@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
|
@@ -239,6 +239,8 @@
|
|
|
239
239
|
"This field is required.": "Bu alan zorunludur.",
|
|
240
240
|
"On": "Açık",
|
|
241
241
|
"Off": "Kapalı",
|
|
242
|
+
"Checked": "İşaretlendi",
|
|
243
|
+
"Unchecked": "İşaretlenmedi",
|
|
242
244
|
"Scroll left": "Sola kaydır",
|
|
243
245
|
"Scroll right": "Sağa Kaydır",
|
|
244
246
|
"Send feedback": "Geri bildirim gönder",
|
|
@@ -323,5 +325,7 @@
|
|
|
323
325
|
"Supported Formats:": "Supported Formats:",
|
|
324
326
|
"Upload files.": "Upload files.",
|
|
325
327
|
"File upload area": "File upload area",
|
|
326
|
-
"Uploaded": "Uploaded"
|
|
328
|
+
"Uploaded": "Uploaded",
|
|
329
|
+
"Ascending": "Artan",
|
|
330
|
+
"Descending": "Azalan"
|
|
327
331
|
}
|
|
@@ -239,6 +239,8 @@
|
|
|
239
239
|
"This field is required.": "该字段为必填项。",
|
|
240
240
|
"On": "开启",
|
|
241
241
|
"Off": "关闭",
|
|
242
|
+
"Checked": "已选中",
|
|
243
|
+
"Unchecked": "未选中",
|
|
242
244
|
"Scroll left": "向左滚动",
|
|
243
245
|
"Scroll right": "向右滚动",
|
|
244
246
|
"Send feedback": "发送反馈",
|
|
@@ -323,5 +325,7 @@
|
|
|
323
325
|
"Supported Formats:": "Supported Formats:",
|
|
324
326
|
"Upload files.": "Upload files.",
|
|
325
327
|
"File upload area": "File upload area",
|
|
326
|
-
"Uploaded": "Uploaded"
|
|
328
|
+
"Uploaded": "Uploaded",
|
|
329
|
+
"Ascending": "升序",
|
|
330
|
+
"Descending": "降序"
|
|
327
331
|
}
|
|
@@ -248,6 +248,8 @@
|
|
|
248
248
|
"This field is required.": "此欄位為必填。",
|
|
249
249
|
"On": "開啟",
|
|
250
250
|
"Off": "關閉",
|
|
251
|
+
"Checked": "已勾選",
|
|
252
|
+
"Unchecked": "未勾選",
|
|
251
253
|
"Loading": "載入中",
|
|
252
254
|
"Value": "值",
|
|
253
255
|
"Data": "資料",
|
|
@@ -323,5 +325,7 @@
|
|
|
323
325
|
"Supported Formats:": "Supported Formats:",
|
|
324
326
|
"Upload files.": "Upload files.",
|
|
325
327
|
"File upload area": "File upload area",
|
|
326
|
-
"Uploaded": "Uploaded"
|
|
328
|
+
"Uploaded": "Uploaded",
|
|
329
|
+
"Ascending": "遞增",
|
|
330
|
+
"Descending": "遞減"
|
|
327
331
|
}
|
|
@@ -184,18 +184,10 @@ export const CheckboxListWithAction = ({
|
|
|
184
184
|
});
|
|
185
185
|
return elements;
|
|
186
186
|
}, [options]);
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
rowIndex,
|
|
192
|
-
type,
|
|
193
|
-
blocked
|
|
194
|
-
}) => {
|
|
195
|
-
const isActive = rowIndex === newRowIndex && type === newElementType && !blocked;
|
|
196
|
-
element.setAttribute("tabindex", isActive ? "0" : "-1");
|
|
197
|
-
});
|
|
198
|
-
}, [getFocusableElements]);
|
|
187
|
+
const getTabIndex = useCallback((rowIndex, elementType, blocked) => {
|
|
188
|
+
if (blocked) return -1;
|
|
189
|
+
return rowIndex === focusedRowIndex && elementType === focusedElementType ? 0 : -1;
|
|
190
|
+
}, [focusedRowIndex, focusedElementType]);
|
|
199
191
|
const handleKeyDown = useCallback(
|
|
200
192
|
// eslint-disable-next-line complexity
|
|
201
193
|
e => {
|
|
@@ -269,7 +261,6 @@ export const CheckboxListWithAction = ({
|
|
|
269
261
|
e.preventDefault();
|
|
270
262
|
setFocusedRowIndex(newRowIndex);
|
|
271
263
|
setFocusedElementType(newElementType);
|
|
272
|
-
updateTabIndex(newRowIndex, newElementType);
|
|
273
264
|
// Find and focus the target element
|
|
274
265
|
const targetElement = elements.find(({
|
|
275
266
|
rowIndex,
|
|
@@ -278,7 +269,7 @@ export const CheckboxListWithAction = ({
|
|
|
278
269
|
}) => rowIndex === newRowIndex && type === newElementType && !blocked);
|
|
279
270
|
targetElement === null || targetElement === void 0 ? void 0 : targetElement.element.focus();
|
|
280
271
|
}
|
|
281
|
-
}, [getFocusableElements, options, focusedRowIndex, focusedElementType, checkboxId, onChange, handleTab
|
|
272
|
+
}, [getFocusableElements, options, focusedRowIndex, focusedElementType, checkboxId, onChange, handleTab]);
|
|
282
273
|
const handleFocus = useCallback(e => {
|
|
283
274
|
const elements = getFocusableElements();
|
|
284
275
|
const focusedElement = e.target;
|
|
@@ -288,10 +279,9 @@ export const CheckboxListWithAction = ({
|
|
|
288
279
|
if (targetElementInfo && !targetElementInfo.blocked && (targetElementInfo.rowIndex !== focusedRowIndex || targetElementInfo.type !== focusedElementType)) {
|
|
289
280
|
setFocusedRowIndex(targetElementInfo.rowIndex);
|
|
290
281
|
setFocusedElementType(targetElementInfo.type);
|
|
291
|
-
updateTabIndex(targetElementInfo.rowIndex, targetElementInfo.type);
|
|
292
282
|
}
|
|
293
|
-
}, [focusedRowIndex, focusedElementType, getFocusableElements
|
|
294
|
-
// Initialize
|
|
283
|
+
}, [focusedRowIndex, focusedElementType, getFocusableElements]);
|
|
284
|
+
// Initialize focusedRowIndex when options first become available
|
|
295
285
|
useEffect(() => {
|
|
296
286
|
if (options && options.length > 0 && !isInitialized.current) {
|
|
297
287
|
// Find first non-blocked row
|
|
@@ -302,17 +292,25 @@ export const CheckboxListWithAction = ({
|
|
|
302
292
|
if (firstValidRow < options.length) {
|
|
303
293
|
setFocusedRowIndex(firstValidRow);
|
|
304
294
|
setFocusedElementType("checkbox");
|
|
305
|
-
updateTabIndex(firstValidRow, "checkbox");
|
|
306
295
|
isInitialized.current = true;
|
|
307
296
|
}
|
|
308
297
|
}
|
|
309
|
-
}, [options
|
|
310
|
-
//
|
|
298
|
+
}, [options]);
|
|
299
|
+
// Correct focusedRowIndex if options shrinks or the focused row becomes blocked after init
|
|
311
300
|
useEffect(() => {
|
|
312
|
-
if (isInitialized.current) {
|
|
313
|
-
|
|
301
|
+
if (!isInitialized.current || !options || options.length === 0) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
const isInBounds = focusedRowIndex < options.length;
|
|
305
|
+
if (isInBounds && !options[focusedRowIndex].blocked) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const firstValid = options.findIndex(opt => !opt.blocked);
|
|
309
|
+
if (firstValid >= 0) {
|
|
310
|
+
setFocusedRowIndex(firstValid);
|
|
311
|
+
setFocusedElementType("checkbox");
|
|
314
312
|
}
|
|
315
|
-
}, [
|
|
313
|
+
}, [options, focusedRowIndex]);
|
|
316
314
|
const getLabelColorInfo = (color, withRightPadding, isHidden, extraArgs) => {
|
|
317
315
|
if (!color) {
|
|
318
316
|
return null;
|
|
@@ -342,7 +340,7 @@ export const CheckboxListWithAction = ({
|
|
|
342
340
|
})
|
|
343
341
|
}));
|
|
344
342
|
};
|
|
345
|
-
const renderLabel = (option, lbl, ttl) => {
|
|
343
|
+
const renderLabel = (option, lbl, ttl, rowIndex) => {
|
|
346
344
|
const additionalTitle = option.countSelectedChild && option.isWithAction ? translate("Number of selected child groups - {count}").replace("{count}", option.countSelectedChild.toString()) : "";
|
|
347
345
|
const title = option.isWithAction ? translate("View {groupName} children").replace("{groupName}", ttl).concat(additionalTitle ? `${". "}${additionalTitle}` : "") : translate("Toggle {groupName} filter").replace("{groupName}", ttl);
|
|
348
346
|
const classN = classNames(["zen-checkbox-list-with-action__label", "zen-ellipsis", option.isWithAction ? "zen-checkbox-list-with-action__label--action" : ""]);
|
|
@@ -371,7 +369,8 @@ export const CheckboxListWithAction = ({
|
|
|
371
369
|
onClick: handleClick,
|
|
372
370
|
title: title,
|
|
373
371
|
className: classN,
|
|
374
|
-
tabIndex:
|
|
372
|
+
tabIndex: getTabIndex(rowIndex, "button", option.blocked),
|
|
373
|
+
disabled: option.blocked
|
|
375
374
|
}, otherArgs, {
|
|
376
375
|
children: childEl
|
|
377
376
|
})) : _jsx("div", {
|
|
@@ -407,7 +406,7 @@ export const CheckboxListWithAction = ({
|
|
|
407
406
|
children: optionsArr.map((opt, ind) => {
|
|
408
407
|
const titleForRender = opt.title || opt.label;
|
|
409
408
|
const labelForRender = selectSearchTerm(opt.label);
|
|
410
|
-
const labelElement = renderLabel(opt, labelForRender, titleForRender);
|
|
409
|
+
const labelElement = renderLabel(opt, labelForRender, titleForRender, ind);
|
|
411
410
|
return _jsxs("li", {
|
|
412
411
|
className: classNames(["zen-checkbox-list-with-action__action-item", opt.isWithAction ? "zen-checkbox-list-with-action__action-item--action" : ""]),
|
|
413
412
|
"data-item": opt.property,
|
|
@@ -421,7 +420,7 @@ export const CheckboxListWithAction = ({
|
|
|
421
420
|
title: translate("Toggle {groupName} filter").replace("{groupName}", titleForRender),
|
|
422
421
|
describedBy: opt.isWithAction ? navigationInstructionsId : undefined,
|
|
423
422
|
"data-indeterminate": opt.partialChecked,
|
|
424
|
-
tabIndex:
|
|
423
|
+
tabIndex: getTabIndex(ind, "checkbox", opt.blocked),
|
|
425
424
|
children: opt.isWithAction ? null : labelElement
|
|
426
425
|
}), opt.isWithAction && labelElement]
|
|
427
426
|
}, `li_${ind}_${opt.property}`);
|
|
@@ -1,50 +1,117 @@
|
|
|
1
|
+
import { injectString } from "../../../utils/localization/translationsDictionary";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useCallback, useId, useMemo } from "react";
|
|
3
4
|
import { groupColumns } from "../../extensions/groupColumns";
|
|
4
5
|
import { SelectList } from "../../../selectList/selectList";
|
|
5
6
|
import { CheckboxState } from "../../../checkbox/checkboxState";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
7
|
+
import { useLanguage } from "../../../utils/localization/useLanguage";
|
|
8
|
+
injectString("cs", "Select visible columns", "Vyberte viditeln\xE9 sloupce");
|
|
9
|
+
injectString("da-DK", "Select visible columns", "V\xE6lg synlige kolonner");
|
|
10
|
+
injectString("de", "Select visible columns", "Sichtbare Spalten ausw\xE4hlen");
|
|
11
|
+
injectString("en", "Select visible columns", "Select visible columns");
|
|
12
|
+
injectString("es", "Select visible columns", "Seleccionar columnas visibles");
|
|
13
|
+
injectString("fi-FI", "Select visible columns", "Valitse n\xE4kyv\xE4t sarakkeet");
|
|
14
|
+
injectString("fr", "Select visible columns", "S\xE9lectionner les colonnes visibles");
|
|
15
|
+
injectString("fr-FR", "Select visible columns", "S\xE9lectionner les colonnes visibles");
|
|
16
|
+
injectString("hu-HU", "Select visible columns", "L\xE1that\xF3 oszlopok kiv\xE1laszt\xE1sa");
|
|
17
|
+
injectString("id", "Select visible columns", "Pilih kolom yang terlihat");
|
|
18
|
+
injectString("it", "Select visible columns", "Selezionare colonne visibili");
|
|
19
|
+
injectString("ja", "Select visible columns", "\u8868\u793A\u5217\u3092\u9078\u629E");
|
|
20
|
+
injectString("ko-KR", "Select visible columns", "\uD45C\uC2DC\uB418\uB294 \uC5F4 \uC120\uD0DD");
|
|
21
|
+
injectString("ms", "Select visible columns", "Pilih lajur yang boleh dilihat");
|
|
22
|
+
injectString("nb-NO", "Select visible columns", "Velg synlige kolonner");
|
|
23
|
+
injectString("nl", "Select visible columns", "Zichtbare kolommen selecteren");
|
|
24
|
+
injectString("pl", "Select visible columns", "Wybierz widoczne kolumny");
|
|
25
|
+
injectString("pt-BR", "Select visible columns", "Selecionar colunas vis\xEDveis");
|
|
26
|
+
injectString("pt-PT", "Select visible columns", "Selecionar colunas vis\xEDveis");
|
|
27
|
+
injectString("sk-SK", "Select visible columns", "Vybra\u0165 vidite\u013En\xE9 st\u013Apce");
|
|
28
|
+
injectString("sv", "Select visible columns", "V\xE4lj synbara kolumner");
|
|
29
|
+
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");
|
|
30
|
+
injectString("tr", "Select visible columns", "G\xF6r\xFCn\xFCr s\xFCtunlar\u0131 se\xE7");
|
|
31
|
+
injectString("zh-Hans", "Select visible columns", "\u9009\u62E9\u53EF\u89C1\u5217");
|
|
32
|
+
injectString("zh-TW", "Select visible columns", "\u9078\u53D6\u53EF\u898B\u6B04");
|
|
33
|
+
injectString("ro-RO", "Select visible columns", "Selecta\u021Bi coloanele vizibile");
|
|
34
|
+
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");
|
|
35
|
+
const SubColumnsList = ({
|
|
36
|
+
title,
|
|
37
|
+
columns,
|
|
38
|
+
settings,
|
|
39
|
+
disabledColumns,
|
|
40
|
+
onChange,
|
|
41
|
+
sortColumns
|
|
42
|
+
}) => {
|
|
43
|
+
const id = useId();
|
|
44
|
+
const {
|
|
45
|
+
translate
|
|
46
|
+
} = useLanguage();
|
|
47
|
+
const sortColumnsInt = useCallback((a, b) => {
|
|
48
|
+
if (sortColumns) {
|
|
49
|
+
return sortColumns(a.title, b.title);
|
|
36
50
|
}
|
|
37
|
-
return
|
|
51
|
+
return 0;
|
|
52
|
+
}, [sortColumns]);
|
|
53
|
+
const items = useMemo(() => columns.sort(sortColumnsInt).map(c => ({
|
|
54
|
+
id: c.id,
|
|
55
|
+
title: c.title,
|
|
56
|
+
disabled: (disabledColumns === null || disabledColumns === void 0 ? void 0 : disabledColumns.includes(c.name)) || false,
|
|
57
|
+
showCheckbox: true,
|
|
58
|
+
children: c.title
|
|
59
|
+
})), [columns, disabledColumns, sortColumnsInt]);
|
|
60
|
+
const allDisabled = useMemo(() => items.every(item => item.disabled), [items]);
|
|
61
|
+
const state = columns.reduce((res, c) => {
|
|
62
|
+
res.set(c.id, settings.get(c.name) !== false ? CheckboxState.On : CheckboxState.Off);
|
|
63
|
+
return res;
|
|
64
|
+
}, new Map());
|
|
65
|
+
const onChangeItem = useCallback(newState => {
|
|
66
|
+
const newSettings = new Map(settings);
|
|
67
|
+
newState.forEach((stateVal, itemId) => {
|
|
68
|
+
var _a;
|
|
69
|
+
newSettings.set((_a = columns.find(c => c.id === itemId)) === null || _a === void 0 ? void 0 : _a.name, stateVal === CheckboxState.On);
|
|
70
|
+
});
|
|
71
|
+
onChange && onChange(newSettings);
|
|
72
|
+
}, [columns, settings, onChange]);
|
|
73
|
+
const list = useMemo(() => _jsx(SelectList, {
|
|
74
|
+
id: id,
|
|
75
|
+
items: items,
|
|
76
|
+
value: state,
|
|
77
|
+
title: title || translate("Select visible columns"),
|
|
78
|
+
multiselect: true,
|
|
79
|
+
showCheckbox: true,
|
|
80
|
+
onChange: onChangeItem,
|
|
81
|
+
disabled: allDisabled
|
|
82
|
+
}), [id, items, state, title, translate, onChangeItem, allDisabled]);
|
|
83
|
+
if (!title) {
|
|
84
|
+
return list;
|
|
85
|
+
}
|
|
86
|
+
return _jsxs("div", {
|
|
87
|
+
className: "zen-columns-list__sub-section",
|
|
88
|
+
children: [_jsx("div", {
|
|
89
|
+
className: "zen-columns-list__title zen-ellipsis",
|
|
90
|
+
children: title
|
|
91
|
+
}), list]
|
|
92
|
+
});
|
|
38
93
|
};
|
|
39
|
-
export function ColumnSettingsList({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
94
|
+
export function ColumnSettingsList({
|
|
95
|
+
columns,
|
|
96
|
+
settings,
|
|
97
|
+
disabledColumns,
|
|
98
|
+
onChange,
|
|
99
|
+
sortGroups,
|
|
100
|
+
sortColumns
|
|
101
|
+
}) {
|
|
102
|
+
const groupped = groupColumns(columns);
|
|
103
|
+
const sortGroupsInt = useCallback((a, b) => {
|
|
104
|
+
if (sortGroups) {
|
|
105
|
+
return sortGroups(a[0], b[0]);
|
|
106
|
+
}
|
|
107
|
+
return 0;
|
|
108
|
+
}, [sortGroups]);
|
|
109
|
+
return Array.from(groupped.entries()).sort(sortGroupsInt).map(([title, cs]) => _jsx(SubColumnsList, {
|
|
110
|
+
title: title,
|
|
111
|
+
columns: cs,
|
|
112
|
+
settings: settings,
|
|
113
|
+
disabledColumns: disabledColumns,
|
|
114
|
+
onChange: onChange,
|
|
115
|
+
sortColumns: sortColumns
|
|
116
|
+
}, cs.map(c => c.id).join("-")));
|
|
117
|
+
}
|