@geotab/zenith 3.17.1 → 3.18.0-nightly.20261117.255bb01
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/banner/banner.d.ts +1 -0
- package/dist/banner/bannerMultipLine.js +3 -1
- package/dist/banner/bannerSingleLine.js +2 -0
- package/dist/calendar/calendarTypes.d.ts +5 -0
- package/dist/calendar/components/calendarGrid.d.ts +2 -2
- package/dist/calendar/components/calendarGrid.js +7 -2
- package/dist/calendar/hooks/useCalendar.d.ts +1 -1
- package/dist/calendar/hooks/useCalendar.js +44 -20
- package/dist/calendarNew/components/virtualMonthList/virtualMonthList.d.ts +4 -1
- package/dist/calendarNew/components/virtualMonthList/virtualMonthList.js +2 -2
- package/dist/card/card.d.ts +5 -0
- package/dist/card/card.js +6 -4
- package/dist/card/components/title.d.ts +4 -1
- package/dist/card/components/title.js +3 -3
- package/dist/chart/accessibleChart/accessibleChartTable.d.ts +1 -1
- package/dist/chart/accessibleChart/accessibleChartTable.js +29 -6
- package/dist/chart/accessibleChart/interfaces.d.ts +8 -2
- package/dist/chart/barChart.d.ts +3 -1
- package/dist/chart/barChart.js +5 -3
- package/dist/chart/lineChart.d.ts +3 -1
- package/dist/chart/lineChart.js +5 -3
- package/dist/chart/pieChart/pieLegendPlugin.js +3 -0
- package/dist/chart/pieChart/renderPieLegend.js +6 -4
- package/dist/chart/pieChart.d.ts +3 -1
- package/dist/chart/pieChart.js +5 -3
- package/dist/chart/plugins/legend/legendFocus.d.ts +2 -0
- package/dist/chart/plugins/legend/legendFocus.js +20 -0
- package/dist/chart/plugins/legend/legendPlugin.js +3 -0
- package/dist/chart/plugins/legend/renderLegend.js +9 -5
- package/dist/chart/utils/isEmptyDataPoint.d.ts +1 -0
- package/dist/chart/utils/isEmptyDataPoint.js +5 -0
- package/dist/checkboxListWithAction/checkboxListWithAction.d.ts +6 -0
- package/dist/checkboxListWithAction/checkboxListWithAction.js +129 -52
- package/dist/commonHelpers/hooks/useFormFieldValues/useFormFieldValues.d.ts +2 -1
- package/dist/commonHelpers/hooks/useFormFieldValues/useFormFieldValues.js +1 -0
- package/dist/commonHelpers/hooks/useMergedRef.d.ts +6 -0
- package/dist/commonHelpers/hooks/useMergedRef.js +37 -0
- package/dist/commonHelpers/hooks/useScroll.js +0 -1
- package/dist/commonStyles/typography/typography.less +9 -0
- package/dist/dataFeed/dataFeed.js +8 -5
- package/dist/dataGrid/cell/cell.d.ts +7 -1
- package/dist/dataGrid/cell/cell.js +8 -2
- package/dist/dataGrid/columns/mainColumn/mainColumnWrapper.d.ts +2 -0
- package/dist/dataGrid/columns/mainColumn/mainColumnWrapper.js +2 -2
- package/dist/dataGrid/dataGrid.d.ts +2 -1
- package/dist/dataGrid/dataGrid.js +40 -14
- package/dist/dataGrid/extensions/getStickyOffsets.d.ts +32 -0
- package/dist/dataGrid/extensions/getStickyOffsets.js +47 -0
- package/dist/dataGrid/headerCell/headerCell.d.ts +7 -1
- package/dist/dataGrid/headerCell/headerCell.js +5 -3
- package/dist/dataGrid/listColumn.d.ts +7 -0
- package/dist/dataGrid/row/row.d.ts +2 -2
- package/dist/dataGrid/row/row.js +13 -7
- package/dist/dateInputInner/components/template.d.ts +1 -1
- package/dist/dateInputInner/components/template.js +2 -0
- package/dist/dateInputInnerNew/components/template.d.ts +1 -1
- package/dist/dateInputInnerNew/components/template.js +3 -3
- package/dist/dateInputRawNew/components/template.js +1 -1
- package/dist/dateInputRawNew/components/trigger/trigger.d.ts +6 -2
- package/dist/dateInputRawNew/components/trigger/trigger.js +27 -8
- package/dist/dateInputRawNew/hooks/useDateInputRawNew.js +13 -4
- package/dist/datePickerCommon/hooks/useDateInputInner/dateInputInnerTypes.d.ts +2 -0
- package/dist/datePickerCommon/hooks/useDateInputInner/useDateInputInner.d.ts +1 -1
- package/dist/datePickerCommon/hooks/useDateInputInner/useDateInputInner.js +34 -10
- package/dist/datePickerCommon/hooks/useDateInputInner/useTodayButton.d.ts +2 -1
- package/dist/datePickerCommon/hooks/useDateInputInner/useTodayButton.js +11 -3
- package/dist/datePickerCommon/hooks/useDateInputRaw/dateInputRawBehavior.d.ts +5 -0
- package/dist/datePickerCommon/hooks/useDateInputRaw/dateInputRawBehavior.js +1 -0
- package/dist/datePickerCommon/hooks/useDateInputRaw/useDateInputRaw.js +4 -2
- package/dist/datePickerCommon/hooks/useDateRangeRaw/useDateRangeRawCore.d.ts +1 -7
- package/dist/datePickerCommon/hooks/useDateRangeRaw/useDateRangeRawCore.js +5 -5
- package/dist/datePickerCommon/types/dateInputInner.d.ts +2 -0
- package/dist/datePickerCommon/types/dateInputRaw.d.ts +11 -0
- package/dist/datePickerCommon/types/dateInputRawContext.d.ts +2 -1
- package/dist/datePickerCommon/utils/findEnabledDay.d.ts +6 -0
- package/dist/datePickerCommon/utils/findEnabledDay.js +19 -0
- package/dist/datePickerCommon/utils/getLimitsByPriority.d.ts +12 -0
- package/dist/datePickerCommon/utils/getLimitsByPriority.js +10 -0
- package/dist/datePickerCommon/utils/pickTabTarget.d.ts +5 -0
- package/dist/datePickerCommon/utils/pickTabTarget.js +20 -0
- package/dist/datePickerCommon/utils/resolveDisabledDate.d.ts +12 -0
- package/dist/datePickerCommon/utils/resolveDisabledDate.js +12 -0
- package/dist/datePickerNew/components/dateSegmentInput/dateSegmentInput.d.ts +2 -0
- package/dist/datePickerNew/components/dateSegmentInput/dateSegmentInput.js +2 -1
- package/dist/dateRangeRawNew/hooks/useDateRangeNewParts.d.ts +1 -7
- package/dist/dateRangeRawNew/hooks/useDateRangeNewParts.js +15 -24
- package/dist/dateRangeRawNew/hooks/useDateRangeRawNew.js +3 -3
- package/dist/dateRangeRawNew/hooks/useRangeEntry.js +4 -31
- package/dist/dropdownRaw/dropdownHelper.d.ts +10 -0
- package/dist/dropdownRaw/dropdownHelper.js +6 -2
- package/dist/dropdownRaw/dropdownPopup.js +2 -0
- package/dist/dropdownRaw/dropdownRaw.js +22 -8
- package/dist/dropdownRaw/dropdownSearchableTrigger.js +2 -3
- package/dist/dropdownRaw/types.d.ts +7 -0
- package/dist/fileUpload/components/filePreview.d.ts +15 -0
- package/dist/fileUpload/components/filePreview.js +272 -0
- package/dist/fileUpload/components/previewableFile.d.ts +16 -0
- package/dist/fileUpload/components/previewableFile.js +48 -0
- package/dist/fileUpload/components/resolveFileActions.d.ts +10 -0
- package/dist/fileUpload/components/resolveFileActions.js +11 -0
- package/dist/fileUpload/components/uploadedFilesSection.d.ts +9 -1
- package/dist/fileUpload/components/uploadedFilesSection.js +91 -16
- package/dist/fileUpload/components/useFilePreview.d.ts +12 -0
- package/dist/fileUpload/components/useFilePreview.js +85 -0
- package/dist/fileUpload/fileUpload.d.ts +1 -1
- package/dist/fileUpload/fileUpload.js +63 -2
- package/dist/fileUpload/fileUploadType.d.ts +35 -0
- package/dist/filters/components/filtersSearch.d.ts +3 -1
- package/dist/filters/components/filtersSearch.js +3 -3
- package/dist/filters/components/filtersSearchList.d.ts +3 -1
- package/dist/filters/components/filtersSearchList.js +6 -4
- package/dist/filters/components/filtersSidePanel.js +1 -1
- package/dist/filters/filters.d.ts +4 -0
- package/dist/filters/filters.js +10 -5
- package/dist/filtersBar/components/filtersBarDropdown/filtersBarDropdown.js +1 -2
- package/dist/filtersBar/components/filtersBarPeriodPicker/normalizeDates.js +1 -2
- package/dist/filtersBar/components/filtersBarSearch/filtersBarSearch.d.ts +1 -1
- package/dist/filtersBar/filtersBar.js +3 -1
- package/dist/filtersBar/filtersBarProvider.js +2 -4
- package/dist/filtersBar/filtersBarProviderSearch.js +3 -6
- package/dist/filtersBar/filtersBarProviderTrigger.js +4 -1
- package/dist/formSection/components/formSectionCard.js +1 -1
- package/dist/groupsFilterRaw/groupsFilterInterfaces.d.ts +2 -2
- package/dist/header/header.js +10 -6
- package/dist/header/headerContext.js +4 -1
- package/dist/icons/iconEngine.d.ts +3 -0
- package/dist/icons/iconEngine.js +12 -0
- package/dist/index.css +301 -11
- package/dist/index.d.ts +3 -1
- package/dist/index.js +12 -11
- package/dist/inputAdornments/inputAdornments.d.ts +3 -1
- package/dist/inputAdornments/inputAdornments.js +2 -2
- package/dist/lineChartMini/lineChartMini.d.ts +3 -1
- package/dist/lineChartMini/lineChartMini.js +5 -3
- package/dist/list/listItem/listItem.js +9 -0
- package/dist/miniTabs/miniTabs.d.ts +2 -1
- package/dist/miniTabs/miniTabs.js +2 -2
- package/dist/miniTabs/miniTabsItem.js +1 -1
- package/dist/modal/modal.d.ts +2 -0
- package/dist/nav/nav.js +2 -4
- package/dist/pillExpandable/pillExpandable.js +0 -1
- package/dist/pillExpandable/pillExpandableSimple.js +1 -2
- package/dist/primaryIcon/primaryIcon.d.ts +3 -1
- package/dist/primaryIcon/primaryIcon.js +3 -3
- package/dist/searchInputRaw/searchInputRaw.js +4 -2
- package/dist/searchInputRaw/types.d.ts +2 -0
- package/dist/selectList/selectList.js +25 -1
- package/dist/selectList/selectListItem.d.ts +8 -1
- package/dist/selectList/selectListItem.js +288 -57
- package/dist/stepperRaw/stepperRaw.js +5 -2
- package/dist/stepperRaw/utils/onBeforeInput.js +6 -1
- package/dist/table/columnMenu/columnMenuHeader.d.ts +28 -0
- package/dist/table/columnMenu/columnMenuHeader.js +132 -0
- package/dist/table/columnMenu/useColumnMenu.d.ts +24 -0
- package/dist/table/columnMenu/useColumnMenu.js +61 -0
- package/dist/table/flexible/getDefaultSettings.d.ts +1 -0
- package/dist/table/flexible/getDefaultSettings.js +2 -1
- package/dist/table/flexible/interfaces.d.ts +7 -0
- package/dist/table/flexible/mergeColumnSettings.js +2 -1
- package/dist/table/flexible/useFlexibleColumns.d.ts +16 -0
- package/dist/table/flexible/useFlexibleColumns.js +123 -49
- package/dist/table/flexible/useSettingsStorage.d.ts +2 -1
- package/dist/table/loading/useLoading.d.ts +1 -0
- package/dist/table/nested/nestedData.js +4 -2
- package/dist/table/sortable/useSortableColumns.d.ts +1 -0
- package/dist/table/sortable/useSortableColumns.js +4 -1
- package/dist/table/table.d.ts +14 -1
- package/dist/table/table.js +16 -3
- package/dist/textInputRaw/textInputRaw.js +5 -3
- package/dist/textInputRaw/types.d.ts +2 -0
- package/dist/textareaRaw/textareaRaw.js +4 -2
- package/dist/tooltip/tooltip.js +1 -2
- package/dist/utils/localization/translations/ar-001.json +1 -2
- package/dist/utils/localization/translations/bg-BG.json +1 -2
- package/dist/utils/localization/translations/cs.json +1 -2
- package/dist/utils/localization/translations/da-DK.json +1 -2
- package/dist/utils/localization/translations/de.json +1 -2
- package/dist/utils/localization/translations/el-GR.json +1 -2
- package/dist/utils/localization/translations/en.json +1 -2
- package/dist/utils/localization/translations/es.json +1 -2
- package/dist/utils/localization/translations/et-EE.json +1 -2
- package/dist/utils/localization/translations/fi-FI.json +1 -2
- package/dist/utils/localization/translations/fr-FR.json +1 -2
- package/dist/utils/localization/translations/fr.json +1 -2
- package/dist/utils/localization/translations/hu-HU.json +1 -2
- package/dist/utils/localization/translations/id.json +1 -2
- package/dist/utils/localization/translations/it.json +1 -2
- package/dist/utils/localization/translations/ja.json +1 -2
- package/dist/utils/localization/translations/ka-GE.json +1 -2
- package/dist/utils/localization/translations/ko-KR.json +1 -2
- package/dist/utils/localization/translations/lt-LT.json +1 -2
- package/dist/utils/localization/translations/lv-LV.json +1 -2
- package/dist/utils/localization/translations/ms.json +1 -2
- package/dist/utils/localization/translations/nb-NO.json +1 -2
- package/dist/utils/localization/translations/nl.json +1 -2
- package/dist/utils/localization/translations/pl.json +1 -2
- package/dist/utils/localization/translations/pt-BR.json +1 -2
- package/dist/utils/localization/translations/pt-PT.json +1 -2
- package/dist/utils/localization/translations/ro-RO.json +1 -2
- package/dist/utils/localization/translations/sk-SK.json +1 -2
- package/dist/utils/localization/translations/sv.json +1 -2
- package/dist/utils/localization/translations/th.json +1 -2
- package/dist/utils/localization/translations/tr.json +1 -2
- package/dist/utils/localization/translations/zh-Hans.json +1 -2
- package/dist/utils/localization/translations/zh-TW.json +1 -2
- package/dist/utils/positioningUtils/calculatePosition.js +11 -2
- package/dist/utils/positioningUtils/flipWhenNoRoom.d.ts +2 -0
- package/dist/{datePickerNew/utils → utils/positioningUtils}/flipWhenNoRoom.js +2 -2
- package/esm/banner/banner.d.ts +1 -0
- package/esm/banner/bannerMultipLine.js +3 -1
- package/esm/banner/bannerSingleLine.js +2 -0
- package/esm/calendar/calendarTypes.d.ts +5 -0
- package/esm/calendar/components/calendarGrid.d.ts +2 -2
- package/esm/calendar/components/calendarGrid.js +7 -2
- package/esm/calendar/hooks/useCalendar.d.ts +1 -1
- package/esm/calendar/hooks/useCalendar.js +44 -20
- package/esm/calendarNew/components/virtualMonthList/virtualMonthList.d.ts +4 -1
- package/esm/calendarNew/components/virtualMonthList/virtualMonthList.js +2 -2
- package/esm/card/card.d.ts +5 -0
- package/esm/card/card.js +6 -4
- package/esm/card/components/title.d.ts +4 -1
- package/esm/card/components/title.js +3 -3
- package/esm/chart/accessibleChart/accessibleChartTable.d.ts +1 -1
- package/esm/chart/accessibleChart/accessibleChartTable.js +29 -6
- package/esm/chart/accessibleChart/interfaces.d.ts +8 -2
- package/esm/chart/barChart.d.ts +3 -1
- package/esm/chart/barChart.js +5 -3
- package/esm/chart/lineChart.d.ts +3 -1
- package/esm/chart/lineChart.js +5 -3
- package/esm/chart/pieChart/pieLegendPlugin.js +3 -0
- package/esm/chart/pieChart/renderPieLegend.js +6 -4
- package/esm/chart/pieChart.d.ts +3 -1
- package/esm/chart/pieChart.js +5 -3
- package/esm/chart/plugins/legend/legendFocus.d.ts +2 -0
- package/esm/chart/plugins/legend/legendFocus.js +15 -0
- package/esm/chart/plugins/legend/legendPlugin.js +3 -0
- package/esm/chart/plugins/legend/renderLegend.js +9 -5
- package/esm/chart/utils/isEmptyDataPoint.d.ts +1 -0
- package/esm/chart/utils/isEmptyDataPoint.js +1 -0
- package/esm/checkboxListWithAction/checkboxListWithAction.d.ts +6 -0
- package/esm/checkboxListWithAction/checkboxListWithAction.js +129 -52
- package/esm/commonHelpers/hooks/useFormFieldValues/useFormFieldValues.d.ts +2 -1
- package/esm/commonHelpers/hooks/useFormFieldValues/useFormFieldValues.js +1 -0
- package/esm/commonHelpers/hooks/useMergedRef.d.ts +6 -0
- package/esm/commonHelpers/hooks/useMergedRef.js +33 -0
- package/esm/commonHelpers/hooks/useScroll.js +0 -1
- package/esm/commonStyles/colors/colorsConstant.d.ts +12 -0
- package/esm/commonStyles/colors/colorsConstant.js +88 -0
- package/esm/dataFeed/dataFeed.js +8 -5
- package/esm/dataGrid/cell/cell.d.ts +7 -1
- package/esm/dataGrid/cell/cell.js +8 -2
- package/esm/dataGrid/columns/mainColumn/mainColumnWrapper.d.ts +2 -0
- package/esm/dataGrid/columns/mainColumn/mainColumnWrapper.js +2 -2
- package/esm/dataGrid/dataGrid.d.ts +2 -1
- package/esm/dataGrid/dataGrid.js +32 -11
- package/esm/dataGrid/extensions/getStickyOffsets.d.ts +32 -0
- package/esm/dataGrid/extensions/getStickyOffsets.js +41 -0
- package/esm/dataGrid/headerCell/headerCell.d.ts +7 -1
- package/esm/dataGrid/headerCell/headerCell.js +5 -3
- package/esm/dataGrid/listColumn.d.ts +7 -0
- package/esm/dataGrid/row/row.d.ts +2 -2
- package/esm/dataGrid/row/row.js +12 -6
- package/esm/dateInputInner/components/template.d.ts +1 -1
- package/esm/dateInputInner/components/template.js +2 -0
- package/esm/dateInputInnerNew/components/template.d.ts +1 -1
- package/esm/dateInputInnerNew/components/template.js +3 -3
- package/esm/dateInputRawNew/components/template.js +1 -1
- package/esm/dateInputRawNew/components/trigger/trigger.d.ts +6 -2
- package/esm/dateInputRawNew/components/trigger/trigger.js +27 -8
- package/esm/dateInputRawNew/hooks/useDateInputRawNew.js +13 -4
- package/esm/datePickerCommon/hooks/useDateInputInner/dateInputInnerTypes.d.ts +2 -0
- package/esm/datePickerCommon/hooks/useDateInputInner/useDateInputInner.d.ts +1 -1
- package/esm/datePickerCommon/hooks/useDateInputInner/useDateInputInner.js +34 -10
- package/esm/datePickerCommon/hooks/useDateInputInner/useTodayButton.d.ts +2 -1
- package/esm/datePickerCommon/hooks/useDateInputInner/useTodayButton.js +11 -3
- package/esm/datePickerCommon/hooks/useDateInputRaw/dateInputRawBehavior.d.ts +5 -0
- package/esm/datePickerCommon/hooks/useDateInputRaw/dateInputRawBehavior.js +1 -0
- package/esm/datePickerCommon/hooks/useDateInputRaw/useDateInputRaw.js +4 -2
- package/esm/datePickerCommon/hooks/useDateRangeRaw/useDateRangeRawCore.d.ts +1 -7
- package/esm/datePickerCommon/hooks/useDateRangeRaw/useDateRangeRawCore.js +5 -5
- package/esm/datePickerCommon/types/dateInputInner.d.ts +2 -0
- package/esm/datePickerCommon/types/dateInputRaw.d.ts +11 -0
- package/esm/datePickerCommon/types/dateInputRawContext.d.ts +2 -1
- package/esm/datePickerCommon/utils/findEnabledDay.d.ts +6 -0
- package/esm/datePickerCommon/utils/findEnabledDay.js +15 -0
- package/esm/datePickerCommon/utils/getLimitsByPriority.d.ts +12 -0
- package/esm/datePickerCommon/utils/getLimitsByPriority.js +6 -0
- package/esm/datePickerCommon/utils/pickTabTarget.d.ts +5 -0
- package/esm/datePickerCommon/utils/pickTabTarget.js +16 -0
- package/esm/datePickerCommon/utils/resolveDisabledDate.d.ts +12 -0
- package/esm/datePickerCommon/utils/resolveDisabledDate.js +8 -0
- package/esm/datePickerNew/components/dateSegmentInput/dateSegmentInput.d.ts +2 -0
- package/esm/datePickerNew/components/dateSegmentInput/dateSegmentInput.js +2 -1
- package/esm/dateRangeRawNew/hooks/useDateRangeNewParts.d.ts +1 -7
- package/esm/dateRangeRawNew/hooks/useDateRangeNewParts.js +15 -24
- package/esm/dateRangeRawNew/hooks/useDateRangeRawNew.js +3 -3
- package/esm/dateRangeRawNew/hooks/useRangeEntry.js +4 -31
- package/esm/dropdownRaw/dropdownHelper.d.ts +10 -0
- package/esm/dropdownRaw/dropdownHelper.js +6 -2
- package/esm/dropdownRaw/dropdownPopup.js +2 -0
- package/esm/dropdownRaw/dropdownRaw.js +23 -9
- package/esm/dropdownRaw/dropdownSearchableTrigger.js +2 -3
- package/esm/dropdownRaw/types.d.ts +7 -0
- package/esm/fileUpload/components/filePreview.d.ts +15 -0
- package/esm/fileUpload/components/filePreview.js +263 -0
- package/esm/fileUpload/components/previewableFile.d.ts +16 -0
- package/esm/fileUpload/components/previewableFile.js +43 -0
- package/esm/fileUpload/components/resolveFileActions.d.ts +10 -0
- package/esm/fileUpload/components/resolveFileActions.js +7 -0
- package/esm/fileUpload/components/uploadedFilesSection.d.ts +9 -1
- package/esm/fileUpload/components/uploadedFilesSection.js +91 -16
- package/esm/fileUpload/components/useFilePreview.d.ts +12 -0
- package/esm/fileUpload/components/useFilePreview.js +81 -0
- package/esm/fileUpload/fileUpload.d.ts +1 -1
- package/esm/fileUpload/fileUpload.js +63 -2
- package/esm/fileUpload/fileUploadType.d.ts +35 -0
- package/esm/filters/components/filtersSearch.d.ts +3 -1
- package/esm/filters/components/filtersSearch.js +3 -3
- package/esm/filters/components/filtersSearchList.d.ts +3 -1
- package/esm/filters/components/filtersSearchList.js +6 -4
- package/esm/filters/components/filtersSidePanel.js +1 -1
- package/esm/filters/filters.d.ts +4 -0
- package/esm/filters/filters.js +10 -5
- package/esm/filtersBar/components/filtersBarDropdown/filtersBarDropdown.js +1 -2
- package/esm/filtersBar/components/filtersBarPeriodPicker/normalizeDates.js +1 -2
- package/esm/filtersBar/components/filtersBarSearch/filtersBarSearch.d.ts +1 -1
- package/esm/filtersBar/filtersBar.js +3 -1
- package/esm/filtersBar/filtersBarProvider.js +3 -5
- package/esm/filtersBar/filtersBarProviderSearch.js +4 -7
- package/esm/filtersBar/filtersBarProviderTrigger.js +5 -2
- package/esm/formSection/components/formSectionCard.js +1 -1
- package/esm/groupsFilterRaw/groupsFilterInterfaces.d.ts +2 -2
- package/esm/header/header.js +10 -6
- package/esm/header/headerContext.js +5 -2
- package/esm/icons/iconEngine.d.ts +3 -0
- package/esm/icons/iconEngine.js +8 -0
- package/esm/index.d.ts +3 -1
- package/esm/index.js +1 -1
- package/esm/inputAdornments/inputAdornments.d.ts +3 -1
- package/esm/inputAdornments/inputAdornments.js +2 -2
- package/esm/lineChartMini/lineChartMini.d.ts +3 -1
- package/esm/lineChartMini/lineChartMini.js +5 -3
- package/esm/list/listItem/listItem.js +10 -1
- package/esm/miniTabs/miniTabs.d.ts +2 -1
- package/esm/miniTabs/miniTabs.js +2 -2
- package/esm/miniTabs/miniTabsItem.js +1 -1
- package/esm/modal/modal.d.ts +2 -0
- package/esm/nav/nav.js +2 -4
- package/esm/pillExpandable/pillExpandable.js +0 -1
- package/esm/pillExpandable/pillExpandableSimple.js +1 -2
- package/esm/primaryIcon/primaryIcon.d.ts +3 -1
- package/esm/primaryIcon/primaryIcon.js +3 -3
- package/esm/searchInputRaw/searchInputRaw.js +4 -2
- package/esm/searchInputRaw/types.d.ts +2 -0
- package/esm/selectList/selectList.js +25 -1
- package/esm/selectList/selectListItem.d.ts +8 -1
- package/esm/selectList/selectListItem.js +277 -53
- package/esm/stepperRaw/stepperRaw.js +5 -2
- package/esm/stepperRaw/utils/onBeforeInput.js +6 -1
- package/esm/table/columnMenu/columnMenuHeader.d.ts +28 -0
- package/esm/table/columnMenu/columnMenuHeader.js +123 -0
- package/esm/table/columnMenu/useColumnMenu.d.ts +24 -0
- package/esm/table/columnMenu/useColumnMenu.js +57 -0
- package/esm/table/flexible/getDefaultSettings.d.ts +1 -0
- package/esm/table/flexible/getDefaultSettings.js +2 -1
- package/esm/table/flexible/interfaces.d.ts +7 -0
- package/esm/table/flexible/mergeColumnSettings.js +2 -1
- package/esm/table/flexible/useFlexibleColumns.d.ts +16 -0
- package/esm/table/flexible/useFlexibleColumns.js +123 -49
- package/esm/table/flexible/useSettingsStorage.d.ts +2 -1
- package/esm/table/loading/useLoading.d.ts +1 -0
- package/esm/table/nested/nestedData.js +4 -2
- package/esm/table/sortable/useSortableColumns.d.ts +1 -0
- package/esm/table/sortable/useSortableColumns.js +4 -1
- package/esm/table/table.d.ts +14 -1
- package/esm/table/table.js +16 -3
- package/esm/testHelpers/canadianNonWorkingDays.d.ts +9 -0
- package/esm/testHelpers/canadianNonWorkingDays.js +23 -0
- package/esm/testHelpers/holidayCountries.d.ts +39 -0
- package/esm/testHelpers/holidayCountries.js +107 -0
- package/esm/testHelpers/holidays.d.ts +9 -0
- package/esm/testHelpers/holidays.js +26 -0
- package/esm/testHelpers/newSouthWalesNonWorkingDays.d.ts +9 -0
- package/esm/testHelpers/newSouthWalesNonWorkingDays.js +19 -0
- package/esm/testHelpers/polishNonWorkingDays.d.ts +11 -0
- package/esm/testHelpers/polishNonWorkingDays.js +20 -0
- package/esm/testHelpers/renderAsync.d.ts +2 -1
- package/esm/textInputRaw/textInputRaw.js +5 -3
- package/esm/textInputRaw/types.d.ts +2 -0
- package/esm/textareaRaw/textareaRaw.js +4 -2
- package/esm/tooltip/tooltip.js +1 -2
- package/esm/utils/localization/translations/ar-001.json +1 -2
- package/esm/utils/localization/translations/bg-BG.json +1 -2
- package/esm/utils/localization/translations/cs.json +1 -2
- package/esm/utils/localization/translations/da-DK.json +1 -2
- package/esm/utils/localization/translations/de.json +1 -2
- package/esm/utils/localization/translations/el-GR.json +1 -2
- package/esm/utils/localization/translations/en.json +1 -2
- package/esm/utils/localization/translations/es.json +1 -2
- package/esm/utils/localization/translations/et-EE.json +1 -2
- package/esm/utils/localization/translations/fi-FI.json +1 -2
- package/esm/utils/localization/translations/fr-FR.json +1 -2
- package/esm/utils/localization/translations/fr.json +1 -2
- package/esm/utils/localization/translations/hu-HU.json +1 -2
- package/esm/utils/localization/translations/id.json +1 -2
- package/esm/utils/localization/translations/it.json +1 -2
- package/esm/utils/localization/translations/ja.json +1 -2
- package/esm/utils/localization/translations/ka-GE.json +1 -2
- package/esm/utils/localization/translations/ko-KR.json +1 -2
- package/esm/utils/localization/translations/lt-LT.json +1 -2
- package/esm/utils/localization/translations/lv-LV.json +1 -2
- package/esm/utils/localization/translations/ms.json +1 -2
- package/esm/utils/localization/translations/nb-NO.json +1 -2
- package/esm/utils/localization/translations/nl.json +1 -2
- package/esm/utils/localization/translations/pl.json +1 -2
- package/esm/utils/localization/translations/pt-BR.json +1 -2
- package/esm/utils/localization/translations/pt-PT.json +1 -2
- package/esm/utils/localization/translations/ro-RO.json +1 -2
- package/esm/utils/localization/translations/sk-SK.json +1 -2
- package/esm/utils/localization/translations/sv.json +1 -2
- package/esm/utils/localization/translations/th.json +1 -2
- package/esm/utils/localization/translations/tr.json +1 -2
- package/esm/utils/localization/translations/zh-Hans.json +1 -2
- package/esm/utils/localization/translations/zh-TW.json +1 -2
- package/esm/utils/positioningUtils/calculatePosition.js +11 -2
- package/esm/utils/positioningUtils/flipWhenNoRoom.d.ts +2 -0
- package/esm/{datePickerNew/utils → utils/positioningUtils}/flipWhenNoRoom.js +2 -2
- package/package.json +145 -158
- package/dist/datePickerNew/utils/flipWhenNoRoom.d.ts +0 -2
- package/esm/datePickerNew/utils/flipWhenNoRoom.d.ts +0 -2
package/README.md
CHANGED
|
@@ -47,6 +47,14 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
47
47
|
|
|
48
48
|
## Change log
|
|
49
49
|
|
|
50
|
+
### 3.18.0
|
|
51
|
+
|
|
52
|
+
- Add opt-in `fill` prop to `MiniTabs` so the tabs fill the available width
|
|
53
|
+
- Make chart legend items keyboard accessible
|
|
54
|
+
- Add `stepper` support to `Filters.DateRange` as a single pill around the chip; make the `Filters` side panel date range full width
|
|
55
|
+
- Add `data-xxxl` typography style (`zen-data-xxxl`)
|
|
56
|
+
- Focus the first invalid field when a React Hook Form submit fails in `TextInput`, `Textarea` and `Stepper` (including the `Raw` variants)
|
|
57
|
+
|
|
50
58
|
### 3.17.1
|
|
51
59
|
|
|
52
60
|
- Preserve filter names and show applied selection counts.
|
package/dist/banner/banner.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface IBannerAction {
|
|
|
9
9
|
target?: React.HTMLAttributeAnchorTarget;
|
|
10
10
|
onClick?: () => void;
|
|
11
11
|
text: string;
|
|
12
|
+
ariaLabel?: string;
|
|
12
13
|
}
|
|
13
14
|
export type BannerType = "error" | "info" | "success" | "warning";
|
|
14
15
|
export interface IBanner extends Partial<IZenIdComponentProps> {
|
|
@@ -56,6 +56,7 @@ const button_1 = require("../button/button");
|
|
|
56
56
|
const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
|
|
57
57
|
const react_1 = require("react");
|
|
58
58
|
const useNodeText_1 = require("../utils/useNodeText");
|
|
59
|
+
// eslint-disable-next-line complexity
|
|
59
60
|
const BannerMultiline = ({
|
|
60
61
|
children,
|
|
61
62
|
header,
|
|
@@ -70,7 +71,6 @@ const BannerMultiline = ({
|
|
|
70
71
|
primaryAction,
|
|
71
72
|
id,
|
|
72
73
|
className = ""
|
|
73
|
-
// eslint-disable-next-line complexity
|
|
74
74
|
}) => {
|
|
75
75
|
const bannerOptions = (0, bannerUtils_1.getBannerOptions)(type);
|
|
76
76
|
const {
|
|
@@ -142,6 +142,7 @@ const BannerMultiline = ({
|
|
|
142
142
|
link: action.link,
|
|
143
143
|
target: action.target,
|
|
144
144
|
onClick: action.onClick,
|
|
145
|
+
ariaLabel: action.ariaLabel,
|
|
145
146
|
children: action.text
|
|
146
147
|
}), primaryAction && (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
147
148
|
className: linkClasses,
|
|
@@ -149,6 +150,7 @@ const BannerMultiline = ({
|
|
|
149
150
|
link: primaryAction.link,
|
|
150
151
|
target: primaryAction.target,
|
|
151
152
|
onClick: primaryAction.onClick,
|
|
153
|
+
ariaLabel: primaryAction.ariaLabel,
|
|
152
154
|
children: primaryAction.text
|
|
153
155
|
})]
|
|
154
156
|
})]
|
|
@@ -111,6 +111,7 @@ const BannerSingleLine = ({
|
|
|
111
111
|
link: action.link,
|
|
112
112
|
target: action.target,
|
|
113
113
|
onClick: action.onClick,
|
|
114
|
+
ariaLabel: action.ariaLabel,
|
|
114
115
|
children: action.text
|
|
115
116
|
}), primaryAction && (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
116
117
|
className: linkClasses,
|
|
@@ -118,6 +119,7 @@ const BannerSingleLine = ({
|
|
|
118
119
|
link: primaryAction.link,
|
|
119
120
|
target: primaryAction.target,
|
|
120
121
|
onClick: primaryAction.onClick,
|
|
122
|
+
ariaLabel: primaryAction.ariaLabel,
|
|
121
123
|
children: primaryAction.text
|
|
122
124
|
})]
|
|
123
125
|
})]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC, KeyboardEvent, ReactNode, RefObject } from "react";
|
|
2
2
|
import { IZenComponentProps } from "../commonHelpers/zenComponent";
|
|
3
3
|
import { IIcon } from "../icons/icon";
|
|
4
|
+
import { TIsDateDisabled } from "../datePickerCommon/utils/resolveDisabledDate";
|
|
4
5
|
export interface ICalendarRange {
|
|
5
6
|
from?: string;
|
|
6
7
|
to?: string;
|
|
@@ -19,6 +20,8 @@ export interface ICalendar extends IZenComponentProps {
|
|
|
19
20
|
disablePastDates?: boolean;
|
|
20
21
|
disableDatesAfter?: string;
|
|
21
22
|
disableDatesBefore?: string;
|
|
23
|
+
/** Decides for each day whether it is disabled. When set, its answer is final and the four limits above are not used. */
|
|
24
|
+
isDateDisabled?: TIsDateDisabled;
|
|
22
25
|
dateRangeMode?: boolean;
|
|
23
26
|
startDayOfWeek?: number;
|
|
24
27
|
yearRange?: number;
|
|
@@ -79,6 +82,8 @@ export interface ICalendarContext {
|
|
|
79
82
|
handleFocusDateChange: (focusing?: boolean) => (date: string) => void;
|
|
80
83
|
handleTodayButtonClick: (e: unknown) => void;
|
|
81
84
|
isDisabledDay: (date: string) => boolean;
|
|
85
|
+
/** True when an `isDateDisabled` rule is set. Such a rule can disable days in the middle of a month, which the keys and Tab have to step over. */
|
|
86
|
+
hasDateRule?: boolean;
|
|
82
87
|
getBeforeDecorator: (date: string, isFirstDayOfMonth: boolean, isFirstDayOfWeek: boolean) => ReactNode;
|
|
83
88
|
getAfterDecorator: (date: string, isLastDayOfMonth: boolean, isLastDayOfWeek: boolean) => ReactNode;
|
|
84
89
|
translate: (key: string, params?: Record<string, string>) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICalendarContext } from "../calendarTypes";
|
|
2
|
-
type ICalendarGrid = Pick<ICalendarContext, "id" | "dates" | "monthStart" | "monthEnd" | "fromDate" | "toDate" | "hoverDate" | "rangePreview" | "previewRangeOnHover" | "focusDate" | "viewDate" | "dateRangeMode" | "isMobileView" | "isTabStop" | "currentActiveField" | "memoizedVisibleFocus" | "getDayOfWeek" | "fullDayLabels" | "isDisabledDay" | "onPointerDown" | "handleDateKeyDown" | "setHoverDate" | "handleFocusDateChange" | "getBeforeDecorator" | "getAfterDecorator" | "translate"> & {
|
|
2
|
+
type ICalendarGrid = Pick<ICalendarContext, "id" | "dates" | "monthStart" | "monthEnd" | "fromDate" | "toDate" | "hoverDate" | "rangePreview" | "previewRangeOnHover" | "focusDate" | "viewDate" | "dateRangeMode" | "isMobileView" | "isTabStop" | "currentActiveField" | "memoizedVisibleFocus" | "getDayOfWeek" | "fullDayLabels" | "isDisabledDay" | "hasDateRule" | "onPointerDown" | "handleDateKeyDown" | "setHoverDate" | "handleFocusDateChange" | "getBeforeDecorator" | "getAfterDecorator" | "translate"> & {
|
|
3
3
|
hideThead?: boolean;
|
|
4
4
|
hideOtherMonthDates?: boolean;
|
|
5
5
|
/** The day to mark as today, as a Date that reads as the user's wall clock; the browser's day when absent. */
|
|
@@ -7,5 +7,5 @@ type ICalendarGrid = Pick<ICalendarContext, "id" | "dates" | "monthStart" | "mon
|
|
|
7
7
|
/** A touch selects a day when released on it instead of when it lands, so scrolling the month list does not select. */
|
|
8
8
|
selectTouchOnRelease?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare const CalendarGrid: ({ id, dates, monthStart, monthEnd, fromDate, toDate, hoverDate, rangePreview, previewRangeOnHover, focusDate, viewDate, dateRangeMode, isMobileView, isTabStop, currentActiveField, memoizedVisibleFocus, getDayOfWeek, fullDayLabels, isDisabledDay, onPointerDown, handleDateKeyDown, setHoverDate, handleFocusDateChange, getBeforeDecorator, getAfterDecorator, translate, hideThead, hideOtherMonthDates, today, selectTouchOnRelease }: ICalendarGrid) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const CalendarGrid: ({ id, dates, monthStart, monthEnd, fromDate, toDate, hoverDate, rangePreview, previewRangeOnHover, focusDate, viewDate, dateRangeMode, isMobileView, isTabStop, currentActiveField, memoizedVisibleFocus, getDayOfWeek, fullDayLabels, isDisabledDay, hasDateRule, onPointerDown, handleDateKeyDown, setHoverDate, handleFocusDateChange, getBeforeDecorator, getAfterDecorator, translate, hideThead, hideOtherMonthDates, today, selectTouchOnRelease }: ICalendarGrid) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -4,6 +4,7 @@ exports.CalendarGrid = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const classNames_1 = require("../../commonHelpers/classNames/classNames");
|
|
6
6
|
const calendarUtils_1 = require("../calendarUtils");
|
|
7
|
+
const pickTabTarget_1 = require("../../datePickerCommon/utils/pickTabTarget");
|
|
7
8
|
const useTouchTap_1 = require("../hooks/useTouchTap");
|
|
8
9
|
const isPreviewEnd = (rangePreview, hoverDate, date, isOtherMonth, isActive) => {
|
|
9
10
|
if (!rangePreview || isOtherMonth || (date !== rangePreview.from && date !== rangePreview.to))
|
|
@@ -11,7 +12,7 @@ const isPreviewEnd = (rangePreview, hoverDate, date, isOtherMonth, isActive) =>
|
|
|
11
12
|
return !!rangePreview.outlineEnds || (date === hoverDate && !isActive);
|
|
12
13
|
};
|
|
13
14
|
const isTintedByItself = (isRangeMode, isRowEdge, isInRange, hasFade, isPreviewEndDay) => (isRangeMode && !isRowEdge && isInRange && !hasFade) || isPreviewEndDay;
|
|
14
|
-
const CalendarGrid = ({ id, dates, monthStart, monthEnd, fromDate, toDate, hoverDate, rangePreview, previewRangeOnHover, focusDate, viewDate, dateRangeMode, isMobileView, isTabStop, currentActiveField, memoizedVisibleFocus, getDayOfWeek, fullDayLabels, isDisabledDay, onPointerDown, handleDateKeyDown, setHoverDate, handleFocusDateChange, getBeforeDecorator, getAfterDecorator, translate, hideThead = false, hideOtherMonthDates = false, today, selectTouchOnRelease = false }) => {
|
|
15
|
+
const CalendarGrid = ({ id, dates, monthStart, monthEnd, fromDate, toDate, hoverDate, rangePreview, previewRangeOnHover, focusDate, viewDate, dateRangeMode, isMobileView, isTabStop, currentActiveField, memoizedVisibleFocus, getDayOfWeek, fullDayLabels, isDisabledDay, hasDateRule, onPointerDown, handleDateKeyDown, setHoverDate, handleFocusDateChange, getBeforeDecorator, getAfterDecorator, translate, hideThead = false, hideOtherMonthDates = false, today, selectTouchOnRelease = false }) => {
|
|
15
16
|
const touchTap = (0, useTouchTap_1.useTouchTap)(selectTouchOnRelease, onPointerDown);
|
|
16
17
|
const todayKey = (0, calendarUtils_1.toDateKey)(today !== null && today !== void 0 ? today : new Date());
|
|
17
18
|
const tintFrom = rangePreview ? rangePreview.from : fromDate;
|
|
@@ -19,6 +20,10 @@ const CalendarGrid = ({ id, dates, monthStart, monthEnd, fromDate, toDate, hover
|
|
|
19
20
|
// The day Tab reaches is the selected start, or, in a month the start is not in, the day the keyboard last moved to.
|
|
20
21
|
const isStartInGrid = !!fromDate && dates.some(week => week.includes(fromDate));
|
|
21
22
|
const tabTarget = fromDate && !isStartInGrid && focusDate ? focusDate : fromDate || viewDate;
|
|
23
|
+
// With a rule the browser can not focus a disabled day, so when the day Tab would reach is disabled it goes to the next enabled day of the month.
|
|
24
|
+
const monthDays = dates.flat().filter(day => day >= monthStart && day <= monthEnd);
|
|
25
|
+
const wantedTabDay = memoizedVisibleFocus ? tabTarget : monthDays.find(day => day.split("T")[0] === viewDate.split("T")[0]);
|
|
26
|
+
const ruleTabDay = hasDateRule && wantedTabDay ? (0, pickTabTarget_1.pickTabTarget)(monthDays, wantedTabDay, isDisabledDay) : undefined;
|
|
22
27
|
const getDayFlags = (date, index, weekIndex) => {
|
|
23
28
|
const isFirstDayOfWeek = index === 0;
|
|
24
29
|
const isLastDayOfWeek = index === 6;
|
|
@@ -31,7 +36,7 @@ const CalendarGrid = ({ id, dates, monthStart, monthEnd, fromDate, toDate, hover
|
|
|
31
36
|
isDisabled: isDisabledDay(date),
|
|
32
37
|
isActive: date === fromDate || date === toDate,
|
|
33
38
|
isReadyToChange: (date === fromDate && currentActiveField === "start") || (date === toDate && currentActiveField === "end"),
|
|
34
|
-
isFocusable: memoizedVisibleFocus ? date === tabTarget : date.split("T")[0] === viewDate.split("T")[0],
|
|
39
|
+
isFocusable: ruleTabDay ? date === ruleTabDay : memoizedVisibleFocus ? date === tabTarget : date.split("T")[0] === viewDate.split("T")[0],
|
|
35
40
|
isFirstDayOfWeek,
|
|
36
41
|
isLastDayOfWeek,
|
|
37
42
|
isFirstDayOfMonth: weekIndex === 0 && index === 0,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ICalendar, ICalendarContext } from "../calendarTypes";
|
|
2
|
-
export declare const useCalendar: ({ id, value, onChange, disableFutureDates, disablePastDates, disableDatesAfter, disableDatesBefore, dateRangeMode, startDayOfWeek, yearRange, isMobileView, onMobileMonthYearClick, isTabStop, onKeyboardNavigate, getCurrentActiveField, onTodayButtonClick, viewDate: controlledViewDate, onViewDateChange, hoverDate: controlledHoverDate, onHoverDateChange, swapOnConflict, previewRangeOnHover, previewRange }: ICalendar) => ICalendarContext;
|
|
2
|
+
export declare const useCalendar: ({ id, value, onChange, disableFutureDates: disableFutureDatesProp, disablePastDates: disablePastDatesProp, disableDatesAfter: disableDatesAfterProp, disableDatesBefore: disableDatesBeforeProp, isDateDisabled, dateRangeMode, startDayOfWeek, yearRange, isMobileView, onMobileMonthYearClick, isTabStop, onKeyboardNavigate, getCurrentActiveField, onTodayButtonClick, viewDate: controlledViewDate, onViewDateChange, hoverDate: controlledHoverDate, onHoverDateChange, swapOnConflict, previewRangeOnHover, previewRange }: ICalendar) => ICalendarContext;
|
|
@@ -11,6 +11,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
11
11
|
const react_1 = require("react");
|
|
12
12
|
const dateUtils_1 = require("../dateUtils");
|
|
13
13
|
const calendarUtils_1 = require("../calendarUtils");
|
|
14
|
+
const getLimitsByPriority_1 = require("../../datePickerCommon/utils/getLimitsByPriority");
|
|
15
|
+
const findEnabledDay_1 = require("../../datePickerCommon/utils/findEnabledDay");
|
|
16
|
+
const resolveDisabledDate_1 = require("../../datePickerCommon/utils/resolveDisabledDate");
|
|
14
17
|
const useLanguage_1 = require("../../utils/localization/useLanguage");
|
|
15
18
|
const useDriveClassName_1 = require("../../utils/theme/useDriveClassName");
|
|
16
19
|
const useDirectionalIcon_1 = require("../../utils/localization/useDirectionalIcon");
|
|
@@ -882,10 +885,11 @@ const useCalendar = ({
|
|
|
882
885
|
id,
|
|
883
886
|
value,
|
|
884
887
|
onChange,
|
|
885
|
-
disableFutureDates
|
|
886
|
-
disablePastDates
|
|
887
|
-
disableDatesAfter,
|
|
888
|
-
disableDatesBefore,
|
|
888
|
+
disableFutureDates: disableFutureDatesProp,
|
|
889
|
+
disablePastDates: disablePastDatesProp,
|
|
890
|
+
disableDatesAfter: disableDatesAfterProp,
|
|
891
|
+
disableDatesBefore: disableDatesBeforeProp,
|
|
892
|
+
isDateDisabled,
|
|
889
893
|
dateRangeMode = false,
|
|
890
894
|
startDayOfWeek,
|
|
891
895
|
yearRange,
|
|
@@ -904,6 +908,18 @@ const useCalendar = ({
|
|
|
904
908
|
previewRange
|
|
905
909
|
}) => {
|
|
906
910
|
var _a;
|
|
911
|
+
// The isDateDisabled callback has the highest priority: with it the limits are not used, not for the days and not for the years.
|
|
912
|
+
const {
|
|
913
|
+
disableFutureDates = false,
|
|
914
|
+
disablePastDates = false,
|
|
915
|
+
disableDatesAfter,
|
|
916
|
+
disableDatesBefore
|
|
917
|
+
} = (0, getLimitsByPriority_1.getLimitsByPriority)({
|
|
918
|
+
disableFutureDates: disableFutureDatesProp,
|
|
919
|
+
disablePastDates: disablePastDatesProp,
|
|
920
|
+
disableDatesAfter: disableDatesAfterProp,
|
|
921
|
+
disableDatesBefore: disableDatesBeforeProp
|
|
922
|
+
}, isDateDisabled);
|
|
907
923
|
const {
|
|
908
924
|
translate
|
|
909
925
|
} = (0, useLanguage_1.useLanguage)();
|
|
@@ -1082,6 +1098,18 @@ const useCalendar = ({
|
|
|
1082
1098
|
const newRangeOptions = (0, calendarUtils_1.getCalendarRange)(selectedDate, currentActiveField, isWrongPeriodFn, fromDate, toDate);
|
|
1083
1099
|
emit(newRangeOptions, currentActiveField);
|
|
1084
1100
|
}, [dateRangeMode, getCurrentActiveField, fromDate, toDate, onChange, handleFocusDateChange, setHoverDate, swapOnConflict, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter]);
|
|
1101
|
+
const isDisabledByLimits = (0, react_1.useCallback)(day => {
|
|
1102
|
+
const dateTime = day.getTime();
|
|
1103
|
+
const nowDateTime = new Date(now).getTime();
|
|
1104
|
+
return disableFutureDates && dateTime > nowDateTime || disablePastDates && dateTime < nowDateTime || (0, dateUtils_1.isDisableDate)(dateTime, disableDatesBefore, disableDatesAfter);
|
|
1105
|
+
}, [disableFutureDates, disablePastDates, now, disableDatesAfter, disableDatesBefore]);
|
|
1106
|
+
const isDisabledDay = (0, react_1.useCallback)(date => (0, resolveDisabledDate_1.resolveDisabledDate)(new Date(date), isDateDisabled, isDisabledByLimits), [isDateDisabled, isDisabledByLimits]);
|
|
1107
|
+
// The browser can not focus a disabled day, so with a rule that disables days in the middle of the month (weekends) a key moves on to
|
|
1108
|
+
// the next enabled day in its direction, and stays put when there is none. Without a rule the key goes to the day it names, as it always did.
|
|
1109
|
+
const moveFocus = (0, react_1.useCallback)((e, target, stepDays) => {
|
|
1110
|
+
const day = isDateDisabled ? (0, findEnabledDay_1.findEnabledDay)(target, stepDays, isDisabledDay) : target;
|
|
1111
|
+
if (day) (0, calendarUtils_1.setFocusTo)(e, day, handleFocusDateChange(true));else e.preventDefault();
|
|
1112
|
+
}, [isDateDisabled, isDisabledDay, handleFocusDateChange]);
|
|
1085
1113
|
const handleDateKeyDown = (0, react_1.useCallback)((e, isDisabled, date, isOtherMonth) => {
|
|
1086
1114
|
if (e.code === "Enter" || e.code === "Space") {
|
|
1087
1115
|
e.preventDefault();
|
|
@@ -1090,51 +1118,46 @@ const useCalendar = ({
|
|
|
1090
1118
|
}
|
|
1091
1119
|
if (NAVIGATION_CODES.includes(e.code)) onKeyboardNavigate === null || onKeyboardNavigate === void 0 ? void 0 : onKeyboardNavigate();
|
|
1092
1120
|
if (e.code === "ArrowLeft") {
|
|
1093
|
-
(
|
|
1121
|
+
moveFocus(e, (0, dateUtils_1.addDays)(new Date(date), -1).toISOString(), -1);
|
|
1094
1122
|
return;
|
|
1095
1123
|
}
|
|
1096
1124
|
if (e.code === "ArrowRight") {
|
|
1097
|
-
(
|
|
1125
|
+
moveFocus(e, (0, dateUtils_1.addDays)(new Date(date), 1).toISOString(), 1);
|
|
1098
1126
|
return;
|
|
1099
1127
|
}
|
|
1100
1128
|
if (e.code === "ArrowUp") {
|
|
1101
|
-
(
|
|
1129
|
+
moveFocus(e, (0, dateUtils_1.addDays)(new Date(date), -7).toISOString(), -7);
|
|
1102
1130
|
return;
|
|
1103
1131
|
}
|
|
1104
1132
|
if (e.code === "ArrowDown") {
|
|
1105
|
-
(
|
|
1133
|
+
moveFocus(e, (0, dateUtils_1.addDays)(new Date(date), 7).toISOString(), 7);
|
|
1106
1134
|
return;
|
|
1107
1135
|
}
|
|
1108
1136
|
if (e.code === "Home") {
|
|
1109
|
-
(
|
|
1137
|
+
moveFocus(e, (0, dateUtils_1.getStartOfWeek)(date), 1);
|
|
1110
1138
|
return;
|
|
1111
1139
|
}
|
|
1112
1140
|
if (e.code === "End") {
|
|
1113
|
-
(
|
|
1141
|
+
moveFocus(e, (0, dateUtils_1.getEndOfWeek)(date), -1);
|
|
1114
1142
|
return;
|
|
1115
1143
|
}
|
|
1116
1144
|
if (e.code === "PageUp" && e.shiftKey) {
|
|
1117
|
-
(
|
|
1145
|
+
moveFocus(e, (0, dateUtils_1.getSameDateOrTheLastForMonth)(date, -12), -1);
|
|
1118
1146
|
return;
|
|
1119
1147
|
}
|
|
1120
1148
|
if (e.code === "PageDown" && e.shiftKey) {
|
|
1121
|
-
(
|
|
1149
|
+
moveFocus(e, (0, dateUtils_1.getSameDateOrTheLastForMonth)(date, 12), 1);
|
|
1122
1150
|
return;
|
|
1123
1151
|
}
|
|
1124
1152
|
if (e.code === "PageUp") {
|
|
1125
|
-
(
|
|
1153
|
+
moveFocus(e, (0, dateUtils_1.getSameDateOrTheLastForMonth)(date, -1), -1);
|
|
1126
1154
|
return;
|
|
1127
1155
|
}
|
|
1128
1156
|
if (e.code === "PageDown") {
|
|
1129
|
-
(
|
|
1157
|
+
moveFocus(e, (0, dateUtils_1.getSameDateOrTheLastForMonth)(date, 1), 1);
|
|
1130
1158
|
return;
|
|
1131
1159
|
}
|
|
1132
|
-
}, [selectionHandler,
|
|
1133
|
-
const isDisabledDay = (0, react_1.useCallback)(date => {
|
|
1134
|
-
const dateTime = new Date(date).getTime();
|
|
1135
|
-
const nowDateTime = new Date(now).getTime();
|
|
1136
|
-
return disableFutureDates && dateTime > nowDateTime || disablePastDates && dateTime < nowDateTime || (0, dateUtils_1.isDisableDate)(dateTime, disableDatesBefore, disableDatesAfter);
|
|
1137
|
-
}, [disableFutureDates, disablePastDates, now, disableDatesAfter, disableDatesBefore]);
|
|
1160
|
+
}, [selectionHandler, moveFocus, onKeyboardNavigate]);
|
|
1138
1161
|
const onPointerDown = (0, react_1.useCallback)((date, isOtherMonth) => {
|
|
1139
1162
|
var _a;
|
|
1140
1163
|
// The press does not move the browser's focus, so the day the keyboard was on would keep its outline.
|
|
@@ -1262,6 +1285,7 @@ const useCalendar = ({
|
|
|
1262
1285
|
handleFocusDateChange,
|
|
1263
1286
|
handleTodayButtonClick,
|
|
1264
1287
|
isDisabledDay,
|
|
1288
|
+
hasDateRule: !!isDateDisabled,
|
|
1265
1289
|
getBeforeDecorator,
|
|
1266
1290
|
getAfterDecorator,
|
|
1267
1291
|
translate,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./virtualMonthList.less";
|
|
2
2
|
import { ICalendarRange } from "../../../calendar/calendarTypes";
|
|
3
3
|
import { IMonthListScrollTrigger } from "./hooks/useMonthListScroll";
|
|
4
|
+
import { TIsDateDisabled } from "../../../datePickerCommon/utils/resolveDisabledDate";
|
|
4
5
|
interface IVirtualMonthListProps {
|
|
5
6
|
id: string;
|
|
6
7
|
range: ICalendarRange;
|
|
@@ -13,6 +14,8 @@ interface IVirtualMonthListProps {
|
|
|
13
14
|
disablePastDates?: boolean;
|
|
14
15
|
disableDatesBefore?: string;
|
|
15
16
|
disableDatesAfter?: string;
|
|
17
|
+
/** Decides for each day whether it is disabled. When set, its answer is final and the four limits above are not used. */
|
|
18
|
+
isDateDisabled?: TIsDateDisabled;
|
|
16
19
|
scrollTrigger?: IMonthListScrollTrigger;
|
|
17
20
|
/** Defaults to range selection; pass false for a single-date list. */
|
|
18
21
|
dateRangeMode?: boolean;
|
|
@@ -26,5 +29,5 @@ interface IVirtualMonthListProps {
|
|
|
26
29
|
/** Called when a key is about to move the focus to another day. */
|
|
27
30
|
onKeyboardNavigate?: () => void;
|
|
28
31
|
}
|
|
29
|
-
export declare const VirtualMonthList: ({ id, range, startDayOfWeek, onChange, hoverDate, onHoverDateChange, getCurrentActiveField, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter, scrollTrigger, dateRangeMode, previewRangeOnHover, previewRange, onKeyboardNavigate }: IVirtualMonthListProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare const VirtualMonthList: ({ id, range, startDayOfWeek, onChange, hoverDate, onHoverDateChange, getCurrentActiveField, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter, isDateDisabled, scrollTrigger, dateRangeMode, previewRangeOnHover, previewRange, onKeyboardNavigate }: IVirtualMonthListProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
33
|
export {};
|
|
@@ -10,7 +10,7 @@ const zen_1 = require("../../../utils/zen");
|
|
|
10
10
|
const SCROLL_SETTLE_MS = 150;
|
|
11
11
|
const MAX_SCROLL_RETRIES = 3;
|
|
12
12
|
const getMonthKey = (m) => m instanceof Date ? `${m.getFullYear()}-${m.getMonth()}` : `${m.year}-${m.month}`;
|
|
13
|
-
const VirtualMonthList = ({ id, range, startDayOfWeek, onChange, hoverDate, onHoverDateChange, getCurrentActiveField, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter, scrollTrigger, dateRangeMode = true, previewRangeOnHover, previewRange, onKeyboardNavigate }) => {
|
|
13
|
+
const VirtualMonthList = ({ id, range, startDayOfWeek, onChange, hoverDate, onHoverDateChange, getCurrentActiveField, disableFutureDates, disablePastDates, disableDatesBefore, disableDatesAfter, isDateDisabled, scrollTrigger, dateRangeMode = true, previewRangeOnHover, previewRange, onKeyboardNavigate }) => {
|
|
14
14
|
var _a;
|
|
15
15
|
const { visibleMonths, totalHeight, scrollRef, onScroll, navigateTo } = (0, useVirtualMonths_1.useVirtualMonths)(startDayOfWeek, range.from, disableDatesBefore, disableDatesAfter);
|
|
16
16
|
// The list is one Tab stop: its days and titles are reached with the arrow keys, so Tab goes on to what follows the list. The stop
|
|
@@ -86,6 +86,6 @@ const VirtualMonthList = ({ id, range, startDayOfWeek, onChange, hoverDate, onHo
|
|
|
86
86
|
const handleMonthYearClose = (0, react_1.useCallback)(() => {
|
|
87
87
|
setMonthYearPicker(null);
|
|
88
88
|
}, []);
|
|
89
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { ref: scrollRef, className: "zen-virtual-month-list", onScroll: handleScroll, onPointerDown: releaseMonthToFocus, onKeyDown: releaseMonthToFocus, children: (0, jsx_runtime_1.jsx)("div", { style: { height: totalHeight, position: "relative" }, children: visibleMonths.map(({ year, month, offsetY, viewDate }) => ((0, jsx_runtime_1.jsx)("div", { className: "zen-virtual-month-list__month", style: { position: "absolute", top: offsetY, left: 0, right: 0 }, onFocus: () => setTabMonth(getMonthKey({ year, month })), "data-month": getMonthKey({ year, month }), children: (0, jsx_runtime_1.jsx)(calendarNew_1.CalendarNew, { hideOtherMonthDates: true, hideNav: true, hideMobileDayLabels: true, isMobileView: true, isTabStop: getMonthKey({ year, month }) === tabStopMonth, onMobileMonthYearClick: handleMobileMonthYearClick, id: `${id}-${year}-${month}`, value: range, onChange: onChange, dateRangeMode: dateRangeMode, disableFutureDates: disableFutureDates, disablePastDates: disablePastDates, disableDatesAfter: disableDatesAfter, disableDatesBefore: disableDatesBefore, startDayOfWeek: startDayOfWeek, viewDate: viewDate, onViewDateChange: handleViewDateChange, hoverDate: hoverDate, onHoverDateChange: onHoverDateChange, getCurrentActiveField: getCurrentActiveField, previewRangeOnHover: previewRangeOnHover, previewRange: previewRange, onKeyboardNavigate: onKeyboardNavigate }) }, `${year}-${month}`))) }) }), monthYearPicker && ((0, jsx_runtime_1.jsx)(mobileMonthYearPicker_1.MobileMonthYearPicker, { month: monthYearPicker.month, year: monthYearPicker.year, onDone: handleMonthYearDone, onClose: handleMonthYearClose }))] }));
|
|
89
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { ref: scrollRef, className: "zen-virtual-month-list", onScroll: handleScroll, onPointerDown: releaseMonthToFocus, onKeyDown: releaseMonthToFocus, children: (0, jsx_runtime_1.jsx)("div", { style: { height: totalHeight, position: "relative" }, children: visibleMonths.map(({ year, month, offsetY, viewDate }) => ((0, jsx_runtime_1.jsx)("div", { className: "zen-virtual-month-list__month", style: { position: "absolute", top: offsetY, left: 0, right: 0 }, onFocus: () => setTabMonth(getMonthKey({ year, month })), "data-month": getMonthKey({ year, month }), children: (0, jsx_runtime_1.jsx)(calendarNew_1.CalendarNew, { hideOtherMonthDates: true, hideNav: true, hideMobileDayLabels: true, isMobileView: true, isTabStop: getMonthKey({ year, month }) === tabStopMonth, onMobileMonthYearClick: handleMobileMonthYearClick, id: `${id}-${year}-${month}`, value: range, onChange: onChange, dateRangeMode: dateRangeMode, disableFutureDates: disableFutureDates, disablePastDates: disablePastDates, disableDatesAfter: disableDatesAfter, disableDatesBefore: disableDatesBefore, isDateDisabled: isDateDisabled, startDayOfWeek: startDayOfWeek, viewDate: viewDate, onViewDateChange: handleViewDateChange, hoverDate: hoverDate, onHoverDateChange: onHoverDateChange, getCurrentActiveField: getCurrentActiveField, previewRangeOnHover: previewRangeOnHover, previewRange: previewRange, onKeyboardNavigate: onKeyboardNavigate }) }, `${year}-${month}`))) }) }), monthYearPicker && ((0, jsx_runtime_1.jsx)(mobileMonthYearPicker_1.MobileMonthYearPicker, { month: monthYearPicker.month, year: monthYearPicker.year, onDone: handleMonthYearDone, onClose: handleMonthYearClose }))] }));
|
|
90
90
|
};
|
|
91
91
|
exports.VirtualMonthList = VirtualMonthList;
|
package/dist/card/card.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FC, FunctionComponent, ReactNode } from "react";
|
|
2
|
+
import type { Ref } from "react";
|
|
2
3
|
import { IAbsoluteSize, TContainerSize } from "../cardContainer/cardContainer";
|
|
3
4
|
import { TCardStatus } from "./components/status";
|
|
4
5
|
import { THeadingTag, TIconType } from "./components/title";
|
|
@@ -28,6 +29,10 @@ export interface ICard extends IZenComponentProps, IZenGridItem, IZenFormLayoutI
|
|
|
28
29
|
link?: string;
|
|
29
30
|
target?: React.HTMLAttributeAnchorTarget;
|
|
30
31
|
onClick?: () => void;
|
|
32
|
+
/** Ref to the interactive title when it is a button or link. */
|
|
33
|
+
titleRef?: Ref<HTMLElement>;
|
|
34
|
+
/** Sets `data-role` on a clickable title for SidePanel or ControlledPopup. */
|
|
35
|
+
dataRole?: "dialog" | "menu" | "listbox" | "tree" | "grid" | "true";
|
|
31
36
|
/**
|
|
32
37
|
* @deprecated
|
|
33
38
|
* @param date - will be removed in the next major release
|
package/dist/card/card.js
CHANGED
|
@@ -114,9 +114,7 @@ const toggleButton_1 = require("../toggleButton/toggleButton");
|
|
|
114
114
|
const useMobileClassName_1 = require("../utils/theme/useMobileClassName");
|
|
115
115
|
exports.DEFAULT_CARD_SIZE = "S";
|
|
116
116
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
117
|
-
const Card =
|
|
118
|
-
// eslint-disable-next-line complexity
|
|
119
|
-
props => {
|
|
117
|
+
const Card = props => {
|
|
120
118
|
const {
|
|
121
119
|
id,
|
|
122
120
|
size,
|
|
@@ -132,6 +130,8 @@ props => {
|
|
|
132
130
|
link,
|
|
133
131
|
target,
|
|
134
132
|
onClick,
|
|
133
|
+
titleRef,
|
|
134
|
+
dataRole,
|
|
135
135
|
cardContentClasses = "",
|
|
136
136
|
tooltipAlignment,
|
|
137
137
|
fullWidth,
|
|
@@ -299,7 +299,9 @@ props => {
|
|
|
299
299
|
title: title,
|
|
300
300
|
icon: titleIcon,
|
|
301
301
|
iconType: titleIconType,
|
|
302
|
-
titleAs: titleAs
|
|
302
|
+
titleAs: titleAs,
|
|
303
|
+
titleRef: titleRef,
|
|
304
|
+
dataRole: dataRole
|
|
303
305
|
}), (0, jsx_runtime_1.jsxs)("div", {
|
|
304
306
|
className: "zen-card__header-right",
|
|
305
307
|
children: [!!headerActions.length && headerActions, date ? (0, jsx_runtime_1.jsx)("span", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent } from "react";
|
|
2
|
+
import type { Ref } from "react";
|
|
2
3
|
import "./title.less";
|
|
3
4
|
import { IIcon } from "../../icons/icon";
|
|
4
5
|
export type TIconType = "info" | "warning" | "error" | "success" | "default";
|
|
@@ -14,6 +15,8 @@ interface ITitle {
|
|
|
14
15
|
iconType?: TIconType;
|
|
15
16
|
onClick?: () => void;
|
|
16
17
|
titleAs?: THeadingTag;
|
|
18
|
+
titleRef?: Ref<HTMLElement>;
|
|
19
|
+
dataRole?: "dialog" | "menu" | "listbox" | "tree" | "grid" | "true";
|
|
17
20
|
}
|
|
18
|
-
export declare const Title: ({ isMobile, link, target, title, id, icon, iconType, className, onClick, titleAs }: ITitle) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const Title: ({ isMobile, link, target, title, id, icon, iconType, className, onClick, titleAs, titleRef, dataRole }: ITitle) => import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
export {};
|
|
@@ -10,7 +10,7 @@ const iconChevronRightSmall_1 = require("../../icons/iconChevronRightSmall");
|
|
|
10
10
|
const iconChevronLeftSmall_1 = require("../../icons/iconChevronLeftSmall");
|
|
11
11
|
const useDirectionalIcon_1 = require("../../utils/localization/useDirectionalIcon");
|
|
12
12
|
const VALID_HEADING_TAGS = new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
13
|
-
const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick, titleAs }) => {
|
|
13
|
+
const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick, titleAs, titleRef, dataRole }) => {
|
|
14
14
|
const driveClassNames = (0, useDriveClassName_1.useDriveClassName)("zen-card-title");
|
|
15
15
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
16
16
|
const iconClassName = iconType ? `zen-card-title__icon--${iconType}` : "";
|
|
@@ -20,10 +20,10 @@ const Title = ({ isMobile, link, target, title, id, icon, iconType, className =
|
|
|
20
20
|
const chevron = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)("span", { className: "zen-card-title__link-chevron", children: (0, jsx_runtime_1.jsx)(ChevronIcon, { size: iconSize, className: "zen-card-title__chevron-icon" }) })), [ChevronIcon, iconSize]);
|
|
21
21
|
const titleClasses = (0, classNames_1.classNames)(["zen-card-title", driveClassNames || "", onClick ? "zen-card-title__clickable" : ""]);
|
|
22
22
|
if (onClick) {
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", className: titleClasses, onClick: onClick, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: [title, chevron] })] }));
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", className: titleClasses, onClick: onClick, ref: titleRef, "data-role": dataRole, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: [title, chevron] })] }));
|
|
24
24
|
}
|
|
25
25
|
if (link) {
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)("a", { id: id, className: titleClasses, href: link, target: target, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, className: (0, classNames_1.classNames)(["zen-card-title__link-text"]), children: [title, chevron] })] }));
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)("a", { id: id, className: titleClasses, href: link, target: target, ref: titleRef, "data-role": dataRole, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, className: (0, classNames_1.classNames)(["zen-card-title__link-text"]), children: [title, chevron] })] }));
|
|
27
27
|
}
|
|
28
28
|
const tag = titleAs && VALID_HEADING_TAGS.has(titleAs) ? titleAs : "div";
|
|
29
29
|
return (0, react_1.createElement)(tag, { className: titleClasses }, iconElement, (0, jsx_runtime_1.jsx)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: title }, "text"));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IAccessibleChart } from "./interfaces";
|
|
2
|
-
export declare const AccessibleChartTable: ({ type, data, options }: IAccessibleChart) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const AccessibleChartTable: ({ type, data, options, accessibility }: IAccessibleChart) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,6 +14,7 @@ const userFormatContext_1 = require("../../utils/userFormat/userFormatContext");
|
|
|
14
14
|
const formatDate_1 = require("../../utils/formatDate");
|
|
15
15
|
const resampleArrayEvenly_1 = require("../utils/resampleArrayEvenly");
|
|
16
16
|
const isDateString_1 = require("../utils/isDateString");
|
|
17
|
+
const isEmptyDataPoint_1 = require("../utils/isEmptyDataPoint");
|
|
17
18
|
const getFormattedLabel_1 = require("../utils/getFormattedLabel");
|
|
18
19
|
const truncateDecimals_1 = require("../../utils/truncateDecimals");
|
|
19
20
|
const calculateMinTruncationPrecision_1 = require("../utils/calculateMinTruncationPrecision");
|
|
@@ -215,8 +216,10 @@ const getYLabels = (type, data) => {
|
|
|
215
216
|
const AccessibleChartTable = ({
|
|
216
217
|
type,
|
|
217
218
|
data,
|
|
218
|
-
options
|
|
219
|
+
options,
|
|
220
|
+
accessibility
|
|
219
221
|
}) => {
|
|
222
|
+
const renderTableCell = accessibility === null || accessibility === void 0 ? void 0 : accessibility.renderTableCell;
|
|
220
223
|
const {
|
|
221
224
|
translate
|
|
222
225
|
} = (0, useLanguage_1.useLanguage)();
|
|
@@ -293,11 +296,20 @@ const AccessibleChartTable = ({
|
|
|
293
296
|
const dsXKey = ds.x instanceof Date ? ds.x.toISOString() : ds.x.toString();
|
|
294
297
|
return dsXKey === yLabel.toString();
|
|
295
298
|
});
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
299
|
+
if (!matchingDataPoint) {
|
|
300
|
+
return (0, jsx_runtime_1.jsx)("td", {
|
|
301
|
+
children: "-"
|
|
302
|
+
}, dsIndex);
|
|
300
303
|
}
|
|
304
|
+
if (renderTableCell) {
|
|
305
|
+
// Same index the tooltip uses: trend datasets stay in the count, filteredDatasets drops them
|
|
306
|
+
const datasetIndex = data.datasets.indexOf(dataset);
|
|
307
|
+
return (0, jsx_runtime_1.jsx)("td", {
|
|
308
|
+
children: (0, isEmptyDataPoint_1.isEmptyDataPoint)(matchingDataPoint.y) ? "-" : renderTableCell(matchingDataPoint, datasetIndex, dataset)
|
|
309
|
+
}, dsIndex);
|
|
310
|
+
}
|
|
311
|
+
const yValue = matchingDataPoint.y;
|
|
312
|
+
const cellContent = typeof yValue === "number" ? (0, truncateDecimals_1.truncateDecimals)(yValue, datasetDecimalPlaces) : yValue;
|
|
301
313
|
return (0, jsx_runtime_1.jsx)("td", {
|
|
302
314
|
children: cellContent
|
|
303
315
|
}, dsIndex);
|
|
@@ -309,6 +321,11 @@ const AccessibleChartTable = ({
|
|
|
309
321
|
}), data.datasets.map((dataset, dsIndex) => {
|
|
310
322
|
const yValue = dataset.data[yIndex];
|
|
311
323
|
const datasetDecimalPlaces = decimalPlacesPerDataset.get(dsIndex);
|
|
324
|
+
if (renderTableCell) {
|
|
325
|
+
return (0, jsx_runtime_1.jsx)("td", {
|
|
326
|
+
children: (0, isEmptyDataPoint_1.isEmptyDataPoint)(yValue) ? "" : renderTableCell(yValue, dsIndex, dataset)
|
|
327
|
+
}, dsIndex);
|
|
328
|
+
}
|
|
312
329
|
return (0, jsx_runtime_1.jsx)("td", {
|
|
313
330
|
children: typeof yValue === "number" ? (0, truncateDecimals_1.truncateDecimals)(yValue, datasetDecimalPlaces) : yValue
|
|
314
331
|
}, dsIndex);
|
|
@@ -319,8 +336,14 @@ const AccessibleChartTable = ({
|
|
|
319
336
|
children: yLabel.toString()
|
|
320
337
|
}), data.datasets.map((dataset, dsIndex) => {
|
|
321
338
|
var _a;
|
|
322
|
-
const y = (_a = dataset.data[yIndex]) === null || _a === void 0 ? void 0 : _a.y;
|
|
323
339
|
const datasetDecimalPlaces = decimalPlacesPerDataset.get(dsIndex);
|
|
340
|
+
if (renderTableCell) {
|
|
341
|
+
const dataPoint = dataset.data[yIndex];
|
|
342
|
+
return (0, jsx_runtime_1.jsx)("td", {
|
|
343
|
+
children: (0, isEmptyDataPoint_1.isEmptyDataPoint)(dataPoint) ? "" : renderTableCell(dataPoint, dsIndex, dataset)
|
|
344
|
+
}, dsIndex);
|
|
345
|
+
}
|
|
346
|
+
const y = (_a = dataset.data[yIndex]) === null || _a === void 0 ? void 0 : _a.y;
|
|
324
347
|
const yValue = typeof y === "number" ? (0, truncateDecimals_1.truncateDecimals)(y, datasetDecimalPlaces) : y || "";
|
|
325
348
|
return (0, jsx_runtime_1.jsx)("td", {
|
|
326
349
|
children: yValue
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
1
2
|
import { ChartData, ChartDataset } from "chart.js";
|
|
2
3
|
import { IBarChartData, IBarChartDataset, IBarChartOptions, IBarChartPoint } from "../barChart/interfaces";
|
|
3
4
|
import { ILineChartData, ILineChartDataset, ILineChartOptions, ILineChartPoint } from "../lineChart/interfaces";
|
|
4
|
-
import { IPieChartData } from "../pieChart/interfaces";
|
|
5
|
+
import { IPieChartData, IPieChartDataset } from "../pieChart/interfaces";
|
|
5
6
|
import { BarChartType, LineChartType, PieChartType } from "../chart";
|
|
6
7
|
export type AccessibleChartData = ILineChartData | IBarChartData | IPieChartData | ChartData<"line">;
|
|
7
8
|
export type AccessibleChartType = LineChartType | BarChartType | PieChartType | "line-mini";
|
|
8
|
-
export type AccessibleChartDataset = ILineChartDataset | IBarChartDataset | ChartDataset<"line"
|
|
9
|
+
export type AccessibleChartDataset = ILineChartDataset | IBarChartDataset | ChartDataset<"line"> | IPieChartDataset;
|
|
10
|
+
export type AccessibleTableCellRenderer = (dataPoint: ILineChartPoint | IBarChartPoint | number, datasetIndex: number, dataset: AccessibleChartDataset) => ReactNode;
|
|
11
|
+
export interface IChartAccessibilityOptions {
|
|
12
|
+
renderTableCell?: AccessibleTableCellRenderer;
|
|
13
|
+
}
|
|
9
14
|
export interface IAccessibleChart {
|
|
10
15
|
data: AccessibleChartData;
|
|
11
16
|
type: AccessibleChartType;
|
|
12
17
|
options?: ILineChartOptions | IBarChartOptions;
|
|
13
18
|
narrativeId?: string;
|
|
19
|
+
accessibility?: IChartAccessibilityOptions;
|
|
14
20
|
}
|
|
15
21
|
export interface IChartTrend {
|
|
16
22
|
trendDirection: "increases" | "decreases" | "flat" | "complex" | "undefined";
|
package/dist/chart/barChart.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { ILegendOptions } from "./plugins/legend/interfaces";
|
|
|
8
8
|
import { ITooltipOptions } from "./plugins/tooltip/interfaces";
|
|
9
9
|
import { IChartInsight } from "./chartInsight/chartInsight";
|
|
10
10
|
import { IChartSummary } from "./interfaces";
|
|
11
|
+
import { IChartAccessibilityOptions } from "./accessibleChart/interfaces";
|
|
11
12
|
export interface IBarChart extends IZenComponentProps {
|
|
12
13
|
data: IBarChartData;
|
|
13
14
|
options?: IBarChartOptions;
|
|
@@ -17,5 +18,6 @@ export interface IBarChart extends IZenComponentProps {
|
|
|
17
18
|
insight?: IChartInsight | false;
|
|
18
19
|
summary?: IChartSummary | false;
|
|
19
20
|
plugins?: Plugin<"bar">[];
|
|
21
|
+
accessibility?: IChartAccessibilityOptions;
|
|
20
22
|
}
|
|
21
|
-
export declare const BarChart: ({ data, options, axis, insight, summary, legend, tooltip, plugins, className, ...rest }: IBarChart) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const BarChart: ({ data, options, axis, insight, summary, legend, tooltip, plugins, className, accessibility, ...rest }: IBarChart) => import("react/jsx-runtime").JSX.Element;
|
package/dist/chart/barChart.js
CHANGED
|
@@ -86,9 +86,10 @@ const BarChart = _a => {
|
|
|
86
86
|
legend,
|
|
87
87
|
tooltip,
|
|
88
88
|
plugins,
|
|
89
|
-
className
|
|
89
|
+
className,
|
|
90
|
+
accessibility
|
|
90
91
|
} = _a,
|
|
91
|
-
rest = __rest(_a, ["data", "options", "axis", "insight", "summary", "legend", "tooltip", "plugins", "className"]);
|
|
92
|
+
rest = __rest(_a, ["data", "options", "axis", "insight", "summary", "legend", "tooltip", "plugins", "className", "accessibility"]);
|
|
92
93
|
const {
|
|
93
94
|
translate
|
|
94
95
|
} = (0, useLanguage_1.useLanguage)();
|
|
@@ -177,7 +178,8 @@ const BarChart = _a => {
|
|
|
177
178
|
type: "bar",
|
|
178
179
|
data: chartData,
|
|
179
180
|
options: chartOptions,
|
|
180
|
-
narrativeId: narrativeId
|
|
181
|
+
narrativeId: narrativeId,
|
|
182
|
+
accessibility: accessibility
|
|
181
183
|
})]
|
|
182
184
|
});
|
|
183
185
|
};
|
|
@@ -8,6 +8,7 @@ import { ILegendOptions } from "./plugins/legend/interfaces";
|
|
|
8
8
|
import { ILineOptions } from "./plugins/linePlugin/interfaces";
|
|
9
9
|
import { IChartInsight } from "./chartInsight/chartInsight";
|
|
10
10
|
import { IChartSummary } from "./interfaces";
|
|
11
|
+
import { IChartAccessibilityOptions } from "./accessibleChart/interfaces";
|
|
11
12
|
export interface ILineChart extends IZenComponentProps {
|
|
12
13
|
data: ILineChartData;
|
|
13
14
|
options?: ILineChartOptions;
|
|
@@ -17,5 +18,6 @@ export interface ILineChart extends IZenComponentProps {
|
|
|
17
18
|
summary?: IChartSummary | false;
|
|
18
19
|
tooltip?: ILineOptions | false;
|
|
19
20
|
plugins?: Plugin<"line">[];
|
|
21
|
+
accessibility?: IChartAccessibilityOptions;
|
|
20
22
|
}
|
|
21
|
-
export declare const LineChart: ({ data, options, axis, insight, summary, legend, tooltip, plugins, className, ...rest }: ILineChart) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const LineChart: ({ data, options, axis, insight, summary, legend, tooltip, plugins, className, accessibility, ...rest }: ILineChart) => import("react/jsx-runtime").JSX.Element;
|
package/dist/chart/lineChart.js
CHANGED
|
@@ -89,9 +89,10 @@ const LineChart = _a => {
|
|
|
89
89
|
legend,
|
|
90
90
|
tooltip,
|
|
91
91
|
plugins,
|
|
92
|
-
className
|
|
92
|
+
className,
|
|
93
|
+
accessibility
|
|
93
94
|
} = _a,
|
|
94
|
-
rest = __rest(_a, ["data", "options", "axis", "insight", "summary", "legend", "tooltip", "plugins", "className"]);
|
|
95
|
+
rest = __rest(_a, ["data", "options", "axis", "insight", "summary", "legend", "tooltip", "plugins", "className", "accessibility"]);
|
|
95
96
|
const {
|
|
96
97
|
translate
|
|
97
98
|
} = (0, useLanguage_1.useLanguage)();
|
|
@@ -195,7 +196,8 @@ const LineChart = _a => {
|
|
|
195
196
|
type: "line",
|
|
196
197
|
data: chartData,
|
|
197
198
|
options: chartOptions,
|
|
198
|
-
narrativeId: narrativeId
|
|
199
|
+
narrativeId: narrativeId,
|
|
200
|
+
accessibility: accessibility
|
|
199
201
|
})]
|
|
200
202
|
});
|
|
201
203
|
};
|