@geotab/zenith 3.14.1 → 3.15.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +1 -2
- package/dist/chart/plugins/linePlugin/linePlugin.js +29 -7
- 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 +219 -169
- 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/tsconfig.cjs.tsbuildinfo +1 -0
- 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/linePlugin.js +29 -7
- 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/tsconfig.esm.tsbuildinfo +1 -0
- 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
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
1
|
+
import { injectString } from "../utils/localization/translationsDictionary";
|
|
2
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
6
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
11
9
|
};
|
|
12
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
11
|
import { useContext, useEffect, useMemo } from "react";
|
|
@@ -20,73 +18,135 @@ import { LEGEND_PLUGIN_ID } from "./plugins/htmlLegend";
|
|
|
20
18
|
import { useDrive } from "../utils/theme/useDrive";
|
|
21
19
|
import { useMobile } from "../commonHelpers/hooks/useMobile";
|
|
22
20
|
import { themeContext } from "../utils/theme/themeContext";
|
|
21
|
+
import { useLanguage } from "../utils/localization/useLanguage";
|
|
22
|
+
injectString("cs", "Line chart", "Spojnicov\xFD graf");
|
|
23
|
+
injectString("da-DK", "Line chart", "Linjediagram");
|
|
24
|
+
injectString("de", "Line chart", "Liniendiagramm");
|
|
25
|
+
injectString("en", "Line chart", "Line chart");
|
|
26
|
+
injectString("es", "Line chart", "Gr\xE1fico de l\xEDneas");
|
|
27
|
+
injectString("fi-FI", "Line chart", "Viivakaavio");
|
|
28
|
+
injectString("fr", "Line chart", "Graphique lin\xE9aire");
|
|
29
|
+
injectString("fr-FR", "Line chart", "Graphique lin\xE9aire");
|
|
30
|
+
injectString("hu-HU", "Line chart", "Vonaldiagram");
|
|
31
|
+
injectString("id", "Line chart", "Bagan garis");
|
|
32
|
+
injectString("it", "Line chart", "Grafico a linee");
|
|
33
|
+
injectString("ja", "Line chart", "\u6298\u308C\u7DDA\u30B0\u30E9\u30D5");
|
|
34
|
+
injectString("ko-KR", "Line chart", "\uC120\uD615 \uCC28\uD2B8");
|
|
35
|
+
injectString("ms", "Line chart", "Carta garisan");
|
|
36
|
+
injectString("nb-NO", "Line chart", "Linjediagram");
|
|
37
|
+
injectString("nl", "Line chart", "Lijndiagram");
|
|
38
|
+
injectString("pl", "Line chart", "Wykres liniowy");
|
|
39
|
+
injectString("pt-BR", "Line chart", "Gr\xE1fico de linhas");
|
|
40
|
+
injectString("pt-PT", "Line chart", "Gr\xE1fico de linhas");
|
|
41
|
+
injectString("sk-SK", "Line chart", "\u010Ciarov\xFD graf");
|
|
42
|
+
injectString("sv", "Line chart", "Linjediagram");
|
|
43
|
+
injectString("th", "Line chart", "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E2A\u0E49\u0E19");
|
|
44
|
+
injectString("tr", "Line chart", "\xC7izgi grafik");
|
|
45
|
+
injectString("zh-Hans", "Line chart", "\u6298\u7EBF\u56FE");
|
|
46
|
+
injectString("zh-TW", "Line chart", "\u6298\u7DDA\u5716");
|
|
47
|
+
injectString("ro-RO", "Line chart", "Grafic liniar");
|
|
48
|
+
injectString("ar", "Line chart", "\u0645\u062E\u0637\u0637 \u062E\u0637\u064A");
|
|
49
|
+
injectString("lt-LT", "Line chart", "Linijin\u0117 diagrama");
|
|
50
|
+
injectString("lv-LV", "Line chart", "L\u012Bniju diagramma");
|
|
51
|
+
injectString("ka-GE", "Line chart", "\u10EE\u10D0\u10D6\u10DD\u10D5\u10D0\u10DC\u10D8 \u10E1\u10E5\u10D4\u10DB\u10D0");
|
|
52
|
+
injectString("el-GR", "Line chart", "\u0393\u03C1\u03AC\u03C6\u03B7\u03BC\u03B1 \u03B3\u03C1\u03B1\u03BC\u03BC\u03CE\u03BD");
|
|
53
|
+
injectString("et-EE", "Line chart", "Joondiagramm");
|
|
54
|
+
injectString("bg-BG", "Line chart", "\u041B\u0438\u043D\u0435\u0439\u043D\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u0430");
|
|
23
55
|
ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, Filler, TimeScale);
|
|
24
56
|
const defaultGridStyle = {
|
|
25
|
-
|
|
26
|
-
|
|
57
|
+
drawTicks: false,
|
|
58
|
+
color: "#C0CCD8"
|
|
27
59
|
};
|
|
28
60
|
const defaultGridBorderStyle = {
|
|
29
|
-
|
|
30
|
-
|
|
61
|
+
display: false,
|
|
62
|
+
dash: [2, 2]
|
|
31
63
|
};
|
|
32
64
|
const defTicksStyle = {
|
|
33
|
-
|
|
65
|
+
padding: 10
|
|
34
66
|
};
|
|
35
|
-
const getDefaultOptions =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const getDefaultOptions = fontSize => {
|
|
68
|
+
const defTitleStyle = {
|
|
69
|
+
display: true,
|
|
70
|
+
font: {
|
|
71
|
+
size: fontSize,
|
|
72
|
+
weight: "400"
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
responsive: true,
|
|
77
|
+
maintainAspectRatio: false,
|
|
78
|
+
scales: {
|
|
79
|
+
x: {
|
|
80
|
+
grid: defaultGridStyle,
|
|
81
|
+
border: defaultGridBorderStyle,
|
|
82
|
+
ticks: defTicksStyle,
|
|
83
|
+
title: defTitleStyle
|
|
84
|
+
},
|
|
85
|
+
y: {
|
|
86
|
+
grid: defaultGridStyle,
|
|
87
|
+
border: defaultGridBorderStyle,
|
|
88
|
+
ticks: defTicksStyle,
|
|
89
|
+
title: defTitleStyle
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
plugins: {
|
|
93
|
+
legend: {
|
|
94
|
+
display: false
|
|
95
|
+
},
|
|
96
|
+
tooltip: {
|
|
97
|
+
enabled: true
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
69
101
|
};
|
|
70
102
|
/**
|
|
71
103
|
* @deprecated - will be removed in the next releases.
|
|
72
104
|
*/
|
|
73
|
-
export const LineChart =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
105
|
+
export const LineChart = _a => {
|
|
106
|
+
var {
|
|
107
|
+
data,
|
|
108
|
+
options = {},
|
|
109
|
+
plugins,
|
|
110
|
+
className
|
|
111
|
+
} = _a,
|
|
112
|
+
rest = __rest(_a, ["data", "options", "plugins", "className"]);
|
|
113
|
+
const {
|
|
114
|
+
translate
|
|
115
|
+
} = useLanguage();
|
|
116
|
+
const isDrive = useDrive();
|
|
117
|
+
const isMobile = useMobile();
|
|
118
|
+
const memoizedFontSize = useMemo(() => isDrive ? isMobile ? 14 : 16 : 12, [isDrive, isMobile]);
|
|
119
|
+
const {
|
|
120
|
+
dark
|
|
121
|
+
} = useContext(themeContext);
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
ChartJS.defaults.font = {
|
|
124
|
+
family: "Roboto",
|
|
125
|
+
size: memoizedFontSize
|
|
126
|
+
};
|
|
127
|
+
ChartJS.defaults.color = dark ? "#FFFFFF" : "#1F2833";
|
|
128
|
+
}, [memoizedFontSize, dark]);
|
|
129
|
+
const adaptedData = Object.assign({}, data);
|
|
130
|
+
const memoizedDefaultOptions = useMemo(() => getDefaultOptions(memoizedFontSize), [memoizedFontSize]);
|
|
131
|
+
const adaptedOptions = deepMerge(memoizedDefaultOptions, options);
|
|
132
|
+
adaptedData.datasets = adaptedData.datasets.map((ds, i) => getDefaultDatasetStyle(ds, i));
|
|
133
|
+
const memoizedPlagins = useMemo(() => plugins === null || plugins === void 0 ? void 0 : plugins.map(el => el.id === LEGEND_PLUGIN_ID ? Object.assign(Object.assign({}, el), {
|
|
134
|
+
isDrive: isDrive
|
|
135
|
+
}) : el), [isDrive, plugins]);
|
|
136
|
+
return _jsx("div", {
|
|
137
|
+
className: "zen-line-chart",
|
|
138
|
+
tabIndex: 0,
|
|
139
|
+
style: {
|
|
140
|
+
width: "100%",
|
|
141
|
+
height: "100%"
|
|
142
|
+
},
|
|
143
|
+
role: "figure",
|
|
144
|
+
"aria-label": translate("Line chart"),
|
|
145
|
+
children: _jsx(Line, Object.assign({
|
|
146
|
+
options: adaptedOptions,
|
|
147
|
+
data: adaptedData,
|
|
148
|
+
plugins: memoizedPlagins,
|
|
149
|
+
className: className
|
|
150
|
+
}, rest))
|
|
151
|
+
});
|
|
152
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IZenComponentProps } from "../commonHelpers/zenComponent";
|
|
2
2
|
import type { ChartData, ChartOptions } from "chart.js/auto";
|
|
3
|
+
import "./lineChartMini.less";
|
|
3
4
|
export interface ILineChartMini extends IZenComponentProps {
|
|
4
5
|
data: ChartData<"line">;
|
|
5
6
|
options?: ChartOptions<"line">;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
1
|
+
import { injectString } from "../utils/localization/translationsDictionary";
|
|
2
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
6
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
11
9
|
};
|
|
12
10
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useContext, useEffect, useMemo } from "react";
|
|
11
|
+
import { useContext, useEffect, useId, useMemo } from "react";
|
|
14
12
|
import { Line } from "../react-chartjs/typedCharts";
|
|
15
13
|
import { Chart as ChartJS, CategoryScale, LinearScale, PointElement, LineElement, Filler } from "chart.js/auto";
|
|
16
14
|
import { deepMerge } from "../commonHelpers/utils";
|
|
@@ -20,76 +18,141 @@ import { useMobile } from "../commonHelpers/hooks/useMobile";
|
|
|
20
18
|
import { themeContext } from "../utils/theme/themeContext";
|
|
21
19
|
import { useIsRTL } from "../utils/localization/useIsRTL";
|
|
22
20
|
import { AccessibleChart } from "../chart/accessibleChart/accessibleChart";
|
|
21
|
+
import { useLanguage } from "../utils/localization/useLanguage";
|
|
22
|
+
injectString("cs", "Line chart", "Spojnicov\xFD graf");
|
|
23
|
+
injectString("da-DK", "Line chart", "Linjediagram");
|
|
24
|
+
injectString("de", "Line chart", "Liniendiagramm");
|
|
25
|
+
injectString("en", "Line chart", "Line chart");
|
|
26
|
+
injectString("es", "Line chart", "Gr\xE1fico de l\xEDneas");
|
|
27
|
+
injectString("fi-FI", "Line chart", "Viivakaavio");
|
|
28
|
+
injectString("fr", "Line chart", "Graphique lin\xE9aire");
|
|
29
|
+
injectString("fr-FR", "Line chart", "Graphique lin\xE9aire");
|
|
30
|
+
injectString("hu-HU", "Line chart", "Vonaldiagram");
|
|
31
|
+
injectString("id", "Line chart", "Bagan garis");
|
|
32
|
+
injectString("it", "Line chart", "Grafico a linee");
|
|
33
|
+
injectString("ja", "Line chart", "\u6298\u308C\u7DDA\u30B0\u30E9\u30D5");
|
|
34
|
+
injectString("ko-KR", "Line chart", "\uC120\uD615 \uCC28\uD2B8");
|
|
35
|
+
injectString("ms", "Line chart", "Carta garisan");
|
|
36
|
+
injectString("nb-NO", "Line chart", "Linjediagram");
|
|
37
|
+
injectString("nl", "Line chart", "Lijndiagram");
|
|
38
|
+
injectString("pl", "Line chart", "Wykres liniowy");
|
|
39
|
+
injectString("pt-BR", "Line chart", "Gr\xE1fico de linhas");
|
|
40
|
+
injectString("pt-PT", "Line chart", "Gr\xE1fico de linhas");
|
|
41
|
+
injectString("sk-SK", "Line chart", "\u010Ciarov\xFD graf");
|
|
42
|
+
injectString("sv", "Line chart", "Linjediagram");
|
|
43
|
+
injectString("th", "Line chart", "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E2A\u0E49\u0E19");
|
|
44
|
+
injectString("tr", "Line chart", "\xC7izgi grafik");
|
|
45
|
+
injectString("zh-Hans", "Line chart", "\u6298\u7EBF\u56FE");
|
|
46
|
+
injectString("zh-TW", "Line chart", "\u6298\u7DDA\u5716");
|
|
47
|
+
injectString("ro-RO", "Line chart", "Grafic liniar");
|
|
48
|
+
injectString("ar", "Line chart", "\u0645\u062E\u0637\u0637 \u062E\u0637\u064A");
|
|
49
|
+
injectString("lt-LT", "Line chart", "Linijin\u0117 diagrama");
|
|
50
|
+
injectString("lv-LV", "Line chart", "L\u012Bniju diagramma");
|
|
51
|
+
injectString("ka-GE", "Line chart", "\u10EE\u10D0\u10D6\u10DD\u10D5\u10D0\u10DC\u10D8 \u10E1\u10E5\u10D4\u10DB\u10D0");
|
|
52
|
+
injectString("el-GR", "Line chart", "\u0393\u03C1\u03AC\u03C6\u03B7\u03BC\u03B1 \u03B3\u03C1\u03B1\u03BC\u03BC\u03CE\u03BD");
|
|
53
|
+
injectString("et-EE", "Line chart", "Joondiagramm");
|
|
54
|
+
injectString("bg-BG", "Line chart", "\u041B\u0438\u043D\u0435\u0439\u043D\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u0430");
|
|
23
55
|
ChartJS.defaults.font = {
|
|
24
|
-
|
|
25
|
-
|
|
56
|
+
family: "Roboto",
|
|
57
|
+
size: 12
|
|
26
58
|
};
|
|
27
59
|
ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, Filler);
|
|
28
60
|
const defaultGridStyle = {
|
|
29
|
-
|
|
61
|
+
display: false
|
|
30
62
|
};
|
|
31
63
|
const defaultGridBorderStyle = {
|
|
32
|
-
|
|
64
|
+
display: false
|
|
33
65
|
};
|
|
34
|
-
const getDefaultOptions =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
66
|
+
const getDefaultOptions = isRtl => ({
|
|
67
|
+
responsive: true,
|
|
68
|
+
maintainAspectRatio: false,
|
|
69
|
+
layout: {
|
|
70
|
+
padding: {
|
|
71
|
+
left: isRtl ? 16 : 0,
|
|
72
|
+
right: isRtl ? 0 : 16
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
scales: {
|
|
76
|
+
x: {
|
|
77
|
+
grid: defaultGridStyle,
|
|
78
|
+
border: defaultGridBorderStyle,
|
|
79
|
+
reverse: isRtl,
|
|
80
|
+
offset: false
|
|
42
81
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
display: false
|
|
56
|
-
}
|
|
57
|
-
}
|
|
82
|
+
y: {
|
|
83
|
+
grid: defaultGridStyle,
|
|
84
|
+
border: defaultGridBorderStyle,
|
|
85
|
+
position: isRtl ? "right" : "left",
|
|
86
|
+
ticks: {
|
|
87
|
+
display: false
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
plugins: {
|
|
92
|
+
legend: {
|
|
93
|
+
display: false
|
|
58
94
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
display: false
|
|
62
|
-
},
|
|
63
|
-
tooltip: {
|
|
64
|
-
enabled: false
|
|
65
|
-
}
|
|
95
|
+
tooltip: {
|
|
96
|
+
enabled: false
|
|
66
97
|
}
|
|
98
|
+
}
|
|
67
99
|
});
|
|
68
|
-
export const LineChartMini =
|
|
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
|
-
|
|
100
|
+
export const LineChartMini = _a => {
|
|
101
|
+
var _b, _c;
|
|
102
|
+
var {
|
|
103
|
+
data,
|
|
104
|
+
options = {}
|
|
105
|
+
} = _a,
|
|
106
|
+
rest = __rest(_a, ["data", "options"]);
|
|
107
|
+
const {
|
|
108
|
+
translate
|
|
109
|
+
} = useLanguage();
|
|
110
|
+
const narrativeId = useId();
|
|
111
|
+
const isDrive = useDrive();
|
|
112
|
+
const isMobile = useMobile();
|
|
113
|
+
const memoizedFontSize = useMemo(() => isDrive ? isMobile ? 14 : 16 : 12, [isDrive, isMobile]);
|
|
114
|
+
const {
|
|
115
|
+
dark
|
|
116
|
+
} = useContext(themeContext);
|
|
117
|
+
const isRtl = useIsRTL();
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
ChartJS.defaults.font = {
|
|
120
|
+
family: "Roboto",
|
|
121
|
+
size: memoizedFontSize
|
|
122
|
+
};
|
|
123
|
+
ChartJS.defaults.color = dark ? "#FFFFFF" : "#1F2833";
|
|
124
|
+
}, [memoizedFontSize, dark]);
|
|
125
|
+
const adaptedData = Object.assign({}, data);
|
|
126
|
+
const defaultOptions = useMemo(() => getDefaultOptions(isRtl), [isRtl]);
|
|
127
|
+
const adaptedOptions = deepMerge(defaultOptions, options);
|
|
128
|
+
if (((_b = adaptedData.labels) === null || _b === void 0 ? void 0 : _b.length) === 2) {
|
|
129
|
+
const maxLabelsCount = Math.max(...data.datasets.map(ds => ds.data.length));
|
|
130
|
+
const newLabels = Array(maxLabelsCount).fill("");
|
|
131
|
+
newLabels[0] = (_c = data.labels) === null || _c === void 0 ? void 0 : _c[0];
|
|
132
|
+
newLabels[newLabels.length - 1] = data.labels ? data.labels[data.labels.length - 1] : "";
|
|
133
|
+
adaptedData.labels = newLabels;
|
|
134
|
+
}
|
|
135
|
+
adaptedData.datasets = adaptedData.datasets.map((ds, i) => getDefaultDatasetStyle(ds, i, true));
|
|
136
|
+
return _jsxs(_Fragment, {
|
|
137
|
+
children: [_jsx("div", {
|
|
138
|
+
className: "zen-line-chart-mini",
|
|
139
|
+
tabIndex: 0,
|
|
140
|
+
style: {
|
|
141
|
+
width: "100%",
|
|
142
|
+
height: "100%"
|
|
143
|
+
},
|
|
144
|
+
role: "figure",
|
|
145
|
+
"aria-label": translate("Line chart"),
|
|
146
|
+
"aria-describedby": narrativeId,
|
|
147
|
+
children: _jsx(Line, Object.assign({
|
|
148
|
+
options: adaptedOptions,
|
|
149
|
+
data: adaptedData,
|
|
150
|
+
"aria-hidden": true
|
|
151
|
+
}, rest))
|
|
152
|
+
}), _jsx(AccessibleChart, {
|
|
153
|
+
type: "line-mini",
|
|
154
|
+
data: adaptedData,
|
|
155
|
+
narrativeId: narrativeId
|
|
156
|
+
})]
|
|
157
|
+
});
|
|
158
|
+
};
|
|
@@ -28,5 +28,6 @@ export interface IItemData {
|
|
|
28
28
|
isTall?: boolean;
|
|
29
29
|
target?: React.HTMLAttributeAnchorTarget;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
declare const ItemDataInner: ({ id, ...rest }: IItemData) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare const ItemData: typeof ItemDataInner;
|
|
32
33
|
export {};
|
|
@@ -27,5 +27,6 @@ export interface IItemData {
|
|
|
27
27
|
isTall?: boolean;
|
|
28
28
|
target?: React.HTMLAttributeAnchorTarget;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
declare const ItemDataInternalInner: ({ id, visible, icon, iconClassName, name, link, secondary, status, actions, data, onClick, checked, onCheck, isDrive, isMobile, isTall, target }: IItemData) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const ItemDataInternal: typeof ItemDataInternalInner;
|
|
31
32
|
export {};
|
package/esm/list/list.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { IItemData } from "../itemData/itemData";
|
|
3
|
-
export declare const isDataListItem: (item: ReactNode) => item is ReactElement<IItemData
|
|
3
|
+
export declare const isDataListItem: (item: ReactNode) => item is ReactElement<IItemData>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, ForwardRefExoticComponent, RefAttributes,
|
|
1
|
+
import { FC, ForwardRefExoticComponent, RefAttributes, PropsWithChildren } from "react";
|
|
2
2
|
import { IMenuControlledItem } from "../menuItem";
|
|
3
3
|
import { IZenComponentProps } from "../../../commonHelpers/zenComponent";
|
|
4
4
|
import { IMenuSeparator } from "../menuSeparator";
|
|
@@ -19,9 +19,7 @@ export interface IControlledMenuListInternal extends IControlledMenuList {
|
|
|
19
19
|
isOpen?: boolean;
|
|
20
20
|
setIsOpen?: (v: boolean) => void;
|
|
21
21
|
}
|
|
22
|
-
export declare const ControlledMenuList: ForwardRefExoticComponent<IControlledMenuList & {
|
|
23
|
-
children?: ReactNode;
|
|
24
|
-
} & RefAttributes<HTMLDivElement>> & {
|
|
22
|
+
export declare const ControlledMenuList: ForwardRefExoticComponent<PropsWithChildren<IControlledMenuList> & RefAttributes<HTMLDivElement>> & {
|
|
25
23
|
Item: FC<IMenuControlledItem>;
|
|
26
24
|
Separator: FC<IMenuSeparator>;
|
|
27
25
|
};
|
|
@@ -8,6 +8,7 @@ import { getItemLabel } from "../../utils/getItemLabel";
|
|
|
8
8
|
import { normalizeSeparators } from "../../utils/normalizeSeparators";
|
|
9
9
|
import { useMenuPath } from "../../utils/useMenuPath";
|
|
10
10
|
import { useLastValidSheet } from "../../utils/useLastValidSheet";
|
|
11
|
+
import { useDisplayContent } from "../../utils/useDisplayContent";
|
|
11
12
|
import { useMenuListKeyboardNav } from "../../utils/useMenuListKeyboardNav";
|
|
12
13
|
import { MenuButton } from "../menuButton";
|
|
13
14
|
import { IconArrowLeft } from "../../../icons/iconArrowLeft";
|
|
@@ -95,6 +96,7 @@ const ControlledMenuListBase = forwardRef(({ children, setIsOpen, isOpen, classN
|
|
|
95
96
|
}
|
|
96
97
|
return [buildListItems(children), null];
|
|
97
98
|
}, [children, isMobile, path, isEmbedded, buildListItems]);
|
|
99
|
+
const { displayContent, displayParent } = useDisplayContent(isOpen, content, parent);
|
|
98
100
|
// Standalone mobile only: compute nested content for the inline MobileSheet.
|
|
99
101
|
const [nestedContent, nestedParent] = useMemo(() => {
|
|
100
102
|
if (isEmbedded || !isMobile || path.length === 0) {
|
|
@@ -115,7 +117,7 @@ const ControlledMenuListBase = forwardRef(({ children, setIsOpen, isOpen, classN
|
|
|
115
117
|
applyDirection && direction === "horizontal" ? "zen-menu-item--horizontal" : ""
|
|
116
118
|
]), children: [backParent ? (_jsx(MenuButton, { id: "root", name: getItemLabel(backParent), icon: BackArrowIcon, onClick: closeBranch, hasChildren: false, disabled: false }, "root")) : null, listContent] }) }));
|
|
117
119
|
const { sheetContent, sheetParent, sheetPathLength, sheetParentName } = useLastValidSheet(nestedContent, nestedParent, path, children);
|
|
118
|
-
return (_jsxs(PathProvider, { path: path, onOpenBranch: onOpenBranch, closeBranch: closeBranch, navigatedViaKeyboardRef: navigatedViaKeyboardRef, keyboardActiveRef: keyboardActiveRef, children: [renderList(
|
|
120
|
+
return (_jsxs(PathProvider, { path: path, onOpenBranch: onOpenBranch, closeBranch: closeBranch, navigatedViaKeyboardRef: navigatedViaKeyboardRef, keyboardActiveRef: keyboardActiveRef, children: [renderList(displayContent, displayParent, divRefCallback), !isEmbedded && isMobile && (_jsxs(MobileSheet, { label: sheetParentName, isOpen: path.length > 0, triggerRef: internalRef, onHidePanel: closeAll, onCloseClick: closeAll, children: [_jsx(MobileSheet.Title, { children: sheetParentName }), _jsx(MobileSheet.Content, { children: renderList(sheetContent, sheetPathLength > 1 ? sheetParent : null, undefined, false, onKeyDownVertical) })] }))] }));
|
|
119
121
|
});
|
|
120
122
|
ControlledMenuListBase.displayName = "ControlledMenuList";
|
|
121
123
|
export const ControlledMenuList = ControlledMenuListBase;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Freezes the displayed content/parent while the MobileSheet is closing so the
|
|
4
|
+
* sheet animates out over the submenu the user was in rather than flashing back
|
|
5
|
+
* to the root list.
|
|
6
|
+
*
|
|
7
|
+
* Refs are updated whenever the menu is open. When the user navigates back to
|
|
8
|
+
* root (parent === null) the frozen state is cleared, so closing from root does
|
|
9
|
+
* not freeze stale sub-level content.
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ Stability contract: `content` and `parent` must be referentially stable
|
|
12
|
+
* across renders while the menu is open (e.g. produced by `useMemo`).
|
|
13
|
+
* Passing a new array or object literal on every render will cause the
|
|
14
|
+
* `useLayoutEffect` to re-run every cycle, defeating the freeze: the ref will
|
|
15
|
+
* always reflect the latest values so there is nothing to freeze when
|
|
16
|
+
* `isOpen` transitions to `false`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useDisplayContent: (isOpen: boolean | undefined, content: ReactElement[], parent: ReactElement | null) => {
|
|
19
|
+
displayContent: ReactElement<unknown, string | import("react").JSXElementConstructor<any>>[];
|
|
20
|
+
displayParent: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
21
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useRef, useLayoutEffect } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Freezes the displayed content/parent while the MobileSheet is closing so the
|
|
4
|
+
* sheet animates out over the submenu the user was in rather than flashing back
|
|
5
|
+
* to the root list.
|
|
6
|
+
*
|
|
7
|
+
* Refs are updated whenever the menu is open. When the user navigates back to
|
|
8
|
+
* root (parent === null) the frozen state is cleared, so closing from root does
|
|
9
|
+
* not freeze stale sub-level content.
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ Stability contract: `content` and `parent` must be referentially stable
|
|
12
|
+
* across renders while the menu is open (e.g. produced by `useMemo`).
|
|
13
|
+
* Passing a new array or object literal on every render will cause the
|
|
14
|
+
* `useLayoutEffect` to re-run every cycle, defeating the freeze: the ref will
|
|
15
|
+
* always reflect the latest values so there is nothing to freeze when
|
|
16
|
+
* `isOpen` transitions to `false`.
|
|
17
|
+
*/
|
|
18
|
+
export const useDisplayContent = (isOpen, content, parent) => {
|
|
19
|
+
const lastRef = useRef({ content: [], parent: null });
|
|
20
|
+
// content and parent are compared by reference — see stability contract above.
|
|
21
|
+
useLayoutEffect(() => {
|
|
22
|
+
if (isOpen !== false) {
|
|
23
|
+
lastRef.current = { content, parent };
|
|
24
|
+
}
|
|
25
|
+
}, [isOpen, content, parent]);
|
|
26
|
+
const isFreezing = isOpen === false && lastRef.current.parent !== null;
|
|
27
|
+
return {
|
|
28
|
+
displayContent: isFreezing ? lastRef.current.content : content,
|
|
29
|
+
displayParent: isFreezing ? lastRef.current.parent : parent
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -8,7 +8,7 @@ export interface INavFooter extends IZenComponentProps {
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const NavFooter: FC<INavFooter> & {
|
|
10
10
|
Action: {
|
|
11
|
-
({ children }: import("./navFooterAction/navFooterAction").INavFooterActionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
({ children, active }: import("./navFooterAction/navFooterAction").INavFooterActionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
12
|
displayName: string;
|
|
13
13
|
};
|
|
14
14
|
Bottom: FC<IZenComponentProps>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "./navFooterAction.less";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
export interface INavFooterActionProps extends PropsWithChildren {
|
|
4
|
+
active?: boolean;
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
6
7
|
* @beta This component is not fully ready yet and may change in future releases.
|
|
7
8
|
*/
|
|
8
9
|
export declare const NavFooterAction: {
|
|
9
|
-
({ children }: INavFooterActionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
({ children, active }: INavFooterActionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
11
|
displayName: string;
|
|
11
12
|
};
|