1.0.128 • Published 2 years ago

adm-table v1.0.128

Weekly downloads
423
License
-
Repository
-
Last release
2 years 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

2 years ago

1.0.127

2 years ago

1.0.101

3 years ago

1.0.100

3 years ago

1.0.107

3 years ago

1.0.109

3 years ago

1.0.108

3 years ago

1.0.103

3 years ago

1.0.102

3 years ago

1.0.105

3 years ago

1.0.104

3 years ago

1.0.121

3 years ago

1.0.120

3 years ago

1.0.123

3 years ago

1.0.122

3 years ago

1.0.125

2 years ago

1.0.124

2 years ago

1.0.110

3 years ago

1.0.112

3 years ago

1.0.111

3 years ago

1.0.118

3 years ago

1.0.117

3 years ago

1.0.119

3 years ago

1.0.114

3 years ago

1.0.113

3 years ago

1.0.116

3 years ago

1.0.115

3 years ago

1.0.95

3 years ago

1.0.94

3 years ago

1.0.99

3 years ago

1.0.98

3 years ago

1.0.97

3 years ago

1.0.96

3 years ago

1.0.92

4 years ago

1.0.91

4 years ago

1.0.84

4 years ago

1.0.83

4 years ago

1.0.88

4 years ago

1.0.87

4 years ago

1.0.86

4 years ago

1.0.85

4 years ago

1.0.89

4 years ago

1.0.90

4 years ago

1.0.81

4 years ago

1.0.77

4 years ago

1.0.79

4 years ago

1.0.78

4 years ago

1.0.80

4 years ago

1.0.76

4 years ago

1.0.75

4 years ago

1.0.74

4 years ago

1.0.73

4 years ago

1.0.72

4 years ago

1.0.71

4 years ago

1.0.70

4 years ago

1.0.69

4 years ago

1.0.68

4 years ago

1.0.66

5 years ago

1.0.67

5 years ago

1.0.65

5 years ago

1.0.64

5 years ago

1.0.63

5 years ago

1.0.62

5 years ago

1.0.61

5 years ago

1.0.60

5 years ago

1.0.59

5 years ago

1.0.58

5 years ago

1.0.57

5 years ago

1.0.56

5 years ago

1.0.55

5 years ago

1.0.54

5 years ago

1.0.53

5 years ago

1.0.52

5 years ago

1.0.51

5 years ago

1.0.49

5 years ago

1.0.50

5 years ago

1.0.48

5 years ago

1.0.47

5 years ago

1.0.44

5 years ago

1.0.45

5 years ago

1.0.43

5 years ago

1.0.42

5 years ago

1.0.41

5 years ago

1.0.39

5 years ago

1.0.40

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.11

5 years ago

1.0.12

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.3

5 years ago

1.0.0

5 years ago