@pega/lists-react 9.0.0-build.2.8 → 9.0.0-build.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -4
- package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts +10 -5
- package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts.map +1 -1
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js +27 -2
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js.map +1 -1
- package/lib/Core/Components/AggregateMenu.d.ts +1 -0
- package/lib/Core/Components/AggregateMenu.d.ts.map +1 -1
- package/lib/Core/Components/AggregateMenu.js +32 -18
- package/lib/Core/Components/AggregateMenu.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 +91 -163
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js.map +1 -1
- package/lib/Core/Components/ContextMenu/QuickFilter.js +7 -7
- 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 +2 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js +9 -21
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.js +4 -3
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.js +4 -3
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts +0 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js +0 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts +5 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js +12 -5
- 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 +5 -0
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts +5 -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/CommonFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/CommonFilter.js +2 -2
- package/lib/Core/Components/Filters/CommonFilter.js.map +1 -1
- package/lib/Core/Components/Filters/FilterType.js +5 -5
- package/lib/Core/Components/Filters/FilterType.js.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.js +2 -2
- package/lib/Core/Components/Filters/SelectFilter.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 +3 -2
- 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.d.ts → GroupRenderer/index.d.ts} +8 -1
- package/lib/Core/Components/GroupRenderer/index.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/index.js +367 -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 +6 -5
- 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 +8 -5
- package/lib/Core/Components/HeaderCell.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.js +3 -3
- 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 +2 -2
- package/lib/Core/Components/HeaderMenu/index.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/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/RenderingEngine/RenderCell.d.ts +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js +2 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js.map +1 -1
- package/lib/Core/Components/TestIdConstants.d.ts +1 -0
- package/lib/Core/Components/TestIdConstants.js +2 -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 +9 -33
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.d.ts +1 -1
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.js +1 -1
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.js.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts +20 -9
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.js +89 -65
- 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 +1 -0
- package/lib/Core/Components/Toolbar/FieldSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/FieldSelector.js +3 -2
- 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/SimpleToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.js +4 -3
- package/lib/Core/Components/Toolbar/SimpleToolbar.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 +2 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js +10 -7
- 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 +6 -3
- 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 +11 -3
- 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 +81 -79
- 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 +6 -9
- package/lib/Core/Components/Toolbar/hooks/useSearch.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts +4 -4
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js +6 -6
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts +2 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js +8 -2
- 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 +2 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts +6 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js +17 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js.map +1 -0
- package/lib/Core/Components/Toolbar/utils/utils.d.ts +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.js +2 -1
- 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.d.ts +97 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js +251 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.d.ts +22 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.js +38 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.d.ts +22 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.js +45 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.d.ts +49 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.js +55 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.d.ts +21 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.js +39 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.d.ts +38 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.js +62 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts +112 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js +214 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js.map +1 -0
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js +21 -8
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -1
- package/lib/Core/Components/Virtualise/index.js +21 -13
- package/lib/Core/Components/Virtualise/index.js.map +1 -1
- package/lib/Core/Components/Virtualise/utility.d.ts +1 -1
- package/lib/Core/Components/Virtualise/utility.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/utility.js +3 -2
- package/lib/Core/Components/Virtualise/utility.js.map +1 -1
- 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 +19 -0
- package/lib/Core/Hooks/a11y/useAnnounce.d.ts.map +1 -0
- package/lib/Core/Hooks/a11y/useAnnounce.js +49 -0
- package/lib/Core/Hooks/a11y/useAnnounce.js.map +1 -0
- package/lib/Core/Hooks/useDragDrop.d.ts.map +1 -1
- package/lib/Core/Hooks/useDragDrop.js +2 -0
- package/lib/Core/Hooks/useDragDrop.js.map +1 -1
- package/lib/Core/Hooks/useRepeat.d.ts.map +1 -1
- package/lib/Core/Hooks/useRepeat.js +20 -1
- package/lib/Core/Hooks/useRepeat.js.map +1 -1
- package/lib/Core/Localization/defaultTranslations.d.ts +16 -13
- package/lib/Core/Localization/defaultTranslations.d.ts.map +1 -1
- package/lib/Core/Localization/defaultTranslations.js +17 -14
- package/lib/Core/Localization/defaultTranslations.js.map +1 -1
- package/lib/Core/Test/JUnitMocks.d.ts +6 -617
- package/lib/Core/Test/JUnitMocks.d.ts.map +1 -1
- package/lib/Core/Test/JUnitMocks.js +5 -4
- package/lib/Core/Test/JUnitMocks.js.map +1 -1
- package/lib/Core/Utils/index.d.ts +11 -0
- package/lib/Core/Utils/index.d.ts.map +1 -1
- package/lib/Core/Utils/index.js +22 -8
- 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 +18 -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/StyledGalleryContainer.d.ts +13 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js +30 -40
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js.map +1 -1
- 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 +22 -62
- 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 +91 -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 +10 -4
- package/lib/Core/Views/Map/index.js.map +1 -1
- package/lib/Core/Views/RsCardWrapper.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/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/Row.d.ts +3 -1
- package/lib/Core/Views/Table/Row.d.ts.map +1 -1
- package/lib/Core/Views/Table/Row.js +5 -3
- package/lib/Core/Views/Table/Row.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 +269 -158
- package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -1
- package/lib/Core/Views/Table/TableA11y.d.ts +11 -0
- package/lib/Core/Views/Table/TableA11y.d.ts.map +1 -1
- package/lib/Core/Views/Table/TableA11y.js +207 -2
- package/lib/Core/Views/Table/TableA11y.js.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts +5 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.js +38 -15
- 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 +6 -4
- package/lib/Core/Views/Table/index.js.map +1 -1
- package/lib/Core/Views/Table/useCountChange.d.ts +10 -0
- package/lib/Core/Views/Table/useCountChange.d.ts.map +1 -0
- package/lib/Core/Views/Table/useCountChange.js +39 -0
- package/lib/Core/Views/Table/useCountChange.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.d.ts +5 -0
- package/lib/Core/Views/Timeline/Timeline.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.js +28 -0
- package/lib/Core/Views/Timeline/Timeline.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts +393 -0
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.styles.js +175 -0
- package/lib/Core/Views/Timeline/Timeline.styles.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.types.d.ts +48 -0
- package/lib/Core/Views/Timeline/Timeline.types.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.types.js +2 -0
- package/lib/Core/Views/Timeline/Timeline.types.js.map +1 -0
- package/lib/Core/Views/Timeline/TimelineItem.d.ts +12 -0
- package/lib/Core/Views/Timeline/TimelineItem.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/TimelineItem.js +43 -0
- package/lib/Core/Views/Timeline/TimelineItem.js.map +1 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts +4 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.js +141 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.js.map +1 -0
- package/lib/Core/Views/Timeline/index.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/index.js +14 -8
- package/lib/Core/Views/Timeline/index.js.map +1 -1
- package/lib/Core/Views/Timeline/utils.d.ts +10 -0
- package/lib/Core/Views/Timeline/utils.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/utils.js +144 -0
- package/lib/Core/Views/Timeline/utils.js.map +1 -0
- package/lib/Core/Views/rs-styles.d.ts +1 -1
- 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/templateFeatureSupport.d.ts +17 -0
- package/lib/Core/templateFeatureSupport.d.ts.map +1 -0
- package/lib/Core/templateFeatureSupport.js +30 -0
- package/lib/Core/templateFeatureSupport.js.map +1 -0
- 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 -12
- 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 -35
- 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 -49
- 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 -63
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js.map +0 -1
- package/lib/Core/Components/EmptyContainer.d.ts +0 -5
- package/lib/Core/Components/EmptyContainer.d.ts.map +0 -1
- package/lib/Core/Components/EmptyContainer.js +0 -12
- package/lib/Core/Components/EmptyContainer.js.map +0 -1
- package/lib/Core/Components/GroupRenderer.d.ts.map +0 -1
- package/lib/Core/Components/GroupRenderer.js +0 -240
- package/lib/Core/Components/GroupRenderer.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 -8
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts.map +0 -1
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js +0 -61
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js.map +0 -1
- package/lib/Core/Hooks/useSelect.d.ts +0 -9
- package/lib/Core/Hooks/useSelect.d.ts.map +0 -1
- package/lib/Core/Hooks/useSelect.js +0 -24
- package/lib/Core/Hooks/useSelect.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/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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { Flex, Modal, UnorderedList } from '@pega/cosmos-react-core';
|
|
4
|
+
import { dateFunctionLabels, getGroupFromKey, FieldType } from 'pega-repeating-structures-core';
|
|
5
|
+
import useTranslate from '../../Hooks/useTranslate';
|
|
6
|
+
import { useFormattedAdditionalFieldData } from './GroupAdditionalInfo';
|
|
7
|
+
import { GroupName } from '.';
|
|
8
|
+
const DATE_TYPES = [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY];
|
|
9
|
+
const ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT = 10;
|
|
10
|
+
export const isDateLikeField = (type) => {
|
|
11
|
+
return DATE_TYPES.includes(type);
|
|
12
|
+
};
|
|
13
|
+
const GroupAdditionalFieldDataModalHeading = memo(({ groupHeader, column, view, dateFunction }) => {
|
|
14
|
+
const { label: groupHeaderLabel, groupBy } = groupHeader;
|
|
15
|
+
const { type: additionalFieldType } = column.field;
|
|
16
|
+
const { columns, state: { groups } } = view;
|
|
17
|
+
const [translate] = useTranslate();
|
|
18
|
+
const group = getGroupFromKey(groupBy, groups);
|
|
19
|
+
const groupHeaderColumn = columns?.find(c => c.field.id === group?.columnId);
|
|
20
|
+
// compute additional field label
|
|
21
|
+
const additionalFieldLabel = dateFunction && isDateLikeField(additionalFieldType)
|
|
22
|
+
? `${column.label} (${translate(dateFunctionLabels[dateFunction])})`
|
|
23
|
+
: column.label;
|
|
24
|
+
return (_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, "data-testid": 'group-additional-field-data-modal-heading', children: [_jsx("span", { children: `${groupHeaderLabel}:` }), _jsxs("span", { children: [_jsx(GroupName, { view: view, column: groupHeaderColumn, groupHeader: groupHeader, dateFunction: group?.dateFunction, customFunction: group?.customFunction }), ","] }), _jsx("span", { children: additionalFieldLabel })] }));
|
|
25
|
+
});
|
|
26
|
+
const AdditionalFieldItemRenderer = ({ value, additionalField, column, groupHeader }) => {
|
|
27
|
+
const { renderer } = useFormattedAdditionalFieldData({ value, count: 1, id: additionalField.id }, additionalField, { column, meta: column.parent.meta, groupHeader }, 'GroupHeader');
|
|
28
|
+
return renderer;
|
|
29
|
+
};
|
|
30
|
+
const GroupAdditionalFieldDataModal = ({ groupHeader, additionalField, column }) => {
|
|
31
|
+
const view = column.parent;
|
|
32
|
+
const { getAdditionalFieldData } = groupHeader;
|
|
33
|
+
const [limit, setLimit] = useState(ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT);
|
|
34
|
+
const [additionalFieldData, setAdditionalFieldData] = useState(null);
|
|
35
|
+
// Fetch additional field data once on mount
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
let isActive = true;
|
|
38
|
+
(async () => {
|
|
39
|
+
const data = await getAdditionalFieldData(additionalField);
|
|
40
|
+
if (isActive && data) {
|
|
41
|
+
setAdditionalFieldData({ values: data.values, hasMore: data.hasMore });
|
|
42
|
+
}
|
|
43
|
+
else if (!data) {
|
|
44
|
+
setAdditionalFieldData({ values: [], hasMore: false });
|
|
45
|
+
}
|
|
46
|
+
})();
|
|
47
|
+
return () => {
|
|
48
|
+
isActive = false;
|
|
49
|
+
};
|
|
50
|
+
}, [groupHeader, additionalField]);
|
|
51
|
+
// Toggle between showing limited and all additional field values in unordered list.
|
|
52
|
+
const handleToggleShow = useCallback(() => {
|
|
53
|
+
setLimit(prev => prev === ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT && additionalFieldData
|
|
54
|
+
? additionalFieldData.values.length
|
|
55
|
+
: ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT);
|
|
56
|
+
}, [additionalFieldData]);
|
|
57
|
+
const values = additionalFieldData?.values ?? [];
|
|
58
|
+
const hasMore = additionalFieldData?.hasMore ?? false;
|
|
59
|
+
return (_jsx(Modal, { autoWidth: true, heading: _jsx(GroupAdditionalFieldDataModalHeading, { column: column, dateFunction: 'dateFunction' in additionalField ? additionalField.dateFunction : undefined, groupHeader: groupHeader, view: view }), progress: !additionalFieldData, count: additionalFieldData ? { value: values.length, hasMore } : undefined, "data-testid": 'group-additional-field-data-modal', children: additionalFieldData && (_jsx(UnorderedList, { "data-testid": 'group-additional-field-data-modal-list', onToggleShow: values.length > ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT ? handleToggleShow : undefined, count: values.length > ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT ? values.length : undefined, items: values.slice(0, limit).map(value => (_jsx(AdditionalFieldItemRenderer, { value: value, additionalField: additionalField, column: column, groupHeader: groupHeader }))) })) }));
|
|
60
|
+
};
|
|
61
|
+
export default GroupAdditionalFieldDataModal;
|
|
62
|
+
//# sourceMappingURL=GroupAdditionalFieldDataModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupAdditionalFieldDataModal.js","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAsB,MAAM,yBAAyB,CAAC;A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CAAC,CAAC,SAAS,EAE9E,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,GACV,EAEJ,QAAQ,EAAE,CAAC,mBAAmB,EAC9B,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,iBAC9D,mCAAmC,YAE9C,mBAAmB,IAAI,CACtB,KAAC,aAAa,mBACA,wCAAwC,EACpD,YAAY,EACV,MAAM,CAAC,MAAM,GAAG,oCAAoC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,EAErF,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,oCAAoC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACvF,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACzC,KAAC,2BAA2B,IAC1B,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,GACxB,CACH,CAAC,GACF,CACH,GACK,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["import { memo, useCallback, useEffect, useState } from 'react';\n\nimport { Flex, Modal, UnorderedList, type ExcludeStrict } from '@pega/cosmos-react-core';\nimport {\n dateFunctionLabels,\n getGroupFromKey,\n FieldType,\n type RsCoreTypes\n} from 'pega-repeating-structures-core';\nimport type { DateFunction } from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/core/types';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport { useFormattedAdditionalFieldData } from './GroupAdditionalInfo';\n\nimport { GroupName } from '.';\n\nexport type GroupAdditionalFieldData = RsCoreTypes.GroupGenerator['additionalFieldsData'][0];\nexport type GetAdditionalDataResponse = NonNullable<\n Awaited<ReturnType<RsCoreTypes.GroupGenerator['getAdditionalFieldData']>>\n>;\ntype FieldTypes = (typeof FieldType)[keyof typeof FieldType];\n\nconst DATE_TYPES: readonly string[] = [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY];\nconst ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT = 10;\n\nexport const isDateLikeField = (\n type: FieldTypes\n): type is typeof FieldType.DATE | typeof FieldType.DATE_TIME | typeof FieldType.DATE_ONLY => {\n return DATE_TYPES.includes(type);\n};\n\nconst GroupAdditionalFieldDataModalHeading = memo(\n ({\n groupHeader,\n column,\n view,\n dateFunction\n }: {\n groupHeader: RsCoreTypes.GroupGenerator;\n column: RsCoreTypes.Column;\n view: RsCoreTypes.View;\n dateFunction: ExcludeStrict<DateFunction, 'SECONDS'> | undefined;\n }) => {\n const { label: groupHeaderLabel, groupBy } = groupHeader;\n const { type: additionalFieldType } = column.field;\n const {\n columns,\n state: { groups }\n } = view;\n const [translate] = useTranslate();\n\n const group = getGroupFromKey(groupBy, groups);\n const groupHeaderColumn = columns?.find(c => c.field.id === group?.columnId);\n // compute additional field label\n const additionalFieldLabel =\n dateFunction && isDateLikeField(additionalFieldType)\n ? `${column.label} (${translate(dateFunctionLabels[dateFunction])})`\n : column.label;\n\n return (\n <Flex\n container={{ alignItems: 'center', gap: 1 }}\n data-testid='group-additional-field-data-modal-heading'\n >\n <span>{`${groupHeaderLabel}:`}</span>\n <span>\n <GroupName\n view={view}\n column={groupHeaderColumn}\n groupHeader={groupHeader}\n dateFunction={group?.dateFunction}\n customFunction={group?.customFunction}\n />\n ,\n </span>\n <span>{additionalFieldLabel}</span>\n </Flex>\n );\n }\n);\n\nconst AdditionalFieldItemRenderer = ({\n value,\n additionalField,\n column,\n groupHeader\n}: {\n value: GroupAdditionalFieldData['value'];\n additionalField: RsCoreTypes.GroupAdditionalField;\n column: RsCoreTypes.Column;\n groupHeader: RsCoreTypes.GroupGenerator;\n}) => {\n const { renderer } = useFormattedAdditionalFieldData(\n { value, count: 1, id: additionalField.id },\n additionalField,\n { column, meta: column.parent.meta, groupHeader },\n 'GroupHeader'\n );\n return renderer;\n};\n\nconst GroupAdditionalFieldDataModal = ({\n groupHeader,\n additionalField,\n column\n}: {\n groupHeader: RsCoreTypes.GroupGenerator;\n additionalField: RsCoreTypes.GroupAdditionalField;\n column: RsCoreTypes.Column;\n}) => {\n const view = column.parent;\n const { getAdditionalFieldData } = groupHeader;\n\n const [limit, setLimit] = useState(ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT);\n const [additionalFieldData, setAdditionalFieldData] = useState<GetAdditionalDataResponse | null>(\n null\n );\n\n // Fetch additional field data once on mount\n useEffect(() => {\n let isActive = true;\n (async () => {\n const data = await getAdditionalFieldData(additionalField);\n if (isActive && data) {\n setAdditionalFieldData({ values: data.values, hasMore: data.hasMore });\n } else if (!data) {\n setAdditionalFieldData({ values: [], hasMore: false });\n }\n })();\n return () => {\n isActive = false;\n };\n }, [groupHeader, additionalField]);\n\n // Toggle between showing limited and all additional field values in unordered list.\n const handleToggleShow = useCallback(() => {\n setLimit(prev =>\n prev === ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT && additionalFieldData\n ? additionalFieldData.values.length\n : ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT\n );\n }, [additionalFieldData]);\n\n const values = additionalFieldData?.values ?? [];\n const hasMore = additionalFieldData?.hasMore ?? false;\n\n return (\n <Modal\n autoWidth\n heading={\n <GroupAdditionalFieldDataModalHeading\n column={column}\n dateFunction={\n 'dateFunction' in additionalField ? additionalField.dateFunction : undefined\n }\n groupHeader={groupHeader}\n view={view}\n />\n }\n progress={!additionalFieldData}\n count={additionalFieldData ? { value: values.length, hasMore } : undefined}\n data-testid='group-additional-field-data-modal'\n >\n {additionalFieldData && (\n <UnorderedList\n data-testid='group-additional-field-data-modal-list'\n onToggleShow={\n values.length > ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT ? handleToggleShow : undefined\n }\n count={values.length > ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT ? values.length : undefined}\n items={values.slice(0, limit).map(value => (\n <AdditionalFieldItemRenderer\n value={value}\n additionalField={additionalField}\n column={column}\n groupHeader={groupHeader}\n />\n ))}\n />\n )}\n </Modal>\n );\n};\n\nexport default GroupAdditionalFieldDataModal;\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
import { type GroupAdditionalFieldData } from './GroupAdditionalFieldDataModal';
|
|
3
|
+
type AdditionalFieldRendererContext = 'GroupHeader' | 'GroupHeaderTooltip';
|
|
4
|
+
type GroupAdditionalInfoProps = {
|
|
5
|
+
additionalFieldData: GroupAdditionalFieldData;
|
|
6
|
+
columns: RsCoreTypes.Column[];
|
|
7
|
+
groupHeader: RsCoreTypes.GroupGenerator;
|
|
8
|
+
additionalField: RsCoreTypes.GroupAdditionalField;
|
|
9
|
+
rendererContext: AdditionalFieldRendererContext;
|
|
10
|
+
};
|
|
11
|
+
export declare const useFormattedAdditionalFieldData: (additionalFieldData: GroupAdditionalFieldData, additionalField: RsCoreTypes.GroupAdditionalField, { column, meta, groupHeader }: {
|
|
12
|
+
column: RsCoreTypes.Column | null;
|
|
13
|
+
meta: RsCoreTypes.Meta | null;
|
|
14
|
+
groupHeader: RsCoreTypes.GroupGenerator;
|
|
15
|
+
}, rendererContext: AdditionalFieldRendererContext) => {
|
|
16
|
+
label: null;
|
|
17
|
+
renderer: null;
|
|
18
|
+
} | {
|
|
19
|
+
label: string;
|
|
20
|
+
renderer: string | number | null;
|
|
21
|
+
} | {
|
|
22
|
+
label: string;
|
|
23
|
+
renderer: import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
} | {
|
|
25
|
+
label: string;
|
|
26
|
+
renderer: import("react/jsx-runtime").JSX.Element | "Multiple";
|
|
27
|
+
} | {
|
|
28
|
+
label: string | undefined;
|
|
29
|
+
renderer: import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
};
|
|
31
|
+
declare const GroupAdditionalInfo: ({ additionalFieldData, columns, groupHeader, additionalField, rendererContext }: GroupAdditionalInfoProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
32
|
+
export default GroupAdditionalInfo;
|
|
33
|
+
//# sourceMappingURL=GroupAdditionalInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupAdditionalInfo.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/GroupAdditionalInfo.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAiC,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAcjG,OAAsC,EAEpC,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AAEzC,KAAK,8BAA8B,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAC3E,KAAK,wBAAwB,GAAG;IAC9B,mBAAmB,EAAE,wBAAwB,CAAC;IAC9C,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC;IACxC,eAAe,EAAE,WAAW,CAAC,oBAAoB,CAAC;IAClD,eAAe,EAAE,8BAA8B,CAAC;CACjD,CAAC;AAgCF,eAAO,MAAM,+BAA+B,GAC1C,qBAAqB,wBAAwB,EAC7C,iBAAiB,WAAW,CAAC,oBAAoB,EACjD,+BAIG;IACD,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC;IAClC,IAAI,EAAE,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC;CACzC,EACD,iBAAiB,8BAA8B;;;;;;;;;;;;;;;CAmGhD,CAAC;AAEF,QAAA,MAAM,mBAAmB,GAAI,iFAM1B,wBAAwB,mDAqC1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Text, useModalManager, Button, VisuallyHiddenText } from '@pega/cosmos-react-core';
|
|
5
|
+
import { dateFunctionLabels, FieldType } from 'pega-repeating-structures-core';
|
|
6
|
+
import { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';
|
|
7
|
+
import useTranslate from '../../Hooks/useTranslate';
|
|
8
|
+
import { getFormattedAggregationValue } from '../AggregateMenu';
|
|
9
|
+
import DateValueDisplay from '../DateValueDisplay';
|
|
10
|
+
import RenderingEngine from '../RenderingEngine/RenderCell';
|
|
11
|
+
import { resolveCellComponent, resolveViewComponent } from '../RenderingEngine/ComponentResolverFactory';
|
|
12
|
+
import GlobalContext from '../../Context/GlobalContext';
|
|
13
|
+
import GroupAdditionalFieldDataModal, { isDateLikeField } from './GroupAdditionalFieldDataModal';
|
|
14
|
+
const isAdditionalFieldWithDateFunction = (additionalField) => {
|
|
15
|
+
return 'dateFunction' in additionalField && Boolean(additionalField.dateFunction);
|
|
16
|
+
};
|
|
17
|
+
const ConditionalEllipsisText = styled(Text) `
|
|
18
|
+
${({ ellipsis }) => ellipsis && ellipsisOverflow}
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
min-width: 0;
|
|
21
|
+
`;
|
|
22
|
+
function withGlobalContext(Component) {
|
|
23
|
+
return function WithGlobalContext(props) {
|
|
24
|
+
const globalContext = useMemo(() => ({
|
|
25
|
+
resolveCellComponent,
|
|
26
|
+
resolveViewComponent
|
|
27
|
+
}), []);
|
|
28
|
+
return (_jsx(GlobalContext.Provider, { value: globalContext, children: _jsx(Component, { ...props }) }));
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export const useFormattedAdditionalFieldData = (additionalFieldData, additionalField, { column, meta, groupHeader }, rendererContext) => {
|
|
32
|
+
const [translate] = useTranslate();
|
|
33
|
+
const { create } = useModalManager();
|
|
34
|
+
if (!column || !meta) {
|
|
35
|
+
return { label: null, renderer: null };
|
|
36
|
+
}
|
|
37
|
+
const { value, count = 0 } = additionalFieldData || {};
|
|
38
|
+
const { locale, timezone } = meta;
|
|
39
|
+
const { label, field: { type, name: additionalFieldName } } = column;
|
|
40
|
+
const isDateFieldWithDateFunction = isDateLikeField(type) && isAdditionalFieldWithDateFunction(additionalField);
|
|
41
|
+
const dateFunctionLabel = isDateFieldWithDateFunction
|
|
42
|
+
? translate(dateFunctionLabels[additionalField.dateFunction])
|
|
43
|
+
: null;
|
|
44
|
+
// Additional field as aggregation
|
|
45
|
+
if ('aggregation' in additionalField &&
|
|
46
|
+
additionalField.aggregation &&
|
|
47
|
+
type === FieldType.NUMBER) {
|
|
48
|
+
return {
|
|
49
|
+
label: `${label}(${translate(additionalField.aggregation)})`,
|
|
50
|
+
renderer: typeof value === 'string' || typeof value === 'number'
|
|
51
|
+
? getFormattedAggregationValue(value, additionalField.aggregation, column)
|
|
52
|
+
: null
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
// Additional field as Date part
|
|
56
|
+
if (count === 1 && isDateFieldWithDateFunction) {
|
|
57
|
+
return {
|
|
58
|
+
label: `${label}${dateFunctionLabel ? ` (${dateFunctionLabel})` : ''}`,
|
|
59
|
+
renderer: (typeof value === 'string' || typeof value === 'number') && locale && timezone ? (_jsx(DateValueDisplay, { value: value, dateFunction: additionalField.dateFunction, locale: locale, timezone: timezone })) : null
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// Additional field as normal field but with multiple values.
|
|
63
|
+
if (count > 1) {
|
|
64
|
+
return {
|
|
65
|
+
label: `${label}${dateFunctionLabel ? ` (${dateFunctionLabel})` : ''}`,
|
|
66
|
+
renderer: rendererContext === 'GroupHeader' ? (_jsx(Button, { variant: 'link', onClick: (event) => {
|
|
67
|
+
create(withGlobalContext(GroupAdditionalFieldDataModal), {
|
|
68
|
+
groupHeader,
|
|
69
|
+
additionalField,
|
|
70
|
+
column
|
|
71
|
+
});
|
|
72
|
+
// Stop propagation to avoid group expand/collapse on button click
|
|
73
|
+
event.stopPropagation();
|
|
74
|
+
}, children: translate('Multiple') })) : (translate('Multiple'))
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// Additional field as normal field.
|
|
78
|
+
column.setExecutionContext(null);
|
|
79
|
+
return {
|
|
80
|
+
label,
|
|
81
|
+
renderer: (_jsx(RenderingEngine, { ...column.getRenderingEngineProps(),
|
|
82
|
+
context: {
|
|
83
|
+
...column.getContext(),
|
|
84
|
+
name: 'GroupAdditionalField',
|
|
85
|
+
getValue: () => value,
|
|
86
|
+
getExecutionContext: () => {
|
|
87
|
+
return {
|
|
88
|
+
getValue: () => ({ ...groupHeader.data, [additionalFieldName]: value }),
|
|
89
|
+
name: 'groupHeader'
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
} }))
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
const GroupAdditionalInfo = ({ additionalFieldData, columns, groupHeader, additionalField, rendererContext }) => {
|
|
96
|
+
const { id: fieldId } = additionalFieldData;
|
|
97
|
+
const column = columns.find(c => c.field.id === fieldId);
|
|
98
|
+
const { label, renderer } = useFormattedAdditionalFieldData(additionalFieldData, additionalField, { column: column ?? null, meta: column ? column.parent.meta : null, groupHeader }, rendererContext);
|
|
99
|
+
if (!column) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
const isGroupHeaderContext = rendererContext === 'GroupHeader';
|
|
103
|
+
return (_jsxs(_Fragment, { children: [_jsx(VisuallyHiddenText, { children: ', ' }), _jsxs(ConditionalEllipsisText, { ellipsis: isGroupHeaderContext, variant: isGroupHeaderContext ? 'secondary' : undefined, "data-testid": 'additional-field-label', children: [label, ":"] }), _jsx(ConditionalEllipsisText, { ellipsis: isGroupHeaderContext, variant: isGroupHeaderContext ? 'secondary' : undefined, "data-testid": 'additional-field-renderer', children: renderer })] }));
|
|
104
|
+
};
|
|
105
|
+
export default GroupAdditionalInfo;
|
|
106
|
+
//# sourceMappingURL=GroupAdditionalInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupAdditionalInfo.js","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/GroupAdditionalInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAA8C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAoB,MAAM,gCAAgC,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAG7E,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,OAAO,6BAA6B,EAAE,EACpC,eAAe,EAEhB,MAAM,iCAAiC,CAAC;AAWzC,MAAM,iCAAiC,GAAG,CACxC,eAAiD,EACM,EAAE;IACzD,OAAO,cAAc,IAAI,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AACpF,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAuB;IAC/D,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,IAAI,gBAAgB;;;CAGjD,CAAC;AAEF,SAAS,iBAAiB,CAAI,SAA2B;IACvD,OAAO,SAAS,iBAAiB,CAAC,KAA2B;QAC3D,MAAM,aAAa,GAAG,OAAO,C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AAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,EACjF,eAAe,CAChB,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,oBAAoB,GAAG,eAAe,KAAK,aAAa,CAAC;IAE/D,OAAO,CACL,8BAEE,KAAC,kBAAkB,cAAE,IAAI,GAAsB,EAC/C,MAAC,uBAAuB,IACtB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,iBAC3C,wBAAwB,aAEnC,KAAK,SACkB,EAC1B,KAAC,uBAAuB,IACtB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,iBAC3C,2BAA2B,YAEtC,QAAQ,GACe,IACzB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { useMemo, type ComponentType, type PropsWithChildren } from 'react';\nimport styled from 'styled-components';\n\nimport { Text, useModalManager, Button, VisuallyHiddenText } from '@pega/cosmos-react-core';\nimport { dateFunctionLabels, FieldType, type RsCoreTypes } from 'pega-repeating-structures-core';\nimport { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport type { DateGroupAdditionalField } from 'pega-repeating-structures-core/lib/types/State.types';\n\nimport useTranslate from '../../Hooks/useTranslate';\nimport { getFormattedAggregationValue } from '../AggregateMenu';\nimport DateValueDisplay from '../DateValueDisplay';\nimport RenderingEngine from '../RenderingEngine/RenderCell';\nimport {\n resolveCellComponent,\n resolveViewComponent\n} from '../RenderingEngine/ComponentResolverFactory';\nimport GlobalContext from '../../Context/GlobalContext';\n\nimport GroupAdditionalFieldDataModal, {\n isDateLikeField,\n type GroupAdditionalFieldData\n} from './GroupAdditionalFieldDataModal';\n\ntype AdditionalFieldRendererContext = 'GroupHeader' | 'GroupHeaderTooltip';\ntype GroupAdditionalInfoProps = {\n additionalFieldData: GroupAdditionalFieldData;\n columns: RsCoreTypes.Column[];\n groupHeader: RsCoreTypes.GroupGenerator;\n additionalField: RsCoreTypes.GroupAdditionalField;\n rendererContext: AdditionalFieldRendererContext;\n};\n\nconst isAdditionalFieldWithDateFunction = (\n additionalField: RsCoreTypes.GroupAdditionalField\n): additionalField is Required<DateGroupAdditionalField> => {\n return 'dateFunction' in additionalField && Boolean(additionalField.dateFunction);\n};\n\nconst ConditionalEllipsisText = styled(Text)<{ ellipsis: boolean }>`\n ${({ ellipsis }) => ellipsis && ellipsisOverflow}\n display: inline-flex;\n min-width: 0;\n`;\n\nfunction withGlobalContext<P>(Component: ComponentType<P>) {\n return function WithGlobalContext(props: PropsWithChildren<P>) {\n const globalContext = useMemo(\n () => ({\n resolveCellComponent,\n resolveViewComponent\n }),\n []\n );\n\n return (\n <GlobalContext.Provider value={globalContext}>\n <Component {...props} />\n </GlobalContext.Provider>\n );\n };\n}\n\nexport const useFormattedAdditionalFieldData = (\n additionalFieldData: GroupAdditionalFieldData,\n additionalField: RsCoreTypes.GroupAdditionalField,\n {\n column,\n meta,\n groupHeader\n }: {\n column: RsCoreTypes.Column | null;\n meta: RsCoreTypes.Meta | null;\n groupHeader: RsCoreTypes.GroupGenerator;\n },\n rendererContext: AdditionalFieldRendererContext\n) => {\n const [translate] = useTranslate();\n const { create } = useModalManager();\n if (!column || !meta) {\n return { label: null, renderer: null };\n }\n\n const { value, count = 0 } = additionalFieldData || {};\n const { locale, timezone } = meta;\n const {\n label,\n field: { type, name: additionalFieldName }\n } = column;\n const isDateFieldWithDateFunction =\n isDateLikeField(type) && isAdditionalFieldWithDateFunction(additionalField);\n const dateFunctionLabel = isDateFieldWithDateFunction\n ? translate(dateFunctionLabels[additionalField.dateFunction])\n : null;\n // Additional field as aggregation\n if (\n 'aggregation' in additionalField &&\n additionalField.aggregation &&\n type === FieldType.NUMBER\n ) {\n return {\n label: `${label}(${translate(additionalField.aggregation)})`,\n renderer:\n typeof value === 'string' || typeof value === 'number'\n ? getFormattedAggregationValue(value, additionalField.aggregation, column)\n : null\n };\n }\n\n // Additional field as Date part\n if (count === 1 && isDateFieldWithDateFunction) {\n return {\n label: `${label}${dateFunctionLabel ? ` (${dateFunctionLabel})` : ''}`,\n renderer:\n (typeof value === 'string' || typeof value === 'number') && locale && timezone ? (\n <DateValueDisplay\n value={value}\n dateFunction={additionalField.dateFunction}\n locale={locale}\n timezone={timezone}\n />\n ) : null\n };\n }\n\n // Additional field as normal field but with multiple values.\n if (count > 1) {\n return {\n label: `${label}${dateFunctionLabel ? ` (${dateFunctionLabel})` : ''}`,\n renderer:\n rendererContext === 'GroupHeader' ? (\n <Button\n variant='link'\n onClick={(event: MouseEvent) => {\n create(withGlobalContext(GroupAdditionalFieldDataModal), {\n groupHeader,\n additionalField,\n column\n });\n // Stop propagation to avoid group expand/collapse on button click\n event.stopPropagation();\n }}\n >\n {translate('Multiple')}\n </Button>\n ) : (\n translate('Multiple')\n )\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 {\n getValue: () => ({ ...groupHeader.data, [additionalFieldName]: value }),\n name: 'groupHeader'\n };\n }\n }\n }}\n />\n )\n };\n};\n\nconst GroupAdditionalInfo = ({\n additionalFieldData,\n columns,\n groupHeader,\n additionalField,\n rendererContext\n}: GroupAdditionalInfoProps) => {\n const { id: fieldId } = additionalFieldData;\n const column = columns.find(c => c.field.id === fieldId);\n\n const { label, renderer } = useFormattedAdditionalFieldData(\n additionalFieldData,\n additionalField,\n { column: column ?? null, meta: column ? column.parent.meta : null, groupHeader },\n rendererContext\n );\n\n if (!column) {\n return null;\n }\n\n const isGroupHeaderContext = rendererContext === 'GroupHeader';\n\n return (\n <>\n {/* For screen readers. */}\n <VisuallyHiddenText>{', '}</VisuallyHiddenText>\n <ConditionalEllipsisText\n ellipsis={isGroupHeaderContext}\n variant={isGroupHeaderContext ? 'secondary' : undefined}\n data-testid='additional-field-label'\n >\n {label}:\n </ConditionalEllipsisText>\n <ConditionalEllipsisText\n ellipsis={isGroupHeaderContext}\n variant={isGroupHeaderContext ? 'secondary' : undefined}\n data-testid='additional-field-renderer'\n >\n {renderer}\n </ConditionalEllipsisText>\n </>\n );\n};\n\nexport default GroupAdditionalInfo;\n"]}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export function GroupName({ view, column, groupHeader, dateFunction, customFunction }: {
|
|
2
|
+
view: any;
|
|
3
|
+
column: any;
|
|
4
|
+
groupHeader: any;
|
|
5
|
+
dateFunction: any;
|
|
6
|
+
customFunction: any;
|
|
7
|
+
}): any;
|
|
1
8
|
declare function GroupHeader({ groupHeader, columns }: {
|
|
2
9
|
groupHeader: any;
|
|
3
10
|
columns: any;
|
|
@@ -12,4 +19,4 @@ declare namespace GroupHeader {
|
|
|
12
19
|
}
|
|
13
20
|
export default GroupHeader;
|
|
14
21
|
import PropTypes from 'prop-types';
|
|
15
|
-
//# sourceMappingURL=
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":"AA+PA;;;;;;QAwCC;AA2GD;;;mDAiJC;;;;;;;;;;sBAniBqB,YAAY"}
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useRef, useCallback } from 'react';
|
|
4
|
+
import styled, { css } from 'styled-components';
|
|
5
|
+
import { Icon, Text, MetaList, Tooltip, VisuallyHiddenText, Flex } 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 { createClassName as cx } from '../../Utils';
|
|
9
|
+
import useTranslate from '../../Hooks/useTranslate';
|
|
10
|
+
import { customFunctions, intervalGroupingBoundaries } from '../../constants';
|
|
11
|
+
import AggregatorCell from '../AggregatorCell';
|
|
12
|
+
import RenderingEngine from '../RenderingEngine/RenderCell';
|
|
13
|
+
import DateValueDisplay from '../DateValueDisplay';
|
|
14
|
+
import TestIdConstants from '../TestIdConstants';
|
|
15
|
+
import GroupAdditionalInfo from './GroupAdditionalInfo';
|
|
16
|
+
const groupheaderleftdisplacement = headerLevel => `${(headerLevel.level + 1) * 0.5}rem`;
|
|
17
|
+
const ColorBadge = styled.div(({ theme, colorIndicator }) => {
|
|
18
|
+
const borderVerticalOuter = theme.components.table.border['vertical-outer'];
|
|
19
|
+
return css `
|
|
20
|
+
position: sticky;
|
|
21
|
+
inset-inline-start: 0;
|
|
22
|
+
z-index: 10;
|
|
23
|
+
|
|
24
|
+
&::before {
|
|
25
|
+
content: '';
|
|
26
|
+
position: absolute;
|
|
27
|
+
inset-block-start: 0;
|
|
28
|
+
inset-inline-start: 0;
|
|
29
|
+
width: 0.25rem;
|
|
30
|
+
height: 100%;
|
|
31
|
+
background-color: ${colorIndicator};
|
|
32
|
+
z-index: 12;
|
|
33
|
+
|
|
34
|
+
/* Apply border radius to group header when table vertical outer border was disabled */
|
|
35
|
+
${!borderVerticalOuter &&
|
|
36
|
+
css `
|
|
37
|
+
border-top-left-radius: min(${theme.base['border-radius']}, 0.25rem);
|
|
38
|
+
border-bottom-left-radius: min(${theme.base['border-radius']}, 0.25rem);
|
|
39
|
+
`}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* TODO: remove currentColor style after cosmos fixes the issue
|
|
45
|
+
* Cosmos yet to handle dark theme on BareButton
|
|
46
|
+
*/
|
|
47
|
+
const StyledGroupHeader = styled.div(({ theme, isAggregationApplied, groupHeader }) => {
|
|
48
|
+
const borderVerticalOuter = theme.components.table.border['vertical-outer'];
|
|
49
|
+
const borderHorizontalInner = theme.components.table.border['horizontal-inner'];
|
|
50
|
+
return css `
|
|
51
|
+
--group-left: ${groupheaderleftdisplacement(groupHeader)};
|
|
52
|
+
background-color: var(--group-bg-color);
|
|
53
|
+
|
|
54
|
+
&:has(button[aria-expanded='true']) {
|
|
55
|
+
filter: ${theme.base.shadow['low-filter']};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
${!borderHorizontalInner &&
|
|
59
|
+
css `
|
|
60
|
+
filter: ${theme.base.shadow['low-filter']};
|
|
61
|
+
`}
|
|
62
|
+
|
|
63
|
+
&.row.sticky-group-header {
|
|
64
|
+
position: sticky;
|
|
65
|
+
display: block;
|
|
66
|
+
top: calc(
|
|
67
|
+
${groupHeader.isLeafNode && groupHeader.level !== 0
|
|
68
|
+
? 'calc(var(--row-height) + var(--group-header-height))'
|
|
69
|
+
: 'var(--row-height)'}
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
/* z-index starting from 8 because freeze-line has z-index 7 */
|
|
73
|
+
z-index: ${`${8 + groupHeader.index}`};
|
|
74
|
+
> .cell-action,
|
|
75
|
+
.cell-fixed {
|
|
76
|
+
background-color: var(--group-bg-color);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.group-label {
|
|
81
|
+
width: 0.437rem;
|
|
82
|
+
display: inline-block;
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.group-header-groupby {
|
|
87
|
+
font-weight: ${theme.base['font-weight'].normal};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.group-context-count .group-count {
|
|
91
|
+
font-weight: ${theme.base['font-weight'].bold};
|
|
92
|
+
white-space: pre;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.row.group-header-row {
|
|
96
|
+
height: auto;
|
|
97
|
+
border-bottom: ${!isAggregationApplied && borderHorizontalInner
|
|
98
|
+
? 'var(--border-style)'
|
|
99
|
+
: 'none'};
|
|
100
|
+
|
|
101
|
+
.group-header-aggregation-row {
|
|
102
|
+
display: flex;
|
|
103
|
+
|
|
104
|
+
/* 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 */
|
|
105
|
+
height: ${isAggregationApplied ? 'var(--group-header-height)' : 0};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Apply border radius to group header when table vertical outer border was disabled */
|
|
110
|
+
${!borderVerticalOuter &&
|
|
111
|
+
css `
|
|
112
|
+
/* consider three group-header-rows stacked vertically, the first and second group headers have RULE 2 AND RULE 3 applied, the third group-header has only RULE 3 applied */
|
|
113
|
+
&.group-header-row {
|
|
114
|
+
/* RULE 1- if there are no adjacent group-headers, apply border-radius to all corners */
|
|
115
|
+
border-radius: min(${theme.base['border-radius']}, 0.25rem);
|
|
116
|
+
|
|
117
|
+
/* RULE-2- if there is an adjacent group-header below, remove bottom border-radius */
|
|
118
|
+
&:has(+ .group-header-row) {
|
|
119
|
+
border-radius: 0;
|
|
120
|
+
|
|
121
|
+
& ${ColorBadge}::before {
|
|
122
|
+
border-radius: 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/*RULE 3- if there is an adjacent group-header, go to the adjacent group header and remove top border-radius */
|
|
127
|
+
&:has(+ .group-header-row) + .group-header-row {
|
|
128
|
+
border-top-left-radius: 0;
|
|
129
|
+
border-top-right-radius: 0;
|
|
130
|
+
|
|
131
|
+
& ${ColorBadge}::before {
|
|
132
|
+
border-top-left-radius: 0;
|
|
133
|
+
border-top-right-radius: 0;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
`}
|
|
138
|
+
|
|
139
|
+
&.group-header-row .stickyGroupHeader {
|
|
140
|
+
position: sticky;
|
|
141
|
+
left: 0;
|
|
142
|
+
width: 0;
|
|
143
|
+
z-index: 10;
|
|
144
|
+
height: var(--group-header-height);
|
|
145
|
+
|
|
146
|
+
> button {
|
|
147
|
+
color: currentColor;
|
|
148
|
+
position: absolute;
|
|
149
|
+
left: 0;
|
|
150
|
+
top: 0;
|
|
151
|
+
bottom: 0;
|
|
152
|
+
width: max-content;
|
|
153
|
+
max-width: var(--container-width);
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
background-color: var(--group-bg-color);
|
|
157
|
+
padding-left: var(--group-left);
|
|
158
|
+
margin-inline-start: 0.25rem;
|
|
159
|
+
z-index: 30;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
text-align: inherit;
|
|
163
|
+
font-stretch: inherit;
|
|
164
|
+
|
|
165
|
+
> .group-wrapper {
|
|
166
|
+
margin-inline-start: ${groupHeader.count === 0
|
|
167
|
+
? `calc(${theme.base.spacing} * 2.25)`
|
|
168
|
+
: 'unset'};
|
|
169
|
+
align-items: baseline;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.cell-content {
|
|
173
|
+
max-height: var(--group-header-height);
|
|
174
|
+
padding: 0;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
button:focus {
|
|
178
|
+
box-shadow: ${theme.base.shadow['focus-inset']};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
.group-header.cell {
|
|
182
|
+
left: 0;
|
|
183
|
+
padding-left: var(--group-left);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
div.group-header.cell-fixed {
|
|
187
|
+
background-color: var(--group-bg-color);
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
});
|
|
191
|
+
const StyledMetaList = styled(MetaList) `
|
|
192
|
+
margin-inline-start: 0;
|
|
193
|
+
|
|
194
|
+
/* Overrides default MetaList padding and margin which was causing text-overflow issues */
|
|
195
|
+
margin: 0;
|
|
196
|
+
padding: 0 0.3rem;
|
|
197
|
+
`;
|
|
198
|
+
const GroupAdditionalInfoSeparator = styled.span `
|
|
199
|
+
margin-inline-start: 0.3rem;
|
|
200
|
+
`;
|
|
201
|
+
/**
|
|
202
|
+
* Generates unique ARIA label IDs for accessibility.
|
|
203
|
+
* - groupLabelId: for the group label (e.g., "Status:")
|
|
204
|
+
* - groupNameId: for the group value (e.g., "Open")
|
|
205
|
+
* - additionalInfoIds: for any additional fields shown in the group header
|
|
206
|
+
* These IDs are used in aria-labelledby to improve screen reader support.
|
|
207
|
+
*/
|
|
208
|
+
const getAriaLabelIds = (uniqueId, additionalFields) => {
|
|
209
|
+
const groupLabelId = `group-label-${uniqueId}`;
|
|
210
|
+
const groupNameId = `group-name-${uniqueId}`;
|
|
211
|
+
const additionalInfoIds = additionalFields?.map(additionalField => `group-additional-info-${uniqueId}-${additionalField.id}` /* used in aria-labelledby */);
|
|
212
|
+
return { groupLabelId, groupNameId, additionalInfoIds };
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Returns label for interval grouping based on interval and boundaries
|
|
216
|
+
Response data depends on boundary settings.
|
|
217
|
+
Ex: For sample data of profit
|
|
218
|
+
profit --> cases(count)
|
|
219
|
+
{'0': 10, 1': 100, '2':30, '10': 35, '15':45, '20':2}
|
|
220
|
+
For Interval 10
|
|
221
|
+
If the boundary is 'include-lower-only',
|
|
222
|
+
and value is 10 then label -> 10 to 20
|
|
223
|
+
|
|
224
|
+
If boundary is 'include-upper-only',
|
|
225
|
+
and value is 10 then label -> 0 to 10
|
|
226
|
+
* */
|
|
227
|
+
function buildIntervalGroupingLabel(value, customFunction, translate) {
|
|
228
|
+
const { interval, boundaries } = customFunction;
|
|
229
|
+
// To restrict the decimals in labels
|
|
230
|
+
const intervalDecimalLength = (interval.toString().split('.')[1] || '').length;
|
|
231
|
+
value = Number(value);
|
|
232
|
+
// In case of 'include-lower-only'
|
|
233
|
+
let lowerValue = value.toFixed(intervalDecimalLength);
|
|
234
|
+
let upperValue = (value + interval).toFixed(intervalDecimalLength);
|
|
235
|
+
// In case of boundary 'include-upper-only'
|
|
236
|
+
if (boundaries === intervalGroupingBoundaries.includeUpperOnly) {
|
|
237
|
+
lowerValue = (value - interval).toFixed(intervalDecimalLength);
|
|
238
|
+
upperValue = value.toFixed(intervalDecimalLength);
|
|
239
|
+
}
|
|
240
|
+
return `${lowerValue} ${translate('to')} ${upperValue}`;
|
|
241
|
+
}
|
|
242
|
+
export function GroupName({ view, column, groupHeader, dateFunction, customFunction }) {
|
|
243
|
+
const [translate] = useTranslate();
|
|
244
|
+
const { locale, timezone } = view.meta;
|
|
245
|
+
const isRangeGrouping = customFunction?.type === customFunctions.RANGE_GROUPING;
|
|
246
|
+
const isIntervalGrouping = customFunction?.type === customFunctions.INTERVAL_GROUPING;
|
|
247
|
+
if (dateFunction) {
|
|
248
|
+
return (_jsx(DateValueDisplay, { value: groupHeader.name, dateFunction: dateFunction, locale: locale, timezone: timezone }));
|
|
249
|
+
}
|
|
250
|
+
if (isRangeGrouping) {
|
|
251
|
+
/** If custom range grouping applied on number field , we need to show group name as text instead of number */
|
|
252
|
+
return groupHeader.name;
|
|
253
|
+
}
|
|
254
|
+
if (isIntervalGrouping) {
|
|
255
|
+
/** If custom range grouping applied on number , we need to show group name based on value and custom function details like interval and boundaries */
|
|
256
|
+
return buildIntervalGroupingLabel(groupHeader.name, customFunction, translate);
|
|
257
|
+
}
|
|
258
|
+
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)
|
|
259
|
+
const columnRendererProps = {
|
|
260
|
+
...column.getRenderingEngineProps(),
|
|
261
|
+
context: {
|
|
262
|
+
getValue: () => groupHeader.name,
|
|
263
|
+
getExecutionContext: () => {
|
|
264
|
+
return { getValue: () => groupHeader.data, name: 'groupHeader' };
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
return _jsx(RenderingEngine, { ...columnRendererProps });
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Tooltip content for the group header.
|
|
272
|
+
* Shows the group label, value, and any additional fields.
|
|
273
|
+
* Used for hover/focus tooltips on the group header button.
|
|
274
|
+
*/
|
|
275
|
+
function GroupHeaderToolTip({ column, groupHeader, columns, additionalFields, target }) {
|
|
276
|
+
const view = column.parent;
|
|
277
|
+
const { dateFunction, customFunction } = getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};
|
|
278
|
+
const formatter = view.getFormatterByKey('Integer');
|
|
279
|
+
const { locale } = view.meta;
|
|
280
|
+
const groupCountFormatted = formatter
|
|
281
|
+
? formatter(groupHeader.count, { locale })
|
|
282
|
+
: groupHeader.count;
|
|
283
|
+
return (_jsxs(Tooltip, { smart: true, target: target, showDelay: 'short', hideDelay: 'none', describeTarget: false, children: [_jsxs(Text, { children: [!column.field.hideGroupColumnNameLabel && groupHeader.label, ": "] }), _jsxs(Text, { children: [_jsx(GroupName, { view: view, column: column, groupHeader: groupHeader, dateFunction: dateFunction, customFunction: customFunction }), _jsx(Text, { children: ` (${groupCountFormatted})` })] }), !!(groupHeader.additionalFieldsData?.length && additionalFields.length) && (_jsx(_Fragment, { children: groupHeader.additionalFieldsData?.map(additionalFieldData => {
|
|
284
|
+
return (_jsxs(_Fragment, { children: [' • ', _jsx(GroupAdditionalInfo, { groupHeader: groupHeader, additionalField: additionalFields.find(additionalField => additionalField.id === additionalFieldData.id), columns: columns, additionalFieldData: additionalFieldData, rendererContext: 'GroupHeaderTooltip' })] }));
|
|
285
|
+
}) }))] }));
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Renders the main group header label and count.
|
|
289
|
+
* - Shows the group label (e.g., "Status:") unless hidden by column config.
|
|
290
|
+
* - Shows the group value and item count.
|
|
291
|
+
* - Uses ARIA IDs for accessibility.
|
|
292
|
+
*/
|
|
293
|
+
function GroupHeaderLabel({ column, groupHeader }) {
|
|
294
|
+
const view = column.parent;
|
|
295
|
+
const { dateFunction, customFunction } = getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};
|
|
296
|
+
const formatter = view.getFormatterByKey('Integer');
|
|
297
|
+
const { locale } = view.meta;
|
|
298
|
+
const groupCountFormatted = formatter
|
|
299
|
+
? formatter(groupHeader.count, { locale })
|
|
300
|
+
: groupHeader.count;
|
|
301
|
+
const { groupLabelId, groupNameId } = getAriaLabelIds(groupHeader.uniqueId);
|
|
302
|
+
return (_jsxs(_Fragment, { 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}`, id: groupLabelId, 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, id: groupNameId, children: [_jsx(GroupName, { view: view, column: column, groupHeader: groupHeader, dateFunction: dateFunction, customFunction: customFunction }), _jsx("span", { className: 'group-count', children: ` (${groupCountFormatted})` }), _jsx(VisuallyHiddenText, { children: " items" })] })] }));
|
|
303
|
+
}
|
|
304
|
+
// NOTE: While making any changes in GroupRenderer.jsx, also make similar changes in HierarchicalGroupRenderer.jsx file if applicable
|
|
305
|
+
export default function GroupHeader({ groupHeader, columns }) {
|
|
306
|
+
const buttonRef = useRef();
|
|
307
|
+
const view = columns[0].parent;
|
|
308
|
+
const toggleGroup = useCallback(() => {
|
|
309
|
+
if (groupHeader.count > 0) {
|
|
310
|
+
view.type.toggleGroupExpansion({ groupHeader });
|
|
311
|
+
}
|
|
312
|
+
}, [groupHeader, view]);
|
|
313
|
+
// TODO: This we are adding temporary to show freeze border until we make group header rendering change
|
|
314
|
+
// when we will pick up aggregation.
|
|
315
|
+
if (!groupHeader.isVisible)
|
|
316
|
+
return null;
|
|
317
|
+
// If grouping by a regular column (i.e. without a dateFunction), determine props for the renderer
|
|
318
|
+
const { columnId, additionalFields = [] } = getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};
|
|
319
|
+
// if state.groups is not yet prepared/updated, then getGroupFromKey will return undefined
|
|
320
|
+
if (!columnId) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
const column = columns.find(c => c.field.id === columnId);
|
|
324
|
+
const isAggregationApplied = columns.filter(c => !c.hidden).some(c => c.aggregated);
|
|
325
|
+
// Generate unique ARIA label IDs for accessibility
|
|
326
|
+
const { groupLabelId, groupNameId, additionalInfoIds = [] } = getAriaLabelIds(groupHeader.uniqueId, additionalFields);
|
|
327
|
+
let groupAdditionalInfo;
|
|
328
|
+
// Prepare additional info components if present
|
|
329
|
+
if (groupHeader.additionalFieldsData?.length && additionalFields.length) {
|
|
330
|
+
groupAdditionalInfo = groupHeader.additionalFieldsData.reduce((acc, additionalFieldData, idx) => {
|
|
331
|
+
const additionalField = additionalFields.find(field => field.id === additionalFieldData.id);
|
|
332
|
+
if (additionalField) {
|
|
333
|
+
acc.push(_jsx(Flex, { container: { gap: 0.5 }, id: additionalInfoIds[idx], children: _jsx(GroupAdditionalInfo, { additionalFieldData: additionalFieldData, additionalField: additionalField, columns: columns, groupHeader: groupHeader, rendererContext: 'GroupHeader' }) }));
|
|
334
|
+
}
|
|
335
|
+
return acc;
|
|
336
|
+
}, []);
|
|
337
|
+
}
|
|
338
|
+
// FIXME: Import rather than COPY, i would rather
|
|
339
|
+
return (_jsx(StyledGroupHeader, { groupHeader: groupHeader, className: cx('row group-header-row sticky-group-header'), "data-test-id": 'groupHeader', "data-testid": `${TestIdConstants.groupHeader}-${groupHeader.label}-${groupHeader.name}`, isAggregationApplied: isAggregationApplied, role: 'row', onFocus: e => {
|
|
340
|
+
if (buttonRef.current && !e.currentTarget.contains(e.relatedTarget)) {
|
|
341
|
+
e.preventDefault();
|
|
342
|
+
buttonRef.current.focus();
|
|
343
|
+
}
|
|
344
|
+
}, children: _jsxs(Flex, { container: true, children: [_jsx(ColorBadge, { colorIndicator: groupHeader.colorIndicator }), _jsxs("div", { children: [_jsxs("div", { className: 'stickyGroupHeader', children: [_jsxs(BareButton, { ref: buttonRef, "aria-labelledby": [groupLabelId, groupNameId, ...additionalInfoIds].join(' '), "aria-expanded": !!groupHeader.isExpanded, style: {
|
|
345
|
+
paddingRight: 'var(--group-left)'
|
|
346
|
+
}, onClick: () => toggleGroup(), onKeyDown: event => {
|
|
347
|
+
if (event.key === 'Enter') {
|
|
348
|
+
// Prevent capturing of group header toggle click to its child renderers.
|
|
349
|
+
event.preventDefault();
|
|
350
|
+
event.stopPropagation();
|
|
351
|
+
toggleGroup();
|
|
352
|
+
}
|
|
353
|
+
}, tabIndex: -1, icon: true, children: [groupHeader.count > 0 &&
|
|
354
|
+
(groupHeader.isExpanded ? _jsx(Icon, { name: 'caret-down' }) : _jsx(Icon, { name: 'caret-right' })), _jsxs("div", { className: 'group-wrapper', children: [_jsx(GroupHeaderLabel, { column: column, groupHeader: groupHeader }), groupAdditionalInfo && (_jsxs(_Fragment, { children: [_jsx(Text, { variant: 'secondary', as: GroupAdditionalInfoSeparator, children: "\u2022" }), _jsx(StyledMetaList, { wrapItems: false, items: groupAdditionalInfo })] }))] })] }), buttonRef.current && (_jsx(GroupHeaderToolTip, { target: buttonRef.current, column: column, groupHeader: groupHeader, columns: columns, additionalFields: additionalFields }))] }), _jsx("div", { className: 'group-header-aggregation-row', children: columns.map(c => {
|
|
355
|
+
const cxt = {
|
|
356
|
+
getValue: () => groupHeader?.aggregation?.[c.field.name]?.[c.aggregationType?.toLowerCase()]
|
|
357
|
+
};
|
|
358
|
+
return (_jsx(AggregatorCell, { column: c, context: cxt, className: cx('cell', {
|
|
359
|
+
'cell-fixed': column.frozen
|
|
360
|
+
}) }, c.field.id));
|
|
361
|
+
}) })] })] }) }));
|
|
362
|
+
}
|
|
363
|
+
GroupHeader.propTypes = {
|
|
364
|
+
columns: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
365
|
+
groupHeader: PropTypes.objectOf(PropTypes.any).isRequired
|
|
366
|
+
};
|
|
367
|
+
//# sourceMappingURL=index.js.map
|