@pega/lists-react 8.0.0-build.27.14
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/LICENSE +185 -0
- package/README.md +219 -0
- package/SECURITY.md +11 -0
- package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts +23 -0
- package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts.map +1 -0
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js +30 -0
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js.map +1 -0
- package/lib/Core/Components/AggregateMenu.d.ts +23 -0
- package/lib/Core/Components/AggregateMenu.d.ts.map +1 -0
- package/lib/Core/Components/AggregateMenu.js +73 -0
- package/lib/Core/Components/AggregateMenu.js.map +1 -0
- package/lib/Core/Components/AggregatorCell.d.ts +23 -0
- package/lib/Core/Components/AggregatorCell.d.ts.map +1 -0
- package/lib/Core/Components/AggregatorCell.js +29 -0
- package/lib/Core/Components/AggregatorCell.js.map +1 -0
- package/lib/Core/Components/ColumnResizer.d.ts +13 -0
- package/lib/Core/Components/ColumnResizer.d.ts.map +1 -0
- package/lib/Core/Components/ColumnResizer.js +12 -0
- package/lib/Core/Components/ColumnResizer.js.map +1 -0
- package/lib/Core/Components/ConfirmationModal.d.ts +27 -0
- package/lib/Core/Components/ConfirmationModal.d.ts.map +1 -0
- package/lib/Core/Components/ConfirmationModal.js +36 -0
- package/lib/Core/Components/ConfirmationModal.js.map +1 -0
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts +17 -0
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts.map +1 -0
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js +209 -0
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js.map +1 -0
- package/lib/Core/Components/ContextMenu/CopyPaste.d.ts +3 -0
- package/lib/Core/Components/ContextMenu/CopyPaste.d.ts.map +1 -0
- package/lib/Core/Components/ContextMenu/CopyPaste.js +22 -0
- package/lib/Core/Components/ContextMenu/CopyPaste.js.map +1 -0
- package/lib/Core/Components/ContextMenu/QuickFilter.d.ts +4 -0
- package/lib/Core/Components/ContextMenu/QuickFilter.d.ts.map +1 -0
- package/lib/Core/Components/ContextMenu/QuickFilter.js +82 -0
- package/lib/Core/Components/ContextMenu/QuickFilter.js.map +1 -0
- package/lib/Core/Components/DateValueDisplay.d.ts +13 -0
- package/lib/Core/Components/DateValueDisplay.d.ts.map +1 -0
- package/lib/Core/Components/DateValueDisplay.js +71 -0
- package/lib/Core/Components/DateValueDisplay.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/Badge.d.ts +14 -0
- package/lib/Core/Components/DefaultComponents/Badge.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/Badge.js +15 -0
- package/lib/Core/Components/DefaultComponents/Badge.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CardItem.d.ts +3 -0
- package/lib/Core/Components/DefaultComponents/CardItem.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CardItem.js +78 -0
- package/lib/Core/Components/DefaultComponents/CardItem.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Cell.d.ts +15 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Cell.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Cell.js +18 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Cell.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/CheckCross.d.ts +5 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/CheckCross.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/CheckCross.js +25 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/CheckCross.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/Comma.d.ts +13 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/Comma.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/Comma.js +11 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/Comma.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts +3 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.js +10 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/ForwardSlash.d.ts +13 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/ForwardSlash.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/ForwardSlash.js +11 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/ForwardSlash.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/MultiLine.d.ts +13 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/MultiLine.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/MultiLine.js +15 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/MultiLine.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/Space.d.ts +13 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/Space.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/Space.js +11 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/Space.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/index.d.ts +12 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/index.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/index.js +11 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/index.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/CustomCell.d.ts +18 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/CustomCell.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/CustomCell.js +51 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/CustomCell.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/DefaultTextRenderer.d.ts +13 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/DefaultTextRenderer.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/DefaultTextRenderer.js +25 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/DefaultTextRenderer.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts +12 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js +35 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts +15 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js +49 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts +12 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js +44 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts +16 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js +64 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Link.d.ts +7 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Link.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Link.js +23 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Link.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Operator.d.ts +19 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Operator.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Operator.js +37 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/Operator.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RichText.d.ts +17 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RichText.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RichText.js +50 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RichText.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts +13 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js +67 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.d.ts +11 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.js +11 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.d.ts +11 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.js +13 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowSelectHandle.d.ts +15 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowSelectHandle.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowSelectHandle.js +57 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowSelectHandle.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts +52 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js +29 -0
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts +3 -0
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js +25 -0
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/Filter.d.ts +15 -0
- package/lib/Core/Components/DefaultComponents/Filter.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/Filter.js +18 -0
- package/lib/Core/Components/DefaultComponents/Filter.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/HeaderCell.d.ts +17 -0
- package/lib/Core/Components/DefaultComponents/HeaderCell.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/HeaderCell.js +21 -0
- package/lib/Core/Components/DefaultComponents/HeaderCell.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/LoadingIndicator.d.ts +3 -0
- package/lib/Core/Components/DefaultComponents/LoadingIndicator.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/LoadingIndicator.js +9 -0
- package/lib/Core/Components/DefaultComponents/LoadingIndicator.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts +24 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js +102 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.d.ts +16 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js +26 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts +25 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js +85 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationUnsavedWarning.d.ts +16 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationUnsavedWarning.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationUnsavedWarning.js +26 -0
- package/lib/Core/Components/DefaultComponents/PersonalizationUnsavedWarning.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/RowHeight.d.ts +13 -0
- package/lib/Core/Components/DefaultComponents/RowHeight.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/RowHeight.js +20 -0
- package/lib/Core/Components/DefaultComponents/RowHeight.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.d.ts +15 -0
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js +40 -0
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/Sort.d.ts +15 -0
- package/lib/Core/Components/DefaultComponents/Sort.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/Sort.js +21 -0
- package/lib/Core/Components/DefaultComponents/Sort.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/index.d.ts +96 -0
- package/lib/Core/Components/DefaultComponents/index.d.ts.map +1 -0
- package/lib/Core/Components/DefaultComponents/index.js +53 -0
- package/lib/Core/Components/DefaultComponents/index.js.map +1 -0
- package/lib/Core/Components/DynamicFieldConfiguration.d.ts +23 -0
- package/lib/Core/Components/DynamicFieldConfiguration.d.ts.map +1 -0
- package/lib/Core/Components/DynamicFieldConfiguration.js +92 -0
- package/lib/Core/Components/DynamicFieldConfiguration.js.map +1 -0
- package/lib/Core/Components/EmptyContainer.d.ts +5 -0
- package/lib/Core/Components/EmptyContainer.d.ts.map +1 -0
- package/lib/Core/Components/EmptyContainer.js +12 -0
- package/lib/Core/Components/EmptyContainer.js.map +1 -0
- package/lib/Core/Components/FieldTypeIcon.d.ts +13 -0
- package/lib/Core/Components/FieldTypeIcon.d.ts.map +1 -0
- package/lib/Core/Components/FieldTypeIcon.js +17 -0
- package/lib/Core/Components/FieldTypeIcon.js.map +1 -0
- package/lib/Core/Components/Filters/AdvanceFilter.d.ts +16 -0
- package/lib/Core/Components/Filters/AdvanceFilter.d.ts.map +1 -0
- package/lib/Core/Components/Filters/AdvanceFilter.js +29 -0
- package/lib/Core/Components/Filters/AdvanceFilter.js.map +1 -0
- package/lib/Core/Components/Filters/BooleanFilter.d.ts +17 -0
- package/lib/Core/Components/Filters/BooleanFilter.d.ts.map +1 -0
- package/lib/Core/Components/Filters/BooleanFilter.js +43 -0
- package/lib/Core/Components/Filters/BooleanFilter.js.map +1 -0
- package/lib/Core/Components/Filters/CommonFilter.d.ts +17 -0
- package/lib/Core/Components/Filters/CommonFilter.d.ts.map +1 -0
- package/lib/Core/Components/Filters/CommonFilter.js +67 -0
- package/lib/Core/Components/Filters/CommonFilter.js.map +1 -0
- package/lib/Core/Components/Filters/Filter.d.ts +18 -0
- package/lib/Core/Components/Filters/Filter.d.ts.map +1 -0
- package/lib/Core/Components/Filters/Filter.js +20 -0
- package/lib/Core/Components/Filters/Filter.js.map +1 -0
- package/lib/Core/Components/Filters/FilterMenu.d.ts +15 -0
- package/lib/Core/Components/Filters/FilterMenu.d.ts.map +1 -0
- package/lib/Core/Components/Filters/FilterMenu.js +32 -0
- package/lib/Core/Components/Filters/FilterMenu.js.map +1 -0
- package/lib/Core/Components/Filters/FilterType.d.ts +18 -0
- package/lib/Core/Components/Filters/FilterType.d.ts.map +1 -0
- package/lib/Core/Components/Filters/FilterType.js +35 -0
- package/lib/Core/Components/Filters/FilterType.js.map +1 -0
- package/lib/Core/Components/Filters/Hooks/useFilterSubmit.d.ts +5 -0
- package/lib/Core/Components/Filters/Hooks/useFilterSubmit.d.ts.map +1 -0
- package/lib/Core/Components/Filters/Hooks/useFilterSubmit.js +10 -0
- package/lib/Core/Components/Filters/Hooks/useFilterSubmit.js.map +1 -0
- package/lib/Core/Components/Filters/Hooks/useValidRhsTypes.d.ts +2 -0
- package/lib/Core/Components/Filters/Hooks/useValidRhsTypes.d.ts.map +1 -0
- package/lib/Core/Components/Filters/Hooks/useValidRhsTypes.js +14 -0
- package/lib/Core/Components/Filters/Hooks/useValidRhsTypes.js.map +1 -0
- package/lib/Core/Components/Filters/InputWrapper.d.ts +28 -0
- package/lib/Core/Components/Filters/InputWrapper.d.ts.map +1 -0
- package/lib/Core/Components/Filters/InputWrapper.js +40 -0
- package/lib/Core/Components/Filters/InputWrapper.js.map +1 -0
- package/lib/Core/Components/Filters/SelectFilter.d.ts +17 -0
- package/lib/Core/Components/Filters/SelectFilter.d.ts.map +1 -0
- package/lib/Core/Components/Filters/SelectFilter.js +116 -0
- package/lib/Core/Components/Filters/SelectFilter.js.map +1 -0
- package/lib/Core/Components/Filters/SimpleFilter.d.ts +17 -0
- package/lib/Core/Components/Filters/SimpleFilter.d.ts.map +1 -0
- package/lib/Core/Components/Filters/SimpleFilter.js +38 -0
- package/lib/Core/Components/Filters/SimpleFilter.js.map +1 -0
- package/lib/Core/Components/Filters/config.d.ts +75 -0
- package/lib/Core/Components/Filters/config.d.ts.map +1 -0
- package/lib/Core/Components/Filters/config.js +244 -0
- package/lib/Core/Components/Filters/config.js.map +1 -0
- package/lib/Core/Components/Filters/styles.d.ts +3 -0
- package/lib/Core/Components/Filters/styles.d.ts.map +1 -0
- package/lib/Core/Components/Filters/styles.js +30 -0
- package/lib/Core/Components/Filters/styles.js.map +1 -0
- package/lib/Core/Components/Footer.d.ts +13 -0
- package/lib/Core/Components/Footer.d.ts.map +1 -0
- package/lib/Core/Components/Footer.js +22 -0
- package/lib/Core/Components/Footer.js.map +1 -0
- package/lib/Core/Components/FooterAggregators.d.ts +16 -0
- package/lib/Core/Components/FooterAggregators.d.ts.map +1 -0
- package/lib/Core/Components/FooterAggregators.js +29 -0
- package/lib/Core/Components/FooterAggregators.js.map +1 -0
- package/lib/Core/Components/FreezeLine.d.ts +13 -0
- package/lib/Core/Components/FreezeLine.d.ts.map +1 -0
- package/lib/Core/Components/FreezeLine.js +13 -0
- package/lib/Core/Components/FreezeLine.js.map +1 -0
- package/lib/Core/Components/GroupRenderer.d.ts +15 -0
- package/lib/Core/Components/GroupRenderer.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer.js +212 -0
- package/lib/Core/Components/GroupRenderer.js.map +1 -0
- package/lib/Core/Components/Grouping/GroupingMenu.d.ts +15 -0
- package/lib/Core/Components/Grouping/GroupingMenu.d.ts.map +1 -0
- package/lib/Core/Components/Grouping/GroupingMenu.js +66 -0
- package/lib/Core/Components/Grouping/GroupingMenu.js.map +1 -0
- package/lib/Core/Components/HeaderCell.d.ts +17 -0
- package/lib/Core/Components/HeaderCell.d.ts.map +1 -0
- package/lib/Core/Components/HeaderCell.js +30 -0
- package/lib/Core/Components/HeaderCell.js.map +1 -0
- package/lib/Core/Components/HeaderMenu/actions.d.ts +15 -0
- package/lib/Core/Components/HeaderMenu/actions.d.ts.map +1 -0
- package/lib/Core/Components/HeaderMenu/actions.js +211 -0
- package/lib/Core/Components/HeaderMenu/actions.js.map +1 -0
- package/lib/Core/Components/HeaderMenu/index.d.ts +23 -0
- package/lib/Core/Components/HeaderMenu/index.d.ts.map +1 -0
- package/lib/Core/Components/HeaderMenu/index.js +187 -0
- package/lib/Core/Components/HeaderMenu/index.js.map +1 -0
- package/lib/Core/Components/HierarchicalCell.d.ts +23 -0
- package/lib/Core/Components/HierarchicalCell.d.ts.map +1 -0
- package/lib/Core/Components/HierarchicalCell.js +30 -0
- package/lib/Core/Components/HierarchicalCell.js.map +1 -0
- package/lib/Core/Components/HierarchicalGroupFooters.d.ts +32 -0
- package/lib/Core/Components/HierarchicalGroupFooters.d.ts.map +1 -0
- package/lib/Core/Components/HierarchicalGroupFooters.js +58 -0
- package/lib/Core/Components/HierarchicalGroupFooters.js.map +1 -0
- package/lib/Core/Components/HierarchicalGroupRenderer.d.ts +31 -0
- package/lib/Core/Components/HierarchicalGroupRenderer.d.ts.map +1 -0
- package/lib/Core/Components/HierarchicalGroupRenderer.js +230 -0
- package/lib/Core/Components/HierarchicalGroupRenderer.js.map +1 -0
- package/lib/Core/Components/LoadingIndicator.d.ts +15 -0
- package/lib/Core/Components/LoadingIndicator.d.ts.map +1 -0
- package/lib/Core/Components/LoadingIndicator.js +15 -0
- package/lib/Core/Components/LoadingIndicator.js.map +1 -0
- package/lib/Core/Components/NotificationManager.d.ts +13 -0
- package/lib/Core/Components/NotificationManager.d.ts.map +1 -0
- package/lib/Core/Components/NotificationManager.js +44 -0
- package/lib/Core/Components/NotificationManager.js.map +1 -0
- package/lib/Core/Components/RFColumnConfigurator.d.ts +19 -0
- package/lib/Core/Components/RFColumnConfigurator.d.ts.map +1 -0
- package/lib/Core/Components/RFColumnConfigurator.js +90 -0
- package/lib/Core/Components/RFColumnConfigurator.js.map +1 -0
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.d.ts +13 -0
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.d.ts.map +1 -0
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.js +52 -0
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.js.map +1 -0
- package/lib/Core/Components/RSWrapper/Personalization.d.ts +13 -0
- package/lib/Core/Components/RSWrapper/Personalization.d.ts.map +1 -0
- package/lib/Core/Components/RSWrapper/Personalization.js +61 -0
- package/lib/Core/Components/RSWrapper/Personalization.js.map +1 -0
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.d.ts +2 -0
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.d.ts.map +1 -0
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.js +4 -0
- package/lib/Core/Components/RSWrapper/__mocks__/uuid.js.map +1 -0
- package/lib/Core/Components/RSWrapper/index.d.ts +6 -0
- package/lib/Core/Components/RSWrapper/index.d.ts.map +1 -0
- package/lib/Core/Components/RSWrapper/index.js +83 -0
- package/lib/Core/Components/RSWrapper/index.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/ComponentResolverFactory.d.ts +3 -0
- package/lib/Core/Components/RenderingEngine/ComponentResolverFactory.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/ComponentResolverFactory.js +65 -0
- package/lib/Core/Components/RenderingEngine/ComponentResolverFactory.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/ErrorHandler.d.ts +2 -0
- package/lib/Core/Components/RenderingEngine/ErrorHandler.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/ErrorHandler.js +2 -0
- package/lib/Core/Components/RenderingEngine/ErrorHandler.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/ExpresssionEvaluator.d.ts +2 -0
- package/lib/Core/Components/RenderingEngine/ExpresssionEvaluator.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/ExpresssionEvaluator.js +2 -0
- package/lib/Core/Components/RenderingEngine/ExpresssionEvaluator.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/Flasher.d.ts +2 -0
- package/lib/Core/Components/RenderingEngine/Flasher.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/Flasher.js +2 -0
- package/lib/Core/Components/RenderingEngine/Flasher.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/Formatter.d.ts +2 -0
- package/lib/Core/Components/RenderingEngine/Formatter.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/Formatter.js +24 -0
- package/lib/Core/Components/RenderingEngine/Formatter.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts +16 -0
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/RenderCell.js +48 -0
- package/lib/Core/Components/RenderingEngine/RenderCell.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/RenderView.d.ts +8 -0
- package/lib/Core/Components/RenderingEngine/RenderView.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/RenderView.js +25 -0
- package/lib/Core/Components/RenderingEngine/RenderView.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/Util.d.ts +2 -0
- package/lib/Core/Components/RenderingEngine/Util.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/Util.js +36 -0
- package/lib/Core/Components/RenderingEngine/Util.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/ValueRenderer.d.ts +14 -0
- package/lib/Core/Components/RenderingEngine/ValueRenderer.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/ValueRenderer.js +12 -0
- package/lib/Core/Components/RenderingEngine/ValueRenderer.js.map +1 -0
- package/lib/Core/Components/RenderingEngine/useHighlighter.d.ts +5 -0
- package/lib/Core/Components/RenderingEngine/useHighlighter.d.ts.map +1 -0
- package/lib/Core/Components/RenderingEngine/useHighlighter.js +52 -0
- package/lib/Core/Components/RenderingEngine/useHighlighter.js.map +1 -0
- package/lib/Core/Components/TestIdConstants.d.ts +15 -0
- package/lib/Core/Components/TestIdConstants.d.ts.map +1 -0
- package/lib/Core/Components/TestIdConstants.js +14 -0
- package/lib/Core/Components/TestIdConstants.js.map +1 -0
- package/lib/Core/Components/Toolbar/ActionsMenu.d.ts +15 -0
- package/lib/Core/Components/Toolbar/ActionsMenu.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/ActionsMenu.js +58 -0
- package/lib/Core/Components/Toolbar/ActionsMenu.js.map +1 -0
- package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts +14 -0
- package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js +59 -0
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -0
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.d.ts +20 -0
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.js +14 -0
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.js.map +1 -0
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts +35 -0
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/ColumnSelector.js +141 -0
- package/lib/Core/Components/Toolbar/ColumnSelector.js.map +1 -0
- package/lib/Core/Components/Toolbar/DebugInfo.d.ts +14 -0
- package/lib/Core/Components/Toolbar/DebugInfo.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/DebugInfo.js +48 -0
- package/lib/Core/Components/Toolbar/DebugInfo.js.map +1 -0
- package/lib/Core/Components/Toolbar/FieldSelector.d.ts +19 -0
- package/lib/Core/Components/Toolbar/FieldSelector.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/FieldSelector.js +53 -0
- package/lib/Core/Components/Toolbar/FieldSelector.js.map +1 -0
- package/lib/Core/Components/Toolbar/Grouping.types.d.ts +22 -0
- package/lib/Core/Components/Toolbar/Grouping.types.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/Grouping.types.js +2 -0
- package/lib/Core/Components/Toolbar/Grouping.types.js.map +1 -0
- package/lib/Core/Components/Toolbar/Map/MapToolbar.d.ts +9 -0
- package/lib/Core/Components/Toolbar/Map/MapToolbar.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/Map/MapToolbar.js +27 -0
- package/lib/Core/Components/Toolbar/Map/MapToolbar.js.map +1 -0
- package/lib/Core/Components/Toolbar/RefreshBanner.d.ts +15 -0
- package/lib/Core/Components/Toolbar/RefreshBanner.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/RefreshBanner.js +28 -0
- package/lib/Core/Components/Toolbar/RefreshBanner.js.map +1 -0
- package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts +14 -0
- package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/SimpleToolbar.js +22 -0
- package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -0
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts +8 -0
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js +61 -0
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js.map +1 -0
- package/lib/Core/Components/Toolbar/ToolbarActions.d.ts +20 -0
- package/lib/Core/Components/Toolbar/ToolbarActions.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/ToolbarActions.js +28 -0
- package/lib/Core/Components/Toolbar/ToolbarActions.js.map +1 -0
- package/lib/Core/Components/Toolbar/ValidateMessage.d.ts +17 -0
- package/lib/Core/Components/Toolbar/ValidateMessage.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/ValidateMessage.js +44 -0
- package/lib/Core/Components/Toolbar/ValidateMessage.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useAnnounceRowsCount.d.ts +3 -0
- package/lib/Core/Components/Toolbar/hooks/useAnnounceRowsCount.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useAnnounceRowsCount.js +37 -0
- package/lib/Core/Components/Toolbar/hooks/useAnnounceRowsCount.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useFilter.d.ts +10 -0
- package/lib/Core/Components/Toolbar/hooks/useFilter.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useFilter.js +43 -0
- package/lib/Core/Components/Toolbar/hooks/useFilter.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useFormControlProps.d.ts +5 -0
- package/lib/Core/Components/Toolbar/hooks/useFormControlProps.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useFormControlProps.js +18 -0
- package/lib/Core/Components/Toolbar/hooks/useFormControlProps.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts +24 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js +58 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts +16 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js +110 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.d.ts +11 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js +75 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts +11 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js +61 -0
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts +9 -0
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useMore.js +317 -0
- package/lib/Core/Components/Toolbar/hooks/useMore.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts +13 -0
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js +17 -0
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useRowFocus.d.ts +6 -0
- package/lib/Core/Components/Toolbar/hooks/useRowFocus.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useRowFocus.js +13 -0
- package/lib/Core/Components/Toolbar/hooks/useRowFocus.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSearch.d.ts +11 -0
- package/lib/Core/Components/Toolbar/hooks/useSearch.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSearch.js +38 -0
- package/lib/Core/Components/Toolbar/hooks/useSearch.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts +44 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js +54 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts +13 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js +81 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.d.ts +11 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js +41 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.d.ts +8 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.js +19 -0
- package/lib/Core/Components/Toolbar/hooks/useSort/utils.js.map +1 -0
- package/lib/Core/Components/Toolbar/index.d.ts +14 -0
- package/lib/Core/Components/Toolbar/index.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/index.js +13 -0
- package/lib/Core/Components/Toolbar/index.js.map +1 -0
- package/lib/Core/Components/Toolbar/utils/getCount.d.ts +9 -0
- package/lib/Core/Components/Toolbar/utils/getCount.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/utils/getCount.js +22 -0
- package/lib/Core/Components/Toolbar/utils/getCount.js.map +1 -0
- package/lib/Core/Components/Toolbar/utils/utils.d.ts +51 -0
- package/lib/Core/Components/Toolbar/utils/utils.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/utils/utils.js +100 -0
- package/lib/Core/Components/Toolbar/utils/utils.js.map +1 -0
- package/lib/Core/Components/Virtualise/Pagination.d.ts +13 -0
- package/lib/Core/Components/Virtualise/Pagination.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/Pagination.js +228 -0
- package/lib/Core/Components/Virtualise/Pagination.js.map +1 -0
- package/lib/Core/Components/Virtualise/UseResizeObserver.d.ts +2 -0
- package/lib/Core/Components/Virtualise/UseResizeObserver.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/UseResizeObserver.js +18 -0
- package/lib/Core/Components/Virtualise/UseResizeObserver.js.map +1 -0
- package/lib/Core/Components/Virtualise/UseScroll.d.ts +3 -0
- package/lib/Core/Components/Virtualise/UseScroll.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/UseScroll.js +92 -0
- package/lib/Core/Components/Virtualise/UseScroll.js.map +1 -0
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.d.ts +3 -0
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js +328 -0
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -0
- package/lib/Core/Components/Virtualise/index.d.ts +3 -0
- package/lib/Core/Components/Virtualise/index.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/index.js +313 -0
- package/lib/Core/Components/Virtualise/index.js.map +1 -0
- package/lib/Core/Components/Virtualise/utility.d.ts +63 -0
- package/lib/Core/Components/Virtualise/utility.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/utility.js +209 -0
- package/lib/Core/Components/Virtualise/utility.js.map +1 -0
- package/lib/Core/Context/GlobalContext.d.ts +8 -0
- package/lib/Core/Context/GlobalContext.d.ts.map +1 -0
- package/lib/Core/Context/GlobalContext.js +7 -0
- package/lib/Core/Context/GlobalContext.js.map +1 -0
- package/lib/Core/Context/LocalizationContext.d.ts +13 -0
- package/lib/Core/Context/LocalizationContext.d.ts.map +1 -0
- package/lib/Core/Context/LocalizationContext.js +16 -0
- package/lib/Core/Context/LocalizationContext.js.map +1 -0
- package/lib/Core/Context/ToolbarContext.d.ts +8 -0
- package/lib/Core/Context/ToolbarContext.d.ts.map +1 -0
- package/lib/Core/Context/ToolbarContext.js +7 -0
- package/lib/Core/Context/ToolbarContext.js.map +1 -0
- package/lib/Core/Hooks/UseDebounce.d.ts +2 -0
- package/lib/Core/Hooks/UseDebounce.d.ts.map +1 -0
- package/lib/Core/Hooks/UseDebounce.js +15 -0
- package/lib/Core/Hooks/UseDebounce.js.map +1 -0
- package/lib/Core/Hooks/UseOuterEvent.d.ts +2 -0
- package/lib/Core/Hooks/UseOuterEvent.d.ts.map +1 -0
- package/lib/Core/Hooks/UseOuterEvent.js +30 -0
- package/lib/Core/Hooks/UseOuterEvent.js.map +1 -0
- package/lib/Core/Hooks/UseReactToProps.d.ts +2 -0
- package/lib/Core/Hooks/UseReactToProps.d.ts.map +1 -0
- package/lib/Core/Hooks/UseReactToProps.js +8 -0
- package/lib/Core/Hooks/UseReactToProps.js.map +1 -0
- package/lib/Core/Hooks/UseScrollAway.d.ts +2 -0
- package/lib/Core/Hooks/UseScrollAway.d.ts.map +1 -0
- package/lib/Core/Hooks/UseScrollAway.js +30 -0
- package/lib/Core/Hooks/UseScrollAway.js.map +1 -0
- package/lib/Core/Hooks/UseSelect.d.ts +2 -0
- package/lib/Core/Hooks/UseSelect.d.ts.map +1 -0
- package/lib/Core/Hooks/UseSelect.js +17 -0
- package/lib/Core/Hooks/UseSelect.js.map +1 -0
- package/lib/Core/Hooks/UseThrottle.d.ts +2 -0
- package/lib/Core/Hooks/UseThrottle.d.ts.map +1 -0
- package/lib/Core/Hooks/UseThrottle.js +14 -0
- package/lib/Core/Hooks/UseThrottle.js.map +1 -0
- package/lib/Core/Hooks/UseThunkReducer.d.ts +3 -0
- package/lib/Core/Hooks/UseThunkReducer.d.ts.map +1 -0
- package/lib/Core/Hooks/UseThunkReducer.js +15 -0
- package/lib/Core/Hooks/UseThunkReducer.js.map +1 -0
- package/lib/Core/Hooks/a11y/index.d.ts +3 -0
- package/lib/Core/Hooks/a11y/index.d.ts.map +1 -0
- package/lib/Core/Hooks/a11y/index.js +4 -0
- package/lib/Core/Hooks/a11y/index.js.map +1 -0
- package/lib/Core/Hooks/a11y/useAnnounceGroup.d.ts +3 -0
- package/lib/Core/Hooks/a11y/useAnnounceGroup.d.ts.map +1 -0
- package/lib/Core/Hooks/a11y/useAnnounceGroup.js +45 -0
- package/lib/Core/Hooks/a11y/useAnnounceGroup.js.map +1 -0
- package/lib/Core/Hooks/a11y/useKeyboardA11y.d.ts +16 -0
- package/lib/Core/Hooks/a11y/useKeyboardA11y.d.ts.map +1 -0
- package/lib/Core/Hooks/a11y/useKeyboardA11y.js +147 -0
- package/lib/Core/Hooks/a11y/useKeyboardA11y.js.map +1 -0
- package/lib/Core/Hooks/useConfirmationModal.d.ts +5 -0
- package/lib/Core/Hooks/useConfirmationModal.d.ts.map +1 -0
- package/lib/Core/Hooks/useConfirmationModal.js +42 -0
- package/lib/Core/Hooks/useConfirmationModal.js.map +1 -0
- package/lib/Core/Hooks/useDragDrop.d.ts +25 -0
- package/lib/Core/Hooks/useDragDrop.d.ts.map +1 -0
- package/lib/Core/Hooks/useDragDrop.js +217 -0
- package/lib/Core/Hooks/useDragDrop.js.map +1 -0
- package/lib/Core/Hooks/useRepeat.d.ts +18 -0
- package/lib/Core/Hooks/useRepeat.d.ts.map +1 -0
- package/lib/Core/Hooks/useRepeat.js +174 -0
- package/lib/Core/Hooks/useRepeat.js.map +1 -0
- package/lib/Core/Hooks/useSingleClick.d.ts +2 -0
- package/lib/Core/Hooks/useSingleClick.d.ts.map +1 -0
- package/lib/Core/Hooks/useSingleClick.js +17 -0
- package/lib/Core/Hooks/useSingleClick.js.map +1 -0
- package/lib/Core/Hooks/useSmallScreen.d.ts +4 -0
- package/lib/Core/Hooks/useSmallScreen.d.ts.map +1 -0
- package/lib/Core/Hooks/useSmallScreen.js +11 -0
- package/lib/Core/Hooks/useSmallScreen.js.map +1 -0
- package/lib/Core/Hooks/useTranslate.d.ts +2 -0
- package/lib/Core/Hooks/useTranslate.d.ts.map +1 -0
- package/lib/Core/Hooks/useTranslate.js +7 -0
- package/lib/Core/Hooks/useTranslate.js.map +1 -0
- package/lib/Core/Localization/defaultTranslations.d.ts +144 -0
- package/lib/Core/Localization/defaultTranslations.d.ts.map +1 -0
- package/lib/Core/Localization/defaultTranslations.js +145 -0
- package/lib/Core/Localization/defaultTranslations.js.map +1 -0
- package/lib/Core/Localization/translateCosmosLiteralsUtils.d.ts +6 -0
- package/lib/Core/Localization/translateCosmosLiteralsUtils.d.ts.map +1 -0
- package/lib/Core/Localization/translateCosmosLiteralsUtils.js +15 -0
- package/lib/Core/Localization/translateCosmosLiteralsUtils.js.map +1 -0
- package/lib/Core/Test/JUnitMocks.d.ts +1015 -0
- package/lib/Core/Test/JUnitMocks.d.ts.map +1 -0
- package/lib/Core/Test/JUnitMocks.js +619 -0
- package/lib/Core/Test/JUnitMocks.js.map +1 -0
- package/lib/Core/Test/TestUtils.d.ts +9 -0
- package/lib/Core/Test/TestUtils.d.ts.map +1 -0
- package/lib/Core/Test/TestUtils.js +25 -0
- package/lib/Core/Test/TestUtils.js.map +1 -0
- package/lib/Core/Utils/index.d.ts +19 -0
- package/lib/Core/Utils/index.d.ts.map +1 -0
- package/lib/Core/Utils/index.js +93 -0
- package/lib/Core/Utils/index.js.map +1 -0
- package/lib/Core/Views/Gallery/GalleryA11y.d.ts +13 -0
- package/lib/Core/Views/Gallery/GalleryA11y.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/GalleryA11y.js +57 -0
- package/lib/Core/Views/Gallery/GalleryA11y.js.map +1 -0
- package/lib/Core/Views/Gallery/ItemWrapper.d.ts +19 -0
- package/lib/Core/Views/Gallery/ItemWrapper.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/ItemWrapper.js +29 -0
- package/lib/Core/Views/Gallery/ItemWrapper.js.map +1 -0
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts +3 -0
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js +60 -0
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js.map +1 -0
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.d.ts +2 -0
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js +8 -0
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js.map +1 -0
- package/lib/Core/Views/Gallery/index.d.ts +13 -0
- package/lib/Core/Views/Gallery/index.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/index.js +82 -0
- package/lib/Core/Views/Gallery/index.js.map +1 -0
- package/lib/Core/Views/Map/Map.styles.d.ts +12 -0
- package/lib/Core/Views/Map/Map.styles.d.ts.map +1 -0
- package/lib/Core/Views/Map/Map.styles.js +47 -0
- package/lib/Core/Views/Map/Map.styles.js.map +1 -0
- package/lib/Core/Views/Map/MapItem.d.ts +10 -0
- package/lib/Core/Views/Map/MapItem.d.ts.map +1 -0
- package/lib/Core/Views/Map/MapItem.js +12 -0
- package/lib/Core/Views/Map/MapItem.js.map +1 -0
- package/lib/Core/Views/Map/index.d.ts +7 -0
- package/lib/Core/Views/Map/index.d.ts.map +1 -0
- package/lib/Core/Views/Map/index.js +50 -0
- package/lib/Core/Views/Map/index.js.map +1 -0
- package/lib/Core/Views/Map/utils.d.ts +14 -0
- package/lib/Core/Views/Map/utils.d.ts.map +1 -0
- package/lib/Core/Views/Map/utils.js +31 -0
- package/lib/Core/Views/Map/utils.js.map +1 -0
- package/lib/Core/Views/Table/Body.d.ts +23 -0
- package/lib/Core/Views/Table/Body.d.ts.map +1 -0
- package/lib/Core/Views/Table/Body.js +44 -0
- package/lib/Core/Views/Table/Body.js.map +1 -0
- package/lib/Core/Views/Table/CellWrapper.d.ts +23 -0
- package/lib/Core/Views/Table/CellWrapper.d.ts.map +1 -0
- package/lib/Core/Views/Table/CellWrapper.js +75 -0
- package/lib/Core/Views/Table/CellWrapper.js.map +1 -0
- package/lib/Core/Views/Table/GroupingHeaderCell.d.ts +22 -0
- package/lib/Core/Views/Table/GroupingHeaderCell.d.ts.map +1 -0
- package/lib/Core/Views/Table/GroupingHeaderCell.js +26 -0
- package/lib/Core/Views/Table/GroupingHeaderCell.js.map +1 -0
- package/lib/Core/Views/Table/HeaderWrapper.d.ts +13 -0
- package/lib/Core/Views/Table/HeaderWrapper.d.ts.map +1 -0
- package/lib/Core/Views/Table/HeaderWrapper.js +33 -0
- package/lib/Core/Views/Table/HeaderWrapper.js.map +1 -0
- package/lib/Core/Views/Table/Headers.d.ts +3 -0
- package/lib/Core/Views/Table/Headers.d.ts.map +1 -0
- package/lib/Core/Views/Table/Headers.js +24 -0
- package/lib/Core/Views/Table/Headers.js.map +1 -0
- package/lib/Core/Views/Table/Row.d.ts +26 -0
- package/lib/Core/Views/Table/Row.d.ts.map +1 -0
- package/lib/Core/Views/Table/Row.js +24 -0
- package/lib/Core/Views/Table/Row.js.map +1 -0
- package/lib/Core/Views/Table/Samples/a11ySampleWithErrors.d.ts +8 -0
- package/lib/Core/Views/Table/Samples/a11ySampleWithErrors.d.ts.map +1 -0
- package/lib/Core/Views/Table/Samples/a11ySampleWithErrors.js +333 -0
- package/lib/Core/Views/Table/Samples/a11ySampleWithErrors.js.map +1 -0
- package/lib/Core/Views/Table/StyledTableContainer.d.ts +3 -0
- package/lib/Core/Views/Table/StyledTableContainer.d.ts.map +1 -0
- package/lib/Core/Views/Table/StyledTableContainer.js +861 -0
- package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -0
- package/lib/Core/Views/Table/TableA11y.d.ts +48 -0
- package/lib/Core/Views/Table/TableA11y.d.ts.map +1 -0
- package/lib/Core/Views/Table/TableA11y.js +638 -0
- package/lib/Core/Views/Table/TableA11y.js.map +1 -0
- package/lib/Core/Views/Table/UseSort.d.ts +2 -0
- package/lib/Core/Views/Table/UseSort.d.ts.map +1 -0
- package/lib/Core/Views/Table/UseSort.js +37 -0
- package/lib/Core/Views/Table/UseSort.js.map +1 -0
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts +31 -0
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts.map +1 -0
- package/lib/Core/Views/Table/VirtualizeWrapper.js +39 -0
- package/lib/Core/Views/Table/VirtualizeWrapper.js.map +1 -0
- package/lib/Core/Views/Table/index.d.ts +13 -0
- package/lib/Core/Views/Table/index.d.ts.map +1 -0
- package/lib/Core/Views/Table/index.js +91 -0
- package/lib/Core/Views/Table/index.js.map +1 -0
- package/lib/Core/Views/Timeline/index.d.ts +7 -0
- package/lib/Core/Views/Timeline/index.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/index.js +81 -0
- package/lib/Core/Views/Timeline/index.js.map +1 -0
- package/lib/Core/Views/Timeline/utility.d.ts +8 -0
- package/lib/Core/Views/Timeline/utility.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/utility.js +120 -0
- package/lib/Core/Views/Timeline/utility.js.map +1 -0
- package/lib/Core/Views/rs-styles.d.ts +3 -0
- package/lib/Core/Views/rs-styles.d.ts.map +1 -0
- package/lib/Core/Views/rs-styles.js +10 -0
- package/lib/Core/Views/rs-styles.js.map +1 -0
- package/lib/Core/constants.d.ts +73 -0
- package/lib/Core/constants.d.ts.map +1 -0
- package/lib/Core/constants.js +86 -0
- package/lib/Core/constants.js.map +1 -0
- package/lib/Core/index.d.ts +5 -0
- package/lib/Core/index.d.ts.map +1 -0
- package/lib/Core/index.js +40 -0
- package/lib/Core/index.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib/types.d.ts +231 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useRef, useMemo } from 'react';
|
|
3
|
+
import { ConditionBuilder, splitConditionTree } from '@pega/cosmos-react-condition-builder';
|
|
4
|
+
import useValidRhsTypes from '../../Filters/Hooks/useValidRhsTypes';
|
|
5
|
+
import getMenuItemsFromColumns from '../utils/utils';
|
|
6
|
+
import { TOOLBAR_FEATURES } from '../../../constants';
|
|
7
|
+
const useFilter = ({ view }) => {
|
|
8
|
+
const { state: { filterExpression, clearColFilter } = {}, type: { clearFilter, applyFilter } } = view;
|
|
9
|
+
const displayFilter = view.shouldDisplayFeature(TOOLBAR_FEATURES.FILTER);
|
|
10
|
+
const formattedColumns = useMemo(() => getMenuItemsFromColumns(view.columns?.filter(c => c.field.filter), 'name'), [view.columns]);
|
|
11
|
+
const validRhsTypes = useValidRhsTypes(view);
|
|
12
|
+
const handle = useRef(null);
|
|
13
|
+
const { conditions } = splitConditionTree(filterExpression);
|
|
14
|
+
const filters = Object.keys(conditions) || [];
|
|
15
|
+
const onSubmit = useCallback(() => {
|
|
16
|
+
if (!handle?.current)
|
|
17
|
+
return true;
|
|
18
|
+
const [valid, newCondition] = handle.current.getCondition();
|
|
19
|
+
if (!valid)
|
|
20
|
+
return false;
|
|
21
|
+
applyFilter({ filterExp: newCondition });
|
|
22
|
+
if (clearColFilter)
|
|
23
|
+
clearFilter(null);
|
|
24
|
+
return true;
|
|
25
|
+
}, [applyFilter, clearFilter, clearColFilter]);
|
|
26
|
+
const onCancel = useCallback(() => {
|
|
27
|
+
if (clearColFilter)
|
|
28
|
+
clearFilter(null);
|
|
29
|
+
}, [clearColFilter, clearFilter]);
|
|
30
|
+
const filterRenderer = useCallback(() => {
|
|
31
|
+
return (_jsx(ConditionBuilder, { fields: formattedColumns, condition: filterExpression || undefined, validRhsTypes: validRhsTypes, dateFunctions: view.meta.dateFunctions, disallowNOT: true, handle: handle }));
|
|
32
|
+
}, [filterExpression, formattedColumns, validRhsTypes, view.meta.dateFunctions]);
|
|
33
|
+
if (!displayFilter)
|
|
34
|
+
return;
|
|
35
|
+
return {
|
|
36
|
+
count: filters?.length > 0 ? filters.length : undefined,
|
|
37
|
+
renderer: filterRenderer,
|
|
38
|
+
onCancel,
|
|
39
|
+
onSubmit
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export default useFilter;
|
|
43
|
+
//# sourceMappingURL=useFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFilter.js","sourceRoot":"","sources":["../../../../../Core/Components/To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E,YAAY,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC5D,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,WAAW,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;QACzC,IAAI,cAAc;YAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;IAE/C,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;QAChC,IAAI,cAAc;YAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAClC,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,OAAO,CACL,KAAC,gBAAgB,IACf,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,gBAAgB,IAAI,SAAS,EACxC,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EACtC,WAAW,QACX,MAAM,EAAE,MAAM,GACd,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACjF,IAAI,CAAC,aAAa;QAAE,OAAO;IAC3B,OAAO;QACL,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QACvD,QAAQ,EAAE,cAAc;QACxB,QAAQ;QACR,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { useCallback, useRef, useMemo } from 'react';\n\nimport { ConditionBuilder, splitConditionTree } from '@pega/cosmos-react-condition-builder';\n\nimport useValidRhsTypes from '../../Filters/Hooks/useValidRhsTypes';\nimport getMenuItemsFromColumns from '../utils/utils';\nimport { TOOLBAR_FEATURES } from '../../../constants';\n\nconst useFilter = ({ view }) => {\n const {\n state: { filterExpression, clearColFilter } = {},\n type: { clearFilter, applyFilter }\n } = view;\n const displayFilter = view.shouldDisplayFeature(TOOLBAR_FEATURES.FILTER);\n const formattedColumns = useMemo(\n () =>\n getMenuItemsFromColumns(\n view.columns?.filter(c => c.field.filter),\n 'name'\n ),\n [view.columns]\n );\n const validRhsTypes = useValidRhsTypes(view);\n const handle = useRef(null);\n const { conditions } = splitConditionTree(filterExpression);\n const filters = Object.keys(conditions) || [];\n\n const onSubmit = useCallback(() => {\n if (!handle?.current) return true;\n\n const [valid, newCondition] = handle.current.getCondition();\n if (!valid) return false;\n\n applyFilter({ filterExp: newCondition });\n if (clearColFilter) clearFilter(null);\n return true;\n }, [applyFilter, clearFilter, clearColFilter]);\n\n const onCancel = useCallback(() => {\n if (clearColFilter) clearFilter(null);\n }, [clearColFilter, clearFilter]);\n const filterRenderer = useCallback(() => {\n return (\n <ConditionBuilder\n fields={formattedColumns}\n condition={filterExpression || undefined}\n validRhsTypes={validRhsTypes}\n dateFunctions={view.meta.dateFunctions} // Could be undefined\n disallowNOT\n handle={handle}\n />\n );\n }, [filterExpression, formattedColumns, validRhsTypes, view.meta.dateFunctions]);\n if (!displayFilter) return;\n return {\n count: filters?.length > 0 ? filters.length : undefined,\n renderer: filterRenderer,\n onCancel,\n onSubmit\n };\n};\n\nexport default useFilter;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
import type { FormControlProps } from '@pega/cosmos-react-core';
|
|
3
|
+
declare const useFormControlProps: (view: RsCoreTypes.View) => FormControlProps;
|
|
4
|
+
export default useFormControlProps;
|
|
5
|
+
//# sourceMappingURL=useFormControlProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormControlProps.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useFormControlProps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,QAAA,MAAM,mBAAmB,SAAU,WAAW,CAAC,IAAI,KAAG,gBAcrD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useToolbarContext } from '../../../Context/ToolbarContext';
|
|
3
|
+
const useFormControlProps = (view) => {
|
|
4
|
+
const { meta: { requiredOnLoad } = {}, getContext } = view;
|
|
5
|
+
const { getRequiredDef } = getContext();
|
|
6
|
+
const { required } = getRequiredDef() || {};
|
|
7
|
+
const { additionalInfo } = useToolbarContext();
|
|
8
|
+
return useMemo(() => {
|
|
9
|
+
const formProps = {};
|
|
10
|
+
if (required ?? requiredOnLoad) {
|
|
11
|
+
formProps.required = true;
|
|
12
|
+
}
|
|
13
|
+
formProps.additionalInfo = additionalInfo;
|
|
14
|
+
return formProps;
|
|
15
|
+
}, [required, requiredOnLoad, additionalInfo]);
|
|
16
|
+
};
|
|
17
|
+
export default useFormControlProps;
|
|
18
|
+
//# sourceMappingURL=useFormControlProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormControlProps.js","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useFormControlProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,mBAAmB,GAAG,CAAC,IAAsB,EAAoB,EAAE;IACvE,MAAM,EAAE,IAAI,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAE3D,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,MAAM,EAAE,QAAQ,EAAE,GAAQ,cAAc,EAAE,IAAI,EAAE,CAAC;IACjD,MAAM,EAAE,cAAc,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAC/C,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,SAAS,GAAqB,EAAE,CAAC;QACvC,IAAI,QAAQ,IAAI,cAAc,EAAE,CAAC;YAC/B,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,SAAS,CAAC,cAAc,GAAG,cAAc,CAAC;QAC1C,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { useMemo } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { FormControlProps } from '@pega/cosmos-react-core';\n\nimport { useToolbarContext } from '../../../Context/ToolbarContext';\n\nconst useFormControlProps = (view: RsCoreTypes.View): FormControlProps => {\n const { meta: { requiredOnLoad } = {}, getContext } = view;\n\n const { getRequiredDef } = getContext();\n const { required }: any = getRequiredDef() || {};\n const { additionalInfo } = useToolbarContext();\n return useMemo(() => {\n const formProps: FormControlProps = {};\n if (required ?? requiredOnLoad) {\n formProps.required = true;\n }\n formProps.additionalInfo = additionalInfo;\n return formProps;\n }, [required, requiredOnLoad, additionalInfo]);\n};\n\nexport default useFormControlProps;\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default DateFunctionSelector;
|
|
2
|
+
/** Renders a Date-function selector in a grouping row if applicable */
|
|
3
|
+
declare function DateFunctionSelector(props: any): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
declare namespace DateFunctionSelector {
|
|
5
|
+
namespace propTypes {
|
|
6
|
+
let group: PropTypes.Validator<{
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
let dateFunctions: PropTypes.Requireable<{
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
}>;
|
|
12
|
+
let groupingOptions: PropTypes.Validator<{
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
}>;
|
|
15
|
+
let columns: PropTypes.Validator<any[]>;
|
|
16
|
+
let onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
17
|
+
}
|
|
18
|
+
namespace defaultProps {
|
|
19
|
+
let dateFunctions_1: undefined;
|
|
20
|
+
export { dateFunctions_1 as dateFunctions };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
import PropTypes from 'prop-types';
|
|
24
|
+
//# sourceMappingURL=DateFunctionSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateFunctionSelector.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.jsx"],"names":[],"mappings":";AAeA,uEAAuE;AACvE,kGA2DC;;;;;;;;;;;;;;;;;;;;sBA1EqB,YAAY"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { Option, Select } from '@pega/cosmos-react-core';
|
|
6
|
+
import { dateFunctionLabels } from 'pega-repeating-structures-core';
|
|
7
|
+
import useTranslate from '../../../../Hooks/useTranslate';
|
|
8
|
+
import { getFieldType } from './utils';
|
|
9
|
+
const StyledDateFuncWrapper = styled.div `
|
|
10
|
+
width: 9rem;
|
|
11
|
+
`;
|
|
12
|
+
/** Renders a Date-function selector in a grouping row if applicable */
|
|
13
|
+
const DateFunctionSelector = props => {
|
|
14
|
+
const { group, groupingOptions, dateFunctions, columns, onChange } = props;
|
|
15
|
+
const [translate] = useTranslate();
|
|
16
|
+
const fieldType = getFieldType(group.columnId, columns);
|
|
17
|
+
/**
|
|
18
|
+
* Determine what all date functions (if any) can be used for the given fieldType
|
|
19
|
+
* @type { import("./Grouping.types").DateSelectorOption[] }
|
|
20
|
+
*/
|
|
21
|
+
const allOptions = useMemo(() => {
|
|
22
|
+
// If date functions are disabled or not applicable to the current field type
|
|
23
|
+
if (!dateFunctions || !['date', 'datetime'].includes(fieldType)) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
return [
|
|
27
|
+
// Date functions applicable for the given field type
|
|
28
|
+
...dateFunctions[fieldType === 'date' ? 'DATE_ONLY' : 'DATE_TIME'].map(f => ({
|
|
29
|
+
key: f,
|
|
30
|
+
dateFunction: f,
|
|
31
|
+
label: translate(dateFunctionLabels[f])
|
|
32
|
+
})),
|
|
33
|
+
// Option for grouping directly by the field values
|
|
34
|
+
// The key 'NONE' is needed to work with the Select component
|
|
35
|
+
{ key: 'NONE', dateFunction: undefined, label: 'Default' }
|
|
36
|
+
];
|
|
37
|
+
}, [dateFunctions, fieldType, translate]);
|
|
38
|
+
// Skip if no options are available
|
|
39
|
+
// i.e. date functions are disabled or not applicable to current field type
|
|
40
|
+
if (allOptions.length === 0) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
// NOTE: Doing it this way to preserve the order of options.
|
|
44
|
+
// If we instead appended `group.dateFunction` to `available`, the order or options will change on further selections.
|
|
45
|
+
const { available } = groupingOptions.dateFuncs[group.columnId];
|
|
46
|
+
const optionsToUse = allOptions.filter(o => available.includes(o.dateFunction) || o.dateFunction === group.dateFunction);
|
|
47
|
+
return (_jsx(StyledDateFuncWrapper, { children: _jsx(Select, { label: 'Date function', labelHidden: true, "data-testid": 'GroupingDateFuncSelector', value: group.dateFunction || 'NONE', onChange: e => onChange(e.target.value === 'NONE' ? undefined : e.target.value), children: optionsToUse.map(o => (_jsx(Option, { value: o.key, children: o.label }, o.key))) }) }));
|
|
48
|
+
};
|
|
49
|
+
DateFunctionSelector.propTypes = {
|
|
50
|
+
group: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
51
|
+
dateFunctions: PropTypes.objectOf(PropTypes.any),
|
|
52
|
+
groupingOptions: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
53
|
+
columns: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
54
|
+
onChange: PropTypes.func.isRequired
|
|
55
|
+
};
|
|
56
|
+
DateFunctionSelector.defaultProps = { dateFunctions: undefined };
|
|
57
|
+
export default DateFunctionSelector;
|
|
58
|
+
//# sourceMappingURL=DateFunctionSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateFunctionSelector.js","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvC,CAAC;AAEF,uEAAuE;AACvE,MAAM,oBAAoB,GAAG,KAAK,CAAC,EAAE;IACnC,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3E,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAExD;;;OAGG;IACH,MAAM,UAAU,GAA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K,CAAC,YAAY,IAAI,MAAM,EACnC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,YAE9E,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CACrB,KAAC,MAAM,IAAa,KAAK,EAAE,CAAC,CAAC,GAAG,YAC7B,CAAC,CAAC,KAAK,IADG,CAAC,CAAC,GAAG,CAET,CACV,CAAC,GACK,GACa,CACzB,CAAC;AACJ,CAAC,CAAC;AACF,oBAAoB,CAAC,SAAS,GAAG;IAC/B,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACnD,aAAa,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAChD,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IAC7D,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC;AACF,oBAAoB,CAAC,YAAY,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;AAEjE,eAAe,oBAAoB,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport { Option, Select } from '@pega/cosmos-react-core';\nimport { dateFunctionLabels } from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../../../Hooks/useTranslate';\n\nimport { getFieldType } from './utils';\n\nconst StyledDateFuncWrapper = styled.div`\n width: 9rem;\n`;\n\n/** Renders a Date-function selector in a grouping row if applicable */\nconst DateFunctionSelector = props => {\n const { group, groupingOptions, dateFunctions, columns, onChange } = props;\n const [translate] = useTranslate();\n const fieldType = getFieldType(group.columnId, columns);\n\n /**\n * Determine what all date functions (if any) can be used for the given fieldType\n * @type { import(\"./Grouping.types\").DateSelectorOption[] }\n */\n const allOptions = useMemo(() => {\n // If date functions are disabled or not applicable to the current field type\n if (!dateFunctions || !['date', 'datetime'].includes(fieldType)) {\n return [];\n }\n\n return [\n // Date functions applicable for the given field type\n ...dateFunctions[fieldType === 'date' ? 'DATE_ONLY' : 'DATE_TIME'].map(f => ({\n key: f,\n dateFunction: f,\n label: translate(dateFunctionLabels[f])\n })),\n\n // Option for grouping directly by the field values\n // The key 'NONE' is needed to work with the Select component\n { key: 'NONE', dateFunction: undefined, label: 'Default' }\n ];\n }, [dateFunctions, fieldType, translate]);\n\n // Skip if no options are available\n // i.e. date functions are disabled or not applicable to current field type\n if (allOptions.length === 0) {\n return null;\n }\n\n // NOTE: Doing it this way to preserve the order of options.\n // If we instead appended `group.dateFunction` to `available`, the order or options will change on further selections.\n const { available } = groupingOptions.dateFuncs[group.columnId];\n const optionsToUse = allOptions.filter(\n o => available.includes(o.dateFunction) || o.dateFunction === group.dateFunction\n );\n\n return (\n <StyledDateFuncWrapper>\n <Select\n label='Date function'\n labelHidden\n data-testid='GroupingDateFuncSelector'\n value={group.dateFunction || 'NONE'} // Can't set up `undefined` as value\n onChange={e => onChange(e.target.value === 'NONE' ? undefined : e.target.value)}\n >\n {optionsToUse.map(o => (\n <Option key={o.key} value={o.key}>\n {o.label}\n </Option>\n ))}\n </Select>\n </StyledDateFuncWrapper>\n );\n};\nDateFunctionSelector.propTypes = {\n group: PropTypes.objectOf(PropTypes.any).isRequired,\n dateFunctions: PropTypes.objectOf(PropTypes.any),\n groupingOptions: PropTypes.objectOf(PropTypes.any).isRequired,\n columns: PropTypes.arrayOf(PropTypes.any).isRequired,\n onChange: PropTypes.func.isRequired\n};\nDateFunctionSelector.defaultProps = { dateFunctions: undefined };\n\nexport default DateFunctionSelector;\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
import type { Group } from 'pega-repeating-structures-core/types/State.types';
|
|
3
|
+
import type { GroupingOptions } from '../../Grouping.types';
|
|
4
|
+
import type { AppliedGroup } from './useGroup';
|
|
5
|
+
interface GroupRendererProps {
|
|
6
|
+
appliedGroups: AppliedGroup[];
|
|
7
|
+
groupingOptions: GroupingOptions;
|
|
8
|
+
setGroups: (groups: (Group | {
|
|
9
|
+
id: string;
|
|
10
|
+
})[]) => void;
|
|
11
|
+
columns: RsCoreTypes.Column[];
|
|
12
|
+
dateFunctions: RsCoreTypes.Meta['dateFunctions'];
|
|
13
|
+
}
|
|
14
|
+
declare const GroupRenderer: ({ appliedGroups, groupingOptions, setGroups, columns, dateFunctions }: GroupRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default GroupRenderer;
|
|
16
|
+
//# sourceMappingURL=GroupRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupRenderer.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/GroupRenderer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AAK9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAS/C,UAAU,kBAAkB;IAC1B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IACxD,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IAC9B,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;CAClD;AACD,QAAA,MAAM,aAAa,0EAMhB,kBAAkB,4CAoLpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
4
|
+
import { Button, createUID, Flex, Icon, useI18n } from '@pega/cosmos-react-core';
|
|
5
|
+
import useRowFocus from '../useRowFocus';
|
|
6
|
+
import useDragDrop from '../../../../Hooks/useDragDrop';
|
|
7
|
+
import FieldSelector from '../../FieldSelector';
|
|
8
|
+
import { getFieldType } from './utils';
|
|
9
|
+
import DateFunctionSelector from './DateFunctionSelector';
|
|
10
|
+
const DropSelector = '[data-drop]';
|
|
11
|
+
const StyledRow = styled.div `
|
|
12
|
+
.remove-group {
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
const GroupRenderer = ({ appliedGroups, groupingOptions, setGroups, columns, dateFunctions }) => {
|
|
17
|
+
const t = useI18n();
|
|
18
|
+
const { focusRowRef, focusRowId, setFocusRowId } = useRowFocus();
|
|
19
|
+
const dragDropRef = useRef(null);
|
|
20
|
+
const getAnimationSelector = useCallback((target) => target.closest(DropSelector), []);
|
|
21
|
+
const onDrop = useCallback((dest, src) => {
|
|
22
|
+
const dropIndex = Number(dest.getAttribute('data-index'));
|
|
23
|
+
const dragIndex = Number(src.getAttribute('data-index'));
|
|
24
|
+
if (dragIndex !== dropIndex) {
|
|
25
|
+
const existingGroups = appliedGroups.map(v => ({ ...v }));
|
|
26
|
+
const dragGroup = existingGroups.splice(dragIndex, 1)[0];
|
|
27
|
+
existingGroups.splice(dropIndex, 0, dragGroup);
|
|
28
|
+
setGroups(existingGroups);
|
|
29
|
+
}
|
|
30
|
+
}, [appliedGroups, setGroups]);
|
|
31
|
+
const { dragProps, dropProps } = useDragDrop({
|
|
32
|
+
context: dragDropRef,
|
|
33
|
+
getAnimationSelector,
|
|
34
|
+
getGhostImageSelector: getAnimationSelector,
|
|
35
|
+
getDraggedObject: getAnimationSelector,
|
|
36
|
+
onDrop
|
|
37
|
+
});
|
|
38
|
+
const removeGroup = useCallback((index) => {
|
|
39
|
+
const existingGroups = appliedGroups.map(v => ({ ...v }));
|
|
40
|
+
existingGroups.splice(index, 1);
|
|
41
|
+
setGroups(existingGroups);
|
|
42
|
+
if (existingGroups.length > 0)
|
|
43
|
+
setFocusRowId(index === appliedGroups.length - 1
|
|
44
|
+
? existingGroups[index - 1].id
|
|
45
|
+
: existingGroups[index].id);
|
|
46
|
+
}, [appliedGroups, setGroups, setFocusRowId]);
|
|
47
|
+
const handleColumnChange = useCallback((group, index, newID) => {
|
|
48
|
+
if (newID === group.columnId)
|
|
49
|
+
return; // Ignore re-selecting the same
|
|
50
|
+
const updatedGroup = {
|
|
51
|
+
...group,
|
|
52
|
+
columnId: newID,
|
|
53
|
+
dateFunction: undefined // Reset for non-date/time fields
|
|
54
|
+
};
|
|
55
|
+
// For date/datetime field, pick a date function by default (if enabled)
|
|
56
|
+
const fieldType = getFieldType(newID, columns);
|
|
57
|
+
if (dateFunctions && (fieldType === 'date' || fieldType === 'datetime')) {
|
|
58
|
+
updatedGroup.dateFunction = groupingOptions.dateFuncs[newID]
|
|
59
|
+
? groupingOptions.dateFuncs[newID].available[0] // If the field is already picked before
|
|
60
|
+
: groupingOptions.dateGroupVariants[fieldType][0]; // When picking the field for the first time
|
|
61
|
+
}
|
|
62
|
+
setGroups([
|
|
63
|
+
...appliedGroups.slice(0, index),
|
|
64
|
+
updatedGroup,
|
|
65
|
+
...appliedGroups.slice(index + 1)
|
|
66
|
+
]);
|
|
67
|
+
}, [appliedGroups, groupingOptions, setGroups, dateFunctions, columns]);
|
|
68
|
+
const handleDateFuncChange = useCallback((group, index, newFunc) => {
|
|
69
|
+
if (newFunc === group.dateFunction)
|
|
70
|
+
return; // Ignore re-selecting the same
|
|
71
|
+
const updatedGroup = { ...group, dateFunction: newFunc };
|
|
72
|
+
setGroups([
|
|
73
|
+
...appliedGroups.slice(0, index),
|
|
74
|
+
updatedGroup,
|
|
75
|
+
...appliedGroups.slice(index + 1)
|
|
76
|
+
]);
|
|
77
|
+
}, [setGroups, appliedGroups]);
|
|
78
|
+
const addRow = useCallback(() => {
|
|
79
|
+
const newRow = { id: createUID(), columnId: '', order: 'asc' };
|
|
80
|
+
const existingGroups = [...appliedGroups, newRow];
|
|
81
|
+
setGroups(existingGroups);
|
|
82
|
+
setFocusRowId(newRow.id);
|
|
83
|
+
}, [appliedGroups, setGroups, setFocusRowId]);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!appliedGroups.length) {
|
|
86
|
+
addRow();
|
|
87
|
+
}
|
|
88
|
+
}, [appliedGroups, addRow]);
|
|
89
|
+
return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsx(Flex, { container: { direction: 'column', gap: 1 }, className: 'group-content', ref: dragDropRef, children: appliedGroups.map((group, index) => (_jsx(StyledRow, { children: _jsx("div", { ...dropProps, "data-index": index, children: _jsxs(Flex, { container: {
|
|
90
|
+
justify: 'between',
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
direction: 'row',
|
|
93
|
+
wrap: 'nowrap',
|
|
94
|
+
itemGap: 0.5
|
|
95
|
+
}, ref: appliedGroups[index].id === focusRowId ? focusRowRef : null, children: [_jsx(Flex, { item: { grow: 1 }, children: _jsxs(Flex, { container: {
|
|
96
|
+
justify: 'start',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
direction: 'row',
|
|
99
|
+
wrap: 'nowrap',
|
|
100
|
+
itemGap: 0.5
|
|
101
|
+
}, children: [_jsx("div", { ...dragProps, children: _jsx(Icon, { name: 'drag' }) }), _jsx(Flex, { item: { grow: 1 }, children: _jsx(FieldSelector, { columns: columns?.filter(c => c.field.grouping &&
|
|
102
|
+
(c.field.id.toString() === group.columnId.toString() ||
|
|
103
|
+
!groupingOptions.exhaustedFields.has(c.field.id))), value: group.columnId, disabled: !!group.customFunction, onChange: (newID) => handleColumnChange(group, index, newID), fieldProp: 'id' }) }), _jsx(DateFunctionSelector, { group: group, groupingOptions: groupingOptions, dateFunctions: dateFunctions, columns: columns, onChange: (newFunc) => handleDateFuncChange(group, index, newFunc) })] }) }), _jsx(Button, { "aria-label": t('delete_group'), icon: true, variant: 'simple', className: 'remove-group', onClick: () => removeGroup(index), children: _jsx(Icon, { name: 'trash' }) })] }) }) }, group.id))) }), _jsx("div", { children: _jsx(Button, { variant: 'link', "aria-label": t('add_group'), onClick: addRow, children: _jsxs(Flex, { container: {
|
|
104
|
+
inline: true,
|
|
105
|
+
alignItems: 'start',
|
|
106
|
+
gap: 1
|
|
107
|
+
}, as: 'span', children: [_jsx(Icon, { name: 'plus' }), _jsx("span", { children: t('add') })] }) }) })] }, 'grouping'));
|
|
108
|
+
};
|
|
109
|
+
export default GroupRenderer;
|
|
110
|
+
//# sourceMappingURL=GroupRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupRenderer.js","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/GroupRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAIjF,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,WAAW,MAAM,+BAA+B,CAAC;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAG1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E,MAAC,IAAI,IACH,SAAS,EAAE;4BACT,MAAM,EAAE,IAAI;4BACZ,UAAU,EAAE,OAAO;4BACnB,GAAG,EAAE,CAAC;yBACP,EACD,EAAE,EAAC,MAAM,aAET,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,EACpB,yBAAO,CAAC,CAAC,KAAK,CAAC,GAAQ,IAClB,GACA,GACL,KAjF8C,UAAU,CAkFzD,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import styled from 'styled-components';\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport { Button, createUID, Flex, Icon, useI18n } from '@pega/cosmos-react-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { Group } from 'pega-repeating-structures-core/types/State.types';\n\nimport useRowFocus from '../useRowFocus';\nimport useDragDrop from '../../../../Hooks/useDragDrop';\nimport FieldSelector from '../../FieldSelector';\nimport type { GroupingOptions } from '../../Grouping.types';\n\nimport { getFieldType } from './utils';\nimport DateFunctionSelector from './DateFunctionSelector';\nimport type { AppliedGroup } from './useGroup';\n\nconst DropSelector = '[data-drop]';\nconst StyledRow = styled.div`\n .remove-group {\n cursor: pointer;\n }\n`;\n\ninterface GroupRendererProps {\n appliedGroups: AppliedGroup[];\n groupingOptions: GroupingOptions;\n setGroups: (groups: (Group | { id: string })[]) => void;\n columns: RsCoreTypes.Column[];\n dateFunctions: RsCoreTypes.Meta['dateFunctions'];\n}\nconst GroupRenderer = ({\n appliedGroups,\n groupingOptions,\n setGroups,\n columns,\n dateFunctions\n}: GroupRendererProps) => {\n const t = useI18n();\n const { focusRowRef, focusRowId, setFocusRowId } = useRowFocus();\n\n const dragDropRef = useRef<HTMLDivElement>(null);\n const getAnimationSelector = useCallback((target: Element) => target.closest(DropSelector), []);\n const onDrop = useCallback(\n (dest: Element, src: Element) => {\n const dropIndex = Number(dest.getAttribute('data-index'));\n const dragIndex = Number(src.getAttribute('data-index'));\n if (dragIndex !== dropIndex) {\n const existingGroups = appliedGroups.map(v => ({ ...v }));\n const dragGroup = existingGroups.splice(dragIndex, 1)[0];\n existingGroups.splice(dropIndex, 0, dragGroup);\n setGroups(existingGroups);\n }\n },\n [appliedGroups, setGroups]\n );\n const { dragProps, dropProps } = useDragDrop({\n context: dragDropRef,\n getAnimationSelector,\n getGhostImageSelector: getAnimationSelector,\n getDraggedObject: getAnimationSelector,\n onDrop\n });\n\n const removeGroup = useCallback(\n (index: number) => {\n const existingGroups = appliedGroups.map(v => ({ ...v }));\n existingGroups.splice(index, 1);\n setGroups(existingGroups);\n\n if (existingGroups.length > 0)\n setFocusRowId(\n index === appliedGroups.length - 1\n ? existingGroups[index - 1].id\n : existingGroups[index].id\n );\n },\n [appliedGroups, setGroups, setFocusRowId]\n );\n\n const handleColumnChange = useCallback(\n (group: Group, index: number, newID: string) => {\n if (newID === group.columnId) return; // Ignore re-selecting the same\n const updatedGroup: Group = {\n ...group,\n columnId: newID,\n dateFunction: undefined // Reset for non-date/time fields\n };\n\n // For date/datetime field, pick a date function by default (if enabled)\n const fieldType = getFieldType(newID, columns);\n if (dateFunctions && (fieldType === 'date' || fieldType === 'datetime')) {\n updatedGroup.dateFunction = groupingOptions.dateFuncs[newID]\n ? groupingOptions.dateFuncs[newID].available[0] // If the field is already picked before\n : groupingOptions.dateGroupVariants[fieldType][0]; // When picking the field for the first time\n }\n\n setGroups([\n ...appliedGroups.slice(0, index),\n updatedGroup,\n ...appliedGroups.slice(index + 1)\n ]);\n },\n [appliedGroups, groupingOptions, setGroups, dateFunctions, columns]\n );\n\n const handleDateFuncChange = useCallback(\n (group: Group, index: number, newFunc: Group['dateFunction']) => {\n if (newFunc === group.dateFunction) return; // Ignore re-selecting the same\n const updatedGroup = { ...group, dateFunction: newFunc };\n setGroups([\n ...appliedGroups.slice(0, index),\n updatedGroup,\n ...appliedGroups.slice(index + 1)\n ]);\n },\n [setGroups, appliedGroups]\n );\n\n const addRow = useCallback(() => {\n const newRow = { id: createUID(), columnId: '', order: 'asc' };\n const existingGroups = [...appliedGroups, newRow];\n setGroups(existingGroups);\n setFocusRowId(newRow.id);\n }, [appliedGroups, setGroups, setFocusRowId]);\n\n useEffect(() => {\n if (!appliedGroups.length) {\n addRow();\n }\n }, [appliedGroups, addRow]);\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }} key='grouping'>\n <Flex container={{ direction: 'column', gap: 1 }} className='group-content' ref={dragDropRef}>\n {appliedGroups.map((group, index) => (\n <StyledRow key={group.id}>\n <div {...dropProps} data-index={index}>\n <Flex\n container={{\n justify: 'between',\n alignItems: 'center',\n direction: 'row',\n wrap: 'nowrap',\n itemGap: 0.5\n }}\n ref={appliedGroups[index].id === focusRowId ? focusRowRef : null}\n >\n <Flex item={{ grow: 1 }}>\n <Flex\n container={{\n justify: 'start',\n alignItems: 'center',\n direction: 'row',\n wrap: 'nowrap',\n itemGap: 0.5\n }}\n >\n <div {...dragProps}>\n <Icon name='drag' />\n </div>\n <Flex item={{ grow: 1 }}>\n <FieldSelector\n columns={columns?.filter(\n c =>\n c.field.grouping &&\n (c.field.id.toString() === group.columnId.toString() ||\n !groupingOptions.exhaustedFields.has(c.field.id))\n )}\n value={group.columnId}\n disabled={!!group.customFunction}\n onChange={(newID: string) => handleColumnChange(group, index, newID)}\n fieldProp='id'\n />\n </Flex>\n <DateFunctionSelector\n group={group}\n groupingOptions={groupingOptions}\n dateFunctions={dateFunctions}\n columns={columns}\n onChange={(newFunc: Group['dateFunction']) =>\n handleDateFuncChange(group, index, newFunc)\n }\n />\n </Flex>\n </Flex>\n <Button\n aria-label={t('delete_group')}\n icon\n variant='simple'\n className='remove-group'\n onClick={() => removeGroup(index)}\n >\n <Icon name='trash' />\n </Button>\n </Flex>\n </div>\n </StyledRow>\n ))}\n </Flex>\n <div>\n <Button variant='link' aria-label={t('add_group')} onClick={addRow}>\n <Flex\n container={{\n inline: true,\n alignItems: 'start',\n gap: 1\n }}\n as='span'\n >\n <Icon name='plus' />\n <span>{t('add')}</span>\n </Flex>\n </Button>\n </div>\n </Flex>\n );\n};\n\nexport default GroupRenderer;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ListToolbarProps } from '@pega/cosmos-react-core';
|
|
2
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
3
|
+
import type { Group } from 'pega-repeating-structures-core/types/State.types';
|
|
4
|
+
export interface AppliedGroup extends Group {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
declare const useGroup: ({ view }: {
|
|
8
|
+
view: RsCoreTypes.View;
|
|
9
|
+
}) => ListToolbarProps["group"];
|
|
10
|
+
export default useGroup;
|
|
11
|
+
//# sourceMappingURL=useGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGroup.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/useGroup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,gBAAgB,EAAe,MAAM,yBAAyB,CAAC;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AAQ9E,MAAM,WAAW,YAAa,SAAQ,KAAK;IACzC,EAAE,EAAE,MAAM,CAAC;CACZ;AAKD,QAAA,MAAM,QAAQ,aAAc;IAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAA;CAAE,KAAG,gBAAgB,CAAC,OAAO,CAsFhF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { createUID, usePrevious } from '@pega/cosmos-react-core';
|
|
3
|
+
import { TOOLBAR_FEATURES } from '../../../../constants';
|
|
4
|
+
import { deepEqual } from '../../../../Utils';
|
|
5
|
+
import { getGroupingOptions } from './utils';
|
|
6
|
+
import GroupRenderer from './GroupRenderer';
|
|
7
|
+
const convertGroupsToAppliedGroups = (groups) => groups.map(group => ({ ...group, id: createUID() }));
|
|
8
|
+
const useGroup = ({ view }) => {
|
|
9
|
+
const { state: { groups = [] } = {}, meta: { grouping, dateFunctions }, type: { applyGrouping }, columns = [] } = view;
|
|
10
|
+
const displayGrouping = view.shouldDisplayFeature(TOOLBAR_FEATURES.GROUPING);
|
|
11
|
+
const [appliedGroups, setAppliedGroups] = useState([]);
|
|
12
|
+
const [groupingOptions, setGroupingOptions] = useState(() => getGroupingOptions(groups, columns, dateFunctions));
|
|
13
|
+
const setGroups = useCallback((newGroups) => {
|
|
14
|
+
setAppliedGroups(newGroups);
|
|
15
|
+
setGroupingOptions(getGroupingOptions(newGroups, columns, dateFunctions));
|
|
16
|
+
}, [columns, dateFunctions]);
|
|
17
|
+
// BUG-758989 This useEffect should run only once when the columns are populated on view
|
|
18
|
+
// as getGroupingOptions function has dependency on column to form dateFunc object
|
|
19
|
+
const prevColumns = usePrevious(columns);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!columns || !prevColumns)
|
|
22
|
+
return;
|
|
23
|
+
if (columns.length !== prevColumns.length) {
|
|
24
|
+
setGroupingOptions(getGroupingOptions(appliedGroups, columns, dateFunctions));
|
|
25
|
+
}
|
|
26
|
+
}, [columns]);
|
|
27
|
+
const onSubmit = useCallback(() => {
|
|
28
|
+
const groupsToSet = appliedGroups
|
|
29
|
+
.filter(e => e.columnId)
|
|
30
|
+
.map((group, index) => {
|
|
31
|
+
const { id, ...rest } = group;
|
|
32
|
+
return { ...rest, level: index };
|
|
33
|
+
});
|
|
34
|
+
applyGrouping(groupsToSet);
|
|
35
|
+
}, [applyGrouping, setGroups, appliedGroups]);
|
|
36
|
+
const onCancel = useCallback(() => {
|
|
37
|
+
setGroups(convertGroupsToAppliedGroups(groups));
|
|
38
|
+
}, [groups, setGroups]);
|
|
39
|
+
/*
|
|
40
|
+
* The usePrevious hook is used in conjunction with the effect below...
|
|
41
|
+
* ...to determine if the groups prop has in essence changed in value as it is always referentially different [] === [] // false.
|
|
42
|
+
* This workaround is necessary to render proper state within the group popover content.
|
|
43
|
+
* The conditional logic avoids many excessive renders.
|
|
44
|
+
* The overall hook/grouping implementation may be able to be modified to avoid this.
|
|
45
|
+
*/
|
|
46
|
+
const prevGroups = usePrevious(groups);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!view.columns)
|
|
49
|
+
return;
|
|
50
|
+
if (!groups || !prevGroups || !deepEqual(groups, prevGroups)) {
|
|
51
|
+
setGroups(convertGroupsToAppliedGroups(groups));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// This is obviously not extensive comparison but may be effective enough for the group object type. Enhance as needed.
|
|
55
|
+
const groupsChanged = groups.length !== prevGroups.length ||
|
|
56
|
+
groups.some((group, i) => group.columnId !== prevGroups[i].columnId ||
|
|
57
|
+
group.order !== prevGroups[i].order ||
|
|
58
|
+
!deepEqual(group.dateFunction, prevGroups[i].dateFunction) ||
|
|
59
|
+
!deepEqual(group.customFunction, prevGroups[i].customFunction));
|
|
60
|
+
if (groupsChanged) {
|
|
61
|
+
setGroups(convertGroupsToAppliedGroups(groups));
|
|
62
|
+
}
|
|
63
|
+
}, [groups, prevGroups, setGroups, view.columns]);
|
|
64
|
+
if (!grouping || view.hierarchicalGroupEnabled || !displayGrouping)
|
|
65
|
+
return;
|
|
66
|
+
return {
|
|
67
|
+
count: groups.length > 0 ? groups.length : undefined,
|
|
68
|
+
renderer: GroupRenderer,
|
|
69
|
+
rendererProps: { appliedGroups, columns, dateFunctions, groupingOptions, setGroups },
|
|
70
|
+
onSubmit,
|
|
71
|
+
onCancel
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export default useGroup;
|
|
75
|
+
//# sourceMappingURL=useGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGroup.js","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/useGroup.ts"],"names":[],"mappings":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Q;KACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { createUID, type ListToolbarProps, usePrevious } from '@pega/cosmos-react-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { Group } from 'pega-repeating-structures-core/types/State.types';\n\nimport { TOOLBAR_FEATURES } from '../../../../constants';\nimport { deepEqual } from '../../../../Utils';\n\nimport { getGroupingOptions } from './utils';\nimport GroupRenderer from './GroupRenderer';\n\nexport interface AppliedGroup extends Group {\n id: string;\n}\n\nconst convertGroupsToAppliedGroups = (groups: Group[]) =>\n groups.map(group => ({ ...group, id: createUID() }));\n\nconst useGroup = ({ view }: { view: RsCoreTypes.View }): ListToolbarProps['group'] => {\n const {\n state: { groups = [] } = {},\n meta: { grouping, dateFunctions },\n type: { applyGrouping },\n columns = []\n } = view;\n\n const displayGrouping = view.shouldDisplayFeature(TOOLBAR_FEATURES.GROUPING);\n const [appliedGroups, setAppliedGroups] = useState<AppliedGroup[]>([]);\n const [groupingOptions, setGroupingOptions] = useState(() =>\n getGroupingOptions(groups, columns, dateFunctions)\n );\n\n const setGroups = useCallback(\n (newGroups: AppliedGroup[]) => {\n setAppliedGroups(newGroups);\n setGroupingOptions(getGroupingOptions(newGroups, columns, dateFunctions));\n },\n [columns, dateFunctions]\n );\n\n // BUG-758989 This useEffect should run only once when the columns are populated on view\n // as getGroupingOptions function has dependency on column to form dateFunc object\n const prevColumns = usePrevious(columns);\n useEffect(() => {\n if (!columns || !prevColumns) return;\n if (columns.length !== prevColumns.length) {\n setGroupingOptions(getGroupingOptions(appliedGroups, columns, dateFunctions));\n }\n }, [columns]);\n\n const onSubmit = useCallback(() => {\n const groupsToSet = appliedGroups\n .filter(e => e.columnId)\n .map((group, index) => {\n const { id, ...rest } = group;\n return { ...rest, level: index };\n });\n applyGrouping(groupsToSet);\n }, [applyGrouping, setGroups, appliedGroups]);\n\n const onCancel = useCallback(() => {\n setGroups(convertGroupsToAppliedGroups(groups));\n }, [groups, setGroups]);\n\n /*\n * The usePrevious hook is used in conjunction with the effect below...\n * ...to determine if the groups prop has in essence changed in value as it is always referentially different [] === [] // false.\n * This workaround is necessary to render proper state within the group popover content.\n * The conditional logic avoids many excessive renders.\n * The overall hook/grouping implementation may be able to be modified to avoid this.\n */\n const prevGroups = usePrevious(groups);\n useEffect(() => {\n if (!view.columns) return;\n if (!groups || !prevGroups || !deepEqual(groups, prevGroups)) {\n setGroups(convertGroupsToAppliedGroups(groups));\n return;\n }\n\n // This is obviously not extensive comparison but may be effective enough for the group object type. Enhance as needed.\n const groupsChanged =\n groups.length !== prevGroups.length ||\n groups.some(\n (group, i) =>\n group.columnId !== prevGroups[i].columnId ||\n group.order !== prevGroups[i].order ||\n !deepEqual(group.dateFunction, prevGroups[i].dateFunction) ||\n !deepEqual(group.customFunction, prevGroups[i].customFunction)\n );\n\n if (groupsChanged) {\n setGroups(convertGroupsToAppliedGroups(groups));\n }\n }, [groups, prevGroups, setGroups, view.columns]);\n\n if (!grouping || view.hierarchicalGroupEnabled || !displayGrouping) return;\n\n return {\n count: groups.length > 0 ? groups.length : undefined,\n renderer: GroupRenderer,\n rendererProps: { appliedGroups, columns, dateFunctions, groupingOptions, setGroups },\n onSubmit,\n onCancel\n };\n};\n\nexport default useGroup;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
import type { Group } from 'pega-repeating-structures-core/types/State.types';
|
|
3
|
+
import type { GroupingOptions } from '../../Grouping.types';
|
|
4
|
+
/**
|
|
5
|
+
* Finds the matching column for the given columnId and returns its field type.
|
|
6
|
+
* Returns `undefined` if no match found
|
|
7
|
+
*/
|
|
8
|
+
export declare function getFieldType(columnId: Group['columnId'], columns: RsCoreTypes.Column[]): "number" | "boolean" | "text" | "time" | "action" | "date" | "currency" | "datetime" | "custom" | "URL" | "Date" | "Date only" | undefined;
|
|
9
|
+
/** Returns metadata to identify which fields and which date functions are/aren't available for selection */
|
|
10
|
+
export declare function getGroupingOptions(groups: Group[], columns: RsCoreTypes.Column[], dateFunctions: RsCoreTypes.Meta['dateFunctions']): GroupingOptions;
|
|
11
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AAE9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,8IAEtF;AAED,4GAA4G;AAC5G,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,KAAK,EAAE,EACf,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,EAC7B,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,GAC/C,eAAe,CA2DjB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds the matching column for the given columnId and returns its field type.
|
|
3
|
+
* Returns `undefined` if no match found
|
|
4
|
+
*/
|
|
5
|
+
export function getFieldType(columnId, columns) {
|
|
6
|
+
return columns.find(c => c.field.id.toString() === columnId.toString())?.field.type;
|
|
7
|
+
}
|
|
8
|
+
/** Returns metadata to identify which fields and which date functions are/aren't available for selection */
|
|
9
|
+
export function getGroupingOptions(groups, columns, dateFunctions) {
|
|
10
|
+
const groupingOptions = {
|
|
11
|
+
// Set of fields that are already exhausted in grouping
|
|
12
|
+
// NOTE: For date/datetime fields, when dateFunctions are enabled, it doesn't mark a field as exhausted until all the date-function variants are used against that field
|
|
13
|
+
exhaustedFields: new Set(),
|
|
14
|
+
// Contains field-wise lookups with values of structure { exhausted, available }
|
|
15
|
+
dateFuncs: {},
|
|
16
|
+
// Possible `dateFunction` choices by field type
|
|
17
|
+
dateGroupVariants: {
|
|
18
|
+
date: [],
|
|
19
|
+
datetime: []
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
// Traverse all the groups and mark which all fields and date functions are exhausted already
|
|
23
|
+
groups.forEach(({ columnId, dateFunction }) => {
|
|
24
|
+
if (columnId === '')
|
|
25
|
+
return; // Ignore empty groups
|
|
26
|
+
const fieldType = getFieldType(columnId, columns);
|
|
27
|
+
// If date functions are enabled, and it's a date/datetime field, track the functions used
|
|
28
|
+
if (dateFunctions && (fieldType === 'date' || fieldType === 'datetime')) {
|
|
29
|
+
groupingOptions.dateFuncs[columnId] = groupingOptions.dateFuncs[columnId] || {
|
|
30
|
+
exhausted: [],
|
|
31
|
+
available: []
|
|
32
|
+
};
|
|
33
|
+
groupingOptions.dateFuncs[columnId].exhausted.push(dateFunction); // `dateFunction` could be undefined
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Otherwise, simply mark the columns as exhausted
|
|
37
|
+
groupingOptions.exhaustedFields.add(columnId);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
// When dateFunctions are enabled, determine which date/datetime fields are fully exhausted and also note which functions are available for each field
|
|
41
|
+
if (dateFunctions) {
|
|
42
|
+
// Identify all possible variants for a given field type
|
|
43
|
+
// The `undefined` variant is applied when we group data directly by a field's values without any date function
|
|
44
|
+
groupingOptions.dateGroupVariants = {
|
|
45
|
+
date: [...dateFunctions.DATE_ONLY, undefined],
|
|
46
|
+
datetime: [...dateFunctions.DATE_TIME, undefined]
|
|
47
|
+
};
|
|
48
|
+
// For each date/datetime field, set up which variants are yet to be used. Also determine if all the variants are exhausted
|
|
49
|
+
Object.entries(groupingOptions.dateFuncs).forEach(([columnId, obj]) => {
|
|
50
|
+
const fieldType = getFieldType(columnId, columns);
|
|
51
|
+
if (fieldType === 'date' || fieldType === 'datetime') {
|
|
52
|
+
obj.available = groupingOptions.dateGroupVariants[fieldType].filter(v => !obj.exhausted.includes(v));
|
|
53
|
+
}
|
|
54
|
+
if (obj.available.length === 0) {
|
|
55
|
+
groupingOptions.exhaustedFields.add(columnId);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return groupingOptions;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useGroup/utils.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,QAA2B,EAAE,OAA6B;IACrF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC;AACtF,CAAC;AAED,4GAA4G;AAC5G,MAAM,UAAU,kBAAkB,CAChC,MAAe,EACf,OAA6B,EAC7B,aAAgD;IAEhD,MAAM,eAAe,GAAoB;QACvC,uDAAuD;QACvD,wKAAwK;QACxK,eAAe,EAAE,IAAI,GAAG,EAAE;QAE1B,gFAAgF;QAChF,SAAS,EAAE,EAAE;QAEb,gDAAgD;QAChD,iBAAiB,EAAE;YACjB,IAAI,EAAE,EAAE;YACR,QAAQ,EAAE,EAAE;SACb;KACF,CAAC;IAEF,6FAA6F;IAC7F,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE;QAC5C,IAAI,QAAQ,KAAK,EAAE;YAAE,OAAO,CAAC,sBAAsB;QACnD,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAA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AG,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC/B,eAAe,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAChD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { Group } from 'pega-repeating-structures-core/types/State.types';\n\nimport type { GroupingOptions } from '../../Grouping.types';\n\n/**\n * Finds the matching column for the given columnId and returns its field type.\n * Returns `undefined` if no match found\n */\nexport function getFieldType(columnId: Group['columnId'], columns: RsCoreTypes.Column[]) {\n return columns.find(c => c.field.id.toString() === columnId.toString())?.field.type;\n}\n\n/** Returns metadata to identify which fields and which date functions are/aren't available for selection */\nexport function getGroupingOptions(\n groups: Group[],\n columns: RsCoreTypes.Column[],\n dateFunctions: RsCoreTypes.Meta['dateFunctions']\n): GroupingOptions {\n const groupingOptions: GroupingOptions = {\n // Set of fields that are already exhausted in grouping\n // NOTE: For date/datetime fields, when dateFunctions are enabled, it doesn't mark a field as exhausted until all the date-function variants are used against that field\n exhaustedFields: new Set(),\n\n // Contains field-wise lookups with values of structure { exhausted, available }\n dateFuncs: {},\n\n // Possible `dateFunction` choices by field type\n dateGroupVariants: {\n date: [],\n datetime: []\n }\n };\n\n // Traverse all the groups and mark which all fields and date functions are exhausted already\n groups.forEach(({ columnId, dateFunction }) => {\n if (columnId === '') return; // Ignore empty groups\n const fieldType = getFieldType(columnId, columns);\n\n // If date functions are enabled, and it's a date/datetime field, track the functions used\n if (dateFunctions && (fieldType === 'date' || fieldType === 'datetime')) {\n groupingOptions.dateFuncs[columnId] = groupingOptions.dateFuncs[columnId] || {\n exhausted: [],\n available: []\n };\n groupingOptions.dateFuncs[columnId].exhausted.push(dateFunction); // `dateFunction` could be undefined\n } else {\n // Otherwise, simply mark the columns as exhausted\n groupingOptions.exhaustedFields.add(columnId);\n }\n });\n\n // When dateFunctions are enabled, determine which date/datetime fields are fully exhausted and also note which functions are available for each field\n if (dateFunctions) {\n // Identify all possible variants for a given field type\n // The `undefined` variant is applied when we group data directly by a field's values without any date function\n groupingOptions.dateGroupVariants = {\n date: [...dateFunctions.DATE_ONLY, undefined],\n datetime: [...dateFunctions.DATE_TIME, undefined]\n };\n\n // For each date/datetime field, set up which variants are yet to be used. Also determine if all the variants are exhausted\n Object.entries(groupingOptions.dateFuncs).forEach(([columnId, obj]) => {\n const fieldType = getFieldType(columnId, columns);\n if (fieldType === 'date' || fieldType === 'datetime') {\n obj.available = groupingOptions.dateGroupVariants[fieldType].filter(\n v => !obj.exhausted.includes(v)\n );\n }\n\n if (obj.available.length === 0) {\n groupingOptions.exhaustedFields.add(columnId);\n }\n });\n }\n\n return groupingOptions;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMore.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Toolbar/hooks/useMore.jsx"],"names":[],"mappings":";AA2CA;;;;;;EAkWC"}
|