pixelize-design-library 1.1.17 → 1.1.19

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.
@@ -52,7 +52,8 @@ var selectionCellColumn = {
52
52
  className: "select-cell",
53
53
  };
54
54
  var KaTable = function (_a) {
55
- var columns = _a.columns, data = _a.data, _b = _a.rowKey, rowKey = _b === void 0 ? "id" : _b, Edit = _a.Edit,
55
+ var _b;
56
+ var columns = _a.columns, data = _a.data, _c = _a.rowKey, rowKey = _c === void 0 ? "id" : _c, Edit = _a.Edit,
56
57
  // sorting,
57
58
  format = _a.format,
58
59
  // paging,
@@ -61,7 +62,8 @@ var KaTable = function (_a) {
61
62
  !columns.some(function (column) { return column.key === "select-cell"; })) {
62
63
  columns.unshift(selectionCellColumn);
63
64
  }
64
- var mergedChildComponents = (0, useMergedChildComponents_1.default)(childComponents, onSortChange, onMenuItemClick, menuItems, onSelectionChange, rowKey, onRowClick, selected, data.length);
65
+ var dataLength = (_b = data === null || data === void 0 ? void 0 : data.length) !== null && _b !== void 0 ? _b : 0;
66
+ var mergedChildComponents = (0, useMergedChildComponents_1.default)(childComponents, onSortChange, onMenuItemClick, menuItems, onSelectionChange, rowKey, onRowClick, selected, dataLength);
65
67
  return (react_1.default.createElement(ka_table_1.Table, { columns: columns, data: data, rowKeyField: rowKey, editingMode: Edit,
66
68
  // sortingMode={sorting}
67
69
  format: format,
@@ -61,8 +61,8 @@ var useMergedChildComponents = function (childComponents, onSortChange, onMenuIt
61
61
  var _a = react_1.default.useState(selected), selections = _a[0], setSelections = _a[1];
62
62
  var isAllSelected = (0, react_1.useMemo)(function () {
63
63
  return {
64
- checked: selections.length === dataLength,
65
- intederminate: selections.length > 0 && selections.length < dataLength,
64
+ checked: (selections === null || selections === void 0 ? void 0 : selections.length) === dataLength,
65
+ intederminate: (selections === null || selections === void 0 ? void 0 : selections.length) > 0 && (selections === null || selections === void 0 ? void 0 : selections.length) < dataLength,
66
66
  };
67
67
  }, [selections, dataLength]);
68
68
  var cellSelectionHandle = (0, react_1.useCallback)(function (values, type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",