3.2.3 • Published 2 years ago

material-inline-operation-table v3.2.3

Weekly downloads
372
License
MIT
Repository
-
Last release
2 years ago

Material Inline Operation Table

This package can be used in your react applications to manage some table data. You can perform add,update and delete operations with this package.

This package uses standart mui table of react.

Installation

You can use standart npm package installation

npm i material-inline-operation-table

Usage

class InlineTableClass extends Component {
  constructor(props) {
    //...
  }

  //your other code here...

  headRows = [
    {
      id: "someId",
      numeric: false,
      disablePadding: false,
      label: "label for someId", // this value will be seen in coumn header
      type: "string", //can be string,date,chip,icon,currency,number,bool or component
      width : 10 //formatted as number, is not applied for actions column. Total number of width must be 100
    },
    /*your other column sets here*/
    { id: "actions", numeric: true, disablePadding: false, label: "" }, //this must exist
  ];


  render() {
    return (
      <React.Fragment>
        <InlineTable
          //..........
        />
      </React.Fragment>
    );
  }
}

Parameters

ParameterRequiredDefault ValueDescription
fetchDataMethodtrue-api method for getting table data
fetchDataMethodParametertrue-parameters of api method data
headRowstrue-column definitions of the table
deleteMethodtrue-api method for deleting table data
saveMethodtrue-api method for update table data
addMethodtrue-api method for insert table data
inlineFormtrue-free style react component which will appear when user wants to add a new record or update an existing record
emptyModeltrue-will be the initial values when user wants to add new record
tableNametrue-name will appear in table heading
tableIdtrue-id representing the table
showButtonstrue-define wihch buttons will appear (add,update,delete, csv, print, refresh,filterBar or columnsBar ) Ex. Format : { add: true, edit: false, delete: true, csv: true, search: true, refresh : true, filterBar : true, columnsBar : true, print : true}
allowPaginationtrue-whether the pagination will be applied , true or false
onRowSelectedfalsenullaction triggered on row click Ex. Format : (e, row) => { console.log(e,row); }
identifierColumntrue-this column will use for identifying row for selection
onAllButtonClickfalsenull-
tableSizefalse"medium"define table size "small","medium" or "large"
operationMessagesfalse{ add: { toolTip: "Yeni Kayıt", success: "Ekleme işlemi başarılı", fail: "Ekleme işlemi başarısız", }, update: { toolTip: "Düzenle", success: "Düzenleme işlemi başarılı", fail: "Düzenleme işlemi başarısız", }, delete: { toolTip: "Sil", onDeletePopup: "Kayıt silinecektir. Onaylıyor musunuz?", success: "Silme işlemi başarılı", fail: "Silme işlemi başarısız", }, general: { unexpectedError: "Beklenmeyen bir hata oluştu", confirm: "Onayla", cancel: "Vazgeç",columnsPopUp : "Sütunları Göster",selectAll : "Hepsi" }, }operation messages and tooltip definitions can be done with this parameter
containerNamefalse"material_inline_operation_table"used for naming the buttons of table and its rows
boolColumnLabelsfalse{ true: "Evet", false: "Hayır" }text will appear when column type is selected as "bool"
kafkaUsagefalse{ addMethod : false, saveMethod : false, deleteMethod : false }define whether kafka integration is made any of operations.
signalRNotificationComponentfalsenullfree style signalR notification component for connecting signalR hub
setBlockingfalsenullused for blocking the screen when kafka usage exists
isConnectionAlivefalsetruewhen kafka is used and signalR connection exists, the table will be rendered
signalRNotificationComponentPropsfalsenullparameters of signalRNotificationComponent. Ex. Usage : { methodName : "signalRMethodName", setConnectionStatus : (status) => {console.log(status);}, onMessage : (message) => {console.log(message);} }
initializeTransactionfalsenullis used for defining transactionID for the row currently operated on. Ex. Usage : initializeTransaction(row) { const transactionID = uuidv4(); this.setState({...this.state,islemKod:transactionID}); row.islemKod = transactionID; }
forceStopCountfalse0is used for re-rendering the table. Defined for kafka usage
defaultOrderColumnfalsenulldefine default column to be ordered by. if null, identifiercolumn is used
defaultOrderWayfalse"asc"define default order way for ordering. "asc" or "desc"
defaultRowsPerPagefalse10define value of rows per page. 5,10,25,50 or 100
rowsMaxHeightfalse1000define max length of table in px.
rowHeightfalse80define length of table in px.
customComponentsfalsenullcustomComponent renderer for the column. column type should be set to "component". the parameter format should be a list of objects in format : {id : "the id which should match the column id", component : free style React component ,params : parameters used by free style component, getParamsFromRow : the list of parameter names which should be get from the identifier column value of the row }

Internationalization

You can pass "intl" object as props to use internationalization. In your API, the methods you use must return a JSON object containing "success" and "errorId" fields.

Like this :

{
  ...
  "success" : true or false,
  "errorId" : "A message contained in your language file"
  ...
}

License

MIT

3.2.2

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.2.3

2 years ago

3.1.9

2 years ago

3.1.8

3 years ago

3.1.7

3 years ago

3.1.6

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.5

3 years ago

3.1.4

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.7

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago