@geotab/zenith 3.14.1 → 3.15.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 +28 -2
- package/dist/advancedGroupsFilter/advancedGroupsFilterFormSection.js +17 -7
- package/dist/alert/banner.d.ts +2 -3
- package/dist/alert/hooks/useAlertState.d.ts +0 -1
- package/dist/banner/bannerMultipLine.d.ts +0 -1
- package/dist/banner/bannerSingleLine.d.ts +0 -1
- package/dist/banner/utils/isSummaryErrorElement.d.ts +1 -2
- package/dist/calendar/dateUtils.js +2 -2
- package/dist/card/card.js +17 -7
- package/dist/card/components/content.d.ts +0 -1
- package/dist/cardContainer/helpers/getSizeClass.js +1 -2
- package/dist/chart/accessibleChart/accessibleChart.js +1 -1
- package/dist/chart/accessibleChart/accessibleChartNarrative.d.ts +1 -1
- package/dist/chart/accessibleChart/accessibleChartNarrative.js +11 -5
- package/dist/chart/accessibleChart/generatePieNarrative.d.ts +7 -0
- package/dist/chart/accessibleChart/generatePieNarrative.js +179 -0
- package/dist/chart/accessibleChart/interfaces.d.ts +1 -0
- package/dist/chart/barChart/getDefaultOptions.js +5 -6
- package/dist/chart/barChart.js +152 -50
- package/dist/chart/interfaces.d.ts +0 -1
- package/dist/chart/lineChart/getDefaultOptions.js +5 -6
- package/dist/chart/lineChart/useChartTicks.d.ts +0 -1
- package/dist/chart/lineChart/useSummary.d.ts +7 -8
- package/dist/chart/lineChart.js +167 -59
- package/dist/chart/pieChart.js +174 -76
- package/dist/chart/plugins/linePlugin/getInterpolatedValue.js +10 -2
- package/dist/chart/utils/convertDates.d.ts +1 -1
- package/dist/chart/utils/getFormattedLabel.js +1 -2
- package/dist/chart/utils/getNiceAxisRange.d.ts +21 -0
- package/dist/chart/utils/getNiceAxisRange.js +76 -0
- package/dist/chart/utils/getRange.js +2 -2
- package/dist/chart/utils/getYAxisMeta.d.ts +2 -5
- package/dist/chart/utils/getYAxisMeta.js +17 -2
- package/dist/chart/utils/getYAxisTickCount.d.ts +15 -0
- package/dist/chart/utils/getYAxisTickCount.js +19 -0
- package/dist/chart/utils/resampleArrayEvenly.js +1 -2
- package/dist/checkbox/checkbox.js +17 -7
- package/dist/checkboxListWithAction/checkboxListWithAction.d.ts +0 -1
- package/dist/chip/chip.d.ts +0 -1
- package/dist/chip/utils/useChip.d.ts +0 -1
- package/dist/commonHelpers/HOC/reducerLogger/reducerLogger.d.ts +1 -1
- package/dist/commonHelpers/arrowNavigation/components/arrowButton/arrowButton.d.ts +0 -1
- package/dist/commonHelpers/arrowNavigation/hooks/useHoldOnScroll.d.ts +0 -1
- package/dist/commonHelpers/generateId.js +1 -2
- package/dist/commonHelpers/hooks/breakpoints.d.ts +4 -0
- package/dist/commonHelpers/hooks/breakpoints.js +7 -0
- package/dist/commonHelpers/hooks/fetch.reducer.d.ts +1 -1
- package/dist/commonHelpers/hooks/fetch.reducer.js +1 -2
- package/dist/commonHelpers/hooks/useDebouncedMemo.d.ts +0 -1
- package/dist/commonHelpers/hooks/useDebouncedMemo.js +1 -2
- package/dist/commonHelpers/hooks/useDeviceType.js +2 -2
- package/dist/commonHelpers/hooks/useEscape.d.ts +1 -1
- package/dist/commonHelpers/hooks/useGridSize.d.ts +0 -1
- package/dist/commonHelpers/hooks/useMobileOrTablet.d.ts +1 -0
- package/dist/commonHelpers/hooks/useMobileOrTablet.js +21 -0
- package/dist/commonHelpers/hooks/usePillSize.d.ts +0 -1
- package/dist/{gridLayout → commonHelpers}/hooks/useTablet.js +8 -11
- package/dist/commonHelpers/utils.js +3 -3
- package/dist/commonStyles/colors/colors.less +1 -0
- package/dist/dataFeed/dataFeed.d.ts +1 -1
- package/dist/dataFeed/dataFeed.js +2 -2
- package/dist/dataFeed/dataFeedCell/dataFeedCell.d.ts +3 -1
- package/dist/dataFeed/dataFeedColumnsItems.d.ts +2 -2
- package/dist/dataGrid/cell/cell.d.ts +3 -1
- package/dist/dataGrid/columns/actionsColumn/actionsButton.js +1 -2
- package/dist/dataGrid/columns/actionsColumn/actionsColumn.d.ts +3 -3
- package/dist/dataGrid/dataGrid.d.ts +13 -1
- package/dist/dataGrid/dataGrid.js +48 -3
- package/dist/dataGrid/emptySearchList/emptySearchList.d.ts +0 -1
- package/dist/dataGrid/row/row.d.ts +3 -1
- package/dist/dataGrid/withActions/withActions.d.ts +1 -1
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsList.js +1 -2
- package/dist/dataGrid/withFlexibleColumns/withFlexibleColumns.d.ts +1 -1
- package/dist/dataGrid/withLoading/withLoading.d.ts +1 -1
- package/dist/dataGrid/withSelectableRows/withLimitedSelectableRows.d.ts +1 -1
- package/dist/dataGrid/withSelectableRows/withSelectableRows.d.ts +1 -1
- package/dist/dataGrid/withSortableColumns/withSortableColumns.d.ts +1 -1
- package/dist/dateInputInner/dateInputInnerReducer.js +2 -2
- package/dist/dateRangeRaw/utils/areMapsEqual.js +1 -2
- package/dist/dialog/dialog.d.ts +0 -1
- package/dist/dropdown/dropdown.js +1 -1
- package/dist/dropdown/useDropdownState.d.ts +0 -1
- package/dist/dropdownRaw/dropdownHelper.js +2 -2
- package/dist/dropdownRaw/dropdownList.d.ts +3 -2
- package/dist/dropdownRaw/dropdownList.js +31 -49
- package/dist/dropdownRaw/dropdownRaw.js +34 -13
- package/dist/dropdownRaw/stateReducer/stateReducer.d.ts +4 -1
- package/dist/dropdownRaw/stateReducer/stateReducer.js +33 -23
- package/dist/dropdownRaw/stateReducer/stateReducerHelper.d.ts +1 -2
- package/dist/dropdownRaw/stateReducer/stateReducerHelper.js +8 -13
- package/dist/dropdownRaw/types.d.ts +20 -0
- package/dist/feedbackContainer/feedbackContainer.js +17 -7
- package/dist/feedbackContainer/hooks/useFeedbackAlert.d.ts +0 -1
- package/dist/feedbackContainer/hooks/useFeedbackToast.d.ts +0 -1
- package/dist/filters/components/filtersDropdown.js +2 -2
- package/dist/filters/components/filtersItem.d.ts +2 -2
- package/dist/filters/components/filtersSearchList.d.ts +0 -1
- package/dist/filters/components/filtersSelect.d.ts +0 -1
- package/dist/filters/components/filtersSelectCompact.d.ts +0 -1
- package/dist/filters/components/filtersSelectListItem.d.ts +0 -1
- package/dist/filters/components/filtersSelectUnfoldingPill.d.ts +0 -1
- package/dist/filters/components/filtersSidePanelItem.js +17 -7
- package/dist/filters/filtersHelper.d.ts +1 -1
- package/dist/filters/filtersHelper.js +5 -5
- package/dist/filters/filtersHooks.d.ts +0 -1
- package/dist/filtersBar/components/filtersBarDropdownWithCheckbox/filtersBarDropdownWithCheckbox.js +1 -1
- package/dist/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +2 -2
- package/dist/filtersBar/filtersBar.js +2 -2
- package/dist/filtersBar/filtersBarActions/filtersBarActions.d.ts +0 -1
- package/dist/filtersBar/filtersBarInterfaces.d.ts +0 -1
- package/dist/filtersBar/filtersBarReducer.js +2 -2
- package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelDropdownWithCheckbox/filtersBarSidePanelDropdownWithCheckbox.d.ts +4 -10
- package/dist/filtersBar/filtersBarSidePanel/sidePanelReducer.js +2 -2
- package/dist/filtersBar/utils/getNumberOfChangedFilters.js +1 -2
- package/dist/footerButtons/footerButtons.js +17 -7
- package/dist/formField/components/formFieldAdditionalInfo.d.ts +0 -1
- package/dist/formField/components/formFieldCounter.d.ts +0 -1
- package/dist/formField/components/formFieldLoading.d.ts +0 -1
- package/dist/formField/components/formFieldSkeleton.d.ts +0 -1
- package/dist/formField/components/formFieldWithLabel.d.ts +0 -1
- package/dist/formField/components/formFieldWithoutLabel.d.ts +0 -1
- package/dist/formField/formField.d.ts +1 -1
- package/dist/formField/hooks/useBanner.d.ts +0 -1
- package/dist/formField/hooks/useDisabled.d.ts +1 -1
- package/dist/formGroup/components/customRow/customRow.d.ts +0 -1
- package/dist/formGroup/formGroup.js +17 -7
- package/dist/formGroup/hooks/listHooks/useStateToElements.d.ts +0 -1
- package/dist/formGroup/hooks/listHooks/useStateToElements.js +1 -1
- package/dist/formGroup/utils/formGroupProvider.d.ts +0 -1
- package/dist/formGroup/utils/isFormLabel.d.ts +1 -1
- package/dist/formGroupItem/formGroupItem.d.ts +0 -1
- package/dist/formLayout/components/layoutColumn/layoutColum.d.ts +0 -1
- package/dist/formLayout/hooks/useFormButtons.d.ts +1 -1
- package/dist/formLayout/types.d.ts +0 -1
- package/dist/formLayout/utils/attachHeadings.d.ts +1 -1
- package/dist/formLayout/utils/attachSeparators.d.ts +0 -1
- package/dist/formLayout/utils/getChildrenWithCustomColumns.d.ts +1 -2
- package/dist/formLayout/utils/getChildrenWithCustomColumns.js +2 -2
- package/dist/formLayout/utils/getFieldLabel.js +5 -5
- package/dist/formSection/components/actions.d.ts +0 -1
- package/dist/formSection/components/additional.d.ts +0 -1
- package/dist/formSection/utils/isFormSection.d.ts +2 -4
- package/dist/formStepper/components/formStepRaw.d.ts +0 -1
- package/dist/formStepper/formStepper.d.ts +0 -1
- package/dist/formStepper/formStepper.js +5 -5
- package/dist/formStepperButtons/formStepperButtons.js +3 -3
- package/dist/gridLayout/hooks/useStretch.js +1 -1
- package/dist/gridLayout/utils/convertStateToClasses.js +1 -2
- package/dist/gridLayout/utils/gridLayoutProvider.d.ts +0 -1
- package/dist/gridLayout/utils/gridLayoutProvider.js +1 -1
- package/dist/gridLayout/utils/isGridItem.d.ts +1 -1
- package/dist/groupsFilter/groupsHelper.d.ts +5 -5
- package/dist/groupsFilterRaw/groupsFilterHelper.js +16 -16
- package/dist/groupsFilterRaw/groupsHelper.d.ts +1 -1
- package/dist/groupsFilterRaw/groupsHelper.js +4 -4
- package/dist/groupsFilterRaw/stateReducer/stateReducer.d.ts +1 -1
- package/dist/groupsFilterRaw/stateReducer/stateReducer.js +2 -2
- package/dist/groupsFilterRaw/testData.js +3 -4
- package/dist/groupsFilterRaw/uiStateReducer/uiStateReducer.js +2 -2
- package/dist/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +5 -0
- package/dist/header/components/mobileFilterControl/mobileFilterControl.d.ts +0 -1
- package/dist/header/components/mobileSearchControl/mobileSearchControl.d.ts +0 -1
- package/dist/header/header.js +17 -7
- package/dist/header/headerButton.d.ts +0 -1
- package/dist/header/headerContext.d.ts +1 -2
- package/dist/header/headerHelpers.d.ts +5 -5
- package/dist/header/headerHelpers.js +17 -7
- package/dist/header/hooks/useNonFittingElements.d.ts +3 -4
- package/dist/headerTitle/headerTitle.d.ts +0 -1
- package/dist/icons/iconAce.d.ts +3 -0
- package/dist/icons/iconAce.js +12 -0
- package/dist/icons/iconBreak.d.ts +3 -0
- package/dist/icons/iconBreak.js +12 -0
- package/dist/icons/iconChevronStepper.d.ts +3 -0
- package/dist/icons/iconChevronStepper.js +12 -0
- package/dist/icons/iconPotato.d.ts +3 -0
- package/dist/icons/iconPotato.js +12 -0
- package/dist/icons/iconToggleLarge.d.ts +3 -0
- package/dist/icons/iconToggleLarge.js +12 -0
- package/dist/icons/iconToggleSmall.d.ts +3 -0
- package/dist/icons/iconToggleSmall.js +12 -0
- package/dist/icons/iconTrendNeutral.d.ts +3 -0
- package/dist/icons/iconTrendNeutral.js +12 -0
- package/dist/icons/iconTruck.d.ts +3 -0
- package/dist/icons/iconTruck.js +12 -0
- package/dist/index.css +234 -33
- package/dist/index.d.ts +8 -0
- package/dist/index.js +30 -13
- package/dist/layout/layout.d.ts +2 -1
- package/dist/layout/layout.js +17 -7
- package/dist/layout/layoutBanner.d.ts +0 -1
- package/dist/lineChart/lineChart.d.ts +1 -0
- package/dist/lineChart/lineChart.js +135 -70
- package/dist/lineChartMini/lineChartMini.d.ts +1 -0
- package/dist/lineChartMini/lineChartMini.js +141 -73
- package/dist/list/itemData/itemData.d.ts +2 -1
- package/dist/list/itemData/itemDataInternal.d.ts +2 -1
- package/dist/list/list.d.ts +0 -1
- package/dist/list/utils/changeOrder.js +1 -2
- package/dist/list/utils/isDataListitem.d.ts +1 -1
- package/dist/list/viewportProvider/viewportContext.d.ts +0 -1
- package/dist/menu/components/controlledMenuList/controlledMenuList.d.ts +2 -4
- package/dist/menu/components/controlledMenuList/controlledMenuList.js +3 -1
- package/dist/menu/components/createControlledMenuList.js +1 -2
- package/dist/menu/components/createMenuItem.js +1 -2
- package/dist/menu/contexts/usePathContext.js +1 -2
- package/dist/menu/utils/buildMenuContent.js +1 -2
- package/dist/menu/utils/findPrevFocusable.js +1 -2
- package/dist/menu/utils/useDisplayContent.d.ts +21 -0
- package/dist/menu/utils/useDisplayContent.js +35 -0
- package/dist/menu/utils/useMenuItemKeyboardNav.js +1 -2
- package/dist/miniTabs/miniTabsHelper.js +17 -7
- package/dist/mobileSheet/components/mobileSheetTitle.d.ts +0 -1
- package/dist/modal/modal.js +17 -7
- package/dist/nav/context/nav.context.d.ts +0 -1
- package/dist/nav/navFooter/navEditFooter/navEditFooter.d.ts +0 -1
- package/dist/nav/navFooter/navFooter.d.ts +1 -1
- package/dist/nav/navFooter/navFooterAction/navFooterAction.d.ts +2 -1
- package/dist/nav/navFooter/navFooterAction/navFooterAction.js +3 -1
- package/dist/nav/navItem/navItem.d.ts +2 -0
- package/dist/nav/navItem/navItem.js +56 -47
- package/dist/nav/navItem/navItemContent.d.ts +19 -0
- package/dist/nav/navItem/navItemContent.js +21 -0
- package/dist/nav/navItem/navItemType.d.ts +7 -0
- package/dist/nav/navItem/navItemType.js +9 -0
- package/dist/nav/utils/navUtils.d.ts +2 -4
- package/dist/nav/utils/navUtils.js +2 -2
- package/dist/overview/overview.d.ts +0 -1
- package/dist/pageHeader/pageHeader.d.ts +1 -1
- package/dist/pageHeader/pageHeaderButton.d.ts +0 -1
- package/dist/pageHeader/pageHeaderHelpers.d.ts +1 -1
- package/dist/pageHeader/pageHeaderMenu.d.ts +0 -1
- package/dist/pagination/paginationArrow.d.ts +0 -1
- package/dist/pill/interfaces/pill.interface.d.ts +0 -1
- package/dist/pillBox/components/pillBoxItem.d.ts +1 -2
- package/dist/popup/popup.js +17 -7
- package/dist/progressIndicator/progressIndicator.d.ts +39 -0
- package/dist/progressIndicator/progressIndicator.js +30 -0
- package/dist/progressIndicator/progressIndicatorUtils.d.ts +12 -0
- package/dist/progressIndicator/progressIndicatorUtils.js +30 -0
- package/dist/radioGroupRaw/radioGroupRaw.js +17 -7
- package/dist/radioGroupRaw/types.d.ts +0 -1
- package/dist/react-chartjs/dateFns/dateFns.js +10 -11
- package/dist/react-chartjs/utils.d.ts +3 -3
- package/dist/react-chartjs/utils.js +8 -9
- package/dist/searchInputRaw/searchInputRaw.js +17 -7
- package/dist/searchInputRaw/types.d.ts +0 -1
- package/dist/selectField/selectField.d.ts +2 -3
- package/dist/selectList/selectList.d.ts +0 -1
- package/dist/selectRaw/hooks/usePopupWidth.js +17 -7
- package/dist/selectRaw/selectRaw.js +20 -7
- package/dist/sidePanel/sidePanelCell/sidePanelCell.d.ts +0 -1
- package/dist/summaries/utils/splitIntoPairs.js +1 -2
- package/dist/summaryTile/summaryTile.js +17 -7
- package/dist/summaryTile/summaryTileTrigger.js +17 -7
- package/dist/table/actions/actionsMenu.d.ts +0 -1
- package/dist/table/children/useTableChildren.d.ts +7 -7
- package/dist/table/detailPanel/interfaces.d.ts +0 -1
- package/dist/table/flexible/columnsList.js +1 -2
- package/dist/table/loading/useLoading.d.ts +10 -10
- package/dist/table/nested/nestedData.d.ts +3 -1
- package/dist/table/nested/useNestedRows.d.ts +2 -2
- package/dist/table/selectable/selectableHeader.d.ts +2 -1
- package/dist/table/selectable/selectableHeader.js +4 -3
- package/dist/table/selectable/useSelectableRows.d.ts +1 -1
- package/dist/table/selectable/useSelectableRows.js +7 -4
- package/dist/table/table.d.ts +16 -1
- package/dist/table/table.js +101 -5
- package/dist/tag/tag.d.ts +19 -0
- package/dist/tag/tag.js +14 -0
- package/dist/textIconButton/textIconButton.js +17 -7
- package/dist/toastRaw/toastRaw.d.ts +1 -1
- package/dist/toastRaw/toastRaw.js +3 -1
- package/dist/toggleButtonRaw/toggleButtonRaw.js +17 -7
- package/dist/toggleButtonRaw/types.d.ts +0 -1
- package/dist/tooltip/tooltip.js +17 -7
- package/dist/tooltipInfo/tooltipInfo.d.ts +0 -1
- package/dist/utils/compareElementsUtils/isArraysEqualDeeply.js +1 -2
- package/dist/utils/compareElementsUtils/isElementsEqual.js +2 -2
- package/dist/utils/escapeHtml.js +1 -2
- package/dist/utils/localization/directionContext.d.ts +0 -1
- package/dist/utils/localization/languageContext.d.ts +0 -1
- package/dist/utils/localization/translations/en.json +12 -1
- package/dist/utils/theme/themeContext.d.ts +0 -1
- package/dist/utils/topWindow/topWindowContext.d.ts +0 -1
- package/dist/utils/useFadeComponent.d.ts +0 -1
- package/dist/utils/userFormat/userFormatContext.d.ts +0 -1
- package/dist/waiting/waiting.d.ts +2 -1
- package/dist/waiting/waiting.js +23 -6
- package/esm/alert/banner.d.ts +2 -3
- package/esm/alert/hooks/useAlertState.d.ts +0 -1
- package/esm/banner/bannerMultipLine.d.ts +0 -1
- package/esm/banner/bannerSingleLine.d.ts +0 -1
- package/esm/banner/utils/isSummaryErrorElement.d.ts +1 -2
- package/esm/card/components/content.d.ts +0 -1
- package/esm/chart/accessibleChart/accessibleChart.js +1 -1
- package/esm/chart/accessibleChart/accessibleChartNarrative.d.ts +1 -1
- package/esm/chart/accessibleChart/accessibleChartNarrative.js +8 -2
- package/esm/chart/accessibleChart/generatePieNarrative.d.ts +7 -0
- package/esm/chart/accessibleChart/generatePieNarrative.js +167 -0
- package/esm/chart/accessibleChart/interfaces.d.ts +1 -0
- package/esm/chart/barChart/getDefaultOptions.js +5 -6
- package/esm/chart/barChart.js +147 -50
- package/esm/chart/interfaces.d.ts +0 -1
- package/esm/chart/lineChart/getDefaultOptions.js +5 -6
- package/esm/chart/lineChart/useChartTicks.d.ts +0 -1
- package/esm/chart/lineChart/useSummary.d.ts +7 -8
- package/esm/chart/lineChart.js +162 -59
- package/esm/chart/pieChart.js +169 -76
- package/esm/chart/plugins/linePlugin/getInterpolatedValue.js +9 -0
- package/esm/chart/utils/convertDates.d.ts +1 -1
- package/esm/chart/utils/getNiceAxisRange.d.ts +21 -0
- package/esm/chart/utils/getNiceAxisRange.js +72 -0
- package/esm/chart/utils/getRange.js +2 -2
- package/esm/chart/utils/getYAxisMeta.d.ts +2 -5
- package/esm/chart/utils/getYAxisMeta.js +17 -2
- package/esm/chart/utils/getYAxisTickCount.d.ts +15 -0
- package/esm/chart/utils/getYAxisTickCount.js +15 -0
- package/esm/checkboxListWithAction/checkboxListWithAction.d.ts +0 -1
- package/esm/chip/chip.d.ts +0 -1
- package/esm/chip/utils/useChip.d.ts +0 -1
- package/esm/commonHelpers/HOC/reducerLogger/reducerLogger.d.ts +1 -1
- package/esm/commonHelpers/arrowNavigation/components/arrowButton/arrowButton.d.ts +0 -1
- package/esm/commonHelpers/arrowNavigation/hooks/useHoldOnScroll.d.ts +0 -1
- package/esm/commonHelpers/hooks/breakpoints.d.ts +4 -0
- package/esm/commonHelpers/hooks/breakpoints.js +4 -0
- package/esm/commonHelpers/hooks/fetch.reducer.d.ts +1 -1
- package/esm/commonHelpers/hooks/useDebouncedMemo.d.ts +0 -1
- package/esm/commonHelpers/hooks/useDeviceType.js +2 -2
- package/esm/commonHelpers/hooks/useEscape.d.ts +1 -1
- package/esm/commonHelpers/hooks/useGridSize.d.ts +0 -1
- package/esm/commonHelpers/hooks/useMobileOrTablet.d.ts +1 -0
- package/esm/commonHelpers/hooks/useMobileOrTablet.js +17 -0
- package/esm/commonHelpers/hooks/usePillSize.d.ts +0 -1
- package/esm/commonHelpers/hooks/useTablet.js +17 -0
- package/esm/dataFeed/dataFeed.d.ts +1 -1
- package/esm/dataFeed/dataFeed.js +2 -2
- package/esm/dataFeed/dataFeedCell/dataFeedCell.d.ts +3 -1
- package/esm/dataFeed/dataFeedColumnsItems.d.ts +2 -2
- package/esm/dataGrid/cell/cell.d.ts +3 -1
- package/esm/dataGrid/columns/actionsColumn/actionsColumn.d.ts +3 -3
- package/esm/dataGrid/dataGrid.d.ts +13 -1
- package/esm/dataGrid/dataGrid.js +48 -3
- package/esm/dataGrid/emptySearchList/emptySearchList.d.ts +0 -1
- package/esm/dataGrid/row/row.d.ts +3 -1
- package/esm/dataGrid/withActions/withActions.d.ts +1 -1
- package/esm/dataGrid/withFlexibleColumns/withFlexibleColumns.d.ts +1 -1
- package/esm/dataGrid/withLoading/withLoading.d.ts +1 -1
- package/esm/dataGrid/withSelectableRows/withLimitedSelectableRows.d.ts +1 -1
- package/esm/dataGrid/withSelectableRows/withSelectableRows.d.ts +1 -1
- package/esm/dataGrid/withSortableColumns/withSortableColumns.d.ts +1 -1
- package/esm/dialog/dialog.d.ts +0 -1
- package/esm/dropdown/dropdown.js +1 -1
- package/esm/dropdown/useDropdownState.d.ts +0 -1
- package/esm/dropdownRaw/dropdownList.d.ts +3 -2
- package/esm/dropdownRaw/dropdownList.js +14 -42
- package/esm/dropdownRaw/dropdownRaw.js +35 -14
- package/esm/dropdownRaw/stateReducer/stateReducer.d.ts +4 -1
- package/esm/dropdownRaw/stateReducer/stateReducer.js +32 -22
- package/esm/dropdownRaw/stateReducer/stateReducerHelper.d.ts +1 -2
- package/esm/dropdownRaw/stateReducer/stateReducerHelper.js +5 -10
- package/esm/dropdownRaw/types.d.ts +20 -0
- package/esm/feedbackContainer/hooks/useFeedbackAlert.d.ts +0 -1
- package/esm/feedbackContainer/hooks/useFeedbackToast.d.ts +0 -1
- package/esm/filters/components/filtersItem.d.ts +2 -2
- package/esm/filters/components/filtersSearchList.d.ts +0 -1
- package/esm/filters/components/filtersSelect.d.ts +0 -1
- package/esm/filters/components/filtersSelectCompact.d.ts +0 -1
- package/esm/filters/components/filtersSelectListItem.d.ts +0 -1
- package/esm/filters/components/filtersSelectUnfoldingPill.d.ts +0 -1
- package/esm/filters/filtersHelper.d.ts +1 -1
- package/esm/filters/filtersHooks.d.ts +0 -1
- package/esm/filtersBar/components/filtersBarDropdownWithCheckbox/filtersBarDropdownWithCheckbox.js +1 -1
- package/esm/filtersBar/filtersBar.js +2 -2
- package/esm/filtersBar/filtersBarActions/filtersBarActions.d.ts +0 -1
- package/esm/filtersBar/filtersBarInterfaces.d.ts +0 -1
- package/esm/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelDropdownWithCheckbox/filtersBarSidePanelDropdownWithCheckbox.d.ts +4 -10
- package/esm/formField/components/formFieldAdditionalInfo.d.ts +0 -1
- package/esm/formField/components/formFieldCounter.d.ts +0 -1
- package/esm/formField/components/formFieldLoading.d.ts +0 -1
- package/esm/formField/components/formFieldSkeleton.d.ts +0 -1
- package/esm/formField/components/formFieldWithLabel.d.ts +0 -1
- package/esm/formField/components/formFieldWithoutLabel.d.ts +0 -1
- package/esm/formField/formField.d.ts +1 -1
- package/esm/formField/hooks/useBanner.d.ts +0 -1
- package/esm/formField/hooks/useDisabled.d.ts +1 -1
- package/esm/formGroup/components/customRow/customRow.d.ts +0 -1
- package/esm/formGroup/hooks/listHooks/useStateToElements.d.ts +0 -1
- package/esm/formGroup/hooks/listHooks/useStateToElements.js +1 -1
- package/esm/formGroup/utils/formGroupProvider.d.ts +0 -1
- package/esm/formGroup/utils/isFormLabel.d.ts +1 -1
- package/esm/formGroupItem/formGroupItem.d.ts +0 -1
- package/esm/formLayout/components/layoutColumn/layoutColum.d.ts +0 -1
- package/esm/formLayout/hooks/useFormButtons.d.ts +1 -1
- package/esm/formLayout/types.d.ts +0 -1
- package/esm/formLayout/utils/attachHeadings.d.ts +1 -1
- package/esm/formLayout/utils/attachSeparators.d.ts +0 -1
- package/esm/formLayout/utils/getChildrenWithCustomColumns.d.ts +1 -2
- package/esm/formLayout/utils/getChildrenWithCustomColumns.js +2 -2
- package/esm/formLayout/utils/getFieldLabel.js +5 -5
- package/esm/formSection/components/actions.d.ts +0 -1
- package/esm/formSection/components/additional.d.ts +0 -1
- package/esm/formSection/utils/isFormSection.d.ts +2 -4
- package/esm/formStepper/components/formStepRaw.d.ts +0 -1
- package/esm/formStepper/formStepper.d.ts +0 -1
- package/esm/formStepper/formStepper.js +5 -5
- package/esm/formStepperButtons/formStepperButtons.js +3 -3
- package/esm/gridLayout/hooks/useStretch.js +1 -1
- package/esm/gridLayout/utils/gridLayoutProvider.d.ts +0 -1
- package/esm/gridLayout/utils/gridLayoutProvider.js +1 -1
- package/esm/gridLayout/utils/isGridItem.d.ts +1 -1
- package/esm/groupsFilter/groupsHelper.d.ts +5 -5
- package/esm/groupsFilterRaw/groupsHelper.d.ts +1 -1
- package/esm/groupsFilterRaw/stateReducer/stateReducer.d.ts +1 -1
- package/esm/groupsFilterRaw/testData.js +1 -2
- package/esm/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +5 -0
- package/esm/header/components/mobileFilterControl/mobileFilterControl.d.ts +0 -1
- package/esm/header/components/mobileSearchControl/mobileSearchControl.d.ts +0 -1
- package/esm/header/headerButton.d.ts +0 -1
- package/esm/header/headerContext.d.ts +1 -2
- package/esm/header/headerHelpers.d.ts +5 -5
- package/esm/header/hooks/useNonFittingElements.d.ts +3 -4
- package/esm/headerTitle/headerTitle.d.ts +0 -1
- package/esm/icons/iconAce.d.ts +3 -0
- package/esm/icons/iconAce.js +8 -0
- package/esm/icons/iconBreak.d.ts +3 -0
- package/esm/icons/iconBreak.js +8 -0
- package/esm/icons/iconChevronStepper.d.ts +3 -0
- package/esm/icons/iconChevronStepper.js +8 -0
- package/esm/icons/iconPotato.d.ts +3 -0
- package/esm/icons/iconPotato.js +8 -0
- package/esm/icons/iconToggleLarge.d.ts +3 -0
- package/esm/icons/iconToggleLarge.js +8 -0
- package/esm/icons/iconToggleSmall.d.ts +3 -0
- package/esm/icons/iconToggleSmall.js +8 -0
- package/esm/icons/iconTrendNeutral.d.ts +3 -0
- package/esm/icons/iconTrendNeutral.js +8 -0
- package/esm/icons/iconTruck.d.ts +3 -0
- package/esm/icons/iconTruck.js +8 -0
- package/esm/index.d.ts +8 -0
- package/esm/index.js +8 -0
- package/esm/layout/layout.d.ts +2 -1
- package/esm/layout/layoutBanner.d.ts +0 -1
- package/esm/lineChart/lineChart.d.ts +1 -0
- package/esm/lineChart/lineChart.js +129 -69
- package/esm/lineChartMini/lineChartMini.d.ts +1 -0
- package/esm/lineChartMini/lineChartMini.js +136 -73
- package/esm/list/itemData/itemData.d.ts +2 -1
- package/esm/list/itemData/itemDataInternal.d.ts +2 -1
- package/esm/list/list.d.ts +0 -1
- package/esm/list/utils/isDataListitem.d.ts +1 -1
- package/esm/list/viewportProvider/viewportContext.d.ts +0 -1
- package/esm/menu/components/controlledMenuList/controlledMenuList.d.ts +2 -4
- package/esm/menu/components/controlledMenuList/controlledMenuList.js +3 -1
- package/esm/menu/utils/useDisplayContent.d.ts +21 -0
- package/esm/menu/utils/useDisplayContent.js +31 -0
- package/esm/mobileSheet/components/mobileSheetTitle.d.ts +0 -1
- package/esm/nav/context/nav.context.d.ts +0 -1
- package/esm/nav/navFooter/navEditFooter/navEditFooter.d.ts +0 -1
- package/esm/nav/navFooter/navFooter.d.ts +1 -1
- package/esm/nav/navFooter/navFooterAction/navFooterAction.d.ts +2 -1
- package/esm/nav/navFooter/navFooterAction/navFooterAction.js +3 -1
- package/esm/nav/navItem/navItem.d.ts +2 -0
- package/esm/nav/navItem/navItem.js +57 -48
- package/esm/nav/navItem/navItemContent.d.ts +19 -0
- package/esm/nav/navItem/navItemContent.js +17 -0
- package/esm/nav/navItem/navItemType.d.ts +7 -0
- package/esm/nav/navItem/navItemType.js +6 -0
- package/esm/nav/utils/navUtils.d.ts +2 -4
- package/esm/overview/overview.d.ts +0 -1
- package/esm/pageHeader/pageHeader.d.ts +1 -1
- package/esm/pageHeader/pageHeaderButton.d.ts +0 -1
- package/esm/pageHeader/pageHeaderHelpers.d.ts +1 -1
- package/esm/pageHeader/pageHeaderMenu.d.ts +0 -1
- package/esm/pagination/paginationArrow.d.ts +0 -1
- package/esm/pill/interfaces/pill.interface.d.ts +0 -1
- package/esm/pillBox/components/pillBoxItem.d.ts +1 -2
- package/esm/progressIndicator/progressIndicator.d.ts +39 -0
- package/esm/progressIndicator/progressIndicator.js +26 -0
- package/esm/progressIndicator/progressIndicatorUtils.d.ts +12 -0
- package/esm/progressIndicator/progressIndicatorUtils.js +25 -0
- package/esm/radioGroupRaw/types.d.ts +0 -1
- package/esm/react-chartjs/utils.d.ts +3 -3
- package/esm/searchInputRaw/types.d.ts +0 -1
- package/esm/selectField/selectField.d.ts +2 -3
- package/esm/selectList/selectList.d.ts +0 -1
- package/esm/selectRaw/selectRaw.js +3 -0
- package/esm/sidePanel/sidePanelCell/sidePanelCell.d.ts +0 -1
- package/esm/table/actions/actionsMenu.d.ts +0 -1
- package/esm/table/children/useTableChildren.d.ts +7 -7
- package/esm/table/detailPanel/interfaces.d.ts +0 -1
- package/esm/table/loading/useLoading.d.ts +10 -10
- package/esm/table/nested/nestedData.d.ts +3 -1
- package/esm/table/nested/useNestedRows.d.ts +2 -2
- package/esm/table/selectable/selectableHeader.d.ts +2 -1
- package/esm/table/selectable/selectableHeader.js +4 -3
- package/esm/table/selectable/useSelectableRows.d.ts +1 -1
- package/esm/table/selectable/useSelectableRows.js +7 -4
- package/esm/table/table.d.ts +16 -1
- package/esm/table/table.js +102 -6
- package/esm/tag/tag.d.ts +19 -0
- package/esm/tag/tag.js +10 -0
- package/esm/testHelpers/geotab-axe/index.d.ts +0 -1
- package/esm/toastRaw/toastRaw.d.ts +1 -1
- package/esm/toastRaw/toastRaw.js +3 -1
- package/esm/toggleButtonRaw/types.d.ts +0 -1
- package/esm/tooltipInfo/tooltipInfo.d.ts +0 -1
- package/esm/utils/localization/directionContext.d.ts +0 -1
- package/esm/utils/localization/languageContext.d.ts +0 -1
- package/esm/utils/localization/translations/en.json +12 -1
- package/esm/utils/theme/themeContext.d.ts +0 -1
- package/esm/utils/topWindow/topWindowContext.d.ts +0 -1
- package/esm/utils/useFadeComponent.d.ts +0 -1
- package/esm/utils/userFormat/userFormatContext.d.ts +0 -1
- package/esm/waiting/waiting.d.ts +2 -1
- package/esm/waiting/waiting.js +24 -7
- package/package.json +13 -6
- package/esm/gridLayout/hooks/useTablet.js +0 -20
- /package/dist/{gridLayout → commonHelpers}/hooks/useTablet.d.ts +0 -0
- /package/esm/{gridLayout → commonHelpers}/hooks/useTablet.d.ts +0 -0
|
@@ -178,39 +178,6 @@ injectString("ka-GE", "Apply", "\u10D2\u10D0\u10DB\u10DD\u10E7\u10D4\u10DC\u10D4
|
|
|
178
178
|
injectString("el-GR", "Apply", "\u0395\u03C6\u03B1\u03C1\u03BC\u03BF\u03B3\u03AE");
|
|
179
179
|
injectString("et-EE", "Apply", "Rakenda");
|
|
180
180
|
injectString("bg-BG", "Apply", "\u041F\u0440\u0438\u043B\u0430\u0433\u0430\u043D\u0435");
|
|
181
|
-
injectString("cs", "Deselect all", "Zru\u0161it v\xFDb\u011Br v\u0161ech");
|
|
182
|
-
injectString("da-DK", "Deselect all", "Frav\xE6lg alle");
|
|
183
|
-
injectString("de", "Deselect all", "Auswahl f\xFCr alle aufheben");
|
|
184
|
-
injectString("en", "Deselect all", "Deselect all");
|
|
185
|
-
injectString("es", "Deselect all", "Deseleccionar todo");
|
|
186
|
-
injectString("fi-FI", "Deselect all", "Poista kaikki valinnat");
|
|
187
|
-
injectString("fr", "Deselect all", "D\xE9s\xE9lectionner tout");
|
|
188
|
-
injectString("fr-FR", "Deselect all", "D\xE9s\xE9lectionner tout");
|
|
189
|
-
injectString("hu-HU", "Deselect all", "Ne v\xE1lassz ki semmit.");
|
|
190
|
-
injectString("id", "Deselect all", "Batalkan pilih semua");
|
|
191
|
-
injectString("it", "Deselect all", "Deselezionare tutto");
|
|
192
|
-
injectString("ja", "Deselect all", "\u3059\u3079\u3066\u3092\u9078\u629E\u89E3\u9664");
|
|
193
|
-
injectString("ko-KR", "Deselect all", "\uBAA8\uB450 \uC120\uD0DD \uCDE8\uC18C");
|
|
194
|
-
injectString("ms", "Deselect all", "Nyahpilih semua");
|
|
195
|
-
injectString("nb-NO", "Deselect all", "Fjern alle valg");
|
|
196
|
-
injectString("nl", "Deselect all", "Alles deselecteren");
|
|
197
|
-
injectString("pl", "Deselect all", "Usu\u0144 wyb\xF3r wszystkich");
|
|
198
|
-
injectString("pt-BR", "Deselect all", "Desmarcar tudo");
|
|
199
|
-
injectString("pt-PT", "Deselect all", "Desmarcar tudo");
|
|
200
|
-
injectString("sk-SK", "Deselect all", "Zru\u0161 v\xFDber v\u0161etk\xFDch.");
|
|
201
|
-
injectString("sv", "Deselect all", "Avmarkera alla");
|
|
202
|
-
injectString("th", "Deselect all", "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E01\u0E32\u0E23\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14");
|
|
203
|
-
injectString("tr", "Deselect all", "T\xFCm\xFCn\xFCn se\xE7imini iptal et");
|
|
204
|
-
injectString("zh-Hans", "Deselect all", "\u53D6\u6D88\u5168\u9009");
|
|
205
|
-
injectString("zh-TW", "Deselect all", "\u53D6\u6D88\u5168\u9078");
|
|
206
|
-
injectString("ro-RO", "Deselect all", "Deselecta\u021Bi tot");
|
|
207
|
-
injectString("ar", "Deselect all", "\u0625\u0644\u063A\u0627\u0621 \u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
208
|
-
injectString("lt-LT", "Deselect all", "At\u017Eym\u0117ti visus");
|
|
209
|
-
injectString("lv-LV", "Deselect all", "Atcelt visas atlases");
|
|
210
|
-
injectString("ka-GE", "Deselect all", "\u10E7\u10D5\u10D4\u10DA\u10D0\u10E1 \u10DB\u10DD\u10EE\u10E1\u10DC\u10D0");
|
|
211
|
-
injectString("el-GR", "Deselect all", "\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7 \u03CC\u03BB\u03C9\u03BD \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03CE\u03BD");
|
|
212
|
-
injectString("et-EE", "Deselect all", "T\xFChista k\xF5ik valikud");
|
|
213
|
-
injectString("bg-BG", "Deselect all", "\u041F\u0440\u0435\u043C\u0430\u0445\u0432\u0430\u043D\u0435 \u043D\u0430 \u0432\u0441\u0438\u0447\u043A\u0438 \u0438\u0437\u0431\u043E\u0440\u0438");
|
|
214
181
|
injectString("cs", "Select all", "Vybrat v\u0161e");
|
|
215
182
|
injectString("da-DK", "Select all", "V\xE6lg alle");
|
|
216
183
|
injectString("de", "Select all", "Alle ausw\xE4hlen");
|
|
@@ -373,7 +340,8 @@ export const DropdownList = ({
|
|
|
373
340
|
onSelect,
|
|
374
341
|
onSingleSelect,
|
|
375
342
|
listData,
|
|
376
|
-
|
|
343
|
+
isSelectAllActive,
|
|
344
|
+
shouldBlockItems,
|
|
377
345
|
backButtonName,
|
|
378
346
|
width,
|
|
379
347
|
minWidth,
|
|
@@ -402,7 +370,7 @@ export const DropdownList = ({
|
|
|
402
370
|
const internalListId = useId();
|
|
403
371
|
const selectListId = listId || internalListId;
|
|
404
372
|
const handleSelectAllClick = () => {
|
|
405
|
-
onSelectAllClick(
|
|
373
|
+
onSelectAllClick(!!isSelectAllActive);
|
|
406
374
|
};
|
|
407
375
|
const handleBackButtonKeyDown = useCallback(event => {
|
|
408
376
|
if (event.key === "ArrowLeft") {
|
|
@@ -430,13 +398,14 @@ export const DropdownList = ({
|
|
|
430
398
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
431
399
|
forceSelection ? onSingleSelect(false, newActiveEl || activeValue) : onSingleSelect(false, newActiveEl);
|
|
432
400
|
}, [activeValue, forceSelection, onSingleSelect]);
|
|
433
|
-
const selectButtonLabel =
|
|
434
|
-
const getActionButton = (label, title, icon, isDisabled, clickHandler, size, onKeyDown) => _jsx("button", {
|
|
401
|
+
const selectButtonLabel = translate("Select all");
|
|
402
|
+
const getActionButton = (label, title, icon, isDisabled, clickHandler, size, onKeyDown, isSelected) => _jsx("button", {
|
|
435
403
|
type: "button",
|
|
436
404
|
disabled: isDisabled,
|
|
437
405
|
onClick: clickHandler,
|
|
438
406
|
onKeyDown: onKeyDown,
|
|
439
|
-
|
|
407
|
+
"aria-pressed": isSelected,
|
|
408
|
+
className: classNames(["zen-dropdown-list__item zen-dropdown-list__item--interactive zen-dropdown-list__action-button zen-dropdown-list__action-button-back", isSelected ? "zen-dropdown-list__action-button--selected" : ""]),
|
|
440
409
|
title: title,
|
|
441
410
|
children: _jsxs(_Fragment, {
|
|
442
411
|
children: [React.createElement(icon, {
|
|
@@ -472,11 +441,14 @@ export const DropdownList = ({
|
|
|
472
441
|
});
|
|
473
442
|
return values;
|
|
474
443
|
};
|
|
444
|
+
const multiselectOptions = shouldBlockItems ? listData.map(item => Object.assign(Object.assign({}, item), {
|
|
445
|
+
blocked: true
|
|
446
|
+
})) : listData;
|
|
475
447
|
return _jsx("div", {
|
|
476
448
|
className: "zen-dropdown-list__elements",
|
|
477
449
|
ref: listElementRef,
|
|
478
450
|
children: isMultiselect ? _jsx(CheckboxListWithAction, {
|
|
479
|
-
options:
|
|
451
|
+
options: multiselectOptions,
|
|
480
452
|
label: "",
|
|
481
453
|
onChange: handleChange,
|
|
482
454
|
onClick: handleClick
|
|
@@ -492,7 +464,7 @@ export const DropdownList = ({
|
|
|
492
464
|
value: createValue(listData, activeValue)
|
|
493
465
|
})
|
|
494
466
|
});
|
|
495
|
-
}, [listElementRef, isMultiselect, listData, handleChange, handleClick, handleSingleChange, translate, selectListId, forceSelection, activeValue]);
|
|
467
|
+
}, [listElementRef, isMultiselect, shouldBlockItems, listData, handleChange, handleClick, handleSingleChange, translate, selectListId, forceSelection, activeValue]);
|
|
496
468
|
return _jsxs("div", Object.assign({
|
|
497
469
|
className: classNames(["zen-dropdown-list", driveComponentClass || ""])
|
|
498
470
|
}, styleWidth, {
|
|
@@ -510,7 +482,7 @@ export const DropdownList = ({
|
|
|
510
482
|
}) : null, backButtonName ? _jsx("div", {
|
|
511
483
|
className: "zen-dropdown-list__item-wrapper",
|
|
512
484
|
children: getActionButton(backButtonName, translate("Back"), IconBackArrow, false, onBackButtonClick, "large", handleBackButtonKeyDown)
|
|
513
|
-
}) : null, hasSelectAllButton ? getActionButton(selectButtonLabel, selectButtonLabel, IconCheckRadio, !!isSelectAllButtonDisable, handleSelectAllClick, isDrive ? "huger" : "huge") : null, listDataComponent, isWithFooter ? _jsxs("div", {
|
|
485
|
+
}) : null, hasSelectAllButton ? getActionButton(selectButtonLabel, selectButtonLabel, IconCheckRadio, !!isSelectAllButtonDisable, handleSelectAllClick, isDrive ? "huger" : "huge", undefined, isSelectAllActive) : null, listDataComponent, isWithFooter ? _jsxs("div", {
|
|
514
486
|
className: "zen-dropdown-list__footer",
|
|
515
487
|
children: [_jsx(Button, {
|
|
516
488
|
onClick: isMultiselect ? onClearClick : handleClearClick,
|
|
@@ -538,4 +510,4 @@ export const DropdownList = ({
|
|
|
538
510
|
}) : null]
|
|
539
511
|
}));
|
|
540
512
|
};
|
|
541
|
-
export const TRANSLATIONS = ["Select all", "
|
|
513
|
+
export const TRANSLATIONS = ["Select all", "Clear", "Back", "No data"];
|
|
@@ -8,7 +8,7 @@ import { getInitialState, stateReducer, ROOT_GROUP_ID } from "./stateReducer/sta
|
|
|
8
8
|
import { StateActionType } from "./stateReducer/stateActionType";
|
|
9
9
|
import { FOCUSABLE_SELECTOR } from "../utils/focusableSelector";
|
|
10
10
|
import { useEscape } from "../commonHelpers/hooks/useEscape";
|
|
11
|
-
import { checkIsDataProblem, compareObjectsArrays, compareStringsArrays, createListDataOptions, getDataForChange, getListDataWithDisabled, getSelectedCount, getStringFromAllSelected, getStringFromSelected,
|
|
11
|
+
import { checkIsDataProblem, compareObjectsArrays, compareStringsArrays, createListDataOptions, getDataForChange, getListDataWithDisabled, getSelectedCount, getStringFromAllSelected, getStringFromSelected, isAllItemsHasOneParent, isEveryItemSelected, prepareSelectedIdsToItems, sortDropdownItemArray } from "./dropdownHelper";
|
|
12
12
|
import { DropdownTrigger } from "./dropdownTrigger";
|
|
13
13
|
import { isFocusable } from "../dialog/dialogHelpers";
|
|
14
14
|
import { useLanguage } from "../utils/localization/useLanguage";
|
|
@@ -109,7 +109,10 @@ export const DropdownRaw = props => {
|
|
|
109
109
|
mobileSheetStackingClassName,
|
|
110
110
|
isError,
|
|
111
111
|
firstParentNodeIsVisible,
|
|
112
|
-
dataAnalyticsId
|
|
112
|
+
dataAnalyticsId,
|
|
113
|
+
hideSelectAllOnSearch = false,
|
|
114
|
+
blockItemsOnSelectAll = false,
|
|
115
|
+
autoPromoteSelectAll = false
|
|
113
116
|
} = props;
|
|
114
117
|
const {
|
|
115
118
|
isFormSection
|
|
@@ -147,7 +150,7 @@ export const DropdownRaw = props => {
|
|
|
147
150
|
const isQueryMode = useMemo(() => typeof getData === "undefined" && typeof dataItems === "undefined", [getData, dataItems]);
|
|
148
151
|
const isCheckboxMode = useMemo(() => checkboxLabel && typeof value === "object" && "isChecked" in value && typeof value.isChecked === "boolean" || false, [checkboxLabel, value]);
|
|
149
152
|
const [initialInChecked] = useState(isCheckboxMode ? value.isChecked : undefined);
|
|
150
|
-
const [state, dispatchState] = useReducer(stateReducer, getInitialState(isFullSelectionMode, isQueryMode ? (fetchState === null || fetchState === void 0 ? void 0 : fetchState.data) || [] : dataItems || [], isFullSelectionMode || isCheckboxMode ? value.selected : value, listLimit, defaultValue ? isFullSelectionMode || isCheckboxMode ? defaultValue.selected : defaultValue : undefined, isFullSelectionMode ? value.isAllSelected : undefined, defaultValue ? isFullSelectionMode ? defaultValue.isAllSelected : undefined : undefined, isCheckboxMode ? value.isChecked : undefined, isCheckboxMode && defaultValue ? defaultValue.isChecked : undefined, firstParentNodeIsVisible));
|
|
153
|
+
const [state, dispatchState] = useReducer(stateReducer, getInitialState(isFullSelectionMode, isQueryMode ? (fetchState === null || fetchState === void 0 ? void 0 : fetchState.data) || [] : dataItems || [], isFullSelectionMode || isCheckboxMode ? value.selected : value, listLimit, defaultValue ? isFullSelectionMode || isCheckboxMode ? defaultValue.selected : defaultValue : undefined, isFullSelectionMode ? value.isAllSelected : undefined, defaultValue ? isFullSelectionMode ? defaultValue.isAllSelected : undefined : undefined, isCheckboxMode ? value.isChecked : undefined, isCheckboxMode && defaultValue ? defaultValue.isChecked : undefined, firstParentNodeIsVisible, autoPromoteSelectAll));
|
|
151
154
|
const chipStatus = useChipStatus();
|
|
152
155
|
const isMobile = useMobile();
|
|
153
156
|
const popupId = useId();
|
|
@@ -174,6 +177,7 @@ export const DropdownRaw = props => {
|
|
|
174
177
|
const getNamedItemsHasBeenCalled = useRef(false);
|
|
175
178
|
const selectedItemsLoader = useRef(undefined);
|
|
176
179
|
const previousMapDataItems = useRef(isQueryMode ? (fetchState === null || fetchState === void 0 ? void 0 : fetchState.data) || [] : !getData && (dataItems === null || dataItems === void 0 ? void 0 : dataItems.length) ? dataItems : []);
|
|
180
|
+
const previousFetchStateData = useRef(isQueryMode ? fetchState === null || fetchState === void 0 ? void 0 : fetchState.data : undefined);
|
|
177
181
|
const prevIsLoading = useRef(isLoading);
|
|
178
182
|
const prevIsChecked = useRef(isCheckboxMode ? value.isChecked : undefined);
|
|
179
183
|
const currentAllSelected = useMemo(() => state.isNestedList || !multiselect || !isFullSelectionMode ? undefined : state.isAllSelected, [state.isNestedList, state.isAllSelected, multiselect, isFullSelectionMode]);
|
|
@@ -380,7 +384,9 @@ export const DropdownRaw = props => {
|
|
|
380
384
|
}, [handleClose]);
|
|
381
385
|
const memoizedAllowClosing = useMemo(() => state.currentId === undefined || state.currentId === state.rootId, [state.currentId, state.rootId]);
|
|
382
386
|
const handleSingleSelection = useCallback((reset, selected) => {
|
|
383
|
-
|
|
387
|
+
var _a, _b;
|
|
388
|
+
const isLeaf = !!selected && !((_b = (_a = state.groupsMap[selected]) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length);
|
|
389
|
+
const shouldBeClosed = !hasApplyButton && (memoizedAllowClosing || isLeaf) && (reset || !!selected);
|
|
384
390
|
dispatchState({
|
|
385
391
|
type: StateActionType.ChangeSingleSelection,
|
|
386
392
|
payload: {
|
|
@@ -393,7 +399,7 @@ export const DropdownRaw = props => {
|
|
|
393
399
|
type: StateActionType.SetInputValue,
|
|
394
400
|
payload: ""
|
|
395
401
|
});
|
|
396
|
-
}, [handleEscape, hasApplyButton, memoizedAllowClosing]);
|
|
402
|
+
}, [handleEscape, hasApplyButton, memoizedAllowClosing, state.groupsMap]);
|
|
397
403
|
const handleSelectAllClick = useCallback(isAllSelect => {
|
|
398
404
|
if (isFullSelectionMode) {
|
|
399
405
|
dispatchState({
|
|
@@ -529,8 +535,12 @@ export const DropdownRaw = props => {
|
|
|
529
535
|
payload: undefined
|
|
530
536
|
});
|
|
531
537
|
}, [errorHandler]);
|
|
532
|
-
const handleDataQuery = useCallback((dta, searchVal) => {
|
|
533
|
-
|
|
538
|
+
const handleDataQuery = useCallback((dta, searchVal, dataChanged = true) => {
|
|
539
|
+
// Only (re)build groupsMap from a genuine, freshly fetched full list. In query mode the parent's
|
|
540
|
+
// fetchState.data lags behind the typed search value, so when a search is cleared this effect can run
|
|
541
|
+
// with the previous, search-filtered data while searchVal is already empty. Rebuilding groupsMap from
|
|
542
|
+
// that stale subset shrinks it and makes the current selection look like "all selected".
|
|
543
|
+
if (dataChanged && dta.length && !searchVal && !compareObjectsArrays(dta, previousMapDataItems.current)) {
|
|
534
544
|
dispatchState({
|
|
535
545
|
type: StateActionType.CreateMap,
|
|
536
546
|
payload: dta
|
|
@@ -577,7 +587,9 @@ export const DropdownRaw = props => {
|
|
|
577
587
|
if (!isQueryMode || (fetchState === null || fetchState === void 0 ? void 0 : fetchState.isLoading)) {
|
|
578
588
|
return;
|
|
579
589
|
}
|
|
580
|
-
|
|
590
|
+
const dataChanged = (fetchState === null || fetchState === void 0 ? void 0 : fetchState.data) !== previousFetchStateData.current;
|
|
591
|
+
previousFetchStateData.current = fetchState === null || fetchState === void 0 ? void 0 : fetchState.data;
|
|
592
|
+
handleDataQuery((fetchState === null || fetchState === void 0 ? void 0 : fetchState.data) || [], state.inputValue, dataChanged);
|
|
581
593
|
});
|
|
582
594
|
return () => {
|
|
583
595
|
var _a;
|
|
@@ -876,7 +888,15 @@ export const DropdownRaw = props => {
|
|
|
876
888
|
});
|
|
877
889
|
}
|
|
878
890
|
if (state.showList) {
|
|
879
|
-
const isSearchMode = state.inputValue && !state.currentId;
|
|
891
|
+
const isSearchMode = Boolean(state.inputValue) && !state.currentId;
|
|
892
|
+
const selectAllActiveForCurrentLevel = state.selectAllActiveForId === (state.currentId || state.rootId);
|
|
893
|
+
// DESIGN INTENT: button state (isSelectAllActive) is truth-based — shows pressed whenever
|
|
894
|
+
// all items are actually selected, including after search+clear where selectAllActiveForId
|
|
895
|
+
// was cleared. shouldBlockItems is intent-based — only activates when "Select all" was
|
|
896
|
+
// explicitly clicked (selectAllActiveForCurrentLevel), never from manual individual selection.
|
|
897
|
+
// This asymmetry is intentional: the button restores its visual state post-search, but
|
|
898
|
+
// blocking does not, to avoid unexpected UX when users manually select all items.
|
|
899
|
+
const isAllCurrentLevelSelected = !isSearchMode && !isFullSelectionMode ? isEveryItemSelected(getListDataWithDisabled(state.listData, state.isNestedList), state.selectedIds) : false;
|
|
880
900
|
const currentListData = createListDataOptions(state, translate, isSearchMode ? sortDropdownItemArray(state.listData, sortFn).slice(0, listLimit).filter(el => el.id !== state.rootId) :
|
|
881
901
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
882
902
|
sortDropdownItemArray(((_b = state.groupsMap[state.currentId || state.rootId]) === null || _b === void 0 ? void 0 : _b.children) || [], sortFn).slice(0, listLimit) || [], multiselect, currentAllSelected);
|
|
@@ -892,16 +912,17 @@ export const DropdownRaw = props => {
|
|
|
892
912
|
activeValue: state.selectedIds.length ? state.selectedIds[0] : "root",
|
|
893
913
|
backButtonName: state.currentId && state.groupsMap[state.currentId] ? getGroupDescription(state.groupsMap[state.currentId], translate) : undefined,
|
|
894
914
|
filterName: isMobile ? undefined : filterName,
|
|
895
|
-
|
|
915
|
+
isSelectAllActive: isFullSelectionMode ? currentAllSelected : isSearchMode ? isEveryItemSelected(getListDataWithDisabled(state.listData, state.isNestedList), state.selectedIds) : selectAllActiveForCurrentLevel || isAllCurrentLevelSelected,
|
|
916
|
+
shouldBlockItems: blockItemsOnSelectAll && !state.inputValue && !isFullSelectionMode && selectAllActiveForCurrentLevel,
|
|
896
917
|
isMultiselect: multiselect,
|
|
897
918
|
forceSelection: forceSelection,
|
|
898
919
|
listData: currentListData,
|
|
899
920
|
width: width || currentWidth === 180 ? undefined : currentWidth,
|
|
900
921
|
minWidth: currentWidth,
|
|
901
|
-
hasSelectAllButton: selectAllButton && multiselect,
|
|
922
|
+
hasSelectAllButton: selectAllButton && multiselect && !(hideSelectAllOnSearch && state.inputValue),
|
|
902
923
|
hasApplyButton: hasApplyButton,
|
|
903
924
|
isApplyDisabled: memoizedIsApplyButtonDisabled,
|
|
904
|
-
isSelectAllButtonDisable: currentListData.length === 0 || isSearchMode
|
|
925
|
+
isSelectAllButtonDisable: currentListData.length === 0 || isSearchMode && state.isNestedList && isAllItemsHasOneParent(state.listData.filter(el => el.id !== state.rootId), (((_c = state.groupsMap[state.rootId]) === null || _c === void 0 ? void 0 : _c.children) || []).map(el => el.id)),
|
|
905
926
|
isClearButtonDisabled: memoizedIsClearButtonDisabled,
|
|
906
927
|
isWithFooter: memoizedWithFooter && !isMobile,
|
|
907
928
|
isMobile: isMobile,
|
|
@@ -913,7 +934,7 @@ export const DropdownRaw = props => {
|
|
|
913
934
|
});
|
|
914
935
|
}
|
|
915
936
|
return null;
|
|
916
|
-
}, [state, isLoading, isQueryMode, fetchState === null || fetchState === void 0 ? void 0 : fetchState.isLoading, fetchState === null || fetchState === void 0 ? void 0 : fetchState.error, handleClearClick, handleCancelClick, handleApplyClick, hasApplyButton, memoizedWithFooter, translate, sortFn, listLimit, multiselect, currentAllSelected, handleBackButtonClick, handleSelectAllInSearch, handleSelectAllClick, handleSelect, handleChangeCurrentId, handleSingleSelection, isMobile, filterName, forceSelection, width, selectAllButton, memoizedIsApplyButtonDisabled, memoizedIsClearButtonDisabled, isCheckboxMode, handleCheckboxChange, checkboxLabel, selectListId]);
|
|
937
|
+
}, [state, isLoading, isQueryMode, fetchState === null || fetchState === void 0 ? void 0 : fetchState.isLoading, fetchState === null || fetchState === void 0 ? void 0 : fetchState.error, handleClearClick, handleCancelClick, handleApplyClick, hasApplyButton, memoizedWithFooter, translate, sortFn, listLimit, multiselect, currentAllSelected, handleBackButtonClick, handleSelectAllInSearch, handleSelectAllClick, handleSelect, handleChangeCurrentId, handleSingleSelection, isMobile, filterName, forceSelection, width, selectAllButton, hideSelectAllOnSearch, memoizedIsApplyButtonDisabled, memoizedIsClearButtonDisabled, isCheckboxMode, handleCheckboxChange, checkboxLabel, selectListId, isFullSelectionMode, blockItemsOnSelectAll]);
|
|
917
938
|
const currentStringFromSelected = isFullSelectionMode && hasApplyButton && state.globalIsAllSelected || isFullSelectionMode && !hasApplyButton && state.isAllSelected ? getStringFromAllSelected(state.groupsMap, translate, state.rootId) : getStringFromSelected(hasApplyButton ? state.globalSelectedIds : state.selectedIds, state.groupsMapSelected, translate, state.rootId);
|
|
918
939
|
const memoizedCurrentSelection = useMemo(() => showSelection && !state.inputValue ? currentStringFromSelected : "", [showSelection, state.inputValue, currentStringFromSelected]);
|
|
919
940
|
const parentTriggerWidth = ((_b = comboboxRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().width) || 420;
|
|
@@ -1011,4 +1032,4 @@ export const DropdownRaw = props => {
|
|
|
1011
1032
|
});
|
|
1012
1033
|
};
|
|
1013
1034
|
DropdownRaw.displayName = "DropdownRaw";
|
|
1014
|
-
export const TRANSLATIONS = ["Filter by group", "Open filter", "Clear search", "Select all", "
|
|
1035
|
+
export const TRANSLATIONS = ["Filter by group", "Open filter", "Clear search", "Select all", "Clear", "Back", "No data"];
|
|
@@ -25,6 +25,8 @@ export interface IDropdownState {
|
|
|
25
25
|
listLimit: number;
|
|
26
26
|
resultsExceedListLimit?: boolean;
|
|
27
27
|
isAllSelected?: boolean;
|
|
28
|
+
selectAllActiveForId?: string;
|
|
29
|
+
autoPromoteSelectAll?: boolean;
|
|
28
30
|
globalIsAllSelected?: boolean;
|
|
29
31
|
defaultValueIsAllSelected?: boolean;
|
|
30
32
|
isChecked?: boolean;
|
|
@@ -34,7 +36,7 @@ export interface IDropdownState {
|
|
|
34
36
|
}
|
|
35
37
|
export interface IStateReducer extends Reducer<IDropdownState, TStateAction> {
|
|
36
38
|
}
|
|
37
|
-
export declare const getInitialState: (isFullSelectionMode: boolean, comboItems: IDropdownRawItem[], selection: string[], listLimit: number, defaultValue?: string[], isAllSelected?: boolean, defaultValueIsAllSelected?: boolean, isChecked?: boolean, defaultValueIsChecked?: boolean, firstParentNodeIsVisible?: boolean) => {
|
|
39
|
+
export declare const getInitialState: (isFullSelectionMode: boolean, comboItems: IDropdownRawItem[], selection: string[], listLimit: number, defaultValue?: string[], isAllSelected?: boolean, defaultValueIsAllSelected?: boolean, isChecked?: boolean, defaultValueIsChecked?: boolean, firstParentNodeIsVisible?: boolean, autoPromoteSelectAll?: boolean) => {
|
|
38
40
|
groupsMap: ITypedHash<IGroupTree>;
|
|
39
41
|
selectedIds: string[];
|
|
40
42
|
globalSelectedIds: string[];
|
|
@@ -62,5 +64,6 @@ export declare const getInitialState: (isFullSelectionMode: boolean, comboItems:
|
|
|
62
64
|
listLimit: number;
|
|
63
65
|
resultsExceedListLimit: boolean;
|
|
64
66
|
firstParentNodeIsVisible: boolean | undefined;
|
|
67
|
+
autoPromoteSelectAll: boolean | undefined;
|
|
65
68
|
};
|
|
66
69
|
export declare function stateReducer(state: IDropdownState, action: TStateAction): IDropdownState;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StateActionType } from "./stateActionType";
|
|
2
|
-
import { getChildList,
|
|
2
|
+
import { getChildList, getRootId, computeIsAllSelected } from "./stateReducerHelper";
|
|
3
3
|
import { createGroupsMap } from "../../groupsFilterRaw/groupsFilterHelper";
|
|
4
4
|
export const ROOT_GROUP_ID = "zen_dropdown_root_group_id";
|
|
5
|
-
export const getInitialState = (isFullSelectionMode, comboItems, selection, listLimit, defaultValue, isAllSelected, defaultValueIsAllSelected, isChecked, defaultValueIsChecked, firstParentNodeIsVisible) => {
|
|
5
|
+
export const getInitialState = (isFullSelectionMode, comboItems, selection, listLimit, defaultValue, isAllSelected, defaultValueIsAllSelected, isChecked, defaultValueIsChecked, firstParentNodeIsVisible, autoPromoteSelectAll) => {
|
|
6
6
|
const updatedGroupsMapSelected = new Map();
|
|
7
7
|
const updatedGroupsMap = comboItems.length ? createGroupsMap(comboItems, ROOT_GROUP_ID) : {};
|
|
8
8
|
const namelessIds = new Set();
|
|
@@ -47,7 +47,8 @@ export const getInitialState = (isFullSelectionMode, comboItems, selection, list
|
|
|
47
47
|
globalIsChecked: isChecked,
|
|
48
48
|
listLimit,
|
|
49
49
|
resultsExceedListLimit: false,
|
|
50
|
-
firstParentNodeIsVisible: firstParentNodeIsVisible
|
|
50
|
+
firstParentNodeIsVisible: firstParentNodeIsVisible,
|
|
51
|
+
autoPromoteSelectAll: autoPromoteSelectAll
|
|
51
52
|
};
|
|
52
53
|
};
|
|
53
54
|
// eslint-disable-next-line complexity
|
|
@@ -71,12 +72,14 @@ export function stateReducer(state, action) {
|
|
|
71
72
|
}
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
75
|
+
const updatedGroupsMapCount = Object.keys(updatedGroupsMap).length;
|
|
76
|
+
const isCurrentListNested = updatedGroupsMapCount > 0 && (updatedGroupsMap[ROOT_GROUP_ID].children || []).some(el => el.children && el.children.length);
|
|
77
|
+
const groupsMapLength = updatedGroupsMapCount - 1;
|
|
78
|
+
const newResultsExceedListLimit = groupsMapLength >= state.listLimit;
|
|
79
|
+
const selectedInNewMap = state.selectedIds.filter(id => id in updatedGroupsMap).length - newNamelessIds.size;
|
|
80
|
+
const newIsAllSelected = computeIsAllSelected(state.isAllSelected, state.isFullSelectionMode, newResultsExceedListLimit, groupsMapLength, selectedInNewMap);
|
|
78
81
|
const rootId = getRootId(updatedGroupsMap, ROOT_GROUP_ID, state.firstParentNodeIsVisible);
|
|
79
|
-
return Object.assign(Object.assign(
|
|
82
|
+
return Object.assign(Object.assign({}, state), { groupsMap: updatedGroupsMap, rootId: rootId || ROOT_GROUP_ID, namelessIds: newNamelessIds, isNestedList: state.isNestedList ? state.isNestedList : isCurrentListNested, resultsExceedListLimit: newResultsExceedListLimit, isAllSelected: newIsAllSelected });
|
|
80
83
|
}
|
|
81
84
|
case StateActionType.SetListData: {
|
|
82
85
|
state.selectedIds.forEach(id => {
|
|
@@ -101,9 +104,9 @@ export function stateReducer(state, action) {
|
|
|
101
104
|
case StateActionType.SetIsOpenCombo:
|
|
102
105
|
return Object.assign(Object.assign({}, state), { isOpenCombo: payload });
|
|
103
106
|
case StateActionType.ResetSelection:
|
|
104
|
-
return Object.assign(Object.assign({}, state), { selectedIds: [...state.defaultValue], isAllSelected: state.defaultValueIsAllSelected, isChecked: typeof state.isChecked === "boolean" ? state.defaultValueIsChecked || false : undefined });
|
|
107
|
+
return Object.assign(Object.assign({}, state), { selectedIds: [...state.defaultValue], isAllSelected: state.defaultValueIsAllSelected, isChecked: typeof state.isChecked === "boolean" ? state.defaultValueIsChecked || false : undefined, selectAllActiveForId: undefined });
|
|
105
108
|
case StateActionType.ResetStateToGlobal:
|
|
106
|
-
return Object.assign(Object.assign({}, state), { selectedIds: [...state.globalSelectedIds], isAllSelected: state.globalIsAllSelected, isChecked: state.globalIsChecked });
|
|
109
|
+
return Object.assign(Object.assign({}, state), { selectedIds: [...state.globalSelectedIds], isAllSelected: state.globalIsAllSelected, isChecked: state.globalIsChecked, selectAllActiveForId: undefined });
|
|
107
110
|
case StateActionType.NothingToShow:
|
|
108
111
|
return Object.assign(Object.assign({}, state), { showWaiting: false, showEmptyList: false, showList: false });
|
|
109
112
|
case StateActionType.Show:
|
|
@@ -115,7 +118,7 @@ export function stateReducer(state, action) {
|
|
|
115
118
|
case StateActionType.ShowList:
|
|
116
119
|
return Object.assign(Object.assign({}, state), { showWaiting: false, showEmptyList: false, showList: true });
|
|
117
120
|
case StateActionType.SetInputValue:
|
|
118
|
-
return Object.assign(Object.assign({}, state), { inputValue: payload });
|
|
121
|
+
return Object.assign(Object.assign({}, state), { inputValue: payload, selectAllActiveForId: undefined });
|
|
119
122
|
case StateActionType.SetState: {
|
|
120
123
|
const newNamelessIds = new Set(state.namelessIds);
|
|
121
124
|
payload.selected.forEach(id => {
|
|
@@ -219,8 +222,10 @@ export function stateReducer(state, action) {
|
|
|
219
222
|
state.groupsMapSelected.set(id, Object.assign(Object.assign({ id }, (item.name ? { name: item.name } : {})), (item.color ? { color: item.color } : {})));
|
|
220
223
|
}
|
|
221
224
|
});
|
|
222
|
-
const
|
|
223
|
-
|
|
225
|
+
const newIsAllSelected = state.autoPromoteSelectAll
|
|
226
|
+
? currentSelectedIds.size >= Object.keys(state.groupsMap).length - 1
|
|
227
|
+
: state.isAllSelected;
|
|
228
|
+
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(currentSelectedIds), selectAllActiveForId: undefined, isAllSelected: newIsAllSelected });
|
|
224
229
|
}
|
|
225
230
|
case StateActionType.ChangeBulkSelection: {
|
|
226
231
|
const { itemsIds, value } = payload;
|
|
@@ -253,8 +258,10 @@ export function stateReducer(state, action) {
|
|
|
253
258
|
state.groupsMapSelected.set(id, Object.assign(Object.assign({ id }, (item.name ? { name: item.name } : {})), (item.color ? { color: item.color } : {})));
|
|
254
259
|
}
|
|
255
260
|
});
|
|
256
|
-
const
|
|
257
|
-
|
|
261
|
+
const newIsAllSelected = state.autoPromoteSelectAll
|
|
262
|
+
? currentSelectedIds.size >= Object.keys(state.groupsMap).length - 1
|
|
263
|
+
: state.isAllSelected;
|
|
264
|
+
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(currentSelectedIds), selectAllActiveForId: undefined, isAllSelected: newIsAllSelected });
|
|
258
265
|
}
|
|
259
266
|
case StateActionType.SelectAllChildren: {
|
|
260
267
|
const currentEl = state.groupsMap[payload];
|
|
@@ -291,7 +298,7 @@ export function stateReducer(state, action) {
|
|
|
291
298
|
state.groupsMapSelected.set(id, Object.assign(Object.assign({ id }, (item.name ? { name: item.name } : {})), (item.color ? { color: item.color } : {})));
|
|
292
299
|
}
|
|
293
300
|
});
|
|
294
|
-
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(newSelected) });
|
|
301
|
+
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(newSelected), selectAllActiveForId: payload });
|
|
295
302
|
}
|
|
296
303
|
case StateActionType.DeselectItemsFromAllSelected: {
|
|
297
304
|
const currentEl = state.groupsMap[state.rootId];
|
|
@@ -315,12 +322,16 @@ export function stateReducer(state, action) {
|
|
|
315
322
|
state.groupsMapSelected.set(id, Object.assign(Object.assign({ id }, (item.name ? { name: item.name } : {})), (item.color ? { color: item.color } : {})));
|
|
316
323
|
}
|
|
317
324
|
});
|
|
318
|
-
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(newSelected), isAllSelected: state.isFullSelectionMode ? false : undefined });
|
|
325
|
+
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(newSelected), isAllSelected: state.isFullSelectionMode ? false : undefined, selectAllActiveForId: undefined });
|
|
319
326
|
}
|
|
320
327
|
case StateActionType.ToggleValueForAllSelected: {
|
|
321
328
|
const currentEl = state.groupsMap[state.rootId];
|
|
329
|
+
// selectAllActiveForId tracks when "Select all" was clicked at this level, even when
|
|
330
|
+
// autoPromoteSelectAll=false keeps isAllSelected=false. Without this fallback, a second
|
|
331
|
+
// click would incorrectly clear selections and leave the button stuck as pressed.
|
|
332
|
+
const effectiveIsAllSelected = !!state.isAllSelected || state.selectAllActiveForId === (state.currentId || state.rootId);
|
|
322
333
|
const newSelected = new Set();
|
|
323
|
-
|
|
334
|
+
effectiveIsAllSelected &&
|
|
324
335
|
((currentEl === null || currentEl === void 0 ? void 0 : currentEl.children) || []).forEach(el => {
|
|
325
336
|
if (!newSelected.has(el.id) && el.disabled) {
|
|
326
337
|
newSelected.add(el.id);
|
|
@@ -333,9 +344,8 @@ export function stateReducer(state, action) {
|
|
|
333
344
|
state.groupsMapSelected.set(id, Object.assign(Object.assign({ id }, (item.name ? { name: item.name } : {})), (item.color ? { color: item.color } : {})));
|
|
334
345
|
}
|
|
335
346
|
});
|
|
336
|
-
const updatedIsAllSelectedValue = state.isFullSelectionMode ? !
|
|
337
|
-
|
|
338
|
-
return Object.assign(Object.assign(Object.assign({}, state), { selectedIds: state.isAllSelected ? Array.from(newSelected) : [], isAllSelected: updatedIsAllSelectedValue }), additionalStateUpdates);
|
|
347
|
+
const updatedIsAllSelectedValue = state.isFullSelectionMode ? !effectiveIsAllSelected : undefined;
|
|
348
|
+
return Object.assign(Object.assign({}, state), { selectedIds: effectiveIsAllSelected ? Array.from(newSelected) : [], isAllSelected: updatedIsAllSelectedValue, selectAllActiveForId: undefined });
|
|
339
349
|
}
|
|
340
350
|
case StateActionType.DeselectAllChildren: {
|
|
341
351
|
const childrenForDeselect = [];
|
|
@@ -347,7 +357,7 @@ export function stateReducer(state, action) {
|
|
|
347
357
|
});
|
|
348
358
|
const newSelected = new Set(state.selectedIds);
|
|
349
359
|
childrenForDeselect.forEach(childId => newSelected.delete(childId));
|
|
350
|
-
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(newSelected) });
|
|
360
|
+
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(newSelected), selectAllActiveForId: undefined });
|
|
351
361
|
}
|
|
352
362
|
case StateActionType.SetFirstParentNodeIsVisible: {
|
|
353
363
|
if (state.firstParentNodeIsVisible === payload) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IDropdownState } from "./stateReducer";
|
|
2
1
|
import { IDropdownRawItem } from "../types";
|
|
3
2
|
import { IGroupTree, ITypedHash } from "../../groupsFilterRaw/groupsFilterInterfaces";
|
|
4
3
|
export declare function getChildList(childArr: IDropdownRawItem[] | undefined): IDropdownRawItem[];
|
|
5
|
-
export declare const
|
|
4
|
+
export declare const computeIsAllSelected: (currentIsAllSelected: boolean | undefined, isFullSelectionMode: boolean, resultsExceedListLimit: boolean | undefined, groupsMapLength: number, selectedCount: number) => boolean | undefined;
|
|
6
5
|
export declare const getRootId: (groupsMap: ITypedHash<IGroupTree>, rootIdKey: string, firstParentNodeIsVisible?: boolean) => string | undefined;
|
|
@@ -13,16 +13,11 @@ export function getChildList(childArr) {
|
|
|
13
13
|
});
|
|
14
14
|
return list;
|
|
15
15
|
}
|
|
16
|
-
export const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
additionalStateUpdates.isAllSelected = true;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return additionalStateUpdates;
|
|
25
|
-
};
|
|
16
|
+
export const computeIsAllSelected = (currentIsAllSelected, isFullSelectionMode, resultsExceedListLimit, groupsMapLength, selectedCount) => !resultsExceedListLimit && isFullSelectionMode && groupsMapLength > 0
|
|
17
|
+
? selectedCount >= groupsMapLength
|
|
18
|
+
? true
|
|
19
|
+
: currentIsAllSelected
|
|
20
|
+
: currentIsAllSelected;
|
|
26
21
|
export const getRootId = (groupsMap, rootIdKey, firstParentNodeIsVisible) => {
|
|
27
22
|
var _a;
|
|
28
23
|
if (Object.keys(groupsMap).length === 0) {
|
|
@@ -62,6 +62,26 @@ interface IDropdownBase extends IChipsParent {
|
|
|
62
62
|
mobileSheetStackingClassName?: string;
|
|
63
63
|
firstParentNodeIsVisible?: boolean;
|
|
64
64
|
dataAnalyticsId?: string;
|
|
65
|
+
/**
|
|
66
|
+
* When `true`, hides the "Select all" button while the user has an active search query.
|
|
67
|
+
* The button reappears when the search field is cleared.
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
hideSelectAllOnSearch?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* When `true`, individual list items are visually blocked (disabled) while "Select all" is
|
|
73
|
+
* active at the current level, preventing partial deselection after a bulk selection.
|
|
74
|
+
* Has no effect in full-selection mode (`value` with `isAllSelected`).
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
blockItemsOnSelectAll?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* When `true`, automatically promotes `isAllSelected` to `true` when all available items
|
|
80
|
+
* are individually checked. Only applies in full-selection mode (value with `isAllSelected`).
|
|
81
|
+
* Has no effect in standard mode (`value: string[]`).
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
autoPromoteSelectAll?: boolean;
|
|
65
85
|
}
|
|
66
86
|
interface IDropdownBaseDefault {
|
|
67
87
|
disabled?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { FiltersChip, IFiltersChip } from "./filtersChip";
|
|
3
3
|
import { FiltersDateRange, IFiltersDateRangeItem, TFiltersDateRangeState } from "./filtersDateRange";
|
|
4
4
|
import { FiltersDropdown, IFiltersDropdown, TFiltersDropdownAllStates } from "./filtersDropdown";
|
|
@@ -49,4 +49,4 @@ export declare const allowedFiltersComponents: ({
|
|
|
49
49
|
({ ...props }: IFiltersChip): import("react/jsx-runtime").JSX.Element;
|
|
50
50
|
displayName: string;
|
|
51
51
|
} | typeof FiltersDropdown)[];
|
|
52
|
-
export declare const getAllowedFilters: <T extends
|
|
52
|
+
export declare const getAllowedFilters: <T extends ReactNode>(items: T[]) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
|
|
@@ -22,7 +22,7 @@ export declare const prepareDefaultDropdownState: (type: TDropdownState) => neve
|
|
|
22
22
|
isAllSelected: boolean;
|
|
23
23
|
isChecked?: undefined;
|
|
24
24
|
};
|
|
25
|
-
export declare const getChildren: (children?: ReactElement | (null | ReactElement)[]) =>
|
|
25
|
+
export declare const getChildren: (children?: ReactElement | (null | ReactElement)[]) => ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
|
|
26
26
|
export declare const getFiltersState: (children: ReactElement | ReactElement[]) => {};
|
|
27
27
|
export declare const createStateObject: (children: ReactElement | ReactElement[], field: "state" | "defaultState") => {};
|
|
28
28
|
export declare function getNumberOfChangedFilters(state: object): number;
|
package/esm/filtersBar/components/filtersBarDropdownWithCheckbox/filtersBarDropdownWithCheckbox.js
CHANGED
|
@@ -93,7 +93,7 @@ export const FiltersBarDropdownWithCheckbox = ({ sidePanelTitle, className, prop
|
|
|
93
93
|
restProps,
|
|
94
94
|
useSidePanelView
|
|
95
95
|
]);
|
|
96
|
-
const componentWithSeparateCheckbox =
|
|
96
|
+
const componentWithSeparateCheckbox = (_jsx(FiltersBarSidePanelDropdownWithCheckbox, { props: Object.assign({}, commonProps), state: state, onChange: onChange, getData: memoizedGetData }));
|
|
97
97
|
const component = isFullSelectionMode ? (_jsx(Dropdown, Object.assign({}, commonProps, { checkboxLabel: props.checkboxLabel, getData: props.getData, value: { selected: Array.from(selection), isAllSelected: isCurrentAllSelected || false, isChecked: isCurrentChecked }, onChange: onChangeFullSelectionWithCheckbox, defaultValue: props.defaultValue, multiselect: true, selectAllButton: true }))) : (_jsx(Dropdown, Object.assign({}, commonProps, { checkboxLabel: props.checkboxLabel, getData: props.getData, value: { selected: Array.from(selection), isChecked: isCurrentChecked }, onChange: onChangeWithCheckbox, defaultValue: props.defaultValue })));
|
|
98
98
|
if (!useSidePanelView) {
|
|
99
99
|
return component;
|
|
@@ -130,7 +130,7 @@ export const FiltersBar = ({ className, children, isAllFiltersVisible, hideAllFi
|
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
}, [filterBarChildren, memoizedShouldUpdate, sidePanelState, stateFromChildren]);
|
|
133
|
-
const searchChild = childrenArray.find(child =>
|
|
133
|
+
const searchChild = childrenArray.find(child => typeof child === "object" && "type" in child && child.type === FiltersBarSearch);
|
|
134
134
|
useEffect(() => {
|
|
135
135
|
setSearchComponent(searchChild);
|
|
136
136
|
}, [searchChild, setSearchComponent]);
|
|
@@ -208,7 +208,7 @@ export const FiltersBar = ({ className, children, isAllFiltersVisible, hideAllFi
|
|
|
208
208
|
return getNumberOfChangedFilters(filtersBarState.childrenState, filtersBarState.prevChildrenState) > 0;
|
|
209
209
|
}, [filtersBarState.childrenState, filtersBarState.prevChildrenState, getDefaultFiltersState, onApplyAllFilters]);
|
|
210
210
|
const sidePanel = useMemo(() => {
|
|
211
|
-
const sidePanelChild = childrenArray.find(child =>
|
|
211
|
+
const sidePanelChild = childrenArray.find(child => typeof child === "object" && "type" in child && child.type === FiltersBarSidePanelContainer);
|
|
212
212
|
if (!sidePanelChild) {
|
|
213
213
|
return (_jsx(FiltersBarSidePanel, { parentElement: parentElement, isOpen: isAllFiltersVisible, triggerRef: isMobile ? mobileTriggerRef || emptyFiltersRef : allFiltersRef, getDefaultFiltersState: getDefaultFiltersState, onClosePanel: onClosePanel, state: sidePanelState, onApplyAllFilters: handleApplyAllFilters(true), dispatch: dispatchSidePanelState, pillName: pillName, pillIcon: pillIcon, pillType: pillType, children: filterBarChildren }));
|
|
214
214
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FiltersBarDropdown, IFiltersBarDropdown, IFiltersBarDropdownFullSelectionMode } from "./components/filtersBarDropdown/filtersBarDropdown";
|
|
3
2
|
import { FiltersBarGroupButton, IFiltersBarGroupButton } from "./components/filtersBarGroupButton/filtersBarGroupButton";
|
|
4
3
|
import { FiltersBarGroupsFilter, IFiltersBarGroupsFilter } from "./components/filtersBarGroupsFilter/filtersBarGroupsFilter";
|