@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
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ import { RepeatingStructures } from '@pega/lists-react';
|
|
|
49
49
|
| showCount | Boolean | No | `true` | Display count in toolbar |
|
|
50
50
|
| defaultRowHeight | String | No | `undefined` | Row density id value from [displayDensity](#displayDensity) options |
|
|
51
51
|
| allowBulkActions | boolean | No | `false` | Renders the 'Bulk actions' button in the table toolbar, which gets enabled on row selection |
|
|
52
|
-
| dateFunctions | Object | No | `undefined` | Enables date-functions like MONTHS/WEEKS/... during Grouping and Filtering. ([Object structure](https://
|
|
52
|
+
| dateFunctions | Object | No | `undefined` | Enables date-functions like MONTHS/WEEKS/... during Grouping and Filtering. ([Object structure](https://github.com/Pega-UXEngineering/constellation-frontend/blob/028ffa1642e12c61a3383b9babc0e0e83800d352/packages/cosmos-condition-builder/src/components/ConditionBuilder/ConditionBuilder.types.ts#L137)) |
|
|
53
53
|
| relativeDates | Boolean | No | `false` | Enables Relative Dates, such as "Last 7 days" or "Current Year", in Filtering for DateTime or Date_Only values. |
|
|
54
54
|
| footer | Boolean | No | `true` | Display footer on the view |
|
|
55
55
|
| dynamicFieldTemplates | Object | No | `dynamicFieldTemplates: [{ name: 'Comma separated', value: 'comma',selected: true }, { name: 'Space separated', value: 'space' }, { name: 'Multi line', value: 'multiline' }, { name: 'Forward slash', value: 'forwardslash' }]` | Templates for dynamic fields. See section on Dynamic fields |
|
|
@@ -203,9 +203,6 @@ APIs exposed on the component ref are accessible via `compRef.current.<API_NAME>
|
|
|
203
203
|
|
|
204
204
|
- The first focus will be on the table's first header cell if earlier no navigation has been done.
|
|
205
205
|
- To navigate between the cells, use the arrow keys.
|
|
206
|
-
- Pressing enter on the cell can turn the cell in edit mode if it is editable.
|
|
207
|
-
- Pressing enter again will submit the data
|
|
208
|
-
- Pressing escape will discard the changes and turn the cell back to read mode.
|
|
209
206
|
- To focus out from the table cells, press the tab key and focus will be shifted to the next focusable element on the page after table.
|
|
210
207
|
- Next time when navigated again to the table, the last visited cell will be focused.
|
|
211
208
|
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Provides accessibility features for repeating structures, including focus boundary handling
|
|
3
|
+
* and announcing changes in the view's state for accessibility purposes.
|
|
4
|
+
*
|
|
5
|
+
* @param {Object} props.a11yRef - A reference object containing accessibility-related handlers.
|
|
6
|
+
* @param {Object} props.view - The view object containing the current state of the repeating structure.
|
|
7
|
+
*
|
|
8
|
+
* @returns {JSX.Element} The rendered structure with accessibility features.
|
|
9
|
+
*/
|
|
10
|
+
declare function RepeatingStructureA11y({ children, a11yRef, view }: Object): JSX.Element;
|
|
6
11
|
declare namespace RepeatingStructureA11y {
|
|
7
12
|
namespace propTypes {
|
|
8
13
|
let children: PropTypes.Requireable<object>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatingStructureA11y.d.ts","sourceRoot":"","sources":["../../../../Core/Components/A11y/RepeatingStructureA11y.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RepeatingStructureA11y.d.ts","sourceRoot":"","sources":["../../../../Core/Components/A11y/RepeatingStructureA11y.jsx"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AACH,qEALW,MAAM,GAGJ,GAAG,CAAC,OAAO,CAgDvB;;;;;;;;;;;;;;;;;sBAtEqB,YAAY"}
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import
|
|
5
|
+
import useAnnounce from '../../Hooks/a11y/useAnnounce';
|
|
6
|
+
import useTranslate from '../../Hooks/useTranslate';
|
|
6
7
|
const StyledInput = styled.input `
|
|
7
8
|
width: 0;
|
|
8
9
|
height: 0;
|
|
@@ -11,12 +12,36 @@ const StyledInput = styled.input `
|
|
|
11
12
|
outline: none;
|
|
12
13
|
opacity: 0;
|
|
13
14
|
`;
|
|
15
|
+
/**
|
|
16
|
+
* Provides accessibility features for repeating structures, including focus boundary handling
|
|
17
|
+
* and announcing changes in the view's state for accessibility purposes.
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} props.a11yRef - A reference object containing accessibility-related handlers.
|
|
20
|
+
* @param {Object} props.view - The view object containing the current state of the repeating structure.
|
|
21
|
+
*
|
|
22
|
+
* @returns {JSX.Element} The rendered structure with accessibility features.
|
|
23
|
+
*/
|
|
14
24
|
export default function RepeatingStructureA11y({ children, a11yRef, view }) {
|
|
25
|
+
const [translate] = useTranslate();
|
|
15
26
|
const onFocusHandler = useCallback(e => {
|
|
16
27
|
a11yRef.current.boundaryElementsFocusHandler(e);
|
|
17
28
|
}, [a11yRef]);
|
|
18
29
|
const { state } = view;
|
|
19
|
-
|
|
30
|
+
// For show/hide columns, we only use the 'modified' message because there is always at least one column present.
|
|
31
|
+
// Any change—whether adding or removing a column is considered a modification for accessibility announcement.
|
|
32
|
+
useAnnounce(state.hiddenColumns, {
|
|
33
|
+
modified: translate('Show/Hide modified')
|
|
34
|
+
}, state.personalization?.active);
|
|
35
|
+
useAnnounce(state.freezeColumns, {
|
|
36
|
+
added: translate('Freeze applied'),
|
|
37
|
+
modified: translate('Freeze modified'),
|
|
38
|
+
removed: translate('Freeze removed')
|
|
39
|
+
}, state.personalization?.active);
|
|
40
|
+
useAnnounce(state.groups, {
|
|
41
|
+
added: translate('Group applied'),
|
|
42
|
+
modified: translate('Group modified'),
|
|
43
|
+
removed: translate('Group removed')
|
|
44
|
+
}, state.personalization?.active);
|
|
20
45
|
return (_jsxs(_Fragment, { children: [_jsx(StyledInput, { className: 'top', type: 'text', "aria-hidden": true, onFocus: onFocusHandler }), children, _jsx(StyledInput, { className: 'bottom', type: 'text', "aria-hidden": true, onFocus: onFocusHandler })] }));
|
|
21
46
|
}
|
|
22
47
|
RepeatingStructureA11y.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatingStructureA11y.js","sourceRoot":"","sources":["../../../../Core/Components/A11y/RepeatingStructureA11y.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,
|
|
1
|
+
{"version":3,"file":"RepeatingStructureA11y.js","sourceRoot":"","sources":["../../../../Core/Components/A11y/RepeatingStructureA11y.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAA;;;;;;;CAO/B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE;IACxE,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,CAAC,EAAE;QACF,OAAO,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IACF,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACvB,iHAAiH;IACjH,8GAA8G;IAC9G,WAAW,CACT,KAAK,CAAC,aAAa,EACnB;QACE,QAAQ,EAAE,SAAS,CAAC,oBAAoB,CAAC;KAC1C,EACD,KAAK,CAAC,eAAe,EAAE,MAAM,CAC9B,CAAC;IAEF,WAAW,CACT,KAAK,CAAC,aAAa,EACnB;QACE,KAAK,EAAE,SAAS,CAAC,gBAAgB,CAAC;QAClC,QAAQ,EAAE,SAAS,CAAC,iBAAiB,CAAC;QACtC,OAAO,EAAE,SAAS,CAAC,gBAAgB,CAAC;KACrC,EACD,KAAK,CAAC,eAAe,EAAE,MAAM,CAC9B,CAAC;IAEF,WAAW,CACT,KAAK,CAAC,MAAM,EACZ;QACE,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC;QACjC,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC;QACrC,OAAO,EAAE,SAAS,CAAC,eAAe,CAAC;KACpC,EACD,KAAK,CAAC,eAAe,EAAE,MAAM,CAC9B,CAAC;IAEF,OAAO,CACL,8BACE,KAAC,WAAW,IAAC,SAAS,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,uBAAa,OAAO,EAAE,cAAc,GAAI,EAC/E,QAAQ,EACT,KAAC,WAAW,IAAC,SAAS,EAAC,QAAQ,EAAC,IAAI,EAAC,MAAM,uBAAa,OAAO,EAAE,cAAc,GAAI,IAClF,CACJ,CAAC;AACJ,CAAC;AAED,sBAAsB,CAAC,SAAS,GAAG;IACjC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAClE,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,UAAU;IAC1D,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC;AAEF,sBAAsB,CAAC,YAAY,GAAG;IACpC,QAAQ,EAAE,EAAE;CACb,CAAC","sourcesContent":["import { useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport useAnnounce from '../../Hooks/a11y/useAnnounce';\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst StyledInput = styled.input`\n width: 0;\n height: 0;\n border-width: 0;\n position: absolute;\n outline: none;\n opacity: 0;\n`;\n\n/**\n * Provides accessibility features for repeating structures, including focus boundary handling\n * and announcing changes in the view's state for accessibility purposes.\n *\n * @param {Object} props.a11yRef - A reference object containing accessibility-related handlers.\n * @param {Object} props.view - The view object containing the current state of the repeating structure.\n *\n * @returns {JSX.Element} The rendered structure with accessibility features.\n */\nexport default function RepeatingStructureA11y({ children, a11yRef, view }) {\n const [translate] = useTranslate();\n const onFocusHandler = useCallback(\n e => {\n a11yRef.current.boundaryElementsFocusHandler(e);\n },\n [a11yRef]\n );\n const { state } = view;\n // For show/hide columns, we only use the 'modified' message because there is always at least one column present.\n // Any change—whether adding or removing a column is considered a modification for accessibility announcement.\n useAnnounce(\n state.hiddenColumns,\n {\n modified: translate('Show/Hide modified')\n },\n state.personalization?.active\n );\n\n useAnnounce(\n state.freezeColumns,\n {\n added: translate('Freeze applied'),\n modified: translate('Freeze modified'),\n removed: translate('Freeze removed')\n },\n state.personalization?.active\n );\n\n useAnnounce(\n state.groups,\n {\n added: translate('Group applied'),\n modified: translate('Group modified'),\n removed: translate('Group removed')\n },\n state.personalization?.active\n );\n\n return (\n <>\n <StyledInput className='top' type='text' aria-hidden onFocus={onFocusHandler} />\n {children}\n <StyledInput className='bottom' type='text' aria-hidden onFocus={onFocusHandler} />\n </>\n );\n}\n\nRepeatingStructureA11y.propTypes = {\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n a11yRef: PropTypes.objectOf(PropTypes.objectOf).isRequired,\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n\nRepeatingStructureA11y.defaultProps = {\n children: []\n};\n"]}
|
|
@@ -19,5 +19,6 @@ declare namespace AggregateMenu {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
export default AggregateMenu;
|
|
22
|
+
export function getFormattedAggregationValue(rawAggregationValue: number | string, aggregationType: string, column: import("pega-repeating-structures-core").RsCoreTypes.Column): string | number;
|
|
22
23
|
import PropTypes from 'prop-types';
|
|
23
24
|
//# sourceMappingURL=AggregateMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregateMenu.d.ts","sourceRoot":"","sources":["../../../Core/Components/AggregateMenu.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AggregateMenu.d.ts","sourceRoot":"","sources":["../../../Core/Components/AggregateMenu.jsx"],"names":[],"mappings":"AAqEA;;;mDA2DC;;;;;;;;;;;;;;;;;;AA9EM,kEALI,MAAM,GAAC,MAAM,mBACb,MAAM,UACN,OAAO,gCAAgC,EAAE,WAAW,CAAC,MAAM,GACzD,MAAM,GAAC,MAAM,CAmBzB;sBAlEqB,YAAY"}
|
|
@@ -12,6 +12,9 @@ const StyledMenuButton = styled(MenuButton) `
|
|
|
12
12
|
}
|
|
13
13
|
`;
|
|
14
14
|
const StyledCell = styled.div `
|
|
15
|
+
&:not(:has(${StyledMenuButton})) {
|
|
16
|
+
gap: 0.25rem;
|
|
17
|
+
}
|
|
15
18
|
display: flex;
|
|
16
19
|
text-align: right;
|
|
17
20
|
justify-content: flex-end;
|
|
@@ -25,11 +28,36 @@ const StyledCell = styled.div `
|
|
|
25
28
|
const StyledAggregationValue = styled.div `
|
|
26
29
|
font-weight: ${props => props.theme.base['font-weight']['semi-bold']};
|
|
27
30
|
`;
|
|
31
|
+
/**
|
|
32
|
+
* Formats the aggregation value based on the aggregation type and column context.
|
|
33
|
+
*
|
|
34
|
+
* @param {number|string} rawAggregationValue - The raw aggregation value to format.
|
|
35
|
+
* @param {string} aggregationType - The type of aggregation (e.g., 'Avg').
|
|
36
|
+
* @param {import('pega-repeating-structures-core').RsCoreTypes.Column} column - The column object.
|
|
37
|
+
* @returns {string|number} The formatted aggregation value or the raw value if no formatter is available.
|
|
38
|
+
*/
|
|
39
|
+
export const getFormattedAggregationValue = (rawAggregationValue, aggregationType, column) => {
|
|
40
|
+
const formatter = column.getContext().getFormatter();
|
|
41
|
+
const fieldDef = column.getContext().getField();
|
|
42
|
+
const { fieldType } = fieldDef;
|
|
43
|
+
const { locale, timezone } = column.parent.meta;
|
|
44
|
+
if (!formatter)
|
|
45
|
+
return rawAggregationValue;
|
|
46
|
+
if (aggregationType === 'Avg' && fieldType === 'Integer') {
|
|
47
|
+
return formatNumber(Number(rawAggregationValue), {
|
|
48
|
+
locale,
|
|
49
|
+
useGrouping: true,
|
|
50
|
+
maximumFractionDigits: 2
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return formatter(rawAggregationValue, { locale, timezone, fieldDef });
|
|
54
|
+
};
|
|
28
55
|
export default function AggregateMenu({ column, context }) {
|
|
29
|
-
const { aggregateOptions
|
|
56
|
+
const { aggregateOptions } = column.parent.meta;
|
|
30
57
|
const { aggregationType } = column;
|
|
31
58
|
const uid = createUID();
|
|
32
59
|
const [translate] = useTranslate();
|
|
60
|
+
const isFooterAggregate = context.getExecutionContext?.()?.name === 'footer';
|
|
33
61
|
const actions = aggregateOptions[column.field.type]?.map(label => ({
|
|
34
62
|
primary: translate(label),
|
|
35
63
|
id: label,
|
|
@@ -39,28 +67,14 @@ export default function AggregateMenu({ column, context }) {
|
|
|
39
67
|
if (!actions)
|
|
40
68
|
return null;
|
|
41
69
|
const rawAggregationValue = context.getValue();
|
|
42
|
-
const
|
|
43
|
-
const fieldDef = column.getContext().getField();
|
|
44
|
-
const { fieldType } = fieldDef;
|
|
45
|
-
const aggregationValue = (() => {
|
|
46
|
-
if (!formatter)
|
|
47
|
-
return rawAggregationValue;
|
|
48
|
-
if (aggregationType === 'Avg' && fieldType === 'Integer') {
|
|
49
|
-
return formatNumber(Number(rawAggregationValue), {
|
|
50
|
-
locale,
|
|
51
|
-
useGrouping: true,
|
|
52
|
-
maximumFractionDigits: 2
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
return formatter(rawAggregationValue, { locale, timezone, fieldDef });
|
|
56
|
-
})();
|
|
70
|
+
const aggregationValue = getFormattedAggregationValue(rawAggregationValue, aggregationType, column);
|
|
57
71
|
const buttonText = translate('Aggregate options');
|
|
58
|
-
return (_jsxs(StyledCell, { children: [_jsx("span", { children: translate(aggregationType) }), _jsx(StyledMenuButton, { className: 'aggregate-button', menu: {
|
|
72
|
+
return (_jsxs(StyledCell, { children: [_jsx("span", { children: translate(aggregationType) }), isFooterAggregate && (_jsx(StyledMenuButton, { className: 'aggregate-button', menu: {
|
|
59
73
|
items: actions,
|
|
60
74
|
mode: 'single-select'
|
|
61
75
|
}, popover: {
|
|
62
76
|
portal: true
|
|
63
|
-
}, icon: 'arrow-micro-down', iconOnly: true, variant: 'simple', compact: true, text: buttonText, "aria-labelledby": `${uid}_label` }), _jsx(Flex, { container: true, as: StyledAggregationValue, item: { shrink: 0 }, "data-testid": TestIdConstants.aggregateDisplayValue, children: aggregationValue }), _jsx(VisuallyHiddenText, { id: `${uid}_label`, "aria-hidden": true, children: `${translate(aggregationType)} ${context.getValue()} ${buttonText}` })] }));
|
|
77
|
+
}, icon: 'arrow-micro-down', iconOnly: true, variant: 'simple', compact: true, text: buttonText, "aria-labelledby": `${uid}_label` })), _jsx(Flex, { container: true, as: StyledAggregationValue, item: { shrink: 0 }, "data-testid": TestIdConstants.aggregateDisplayValue, children: aggregationValue }), _jsx(VisuallyHiddenText, { id: `${uid}_label`, "aria-hidden": true, children: `${translate(aggregationType)} ${context.getValue()} ${buttonText}` })] }));
|
|
64
78
|
}
|
|
65
79
|
AggregateMenu.propTypes = {
|
|
66
80
|
column: PropTypes.objectOf(PropTypes.any),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregateMenu.js","sourceRoot":"","sources":["../../../Core/Components/AggregateMenu.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAEjD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;WAChC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;;;;;CAK/D,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"AggregateMenu.js","sourceRoot":"","sources":["../../../Core/Components/AggregateMenu.jsx"],"names":[],"mappings":"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","sourcesContent":["import styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport {\n Flex,\n MenuButton,\n VisuallyHiddenText,\n createUID,\n formatNumber\n} from '@pega/cosmos-react-core';\n\nimport useTranslate from '../Hooks/useTranslate';\n\nimport TestIdConstants from './TestIdConstants';\n\nconst StyledMenuButton = styled(MenuButton)`\n color: ${props => props.theme.base.palette['foreground-color']};\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n`;\n\nconst StyledCell = styled.div`\n &:not(:has(${StyledMenuButton})) {\n gap: 0.25rem;\n }\n display: flex;\n text-align: right;\n justify-content: flex-end;\n align-items: center;\n margin-inline-end: var(--cell-padding);\n\n &:hover {\n background-clip: padding-box;\n }\n`;\n\nconst StyledAggregationValue = styled.div`\n font-weight: ${props => props.theme.base['font-weight']['semi-bold']};\n`;\n\n/**\n * Formats the aggregation value based on the aggregation type and column context.\n *\n * @param {number|string} rawAggregationValue - The raw aggregation value to format.\n * @param {string} aggregationType - The type of aggregation (e.g., 'Avg').\n * @param {import('pega-repeating-structures-core').RsCoreTypes.Column} column - The column object.\n * @returns {string|number} The formatted aggregation value or the raw value if no formatter is available.\n */\nexport const getFormattedAggregationValue = (rawAggregationValue, aggregationType, column) => {\n const formatter = column.getContext().getFormatter();\n const fieldDef = column.getContext().getField();\n const { fieldType } = fieldDef;\n const { locale, timezone } = column.parent.meta;\n\n if (!formatter) return rawAggregationValue;\n\n if (aggregationType === 'Avg' && fieldType === 'Integer') {\n return formatNumber(Number(rawAggregationValue), {\n locale,\n useGrouping: true,\n maximumFractionDigits: 2\n });\n }\n\n return formatter(rawAggregationValue, { locale, timezone, fieldDef });\n};\n\nexport default function AggregateMenu({ column, context }) {\n const { aggregateOptions } = column.parent.meta;\n const { aggregationType } = column;\n const uid = createUID();\n const [translate] = useTranslate();\n const isFooterAggregate = context.getExecutionContext?.()?.name === 'footer';\n\n const actions = aggregateOptions[column.field.type]?.map(label => ({\n primary: translate(label),\n id: label,\n onClick: () => column.applyAggregation(label),\n selected: aggregationType === label\n }));\n if (!actions) return null;\n\n const rawAggregationValue = context.getValue();\n\n const aggregationValue = getFormattedAggregationValue(\n rawAggregationValue,\n aggregationType,\n column\n );\n\n const buttonText = translate('Aggregate options');\n\n return (\n <StyledCell>\n <span>{translate(aggregationType)}</span>\n {isFooterAggregate && (\n <StyledMenuButton\n className='aggregate-button'\n menu={{\n items: actions,\n mode: 'single-select'\n }}\n popover={{\n portal: true\n }}\n icon='arrow-micro-down'\n iconOnly\n variant='simple'\n compact\n text={buttonText} // Text property to display tooltip on hover\n aria-labelledby={`${uid}_label`}\n />\n )}\n <Flex\n container\n as={StyledAggregationValue}\n item={{ shrink: 0 }}\n data-testid={TestIdConstants.aggregateDisplayValue}\n >\n {aggregationValue}\n </Flex>\n <VisuallyHiddenText id={`${uid}_label`} aria-hidden>\n {`${translate(aggregationType)} ${context.getValue()} ${buttonText}`}\n </VisuallyHiddenText>\n </StyledCell>\n );\n}\n\nAggregateMenu.propTypes = {\n column: PropTypes.objectOf(PropTypes.any),\n context: PropTypes.objectOf(PropTypes.any)\n};\n\nAggregateMenu.defaultProps = {\n column: {},\n context: {}\n};\n"]}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
export default function ContextMenuContainer({ view, selector }: {
|
|
3
|
+
view: RsCoreTypes.View;
|
|
4
|
+
selector: {
|
|
5
|
+
query: string;
|
|
6
|
+
};
|
|
4
7
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
-
declare namespace ContextMenuContainer {
|
|
6
|
-
namespace propTypes {
|
|
7
|
-
let view: PropTypes.Validator<{
|
|
8
|
-
[x: string]: any;
|
|
9
|
-
}>;
|
|
10
|
-
let selector: PropTypes.Validator<{
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
}>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export default ContextMenuContainer;
|
|
16
|
-
import PropTypes from 'prop-types';
|
|
17
8
|
//# sourceMappingURL=ContextMenuContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Components/ContextMenu/ContextMenuContainer.
|
|
1
|
+
{"version":3,"file":"ContextMenuContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Components/ContextMenu/ContextMenuContainer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AA0FlE,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,IAAI,EACJ,QAAQ,EACT,EAAE;IACD,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IACvB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7B,kDAyGA"}
|
|
@@ -1,134 +1,55 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { Popover, Icon, useElement, useOuterEvent } from '@pega/cosmos-react-core';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, useEffect, useCallback } from 'react';
|
|
3
|
+
import { v4 as uuidV4 } from 'uuid';
|
|
4
|
+
import { Popover, Icon, useElement, useOuterEvent, Menu, isInstance } from '@pega/cosmos-react-core';
|
|
6
5
|
import { getRowContextData, getScrollerElem, isFilterApplied } from 'pega-repeating-structures-core';
|
|
7
|
-
import { createClassName as cx } from '../../Utils';
|
|
8
6
|
import useTranslate from '../../Hooks/useTranslate';
|
|
9
7
|
import useScrollAway from '../../Hooks/useScrollAway';
|
|
8
|
+
import TestIdConstants from '../TestIdConstants';
|
|
10
9
|
import { applyFilter, quickFilterEnabled, removeFilter } from './QuickFilter';
|
|
11
10
|
import copyText from './CopyPaste';
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
text-overflow: ellipsis;
|
|
20
|
-
padding: 0.25rem;
|
|
21
|
-
border-radius: 0.156rem;
|
|
22
|
-
box-sizing: border-box;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
margin-top: 0.125rem;
|
|
25
|
-
margin-bottom: 0.125rem;
|
|
26
|
-
:hover {
|
|
27
|
-
background-color: ${theme.base.colors.blue['extra-light']};
|
|
28
|
-
box-shadow: ${theme.base.shadow['focus-inset']};
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
});
|
|
32
|
-
const StyledListItem = styled.div(({ theme }) => {
|
|
33
|
-
return css `
|
|
34
|
-
button {
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
/* stylelint-disable unit-allowed-list */
|
|
38
|
-
padding: 4px 8px;
|
|
39
|
-
}
|
|
40
|
-
.label {
|
|
41
|
-
padding-left: 14px;
|
|
42
|
-
vertical-align: text-top;
|
|
43
|
-
}
|
|
44
|
-
.disabled {
|
|
45
|
-
padding-left: 14px;
|
|
46
|
-
vertical-align: text-top;
|
|
47
|
-
opacity: ${theme.base['disabled-opacity']};
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
50
|
-
});
|
|
51
|
-
const StyledButton = styled.button `
|
|
52
|
-
display: block;
|
|
53
|
-
text-align: start;
|
|
54
|
-
background: none;
|
|
55
|
-
border: none;
|
|
56
|
-
line-height: 1;
|
|
57
|
-
outline: none;
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
color: ${props => props.theme.base.palette['foreground-color']};
|
|
60
|
-
border-radius: 0;
|
|
61
|
-
`;
|
|
62
|
-
const getDefaultMenuItems = (column, rowContextData, targetCell, columns, filterExpression, actionColumnFiltering, actionClearFiltering, translate) => {
|
|
63
|
-
const isFiltered = isFilterApplied(column, filterExpression);
|
|
64
|
-
return [
|
|
65
|
-
{
|
|
11
|
+
const getMenuItems = (targetCell, column, rowContextData, view, translate) => {
|
|
12
|
+
const { columns = [], state: { filterExpression } = {}, type: { applyFilter: applyViewFilter, clearFilter } } = view;
|
|
13
|
+
const defaultMenuItems = [];
|
|
14
|
+
if (quickFilterEnabled(columns, column.field.id)) {
|
|
15
|
+
const isFiltered = filterExpression && isFilterApplied(column, filterExpression);
|
|
16
|
+
defaultMenuItems.push({
|
|
66
17
|
id: 'quickFilter',
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
show: !!quickFilterEnabled(columns, column.field.id),
|
|
70
|
-
disabled: false,
|
|
18
|
+
visual: isFiltered ? _jsx(Icon, { name: 'times' }) : _jsx(Icon, { name: 'filter' }),
|
|
19
|
+
primary: isFiltered ? translate('Remove filter') : translate('Filter by this'),
|
|
71
20
|
onClick: () => {
|
|
72
21
|
if (isFiltered) {
|
|
73
|
-
|
|
22
|
+
removeFilter(filterExpression, targetCell, applyViewFilter, clearFilter);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
applyFilter(columns, targetCell, rowContextData, filterExpression, applyViewFilter);
|
|
74
26
|
}
|
|
75
|
-
return applyFilter(columns, targetCell, rowContextData, filterExpression, actionColumnFiltering);
|
|
76
27
|
}
|
|
77
|
-
}
|
|
78
|
-
{
|
|
79
|
-
id: 'copyText',
|
|
80
|
-
icon: 'copy',
|
|
81
|
-
label: translate('Copy text'),
|
|
82
|
-
show: true,
|
|
83
|
-
disabled: false,
|
|
84
|
-
onClick: () => copyText(targetCell)
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: 'pasteText',
|
|
88
|
-
icon: 'documents',
|
|
89
|
-
label: translate('Paste text'),
|
|
90
|
-
show: true,
|
|
91
|
-
disabled: true,
|
|
92
|
-
onClick: () => { }
|
|
93
|
-
}
|
|
94
|
-
];
|
|
95
|
-
};
|
|
96
|
-
const getMenuItems = (targetCell, column, rowContextData, columns, filterExpression, actionColumnFiltering, actionClearFiltering, translate) => {
|
|
97
|
-
const fieldContextOptions = column.field?.contextMenuOptions || [];
|
|
98
|
-
return [
|
|
99
|
-
...getDefaultMenuItems(column, rowContextData, targetCell, columns, filterExpression, actionColumnFiltering, actionClearFiltering, translate),
|
|
100
|
-
...fieldContextOptions
|
|
101
|
-
];
|
|
102
|
-
};
|
|
103
|
-
const shouldOverrideContextMenu = (targetCell, columns) => {
|
|
104
|
-
if (!targetCell) {
|
|
105
|
-
return false;
|
|
28
|
+
});
|
|
106
29
|
}
|
|
30
|
+
defaultMenuItems.push({
|
|
31
|
+
id: 'copyText',
|
|
32
|
+
visual: _jsx(Icon, { name: 'copy' }),
|
|
33
|
+
primary: translate('Copy text'),
|
|
34
|
+
onClick: () => copyText(targetCell)
|
|
35
|
+
});
|
|
36
|
+
const fieldSpecificMenuItems = (column.field?.contextMenuOptions || []).map(option => ({
|
|
37
|
+
id: option.id,
|
|
38
|
+
visual: option.icon ? _jsx(Icon, { name: option.icon }) : undefined,
|
|
39
|
+
primary: option.label || '',
|
|
40
|
+
onClick: () => option.onClick?.(targetCell)
|
|
41
|
+
}));
|
|
42
|
+
return [...defaultMenuItems, ...fieldSpecificMenuItems];
|
|
43
|
+
};
|
|
44
|
+
const shouldOverrideContextMenu = (targetCell, columns = []) => {
|
|
107
45
|
const { colId } = targetCell.dataset;
|
|
108
46
|
const { field } = columns.find(col => col.field.id.toString() === colId?.toString()) || {};
|
|
109
47
|
return !(!field || field?.noContextMenu);
|
|
110
48
|
};
|
|
111
|
-
const MenuItem = ({ menu = {}, target = {}, column = {}, rowContextData = {}, onMenuItemClick = () => { } }) => {
|
|
112
|
-
const { onClick = () => { }, icon, disabled = false, show = true, label } = menu;
|
|
113
|
-
if (!show) {
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
return (_jsx(StyledContent, { onClick: () => {
|
|
117
|
-
onMenuItemClick();
|
|
118
|
-
onClick(target, column, rowContextData);
|
|
119
|
-
}, children: _jsx(StyledListItem, { children: _jsxs(StyledButton, { children: [icon && _jsx(Icon, { name: icon }), _jsx("span", { className: cx('label', { disabled }), children: label })] }) }) }));
|
|
120
|
-
};
|
|
121
|
-
MenuItem.propTypes = {
|
|
122
|
-
menu: PropTypes.objectOf(PropTypes.any),
|
|
123
|
-
target: PropTypes.objectOf(PropTypes.any),
|
|
124
|
-
column: PropTypes.objectOf(PropTypes.any),
|
|
125
|
-
rowContextData: PropTypes.objectOf(PropTypes.any),
|
|
126
|
-
onMenuItemClick: PropTypes.func
|
|
127
|
-
};
|
|
128
49
|
export default function ContextMenuContainer({ view, selector }) {
|
|
129
|
-
const { columns, data, state: { paginationOptions
|
|
50
|
+
const { columns = [], data = [], state: { paginationOptions } = {}, domContainer } = view;
|
|
130
51
|
const [translate] = useTranslate();
|
|
131
|
-
const
|
|
52
|
+
const [menuContext, setMenuContext] = useState(null);
|
|
132
53
|
const [showMenu, setShowMenu] = useState(false);
|
|
133
54
|
const [menuItems, setMenuItems] = useState([]);
|
|
134
55
|
const [popperRef, setPopperRef] = useElement();
|
|
@@ -139,63 +60,70 @@ export default function ContextMenuContainer({ view, selector }) {
|
|
|
139
60
|
useScrollAway(popperRef, scrollerElem, () => {
|
|
140
61
|
setShowMenu(false);
|
|
141
62
|
});
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (!showMenu) {
|
|
65
|
+
const targetCell = menuContext?.targetCell;
|
|
66
|
+
if (targetCell) {
|
|
67
|
+
targetCell.removeAttribute('data-context-menu-active');
|
|
68
|
+
targetCell.removeAttribute('aria-expanded');
|
|
69
|
+
targetCell.removeAttribute('aria-controls');
|
|
70
|
+
}
|
|
71
|
+
setMenuContext(null);
|
|
145
72
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
73
|
+
}, [showMenu]);
|
|
74
|
+
const contextMenuListener = useCallback((e) => {
|
|
75
|
+
const target = e.target;
|
|
76
|
+
if (!isInstance(target, Element))
|
|
77
|
+
return;
|
|
78
|
+
const targetElement = target.closest(selector.query.toString());
|
|
79
|
+
if (!isInstance(targetElement, HTMLElement))
|
|
80
|
+
return;
|
|
81
|
+
if (shouldOverrideContextMenu(targetElement, columns) && !target.closest('a')) {
|
|
153
82
|
e.stopPropagation();
|
|
154
83
|
e.preventDefault();
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
targetElement.
|
|
160
|
-
|
|
84
|
+
const { colId } = targetElement.dataset;
|
|
85
|
+
const column = columns.find(col => col.field.id.toString() === colId?.toString());
|
|
86
|
+
if (!column)
|
|
87
|
+
return;
|
|
88
|
+
targetElement.setAttribute('data-context-menu-active', 'true');
|
|
89
|
+
targetElement.setAttribute('aria-expanded', 'true');
|
|
90
|
+
const menuId = `rs-context-menu-${uuidV4()}`;
|
|
91
|
+
targetElement.setAttribute('aria-controls', menuId);
|
|
92
|
+
const rowContextData = getRowContextData(data, paginationOptions || {}, targetElement);
|
|
93
|
+
const options = getMenuItems(targetElement, column, rowContextData, view, translate);
|
|
94
|
+
if (!options.length)
|
|
95
|
+
return;
|
|
161
96
|
setShowMenu(true);
|
|
162
97
|
setMenuItems(options);
|
|
98
|
+
setMenuContext({
|
|
99
|
+
column,
|
|
100
|
+
targetCell: targetElement,
|
|
101
|
+
rowContextData,
|
|
102
|
+
menuId
|
|
103
|
+
});
|
|
163
104
|
}
|
|
164
|
-
}, [
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
contextMenuRef.rowContextData,
|
|
170
|
-
data,
|
|
171
|
-
paginationOptions,
|
|
172
|
-
filterExpression,
|
|
173
|
-
applyViewFilter,
|
|
174
|
-
clearFilter,
|
|
175
|
-
translate
|
|
176
|
-
]);
|
|
105
|
+
}, [selector, columns, data, paginationOptions, translate, view]);
|
|
106
|
+
const onKeydown = useCallback(({ key }) => {
|
|
107
|
+
if (key === 'Escape')
|
|
108
|
+
setShowMenu(false);
|
|
109
|
+
}, []);
|
|
177
110
|
useEffect(() => {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
111
|
+
const abortController = new AbortController();
|
|
112
|
+
if (!domContainer)
|
|
113
|
+
return;
|
|
114
|
+
domContainer.addEventListener('contextmenu', contextMenuListener, {
|
|
115
|
+
signal: abortController.signal
|
|
116
|
+
});
|
|
117
|
+
document.addEventListener('keydown', onKeydown, {
|
|
118
|
+
signal: abortController.signal
|
|
119
|
+
});
|
|
182
120
|
return () => {
|
|
183
|
-
|
|
184
|
-
domContainer.removeEventListener('contextmenu', contextMenuListener);
|
|
185
|
-
domContainer.removeEventListener('keydown', onMenuItemClick);
|
|
186
|
-
}
|
|
121
|
+
abortController.abort();
|
|
187
122
|
};
|
|
188
|
-
}, [domContainer, contextMenuListener
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
return (_jsx(Popover, { portal: true, ref: setPopperRef, target: contextMenuRef.targetCell, children: _jsx(StyledPopover, { children: menuItems.map(menu => (_jsx(MenuItem, { onMenuItemClick: onMenuItemClick, target: contextMenuRef.targetCell, column: contextMenuRef.column, rowContextData: contextMenuRef.rowContextData, menu: menu }, menu.id))) }) }));
|
|
123
|
+
}, [domContainer, contextMenuListener]);
|
|
124
|
+
return showMenu && menuContext ? (_jsx(Popover, { ref: setPopperRef, target: menuContext.targetCell, children: _jsx(Menu, { id: menuContext.menuId, items: menuItems, onItemClick: (_, e) => {
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
setShowMenu(false);
|
|
127
|
+
}, focusControlEl: menuContext.targetCell, className: 'action-menu', "data-testid": TestIdConstants.contextMenu, "data-test-id": 'action-menu' }) })) : null;
|
|
196
128
|
}
|
|
197
|
-
ContextMenuContainer.propTypes = {
|
|
198
|
-
view: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
199
|
-
selector: PropTypes.objectOf(PropTypes.any).isRequired
|
|
200
|
-
};
|
|
201
129
|
//# sourceMappingURL=ContextMenuContainer.js.map
|