@pega/lists-react 9.0.0-build.9.9 → 10.0.0-build.1.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 +0 -4
- package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts.map +1 -1
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js +2 -1
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js.map +1 -1
- package/lib/Core/Components/AggregateMenu.d.ts.map +1 -1
- package/lib/Core/Components/AggregateMenu.js +6 -2
- package/lib/Core/Components/AggregateMenu.js.map +1 -1
- package/lib/Core/Components/AggregatorCell.d.ts.map +1 -1
- package/lib/Core/Components/AggregatorCell.js +3 -1
- package/lib/Core/Components/AggregatorCell.js.map +1 -1
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts +6 -15
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts.map +1 -1
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js +111 -166
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js.map +1 -1
- package/lib/Core/Components/ContextMenu/QuickFilter.js +1 -1
- package/lib/Core/Components/ContextMenu/QuickFilter.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js +33 -5
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.d.ts +10 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.js +27 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDeleteAction.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts +2 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js +2 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts +3 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js +11 -2
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts +3 -2
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js +13 -26
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js +2 -2
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts +0 -2
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js +11 -9
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js +20 -19
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts +4 -3
- package/lib/Core/Components/DefaultComponents/index.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.js +0 -2
- package/lib/Core/Components/DefaultComponents/index.js.map +1 -1
- package/lib/Core/Components/Filters/AdvanceFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/AdvanceFilter.js +5 -2
- package/lib/Core/Components/Filters/AdvanceFilter.js.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.d.ts +1 -1
- package/lib/Core/Components/Filters/SelectFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.js +43 -44
- package/lib/Core/Components/Filters/SelectFilter.js.map +1 -1
- package/lib/Core/Components/Filters/SimpleFilter.js +1 -1
- package/lib/Core/Components/Filters/SimpleFilter.js.map +1 -1
- package/lib/Core/Components/Filters/styles.d.ts +1 -1
- package/lib/Core/Components/FooterAggregators.d.ts.map +1 -1
- package/lib/Core/Components/FooterAggregators.js +6 -3
- package/lib/Core/Components/FooterAggregators.js.map +1 -1
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts +12 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js +62 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js.map +1 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts +33 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js +106 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js.map +1 -0
- package/lib/Core/Components/GroupRenderer/index.d.ts +22 -0
- package/lib/Core/Components/GroupRenderer/index.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/index.js +395 -0
- package/lib/Core/Components/GroupRenderer/index.js.map +1 -0
- package/lib/Core/Components/Grouping/GroupingMenu.d.ts.map +1 -1
- package/lib/Core/Components/Grouping/GroupingMenu.js +2 -1
- package/lib/Core/Components/Grouping/GroupingMenu.js.map +1 -1
- package/lib/Core/Components/HeaderCell.d.ts.map +1 -1
- package/lib/Core/Components/HeaderCell.js +3 -3
- package/lib/Core/Components/HeaderCell.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.d.ts +1 -1
- package/lib/Core/Components/HeaderMenu/actions.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.js +3 -4
- package/lib/Core/Components/HeaderMenu/actions.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.js +5 -5
- package/lib/Core/Components/HeaderMenu/index.js.map +1 -1
- package/lib/Core/Components/HierarchicalGroupRenderer.d.ts.map +1 -1
- package/lib/Core/Components/HierarchicalGroupRenderer.js +6 -2
- package/lib/Core/Components/HierarchicalGroupRenderer.js.map +1 -1
- package/lib/Core/Components/NotificationManager.js +1 -1
- package/lib/Core/Components/NotificationManager.js.map +1 -1
- package/lib/Core/Components/RFColumnConfigurator.d.ts.map +1 -1
- package/lib/Core/Components/RFColumnConfigurator.js +32 -9
- package/lib/Core/Components/RFColumnConfigurator.js.map +1 -1
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.d.ts.map +1 -1
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.js +2 -1
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.js.map +1 -1
- package/lib/Core/Components/RSWrapper/index.d.ts.map +1 -1
- package/lib/Core/Components/RSWrapper/index.js +2 -9
- package/lib/Core/Components/RSWrapper/index.js.map +1 -1
- package/lib/Core/Components/RenderingEngine/Formatter.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/Formatter.js +4 -1
- package/lib/Core/Components/RenderingEngine/Formatter.js.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js +19 -8
- package/lib/Core/Components/RenderingEngine/RenderCell.js.map +1 -1
- package/lib/Core/Components/RenderingEngine/useHighlighter.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/useHighlighter.js +0 -1
- package/lib/Core/Components/RenderingEngine/useHighlighter.js.map +1 -1
- package/lib/Core/Components/TestIdConstants.d.ts +2 -0
- package/lib/Core/Components/TestIdConstants.js +3 -1
- package/lib/Core/Components/TestIdConstants.js.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js +7 -18
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts +6 -4
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.js +18 -21
- package/lib/Core/Components/Toolbar/ColumnSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/DebugInfo.d.ts +3 -5
- package/lib/Core/Components/Toolbar/DebugInfo.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/DebugInfo.js +3 -3
- package/lib/Core/Components/Toolbar/DebugInfo.js.map +1 -1
- package/lib/Core/Components/Toolbar/FieldSelector.d.ts +2 -1
- package/lib/Core/Components/Toolbar/FieldSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/FieldSelector.js +14 -7
- package/lib/Core/Components/Toolbar/FieldSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/Grouping.types.d.ts +0 -6
- package/lib/Core/Components/Toolbar/Grouping.types.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/Grouping.types.js.map +1 -1
- package/lib/Core/Components/Toolbar/RefreshBanner.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/RefreshBanner.js +1 -0
- package/lib/Core/Components/Toolbar/RefreshBanner.js.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.js +2 -4
- package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useFilter.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useFilter.js +4 -1
- package/lib/Core/Components/Toolbar/hooks/useFilter.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts +14 -18
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js +15 -16
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts +4 -2
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js +30 -22
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js +17 -6
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts +7 -2
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js +12 -5
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.js +134 -80
- package/lib/Core/Components/Toolbar/hooks/useMore.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts +8 -6
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js +18 -3
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSearch.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSearch.js +7 -10
- package/lib/Core/Components/Toolbar/hooks/useSearch.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts +8 -6
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js +16 -10
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts +4 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js +9 -3
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js +8 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.d.ts +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.js +2 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts +2 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js +36 -12
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.d.ts +28 -7
- package/lib/Core/Components/Toolbar/utils/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.js +43 -11
- package/lib/Core/Components/Toolbar/utils/utils.js.map +1 -1
- package/lib/Core/Components/Virtualise/Pagination.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/Pagination.js +2 -1
- package/lib/Core/Components/Virtualise/Pagination.js.map +1 -1
- package/lib/Core/Components/Virtualise/UseScroll.d.ts +4 -1
- package/lib/Core/Components/Virtualise/UseScroll.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/UseScroll.js +16 -3
- package/lib/Core/Components/Virtualise/UseScroll.js.map +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js.map +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js.map +1 -1
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js +14 -4
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -1
- package/lib/Core/Components/Virtualise/index.js +19 -4
- package/lib/Core/Components/Virtualise/index.js.map +1 -1
- package/lib/Core/Components/Virtualise/utility.js +1 -1
- package/lib/Core/Components/Virtualise/utility.js.map +1 -1
- package/lib/Core/Components/WarningBanner.d.ts +11 -0
- package/lib/Core/Components/WarningBanner.d.ts.map +1 -0
- package/lib/Core/Components/WarningBanner.js +23 -0
- package/lib/Core/Components/WarningBanner.js.map +1 -0
- package/lib/Core/Context/LocalizationContext.d.ts +1 -1
- package/lib/Core/Context/LocalizationContext.d.ts.map +1 -1
- package/lib/Core/Context/LocalizationContext.js.map +1 -1
- package/lib/Core/Hooks/a11y/useAnnounce.d.ts +3 -4
- package/lib/Core/Hooks/a11y/useAnnounce.d.ts.map +1 -1
- package/lib/Core/Hooks/a11y/useAnnounce.js +3 -4
- package/lib/Core/Hooks/a11y/useAnnounce.js.map +1 -1
- package/lib/Core/Hooks/useDebounce.js +1 -1
- package/lib/Core/Hooks/useDebounce.js.map +1 -1
- package/lib/Core/Hooks/useDragDrop.d.ts +2 -2
- package/lib/Core/Hooks/useDragDrop.d.ts.map +1 -1
- package/lib/Core/Hooks/useDragDrop.js +9 -9
- package/lib/Core/Hooks/useDragDrop.js.map +1 -1
- package/lib/Core/Hooks/useRepeat.d.ts +1 -1
- package/lib/Core/Hooks/useRepeat.d.ts.map +1 -1
- package/lib/Core/Hooks/useRepeat.js +58 -11
- package/lib/Core/Hooks/useRepeat.js.map +1 -1
- package/lib/Core/Hooks/useSelectAllCheckbox.d.ts +21 -0
- package/lib/Core/Hooks/useSelectAllCheckbox.d.ts.map +1 -0
- package/lib/Core/Hooks/useSelectAllCheckbox.js +23 -0
- package/lib/Core/Hooks/useSelectAllCheckbox.js.map +1 -0
- package/lib/Core/Localization/defaultTranslations.d.ts +15 -13
- package/lib/Core/Localization/defaultTranslations.d.ts.map +1 -1
- package/lib/Core/Localization/defaultTranslations.js +16 -14
- package/lib/Core/Localization/defaultTranslations.js.map +1 -1
- package/lib/Core/Test/JUnitMocks.d.ts +12 -0
- package/lib/Core/Test/JUnitMocks.d.ts.map +1 -1
- package/lib/Core/Test/JUnitMocks.js +27 -8
- package/lib/Core/Test/JUnitMocks.js.map +1 -1
- package/lib/Core/Test/TestUtils.d.ts +0 -1
- package/lib/Core/Test/TestUtils.d.ts.map +1 -1
- package/lib/Core/Test/TestUtils.js +3 -7
- package/lib/Core/Test/TestUtils.js.map +1 -1
- package/lib/Core/Utils/index.d.ts +15 -0
- package/lib/Core/Utils/index.d.ts.map +1 -1
- package/lib/Core/Utils/index.js +22 -0
- package/lib/Core/Utils/index.js.map +1 -1
- package/lib/Core/Utils/styles.d.ts +2 -2
- package/lib/Core/Utils/styles.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts +4 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.js +29 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js +25 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.js +15 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.js.map +1 -0
- package/lib/Core/Views/Gallery/Gallery.types.d.ts +8 -0
- package/lib/Core/Views/Gallery/Gallery.types.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Gallery.types.js +2 -0
- package/lib/Core/Views/Gallery/Gallery.types.js.map +1 -0
- package/lib/Core/Views/Gallery/GalleryA11y.d.ts +7 -5
- package/lib/Core/Views/Gallery/GalleryA11y.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/GalleryA11y.js +9 -52
- package/lib/Core/Views/Gallery/GalleryA11y.js.map +1 -1
- package/lib/Core/Views/Gallery/GalleryContainer.d.ts +23 -0
- package/lib/Core/Views/Gallery/GalleryContainer.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/GalleryContainer.js +66 -0
- package/lib/Core/Views/Gallery/GalleryContainer.js.map +1 -0
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js +1 -1
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js.map +1 -1
- package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts +9 -0
- package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/hooks/useRowActions.js +25 -0
- package/lib/Core/Views/Gallery/hooks/useRowActions.js.map +1 -0
- package/lib/Core/Views/Gallery/index.d.ts +4 -8
- package/lib/Core/Views/Gallery/index.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/index.js +38 -59
- package/lib/Core/Views/Gallery/index.js.map +1 -1
- package/lib/Core/Views/Gallery/utils.d.ts +36 -0
- package/lib/Core/Views/Gallery/utils.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/utils.js +115 -0
- package/lib/Core/Views/Gallery/utils.js.map +1 -0
- package/lib/Core/Views/Map/Map.styles.d.ts +190 -6
- package/lib/Core/Views/Map/Map.styles.d.ts.map +1 -1
- package/lib/Core/Views/Map/Map.styles.js.map +1 -1
- package/lib/Core/Views/Map/index.d.ts.map +1 -1
- package/lib/Core/Views/Map/index.js +2 -2
- package/lib/Core/Views/Map/index.js.map +1 -1
- package/lib/Core/Views/RsCardWrapper.js.map +1 -1
- package/lib/Core/Views/Table/Body.d.ts.map +1 -1
- package/lib/Core/Views/Table/Body.js +5 -2
- package/lib/Core/Views/Table/Body.js.map +1 -1
- package/lib/Core/Views/Table/CellWrapper.d.ts +1 -1
- package/lib/Core/Views/Table/CellWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/CellWrapper.js +4 -2
- package/lib/Core/Views/Table/CellWrapper.js.map +1 -1
- package/lib/Core/Views/Table/GroupingHeaderCell.d.ts +6 -15
- package/lib/Core/Views/Table/GroupingHeaderCell.d.ts.map +1 -1
- package/lib/Core/Views/Table/GroupingHeaderCell.js +16 -14
- package/lib/Core/Views/Table/GroupingHeaderCell.js.map +1 -1
- package/lib/Core/Views/Table/HeaderWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/HeaderWrapper.js +5 -5
- package/lib/Core/Views/Table/HeaderWrapper.js.map +1 -1
- package/lib/Core/Views/Table/SkeletonRows.d.ts +1 -1
- package/lib/Core/Views/Table/SkeletonRows.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.d.ts +3 -1
- package/lib/Core/Views/Table/StyledTableContainer.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.js +270 -155
- package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -1
- package/lib/Core/Views/Table/TableA11y.d.ts +13 -1
- package/lib/Core/Views/Table/TableA11y.d.ts.map +1 -1
- package/lib/Core/Views/Table/TableA11y.js +233 -13
- package/lib/Core/Views/Table/TableA11y.js.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts +3 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.js +16 -16
- package/lib/Core/Views/Table/VirtualizeWrapper.js.map +1 -1
- package/lib/Core/Views/Table/index.d.ts.map +1 -1
- package/lib/Core/Views/Table/index.js +16 -7
- package/lib/Core/Views/Table/index.js.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.js +15 -20
- package/lib/Core/Views/Timeline/Timeline.js.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts +392 -15
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.styles.js +44 -44
- package/lib/Core/Views/Timeline/Timeline.styles.js.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.types.d.ts +11 -7
- package/lib/Core/Views/Timeline/Timeline.types.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/Timeline.types.js.map +1 -1
- package/lib/Core/Views/Timeline/TimelineGroup.d.ts +13 -0
- package/lib/Core/Views/Timeline/TimelineGroup.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/TimelineGroup.js +21 -0
- package/lib/Core/Views/Timeline/TimelineGroup.js.map +1 -0
- package/lib/Core/Views/Timeline/TimelineItem.d.ts +1 -3
- package/lib/Core/Views/Timeline/TimelineItem.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/TimelineItem.js +7 -6
- package/lib/Core/Views/Timeline/TimelineItem.js.map +1 -1
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts +2 -2
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.js.map +1 -1
- package/lib/Core/Views/Timeline/index.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/index.js +13 -6
- package/lib/Core/Views/Timeline/index.js.map +1 -1
- package/lib/Core/Views/Timeline/utils.d.ts +8 -10
- package/lib/Core/Views/Timeline/utils.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/utils.js +136 -58
- package/lib/Core/Views/Timeline/utils.js.map +1 -1
- package/lib/Core/Views/rs-styles.d.ts +1 -1
- package/lib/Core/a11y/loadingAnnouncementBehavior.d.ts +12 -0
- package/lib/Core/a11y/loadingAnnouncementBehavior.d.ts.map +1 -0
- package/lib/Core/a11y/loadingAnnouncementBehavior.js +37 -0
- package/lib/Core/a11y/loadingAnnouncementBehavior.js.map +1 -0
- package/lib/Core/constants.d.ts.map +1 -1
- package/lib/Core/constants.js +1 -0
- package/lib/Core/constants.js.map +1 -1
- package/lib/Core/index.d.ts.map +1 -1
- package/lib/Core/index.js +1 -2
- package/lib/Core/index.js.map +1 -1
- package/lib/Core/templateFeatureSupport.d.ts +17 -0
- package/lib/Core/templateFeatureSupport.d.ts.map +1 -0
- package/lib/Core/templateFeatureSupport.js +31 -0
- package/lib/Core/templateFeatureSupport.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/RepeatingStructuresBoot.types.d.ts +12 -8
- package/lib/types/RepeatingStructuresBoot.types.d.ts.map +1 -1
- package/lib/types/RepeatingStructuresBoot.types.js.map +1 -1
- package/lib/types.d.ts +2 -0
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +11 -13
- package/lib/Core/Components/DefaultComponents/CardItem.d.ts +0 -3
- package/lib/Core/Components/DefaultComponents/CardItem.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CardItem.js +0 -78
- package/lib/Core/Components/DefaultComponents/CardItem.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts +0 -12
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js +0 -36
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts +0 -15
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js +0 -50
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts +0 -12
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js +0 -44
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts +0 -16
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js +0 -64
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js.map +0 -1
- package/lib/Core/Components/GroupRenderer.d.ts +0 -31
- package/lib/Core/Components/GroupRenderer.d.ts.map +0 -1
- package/lib/Core/Components/GroupRenderer.js +0 -348
- package/lib/Core/Components/GroupRenderer.js.map +0 -1
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.d.ts +0 -2
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.d.ts.map +0 -1
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.js +0 -4
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.js.map +0 -1
- package/lib/Core/Components/Toolbar/KeyboardInstructions.d.ts +0 -6
- package/lib/Core/Components/Toolbar/KeyboardInstructions.d.ts.map +0 -1
- package/lib/Core/Components/Toolbar/KeyboardInstructions.js +0 -32
- package/lib/Core/Components/Toolbar/KeyboardInstructions.js.map +0 -1
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts +0 -7
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts.map +0 -1
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js +0 -109
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js.map +0 -1
- package/lib/Core/Views/Gallery/ItemWrapper.d.ts +0 -19
- package/lib/Core/Views/Gallery/ItemWrapper.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/ItemWrapper.js +0 -34
- package/lib/Core/Views/Gallery/ItemWrapper.js.map +0 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts +0 -3
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js +0 -51
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js.map +0 -1
- package/lib/Core/Views/Timeline/utility.d.ts +0 -8
- package/lib/Core/Views/Timeline/utility.d.ts.map +0 -1
- package/lib/Core/Views/Timeline/utility.js +0 -120
- package/lib/Core/Views/Timeline/utility.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/RSWrapper/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC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AAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;YACvC,GAAG,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,eAAe,GAAG,MAAM,EAAE,CAAC;IACjC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAEtC,OAAO,CACL,KAAC,eAAe,cACd,KAAC,iBAAiB,IAChB,GAAG,EAAE,CAAC,CAAC,EAAE;gBACP,eAAe,CAAC,CAAC,CAAC,CAAC;gBACnB,eAAe,CAAC,OAAO,GAAG,CAAC,CAAC;YAC9B,CAAC,EACD,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,YAAY,YAEtB,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,GAAI,GACP,GACJ,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,SAAS,CAAC,SAAS,GAAG;IACpB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC;AAEF,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAErE,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACtC,OAAO,CACL,KAAC,oBAAoB,cACnB,KAAC,eAAe,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,GACnB,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC","sourcesContent":["import { forwardRef, memo, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport styled, { css } from 'styled-components';\n\nimport { Fullscreen, useFullscreenContext } from '@pega/cosmos-react-core';\nimport { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';\n\nimport styles from '../../Views/rs-styles';\nimport Table from '../../Views/Table';\nimport Gallery from '../../Views/Gallery';\nimport Timeline from '../../Views/Timeline';\nimport Map from '../../Views/Map';\nimport repeatComponent from '../../index';\nimport useConfirmationModal from '../../Hooks/useConfirmationModal';\nimport useSmallScreen from '../../Hooks/useSmallScreen';\nimport { LocalizationProvider } from '../../Context/LocalizationContext';\n\nconst StyledRSContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(() => {\n const fullscreen = useFullscreenContext();\n\n return css`\n ${styles}\n\n ${fullscreen &&\n fullscreen[0] &&\n css`\n height: 100%;\n `}\n `;\n});\n\nexport const CosmosProviders = ({ children }) => {\n return <Fullscreen>{children}</Fullscreen>;\n};\n\nconst RSWrapper = ({ view }) => {\n /** Read template from view, as changeTemplate feature can mutate the template */\n const { template, setDomContainer, columns } = view;\n\n let Component;\n switch (template) {\n case REPEATING_STRUCTURE_TEMPLATES.GALLERY:\n Component = Gallery;\n break;\n case REPEATING_STRUCTURE_TEMPLATES.TIMELINE:\n Component = Timeline;\n break;\n case REPEATING_STRUCTURE_TEMPLATES.MAP:\n Component = Map;\n break;\n default:\n Component = Table;\n }\n\n useConfirmationModal({ view });\n\n /**\n * Adding all column level styles into columnStyles on DOMContainer.\n * Since domContainer is the only ref available across the features.\n * If some feature want to override something (say Resize the width), that only refelects if we add styles here.\n * Other wise fall into specificity/precedence of local CSS variables.\n * This won't effect other RS views, since these styles are generated through features.\n * If a feature is not applicable it won't add styles to this object.\n */\n const columnStyles = columns?.reduce((acc, column) => {\n const { style, field, hidden } = column;\n if (hidden) return acc;\n Object.entries(style).forEach(([s, v]) => {\n acc[`--col-${s}-${field.idHash}`] = v;\n });\n return acc;\n }, {});\n\n const domContainerRef = useRef();\n useSmallScreen(view, domContainerRef);\n\n return (\n <CosmosProviders>\n <StyledRSContainer\n ref={r => {\n setDomContainer(r);\n domContainerRef.current = r;\n }}\n style={columnStyles}\n className='rs-wrapper'\n >\n <Component view={view} />\n </StyledRSContainer>\n </CosmosProviders>\n );\n};\n\nRSWrapper.displayName = 'RSWrapper';\n\nRSWrapper.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n\nconst RepeatComponent = memo(forwardRef(repeatComponent(RSWrapper)));\n\nconst WithLocalization = (props, ref) => {\n return (\n <LocalizationProvider>\n <RepeatComponent {...props} ref={ref} />\n </LocalizationProvider>\n );\n};\n\nexport default memo(forwardRef(WithLocalization));\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Formatter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/Formatter.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"Formatter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/Formatter.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,QAyBtE"}
|
|
@@ -6,13 +6,16 @@ export default function Formatter(context, applyFormatter) {
|
|
|
6
6
|
const { locale, timezone } = context.getRsMeta();
|
|
7
7
|
const rowData = context.getExecutionContext?.()?.getValue?.();
|
|
8
8
|
const fieldDef = context.getField();
|
|
9
|
+
// TODO: Need to read this context.formatterConfig from context.getField() once its available there.
|
|
10
|
+
const formatterConfig = context.formatterConfig;
|
|
9
11
|
let formattedValue = applyFormatter && formatter
|
|
10
12
|
? formatter(inputValue, {
|
|
11
13
|
locale,
|
|
12
14
|
timezone,
|
|
13
15
|
rowData,
|
|
14
16
|
fieldDef,
|
|
15
|
-
translate
|
|
17
|
+
translate,
|
|
18
|
+
formatterConfig
|
|
16
19
|
})
|
|
17
20
|
: inputValue?.toString();
|
|
18
21
|
// Empty cell value for any field type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Formatter.js","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/Formatter.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAY,EAAE,cAAuB;IACrE,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IACzC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,mBAAmB,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC;IAC9D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACpC,IAAI,cAAc,GAChB,cAAc,IAAI,SAAS;QACzB,CAAC,CAAC,SAAS,CAAC,UAAU,EAAE;YACpB,MAAM;YACN,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,SAAS;
|
|
1
|
+
{"version":3,"file":"Formatter.js","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/Formatter.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAY,EAAE,cAAuB;IACrE,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IACzC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,mBAAmB,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC;IAC9D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACpC,oGAAoG;IACpG,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAChD,IAAI,cAAc,GAChB,cAAc,IAAI,SAAS;QACzB,CAAC,CAAC,SAAS,CAAC,UAAU,EAAE;YACpB,MAAM;YACN,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,SAAS;YACT,eAAe;SAChB,CAAC;QACJ,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAC;IAC7B,sCAAsC;IACtC,IAAI,cAAc,KAAK,EAAE,IAAI,cAAc,KAAK,IAAI,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACrF,cAAc,GAAG,IAAI,CAAC;IACxB,CAAC;IACD,OAAO,CAAC,OAAO,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import useTranslate from '../../Hooks/useTranslate';\n\nexport default function Formatter(context: any, applyFormatter: boolean) {\n const [translate] = useTranslate();\n const inputValue = context.getValue();\n const formatter = context.getFormatter();\n const { locale, timezone } = context.getRsMeta();\n const rowData = context.getExecutionContext?.()?.getValue?.();\n const fieldDef = context.getField();\n // TODO: Need to read this context.formatterConfig from context.getField() once its available there.\n const formatterConfig = context.formatterConfig;\n let formattedValue =\n applyFormatter && formatter\n ? formatter(inputValue, {\n locale,\n timezone,\n rowData,\n fieldDef,\n translate,\n formatterConfig\n })\n : inputValue?.toString();\n // Empty cell value for any field type\n if (formattedValue === '' || formattedValue === null || formattedValue === undefined) {\n formattedValue = '––';\n }\n context.setProp('formattedValue', formattedValue);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderCell.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/RenderCell.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"RenderCell.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/RenderCell.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AA4B7E,UAAU,oBAAqB,SAAQ,WAAW,CAAC,0BAA0B;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,eAAe,CAAC,EACvB,SAAgB,EAChB,WAAmB,EACnB,mBAA2B,EAC3B,YAAoB,EACpB,OAAe,EACf,OAAO,EACP,MAAM,EACN,KAAY,EACZ,SAAS,EACV,EAAE,oBAAoB,2CAiDtB;;AAED,wBAAqC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useMemo, useRef, useContext } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
4
|
import { FieldType } from 'pega-repeating-structures-core';
|
|
5
|
+
import { defaultThemeProp } from '@pega/cosmos-react-core';
|
|
6
|
+
import { markStyles } from '@pega/cosmos-react-core/lib/components/Mark/Mark';
|
|
5
7
|
import { createClassName as cx } from '../../Utils';
|
|
6
8
|
import GlobalContext from '../../Context/GlobalContext';
|
|
7
9
|
import Formatter from './Formatter';
|
|
@@ -9,9 +11,19 @@ import ExpresssionEvaluator from './ExpresssionEvaluator';
|
|
|
9
11
|
import Flasher from './Flasher';
|
|
10
12
|
import useHighlighter from './useHighlighter';
|
|
11
13
|
import ErrorHandler from './ErrorHandler';
|
|
12
|
-
const StyledSpan = styled.span
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
const StyledSpan = styled.span(({ style }) => {
|
|
15
|
+
return css `
|
|
16
|
+
${style}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Using mark tag instead of <Mark /> component as the search in RS needs to be done on the rendered DOM content instead of string value.
|
|
20
|
+
*/
|
|
21
|
+
mark {
|
|
22
|
+
${markStyles}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
});
|
|
26
|
+
StyledSpan.defaultProps = defaultThemeProp;
|
|
15
27
|
function RenderingEngine({ formatter = true, highlighter = false, expressionEvaluator = false, errorHandler = false, flasher = false, context, column, style = null /* This prop is provided by CellWrapper.jsx */, className }) {
|
|
16
28
|
const { resolveCellComponent, resolveViewComponent } = useContext(GlobalContext);
|
|
17
29
|
const engineWrapper = useRef();
|
|
@@ -23,14 +35,13 @@ function RenderingEngine({ formatter = true, highlighter = false, expressionEval
|
|
|
23
35
|
...context,
|
|
24
36
|
renderFactory,
|
|
25
37
|
resolveCellComponent,
|
|
26
|
-
resolveViewComponent
|
|
38
|
+
resolveViewComponent,
|
|
39
|
+
formatterConfig: column.formatterConfig
|
|
27
40
|
};
|
|
28
41
|
const pipeline = [];
|
|
29
42
|
const { getField, getRendererType } = engineContext;
|
|
30
43
|
const field = getField();
|
|
31
|
-
const isHighlighterApplicable = useMemo(() => !!(
|
|
32
|
-
field.type === FieldType.TEXT &&
|
|
33
|
-
column.parent?.meta?.globalSearch), [field.type, column]);
|
|
44
|
+
const isHighlighterApplicable = useMemo(() => !!(field.type === FieldType.TEXT && column.parent?.meta?.globalSearch), [field.type, column]);
|
|
34
45
|
if (expressionEvaluator)
|
|
35
46
|
pipeline.push(ExpresssionEvaluator);
|
|
36
47
|
if (column.formatterAllowed)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderCell.js","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/RenderCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,MAAM,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"RenderCell.js","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/RenderCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAoB,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAE9E,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAA2C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrF,OAAO,GAAG,CAAA;MACN,KAAK;;;;;;QAMH,UAAU;;GAEf,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAa3C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C,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IAChF,IAAI,YAAY;QAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,IAAI,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEpC,cAAc,CAAC,aAAa,EAAE;QAC5B,eAAe,EAAE,WAAW,IAAI,uBAAuB;KACxD,CAAC,CAAC;IAEH,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;IAExC,OAAO,CACL,KAAC,UAAU,IACT,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC,KACpC,CAAC,WAAW;YACd,uBAAuB;YACvB,aAAa,CAAC,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,CAAC,gBAAgB,EAAE,EAAE,CAAC,YAE/E,oBAAoB,CAAC,eAAe,EAAE,EAAE,IAAI,cAAc,EAAE,aAAa,EAAE,aAAa,CAAC,GAC/E,CACd,CAAC;AACJ,CAAC;AAED,eAAe,IAAI,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import { memo, useMemo, useRef, useContext } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { CSSObject } from 'styled-components';\n\nimport { FieldType, type RsCoreTypes } from 'pega-repeating-structures-core';\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\nimport { markStyles } from '@pega/cosmos-react-core/lib/components/Mark/Mark';\n\nimport { createClassName as cx } from '../../Utils';\nimport GlobalContext from '../../Context/GlobalContext';\n\nimport Formatter from './Formatter';\nimport ExpresssionEvaluator from './ExpresssionEvaluator';\nimport Flasher from './Flasher';\nimport useHighlighter from './useHighlighter';\nimport ErrorHandler from './ErrorHandler';\n\nconst StyledSpan = styled.span<{ style: RenderingEngineProps['style'] }>(({ style }) => {\n return css`\n ${style}\n\n /**\n * Using mark tag instead of <Mark /> component as the search in RS needs to be done on the rendered DOM content instead of string value.\n */\n mark {\n ${markStyles}\n }\n `;\n});\n\nStyledSpan.defaultProps = defaultThemeProp;\n\ninterface RenderingEngineProps extends RsCoreTypes.ColumnRenderingEngineProps {\n formatter?: boolean;\n highlighter?: boolean;\n expressionEvaluator?: boolean;\n errorHandler?: boolean;\n flasher?: boolean;\n context?: any;\n style?: CSSObject | null;\n className?: string;\n}\n\nfunction RenderingEngine({\n formatter = true,\n highlighter = false,\n expressionEvaluator = false,\n errorHandler = false,\n flasher = false,\n context,\n column,\n style = null /* This prop is provided by CellWrapper.jsx */,\n className\n}: RenderingEngineProps) {\n const { resolveCellComponent, resolveViewComponent } = useContext(GlobalContext);\n\n const engineWrapper = useRef();\n const { renderFactory } = column;\n\n const columnExecutionContext = column.getExecutionContext();\n\n const engineContext = {\n getElement: () => engineWrapper.current,\n ...column.getContext(columnExecutionContext),\n ...context,\n renderFactory,\n resolveCellComponent,\n resolveViewComponent,\n formatterConfig: column.formatterConfig\n };\n const pipeline: any[] = [];\n const { getField, getRendererType } = engineContext;\n const field = getField();\n\n const isHighlighterApplicable = useMemo(\n () => !!(field.type === FieldType.TEXT && column.parent?.meta?.globalSearch),\n [field.type, column]\n );\n\n if (expressionEvaluator) pipeline.push(ExpresssionEvaluator);\n if (column.formatterAllowed) pipeline.push((c: any) => Formatter(c, formatter));\n if (errorHandler) pipeline.push(ErrorHandler);\n if (flasher) pipeline.push(Flasher);\n\n useHighlighter(engineContext, {\n shouldHighlight: highlighter && isHighlighterApplicable\n });\n\n pipeline.forEach(p => p(engineContext));\n\n return (\n <StyledSpan\n ref={engineWrapper}\n style={style}\n className={cx('cell-content', className)}\n {...(highlighter &&\n isHighlighterApplicable &&\n engineContext.getSearchKeyword() && { key: engineContext.getSearchKeyword() })}\n >\n {resolveCellComponent(getRendererType?.() || 'cellRenderer', renderFactory, engineContext)}\n </StyledSpan>\n );\n}\n\nexport default memo(RenderingEngine);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHighlighter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/useHighlighter.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,GAAG,EACZ,EAAE,aAAqB,EAAE,eAAuB,EAAE;;;CAAK,
|
|
1
|
+
{"version":3,"file":"useHighlighter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/useHighlighter.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,GAAG,EACZ,EAAE,aAAqB,EAAE,eAAuB,EAAE;;;CAAK,QA6CxD"}
|
|
@@ -33,7 +33,6 @@ export default function useHighlighter(context, { caseSensitive = false, shouldH
|
|
|
33
33
|
child.textContent.replace(keywordRegex, (match, idx) => {
|
|
34
34
|
const part = document.createTextNode(child.textContent.slice(lastIdx, idx));
|
|
35
35
|
const highlighted = document.createElement('mark');
|
|
36
|
-
highlighted.style.background = '#fffc65';
|
|
37
36
|
highlighted.textContent = match;
|
|
38
37
|
frag.appendChild(part);
|
|
39
38
|
frag.appendChild(highlighted);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHighlighter.js","sourceRoot":"","sources":["../../../../Core/Components/RenderingEngine/useHighlighter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,mBAAmB,GAAG,qCAAqC,CAAC;AAClE,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,KAAK,EAAE,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAY,EACZ,EAAE,aAAa,GAAG,KAAK,EAAE,eAAe,GAAG,KAAK,EAAE,GAAG,EAAE;IAEvD,+EAA+E;IAC/E,wDAAwD;IACxD,MAA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,KAAK,CAAC,MAAM,CAAC;oBAC/B,CAAC,CAAC,CAAC;oBACH,MAAM,GAAG,GAAG,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;oBACtE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;oBACtB,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,eAAe,IAAI,OAAO,CAAC,MAAM;YAAE,SAAS,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { useEffect } from 'react';\n\nconst SPECIAL_CHARS_REGEX = /(\\[|\\\\|\\^|\\$|\\.|\\||\\?|\\*|\\+|\\(|\\))/g;\nfunction sanitizeRegex(regex: string) {\n return regex?.replace(SPECIAL_CHARS_REGEX, '\\\\$1');\n}\n\nexport default function useHighlighter(\n context: any,\n { caseSensitive = false, shouldHighlight = false } = {}\n) {\n // Context is executional context and wont be available in asynchronous method.\n // We have to keep reference of used objects in closure.\n const getElement = context?.getElement;\n const getSearchKeyword = context?.getSearchKeyword;\n\n useEffect(() => {\n const flags = caseSensitive ? 'g' : 'gi';\n const keyword = [sanitizeRegex(getSearchKeyword?.()?.trim())].filter((_: string) => _);\n\n const keywordRegex = new RegExp(keyword[0], flags);\n function highlight(element: Node) {\n if (!element?.textContent || !keywordRegex.test(element.textContent)) {\n // in case there is no match\n return;\n }\n // Sort longer matches first to avoid\n // highlighting keywords within keywords.\n Array.from(element?.childNodes || []).forEach(child => {\n keywordRegex.lastIndex = 0;\n if (child.nodeType !== 3) {\n // not a text node\n if (child.nodeName !== 'SCRIPT' && child.nodeName !== 'STYLE') {\n highlight(child);\n }\n } else if (child.textContent && keywordRegex.test(child.textContent)) {\n const frag = document.createDocumentFragment();\n let lastIdx = 0;\n child.textContent.replace(keywordRegex, (match: string, idx: number): any => {\n const part = document.createTextNode(child.textContent!.slice(lastIdx, idx));\n const highlighted = document.createElement('mark');\n highlighted.textContent = match;\n frag.appendChild(part);\n frag.appendChild(highlighted);\n lastIdx = idx + match.length;\n });\n const end = document.createTextNode(child.textContent.slice(lastIdx));\n frag.appendChild(end);\n child.parentNode?.replaceChild(frag, child);\n }\n });\n }\n if (shouldHighlight && keyword.length) highlight(getElement?.());\n });\n}\n"]}
|
|
@@ -7,9 +7,11 @@ declare namespace _default {
|
|
|
7
7
|
let aggregateDisplayValue: string;
|
|
8
8
|
let columnFilterIcon: string;
|
|
9
9
|
let groupHeader: string;
|
|
10
|
+
let groupHeaderButton: string;
|
|
10
11
|
let groupHeaderCount: string;
|
|
11
12
|
let groupHeaderGroupBy: string;
|
|
12
13
|
let hierarchicalCell: string;
|
|
14
|
+
let contextMenu: string;
|
|
13
15
|
}
|
|
14
16
|
export default _default;
|
|
15
17
|
//# sourceMappingURL=TestIdConstants.d.ts.map
|
|
@@ -7,8 +7,10 @@ export default {
|
|
|
7
7
|
aggregateDisplayValue: 'aggregate-display-value',
|
|
8
8
|
columnFilterIcon: 'column-filter-icon',
|
|
9
9
|
groupHeader: 'group-header',
|
|
10
|
+
groupHeaderButton: 'group-header-button',
|
|
10
11
|
groupHeaderCount: 'group-header-count',
|
|
11
12
|
groupHeaderGroupBy: 'group-header-group-by',
|
|
12
|
-
hierarchicalCell: 'hierarchical-cell'
|
|
13
|
+
hierarchicalCell: 'hierarchical-cell',
|
|
14
|
+
contextMenu: 'repeat-context-menu'
|
|
13
15
|
};
|
|
14
16
|
//# sourceMappingURL=TestIdConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestIdConstants.js","sourceRoot":"","sources":["../../../Core/Components/TestIdConstants.js"],"names":[],"mappings":"AAAA,eAAe;IACb,YAAY,EAAE,sBAAsB;IACpC,WAAW,EAAE,qBAAqB;IAClC,UAAU,EAAE,oBAAoB;IAChC,iBAAiB,EAAE,4BAA4B;IAC/C,SAAS,EAAE,mBAAmB;IAC9B,qBAAqB,EAAE,yBAAyB;IAChD,gBAAgB,EAAE,oBAAoB;IACtC,WAAW,EAAE,cAAc;IAC3B,gBAAgB,EAAE,oBAAoB;IACtC,kBAAkB,EAAE,uBAAuB;IAC3C,gBAAgB,EAAE,mBAAmB;
|
|
1
|
+
{"version":3,"file":"TestIdConstants.js","sourceRoot":"","sources":["../../../Core/Components/TestIdConstants.js"],"names":[],"mappings":"AAAA,eAAe;IACb,YAAY,EAAE,sBAAsB;IACpC,WAAW,EAAE,qBAAqB;IAClC,UAAU,EAAE,oBAAoB;IAChC,iBAAiB,EAAE,4BAA4B;IAC/C,SAAS,EAAE,mBAAmB;IAC9B,qBAAqB,EAAE,yBAAyB;IAChD,gBAAgB,EAAE,oBAAoB;IACtC,WAAW,EAAE,cAAc;IAC3B,iBAAiB,EAAE,qBAAqB;IACxC,gBAAgB,EAAE,oBAAoB;IACtC,kBAAkB,EAAE,uBAAuB;IAC3C,gBAAgB,EAAE,mBAAmB;IACrC,WAAW,EAAE,qBAAqB;CACnC,CAAC","sourcesContent":["export default {\n filterButton: 'repeat-filter-button',\n groupButton: 'repeat-group-button',\n sortButton: 'repeat-sort-button',\n moreOptionsButton: 'repeat-more-options-button',\n noRecords: 'repeat-no-records',\n aggregateDisplayValue: 'aggregate-display-value',\n columnFilterIcon: 'column-filter-icon',\n groupHeader: 'group-header',\n groupHeaderButton: 'group-header-button',\n groupHeaderCount: 'group-header-count',\n groupHeaderGroupBy: 'group-header-group-by',\n hierarchicalCell: 'hierarchical-cell',\n contextMenu: 'repeat-context-menu'\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdvanceToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdvanceToolbar.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":"AAwBA;;4CA4GC;;;;;;;;;sBApIqB,YAAY"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ListToolbar } from '@pega/cosmos-react-core';
|
|
4
|
-
import { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core
|
|
4
|
+
import { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';
|
|
5
5
|
import { SELECTION_MODES } from '../../constants';
|
|
6
|
+
import showFeatureForTemplate from '../../templateFeatureSupport';
|
|
6
7
|
import ActionsMenu from './ActionsMenu';
|
|
7
8
|
import MapToolbar from './Map/MapToolbar';
|
|
8
9
|
import ToolbarActions from './ToolbarActions';
|
|
9
|
-
import TimelineToolbar from './Timeline/TimelineToolbar';
|
|
10
10
|
import useSearch from './hooks/useSearch';
|
|
11
11
|
import useFilter from './hooks/useFilter';
|
|
12
12
|
import usePersonalization from './hooks/usePersonalization';
|
|
@@ -19,22 +19,21 @@ import AnnounceRowsCount from './AnnounceRowsCount';
|
|
|
19
19
|
import ValidateMessage from './ValidateMessage';
|
|
20
20
|
import useFormControlProps from './hooks/useFormControlProps';
|
|
21
21
|
import useWrapAction from './hooks/useWrapAction';
|
|
22
|
-
import KeyboardInstructions from './KeyboardInstructions';
|
|
23
22
|
export default function AdvanceToolbar({ view }) {
|
|
24
|
-
const { selectedRecordsCount, meta: { basicMode, selectionMode, title,
|
|
23
|
+
const { selectedRecordsCount, meta: { basicMode, selectionMode, title, showTitle, toolbarActions, allowBulkActions, mapFieldIds } = {}, rows, state, getContext, isLoading, showCount, refreshNotification, type: { forceRefresh }, announceCount, template } = view;
|
|
25
24
|
const { getRequiredDef } = getContext();
|
|
26
25
|
const { validatemessage } = getRequiredDef() || {};
|
|
27
|
-
const { viewSelector } = usePersonalization({ view });
|
|
26
|
+
const { viewSelector, createEditViewContent } = usePersonalization({ view });
|
|
28
27
|
const search = useSearch({ view });
|
|
29
28
|
const count = showCount ? getCount({ view }) : undefined;
|
|
30
29
|
const filter = useFilter({ view });
|
|
31
30
|
const group = useGroup({ view });
|
|
32
31
|
const sort = useSort({ view });
|
|
33
|
-
const { actions, actionsButtonRef,
|
|
32
|
+
const { actions, actionsButtonRef, selectedActionContent } = useMore({ view });
|
|
34
33
|
const enableActionsMenu = selectionMode === SELECTION_MODES.multi && selectedRecordsCount !== 0;
|
|
35
34
|
const formControlProps = useFormControlProps(view);
|
|
36
35
|
const wrapAction = useWrapAction(view);
|
|
37
|
-
const additionalActions = (_jsxs(_Fragment, { children: [basicMode && (_jsx(ToolbarActions, { toolbarActions: toolbarActions?.filter(action => !action.id.startsWith('Add')) })), allowBulkActions && _jsx(ActionsMenu, { enableActionsMenu: enableActionsMenu, view: view })] }));
|
|
36
|
+
const additionalActions = (_jsxs(_Fragment, { children: [basicMode && (_jsx(ToolbarActions, { toolbarActions: toolbarActions?.filter(action => !action.id.startsWith('Add')) })), allowBulkActions && template !== REPEATING_STRUCTURE_TEMPLATES.TIMELINE && (_jsx(ActionsMenu, { enableActionsMenu: enableActionsMenu, view: view }))] }));
|
|
38
37
|
const createNewAction = toolbarActions?.find(action => action.id.startsWith('Add'));
|
|
39
38
|
const createNew = createNewAction && basicMode
|
|
40
39
|
? {
|
|
@@ -42,17 +41,7 @@ export default function AdvanceToolbar({ view }) {
|
|
|
42
41
|
onClick: createNewAction.onClick
|
|
43
42
|
}
|
|
44
43
|
: undefined;
|
|
45
|
-
|
|
46
|
-
switch (template) {
|
|
47
|
-
case REPEATING_STRUCTURE_TEMPLATES.TIMELINE:
|
|
48
|
-
Toolbar = (_jsxs(_Fragment, { children: [_jsx(TimelineToolbar, { name: title, formControlProps: formControlProps, viewSelector: viewSelector, search: search, count: count, additionalActions: additionalActions, filter: filter, createNew: createNew, view: view, actions: actions, actionsButtonRef: actionsButtonRef }), popover] }));
|
|
49
|
-
break;
|
|
50
|
-
case REPEATING_STRUCTURE_TEMPLATES.MAP:
|
|
51
|
-
Toolbar = (_jsx(MapToolbar, { locationFieldId: mapFieldIds?.location, name: title, formControlProps: formControlProps, rows: rows, count: count, createNew: createNew, additionalActions: additionalActions }));
|
|
52
|
-
break;
|
|
53
|
-
default:
|
|
54
|
-
Toolbar = (_jsxs(_Fragment, { children: [_jsx(ListToolbar, { name: title, formControlProps: formControlProps, viewSelector: viewSelector, search: search, count: count, additionalActions: additionalActions, filter: filter, group: group, sort: sort, actions: actions, actionsButtonRef: actionsButtonRef, createNew: createNew, wrap: template === REPEATING_STRUCTURE_TEMPLATES.TABLE && wrapAction, keyboardInstructions: template === REPEATING_STRUCTURE_TEMPLATES.TABLE ? (_jsx(KeyboardInstructions, { template: template })) : undefined }), popover] }));
|
|
55
|
-
}
|
|
44
|
+
const Toolbar = template === REPEATING_STRUCTURE_TEMPLATES.MAP ? (_jsx(MapToolbar, { locationFieldId: mapFieldIds?.location, name: title, showName: showTitle, formControlProps: formControlProps, rows: rows, count: count, createNew: createNew, additionalActions: additionalActions })) : (_jsxs(_Fragment, { children: [_jsx(ListToolbar, { name: title, showName: showTitle, formControlProps: formControlProps, viewSelector: viewSelector, search: search, count: count, additionalActions: additionalActions, filter: filter, group: showFeatureForTemplate(template, 'group') && group, sort: sort, actions: actions, actionsButtonRef: actionsButtonRef, createNew: createNew, wrap: wrapAction }), selectedActionContent, createEditViewContent] }));
|
|
56
45
|
return (_jsxs(AnnounceRowsCount, { state: state, count: count, isLoading: isLoading, announceCount: announceCount, children: [_jsx(ValidateMessage, { message: validatemessage, children: Toolbar }), refreshNotification && (_jsx(RefreshBanner, { refreshNotification: refreshNotification, forceRefresh: forceRefresh }))] }));
|
|
57
46
|
}
|
|
58
47
|
AdvanceToolbar.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdvanceToolbar.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AdvanceToolbar.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/AdvanceToolbar.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,sBAAsB,MAAM,8BAA8B,CAAC;AAElE,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,mBAAmB,MAAM,6BAA6B,CAAC;AAC9D,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE;IAC7C,MAAM,EACJ,oBAAoB,EACpB,IAAI,EAAE,EACJ,SAAS,EACT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EACV,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,UAAU,GAChB,EACD,qBAAqB,EACrB,qBAAqB,IACrB,CACJ,CAAC;IAEJ,OAAO,CACL,MAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,aAE5B,KAAC,eAAe,IAAC,OAAO,EAAE,eAAe,YACtC,OAAO,GAEQ,EACjB,mBAAmB,IAAI,CACtB,KAAC,aAAa,IAAC,mBAAmB,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,GAAI,CACxF,IACiB,CACrB,CAAC;AACJ,CAAC;AAED,cAAc,CAAC,SAAS,GAAG;IACzB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { ListToolbar } from '@pega/cosmos-react-core';\nimport { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';\n\nimport { SELECTION_MODES } from '../../constants';\nimport showFeatureForTemplate from '../../templateFeatureSupport';\n\nimport ActionsMenu from './ActionsMenu';\nimport MapToolbar from './Map/MapToolbar';\nimport ToolbarActions from './ToolbarActions';\nimport useSearch from './hooks/useSearch';\nimport useFilter from './hooks/useFilter';\nimport usePersonalization from './hooks/usePersonalization';\nimport useMore from './hooks/useMore';\nimport useGroup from './hooks/useGroup/useGroup';\nimport useSort from './hooks/useSort/useSort';\nimport getCount from './utils/getCount';\nimport RefreshBanner from './RefreshBanner';\nimport AnnounceRowsCount from './AnnounceRowsCount';\nimport ValidateMessage from './ValidateMessage';\nimport useFormControlProps from './hooks/useFormControlProps';\nimport useWrapAction from './hooks/useWrapAction';\n\nexport default function AdvanceToolbar({ view }) {\n const {\n selectedRecordsCount,\n meta: {\n basicMode,\n selectionMode,\n title,\n showTitle,\n toolbarActions,\n allowBulkActions,\n mapFieldIds\n } = {},\n rows,\n state,\n getContext,\n isLoading,\n showCount,\n refreshNotification,\n type: { forceRefresh },\n announceCount,\n template\n } = view;\n const { getRequiredDef } = getContext();\n const { validatemessage } = getRequiredDef() || {};\n const { viewSelector, createEditViewContent } = usePersonalization({ view });\n const search = useSearch({ view });\n const count = showCount ? getCount({ view }) : undefined;\n const filter = useFilter({ view });\n const group = useGroup({ view });\n const sort = useSort({ view });\n const { actions, actionsButtonRef, selectedActionContent } = useMore({ view });\n const enableActionsMenu = selectionMode === SELECTION_MODES.multi && selectedRecordsCount !== 0;\n const formControlProps = useFormControlProps(view);\n const wrapAction = useWrapAction(view);\n\n const additionalActions = (\n <>\n {basicMode && (\n <ToolbarActions\n toolbarActions={toolbarActions?.filter(action => !action.id.startsWith('Add'))}\n />\n )}\n {allowBulkActions && template !== REPEATING_STRUCTURE_TEMPLATES.TIMELINE && (\n <ActionsMenu enableActionsMenu={enableActionsMenu} view={view} />\n )}\n </>\n );\n\n const createNewAction = toolbarActions?.find(action => action.id.startsWith('Add'));\n const createNew =\n createNewAction && basicMode\n ? {\n label: createNewAction?.text,\n onClick: createNewAction.onClick\n }\n : undefined;\n\n const Toolbar =\n template === REPEATING_STRUCTURE_TEMPLATES.MAP ? (\n <MapToolbar\n locationFieldId={mapFieldIds?.location}\n name={title}\n showName={showTitle}\n formControlProps={formControlProps}\n rows={rows}\n count={count}\n createNew={createNew}\n additionalActions={additionalActions}\n />\n ) : (\n <>\n <ListToolbar\n name={title}\n showName={showTitle}\n formControlProps={formControlProps}\n viewSelector={viewSelector}\n search={search}\n count={count}\n additionalActions={additionalActions}\n filter={filter}\n group={showFeatureForTemplate(template, 'group') && group}\n sort={sort}\n actions={actions}\n actionsButtonRef={actionsButtonRef}\n createNew={createNew}\n wrap={wrapAction}\n />\n {selectedActionContent}\n {createEditViewContent}\n </>\n );\n\n return (\n <AnnounceRowsCount\n state={state}\n count={count}\n isLoading={isLoading}\n announceCount={announceCount}\n >\n <ValidateMessage message={validatemessage}>\n {Toolbar}\n {/* FIXME: This implementation of error status should be considered temporary until an official, and properly accessible, spec is determined. */}\n </ValidateMessage>\n {refreshNotification && (\n <RefreshBanner refreshNotification={refreshNotification} forceRefresh={forceRefresh} />\n )}\n </AnnounceRowsCount>\n );\n}\n\nAdvanceToolbar.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
|
|
@@ -11,7 +11,7 @@ export function getIconByFieldType(type: string): JSX.Element;
|
|
|
11
11
|
* @param {string} action - The action to perform, either 'Show/hide columns' or 'Freeze columns'.
|
|
12
12
|
* @returns Arrays of columns nested by category
|
|
13
13
|
*/
|
|
14
|
-
export function transformData(
|
|
14
|
+
export function transformData(fieldDefs: any, state: any, action: string): any[];
|
|
15
15
|
export function ColumnSelectorControl(props: any): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export namespace ColumnSelectorControl {
|
|
17
17
|
namespace propTypes {
|
|
@@ -26,16 +26,18 @@ export const pinning: "Freeze columns";
|
|
|
26
26
|
declare const _default: import("react").MemoExoticComponent<typeof ColumnSelector>;
|
|
27
27
|
export default _default;
|
|
28
28
|
import PropTypes from 'prop-types';
|
|
29
|
-
declare function ColumnSelector({ dispatch,
|
|
29
|
+
declare function ColumnSelector({ dispatch, fieldDefs, state, action, finishPopOver }: {
|
|
30
30
|
dispatch: any;
|
|
31
|
-
|
|
31
|
+
fieldDefs: any;
|
|
32
|
+
state: any;
|
|
32
33
|
action: any;
|
|
33
34
|
finishPopOver: any;
|
|
34
35
|
}): import("react/jsx-runtime").JSX.Element;
|
|
35
36
|
declare namespace ColumnSelector {
|
|
36
37
|
export namespace propTypes_1 {
|
|
37
38
|
export let dispatch: PropTypes.Validator<(...args: any[]) => any>;
|
|
38
|
-
export let
|
|
39
|
+
export let fieldDefs: PropTypes.Validator<(object | null | undefined)[]>;
|
|
40
|
+
export let state: PropTypes.Validator<(object | null | undefined)[]>;
|
|
39
41
|
let action_1: PropTypes.Validator<string>;
|
|
40
42
|
export { action_1 as action };
|
|
41
43
|
export let finishPopOver: PropTypes.Validator<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnSelector.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/ColumnSelector.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColumnSelector.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/ColumnSelector.jsx"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,yCAHW,MAAM,GACJ,GAAG,CAAC,OAAO,CAKvB;AAeD;;;;;GAKG;AACH,kEAHW,MAAM,SAsDhB;AA2BD,2FA0EC;;;;;;;;;AAzLD,6BAA8B,mBAAmB,CAAC;AAClD,sBAAuB,gBAAgB,CAAC;;;sBAlBlB,YAAY;AAmNlC;;;;;;4CAwBC"}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo, useCallback, useEffect, useState, useMemo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import { Icon, SearchInput, Menu, menuHelpers, useElement, Flex, Button } from '@pega/cosmos-react-core';
|
|
6
|
-
import {
|
|
5
|
+
import { Icon, SearchInput, Menu, menuHelpers, useElement, Flex, Button, useI18n } from '@pega/cosmos-react-core';
|
|
6
|
+
import { getFieldIcon } from '../../Utils';
|
|
7
7
|
import useTranslate from '../../Hooks/useTranslate';
|
|
8
8
|
export const colsVisibility = 'Show/hide columns';
|
|
9
9
|
export const pinning = 'Freeze columns';
|
|
@@ -35,29 +35,25 @@ function getModifiedColumns(initialSelectedColumns, currentSelectedColumns) {
|
|
|
35
35
|
* @param {string} action - The action to perform, either 'Show/hide columns' or 'Freeze columns'.
|
|
36
36
|
* @returns Arrays of columns nested by category
|
|
37
37
|
*/
|
|
38
|
-
export function transformData(
|
|
38
|
+
export function transformData(fieldDefs, state, action) {
|
|
39
39
|
const result = [];
|
|
40
|
-
if (!
|
|
40
|
+
if (!fieldDefs?.length)
|
|
41
41
|
return result;
|
|
42
42
|
const categoryObj = {};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
43
|
+
fieldDefs
|
|
44
|
+
?.filter(c => c.toggle)
|
|
45
|
+
.forEach(field => {
|
|
46
|
+
const { id, category = [], type, label } = field;
|
|
47
|
+
const visible = state.visibleColumns?.includes(id);
|
|
48
|
+
const frozen = state.freezeColumns?.includes(id);
|
|
48
49
|
const lastCategoryLabel = category.length ? category[category.length - 1].label : undefined;
|
|
49
|
-
let disabled;
|
|
50
|
-
if (action === colsVisibility) {
|
|
51
|
-
disabled = !allowColumnToggle && !hidden;
|
|
52
|
-
}
|
|
53
50
|
if (categoryObj[lastCategoryLabel])
|
|
54
51
|
categoryObj[lastCategoryLabel].items.push({
|
|
55
52
|
id,
|
|
56
53
|
primary: label,
|
|
57
54
|
label,
|
|
58
|
-
selected: action === colsVisibility ?
|
|
55
|
+
selected: action === colsVisibility ? visible : frozen,
|
|
59
56
|
type,
|
|
60
|
-
disabled,
|
|
61
57
|
visual: getIconByFieldType(type)
|
|
62
58
|
});
|
|
63
59
|
else {
|
|
@@ -68,10 +64,9 @@ export function transformData(columns, action) {
|
|
|
68
64
|
{
|
|
69
65
|
id,
|
|
70
66
|
primary: label,
|
|
71
|
-
selected: action === colsVisibility ?
|
|
67
|
+
selected: action === colsVisibility ? visible : frozen,
|
|
72
68
|
label,
|
|
73
69
|
type,
|
|
74
|
-
disabled,
|
|
75
70
|
visual: getIconByFieldType(type)
|
|
76
71
|
}
|
|
77
72
|
]
|
|
@@ -105,6 +100,7 @@ const StyledMenu = styled(Menu) `
|
|
|
105
100
|
`;
|
|
106
101
|
export function ColumnSelectorControl(props) {
|
|
107
102
|
const { data, onSubmit, onCancel, action } = props;
|
|
103
|
+
const t = useI18n();
|
|
108
104
|
const initialSelectedColumns = useMemo(() => new Set(menuHelpers
|
|
109
105
|
.flatten(data)
|
|
110
106
|
.filter(item => item.selected)
|
|
@@ -134,7 +130,7 @@ export function ColumnSelectorControl(props) {
|
|
|
134
130
|
}, [searchText, items]);
|
|
135
131
|
const modifiedColumns = useMemo(() => getModifiedColumns(initialSelectedColumns, selectedColumns), [initialSelectedColumns, selectedColumns, action]);
|
|
136
132
|
const isSubmitEnabled = !(action === colsVisibility && selectedColumns.size === 0) && modifiedColumns.length > 0;
|
|
137
|
-
return (_jsx(StyledMenu, { items: itemsToRender, mode: 'multi-select', onItemClick: (id, args) => {
|
|
133
|
+
return (_jsx(StyledMenu, { "aria-label": t('columns'), items: itemsToRender, mode: 'multi-select', onItemClick: (id, args) => {
|
|
138
134
|
setItems(cur => menuHelpers.toggleSelected(cur, id, args.mode));
|
|
139
135
|
}, role: 'listbox', focusControlEl: searchRef || undefined, header: _jsx(SearchInput, { value: searchText, onSearchChange: setSearchText, ref: setSearchRef }), footer: _jsx(Footer, { onCancel: onCancel, onSubmit: () => onSubmit(modifiedColumns), disabled: !isSubmitEnabled }) }));
|
|
140
136
|
}
|
|
@@ -144,8 +140,8 @@ ColumnSelectorControl.propTypes = {
|
|
|
144
140
|
onCancel: PropTypes.func.isRequired,
|
|
145
141
|
action: PropTypes.string.isRequired
|
|
146
142
|
};
|
|
147
|
-
function ColumnSelector({ dispatch,
|
|
148
|
-
const transformed = useMemo(() => transformData(
|
|
143
|
+
function ColumnSelector({ dispatch, fieldDefs, state, action, finishPopOver }) {
|
|
144
|
+
const transformed = useMemo(() => transformData(fieldDefs, state, action), [fieldDefs, state, action]);
|
|
149
145
|
const onSubmitHandler = useCallback(changedCols => {
|
|
150
146
|
if (changedCols.length > 0) {
|
|
151
147
|
dispatch(changedCols);
|
|
@@ -156,7 +152,8 @@ function ColumnSelector({ dispatch, columns, action, finishPopOver }) {
|
|
|
156
152
|
}
|
|
157
153
|
ColumnSelector.propTypes = {
|
|
158
154
|
dispatch: PropTypes.func.isRequired,
|
|
159
|
-
|
|
155
|
+
fieldDefs: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
156
|
+
state: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
160
157
|
action: PropTypes.string.isRequired,
|
|
161
158
|
finishPopOver: PropTypes.func.isRequired
|
|
162
159
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnSelector.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/ColumnSelector.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,MAAM,EACP,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAClD,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAI;IACrC,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,KAAC,IAAI,oBAAe,QAAQ,iBAAe,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAI,CAAC;AACjF,CAAC;AAED;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,sBAAsB,EAAE,sBAAsB;IACxE,MAAM,YAAY,GAAG,CAAC,GAAG,sBAAsB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,sBAAsB,CAAC,GA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E;IAClE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAErF,MAAM,eAAe,GAAG,WAAW,CACjC,WAAW,CAAC,EAAE;QACZ,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,QAAQ,CAAC,WAAW,CAAC,CAAC;QACxB,CAAC;QACD,aAAa,EAAE,CAAC;IAClB,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,IACpB,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,MAAM,GACd,CACH,CAAC;AACJ,CAAC;AAED,cAAc,CAAC,SAAS,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,UAAU;IACvD,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACnC,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACzC,CAAC;AAEF,eAAe,IAAI,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { memo, useCallback, useEffect, useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport {\n Icon,\n SearchInput,\n Menu,\n menuHelpers,\n useElement,\n Flex,\n Button\n} from '@pega/cosmos-react-core';\n\nimport { allowToggle, getFieldIcon } from '../../Utils';\nimport useTranslate from '../../Hooks/useTranslate';\n\nexport const colsVisibility = 'Show/hide columns';\nexport const pinning = 'Freeze columns';\n\n/**\n * Returns an Icon component based on the field type.\n *\n * @param {string} type - The type of the field for which the icon is required.\n * @returns {JSX.Element} - A React Icon component with the appropriate icon name.\n */\nexport function getIconByFieldType(type) {\n const iconName = getFieldIcon(type);\n return <Icon data-test-id={iconName} data-testid={iconName} name={iconName} />;\n}\n\n/**\n * Determines the list of changed column IDs.\n *\n * @param {Set<string>} initialSelectedColumns - The initial set of selected column IDs.\n * @param {Set<string>} currentSelectedColumns - The current set of selected column IDs.\n * @returns {string[]} - Array of modified column IDs.\n */\nfunction getModifiedColumns(initialSelectedColumns, currentSelectedColumns) {\n const addedColumns = [...currentSelectedColumns].filter(id => !initialSelectedColumns.has(id));\n const removedColumns = [...initialSelectedColumns].filter(id => !currentSelectedColumns.has(id));\n return [...addedColumns, ...removedColumns];\n}\n\n/**\n * Transforms the columns array into array of columns grouped by category\n * @param {Array} columns - The array of column objects to be transformed.\n * @param {string} action - The action to perform, either 'Show/hide columns' or 'Freeze columns'.\n * @returns Arrays of columns nested by category\n */\nexport function transformData(columns, action) {\n const result = [];\n if (!columns?.length) return result;\n\n const categoryObj = {};\n const allowColumnToggle = allowToggle(columns[0].parent.getVisibleColumns());\n\n columns\n ?.filter(c => c.field.toggle)\n .forEach(column => {\n const {\n field: { id, category = [], type },\n label,\n hidden,\n frozen\n } = column;\n const lastCategoryLabel = category.length ? category[category.length - 1].label : undefined;\n let disabled;\n if (action === colsVisibility) {\n disabled = !allowColumnToggle && !hidden;\n }\n if (categoryObj[lastCategoryLabel])\n categoryObj[lastCategoryLabel].items.push({\n id,\n primary: label,\n label,\n selected: action === colsVisibility ? !hidden : frozen,\n type,\n disabled,\n visual: getIconByFieldType(type)\n });\n else {\n categoryObj[lastCategoryLabel] = {\n id: `category:${lastCategoryLabel}`,\n primary: lastCategoryLabel,\n items: [\n {\n id,\n primary: label,\n selected: action === colsVisibility ? !hidden : frozen,\n label,\n type,\n disabled,\n visual: getIconByFieldType(type)\n }\n ]\n };\n }\n });\n // Items with no category attribute are set in the root of returned array\n if (categoryObj[undefined] && categoryObj[undefined].items) {\n result.push(...categoryObj[undefined].items);\n delete categoryObj[undefined];\n }\n const keys = Object.keys(categoryObj);\n // Items with category attribute are grouped inside the nested category object\n keys.forEach(key => {\n result.push(categoryObj[key]);\n });\n\n return result;\n}\n\nconst Footer = memo(({ onCancel, onSubmit, disabled }) => {\n const [translate] = useTranslate();\n return (\n <Flex container={{ justify: 'between' }}>\n <Button onClick={onCancel} data-testid='cancel'>\n {translate('Cancel')}\n </Button>\n <Button variant='primary' onClick={onSubmit} disabled={disabled} data-testid='submit'>\n {translate('Submit')}\n </Button>\n </Flex>\n );\n});\n\nFooter.displayName = 'Footer';\n\nFooter.propTypes = {\n onCancel: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n disabled: PropTypes.bool.isRequired\n};\n\nconst StyledMenu = styled(Menu)`\n width: 16rem;\n`;\nexport function ColumnSelectorControl(props) {\n const { data, onSubmit, onCancel, action } = props;\n\n const initialSelectedColumns = useMemo(\n () =>\n new Set(\n menuHelpers\n .flatten(data)\n .filter(item => item.selected)\n .map(item => item.id)\n ),\n [data]\n );\n\n const [searchText, setSearchText] = useState('');\n const [searchRef, setSearchRef] = useElement(null);\n const [items, setItems] = useState(data);\n const selectedColumns = useMemo(\n () => new Set(menuHelpers.getSelected(items).map(item => item.id)),\n [items]\n );\n\n useEffect(() => {\n if (searchRef) {\n searchRef.focus();\n }\n }, [searchRef]);\n\n const itemsToRender = useMemo(() => {\n return menuHelpers.mapTree(\n searchText\n ? menuHelpers\n .flatten(items)\n .filter(({ primary }) => primary.toLowerCase().includes(searchText.toLowerCase()))\n : items,\n item => {\n return {\n ...item,\n visual: item.visual,\n selected: item.items ? undefined : item.selected,\n disabled: item.selected && action === colsVisibility && selectedColumns.size <= 1\n };\n }\n );\n }, [searchText, items]);\n\n const modifiedColumns = useMemo(\n () => getModifiedColumns(initialSelectedColumns, selectedColumns),\n [initialSelectedColumns, selectedColumns, action]\n );\n\n const isSubmitEnabled =\n !(action === colsVisibility && selectedColumns.size === 0) && modifiedColumns.length > 0;\n return (\n <StyledMenu\n items={itemsToRender}\n mode='multi-select'\n onItemClick={(id, args) => {\n setItems(cur => menuHelpers.toggleSelected(cur, id, args.mode));\n }}\n role='listbox'\n focusControlEl={searchRef || undefined}\n header={<SearchInput value={searchText} onSearchChange={setSearchText} ref={setSearchRef} />}\n footer={\n <Footer\n onCancel={onCancel}\n onSubmit={() => onSubmit(modifiedColumns)}\n disabled={!isSubmitEnabled}\n />\n }\n />\n );\n}\n\nColumnSelectorControl.propTypes = {\n data: PropTypes.arrayOf(PropTypes.object).isRequired,\n onSubmit: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n action: PropTypes.string.isRequired\n};\n\nfunction ColumnSelector({ dispatch, columns, action, finishPopOver }) {\n const transformed = useMemo(() => transformData(columns, action), [columns, action]);\n\n const onSubmitHandler = useCallback(\n changedCols => {\n if (changedCols.length > 0) {\n dispatch(changedCols);\n }\n finishPopOver();\n },\n [dispatch]\n );\n\n return (\n <ColumnSelectorControl\n data={transformed}\n onSubmit={onSubmitHandler}\n onCancel={finishPopOver}\n action={action}\n />\n );\n}\n\nColumnSelector.propTypes = {\n dispatch: PropTypes.func.isRequired,\n columns: PropTypes.arrayOf(PropTypes.object).isRequired,\n action: PropTypes.string.isRequired,\n finishPopOver: PropTypes.func.isRequired\n};\n\nexport default memo(ColumnSelector);\n"]}
|
|
1
|
+
{"version":3,"file":"ColumnSelector.js","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/ColumnSelector.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,MAAM,EACN,OAAO,EACR,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO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MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACnC,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACzC,CAAC;AAEF,eAAe,IAAI,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { memo, useCallback, useEffect, useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport {\n Icon,\n SearchInput,\n Menu,\n menuHelpers,\n useElement,\n Flex,\n Button,\n useI18n\n} from '@pega/cosmos-react-core';\n\nimport { getFieldIcon } from '../../Utils';\nimport useTranslate from '../../Hooks/useTranslate';\n\nexport const colsVisibility = 'Show/hide columns';\nexport const pinning = 'Freeze columns';\n\n/**\n * Returns an Icon component based on the field type.\n *\n * @param {string} type - The type of the field for which the icon is required.\n * @returns {JSX.Element} - A React Icon component with the appropriate icon name.\n */\nexport function getIconByFieldType(type) {\n const iconName = getFieldIcon(type);\n return <Icon data-test-id={iconName} data-testid={iconName} name={iconName} />;\n}\n\n/**\n * Determines the list of changed column IDs.\n *\n * @param {Set<string>} initialSelectedColumns - The initial set of selected column IDs.\n * @param {Set<string>} currentSelectedColumns - The current set of selected column IDs.\n * @returns {string[]} - Array of modified column IDs.\n */\nfunction getModifiedColumns(initialSelectedColumns, currentSelectedColumns) {\n const addedColumns = [...currentSelectedColumns].filter(id => !initialSelectedColumns.has(id));\n const removedColumns = [...initialSelectedColumns].filter(id => !currentSelectedColumns.has(id));\n return [...addedColumns, ...removedColumns];\n}\n\n/**\n * Transforms the columns array into array of columns grouped by category\n * @param {Array} columns - The array of column objects to be transformed.\n * @param {string} action - The action to perform, either 'Show/hide columns' or 'Freeze columns'.\n * @returns Arrays of columns nested by category\n */\nexport function transformData(fieldDefs, state, action) {\n const result = [];\n if (!fieldDefs?.length) return result;\n\n const categoryObj = {};\n\n fieldDefs\n ?.filter(c => c.toggle)\n .forEach(field => {\n const { id, category = [], type, label } = field;\n const visible = state.visibleColumns?.includes(id);\n const frozen = state.freezeColumns?.includes(id);\n const lastCategoryLabel = category.length ? category[category.length - 1].label : undefined;\n if (categoryObj[lastCategoryLabel])\n categoryObj[lastCategoryLabel].items.push({\n id,\n primary: label,\n label,\n selected: action === colsVisibility ? visible : frozen,\n type,\n visual: getIconByFieldType(type)\n });\n else {\n categoryObj[lastCategoryLabel] = {\n id: `category:${lastCategoryLabel}`,\n primary: lastCategoryLabel,\n items: [\n {\n id,\n primary: label,\n selected: action === colsVisibility ? visible : frozen,\n label,\n type,\n visual: getIconByFieldType(type)\n }\n ]\n };\n }\n });\n // Items with no category attribute are set in the root of returned array\n if (categoryObj[undefined] && categoryObj[undefined].items) {\n result.push(...categoryObj[undefined].items);\n delete categoryObj[undefined];\n }\n const keys = Object.keys(categoryObj);\n // Items with category attribute are grouped inside the nested category object\n keys.forEach(key => {\n result.push(categoryObj[key]);\n });\n\n return result;\n}\n\nconst Footer = memo(({ onCancel, onSubmit, disabled }) => {\n const [translate] = useTranslate();\n return (\n <Flex container={{ justify: 'between' }}>\n <Button onClick={onCancel} data-testid='cancel'>\n {translate('Cancel')}\n </Button>\n <Button variant='primary' onClick={onSubmit} disabled={disabled} data-testid='submit'>\n {translate('Submit')}\n </Button>\n </Flex>\n );\n});\n\nFooter.displayName = 'Footer';\n\nFooter.propTypes = {\n onCancel: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n disabled: PropTypes.bool.isRequired\n};\n\nconst StyledMenu = styled(Menu)`\n width: 16rem;\n`;\nexport function ColumnSelectorControl(props) {\n const { data, onSubmit, onCancel, action } = props;\n const t = useI18n();\n\n const initialSelectedColumns = useMemo(\n () =>\n new Set(\n menuHelpers\n .flatten(data)\n .filter(item => item.selected)\n .map(item => item.id)\n ),\n [data]\n );\n\n const [searchText, setSearchText] = useState('');\n const [searchRef, setSearchRef] = useElement(null);\n const [items, setItems] = useState(data);\n const selectedColumns = useMemo(\n () => new Set(menuHelpers.getSelected(items).map(item => item.id)),\n [items]\n );\n\n useEffect(() => {\n if (searchRef) {\n searchRef.focus();\n }\n }, [searchRef]);\n\n const itemsToRender = useMemo(() => {\n return menuHelpers.mapTree(\n searchText\n ? menuHelpers\n .flatten(items)\n .filter(({ primary }) => primary.toLowerCase().includes(searchText.toLowerCase()))\n : items,\n item => {\n return {\n ...item,\n visual: item.visual,\n selected: item.items ? undefined : item.selected,\n disabled: item.selected && action === colsVisibility && selectedColumns.size <= 1\n };\n }\n );\n }, [searchText, items]);\n\n const modifiedColumns = useMemo(\n () => getModifiedColumns(initialSelectedColumns, selectedColumns),\n [initialSelectedColumns, selectedColumns, action]\n );\n\n const isSubmitEnabled =\n !(action === colsVisibility && selectedColumns.size === 0) && modifiedColumns.length > 0;\n return (\n <StyledMenu\n aria-label={t('columns')}\n items={itemsToRender}\n mode='multi-select'\n onItemClick={(id, args) => {\n setItems(cur => menuHelpers.toggleSelected(cur, id, args.mode));\n }}\n role='listbox'\n focusControlEl={searchRef || undefined}\n header={<SearchInput value={searchText} onSearchChange={setSearchText} ref={setSearchRef} />}\n footer={\n <Footer\n onCancel={onCancel}\n onSubmit={() => onSubmit(modifiedColumns)}\n disabled={!isSubmitEnabled}\n />\n }\n />\n );\n}\n\nColumnSelectorControl.propTypes = {\n data: PropTypes.arrayOf(PropTypes.object).isRequired,\n onSubmit: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n action: PropTypes.string.isRequired\n};\n\nfunction ColumnSelector({ dispatch, fieldDefs, state, action, finishPopOver }) {\n const transformed = useMemo(\n () => transformData(fieldDefs, state, action),\n [fieldDefs, state, action]\n );\n\n const onSubmitHandler = useCallback(\n changedCols => {\n if (changedCols.length > 0) {\n dispatch(changedCols);\n }\n finishPopOver();\n },\n [dispatch]\n );\n\n return (\n <ColumnSelectorControl\n data={transformed}\n onSubmit={onSubmitHandler}\n onCancel={finishPopOver}\n action={action}\n />\n );\n}\n\nColumnSelector.propTypes = {\n dispatch: PropTypes.func.isRequired,\n fieldDefs: PropTypes.arrayOf(PropTypes.object).isRequired,\n state: PropTypes.arrayOf(PropTypes.object).isRequired,\n action: PropTypes.string.isRequired,\n finishPopOver: PropTypes.func.isRequired\n};\n\nexport default memo(ColumnSelector);\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare const _default: import("react").MemoExoticComponent<typeof DebugInfo>;
|
|
2
2
|
export default _default;
|
|
3
|
-
declare function DebugInfo({ view,
|
|
3
|
+
declare function DebugInfo({ view, target, onClose }: {
|
|
4
4
|
view: any;
|
|
5
|
-
|
|
5
|
+
target: any;
|
|
6
6
|
onClose: any;
|
|
7
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare namespace DebugInfo {
|
|
@@ -10,9 +10,7 @@ declare namespace DebugInfo {
|
|
|
10
10
|
let view: PropTypes.Validator<{
|
|
11
11
|
[x: string]: any;
|
|
12
12
|
}>;
|
|
13
|
-
let
|
|
14
|
-
current: PropTypes.Requireable<Element>;
|
|
15
|
-
}>>>;
|
|
13
|
+
let target: PropTypes.Requireable<Element>;
|
|
16
14
|
let onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
15
|
}
|
|
18
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugInfo.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/DebugInfo.jsx"],"names":[],"mappings":";;AAgBA;;;;4CAwCC
|
|
1
|
+
{"version":3,"file":"DebugInfo.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Toolbar/DebugInfo.jsx"],"names":[],"mappings":";;AAgBA;;;;4CAwCC;;;;;;;;;;sBAvDqB,YAAY"}
|