@geotab/zenith 3.11.0 → 3.11.1
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.
- package/README.md +8 -0
- package/dist/checkboxListWithAction/checkboxListWithAction.js +26 -27
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsList.js +116 -44
- package/dist/dataGrid/withFlexibleColumns/withFlexibleColumns.js +219 -133
- package/dist/index.css +4 -1
- package/dist/pillExpandable/pillExpandable.js +1 -36
- package/dist/pillExpandable/pillExpandableSimple.d.ts +1 -2
- package/dist/pillExpandable/pillExpandableSimple.js +5 -3
- package/dist/selectList/selectList.actionTypes.d.ts +6 -1
- package/dist/selectList/selectList.actionTypes.js +1 -0
- package/dist/selectList/selectList.d.ts +1 -1
- package/dist/selectList/selectList.helpers.d.ts +1 -1
- package/dist/selectList/selectList.helpers.js +29 -4
- package/dist/selectList/selectList.js +467 -125
- package/dist/selectList/selectList.reducer.js +3 -2
- package/dist/selectList/selectListItem.d.ts +2 -1
- package/dist/selectList/selectListItem.js +19 -2
- package/dist/sortControl/sortControl.js +58 -2
- package/dist/summaryTile/summaryTile.d.ts +3 -1
- package/dist/summaryTile/summaryTile.js +2 -1
- package/dist/table/flexible/columnsList.js +4 -2
- package/dist/utils/localization/translations/ar.json +5 -1
- package/dist/utils/localization/translations/cs.json +5 -1
- package/dist/utils/localization/translations/da-DK.json +5 -1
- package/dist/utils/localization/translations/de.json +5 -1
- package/dist/utils/localization/translations/en.json +5 -1
- package/dist/utils/localization/translations/es.json +5 -1
- package/dist/utils/localization/translations/fi-FI.json +5 -1
- package/dist/utils/localization/translations/fr-FR.json +5 -1
- package/dist/utils/localization/translations/fr.json +5 -1
- package/dist/utils/localization/translations/hu-HU.json +5 -1
- package/dist/utils/localization/translations/id.json +5 -1
- package/dist/utils/localization/translations/it.json +5 -1
- package/dist/utils/localization/translations/ja.json +5 -1
- package/dist/utils/localization/translations/ko-KR.json +5 -1
- package/dist/utils/localization/translations/ms.json +5 -1
- package/dist/utils/localization/translations/nb-NO.json +5 -1
- package/dist/utils/localization/translations/nl.json +5 -1
- package/dist/utils/localization/translations/pl.json +5 -1
- package/dist/utils/localization/translations/pt-BR.json +5 -1
- package/dist/utils/localization/translations/pt-PT.json +5 -1
- package/dist/utils/localization/translations/ro-RO.json +5 -1
- package/dist/utils/localization/translations/sk-SK.json +5 -1
- package/dist/utils/localization/translations/sv.json +5 -1
- package/dist/utils/localization/translations/th.json +5 -1
- package/dist/utils/localization/translations/tr.json +5 -1
- package/dist/utils/localization/translations/zh-Hans.json +5 -1
- package/dist/utils/localization/translations/zh-TW.json +5 -1
- package/esm/checkboxListWithAction/checkboxListWithAction.js +26 -27
- package/esm/dataGrid/withFlexibleColumns/components/columnSettingsList.js +110 -43
- package/esm/dataGrid/withFlexibleColumns/withFlexibleColumns.js +213 -132
- package/esm/pillExpandable/pillExpandable.js +1 -36
- package/esm/pillExpandable/pillExpandableSimple.d.ts +1 -2
- package/esm/pillExpandable/pillExpandableSimple.js +5 -3
- package/esm/selectList/selectList.actionTypes.d.ts +6 -1
- package/esm/selectList/selectList.actionTypes.js +1 -0
- package/esm/selectList/selectList.d.ts +1 -1
- package/esm/selectList/selectList.helpers.d.ts +1 -1
- package/esm/selectList/selectList.helpers.js +29 -4
- package/esm/selectList/selectList.js +463 -126
- package/esm/selectList/selectList.reducer.js +3 -2
- package/esm/selectList/selectListItem.d.ts +2 -1
- package/esm/selectList/selectListItem.js +19 -2
- package/esm/sortControl/sortControl.js +58 -2
- package/esm/summaryTile/summaryTile.d.ts +3 -1
- package/esm/summaryTile/summaryTile.js +2 -1
- package/esm/table/flexible/columnsList.js +4 -2
- package/esm/utils/localization/translations/ar.json +5 -1
- package/esm/utils/localization/translations/cs.json +5 -1
- package/esm/utils/localization/translations/da-DK.json +5 -1
- package/esm/utils/localization/translations/de.json +5 -1
- package/esm/utils/localization/translations/en.json +5 -1
- package/esm/utils/localization/translations/es.json +5 -1
- package/esm/utils/localization/translations/fi-FI.json +5 -1
- package/esm/utils/localization/translations/fr-FR.json +5 -1
- package/esm/utils/localization/translations/fr.json +5 -1
- package/esm/utils/localization/translations/hu-HU.json +5 -1
- package/esm/utils/localization/translations/id.json +5 -1
- package/esm/utils/localization/translations/it.json +5 -1
- package/esm/utils/localization/translations/ja.json +5 -1
- package/esm/utils/localization/translations/ko-KR.json +5 -1
- package/esm/utils/localization/translations/ms.json +5 -1
- package/esm/utils/localization/translations/nb-NO.json +5 -1
- package/esm/utils/localization/translations/nl.json +5 -1
- package/esm/utils/localization/translations/pl.json +5 -1
- package/esm/utils/localization/translations/pt-BR.json +5 -1
- package/esm/utils/localization/translations/pt-PT.json +5 -1
- package/esm/utils/localization/translations/ro-RO.json +5 -1
- package/esm/utils/localization/translations/sk-SK.json +5 -1
- package/esm/utils/localization/translations/sv.json +5 -1
- package/esm/utils/localization/translations/th.json +5 -1
- package/esm/utils/localization/translations/tr.json +5 -1
- package/esm/utils/localization/translations/zh-Hans.json +5 -1
- package/esm/utils/localization/translations/zh-TW.json +5 -1
- 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
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
|
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
|
|
302
|
-
// Initialize
|
|
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
|
|
318
|
-
//
|
|
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
|
-
|
|
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
|
-
}, [
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
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({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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;
|