@patternfly/react-table 5.0.0-alpha.21 → 5.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/deprecated/components/Table/index.d.ts +2 -0
  3. package/deprecated/components/Table/index.d.ts.map +1 -0
  4. package/deprecated/components/Table/index.js +2 -0
  5. package/deprecated/components/Table/index.js.map +1 -0
  6. package/dist/esm/deprecated/components/Table/index.d.ts +2 -0
  7. package/dist/esm/deprecated/components/Table/index.d.ts.map +1 -0
  8. package/dist/esm/deprecated/components/Table/index.js +2 -0
  9. package/dist/esm/deprecated/components/Table/index.js.map +1 -0
  10. package/dist/js/deprecated/components/Table/index.d.ts +2 -0
  11. package/dist/js/deprecated/components/Table/index.d.ts.map +1 -0
  12. package/dist/js/deprecated/components/Table/index.js +5 -0
  13. package/dist/js/deprecated/components/Table/index.js.map +1 -0
  14. package/package.json +3 -3
  15. package/src/components/TableComposable/examples/ComposableTable.md +2 -6
  16. package/src/{components → deprecated/components}/Table/examples/Table.md +2 -8
  17. package/src/deprecated/components/Table/index.ts +1 -0
  18. package/src/docs/demos/Table.md +51 -44
  19. package/src/docs/demos/table-demos/ColumnManagement.jsx +12 -10
  20. /package/src/{components → deprecated/components}/Table/examples/LegacyTableActions.tsx +0 -0
  21. /package/src/{components → deprecated/components}/Table/examples/LegacyTableBasic.tsx +0 -0
  22. /package/src/{components → deprecated/components}/Table/examples/LegacyTableCellWidth.tsx +0 -0
  23. /package/src/{components → deprecated/components}/Table/examples/LegacyTableCompoundExpandable.tsx +0 -0
  24. /package/src/{components → deprecated/components}/Table/examples/LegacyTableControllingText.tsx +0 -0
  25. /package/src/{components → deprecated/components}/Table/examples/LegacyTableEmptyState.tsx +0 -0
  26. /package/src/{components → deprecated/components}/Table/examples/LegacyTableExpandable.tsx +0 -0
  27. /package/src/{components → deprecated/components}/Table/examples/LegacyTableFavoritable.tsx +0 -0
  28. /package/src/{components → deprecated/components}/Table/examples/LegacyTableHoverable.tsx +0 -0
  29. /package/src/{components → deprecated/components}/Table/examples/LegacyTableMisc.tsx +0 -0
  30. /package/src/{components → deprecated/components}/Table/examples/LegacyTableSelectable.tsx +0 -0
  31. /package/src/{components → deprecated/components}/Table/examples/LegacyTableSelectableRadio.tsx +0 -0
  32. /package/src/{components → deprecated/components}/Table/examples/LegacyTableSortable.tsx +0 -0
  33. /package/src/{components → deprecated/components}/Table/examples/LegacyTableSortableCustom.tsx +0 -0
  34. /package/src/{components → deprecated/components}/Table/examples/LegacyTableStriped.tsx +0 -0
  35. /package/src/{components → deprecated/components}/Table/examples/LegacyTableStripedCustomTr.tsx +0 -0
  36. /package/src/{components → deprecated/components}/Table/examples/LegacyTableStripedExpandable.tsx +0 -0
  37. /package/src/{components → deprecated/components}/Table/examples/LegacyTableTextModifiers.tsx +0 -0
  38. /package/src/{components → deprecated/components}/Table/examples/LegacyTableTree.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-alpha.23](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@5.0.0-alpha.22...@patternfly/react-table@5.0.0-alpha.23) (2023-03-03)
7
+
8
+ **Note:** Version bump only for package @patternfly/react-table
9
+
10
+ # [5.0.0-alpha.22](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@5.0.0-alpha.21...@patternfly/react-table@5.0.0-alpha.22) (2023-03-02)
11
+
12
+ ### Bug Fixes
13
+
14
+ - **DataListCheck:** updated onChange param order ([#8735](https://github.com/patternfly/patternfly-react/issues/8735)) ([bf0c2ff](https://github.com/patternfly/patternfly-react/commit/bf0c2ff9a4854f1b879511522746d3d5d2fbb6f1))
15
+
6
16
  # [5.0.0-alpha.21](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@5.0.0-alpha.20...@patternfly/react-table@5.0.0-alpha.21) (2023-03-02)
7
17
 
8
18
  **Note:** Version bump only for package @patternfly/react-table
@@ -0,0 +1,2 @@
1
+ export * from './';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/deprecated/components/Table/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/deprecated/components/Table/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/deprecated/components/Table/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/deprecated/components/Table/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/deprecated/components/Table/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/deprecated/components/Table/index.ts"],"names":[],"mappings":";;;AAAA,6CAAmB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-table",
3
- "version": "5.0.0-alpha.21",
3
+ "version": "5.0.0-alpha.23",
4
4
  "description": "This library provides a set of React table components for use with the PatternFly 4",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -39,7 +39,7 @@
39
39
  "subpaths": "node scripts/copySubpaths.js"
40
40
  },
41
41
  "dependencies": {
42
- "@patternfly/react-core": "^5.0.0-alpha.21",
42
+ "@patternfly/react-core": "^5.0.0-alpha.23",
43
43
  "@patternfly/react-icons": "^5.0.0-alpha.4",
44
44
  "@patternfly/react-styles": "^5.0.0-alpha.4",
45
45
  "@patternfly/react-tokens": "^5.0.0-alpha.4",
@@ -54,5 +54,5 @@
54
54
  "react": "^16.8 || ^17 || ^18",
55
55
  "react-dom": "^16.8 || ^17 || ^18"
56
56
  },
57
- "gitHead": "e0d37bc28421bc0a048bc062714391ba6cf82f54"
57
+ "gitHead": "47ec39c169e68ca9dee8ba1b550f4328d6fb705e"
58
58
  }
@@ -40,13 +40,9 @@ ouia: true
40
40
 
41
41
  Note: Table lives in its own package at [@patternfly/react-table](https://www.npmjs.com/package/@patternfly/react-table)!
42
42
 
43
- PatternFly has two implementations of a React table.
43
+ The `TableComposable` component takes an explicit and declarative approach, and its implementation closely mirrors that of an HTML table.
44
44
 
45
- The first is the newer `TableComposable` component. It takes a more explicit and declarative approach, and its implementation more closely mirrors that of an HTML table. Generally, updates and new feature requests are implemented in the `TableComposable`.
46
-
47
- The second is the original `Table` component. It is configuration based and takes a less declarative and more implicit approach about laying out the table structure, such as the rows and cells within it. The documentation for the older table implementation can be found under the [React legacy](/components/table/react-legacy) tab.
48
-
49
- **For most common use cases, we recommend using `TableComposable`. Both implementations are supported and fully maintained.**
45
+ The documentation for the deprecated table implementation can be found under the [React deprecated](/components/table/react-deprecated) tab. It is configuration based and takes a less declarative and more implicit approach to laying out the table structure, such as the rows and cells within it.
50
46
 
51
47
  import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
52
48
  import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
@@ -6,17 +6,11 @@ propComponents: ['Table', 'TableHeader', 'TableBody', 'ISortBy']
6
6
  ouia: true
7
7
  ---
8
8
 
9
- # Legacy Table
10
-
11
9
  Note: Table lives in its own package at [@patternfly/react-table](https://www.npmjs.com/package/@patternfly/react-table)!
12
10
 
13
- PatternFly has two implementations of a React table.
14
-
15
- The first is the newer `TableComposable` component. It takes a more explicit and declarative approach, and its implementation more closely mirrors that of an html table. Generally, updates and new feature requests are implemented in the `ComposableTable`.
16
-
17
- The second is the original `Table` component. It is configuration based and takes a less declarative and more implicit approach about laying out the table structure, such as the rows and cells within it.
11
+ **This implementation of `Table` has been deprecated. It is no longer supported or maintained.**
18
12
 
19
- **For most common use cases, we recommend using `TableComposable`. Both implementations are supported and fully maintained.**
13
+ This deprecated `Table` component is configuration-based and takes a less declarative and more implicit approach to laying out the table structure, such as the rows and cells within it.
20
14
 
21
15
  import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
22
16
  import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
@@ -0,0 +1 @@
1
+ export * from './';
@@ -98,14 +98,14 @@ class BulkSelectTableDemo extends React.Component {
98
98
  res: rows,
99
99
  selectedItems: isSelected
100
100
  ? [...prevState.selectedItems, id]
101
- : prevState.selectedItems.filter(itemId => itemId !== id)
101
+ : prevState.selectedItems.filter((itemId) => itemId !== id)
102
102
  };
103
103
  });
104
104
  };
105
105
 
106
106
  this.updateSelected = () => {
107
107
  const { res, selectedItems } = this.state;
108
- let rows = res.map(post => {
108
+ let rows = res.map((post) => {
109
109
  post.selected = selectedItems.includes(post.id);
110
110
  return post;
111
111
  });
@@ -115,7 +115,7 @@ class BulkSelectTableDemo extends React.Component {
115
115
  });
116
116
  };
117
117
 
118
- this.handleSelectClick = newState => {
118
+ this.handleSelectClick = (newState) => {
119
119
  if (newState === 'none') {
120
120
  this.setState(
121
121
  {
@@ -125,7 +125,7 @@ class BulkSelectTableDemo extends React.Component {
125
125
  );
126
126
  } else if (newState === 'page') {
127
127
  let newRows = [];
128
- let rows = this.state.res.map(post => {
128
+ let rows = this.state.res.map((post) => {
129
129
  const isSelected = post.selected;
130
130
  newRows = isSelected ? [...newRows] : [...newRows, post.id];
131
131
  post.selected = true;
@@ -150,13 +150,13 @@ class BulkSelectTableDemo extends React.Component {
150
150
  }
151
151
  };
152
152
 
153
- this.onDropDownToggle = isOpen => {
153
+ this.onDropDownToggle = (isOpen) => {
154
154
  this.setState({
155
155
  isDropDownOpen: isOpen
156
156
  });
157
157
  };
158
158
 
159
- this.onDropDownSelect = event => {
159
+ this.onDropDownSelect = (event) => {
160
160
  this.setState((prevState, props) => {
161
161
  return { isDropDownOpen: !prevState.isDropDownOpen };
162
162
  });
@@ -166,10 +166,10 @@ class BulkSelectTableDemo extends React.Component {
166
166
  fetch(page, perPage) {
167
167
  this.setState({ loading: true });
168
168
  fetch(`https://jsonplaceholder.typicode.com/posts?_page=${page}&_limit=${perPage}`)
169
- .then(resp => resp.json())
170
- .then(resp => this.setState({ res: resp, perPage, page, loading: false }))
169
+ .then((resp) => resp.json())
170
+ .then((resp) => this.setState({ res: resp, perPage, page, loading: false }))
171
171
  .then(() => this.updateSelected())
172
- .catch(err => this.setState({ error: err, loading: false }));
172
+ .catch((err) => this.setState({ error: err, loading: false }));
173
173
  }
174
174
 
175
175
  componentDidMount() {
@@ -238,8 +238,7 @@ class BulkSelectTableDemo extends React.Component {
238
238
  </DropdownToggleCheckbox>
239
239
  ]}
240
240
  onToggle={this.onDropDownToggle}
241
- >
242
- </DropdownToggle>
241
+ ></DropdownToggle>
243
242
  }
244
243
  isOpen={isDropDownOpen}
245
244
  dropdownItems={items}
@@ -264,7 +263,7 @@ class BulkSelectTableDemo extends React.Component {
264
263
 
265
264
  render() {
266
265
  const { loading, res } = this.state;
267
- const rows = res.map(post => ({
266
+ const rows = res.map((post) => ({
268
267
  cells: [post.title, post.body],
269
268
  selected: post.selected
270
269
  }));
@@ -304,21 +303,25 @@ class BulkSelectTableDemo extends React.Component {
304
303
  ### Expand/collapse all
305
304
 
306
305
  ```js isFullscreen file="./table-demos/ExpandCollapseAll.jsx"
306
+
307
307
  ```
308
308
 
309
309
  ### Compact
310
310
 
311
311
  ```js isFullscreen file="./table-demos/Compact.jsx"
312
+
312
313
  ```
313
314
 
314
315
  ### Compound expansion
315
316
 
316
317
  ```js isFullscreen file="./table-demos/CompoundExpansion.jsx"
318
+
317
319
  ```
318
320
 
319
321
  ### Column management
320
322
 
321
323
  ```js isFullscreen file="./table-demos/ColumnManagement.jsx"
324
+
322
325
  ```
323
326
 
324
327
  ### Column management with draggable
@@ -642,7 +645,7 @@ class ColumnManagementAction extends React.Component {
642
645
  this.onSelect = this.onSelect.bind(this);
643
646
  this.toggleSelect = this.toggleSelect.bind(this);
644
647
  this.renderModal = this.renderModal.bind(this);
645
- this.matchCheckboxNameToColumn = name => {
648
+ this.matchCheckboxNameToColumn = (name) => {
646
649
  switch (name) {
647
650
  case 'check1':
648
651
  return 'Repositories';
@@ -656,7 +659,7 @@ class ColumnManagementAction extends React.Component {
656
659
  return 'Last commit';
657
660
  }
658
661
  };
659
- this.matchDataListNameToColumn = name => {
662
+ this.matchDataListNameToColumn = (name) => {
660
663
  switch (name) {
661
664
  case 'data1':
662
665
  return 'Repositories';
@@ -673,8 +676,8 @@ class ColumnManagementAction extends React.Component {
673
676
  this.filterData = (checked, name) => {
674
677
  const { rows, columns, filters } = this.state;
675
678
  if (checked) {
676
- const updatedFilters = filters.filter(item => item !== name);
677
- const filteredColumns = this.defaultColumns.filter(column => !updatedFilters.includes(column));
679
+ const updatedFilters = filters.filter((item) => item !== name);
680
+ const filteredColumns = this.defaultColumns.filter((column) => !updatedFilters.includes(column));
678
681
  this.setState({
679
682
  filters: updatedFilters,
680
683
  filteredColumns: filteredColumns
@@ -682,7 +685,7 @@ class ColumnManagementAction extends React.Component {
682
685
  } else {
683
686
  let updatedFilters = filters;
684
687
  updatedFilters.push(name);
685
- const filteredColumns = columns.filter(column => !filters.includes(column));
688
+ const filteredColumns = columns.filter((column) => !filters.includes(column));
686
689
  this.setState({
687
690
  filters: updatedFilters,
688
691
  filteredColumns: filteredColumns
@@ -695,7 +698,7 @@ class ColumnManagementAction extends React.Component {
695
698
  filteredColumns: this.defaultColumns
696
699
  });
697
700
  };
698
- this.handleChange = (checked, event) => {
701
+ this.handleChange = (event, checked) => {
699
702
  const target = event.target;
700
703
  const value = target.type === 'checkbox' ? target.checked : target.value;
701
704
  this.filterData(checked, this.matchCheckboxNameToColumn(target.name));
@@ -709,15 +712,15 @@ class ColumnManagementAction extends React.Component {
709
712
  }));
710
713
  };
711
714
  this.onSave = () => {
712
- const orderedColumns = this.state.itemOrder.map(item => this.matchDataListNameToColumn(item));
715
+ const orderedColumns = this.state.itemOrder.map((item) => this.matchDataListNameToColumn(item));
713
716
  // concat empty string at the end for actions column
714
717
  const filteredOrderedColumns = orderedColumns
715
- .filter(col => this.state.filteredColumns.length === 0 || this.state.filteredColumns.indexOf(col) > -1)
718
+ .filter((col) => this.state.filteredColumns.length === 0 || this.state.filteredColumns.indexOf(col) > -1)
716
719
  .concat(['']);
717
720
  const orderedRows = [];
718
- this.defaultRows.forEach(row => {
721
+ this.defaultRows.forEach((row) => {
719
722
  const updatedCells = row.cells
720
- .filter(cell => filteredOrderedColumns.indexOf(cell.props.column) > -1)
723
+ .filter((cell) => filteredOrderedColumns.indexOf(cell.props.column) > -1)
721
724
  .sort((cellA, cellB) => {
722
725
  const indexA = filteredOrderedColumns.indexOf(cellA.props.column);
723
726
  const indexB = filteredOrderedColumns.indexOf(cellB.props.column);
@@ -740,7 +743,7 @@ class ColumnManagementAction extends React.Component {
740
743
  isModalOpen: !isModalOpen
741
744
  }));
742
745
  };
743
-
746
+
744
747
  this.selectAllColumns = () => {
745
748
  this.unfilterAllData();
746
749
  this.setState({
@@ -752,7 +755,7 @@ class ColumnManagementAction extends React.Component {
752
755
  });
753
756
  };
754
757
 
755
- this.onDragStart = id => {
758
+ this.onDragStart = (id) => {
756
759
  this.setState({
757
760
  id: id,
758
761
  liveText: `Dragging started for item id: ${id}.`
@@ -772,7 +775,7 @@ class ColumnManagementAction extends React.Component {
772
775
  });
773
776
  };
774
777
 
775
- this.onDragFinish = itemOrder => {
778
+ this.onDragFinish = (itemOrder) => {
776
779
  this.setState({
777
780
  liveText: `Dragging finished`,
778
781
  itemOrder
@@ -783,7 +786,7 @@ class ColumnManagementAction extends React.Component {
783
786
  onSelect(event, isSelected, rowId) {
784
787
  let rows;
785
788
  if (rowId === -1) {
786
- rows = this.state.rows.map(oneRow => {
789
+ rows = this.state.rows.map((oneRow) => {
787
790
  oneRow.selected = isSelected;
788
791
  return oneRow;
789
792
  });
@@ -1151,8 +1154,8 @@ class FilterTableDemo extends React.Component {
1151
1154
 
1152
1155
  this.onDelete = (type = '', id = '') => {
1153
1156
  if (type) {
1154
- this.setState(prevState => {
1155
- prevState.filters[type.toLowerCase()] = prevState.filters[type.toLowerCase()].filter(s => s !== id);
1157
+ this.setState((prevState) => {
1158
+ prevState.filters[type.toLowerCase()] = prevState.filters[type.toLowerCase()].filter((s) => s !== id);
1156
1159
  return {
1157
1160
  filters: prevState.filters
1158
1161
  };
@@ -1168,39 +1171,39 @@ class FilterTableDemo extends React.Component {
1168
1171
  }
1169
1172
  };
1170
1173
 
1171
- this.onCategoryToggle = isOpen => {
1174
+ this.onCategoryToggle = (isOpen) => {
1172
1175
  this.setState({
1173
1176
  isCategoryDropdownOpen: isOpen
1174
1177
  });
1175
1178
  };
1176
1179
 
1177
- this.onCategorySelect = event => {
1180
+ this.onCategorySelect = (event) => {
1178
1181
  this.setState({
1179
1182
  currentCategory: event.target.innerText,
1180
1183
  isCategoryDropdownOpen: !this.state.isCategoryDropdownOpen
1181
1184
  });
1182
1185
  };
1183
1186
 
1184
- this.onFilterToggle = isOpen => {
1187
+ this.onFilterToggle = (isOpen) => {
1185
1188
  this.setState({
1186
1189
  isFilterDropdownOpen: isOpen
1187
1190
  });
1188
1191
  };
1189
1192
 
1190
- this.onFilterSelect = event => {
1193
+ this.onFilterSelect = (event) => {
1191
1194
  this.setState({
1192
1195
  isFilterDropdownOpen: !this.state.isFilterDropdownOpen
1193
1196
  });
1194
1197
  };
1195
1198
 
1196
- this.onInputChange = newValue => {
1199
+ this.onInputChange = (newValue) => {
1197
1200
  this.setState({ inputValue: newValue });
1198
1201
  };
1199
1202
 
1200
1203
  this.onRowSelect = (event, isSelected, rowId) => {
1201
1204
  let rows;
1202
1205
  if (rowId === -1) {
1203
- rows = this.state.rows.map(oneRow => {
1206
+ rows = this.state.rows.map((oneRow) => {
1204
1207
  oneRow.selected = isSelected;
1205
1208
  return oneRow;
1206
1209
  });
@@ -1215,24 +1218,24 @@ class FilterTableDemo extends React.Component {
1215
1218
 
1216
1219
  this.onStatusSelect = (event, selection) => {
1217
1220
  const checked = event.target.checked;
1218
- this.setState(prevState => {
1221
+ this.setState((prevState) => {
1219
1222
  const prevSelections = prevState.filters['status'];
1220
1223
  return {
1221
1224
  filters: {
1222
1225
  ...prevState.filters,
1223
- status: checked ? [...prevSelections, selection] : prevSelections.filter(value => value !== selection)
1226
+ status: checked ? [...prevSelections, selection] : prevSelections.filter((value) => value !== selection)
1224
1227
  }
1225
1228
  };
1226
1229
  });
1227
1230
  };
1228
1231
 
1229
- this.onNameInput = event => {
1232
+ this.onNameInput = (event) => {
1230
1233
  if (event.key && event.key !== 'Enter') {
1231
1234
  return;
1232
1235
  }
1233
1236
 
1234
1237
  const { inputValue } = this.state;
1235
- this.setState(prevState => {
1238
+ this.setState((prevState) => {
1236
1239
  const prevFilters = prevState.filters['name'];
1237
1240
  return {
1238
1241
  filters: {
@@ -1245,7 +1248,7 @@ class FilterTableDemo extends React.Component {
1245
1248
  };
1246
1249
 
1247
1250
  this.onLocationSelect = (event, selection) => {
1248
- this.setState(prevState => {
1251
+ this.setState((prevState) => {
1249
1252
  return {
1250
1253
  filters: {
1251
1254
  ...prevState.filters,
@@ -1381,10 +1384,10 @@ class FilterTableDemo extends React.Component {
1381
1384
 
1382
1385
  const filteredRows =
1383
1386
  filters.name.length > 0 || filters.location.length > 0 || filters.status.length > 0
1384
- ? rows.filter(row => {
1387
+ ? rows.filter((row) => {
1385
1388
  return (
1386
1389
  (filters.name.length === 0 ||
1387
- filters.name.some(name => row.cells[0].toLowerCase().includes(name.toLowerCase()))) &&
1390
+ filters.name.some((name) => row.cells[0].toLowerCase().includes(name.toLowerCase()))) &&
1388
1391
  (filters.location.length === 0 || filters.location.includes(row.cells[5])) &&
1389
1392
  (filters.status.length === 0 || filters.status.includes(row.cells[4]))
1390
1393
  );
@@ -1460,6 +1463,7 @@ class FilterTableDemo extends React.Component {
1460
1463
  ### Sortable - responsive
1461
1464
 
1462
1465
  ```js isFullscreen file="./table-demos/SortableResponsive.jsx"
1466
+
1463
1467
  ```
1464
1468
 
1465
1469
  ### Automatic pagination
@@ -1546,7 +1550,7 @@ class ComplexPaginationTableDemo extends React.Component {
1546
1550
  }
1547
1551
 
1548
1552
  render() {
1549
- const rows = this.state.rows.map(row => ({ cells: row.cells }));
1553
+ const rows = this.state.rows.map((row) => ({ cells: row.cells }));
1550
1554
  return (
1551
1555
  <React.Fragment>
1552
1556
  {this.renderPagination()}
@@ -1563,6 +1567,7 @@ class ComplexPaginationTableDemo extends React.Component {
1563
1567
  ### Static bottom pagination on mobile
1564
1568
 
1565
1569
  ```js isFullscreen file="table-demos/StaticBottomPagination.jsx"
1570
+
1566
1571
  ```
1567
1572
 
1568
1573
  ### Sticky header
@@ -1575,7 +1580,7 @@ import { rows } from '../examples/Data.jsx';
1575
1580
 
1576
1581
  class StickyHeaderTableDemo extends React.Component {
1577
1582
  render() {
1578
- const renderLabel = labelText => {
1583
+ const renderLabel = (labelText) => {
1579
1584
  switch (labelText) {
1580
1585
  case 'Running':
1581
1586
  return <Label color="green">{labelText}</Label>;
@@ -1603,7 +1608,7 @@ class StickyHeaderTableDemo extends React.Component {
1603
1608
  { title: 'Last Modified', transforms: [cellWidth(15)] },
1604
1609
  { title: 'URL', transforms: [cellWidth(10)] }
1605
1610
  ]}
1606
- rows={rows.map(row => [
1611
+ rows={rows.map((row) => [
1607
1612
  row.name,
1608
1613
  row.threads,
1609
1614
  row.applications,
@@ -1636,6 +1641,7 @@ class StickyHeaderTableDemo extends React.Component {
1636
1641
  ### Sticky first column
1637
1642
 
1638
1643
  ```js isFullscreen file="./table-demos/StickyFirstColumn.jsx"
1644
+
1639
1645
  ```
1640
1646
 
1641
1647
  ### Sticky columns and header with toolbar
@@ -1643,6 +1649,7 @@ class StickyHeaderTableDemo extends React.Component {
1643
1649
  A toolbar may be added above a sticky table either inside or outside the `OuterScrollContainer`.
1644
1650
 
1645
1651
  ```ts isFullscreen file="../examples/ComposableTableStickyToolbar.tsx"
1652
+
1646
1653
  ```
1647
1654
 
1648
1655
  ## Empty states
@@ -45,7 +45,7 @@ export const ColumnManagementAction = () => {
45
45
  const [perPage, setPerPage] = React.useState(10);
46
46
  const [paginatedRows, setPaginatedRows] = React.useState(rows);
47
47
 
48
- const matchCheckboxNameToColumn = name => {
48
+ const matchCheckboxNameToColumn = (name) => {
49
49
  switch (name) {
50
50
  case 'check1':
51
51
  return 'Servers';
@@ -65,7 +65,7 @@ export const ColumnManagementAction = () => {
65
65
  return 'URL';
66
66
  }
67
67
  };
68
- const matchSelectedColumnNameToAttr = name => {
68
+ const matchSelectedColumnNameToAttr = (name) => {
69
69
  switch (name) {
70
70
  case 'Servers':
71
71
  return 'name';
@@ -127,15 +127,15 @@ export const ColumnManagementAction = () => {
127
127
 
128
128
  const filteredRows = [];
129
129
  if (checked) {
130
- const updatedFilters = filters.filter(item => item !== selectedColumn);
130
+ const updatedFilters = filters.filter((item) => item !== selectedColumn);
131
131
 
132
132
  // Only show the names of columns that were selected in the modal
133
133
  const filteredColumns = defaultColumns.filter(
134
- column => !updatedFilters.includes(matchSelectedColumnNameToAttr(column))
134
+ (column) => !updatedFilters.includes(matchSelectedColumnNameToAttr(column))
135
135
  );
136
136
 
137
137
  // Remove the attributes (i.e. "columns") that were not selected
138
- defaultRows.forEach(item => filteredRows.push(removePropFromObject(item, updatedFilters)));
138
+ defaultRows.forEach((item) => filteredRows.push(removePropFromObject(item, updatedFilters)));
139
139
 
140
140
  setFilters(updatedFilters);
141
141
  setFilteredColumns(filteredColumns);
@@ -145,10 +145,12 @@ export const ColumnManagementAction = () => {
145
145
  updatedFilters.push(selectedColumn);
146
146
 
147
147
  // Only show the names of columns that were selected in the modal
148
- const filteredColumns = managedColumns.filter(column => !filters.includes(matchSelectedColumnNameToAttr(column)));
148
+ const filteredColumns = managedColumns.filter(
149
+ (column) => !filters.includes(matchSelectedColumnNameToAttr(column))
150
+ );
149
151
 
150
152
  // Remove the attributes (i.e. "columns") that were not selected
151
- managedRows.forEach(item => filteredRows.push(removePropFromObject(item, updatedFilters)));
153
+ managedRows.forEach((item) => filteredRows.push(removePropFromObject(item, updatedFilters)));
152
154
 
153
155
  setFilters(updatedFilters);
154
156
  setFilteredColumns(filteredColumns);
@@ -161,13 +163,13 @@ export const ColumnManagementAction = () => {
161
163
  setFilteredRows(defaultRows);
162
164
  };
163
165
 
164
- const handleChange = (checked, event) => {
166
+ const handleChange = (event, checked) => {
165
167
  const target = event.target;
166
168
  const value = target.type === 'checkbox' ? target.checked : target.value;
167
169
 
168
170
  // Remove any columns from the table that aren't checked
169
171
  filterData(checked, matchCheckboxNameToColumn(target.name));
170
- const checkedIndex = columns.findIndex(element => element === matchCheckboxNameToColumn(target.name));
172
+ const checkedIndex = columns.findIndex((element) => element === matchCheckboxNameToColumn(target.name));
171
173
 
172
174
  const updatedCheckedState = [...checkedState];
173
175
  updatedCheckedState[checkedIndex] = value;
@@ -364,7 +366,7 @@ export const ColumnManagementAction = () => {
364
366
  );
365
367
  };
366
368
 
367
- const renderLabel = labelText => {
369
+ const renderLabel = (labelText) => {
368
370
  switch (labelText) {
369
371
  case 'Running':
370
372
  return <Label color="green">{labelText}</Label>;