@geotab/zenith 3.10.0-beta.3 → 3.10.0-beta.4

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 (107) hide show
  1. package/README.md +9 -1
  2. package/dist/commonStyles/pillStyles/pillContent.less +9 -9
  3. package/dist/commonStyles/pillStyles/pillStyles.less +2 -2
  4. package/dist/dataGrid/cell/cell.d.ts +2 -1
  5. package/dist/dataGrid/cell/cell.js +2 -2
  6. package/dist/dataGrid/dataGrid.js +6 -4
  7. package/dist/dataGrid/listColumn.d.ts +2 -0
  8. package/dist/dataGrid/row/row.js +11 -7
  9. package/dist/dataGrid/withFlexibleColumns/components/columnSettingsList.js +2 -1
  10. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +4 -0
  11. package/dist/dateRangeRaw/utils/parseLabel.js +1 -1
  12. package/dist/dropdownRaw/dropdownList.d.ts +1 -2
  13. package/dist/dropdownRaw/dropdownList.js +2 -7
  14. package/dist/dropdownRaw/dropdownRaw.js +12 -7
  15. package/dist/filtersBar/filtersContainer/filtersContainer.js +14 -4
  16. package/dist/index.css +690 -653
  17. package/dist/radioGroupRaw/radioGroupRaw.js +2 -1
  18. package/dist/selectList/selectList.helpers.d.ts +1 -1
  19. package/dist/selectList/selectList.helpers.js +31 -6
  20. package/dist/selectList/selectList.js +3 -1
  21. package/dist/selectList/selectList.reducer.js +1 -2
  22. package/dist/sortControl/sortControl.js +58 -2
  23. package/dist/table/children/useTableChildren.d.ts +1 -1
  24. package/dist/table/children/useTableChildren.js +3 -3
  25. package/dist/table/flexible/columnsList.js +4 -2
  26. package/dist/table/selectable/useSelectableRows.d.ts +8 -0
  27. package/dist/table/selectable/useSelectableRows.js +14 -6
  28. package/dist/table/table.js +1 -7
  29. package/dist/utils/localization/translations/ar.json +3 -1
  30. package/dist/utils/localization/translations/cs.json +3 -1
  31. package/dist/utils/localization/translations/da-DK.json +3 -1
  32. package/dist/utils/localization/translations/de.json +3 -1
  33. package/dist/utils/localization/translations/en.json +3 -1
  34. package/dist/utils/localization/translations/es.json +3 -1
  35. package/dist/utils/localization/translations/fi-FI.json +3 -1
  36. package/dist/utils/localization/translations/fr-FR.json +3 -1
  37. package/dist/utils/localization/translations/fr.json +3 -1
  38. package/dist/utils/localization/translations/hu-HU.json +3 -1
  39. package/dist/utils/localization/translations/id.json +3 -1
  40. package/dist/utils/localization/translations/it.json +3 -1
  41. package/dist/utils/localization/translations/ja.json +3 -1
  42. package/dist/utils/localization/translations/ko-KR.json +3 -1
  43. package/dist/utils/localization/translations/ms.json +3 -1
  44. package/dist/utils/localization/translations/nb-NO.json +3 -1
  45. package/dist/utils/localization/translations/nl.json +3 -1
  46. package/dist/utils/localization/translations/pl.json +3 -1
  47. package/dist/utils/localization/translations/pt-BR.json +3 -1
  48. package/dist/utils/localization/translations/pt-PT.json +3 -1
  49. package/dist/utils/localization/translations/ro-RO.json +3 -1
  50. package/dist/utils/localization/translations/sk-SK.json +3 -1
  51. package/dist/utils/localization/translations/sv.json +3 -1
  52. package/dist/utils/localization/translations/th.json +3 -1
  53. package/dist/utils/localization/translations/tr.json +3 -1
  54. package/dist/utils/localization/translations/zh-Hans.json +3 -1
  55. package/dist/utils/localization/translations/zh-TW.json +3 -1
  56. package/esm/dataGrid/cell/cell.d.ts +2 -1
  57. package/esm/dataGrid/cell/cell.js +2 -2
  58. package/esm/dataGrid/dataGrid.js +6 -4
  59. package/esm/dataGrid/listColumn.d.ts +2 -0
  60. package/esm/dataGrid/row/row.js +11 -7
  61. package/esm/dataGrid/withFlexibleColumns/components/columnSettingsList.js +2 -1
  62. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +4 -0
  63. package/esm/dateRangeRaw/utils/parseLabel.js +1 -1
  64. package/esm/dropdownRaw/dropdownList.d.ts +1 -2
  65. package/esm/dropdownRaw/dropdownList.js +2 -7
  66. package/esm/dropdownRaw/dropdownRaw.js +12 -7
  67. package/esm/filtersBar/filtersContainer/filtersContainer.js +14 -4
  68. package/esm/radioGroupRaw/radioGroupRaw.js +2 -1
  69. package/esm/selectList/selectList.helpers.d.ts +1 -1
  70. package/esm/selectList/selectList.helpers.js +31 -6
  71. package/esm/selectList/selectList.js +3 -1
  72. package/esm/selectList/selectList.reducer.js +1 -2
  73. package/esm/sortControl/sortControl.js +58 -2
  74. package/esm/table/children/useTableChildren.d.ts +1 -1
  75. package/esm/table/children/useTableChildren.js +3 -3
  76. package/esm/table/flexible/columnsList.js +4 -2
  77. package/esm/table/selectable/useSelectableRows.d.ts +8 -0
  78. package/esm/table/selectable/useSelectableRows.js +14 -6
  79. package/esm/table/table.js +1 -7
  80. package/esm/utils/localization/translations/ar.json +3 -1
  81. package/esm/utils/localization/translations/cs.json +3 -1
  82. package/esm/utils/localization/translations/da-DK.json +3 -1
  83. package/esm/utils/localization/translations/de.json +3 -1
  84. package/esm/utils/localization/translations/en.json +3 -1
  85. package/esm/utils/localization/translations/es.json +3 -1
  86. package/esm/utils/localization/translations/fi-FI.json +3 -1
  87. package/esm/utils/localization/translations/fr-FR.json +3 -1
  88. package/esm/utils/localization/translations/fr.json +3 -1
  89. package/esm/utils/localization/translations/hu-HU.json +3 -1
  90. package/esm/utils/localization/translations/id.json +3 -1
  91. package/esm/utils/localization/translations/it.json +3 -1
  92. package/esm/utils/localization/translations/ja.json +3 -1
  93. package/esm/utils/localization/translations/ko-KR.json +3 -1
  94. package/esm/utils/localization/translations/ms.json +3 -1
  95. package/esm/utils/localization/translations/nb-NO.json +3 -1
  96. package/esm/utils/localization/translations/nl.json +3 -1
  97. package/esm/utils/localization/translations/pl.json +3 -1
  98. package/esm/utils/localization/translations/pt-BR.json +3 -1
  99. package/esm/utils/localization/translations/pt-PT.json +3 -1
  100. package/esm/utils/localization/translations/ro-RO.json +3 -1
  101. package/esm/utils/localization/translations/sk-SK.json +3 -1
  102. package/esm/utils/localization/translations/sv.json +3 -1
  103. package/esm/utils/localization/translations/th.json +3 -1
  104. package/esm/utils/localization/translations/tr.json +3 -1
  105. package/esm/utils/localization/translations/zh-Hans.json +3 -1
  106. package/esm/utils/localization/translations/zh-TW.json +3 -1
  107. package/package.json +2 -1
@@ -89,7 +89,8 @@ const RadioGroupRaw = (props) => {
89
89
  "zen-radio-group__item",
90
90
  wrappedInLabel ? "zen-radio-group__item--no-paddings" : "",
91
91
  type === "interactive" ? "zen-radio--interactive" : "",
92
- size === "small" ? "zen-radio-group__item--small" : ""
92
+ size === "small" ? "zen-radio-group__item--small" : "",
93
+ direction === "horizontal" ? "zen-radio--align-start" : ""
93
94
  ]), key: ind, checked: item.value === value, disabled: disabled ? disabled : item.disabled, name: name, reverse: reverse, fullWidth: fullWidth, value: item.value, onChange: onChangeInner, wrappedInLabel: wrappedInLabel, tabIndex: selectItemOnFocus || disabled || item.disabled ? undefined : ind === focusedIndex ? 0 : -1, ref: selectItemOnFocus ? undefined : ind === focusedIndex ? focusElementRef : undefined, role: itemRole }), item.children) }, `${ind}-li`))) })) }));
94
95
  };
95
96
  exports.RadioGroupRaw = RadioGroupRaw;
@@ -5,7 +5,7 @@ export declare const getItemIdByIndex: (state: Map<string, CheckboxState>, index
5
5
  export declare const getItemIndexById: (state: Map<string, CheckboxState>, id: string) => number;
6
6
  export declare const updateItemState: (initialState: Map<string, CheckboxState>, multiselect: boolean, updatedId: string, newState: CheckboxState) => [Map<string, CheckboxState>, boolean];
7
7
  export declare const searchItemIndex: (items: ISelectListItem[], searchStr: string) => number;
8
- export declare const getFirstIndex: (items: ISelectListItem[]) => 0 | -1;
8
+ export declare const getFirstIndex: (items: ISelectListItem[]) => number;
9
9
  export declare const getLastIndex: (items: ISelectListItem[]) => number;
10
10
  export declare const getNextIndex: (currIndex: number, items: ISelectListItem[]) => number;
11
11
  export declare const getPrevIndex: (currIndex: number, items: ISelectListItem[]) => number;
@@ -42,31 +42,56 @@ const searchItemIndex = (items, searchStr) => {
42
42
  });
43
43
  };
44
44
  exports.searchItemIndex = searchItemIndex;
45
- const getFirstIndex = (items) => (items.length > 0 ? 0 : -1);
45
+ const getFirstIndex = (items) => items.findIndex(item => !item.disabled);
46
46
  exports.getFirstIndex = getFirstIndex;
47
- const getLastIndex = (items) => (items.length > 0 ? items.length - 1 : -1);
47
+ const getLastIndex = (items) => {
48
+ for (let i = items.length - 1; i >= 0; i--) {
49
+ if (!items[i].disabled) {
50
+ return i;
51
+ }
52
+ }
53
+ return -1;
54
+ };
48
55
  exports.getLastIndex = getLastIndex;
49
56
  const getNextIndex = (currIndex, items) => {
57
+ var _a;
50
58
  if (items.length === 0) {
51
59
  return -1;
52
60
  }
53
- return currIndex + 1 >= items.length ? 0 : currIndex + 1;
61
+ let nextIndex = currIndex + 1 >= items.length ? 0 : currIndex + 1;
62
+ const startIndex = nextIndex;
63
+ while ((_a = items[nextIndex]) === null || _a === void 0 ? void 0 : _a.disabled) {
64
+ nextIndex = nextIndex + 1 >= items.length ? 0 : nextIndex + 1;
65
+ if (nextIndex === startIndex) {
66
+ return currIndex;
67
+ }
68
+ }
69
+ return nextIndex;
54
70
  };
55
71
  exports.getNextIndex = getNextIndex;
56
72
  const getPrevIndex = (currIndex, items) => {
73
+ var _a;
57
74
  if (items.length === 0) {
58
75
  return -1;
59
76
  }
60
- return currIndex <= 0 || currIndex >= items.length ? items.length - 1 : currIndex - 1;
77
+ let prevIndex = currIndex <= 0 || currIndex >= items.length ? items.length - 1 : currIndex - 1;
78
+ const startIndex = prevIndex;
79
+ while ((_a = items[prevIndex]) === null || _a === void 0 ? void 0 : _a.disabled) {
80
+ prevIndex = prevIndex <= 0 ? items.length - 1 : prevIndex - 1;
81
+ if (prevIndex === startIndex) {
82
+ return currIndex;
83
+ }
84
+ }
85
+ return prevIndex;
61
86
  };
62
87
  exports.getPrevIndex = getPrevIndex;
63
88
  const getFirstActiveIndex = (state, items, multiselect) => {
64
89
  for (let i = 0; i < items.length; i++) {
65
- if (state.get(items[i].id) === checkboxState_1.CheckboxState.On) {
90
+ if (!items[i].disabled && state.get(items[i].id) === checkboxState_1.CheckboxState.On) {
66
91
  return i;
67
92
  }
68
93
  }
69
- return multiselect && items.length > 0 ? 0 : -1;
94
+ return multiselect ? items.findIndex(item => !item.disabled) : -1;
70
95
  };
71
96
  exports.getFirstActiveIndex = getFirstActiveIndex;
72
97
  const getItemsState = (items, value, multiselect) => {
@@ -51,7 +51,9 @@ const SelectList = (_a) => {
51
51
  if (!multiselect && selectItemOnFocus) {
52
52
  dispatchState({ type: selectList_actionTypes_1.ListAction.FocusFirst, payload: { items } });
53
53
  }
54
- dispatchState({ type: selectList_actionTypes_1.ListAction.Focus, payload: { items, multiselect } });
54
+ if (!multiselect) {
55
+ dispatchState({ type: selectList_actionTypes_1.ListAction.Focus, payload: { items, multiselect } });
56
+ }
55
57
  }, [multiselect, items, selectItemOnFocus]);
56
58
  (0, react_2.useEffect)(() => {
57
59
  onChange && state.isItemsStateChanged && onChange(new Map(state.itemsState));
@@ -120,8 +120,7 @@ const selectListReducer = (state, action) => {
120
120
  newItemsState = updatedState;
121
121
  });
122
122
  const prevActiveItemId = (0, selectList_helpers_1.getItemIdByIndex)(state.itemsState, state.activeIndex);
123
- const newActiveItemIndex = !!prevActiveItemId && (0, selectList_helpers_1.getItemIndexById)(newItemsState, prevActiveItemId);
124
- const activeIndex = newActiveItemIndex ? newActiveItemIndex : -1;
123
+ const activeIndex = prevActiveItemId !== undefined ? (0, selectList_helpers_1.getItemIndexById)(newItemsState, prevActiveItemId) : -1;
125
124
  return Object.assign(Object.assign({}, state), { itemsState: newItemsState, activeIndex, isItemsStateChanged: false });
126
125
  }
127
126
  case selectList_actionTypes_1.ListAction.SetLevel: {
@@ -66,6 +66,60 @@ injectString("zh-Hans", "Change sort direction", "\u66F4\u6539\u6392\u5E8F");
66
66
  injectString("zh-TW", "Change sort direction", "\u8B8A\u66F4\u6392\u5E8F\u65B9\u5411");
67
67
  injectString("ro-RO", "Change sort direction", "Schimba\u021Bi direc\u021Bia sort\u0103rii");
68
68
  injectString("ar-SA", "Change sort direction", "\u062A\u063A\u064A\u064A\u0631 \u0627\u062A\u062C\u0627\u0647 \u0627\u0644\u062A\u0631\u062A\u064A\u0628");
69
+ injectString("cs", "Ascending", "Vzestupn\u011B");
70
+ injectString("da-DK", "Ascending", "Stigende");
71
+ injectString("de", "Ascending", "Aufsteigend");
72
+ injectString("en", "Ascending", "Ascending");
73
+ injectString("es", "Ascending", "Ascendente");
74
+ injectString("fi-FI", "Ascending", "Nouseva");
75
+ injectString("fr", "Ascending", "Croissant");
76
+ injectString("fr-FR", "Ascending", "Croissant");
77
+ injectString("hu-HU", "Ascending", "N\xF6vekv\u0151");
78
+ injectString("id", "Ascending", "Naik");
79
+ injectString("it", "Ascending", "Crescente");
80
+ injectString("ja", "Ascending", "\u6607\u9806");
81
+ injectString("ko-KR", "Ascending", "\uC624\uB984\uCC28\uC21C");
82
+ injectString("ms", "Ascending", "Menaik");
83
+ injectString("nb-NO", "Ascending", "Stigende");
84
+ injectString("nl", "Ascending", "Oplopend");
85
+ injectString("pl", "Ascending", "Rosn\u0105co");
86
+ injectString("pt-BR", "Ascending", "Crescente");
87
+ injectString("pt-PT", "Ascending", "Ascendente");
88
+ injectString("sk-SK", "Ascending", "Vzostupne");
89
+ injectString("sv", "Ascending", "Stigande");
90
+ injectString("th", "Ascending", "\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01");
91
+ injectString("tr", "Ascending", "Artan");
92
+ injectString("zh-Hans", "Ascending", "\u5347\u5E8F");
93
+ injectString("zh-TW", "Ascending", "\u905E\u589E");
94
+ injectString("ro-RO", "Ascending", "Ascensiune");
95
+ injectString("ar-SA", "Ascending", "\u062A\u0635\u0627\u0639\u062F\u064A");
96
+ injectString("cs", "Descending", "Sestupn\u011B");
97
+ injectString("da-DK", "Descending", "Faldende");
98
+ injectString("de", "Descending", "Absteigend");
99
+ injectString("en", "Descending", "Descending");
100
+ injectString("es", "Descending", "Descendente");
101
+ injectString("fi-FI", "Descending", "Laskeva");
102
+ injectString("fr", "Descending", "D\xE9croissant");
103
+ injectString("fr-FR", "Descending", "Descendant");
104
+ injectString("hu-HU", "Descending", "Cs\xF6kken\u0151");
105
+ injectString("id", "Descending", "Menurun");
106
+ injectString("it", "Descending", "Decrescente");
107
+ injectString("ja", "Descending", "\u964D\u9806");
108
+ injectString("ko-KR", "Descending", "\uB0B4\uB9BC\uCC28\uC21C");
109
+ injectString("ms", "Descending", "Menurun");
110
+ injectString("nb-NO", "Descending", "Synkende");
111
+ injectString("nl", "Descending", "Aflopend");
112
+ injectString("pl", "Descending", "Malej\u0105co");
113
+ injectString("pt-BR", "Descending", "Decrescente");
114
+ injectString("pt-PT", "Descending", "Descendente");
115
+ injectString("sk-SK", "Descending", "Zostupne");
116
+ injectString("sv", "Descending", "Fallande");
117
+ injectString("th", "Descending", "\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22");
118
+ injectString("tr", "Descending", "Azalan");
119
+ injectString("zh-Hans", "Descending", "\u964D\u5E8F");
120
+ injectString("zh-TW", "Descending", "\u905E\u6E1B");
121
+ injectString("ro-RO", "Descending", "Cobor\xE2re");
122
+ injectString("ar-SA", "Descending", "\u062A\u0646\u0627\u0632\u0644\u064A");
69
123
  injectString("cs", "Sort Options", "Sort Options");
70
124
  injectString("da-DK", "Sort Options", "Sorteringsmuligheder");
71
125
  injectString("de", "Sort Options", "Sort Options");
@@ -157,7 +211,6 @@ const SortControl = ({
157
211
  onClick: () => onSortDirectionToggle(),
158
212
  disabled: disabled,
159
213
  title: translate("Change sort direction"),
160
- "aria-label": translate("Change sort direction"),
161
214
  children: [directionIcon ? sortDirection === SortDirections.Ascending ? (0, jsx_runtime_1.jsx)(iconFilter3Asc_1.IconFilter3Asc, {
162
215
  className: "zen-sort-container__sort-icon",
163
216
  size: isDrive ? "huge" : "large"
@@ -170,6 +223,9 @@ const SortControl = ({
170
223
  children: [buttonTextValue, ": "]
171
224
  }), (0, jsx_runtime_1.jsx)("span", {
172
225
  children: (items.find(item => item.id === sortBy) || items[0]).children
226
+ }), (0, jsx_runtime_1.jsxs)("span", {
227
+ className: "zen-visually-hidden",
228
+ children: [" ", sortDirection === SortDirections.Ascending ? translate("Ascending") : translate("Descending")]
173
229
  })]
174
230
  })]
175
231
  }), isSingleItem ? "" : (0, jsx_runtime_1.jsx)(popup_1.Popup, {
@@ -197,4 +253,4 @@ const SortControl = ({
197
253
  });
198
254
  };
199
255
  exports.SortControl = SortControl;
200
- exports.TRANSLATIONS = ["Sort by", "Sort Options", "Change sort direction"];
256
+ exports.TRANSLATIONS = ["Sort by", "Sort Options", "Change sort direction", "Ascending", "Descending"];
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, ReactNode, RefObject } from "react";
2
- export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, selectAll: () => void, turnOffSelectAll?: boolean, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
2
+ export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
3
3
  bulkActions: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
4
4
  pagination: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
5
5
  activePage: number | undefined;
@@ -27,7 +27,7 @@ const isChildElement = function (child, expectedType) {
27
27
  }
28
28
  return false;
29
29
  };
30
- const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, selectAll, turnOffSelectAll, activeId, gridRef, onCloseDetailPanel) => (0, react_1.useMemo)(() => {
30
+ const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, activeId, gridRef, onCloseDetailPanel) => (0, react_1.useMemo)(() => {
31
31
  let bulkActions = undefined;
32
32
  let tablePagination = undefined;
33
33
  let activePage = undefined;
@@ -42,7 +42,7 @@ const useTableChildren = (children, isMobile, selected, allSelected, clearSelect
42
42
  }
43
43
  if (isChildElement(child, tableBulkActions_1.TableBulkActions.displayName)) {
44
44
  const bulkActionButtons = child.props.children || [];
45
- bulkActions = ((0, jsx_runtime_1.jsx)(bulkActions_1.BulkActions, { gridType: isMobile ? deviceType_1.DeviceType.Mobile : deviceType_1.DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, onSelectAll: selectAll, turnOffSelectAll: turnOffSelectAll, children: bulkActionButtons }));
45
+ bulkActions = ((0, jsx_runtime_1.jsx)(bulkActions_1.BulkActions, { gridType: isMobile ? deviceType_1.DeviceType.Mobile : deviceType_1.DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, children: bulkActionButtons }));
46
46
  return;
47
47
  }
48
48
  if (isChildElement(child, tablePagination_1.TablePagination.displayName)) {
@@ -103,5 +103,5 @@ const useTableChildren = (children, isMobile, selected, allSelected, clearSelect
103
103
  detailPanel: detailPanel,
104
104
  other: other
105
105
  };
106
- }, [children, clearSelection, isMobile, selected, gridRef, allSelected, selectAll, turnOffSelectAll, activeId, onCloseDetailPanel]);
106
+ }, [children, clearSelection, isMobile, selected, gridRef, allSelected, activeId, onCloseDetailPanel]);
107
107
  exports.useTableChildren = useTableChildren;
@@ -65,6 +65,7 @@ const SubColumnsList = ({
65
65
  showCheckbox: true,
66
66
  children: c.title
67
67
  })), [columns, sortColumnsInt, lastVisibleColumnId]);
68
+ const allDisabled = (0, react_1.useMemo)(() => items.every(item => item.disabled), [items]);
68
69
  const state = columns.reduce((res, c) => {
69
70
  res.set(c.id, settings.get(c.id) !== false ? checkboxState_1.CheckboxState.On : checkboxState_1.CheckboxState.Off);
70
71
  return res;
@@ -84,8 +85,9 @@ const SubColumnsList = ({
84
85
  title: title || translate("Select visible columns"),
85
86
  multiselect: true,
86
87
  showCheckbox: true,
87
- onChange: onChangeItem
88
- }), [id, items, state, title, translate, onChangeItem]);
88
+ onChange: onChangeItem,
89
+ disabled: allDisabled
90
+ }), [id, items, state, title, translate, onChangeItem, allDisabled]);
89
91
  if (!title) {
90
92
  return list;
91
93
  }
@@ -16,6 +16,14 @@ export interface ISelectableRowsOptions<T extends IRowEntity<N>, N extends IEnti
16
16
  checkboxTitle?: (entity: T | N) => string;
17
17
  headerTitle?: (state: SelectionState) => string;
18
18
  turnOffSelectAll?: boolean;
19
+ /**
20
+ * When `true`, the header checkbox emits the current page's IDs instead of `{ all: true }`.
21
+ * When `undefined`, falls back to `turnOffSelectAll` for backward compatibility.
22
+ *
23
+ * Note: avoid setting this to `false` alongside `turnOffSelectAll: true` — the checkbox
24
+ * will emit `{ all: true }` while the dropdown hides the "Select all" option, which is inconsistent.
25
+ */
26
+ checkboxSelectsCurrentPage?: boolean;
19
27
  checkboxPlaceholder?: boolean;
20
28
  strategy?: TSelectionStrategy;
21
29
  selectAll?: boolean;
@@ -188,8 +188,16 @@ const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMod
188
188
  return translate("Deselect all");
189
189
  }, [selectable, selectableState, state, translate]);
190
190
  const isEntityChecked = (0, react_1.useCallback)((entity, isNested) => (0, isRowChecked_1.isRowChecked)(selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy, entity, isNested), [selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy]);
191
+ const hasSelectable = !!selectable;
192
+ const selectableCheckboxSelectsCurrentPage = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxSelectsCurrentPage;
193
+ const selectableTurnOffSelectAll = selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll;
194
+ const selectableCheckboxInHeader = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxInHeader;
195
+ const selectableSelectionLimit = selectable === null || selectable === void 0 ? void 0 : selectable.selectionLimit;
196
+ const selectableHeader = selectable === null || selectable === void 0 ? void 0 : selectable.header;
197
+ const checkboxEmitsCurrentPage = selectableCheckboxSelectsCurrentPage !== null && selectableCheckboxSelectsCurrentPage !== void 0 ? selectableCheckboxSelectsCurrentPage : selectableTurnOffSelectAll;
198
+ const checkboxInHeaderValue = selectableCheckboxInHeader !== undefined ? selectableCheckboxInHeader : selectableSelectionLimit !== undefined ? false : undefined;
191
199
  const wrapper = (0, react_1.useMemo)(() => {
192
- if (!selectable) {
200
+ if (!hasSelectable) {
193
201
  return null;
194
202
  }
195
203
  return {
@@ -233,7 +241,7 @@ const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMod
233
241
  onChange: newValue => {
234
242
  var _a, _b;
235
243
  if (newValue) {
236
- const newState = selectable.turnOffSelectAll ? interfaces_1.SelectionState.CurrentPage : interfaces_1.SelectionState.All;
244
+ const newState = checkboxEmitsCurrentPage ? interfaces_1.SelectionState.CurrentPage : interfaces_1.SelectionState.All;
237
245
  setState(newState);
238
246
  onChangeSelectionState(newState);
239
247
  } else {
@@ -251,18 +259,18 @@ const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMod
251
259
  }
252
260
  },
253
261
  calculateSelectionState: () => selectableState,
254
- checkboxInHeader: selectable.checkboxInHeader !== undefined ? selectable.checkboxInHeader : selectable.selectionLimit !== undefined ? false : undefined,
255
- header: selectable.header,
262
+ checkboxInHeader: checkboxInHeaderValue,
263
+ header: selectableHeader,
256
264
  onSelect: newState => {
257
265
  setState(newState);
258
266
  onChangeSelectionState(newState);
259
267
  },
260
- turnOffSelectAll: selectable.turnOffSelectAll
268
+ turnOffSelectAll: selectableTurnOffSelectAll
261
269
  });
262
270
  return cell;
263
271
  }
264
272
  };
265
- }, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener, selectable, selectableState, state, isMobile, checkboxPlaceholder, isEntityChecked, entities, setSelectMode]);
273
+ }, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener, hasSelectable, checkboxEmitsCurrentPage, checkboxInHeaderValue, selectableHeader, selectableTurnOffSelectAll, selectable, selectableState, state, isMobile, checkboxPlaceholder, isEntityChecked, entities, setSelectMode]);
266
274
  const selectableFeedWrapper = (0, react_1.useCallback)((primaryData, secondaryData, entity, isNested) => {
267
275
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
268
276
  if (!entity) {
@@ -227,12 +227,6 @@ const TableInner = ({
227
227
  selected: []
228
228
  });
229
229
  }, [selectable]);
230
- const selectAll = (0, react_1.useCallback)(() => {
231
- selectable === null || selectable === void 0 ? void 0 : selectable.onSelect({
232
- all: true,
233
- selected: []
234
- });
235
- }, [selectable]);
236
230
  const [activeIdInternal, setActiveInternal] = (0, react_1.useState)(undefined);
237
231
  const activeId = active !== undefined ? active : activeIdInternal;
238
232
  const onClickInternal = (0, react_1.useCallback)(id => setActiveInternal(id === activeIdInternal ? undefined : id), [activeIdInternal, setActiveInternal]);
@@ -249,7 +243,7 @@ const TableInner = ({
249
243
  detailPanel,
250
244
  footer,
251
245
  other
252
- } = (0, useTableChildren_1.useTableChildren)(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection, selectAll, selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll, activeId, gridRef, onCloseDetailPanel);
246
+ } = (0, useTableChildren_1.useTableChildren)(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection, activeId, gridRef, onCloseDetailPanel);
253
247
  const hasDetailPanel = !!detailPanel;
254
248
  const shouldEnableRowClick = hasDetailPanel || !!onClick;
255
249
  const activeIdForRow = shouldEnableRowClick ? activeId : undefined;
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "الصيغ المدعومة:",
324
324
  "Upload files.": "رفع الملفات.",
325
325
  "File upload area": "منطقة رفع الملفات",
326
- "Uploaded": "تم الرفع"
326
+ "Uploaded": "تم الرفع",
327
+ "Ascending": "تصاعدي",
328
+ "Descending": "تنازلي"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Vzestupně",
328
+ "Descending": "Sestupně"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Stigende",
328
+ "Descending": "Faldende"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Aufsteigend",
328
+ "Descending": "Absteigend"
327
329
  }
@@ -328,5 +328,7 @@
328
328
  "File upload area": "File upload area",
329
329
  "Uploaded": "Uploaded",
330
330
  "Sort by Ascending": "Sort by Ascending",
331
- "Sort by Descending": "Sort by Descending"
331
+ "Sort by Descending": "Sort by Descending",
332
+ "Ascending": "Ascending",
333
+ "Descending": "Descending"
332
334
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Ascendente",
328
+ "Descending": "Descendente"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Nouseva",
328
+ "Descending": "Laskeva"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Croissant",
328
+ "Descending": "Descendant"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Croissant",
328
+ "Descending": "Décroissant"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Növekvő",
328
+ "Descending": "Csökkenő"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Naik",
328
+ "Descending": "Menurun"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Crescente",
328
+ "Descending": "Decrescente"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "昇順",
328
+ "Descending": "降順"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "오름차순",
328
+ "Descending": "내림차순"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Menaik",
328
+ "Descending": "Menurun"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Stigende",
328
+ "Descending": "Synkende"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Oplopend",
328
+ "Descending": "Aflopend"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Rosnąco",
328
+ "Descending": "Malejąco"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Crescente",
328
+ "Descending": "Decrescente"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Ascendente",
328
+ "Descending": "Descendente"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Ascensiune",
328
+ "Descending": "Coborâre"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Vzostupne",
328
+ "Descending": "Zostupne"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Stigande",
328
+ "Descending": "Fallande"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "จากน้อยไปมาก",
328
+ "Descending": "จากมากไปน้อย"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "Artan",
328
+ "Descending": "Azalan"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "升序",
328
+ "Descending": "降序"
327
329
  }
@@ -323,5 +323,7 @@
323
323
  "Supported Formats:": "Supported Formats:",
324
324
  "Upload files.": "Upload files.",
325
325
  "File upload area": "File upload area",
326
- "Uploaded": "Uploaded"
326
+ "Uploaded": "Uploaded",
327
+ "Ascending": "遞增",
328
+ "Descending": "遞減"
327
329
  }
@@ -13,8 +13,9 @@ export interface IDataGridCell<T extends IEntityWithId> extends IZenComponentPro
13
13
  defaultValue: string | undefined;
14
14
  entity: T;
15
15
  width?: number;
16
+ maxWidth?: number;
16
17
  colspan?: number;
17
18
  onClick?: () => void;
18
19
  isActive?: boolean;
19
20
  }
20
- export declare const DataGridCell: <T extends IEntityWithId>({ index, limited, visibleOnHover, isVisible, width, render, renderWrappers, renderPlaceholder, defaultValue, entity, colspan, className, onClick, isActive }: IDataGridCell<T>) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const DataGridCell: <T extends IEntityWithId>({ index, limited, visibleOnHover, isVisible, width, maxWidth, render, renderWrappers, renderPlaceholder, defaultValue, entity, colspan, className, onClick, isActive }: IDataGridCell<T>) => import("react/jsx-runtime").JSX.Element;