@geotab/zenith 3.0.1 → 3.1.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.
- package/README.md +17 -0
- package/dist/advancedGroupsFilter/advancedGroupsFilter.d.ts +1 -0
- package/dist/advancedGroupsFilter/advancedGroupsFilter.js +2 -2
- package/dist/advancedGroupsFilter/advancedGroupsFilterFormSection.js +3 -1
- package/dist/chip/chip.js +5 -5
- package/dist/commonStyles/zIndex.less +5 -0
- package/dist/dateInput/dateInput.d.ts +2 -1
- package/dist/dateInput/dateInput.js +11 -2
- package/dist/dateRange/dateRange.js +9 -8
- package/dist/dropdown/dropdown.d.ts +2 -0
- package/dist/dropdown/dropdown.js +6 -5
- package/dist/dropdown/dropdownHelper.d.ts +4 -4
- package/dist/dropdown/dropdownHelper.js +2 -1
- package/dist/dropdown/dropdownList.js +2 -2
- package/dist/dropdown/dropdownPopup.d.ts +1 -0
- package/dist/dropdown/dropdownPopup.js +2 -2
- package/dist/dropdown/dropdownSearchableTrigger.js +1 -1
- package/dist/dropdown/stateReducer/stateReducer.d.ts +6 -2
- package/dist/dropdown/stateReducer/stateReducer.js +28 -42
- package/dist/dropdown/stateReducer/stateReducerHelper.d.ts +2 -0
- package/dist/dropdown/stateReducer/stateReducerHelper.js +12 -1
- package/dist/dropdown/useDropdownState.d.ts +1 -1
- package/dist/dropdown/useDropdownState.js +5 -2
- package/dist/filters/components/filtersContainer.d.ts +1 -0
- package/dist/filters/components/filtersContainer.js +10 -11
- package/dist/filters/components/filtersDateInput.d.ts +10 -0
- package/dist/filters/components/filtersDateInput.js +27 -0
- package/dist/filters/components/filtersDropdown.d.ts +5 -4
- package/dist/filters/components/filtersDropdown.js +3 -3
- package/dist/filters/components/filtersEmptySelectedList.d.ts +2 -0
- package/dist/filters/components/filtersEmptySelectedList.js +11 -0
- package/dist/filters/components/filtersItem.d.ts +5 -4
- package/dist/filters/components/filtersItem.js +2 -1
- package/dist/filters/components/filtersSaveModal.d.ts +3 -1
- package/dist/filters/components/filtersSaveModal.js +2 -2
- package/dist/filters/components/filtersSavedChipComponent.js +68 -6
- package/dist/filters/components/filtersSearch.d.ts +4 -4
- package/dist/filters/components/filtersSearch.js +20 -9
- package/dist/filters/components/filtersSearchItemData.js +18 -1
- package/dist/filters/components/filtersSearchList.d.ts +5 -1
- package/dist/filters/components/filtersSearchList.js +155 -27
- package/dist/filters/components/filtersSelect.d.ts +1 -0
- package/dist/filters/components/filtersSelect.js +35 -7
- package/dist/filters/components/filtersSelectListItem.d.ts +21 -15
- package/dist/filters/components/filtersSelectListItem.js +13 -3
- package/dist/filters/components/filtersSidePanel.d.ts +15 -0
- package/dist/filters/components/filtersSidePanel.js +212 -0
- package/dist/filters/components/filtersSidePanelChip.d.ts +9 -0
- package/dist/filters/components/filtersSidePanelChip.js +13 -0
- package/dist/filters/components/filtersSidePanelDropdown.d.ts +6 -0
- package/dist/filters/components/filtersSidePanelDropdown.js +85 -0
- package/dist/filters/components/filtersSidePanelItem.d.ts +16 -0
- package/dist/filters/components/filtersSidePanelItem.js +67 -0
- package/dist/filters/components/filtersSidePanelRange.d.ts +6 -0
- package/dist/filters/components/filtersSidePanelRange.js +28 -0
- package/dist/filters/filters.d.ts +5 -0
- package/dist/filters/filters.js +101 -38
- package/dist/filters/filtersHelper.d.ts +4 -2
- package/dist/filters/filtersHelper.js +40 -1
- package/dist/filters/filtersHooks.d.ts +12 -2
- package/dist/filters/filtersHooks.js +21 -3
- package/dist/formStepper/formStepper.d.ts +1 -1
- package/dist/formStepper/formStepper.js +5 -2
- package/dist/groupsFilter/groupsFilter.js +72 -37
- package/dist/groupsFilter/groupsFilterMenu.d.ts +1 -0
- package/dist/groupsFilter/groupsFilterMenu.js +2 -2
- package/dist/groupsFilter/groupsFilterTrigger.js +1 -1
- package/dist/images/imageLooking.d.ts +4 -0
- package/dist/images/imageLooking.js +16 -0
- package/dist/index.css +407 -83
- package/dist/index.d.ts +7 -4
- package/dist/index.js +26 -15
- package/dist/list/list.d.ts +3 -1
- package/dist/list/list.js +2 -2
- package/dist/mobileSheet/mobileSheet.d.ts +2 -0
- package/dist/mobileSheet/mobileSheet.js +4 -4
- package/dist/modal/modal.d.ts +1 -0
- package/dist/modal/modal.js +2 -2
- package/dist/radioGroup/radioGroup.d.ts +1 -0
- package/dist/radioGroup/radioGroup.js +3 -2
- package/dist/range/range.js +29 -10
- package/dist/searchInputRaw/searchInputRaw.js +1 -1
- package/dist/sidePanel/sidePanel.d.ts +1 -0
- package/dist/sidePanel/sidePanel.js +3 -3
- package/dist/tabs/tabItem/tabItem.d.ts +1 -0
- package/dist/tabs/tabItem/tabItem.js +2 -2
- package/dist/tabs/tabs.d.ts +1 -0
- package/dist/tabs/tabs.js +1 -1
- package/dist/utils/keyboardHelpers.d.ts +2 -0
- package/dist/utils/keyboardHelpers.js +49 -0
- package/dist/utils/localization/translations/cs-json.d.ts +1 -0
- package/dist/utils/localization/translations/cs-json.js +2 -1
- package/dist/utils/localization/translations/de-json.d.ts +1 -0
- package/dist/utils/localization/translations/de-json.js +2 -1
- package/dist/utils/localization/translations/en-json.d.ts +7 -0
- package/dist/utils/localization/translations/en-json.js +8 -1
- package/dist/utils/localization/translations/es-json.d.ts +1 -0
- package/dist/utils/localization/translations/es-json.js +2 -1
- package/dist/utils/localization/translations/fr-FR-json.d.ts +1 -0
- package/dist/utils/localization/translations/fr-FR-json.js +2 -1
- package/dist/utils/localization/translations/fr-json.d.ts +1 -0
- package/dist/utils/localization/translations/fr-json.js +2 -1
- package/dist/utils/localization/translations/id-json.d.ts +1 -0
- package/dist/utils/localization/translations/id-json.js +2 -1
- package/dist/utils/localization/translations/it-json.d.ts +1 -0
- package/dist/utils/localization/translations/it-json.js +2 -1
- package/dist/utils/localization/translations/ja-json.d.ts +1 -0
- package/dist/utils/localization/translations/ja-json.js +2 -1
- package/dist/utils/localization/translations/ko-KR-json.d.ts +1 -0
- package/dist/utils/localization/translations/ko-KR-json.js +2 -1
- package/dist/utils/localization/translations/ms-json.d.ts +1 -0
- package/dist/utils/localization/translations/ms-json.js +2 -1
- package/dist/utils/localization/translations/nl-json.d.ts +1 -0
- package/dist/utils/localization/translations/nl-json.js +2 -1
- package/dist/utils/localization/translations/pl-json.d.ts +1 -0
- package/dist/utils/localization/translations/pl-json.js +2 -1
- package/dist/utils/localization/translations/pt-BR-json.d.ts +1 -0
- package/dist/utils/localization/translations/pt-BR-json.js +2 -1
- package/dist/utils/localization/translations/sv-json.d.ts +1 -0
- package/dist/utils/localization/translations/sv-json.js +2 -1
- package/dist/utils/localization/translations/th-json.d.ts +1 -0
- package/dist/utils/localization/translations/th-json.js +2 -1
- package/dist/utils/localization/translations/tr-json.d.ts +1 -0
- package/dist/utils/localization/translations/tr-json.js +2 -1
- package/dist/utils/localization/translations/zh-Hans-json.d.ts +1 -0
- package/dist/utils/localization/translations/zh-Hans-json.js +2 -1
- package/dist/utils/localization/translations/zh-TW-json.d.ts +1 -0
- package/dist/utils/localization/translations/zh-TW-json.js +2 -1
- package/esm/advancedGroupsFilter/advancedGroupsFilter.d.ts +1 -0
- package/esm/advancedGroupsFilter/advancedGroupsFilter.js +2 -2
- package/esm/advancedGroupsFilter/advancedGroupsFilterFormSection.js +3 -1
- package/esm/chip/chip.js +5 -5
- package/esm/dateInput/dateInput.d.ts +2 -1
- package/esm/dateInput/dateInput.js +11 -2
- package/esm/dateRange/dateRange.js +9 -8
- package/esm/dropdown/dropdown.d.ts +2 -0
- package/esm/dropdown/dropdown.js +5 -4
- package/esm/dropdown/dropdownHelper.d.ts +4 -4
- package/esm/dropdown/dropdownHelper.js +2 -1
- package/esm/dropdown/dropdownList.js +2 -2
- package/esm/dropdown/dropdownPopup.d.ts +1 -0
- package/esm/dropdown/dropdownPopup.js +2 -2
- package/esm/dropdown/dropdownSearchableTrigger.js +1 -1
- package/esm/dropdown/stateReducer/stateReducer.d.ts +6 -2
- package/esm/dropdown/stateReducer/stateReducer.js +29 -43
- package/esm/dropdown/stateReducer/stateReducerHelper.d.ts +2 -0
- package/esm/dropdown/stateReducer/stateReducerHelper.js +10 -0
- package/esm/dropdown/useDropdownState.d.ts +1 -1
- package/esm/dropdown/useDropdownState.js +5 -2
- package/esm/filters/components/filtersContainer.d.ts +1 -0
- package/esm/filters/components/filtersContainer.js +12 -13
- package/esm/filters/components/filtersDateInput.d.ts +10 -0
- package/esm/filters/components/filtersDateInput.js +23 -0
- package/esm/filters/components/filtersDropdown.d.ts +5 -4
- package/esm/filters/components/filtersDropdown.js +3 -3
- package/esm/filters/components/filtersEmptySelectedList.d.ts +2 -0
- package/esm/filters/components/filtersEmptySelectedList.js +7 -0
- package/esm/filters/components/filtersItem.d.ts +5 -4
- package/esm/filters/components/filtersItem.js +2 -1
- package/esm/filters/components/filtersSaveModal.d.ts +3 -1
- package/esm/filters/components/filtersSaveModal.js +2 -2
- package/esm/filters/components/filtersSavedChipComponent.js +68 -6
- package/esm/filters/components/filtersSearch.d.ts +4 -4
- package/esm/filters/components/filtersSearch.js +20 -9
- package/esm/filters/components/filtersSearchItemData.js +18 -1
- package/esm/filters/components/filtersSearchList.d.ts +5 -1
- package/esm/filters/components/filtersSearchList.js +156 -28
- package/esm/filters/components/filtersSelect.d.ts +1 -0
- package/esm/filters/components/filtersSelect.js +36 -8
- package/esm/filters/components/filtersSelectListItem.d.ts +21 -15
- package/esm/filters/components/filtersSelectListItem.js +13 -3
- package/esm/filters/components/filtersSidePanel.d.ts +15 -0
- package/esm/filters/components/filtersSidePanel.js +208 -0
- package/esm/filters/components/filtersSidePanelChip.d.ts +9 -0
- package/esm/filters/components/filtersSidePanelChip.js +9 -0
- package/esm/filters/components/filtersSidePanelDropdown.d.ts +6 -0
- package/esm/filters/components/filtersSidePanelDropdown.js +81 -0
- package/esm/filters/components/filtersSidePanelItem.d.ts +16 -0
- package/esm/filters/components/filtersSidePanelItem.js +63 -0
- package/esm/filters/components/filtersSidePanelRange.d.ts +6 -0
- package/esm/filters/components/filtersSidePanelRange.js +24 -0
- package/esm/filters/filters.d.ts +5 -0
- package/esm/filters/filters.js +101 -38
- package/esm/filters/filtersHelper.d.ts +4 -2
- package/esm/filters/filtersHelper.js +37 -0
- package/esm/filters/filtersHooks.d.ts +12 -2
- package/esm/filters/filtersHooks.js +19 -2
- package/esm/formStepper/formStepper.d.ts +1 -1
- package/esm/formStepper/formStepper.js +5 -2
- package/esm/groupsFilter/groupsFilter.js +72 -37
- package/esm/groupsFilter/groupsFilterMenu.d.ts +1 -0
- package/esm/groupsFilter/groupsFilterMenu.js +2 -2
- package/esm/groupsFilter/groupsFilterTrigger.js +1 -1
- package/esm/images/imageLooking.d.ts +4 -0
- package/esm/images/imageLooking.js +12 -0
- package/esm/index.d.ts +7 -4
- package/esm/index.js +6 -3
- package/esm/list/list.d.ts +3 -1
- package/esm/list/list.js +2 -2
- package/esm/mobileSheet/mobileSheet.d.ts +2 -0
- package/esm/mobileSheet/mobileSheet.js +4 -4
- package/esm/modal/modal.d.ts +1 -0
- package/esm/modal/modal.js +2 -2
- package/esm/radioGroup/radioGroup.d.ts +1 -0
- package/esm/radioGroup/radioGroup.js +3 -2
- package/esm/range/range.js +29 -10
- package/esm/searchInputRaw/searchInputRaw.js +1 -1
- package/esm/sidePanel/sidePanel.d.ts +1 -0
- package/esm/sidePanel/sidePanel.js +3 -3
- package/esm/tabs/tabItem/tabItem.d.ts +1 -0
- package/esm/tabs/tabItem/tabItem.js +2 -2
- package/esm/tabs/tabs.d.ts +1 -0
- package/esm/tabs/tabs.js +1 -1
- package/esm/utils/keyboardHelpers.d.ts +2 -0
- package/esm/utils/keyboardHelpers.js +44 -0
- package/esm/utils/localization/translations/cs-json.d.ts +1 -0
- package/esm/utils/localization/translations/cs-json.js +2 -1
- package/esm/utils/localization/translations/de-json.d.ts +1 -0
- package/esm/utils/localization/translations/de-json.js +2 -1
- package/esm/utils/localization/translations/en-json.d.ts +7 -0
- package/esm/utils/localization/translations/en-json.js +8 -1
- package/esm/utils/localization/translations/es-json.d.ts +1 -0
- package/esm/utils/localization/translations/es-json.js +2 -1
- package/esm/utils/localization/translations/fr-FR-json.d.ts +1 -0
- package/esm/utils/localization/translations/fr-FR-json.js +2 -1
- package/esm/utils/localization/translations/fr-json.d.ts +1 -0
- package/esm/utils/localization/translations/fr-json.js +2 -1
- package/esm/utils/localization/translations/id-json.d.ts +1 -0
- package/esm/utils/localization/translations/id-json.js +2 -1
- package/esm/utils/localization/translations/it-json.d.ts +1 -0
- package/esm/utils/localization/translations/it-json.js +2 -1
- package/esm/utils/localization/translations/ja-json.d.ts +1 -0
- package/esm/utils/localization/translations/ja-json.js +2 -1
- package/esm/utils/localization/translations/ko-KR-json.d.ts +1 -0
- package/esm/utils/localization/translations/ko-KR-json.js +2 -1
- package/esm/utils/localization/translations/ms-json.d.ts +1 -0
- package/esm/utils/localization/translations/ms-json.js +2 -1
- package/esm/utils/localization/translations/nl-json.d.ts +1 -0
- package/esm/utils/localization/translations/nl-json.js +2 -1
- package/esm/utils/localization/translations/pl-json.d.ts +1 -0
- package/esm/utils/localization/translations/pl-json.js +2 -1
- package/esm/utils/localization/translations/pt-BR-json.d.ts +1 -0
- package/esm/utils/localization/translations/pt-BR-json.js +2 -1
- package/esm/utils/localization/translations/sv-json.d.ts +1 -0
- package/esm/utils/localization/translations/sv-json.js +2 -1
- package/esm/utils/localization/translations/th-json.d.ts +1 -0
- package/esm/utils/localization/translations/th-json.js +2 -1
- package/esm/utils/localization/translations/tr-json.d.ts +1 -0
- package/esm/utils/localization/translations/tr-json.js +2 -1
- package/esm/utils/localization/translations/zh-Hans-json.d.ts +1 -0
- package/esm/utils/localization/translations/zh-Hans-json.js +2 -1
- package/esm/utils/localization/translations/zh-TW-json.d.ts +1 -0
- package/esm/utils/localization/translations/zh-TW-json.js +2 -1
- package/package.json +1 -1
- package/dist/filters/components/filtersModal.d.ts +0 -17
- package/dist/filters/components/filtersModal.js +0 -107
- package/dist/filters/components/filtersModalItem.d.ts +0 -9
- package/dist/filters/components/filtersModalItem.js +0 -74
- package/esm/filters/components/filtersModal.d.ts +0 -17
- package/esm/filters/components/filtersModal.js +0 -103
- package/esm/filters/components/filtersModalItem.d.ts +0 -9
- package/esm/filters/components/filtersModalItem.js +0 -70
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFirstFocusableItem = exports.getNewFocusableItem = void 0;
|
|
4
|
+
const focusableSelector_1 = require("./focusableSelector");
|
|
5
|
+
const getNewFocusableItem = (step, container, specificSelector) => {
|
|
6
|
+
if (!container) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const allFocusables = Array.from(container.querySelectorAll(focusableSelector_1.FOCUSABLE_SELECTOR));
|
|
10
|
+
const currentElement = document.activeElement;
|
|
11
|
+
if (allFocusables.length === 0) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
if (specificSelector) {
|
|
15
|
+
const matchingItems = allFocusables.filter(el => el.matches(specificSelector));
|
|
16
|
+
const currentSpecificIndex = matchingItems.indexOf(currentElement);
|
|
17
|
+
if (currentSpecificIndex !== -1 && matchingItems.length > 1) {
|
|
18
|
+
let nextIndex = currentSpecificIndex + step;
|
|
19
|
+
if (nextIndex >= matchingItems.length) {
|
|
20
|
+
nextIndex = 0;
|
|
21
|
+
}
|
|
22
|
+
if (nextIndex < 0) {
|
|
23
|
+
nextIndex = matchingItems.length - 1;
|
|
24
|
+
}
|
|
25
|
+
return matchingItems[nextIndex];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const currentIndex = allFocusables.indexOf(currentElement);
|
|
29
|
+
if (currentIndex === -1) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const nextIndex = currentIndex + step;
|
|
33
|
+
if (nextIndex >= allFocusables.length) {
|
|
34
|
+
return allFocusables[0];
|
|
35
|
+
}
|
|
36
|
+
if (nextIndex < 0) {
|
|
37
|
+
return allFocusables[allFocusables.length - 1];
|
|
38
|
+
}
|
|
39
|
+
return allFocusables[nextIndex];
|
|
40
|
+
};
|
|
41
|
+
exports.getNewFocusableItem = getNewFocusableItem;
|
|
42
|
+
const getFirstFocusableItem = (container) => {
|
|
43
|
+
if (!container) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const allFocusables = Array.from(container.querySelectorAll(focusableSelector_1.FOCUSABLE_SELECTOR));
|
|
47
|
+
return allFocusables[0];
|
|
48
|
+
};
|
|
49
|
+
exports.getFirstFocusableItem = getFirstFocusableItem;
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Zavřít filtr",
|
|
247
247
|
"Column Settings": "Nastavení sloupců",
|
|
248
248
|
"Category": "Kategorie",
|
|
249
|
-
"Select visible columns": "Vyberte viditelné sloupce"
|
|
249
|
+
"Select visible columns": "Vyberte viditelné sloupce",
|
|
250
|
+
"Selected": "Vybráno"
|
|
250
251
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Filter schließen",
|
|
247
247
|
"Column Settings": "Spalteneinstellungen",
|
|
248
248
|
"Category": "Kategorie",
|
|
249
|
-
"Select visible columns": "Sichtbare Spalten auswählen"
|
|
249
|
+
"Select visible columns": "Sichtbare Spalten auswählen",
|
|
250
|
+
"Selected": "Ausgewählt"
|
|
250
251
|
};
|
|
@@ -292,4 +292,11 @@ export declare const translations: {
|
|
|
292
292
|
"Date range filter:": string;
|
|
293
293
|
"Date filter:": string;
|
|
294
294
|
"Select visible columns": string;
|
|
295
|
+
Selected: string;
|
|
296
|
+
"No Filters Selected": string;
|
|
297
|
+
"Selected filters will appear here.": string;
|
|
298
|
+
"Currently selected": string;
|
|
299
|
+
"Top results": string;
|
|
300
|
+
"Open setting conditions popup": string;
|
|
301
|
+
"Close setting conditions popup": string;
|
|
295
302
|
};
|
|
@@ -294,5 +294,12 @@ exports.translations = {
|
|
|
294
294
|
"Category": "Category",
|
|
295
295
|
"Date range filter:": "Date range filter:",
|
|
296
296
|
"Date filter:": "Date filter:",
|
|
297
|
-
"Select visible columns": "Select visible columns"
|
|
297
|
+
"Select visible columns": "Select visible columns",
|
|
298
|
+
"Selected": "Selected",
|
|
299
|
+
"No Filters Selected": "No Filters Selected",
|
|
300
|
+
"Selected filters will appear here.": "Selected filters will appear here.",
|
|
301
|
+
"Currently selected": "Currently selected",
|
|
302
|
+
"Top results": "Top results",
|
|
303
|
+
"Open setting conditions popup": "Open setting conditions popup",
|
|
304
|
+
"Close setting conditions popup": "Close setting conditions popup"
|
|
298
305
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Cerrar filtro",
|
|
247
247
|
"Column Settings": "Configuración de columnas",
|
|
248
248
|
"Category": "Categoría",
|
|
249
|
-
"Select visible columns": "Seleccionar columnas visibles"
|
|
249
|
+
"Select visible columns": "Seleccionar columnas visibles",
|
|
250
|
+
"Selected": "Seleccionado"
|
|
250
251
|
};
|
|
@@ -245,5 +245,6 @@ exports.translations = {
|
|
|
245
245
|
"Close filter": "Fermer le filtre",
|
|
246
246
|
"Column Settings": "Paramètres des colonnes",
|
|
247
247
|
"Category": "Catégorie",
|
|
248
|
-
"Select visible columns": "Sélectionner les colonnes visibles"
|
|
248
|
+
"Select visible columns": "Sélectionner les colonnes visibles",
|
|
249
|
+
"Selected": "Sélectionné"
|
|
249
250
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Fermer le filtre",
|
|
247
247
|
"Column Settings": "Paramètres des colonnes",
|
|
248
248
|
"Category": "Catégorie",
|
|
249
|
-
"Select visible columns": "Sélectionner les colonnes visibles"
|
|
249
|
+
"Select visible columns": "Sélectionner les colonnes visibles",
|
|
250
|
+
"Selected": "Sélectionné"
|
|
250
251
|
};
|
|
@@ -247,5 +247,6 @@ exports.translations = {
|
|
|
247
247
|
"Close filter": "Tutup filter",
|
|
248
248
|
"Column Settings": "Pengaturan Kolom",
|
|
249
249
|
"Category": "Kategori",
|
|
250
|
-
"Select visible columns": "Pilih kolom yang terlihat"
|
|
250
|
+
"Select visible columns": "Pilih kolom yang terlihat",
|
|
251
|
+
"Selected": "Dipilih"
|
|
251
252
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Chiudi filtro",
|
|
247
247
|
"Column Settings": "Impostazioni colonna",
|
|
248
248
|
"Category": "Categoria",
|
|
249
|
-
"Select visible columns": "Selezionare colonne visibili"
|
|
249
|
+
"Select visible columns": "Selezionare colonne visibili",
|
|
250
|
+
"Selected": "Selezionato"
|
|
250
251
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Tutup penyaring",
|
|
247
247
|
"Column Settings": "Tetapan Lajur",
|
|
248
248
|
"Category": "Kategori",
|
|
249
|
-
"Select visible columns": "Pilih lajur yang boleh dilihat"
|
|
249
|
+
"Select visible columns": "Pilih lajur yang boleh dilihat",
|
|
250
|
+
"Selected": "Dipilih"
|
|
250
251
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Filter sluiten",
|
|
247
247
|
"Column Settings": "Kolominstellingen",
|
|
248
248
|
"Category": "Categorie",
|
|
249
|
-
"Select visible columns": "Zichtbare kolommen selecteren"
|
|
249
|
+
"Select visible columns": "Zichtbare kolommen selecteren",
|
|
250
|
+
"Selected": "Geselecteerd"
|
|
250
251
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Zamknij filtr",
|
|
247
247
|
"Column Settings": "Ustawienia kolumn",
|
|
248
248
|
"Category": "Kategoria",
|
|
249
|
-
"Select visible columns": "Wybierz widoczne kolumny"
|
|
249
|
+
"Select visible columns": "Wybierz widoczne kolumny",
|
|
250
|
+
"Selected": "Wybrano"
|
|
250
251
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Fechar filtro",
|
|
247
247
|
"Column Settings": "Configurações da coluna",
|
|
248
248
|
"Category": "Categoria",
|
|
249
|
-
"Select visible columns": "Selecionar colunas visíveis"
|
|
249
|
+
"Select visible columns": "Selecionar colunas visíveis",
|
|
250
|
+
"Selected": "Selecionado"
|
|
250
251
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Stäng filter",
|
|
247
247
|
"Column Settings": "Kolumninställningar",
|
|
248
248
|
"Category": "Kategori",
|
|
249
|
-
"Select visible columns": "Välj synbara kolumner"
|
|
249
|
+
"Select visible columns": "Välj synbara kolumner",
|
|
250
|
+
"Selected": "Valda"
|
|
250
251
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "ปิดตัวกรอง",
|
|
247
247
|
"Column Settings": "การตั้งค่าคอลัมน์",
|
|
248
248
|
"Category": "หมวดหมู่",
|
|
249
|
-
"Select visible columns": "เลือกคอลัมน์ที่มองเห็นได้"
|
|
249
|
+
"Select visible columns": "เลือกคอลัมน์ที่มองเห็นได้",
|
|
250
|
+
"Selected": "เลือกแล้ว"
|
|
250
251
|
};
|
|
@@ -246,5 +246,6 @@ exports.translations = {
|
|
|
246
246
|
"Close filter": "Filtreyi kapat",
|
|
247
247
|
"Column Settings": "Sütun Ayarları",
|
|
248
248
|
"Category": "Kategori",
|
|
249
|
-
"Select visible columns": "Görünür sütunları seç"
|
|
249
|
+
"Select visible columns": "Görünür sütunları seç",
|
|
250
|
+
"Selected": "Seçildi"
|
|
250
251
|
};
|
|
@@ -12,6 +12,7 @@ export interface IAdvancedGroupsFilter extends IZenComponentProps {
|
|
|
12
12
|
errorHandler: (e: Error) => void;
|
|
13
13
|
dataItems?: IDropdownItem[];
|
|
14
14
|
tooltipText?: string;
|
|
15
|
+
isMobile?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export declare const AdvancedGroupsFilter: React.FC<IAdvancedGroupsFilter>;
|
|
17
18
|
export declare const TRANSLATIONS: string[];
|
|
@@ -5,7 +5,7 @@ import { AdvancedGroupsFilterForm, TRANSLATIONS as AdvancedGroupsFilterFormTrans
|
|
|
5
5
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
6
6
|
import { useLanguage } from "../utils/localization/useLanguage";
|
|
7
7
|
import { Modal } from "../modal/modal";
|
|
8
|
-
export const AdvancedGroupsFilter = ({ isOpen, onClose, onApply, state, className, getData, errorHandler, dataItems, tooltipText }) => {
|
|
8
|
+
export const AdvancedGroupsFilter = ({ isOpen, onClose, onApply, state, className, getData, errorHandler, dataItems, tooltipText, isMobile }) => {
|
|
9
9
|
//const dropdownFocusedListClasses = ["zen-dropdown-searchable-trigger__input", "zen-dropdown-searchable-trigger__popup-trigger"];
|
|
10
10
|
const [currentState, setCurrentState] = useState(prepareCurrentFilterState(state));
|
|
11
11
|
const [dataItemsValue, setDataItemsValue] = useState(dataItems || []);
|
|
@@ -28,7 +28,7 @@ export const AdvancedGroupsFilter = ({ isOpen, onClose, onApply, state, classNam
|
|
|
28
28
|
const handleApply = () => {
|
|
29
29
|
onApply(prepareToFilterState(currentState));
|
|
30
30
|
};
|
|
31
|
-
return _jsxs(Modal, { title: translate("Advanced groups filter"), className: classNames(["zen-advanced-groups-filter", className || ""]), isOpen: isOpen, onClose: handleClose, children: [_jsx(AdvancedGroupsFilterForm, { dataItems: dataItemsValue, getData: getData, errorHandler: errorHandler, state: currentState, onStateChange: setCurrentState, tooltipText: tooltipText }), _jsx(Modal.SecondaryButton, { onClick: onClose, children: translate("Cancel") }), _jsx(Modal.PrimaryButton, { onClick: handleApply, children: translate("Apply") })] });
|
|
31
|
+
return _jsxs(Modal, { title: translate("Advanced groups filter"), className: classNames(["zen-advanced-groups-filter", className || ""]), isOpen: isOpen, modalContainerClassName: isMobile ? "zen-advanced-groups-filter-prioritized-modal" : undefined, onClose: handleClose, children: [_jsx(AdvancedGroupsFilterForm, { dataItems: dataItemsValue, getData: getData, errorHandler: errorHandler, state: currentState, onStateChange: setCurrentState, tooltipText: tooltipText }), _jsx(Modal.SecondaryButton, { onClick: onClose, children: translate("Cancel") }), _jsx(Modal.PrimaryButton, { onClick: handleApply, children: translate("Apply") })] });
|
|
32
32
|
};
|
|
33
33
|
export const TRANSLATIONS = [
|
|
34
34
|
...AdvancedGroupsFilterFormTranslations,
|
|
@@ -9,9 +9,11 @@ import { getCurrentSelectionFromIds } from "./advancedGroupsFilterHelper";
|
|
|
9
9
|
import { ENTIRE_ORGANIZATION_GROUP_ID } from "../groupsFilter/groupsHelper";
|
|
10
10
|
import { useLanguage } from "../utils/localization/useLanguage";
|
|
11
11
|
import { FOCUSABLE_SELECTOR } from "../utils/focusableSelector";
|
|
12
|
+
import { useMobile } from "../commonHelpers/hooks/useMobile";
|
|
12
13
|
export const AdvancedGroupsFilterFormSection = ({ state, interSectionRelation, itemId, onInterSectionChange, onRelationChange, onRemoveCondition, onStateChange, getData, errorHandler, dataItems, isHasRemoveConditionButton, isHasTooltip, tooltipText }) => {
|
|
13
14
|
const { translate } = useLanguage();
|
|
14
15
|
const inputItem = useId();
|
|
16
|
+
const isMobile = useMobile();
|
|
15
17
|
const [currentSelection, setCurrentSelection] = React.useState(getCurrentSelectionFromIds(state.items, dataItems));
|
|
16
18
|
const isPrevEmptyComboItems = useRef(dataItems.length === 0);
|
|
17
19
|
const comboboxRef = useRef(null);
|
|
@@ -58,7 +60,7 @@ export const AdvancedGroupsFilterFormSection = ({ state, interSectionRelation, i
|
|
|
58
60
|
] }) }) }) : null, _jsxs("div", { className: "zen-advanced-groups-filter-form__main-section", children: [_jsxs("div", { className: "zen-advanced-groups-filter-form__section-column zen-advanced-groups-filter-form__section-column--left", children: [_jsxs("div", { className: "zen-advanced-groups-filter-form__section-label zen-advanced-groups-filter-form__operator-section", children: [_jsx("div", { className: "zen-advanced-groups-filter-form__operator-label", children: translate("Operator") }), isHasTooltip && _jsx(AdvancedGroupsFilterSectionTooltip, { ariaLabel: "Information", text: tooltipText })] }), _jsx(GroupButton, { onChange: handleRelationChange, groupData: [
|
|
59
61
|
{ name: translate("And"), value: RelationOperator.AND, selected: state.relation === RelationOperator.AND },
|
|
60
62
|
{ name: translate("Or"), value: RelationOperator.OR, selected: state.relation === RelationOperator.OR }
|
|
61
|
-
] })] }), _jsxs("div", { className: "zen-advanced-groups-filter-form__section-column zen-advanced-groups-filter-form__section-column--right", children: [_jsx("label", { className: "zen-advanced-groups-filter-form__section-label", children: translate("Groups") }), isHasRemoveConditionButton && _jsx("button", { type: "button", className: "zen-advanced-groups-filter-form__remove-button", "data-item": itemId, onClick: onRemoveCondition, children: translate("Remove condition") }), _jsxs("div", { className: "zen-advanced-groups-filter-form__combo-section", children: [_jsx("div", { className: "zen-advanced-groups-filter-form__combo-box", ref: comboboxRef, children: _jsx(Dropdown, { classNamePopup: "zen-advanced-groups-filter-form__popup", getData: getData, errorHandler: errorHandler, dataItems: dataItems, onChange: handleSelection, value: state.items.map((el) => el.id), placeholder: translate("Select groups…"), inputId: `${inputItem}-dropdown-${itemId}`, showCounterPill: true }) }), _jsx("div", { className: "zen-advanced-groups-filter-form__selected-box", ref: pillBoxRef, children: _jsx(ComboboxSelected, { selection: getCurrentSelectionFromIds(state.items, dataItems).map((el) => ({ id: el.id, name: el.name })), onRemove: handleRemove, pillEmptyText: ENTIRE_ORGANIZATION_GROUP_ID }) })] })] })] })] });
|
|
63
|
+
] })] }), _jsxs("div", { className: "zen-advanced-groups-filter-form__section-column zen-advanced-groups-filter-form__section-column--right", children: [_jsx("label", { className: "zen-advanced-groups-filter-form__section-label", children: translate("Groups") }), isHasRemoveConditionButton && _jsx("button", { type: "button", className: "zen-advanced-groups-filter-form__remove-button", "data-item": itemId, onClick: onRemoveCondition, children: translate("Remove condition") }), _jsxs("div", { className: "zen-advanced-groups-filter-form__combo-section", children: [_jsx("div", { className: "zen-advanced-groups-filter-form__combo-box", ref: comboboxRef, children: _jsx(Dropdown, { classNamePopup: "zen-advanced-groups-filter-form__popup", getData: getData, mobileSheetStackingClassName: isMobile ? "zen-advanced-groups-filter-form__mobile-sheet-stacking" : undefined, errorHandler: errorHandler, dataItems: dataItems, onChange: handleSelection, value: state.items.map((el) => el.id), placeholder: translate("Select groups…"), inputId: `${inputItem}-dropdown-${itemId}`, showCounterPill: true }) }), _jsx("div", { className: "zen-advanced-groups-filter-form__selected-box", ref: pillBoxRef, children: _jsx(ComboboxSelected, { selection: getCurrentSelectionFromIds(state.items, dataItems).map((el) => ({ id: el.id, name: el.name })), onRemove: handleRemove, pillEmptyText: ENTIRE_ORGANIZATION_GROUP_ID }) })] })] })] })] });
|
|
62
64
|
};
|
|
63
65
|
export const TRANSLATIONS = [
|
|
64
66
|
...AdvancedGroupsFilterSectionTooltipTranslations,
|
package/esm/chip/chip.js
CHANGED
|
@@ -90,12 +90,12 @@ export const Chip = (props) => {
|
|
|
90
90
|
isTriggerMode ? getChipTriggerStateClassName(!!disabled, isOpen, status) : getChipStateClassName(!!disabled, !!readonly, active, status),
|
|
91
91
|
className !== null && className !== void 0 ? className : ""
|
|
92
92
|
], [driveChipClass, isTriggerMode, disabled, isOpen, status, readonly, active, className]);
|
|
93
|
-
const chipComponent = useMemo(() => _jsxs("label", { className: classNames(memoizedClasses), ref: ref, title: chipTitle, htmlFor: id || chipId, children: [_jsx("input", { checked: active, onBlur: onBlurHandler, onKeyUp: onKeyUpHandler, onKeyDown: onKeyDownHandler, onChange: onChangeHandler, id: id || chipId, className: "zen-chip__input", type: "checkbox", disabled: disabled, readOnly: readonly }), children ? _jsx("div", { className: classNames(["zen-chip-text-content", driveTextClass !== null && driveTextClass !== void 0 ? driveTextClass : ""]), children: children }) : null, svgIcon, isClosable && _jsx("button", { type: "button", className: "zen-chip__close-button", onClick: handleClose, title: closeAriaText || translate("Close"), "aria-label": closeAriaText || translate("Close"), children: _jsx(IconClose, { size: isDrive ? "huger" : "large", className: "zen-pill-non-actionable__close-icon" }) })] }), [memoizedClasses, ref, chipTitle, id, chipId, active, onBlurHandler, onKeyUpHandler, onKeyDownHandler, onChangeHandler, disabled, readonly,
|
|
94
|
-
handleClose, closeAriaText, translate, isDrive]);
|
|
93
|
+
const chipComponent = useMemo(() => _jsxs("label", { className: classNames(memoizedClasses), ref: ref, title: title || chipTitle, htmlFor: id || chipId, children: [_jsx("input", { checked: active, onBlur: onBlurHandler, onKeyUp: onKeyUpHandler, onKeyDown: onKeyDownHandler, onChange: onChangeHandler, id: id || chipId, className: "zen-chip__input", type: "checkbox", disabled: disabled, readOnly: readonly }), children ? _jsx("div", { className: classNames(["zen-chip-text-content", driveTextClass !== null && driveTextClass !== void 0 ? driveTextClass : ""]), children: children }) : null, svgIcon, isClosable && _jsx("button", { type: "button", className: "zen-chip__close-button", onClick: handleClose, title: closeAriaText || translate("Close"), "aria-label": closeAriaText || translate("Close"), children: _jsx(IconClose, { size: isDrive ? "huger" : "large", className: "zen-pill-non-actionable__close-icon" }) })] }), [memoizedClasses, ref, title, chipTitle, id, chipId, active, onBlurHandler, onKeyUpHandler, onKeyDownHandler, onChangeHandler, disabled, readonly,
|
|
94
|
+
children, driveTextClass, svgIcon, isClosable, handleClose, closeAriaText, translate, isDrive]);
|
|
95
95
|
const chipTriggerComponent = useMemo(() => {
|
|
96
|
-
const extraAttributes = chipTitle ? { "aria-label": chipTitle } : {};
|
|
96
|
+
const extraAttributes = title ? { "aria-label": title } : chipTitle ? { "aria-label": chipTitle } : {};
|
|
97
97
|
return _jsx("div", Object.assign({ role: "button", tabIndex: 0 }, extraAttributes, { onClick: handleClick, onKeyDown: chipTriggerKeyDownHandler, className: classNames(memoizedClasses), "data-id": id || chipId, ref: triggerRef, children: _jsxs("div", { className: "zen-chip__content-wrapper", children: [hasContent ? _jsx("div", { className: classNames(["zen-chip-text-content", driveTextClass !== null && driveTextClass !== void 0 ? driveTextClass : ""]), children: children }) : null, svgIcon, isClosable && _jsx("button", { type: "button", className: "zen-chip__close-button", onClick: handleClose, title: closeAriaText || translate("Close"), "aria-label": closeAriaText || translate("Close"), children: _jsx(IconClose, { size: isDrive ? "huger" : "large", className: "zen-pill-non-actionable__close-icon" }) }), hasQuantity && quantity ? _jsx("div", { className: "zen-chip__quantity", children: quantity }) : null] }) }));
|
|
98
|
-
}, [handleClick, chipTriggerKeyDownHandler, memoizedClasses, id, chipId, triggerRef, hasContent,
|
|
99
|
-
closeAriaText, translate, isDrive, hasQuantity, quantity]);
|
|
98
|
+
}, [title, chipTitle, handleClick, chipTriggerKeyDownHandler, memoizedClasses, id, chipId, triggerRef, hasContent, driveTextClass,
|
|
99
|
+
children, svgIcon, isClosable, handleClose, closeAriaText, translate, isDrive, hasQuantity, quantity]);
|
|
100
100
|
return isTriggerMode ? chipTriggerComponent : chipComponent;
|
|
101
101
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./dateInput.less";
|
|
3
3
|
import { IZenComponentProps } from "../commonHelpers/zenComponent";
|
|
4
|
-
|
|
4
|
+
import { IChipsParent } from "../chip/chip";
|
|
5
|
+
export interface IDateInput extends IZenComponentProps, IChipsParent {
|
|
5
6
|
defaultValue?: string;
|
|
6
7
|
value: string | undefined;
|
|
7
8
|
onChange: (value: string | undefined) => void;
|
|
@@ -18,9 +18,12 @@ import { FormFieldError } from "../formFieldError/formFieldError";
|
|
|
18
18
|
import { FooterButtons } from "../footerButtons/footerButtons";
|
|
19
19
|
import { MobileSheet } from "../mobileSheet/mobileSheet";
|
|
20
20
|
import { useDriveClassName } from "../utils/theme/useDriveClassName";
|
|
21
|
-
|
|
21
|
+
import { Chip } from "../chip/chip";
|
|
22
|
+
import { useChipStatus } from "../chip/chipStatusProvider";
|
|
23
|
+
export const DateInput = ({ className, classNamePopup, defaultValue, value, onChange, id, disabled, dropDownTitle, timeSelect, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter, error, requireSelection = false, chip, chipIcon, chipId, chipName, buttonLabel }) => {
|
|
22
24
|
const { translate } = useLanguage();
|
|
23
25
|
const isMobile = useMobile();
|
|
26
|
+
const chipStatus = useChipStatus();
|
|
24
27
|
const drivePopupClassName = useDriveClassName("zen-date-input-popup");
|
|
25
28
|
const driveWrapperClassName = useDriveClassName("zen-date-input-popup-wrapper");
|
|
26
29
|
const { dateFormat, timeFormat, weekStartsOnSunday, toLocalDateTime } = useContext(userFormatContext);
|
|
@@ -66,6 +69,11 @@ export const DateInput = ({ className, classNamePopup, defaultValue, value, onCh
|
|
|
66
69
|
const handleClearClick = useCallback(() => {
|
|
67
70
|
setCustomDate(defaultValue);
|
|
68
71
|
}, [defaultValue]);
|
|
72
|
+
const handleClearAndApply = useCallback(() => {
|
|
73
|
+
setCustomDate(defaultValue);
|
|
74
|
+
setIsOpen(false);
|
|
75
|
+
onChange(defaultValue);
|
|
76
|
+
}, [defaultValue, onChange]);
|
|
69
77
|
useEffect(() => {
|
|
70
78
|
setCustomDate(value);
|
|
71
79
|
}, [value]);
|
|
@@ -98,7 +106,8 @@ export const DateInput = ({ className, classNamePopup, defaultValue, value, onCh
|
|
|
98
106
|
}, [isOpen, isMobile]);
|
|
99
107
|
const buttonCurrentLabel = getButtonLabel();
|
|
100
108
|
const buttonCurrentTitle = getButtonLabel(true);
|
|
101
|
-
|
|
109
|
+
const chipTriggerComponent = useMemo(() => _jsx(Chip, { status: isDefaultState ? undefined : chipStatus || "active", title: isDefaultState ? chipName : buttonCurrentTitle, isOpen: isOpen, disabled: disabled, onClick: toggleVisibility, onClose: isDefaultState ? undefined : handleClearAndApply, triggerRef: triggerRef, icon: chipIcon || IconCalendar, id: chipId, children: isDefaultState ? chipName : buttonCurrentLabel }), [isDefaultState, chipStatus, isOpen, disabled, toggleVisibility, handleClearAndApply, chipIcon, chipId, chipName, buttonCurrentLabel, buttonCurrentTitle]);
|
|
110
|
+
return _jsxs(_Fragment, { children: [chip ? chipTriggerComponent : _jsx(TextIconButton, { id: id || undefined, htmlType: "button", title: buttonCurrentTitle, icon: IconCalendar, iconPosition: ButtonIconPosition.Start, className: cssClass, disabled: disabled, onClick: toggleVisibility, ref: triggerRef, children: buttonCurrentLabel }), isMobile ? memoizedMobileView : memoizedDesktopView, _jsx(FormFieldError, { error: error })] });
|
|
102
111
|
};
|
|
103
112
|
export const TRANSLATIONS = [
|
|
104
113
|
"Pick a date",
|
|
@@ -24,6 +24,7 @@ import { useDrive } from "../utils/theme/useDrive";
|
|
|
24
24
|
import { IconChevronRightSmall } from "../icons/iconChevronRightSmall";
|
|
25
25
|
import { Chip } from "../chip/chip";
|
|
26
26
|
import { useChipStatus } from "../chip/chipStatusProvider";
|
|
27
|
+
import { FOCUSABLE_SELECTOR } from "../utils/focusableSelector";
|
|
27
28
|
export const parseLabel = (option, dateFormat, translate, toLacalFn) => {
|
|
28
29
|
const localeFrom = toLacalFn(option.from);
|
|
29
30
|
const localeTo = toLacalFn(option.to);
|
|
@@ -49,7 +50,7 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
|
|
|
49
50
|
const optionsMap = useMemo(() => getOptionsPeriodMap(optionsArg, translate, toLocalDateTime, weekStartsOnSunday ? "Sunday" : "Monday", toReverseOffsetDateTime), [optionsArg, toLocalDateTime, toReverseOffsetDateTime, translate, weekStartsOnSunday]);
|
|
50
51
|
const previousStepOption = useRef("");
|
|
51
52
|
const [selectedRange, setSelectedRange] = useState(getSelectedRangeFromValue(optionsMap, value));
|
|
52
|
-
const
|
|
53
|
+
const mobileContentRef = useRef(null);
|
|
53
54
|
const isCustomDateOption = (selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange.label) === CUSTOM_CALENDAR_ID;
|
|
54
55
|
const [isOpen, setIsOpen] = useState(false);
|
|
55
56
|
const prevIsOpenRef = useRef(false);
|
|
@@ -185,16 +186,17 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
|
|
|
185
186
|
setIsOpen(false);
|
|
186
187
|
}, [setIsOpen]);
|
|
187
188
|
const onReadyForFocus = useCallback((isCurrentOpen) => {
|
|
189
|
+
var _a;
|
|
188
190
|
if (!isMobile) {
|
|
189
191
|
return;
|
|
190
192
|
}
|
|
191
193
|
if (isCurrentOpen) {
|
|
192
|
-
|
|
194
|
+
const focusableElement = (_a = mobileContentRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(FOCUSABLE_SELECTOR);
|
|
195
|
+
focusableElement === null || focusableElement === void 0 ? void 0 : focusableElement.focus();
|
|
193
196
|
return;
|
|
194
197
|
}
|
|
195
|
-
setRenderContent(false);
|
|
196
198
|
prevIsOpenRef.current = isCurrentOpen;
|
|
197
|
-
}, [isMobile]);
|
|
199
|
+
}, [isMobile, mobileContentRef]);
|
|
198
200
|
const isValueNotChanged = useMemo(() => {
|
|
199
201
|
if (!hasApplyButton) {
|
|
200
202
|
return false;
|
|
@@ -206,7 +208,6 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
|
|
|
206
208
|
}, [customDate.from, customDate.to, hasApplyButton, isCustomDateOption, selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange.label, value === null || value === void 0 ? void 0 : value.from, value === null || value === void 0 ? void 0 : value.label, value === null || value === void 0 ? void 0 : value.to]);
|
|
207
209
|
const memoizedDesktopView = useMemo(() => _jsx(ControlledPopup, { className: classNames(["zen-date-range-popup-wrapper", driveWrapperPopupClassName || ""]), ariaLabel: translate("Date range"), useTrapFocusWithTrigger: "on", role: "dialog", triggerRef: triggerRef, onOpenChange: setIsOpen, shouldHoldScroll: true, isOpen: isOpen, recalculateOnScroll: true, children: _jsxs("div", { className: classNames(["zen-date-range-popup", drivePopupClassName || "", classNamePopup !== null && classNamePopup !== void 0 ? classNamePopup : ""]), children: [_jsx("div", { className: "zen-date-range-popup__header", children: title }), component, _jsxs("div", { className: "zen-date-range-popup__footer", children: [_jsx(Button, { className: "zen-date-range-popup__button-clear", type: ButtonType.Tertiary, disabled: !!isDefaultState, onClick: handleClearClick, children: translate("Clear") }), (!isCustomDateOption && hasApplyButton) &&
|
|
208
210
|
_jsx(Button, { className: "zen-date-range-popup__button-reset", type: ButtonType.Secondary, onClick: handleCancelClick, children: translate("Cancel") }), (isCustomDateOption || hasApplyButton) && _jsx(Button, { className: "zen-date-range-popup__button-apply", type: ButtonType.Primary, disabled: (isCustomDateOption && (!customDate.from || !customDate.to)) || isValueNotChanged || !selectedRange, onClick: handleApplyClick, children: translate("Apply") })] })] }) }), [classNamePopup, component, customDate.from, customDate.to, drivePopupClassName, driveWrapperPopupClassName, handleApplyClick, handleCancelClick, handleClearClick, hasApplyButton, isCustomDateOption, isDefaultState, isOpen, isValueNotChanged, selectedRange, title, translate]);
|
|
209
|
-
const notFocusedComponent = useMemo(() => !range.from && !range.to, [range.from, range.to]);
|
|
210
211
|
const memoizedMobileFooter = useMemo(() => {
|
|
211
212
|
const clearButton = _jsx(Button, { type: ButtonType.Tertiary, disabled: !!isDefaultState, onClick: handleClearClick, children: translate("Clear") });
|
|
212
213
|
const cancelButton = hasApplyButton && !showMobileCalendar ? _jsx(Button, { type: ButtonType.Secondary, onClick: handleCancelClick, children: translate("Cancel") }) : null;
|
|
@@ -215,8 +216,8 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
|
|
|
215
216
|
return _jsxs(FooterButtons, { children: [applyButton, cancelButton, clearButton] });
|
|
216
217
|
}, [customDate.from, customDate.to, handleApplyClick, handleCancelClick, handleClearClick, hasApplyButton, isCustomDateOption, isDefaultState, isValueNotChanged, selectedRange,
|
|
217
218
|
showMobileCalendar, translate]);
|
|
218
|
-
const memoizedMobileView = useMemo(() => _jsxs(MobileSheet, { className: classNames(["zen-date-range-mobile-sheet", classNamePopup ? `${classNamePopup}--mobile-sheet` : ""]), label: translate("Date range"), triggerRef: triggerRef, isOpen: isOpen, onHidePanel: memoizedHandleClose, onCloseClick: memoizedHandleClose, useTrapFocusWithTrigger:
|
|
219
|
-
onReadyForFocus,
|
|
219
|
+
const memoizedMobileView = useMemo(() => _jsxs(MobileSheet, { className: classNames(["zen-date-range-mobile-sheet", classNamePopup ? `${classNamePopup}--mobile-sheet` : ""]), label: translate("Date range"), triggerRef: triggerRef, isOpen: isOpen, onHidePanel: memoizedHandleClose, onCloseClick: memoizedHandleClose, useTrapFocusWithTrigger: false, preventFirstFocus: true, isBackVisible: showMobileCalendar, onBackClick: handleMobileBackClick, onReadyForFocus: onReadyForFocus, children: [_jsx(MobileSheet.Title, { children: showMobileCalendar ? calendarLabel : title }), _jsx(MobileSheet.Content, { children: _jsx("div", { ref: mobileContentRef, children: component }) }), _jsx(MobileSheet.Footer, { children: memoizedMobileFooter })] }), [calendarLabel, classNamePopup, component, handleMobileBackClick, isOpen, memoizedHandleClose, memoizedMobileFooter,
|
|
220
|
+
onReadyForFocus, showMobileCalendar, title, translate, mobileContentRef]);
|
|
220
221
|
const checkIsRangeDisable = useCallback((isIncrease) => {
|
|
221
222
|
if (!selectedRange) {
|
|
222
223
|
return true;
|
|
@@ -254,7 +255,7 @@ export const DateRange = ({ className, classNamePopup, defaultValue, value, onCh
|
|
|
254
255
|
!defaultValue && !value || (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.label) === currentLabel || type && type !== ButtonType.Secondary ? "" : "zen-date-range--active"
|
|
255
256
|
]);
|
|
256
257
|
const popupTriggerComponent = useMemo(() => _jsx(TextIconButton, { htmlType: "button", title: buttonTitle, icon: IconCalendar, iconPosition: ButtonIconPosition.Start, className: cssClass, type: type, disabled: disabled, onClick: toggleVisibility, ref: triggerRef, children: buttonLabel }), [cssClass, type, disabled, toggleVisibility, buttonLabel, buttonTitle]);
|
|
257
|
-
const chipTriggerComponent = useMemo(() => _jsx(Chip, { status: isDefaultState ? undefined : chipStatus || "active", isOpen: isOpen, disabled: disabled, onClick: toggleVisibility, onClose: isDefaultState ? undefined : handleClearClick, triggerRef: triggerRef, icon: chipIcon || IconCalendar, id: chipId, children: isDefaultState ? chipName : buttonLabel }), [isDefaultState, chipStatus, isOpen, disabled, toggleVisibility, handleClearClick, chipIcon, chipId, chipName, buttonLabel]);
|
|
258
|
+
const chipTriggerComponent = useMemo(() => _jsx(Chip, { status: isDefaultState ? undefined : chipStatus || "active", title: isDefaultState ? chipName : buttonTitle, isOpen: isOpen, disabled: disabled, onClick: toggleVisibility, onClose: isDefaultState ? undefined : handleClearClick, triggerRef: triggerRef, icon: chipIcon || IconCalendar, id: chipId, children: isDefaultState ? chipName : buttonLabel }), [isDefaultState, chipStatus, isOpen, disabled, toggleVisibility, handleClearClick, chipIcon, chipId, chipName, buttonLabel, buttonTitle]);
|
|
258
259
|
return _jsxs(_Fragment, { children: [stepper ? _jsxs("div", { className: classNames(["zen-date-range-wrapper", driveWrapperTriggerClassName || "", classNameWrapper || ""]), children: [_jsx("button", { type: "button", disabled: checkIsRangeDisable(false), onClick: decreaseRange, className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--left"]), title: translate("Previous"), children: _jsx(IconChevronLeftSmall, { size: isDrive ? "huge" : "large" }) }), popupTriggerComponent, _jsx("button", { type: "button", disabled: checkIsRangeDisable(true), onClick: increaseRange, className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--right"]), title: translate("Next"), children: _jsx(IconChevronRightSmall, { size: isDrive ? "huge" : "large" }) })] }) : (chip ? chipTriggerComponent : popupTriggerComponent), isMobile ? memoizedMobileView : memoizedDesktopView, _jsx(FormFieldError, { error: error })] });
|
|
259
260
|
};
|
|
260
261
|
export const TRANSLATIONS = [
|
|
@@ -5,6 +5,7 @@ import { IColor } from "../groupsFilter/groupsFilterInterfaces";
|
|
|
5
5
|
import { TFilterButton } from "../filterButton/filterButton";
|
|
6
6
|
import { TAlignment } from "../absolute/absolute";
|
|
7
7
|
import { IChipsParent } from "../chip/chip";
|
|
8
|
+
export declare const LIST_LIMIT = 500;
|
|
8
9
|
export interface ISelectionItem {
|
|
9
10
|
id: string;
|
|
10
11
|
name?: string;
|
|
@@ -49,6 +50,7 @@ interface IDropdownBase extends IChipsParent {
|
|
|
49
50
|
isLoading?: boolean;
|
|
50
51
|
alignment?: TAlignment;
|
|
51
52
|
classNamePopup?: string;
|
|
53
|
+
mobileSheetStackingClassName?: string;
|
|
52
54
|
error?: string;
|
|
53
55
|
sortFn?: (a: IDropdownItem, b: IDropdownItem) => number;
|
|
54
56
|
checkboxLabel?: string;
|