1.0.128 • Published 1 year ago

adm-table v1.0.128

Weekly downloads
423
License
-
Repository
-
Last release
1 year ago

adm-table

A Datatable for React.

Based on react-table

Instalation

npm i --save adm-table

Documentation

Also some fields supports from react-table

AdmTable

  • title: string
    • Table title
  • data: array
    • Required
    • Table data
  • columns: array
    • Required
    • Table columns
  • editable: object
    • Table default actions
    • isAddDisabled: func(props)
      • Disable add action if return true
    • isUpdateDisabled: func(props)
      • Disable update action if return true
    • isDeleteDisabled: func(props)
      • Disable delete action if return true
    • isAddHidden: func(props)
      • Hide add action if return true
    • isUpdateHidden: func(props)
      • Hide update action if return true
    • isDeleteHidden: func(props)
      • Hide delete action if return true
    • onRowAdd: async func(newData, oldData, rowData)
      • On row add callback
    • onRowUpdate: async func(newData, oldData, rowData)
      • On row update callback
    • onRowDelete: async func(newData, oldData, rowData)
      • On row delete callback
  • actions: array|func(props)
    • Table custom actions
    • isDisabled: bool
      • Disable action
    • isHidden: bool
      • Show action
    • icon: string
    • isToolbarAction: bool
      • Show action in toolbar
    • onClick: func(event, row)
      • On click action callback
    • tooltip: string
      • Show action tooltip
    • customRender: func(row)
      • Custom action render
  • style: object
    • Set table styles
  • onAcceptRowEditing: func
    • Trigger on accept row editing
  • onCancelRowEditing: func
    • Triger on cancel row editing
  • onRowClick: func(rowData)
    • Triger on row click
  • onRowClickAction: string
    • update
      • Update clicked row
    • delete
      • Delete clicked row
    • click
      • Handle on click row
    • Default click
  • filterValue: string
    • Set filter value
  • editProps: func(rowData)
    • Return edit data
  • onChangeRowsPerPage: func(value)
    • Triger on change rows per page
  • isLoading: bool
    • Show loading indicator
    • Default false
  • externalState: object
    • Pass external state object
    • Default {}
  • localization: object
    • Set table localiazation strings
    • search: string
      • Default Search
    • actions: string
      • Default Action
    • add: string
      • Default Add
    • edit: string
      • Default Edit
    • delete: string
      • Default Delete
    • rows: string
      • Default Rows
    • rowsPerPage: string
      • Default Rows per page
  • options: object
    • Set table options
    • isShowToolbar: bool
      • Show table toolbar
      • Default: true
    • isShowPagination: bool
      • Show table pagination
      • Default: true
    • isShowSearch: bool
      • Show table global search
      • Default: true
    • isSorting: bool
      • Show column sorting icon
      • Default: true
    • isFiltering: bool
      • Show column filtering
      • Default: false
    • isDensePaddings: bool
      • Table dense paddings
      • Default: false
    • isAllBorders: bool
      • Add borders for cells
      • Default: false
    • cellStyles: func(props)
      • Custom cell styles
      • Default: {}
    • rowStyles: func(props)
      • Custom row styles
      • Default: {}
    • pageSize: number
      • Set rows per page
      • Default: 10
    • pageSizeOptions: array
  • isValid: bool
    • Check is edit data valid
  • validationErrorMessage: string
    • Show message if isValid is false
  • tableRef: element

    • Get table container ref

Columns

  • title: string
    • Required
    • Show column title
  • field: string
    • Required
    • Get field from data and render it
  • hideFiltering: bool
    • Hider filter from column
  • width: number|string
    • Column width
  • editableWidth: number|string
    • Set edit mode field width
  • editableStyles: object:
    • Set edit mode field styles
  • filter: string|func(rows, id, filterValue)
    • Set custom or predefined filter
  • tooltip: string
    • Show column title tooltip
  • editable: string
    • always
      • Always show field in edit mode
    • never
      • Never show field in edit mode
    • onAdd
      • Show field only on add
    • onEdit
      • Show filed only on edit
    • Default always
  • emptyValue: string|number
    • Show if data value is empty
  • type: string
    • bool
      • Show checbox input for field
    • number
      • Show number input for field
    • date
      • Show date input for field
    • datetime
      • Show datetime input for field
    • time
      • Show time input for field
    • color
      • Show color picker for field
  • defaultValue: number|string
    • Sets default field value
  • isRequired: bool
    • Mark as required field in edit mode
  • customRender: func(props)
    • Must return jsx. Custom render cells data
  • customEditRender: func(props)
    • Must return jsx. Custom render edit cells data
  • columns: array
    • Used for multiple columns. Allow all fields from column
  • cellStyle: object
    • Set cell styles
  • headerStyle: object
    • Set header styles
  • columnStyle: object
    • Set column styles
  • lookup: object
    • Show select input for field
    • format { value: title }
  • ampm: bool
    • Show time in ampm format
    • Default: true
1.0.128

1 year ago

1.0.127

1 year ago

1.0.101

2 years ago

1.0.100

2 years ago

1.0.107

2 years ago

1.0.109

1 year ago

1.0.108

1 year ago

1.0.103

2 years ago

1.0.102

2 years ago

1.0.105

2 years ago

1.0.104

2 years ago

1.0.121

1 year ago

1.0.120

1 year ago

1.0.123

1 year ago

1.0.122

1 year ago

1.0.125

1 year ago

1.0.124

1 year ago

1.0.110

1 year ago

1.0.112

1 year ago

1.0.111

1 year ago

1.0.118

1 year ago

1.0.117

1 year ago

1.0.119

1 year ago

1.0.114

1 year ago

1.0.113

1 year ago

1.0.116

1 year ago

1.0.115

1 year ago

1.0.95

2 years ago

1.0.94

2 years ago

1.0.99

2 years ago

1.0.98

2 years ago

1.0.97

2 years ago

1.0.96

2 years ago

1.0.92

3 years ago

1.0.91

3 years ago

1.0.84

3 years ago

1.0.83

3 years ago

1.0.88

3 years ago

1.0.87

3 years ago

1.0.86

3 years ago

1.0.85

3 years ago

1.0.89

3 years ago

1.0.90

3 years ago

1.0.81

3 years ago

1.0.77

3 years ago

1.0.79

3 years ago

1.0.78

3 years ago

1.0.80

3 years ago

1.0.76

3 years ago

1.0.75

3 years ago

1.0.74

3 years ago

1.0.73

3 years ago

1.0.72

3 years ago

1.0.71

3 years ago

1.0.70

3 years ago

1.0.69

3 years ago

1.0.68

3 years ago

1.0.66

3 years ago

1.0.67

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago

1.0.63

3 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.55

4 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.51

4 years ago

1.0.49

4 years ago

1.0.50

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.44

4 years ago

1.0.45

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.39

4 years ago

1.0.40

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.12

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.1

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago