@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
package/README.md CHANGED
@@ -54,13 +54,21 @@ Zenith library provides components defined in Zenith Design System. It includes
54
54
  - `Nav` component: support show/hide separator between Core and Apps sections
55
55
  - `Nav` empty state support
56
56
  - Allow multiple columns to be disabled in `ColumnsList`
57
+ - Fix `SelectList` keyboard focus skipping disabled items
57
58
  - Flip icons for Arabic (RTL) language
58
- - `Dropdown` search and select-all improvements
59
+ - `Dropdown` select-all button shows active state when all items are selected
60
+ - Add `ariaLabel` prop to `CardButton` for accessible name override
61
+ - Fix `GroupsFilter` dropdown scrolling into blank space
62
+ - Fix `Dropdown` ARIA pattern — non-search dropdowns now use `menu` role instead of `dialog`
63
+ - Reverse RTL slide-in animation direction for `Toast` and `Notification`
59
64
  - Fix `SidePanel` not animating open due to RTL regression
60
65
  - Add `closeOnScroll` prop to close `ContextMenu` on scroll
61
66
  - Fix checkbox accessibility by moving input inside label wrapper
62
67
  - Fix multi-page selection in `Table` selectable rows
63
68
  - Add `titleAs` prop to `Card` title to control heading tag (`h1`–`h6`)
69
+ - Convert selection and toggle inputs (`Checkbox`, `Radio`, `Toggle`) to rem units
70
+ - Convert text, search, and file inputs to rem units
71
+ - Convert utility and standalone components to rem units
64
72
 
65
73
  ### 3.9.2
66
74
 
@@ -1,7 +1,7 @@
1
1
  @import "../common.less";
2
2
  @import "../typography/typography.less";
3
3
 
4
- @pill-min-width-default: 30px;
4
+ @pill-min-width-default: (30 / @rem);
5
5
  @pill-max-width-default: 200px;
6
6
 
7
7
  // TODO: update to .zen-pill-content after old pill component removed remove
@@ -14,12 +14,12 @@
14
14
  display: flex;
15
15
  align-items: center;
16
16
  justify-content: space-between;
17
- border-radius: 30px;
17
+ border-radius: (30 / @rem);
18
18
  height: @pill-height;
19
19
  display: grid;
20
20
  grid-auto-flow: column;
21
21
 
22
- gap: 8px;
22
+ gap: (8 / @rem);
23
23
 
24
24
  &--icon-left {
25
25
  grid-template-columns: 12px 1fr;
@@ -38,18 +38,18 @@
38
38
 
39
39
  &.zen-pill-new-content--empty {
40
40
  grid-template-columns: 12px 18px;
41
- gap: 8px;
41
+ gap: (8 / @rem);
42
42
  }
43
43
  }
44
44
 
45
45
  &--hidden {
46
- gap: 4px;
46
+ gap: (4 / @rem);
47
47
  }
48
48
  &.zen-pill-new-content--drive,
49
49
  &.zen-pill-new-content--drive-tablet {
50
50
  height: @pill-height--drive;
51
51
  .zen-pill-non-actionable__icon {
52
- min-width: 16px;
52
+ min-width: (16 / @rem);
53
53
  max-width: 16px;
54
54
  height: 16px;
55
55
  }
@@ -67,7 +67,7 @@
67
67
 
68
68
  &.zen-pill-new-content--empty {
69
69
  grid-template-columns: 16px 22px;
70
- gap: 8px;
70
+ gap: (8 / @rem);
71
71
  }
72
72
  }
73
73
  }
@@ -75,7 +75,7 @@
75
75
  height: @pill-height--mobile;
76
76
  .body-m-400-short();
77
77
  .zen-pill-non-actionable__icon {
78
- min-width: 16px;
78
+ min-width: (16 / @rem);
79
79
  max-width: 16px;
80
80
  height: 16px;
81
81
  }
@@ -93,7 +93,7 @@
93
93
 
94
94
  &.zen-pill-new-content--empty {
95
95
  grid-template-columns: 16px 22px;
96
- gap: 8px;
96
+ gap: (8 / @rem);
97
97
  }
98
98
  }
99
99
  }
@@ -7,7 +7,7 @@
7
7
  color: var(--text-primary);
8
8
  align-items: center;
9
9
  justify-content: space-between;
10
- padding: 4px 12px 4px 12px;
11
- border-radius: 30px;
10
+ padding: (4 / @rem) (12 / @rem) (4 / @rem) (12 / @rem);
11
+ border-radius: (30 / @rem);
12
12
  background: var(--backgrounds-content-1);
13
13
  }
@@ -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;
@@ -7,7 +7,7 @@ const classNames_1 = require("../../commonHelpers/classNames/classNames");
7
7
  const basicColumn_1 = require("../columns/basicColumn");
8
8
  const isActiveElement_1 = require("../../list/utils/isActiveElement");
9
9
  const zen_1 = require("../../utils/zen");
10
- const Cell = ({ index, limited, visibleOnHover, isVisible, width, render, renderWrappers, renderPlaceholder, defaultValue, entity, colspan, className, onClick, isActive }) => {
10
+ const Cell = ({ index, limited, visibleOnHover, isVisible, width, maxWidth, render, renderWrappers, renderPlaceholder, defaultValue, entity, colspan, className, onClick, isActive }) => {
11
11
  const [content, setContent] = (0, react_1.useState)("");
12
12
  const placeholderRenderer = (0, react_1.useCallback)(() => {
13
13
  const renderFn = renderPlaceholder || (() => "...");
@@ -72,6 +72,6 @@ const Cell = ({ index, limited, visibleOnHover, isVisible, width, render, render
72
72
  visibleOnHover ? "zen-data-grid__row-cell--visible-on-hover" : "",
73
73
  onClick ? "zen-data-grid__row-cell--clickable" : "",
74
74
  limited ? "zen-ellipsis" : ""
75
- ]), style: { minWidth: width || "auto", maxWidth: width || "auto" }, role: "gridcell", children: content }));
75
+ ]), style: { minWidth: width || "auto", maxWidth: maxWidth ? `${Math.max(width !== null && width !== void 0 ? width : 0, maxWidth)}px` : width || "auto" }, role: "gridcell", children: content }));
76
76
  };
77
77
  exports.DataGridCell = (0, react_1.memo)(Cell);
@@ -57,7 +57,7 @@ const getHeaderPropsFromWrappers = wrappers => wrappers.reduce((result, wrapper)
57
57
  const props = (_a = wrapper.getHeaderProps) === null || _a === void 0 ? void 0 : _a.call(wrapper);
58
58
  return props ? Object.assign(Object.assign({}, result), props) : result;
59
59
  }, {});
60
- const getColumnWidth = defaultWidth => Math.floor(Math.max(defaultWidth, exports.MIN_CELL_WIDTH));
60
+ const getColumnWidth = (defaultWidth, minWidth) => Math.floor(Math.max(defaultWidth, minWidth !== null && minWidth !== void 0 ? minWidth : exports.MIN_CELL_WIDTH));
61
61
  const EmptyList = ({
62
62
  children
63
63
  }) => (0, jsx_runtime_1.jsx)("div", {
@@ -154,12 +154,13 @@ const DataGridInner = ({
154
154
  setVisibleRows(visible);
155
155
  }, [entities]);
156
156
  const listOfDefaultWidthColumns = (0, react_1.useMemo)(() => columnsList.map(column => column.meta.defaultWidth), [columnsList]);
157
+ const listOfMinWidthColumns = (0, react_1.useMemo)(() => columnsList.map(column => column.meta.minWidth), [columnsList]);
157
158
  const {
158
159
  result: observerResult
159
160
  } = (0, useResizeObserver_1.useResizeObserver)({
160
161
  target: gridRef.current
161
162
  });
162
- const allocatedSpace = listOfDefaultWidthColumns.reduce((acc, width) => acc + (width === undefined ? 0 : getColumnWidth(width)), 0);
163
+ const allocatedSpace = listOfDefaultWidthColumns.reduce((acc, width, index) => acc + (width === undefined ? 0 : getColumnWidth(width, listOfMinWidthColumns[index])), 0);
163
164
  const unallocatedSpace = observerResult && observerResult.contentRect.width - allocatedSpace || 0;
164
165
  const flexibleColumnsQty = listOfDefaultWidthColumns.filter(width => width === undefined).length;
165
166
  const flexibleColumnWidth = getColumnWidth(unallocatedSpace / flexibleColumnsQty);
@@ -182,18 +183,19 @@ const DataGridInner = ({
182
183
  }, [updateScroll, scheduleLazyRender]);
183
184
  const getCellParams = (0, react_1.useCallback)(columnIndex => {
184
185
  const defaultWidth = listOfDefaultWidthColumns[columnIndex];
186
+ const minWidth = listOfMinWidthColumns[columnIndex];
185
187
  const limited = !!defaultWidth && defaultWidth > 0;
186
188
  const isFirst = columnIndex === 0;
187
189
  const isLast = columnIndex === listOfDefaultWidthColumns.length - 1;
188
190
  // If the column is the last one or doesn't have a default width, it should be limited to the remaining space
189
- const width = getColumnWidth(defaultWidth || flexibleColumnWidth);
191
+ const width = getColumnWidth(defaultWidth || flexibleColumnWidth, minWidth);
190
192
  return {
191
193
  limited,
192
194
  isFirst,
193
195
  isLast,
194
196
  width
195
197
  };
196
- }, [listOfDefaultWidthColumns, flexibleColumnWidth]);
198
+ }, [listOfDefaultWidthColumns, listOfMinWidthColumns, flexibleColumnWidth]);
197
199
  const renderHeaderCell = (0, react_1.useCallback)((column, columnIndex) => {
198
200
  var _a;
199
201
  const {
@@ -2,6 +2,8 @@ import { ReactNode } from "react";
2
2
  import { ColumnSortDirection } from "../table/table";
3
3
  export interface IListColumnMeta<T, N = T> {
4
4
  readonly defaultWidth?: number;
5
+ readonly minWidth?: number;
6
+ readonly maxWidth?: number;
5
7
  readonly defaultValue?: string;
6
8
  readonly lazyLoad?: boolean;
7
9
  readonly visibleOnHover?: boolean;
@@ -6,10 +6,12 @@ const react_1 = require("react");
6
6
  const classNames_1 = require("../../commonHelpers/classNames/classNames");
7
7
  const cell_1 = require("../cell/cell");
8
8
  exports.MIN_CELL_WIDTH = 100;
9
- const getColumnWidth = (defaultWidth) => Math.floor(Math.max(defaultWidth, exports.MIN_CELL_WIDTH));
9
+ const getColumnWidth = (defaultWidth, minWidth) => Math.floor(Math.max(defaultWidth, minWidth !== null && minWidth !== void 0 ? minWidth : exports.MIN_CELL_WIDTH));
10
10
  const Row = ({ id, entity, columns, visibleRows, flexibleColumnWidth, isLastRow, className, expanded, onExpandedChange, isTreeGrid, ariaPosinset, ariaSetsize, onClick, isActive }) => {
11
11
  const isVisible = visibleRows.has(entity.id);
12
12
  const listOfDefaultWidthColumns = (0, react_1.useMemo)(() => columns.map(column => column.meta.defaultWidth), [columns]);
13
+ const listOfMinWidthColumns = (0, react_1.useMemo)(() => columns.map(column => column.meta.minWidth), [columns]);
14
+ const listOfMaxWidthColumns = (0, react_1.useMemo)(() => columns.map(column => column.meta.maxWidth), [columns]);
13
15
  const getColWidth = (0, react_1.useCallback)((columnIndex, colspan) => {
14
16
  const colsp = colspan || 1;
15
17
  let columnWidth = 0;
@@ -18,26 +20,28 @@ const Row = ({ id, entity, columns, visibleRows, flexibleColumnWidth, isLastRow,
18
20
  continue;
19
21
  }
20
22
  const defaultWidth = listOfDefaultWidthColumns[columnIndex + i];
23
+ const minWidth = listOfMinWidthColumns[columnIndex + i];
21
24
  // If the column is the last one or doesn't have a default width, it should be limited to the remaining space
22
- const width = getColumnWidth(defaultWidth || flexibleColumnWidth);
25
+ const width = getColumnWidth(defaultWidth || flexibleColumnWidth, minWidth);
23
26
  columnWidth += width;
24
27
  }
25
28
  return columnWidth;
26
- }, [flexibleColumnWidth, listOfDefaultWidthColumns]);
29
+ }, [flexibleColumnWidth, listOfDefaultWidthColumns, listOfMinWidthColumns]);
27
30
  const getCellParams = (0, react_1.useCallback)((columnIndex, colspan) => {
28
31
  const width = getColWidth(columnIndex, colspan);
29
32
  const defaultWidth = listOfDefaultWidthColumns[columnIndex];
33
+ const maxWidth = listOfMaxWidthColumns[columnIndex];
30
34
  const limited = !!defaultWidth && defaultWidth > 0;
31
35
  const isFirst = columnIndex === 0;
32
36
  const isLast = columnIndex === listOfDefaultWidthColumns.length - 1;
33
- return { limited, isFirst, isLast, width };
34
- }, [getColWidth, listOfDefaultWidthColumns]);
37
+ return { limited, isFirst, isLast, width, maxWidth };
38
+ }, [getColWidth, listOfDefaultWidthColumns, listOfMaxWidthColumns]);
35
39
  const mainRowId = (0, react_1.useId)();
36
40
  const renderCells = (0, react_1.useCallback)((rowEntity, isNested) => columns.reduce((acc, column, index) => {
37
41
  const colspanFn = column.colspan;
38
42
  let colspan = colspanFn ? (typeof colspanFn === "function" ? colspanFn(rowEntity) : colspanFn) : undefined;
39
43
  colspan = colspan && colspan > 1 ? colspan : undefined;
40
- const { limited, width } = getCellParams(index, colspan);
44
+ const { limited, width, maxWidth } = getCellParams(index, colspan);
41
45
  if (acc.colspan > 0) {
42
46
  acc.colspan--;
43
47
  return acc;
@@ -52,7 +56,7 @@ const Row = ({ id, entity, columns, visibleRows, flexibleColumnWidth, isLastRow,
52
56
  ? column.columnComponent.renderNested.bind(column.columnComponent)
53
57
  : column.columnComponent.render.bind(column.columnComponent))
54
58
  : column.columnComponent.render.bind(column.columnComponent);
55
- acc.cells.push((0, jsx_runtime_1.jsx)(cell_1.DataGridCell, { render: e => renderFn(e, isNested), renderPlaceholder: column.meta.renderPlaceholder, renderWrappers: renderWrappers, defaultValue: column.meta.defaultValue, entity: rowEntity, index: index, limited: limited, visibleOnHover: column.meta.visibleOnHover, width: column.meta.visibleOnHover ? 0 : width, isVisible: isVisible, colspan: colspan, onClick: !isNested && onExpandedChange ? () => onExpandedChange(!expanded) : onClick ? () => onClick(rowEntity.id) : undefined, isActive: isActive, className: isNested ? "zen-data-grid__row-cell--nested" : "" }, `${rowEntity.id}_${column.name}`));
59
+ acc.cells.push((0, jsx_runtime_1.jsx)(cell_1.DataGridCell, { render: e => renderFn(e, isNested), renderPlaceholder: column.meta.renderPlaceholder, renderWrappers: renderWrappers, defaultValue: column.meta.defaultValue, entity: rowEntity, index: index, limited: limited, visibleOnHover: column.meta.visibleOnHover, width: column.meta.visibleOnHover ? 0 : width, maxWidth: column.meta.visibleOnHover ? undefined : maxWidth, isVisible: isVisible, colspan: colspan, onClick: !isNested && onExpandedChange ? () => onExpandedChange(!expanded) : onClick ? () => onClick(rowEntity.id) : undefined, isActive: isActive, className: isNested ? "zen-data-grid__row-cell--nested" : "" }, `${rowEntity.id}_${column.name}`));
56
60
  return acc;
57
61
  }, { cells: [], colspan: 0 }).cells, [columns, expanded, getCellParams, isVisible, onExpandedChange, isActive, onClick]);
58
62
  const cells = (0, react_1.useMemo)(() => renderCells(entity, false), [entity, renderCells]);
@@ -21,6 +21,7 @@ const SubColumnsList = ({ title, columns, settings, disabledColumns, onChange, s
21
21
  showCheckbox: true,
22
22
  children: c.title
23
23
  })), [columns, disabledColumns, sortColumnsInt]);
24
+ const allDisabled = (0, react_1.useMemo)(() => items.every(item => item.disabled), [items]);
24
25
  const state = columns.reduce((res, c) => {
25
26
  res.set(c.id, settings.get(c.name) !== false ? checkboxState_1.CheckboxState.On : checkboxState_1.CheckboxState.Off);
26
27
  return res;
@@ -33,7 +34,7 @@ const SubColumnsList = ({ title, columns, settings, disabledColumns, onChange, s
33
34
  });
34
35
  onChange && onChange(newSettings);
35
36
  }, [columns, settings, onChange]);
36
- const list = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(selectList_1.SelectList, { id: id, items: items, value: state, title: title || "", multiselect: true, showCheckbox: true, onChange: onChangeItem }), [id, items, state, title, onChangeItem]);
37
+ const list = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)(selectList_1.SelectList, { id: id, items: items, value: state, title: title || "", multiselect: true, showCheckbox: true, onChange: onChangeItem, disabled: allDisabled })), [id, items, state, title, onChangeItem, allDisabled]);
37
38
  if (!title) {
38
39
  return list;
39
40
  }
@@ -7,6 +7,10 @@ import { DeviceType } from "../../../../commonHelpers/hooks/deviceType";
7
7
  type TBulkAction = IBulkActionLink | IBulkActionButton;
8
8
  export interface IBulkActionsProps extends IZenComponentProps {
9
9
  selected: number;
10
+ /**
11
+ * When `true`, displays "All selected" instead of a count, and enables action buttons
12
+ * even when `selected` is 0 (i.e., cross-page "select all" is active).
13
+ */
10
14
  allSelected?: boolean;
11
15
  onClearSelection: () => void;
12
16
  onSelectAll?: () => void;
@@ -10,6 +10,6 @@ const parseLabel = (option, dateFormat, translate, toLocalFn) => {
10
10
  localeFrom.getFullYear() === localeTo.getFullYear()) {
11
11
  return (0, formatDate_1.formatDate)(localeFrom, dateFormat, translate);
12
12
  }
13
- return `${(0, formatDate_1.formatDate)(localeFrom, dateFormat, translate)} - ${(0, formatDate_1.formatDate)(localeTo, dateFormat, translate)}`;
13
+ return `${(0, formatDate_1.formatDate)(localeFrom, dateFormat, translate)} ${(0, formatDate_1.formatDate)(localeTo, dateFormat, translate)}`;
14
14
  };
15
15
  exports.parseLabel = parseLabel;
@@ -15,7 +15,6 @@ export interface IDropdownList extends IZenComponentProps {
15
15
  backButtonName?: string;
16
16
  isAllSelected?: boolean;
17
17
  isSelectAllActive?: boolean;
18
- shouldBlockItems?: boolean;
19
18
  listData: ICheckboxListWithActionOption[] | ISelectListItem[];
20
19
  isWithFooter: boolean;
21
20
  width?: number;
@@ -41,6 +40,6 @@ interface IDropdownEmptyList extends Pick<IDropdownList, "className" | "width" |
41
40
  hasError: boolean;
42
41
  }
43
42
  export declare const EmptyList: ({ className, width, onClearClick, onApplyClick, onCancelClick, hasApplyButton, isApplyDisabled, isClearButtonDisabled, isWithFooter, hasError }: IDropdownEmptyList) => import("react/jsx-runtime").JSX.Element;
44
- export declare const DropdownList: ({ onBackButtonClick, onSelectAllClick, onClearClick, onApplyClick, onCancelClick, onChange, onSelect, onSingleSelect, listData, isSelectAllActive, shouldBlockItems, backButtonName, width, minWidth, isSelectAllButtonDisable, hasSelectAllButton, filterName, isMultiselect, hasApplyButton, isApplyDisabled, isClearButtonDisabled, activeValue, forceSelection, isWithFooter, isMobile, handleCheckboxChange, checkboxLabel, isChecked, listElementRef, listId }: IDropdownList) => import("react/jsx-runtime").JSX.Element;
43
+ export declare const DropdownList: ({ onBackButtonClick, onSelectAllClick, onClearClick, onApplyClick, onCancelClick, onChange, onSelect, onSingleSelect, listData, isSelectAllActive, backButtonName, width, minWidth, isSelectAllButtonDisable, hasSelectAllButton, filterName, isMultiselect, hasApplyButton, isApplyDisabled, isClearButtonDisabled, activeValue, forceSelection, isWithFooter, isMobile, handleCheckboxChange, checkboxLabel, isChecked, listElementRef, listId }: IDropdownList) => import("react/jsx-runtime").JSX.Element;
45
44
  export declare const TRANSLATIONS: string[];
46
45
  export {};
@@ -333,7 +333,6 @@ const DropdownList = ({
333
333
  onSingleSelect,
334
334
  listData,
335
335
  isSelectAllActive,
336
- shouldBlockItems,
337
336
  backButtonName,
338
337
  width,
339
338
  minWidth,
@@ -433,15 +432,11 @@ const DropdownList = ({
433
432
  });
434
433
  return values;
435
434
  };
436
- const multiselectOptions = shouldBlockItems ? listData.map(item => Object.assign(Object.assign({}, item), {
437
- blocked: true,
438
- checked: false
439
- })) : listData;
440
435
  return (0, jsx_runtime_1.jsx)("div", {
441
436
  className: "zen-dropdown-list__elements",
442
437
  ref: listElementRef,
443
438
  children: isMultiselect ? (0, jsx_runtime_1.jsx)(checkboxListWithAction_1.CheckboxListWithAction, {
444
- options: multiselectOptions,
439
+ options: listData,
445
440
  label: "",
446
441
  onChange: handleChange,
447
442
  onClick: handleClick
@@ -457,7 +452,7 @@ const DropdownList = ({
457
452
  value: createValue(listData, activeValue)
458
453
  })
459
454
  });
460
- }, [listElementRef, isMultiselect, shouldBlockItems, listData, handleChange, handleClick, handleSingleChange, translate, selectListId, forceSelection, activeValue]);
455
+ }, [listElementRef, isMultiselect, listData, handleChange, handleClick, handleSingleChange, translate, selectListId, forceSelection, activeValue]);
461
456
  return (0, jsx_runtime_1.jsxs)("div", Object.assign({
462
457
  className: (0, classNames_1.classNames)(["zen-dropdown-list", driveComponentClass || ""])
463
458
  }, styleWidth, {
@@ -534,12 +534,18 @@ const DropdownRaw = props => {
534
534
  }, [setChecked, setSearch]);
535
535
  const debouncedGetData = (0, useDebounce_1.useDebounce)((signal, searchValue, isChecked) => getData ? (isCheckboxMode ? getData(signal, searchValue, isChecked) : getData(signal, searchValue)).then(dta => handleData(dta, searchValue)).catch(handleError) : customGetData(searchValue).then(dta => handleData(dta, searchValue)).catch(handleError), 200);
536
536
  const controlData = (0, react_1.useCallback)((signal, searchValue, isChecked) => {
537
- !isQueryMode && dispatchState({
538
- type: stateActionType_1.StateActionType.ShowWaiting,
539
- payload: undefined
540
- });
541
- isQueryMode ? handleQueryMode(searchValue, isChecked) : debouncedGetData(signal, searchValue, isChecked);
542
- }, [debouncedGetData, handleQueryMode, isQueryMode]);
537
+ if (isQueryMode) {
538
+ handleQueryMode(searchValue, isChecked);
539
+ } else if (!getData && dataItems && !searchValue) {
540
+ handleData(dataItems, "");
541
+ } else {
542
+ dispatchState({
543
+ type: stateActionType_1.StateActionType.ShowWaiting,
544
+ payload: undefined
545
+ });
546
+ debouncedGetData(signal, searchValue, isChecked);
547
+ }
548
+ }, [debouncedGetData, handleData, handleQueryMode, isQueryMode, getData, dataItems]);
543
549
  (0, react_1.useEffect)(() => {
544
550
  var _a;
545
551
  const timeoutId = (_a = zen_1.zen.setTimeout) === null || _a === void 0 ? void 0 : _a.call(zen_1.zen, () => {
@@ -864,7 +870,6 @@ const DropdownRaw = props => {
864
870
  filterName: isMobile ? undefined : filterName,
865
871
  isAllSelected: currentAllSelected ? currentAllSelected : isSearchMode ? (0, dropdownHelper_1.isEveryItemSelected)((0, dropdownHelper_1.getListDataWithDisabled)(state.listData, state.isNestedList), state.selectedIds) : currentAllSelected === undefined ? (0, dropdownHelper_1.isAllChildrenSelected)(state, state.currentId || state.rootId) : false,
866
872
  isSelectAllActive: isFullSelectionMode ? currentAllSelected : selectAllActiveForCurrentLevel,
867
- shouldBlockItems: !state.inputValue && !isFullSelectionMode && selectAllActiveForCurrentLevel,
868
873
  isMultiselect: multiselect,
869
874
  forceSelection: forceSelection,
870
875
  listData: currentListData,
@@ -12,8 +12,10 @@ const textIconButton_1 = require("../../textIconButton/textIconButton");
12
12
  const classNames_1 = require("../../commonHelpers/classNames/classNames");
13
13
  const react_1 = require("react");
14
14
  const iconChevronRight_1 = require("../../icons/iconChevronRight");
15
+ const iconChevronLeft_1 = require("../../icons/iconChevronLeft");
15
16
  const useLanguage_1 = require("../../utils/localization/useLanguage");
16
17
  const useDriveClassName_1 = require("../../utils/theme/useDriveClassName");
18
+ const useIsRTL_1 = require("../../utils/localization/useIsRTL");
17
19
  const zen_1 = require("../../utils/zen");
18
20
  injectString("cs", "Scroll left", "P\u0159ej\xEDt doleva");
19
21
  injectString("da-DK", "Scroll left", "Rul til venstre");
@@ -84,6 +86,10 @@ const getScrollButtonType = element => {
84
86
  }
85
87
  return "start";
86
88
  };
89
+ const getScrollIcons = isRTL => ({
90
+ start: isRTL ? iconChevronRight_1.IconChevronRight : iconChevronLeft_1.IconChevronLeft,
91
+ end: isRTL ? iconChevronLeft_1.IconChevronLeft : iconChevronRight_1.IconChevronRight
92
+ });
87
93
  const FiltersContainer = ({
88
94
  className,
89
95
  children
@@ -93,6 +99,11 @@ const FiltersContainer = ({
93
99
  const {
94
100
  translate
95
101
  } = (0, useLanguage_1.useLanguage)();
102
+ const isRTL = (0, useIsRTL_1.useIsRTL)();
103
+ const {
104
+ start: startScrollIcon,
105
+ end: endScrollIcon
106
+ } = getScrollIcons(isRTL);
96
107
  const gradientClass = "zen-filters-toolbar__gradient";
97
108
  const scrollerClass = "zen-filters-toolbar__scroller";
98
109
  const driveClassNameScroller = (0, useDriveClassName_1.useDriveClassName)(scrollerClass);
@@ -205,10 +216,9 @@ const FiltersContainer = ({
205
216
  }), (0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, {
206
217
  title: translate("Scroll left"),
207
218
  className: (0, classNames_1.classNames)(["zen-filters-toolbar__scroller", driveClassNameScroller || "", "zen-filters-toolbar__start", showLeft ? `${scrollerClass}--visible` : "", isHiddenDisplay.left ? `${scrollerClass}--hidden` : ""]),
208
- icon: iconChevronRight_1.IconChevronRight,
219
+ icon: startScrollIcon,
209
220
  iconPosition: textIconButton_1.ButtonIconPosition.Start,
210
- onClick: handleScrollButtonClick(-scrollableStep),
211
- iconClasses: "zen-filters-toolbar__start-icon"
221
+ onClick: handleScrollButtonClick(-scrollableStep)
212
222
  }), (0, jsx_runtime_1.jsx)("div", {
213
223
  ref: scrollableRef,
214
224
  className: (0, classNames_1.classNames)(["zen-filters-toolbar__scrollable", !isHiddenDisplay.left ? "has-left-scroller" : "", !isHiddenDisplay.right ? "has-right-scroller" : ""]),
@@ -221,7 +231,7 @@ const FiltersContainer = ({
221
231
  }), (0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, {
222
232
  title: translate("Scroll right"),
223
233
  className: (0, classNames_1.classNames)([scrollerClass, driveClassNameScroller || "", "zen-filters-toolbar__end", showRight ? `${scrollerClass}--visible` : "", isHiddenDisplay.right ? `${scrollerClass}--hidden` : ""]),
224
- icon: iconChevronRight_1.IconChevronRight,
234
+ icon: endScrollIcon,
225
235
  onClick: handleScrollButtonClick(scrollableStep),
226
236
  iconPosition: textIconButton_1.ButtonIconPosition.End
227
237
  })]