@geotab/zenith 3.1.1-beta.6 → 3.2.0-beta.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 +20 -0
- package/dist/advancedGroupsFilter/advancedGroupsFilter.js +136 -30
- package/dist/advancedGroupsFilter/advancedGroupsFilterForm.js +139 -34
- package/dist/advancedGroupsFilter/advancedGroupsFilterFormSection.js +352 -87
- package/dist/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.d.ts +0 -1
- package/dist/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +83 -9
- package/dist/alertRaw/alertRaw.js +175 -54
- package/dist/banner/bannerMultipLine.js +131 -23
- package/dist/banner/bannerSingleLine.js +110 -16
- package/dist/betaPill/betaPill.js +111 -20
- package/dist/bookmark/bookmark.js +95 -28
- package/dist/bulkEditControl/bulkEditControl.js +167 -34
- package/dist/calendar/calendar.js +943 -273
- package/dist/calendar/calendarUtils.js +157 -85
- package/dist/card/card.js +268 -123
- package/dist/chart/accessibleChart/accessibleChartNarrative.js +648 -555
- package/dist/chart/accessibleChart/accessibleChartTable.js +245 -86
- package/dist/chart/chart.js +36 -21
- package/dist/chart/chartAxis/chartAxis.js +85 -7
- package/dist/checkboxListWithAction/checkboxListWithAction.js +224 -69
- package/dist/chip/chip.js +195 -91
- package/dist/columnsSelector/columnsSelector.js +97 -12
- package/dist/columnsSelector/columnsTab/columnsTab.js +59 -15
- package/dist/columnsSelector/columnsTabGroup/columnsTabGroup.js +81 -34
- package/dist/comboboxSelected/comboboxSelected.js +1 -3
- package/dist/dataFeed/feedExpandControl/feedExpandControl.js +25 -10
- package/dist/dataGrid/columns/checkboxColumn/checkboxHeaderCell.js +92 -11
- package/dist/dataGrid/dataGrid.js +227 -117
- package/dist/dataGrid/emptySearchList/emptySearchList.js +56 -9
- package/dist/dataGrid/entitiesListActions/actions/columnsListButton.js +51 -7
- package/dist/dataGrid/entitiesListActions/actions/fullscreenButton.js +64 -18
- package/dist/dataGrid/withFlexibleColumns/components/columnSettings.js +84 -10
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsSidePanel.js +48 -16
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +223 -32
- package/dist/dataGrid/withSelectableRows/withSelectableRows.js +286 -213
- package/dist/dataGrid/withSortableColumns/columns/sortableColumnWrapper.js +178 -95
- package/dist/dateInputInner/dateInputInner.js +791 -476
- package/dist/dateInputInner/dateInputInnerControlBlock.js +125 -22
- package/dist/dateInputRaw/dateInputRaw.js +315 -104
- package/dist/dateInputRaw/utils/getLabel.js +38 -7
- package/dist/dateRangeInner/dateRangeInner.js +173 -59
- package/dist/dateRangeRaw/dateRangeRaw.js +601 -239
- package/dist/dateRangeRaw/utils/dateRangeUtils.js +629 -241
- package/dist/dateSelectionWrapper/dateSelectionWrapper.js +152 -14
- package/dist/dialog/dialogContent.js +123 -40
- package/dist/dropdownRaw/dropdownHelper.d.ts +2 -2
- package/dist/dropdownRaw/dropdownHelper.js +9 -9
- package/dist/dropdownRaw/dropdownList.js +447 -78
- package/dist/dropdownRaw/dropdownPopup.js +218 -20
- package/dist/dropdownRaw/dropdownRaw.js +866 -506
- package/dist/dropdownRaw/dropdownSearchableTrigger.js +223 -46
- package/dist/dropdownRaw/stateReducer/stateAction.d.ts +5 -1
- package/dist/dropdownRaw/stateReducer/stateActionType.d.ts +2 -1
- package/dist/dropdownRaw/stateReducer/stateActionType.js +1 -0
- package/dist/dropdownRaw/stateReducer/stateReducer.d.ts +6 -1
- package/dist/dropdownRaw/stateReducer/stateReducer.js +24 -12
- package/dist/dropdownRaw/stateReducer/stateReducerHelper.d.ts +2 -0
- package/dist/dropdownRaw/stateReducer/stateReducerHelper.js +20 -1
- package/dist/dropdownRaw/stateReducer/stateReducerTestData.d.ts +39 -0
- package/dist/dropdownRaw/stateReducer/stateReducerTestData.js +74 -0
- package/dist/dropdownRaw/types.d.ts +1 -0
- package/dist/favoriteButton/favoriteButton.js +59 -10
- package/dist/filters/components/filtersContainer.js +151 -64
- package/dist/filters/components/filtersEmptySelectedList.js +30 -4
- package/dist/filters/components/filtersSaveModal.js +140 -42
- package/dist/filters/components/filtersSavedChipComponent.js +318 -108
- package/dist/filters/components/filtersSearchItemData.js +127 -47
- package/dist/filters/components/filtersSearchList.js +381 -179
- package/dist/filters/components/filtersSelect.js +128 -61
- package/dist/filters/components/filtersSelectListItem.js +125 -13
- package/dist/filters/components/filtersSidePanel.js +510 -178
- package/dist/filters/components/filtersSidePanelDropdown.js +2 -2
- package/dist/filters/filters.js +445 -268
- package/dist/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +729 -272
- package/dist/filtersBar/components/resetComponentButton.js +45 -5
- package/dist/filtersBar/filtersBarActions/filtersBarActions.js +126 -15
- package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRadioGroup/filtersBarSidePanelRadioGroup.js +2 -2
- package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +155 -49
- package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +360 -104
- package/dist/filtersBar/filtersContainer/filtersContainer.js +204 -134
- package/dist/formField/components/formFieldWithLabel.d.ts +2 -1
- package/dist/formField/components/formFieldWithLabel.js +3 -2
- package/dist/formField/components/formFieldWithoutLabel.d.ts +2 -1
- package/dist/formField/components/formFieldWithoutLabel.js +3 -3
- package/dist/formField/components/trailingComponent.d.ts +8 -0
- package/dist/formField/components/trailingComponent.js +11 -0
- package/dist/formField/formField.js +26 -11
- package/dist/formField/hooks/useError.js +100 -36
- package/dist/formGroup/components/reviewListToggle/reviewListToggle.js +72 -7
- package/dist/formGroup/hooks/useToggle.js +37 -11
- package/dist/formGroup/utils/getControls.js +8 -7
- package/dist/formLayout/hooks/useError.js +55 -15
- package/dist/formLayout/hooks/useFormButtons.js +128 -27
- package/dist/formSection/components/formSectionModal.js +1 -1
- package/dist/formSection/formSection.js +1 -1
- package/dist/formSection/hooks/useError.js +70 -22
- package/dist/formStepper/components/formStep.js +65 -10
- package/dist/formStepper/formStepper.js +129 -33
- package/dist/formStepperButtons/formStepperButtons.js +184 -38
- package/dist/groupsFilter/groupsHelper.d.ts +1 -1
- package/dist/groupsFilterRaw/groupsFilterAdjustmentState.js +162 -17
- package/dist/groupsFilterRaw/groupsFilterBox.js +137 -32
- package/dist/groupsFilterRaw/groupsFilterCommon.js +75 -8
- package/dist/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +184 -25
- package/dist/groupsFilterRaw/groupsFilterHelper.d.ts +2 -1
- package/dist/groupsFilterRaw/groupsFilterHelper.js +284 -168
- package/dist/groupsFilterRaw/groupsFilterInitialState.js +266 -18
- package/dist/groupsFilterRaw/groupsFilterMenu.js +124 -9
- package/dist/groupsFilterRaw/groupsFilterRaw.d.ts +1 -0
- package/dist/groupsFilterRaw/groupsFilterRaw.js +816 -308
- package/dist/groupsFilterRaw/groupsFilterTestData.d.ts +155 -2
- package/dist/groupsFilterRaw/groupsFilterTestData.js +153 -58
- package/dist/groupsFilterRaw/groupsFilterTrigger.js +139 -35
- package/dist/groupsFilterRaw/groupsHelper.js +739 -208
- package/dist/groupsFilterRaw/stateReducer/stateReducerHelper.js +3 -1
- package/dist/groupsFilterRaw/types.d.ts +1 -0
- package/dist/header/components/collapsedItemsControl/collapsedItemsControl.js +107 -52
- package/dist/header/components/mobileFilterControl/mobileFilterControl.js +62 -9
- package/dist/header/components/mobileSearchControl/mobileSearchControl.js +119 -14
- package/dist/header/headerBack.js +64 -20
- package/dist/index.css +116 -74
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -1
- package/dist/list/itemData/itemDataInternal.js +216 -51
- package/dist/list/listItem/listItem.js +168 -55
- package/dist/menu/components/menuErrorItem.js +33 -5
- package/dist/mobileSheet/mobileSheet.js +195 -69
- package/dist/modal/modal.js +300 -142
- package/dist/nav/nav.js +1 -1
- package/dist/nav/navFooter/navFooter.js +82 -39
- package/dist/nav/navFooter/navFooterAction/navFooterAction.js +52 -13
- package/dist/nav/navHeader/navHeader.js +86 -36
- package/dist/nav/navHeader/navHeaderSearch/navHeaderSearch.js +88 -29
- package/dist/nav/navItem/navItem.d.ts +3 -3
- package/dist/nav/navItem/navItem.js +35 -33
- package/dist/nav/navMobileBar/navMobileBar.js +67 -21
- package/dist/notification/notification.js +124 -21
- package/dist/pagination/paginationArrow.js +81 -11
- package/dist/pagination/paginationText/paginationText.js +45 -11
- package/dist/pill/components/pillNonActionable/pillNonActionable.js +93 -24
- package/dist/pillBox/components/pillBoxItem.js +52 -9
- package/dist/pillBox/pillBox.js +121 -20
- package/dist/pillExpandable/pillExpandable.js +333 -139
- package/dist/rangeRaw/rangeRaw.js +486 -141
- package/dist/rangeRaw/utils/rangeHelper.js +209 -39
- package/dist/searchInputRaw/searchInputRaw.js +180 -65
- package/dist/skeleton/skeleton.js +51 -6
- package/dist/sortControl/sortControl.js +152 -42
- package/dist/stepperRaw/stepperRaw.js +116 -42
- package/dist/summary/summary.js +94 -8
- package/dist/table/actions/actionsMenu.js +171 -78
- package/dist/table/flexible/columnSettings.js +80 -10
- package/dist/table/flexible/columnsList.js +110 -43
- package/dist/table/flexible/columnsPopup.js +77 -20
- package/dist/table/nested/useNestedRows.js +167 -77
- package/dist/table/selectable/selectableHeader.js +180 -41
- package/dist/table/selectable/useSelectableRows.js +270 -191
- package/dist/table/sortable/sortableHeader.js +153 -75
- package/dist/tabs/tabs.js +227 -118
- package/dist/timePickerRaw/timePickerRaw.js +278 -58
- package/dist/toastRaw/toastRaw.js +138 -32
- package/dist/toggleButton/toggleButton.d.ts +0 -1
- package/dist/toggleButtonRaw/toggleButtonRaw.d.ts +1 -0
- package/dist/toggleButtonRaw/toggleButtonRaw.js +146 -40
- package/dist/utils/formatDate.js +1001 -117
- package/{esm/utils/localization/translations/cs-json.js → dist/utils/localization/translations/cs.json} +11 -12
- package/{esm/utils/localization/translations/da-DK-json.js → dist/utils/localization/translations/da-DK.json} +31 -23
- package/{esm/utils/localization/translations/de-json.js → dist/utils/localization/translations/de.json} +12 -13
- package/dist/utils/localization/translations/en.json +308 -0
- package/{esm/utils/localization/translations/es-json.js → dist/utils/localization/translations/es.json} +11 -12
- package/{esm/utils/localization/translations/fi-FI-json.js → dist/utils/localization/translations/fi-FI.json} +31 -23
- package/{esm/utils/localization/translations/fr-FR-json.js → dist/utils/localization/translations/fr-FR.json} +12 -12
- package/{esm/utils/localization/translations/fr-json.js → dist/utils/localization/translations/fr.json} +11 -12
- package/{esm/utils/localization/translations/hu-HU-json.js → dist/utils/localization/translations/hu-HU.json} +31 -23
- package/{esm/utils/localization/translations/id-json.js → dist/utils/localization/translations/id.json} +11 -13
- package/{esm/utils/localization/translations/it-json.js → dist/utils/localization/translations/it.json} +11 -12
- package/{esm/utils/localization/translations/ja-json.js → dist/utils/localization/translations/ja.json} +11 -12
- package/{esm/utils/localization/translations/ko-KR-json.js → dist/utils/localization/translations/ko-KR.json} +24 -23
- package/{esm/utils/localization/translations/ms-json.js → dist/utils/localization/translations/ms.json} +11 -12
- package/{esm/utils/localization/translations/nb-NO-json.js → dist/utils/localization/translations/nb-NO.json} +31 -23
- package/{esm/utils/localization/translations/nl-json.js → dist/utils/localization/translations/nl.json} +11 -12
- package/{esm/utils/localization/translations/pl-json.js → dist/utils/localization/translations/pl.json} +11 -12
- package/{esm/utils/localization/translations/pt-BR-json.js → dist/utils/localization/translations/pt-BR.json} +11 -12
- package/{esm/utils/localization/translations/sk-SK-json.js → dist/utils/localization/translations/sk-SK.json} +31 -23
- package/{esm/utils/localization/translations/sv-json.js → dist/utils/localization/translations/sv.json} +11 -12
- package/{esm/utils/localization/translations/th-json.js → dist/utils/localization/translations/th.json} +11 -12
- package/{esm/utils/localization/translations/tr-json.js → dist/utils/localization/translations/tr.json} +11 -12
- package/{esm/utils/localization/translations/zh-Hans-json.js → dist/utils/localization/translations/zh-Hans.json} +11 -12
- package/{esm/utils/localization/translations/zh-TW-json.js → dist/utils/localization/translations/zh-TW.json} +11 -23
- package/dist/utils/localization/translationsDictionary.d.ts +2 -0
- package/dist/utils/localization/translationsDictionary.js +63 -0
- package/dist/utils/localization/useLanguage.js +2 -74
- package/esm/advancedGroupsFilter/advancedGroupsFilter.js +130 -29
- package/esm/advancedGroupsFilter/advancedGroupsFilterForm.js +133 -33
- package/esm/advancedGroupsFilter/advancedGroupsFilterFormSection.js +317 -65
- package/esm/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.d.ts +0 -1
- package/esm/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +77 -8
- package/esm/alertRaw/alertRaw.js +165 -51
- package/esm/banner/bannerMultipLine.js +121 -20
- package/esm/banner/bannerSingleLine.js +100 -13
- package/esm/betaPill/betaPill.js +105 -19
- package/esm/bookmark/bookmark.js +89 -27
- package/esm/bulkEditControl/bulkEditControl.js +161 -33
- package/esm/calendar/calendar.js +937 -272
- package/esm/calendar/calendarUtils.js +151 -84
- package/esm/card/card.js +233 -101
- package/esm/chart/accessibleChart/accessibleChartNarrative.js +642 -554
- package/esm/chart/accessibleChart/accessibleChartTable.js +239 -85
- package/esm/chart/chart.js +30 -20
- package/esm/chart/chartAxis/chartAxis.js +79 -6
- package/esm/checkboxListWithAction/checkboxListWithAction.js +218 -68
- package/esm/chip/chip.js +189 -90
- package/esm/columnsSelector/columnsSelector.js +91 -11
- package/esm/columnsSelector/columnsTab/columnsTab.js +53 -14
- package/esm/columnsSelector/columnsTabGroup/columnsTabGroup.js +75 -33
- package/esm/comboboxSelected/comboboxSelected.js +1 -3
- package/esm/dataFeed/feedExpandControl/feedExpandControl.js +21 -9
- package/esm/dataGrid/columns/checkboxColumn/checkboxHeaderCell.js +86 -10
- package/esm/dataGrid/dataGrid.js +221 -116
- package/esm/dataGrid/emptySearchList/emptySearchList.js +50 -8
- package/esm/dataGrid/entitiesListActions/actions/columnsListButton.js +45 -6
- package/esm/dataGrid/entitiesListActions/actions/fullscreenButton.js +58 -17
- package/esm/dataGrid/withFlexibleColumns/components/columnSettings.js +78 -9
- package/esm/dataGrid/withFlexibleColumns/components/columnSettingsSidePanel.js +44 -15
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +217 -31
- package/esm/dataGrid/withSelectableRows/withSelectableRows.js +280 -212
- package/esm/dataGrid/withSortableColumns/columns/sortableColumnWrapper.js +172 -94
- package/esm/dateInputInner/dateInputInner.js +785 -475
- package/esm/dateInputInner/dateInputInnerControlBlock.js +119 -21
- package/esm/dateInputRaw/dateInputRaw.js +309 -103
- package/esm/dateInputRaw/utils/getLabel.js +32 -6
- package/esm/dateRangeInner/dateRangeInner.js +167 -58
- package/esm/dateRangeRaw/dateRangeRaw.js +595 -238
- package/esm/dateRangeRaw/utils/dateRangeUtils.js +622 -239
- package/esm/dateSelectionWrapper/dateSelectionWrapper.js +146 -13
- package/esm/dialog/dialogContent.js +117 -39
- package/esm/dropdownRaw/dropdownHelper.d.ts +2 -2
- package/esm/dropdownRaw/dropdownHelper.js +10 -10
- package/esm/dropdownRaw/dropdownList.js +412 -56
- package/esm/dropdownRaw/dropdownPopup.js +212 -19
- package/esm/dropdownRaw/dropdownRaw.js +862 -507
- package/esm/dropdownRaw/dropdownSearchableTrigger.js +217 -45
- package/esm/dropdownRaw/stateReducer/stateAction.d.ts +5 -1
- package/esm/dropdownRaw/stateReducer/stateActionType.d.ts +2 -1
- package/esm/dropdownRaw/stateReducer/stateActionType.js +1 -0
- package/esm/dropdownRaw/stateReducer/stateReducer.d.ts +6 -1
- package/esm/dropdownRaw/stateReducer/stateReducer.js +24 -12
- package/esm/dropdownRaw/stateReducer/stateReducerHelper.d.ts +2 -0
- package/esm/dropdownRaw/stateReducer/stateReducerHelper.js +18 -0
- package/esm/dropdownRaw/stateReducer/stateReducerTestData.d.ts +39 -0
- package/esm/dropdownRaw/stateReducer/stateReducerTestData.js +71 -0
- package/esm/dropdownRaw/types.d.ts +1 -0
- package/esm/favoriteButton/favoriteButton.js +53 -9
- package/esm/filters/components/filtersContainer.js +141 -61
- package/esm/filters/components/filtersEmptySelectedList.js +24 -3
- package/esm/filters/components/filtersSaveModal.js +134 -41
- package/esm/filters/components/filtersSavedChipComponent.js +312 -107
- package/esm/filters/components/filtersSearchItemData.js +121 -46
- package/esm/filters/components/filtersSearchList.js +375 -178
- package/esm/filters/components/filtersSelect.js +122 -60
- package/esm/filters/components/filtersSelectListItem.js +119 -12
- package/esm/filters/components/filtersSidePanel.js +504 -177
- package/esm/filters/components/filtersSidePanelDropdown.js +2 -2
- package/esm/filters/filters.js +435 -265
- package/esm/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +722 -270
- package/esm/filtersBar/components/resetComponentButton.js +39 -4
- package/esm/filtersBar/filtersBarActions/filtersBarActions.js +120 -14
- package/esm/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRadioGroup/filtersBarSidePanelRadioGroup.js +2 -2
- package/esm/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +149 -48
- package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +354 -103
- package/esm/filtersBar/filtersContainer/filtersContainer.js +198 -133
- package/esm/formField/components/formFieldWithLabel.d.ts +2 -1
- package/esm/formField/components/formFieldWithLabel.js +3 -2
- package/esm/formField/components/formFieldWithoutLabel.d.ts +2 -1
- package/esm/formField/components/formFieldWithoutLabel.js +3 -3
- package/esm/formField/components/trailingComponent.d.ts +8 -0
- package/esm/formField/components/trailingComponent.js +7 -0
- package/esm/formField/formField.js +27 -12
- package/esm/formField/hooks/useError.js +94 -35
- package/esm/formGroup/components/reviewListToggle/reviewListToggle.js +66 -6
- package/esm/formGroup/hooks/useToggle.js +31 -10
- package/esm/formGroup/utils/getControls.js +8 -7
- package/esm/formLayout/hooks/useError.js +49 -14
- package/esm/formLayout/hooks/useFormButtons.js +122 -26
- package/esm/formSection/components/formSectionModal.js +1 -1
- package/esm/formSection/formSection.js +1 -1
- package/esm/formSection/hooks/useError.js +64 -21
- package/esm/formStepper/components/formStep.js +59 -9
- package/esm/formStepper/formStepper.js +123 -32
- package/esm/formStepperButtons/formStepperButtons.js +178 -37
- package/esm/groupsFilter/groupsHelper.d.ts +1 -1
- package/esm/groupsFilterRaw/groupsFilterAdjustmentState.js +152 -14
- package/esm/groupsFilterRaw/groupsFilterBox.js +131 -31
- package/esm/groupsFilterRaw/groupsFilterCommon.js +69 -7
- package/esm/groupsFilterRaw/groupsFilterCurrentlySelectedState.js +178 -24
- package/esm/groupsFilterRaw/groupsFilterHelper.d.ts +2 -1
- package/esm/groupsFilterRaw/groupsFilterHelper.js +279 -168
- package/esm/groupsFilterRaw/groupsFilterInitialState.js +260 -17
- package/esm/groupsFilterRaw/groupsFilterMenu.js +118 -8
- package/esm/groupsFilterRaw/groupsFilterRaw.d.ts +1 -0
- package/esm/groupsFilterRaw/groupsFilterRaw.js +811 -308
- package/esm/groupsFilterRaw/groupsFilterTestData.d.ts +155 -2
- package/esm/groupsFilterRaw/groupsFilterTestData.js +152 -57
- package/esm/groupsFilterRaw/groupsFilterTrigger.js +133 -34
- package/esm/groupsFilterRaw/groupsHelper.js +733 -207
- package/esm/groupsFilterRaw/stateReducer/stateReducerHelper.js +3 -1
- package/esm/groupsFilterRaw/types.d.ts +1 -0
- package/esm/header/components/collapsedItemsControl/collapsedItemsControl.js +101 -51
- package/esm/header/components/mobileFilterControl/mobileFilterControl.js +56 -8
- package/esm/header/components/mobileSearchControl/mobileSearchControl.js +113 -13
- package/esm/header/headerBack.js +58 -19
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/list/itemData/itemDataInternal.js +210 -50
- package/esm/list/listItem/listItem.js +162 -54
- package/esm/menu/components/menuErrorItem.js +27 -4
- package/esm/mobileSheet/mobileSheet.js +189 -68
- package/esm/modal/modal.js +265 -120
- package/esm/nav/nav.js +1 -1
- package/esm/nav/navFooter/navFooter.js +76 -38
- package/esm/nav/navFooter/navFooterAction/navFooterAction.js +46 -12
- package/esm/nav/navHeader/navHeader.js +80 -35
- package/esm/nav/navHeader/navHeaderSearch/navHeaderSearch.js +82 -28
- package/esm/nav/navItem/navItem.d.ts +3 -3
- package/esm/nav/navItem/navItem.js +35 -33
- package/esm/nav/navMobileBar/navMobileBar.js +61 -20
- package/esm/notification/notification.js +114 -18
- package/esm/pagination/paginationArrow.js +75 -10
- package/esm/pagination/paginationText/paginationText.js +39 -10
- package/esm/pill/components/pillNonActionable/pillNonActionable.js +87 -23
- package/esm/pillBox/components/pillBoxItem.js +46 -8
- package/esm/pillBox/pillBox.js +115 -19
- package/esm/pillExpandable/pillExpandable.js +327 -138
- package/esm/rangeRaw/rangeRaw.js +480 -140
- package/esm/rangeRaw/utils/rangeHelper.js +203 -38
- package/esm/searchInputRaw/searchInputRaw.js +145 -43
- package/esm/skeleton/skeleton.js +45 -5
- package/esm/sortControl/sortControl.js +146 -41
- package/esm/stepperRaw/stepperRaw.js +112 -41
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/components/EntitiesListAction.js +178 -19
- package/esm/summary/summary.js +88 -7
- package/esm/table/actions/actionsMenu.js +165 -77
- package/esm/table/flexible/columnSettings.js +74 -9
- package/esm/table/flexible/columnsList.js +104 -42
- package/esm/table/flexible/columnsPopup.js +71 -19
- package/esm/table/nested/useNestedRows.js +161 -76
- package/esm/table/selectable/selectableHeader.js +174 -40
- package/esm/table/selectable/useSelectableRows.js +264 -190
- package/esm/table/sortable/sortableHeader.js +147 -74
- package/esm/tabs/tabs.js +221 -117
- package/esm/timePickerRaw/timePickerRaw.js +272 -57
- package/esm/toastRaw/toastRaw.js +132 -31
- package/esm/toggleButton/toggleButton.d.ts +0 -1
- package/esm/toggleButtonRaw/toggleButtonRaw.d.ts +1 -0
- package/esm/toggleButtonRaw/toggleButtonRaw.js +111 -18
- package/esm/utils/formatDate.js +995 -116
- package/{dist/utils/localization/translations/cs-json.js → esm/utils/localization/translations/cs.json} +11 -15
- package/{dist/utils/localization/translations/da-DK-json.js → esm/utils/localization/translations/da-DK.json} +31 -26
- package/{dist/utils/localization/translations/de-json.js → esm/utils/localization/translations/de.json} +12 -16
- package/esm/utils/localization/translations/en.json +308 -0
- package/{dist/utils/localization/translations/es-json.js → esm/utils/localization/translations/es.json} +11 -15
- package/{dist/utils/localization/translations/fi-FI-json.js → esm/utils/localization/translations/fi-FI.json} +31 -26
- package/{dist/utils/localization/translations/fr-FR-json.js → esm/utils/localization/translations/fr-FR.json} +12 -15
- package/{dist/utils/localization/translations/fr-json.js → esm/utils/localization/translations/fr.json} +11 -15
- package/{dist/utils/localization/translations/hu-HU-json.js → esm/utils/localization/translations/hu-HU.json} +31 -26
- package/{dist/utils/localization/translations/id-json.js → esm/utils/localization/translations/id.json} +11 -16
- package/{dist/utils/localization/translations/it-json.js → esm/utils/localization/translations/it.json} +11 -15
- package/{dist/utils/localization/translations/ja-json.js → esm/utils/localization/translations/ja.json} +11 -15
- package/{dist/utils/localization/translations/ko-KR-json.js → esm/utils/localization/translations/ko-KR.json} +24 -26
- package/{dist/utils/localization/translations/ms-json.js → esm/utils/localization/translations/ms.json} +11 -15
- package/{dist/utils/localization/translations/nb-NO-json.js → esm/utils/localization/translations/nb-NO.json} +31 -26
- package/{dist/utils/localization/translations/nl-json.js → esm/utils/localization/translations/nl.json} +11 -15
- package/{dist/utils/localization/translations/pl-json.js → esm/utils/localization/translations/pl.json} +11 -15
- package/{dist/utils/localization/translations/pt-BR-json.js → esm/utils/localization/translations/pt-BR.json} +11 -15
- package/{dist/utils/localization/translations/sk-SK-json.js → esm/utils/localization/translations/sk-SK.json} +31 -26
- package/{dist/utils/localization/translations/sv-json.js → esm/utils/localization/translations/sv.json} +11 -15
- package/{dist/utils/localization/translations/th-json.js → esm/utils/localization/translations/th.json} +11 -15
- package/{dist/utils/localization/translations/tr-json.js → esm/utils/localization/translations/tr.json} +11 -15
- package/{dist/utils/localization/translations/zh-Hans-json.js → esm/utils/localization/translations/zh-Hans.json} +11 -15
- package/{dist/utils/localization/translations/zh-TW-json.js → esm/utils/localization/translations/zh-TW.json} +11 -26
- package/esm/utils/localization/translationsDictionary.d.ts +2 -0
- package/esm/utils/localization/translationsDictionary.js +59 -0
- package/esm/utils/localization/useLanguage.js +1 -50
- package/package.json +19 -12
- package/dist/utils/localization/translations/cs-json.d.ts +0 -251
- package/dist/utils/localization/translations/da-DK-json.d.ts +0 -252
- package/dist/utils/localization/translations/de-json.d.ts +0 -251
- package/dist/utils/localization/translations/en-json.d.ts +0 -314
- package/dist/utils/localization/translations/en-json.js +0 -317
- package/dist/utils/localization/translations/es-json.d.ts +0 -251
- package/dist/utils/localization/translations/fi-FI-json.d.ts +0 -252
- package/dist/utils/localization/translations/fr-FR-json.d.ts +0 -250
- package/dist/utils/localization/translations/fr-json.d.ts +0 -251
- package/dist/utils/localization/translations/hu-HU-json.d.ts +0 -252
- package/dist/utils/localization/translations/id-json.d.ts +0 -252
- package/dist/utils/localization/translations/it-json.d.ts +0 -251
- package/dist/utils/localization/translations/ja-json.d.ts +0 -251
- package/dist/utils/localization/translations/ko-KR-json.d.ts +0 -258
- package/dist/utils/localization/translations/ms-json.d.ts +0 -251
- package/dist/utils/localization/translations/nb-NO-json.d.ts +0 -252
- package/dist/utils/localization/translations/nl-json.d.ts +0 -251
- package/dist/utils/localization/translations/pl-json.d.ts +0 -251
- package/dist/utils/localization/translations/pt-BR-json.d.ts +0 -251
- package/dist/utils/localization/translations/sk-SK-json.d.ts +0 -251
- package/dist/utils/localization/translations/sv-json.d.ts +0 -251
- package/dist/utils/localization/translations/th-json.d.ts +0 -251
- package/dist/utils/localization/translations/tr-json.d.ts +0 -251
- package/dist/utils/localization/translations/zh-Hans-json.d.ts +0 -251
- package/dist/utils/localization/translations/zh-TW-json.d.ts +0 -271
- package/esm/utils/localization/translations/cs-json.d.ts +0 -251
- package/esm/utils/localization/translations/da-DK-json.d.ts +0 -252
- package/esm/utils/localization/translations/de-json.d.ts +0 -251
- package/esm/utils/localization/translations/en-json.d.ts +0 -314
- package/esm/utils/localization/translations/en-json.js +0 -314
- package/esm/utils/localization/translations/es-json.d.ts +0 -251
- package/esm/utils/localization/translations/fi-FI-json.d.ts +0 -252
- package/esm/utils/localization/translations/fr-FR-json.d.ts +0 -250
- package/esm/utils/localization/translations/fr-json.d.ts +0 -251
- package/esm/utils/localization/translations/hu-HU-json.d.ts +0 -252
- package/esm/utils/localization/translations/id-json.d.ts +0 -252
- package/esm/utils/localization/translations/it-json.d.ts +0 -251
- package/esm/utils/localization/translations/ja-json.d.ts +0 -251
- package/esm/utils/localization/translations/ko-KR-json.d.ts +0 -258
- package/esm/utils/localization/translations/ms-json.d.ts +0 -251
- package/esm/utils/localization/translations/nb-NO-json.d.ts +0 -252
- package/esm/utils/localization/translations/nl-json.d.ts +0 -251
- package/esm/utils/localization/translations/pl-json.d.ts +0 -251
- package/esm/utils/localization/translations/pt-BR-json.d.ts +0 -251
- package/esm/utils/localization/translations/sk-SK-json.d.ts +0 -251
- package/esm/utils/localization/translations/sv-json.d.ts +0 -251
- package/esm/utils/localization/translations/th-json.d.ts +0 -251
- package/esm/utils/localization/translations/tr-json.d.ts +0 -251
- package/esm/utils/localization/translations/zh-Hans-json.d.ts +0 -251
- package/esm/utils/localization/translations/zh-TW-json.d.ts +0 -271
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { injectString } from "../utils/localization/translationsDictionary";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
3
|
import { useCallback, useEffect, useId, useMemo, useReducer, useRef, useState } from "react";
|
|
3
|
-
import { FilterMenuStep } from "./groupsFilterInterfaces";
|
|
4
|
+
import { FilterMenuStep, RelationOperator } from "./groupsFilterInterfaces";
|
|
4
5
|
import { GroupsFilterMenu, TRANSLATIONS as GroupsFilterMenuTranslations } from "./groupsFilterMenu";
|
|
5
6
|
import { GroupsFilterInitialState, TRANSLATIONS as GroupsFilterInitialStateTranslations } from "./groupsFilterInitialState";
|
|
6
7
|
import { GroupsFilterAdjustmentState, TRANSLATIONS as GroupsFilterAdjustmentStateTranslations } from "./groupsFilterAdjustmentState";
|
|
@@ -35,318 +36,820 @@ import { isFormItem } from "../commonHelpers/isFormItem";
|
|
|
35
36
|
import { useFormField } from "../commonHelpers/hooks/useFormField";
|
|
36
37
|
import { ReviewTextControl } from "../formGroup/components/reviewTextControl";
|
|
37
38
|
// eslint-disable-next-line max-len, complexity
|
|
38
|
-
|
|
39
|
+
injectString("cs", "Groups", "Skupiny");
|
|
40
|
+
injectString("da-DK", "Groups", "Grupper");
|
|
41
|
+
injectString("de", "Groups", "Gruppen");
|
|
42
|
+
injectString("en", "Groups", "Groups");
|
|
43
|
+
injectString("es", "Groups", "Grupos");
|
|
44
|
+
injectString("fi-FI", "Groups", "Ryhm\xE4t");
|
|
45
|
+
injectString("fr", "Groups", "Groupes");
|
|
46
|
+
injectString("fr-FR", "Groups", "Groupes");
|
|
47
|
+
injectString("hu-HU", "Groups", "Csoportok");
|
|
48
|
+
injectString("id", "Groups", "Grup");
|
|
49
|
+
injectString("it", "Groups", "Gruppi");
|
|
50
|
+
injectString("ja", "Groups", "\u30B0\u30EB\u30FC\u30D7");
|
|
51
|
+
injectString("ko-KR", "Groups", "\uADF8\uB8F9");
|
|
52
|
+
injectString("ms", "Groups", "Kumpulan");
|
|
53
|
+
injectString("nb-NO", "Groups", "Grupper");
|
|
54
|
+
injectString("nl", "Groups", "Groepen");
|
|
55
|
+
injectString("pl", "Groups", "Grupy");
|
|
56
|
+
injectString("pt-BR", "Groups", "Grupos");
|
|
57
|
+
injectString("sk-SK", "Groups", "Skupiny");
|
|
58
|
+
injectString("sv", "Groups", "Grupper");
|
|
59
|
+
injectString("th", "Groups", "\u0E01\u0E25\u0E38\u0E48\u0E21");
|
|
60
|
+
injectString("tr", "Groups", "Gruplar");
|
|
61
|
+
injectString("zh-Hans", "Groups", "\u7EC4");
|
|
62
|
+
injectString("zh-TW", "Groups", "\u7FA4\u7D44");
|
|
63
|
+
injectString("cs", "Or", "Nebo");
|
|
64
|
+
injectString("da-DK", "Or", "Eller");
|
|
65
|
+
injectString("de", "Or", "Oder");
|
|
66
|
+
injectString("en", "Or", "Or");
|
|
67
|
+
injectString("es", "Or", "O");
|
|
68
|
+
injectString("fi-FI", "Or", "Tai");
|
|
69
|
+
injectString("fr", "Or", "Ou");
|
|
70
|
+
injectString("fr-FR", "Or", "Ou");
|
|
71
|
+
injectString("hu-HU", "Or", "Vagy");
|
|
72
|
+
injectString("id", "Or", "Atau");
|
|
73
|
+
injectString("it", "Or", "O");
|
|
74
|
+
injectString("ja", "Or", "\u307E\u305F\u306F");
|
|
75
|
+
injectString("ko-KR", "Or", "\uB610\uB294");
|
|
76
|
+
injectString("ms", "Or", "Atau");
|
|
77
|
+
injectString("nb-NO", "Or", "Eller");
|
|
78
|
+
injectString("nl", "Or", "Of");
|
|
79
|
+
injectString("pl", "Or", "Lub");
|
|
80
|
+
injectString("pt-BR", "Or", "Ou");
|
|
81
|
+
injectString("sk-SK", "Or", "Alebo");
|
|
82
|
+
injectString("sv", "Or", "Eller");
|
|
83
|
+
injectString("th", "Or", "\u0E2B\u0E23\u0E37\u0E2D");
|
|
84
|
+
injectString("tr", "Or", "Veya");
|
|
85
|
+
injectString("zh-Hans", "Or", "\u6216");
|
|
86
|
+
injectString("zh-TW", "Or", "\u6216");
|
|
87
|
+
injectString("cs", "And", "A");
|
|
88
|
+
injectString("da-DK", "And", "Og");
|
|
89
|
+
injectString("de", "And", "Und");
|
|
90
|
+
injectString("en", "And", "And");
|
|
91
|
+
injectString("es", "And", "Y");
|
|
92
|
+
injectString("fi-FI", "And", "Ja");
|
|
93
|
+
injectString("fr", "And", "Et");
|
|
94
|
+
injectString("fr-FR", "And", "Et");
|
|
95
|
+
injectString("hu-HU", "And", "\xC9s");
|
|
96
|
+
injectString("id", "And", "Dan");
|
|
97
|
+
injectString("it", "And", "E");
|
|
98
|
+
injectString("ja", "And", "\u3068");
|
|
99
|
+
injectString("ko-KR", "And", "\uADF8\uB9AC\uACE0");
|
|
100
|
+
injectString("ms", "And", "Dan");
|
|
101
|
+
injectString("nb-NO", "And", "Og");
|
|
102
|
+
injectString("nl", "And", "En");
|
|
103
|
+
injectString("pl", "And", "Oraz");
|
|
104
|
+
injectString("pt-BR", "And", "E");
|
|
105
|
+
injectString("sk-SK", "And", "A");
|
|
106
|
+
injectString("sv", "And", "Och");
|
|
107
|
+
injectString("th", "And", "\u0E41\u0E25\u0E30");
|
|
108
|
+
injectString("tr", "And", "Ve");
|
|
109
|
+
injectString("zh-Hans", "And", "\u548C");
|
|
110
|
+
injectString("zh-TW", "And", "\u548C");
|
|
111
|
+
injectString("cs", "Filter by group", "Filtrovat podle skupiny");
|
|
112
|
+
injectString("da-DK", "Filter by group", "Filtrer efter gruppe");
|
|
113
|
+
injectString("de", "Filter by group", "Nach Gruppe filtern");
|
|
114
|
+
injectString("en", "Filter by group", "Filter by group");
|
|
115
|
+
injectString("es", "Filter by group", "Filtrar por grupo");
|
|
116
|
+
injectString("fi-FI", "Filter by group", "Suodata ryhm\xE4n mukaan");
|
|
117
|
+
injectString("fr", "Filter by group", "Filtrer par groupe");
|
|
118
|
+
injectString("fr-FR", "Filter by group", "Filtrer par groupe");
|
|
119
|
+
injectString("hu-HU", "Filter by group", "Sz\u0171rd csoport alapj\xE1n.");
|
|
120
|
+
injectString("id", "Filter by group", "Filter berdasarkan grup");
|
|
121
|
+
injectString("it", "Filter by group", "Filtrare per gruppo");
|
|
122
|
+
injectString("ja", "Filter by group", "\u30B0\u30EB\u30FC\u30D7\u306B\u3088\u308B\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0");
|
|
123
|
+
injectString("ko-KR", "Filter by group", "\uADF8\uB8F9\uBCC4 \uD544\uD130\uB9C1");
|
|
124
|
+
injectString("ms", "Filter by group", "Saring mengikut kumpulan");
|
|
125
|
+
injectString("nb-NO", "Filter by group", "Filtrer etter gruppe");
|
|
126
|
+
injectString("nl", "Filter by group", "Filteren op groep");
|
|
127
|
+
injectString("pl", "Filter by group", "Filtruj wed\u0142ug grupy");
|
|
128
|
+
injectString("pt-BR", "Filter by group", "Filtrar por grupo");
|
|
129
|
+
injectString("sk-SK", "Filter by group", "Filtrova\u0165 pod\u013Ea skupiny");
|
|
130
|
+
injectString("sv", "Filter by group", "Filtrera efter grupp");
|
|
131
|
+
injectString("th", "Filter by group", "\u0E01\u0E23\u0E2D\u0E07\u0E15\u0E32\u0E21\u0E01\u0E25\u0E38\u0E48\u0E21");
|
|
132
|
+
injectString("tr", "Filter by group", "Gruba g\xF6re filtrele");
|
|
133
|
+
injectString("zh-Hans", "Filter by group", "\u6309\u7EC4\u8FC7\u6EE4");
|
|
134
|
+
injectString("zh-TW", "Filter by group", "\u4F9D\u7FA4\u7D44\u7BE9\u9078");
|
|
135
|
+
injectString("cs", "Apply", "Pou\u017E\xEDt");
|
|
136
|
+
injectString("da-DK", "Apply", "Anvend");
|
|
137
|
+
injectString("de", "Apply", "Anwenden");
|
|
138
|
+
injectString("en", "Apply", "Apply");
|
|
139
|
+
injectString("es", "Apply", "Aplicar");
|
|
140
|
+
injectString("fi-FI", "Apply", "K\xE4yt\xE4");
|
|
141
|
+
injectString("fr", "Apply", "Appliquer");
|
|
142
|
+
injectString("fr-FR", "Apply", "Appliquer");
|
|
143
|
+
injectString("hu-HU", "Apply", "Alkalmazd.");
|
|
144
|
+
injectString("id", "Apply", "Terapkan");
|
|
145
|
+
injectString("it", "Apply", "Applicare");
|
|
146
|
+
injectString("ja", "Apply", "\u9069\u7528");
|
|
147
|
+
injectString("ko-KR", "Apply", "\uC801\uC6A9");
|
|
148
|
+
injectString("ms", "Apply", "Gunakan");
|
|
149
|
+
injectString("nb-NO", "Apply", "Bruk");
|
|
150
|
+
injectString("nl", "Apply", "Toepassen");
|
|
151
|
+
injectString("pl", "Apply", "Zastosuj");
|
|
152
|
+
injectString("pt-BR", "Apply", "Aplicar");
|
|
153
|
+
injectString("sk-SK", "Apply", "Pou\u017Ei");
|
|
154
|
+
injectString("sv", "Apply", "Ans\xF6k");
|
|
155
|
+
injectString("th", "Apply", "\u0E43\u0E0A\u0E49");
|
|
156
|
+
injectString("tr", "Apply", "Uygula");
|
|
157
|
+
injectString("zh-Hans", "Apply", "\u5E94\u7528");
|
|
158
|
+
injectString("zh-TW", "Apply", "\u5957\u7528");
|
|
159
|
+
injectString("cs", "Cancel", "Zru\u0161it");
|
|
160
|
+
injectString("da-DK", "Cancel", "Annuller");
|
|
161
|
+
injectString("de", "Cancel", "Abbrechen");
|
|
162
|
+
injectString("en", "Cancel", "Cancel");
|
|
163
|
+
injectString("es", "Cancel", "Cancelar");
|
|
164
|
+
injectString("fi-FI", "Cancel", "Peruuta");
|
|
165
|
+
injectString("fr", "Cancel", "Annuler");
|
|
166
|
+
injectString("fr-FR", "Cancel", "Annuler");
|
|
167
|
+
injectString("hu-HU", "Cancel", "M\xE9gse");
|
|
168
|
+
injectString("id", "Cancel", "Batalkan");
|
|
169
|
+
injectString("it", "Cancel", "Annullare");
|
|
170
|
+
injectString("ja", "Cancel", "\u30AD\u30E3\u30F3\u30BB\u30EB");
|
|
171
|
+
injectString("ko-KR", "Cancel", "\uCDE8\uC18C");
|
|
172
|
+
injectString("ms", "Cancel", "Batal");
|
|
173
|
+
injectString("nb-NO", "Cancel", "Avbryt");
|
|
174
|
+
injectString("nl", "Cancel", "Annuleren");
|
|
175
|
+
injectString("pl", "Cancel", "Anuluj");
|
|
176
|
+
injectString("pt-BR", "Cancel", "Cancelar");
|
|
177
|
+
injectString("sk-SK", "Cancel", "Zru\u0161.");
|
|
178
|
+
injectString("sv", "Cancel", "Avbryt");
|
|
179
|
+
injectString("th", "Cancel", "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01");
|
|
180
|
+
injectString("tr", "Cancel", "\u0130ptal");
|
|
181
|
+
injectString("zh-Hans", "Cancel", "\u53D6\u6D88");
|
|
182
|
+
injectString("zh-TW", "Cancel", "\u53D6\u6D88");
|
|
183
|
+
injectString("cs", "Clear", "Vymazat");
|
|
184
|
+
injectString("da-DK", "Clear", "Ryd");
|
|
185
|
+
injectString("de", "Clear", "L\xF6schen");
|
|
186
|
+
injectString("en", "Clear", "Clear");
|
|
187
|
+
injectString("es", "Clear", "Borrar");
|
|
188
|
+
injectString("fi-FI", "Clear", "Tyhjenn\xE4");
|
|
189
|
+
injectString("fr", "Clear", "Effacer");
|
|
190
|
+
injectString("fr-FR", "Clear", "Effacer");
|
|
191
|
+
injectString("hu-HU", "Clear", "T\xF6r\xF6ld.");
|
|
192
|
+
injectString("id", "Clear", "Hapus");
|
|
193
|
+
injectString("it", "Clear", "Cancella");
|
|
194
|
+
injectString("ja", "Clear", "\u30AF\u30EA\u30A2");
|
|
195
|
+
injectString("ko-KR", "Clear", "\uC9C0\uC6B0\uAE30");
|
|
196
|
+
injectString("ms", "Clear", "Kosongkan");
|
|
197
|
+
injectString("nb-NO", "Clear", "T\xF8m");
|
|
198
|
+
injectString("nl", "Clear", "Wissen");
|
|
199
|
+
injectString("pl", "Clear", "Wyczy\u015B\u0107");
|
|
200
|
+
injectString("pt-BR", "Clear", "Limpar");
|
|
201
|
+
injectString("sk-SK", "Clear", "Vyma\u017E");
|
|
202
|
+
injectString("sv", "Clear", "Rensa");
|
|
203
|
+
injectString("th", "Clear", "\u0E25\u0E49\u0E32\u0E07");
|
|
204
|
+
injectString("tr", "Clear", "Temizle");
|
|
205
|
+
injectString("zh-Hans", "Clear", "\u6E05\u9664");
|
|
206
|
+
injectString("zh-TW", "Clear", "\u6E05\u9664");
|
|
207
|
+
injectString("cs", "Organization groups filter", "Filtr skupin organizace");
|
|
208
|
+
injectString("da-DK", "Organization groups filter", "Filter for organisationsgrupper");
|
|
209
|
+
injectString("de", "Organization groups filter", "Filter f\xFCr Firmengruppen");
|
|
210
|
+
injectString("en", "Organization groups filter", "Organization groups filter");
|
|
211
|
+
injectString("es", "Organization groups filter", "Filtro de grupos de la organizaci\xF3n");
|
|
212
|
+
injectString("fi-FI", "Organization groups filter", "Organisaatioryhmien suodatin");
|
|
213
|
+
injectString("fr", "Organization groups filter", "Filtre de groupes organisationnels");
|
|
214
|
+
injectString("fr-FR", "Organization groups filter", "Filtre des groupes de l\u2019entreprise");
|
|
215
|
+
injectString("hu-HU", "Organization groups filter", "Szervezeti csoportok sz\u0171r\xE9se");
|
|
216
|
+
injectString("id", "Organization groups filter", "Filter grup organisasi");
|
|
217
|
+
injectString("it", "Organization groups filter", "Filtro di gruppi dell'organizzazione");
|
|
218
|
+
injectString("ja", "Organization groups filter", "\u56E3\u4F53\u30B0\u30EB\u30FC\u30D7\u30D5\u30A3\u30EB\u30BF\u30FC");
|
|
219
|
+
injectString("ko-KR", "Organization groups filter", "\uC870\uC9C1 \uADF8\uB8F9 \uD544\uD130");
|
|
220
|
+
injectString("ms", "Organization groups filter", "Penyaring kumpulan organisasi");
|
|
221
|
+
injectString("nb-NO", "Organization groups filter", "Filter for organisasjonsgrupper.");
|
|
222
|
+
injectString("nl", "Organization groups filter", "Filter voor organisatiegroepen");
|
|
223
|
+
injectString("pl", "Organization groups filter", "Filtr grup organizacji");
|
|
224
|
+
injectString("pt-BR", "Organization groups filter", "Filtro de grupos da organiza\xE7\xE3o");
|
|
225
|
+
injectString("sk-SK", "Organization groups filter", "Filter organiza\u010Dn\xFDch skup\xEDn");
|
|
226
|
+
injectString("sv", "Organization groups filter", "Filter f\xF6r organisationsgrupper");
|
|
227
|
+
injectString("th", "Organization groups filter", "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E01\u0E25\u0E38\u0E48\u0E21\u0E2D\u0E07\u0E04\u0E4C\u0E01\u0E23");
|
|
228
|
+
injectString("tr", "Organization groups filter", "Organizasyon gruplar\u0131 filtresi");
|
|
229
|
+
injectString("zh-Hans", "Organization groups filter", "\u7EC4\u7EC7\u7EC4\u7B5B\u9009\u5668");
|
|
230
|
+
injectString("zh-TW", "Organization groups filter", "\u7D44\u7E54\u7FA4\u7D44\u7BE9\u9078");
|
|
231
|
+
export const GroupsFilterRaw = props => {
|
|
232
|
+
var _a;
|
|
233
|
+
const {
|
|
234
|
+
fullSize,
|
|
235
|
+
className,
|
|
236
|
+
classNamePopup,
|
|
237
|
+
dataLoader,
|
|
238
|
+
errorHandler,
|
|
239
|
+
initialFilterState,
|
|
240
|
+
isWithColor,
|
|
241
|
+
onChange,
|
|
242
|
+
options,
|
|
243
|
+
listLimit = 500,
|
|
244
|
+
isError,
|
|
245
|
+
isReadOnly,
|
|
246
|
+
chip,
|
|
247
|
+
chipIcon,
|
|
248
|
+
chipId,
|
|
249
|
+
chipName
|
|
250
|
+
} = props;
|
|
251
|
+
const chipStatus = useChipStatus();
|
|
252
|
+
const {
|
|
253
|
+
field
|
|
254
|
+
} = useFormField(props.controller);
|
|
255
|
+
const isFormItemValue = isFormItem(props);
|
|
256
|
+
let initialFilterStateInner, onChangeInner;
|
|
257
|
+
if (isFormItemValue) {
|
|
258
|
+
initialFilterStateInner = (_a = props.controller) === null || _a === void 0 ? void 0 : _a.defaultValue;
|
|
259
|
+
onChangeInner = state => {
|
|
260
|
+
field === null || field === void 0 ? void 0 : field.onChange(state);
|
|
261
|
+
};
|
|
262
|
+
} else {
|
|
263
|
+
initialFilterStateInner = initialFilterState;
|
|
264
|
+
onChangeInner = onChange;
|
|
265
|
+
}
|
|
266
|
+
const {
|
|
267
|
+
translate
|
|
268
|
+
} = useLanguage();
|
|
269
|
+
const [groupPlaceHolder, setGroupPlaceHolder] = useState((options === null || options === void 0 ? void 0 : options.placeholder) || translate("Groups"));
|
|
270
|
+
const [state, dispatchState] = useReducer(stateReducer, getInitialState(translate, initialFilterState));
|
|
271
|
+
const [uiState, dispatchUiState] = useReducer(uiStateReducer, uiInitialGroupsFilterState);
|
|
272
|
+
const [dataItems, setDataItems] = useState([]);
|
|
273
|
+
const isMobile = useMobile();
|
|
274
|
+
const inputRef = useRef(null);
|
|
275
|
+
const emptyInputRef = useRef(null);
|
|
276
|
+
const triggerRef = useRef(null);
|
|
277
|
+
const menuRef = useRef(null);
|
|
278
|
+
const prevInitialState = useRef(initialFilterStateInner);
|
|
279
|
+
const prevSearchField = useRef("");
|
|
280
|
+
const groupsFilterId = useId();
|
|
281
|
+
const blocksMap = useMemo(() => [["builtInGroups", "userGroups"], ["advancedGroups", "builtInGroups", "userGroups"], ["builtInGroups", "userGroups"]], []);
|
|
282
|
+
const onOptionsToggle = useCallback(() => {
|
|
283
|
+
dispatchUiState({
|
|
284
|
+
type: UiStateActionType.ToggleOpen,
|
|
285
|
+
payload: undefined
|
|
286
|
+
});
|
|
287
|
+
}, []);
|
|
288
|
+
const handleSetStep = useCallback(newStep => {
|
|
39
289
|
var _a;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
290
|
+
uiState.step !== FilterMenuStep.CurrentlySelected && dispatchUiState({
|
|
291
|
+
type: UiStateActionType.ClearUncheckedState,
|
|
292
|
+
payload: undefined
|
|
293
|
+
});
|
|
294
|
+
dispatchUiState({
|
|
295
|
+
type: UiStateActionType.SetStep,
|
|
296
|
+
payload: newStep
|
|
297
|
+
});
|
|
298
|
+
if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) && newStep !== FilterMenuStep.Initial) {
|
|
299
|
+
inputRef.current.value = "";
|
|
300
|
+
dispatchUiState({
|
|
301
|
+
type: UiStateActionType.SetSearchValue,
|
|
302
|
+
payload: ""
|
|
303
|
+
});
|
|
50
304
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
305
|
+
}, [uiState.step]);
|
|
306
|
+
const onSearchChange = useCallback(event => {
|
|
307
|
+
const newValue = event.currentTarget.value;
|
|
308
|
+
dispatchUiState({
|
|
309
|
+
type: UiStateActionType.SetSearchValue,
|
|
310
|
+
payload: newValue
|
|
311
|
+
});
|
|
312
|
+
dispatchUiState({
|
|
313
|
+
type: UiStateActionType.SetIsOpen,
|
|
314
|
+
payload: true
|
|
315
|
+
});
|
|
316
|
+
uiState.step !== FilterMenuStep.Initial && handleSetStep(FilterMenuStep.Initial);
|
|
317
|
+
}, [handleSetStep, uiState.step]);
|
|
318
|
+
const onSearchChipChange = useCallback(newValue => {
|
|
319
|
+
dispatchUiState({
|
|
320
|
+
type: UiStateActionType.SetSearchValue,
|
|
321
|
+
payload: newValue || ""
|
|
322
|
+
});
|
|
323
|
+
dispatchUiState({
|
|
324
|
+
type: UiStateActionType.SetIsOpen,
|
|
325
|
+
payload: true
|
|
326
|
+
});
|
|
327
|
+
uiState.step !== FilterMenuStep.Initial && handleSetStep(FilterMenuStep.Initial);
|
|
328
|
+
}, [handleSetStep, uiState.step]);
|
|
329
|
+
const handleFocusOnClose = useCallback(() => {
|
|
330
|
+
var _a, _b, _c;
|
|
331
|
+
if (chip) {
|
|
332
|
+
(_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
333
|
+
} else {
|
|
334
|
+
!isMobile && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus());
|
|
335
|
+
isMobile && ((_c = emptyInputRef.current) === null || _c === void 0 ? void 0 : _c.focus());
|
|
54
336
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (value.id === ADVANCED_FILTER_ID) {
|
|
148
|
-
const currentVal = value.state ? uiState.uncheckedAdvancedState : state.advancedFilterState;
|
|
149
|
-
!value.state && dispatchUiState({ type: UiStateActionType.SetUncheckedAdvancedState, payload: currentVal });
|
|
150
|
-
!value.state && dispatchState({ type: StateActionType.SetAdvancedFilterState, payload: getDefaultFilterState() });
|
|
151
|
-
value.state && dispatchState({ type: StateActionType.SetAdvancedFilterState, payload: currentVal || state.frozenState.advancedFilterState || getDefaultFilterState() });
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
dispatchUiState({ type: UiStateActionType.SetUncheckedAdjustmentIds, payload: !value.state ?
|
|
155
|
-
[...uiState.uncheckedAdjustmentIds, value.id] : uiState.uncheckedAdjustmentIds.filter(id => id !== value.id) });
|
|
156
|
-
dispatchState({ type: StateActionType.ChangeSelection, payload: { value: value.state, itemId: value.id } });
|
|
157
|
-
}, [dispatchState, dispatchUiState, state.advancedFilterState, state.frozenState.advancedFilterState, uiState.uncheckedAdvancedState, uiState.uncheckedAdjustmentIds]);
|
|
158
|
-
const basicHandleBackButtonClick = useCallback(() => {
|
|
159
|
-
handleSetStep(FilterMenuStep.Initial);
|
|
160
|
-
}, [handleSetStep]);
|
|
161
|
-
const handleBackButtonClick = useCallback(() => {
|
|
162
|
-
const currentEl = uiState.currentAdjustmentId ? getGroupsTreeItem(state, uiState.currentAdjustmentId) : undefined;
|
|
163
|
-
if (!uiState.currentAdjustmentId || !(currentEl === null || currentEl === void 0 ? void 0 : currentEl.parent)) {
|
|
164
|
-
basicHandleBackButtonClick();
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
const isNotRoot = currentEl.parent.id && currentEl.parent.id !== ENTIRE_ORGANIZATION_GROUP_ID;
|
|
168
|
-
dispatchUiState({ type: UiStateActionType.SetCurrentAdjustmentId, payload: isNotRoot ? currentEl.parent.id : undefined });
|
|
169
|
-
handleSetStep(isNotRoot ? FilterMenuStep.Adjustment : FilterMenuStep.Initial);
|
|
170
|
-
}, [basicHandleBackButtonClick, handleSetStep, state, uiState.currentAdjustmentId]);
|
|
171
|
-
const handleHomeButtonClick = useCallback(() => {
|
|
172
|
-
handleSetStep(FilterMenuStep.Initial);
|
|
173
|
-
uiState.currentAdjustmentId && dispatchUiState({ type: UiStateActionType.SetCurrentAdjustmentId, payload: undefined });
|
|
174
|
-
}, [handleSetStep, uiState.currentAdjustmentId, dispatchUiState]);
|
|
175
|
-
const handleCurrentlySelectedClick = useCallback(() => {
|
|
176
|
-
handleSetStep(FilterMenuStep.CurrentlySelected);
|
|
177
|
-
}, [handleSetStep]);
|
|
178
|
-
const selectAllHandler = useCallback((isAllSelected) => {
|
|
179
|
-
if (!uiState.currentAdjustmentId) {
|
|
180
|
-
return;
|
|
337
|
+
}, [chip, isMobile]);
|
|
338
|
+
const handleCancel = useCallback(() => {
|
|
339
|
+
dispatchUiState({
|
|
340
|
+
type: UiStateActionType.SetIsOpen,
|
|
341
|
+
payload: false
|
|
342
|
+
});
|
|
343
|
+
dispatchState({
|
|
344
|
+
type: StateActionType.SetState,
|
|
345
|
+
payload: state.frozenState
|
|
346
|
+
});
|
|
347
|
+
dispatchState({
|
|
348
|
+
type: StateActionType.SideWide,
|
|
349
|
+
payload: state.frozenSideWideState
|
|
350
|
+
});
|
|
351
|
+
handleSetStep(FilterMenuStep.Initial);
|
|
352
|
+
handleFocusOnClose();
|
|
353
|
+
}, [state.frozenState, state.frozenSideWideState, handleSetStep, handleFocusOnClose]);
|
|
354
|
+
const handleApply = useCallback(() => {
|
|
355
|
+
dispatchUiState({
|
|
356
|
+
type: UiStateActionType.SetIsOpen,
|
|
357
|
+
payload: false
|
|
358
|
+
});
|
|
359
|
+
dispatchUiState({
|
|
360
|
+
type: UiStateActionType.SetSearchValue,
|
|
361
|
+
payload: ""
|
|
362
|
+
});
|
|
363
|
+
dispatchUiState({
|
|
364
|
+
type: UiStateActionType.ClearUncheckedState,
|
|
365
|
+
payload: undefined
|
|
366
|
+
});
|
|
367
|
+
if (inputRef.current) {
|
|
368
|
+
inputRef.current.value = "";
|
|
369
|
+
}
|
|
370
|
+
handleSetStep(FilterMenuStep.Initial);
|
|
371
|
+
dispatchState({
|
|
372
|
+
type: StateActionType.FreezeState,
|
|
373
|
+
payload: getCurrentState(state)
|
|
374
|
+
});
|
|
375
|
+
dispatchState({
|
|
376
|
+
type: StateActionType.FreezeSideWide,
|
|
377
|
+
payload: state.sideWideState
|
|
378
|
+
});
|
|
379
|
+
handleFocusOnClose();
|
|
380
|
+
}, [handleSetStep, state, handleFocusOnClose]);
|
|
381
|
+
const handleReset = useCallback(() => {
|
|
382
|
+
dispatchState({
|
|
383
|
+
type: StateActionType.ResetSelection,
|
|
384
|
+
payload: undefined
|
|
385
|
+
});
|
|
386
|
+
}, []);
|
|
387
|
+
const handleChipClose = useCallback(() => {
|
|
388
|
+
dispatchState({
|
|
389
|
+
type: StateActionType.ResetSelection,
|
|
390
|
+
payload: undefined
|
|
391
|
+
});
|
|
392
|
+
dispatchUiState({
|
|
393
|
+
type: UiStateActionType.SetIsOpen,
|
|
394
|
+
payload: false
|
|
395
|
+
});
|
|
396
|
+
dispatchUiState({
|
|
397
|
+
type: UiStateActionType.SetSearchValue,
|
|
398
|
+
payload: ""
|
|
399
|
+
});
|
|
400
|
+
dispatchUiState({
|
|
401
|
+
type: UiStateActionType.ClearUncheckedState,
|
|
402
|
+
payload: undefined
|
|
403
|
+
});
|
|
404
|
+
if (inputRef.current) {
|
|
405
|
+
inputRef.current.value = "";
|
|
406
|
+
}
|
|
407
|
+
handleSetStep(FilterMenuStep.Initial);
|
|
408
|
+
dispatchState({
|
|
409
|
+
type: StateActionType.FreezeState,
|
|
410
|
+
payload: defaultPreparedFilterState
|
|
411
|
+
});
|
|
412
|
+
dispatchState({
|
|
413
|
+
type: StateActionType.FreezeSideWide,
|
|
414
|
+
payload: false
|
|
415
|
+
});
|
|
416
|
+
}, [handleSetStep]);
|
|
417
|
+
const handleCheckboxChange = useCallback(value => {
|
|
418
|
+
if (value.partial) {
|
|
419
|
+
dispatchState({
|
|
420
|
+
type: StateActionType.DeselectAllChildren,
|
|
421
|
+
payload: value.id
|
|
422
|
+
});
|
|
423
|
+
} else {
|
|
424
|
+
dispatchState({
|
|
425
|
+
type: StateActionType.ChangeSelection,
|
|
426
|
+
payload: {
|
|
427
|
+
value: value.state,
|
|
428
|
+
itemId: value.id
|
|
181
429
|
}
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}, [dispatchState]);
|
|
433
|
+
const handleCheckboxItemClick = useCallback(id => {
|
|
434
|
+
dispatchUiState({
|
|
435
|
+
type: UiStateActionType.SetCurrentAdjustmentId,
|
|
436
|
+
payload: id
|
|
437
|
+
});
|
|
438
|
+
handleSetStep(id ? FilterMenuStep.Adjustment : FilterMenuStep.Initial);
|
|
439
|
+
}, [dispatchUiState, handleSetStep]);
|
|
440
|
+
const handleCheckboxItemAdjustmentClick = useCallback(value => {
|
|
441
|
+
if (value.id === ADVANCED_FILTER_ID) {
|
|
442
|
+
const currentVal = value.state ? uiState.uncheckedAdvancedState : state.advancedFilterState;
|
|
443
|
+
!value.state && dispatchUiState({
|
|
444
|
+
type: UiStateActionType.SetUncheckedAdvancedState,
|
|
445
|
+
payload: currentVal
|
|
446
|
+
});
|
|
447
|
+
!value.state && dispatchState({
|
|
448
|
+
type: StateActionType.SetAdvancedFilterState,
|
|
449
|
+
payload: getDefaultFilterState()
|
|
450
|
+
});
|
|
451
|
+
value.state && dispatchState({
|
|
452
|
+
type: StateActionType.SetAdvancedFilterState,
|
|
453
|
+
payload: currentVal || state.frozenState.advancedFilterState || getDefaultFilterState()
|
|
454
|
+
});
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
dispatchUiState({
|
|
458
|
+
type: UiStateActionType.SetUncheckedAdjustmentIds,
|
|
459
|
+
payload: !value.state ? [...uiState.uncheckedAdjustmentIds, value.id] : uiState.uncheckedAdjustmentIds.filter(id => id !== value.id)
|
|
460
|
+
});
|
|
461
|
+
dispatchState({
|
|
462
|
+
type: StateActionType.ChangeSelection,
|
|
463
|
+
payload: {
|
|
464
|
+
value: value.state,
|
|
465
|
+
itemId: value.id
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
}, [dispatchState, dispatchUiState, state.advancedFilterState, state.frozenState.advancedFilterState, uiState.uncheckedAdvancedState, uiState.uncheckedAdjustmentIds]);
|
|
469
|
+
const basicHandleBackButtonClick = useCallback(() => {
|
|
470
|
+
handleSetStep(FilterMenuStep.Initial);
|
|
471
|
+
}, [handleSetStep]);
|
|
472
|
+
const handleBackButtonClick = useCallback(() => {
|
|
473
|
+
const currentEl = uiState.currentAdjustmentId ? getGroupsTreeItem(state, uiState.currentAdjustmentId) : undefined;
|
|
474
|
+
if (!uiState.currentAdjustmentId || !(currentEl === null || currentEl === void 0 ? void 0 : currentEl.parent)) {
|
|
475
|
+
basicHandleBackButtonClick();
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
const isNotRoot = currentEl.parent.id && currentEl.parent.id !== ENTIRE_ORGANIZATION_GROUP_ID;
|
|
479
|
+
dispatchUiState({
|
|
480
|
+
type: UiStateActionType.SetCurrentAdjustmentId,
|
|
481
|
+
payload: isNotRoot ? currentEl.parent.id : undefined
|
|
482
|
+
});
|
|
483
|
+
handleSetStep(isNotRoot ? FilterMenuStep.Adjustment : FilterMenuStep.Initial);
|
|
484
|
+
}, [basicHandleBackButtonClick, handleSetStep, state, uiState.currentAdjustmentId]);
|
|
485
|
+
const handleHomeButtonClick = useCallback(() => {
|
|
486
|
+
handleSetStep(FilterMenuStep.Initial);
|
|
487
|
+
uiState.currentAdjustmentId && dispatchUiState({
|
|
488
|
+
type: UiStateActionType.SetCurrentAdjustmentId,
|
|
489
|
+
payload: undefined
|
|
490
|
+
});
|
|
491
|
+
}, [handleSetStep, uiState.currentAdjustmentId, dispatchUiState]);
|
|
492
|
+
const handleCurrentlySelectedClick = useCallback(() => {
|
|
493
|
+
handleSetStep(FilterMenuStep.CurrentlySelected);
|
|
494
|
+
}, [handleSetStep]);
|
|
495
|
+
const selectAllHandler = useCallback(isAllSelected => {
|
|
496
|
+
if (!uiState.currentAdjustmentId) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
dispatchState({
|
|
500
|
+
type: isAllSelected ? StateActionType.DeselectAllChildren : StateActionType.SelectAllChildren,
|
|
501
|
+
payload: uiState.currentAdjustmentId
|
|
502
|
+
});
|
|
503
|
+
}, [uiState.currentAdjustmentId, dispatchState]);
|
|
504
|
+
const handleTriggerClick = () => {
|
|
505
|
+
dispatchUiState({
|
|
506
|
+
type: UiStateActionType.ToggleOpen,
|
|
507
|
+
payload: undefined
|
|
508
|
+
});
|
|
509
|
+
};
|
|
510
|
+
const handleAdvancedDialogOpen = useCallback(() => {
|
|
511
|
+
dispatchUiState({
|
|
512
|
+
type: UiStateActionType.SetAdvancedFilterIsOpen,
|
|
513
|
+
payload: true
|
|
514
|
+
});
|
|
515
|
+
}, []);
|
|
516
|
+
const handleAdvancedDialogClose = useCallback(() => {
|
|
517
|
+
dispatchUiState({
|
|
518
|
+
type: UiStateActionType.SetAdvancedFilterIsOpen,
|
|
519
|
+
payload: false
|
|
520
|
+
});
|
|
521
|
+
}, []);
|
|
522
|
+
const handleAdvancedDialogApply = useCallback(val => {
|
|
523
|
+
dispatchUiState({
|
|
524
|
+
type: UiStateActionType.SetAdvancedFilterIsOpen,
|
|
525
|
+
payload: false
|
|
526
|
+
});
|
|
527
|
+
dispatchState({
|
|
528
|
+
type: StateActionType.SetAdvancedFilterState,
|
|
529
|
+
payload: val.items.length ? val : getDefaultFilterState()
|
|
530
|
+
});
|
|
531
|
+
}, []);
|
|
532
|
+
const getAdvancedData = useCallback((_, searchValue) => dataLoader().then(data => searchValue ? data.filter(el => (el.name || el.id).toLocaleLowerCase().indexOf(searchValue.toLocaleLowerCase()) > -1) : data).catch(e => {
|
|
533
|
+
errorHandler(e);
|
|
534
|
+
return [];
|
|
535
|
+
}), [dataLoader, errorHandler]);
|
|
536
|
+
useEffect(() => {
|
|
537
|
+
dispatchUiState({
|
|
538
|
+
type: UiStateActionType.SetLoadWithError,
|
|
539
|
+
payload: false
|
|
540
|
+
});
|
|
541
|
+
dataLoader().then(groups => {
|
|
542
|
+
dispatchState({
|
|
543
|
+
type: StateActionType.CreateGroupsMap,
|
|
544
|
+
payload: groups
|
|
545
|
+
});
|
|
546
|
+
setDataItems(groups);
|
|
547
|
+
}).catch(e => {
|
|
548
|
+
dispatchUiState({
|
|
549
|
+
type: UiStateActionType.SetLoadWithError,
|
|
550
|
+
payload: true
|
|
551
|
+
});
|
|
552
|
+
errorHandler(e);
|
|
553
|
+
});
|
|
554
|
+
}, [dataLoader, errorHandler]);
|
|
555
|
+
useEffect(() => {
|
|
556
|
+
const step = uiState.step;
|
|
557
|
+
if (step !== FilterMenuStep.CurrentlySelected) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
const groupsBlocks = getAdvancedFilterValue({
|
|
561
|
+
blocks: blocksMap[uiState.step],
|
|
562
|
+
state,
|
|
563
|
+
isWithColor: isWithColor || false,
|
|
564
|
+
uncheckedItems: uiState.step === FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdjustmentIds : [],
|
|
565
|
+
uncheckedAdvancedState: uiState.step === FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdvancedState : undefined,
|
|
566
|
+
listLimit
|
|
567
|
+
});
|
|
568
|
+
const label = getAdvancedLabel({
|
|
569
|
+
groupsBlocks
|
|
570
|
+
});
|
|
571
|
+
const selectedValues = dataItems.filter(item => {
|
|
572
|
+
var _a;
|
|
573
|
+
return (_a = state.frozenState.simpleFilterState) === null || _a === void 0 ? void 0 : _a.find(id => id === item.id);
|
|
574
|
+
}).map(item => item.name);
|
|
575
|
+
const selectedValuesLabel = selectedValues.join(` ${state.frozenState.relation === RelationOperator.OR ? translate("Or") : translate("And")} `);
|
|
576
|
+
if (!label && !selectedValuesLabel) {
|
|
577
|
+
setGroupPlaceHolder((options === null || options === void 0 ? void 0 : options.placeholder) || translate("Groups"));
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
const separator = `${label && selectedValuesLabel ? ` ${state.frozenState.relation === RelationOperator.OR ? translate("Or") : translate("And")} ` : ""}`;
|
|
581
|
+
setGroupPlaceHolder(`${label}${separator}${selectedValuesLabel}`);
|
|
582
|
+
}, [uiState.searchValue, uiState.step, blocksMap, state, isWithColor, listLimit, uiState.currentAdjustmentId, uiState.uncheckedAdjustmentIds, uiState.uncheckedAdvancedState, dataItems, options === null || options === void 0 ? void 0 : options.placeholder, translate]);
|
|
583
|
+
const getGroupsBox = useCallback(() => _jsx(GroupsFilterBox, {
|
|
584
|
+
step: uiState.step,
|
|
585
|
+
currentId: uiState.currentAdjustmentId,
|
|
586
|
+
isWithColor: isWithColor || false,
|
|
587
|
+
state: state,
|
|
588
|
+
search: uiState.searchValue,
|
|
589
|
+
blocks: uiState.searchValue && uiState.step === FilterMenuStep.Initial ? [] : blocksMap[uiState.step],
|
|
590
|
+
onChange: uiState.step === FilterMenuStep.CurrentlySelected ? handleCheckboxItemAdjustmentClick : handleCheckboxChange,
|
|
591
|
+
onClick: handleCheckboxItemClick,
|
|
592
|
+
uncheckedItems: uiState.step === FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdjustmentIds : [],
|
|
593
|
+
uncheckedAdvancedState: uiState.step === FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdvancedState : undefined,
|
|
594
|
+
listLimit: listLimit
|
|
595
|
+
}), [blocksMap, handleCheckboxChange, handleCheckboxItemAdjustmentClick, handleCheckboxItemClick, isWithColor, listLimit, state, uiState.currentAdjustmentId, uiState.searchValue, uiState.step, uiState.uncheckedAdjustmentIds, uiState.uncheckedAdvancedState]);
|
|
596
|
+
const onSideWideChange = newState => {
|
|
597
|
+
dispatchState({
|
|
598
|
+
type: StateActionType.SideWide,
|
|
599
|
+
payload: newState
|
|
600
|
+
});
|
|
601
|
+
};
|
|
602
|
+
const onRelationChange = newRelation => {
|
|
603
|
+
dispatchState({
|
|
604
|
+
type: StateActionType.Relation,
|
|
605
|
+
payload: newRelation
|
|
606
|
+
});
|
|
607
|
+
};
|
|
608
|
+
const getSearchResult = useCallback(() => {
|
|
609
|
+
const result = getSearchResultFromObject(state, uiState.searchValue);
|
|
610
|
+
return result ? (result.builtInGroups.length + result.userGroups.length).toString() : "0";
|
|
611
|
+
}, [state, uiState.searchValue]);
|
|
612
|
+
const getAdvancedDialog = useMemo(() => _jsx(AdvancedGroupsFilter, {
|
|
613
|
+
isOpen: uiState.isOpenAdvancedFilter,
|
|
614
|
+
onClose: handleAdvancedDialogClose,
|
|
615
|
+
onApply: handleAdvancedDialogApply,
|
|
616
|
+
state: state.advancedFilterState,
|
|
617
|
+
getData: getAdvancedData,
|
|
618
|
+
errorHandler: errorHandler,
|
|
619
|
+
dataItems: dataItems,
|
|
620
|
+
isMobile: isMobile
|
|
621
|
+
}), [uiState.isOpenAdvancedFilter, handleAdvancedDialogClose, handleAdvancedDialogApply, dataItems, state.advancedFilterState, getAdvancedData, errorHandler, isMobile]);
|
|
622
|
+
useEffect(() => {
|
|
623
|
+
if (!state.globalChanges) {
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
const newState = {
|
|
627
|
+
groups: convertPreparedFilters(state.frozenState),
|
|
628
|
+
sideWide: state.frozenSideWideState
|
|
186
629
|
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
}, [initialFilterStateInner, state.groupsMap]);
|
|
274
|
-
const handleReadyForFocus = useCallback((isCurrentOpen) => {
|
|
275
|
-
var _a, _b, _c;
|
|
276
|
-
if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
if (!isCurrentOpen) {
|
|
280
|
-
(_b = emptyInputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
(_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.focus();
|
|
284
|
-
}, [inputRef]);
|
|
285
|
-
useEffect(() => {
|
|
286
|
-
var _a, _b, _c, _d;
|
|
287
|
-
if (!uiState.isOpen) {
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
if (uiState.searchValue && uiState.step === FilterMenuStep.Initial || uiState.step === FilterMenuStep.Initial && uiState.searchValue === ""
|
|
291
|
-
&& prevSearchField.current !== uiState.searchValue) {
|
|
292
|
-
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
293
|
-
prevSearchField.current = uiState.searchValue;
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
const firstFocusable = chip ? (_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(FOCUSABLE_SELECTOR)[1] : (_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.querySelector(FOCUSABLE_SELECTOR);
|
|
297
|
-
prevSearchField.current = "";
|
|
298
|
-
if (firstFocusable && !((_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.value)) {
|
|
299
|
-
firstFocusable.focus();
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}, [uiState.searchValue, uiState.isOpen, uiState.step, handleSetStep, chip]);
|
|
303
|
-
useEffect(() => {
|
|
304
|
-
var _a;
|
|
305
|
-
uiState.isOpen && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
|
|
306
|
-
}, [inputRef, uiState.isOpen]);
|
|
307
|
-
useEffect(() => {
|
|
308
|
-
if (!uiState.isOpen && uiState.step === FilterMenuStep.Initial && isFilterHasSelection(state.frozenState)) {
|
|
309
|
-
dispatchUiState({ type: UiStateActionType.SetStep, payload: FilterMenuStep.CurrentlySelected });
|
|
310
|
-
}
|
|
311
|
-
}, [uiState.isOpen, state.frozenState, uiState.step]);
|
|
312
|
-
function handleEscape(e) {
|
|
313
|
-
var _a;
|
|
314
|
-
if (e && uiState.isOpen) {
|
|
315
|
-
(_a = e.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation();
|
|
316
|
-
}
|
|
317
|
-
if (uiState.isOpenAdvancedFilter) {
|
|
318
|
-
handleAdvancedDialogClose();
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
dispatchUiState({ type: UiStateActionType.SetIsOpen, payload: false });
|
|
322
|
-
if (triggerRef.current) {
|
|
323
|
-
triggerRef.current.focus();
|
|
324
|
-
}
|
|
630
|
+
if ((initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.sideWide) === state.frozenSideWideState && comparePreparedFilters(prepareFilters(initialFilterStateInner.groups), state.frozenState)) {
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
const selectedValues = dataItems.filter(item => {
|
|
634
|
+
var _a;
|
|
635
|
+
return (_a = state.frozenState.simpleFilterState) === null || _a === void 0 ? void 0 : _a.find(id => id === item.id);
|
|
636
|
+
}).map(item => item.name);
|
|
637
|
+
setGroupPlaceHolder(selectedValues.length > 0 ? selectedValues.join(", ") : translate("Groups"));
|
|
638
|
+
onChangeInner(Object.assign({}, newState));
|
|
639
|
+
dispatchState({
|
|
640
|
+
type: StateActionType.TurnOfGlobalChanges,
|
|
641
|
+
payload: undefined
|
|
642
|
+
});
|
|
643
|
+
}, [state.globalChanges, dataItems, translate, state.frozenState, state.frozenSideWideState, onChangeInner, initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.sideWide, initialFilterStateInner]);
|
|
644
|
+
useEffect(() => {
|
|
645
|
+
var _a;
|
|
646
|
+
if (((_a = prevInitialState.current) === null || _a === void 0 ? void 0 : _a.sideWide) === (initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.sideWide) && comparePreparedFilters(prepareFilters(initialFilterStateInner ? initialFilterStateInner.groups : getDefaultFilterState()), prepareFilters(prevInitialState.current ? prevInitialState.current.groups : getDefaultFilterState()))) {
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
const stateForDispatch = (initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.groups) ? {
|
|
650
|
+
value: prepareFilters(initialFilterStateInner.groups),
|
|
651
|
+
global: initialFilterStateInner.sideWide
|
|
652
|
+
} : {
|
|
653
|
+
value: prepareFilters(getDefaultFilterState()),
|
|
654
|
+
global: false
|
|
655
|
+
};
|
|
656
|
+
if (Object.keys(state.groupsMap).length > 0) {
|
|
657
|
+
prevInitialState.current = initialFilterStateInner ? Object.assign({}, initialFilterStateInner) : undefined;
|
|
658
|
+
dispatchState({
|
|
659
|
+
type: StateActionType.CreateInitialState,
|
|
660
|
+
payload: stateForDispatch
|
|
661
|
+
});
|
|
662
|
+
!(initialFilterStateInner === null || initialFilterStateInner === void 0 ? void 0 : initialFilterStateInner.groups) && dispatchUiState({
|
|
663
|
+
type: UiStateActionType.SetStep,
|
|
664
|
+
payload: FilterMenuStep.Initial
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
}, [initialFilterStateInner, state.groupsMap]);
|
|
668
|
+
const handleReadyForFocus = useCallback(isCurrentOpen => {
|
|
669
|
+
var _a, _b, _c;
|
|
670
|
+
if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) {
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
if (!isCurrentOpen) {
|
|
674
|
+
(_b = emptyInputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
(_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.focus();
|
|
678
|
+
}, [inputRef]);
|
|
679
|
+
useEffect(() => {
|
|
680
|
+
var _a, _b, _c, _d;
|
|
681
|
+
if (!uiState.isOpen) {
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
if (uiState.searchValue && uiState.step === FilterMenuStep.Initial || uiState.step === FilterMenuStep.Initial && uiState.searchValue === "" && prevSearchField.current !== uiState.searchValue) {
|
|
685
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
686
|
+
prevSearchField.current = uiState.searchValue;
|
|
687
|
+
} else {
|
|
688
|
+
const firstFocusable = chip ? (_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(FOCUSABLE_SELECTOR)[1] : (_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.querySelector(FOCUSABLE_SELECTOR);
|
|
689
|
+
prevSearchField.current = "";
|
|
690
|
+
if (firstFocusable && !((_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.value)) {
|
|
691
|
+
firstFocusable.focus();
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}, [uiState.searchValue, uiState.isOpen, uiState.step, handleSetStep, chip]);
|
|
695
|
+
useEffect(() => {
|
|
696
|
+
var _a;
|
|
697
|
+
uiState.isOpen && ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
|
|
698
|
+
}, [inputRef, uiState.isOpen]);
|
|
699
|
+
useEffect(() => {
|
|
700
|
+
if (!uiState.isOpen && uiState.step === FilterMenuStep.Initial && isFilterHasSelection(state.frozenState)) {
|
|
701
|
+
dispatchUiState({
|
|
702
|
+
type: UiStateActionType.SetStep,
|
|
703
|
+
payload: FilterMenuStep.CurrentlySelected
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
}, [uiState.isOpen, state.frozenState, uiState.step]);
|
|
707
|
+
function handleEscape(e) {
|
|
708
|
+
var _a;
|
|
709
|
+
if (e && uiState.isOpen) {
|
|
710
|
+
(_a = e.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation();
|
|
711
|
+
}
|
|
712
|
+
if (uiState.isOpenAdvancedFilter) {
|
|
713
|
+
handleAdvancedDialogClose();
|
|
714
|
+
return;
|
|
325
715
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
getGroupsBox, handleBackButtonClick, handleHomeButtonClick, selectAllHandler, basicHandleBackButtonClick]);
|
|
333
|
-
const memoizedFooterButtons = useMemo(() => _jsxs(FooterButtons, { children: [_jsx(Button, { onClick: handleApply, type: ButtonType.Primary, disabled: isApplyDisabled, className: "zen-groups-filter-menu__apply-button zen-ellipsis", title: translate("Apply"), children: translate("Apply") }), _jsx(Button, { onClick: handleCancel, className: "zen-groups-filter-menu__cancel-button zen-ellipsis", title: translate("Cancel"), children: translate("Cancel") }), _jsx(Button, { type: ButtonType.Tertiary, className: "zen-groups-filter-menu__reset-button zen-ellipsis", onClick: handleReset, children: translate("Clear") })] }), [handleApply, handleCancel, handleReset, isApplyDisabled, translate]);
|
|
334
|
-
const memoizedMobileView = useMemo(() => _jsxs(MobileSheet, { label: translate("Organization groups filter"), triggerRef: triggerRef, isOpen: uiState.isOpen, onHidePanel: onOptionsToggle, onCloseClick: onOptionsToggle, preventFirstFocus: true, onReadyForFocus: handleReadyForFocus, children: [_jsx(MobileSheet.Title, { children: translate("Filter by group") }), _jsx(MobileSheet.Content, { children: memoizedContent }), _jsx(MobileSheet.Footer, { children: memoizedFooterButtons })] }), [translate, uiState.isOpen, onOptionsToggle, handleReadyForFocus, memoizedContent, memoizedFooterButtons]);
|
|
335
|
-
const memoizedDesktopView = useMemo(() => _jsx(ControlledPopup, { isOpen: uiState.isOpen, className: classNames(["zen-groups-filter__popup",
|
|
336
|
-
uiState.isOpenAdvancedFilter ? "zen-groups-filter__popup--inactive" : "", className ? className : ""]), onOpenChange: onOptionsToggle, useTrapFocusWithTrigger: uiState.isOpenAdvancedFilter ? "off" : "withTrigger", shouldHoldScroll: true, triggerRef: triggerRef, ariaLabel: translate("Organization groups filter"), recalculateOnScroll: true, children: memoizedContent }), [className, memoizedContent, onOptionsToggle, translate, uiState.isOpen, uiState.isOpenAdvancedFilter]);
|
|
337
|
-
const triggerClassName = classNames(["zen-groups-filter-trigger", isError ? "zen-groups-filter-trigger--error" : ""]);
|
|
338
|
-
if (isReadOnly) {
|
|
339
|
-
// TODO: how many items should we show?
|
|
340
|
-
return _jsx(ReviewTextControl, { value: groupPlaceHolder });
|
|
716
|
+
dispatchUiState({
|
|
717
|
+
type: UiStateActionType.SetIsOpen,
|
|
718
|
+
payload: false
|
|
719
|
+
});
|
|
720
|
+
if (triggerRef.current) {
|
|
721
|
+
triggerRef.current.focus();
|
|
341
722
|
}
|
|
342
|
-
|
|
343
|
-
|
|
723
|
+
}
|
|
724
|
+
useEscape(triggerRef, handleEscape, uiState.isOpen);
|
|
725
|
+
const selectedCount = getFrozenCount(state);
|
|
726
|
+
const isStateHasData = Object.keys(state.groupsMap).length > 0;
|
|
727
|
+
const isApplyDisabled = !isStateChanged(state);
|
|
728
|
+
const memoizedContent = useMemo(() => _jsxs("div", {
|
|
729
|
+
className: classNames(["zen-groups-filter-menu", isMobile ? "zen-groups-filter-menu--mobile" : ""]),
|
|
730
|
+
ref: menuRef,
|
|
731
|
+
children: [chip || isMobile ? _jsx("div", {
|
|
732
|
+
className: "zen-groups-filter__input-container",
|
|
733
|
+
children: _jsx(SearchInput, {
|
|
734
|
+
className: "zen-groups-filter__chip-input",
|
|
735
|
+
onChange: onSearchChipChange,
|
|
736
|
+
value: uiState.searchValue,
|
|
737
|
+
ref: inputRef,
|
|
738
|
+
id: groupsFilterId,
|
|
739
|
+
placeholder: translate("Filter by group")
|
|
740
|
+
})
|
|
741
|
+
}) : null, isStateHasData && !uiState.isLoadWithError && _jsxs(GroupsFilterMenu, {
|
|
742
|
+
onCancelClick: handleCancel,
|
|
743
|
+
onApplyClick: handleApply,
|
|
744
|
+
onResetClick: handleReset,
|
|
745
|
+
isApplyDisabled: isApplyDisabled,
|
|
746
|
+
hasFooter: !isMobile,
|
|
747
|
+
children: [uiState.step === FilterMenuStep.Initial && _jsx(GroupsFilterInitialState, {
|
|
748
|
+
siteWideState: state.sideWideState,
|
|
749
|
+
onDialogButtonClick: handleAdvancedDialogOpen,
|
|
750
|
+
count: getCurrentlySelectedCount(state),
|
|
751
|
+
onSiteWideChange: onSideWideChange,
|
|
752
|
+
onCurrentlySelectedClick: handleCurrentlySelectedClick,
|
|
753
|
+
searchResult: uiState.searchValue ? getSearchResult() : "",
|
|
754
|
+
children: getGroupsBox()
|
|
755
|
+
}), uiState.step === FilterMenuStep.Adjustment && _jsx(GroupsFilterAdjustmentState, {
|
|
756
|
+
onBackButtonClick: handleBackButtonClick,
|
|
757
|
+
onHomeButtonClick: handleHomeButtonClick,
|
|
758
|
+
onSelectAllClick: selectAllHandler,
|
|
759
|
+
backButtonName: getBackButtonName(state, uiState.currentAdjustmentId),
|
|
760
|
+
isAllSelected: isAllChildrenSelected(state, uiState.currentAdjustmentId),
|
|
761
|
+
children: getGroupsBox()
|
|
762
|
+
}), uiState.step === FilterMenuStep.CurrentlySelected && _jsx(GroupsFilterCurrentlySelectedState, {
|
|
763
|
+
siteWideState: state.sideWideState,
|
|
764
|
+
relation: state.relation,
|
|
765
|
+
count: getCurrentlySelectedCount(state),
|
|
766
|
+
onBackButtonClick: basicHandleBackButtonClick,
|
|
767
|
+
onSiteWideChange: onSideWideChange,
|
|
768
|
+
onRelationChange: onRelationChange,
|
|
769
|
+
children: getGroupsBox()
|
|
770
|
+
})]
|
|
771
|
+
}), !uiState.isLoadWithError && !isStateHasData && !Object.keys(state.groupsMap).length && _jsx(SkeletonList, {
|
|
772
|
+
className: "zen-groups-filter__waiting"
|
|
773
|
+
})]
|
|
774
|
+
}), [isMobile, chip, onSearchChipChange, uiState.searchValue, uiState.isLoadWithError, uiState.step, uiState.currentAdjustmentId, groupsFilterId, translate, isStateHasData, handleCancel, handleApply, handleReset, isApplyDisabled, state, handleAdvancedDialogOpen, handleCurrentlySelectedClick, getSearchResult, getGroupsBox, handleBackButtonClick, handleHomeButtonClick, selectAllHandler, basicHandleBackButtonClick]);
|
|
775
|
+
const memoizedFooterButtons = useMemo(() => _jsxs(FooterButtons, {
|
|
776
|
+
children: [_jsx(Button, {
|
|
777
|
+
onClick: handleApply,
|
|
778
|
+
type: ButtonType.Primary,
|
|
779
|
+
disabled: isApplyDisabled,
|
|
780
|
+
className: "zen-groups-filter-menu__apply-button zen-ellipsis",
|
|
781
|
+
title: translate("Apply"),
|
|
782
|
+
children: translate("Apply")
|
|
783
|
+
}), _jsx(Button, {
|
|
784
|
+
onClick: handleCancel,
|
|
785
|
+
className: "zen-groups-filter-menu__cancel-button zen-ellipsis",
|
|
786
|
+
title: translate("Cancel"),
|
|
787
|
+
children: translate("Cancel")
|
|
788
|
+
}), _jsx(Button, {
|
|
789
|
+
type: ButtonType.Tertiary,
|
|
790
|
+
className: "zen-groups-filter-menu__reset-button zen-ellipsis",
|
|
791
|
+
onClick: handleReset,
|
|
792
|
+
children: translate("Clear")
|
|
793
|
+
})]
|
|
794
|
+
}), [handleApply, handleCancel, handleReset, isApplyDisabled, translate]);
|
|
795
|
+
const memoizedMobileView = useMemo(() => _jsxs(MobileSheet, {
|
|
796
|
+
label: translate("Organization groups filter"),
|
|
797
|
+
triggerRef: triggerRef,
|
|
798
|
+
isOpen: uiState.isOpen,
|
|
799
|
+
onHidePanel: onOptionsToggle,
|
|
800
|
+
onCloseClick: onOptionsToggle,
|
|
801
|
+
preventFirstFocus: true,
|
|
802
|
+
onReadyForFocus: handleReadyForFocus,
|
|
803
|
+
children: [_jsx(MobileSheet.Title, {
|
|
804
|
+
children: translate("Filter by group")
|
|
805
|
+
}), _jsx(MobileSheet.Content, {
|
|
806
|
+
children: memoizedContent
|
|
807
|
+
}), _jsx(MobileSheet.Footer, {
|
|
808
|
+
children: memoizedFooterButtons
|
|
809
|
+
})]
|
|
810
|
+
}), [translate, uiState.isOpen, onOptionsToggle, handleReadyForFocus, memoizedContent, memoizedFooterButtons]);
|
|
811
|
+
const memoizedDesktopView = useMemo(() => _jsx(ControlledPopup, {
|
|
812
|
+
isOpen: uiState.isOpen,
|
|
813
|
+
className: classNames(["zen-groups-filter__popup", uiState.isOpenAdvancedFilter ? "zen-groups-filter__popup--inactive" : "", classNamePopup || ""]),
|
|
814
|
+
onOpenChange: onOptionsToggle,
|
|
815
|
+
useTrapFocusWithTrigger: uiState.isOpenAdvancedFilter ? "off" : "withTrigger",
|
|
816
|
+
shouldHoldScroll: true,
|
|
817
|
+
triggerRef: triggerRef,
|
|
818
|
+
ariaLabel: translate("Organization groups filter"),
|
|
819
|
+
recalculateOnScroll: true,
|
|
820
|
+
children: memoizedContent
|
|
821
|
+
}), [classNamePopup, memoizedContent, onOptionsToggle, translate, uiState.isOpen, uiState.isOpenAdvancedFilter]);
|
|
822
|
+
const triggerClassName = classNames(["zen-groups-filter-trigger", isError ? "zen-groups-filter-trigger--error" : "", className || ""]);
|
|
823
|
+
if (isReadOnly) {
|
|
824
|
+
// TODO: how many items should we show?
|
|
825
|
+
return _jsx(ReviewTextControl, {
|
|
826
|
+
value: groupPlaceHolder
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
return _jsxs(_Fragment, {
|
|
830
|
+
children: [chip ? _jsx(Chip, {
|
|
831
|
+
status: selectedCount ? chipStatus || "active" : undefined,
|
|
832
|
+
isOpen: uiState.isOpen,
|
|
833
|
+
disabled: false,
|
|
834
|
+
onClick: handleTriggerClick,
|
|
835
|
+
onClose: selectedCount ? handleChipClose : undefined,
|
|
836
|
+
triggerRef: triggerRef,
|
|
837
|
+
icon: chipIcon,
|
|
838
|
+
id: chipId,
|
|
839
|
+
children: groupPlaceHolder !== translate("Groups") ? groupPlaceHolder : chipName
|
|
840
|
+
}) : _jsx(GroupsFilterTrigger, {
|
|
841
|
+
value: uiState.searchValue,
|
|
842
|
+
className: triggerClassName,
|
|
843
|
+
onChange: onSearchChange,
|
|
844
|
+
isOpenPopup: uiState.isOpen,
|
|
845
|
+
count: selectedCount,
|
|
846
|
+
withGlobeIcon: state.frozenSideWideState && selectedCount > 0,
|
|
847
|
+
inputRef: isMobile ? emptyInputRef : inputRef,
|
|
848
|
+
handleClick: handleTriggerClick,
|
|
849
|
+
ref: triggerRef,
|
|
850
|
+
fullSize: fullSize,
|
|
851
|
+
placeholder: groupPlaceHolder
|
|
852
|
+
}), isMobile ? memoizedMobileView : memoizedDesktopView, uiState.isOpenAdvancedFilter && getAdvancedDialog]
|
|
853
|
+
});
|
|
344
854
|
};
|
|
345
|
-
export const TRANSLATIONS = [
|
|
346
|
-
"Organization groups filter",
|
|
347
|
-
...GroupsFilterMenuTranslations,
|
|
348
|
-
...GroupsFilterTriggerTranslations,
|
|
349
|
-
...GroupsFilterAdjustmentStateTranslations,
|
|
350
|
-
...GroupsFilterInitialStateTranslations,
|
|
351
|
-
...GroupsFilterCurrentlySelectedStateTranslations
|
|
352
|
-
];
|
|
855
|
+
export const TRANSLATIONS = ["Organization groups filter", ...GroupsFilterMenuTranslations, ...GroupsFilterTriggerTranslations, ...GroupsFilterAdjustmentStateTranslations, ...GroupsFilterInitialStateTranslations, ...GroupsFilterCurrentlySelectedStateTranslations];
|