@geotab/zenith 3.11.0 → 3.11.1-beta.0

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 (93) hide show
  1. package/README.md +8 -0
  2. package/dist/checkboxListWithAction/checkboxListWithAction.js +26 -27
  3. package/dist/dataGrid/withFlexibleColumns/components/columnSettingsList.js +116 -44
  4. package/dist/index.css +4 -1
  5. package/dist/pillExpandable/pillExpandable.js +1 -36
  6. package/dist/pillExpandable/pillExpandableSimple.d.ts +1 -2
  7. package/dist/pillExpandable/pillExpandableSimple.js +5 -3
  8. package/dist/selectList/selectList.actionTypes.d.ts +6 -1
  9. package/dist/selectList/selectList.actionTypes.js +1 -0
  10. package/dist/selectList/selectList.d.ts +1 -1
  11. package/dist/selectList/selectList.helpers.d.ts +1 -1
  12. package/dist/selectList/selectList.helpers.js +29 -4
  13. package/dist/selectList/selectList.js +464 -125
  14. package/dist/selectList/selectList.reducer.js +3 -2
  15. package/dist/selectList/selectListItem.d.ts +2 -1
  16. package/dist/selectList/selectListItem.js +19 -2
  17. package/dist/sortControl/sortControl.js +58 -2
  18. package/dist/summaryTile/summaryTile.d.ts +3 -1
  19. package/dist/summaryTile/summaryTile.js +2 -1
  20. package/dist/table/flexible/columnsList.js +4 -2
  21. package/dist/utils/localization/translations/ar.json +5 -1
  22. package/dist/utils/localization/translations/cs.json +5 -1
  23. package/dist/utils/localization/translations/da-DK.json +5 -1
  24. package/dist/utils/localization/translations/de.json +5 -1
  25. package/dist/utils/localization/translations/en.json +5 -1
  26. package/dist/utils/localization/translations/es.json +5 -1
  27. package/dist/utils/localization/translations/fi-FI.json +5 -1
  28. package/dist/utils/localization/translations/fr-FR.json +5 -1
  29. package/dist/utils/localization/translations/fr.json +5 -1
  30. package/dist/utils/localization/translations/hu-HU.json +5 -1
  31. package/dist/utils/localization/translations/id.json +5 -1
  32. package/dist/utils/localization/translations/it.json +5 -1
  33. package/dist/utils/localization/translations/ja.json +5 -1
  34. package/dist/utils/localization/translations/ko-KR.json +5 -1
  35. package/dist/utils/localization/translations/ms.json +5 -1
  36. package/dist/utils/localization/translations/nb-NO.json +5 -1
  37. package/dist/utils/localization/translations/nl.json +5 -1
  38. package/dist/utils/localization/translations/pl.json +5 -1
  39. package/dist/utils/localization/translations/pt-BR.json +5 -1
  40. package/dist/utils/localization/translations/pt-PT.json +5 -1
  41. package/dist/utils/localization/translations/ro-RO.json +5 -1
  42. package/dist/utils/localization/translations/sk-SK.json +5 -1
  43. package/dist/utils/localization/translations/sv.json +5 -1
  44. package/dist/utils/localization/translations/th.json +5 -1
  45. package/dist/utils/localization/translations/tr.json +5 -1
  46. package/dist/utils/localization/translations/zh-Hans.json +5 -1
  47. package/dist/utils/localization/translations/zh-TW.json +5 -1
  48. package/esm/checkboxListWithAction/checkboxListWithAction.js +26 -27
  49. package/esm/dataGrid/withFlexibleColumns/components/columnSettingsList.js +110 -43
  50. package/esm/pillExpandable/pillExpandable.js +1 -36
  51. package/esm/pillExpandable/pillExpandableSimple.d.ts +1 -2
  52. package/esm/pillExpandable/pillExpandableSimple.js +5 -3
  53. package/esm/selectList/selectList.actionTypes.d.ts +6 -1
  54. package/esm/selectList/selectList.actionTypes.js +1 -0
  55. package/esm/selectList/selectList.d.ts +1 -1
  56. package/esm/selectList/selectList.helpers.d.ts +1 -1
  57. package/esm/selectList/selectList.helpers.js +29 -4
  58. package/esm/selectList/selectList.js +460 -126
  59. package/esm/selectList/selectList.reducer.js +3 -2
  60. package/esm/selectList/selectListItem.d.ts +2 -1
  61. package/esm/selectList/selectListItem.js +19 -2
  62. package/esm/sortControl/sortControl.js +58 -2
  63. package/esm/summaryTile/summaryTile.d.ts +3 -1
  64. package/esm/summaryTile/summaryTile.js +2 -1
  65. package/esm/table/flexible/columnsList.js +4 -2
  66. package/esm/utils/localization/translations/ar.json +5 -1
  67. package/esm/utils/localization/translations/cs.json +5 -1
  68. package/esm/utils/localization/translations/da-DK.json +5 -1
  69. package/esm/utils/localization/translations/de.json +5 -1
  70. package/esm/utils/localization/translations/en.json +5 -1
  71. package/esm/utils/localization/translations/es.json +5 -1
  72. package/esm/utils/localization/translations/fi-FI.json +5 -1
  73. package/esm/utils/localization/translations/fr-FR.json +5 -1
  74. package/esm/utils/localization/translations/fr.json +5 -1
  75. package/esm/utils/localization/translations/hu-HU.json +5 -1
  76. package/esm/utils/localization/translations/id.json +5 -1
  77. package/esm/utils/localization/translations/it.json +5 -1
  78. package/esm/utils/localization/translations/ja.json +5 -1
  79. package/esm/utils/localization/translations/ko-KR.json +5 -1
  80. package/esm/utils/localization/translations/ms.json +5 -1
  81. package/esm/utils/localization/translations/nb-NO.json +5 -1
  82. package/esm/utils/localization/translations/nl.json +5 -1
  83. package/esm/utils/localization/translations/pl.json +5 -1
  84. package/esm/utils/localization/translations/pt-BR.json +5 -1
  85. package/esm/utils/localization/translations/pt-PT.json +5 -1
  86. package/esm/utils/localization/translations/ro-RO.json +5 -1
  87. package/esm/utils/localization/translations/sk-SK.json +5 -1
  88. package/esm/utils/localization/translations/sv.json +5 -1
  89. package/esm/utils/localization/translations/th.json +5 -1
  90. package/esm/utils/localization/translations/tr.json +5 -1
  91. package/esm/utils/localization/translations/zh-Hans.json +5 -1
  92. package/esm/utils/localization/translations/zh-TW.json +5 -1
  93. package/package.json +1 -1
package/README.md CHANGED
@@ -47,6 +47,14 @@ Zenith library provides components defined in Zenith Design System. It includes
47
47
 
48
48
  ## Change log
49
49
 
50
+ ### 3.11.1
51
+
52
+ - Fix `SummaryTile` accessibility: add `tooltipAriaLabel` prop for accessible tooltip name
53
+ - Fix aria-label on generic div in zen-status-pill expand button
54
+ - Fix `SortControl` accessibility: remove redundant aria-label, add visually-hidden sort direction text
55
+ - Fix `SelectList` keyboard navigation: skip disabled items
56
+ - Fix column selection accessibility
57
+
50
58
  ### 3.11.0
51
59
 
52
60
  - Add `ControlledMenuList` component and `createMenuItem`/`createControlledMenuList` factories for typed, path-based menu navigation with keyboard support
@@ -192,18 +192,10 @@ const CheckboxListWithAction = ({
192
192
  });
193
193
  return elements;
194
194
  }, [options]);
195
- const updateTabIndex = (0, react_1.useCallback)((newRowIndex, newElementType) => {
196
- const elements = getFocusableElements();
197
- elements.forEach(({
198
- element,
199
- rowIndex,
200
- type,
201
- blocked
202
- }) => {
203
- const isActive = rowIndex === newRowIndex && type === newElementType && !blocked;
204
- element.setAttribute("tabindex", isActive ? "0" : "-1");
205
- });
206
- }, [getFocusableElements]);
195
+ const getTabIndex = (0, react_1.useCallback)((rowIndex, elementType, blocked) => {
196
+ if (blocked) return -1;
197
+ return rowIndex === focusedRowIndex && elementType === focusedElementType ? 0 : -1;
198
+ }, [focusedRowIndex, focusedElementType]);
207
199
  const handleKeyDown = (0, react_1.useCallback)(
208
200
  // eslint-disable-next-line complexity
209
201
  e => {
@@ -277,7 +269,6 @@ const CheckboxListWithAction = ({
277
269
  e.preventDefault();
278
270
  setFocusedRowIndex(newRowIndex);
279
271
  setFocusedElementType(newElementType);
280
- updateTabIndex(newRowIndex, newElementType);
281
272
  // Find and focus the target element
282
273
  const targetElement = elements.find(({
283
274
  rowIndex,
@@ -286,7 +277,7 @@ const CheckboxListWithAction = ({
286
277
  }) => rowIndex === newRowIndex && type === newElementType && !blocked);
287
278
  targetElement === null || targetElement === void 0 ? void 0 : targetElement.element.focus();
288
279
  }
289
- }, [getFocusableElements, options, focusedRowIndex, focusedElementType, checkboxId, onChange, handleTab, updateTabIndex]);
280
+ }, [getFocusableElements, options, focusedRowIndex, focusedElementType, checkboxId, onChange, handleTab]);
290
281
  const handleFocus = (0, react_1.useCallback)(e => {
291
282
  const elements = getFocusableElements();
292
283
  const focusedElement = e.target;
@@ -296,10 +287,9 @@ const CheckboxListWithAction = ({
296
287
  if (targetElementInfo && !targetElementInfo.blocked && (targetElementInfo.rowIndex !== focusedRowIndex || targetElementInfo.type !== focusedElementType)) {
297
288
  setFocusedRowIndex(targetElementInfo.rowIndex);
298
289
  setFocusedElementType(targetElementInfo.type);
299
- updateTabIndex(targetElementInfo.rowIndex, targetElementInfo.type);
300
290
  }
301
- }, [focusedRowIndex, focusedElementType, getFocusableElements, updateTabIndex]);
302
- // Initialize tabindex when options first become available
291
+ }, [focusedRowIndex, focusedElementType, getFocusableElements]);
292
+ // Initialize focusedRowIndex when options first become available
303
293
  (0, react_1.useEffect)(() => {
304
294
  if (options && options.length > 0 && !isInitialized.current) {
305
295
  // Find first non-blocked row
@@ -310,17 +300,25 @@ const CheckboxListWithAction = ({
310
300
  if (firstValidRow < options.length) {
311
301
  setFocusedRowIndex(firstValidRow);
312
302
  setFocusedElementType("checkbox");
313
- updateTabIndex(firstValidRow, "checkbox");
314
303
  isInitialized.current = true;
315
304
  }
316
305
  }
317
- }, [options, updateTabIndex]);
318
- // Update tabindex when focused position changes (only after initialization)
306
+ }, [options]);
307
+ // Correct focusedRowIndex if options shrinks or the focused row becomes blocked after init
319
308
  (0, react_1.useEffect)(() => {
320
- if (isInitialized.current) {
321
- updateTabIndex(focusedRowIndex, focusedElementType);
309
+ if (!isInitialized.current || !options || options.length === 0) {
310
+ return;
311
+ }
312
+ const isInBounds = focusedRowIndex < options.length;
313
+ if (isInBounds && !options[focusedRowIndex].blocked) {
314
+ return;
315
+ }
316
+ const firstValid = options.findIndex(opt => !opt.blocked);
317
+ if (firstValid >= 0) {
318
+ setFocusedRowIndex(firstValid);
319
+ setFocusedElementType("checkbox");
322
320
  }
323
- }, [focusedRowIndex, focusedElementType, updateTabIndex]);
321
+ }, [options, focusedRowIndex]);
324
322
  const getLabelColorInfo = (color, withRightPadding, isHidden, extraArgs) => {
325
323
  if (!color) {
326
324
  return null;
@@ -350,7 +348,7 @@ const CheckboxListWithAction = ({
350
348
  })
351
349
  }));
352
350
  };
353
- const renderLabel = (option, lbl, ttl) => {
351
+ const renderLabel = (option, lbl, ttl, rowIndex) => {
354
352
  const additionalTitle = option.countSelectedChild && option.isWithAction ? translate("Number of selected child groups - {count}").replace("{count}", option.countSelectedChild.toString()) : "";
355
353
  const title = option.isWithAction ? translate("View {groupName} children").replace("{groupName}", ttl).concat(additionalTitle ? `${". "}${additionalTitle}` : "") : translate("Toggle {groupName} filter").replace("{groupName}", ttl);
356
354
  const classN = (0, classNames_1.classNames)(["zen-checkbox-list-with-action__label", "zen-ellipsis", option.isWithAction ? "zen-checkbox-list-with-action__label--action" : ""]);
@@ -379,7 +377,8 @@ const CheckboxListWithAction = ({
379
377
  onClick: handleClick,
380
378
  title: title,
381
379
  className: classN,
382
- tabIndex: -1
380
+ tabIndex: getTabIndex(rowIndex, "button", option.blocked),
381
+ disabled: option.blocked
383
382
  }, otherArgs, {
384
383
  children: childEl
385
384
  })) : (0, jsx_runtime_1.jsx)("div", {
@@ -415,7 +414,7 @@ const CheckboxListWithAction = ({
415
414
  children: optionsArr.map((opt, ind) => {
416
415
  const titleForRender = opt.title || opt.label;
417
416
  const labelForRender = selectSearchTerm(opt.label);
418
- const labelElement = renderLabel(opt, labelForRender, titleForRender);
417
+ const labelElement = renderLabel(opt, labelForRender, titleForRender, ind);
419
418
  return (0, jsx_runtime_1.jsxs)("li", {
420
419
  className: (0, classNames_1.classNames)(["zen-checkbox-list-with-action__action-item", opt.isWithAction ? "zen-checkbox-list-with-action__action-item--action" : ""]),
421
420
  "data-item": opt.property,
@@ -429,7 +428,7 @@ const CheckboxListWithAction = ({
429
428
  title: translate("Toggle {groupName} filter").replace("{groupName}", titleForRender),
430
429
  describedBy: opt.isWithAction ? navigationInstructionsId : undefined,
431
430
  "data-indeterminate": opt.partialChecked,
432
- tabIndex: -1,
431
+ tabIndex: getTabIndex(ind, "checkbox", opt.blocked),
433
432
  children: opt.isWithAction ? null : labelElement
434
433
  }), opt.isWithAction && labelElement]
435
434
  }, `li_${ind}_${opt.property}`);
@@ -1,54 +1,126 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ const {
4
+ injectString
5
+ } = require("../../../utils/localization/translationsDictionary");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
3
9
  exports.ColumnSettingsList = void 0;
4
10
  const jsx_runtime_1 = require("react/jsx-runtime");
5
11
  const react_1 = require("react");
6
12
  const groupColumns_1 = require("../../extensions/groupColumns");
7
13
  const selectList_1 = require("../../../selectList/selectList");
8
14
  const checkboxState_1 = require("../../../checkbox/checkboxState");
9
- const SubColumnsList = ({ title, columns, settings, disabledColumns, onChange, sortColumns }) => {
10
- const id = (0, react_1.useId)();
11
- const sortColumnsInt = (0, react_1.useCallback)((a, b) => {
12
- if (sortColumns) {
13
- return sortColumns(a.title, b.title);
14
- }
15
- return 0;
16
- }, [sortColumns]);
17
- const items = (0, react_1.useMemo)(() => columns.sort(sortColumnsInt).map(c => ({
18
- id: c.id,
19
- title: c.title,
20
- disabled: (disabledColumns === null || disabledColumns === void 0 ? void 0 : disabledColumns.includes(c.name)) || false,
21
- showCheckbox: true,
22
- children: c.title
23
- })), [columns, disabledColumns, sortColumnsInt]);
24
- const state = columns.reduce((res, c) => {
25
- res.set(c.id, settings.get(c.name) !== false ? checkboxState_1.CheckboxState.On : checkboxState_1.CheckboxState.Off);
26
- return res;
27
- }, new Map());
28
- const onChangeItem = (0, react_1.useCallback)((newState) => {
29
- const newSettings = new Map(settings);
30
- newState.forEach((stateVal, itemId) => {
31
- var _a;
32
- newSettings.set((_a = columns.find(c => c.id === itemId)) === null || _a === void 0 ? void 0 : _a.name, stateVal === checkboxState_1.CheckboxState.On);
33
- });
34
- onChange && onChange(newSettings);
35
- }, [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
- if (!title) {
38
- return list;
15
+ injectString("cs", "Select visible columns", "Vyberte viditeln\xE9 sloupce");
16
+ injectString("da-DK", "Select visible columns", "V\xE6lg synlige kolonner");
17
+ injectString("de", "Select visible columns", "Sichtbare Spalten ausw\xE4hlen");
18
+ injectString("en", "Select visible columns", "Select visible columns");
19
+ injectString("es", "Select visible columns", "Seleccionar columnas visibles");
20
+ injectString("fi-FI", "Select visible columns", "Valitse n\xE4kyv\xE4t sarakkeet");
21
+ injectString("fr", "Select visible columns", "S\xE9lectionner les colonnes visibles");
22
+ injectString("fr-FR", "Select visible columns", "S\xE9lectionner les colonnes visibles");
23
+ injectString("hu-HU", "Select visible columns", "L\xE1that\xF3 oszlopok kiv\xE1laszt\xE1sa");
24
+ injectString("id", "Select visible columns", "Pilih kolom yang terlihat");
25
+ injectString("it", "Select visible columns", "Selezionare colonne visibili");
26
+ injectString("ja", "Select visible columns", "\u8868\u793A\u5217\u3092\u9078\u629E");
27
+ injectString("ko-KR", "Select visible columns", "\uD45C\uC2DC\uB418\uB294 \uC5F4 \uC120\uD0DD");
28
+ injectString("ms", "Select visible columns", "Pilih lajur yang boleh dilihat");
29
+ injectString("nb-NO", "Select visible columns", "Velg synlige kolonner");
30
+ injectString("nl", "Select visible columns", "Zichtbare kolommen selecteren");
31
+ injectString("pl", "Select visible columns", "Wybierz widoczne kolumny");
32
+ injectString("pt-BR", "Select visible columns", "Selecionar colunas vis\xEDveis");
33
+ injectString("pt-PT", "Select visible columns", "Selecionar colunas vis\xEDveis");
34
+ injectString("sk-SK", "Select visible columns", "Vybra\u0165 vidite\u013En\xE9 st\u013Apce");
35
+ injectString("sv", "Select visible columns", "V\xE4lj synbara kolumner");
36
+ injectString("th", "Select visible columns", "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E17\u0E35\u0E48\u0E21\u0E2D\u0E07\u0E40\u0E2B\u0E47\u0E19\u0E44\u0E14\u0E49");
37
+ injectString("tr", "Select visible columns", "G\xF6r\xFCn\xFCr s\xFCtunlar\u0131 se\xE7");
38
+ injectString("zh-Hans", "Select visible columns", "\u9009\u62E9\u53EF\u89C1\u5217");
39
+ injectString("zh-TW", "Select visible columns", "\u9078\u53D6\u53EF\u898B\u6B04");
40
+ injectString("ro-RO", "Select visible columns", "Selecta\u021Bi coloanele vizibile");
41
+ injectString("ar-SA", "Select visible columns", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0627\u0644\u0645\u0631\u0626\u064A\u0629");
42
+ const useLanguage_1 = require("../../../utils/localization/useLanguage");
43
+ const SubColumnsList = ({
44
+ title,
45
+ columns,
46
+ settings,
47
+ disabledColumns,
48
+ onChange,
49
+ sortColumns
50
+ }) => {
51
+ const id = (0, react_1.useId)();
52
+ const {
53
+ translate
54
+ } = (0, useLanguage_1.useLanguage)();
55
+ const sortColumnsInt = (0, react_1.useCallback)((a, b) => {
56
+ if (sortColumns) {
57
+ return sortColumns(a.title, b.title);
39
58
  }
40
- return ((0, jsx_runtime_1.jsxs)("div", { className: "zen-columns-list__sub-section", children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-columns-list__title zen-ellipsis", children: title }), list] }));
59
+ return 0;
60
+ }, [sortColumns]);
61
+ const items = (0, react_1.useMemo)(() => columns.sort(sortColumnsInt).map(c => ({
62
+ id: c.id,
63
+ title: c.title,
64
+ disabled: (disabledColumns === null || disabledColumns === void 0 ? void 0 : disabledColumns.includes(c.name)) || false,
65
+ showCheckbox: true,
66
+ children: c.title
67
+ })), [columns, disabledColumns, sortColumnsInt]);
68
+ const allDisabled = (0, react_1.useMemo)(() => items.every(item => item.disabled), [items]);
69
+ const state = columns.reduce((res, c) => {
70
+ res.set(c.id, settings.get(c.name) !== false ? checkboxState_1.CheckboxState.On : checkboxState_1.CheckboxState.Off);
71
+ return res;
72
+ }, new Map());
73
+ const onChangeItem = (0, react_1.useCallback)(newState => {
74
+ const newSettings = new Map(settings);
75
+ newState.forEach((stateVal, itemId) => {
76
+ var _a;
77
+ newSettings.set((_a = columns.find(c => c.id === itemId)) === null || _a === void 0 ? void 0 : _a.name, stateVal === checkboxState_1.CheckboxState.On);
78
+ });
79
+ onChange && onChange(newSettings);
80
+ }, [columns, settings, onChange]);
81
+ const list = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(selectList_1.SelectList, {
82
+ id: id,
83
+ items: items,
84
+ value: state,
85
+ title: title || translate("Select visible columns"),
86
+ multiselect: true,
87
+ showCheckbox: true,
88
+ onChange: onChangeItem,
89
+ disabled: allDisabled
90
+ }), [id, items, state, title, translate, onChangeItem, allDisabled]);
91
+ if (!title) {
92
+ return list;
93
+ }
94
+ return (0, jsx_runtime_1.jsxs)("div", {
95
+ className: "zen-columns-list__sub-section",
96
+ children: [(0, jsx_runtime_1.jsx)("div", {
97
+ className: "zen-columns-list__title zen-ellipsis",
98
+ children: title
99
+ }), list]
100
+ });
41
101
  };
42
- function ColumnSettingsList({ columns, settings, disabledColumns, onChange, sortGroups, sortColumns }) {
43
- const groupped = (0, groupColumns_1.groupColumns)(columns);
44
- const sortGroupsInt = (0, react_1.useCallback)((a, b) => {
45
- if (sortGroups) {
46
- return sortGroups(a[0], b[0]);
47
- }
48
- return 0;
49
- }, [sortGroups]);
50
- return Array.from(groupped.entries())
51
- .sort(sortGroupsInt)
52
- .map(([title, cs]) => ((0, jsx_runtime_1.jsx)(SubColumnsList, { title: title, columns: cs, settings: settings, disabledColumns: disabledColumns, onChange: onChange, sortColumns: sortColumns }, cs.map(c => c.id).join("-"))));
102
+ function ColumnSettingsList({
103
+ columns,
104
+ settings,
105
+ disabledColumns,
106
+ onChange,
107
+ sortGroups,
108
+ sortColumns
109
+ }) {
110
+ const groupped = (0, groupColumns_1.groupColumns)(columns);
111
+ const sortGroupsInt = (0, react_1.useCallback)((a, b) => {
112
+ if (sortGroups) {
113
+ return sortGroups(a[0], b[0]);
114
+ }
115
+ return 0;
116
+ }, [sortGroups]);
117
+ return Array.from(groupped.entries()).sort(sortGroupsInt).map(([title, cs]) => (0, jsx_runtime_1.jsx)(SubColumnsList, {
118
+ title: title,
119
+ columns: cs,
120
+ settings: settings,
121
+ disabledColumns: disabledColumns,
122
+ onChange: onChange,
123
+ sortColumns: sortColumns
124
+ }, cs.map(c => c.id).join("-")));
53
125
  }
54
- exports.ColumnSettingsList = ColumnSettingsList;
126
+ exports.ColumnSettingsList = ColumnSettingsList;
package/dist/index.css CHANGED
@@ -5008,7 +5008,10 @@ html:lang(ar) .zen-select-item {
5008
5008
  .zen-select-item:not(.zen-select-item--with-checkbox).zen-select-item--focused[aria-selected="true"] > .zen-select-item__wrapper {
5009
5009
  background-color: var(--action-primary--hover);
5010
5010
  }
5011
- .zen-select-item--focused .zen-select-item__wrapper {
5011
+ .zen-select-item--focused:not(.zen-select-item--with-checkbox) > .zen-select-item__wrapper {
5012
+ background-color: var(--backgrounds-hover);
5013
+ }
5014
+ .zen-select-item--focused.zen-select-item--with-checkbox:focus > .zen-select-item__wrapper {
5012
5015
  background-color: var(--backgrounds-hover);
5013
5016
  }
5014
5017
  .zen-select-item .zen-select-item__wrapper--with-arrow {
@@ -35,33 +35,6 @@ injectString("zh-Hans", "View all", "\u67E5\u770B\u5168\u90E8");
35
35
  injectString("zh-TW", "View all", "\u6AA2\u8996\u5168\u90E8");
36
36
  injectString("ro-RO", "View all", "Vezi tot");
37
37
  injectString("ar-SA", "View all", "\u0639\u0631\u0636 \u0627\u0644\u0643\u0644");
38
- injectString("cs", "Expand", "Rozbalit");
39
- injectString("da-DK", "Expand", "Udvid");
40
- injectString("de", "Expand", "Erweitern");
41
- injectString("en", "Expand", "Expand");
42
- injectString("es", "Expand", "Expandir");
43
- injectString("fi-FI", "Expand", "Laajenna");
44
- injectString("fr", "Expand", "D\xE9velopper");
45
- injectString("fr-FR", "Expand", "D\xE9velopper");
46
- injectString("hu-HU", "Expand", "B\u0151v\xEDtsd ki");
47
- injectString("id", "Expand", "Perluas");
48
- injectString("it", "Expand", "Espandere");
49
- injectString("ja", "Expand", "\u5C55\u958B");
50
- injectString("ko-KR", "Expand", "\uD655\uC7A5");
51
- injectString("ms", "Expand", "Kembangkan");
52
- injectString("nb-NO", "Expand", "Utvide");
53
- injectString("nl", "Expand", "Uitvouwen");
54
- injectString("pl", "Expand", "Rozwi\u0144");
55
- injectString("pt-BR", "Expand", "Expandir");
56
- injectString("pt-PT", "Expand", "Expandir");
57
- injectString("sk-SK", "Expand", "Roz\u0161\xEDr.");
58
- injectString("sv", "Expand", "Expandera");
59
- injectString("th", "Expand", "\u0E02\u0E22\u0E32\u0E22");
60
- injectString("tr", "Expand", "Geni\u015Flet");
61
- injectString("zh-Hans", "Expand", "\u5C55\u5F00");
62
- injectString("zh-TW", "Expand", "\u5C55\u958B");
63
- injectString("ro-RO", "Expand", "Extinde\u021Bi");
64
- injectString("ar-SA", "Expand", "\u062A\u0648\u0633\u064A\u0639");
65
38
  const react_1 = require("react");
66
39
  const absolute_1 = require("../absolute/absolute");
67
40
  const focusableSelector_1 = require("../utils/focusableSelector");
@@ -201,9 +174,6 @@ const PillExpandableChild = ({
201
174
  }) => {
202
175
  const pillId = (0, react_1.useId)();
203
176
  const descriptionId = (0, react_1.useId)();
204
- const {
205
- translate
206
- } = (0, useLanguage_1.useLanguage)();
207
177
  const {
208
178
  level,
209
179
  expandedChildPillIds,
@@ -256,7 +226,6 @@ const PillExpandableChild = ({
256
226
  text: text,
257
227
  expanded: isExpanded,
258
228
  onExpand: handleChildToggle,
259
- expandAriaText: translate("Expand"),
260
229
  type: type,
261
230
  errorHandler: errorHandler,
262
231
  descriptionId: descriptionId
@@ -439,9 +408,6 @@ const PillExpandableBase = ({
439
408
  }) => {
440
409
  const popupId = (0, react_1.useId)();
441
410
  const descriptionId = (0, react_1.useId)();
442
- const {
443
- translate
444
- } = (0, useLanguage_1.useLanguage)();
445
411
  const isDrive = (0, useDrive_1.useDrive)();
446
412
  const [isMobile, setIsMobile] = (0, react_1.useState)(false);
447
413
  const handleDeviceTypeChange = (0, react_1.useCallback)(deviceType => {
@@ -603,7 +569,6 @@ const PillExpandableBase = ({
603
569
  icon: effectiveIcon,
604
570
  text: text,
605
571
  expanded: isPopupOpen,
606
- expandAriaText: translate("Expand"),
607
572
  ref: triggerRef,
608
573
  type: type,
609
574
  errorHandler: errorHandler,
@@ -643,4 +608,4 @@ const PillExpandableBase = ({
643
608
  const PillExpandableMemo = (0, react_1.memo)(PillExpandableBase);
644
609
  PillExpandableMemo.displayName = "PillExpandable";
645
610
  exports.PillExpandable = PillExpandableMemo;
646
- exports.TRANSLATIONS = ["Expand", "View all"];
611
+ exports.TRANSLATIONS = ["View all"];
@@ -4,7 +4,6 @@ import { IIcon } from "../icons/icon";
4
4
  interface IPillExpandableSimple extends IPillExpandableBase {
5
5
  includeExpandIcon?: boolean;
6
6
  expanded?: boolean;
7
- expandAriaText?: string;
8
7
  onExpand?: () => void;
9
8
  icon?: FC<IIcon> | false;
10
9
  isBeta?: boolean;
@@ -14,7 +13,7 @@ interface IPillExpandableSimple extends IPillExpandableBase {
14
13
  type?: TPillType;
15
14
  }
16
15
  export declare const PillExpandableSimple: {
17
- ({ onExpand, expandAriaText, text, expanded, includeExpandIcon, type, icon, isBeta, isMobile, ref, className, descriptionId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
16
+ ({ onExpand, text, expanded, includeExpandIcon, type, icon, isBeta, isMobile, ref, className, descriptionId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
18
17
  displayName: string;
19
18
  };
20
19
  export {};
@@ -8,7 +8,9 @@ const iconChevronTop_1 = require("../icons/iconChevronTop");
8
8
  const iconChevronBottom_1 = require("../icons/iconChevronBottom");
9
9
  const iconException_1 = require("../icons/iconException");
10
10
  const classNames_1 = require("../commonHelpers/classNames/classNames");
11
- const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includeExpandIcon = true, type = "warning", icon = iconException_1.IconException, isBeta, isMobile, ref, className, descriptionId }) => {
11
+ const PillExpandableSimple = ({ onExpand, text, expanded, includeExpandIcon = true, type = "warning", icon = iconException_1.IconException, isBeta, isMobile, ref, className, descriptionId
12
+ // eslint-disable-next-line complexity
13
+ }) => {
12
14
  const iconDriveClassName = (0, useDriveClassName_1.useDriveClassName)("icon");
13
15
  const containerDriveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-status-pill__container");
14
16
  const onExpandHandler = (0, react_1.useCallback)(() => {
@@ -25,7 +27,7 @@ const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includ
25
27
  containerDriveClassName || "",
26
28
  className || "",
27
29
  "zen-ellipsis"
28
- ]), ref: ref, onClick: onExpandHandler, tabIndex: !includeExpandIcon ? -1 : undefined, "aria-describedby": descriptionId, children: [icon !== false && ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)([
30
+ ]), ref: ref, onClick: onExpandHandler, tabIndex: !includeExpandIcon ? -1 : undefined, "aria-expanded": includeExpandIcon ? (expanded !== null && expanded !== void 0 ? expanded : false) : undefined, "aria-describedby": descriptionId, children: [icon !== false && ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)([
29
31
  "zen-status-pill__icon",
30
32
  `zen-status-pill__icon--${type}`,
31
33
  isLargeIcon ? "zen-status-pill__icon--large" : "",
@@ -37,7 +39,7 @@ const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includ
37
39
  `zen-status-pill__text--${type}`,
38
40
  "zen-ellipsis",
39
41
  isTextCentered ? "zen-status-pill__text--centered" : ""
40
- ]), children: text })), includeExpandIcon && ((0, jsx_runtime_1.jsx)("div", { className: `zen-status-pill__expand-button zen-status-pill__expand-button--${type}`, "aria-label": expandAriaText, children: (0, jsx_runtime_1.jsx)("div", { className: "zen-status-pill__icon", children: (0, react_1.createElement)(ChevronIcon, {
42
+ ]), children: text })), includeExpandIcon && ((0, jsx_runtime_1.jsx)("div", { className: `zen-status-pill__expand-button zen-status-pill__expand-button--${type}`, children: (0, jsx_runtime_1.jsx)("div", { className: "zen-status-pill__icon", children: (0, react_1.createElement)(ChevronIcon, {
41
43
  size: iconSize
42
44
  }) }) }))] }));
43
45
  };
@@ -9,6 +9,7 @@ export declare enum ListAction {
9
9
  FocusPrev = "focusPrev",
10
10
  FocusNextPage = "focusNextPage",
11
11
  FocusPrevPage = "focusPrevPage",
12
+ FocusItem = "focusItem",
12
13
  SelectFirst = "selectFirst",
13
14
  SelectLast = "selectLast",
14
15
  SelectNext = "selectNext",
@@ -37,6 +38,9 @@ interface IToggleCurrentPayload {
37
38
  interface IFocusItemPayload {
38
39
  items: ISelectListItem[];
39
40
  }
41
+ interface IFocusItemByIndexPayload {
42
+ index: number;
43
+ }
40
44
  interface ISetLevelPayload {
41
45
  items: ISelectListItem[];
42
46
  }
@@ -75,6 +79,7 @@ interface IResetPayload {
75
79
  type TChangeItemStateAction = IAction<ListAction.ChangeItemState, IChangeItemStatePayload>;
76
80
  type TToggleCurrentAction = IAction<ListAction.ToggleCurrent, IToggleCurrentPayload>;
77
81
  type TFocusItemAction = IAction<ListAction.FocusFirst | ListAction.FocusLast | ListAction.FocusNext | ListAction.FocusPrev, IFocusItemPayload>;
82
+ type TFocusItemByIndexAction = IAction<ListAction.FocusItem, IFocusItemByIndexPayload>;
78
83
  type TFocusNextPageItemAction = IAction<ListAction.FocusNextPage | ListAction.FocusPrevPage, IFocusNextPageItemPayload>;
79
84
  type TSelectItemAction = IAction<ListAction.SelectFirst | ListAction.SelectLast | ListAction.SelectNext | ListAction.SelectPrev, ISelectItemPayload>;
80
85
  type TSelectItemsAction = IAction<ListAction.SelectAllToTheBeginning | ListAction.SelectAllToTheEnd, ISelectItemsPayload>;
@@ -84,5 +89,5 @@ type TSetLevelAction = IAction<ListAction.SetLevel, ISetLevelPayload | undefined
84
89
  type TFocusAction = IAction<ListAction.Focus, IFocusPayload>;
85
90
  type TBlurAction = IAction<ListAction.Blur, IBlurPayload>;
86
91
  type TResetAction = IAction<ListAction.Reset, IResetPayload>;
87
- export type TAction = TChangeItemStateAction | TToggleCurrentAction | TFocusItemAction | TFocusNextPageItemAction | TSelectItemAction | TSelectItemsAction | TToggleAllAction | TSearchItemAction | TFocusAction | TBlurAction | TResetAction | TSetLevelAction;
92
+ export type TAction = TChangeItemStateAction | TToggleCurrentAction | TFocusItemAction | TFocusNextPageItemAction | TFocusItemByIndexAction | TSelectItemAction | TSelectItemsAction | TToggleAllAction | TSearchItemAction | TFocusAction | TBlurAction | TResetAction | TSetLevelAction;
88
93
  export {};
@@ -11,6 +11,7 @@ var ListAction;
11
11
  ListAction["FocusPrev"] = "focusPrev";
12
12
  ListAction["FocusNextPage"] = "focusNextPage";
13
13
  ListAction["FocusPrevPage"] = "focusPrevPage";
14
+ ListAction["FocusItem"] = "focusItem";
14
15
  ListAction["SelectFirst"] = "selectFirst";
15
16
  ListAction["SelectLast"] = "selectLast";
16
17
  ListAction["SelectNext"] = "selectNext";
@@ -36,6 +36,6 @@ export interface IListStateProps {
36
36
  items: ISelectListItem[];
37
37
  }
38
38
  export declare const defaultListItemHeight = 40;
39
- export declare const SelectList: ({ items: outerItems, value, multiselect, selectItemOnFocus, forceSelection, disabled, onChange, onClick, ...rest }: ISelectList) => import("react/jsx-runtime").JSX.Element;
39
+ export declare const SelectList: ({ items: outerItems, value, multiselect, selectItemOnFocus, forceSelection, showCheckbox, disabled, onChange, onClick, ...rest }: ISelectList) => import("react/jsx-runtime").JSX.Element;
40
40
  export declare const PassiveSelectList: (props: any) => import("react/jsx-runtime").JSX.Element;
41
41
  export {};
@@ -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,22 +42,47 @@ 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) => {