@pega/lists-react 9.0.0-build.9.9 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -4
- package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts.map +1 -1
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js +2 -1
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js.map +1 -1
- package/lib/Core/Components/AggregateMenu.d.ts.map +1 -1
- package/lib/Core/Components/AggregateMenu.js +6 -2
- package/lib/Core/Components/AggregateMenu.js.map +1 -1
- package/lib/Core/Components/AggregatorCell.d.ts.map +1 -1
- package/lib/Core/Components/AggregatorCell.js +3 -1
- package/lib/Core/Components/AggregatorCell.js.map +1 -1
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts +6 -15
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts.map +1 -1
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js +111 -166
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js.map +1 -1
- package/lib/Core/Components/ContextMenu/QuickFilter.js +1 -1
- package/lib/Core/Components/ContextMenu/QuickFilter.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js +33 -5
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.d.ts +10 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.js +27 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts +2 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js +2 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts +3 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js +11 -2
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts +3 -2
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js +13 -26
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js +2 -2
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts +0 -2
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js +11 -9
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js +20 -19
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts +4 -3
- package/lib/Core/Components/DefaultComponents/index.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.js +0 -2
- package/lib/Core/Components/DefaultComponents/index.js.map +1 -1
- package/lib/Core/Components/Filters/AdvanceFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/AdvanceFilter.js +5 -2
- package/lib/Core/Components/Filters/AdvanceFilter.js.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.d.ts +1 -1
- package/lib/Core/Components/Filters/SelectFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.js +43 -44
- package/lib/Core/Components/Filters/SelectFilter.js.map +1 -1
- package/lib/Core/Components/Filters/SimpleFilter.js +1 -1
- package/lib/Core/Components/Filters/SimpleFilter.js.map +1 -1
- package/lib/Core/Components/Filters/styles.d.ts +1 -1
- package/lib/Core/Components/FooterAggregators.d.ts.map +1 -1
- package/lib/Core/Components/FooterAggregators.js +6 -3
- package/lib/Core/Components/FooterAggregators.js.map +1 -1
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts +12 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js +62 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js.map +1 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts +33 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js +106 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js.map +1 -0
- package/lib/Core/Components/GroupRenderer/index.d.ts +22 -0
- package/lib/Core/Components/GroupRenderer/index.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/index.js +395 -0
- package/lib/Core/Components/GroupRenderer/index.js.map +1 -0
- package/lib/Core/Components/Grouping/GroupingMenu.d.ts.map +1 -1
- package/lib/Core/Components/Grouping/GroupingMenu.js +2 -1
- package/lib/Core/Components/Grouping/GroupingMenu.js.map +1 -1
- package/lib/Core/Components/HeaderCell.d.ts.map +1 -1
- package/lib/Core/Components/HeaderCell.js +3 -3
- package/lib/Core/Components/HeaderCell.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.d.ts +1 -1
- package/lib/Core/Components/HeaderMenu/actions.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.js +3 -4
- package/lib/Core/Components/HeaderMenu/actions.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.js +5 -5
- package/lib/Core/Components/HeaderMenu/index.js.map +1 -1
- package/lib/Core/Components/HierarchicalGroupRenderer.d.ts.map +1 -1
- package/lib/Core/Components/HierarchicalGroupRenderer.js +6 -2
- package/lib/Core/Components/HierarchicalGroupRenderer.js.map +1 -1
- package/lib/Core/Components/NotificationManager.js +1 -1
- package/lib/Core/Components/NotificationManager.js.map +1 -1
- package/lib/Core/Components/RFColumnConfigurator.d.ts.map +1 -1
- package/lib/Core/Components/RFColumnConfigurator.js +32 -9
- package/lib/Core/Components/RFColumnConfigurator.js.map +1 -1
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.d.ts.map +1 -1
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.js +2 -1
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.js.map +1 -1
- package/lib/Core/Components/RSWrapper/index.d.ts.map +1 -1
- package/lib/Core/Components/RSWrapper/index.js +2 -9
- package/lib/Core/Components/RSWrapper/index.js.map +1 -1
- package/lib/Core/Components/RenderingEngine/Formatter.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/Formatter.js +4 -1
- package/lib/Core/Components/RenderingEngine/Formatter.js.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js +19 -8
- package/lib/Core/Components/RenderingEngine/RenderCell.js.map +1 -1
- package/lib/Core/Components/RenderingEngine/useHighlighter.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/useHighlighter.js +0 -1
- package/lib/Core/Components/RenderingEngine/useHighlighter.js.map +1 -1
- package/lib/Core/Components/TestIdConstants.d.ts +2 -0
- package/lib/Core/Components/TestIdConstants.js +3 -1
- package/lib/Core/Components/TestIdConstants.js.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js +7 -18
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts +6 -4
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.js +18 -21
- package/lib/Core/Components/Toolbar/ColumnSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/DebugInfo.d.ts +3 -5
- package/lib/Core/Components/Toolbar/DebugInfo.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/DebugInfo.js +3 -3
- package/lib/Core/Components/Toolbar/DebugInfo.js.map +1 -1
- package/lib/Core/Components/Toolbar/FieldSelector.d.ts +2 -1
- package/lib/Core/Components/Toolbar/FieldSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/FieldSelector.js +14 -7
- package/lib/Core/Components/Toolbar/FieldSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/Grouping.types.d.ts +0 -6
- package/lib/Core/Components/Toolbar/Grouping.types.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/Grouping.types.js.map +1 -1
- package/lib/Core/Components/Toolbar/RefreshBanner.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/RefreshBanner.js +1 -0
- package/lib/Core/Components/Toolbar/RefreshBanner.js.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.js +2 -4
- package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useFilter.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useFilter.js +4 -1
- package/lib/Core/Components/Toolbar/hooks/useFilter.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts +14 -18
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js +15 -16
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts +4 -2
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js +30 -22
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js +17 -6
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts +7 -2
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js +12 -5
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.js +134 -80
- package/lib/Core/Components/Toolbar/hooks/useMore.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts +8 -6
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js +18 -3
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSearch.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSearch.js +7 -10
- package/lib/Core/Components/Toolbar/hooks/useSearch.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts +8 -6
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js +16 -10
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts +4 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js +9 -3
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js +8 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.d.ts +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.js +2 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts +2 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js +36 -12
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.d.ts +28 -7
- package/lib/Core/Components/Toolbar/utils/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.js +43 -11
- package/lib/Core/Components/Toolbar/utils/utils.js.map +1 -1
- package/lib/Core/Components/Virtualise/Pagination.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/Pagination.js +2 -1
- package/lib/Core/Components/Virtualise/Pagination.js.map +1 -1
- package/lib/Core/Components/Virtualise/UseScroll.d.ts +4 -1
- package/lib/Core/Components/Virtualise/UseScroll.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/UseScroll.js +16 -3
- package/lib/Core/Components/Virtualise/UseScroll.js.map +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js.map +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js.map +1 -1
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js +14 -4
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -1
- package/lib/Core/Components/Virtualise/index.js +19 -4
- package/lib/Core/Components/Virtualise/index.js.map +1 -1
- package/lib/Core/Components/Virtualise/utility.js +1 -1
- package/lib/Core/Components/Virtualise/utility.js.map +1 -1
- package/lib/Core/Components/WarningBanner.d.ts +11 -0
- package/lib/Core/Components/WarningBanner.d.ts.map +1 -0
- package/lib/Core/Components/WarningBanner.js +23 -0
- package/lib/Core/Components/WarningBanner.js.map +1 -0
- package/lib/Core/Context/LocalizationContext.d.ts +1 -1
- package/lib/Core/Context/LocalizationContext.d.ts.map +1 -1
- package/lib/Core/Context/LocalizationContext.js.map +1 -1
- package/lib/Core/Hooks/a11y/useAnnounce.d.ts +3 -4
- package/lib/Core/Hooks/a11y/useAnnounce.d.ts.map +1 -1
- package/lib/Core/Hooks/a11y/useAnnounce.js +3 -4
- package/lib/Core/Hooks/a11y/useAnnounce.js.map +1 -1
- package/lib/Core/Hooks/useDebounce.js +1 -1
- package/lib/Core/Hooks/useDebounce.js.map +1 -1
- package/lib/Core/Hooks/useDragDrop.d.ts +2 -2
- package/lib/Core/Hooks/useDragDrop.d.ts.map +1 -1
- package/lib/Core/Hooks/useDragDrop.js +9 -9
- package/lib/Core/Hooks/useDragDrop.js.map +1 -1
- package/lib/Core/Hooks/useRepeat.d.ts +1 -1
- package/lib/Core/Hooks/useRepeat.d.ts.map +1 -1
- package/lib/Core/Hooks/useRepeat.js +58 -11
- package/lib/Core/Hooks/useRepeat.js.map +1 -1
- package/lib/Core/Hooks/useSelectAllCheckbox.d.ts +21 -0
- package/lib/Core/Hooks/useSelectAllCheckbox.d.ts.map +1 -0
- package/lib/Core/Hooks/useSelectAllCheckbox.js +23 -0
- package/lib/Core/Hooks/useSelectAllCheckbox.js.map +1 -0
- package/lib/Core/Localization/defaultTranslations.d.ts +15 -13
- package/lib/Core/Localization/defaultTranslations.d.ts.map +1 -1
- package/lib/Core/Localization/defaultTranslations.js +16 -14
- package/lib/Core/Localization/defaultTranslations.js.map +1 -1
- package/lib/Core/Test/JUnitMocks.d.ts +12 -0
- package/lib/Core/Test/JUnitMocks.d.ts.map +1 -1
- package/lib/Core/Test/JUnitMocks.js +27 -8
- package/lib/Core/Test/JUnitMocks.js.map +1 -1
- package/lib/Core/Test/TestUtils.d.ts +0 -1
- package/lib/Core/Test/TestUtils.d.ts.map +1 -1
- package/lib/Core/Test/TestUtils.js +3 -7
- package/lib/Core/Test/TestUtils.js.map +1 -1
- package/lib/Core/Utils/index.d.ts +15 -0
- package/lib/Core/Utils/index.d.ts.map +1 -1
- package/lib/Core/Utils/index.js +22 -0
- package/lib/Core/Utils/index.js.map +1 -1
- package/lib/Core/Utils/styles.d.ts +2 -2
- package/lib/Core/Utils/styles.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts +4 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.js +29 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js +25 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.js +15 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.js.map +1 -0
- package/lib/Core/Views/Gallery/Gallery.types.d.ts +8 -0
- package/lib/Core/Views/Gallery/Gallery.types.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Gallery.types.js +2 -0
- package/lib/Core/Views/Gallery/Gallery.types.js.map +1 -0
- package/lib/Core/Views/Gallery/GalleryA11y.d.ts +7 -5
- package/lib/Core/Views/Gallery/GalleryA11y.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/GalleryA11y.js +9 -52
- package/lib/Core/Views/Gallery/GalleryA11y.js.map +1 -1
- package/lib/Core/Views/Gallery/GalleryContainer.d.ts +23 -0
- package/lib/Core/Views/Gallery/GalleryContainer.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/GalleryContainer.js +66 -0
- package/lib/Core/Views/Gallery/GalleryContainer.js.map +1 -0
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js +1 -1
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js.map +1 -1
- package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts +9 -0
- package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/hooks/useRowActions.js +25 -0
- package/lib/Core/Views/Gallery/hooks/useRowActions.js.map +1 -0
- package/lib/Core/Views/Gallery/index.d.ts +4 -8
- package/lib/Core/Views/Gallery/index.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/index.js +38 -59
- package/lib/Core/Views/Gallery/index.js.map +1 -1
- package/lib/Core/Views/Gallery/utils.d.ts +36 -0
- package/lib/Core/Views/Gallery/utils.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/utils.js +115 -0
- package/lib/Core/Views/Gallery/utils.js.map +1 -0
- package/lib/Core/Views/Map/Map.styles.d.ts +190 -6
- package/lib/Core/Views/Map/Map.styles.d.ts.map +1 -1
- package/lib/Core/Views/Map/Map.styles.js.map +1 -1
- package/lib/Core/Views/Map/index.d.ts.map +1 -1
- package/lib/Core/Views/Map/index.js +2 -2
- package/lib/Core/Views/Map/index.js.map +1 -1
- package/lib/Core/Views/RsCardWrapper.js.map +1 -1
- package/lib/Core/Views/Table/Body.d.ts.map +1 -1
- package/lib/Core/Views/Table/Body.js +5 -2
- package/lib/Core/Views/Table/Body.js.map +1 -1
- package/lib/Core/Views/Table/CellWrapper.d.ts +1 -1
- package/lib/Core/Views/Table/CellWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/CellWrapper.js +4 -2
- package/lib/Core/Views/Table/CellWrapper.js.map +1 -1
- package/lib/Core/Views/Table/GroupingHeaderCell.d.ts +6 -15
- package/lib/Core/Views/Table/GroupingHeaderCell.d.ts.map +1 -1
- package/lib/Core/Views/Table/GroupingHeaderCell.js +16 -14
- package/lib/Core/Views/Table/GroupingHeaderCell.js.map +1 -1
- package/lib/Core/Views/Table/HeaderWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/HeaderWrapper.js +5 -5
- package/lib/Core/Views/Table/HeaderWrapper.js.map +1 -1
- package/lib/Core/Views/Table/SkeletonRows.d.ts +1 -1
- package/lib/Core/Views/Table/SkeletonRows.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.d.ts +3 -1
- package/lib/Core/Views/Table/StyledTableContainer.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.js +270 -155
- package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -1
- package/lib/Core/Views/Table/TableA11y.d.ts +13 -1
- package/lib/Core/Views/Table/TableA11y.d.ts.map +1 -1
- package/lib/Core/Views/Table/TableA11y.js +233 -13
- package/lib/Core/Views/Table/TableA11y.js.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts +3 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.js +16 -16
- package/lib/Core/Views/Table/VirtualizeWrapper.js.map +1 -1
- package/lib/Core/Views/Table/index.d.ts.map +1 -1
- package/lib/Core/Views/Table/index.js +16 -7
- package/lib/Core/Views/Table/index.js.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.js +15 -20
- package/lib/Core/Views/Timeline/Timeline.js.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts +392 -15
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.styles.js +44 -44
- package/lib/Core/Views/Timeline/Timeline.styles.js.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.types.d.ts +11 -7
- package/lib/Core/Views/Timeline/Timeline.types.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.types.js.map +1 -1
- package/lib/Core/Views/Timeline/TimelineGroup.d.ts +13 -0
- package/lib/Core/Views/Timeline/TimelineGroup.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/TimelineGroup.js +21 -0
- package/lib/Core/Views/Timeline/TimelineGroup.js.map +1 -0
- package/lib/Core/Views/Timeline/TimelineItem.d.ts +1 -3
- package/lib/Core/Views/Timeline/TimelineItem.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/TimelineItem.js +7 -6
- package/lib/Core/Views/Timeline/TimelineItem.js.map +1 -1
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts +2 -2
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.js.map +1 -1
- package/lib/Core/Views/Timeline/index.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/index.js +13 -6
- package/lib/Core/Views/Timeline/index.js.map +1 -1
- package/lib/Core/Views/Timeline/utils.d.ts +8 -10
- package/lib/Core/Views/Timeline/utils.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/utils.js +136 -58
- package/lib/Core/Views/Timeline/utils.js.map +1 -1
- package/lib/Core/Views/rs-styles.d.ts +1 -1
- package/lib/Core/a11y/loadingAnnouncementBehavior.d.ts +12 -0
- package/lib/Core/a11y/loadingAnnouncementBehavior.d.ts.map +1 -0
- package/lib/Core/a11y/loadingAnnouncementBehavior.js +37 -0
- package/lib/Core/a11y/loadingAnnouncementBehavior.js.map +1 -0
- package/lib/Core/constants.d.ts.map +1 -1
- package/lib/Core/constants.js +1 -0
- package/lib/Core/constants.js.map +1 -1
- package/lib/Core/index.d.ts.map +1 -1
- package/lib/Core/index.js +1 -2
- package/lib/Core/index.js.map +1 -1
- package/lib/Core/templateFeatureSupport.d.ts +17 -0
- package/lib/Core/templateFeatureSupport.d.ts.map +1 -0
- package/lib/Core/templateFeatureSupport.js +31 -0
- package/lib/Core/templateFeatureSupport.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/RepeatingStructuresBoot.types.d.ts +12 -8
- package/lib/types/RepeatingStructuresBoot.types.d.ts.map +1 -1
- package/lib/types/RepeatingStructuresBoot.types.js.map +1 -1
- package/lib/types.d.ts +2 -0
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +11 -13
- package/lib/Core/Components/DefaultComponents/CardItem.d.ts +0 -3
- package/lib/Core/Components/DefaultComponents/CardItem.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CardItem.js +0 -78
- package/lib/Core/Components/DefaultComponents/CardItem.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts +0 -12
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js +0 -36
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts +0 -15
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js +0 -50
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts +0 -12
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js +0 -44
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts +0 -16
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js +0 -64
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js.map +0 -1
- package/lib/Core/Components/GroupRenderer.d.ts +0 -31
- package/lib/Core/Components/GroupRenderer.d.ts.map +0 -1
- package/lib/Core/Components/GroupRenderer.js +0 -348
- package/lib/Core/Components/GroupRenderer.js.map +0 -1
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.d.ts +0 -2
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.d.ts.map +0 -1
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.js +0 -4
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.js.map +0 -1
- package/lib/Core/Components/Toolbar/KeyboardInstructions.d.ts +0 -6
- package/lib/Core/Components/Toolbar/KeyboardInstructions.d.ts.map +0 -1
- package/lib/Core/Components/Toolbar/KeyboardInstructions.js +0 -32
- package/lib/Core/Components/Toolbar/KeyboardInstructions.js.map +0 -1
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts +0 -7
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts.map +0 -1
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js +0 -109
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js.map +0 -1
- package/lib/Core/Views/Gallery/ItemWrapper.d.ts +0 -19
- package/lib/Core/Views/Gallery/ItemWrapper.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/ItemWrapper.js +0 -34
- package/lib/Core/Views/Gallery/ItemWrapper.js.map +0 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts +0 -3
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js +0 -51
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js.map +0 -1
- package/lib/Core/Views/Timeline/utility.d.ts +0 -8
- package/lib/Core/Views/Timeline/utility.d.ts.map +0 -1
- package/lib/Core/Views/Timeline/utility.js +0 -120
- package/lib/Core/Views/Timeline/utility.js.map +0 -1
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { Flex, Icon, Tooltip, useElement, Text, MetaList } from '@pega/cosmos-react-core';
|
|
6
|
-
import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
7
|
-
import { getGroupFromKey } from 'pega-ui-list-data-apis';
|
|
8
|
-
import { dateFunctionLabels, FieldType } from 'pega-repeating-structures-core';
|
|
9
|
-
import { StyledMetaListItem } from '@pega/cosmos-react-core/lib/components/MetaList/MetaList';
|
|
10
|
-
import { createClassName as cx } from '../Utils';
|
|
11
|
-
import useTranslate from '../Hooks/useTranslate';
|
|
12
|
-
import { customFunctions, intervalGroupingBoundaries } from '../constants';
|
|
13
|
-
import AggregatorCell from './AggregatorCell';
|
|
14
|
-
import RenderingEngine from './RenderingEngine/RenderCell';
|
|
15
|
-
import DateValueDisplay from './DateValueDisplay';
|
|
16
|
-
import TestIdConstants from './TestIdConstants';
|
|
17
|
-
import { getFormattedAggregationValue } from './AggregateMenu';
|
|
18
|
-
const groupheaderleftdisplacement = headerLevel => `${(headerLevel.level + 1) * 0.5}rem`;
|
|
19
|
-
/**
|
|
20
|
-
* TODO: remove currentColor style after cosmos fixes the issue
|
|
21
|
-
* Cosmos yet to handle dark theme on BareButton
|
|
22
|
-
*/
|
|
23
|
-
const StyledGroupHeader = styled.div `
|
|
24
|
-
--group-left: ${props => groupheaderleftdisplacement(props.groupHeader)};
|
|
25
|
-
--group-bg-color: ${props => props.theme.base.palette['secondary-background']};
|
|
26
|
-
background-color: var(--group-bg-color);
|
|
27
|
-
&:has(button[aria-expanded='true']) {
|
|
28
|
-
filter: ${props => props.theme.base.shadow['low-filter']};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&.row.sticky-group-header {
|
|
32
|
-
position: sticky;
|
|
33
|
-
display: block;
|
|
34
|
-
top: calc(
|
|
35
|
-
${props => props.groupHeader.isLeafNode && props.groupHeader.level !== 0
|
|
36
|
-
? 'calc(var(--row-height) + var(--group-header-height))'
|
|
37
|
-
: 'var(--row-height)'}
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
/* z-index starting from 8 because freeze-line has z-index 7 */
|
|
41
|
-
z-index: ${props => `${8 + props.groupHeader.index}`};
|
|
42
|
-
> .cell-action,
|
|
43
|
-
.cell-fixed {
|
|
44
|
-
background-color: var(--group-bg-color);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.group-label {
|
|
49
|
-
width: 0.437rem;
|
|
50
|
-
display: inline-block;
|
|
51
|
-
flex-shrink: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.group-header-groupby {
|
|
55
|
-
font-weight: ${props => props.theme.base['font-weight'].normal};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.group-context-count .group-count {
|
|
59
|
-
font-weight: ${props => props.theme.base['font-weight'].bold};
|
|
60
|
-
white-space: pre;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&.row.group-header-row {
|
|
64
|
-
height: auto;
|
|
65
|
-
border-bottom: ${props => (!props.isAggregationApplied ? 'var(--border-style)' : 'none')};
|
|
66
|
-
|
|
67
|
-
.group-header-aggregation-row {
|
|
68
|
-
display: flex;
|
|
69
|
-
|
|
70
|
-
/* Using height 0 so that the aggregations aren't visible when not applied but the cells can take the width and stretch the group header to the full width */
|
|
71
|
-
height: ${props => (props.isAggregationApplied ? 'var(--group-header-height)' : 0)};
|
|
72
|
-
|
|
73
|
-
&::before {
|
|
74
|
-
content: '';
|
|
75
|
-
position: sticky;
|
|
76
|
-
inset-block-start: 0;
|
|
77
|
-
inset-inline-start: 0;
|
|
78
|
-
width: 0.25rem;
|
|
79
|
-
height: 100%;
|
|
80
|
-
background-color: ${props => props.groupHeader.colorIndicator};
|
|
81
|
-
z-index: 12;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&.group-header-row .stickyGroupHeader {
|
|
87
|
-
position: sticky;
|
|
88
|
-
left: 0;
|
|
89
|
-
width: 0;
|
|
90
|
-
z-index: 10;
|
|
91
|
-
height: var(--group-header-height);
|
|
92
|
-
|
|
93
|
-
> button {
|
|
94
|
-
color: currentColor;
|
|
95
|
-
position: absolute;
|
|
96
|
-
left: 0;
|
|
97
|
-
top: 0;
|
|
98
|
-
bottom: 0;
|
|
99
|
-
width: max-content;
|
|
100
|
-
max-width: var(--container-width);
|
|
101
|
-
display: flex;
|
|
102
|
-
align-items: center;
|
|
103
|
-
background-color: var(--group-bg-color);
|
|
104
|
-
padding-left: var(--group-left);
|
|
105
|
-
margin-inline-start: 0.25rem;
|
|
106
|
-
z-index: 30;
|
|
107
|
-
cursor: pointer;
|
|
108
|
-
white-space: nowrap;
|
|
109
|
-
text-align: inherit;
|
|
110
|
-
font-stretch: inherit;
|
|
111
|
-
|
|
112
|
-
> .group-wrapper {
|
|
113
|
-
margin-inline-start: ${({ groupHeader, theme }) => groupHeader.count === 0 ? `calc(${theme.base.spacing} * 2.25)` : 'unset'};
|
|
114
|
-
align-items: baseline;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.cell-content {
|
|
118
|
-
max-height: var(--group-header-height);
|
|
119
|
-
padding: 0;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
button:focus {
|
|
123
|
-
box-shadow: ${({ theme }) => theme.base.shadow['focus-inset']};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&::before {
|
|
127
|
-
content: '';
|
|
128
|
-
position: absolute;
|
|
129
|
-
inset-block-start: 0;
|
|
130
|
-
inset-inline-start: 0;
|
|
131
|
-
width: 0.25rem;
|
|
132
|
-
height: 100%;
|
|
133
|
-
background-color: ${props => props.groupHeader.colorIndicator};
|
|
134
|
-
z-index: 12;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
.group-header.cell {
|
|
138
|
-
left: 0;
|
|
139
|
-
padding-left: var(--group-left);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
div.group-header.cell-fixed {
|
|
143
|
-
background-color: var(--group-bg-color);
|
|
144
|
-
}
|
|
145
|
-
`;
|
|
146
|
-
const StyledText = styled(Text) `
|
|
147
|
-
display: inline-flex;
|
|
148
|
-
white-space: nowrap;
|
|
149
|
-
text-overflow: ellipsis;
|
|
150
|
-
overflow: hidden;
|
|
151
|
-
`;
|
|
152
|
-
const StyledMetaList = styled(MetaList) `
|
|
153
|
-
margin-inline-start: 0;
|
|
154
|
-
`;
|
|
155
|
-
const GroupAdditionalInfoSeparator = styled(StyledMetaListItem) `
|
|
156
|
-
margin-inline-start: 0.3rem;
|
|
157
|
-
`;
|
|
158
|
-
/**
|
|
159
|
-
* For
|
|
160
|
-
* @param {*} additionalFieldData
|
|
161
|
-
* @param {*} additionalField
|
|
162
|
-
* @param {*} param2
|
|
163
|
-
* @returns
|
|
164
|
-
*/
|
|
165
|
-
/**
|
|
166
|
-
* Formats additional field data based on its type and properties.
|
|
167
|
-
*
|
|
168
|
-
* @typedef {NonNullable<
|
|
169
|
-
* Awaited<
|
|
170
|
-
* ReturnType<
|
|
171
|
-
* NonNullable<
|
|
172
|
-
* import('pega-repeating-structures-core').RsCoreTypes.ApiContext['fetchGroupedInfo']
|
|
173
|
-
* >
|
|
174
|
-
* >
|
|
175
|
-
* >[number]['additionalFieldsData']
|
|
176
|
-
* >[number]} AdditionalFieldData
|
|
177
|
-
*
|
|
178
|
-
* @typedef {import('pega-repeating-structures-core').RsCoreTypes.Column} Column
|
|
179
|
-
* @typedef {import('pega-repeating-structures-core').RsCoreTypes.Meta} Meta
|
|
180
|
-
* @typedef {import('pega-repeating-structures-core').RsCoreTypes.GroupGenerator} GroupGenerator
|
|
181
|
-
*
|
|
182
|
-
* @param {AdditionalFieldData} additionalFieldData - The data for the additional field.
|
|
183
|
-
* @param {import('pega-repeating-structures-core').RsCoreTypes.GroupAdditionalField} additionalField - The configuration for the additional field.
|
|
184
|
-
* @param {{column: Column, meta: Meta, groupHeader: GroupGenerator}} config - Additional config for formatting.
|
|
185
|
-
* @param {Column} config.column - The column configuration.
|
|
186
|
-
* @param {Meta} config.meta - RS Meta.
|
|
187
|
-
* @param {GroupGenerator} config.groupHeader - The group header data.
|
|
188
|
-
*
|
|
189
|
-
* @returns {{label: string, renderer: ReactNode | string}} An object containing the formatted label and renderer.
|
|
190
|
-
* @returns {string} returns.label - The formatted label for the additional field.
|
|
191
|
-
* @returns {ReactNode | string} returns.renderer - The React component or value to render.
|
|
192
|
-
*/
|
|
193
|
-
const getFormattedAdditionalFieldData = (additionalFieldData, additionalField, { column, meta, groupHeader, translate }) => {
|
|
194
|
-
const { value, count = 0 } = additionalFieldData || {};
|
|
195
|
-
const { aggregation, dateFunction } = additionalField || {};
|
|
196
|
-
const { locale, timezone } = meta;
|
|
197
|
-
const { label, field: { type } } = column;
|
|
198
|
-
// Additional field as aggregation
|
|
199
|
-
if (aggregation && type === FieldType.NUMBER) {
|
|
200
|
-
return {
|
|
201
|
-
label: `${label}(${translate(aggregation)})`,
|
|
202
|
-
renderer: getFormattedAggregationValue(value, aggregation, column)
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
// Additional field as Date part
|
|
206
|
-
if (dateFunction && [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY].includes(type)) {
|
|
207
|
-
return {
|
|
208
|
-
label: `${label}(${translate(dateFunctionLabels[dateFunction])})`,
|
|
209
|
-
renderer: (_jsx(DateValueDisplay, { value: value, dateFunction: dateFunction, locale: locale, timezone: timezone }))
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
// Additional field as normal field but with multiple values.
|
|
213
|
-
if (count > 1) {
|
|
214
|
-
const { getFormatterByKey } = column.parent;
|
|
215
|
-
const integerFormatter = getFormatterByKey('Integer');
|
|
216
|
-
return {
|
|
217
|
-
label: `${label}(${translate('Count')})`,
|
|
218
|
-
renderer: integerFormatter ? integerFormatter(count, { locale }) : count
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
// Additional field as normal field.
|
|
222
|
-
column.setExecutionContext(null);
|
|
223
|
-
return {
|
|
224
|
-
label,
|
|
225
|
-
renderer: (_jsx(RenderingEngine, { ...column.getRenderingEngineProps(),
|
|
226
|
-
context: {
|
|
227
|
-
...column.getContext(),
|
|
228
|
-
name: 'GroupAdditionalField',
|
|
229
|
-
getValue: () => value,
|
|
230
|
-
getExecutionContext: () => {
|
|
231
|
-
return { getValue: () => groupHeader.data, name: 'groupHeader' };
|
|
232
|
-
}
|
|
233
|
-
} }))
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
const GroupAdditionalInfo = ({ additionalFieldData, columns, groupHeader, additionalField }) => {
|
|
237
|
-
const [infoRef, setInfoRef] = useElement(null);
|
|
238
|
-
const [translate] = useTranslate();
|
|
239
|
-
const { id } = additionalFieldData;
|
|
240
|
-
const column = columns.find(c => c.field.id === id);
|
|
241
|
-
if (!column)
|
|
242
|
-
return null;
|
|
243
|
-
const { meta } = column.parent;
|
|
244
|
-
const { label, renderer } = getFormattedAdditionalFieldData(additionalFieldData, additionalField, { column, meta, groupHeader, translate });
|
|
245
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { container: { gap: 0.5 }, ref: setInfoRef, children: [_jsxs(StyledText, { variant: 'secondary', "data-testid": 'additional-field-label', children: [label, ":"] }), _jsx(StyledText, { variant: 'secondary', "data-testid": 'additional-field-renderer', children: renderer })] }), _jsxs(Tooltip, { smart: true, target: infoRef, showDelay: 'short', hideDelay: 'none', children: [_jsx(Text, { children: `${label}: ` }), _jsx(Text, { children: renderer })] })] }));
|
|
246
|
-
};
|
|
247
|
-
/**
|
|
248
|
-
* Returns label for interval grouping based on interval and boundaries
|
|
249
|
-
Response data depends on boundary settings.
|
|
250
|
-
Ex: For sample data of profit
|
|
251
|
-
profit --> cases(count)
|
|
252
|
-
{'0': 10, 1': 100, '2':30, '10': 35, '15':45, '20':2}
|
|
253
|
-
For Interval 10
|
|
254
|
-
If the boundary is 'include-lower-only',
|
|
255
|
-
and value is 10 then label -> 10 to 20
|
|
256
|
-
|
|
257
|
-
If boundary is 'include-upper-only',
|
|
258
|
-
and value is 10 then label -> 0 to 10
|
|
259
|
-
* */
|
|
260
|
-
function buildIntervalGroupingLabel(value, customFunction, translate) {
|
|
261
|
-
const { interval, boundaries } = customFunction;
|
|
262
|
-
// To restrict the decimals in labels
|
|
263
|
-
const intervalDecimalLength = (interval.toString().split('.')[1] || '').length;
|
|
264
|
-
value = Number(value);
|
|
265
|
-
// In case of 'include-lower-only'
|
|
266
|
-
let lowerValue = value.toFixed(intervalDecimalLength);
|
|
267
|
-
let upperValue = (value + interval).toFixed(intervalDecimalLength);
|
|
268
|
-
// In case of boundary 'include-upper-only'
|
|
269
|
-
if (boundaries === intervalGroupingBoundaries.includeUpperOnly) {
|
|
270
|
-
lowerValue = (value - interval).toFixed(intervalDecimalLength);
|
|
271
|
-
upperValue = value.toFixed(intervalDecimalLength);
|
|
272
|
-
}
|
|
273
|
-
return `${lowerValue} ${translate('to')} ${upperValue}`;
|
|
274
|
-
}
|
|
275
|
-
function GroupName({ view, column, groupHeader, dateFunction, customFunction }) {
|
|
276
|
-
const [translate] = useTranslate();
|
|
277
|
-
const { locale, timezone } = view.meta;
|
|
278
|
-
const isRangeGrouping = customFunction?.type === customFunctions.RANGE_GROUPING;
|
|
279
|
-
const isIntervalGrouping = customFunction?.type === customFunctions.INTERVAL_GROUPING;
|
|
280
|
-
if (dateFunction) {
|
|
281
|
-
return (_jsx(DateValueDisplay, { value: groupHeader.name, dateFunction: dateFunction, locale: locale, timezone: timezone }));
|
|
282
|
-
}
|
|
283
|
-
if (isRangeGrouping) {
|
|
284
|
-
/** If custom range grouping applied on number field , we need to show group name as text instead of number */
|
|
285
|
-
return groupHeader.name;
|
|
286
|
-
}
|
|
287
|
-
if (isIntervalGrouping) {
|
|
288
|
-
/** If custom range grouping applied on number , we need to show group name based on value and custom function details like interval and boundaries */
|
|
289
|
-
return buildIntervalGroupingLabel(groupHeader.name, customFunction, translate);
|
|
290
|
-
}
|
|
291
|
-
column.setExecutionContext(null); // If null is not set then it will execute on the previous row context and facing issues when cell is edited. Based on column.editMode and current context renderer varies (it can be cellEditRenderer)
|
|
292
|
-
const columnRendererProps = {
|
|
293
|
-
...column.getRenderingEngineProps(),
|
|
294
|
-
context: {
|
|
295
|
-
getValue: () => groupHeader.name,
|
|
296
|
-
getExecutionContext: () => {
|
|
297
|
-
return { getValue: () => groupHeader.data, name: 'groupHeader' };
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
return _jsx(RenderingEngine, { ...columnRendererProps });
|
|
302
|
-
}
|
|
303
|
-
// NOTE: While making any changes in GroupRenderer.jsx, also make similar changes in HierarchicalGroupRenderer.jsx file if applicable
|
|
304
|
-
export default function GroupHeader({ groupHeader, columns }) {
|
|
305
|
-
const buttonRef = useRef();
|
|
306
|
-
// TODO: This we are adding temporary to show freeze border until we make group header rendering change
|
|
307
|
-
// when we will pick up aggregation.
|
|
308
|
-
if (!groupHeader.isVisible)
|
|
309
|
-
return null;
|
|
310
|
-
const view = columns[0].parent;
|
|
311
|
-
// If grouping by a regular column (i.e. without a dateFunction), determine props for the renderer
|
|
312
|
-
const { columnId, dateFunction, customFunction, additionalFields = [] } = getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};
|
|
313
|
-
// if state.groups is not yet prepared/updated, then getGroupFromKey will return undefined
|
|
314
|
-
if (!columnId) {
|
|
315
|
-
return null;
|
|
316
|
-
}
|
|
317
|
-
const column = columns.find(c => c.field.id === columnId);
|
|
318
|
-
const formatter = view.getFormatterByKey('Integer');
|
|
319
|
-
const { locale } = view.meta;
|
|
320
|
-
const groupCountFormatted = formatter
|
|
321
|
-
? formatter(groupHeader.count, { locale })
|
|
322
|
-
: groupHeader.count;
|
|
323
|
-
const isAggregationApplied = columns.filter(c => !c.hidden).some(c => c.aggregated);
|
|
324
|
-
// FIXME: Import rather than COPY, i would rather
|
|
325
|
-
return (_jsxs(StyledGroupHeader, { groupHeader: groupHeader, className: cx('row group-header-row sticky-group-header'), "data-test-id": 'groupHeader', "data-testid": TestIdConstants.groupHeader, isAggregationApplied: isAggregationApplied, role: 'row', onFocus: e => {
|
|
326
|
-
if (buttonRef.current && !e.currentTarget.contains(e.relatedTarget)) {
|
|
327
|
-
e.preventDefault();
|
|
328
|
-
buttonRef.current.focus();
|
|
329
|
-
}
|
|
330
|
-
}, children: [_jsx("div", { className: 'stickyGroupHeader', children: _jsxs(BareButton, { ref: buttonRef, "aria-label": `${column.field.hideGroupColumnNameLabel ? '' : groupHeader.label} ${groupHeader.name}, ${groupCountFormatted} items`, "aria-expanded": !!groupHeader.isExpanded, style: {
|
|
331
|
-
paddingRight: 'var(--group-left)'
|
|
332
|
-
}, onClick: () => groupHeader.count > 0 && view.type.toggleGroupExpansion({ groupHeader }), tabIndex: -1, icon: true, children: [groupHeader.count > 0 &&
|
|
333
|
-
(groupHeader.isExpanded ? _jsx(Icon, { name: 'caret-down' }) : _jsx(Icon, { name: 'caret-right' })), _jsxs("div", { className: 'group-wrapper', children: [_jsx("div", { className: 'group-label' }), !column.field.hideGroupColumnNameLabel && (_jsxs("span", { className: 'group-header-groupby', "data-test-id": groupHeader.groupBy, "data-testid": `${TestIdConstants.groupHeaderGroupBy}-${groupHeader.groupBy}`, children: [groupHeader.label, ":"] })), _jsx("div", { className: 'group-label' }), _jsxs("span", { className: 'group-context-count', style: { display: 'inline-flex' }, "data-test-id": 'groupHeader', "data-testid": TestIdConstants.groupHeaderCount, children: [_jsx(GroupName, { view: view, column: column, groupHeader: groupHeader, dateFunction: dateFunction, customFunction: customFunction }), _jsx("span", { className: 'group-count', children: ` (${groupCountFormatted})` })] }), !!(groupHeader.additionalFieldsData?.length && additionalFields.length) && (_jsxs(_Fragment, { children: [_jsx(Text, { "aria-hidden": true, variant: 'secondary', as: GroupAdditionalInfoSeparator, children: "\u2022" }), _jsx(StyledMetaList, { wrapItems: false, items: [
|
|
334
|
-
...groupHeader.additionalFieldsData.map(additionalFieldsData => (_jsx(GroupAdditionalInfo, { additionalFieldData: additionalFieldsData, additionalField: additionalFields.find(additionalField => additionalField.id === additionalFieldsData.id), columns: columns, groupHeader: groupHeader })))
|
|
335
|
-
] })] }))] })] }) }), _jsx("div", { className: 'group-header-aggregation-row', children: columns.map(c => {
|
|
336
|
-
const cxt = {
|
|
337
|
-
getValue: () => groupHeader?.aggregation?.[c.field.name]?.[c.aggregationType?.toLowerCase()]
|
|
338
|
-
};
|
|
339
|
-
return (_jsx(AggregatorCell, { column: c, context: cxt, className: cx('cell', {
|
|
340
|
-
'cell-fixed': column.frozen
|
|
341
|
-
}) }, c.field.id));
|
|
342
|
-
}) })] }));
|
|
343
|
-
}
|
|
344
|
-
GroupHeader.propTypes = {
|
|
345
|
-
columns: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
346
|
-
groupHeader: PropTypes.objectOf(PropTypes.any).isRequired
|
|
347
|
-
};
|
|
348
|
-
//# sourceMappingURL=GroupRenderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupRenderer.js","sourceRoot":"","sources":["../../../Core/Components/GroupRenderer.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAE9F,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,YAAY,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,0BAA0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,EAAE,CACb,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,WAAW,EAAE,CAAC;qBAC/E,CAAC;oBACF,OAAO,CACL,KAAC,cAAc,IAEb,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE;4BACpB,YAAY,EAAE,MAAM,CAAC,MAAM;yBAC5B,CAAC,IALG,CAAC,CAAC,KAAK,CAAC,EAAE,CAMf,CACH,CAAC;gBACJ,CAAC,CAAC,GACE,IACY,CACrB,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,SAAS,GAAG;IACtB,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,WAAW,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CAC1D,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useRef } from 'react';\nimport styled from 'styled-components';\n\nimport { Flex, Icon, Tooltip, useElement, Text, MetaList } from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { getGroupFromKey } from 'pega-ui-list-data-apis';\nimport { dateFunctionLabels, FieldType } from 'pega-repeating-structures-core';\nimport { StyledMetaListItem } from '@pega/cosmos-react-core/lib/components/MetaList/MetaList';\n\nimport { createClassName as cx } from '../Utils';\nimport useTranslate from '../Hooks/useTranslate';\nimport { customFunctions, intervalGroupingBoundaries } from '../constants';\n\nimport AggregatorCell from './AggregatorCell';\nimport RenderingEngine from './RenderingEngine/RenderCell';\nimport DateValueDisplay from './DateValueDisplay';\nimport TestIdConstants from './TestIdConstants';\nimport { getFormattedAggregationValue } from './AggregateMenu';\n\nconst groupheaderleftdisplacement = headerLevel => `${(headerLevel.level + 1) * 0.5}rem`;\n/**\n * TODO: remove currentColor style after cosmos fixes the issue\n * Cosmos yet to handle dark theme on BareButton\n */\n\nconst StyledGroupHeader = styled.div`\n --group-left: ${props => groupheaderleftdisplacement(props.groupHeader)};\n --group-bg-color: ${props => props.theme.base.palette['secondary-background']};\n background-color: var(--group-bg-color);\n &:has(button[aria-expanded='true']) {\n filter: ${props => props.theme.base.shadow['low-filter']};\n }\n\n &.row.sticky-group-header {\n position: sticky;\n display: block;\n top: calc(\n ${props =>\n props.groupHeader.isLeafNode && props.groupHeader.level !== 0\n ? 'calc(var(--row-height) + var(--group-header-height))'\n : 'var(--row-height)'}\n );\n\n /* z-index starting from 8 because freeze-line has z-index 7 */\n z-index: ${props => `${8 + props.groupHeader.index}`};\n > .cell-action,\n .cell-fixed {\n background-color: var(--group-bg-color);\n }\n }\n\n .group-label {\n width: 0.437rem;\n display: inline-block;\n flex-shrink: 0;\n }\n\n .group-header-groupby {\n font-weight: ${props => props.theme.base['font-weight'].normal};\n }\n\n .group-context-count .group-count {\n font-weight: ${props => props.theme.base['font-weight'].bold};\n white-space: pre;\n }\n\n &.row.group-header-row {\n height: auto;\n border-bottom: ${props => (!props.isAggregationApplied ? 'var(--border-style)' : 'none')};\n\n .group-header-aggregation-row {\n display: flex;\n\n /* Using height 0 so that the aggregations aren't visible when not applied but the cells can take the width and stretch the group header to the full width */\n height: ${props => (props.isAggregationApplied ? 'var(--group-header-height)' : 0)};\n\n &::before {\n content: '';\n position: sticky;\n inset-block-start: 0;\n inset-inline-start: 0;\n width: 0.25rem;\n height: 100%;\n background-color: ${props => props.groupHeader.colorIndicator};\n z-index: 12;\n }\n }\n }\n\n &.group-header-row .stickyGroupHeader {\n position: sticky;\n left: 0;\n width: 0;\n z-index: 10;\n height: var(--group-header-height);\n\n > button {\n color: currentColor;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: max-content;\n max-width: var(--container-width);\n display: flex;\n align-items: center;\n background-color: var(--group-bg-color);\n padding-left: var(--group-left);\n margin-inline-start: 0.25rem;\n z-index: 30;\n cursor: pointer;\n white-space: nowrap;\n text-align: inherit;\n font-stretch: inherit;\n\n > .group-wrapper {\n margin-inline-start: ${({ groupHeader, theme }) =>\n groupHeader.count === 0 ? `calc(${theme.base.spacing} * 2.25)` : 'unset'};\n align-items: baseline;\n }\n\n .cell-content {\n max-height: var(--group-header-height);\n padding: 0;\n }\n }\n button:focus {\n box-shadow: ${({ theme }) => theme.base.shadow['focus-inset']};\n }\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n width: 0.25rem;\n height: 100%;\n background-color: ${props => props.groupHeader.colorIndicator};\n z-index: 12;\n }\n }\n .group-header.cell {\n left: 0;\n padding-left: var(--group-left);\n }\n\n div.group-header.cell-fixed {\n background-color: var(--group-bg-color);\n }\n`;\n\nconst StyledText = styled(Text)`\n display: inline-flex;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n`;\n\nconst StyledMetaList = styled(MetaList)`\n margin-inline-start: 0;\n`;\nconst GroupAdditionalInfoSeparator = styled(StyledMetaListItem)`\n margin-inline-start: 0.3rem;\n`;\n\n/**\n * For\n * @param {*} additionalFieldData\n * @param {*} additionalField\n * @param {*} param2\n * @returns\n */\n/**\n * Formats additional field data based on its type and properties.\n *\n * @typedef {NonNullable<\n * Awaited<\n * ReturnType<\n * NonNullable<\n * import('pega-repeating-structures-core').RsCoreTypes.ApiContext['fetchGroupedInfo']\n * >\n * >\n * >[number]['additionalFieldsData']\n * >[number]} AdditionalFieldData\n *\n * @typedef {import('pega-repeating-structures-core').RsCoreTypes.Column} Column\n * @typedef {import('pega-repeating-structures-core').RsCoreTypes.Meta} Meta\n * @typedef {import('pega-repeating-structures-core').RsCoreTypes.GroupGenerator} GroupGenerator\n *\n * @param {AdditionalFieldData} additionalFieldData - The data for the additional field.\n * @param {import('pega-repeating-structures-core').RsCoreTypes.GroupAdditionalField} additionalField - The configuration for the additional field.\n * @param {{column: Column, meta: Meta, groupHeader: GroupGenerator}} config - Additional config for formatting.\n * @param {Column} config.column - The column configuration.\n * @param {Meta} config.meta - RS Meta.\n * @param {GroupGenerator} config.groupHeader - The group header data.\n *\n * @returns {{label: string, renderer: ReactNode | string}} An object containing the formatted label and renderer.\n * @returns {string} returns.label - The formatted label for the additional field.\n * @returns {ReactNode | string} returns.renderer - The React component or value to render.\n */\nconst getFormattedAdditionalFieldData = (\n additionalFieldData,\n additionalField,\n { column, meta, groupHeader, translate }\n) => {\n const { value, count = 0 } = additionalFieldData || {};\n const { aggregation, dateFunction } = additionalField || {};\n const { locale, timezone } = meta;\n const {\n label,\n field: { type }\n } = column;\n\n // Additional field as aggregation\n if (aggregation && type === FieldType.NUMBER) {\n return {\n label: `${label}(${translate(aggregation)})`,\n renderer: getFormattedAggregationValue(value, aggregation, column)\n };\n }\n\n // Additional field as Date part\n if (dateFunction && [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY].includes(type)) {\n return {\n label: `${label}(${translate(dateFunctionLabels[dateFunction])})`,\n renderer: (\n <DateValueDisplay\n value={value}\n dateFunction={dateFunction}\n locale={locale}\n timezone={timezone}\n />\n )\n };\n }\n\n // Additional field as normal field but with multiple values.\n if (count > 1) {\n const { getFormatterByKey } = column.parent;\n const integerFormatter = getFormatterByKey('Integer');\n return {\n label: `${label}(${translate('Count')})`,\n renderer: integerFormatter ? integerFormatter(count, { locale }) : count\n };\n }\n\n // Additional field as normal field.\n column.setExecutionContext(null);\n return {\n label,\n renderer: (\n <RenderingEngine\n {...{\n ...column.getRenderingEngineProps(),\n context: {\n ...column.getContext(),\n name: 'GroupAdditionalField',\n getValue: () => value,\n getExecutionContext: () => {\n return { getValue: () => groupHeader.data, name: 'groupHeader' };\n }\n }\n }}\n />\n )\n };\n};\n\nconst GroupAdditionalInfo = ({ additionalFieldData, columns, groupHeader, additionalField }) => {\n const [infoRef, setInfoRef] = useElement(null);\n const [translate] = useTranslate();\n const { id } = additionalFieldData;\n const column = columns.find(c => c.field.id === id);\n\n if (!column) return null;\n\n const { meta } = column.parent;\n\n const { label, renderer } = getFormattedAdditionalFieldData(\n additionalFieldData,\n additionalField,\n { column, meta, groupHeader, translate }\n );\n\n return (\n <>\n <Flex container={{ gap: 0.5 }} ref={setInfoRef}>\n <StyledText variant='secondary' data-testid='additional-field-label'>\n {label}:\n </StyledText>\n <StyledText variant='secondary' data-testid='additional-field-renderer'>\n {renderer}\n </StyledText>\n </Flex>\n <Tooltip smart target={infoRef} showDelay='short' hideDelay='none'>\n <Text>{`${label}: `}</Text>\n <Text>{renderer}</Text>\n </Tooltip>\n </>\n );\n};\n\n/**\n * Returns label for interval grouping based on interval and boundaries\n Response data depends on boundary settings.\n Ex: For sample data of profit\n profit --> cases(count)\n {'0': 10, 1': 100, '2':30, '10': 35, '15':45, '20':2}\n For Interval 10\n If the boundary is 'include-lower-only',\n and value is 10 then label -> 10 to 20\n\n If boundary is 'include-upper-only',\n and value is 10 then label -> 0 to 10\n * */\nfunction buildIntervalGroupingLabel(value, customFunction, translate) {\n const { interval, boundaries } = customFunction;\n // To restrict the decimals in labels\n const intervalDecimalLength = (interval.toString().split('.')[1] || '').length;\n value = Number(value);\n // In case of 'include-lower-only'\n let lowerValue = value.toFixed(intervalDecimalLength);\n let upperValue = (value + interval).toFixed(intervalDecimalLength);\n // In case of boundary 'include-upper-only'\n if (boundaries === intervalGroupingBoundaries.includeUpperOnly) {\n lowerValue = (value - interval).toFixed(intervalDecimalLength);\n upperValue = value.toFixed(intervalDecimalLength);\n }\n return `${lowerValue} ${translate('to')} ${upperValue}`;\n}\n\nfunction GroupName({ view, column, groupHeader, dateFunction, customFunction }) {\n const [translate] = useTranslate();\n const { locale, timezone } = view.meta;\n const isRangeGrouping = customFunction?.type === customFunctions.RANGE_GROUPING;\n const isIntervalGrouping = customFunction?.type === customFunctions.INTERVAL_GROUPING;\n\n if (dateFunction) {\n return (\n <DateValueDisplay\n value={groupHeader.name}\n dateFunction={dateFunction}\n locale={locale}\n timezone={timezone}\n />\n );\n }\n\n if (isRangeGrouping) {\n /** If custom range grouping applied on number field , we need to show group name as text instead of number */\n return groupHeader.name;\n }\n\n if (isIntervalGrouping) {\n /** If custom range grouping applied on number , we need to show group name based on value and custom function details like interval and boundaries */\n return buildIntervalGroupingLabel(groupHeader.name, customFunction, translate);\n }\n\n column.setExecutionContext(null); // If null is not set then it will execute on the previous row context and facing issues when cell is edited. Based on column.editMode and current context renderer varies (it can be cellEditRenderer)\n\n const columnRendererProps = {\n ...column.getRenderingEngineProps(),\n context: {\n getValue: () => groupHeader.name,\n getExecutionContext: () => {\n return { getValue: () => groupHeader.data, name: 'groupHeader' };\n }\n }\n };\n\n return <RenderingEngine {...columnRendererProps} />;\n}\n\n// NOTE: While making any changes in GroupRenderer.jsx, also make similar changes in HierarchicalGroupRenderer.jsx file if applicable\n\nexport default function GroupHeader({ groupHeader, columns }) {\n const buttonRef = useRef();\n\n // TODO: This we are adding temporary to show freeze border until we make group header rendering change\n // when we will pick up aggregation.\n if (!groupHeader.isVisible) return null;\n\n const view = columns[0].parent;\n // If grouping by a regular column (i.e. without a dateFunction), determine props for the renderer\n const {\n columnId,\n dateFunction,\n customFunction,\n additionalFields = []\n } = getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\n // if state.groups is not yet prepared/updated, then getGroupFromKey will return undefined\n if (!columnId) {\n return null;\n }\n\n const column = columns.find(c => c.field.id === columnId);\n const formatter = view.getFormatterByKey('Integer');\n const { locale } = view.meta;\n const groupCountFormatted = formatter\n ? formatter(groupHeader.count, { locale })\n : groupHeader.count;\n const isAggregationApplied = columns.filter(c => !c.hidden).some(c => c.aggregated);\n\n // FIXME: Import rather than COPY, i would rather\n return (\n <StyledGroupHeader\n groupHeader={groupHeader}\n className={cx('row group-header-row sticky-group-header')}\n data-test-id='groupHeader'\n data-testid={TestIdConstants.groupHeader}\n isAggregationApplied={isAggregationApplied}\n role='row'\n onFocus={e => {\n if (buttonRef.current && !e.currentTarget.contains(e.relatedTarget)) {\n e.preventDefault();\n buttonRef.current.focus();\n }\n }}\n >\n <div className='stickyGroupHeader'>\n <BareButton\n ref={buttonRef}\n aria-label={`${\n column.field.hideGroupColumnNameLabel ? '' : groupHeader.label\n } ${groupHeader.name}, ${groupCountFormatted} items`}\n aria-expanded={!!groupHeader.isExpanded}\n style={{\n paddingRight: 'var(--group-left)'\n }}\n onClick={() => groupHeader.count > 0 && view.type.toggleGroupExpansion({ groupHeader })}\n tabIndex={-1}\n icon\n >\n {groupHeader.count > 0 &&\n (groupHeader.isExpanded ? <Icon name='caret-down' /> : <Icon name='caret-right' />)}\n <div className='group-wrapper'>\n <div className='group-label' />\n {!column.field.hideGroupColumnNameLabel && (\n <span\n className='group-header-groupby'\n data-test-id={groupHeader.groupBy}\n data-testid={`${TestIdConstants.groupHeaderGroupBy}-${groupHeader.groupBy}`}\n >\n {groupHeader.label}:\n </span>\n )}\n <div className='group-label' />\n <span\n className='group-context-count'\n style={{ display: 'inline-flex' }}\n data-test-id='groupHeader'\n data-testid={TestIdConstants.groupHeaderCount}\n >\n <GroupName\n view={view}\n column={column}\n groupHeader={groupHeader}\n dateFunction={dateFunction}\n customFunction={customFunction}\n />\n {/* adding whitespace pre to preserve the space at the begining of count text */}\n <span className='group-count'>{` (${groupCountFormatted})`}</span>\n </span>\n {!!(groupHeader.additionalFieldsData?.length && additionalFields.length) && (\n <>\n <Text aria-hidden variant='secondary' as={GroupAdditionalInfoSeparator}>\n •\n </Text>\n <StyledMetaList\n wrapItems={false}\n items={[\n ...groupHeader.additionalFieldsData.map(additionalFieldsData => (\n <GroupAdditionalInfo\n additionalFieldData={additionalFieldsData}\n additionalField={additionalFields.find(\n additionalField => additionalField.id === additionalFieldsData.id\n )}\n columns={columns}\n groupHeader={groupHeader}\n />\n ))\n ]}\n />\n </>\n )}\n </div>\n </BareButton>\n </div>\n <div className='group-header-aggregation-row'>\n {columns.map(c => {\n const cxt = {\n getValue: () =>\n groupHeader?.aggregation?.[c.field.name]?.[c.aggregationType?.toLowerCase()]\n };\n return (\n <AggregatorCell\n key={c.field.id}\n column={c}\n context={cxt}\n className={cx('cell', {\n 'cell-fixed': column.frozen\n })}\n />\n );\n })}\n </div>\n </StyledGroupHeader>\n );\n}\n\nGroupHeader.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.any).isRequired,\n groupHeader: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/RSWrapper/__mocks__/uuid.js"],"names":[],"mappings":"AACA,6BAA8B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../../../../Core/Components/RSWrapper/__mocks__/uuid.js"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,CAAC","sourcesContent":["/* eslint-disable import/prefer-default-export */\nconst v4 = () => 'someDummyID';\nexport { v4 };\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
-
declare const _default: import("react").MemoExoticComponent<({ template }: {
|
|
3
|
-
template: RsCoreTypes.Meta["template"];
|
|
4
|
-
}) => import("react/jsx-runtime").JSX.Element | null>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=KeyboardInstructions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardInstructions.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/KeyboardInstructions.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiC,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;2EASrD;IAAE,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;CAAE;AAkCtF,wBAA0C"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';
|
|
5
|
-
import { Text, Flex, UnorderedList } from '@pega/cosmos-react-core';
|
|
6
|
-
import useTranslate from '../../Hooks/useTranslate';
|
|
7
|
-
const InstructionLabel = styled(Text) `
|
|
8
|
-
font-weight: ${({ theme }) => theme.base['font-weight'].bold};
|
|
9
|
-
`;
|
|
10
|
-
const KeyboardInstructions = ({ template }) => {
|
|
11
|
-
const [translate] = useTranslate();
|
|
12
|
-
if (template === REPEATING_STRUCTURE_TEMPLATES.TABLE) {
|
|
13
|
-
const keyboardInstructions = [
|
|
14
|
-
{
|
|
15
|
-
label: translate('table_a11y_instructions_arrow_keys_label'),
|
|
16
|
-
description: translate('table_a11y_instructions_arrow_keys_description')
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: translate('table_a11y_instructions_enter_label'),
|
|
20
|
-
description: translate('table_a11y_instructions_enter_description')
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: translate('table_a11y_instructions_escape_label'),
|
|
24
|
-
description: translate('table_a11y_instructions_escape_description')
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
return (_jsxs(Flex, { container: { gap: 2, direction: 'column' }, children: [_jsx(Text, { as: 'p', children: translate('table_a11y_intro') }), _jsx(UnorderedList, { items: keyboardInstructions.map(instruction => (_jsxs(_Fragment, { children: [_jsx(InstructionLabel, { children: instruction.label }), " \u2013", ' ', instruction.description] }))) })] }));
|
|
28
|
-
}
|
|
29
|
-
return null;
|
|
30
|
-
};
|
|
31
|
-
export default memo(KeyboardInstructions);
|
|
32
|
-
//# sourceMappingURL=KeyboardInstructions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardInstructions.js","sourceRoot":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,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAC7C,8BACE,KAAC,gBAAgB,cAAE,WAAW,CAAC,KAAK,GAAoB,aAAS,GAAG,EACnE,WAAW,CAAC,WAAW,IACvB,CACJ,CAAC,GACF,IACG,CACR,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["import { memo } from 'react';\nimport styled from 'styled-components';\n\nimport { REPEATING_STRUCTURE_TEMPLATES, type RsCoreTypes } from 'pega-repeating-structures-core';\nimport { Text, Flex, UnorderedList } from '@pega/cosmos-react-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst InstructionLabel = styled(Text)`\n font-weight: ${({ theme }) => theme.base['font-weight'].bold};\n`;\n\nconst KeyboardInstructions = ({ template }: { template: RsCoreTypes.Meta['template'] }) => {\n const [translate] = useTranslate();\n if (template === REPEATING_STRUCTURE_TEMPLATES.TABLE) {\n const keyboardInstructions = [\n {\n label: translate('table_a11y_instructions_arrow_keys_label'),\n description: translate('table_a11y_instructions_arrow_keys_description')\n },\n {\n label: translate('table_a11y_instructions_enter_label'),\n description: translate('table_a11y_instructions_enter_description')\n },\n {\n label: translate('table_a11y_instructions_escape_label'),\n description: translate('table_a11y_instructions_escape_description')\n }\n ];\n return (\n <Flex container={{ gap: 2, direction: 'column' }}>\n <Text as='p'>{translate('table_a11y_intro')}</Text>\n <UnorderedList\n items={keyboardInstructions.map(instruction => (\n <>\n <InstructionLabel>{instruction.label}</InstructionLabel> –{' '}\n {instruction.description}\n </>\n ))}\n />\n </Flex>\n );\n }\n return null;\n};\n\nexport default memo(KeyboardInstructions);\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OmitStrict, ListToolbarProps } from '@pega/cosmos-react-core';
|
|
2
|
-
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
3
|
-
declare const TimelineToolbar: ({ view, ...restProps }: {
|
|
4
|
-
view: RsCoreTypes.View;
|
|
5
|
-
} & OmitStrict<ListToolbarProps, "sort" | "group">) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export default TimelineToolbar;
|
|
7
|
-
//# sourceMappingURL=TimelineToolbar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineToolbar.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/Timeline/TimelineToolbar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAMlE,QAAA,MAAM,eAAe,GAAI,wBAGtB;IACD,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;CACxB,GAAG,UAAU,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,4CAiHjD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { ListToolbar, useI18n } from '@pega/cosmos-react-core';
|
|
4
|
-
import { TOOLBAR_FEATURES } from '../../../constants';
|
|
5
|
-
import { mapDateFnToGroupOption } from '../../../Views/Timeline/utility';
|
|
6
|
-
const TimelineToolbar = ({ view, ...restProps }) => {
|
|
7
|
-
const t = useI18n();
|
|
8
|
-
const displaySort = view.shouldDisplayFeature(TOOLBAR_FEATURES.SORT);
|
|
9
|
-
const displayGrouping = view.shouldDisplayFeature(TOOLBAR_FEATURES.GROUPING);
|
|
10
|
-
const sort = useMemo(() => {
|
|
11
|
-
const selected = view.state.sortingOrder?.[0]?.order === 'asc' ? 'ascending' : 'descending';
|
|
12
|
-
return {
|
|
13
|
-
mode: 'single-select',
|
|
14
|
-
items: [
|
|
15
|
-
{
|
|
16
|
-
id: 'descending',
|
|
17
|
-
text: t('timeline_toolbar_sort_descending'),
|
|
18
|
-
icon: 'arrow-down',
|
|
19
|
-
selected: selected === 'descending'
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: 'ascending',
|
|
23
|
-
text: t('timeline_toolbar_sort_ascending'),
|
|
24
|
-
icon: 'arrow-up',
|
|
25
|
-
selected: selected === 'ascending'
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
onItemClick: id => {
|
|
29
|
-
if (view.state?.sortingOrder?.[0]) {
|
|
30
|
-
view.type.applySorting([
|
|
31
|
-
{
|
|
32
|
-
...view.state.sortingOrder[0],
|
|
33
|
-
order: id === 'ascending' ? 'asc' : 'desc'
|
|
34
|
-
}
|
|
35
|
-
]);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}, [view.state.sortingOrder, view.type.applySorting]);
|
|
40
|
-
const group = useMemo(() => {
|
|
41
|
-
const selected = mapDateFnToGroupOption(view.state.groups?.[0]?.dateFunction);
|
|
42
|
-
return {
|
|
43
|
-
mode: 'single-select',
|
|
44
|
-
items: [
|
|
45
|
-
{
|
|
46
|
-
id: 'date',
|
|
47
|
-
text: t('timeline_toolbar_group_date'),
|
|
48
|
-
selected: selected === 'date'
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: 'monthyear',
|
|
52
|
-
text: t('timeline_toolbar_group_monthyear'),
|
|
53
|
-
selected: selected === 'monthyear'
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: 'quarteryear',
|
|
57
|
-
text: t('timeline_toolbar_group_quarteryear'),
|
|
58
|
-
selected: selected === 'quarteryear'
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: 'year',
|
|
62
|
-
text: t('timeline_toolbar_group_year'),
|
|
63
|
-
selected: selected === 'year'
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: 'none',
|
|
67
|
-
text: t('timeline_toolbar_group_none'),
|
|
68
|
-
selected: selected === 'none'
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
onItemClick: id => {
|
|
72
|
-
let dateFunction;
|
|
73
|
-
switch (id) {
|
|
74
|
-
case 'year':
|
|
75
|
-
dateFunction = 'YEARS';
|
|
76
|
-
break;
|
|
77
|
-
case 'quarteryear':
|
|
78
|
-
dateFunction = 'QUARTERS';
|
|
79
|
-
break;
|
|
80
|
-
case 'monthyear':
|
|
81
|
-
dateFunction = 'MONTHS';
|
|
82
|
-
break;
|
|
83
|
-
case 'date':
|
|
84
|
-
dateFunction = 'DAYS';
|
|
85
|
-
break;
|
|
86
|
-
default:
|
|
87
|
-
}
|
|
88
|
-
view.type.applyGrouping(dateFunction && view.meta.timelineFields?.date?.label
|
|
89
|
-
? [
|
|
90
|
-
{
|
|
91
|
-
columnId: view.meta.timelineFields.date.label,
|
|
92
|
-
dateFunction,
|
|
93
|
-
level: 0,
|
|
94
|
-
order: view.state.sortingOrder?.[0]?.order ?? 'desc'
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
: []);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
}, [
|
|
101
|
-
view.state.groups,
|
|
102
|
-
view.type.applyGrouping,
|
|
103
|
-
view.meta.timelineFields?.date,
|
|
104
|
-
view.state.sortingOrder
|
|
105
|
-
]);
|
|
106
|
-
return (_jsx(ListToolbar, { ...restProps, sort: displaySort ? sort : undefined, group: view.meta.grouping && displayGrouping ? group : undefined }));
|
|
107
|
-
};
|
|
108
|
-
export default TimelineToolbar;
|
|
109
|
-
//# sourceMappingURL=TimelineToolbar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineToolbar.js","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/Timeline/TimelineToolbar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,yBAA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Aa;wBAChB,YAAY,GAAG,UAAU,CAAC;wBAC1B,MAAM;oBACR,KAAK,WAAW;wBACd,YAAY,GAAG,QAAQ,CAAC;wBACxB,MAAM;oBACR,KAAK,MAAM;wBACT,YAAY,GAAG,MAAM,CAAC;wBACtB,MAAM;oBACR,QAAQ;gBACV,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,aAAa,CACrB,YAAY,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,KAAK;oBACnD,CAAC,CAAC;wBACE;4BACE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK;4BAC7C,YAAY;4BACZ,KAAK,EAAE,CAAC;4BACR,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,MAAM;yBACrD;qBACF;oBACH,CAAC,CAAC,EAAE,CACP,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC,EAAE;QACD,IAAI,CAAC,KAAK,CAAC,MAAM;QACjB,IAAI,CAAC,IAAI,CAAC,aAAa;QACvB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI;QAC9B,IAAI,CAAC,KAAK,CAAC,YAAY;KACxB,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,WAAW,OACN,SAAS,EACb,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACpC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,GAChE,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import type { Group } from 'packages/lists-rs-core/types/State.types';\nimport { useMemo } from 'react';\n\nimport type { OmitStrict, ListToolbarProps } from '@pega/cosmos-react-core';\nimport type { PresetMenuProps } from '@pega/cosmos-react-core/lib/components/ListToolbar/ListToolbar.types';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport { ListToolbar, useI18n } from '@pega/cosmos-react-core';\n\nimport { TOOLBAR_FEATURES } from '../../../constants';\nimport { mapDateFnToGroupOption } from '../../../Views/Timeline/utility';\n\nconst TimelineToolbar = ({\n view,\n ...restProps\n}: {\n view: RsCoreTypes.View;\n} & OmitStrict<ListToolbarProps, 'sort' | 'group'>) => {\n const t = useI18n();\n const displaySort = view.shouldDisplayFeature(TOOLBAR_FEATURES.SORT);\n const displayGrouping = view.shouldDisplayFeature(TOOLBAR_FEATURES.GROUPING);\n\n const sort: PresetMenuProps = useMemo(() => {\n const selected = view.state.sortingOrder?.[0]?.order === 'asc' ? 'ascending' : 'descending';\n return {\n mode: 'single-select',\n items: [\n {\n id: 'descending',\n text: t('timeline_toolbar_sort_descending'),\n icon: 'arrow-down',\n selected: selected === 'descending'\n },\n {\n id: 'ascending',\n text: t('timeline_toolbar_sort_ascending'),\n icon: 'arrow-up',\n selected: selected === 'ascending'\n }\n ],\n onItemClick: id => {\n if (view.state?.sortingOrder?.[0]) {\n view.type.applySorting([\n {\n ...view.state.sortingOrder[0],\n order: id === 'ascending' ? 'asc' : 'desc'\n }\n ]);\n }\n }\n };\n }, [view.state.sortingOrder, view.type.applySorting]);\n\n const group: PresetMenuProps = useMemo(() => {\n const selected = mapDateFnToGroupOption(view.state.groups?.[0]?.dateFunction);\n\n return {\n mode: 'single-select',\n items: [\n {\n id: 'date',\n text: t('timeline_toolbar_group_date'),\n selected: selected === 'date'\n },\n {\n id: 'monthyear',\n text: t('timeline_toolbar_group_monthyear'),\n selected: selected === 'monthyear'\n },\n {\n id: 'quarteryear',\n text: t('timeline_toolbar_group_quarteryear'),\n selected: selected === 'quarteryear'\n },\n {\n id: 'year',\n text: t('timeline_toolbar_group_year'),\n selected: selected === 'year'\n },\n {\n id: 'none',\n text: t('timeline_toolbar_group_none'),\n selected: selected === 'none'\n }\n ],\n onItemClick: id => {\n let dateFunction: Group['dateFunction'];\n switch (id) {\n case 'year':\n dateFunction = 'YEARS';\n break;\n case 'quarteryear':\n dateFunction = 'QUARTERS';\n break;\n case 'monthyear':\n dateFunction = 'MONTHS';\n break;\n case 'date':\n dateFunction = 'DAYS';\n break;\n default:\n }\n view.type.applyGrouping(\n dateFunction && view.meta.timelineFields?.date?.label\n ? [\n {\n columnId: view.meta.timelineFields.date.label,\n dateFunction,\n level: 0,\n order: view.state.sortingOrder?.[0]?.order ?? 'desc'\n }\n ]\n : []\n );\n }\n };\n }, [\n view.state.groups,\n view.type.applyGrouping,\n view.meta.timelineFields?.date,\n view.state.sortingOrder\n ]);\n\n return (\n <ListToolbar\n {...restProps}\n sort={displaySort ? sort : undefined}\n group={view.meta.grouping && displayGrouping ? group : undefined}\n />\n );\n};\n\nexport default TimelineToolbar;\n"]}
|