Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

material-inline-operation-table

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

material-inline-operation-table

An extension for mui table with add,update and delete features, allowing free style inline form

  • 3.2.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-98.46%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 22 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc