@pega/lists-react 9.0.0-build.2.9 → 9.0.0-build.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +1 -1
- package/lib/Core/Components/HeaderMenu/actions.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.js +6 -6
- 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 +4 -4
- 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/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/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 +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js +4 -2
- 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/RepeatingStructuresBoot.types.d.ts +12 -2
- 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 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonalizationCreateEdit.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/PersonalizationCreateEdit.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,SAAS,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"PersonalizationCreateEdit.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/PersonalizationCreateEdit.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,O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CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACnC,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,QAAQ,GAClB,EAED,CAAC,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,CACjC,KAAC,QAAQ,IACP,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,SAAS,CAAC,6BAA6B,CAAC,EAC/C,QAAQ,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,GACvD,CACH,IACI,GACI,CACd,CAAC;AACJ,CAAC;AAED,yBAAyB,CAAC,SAAS,GAAG;IACpC,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IAClD,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC;CACtC,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG;IACvC,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,OAAO,EAAE,KAAK;CACf,CAAC","sourcesContent":["import { useState, useEffect, useMemo, useRef } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Flex, Input, Checkbox, FormDialog } from '@pega/cosmos-react-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nexport default function PersonalizationCreateEdit({ view, onFinish, editing = false, target }) {\n const {\n state: { personalization },\n meta: { nonPersonalizationViewName }\n } = view;\n const personalizationNames = useMemo(() => {\n const personalizations = personalization?.allPersonalizations || {};\n return Object.keys(personalizations).map(key => personalizations[key]?.name?.toLowerCase());\n }, [personalization]);\n const [translate] = useTranslate();\n const currentPersonalization = personalization?.allPersonalizations?.[personalization.active];\n const currentPersonalizationName = currentPersonalization?.name;\n const isAppDefaultView = personalization.active === 'APP_DEFAULT';\n const [viewName, setViewName] = useState(() => {\n if (editing) return currentPersonalizationName;\n return '';\n });\n const [error, setError] = useState();\n const viewNameRef = useRef(null);\n const defaultNameError = `${nonPersonalizationViewName} ${translate(\n 'name is reserved for non Personalized view and cannot be used.'\n )}`;\n const viewAlreadyPresentError = translate('This view is already present.');\n const viewNameEmptyError = translate('This view name cannot be empty.');\n const viewNameMaxLengthError = translate('View name must contain less than 65 characters.');\n const [markAsDefault, setMarkAsDefault] = useState(\n !!(editing && personalization.defaultPersonalization === personalization.active)\n );\n\n useEffect(() => {\n if (viewName && viewName.toLowerCase() === nonPersonalizationViewName.toLowerCase()) {\n setError(defaultNameError);\n return;\n }\n if (\n personalizationNames.includes(viewName?.trim().toLowerCase()) &&\n !(editing && viewName.trim() === currentPersonalizationName)\n ) {\n setError(viewAlreadyPresentError);\n return;\n }\n if (viewName?.length > 64) {\n setError(viewNameMaxLengthError);\n return;\n }\n setError(null);\n }, [\n defaultNameError,\n currentPersonalizationName,\n editing,\n nonPersonalizationViewName,\n personalizationNames,\n viewName,\n viewAlreadyPresentError,\n viewNameMaxLengthError\n ]);\n\n const onChange = e => {\n setViewName(e.target.value);\n };\n\n const onSubmit = () => {\n const trimmedName = viewName.trim();\n if (!trimmedName) {\n viewNameRef.current.focus();\n setError(viewNameEmptyError);\n return;\n }\n if (editing) {\n view.type.editPersonalization(\n personalization.active,\n trimmedName,\n // markAsDefault is meant to be null rather than false as APIS will remove the default if it sees false\n // but will be a no-op if undefined or null\n markAsDefault || null,\n isAppDefaultView\n );\n } else {\n // markAsDefault is meant to be null rather than false as APIS will remove the default if it sees false\n // but will be a no-op if undefined or null\n view.type.createPersonalization(trimmedName, markAsDefault || null);\n }\n\n onFinish();\n return undefined;\n };\n\n return (\n <FormDialog\n heading={translate(editing ? 'Edit customized view' : 'Add customized view')}\n onCancel={onFinish}\n onSubmit={onSubmit}\n target={target}\n >\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Input\n ref={viewNameRef}\n name='viewName'\n required\n label={translate('View name')}\n autoComplete='off'\n status={error ? 'error' : undefined}\n info={error}\n value={viewName}\n onChange={onChange}\n />\n\n {!(editing && isAppDefaultView) && (\n <Checkbox\n checked={markAsDefault}\n label={translate('Always show this view first')}\n onChange={() => setMarkAsDefault(curState => !curState)}\n />\n )}\n </Flex>\n </FormDialog>\n );\n}\n\nPersonalizationCreateEdit.propTypes = {\n onFinish: PropTypes.func,\n view: PropTypes.objectOf(PropTypes.any).isRequired,\n editing: PropTypes.bool,\n target: PropTypes.instanceOf(Element)\n};\n\nPersonalizationCreateEdit.defaultProps = {\n onFinish: () => {},\n editing: false\n};\n"]}
|
|
@@ -10,10 +10,10 @@ export default function PersonalizationDeleteConfirmation(props) {
|
|
|
10
10
|
dismiss();
|
|
11
11
|
}, [onSubmit, dismiss]);
|
|
12
12
|
const modalProps = {
|
|
13
|
-
heading: translate('Delete view'),
|
|
13
|
+
heading: translate('Delete customized view'),
|
|
14
14
|
actions: (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: dismiss, children: translate('No') }), _jsx(Button, { variant: 'primary', onClick: onSubmitAction, children: translate('Yes') })] }))
|
|
15
15
|
};
|
|
16
|
-
return (_jsx(Modal, { heading: modalProps.heading, actions: modalProps.actions, children: _jsx(Text, { children: `${translate('Are you sure you want to delete view')} ${currentActiveViewName}?` }) }));
|
|
16
|
+
return (_jsx(Modal, { heading: modalProps.heading, actions: modalProps.actions, children: _jsx(Text, { children: `${translate('Are you sure you want to delete customized view')} ${currentActiveViewName}?` }) }));
|
|
17
17
|
}
|
|
18
18
|
PersonalizationDeleteConfirmation.propTypes = {
|
|
19
19
|
currentActiveViewName: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonalizationDeleteConfirmation.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/E,MAAM,CAAC,OAAO,UAAU,iCAAiC,CAAC,KAAK;IAC7D,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC7D,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,EAAE,CAAC;IAEtC,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAExB,MAAM,UAAU,GAAG;QACjB,OAAO,EAAE,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"PersonalizationDeleteConfirmation.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/E,MAAM,CAAC,OAAO,UAAU,iCAAiC,CAAC,KAAK;IAC7D,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC7D,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,EAAE,CAAC;IAEtC,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAExB,MAAM,UAAU,GAAG;QACjB,OAAO,EAAE,SAAS,CAAC,wBAAwB,CAAC;QAC5C,OAAO,EAAE,CACP,8BACE,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,YAAG,SAAS,CAAC,IAAI,CAAC,GAAU,EACpD,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,cAAc,YAC9C,SAAS,CAAC,KAAK,CAAC,GACV,IACR,CACJ;KACF,CAAC;IAEF,OAAO,CACL,KAAC,KAAK,IAAC,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,YAC7D,KAAC,IAAI,cAAE,GAAG,SAAS,CAAC,iDAAiD,CAAC,IAAI,qBAAqB,GAAG,GAAQ,GACpG,CACT,CAAC;AACJ,CAAC;AAED,iCAAiC,CAAC,SAAS,GAAG;IAC5C,qBAAqB,EAAE,SAAS,CAAC,MAAM;IACvC,QAAQ,EAAE,SAAS,CAAC,IAAI;CACzB,CAAC;AAEF,iCAAiC,CAAC,YAAY,GAAG;IAC/C,qBAAqB,EAAE,EAAE;IACzB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;CACnB,CAAC","sourcesContent":["import { useCallback } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Text, Button, Modal, useModalContext } from '@pega/cosmos-react-core';\n\nexport default function PersonalizationDeleteConfirmation(props) {\n const { onSubmit, currentActiveViewName, translate } = props;\n const { dismiss } = useModalContext();\n\n const onSubmitAction = useCallback(() => {\n onSubmit();\n dismiss();\n }, [onSubmit, dismiss]);\n\n const modalProps = {\n heading: translate('Delete customized view'),\n actions: (\n <>\n <Button onClick={dismiss}>{translate('No')}</Button>\n <Button variant='primary' onClick={onSubmitAction}>\n {translate('Yes')}\n </Button>\n </>\n )\n };\n\n return (\n <Modal heading={modalProps.heading} actions={modalProps.actions}>\n <Text>{`${translate('Are you sure you want to delete customized view')} ${currentActiveViewName}?`}</Text>\n </Modal>\n );\n}\n\nPersonalizationDeleteConfirmation.propTypes = {\n currentActiveViewName: PropTypes.string,\n onSubmit: PropTypes.func\n};\n\nPersonalizationDeleteConfirmation.defaultProps = {\n currentActiveViewName: '',\n onSubmit: () => {}\n};\n"]}
|
|
@@ -18,8 +18,6 @@ export function usePersonalizationSelector({ personalization, nonPersonalization
|
|
|
18
18
|
}): {
|
|
19
19
|
actions: never[][];
|
|
20
20
|
activePersonalizationName: any;
|
|
21
|
-
defaultId: undefined;
|
|
22
|
-
appDefaultId: undefined;
|
|
23
21
|
};
|
|
24
22
|
import PropTypes from 'prop-types';
|
|
25
23
|
//# sourceMappingURL=PersonalizationSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonalizationSelector.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/PersonalizationSelector.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PersonalizationSelector.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/PersonalizationSelector.jsx"],"names":[],"mappings":"AA+GA;;4CAYC;;;;;;;;;AAtFM;;;;;;;;;EAwEN;sBA7GqB,YAAY"}
|
|
@@ -36,16 +36,12 @@ export const usePersonalizationSelector = ({ personalization, nonPersonalization
|
|
|
36
36
|
name: personalizations[key]?.name,
|
|
37
37
|
isPreset: personalizations[key]?.isPreset
|
|
38
38
|
}));
|
|
39
|
-
let defaultId;
|
|
40
|
-
let appDefaultId;
|
|
41
39
|
const primaryName = option => {
|
|
42
40
|
if (option.id === 'APP_DEFAULT') {
|
|
43
|
-
appDefaultId = option.id;
|
|
44
41
|
return `${option.name} (app default)`;
|
|
45
42
|
// eslint-disable-next-line no-else-return
|
|
46
43
|
}
|
|
47
44
|
else if (option.id === defaultPersonalization) {
|
|
48
|
-
defaultId = option.id;
|
|
49
45
|
return `${option.name} (default)`;
|
|
50
46
|
}
|
|
51
47
|
else {
|
|
@@ -62,13 +58,19 @@ export const usePersonalizationSelector = ({ personalization, nonPersonalization
|
|
|
62
58
|
personalisationClicked(option, personalization, actionPersonalizationSetActive, activePersonalizationName, create, translate);
|
|
63
59
|
}
|
|
64
60
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
acc[
|
|
61
|
+
// If this is the default personalization,
|
|
62
|
+
// place it at the beginning of the preset personalizations (acc[0])
|
|
63
|
+
if (option.id === defaultPersonalization) {
|
|
64
|
+
acc[0].unshift(obj);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
// Preset personalizations go into acc[0],
|
|
68
|
+
// custom personalizations go into acc[1]
|
|
69
|
+
(option.isPreset ? acc[0] : acc[1]).push(obj);
|
|
70
|
+
}
|
|
69
71
|
return acc;
|
|
70
72
|
}, [[], []]);
|
|
71
|
-
return { actions, activePersonalizationName
|
|
73
|
+
return { actions, activePersonalizationName };
|
|
72
74
|
};
|
|
73
75
|
export default function PersonalizationSelector({ view }) {
|
|
74
76
|
const { state: { personalization }, meta: { nonPersonalizationViewName } } = view;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonalizationSelector.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/PersonalizationSelector.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,6BAA6B,MAAM,iCAAiC,CAAC;AAE5E,MAAM,sBAAsB,GAAG,CAC7B,MAAM,EACN,eAAe,EACf,8BAA8B,EAC9B,yBAAyB,EACzB,MAAM,EACN,SAAS,EACT,EAAE;IACF,IAAI,MAAM,CAAC,EAAE,KAAK,eAAe,CAAC,MAAM,EAAE,CAAC;QACzC,OAAO;IACT,CAAC;IACD,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,CAAC;QAC5B,8BAA8B,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,MAAM,CACJ,6BAA6B,EAC7B;QACE,QAAQ,EAAE,GAAG,EAAE;YACb,8BAA8B,CAAC,MAAM,C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onalizationSelector.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/PersonalizationSelector.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,6BAA6B,MAAM,iCAAiC,CAAC;AAE5E,MAAM,sBAAsB,GAAG,CAC7B,MAAM,EACN,eAAe,EACf,8BAA8B,EAC9B,yBAAyB,EACzB,MAAM,EACN,SAAS,EACT,EAAE;IACF,IAAI,MAAM,CAAC,EAAE,KAAK,eAAe,CAAC,MAAM,EAAE,CAAC;QACzC,OAAO;IACT,CAAC;IACD,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,CAAC;QAC5B,8BAA8B,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,MAAM,CACJ,6BAA6B,EAC7B;QACE,QAAQ,EAAE,GAAG,EAAE;YACb,8BAA8B,CAAC,MAAM,CAAC,CAAC;QACzC,CAAC;QACD,yBAAyB;QACzB,SAAS;KACV,EACD,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,EACzC,eAAe,EACf,0BAA0B,EAC1B,8BAA8B,EAC9B,IAAI,EACJ,eAAe,EAChB,EAAE,EAAE;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,EAAE,MAAM,EAAE,GAAG,eAAe,EAAE,CAAC;IACrC,MAAM,gBAAgB,GAAG,eAAe,EAAE,mBAAmB,IAAI,EAAE,CAAC;IACpE,MAAM,qBAAqB,GAAG,eAAe,EAAE,MAAM,IAAI,eAAe,CAAC;IACzE,IAAI,yBAAyB,GAC3B,eAAe,EAAE,mBAAmB,EAAE,CAAC,qBAAqB,CAAC,EAAE,IAAI,C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C,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { Menu, useModalManager } from '@pega/cosmos-react-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport PersonalizationUnsavedWarning from './PersonalizationUnsavedWarning';\n\nconst personalisationClicked = (\n option,\n personalization,\n actionPersonalizationSetActive,\n activePersonalizationName,\n create,\n translate\n) => {\n if (option.id === personalization.active) {\n return;\n }\n if (!personalization?.dirty) {\n actionPersonalizationSetActive(option);\n return;\n }\n\n create(\n PersonalizationUnsavedWarning,\n {\n onSubmit: () => {\n actionPersonalizationSetActive(option);\n },\n activePersonalizationName,\n translate\n },\n { alert: true }\n );\n};\n\nexport const usePersonalizationSelector = ({\n personalization,\n nonPersonalizationViewName,\n actionPersonalizationSetActive,\n name,\n defaultPresetId\n}) => {\n const [translate] = useTranslate();\n const { create } = useModalManager();\n const personalizations = personalization?.allPersonalizations || {};\n const activePersonalization = personalization?.active || defaultPresetId;\n let activePersonalizationName =\n personalization?.allPersonalizations?.[activePersonalization]?.name;\n if (activePersonalization === defaultPresetId) {\n activePersonalizationName = name ?? nonPersonalizationViewName;\n }\n const dependentPresetId = personalizations?.APP_DEFAULT?.personalizationState?.presetId;\n\n const defaultPersonalization = personalization?.defaultPersonalization;\n\n const { [dependentPresetId]: _, ...filteredPersonalizations } = personalizations ?? {};\n\n const options = Object.keys(filteredPersonalizations).map(key => ({\n id: key,\n name: personalizations[key]?.name,\n isPreset: personalizations[key]?.isPreset\n }));\n\n const primaryName = option => {\n if (option.id === 'APP_DEFAULT') {\n return `${option.name} (app default)`;\n // eslint-disable-next-line no-else-return\n } else if (option.id === defaultPersonalization) {\n return `${option.name} (default)`;\n } else {\n return option.name;\n }\n };\n\n const actions = options.reduce(\n (acc, option) => {\n const obj = {\n id: option.id,\n primary: primaryName(option),\n text: option.name,\n selected: option.id === activePersonalization,\n onClick: () => {\n personalisationClicked(\n option,\n personalization,\n actionPersonalizationSetActive,\n activePersonalizationName,\n create,\n translate\n );\n }\n };\n // If this is the default personalization,\n // place it at the beginning of the preset personalizations (acc[0])\n if (option.id === defaultPersonalization) {\n acc[0].unshift(obj);\n } else {\n // Preset personalizations go into acc[0],\n // custom personalizations go into acc[1]\n (option.isPreset ? acc[0] : acc[1]).push(obj);\n }\n return acc;\n },\n [[], []]\n );\n\n return { actions, activePersonalizationName };\n};\n\nexport default function PersonalizationSelector({ view }) {\n const {\n state: { personalization },\n meta: { nonPersonalizationViewName }\n } = view;\n const { actions } = usePersonalizationSelector({\n personalization,\n nonPersonalizationViewName,\n actionPersonalizationSetActive: view.type.applyActivePersonalization\n });\n\n return <Menu className='action-menu' items={actions} mode='single-select' />;\n}\n\nPersonalizationSelector.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectAllCheckbox.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectAllCheckbox.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":"AAwBA;;;;mDA2CC;;;;;;;;;sBAlEqB,YAAY"}
|
|
@@ -7,6 +7,11 @@ import { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/R
|
|
|
7
7
|
import useTranslate from '../../Hooks/useTranslate';
|
|
8
8
|
const StyledDivWrapper = styled.div `
|
|
9
9
|
height: 100%;
|
|
10
|
+
|
|
11
|
+
/* adding padding to the row select checkbox to give space of outline focus ring */
|
|
12
|
+
padding-block: 0.125rem;
|
|
13
|
+
padding-inline: 0.25rem;
|
|
14
|
+
|
|
10
15
|
> div {
|
|
11
16
|
height: 100%;
|
|
12
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectAllCheckbox.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"SelectAllCheckbox.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;IAU/B,sBAAsB;;;CAGzB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACpB;IACC,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACxF,IAAI,CAAC,QAAQ,EAAE,CAAC,qBAAqB,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,EAAE,CAAC;IAC7C,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,IAAI,sBAAsB,CAAC;IAEzE,MAAM,eAAe,GAAG,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC;IAE1F,MAAM,SAAS,GACb,CAAC,oBAAoB,GAAG,CAAC,IAAI,oBAAoB,KAAK,YAAY,CAAC,IAAI,eAAe,CAAC;IACzF,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE;QAC3B,IAAI,gBAAgB,IAAI,eAAe,CAAC,OAAO,EAAE,CAAC;YAChD,OAAO;QACT,CAAC;QACD,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QACjC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;QAE/B,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC/B,eAAe,CAAC,OAAO,GAAG,KAAK,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,IAAC,IAAI,kBACpB,KAAC,QAAQ,IACP,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,eAAe,gBAClB,SAAS,CAAC,YAAY,CAAC,EACnC,QAAQ,EAAE,gBAAgB,GAC1B,GACe,CACpB,CAAC;AACJ,CAAC;AAED,iBAAiB,CAAC,SAAS,GAAG;IAC5B,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IAC9C,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,mBAAmB,EAAE,SAAS,CAAC,IAAI;CACpC,CAAC","sourcesContent":["import styled from 'styled-components';\nimport PropTypes from 'prop-types';\nimport { useRef } from 'react';\n\nimport { Checkbox } from '@pega/cosmos-react-core';\nimport { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst StyledDivWrapper = styled.div`\n height: 100%;\n\n /* adding padding to the row select checkbox to give space of outline focus ring */\n padding-block: 0.125rem;\n padding-inline: 0.25rem;\n\n > div {\n height: 100%;\n }\n ${StyledPseudoRadioCheck} {\n margin-inline-end: 0;\n }\n`;\n\nexport default function SelectAllCheckbox({\n selectAllRows,\n getExecutionContext,\n getDisableSelection\n}) {\n const [translate] = useTranslate();\n const isProcessingRef = useRef(false);\n\n const { selectedRecordsCount, resultsCount, getState, getMeta } = getExecutionContext();\n if (!getState().showSelectAllCheckbox) {\n return null;\n }\n const { disableSelectionOnLoad } = getMeta();\n const disableSelection = getDisableSelection() ?? disableSelectionOnLoad;\n\n const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;\n\n const isChecked =\n (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;\n const handleChange = event => {\n if (disableSelection || isProcessingRef.current) {\n return;\n }\n const { checked } = event.target;\n isProcessingRef.current = true;\n\n selectAllRows(checked).then(() => {\n isProcessingRef.current = false;\n });\n };\n\n return (\n <StyledDivWrapper item>\n <Checkbox\n className='select-all-checkbox'\n checked={isChecked}\n onChange={handleChange}\n indeterminate={isIndeterminate}\n aria-label={translate('Select all')}\n disabled={disableSelection}\n />\n </StyledDivWrapper>\n );\n}\n\nSelectAllCheckbox.propTypes = {\n getExecutionContext: PropTypes.func.isRequired,\n selectAllRows: PropTypes.func.isRequired,\n getDisableSelection: PropTypes.func\n};\n"]}
|
|
@@ -23,7 +23,6 @@ export namespace extRenderer {
|
|
|
23
23
|
}
|
|
24
24
|
declare const _default: {
|
|
25
25
|
Operator: typeof import("./CellRenderers/Operator").default;
|
|
26
|
-
cellEditRenderer: typeof import("./CellRenderers/EditComponents").default;
|
|
27
26
|
RowActionMenu: typeof import("./CellRenderers/RowActionMenu").default;
|
|
28
27
|
RowDragDropHandle: typeof import("./CellRenderers/RowDragDropHandle").default;
|
|
29
28
|
RowSelectHandle: import("react").MemoExoticComponent<{
|
|
@@ -63,7 +62,11 @@ declare const _default: {
|
|
|
63
62
|
sortRenderer: typeof sort;
|
|
64
63
|
filterRenderer: typeof Filter;
|
|
65
64
|
headerCellRenderer: typeof HeaderCell;
|
|
66
|
-
emptyContainerRenderer: (
|
|
65
|
+
emptyContainerRenderer: ({ message, shouldAnnounce, domContainer }: {
|
|
66
|
+
message: any;
|
|
67
|
+
shouldAnnounce: any;
|
|
68
|
+
domContainer: any;
|
|
69
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
67
70
|
loadingIndicator: typeof LoadingIndicator;
|
|
68
71
|
rowHeightRenderer: typeof RowHeightRenderer;
|
|
69
72
|
personalizationSelectorRenderer: typeof personalizationSelectorRenderer;
|
|
@@ -76,7 +79,6 @@ declare const _default: {
|
|
|
76
79
|
value: PropTypes.Requireable<number>;
|
|
77
80
|
};
|
|
78
81
|
}>;
|
|
79
|
-
CardItemRenderer: import("react").NamedExoticComponent<object>;
|
|
80
82
|
selectAllCheckboxRenderer: typeof SelectAllCheckbox;
|
|
81
83
|
};
|
|
82
84
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/index.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/index.jsx"],"names":[],"mappings":"AA4BA,uGAKC;;;;;;;;;;AAUD,mGASC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBApDqB,YAAY;iBAEjB,QAAQ;mBACN,UAAU;uBAEN,cAAc;6BAER,oBAAoB;8BACnB,aAAa;4CAEC,2BAA2B;8CACzB,6BAA6B;8BAC7C,qBAAqB"}
|
|
@@ -4,7 +4,6 @@ import sort from './Sort';
|
|
|
4
4
|
import Filter from './Filter';
|
|
5
5
|
import CellRenderers from './CellRenderers';
|
|
6
6
|
import HeaderCell from './HeaderCell';
|
|
7
|
-
import CardItem from './CardItem';
|
|
8
7
|
import EmptyContainer from './EmptyContainer';
|
|
9
8
|
import LoadingIndicator from './LoadingIndicator';
|
|
10
9
|
import RowHeightRenderer from './RowHeight';
|
|
@@ -22,7 +21,6 @@ export default {
|
|
|
22
21
|
personalizationSelectorRenderer,
|
|
23
22
|
personalizationCreateEditRenderer,
|
|
24
23
|
badgeRenderer: BadgeRenderer,
|
|
25
|
-
CardItemRenderer: CardItem,
|
|
26
24
|
selectAllCheckboxRenderer: SelectAllCheckbox,
|
|
27
25
|
...CellRenderers
|
|
28
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/index.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/index.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,iBAAiB,MAAM,aAAa,CAAC;AAC5C,OAAO,aAAa,MAAM,SAAS,CAAC;AACpC,OAAO,+BAA+B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filter';\nimport CellRenderers from './CellRenderers';\nimport HeaderCell from './HeaderCell';\nimport EmptyContainer from './EmptyContainer';\nimport LoadingIndicator from './LoadingIndicator';\nimport RowHeightRenderer from './RowHeight';\nimport BadgeRenderer from './Badge';\nimport personalizationSelectorRenderer from './PersonalizationSelector';\nimport personalizationCreateEditRenderer from './PersonalizationCreateEdit';\nimport SelectAllCheckbox from './SelectAllCheckbox';\n\nexport default {\n sortRenderer: sort,\n filterRenderer: Filter,\n headerCellRenderer: HeaderCell,\n emptyContainerRenderer: EmptyContainer,\n loadingIndicator: LoadingIndicator,\n rowHeightRenderer: RowHeightRenderer,\n personalizationSelectorRenderer,\n personalizationCreateEditRenderer,\n badgeRenderer: BadgeRenderer,\n selectAllCheckboxRenderer: SelectAllCheckbox,\n ...CellRenderers\n};\n\nexport function defaultRenderer(Comp, props) {\n if (Comp) {\n return <Comp {...props} />;\n }\n return null;\n}\n\ndefaultRenderer.propTypes = {\n itemKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n};\n\ndefaultRenderer.defaultProps = {\n itemKey: ''\n};\n\nexport function extRenderer(Comp, props) {\n if (Comp) {\n return (\n <span>\n <Comp {...props} />\n </span>\n );\n }\n return null;\n}\n\nextRenderer.propTypes = {\n itemKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n};\n\nextRenderer.defaultProps = {\n itemKey: ''\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonFilter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Filters/CommonFilter.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommonFilter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Filters/CommonFilter.jsx"],"names":[],"mappings":"AAgBA;;;;;4CA2GC;;;;;;;;;;;sBA3HqB,YAAY"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useState, useCallback, useEffect } from 'react';
|
|
4
4
|
import { Select, Option, Flex, FormDialog } from '@pega/cosmos-react-core';
|
|
5
|
-
import { addFilter, getFilterInitializers, comparatorMap } from 'pega-repeating-structures-core';
|
|
5
|
+
import { addFilter, getFilterInitializers, comparatorMap, FieldType } from 'pega-repeating-structures-core';
|
|
6
6
|
import useTranslate from '../../Hooks/useTranslate';
|
|
7
7
|
import InputWrapper from './InputWrapper';
|
|
8
8
|
import useFilterSubmit from './Hooks/useFilterSubmit';
|
|
@@ -47,7 +47,7 @@ export default function CommonFilter({ column, onFilter, finishPopOver, popoverB
|
|
|
47
47
|
};
|
|
48
48
|
// eslint-disable-next-line sonarjs/no-small-switch
|
|
49
49
|
switch (column.field.type) {
|
|
50
|
-
case
|
|
50
|
+
case FieldType.NUMBER: {
|
|
51
51
|
content = (_jsx(InputWrapper, { id: `${column.field.name}`, type: 'number', onChange: onNumberChange, onKeyDown: handleSubmitHandler, style: { width: '100%' }, label: translate('Filter value'), value: filterInput }));
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonFilter.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/CommonFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,
|
|
1
|
+
{"version":3,"file":"CommonFilter.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/CommonFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,MAA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AAC,IADV,GAAG,CAAC,GAAG,CAEX,CACV,CAAC,GACK,GACJ,EACP,KAAC,IAAI,IAAC,IAAI,kBAAE,OAAO,GAAQ,IACtB,GACI,CACd,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAC;AACJ,CAAC;AAED,YAAY,CAAC,SAAS,GAAG;IACvB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useState, useCallback, useEffect } from 'react';\n\nimport { Select, Option, Flex, FormDialog } from '@pega/cosmos-react-core';\nimport {\n addFilter,\n getFilterInitializers,\n comparatorMap,\n FieldType\n} from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport InputWrapper from './InputWrapper';\nimport useFilterSubmit from './Hooks/useFilterSubmit';\n\nexport default function CommonFilter({ column, onFilter, finishPopOver, popoverButtonRef }) {\n const params = column.field.filterParams || [];\n const [fInput, fValue, filter, filterExpression] = getFilterInitializers(column);\n const [filterInput, setFilterInput] = useState(fInput);\n const [comparator, setComparator] = useState(fValue);\n const [translate] = useTranslate();\n let content = null;\n useEffect(() => {\n /* Safe check for params */\n if (params?.[0]?.key && !comparator) setComparator(params[0].key);\n }, []);\n\n const submitFilter = useCallback(() => {\n /* Sending filter expression */\n const newFilterExpression = addFilter({\n filterExpression: filter ? null : filterExpression,\n column,\n comparator: comparatorMap[comparator],\n input: filterInput\n });\n onFilter({\n filterExp: newFilterExpression\n });\n }, [filter, filterExpression, column, comparator, filterInput, onFilter]);\n\n const onFilterChange = useCallback(({ value: comparatorType }) => {\n setComparator(comparatorType);\n }, []);\n\n const applyFilter = useFilterSubmit({ finishPopOver, submitFilter });\n\n const onTextChange = useCallback(value => {\n setFilterInput(value);\n }, []);\n\n const onNumberChange = useCallback(value => {\n setFilterInput(parseFloat(value));\n }, []);\n\n const handleSubmitHandler = e => {\n if (e.key === 'Enter') {\n applyFilter();\n }\n };\n\n // eslint-disable-next-line sonarjs/no-small-switch\n switch (column.field.type) {\n case FieldType.NUMBER: {\n content = (\n <InputWrapper\n id={`${column.field.name}`}\n type='number'\n onChange={onNumberChange}\n onKeyDown={handleSubmitHandler}\n style={{ width: '100%' }}\n label={translate('Filter value')}\n value={filterInput}\n />\n );\n break;\n }\n default: {\n content = (\n <InputWrapper\n id={`${column.field.name}`}\n type='text'\n onChange={onTextChange}\n onKeyDown={handleSubmitHandler}\n style={{ width: '100%' }}\n label={translate('Filter value')}\n value={filterInput}\n />\n );\n break;\n }\n }\n\n return (\n <>\n {popoverButtonRef.current ? (\n <FormDialog\n heading={translate('Filter column')}\n onSubmit={applyFilter}\n onCancel={finishPopOver}\n target={popoverButtonRef.current}\n >\n <Flex container={{ direction: 'column', wrap: 'no-wrap', itemGap: 1 }}>\n <Flex item>\n <Select\n defaultValue={comparator}\n onChange={e => onFilterChange({ value: e.target.value })}\n id={`select-${column.field.name}`}\n label={translate('Filter comparison')}\n >\n {params.map(opt => (\n <Option key={opt.key} value={opt.key}>\n {translate(opt.value)}\n </Option>\n ))}\n </Select>\n </Flex>\n <Flex item>{content}</Flex>\n </Flex>\n </FormDialog>\n ) : null}\n </>\n );\n}\n\nCommonFilter.propTypes = {\n column: PropTypes.objectOf(PropTypes.any).isRequired,\n finishPopOver: PropTypes.func.isRequired,\n onFilter: PropTypes.func.isRequired\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { getFilterConditions } from 'pega-repeating-structures-core';
|
|
3
|
+
import { getFilterConditions, FieldType } from 'pega-repeating-structures-core';
|
|
4
4
|
import AdvanceFilter from './AdvanceFilter';
|
|
5
5
|
import SelectFilter from './SelectFilter';
|
|
6
6
|
import SimpleFilter from './SimpleFilter';
|
|
@@ -17,12 +17,12 @@ export default function FilterType({ column, onFilter, finishPopOver, popoverBut
|
|
|
17
17
|
if (column.field.filterPickList) {
|
|
18
18
|
return (_jsx(SelectFilter, { column: column, onFilter: onFilter, finishPopOver: finishPopOver, popoverButtonRef: popoverButtonRef }));
|
|
19
19
|
}
|
|
20
|
-
if (column.field.type ===
|
|
21
|
-
column.field.type ===
|
|
22
|
-
column.field.type ===
|
|
20
|
+
if (column.field.type === FieldType.DATE ||
|
|
21
|
+
column.field.type === FieldType.DATE_TIME ||
|
|
22
|
+
column.field.type === FieldType.TIME) {
|
|
23
23
|
return (_jsx(SimpleFilter, { column: column, onFilter: onFilter, finishPopOver: finishPopOver, popoverButtonRef: popoverButtonRef }));
|
|
24
24
|
}
|
|
25
|
-
if (column.field.type ===
|
|
25
|
+
if (column.field.type === FieldType.BOOLEAN) {
|
|
26
26
|
return (_jsx(BooleanFilter, { column: column, onFilter: onFilter, finishPopOver: finishPopOver, popoverButtonRef: popoverButtonRef }));
|
|
27
27
|
}
|
|
28
28
|
return (_jsx(CommonFilter, { column: column, onFilter: onFilter, finishPopOver: finishPopOver, popoverButtonRef: popoverButtonRef }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterType.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/FilterType.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterType.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/FilterType.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAEhF,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,YAAY,MAAM,gBAAgB,C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AAK,SAAS,CAAC,OAAO,EAAE,CAAC;QAC5C,OAAO,CACL,KAAC,aAAa,IACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,YAAY,IACX,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC;AAED,UAAU,CAAC,SAAS,GAAG;IACrB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IACzC,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { getFilterConditions, FieldType } from 'pega-repeating-structures-core';\n\nimport AdvanceFilter from './AdvanceFilter';\nimport SelectFilter from './SelectFilter';\nimport SimpleFilter from './SimpleFilter';\nimport CommonFilter from './CommonFilter';\nimport BooleanFilter from './BooleanFilter';\n\nexport default function FilterType({ column, onFilter, finishPopOver, popoverButtonRef }) {\n if (!column) return null;\n\n const filterExpression = column?.getFilterProperties()?.filterExpression;\n const filters = getFilterConditions({ filterExpression });\n\n if (filters.length >= 2) {\n return (\n <AdvanceFilter\n view={column.parent}\n setShowFilter={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n }\n\n if (column.field.filterPickList) {\n return (\n <SelectFilter\n column={column}\n onFilter={onFilter}\n finishPopOver={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n }\n if (\n column.field.type === FieldType.DATE ||\n column.field.type === FieldType.DATE_TIME ||\n column.field.type === FieldType.TIME\n ) {\n return (\n <SimpleFilter\n column={column}\n onFilter={onFilter}\n finishPopOver={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n }\n if (column.field.type === FieldType.BOOLEAN) {\n return (\n <BooleanFilter\n column={column}\n onFilter={onFilter}\n finishPopOver={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n }\n\n return (\n <CommonFilter\n column={column}\n onFilter={onFilter}\n finishPopOver={finishPopOver}\n popoverButtonRef={popoverButtonRef}\n />\n );\n}\n\nFilterType.propTypes = {\n column: PropTypes.objectOf(PropTypes.any),\n finishPopOver: PropTypes.func.isRequired,\n onFilter: PropTypes.func.isRequired\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectFilter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Filters/SelectFilter.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectFilter.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Filters/SelectFilter.jsx"],"names":[],"mappings":"AA6BA;;;;;4CA8JC;;;;;;;;;;;sBA3LqB,YAAY"}
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { Checkbox, CheckboxGroup, Flex, Select, Option, FormDialog } from '@pega/cosmos-react-core';
|
|
6
|
-
import { addFilter, getFilterInitializers, comparatorMap } from 'pega-repeating-structures-core';
|
|
6
|
+
import { addFilter, getFilterInitializers, comparatorMap, FieldType } from 'pega-repeating-structures-core';
|
|
7
7
|
import LoadingIndicator from '../LoadingIndicator';
|
|
8
8
|
import RenderingEngine from '../RenderingEngine/RenderCell';
|
|
9
9
|
import useTranslate from '../../Hooks/useTranslate';
|
|
@@ -80,7 +80,7 @@ export default function SelectFilter({ column, finishPopOver, onFilter, popoverB
|
|
|
80
80
|
const onSelectOrDeselect = useCallback(event => {
|
|
81
81
|
/* Disabling operators like isAnyOf isNoneOf */
|
|
82
82
|
const { value, checked } = event.target;
|
|
83
|
-
const inputValue = column.field.type ===
|
|
83
|
+
const inputValue = column.field.type === FieldType.NUMBER ? parseFloat(value) : value;
|
|
84
84
|
/* collecting set of unique values to sent with different operators */
|
|
85
85
|
if (checked)
|
|
86
86
|
setSelectedValues(selectedValues
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectFilter.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/SelectFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEjG,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKvC,CAAC;AAEF,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIpC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE;IACxF,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,AAAD,EAAG,gBAAgB,CAAC,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC3E,MAAM,CAAC,YAAY,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CA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Ac,EAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,IAAI,EACX,KAAK,EACH,KAAC,eAAe,OAAK,MAAM,CAAC,uBAAuB,EAAE,EAAE,OAAO,EAAE,OAAO,GAAI,IAPxE,IAAI,CAST,CACH,CAAC;4BACJ,CAAC,CAAC,GACY,EAChB,KAAC,qBAAqB,cACpB,KAAC,gBAAgB,IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,mBAAmB,GAAI,GAC/C,IACL,CACtB,IACU,CACd,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAC;AACJ,CAAC;AAED,YAAY,CAAC,SAAS,GAAG;IACvB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useState, useEffect, useCallback } from 'react';\nimport styled from 'styled-components';\n\nimport { Checkbox, CheckboxGroup, Flex, Select, Option, FormDialog } from '@pega/cosmos-react-core';\nimport { addFilter, getFilterInitializers, comparatorMap } from 'pega-repeating-structures-core';\n\nimport LoadingIndicator from '../LoadingIndicator';\nimport RenderingEngine from '../RenderingEngine/RenderCell';\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst LoadingIndicatorStyle = styled.div`\n position: absolute;\n margin: auto;\n left: 0;\n right: 0;\n`;\n\nconst CheckboxGroupStyle = styled.div`\n max-height: 11.719rem;\n overflow: auto;\n margin-top: 0.5rem;\n`;\n\nexport default function SelectFilter({ column, finishPopOver, onFilter, popoverButtonRef }) {\n const [fInput, fValue, , filterExpression] = getFilterInitializers(column);\n const [uniqueValues, setUniqueColumnValues] = useState([]);\n const [uniqueValuesFetched, setUniqueValuesFetched] = useState(false);\n // Prepopulate the select filter with values only when global filter condition matches with condition in select filter.\n const prePopulateSelectFilter = column.field.filterParams.some(\n filterParam => filterParam.key === fValue\n );\n const [selectedValues, setSelectedValues] = useState(prePopulateSelectFilter ? fInput : []);\n const [comparator, setComparator] = useState(fValue);\n\n const syncUniqueValues = useCallback(() => {\n if (!uniqueValuesFetched)\n column.getUniqueValues().then(filteredData => {\n setUniqueValuesFetched(true);\n setUniqueColumnValues(filteredData);\n });\n }, [column, uniqueValuesFetched]);\n const [translate] = useTranslate();\n useEffect(() => {\n const resultSet = new Set();\n column.data.forEach(d => {\n if (d) resultSet.add(d);\n });\n setUniqueColumnValues([...resultSet]);\n }, [column]);\n\n // set the comparator as 1st option by default only if global filter criteria does not match with select filter (prepopulateSelectFilter)\n useEffect(() => {\n if (!prePopulateSelectFilter && column.field.filterParams?.[0]?.key)\n setComparator(column.field.filterParams[0].key);\n // Should be call only on initial load thats why empty dependencies\n }, []);\n\n useEffect(() => {\n if (!column.field?.filterParams?.find(item => item.key !== 'select')) return;\n syncUniqueValues();\n }, [column, syncUniqueValues]);\n\n const onFilterChange = useCallback(({ value: comparatorType }) => {\n setComparator(comparatorType);\n }, []);\n\n const submitFilter = useCallback(() => {\n const formattedComp = comparatorMap[comparator];\n let localFilterExpression = null;\n const input =\n formattedComp === comparatorMap.isNull || formattedComp === comparatorMap.isNotNull\n ? null\n : selectedValues;\n localFilterExpression = addFilter({\n // Ignore the initial filter expression if prePopulateSelectFilter is true as user has chosen to override it.\n filterExpression: prePopulateSelectFilter ? null : filterExpression,\n comparator: formattedComp,\n column,\n input\n });\n onFilter({\n filterExp: localFilterExpression\n });\n finishPopOver();\n }, [comparator, selectedValues, filterExpression, column, onFilter, prePopulateSelectFilter]);\n\n const isSelected = useCallback(\n value => {\n return new Set(selectedValues).has(value);\n },\n [selectedValues]\n );\n\n const onSelectOrDeselect = useCallback(\n event => {\n /* Disabling operators like isAnyOf isNoneOf */\n const { value, checked } = event.target;\n const inputValue = column.field.type === 'number' ? parseFloat(value) : value;\n /* collecting set of unique values to sent with different operators */\n if (checked)\n setSelectedValues(\n selectedValues\n ? [...new Set([inputValue, ...selectedValues])]\n : [...new Set([inputValue])]\n );\n else {\n const index = selectedValues.findIndex(val => val === inputValue);\n const values = selectedValues.slice(0, index).concat(selectedValues.slice(index + 1));\n setSelectedValues(values);\n }\n },\n [column, selectedValues]\n );\n\n // show unique values checkboxes for selection only if comparator is other than 'IS_NULL' and 'IS_NOT_NULL'\n const showUniqueValues = ![comparatorMap.isNull, comparatorMap.isNotNull].includes(\n comparatorMap[comparator]\n );\n\n return (\n <>\n {popoverButtonRef.current ? (\n <FormDialog\n heading={translate('Filter column')}\n onSubmit={submitFilter}\n onCancel={finishPopOver}\n target={popoverButtonRef.current}\n >\n <Flex>\n <Select\n defaultValue={comparator}\n onChange={e => onFilterChange({ value: e.target.value })}\n >\n {(column.field.filterParams || []).map(opt => (\n <Option key={opt.key} value={opt.key}>\n {translate(opt.value)}\n </Option>\n ))}\n </Select>\n </Flex>\n {showUniqueValues && (\n <CheckboxGroupStyle className='popup-menu'>\n <CheckboxGroup>\n {uniqueValues.map(item => {\n const isItemSelected = isSelected(item);\n // Custom context prepared for Rendering engine should contain getExecutionContext\n // otherwise the execution context will be populated wrongly from the previous table rendering cycle.\n // For Select filter execution context should be derived from unique values that are displayed in the modal.\n const context = {\n getExecutionContext: () => {\n return {\n getValue: () => ({ [column.field.name]: item }),\n name: 'selectFilter'\n };\n },\n getValue: () => item\n };\n return (\n <Checkbox\n key={item}\n id={item}\n defaultChecked={isItemSelected}\n name={item}\n onClick={onSelectOrDeselect}\n value={item}\n label={\n <RenderingEngine {...column.getRenderingEngineProps()} context={context} />\n }\n />\n );\n })}\n </CheckboxGroup>\n <LoadingIndicatorStyle>\n <LoadingIndicator view={column.parent} show={!uniqueValuesFetched} />\n </LoadingIndicatorStyle>\n </CheckboxGroupStyle>\n )}\n </FormDialog>\n ) : null}\n </>\n );\n}\n\nSelectFilter.propTypes = {\n column: PropTypes.objectOf(PropTypes.any).isRequired,\n finishPopOver: PropTypes.func.isRequired,\n onFilter: PropTypes.func.isRequired\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SelectFilter.js","sourceRoot":"","sources":["../../../../Core/Components/Filters/SelectFilter.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACpG,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,aAAa,EACb,SAAS,EACV,MAAM,gCAAgC,CAAC;AAExC,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKvC,CAAC;AAEF,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIpC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE;IACxF,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,AAAD,EAAG,gBAAgB,CAAC,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC3E,MAAM,CAAC,YAAY,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtE,uHAAuH;IACvH,MAAM,uBAAuB,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI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AI,EACX,KAAK,EACH,KAAC,eAAe,OAAK,MAAM,CAAC,uBAAuB,EAAE,EAAE,OAAO,EAAE,OAAO,GAAI,IAPxE,IAAI,CAST,CACH,CAAC;4BACJ,CAAC,CAAC,GACY,EAChB,KAAC,qBAAqB,cACpB,KAAC,gBAAgB,IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,mBAAmB,GAAI,GAC/C,IACL,CACtB,IACU,CACd,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAC;AACJ,CAAC;AAED,YAAY,CAAC,SAAS,GAAG;IACvB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useState, useEffect, useCallback } from 'react';\nimport styled from 'styled-components';\n\nimport { Checkbox, CheckboxGroup, Flex, Select, Option, FormDialog } from '@pega/cosmos-react-core';\nimport {\n addFilter,\n getFilterInitializers,\n comparatorMap,\n FieldType\n} from 'pega-repeating-structures-core';\n\nimport LoadingIndicator from '../LoadingIndicator';\nimport RenderingEngine from '../RenderingEngine/RenderCell';\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst LoadingIndicatorStyle = styled.div`\n position: absolute;\n margin: auto;\n left: 0;\n right: 0;\n`;\n\nconst CheckboxGroupStyle = styled.div`\n max-height: 11.719rem;\n overflow: auto;\n margin-top: 0.5rem;\n`;\n\nexport default function SelectFilter({ column, finishPopOver, onFilter, popoverButtonRef }) {\n const [fInput, fValue, , filterExpression] = getFilterInitializers(column);\n const [uniqueValues, setUniqueColumnValues] = useState([]);\n const [uniqueValuesFetched, setUniqueValuesFetched] = useState(false);\n // Prepopulate the select filter with values only when global filter condition matches with condition in select filter.\n const prePopulateSelectFilter = column.field.filterParams.some(\n filterParam => filterParam.key === fValue\n );\n const [selectedValues, setSelectedValues] = useState(prePopulateSelectFilter ? fInput : []);\n const [comparator, setComparator] = useState(fValue);\n\n const syncUniqueValues = useCallback(() => {\n if (!uniqueValuesFetched)\n column.getUniqueValues().then(filteredData => {\n setUniqueValuesFetched(true);\n setUniqueColumnValues(filteredData);\n });\n }, [column, uniqueValuesFetched]);\n const [translate] = useTranslate();\n useEffect(() => {\n const resultSet = new Set();\n column.data.forEach(d => {\n if (d) resultSet.add(d);\n });\n setUniqueColumnValues([...resultSet]);\n }, [column]);\n\n // set the comparator as 1st option by default only if global filter criteria does not match with select filter (prepopulateSelectFilter)\n useEffect(() => {\n if (!prePopulateSelectFilter && column.field.filterParams?.[0]?.key)\n setComparator(column.field.filterParams[0].key);\n // Should be call only on initial load thats why empty dependencies\n }, []);\n\n useEffect(() => {\n if (!column.field?.filterParams?.find(item => item.key !== 'select')) return;\n syncUniqueValues();\n }, [column, syncUniqueValues]);\n\n const onFilterChange = useCallback(({ value: comparatorType }) => {\n setComparator(comparatorType);\n }, []);\n\n const submitFilter = useCallback(() => {\n const formattedComp = comparatorMap[comparator];\n let localFilterExpression = null;\n const input =\n formattedComp === comparatorMap.isNull || formattedComp === comparatorMap.isNotNull\n ? null\n : selectedValues;\n localFilterExpression = addFilter({\n // Ignore the initial filter expression if prePopulateSelectFilter is true as user has chosen to override it.\n filterExpression: prePopulateSelectFilter ? null : filterExpression,\n comparator: formattedComp,\n column,\n input\n });\n onFilter({\n filterExp: localFilterExpression\n });\n finishPopOver();\n }, [comparator, selectedValues, filterExpression, column, onFilter, prePopulateSelectFilter]);\n\n const isSelected = useCallback(\n value => {\n return new Set(selectedValues).has(value);\n },\n [selectedValues]\n );\n\n const onSelectOrDeselect = useCallback(\n event => {\n /* Disabling operators like isAnyOf isNoneOf */\n const { value, checked } = event.target;\n const inputValue = column.field.type === FieldType.NUMBER ? parseFloat(value) : value;\n /* collecting set of unique values to sent with different operators */\n if (checked)\n setSelectedValues(\n selectedValues\n ? [...new Set([inputValue, ...selectedValues])]\n : [...new Set([inputValue])]\n );\n else {\n const index = selectedValues.findIndex(val => val === inputValue);\n const values = selectedValues.slice(0, index).concat(selectedValues.slice(index + 1));\n setSelectedValues(values);\n }\n },\n [column, selectedValues]\n );\n\n // show unique values checkboxes for selection only if comparator is other than 'IS_NULL' and 'IS_NOT_NULL'\n const showUniqueValues = ![comparatorMap.isNull, comparatorMap.isNotNull].includes(\n comparatorMap[comparator]\n );\n\n return (\n <>\n {popoverButtonRef.current ? (\n <FormDialog\n heading={translate('Filter column')}\n onSubmit={submitFilter}\n onCancel={finishPopOver}\n target={popoverButtonRef.current}\n >\n <Flex>\n <Select\n defaultValue={comparator}\n onChange={e => onFilterChange({ value: e.target.value })}\n >\n {(column.field.filterParams || []).map(opt => (\n <Option key={opt.key} value={opt.key}>\n {translate(opt.value)}\n </Option>\n ))}\n </Select>\n </Flex>\n {showUniqueValues && (\n <CheckboxGroupStyle className='popup-menu'>\n <CheckboxGroup>\n {uniqueValues.map(item => {\n const isItemSelected = isSelected(item);\n // Custom context prepared for Rendering engine should contain getExecutionContext\n // otherwise the execution context will be populated wrongly from the previous table rendering cycle.\n // For Select filter execution context should be derived from unique values that are displayed in the modal.\n const context = {\n getExecutionContext: () => {\n return {\n getValue: () => ({ [column.field.name]: item }),\n name: 'selectFilter'\n };\n },\n getValue: () => item\n };\n return (\n <Checkbox\n key={item}\n id={item}\n defaultChecked={isItemSelected}\n name={item}\n onClick={onSelectOrDeselect}\n value={item}\n label={\n <RenderingEngine {...column.getRenderingEngineProps()} context={context} />\n }\n />\n );\n })}\n </CheckboxGroup>\n <LoadingIndicatorStyle>\n <LoadingIndicator view={column.parent} show={!uniqueValuesFetched} />\n </LoadingIndicatorStyle>\n </CheckboxGroupStyle>\n )}\n </FormDialog>\n ) : null}\n </>\n );\n}\n\nSelectFilter.propTypes = {\n column: PropTypes.objectOf(PropTypes.any).isRequired,\n finishPopOver: PropTypes.func.isRequired,\n onFilter: PropTypes.func.isRequired\n};\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: import("styled-components").
|
|
1
|
+
declare const _default: import("styled-components").RuleSet<object>;
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterAggregators.d.ts","sourceRoot":"","sources":["../../../Core/Components/FooterAggregators.jsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"FooterAggregators.d.ts","sourceRoot":"","sources":["../../../Core/Components/FooterAggregators.jsx"],"names":[],"mappings":";;AAcA;;mDAcC;;;;;;;;;;sBA3BqB,YAAY"}
|
|
@@ -6,7 +6,7 @@ import AggregatorCell from './AggregatorCell';
|
|
|
6
6
|
const StyledAggregatorWrapper = styled.div `
|
|
7
7
|
border-bottom: 0;
|
|
8
8
|
.aggregateCell {
|
|
9
|
-
border-top: var(--border-style);
|
|
9
|
+
border-top: ${props => props.theme.components.table.border['horizontal-inner'] ? 'var(--border-style)' : 'none'};
|
|
10
10
|
}
|
|
11
11
|
`;
|
|
12
12
|
function FooterAggregators({ columns }) {
|
|
@@ -14,7 +14,8 @@ function FooterAggregators({ columns }) {
|
|
|
14
14
|
return null;
|
|
15
15
|
return (_jsx(StyledAggregatorWrapper, { className: 'row', children: columns.map(column => {
|
|
16
16
|
const context = {
|
|
17
|
-
getValue: () => column.aggregateValue
|
|
17
|
+
getValue: () => column.aggregateValue,
|
|
18
|
+
getExecutionContext: () => ({ name: 'footer' })
|
|
18
19
|
};
|
|
19
20
|
return _jsx(AggregatorCell, { column: column, context: context }, column.field?.id);
|
|
20
21
|
}) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterAggregators.js","sourceRoot":"","sources":["../../../Core/Components/FooterAggregators.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,SAAS,MAA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3B,CAAC;AACJ,CAAC;AAED,iBAAiB,CAAC,SAAS,GAAG;IAC5B,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC;CAC1C,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG;IAC/B,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,eAAe,IAAI,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import { memo } from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport AggregatorCell from './AggregatorCell';\n\nconst StyledAggregatorWrapper = styled.div`\n border-bottom: 0;\n .aggregateCell {\n border-top: ${props =>\n props.theme.components.table.border['horizontal-inner'] ? 'var(--border-style)' : 'none'};\n }\n`;\n\nfunction FooterAggregators({ columns }) {\n if (columns.filter(c => c.aggregated).length === 0) return null;\n\n return (\n <StyledAggregatorWrapper className='row'>\n {columns.map(column => {\n const context = {\n getValue: () => column.aggregateValue,\n getExecutionContext: () => ({ name: 'footer' })\n };\n return <AggregatorCell key={column.field?.id} column={column} context={context} />;\n })}\n </StyledAggregatorWrapper>\n );\n}\n\nFooterAggregators.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.any)\n};\n\nFooterAggregators.defaultProps = {\n columns: []\n};\n\nexport default memo(FooterAggregators);\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FieldType, type RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
export type GroupAdditionalFieldData = RsCoreTypes.GroupGenerator['additionalFieldsData'][0];
|
|
3
|
+
export type GetAdditionalDataResponse = NonNullable<Awaited<ReturnType<RsCoreTypes.GroupGenerator['getAdditionalFieldData']>>>;
|
|
4
|
+
type FieldTypes = (typeof FieldType)[keyof typeof FieldType];
|
|
5
|
+
export declare const isDateLikeField: (type: FieldTypes) => type is typeof FieldType.DATE | typeof FieldType.DATE_TIME | typeof FieldType.DATE_ONLY;
|
|
6
|
+
declare const GroupAdditionalFieldDataModal: ({ groupHeader, additionalField, column }: {
|
|
7
|
+
groupHeader: RsCoreTypes.GroupGenerator;
|
|
8
|
+
additionalField: RsCoreTypes.GroupAdditionalField;
|
|
9
|
+
column: RsCoreTypes.Column;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default GroupAdditionalFieldDataModal;
|
|
12
|
+
//# sourceMappingURL=GroupAdditionalFieldDataModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupAdditionalFieldDataModal.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,SAAS,EACT,KAAK,WAAW,EACjB,MAAM,gCAAgC,CAAC;AASxC,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,MAAM,MAAM,yBAAyB,GAAG,WAAW,CACjD,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAC1E,CAAC;AACF,KAAK,UAAU,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAK7D,eAAO,MAAM,eAAe,GAC1B,MAAM,UAAU,KACf,IAAI,IAAI,OAAO,SAAS,CAAC,IAAI,GAAG,OAAO,SAAS,CAAC,SAAS,GAAG,OAAO,SAAS,CAAC,SAEhF,CAAC;AAwEF,QAAA,MAAM,6BAA6B,GAAI,0CAIpC;IACD,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC;IACxC,eAAe,EAAE,WAAW,CAAC,oBAAoB,CAAC;IAClD,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;CAC5B,4CAyEA,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
|