@pega/lists-react 9.0.0-build.2.9 → 9.0.0-build.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -4
- package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts +10 -5
- package/lib/Core/Components/A11y/RepeatingStructureA11y.d.ts.map +1 -1
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js +27 -2
- package/lib/Core/Components/A11y/RepeatingStructureA11y.js.map +1 -1
- package/lib/Core/Components/AggregateMenu.d.ts +1 -0
- package/lib/Core/Components/AggregateMenu.d.ts.map +1 -1
- package/lib/Core/Components/AggregateMenu.js +32 -18
- package/lib/Core/Components/AggregateMenu.js.map +1 -1
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts +6 -15
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts.map +1 -1
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js +91 -163
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js.map +1 -1
- package/lib/Core/Components/ContextMenu/QuickFilter.js +7 -7
- package/lib/Core/Components/ContextMenu/QuickFilter.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/ColumnMergeTemplates/CustomCellWrapper.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js +9 -21
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowActionMenu.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.js +4 -3
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowDragDropHandle.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.js +4 -3
- package/lib/Core/Components/DefaultComponents/CellRenderers/RowError.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts +0 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js +0 -2
- package/lib/Core/Components/DefaultComponents/CellRenderers/index.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts +5 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js +12 -5
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts +3 -2
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js +13 -26
- package/lib/Core/Components/DefaultComponents/PersonalizationCreateEdit.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js +2 -2
- package/lib/Core/Components/DefaultComponents/PersonalizationDeleteConfirmation.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts +0 -2
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js +11 -9
- package/lib/Core/Components/DefaultComponents/PersonalizationSelector.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js +5 -0
- package/lib/Core/Components/DefaultComponents/SelectAllCheckbox.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts +5 -3
- package/lib/Core/Components/DefaultComponents/index.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.js +0 -2
- package/lib/Core/Components/DefaultComponents/index.js.map +1 -1
- package/lib/Core/Components/Filters/CommonFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/CommonFilter.js +2 -2
- package/lib/Core/Components/Filters/CommonFilter.js.map +1 -1
- package/lib/Core/Components/Filters/FilterType.js +5 -5
- package/lib/Core/Components/Filters/FilterType.js.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.d.ts.map +1 -1
- package/lib/Core/Components/Filters/SelectFilter.js +2 -2
- package/lib/Core/Components/Filters/SelectFilter.js.map +1 -1
- package/lib/Core/Components/Filters/styles.d.ts +1 -1
- package/lib/Core/Components/FooterAggregators.d.ts.map +1 -1
- package/lib/Core/Components/FooterAggregators.js +3 -2
- package/lib/Core/Components/FooterAggregators.js.map +1 -1
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts +12 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js +62 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js.map +1 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts +33 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js +106 -0
- package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js.map +1 -0
- package/lib/Core/Components/{GroupRenderer.d.ts → GroupRenderer/index.d.ts} +8 -1
- package/lib/Core/Components/GroupRenderer/index.d.ts.map +1 -0
- package/lib/Core/Components/GroupRenderer/index.js +367 -0
- package/lib/Core/Components/GroupRenderer/index.js.map +1 -0
- package/lib/Core/Components/Grouping/GroupingMenu.d.ts.map +1 -1
- package/lib/Core/Components/Grouping/GroupingMenu.js +6 -5
- package/lib/Core/Components/Grouping/GroupingMenu.js.map +1 -1
- package/lib/Core/Components/HeaderCell.d.ts.map +1 -1
- package/lib/Core/Components/HeaderCell.js +8 -5
- package/lib/Core/Components/HeaderCell.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/actions.js +3 -3
- package/lib/Core/Components/HeaderMenu/actions.js.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.d.ts.map +1 -1
- package/lib/Core/Components/HeaderMenu/index.js +2 -2
- package/lib/Core/Components/HeaderMenu/index.js.map +1 -1
- package/lib/Core/Components/NotificationManager.js +1 -1
- package/lib/Core/Components/NotificationManager.js.map +1 -1
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.d.ts.map +1 -1
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.js +2 -1
- package/lib/Core/Components/RSWrapper/HeaderBarGadget.js.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.d.ts.map +1 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js +2 -1
- package/lib/Core/Components/RenderingEngine/RenderCell.js.map +1 -1
- package/lib/Core/Components/TestIdConstants.d.ts +1 -0
- package/lib/Core/Components/TestIdConstants.js +2 -1
- package/lib/Core/Components/TestIdConstants.js.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js +9 -33
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.d.ts +1 -1
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.js +1 -1
- package/lib/Core/Components/Toolbar/AnnounceRowsCount.js.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts +20 -9
- package/lib/Core/Components/Toolbar/ColumnSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/ColumnSelector.js +89 -65
- package/lib/Core/Components/Toolbar/ColumnSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/DebugInfo.d.ts +3 -5
- package/lib/Core/Components/Toolbar/DebugInfo.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/DebugInfo.js +3 -3
- package/lib/Core/Components/Toolbar/DebugInfo.js.map +1 -1
- package/lib/Core/Components/Toolbar/FieldSelector.d.ts +1 -0
- package/lib/Core/Components/Toolbar/FieldSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/FieldSelector.js +3 -2
- package/lib/Core/Components/Toolbar/FieldSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/Grouping.types.d.ts +0 -6
- package/lib/Core/Components/Toolbar/Grouping.types.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/Grouping.types.js.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.js +4 -3
- package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts +14 -18
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js +15 -16
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts +2 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js +10 -7
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js +6 -3
- package/lib/Core/Components/Toolbar/hooks/useGroup/useGroup.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts +7 -2
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js +11 -3
- package/lib/Core/Components/Toolbar/hooks/useGroup/utils.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useMore.js +81 -79
- package/lib/Core/Components/Toolbar/hooks/useMore.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts +8 -6
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js +18 -3
- package/lib/Core/Components/Toolbar/hooks/usePersonalization.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSearch.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSearch.js +6 -9
- package/lib/Core/Components/Toolbar/hooks/useSearch.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts +4 -4
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js +6 -6
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts +2 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js +8 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/SortRenderer.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js +2 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts +6 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js +17 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js.map +1 -0
- package/lib/Core/Components/Toolbar/utils/utils.d.ts +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.js +2 -1
- package/lib/Core/Components/Toolbar/utils/utils.js.map +1 -1
- package/lib/Core/Components/Virtualise/Pagination.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/Pagination.js +2 -1
- package/lib/Core/Components/Virtualise/Pagination.js.map +1 -1
- package/lib/Core/Components/Virtualise/UseScroll.d.ts +4 -1
- package/lib/Core/Components/Virtualise/UseScroll.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/UseScroll.js +16 -3
- package/lib/Core/Components/Virtualise/UseScroll.js.map +1 -1
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.d.ts +97 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js +251 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.d.ts +22 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.js +38 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.d.ts +22 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.js +45 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.d.ts +49 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.js +55 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.d.ts +21 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.js +39 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.d.ts +38 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.js +62 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts +112 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js +214 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js.map +1 -0
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js +21 -8
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -1
- package/lib/Core/Components/Virtualise/index.js +21 -13
- package/lib/Core/Components/Virtualise/index.js.map +1 -1
- package/lib/Core/Components/Virtualise/utility.d.ts +1 -1
- package/lib/Core/Components/Virtualise/utility.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/utility.js +3 -2
- package/lib/Core/Components/Virtualise/utility.js.map +1 -1
- package/lib/Core/Context/LocalizationContext.d.ts +1 -1
- package/lib/Core/Context/LocalizationContext.d.ts.map +1 -1
- package/lib/Core/Context/LocalizationContext.js.map +1 -1
- package/lib/Core/Hooks/a11y/useAnnounce.d.ts +19 -0
- package/lib/Core/Hooks/a11y/useAnnounce.d.ts.map +1 -0
- package/lib/Core/Hooks/a11y/useAnnounce.js +49 -0
- package/lib/Core/Hooks/a11y/useAnnounce.js.map +1 -0
- package/lib/Core/Hooks/useDragDrop.d.ts.map +1 -1
- package/lib/Core/Hooks/useDragDrop.js +2 -0
- package/lib/Core/Hooks/useDragDrop.js.map +1 -1
- package/lib/Core/Hooks/useRepeat.d.ts.map +1 -1
- package/lib/Core/Hooks/useRepeat.js +20 -1
- package/lib/Core/Hooks/useRepeat.js.map +1 -1
- package/lib/Core/Localization/defaultTranslations.d.ts +16 -13
- package/lib/Core/Localization/defaultTranslations.d.ts.map +1 -1
- package/lib/Core/Localization/defaultTranslations.js +17 -14
- package/lib/Core/Localization/defaultTranslations.js.map +1 -1
- package/lib/Core/Test/JUnitMocks.d.ts +6 -617
- package/lib/Core/Test/JUnitMocks.d.ts.map +1 -1
- package/lib/Core/Test/JUnitMocks.js +5 -4
- package/lib/Core/Test/JUnitMocks.js.map +1 -1
- package/lib/Core/Utils/index.d.ts +11 -0
- package/lib/Core/Utils/index.d.ts.map +1 -1
- package/lib/Core/Utils/index.js +22 -8
- package/lib/Core/Utils/index.js.map +1 -1
- package/lib/Core/Utils/styles.d.ts +2 -2
- package/lib/Core/Utils/styles.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts +4 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.js +18 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js +25 -0
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts +8 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.js +15 -0
- package/lib/Core/Views/Gallery/Components/GalleryHeader.js.map +1 -0
- package/lib/Core/Views/Gallery/Gallery.types.d.ts +8 -0
- package/lib/Core/Views/Gallery/Gallery.types.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/Gallery.types.js +2 -0
- package/lib/Core/Views/Gallery/Gallery.types.js.map +1 -0
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts +13 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js +30 -40
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js.map +1 -1
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js +1 -1
- package/lib/Core/Views/Gallery/_tests_/Samples/GalleryA11ySample.js.map +1 -1
- package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts +9 -0
- package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/hooks/useRowActions.js +25 -0
- package/lib/Core/Views/Gallery/hooks/useRowActions.js.map +1 -0
- package/lib/Core/Views/Gallery/index.d.ts +4 -8
- package/lib/Core/Views/Gallery/index.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/index.js +22 -62
- package/lib/Core/Views/Gallery/index.js.map +1 -1
- package/lib/Core/Views/Gallery/utils.d.ts +36 -0
- package/lib/Core/Views/Gallery/utils.d.ts.map +1 -0
- package/lib/Core/Views/Gallery/utils.js +91 -0
- package/lib/Core/Views/Gallery/utils.js.map +1 -0
- package/lib/Core/Views/Map/Map.styles.d.ts +190 -6
- package/lib/Core/Views/Map/Map.styles.d.ts.map +1 -1
- package/lib/Core/Views/Map/Map.styles.js.map +1 -1
- package/lib/Core/Views/Map/index.d.ts.map +1 -1
- package/lib/Core/Views/Map/index.js +10 -4
- package/lib/Core/Views/Map/index.js.map +1 -1
- package/lib/Core/Views/RsCardWrapper.js.map +1 -1
- package/lib/Core/Views/Table/CellWrapper.d.ts +1 -1
- package/lib/Core/Views/Table/CellWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/CellWrapper.js +4 -2
- package/lib/Core/Views/Table/CellWrapper.js.map +1 -1
- package/lib/Core/Views/Table/HeaderWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/HeaderWrapper.js +5 -5
- package/lib/Core/Views/Table/HeaderWrapper.js.map +1 -1
- package/lib/Core/Views/Table/Row.d.ts +3 -1
- package/lib/Core/Views/Table/Row.d.ts.map +1 -1
- package/lib/Core/Views/Table/Row.js +5 -3
- package/lib/Core/Views/Table/Row.js.map +1 -1
- package/lib/Core/Views/Table/SkeletonRows.d.ts +1 -1
- package/lib/Core/Views/Table/SkeletonRows.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.d.ts +3 -1
- package/lib/Core/Views/Table/StyledTableContainer.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.js +269 -158
- package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -1
- package/lib/Core/Views/Table/TableA11y.d.ts +11 -0
- package/lib/Core/Views/Table/TableA11y.d.ts.map +1 -1
- package/lib/Core/Views/Table/TableA11y.js +207 -2
- package/lib/Core/Views/Table/TableA11y.js.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts +5 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.js +38 -15
- package/lib/Core/Views/Table/VirtualizeWrapper.js.map +1 -1
- package/lib/Core/Views/Table/index.d.ts.map +1 -1
- package/lib/Core/Views/Table/index.js +6 -4
- package/lib/Core/Views/Table/index.js.map +1 -1
- package/lib/Core/Views/Table/useCountChange.d.ts +10 -0
- package/lib/Core/Views/Table/useCountChange.d.ts.map +1 -0
- package/lib/Core/Views/Table/useCountChange.js +39 -0
- package/lib/Core/Views/Table/useCountChange.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.d.ts +5 -0
- package/lib/Core/Views/Timeline/Timeline.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.js +28 -0
- package/lib/Core/Views/Timeline/Timeline.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts +393 -0
- package/lib/Core/Views/Timeline/Timeline.styles.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.styles.js +175 -0
- package/lib/Core/Views/Timeline/Timeline.styles.js.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.types.d.ts +48 -0
- package/lib/Core/Views/Timeline/Timeline.types.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/Timeline.types.js +2 -0
- package/lib/Core/Views/Timeline/Timeline.types.js.map +1 -0
- package/lib/Core/Views/Timeline/TimelineItem.d.ts +12 -0
- package/lib/Core/Views/Timeline/TimelineItem.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/TimelineItem.js +43 -0
- package/lib/Core/Views/Timeline/TimelineItem.js.map +1 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts +4 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.js +141 -0
- package/lib/Core/Views/Timeline/__tests__/Timeline.mocks.js.map +1 -0
- package/lib/Core/Views/Timeline/index.d.ts.map +1 -1
- package/lib/Core/Views/Timeline/index.js +14 -8
- package/lib/Core/Views/Timeline/index.js.map +1 -1
- package/lib/Core/Views/Timeline/utils.d.ts +10 -0
- package/lib/Core/Views/Timeline/utils.d.ts.map +1 -0
- package/lib/Core/Views/Timeline/utils.js +144 -0
- package/lib/Core/Views/Timeline/utils.js.map +1 -0
- package/lib/Core/Views/rs-styles.d.ts +1 -1
- package/lib/Core/constants.d.ts.map +1 -1
- package/lib/Core/constants.js +1 -0
- package/lib/Core/constants.js.map +1 -1
- package/lib/Core/templateFeatureSupport.d.ts +17 -0
- package/lib/Core/templateFeatureSupport.d.ts.map +1 -0
- package/lib/Core/templateFeatureSupport.js +30 -0
- package/lib/Core/templateFeatureSupport.js.map +1 -0
- package/lib/types.d.ts +2 -0
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +11 -12
- package/lib/Core/Components/DefaultComponents/CardItem.d.ts +0 -3
- package/lib/Core/Components/DefaultComponents/CardItem.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CardItem.js +0 -78
- package/lib/Core/Components/DefaultComponents/CardItem.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts +0 -12
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js +0 -35
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/DateTime.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts +0 -15
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js +0 -49
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/Radio.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts +0 -12
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js +0 -44
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/TextInput.js.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts +0 -16
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.d.ts.map +0 -1
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js +0 -63
- package/lib/Core/Components/DefaultComponents/CellRenderers/EditComponents/index.js.map +0 -1
- package/lib/Core/Components/EmptyContainer.d.ts +0 -5
- package/lib/Core/Components/EmptyContainer.d.ts.map +0 -1
- package/lib/Core/Components/EmptyContainer.js +0 -12
- package/lib/Core/Components/EmptyContainer.js.map +0 -1
- package/lib/Core/Components/GroupRenderer.d.ts.map +0 -1
- package/lib/Core/Components/GroupRenderer.js +0 -240
- package/lib/Core/Components/GroupRenderer.js.map +0 -1
- package/lib/Core/Components/Toolbar/KeyboardInstructions.d.ts +0 -6
- package/lib/Core/Components/Toolbar/KeyboardInstructions.d.ts.map +0 -1
- package/lib/Core/Components/Toolbar/KeyboardInstructions.js +0 -32
- package/lib/Core/Components/Toolbar/KeyboardInstructions.js.map +0 -1
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts +0 -8
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.d.ts.map +0 -1
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js +0 -61
- package/lib/Core/Components/Toolbar/Timeline/TimelineToolbar.js.map +0 -1
- package/lib/Core/Hooks/useSelect.d.ts +0 -9
- package/lib/Core/Hooks/useSelect.d.ts.map +0 -1
- package/lib/Core/Hooks/useSelect.js +0 -24
- package/lib/Core/Hooks/useSelect.js.map +0 -1
- package/lib/Core/Views/Gallery/ItemWrapper.d.ts +0 -19
- package/lib/Core/Views/Gallery/ItemWrapper.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/ItemWrapper.js +0 -34
- package/lib/Core/Views/Gallery/ItemWrapper.js.map +0 -1
- package/lib/Core/Views/Timeline/utility.d.ts +0 -8
- package/lib/Core/Views/Timeline/utility.d.ts.map +0 -1
- package/lib/Core/Views/Timeline/utility.js +0 -120
- package/lib/Core/Views/Timeline/utility.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AA2BrD;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,KAA4C,EACF,EAAE;IAC5C,MAAM,EACJ,cAAc,EACd,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,MAAM,wBAAwB,GAAG,MAAM,GAAG,CAAC,CAAC;IAC5C,IAAI,cAAc,KAAK,CAAC,IAAI,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,KAAK,CAAC,EAAE,CAAC;QAC9E,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,wBAAwB,EAAE,CAAC;IAC/D,CAAC;IAED,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,EAAE,YAAY,IAAI,CAAC,CAAC;IAE/D,oEAAoE;IACpE,IAAI,uBAAuB,GAAG,CAAC,CAAC;IA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ACxB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAChD,CAAC,CAAC","sourcesContent":["import type { RefObject } from 'react';\n\nimport { getScrollbarWidth } from 'pega-repeating-structures-core';\nimport { isInstance } from '@pega/cosmos-react-core';\n\nimport type { ItemsHeight } from './VariableHeightVirtualizer';\n\ninterface GetVirtualizedPaginationIndicesParams {\n /** Current vertical scroll offset of the container. */\n scrollTop: number;\n /** Ref to the scrolling container element */\n containerRef: RefObject<HTMLDivElement>;\n /** Ref to the container holding the list items */\n itemContainerRef: RefObject<HTMLDivElement>;\n\n /** Total number of items. */\n totalItemCount: number;\n /** Mapping of item indices and their actual height. */\n itemsHeight: ItemsHeight;\n /** Default height for items if not measured. */\n defaultItemHeight: number;\n\n /** Number of extra items to render above and below the visible viewport for smooth scrolling. */\n buffer: number;\n /** Maximum allowed end index (exclusive). */\n endIndexLimit: number;\n /** If true, allows indices to exceed totalCount for infinite scrolling by including buffer. */\n isInfiniteMode?: boolean;\n}\n\n/**\n * Calculates the start and end indices for virtualized pagination in a variable-height list.\n *\n * @returns {{ startIndex: number, endIndex: number }} Object containing the calculated start and end indices for rendering (inclusive both indices).\n */\nexport const getVirtualizedPaginationIndices = (\n param: GetVirtualizedPaginationIndicesParams\n): { startIndex: number; endIndex: number } => {\n const {\n totalItemCount,\n buffer,\n itemContainerRef,\n scrollTop,\n containerRef,\n itemsHeight,\n defaultItemHeight,\n endIndexLimit,\n isInfiniteMode\n } = param;\n\n const minimumItemsToFetchOnTop = buffer * 4;\n if (totalItemCount === 0 || itemContainerRef.current?.childElementCount === 0) {\n return { startIndex: 0, endIndex: minimumItemsToFetchOnTop };\n }\n\n const viewportHeight = containerRef.current?.clientHeight || 0;\n\n // Find the first visible item index for the current scroll position\n let aboveTheFoldItemsHeight = 0;\n let visibleStartIndex = 0;\n while (\n visibleStartIndex < totalItemCount &&\n aboveTheFoldItemsHeight + (itemsHeight[visibleStartIndex] ?? defaultItemHeight) < scrollTop\n ) {\n aboveTheFoldItemsHeight += itemsHeight[visibleStartIndex] ?? defaultItemHeight;\n visibleStartIndex += 1;\n }\n\n // Find the last visible item index for the current scroll position\n let inViewItemsHeight = 0;\n let visibleEndIndex = visibleStartIndex;\n while (visibleEndIndex < totalItemCount && inViewItemsHeight < viewportHeight) {\n inViewItemsHeight += itemsHeight[visibleEndIndex] ?? defaultItemHeight;\n visibleEndIndex += 1;\n }\n\n const startIndex = Math.max(0, visibleStartIndex - buffer);\n let endIndex = Math.min(visibleEndIndex + buffer, endIndexLimit - 1);\n if (isInfiniteMode) {\n endIndex = Math.max(endIndex, minimumItemsToFetchOnTop);\n } else {\n // In cases where the count is very less due to filters, we would fetch more items to avoid unnecessary API calls if the count after the filter removed is more\n endIndex = Math.max(Math.min(totalItemCount - 1, endIndex), minimumItemsToFetchOnTop);\n }\n return { startIndex, endIndex };\n};\n\n/**\n * Calculates the total buffer height for a list of items, using their individual heights if available,\n * or a default height otherwise.\n *\n * @param totalItemCount - The total number of items in the list.\n * @param itemsHeight - An object or array containing the heights of individual items, indexed by item position.\n * @param defaultItemHeight - The default height to use for items whose height is not specified in `itemsHeight`.\n * @returns The sum of all item heights, using the default height for any missing values.\n */\nexport const calculateTotalBufferHeight = (\n totalItemCount: number,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n let totalBufferHeight = 0;\n for (let i = 0; i < totalItemCount; i += 1) {\n totalBufferHeight += itemsHeight[i] || defaultItemHeight;\n }\n\n return totalBufferHeight;\n};\n\n/**\n * Returns a CSS-compatible max-height value based on the input.\n *\n * @param viewMaxHeight - The maximum height value, which can be a number (pixels), a string (CSS value), or `null`.\n * @returns A string representing the CSS max-height value.\n */\nexport const getMaxHeight = (viewMaxHeight: number | string | null): string => {\n if (!viewMaxHeight) return 'none';\n return typeof viewMaxHeight === 'number' ? `${viewMaxHeight}px` : viewMaxHeight;\n};\n\n/**\n * Calculates the vertical offset for a given item index in a list with variable item heights.\n *\n * @param index - The index of the item for which to calculate the offset.\n * @param itemsHeight - Mapping of item indices and their actual height.\n * @param defaultItemHeight - The default height to use for items not present in the cache.\n * @returns The total offset (in pixels) from the top of the list to the specified index.\n */\nexport const getOffsetForIndex = (\n index: number,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n let offset = 0;\n\n for (let i = 0; i < index; i += 1) {\n offset += itemsHeight[i] ?? defaultItemHeight;\n }\n return offset;\n};\n\n/**\n * Determines whether the viewable area of a virtualized list is not fully filled with rendered items.\n *\n * @param totalItemCount - The total number of items that should be rendered.\n * @param itemContainer - The HTML element containing the rendered items.\n * @param parentContainer - The parent HTML element that contains the items and possibly the header.\n * @param renderHeader - Indicates whether a header is rendered at the top of the parent container.\n * @returns `true` if the view is not filled with all items, `false` otherwise.\n */\nexport const isViewNotFilled = (\n totalItemCount: number,\n itemContainer: HTMLDivElement,\n parentContainer: HTMLDivElement,\n renderHeader: boolean\n): boolean => {\n const parentContainerPosition = parentContainer.getBoundingClientRect();\n let headerHeight = 0;\n if (renderHeader && parentContainer.childElementCount > 1) {\n const firstChild = parentContainer.children[0];\n if (isInstance(firstChild, HTMLDivElement)) {\n headerHeight = firstChild.offsetHeight;\n }\n }\n\n const scrollbarWidth = getScrollbarWidth();\n const items = Array.from(itemContainer.children);\n\n if (!items.length && !totalItemCount) return false;\n if (!items.length && totalItemCount) return true;\n\n return (\n !!totalItemCount &&\n items.length !== totalItemCount &&\n (Math.floor(items[items.length - 1].getBoundingClientRect().bottom) <\n Math.floor(parentContainerPosition.bottom - scrollbarWidth) ||\n Math.floor(items[0].getBoundingClientRect().top) >\n Math.floor(parentContainerPosition.top + headerHeight) ||\n items.length === 0)\n );\n};\n\n/**\n * Retrieves the numeric data index from the `data-index` attribute of a given Element.\n *\n * @param element - The Element from which to extract the data index.\n * @returns The parsed integer value of the `data-index` attribute, or `null` if the attribute is not present.\n */\nexport const getDataIndex = (element: Element): number | null => {\n const dataIndexStr = element?.getAttribute('data-index');\n if (!dataIndexStr) return null;\n const parsedDataIndex = parseInt(dataIndexStr, 10);\n return Number.isNaN(parsedDataIndex) ? null : parsedDataIndex;\n};\n\n/**\n * Calculates and returns an object containing the heights of items whose heights have changed\n * compared to their previous values.\n *\n * @param itemContainer - The container HTMLElement whose child nodes represent items to measure.\n * @param itemsHeight - An object mapping item indices to their measured heights.\n * @param defaultItemHeight - The default height to use for items not present in `itemsHeight`.\n * @returns An object mapping item indices to their new heights for items whose heights have changed.\n */\nexport function getChangedItemsHeight(\n itemContainer: HTMLDivElement,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): ItemsHeight {\n if (!itemContainer) return {};\n\n const newHeights: ItemsHeight = {};\n const nodes = Array.from(itemContainer.children);\n\n nodes.forEach(node => {\n const itemDataIndex = getDataIndex(node);\n if (itemDataIndex === null) return;\n\n const measuredHeight = node.getBoundingClientRect().height;\n const prevHeight = itemsHeight[itemDataIndex] ?? defaultItemHeight;\n if (measuredHeight !== prevHeight) {\n newHeights[itemDataIndex] = measuredHeight;\n }\n });\n\n return newHeights;\n}\n\n/**\n * Calculates the cumulative change in item heights between two sets of item height data,\n * for a range of items starting from `startIndex` up to (but not including) `previousFirstItemDataIndex`.\n *\n * This function compares the current heights (`itemsHeight`) with the previous heights (`previousItemsHeight`)\n * for each item in the specified range, using `defaultItemHeight` as a fallback if a previous height is missing.\n * The result is the sum of the differences in height for all items in the range.\n *\n * @param startIndex - The index at which to start calculating the cumulative height change.\n * @param previousFirstItemDataIndex - The index up to which to calculate (exclusive). If `null` or less than or equal to 0, returns 0.\n * @param itemsHeight - An object mapping item indices to their measured heights.\n * @param previousItemsHeight - An object mapping item indices of previously rendered items to their heights.\n * @param defaultItemHeight - The default height to use if a previous height is not available.\n * @returns The cumulative change in item heights for the specified range, or 0 if the result is not finite.\n */\nexport const calculateCumulativeItemSizeChange = (\n startIndex: number,\n previousFirstItemDataIndex: number | null,\n itemsHeight: ItemsHeight,\n previousItemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n if (previousFirstItemDataIndex === null || previousFirstItemDataIndex <= 0) {\n return 0;\n }\n\n let delta = 0;\n\n for (let i = startIndex; i < previousFirstItemDataIndex; i += 1) {\n const actualHeight = itemsHeight[i];\n const previousHeight = previousItemsHeight[i] ?? defaultItemHeight;\n\n if (actualHeight !== null && actualHeight !== undefined) {\n delta += actualHeight - previousHeight;\n }\n }\n\n return Number.isFinite(delta) ? delta : 0;\n};\n\n/**\n * Updates the position styles of child items within a container element to enable virtualized rendering.\n * Sets the container's top offset and positions each child absolutely based on their calculated heights.\n *\n * @param itemContainer - The HTML element containing the list items to be positioned.\n * @param itemsHeight - An object mapping item indices to their measured heights.\n * @param defaultItemHeight - The default height to use for items without a specified height.\n * @returns The total height of all items within the container, rounded down to the nearest integer.\n */\nexport const updateItemPositionStyles = (\n itemContainer: HTMLDivElement,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n const items = itemContainer.children;\n if (!items?.length) {\n return 0;\n }\n\n const firstItemDataIndex = getDataIndex(items[0]);\n if (firstItemDataIndex === null) return 0;\n\n const offset = getOffsetForIndex(firstItemDataIndex, itemsHeight, defaultItemHeight);\n itemContainer.style.top = `${offset}px`;\n\n let itemContainerCurrentHeight = 0;\n let currentItemIndex = firstItemDataIndex;\n Array.from(items).forEach(item => {\n if (!isInstance(item, HTMLDivElement)) return;\n\n item.style.position = 'absolute';\n item.style.top = `${itemContainerCurrentHeight}px`;\n itemContainerCurrentHeight += itemsHeight[currentItemIndex] ?? defaultItemHeight;\n currentItemIndex += 1;\n });\n\n return Math.floor(itemContainerCurrentHeight);\n};\n"]}
|
|
@@ -4,7 +4,6 @@ import Styled from 'styled-components';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { defaultThemeProp, Progress } from '@pega/cosmos-react-core';
|
|
6
6
|
import { isEmpty } from 'pega-repeating-structures-core';
|
|
7
|
-
import EmptyContainer from '../DefaultComponents/EmptyContainer';
|
|
8
7
|
import useTranslate from '../../Hooks/useTranslate';
|
|
9
8
|
import { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';
|
|
10
9
|
import getPaginationInfo from './Pagination';
|
|
@@ -43,7 +42,11 @@ const StyledLoader = Styled.div `
|
|
|
43
42
|
top: ${props => props.$style.top};
|
|
44
43
|
bottom: ${props => props.$style.bottom};
|
|
45
44
|
`;
|
|
46
|
-
const
|
|
45
|
+
const PAGINATION_TRIGGER_RATIOS = {
|
|
46
|
+
down: 0.9,
|
|
47
|
+
up: 0.1
|
|
48
|
+
};
|
|
49
|
+
const VirtualizeInfinite = forwardRef(({ id, viewHeight, viewWidth, itemHeight, callback, rowContainerClass, children, renderHeader, renderFooter, state, bufferMultiplier, viewMaxHeight, showLoadingIndicator, resetCount, countUpdateCallback, isFetching, hasMoreResults, renderEmptyRecords }, inputRef) => {
|
|
47
50
|
const rowBuffer = 5;
|
|
48
51
|
const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();
|
|
49
52
|
const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});
|
|
@@ -114,7 +117,7 @@ const VirtualizeInfinite = forwardRef(({ id, viewHeight, viewWidth, itemHeight,
|
|
|
114
117
|
});
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
|
-
callback({ ...vi.pInfo.view, id });
|
|
120
|
+
callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });
|
|
118
121
|
}
|
|
119
122
|
else if (resetIsFetchingWhenNoNewIndexes) {
|
|
120
123
|
setLoadingIndicatorInfo({});
|
|
@@ -159,7 +162,7 @@ const VirtualizeInfinite = forwardRef(({ id, viewHeight, viewWidth, itemHeight,
|
|
|
159
162
|
setRContainerDimensionUpdate({});
|
|
160
163
|
}, [getRowContainer]);
|
|
161
164
|
useResizeObserver(getRowContainer, onRowContainerDimensionChange);
|
|
162
|
-
const [updateScrollTop] = useScroll(getPagination, getPContainer, vi, getTotalRowsIncludingBuffer(), renderHeader, isFetching, viewHeight);
|
|
165
|
+
const [updateScrollTop] = useScroll(getPagination, getPContainer, vi, getTotalRowsIncludingBuffer(), renderHeader, isFetching, viewHeight, PAGINATION_TRIGGER_RATIOS);
|
|
163
166
|
useLayoutEffect(() => {
|
|
164
167
|
const rContainer = getRowContainer();
|
|
165
168
|
if (state && state.startIndex >= 0 && vi && rContainer) {
|
|
@@ -250,7 +253,7 @@ const VirtualizeInfinite = forwardRef(({ id, viewHeight, viewWidth, itemHeight,
|
|
|
250
253
|
]);
|
|
251
254
|
return (_jsxs(StyledPContainer, { "$style": {
|
|
252
255
|
maxHeight,
|
|
253
|
-
minHeight: vi.totalRowsLoaded
|
|
256
|
+
minHeight: !vi.totalRowsLoaded ? '100px' : 'auto',
|
|
254
257
|
renderFooter,
|
|
255
258
|
itemHeight,
|
|
256
259
|
height,
|
|
@@ -261,7 +264,15 @@ const VirtualizeInfinite = forwardRef(({ id, viewHeight, viewWidth, itemHeight,
|
|
|
261
264
|
vi.bContainer = c;
|
|
262
265
|
}, children: _jsxs("div", { className: `${rowContainerClass} row-container`, ref: c => {
|
|
263
266
|
vi.rContainer = c;
|
|
264
|
-
}, role: 'rowgroup', children: [
|
|
267
|
+
}, role: 'rowgroup', children: [vi.totalRowsLoaded >= 0 &&
|
|
268
|
+
showLoadingIndicator &&
|
|
269
|
+
isFetching &&
|
|
270
|
+
loadingIndicatorInfo.isScrollingUp && (_jsx(StyledLoader, { "$style": { bottom: '100%' }, children: _jsx(Progress, { className: 'above-loader', placement: 'block', tabIndex: 0, "aria-label": translate('Loading more results') }) })), children, vi.totalRowsLoaded >= 0 &&
|
|
271
|
+
showLoadingIndicator &&
|
|
272
|
+
isFetching &&
|
|
273
|
+
loadingIndicatorInfo.isScrollingDown && (_jsx(StyledLoader, { "$style": { top: '100%' }, children: _jsx(Progress, { className: 'below-loader', placement: 'block', tabIndex: 0, "aria-label": translate('Loading more results') }) }))] }) }), vi.totalRowsLoaded === 0 && !isFetching
|
|
274
|
+
? renderEmptyRecords && renderEmptyRecords()
|
|
275
|
+
: null, renderFooter && renderFooter()] }));
|
|
265
276
|
});
|
|
266
277
|
VirtualizeInfinite.propTypes = {
|
|
267
278
|
id: PropTypes.string.isRequired,
|
|
@@ -283,7 +294,8 @@ VirtualizeInfinite.propTypes = {
|
|
|
283
294
|
viewMaxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
284
295
|
showLoadingIndicator: PropTypes.bool,
|
|
285
296
|
resetCount: PropTypes.bool,
|
|
286
|
-
countUpdateCallback: PropTypes.func
|
|
297
|
+
countUpdateCallback: PropTypes.func,
|
|
298
|
+
renderEmptyRecords: PropTypes.func
|
|
287
299
|
};
|
|
288
300
|
VirtualizeInfinite.defaultProps = {
|
|
289
301
|
bufferMultiplier: 2,
|
|
@@ -299,7 +311,8 @@ VirtualizeInfinite.defaultProps = {
|
|
|
299
311
|
viewMaxHeight: undefined,
|
|
300
312
|
showLoadingIndicator: false,
|
|
301
313
|
resetCount: false,
|
|
302
|
-
countUpdateCallback: () => { }
|
|
314
|
+
countUpdateCallback: () => { },
|
|
315
|
+
renderEmptyRecords: null
|
|
303
316
|
};
|
|
304
317
|
VirtualizeInfinite.displayName = 'VirtualizeInfinite';
|
|
305
318
|
export default memo(VirtualizeInfinite);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualizeInfinite.js","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/VirtualizeInfinite.jsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD,OAAO,cA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M,CAAC,CAAC;IACxE,oBAAoB,EAAE,SAAS,CAAC,IAAI;IACpC,UAAU,EAAE,SAAS,CAAC,IAAI;IAC1B,mBAAmB,EAAE,SAAS,CAAC,IAAI;CACpC,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG;IAChC,gBAAgB,EAAE,CAAC;IACnB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,EAAE;IACrB,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS;IAChB,aAAa,EAAE,SAAS;IACxB,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE,KAAK;IACjB,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC9B,CAAC;AAEF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;AAEtD,eAAe,IAAI,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n memo,\n useEffect,\n useRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useLayoutEffect,\n useState\n} from 'react';\nimport Styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { defaultThemeProp, Progress } from '@pega/cosmos-react-core';\nimport { isEmpty } from 'pega-repeating-structures-core';\n\nimport EmptyContainer from '../DefaultComponents/EmptyContainer';\nimport useTranslate from '../../Hooks/useTranslate';\nimport { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n getRecordCountForLayoutPaint,\n getValueWithUnit,\n getMaxHeight,\n isViewNotFilled,\n setAttributesOnItems,\n updateRowContainerTop\n} from './utility';\nimport useResizeObserver from './UseResizeObserver';\n\nfunction getBContainerMinHeight(props) {\n return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';\n}\n\nconst StyledPContainer = Styled.div`\n position: relative;\n overflow: auto;\n max-height: ${props => props.$style.maxHeight};\n width: ${props => props.$style.width};\n height: ${props => props.$style.height};\n min-height: ${props => props.$style.minHeight};\n border-radius: inherit;\n\n &:has(${StyledSkeletonRow}) {\n overflow: hidden;\n }\n\n .bContainer {\n position: relative;\n min-height: ${props => getBContainerMinHeight(props)};\n border-radius: inherit;\n }\n`;\n\nStyledPContainer.defaultProps = defaultThemeProp;\n\nconst StyledLoader = Styled.div`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: 100%;\n top: ${props => props.$style.top};\n bottom: ${props => props.$style.bottom};\n`;\n\nconst VirtualizeInfinite = forwardRef(\n (\n {\n id,\n viewHeight,\n viewWidth,\n itemHeight,\n callback,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n viewMaxHeight,\n showLoadingIndicator,\n resetCount,\n countUpdateCallback,\n isFetching,\n hasMoreResults\n },\n inputRef\n ) => {\n const rowBuffer = 5;\n\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\n const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});\n const [translate] = useTranslate();\n\n // Create ref to store virtualize related data.\n const vi = useRef({\n itemHeight,\n bufferMultiplier,\n pInfo: {},\n totalRowsLoaded: undefined,\n isInitialized: false\n }).current;\n\n // tracking both state and pInfo.view to identify the initialization as in case of fullscreen, state will be available but pInfo.view won't\n const isInitialized = state && !!Object.keys(vi.pInfo.view ?? {}).length;\n\n const getTotalRowsIncludingBuffer = useCallback(() => {\n if (isEmpty(vi.totalRowsLoaded)) return;\n return hasMoreResults ? vi.totalRowsLoaded + rowBuffer : vi.totalRowsLoaded;\n }, [vi.totalRowsLoaded, hasMoreResults]);\n\n const getRowContainer = useCallback(() => vi.rContainer, [vi.rContainer]);\n const getPContainer = useCallback(() => vi.pContainer, [vi.pContainer]);\n const getBContainer = useCallback(() => vi.bContainer, [vi.bContainer]);\n\n // API used when user want to scroll to top programmatically.\n // Though component auto scroll to top if no element is in view.\n // But calling this API upfront might save one extra call to Fetch API.\n const scrollToTop = useCallback(() => {\n if (!isInitialized) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n false,\n true\n );\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }, [id, vi, getPContainer, callback, isInitialized]);\n\n // expose APIs and properties here to help client to communicate.\n useImperativeHandle(inputRef, () => ({\n getParentContainer: getPContainer,\n scrollToTop,\n vi,\n id\n }));\n\n const { width, height } = useMemo(\n () => ({\n width: getValueWithUnit(viewWidth, '100%'),\n height: getValueWithUnit(viewHeight, 'auto')\n }),\n [viewWidth, viewHeight]\n );\n\n const maxHeight = useMemo(() => getMaxHeight(viewMaxHeight), [viewMaxHeight]);\n\n // Calculate the pagination indexes and notify callback.\n // resetIsFetchingWhenNoNewIndexes - flag specific for isViewNotFilled\n // If view is not filled, we want to call this but resting isFetch to false\n // goes to this method when callback is note fired.\n const getPagination = useCallback(\n (isRefresh = false, resetIsFetchingWhenNoNewIndexes = false) => {\n if (!isFetching || resetIsFetchingWhenNoNewIndexes) {\n const pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n isRefresh,\n true\n );\n const { startIndex, endIndex } = pInfo.view;\n // if new indexes are subset of existing state indexes, no need to update the consumer.\n if (\n isRefresh ||\n !state ||\n !(startIndex >= state.startIndex && endIndex <= state.endIndex)\n ) {\n vi.pInfo = pInfo;\n if (state) {\n const { startIndex: oldStartIndex, endIndex: oldEndIndex } = state;\n if (startIndex < oldStartIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingUp: true };\n });\n }\n if (endIndex > oldEndIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingDown: true };\n });\n }\n }\n\n callback({ ...vi.pInfo.view, id });\n } else if (resetIsFetchingWhenNoNewIndexes) {\n setLoadingIndicatorInfo({});\n }\n }\n },\n [isFetching, getPContainer, getTotalRowsIncludingBuffer, vi, state, callback, id]\n );\n\n // update average stats for next calculation.\n const updateAvarageInVirtualizeInstance = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight, averageNumberOfItemsInARow, averageRowHeight } =\n currentEstimation;\n Object.assign(vi, {\n itemCount: (itemCount + vi.itemCount || itemCount) / 2,\n rowContainerHeight:\n (rowContainerHeight + vi.rowContainerHeight || rowContainerHeight) / 2,\n averageNumberOfItemsInARow:\n (averageNumberOfItemsInARow + vi.averageNumberOfItemsInARow ||\n averageNumberOfItemsInARow) / 2,\n averageRowHeight: (averageRowHeight + vi.averageRowHeight || averageRowHeight) / 2\n });\n },\n [vi]\n );\n\n const getBufferHeight = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let h = 0;\n if (itemCount > 0)\n h =\n (getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()) / itemCount) *\n rowContainerHeight;\n return h;\n },\n [getTotalRowsIncludingBuffer]\n );\n\n const getScrollTop = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let scrollTop = 0;\n if (itemCount > 0) {\n const scrollNodeTopChange =\n // eslint-disable-next-line no-unsafe-optional-chaining\n vi.pInfo?.bufferNewCords?.top - vi.pInfo?.bufferOldCords?.top || 0;\n scrollTop = (vi.pInfo.topRowIndex / itemCount) * rowContainerHeight - scrollNodeTopChange;\n }\n return scrollTop;\n },\n [vi]\n );\n\n const onRowContainerDimensionChange = useCallback(() => {\n const { height: rowContainerHeight, width: rowContainerWidth } =\n getRowContainer()?.getBoundingClientRect() ?? {};\n // trigger virtualizer operations only when row container has some height and width\n if (rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [getRowContainer]);\n\n useResizeObserver(getRowContainer, onRowContainerDimensionChange);\n\n const [updateScrollTop] = useScroll(\n getPagination,\n getPContainer,\n vi,\n getTotalRowsIncludingBuffer(),\n renderHeader,\n isFetching,\n viewHeight\n );\n\n useLayoutEffect(() => {\n const rContainer = getRowContainer();\n if (state && state.startIndex >= 0 && vi && rContainer) {\n setAttributesOnItems(state, rContainer);\n }\n });\n\n useLayoutEffect(() => {\n if (isFetching || !isInitialized) return;\n\n const rowElements = Array.from(getRowContainer().children || []).filter(a =>\n a.hasAttribute('data-key')\n );\n if (!rowElements.length) {\n vi.totalRowsLoaded = 0;\n return;\n }\n\n const lastRow = rowElements[rowElements.length - 1];\n const lastRowDataIndex = parseInt(lastRow.getAttribute('data-index'), 10);\n const newCount = hasMoreResults ? lastRowDataIndex + 1 + rowBuffer : lastRowDataIndex + 1;\n\n // if user is scrolling up/down within the already encountered records, the record count shouldn't update\n if (newCount < getTotalRowsIncludingBuffer() && !resetCount) return;\n\n vi.totalRowsLoaded = lastRowDataIndex + 1;\n countUpdateCallback(vi.totalRowsLoaded);\n }, [children, isFetching]);\n\n // Get estimate and update buffer height\n useLayoutEffect(() => {\n if (!isInitialized) return;\n\n vi.currentEstimation = getCurrentEstimation(getRowContainer(), true);\n updateAvarageInVirtualizeInstance(vi.currentEstimation);\n const h = getBufferHeight(vi.currentEstimation);\n getBContainer().style.height = `${h}px`;\n }, [\n vi,\n children,\n rContainerDimensionUpdate,\n getBContainer,\n getBufferHeight,\n getRowContainer,\n getTotalRowsIncludingBuffer,\n updateAvarageInVirtualizeInstance\n ]);\n\n useLayoutEffect(() => {\n if (isFetching || !isInitialized) return;\n\n const pContainer = getPContainer();\n const scrollTop = getScrollTop(vi.currentEstimation);\n if (vi.pInfo.view.startIndex !== 0) pContainer.scrollTop = scrollTop;\n\n // Setting scrollTop from pContainer.scrollTop as getScrollTop can return value with higher decimal accuracy.\n // but scrollTop attribute from HTML element will round it automatically.\n updateScrollTop(pContainer.scrollTop);\n updateRowContainerTop(\n vi,\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n state,\n pContainer,\n pContainer.scrollTop\n );\n }, [\n vi,\n state,\n isFetching,\n getScrollTop,\n getPContainer,\n updateScrollTop,\n getTotalRowsIncludingBuffer\n ]);\n\n // On mount that means state is not initialized yet, trigger pagination.\n // or whenever count changes or width /height of view port changes, if view is not filled with data, get indexes again.\n useEffect(() => {\n if (isFetching) return;\n\n if (!isInitialized) {\n getPagination(true);\n return;\n }\n\n if (\n isViewNotFilled(\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n getPContainer(),\n renderHeader\n )\n ) {\n getPagination(false, true);\n } else {\n setLoadingIndicatorInfo({});\n }\n }, [\n vi,\n isFetching,\n children,\n viewWidth,\n viewHeight,\n renderHeader,\n rContainerDimensionUpdate,\n getPagination,\n getPContainer,\n getTotalRowsIncludingBuffer\n ]);\n\n return (\n <StyledPContainer\n $style={{\n maxHeight,\n minHeight: vi.totalRowsLoaded === 0 ? '100px' : 'auto',\n renderFooter,\n itemHeight,\n height,\n width\n }}\n data-total-records={vi.totalRowsLoaded}\n className='pContainer'\n ref={c => {\n vi.pContainer = c;\n }}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={c => {\n vi.bContainer = c;\n }}\n >\n <div\n className={`${rowContainerClass} row-container`}\n ref={c => {\n vi.rContainer = c;\n }}\n role='rowgroup'\n >\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingUp && (\n <StyledLoader $style={{ bottom: '100%' }}>\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n {children}\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingDown && (\n <StyledLoader $style={{ top: '100%' }}>\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n </div>\n {vi.totalRowsLoaded === 0 && !isFetching ? <EmptyContainer /> : null}\n {renderFooter && renderFooter()}\n </StyledPContainer>\n );\n }\n);\n\nVirtualizeInfinite.propTypes = {\n id: PropTypes.string.isRequired,\n viewHeight: PropTypes.number,\n viewWidth: PropTypes.number,\n itemHeight: PropTypes.number,\n callback: PropTypes.func,\n isFetching: PropTypes.bool,\n hasMoreResults: PropTypes.bool,\n rowContainerClass: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,\n renderHeader: PropTypes.func,\n renderFooter: PropTypes.func,\n state: PropTypes.shape({\n startIndex: PropTypes.number,\n endIndex: PropTypes.number\n }),\n bufferMultiplier: PropTypes.number,\n viewMaxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n showLoadingIndicator: PropTypes.bool,\n resetCount: PropTypes.bool,\n countUpdateCallback: PropTypes.func\n};\n\nVirtualizeInfinite.defaultProps = {\n bufferMultiplier: 2,\n callback: () => {},\n isFetching: false,\n hasMoreResults: false,\n rowContainerClass: '',\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false,\n resetCount: false,\n countUpdateCallback: () => {}\n};\n\nVirtualizeInfinite.displayName = 'VirtualizeInfinite';\n\nexport default memo(VirtualizeInfinite);\n"]}
|
|
1
|
+
{"version":3,"file":"VirtualizeInfinite.js","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/VirtualizeInfinite.jsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD,OAAO,YAAY,MAAM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AC,MAAM;QAC5B,QAAQ,EAAE,SAAS,CAAC,MAAM;KAC3B,CAAC;IACF,gBAAgB,EAAE,SAAS,CAAC,MAAM;IAClC,aAAa,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxE,oBAAoB,EAAE,SAAS,CAAC,IAAI;IACpC,UAAU,EAAE,SAAS,CAAC,IAAI;IAC1B,mBAAmB,EAAE,SAAS,CAAC,IAAI;IACnC,kBAAkB,EAAE,SAAS,CAAC,IAAI;CACnC,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG;IAChC,gBAAgB,EAAE,CAAC;IACnB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,EAAE;IACrB,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS;IAChB,aAAa,EAAE,SAAS;IACxB,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE,KAAK;IACjB,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC7B,kBAAkB,EAAE,IAAI;CACzB,CAAC;AAEF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;AAEtD,eAAe,IAAI,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n memo,\n useEffect,\n useRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useLayoutEffect,\n useState\n} from 'react';\nimport Styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { defaultThemeProp, Progress } from '@pega/cosmos-react-core';\nimport { isEmpty } from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\nimport { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n getRecordCountForLayoutPaint,\n getValueWithUnit,\n getMaxHeight,\n isViewNotFilled,\n setAttributesOnItems,\n updateRowContainerTop\n} from './utility';\nimport useResizeObserver from './UseResizeObserver';\n\nfunction getBContainerMinHeight(props) {\n return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';\n}\n\nconst StyledPContainer = Styled.div`\n position: relative;\n overflow: auto;\n max-height: ${props => props.$style.maxHeight};\n width: ${props => props.$style.width};\n height: ${props => props.$style.height};\n min-height: ${props => props.$style.minHeight};\n border-radius: inherit;\n\n &:has(${StyledSkeletonRow}) {\n overflow: hidden;\n }\n\n .bContainer {\n position: relative;\n min-height: ${props => getBContainerMinHeight(props)};\n border-radius: inherit;\n }\n`;\n\nStyledPContainer.defaultProps = defaultThemeProp;\n\nconst StyledLoader = Styled.div`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: 100%;\n top: ${props => props.$style.top};\n bottom: ${props => props.$style.bottom};\n`;\n\nconst PAGINATION_TRIGGER_RATIOS = {\n down: 0.9,\n up: 0.1\n};\n\nconst VirtualizeInfinite = forwardRef(\n (\n {\n id,\n viewHeight,\n viewWidth,\n itemHeight,\n callback,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n viewMaxHeight,\n showLoadingIndicator,\n resetCount,\n countUpdateCallback,\n isFetching,\n hasMoreResults,\n renderEmptyRecords\n },\n inputRef\n ) => {\n const rowBuffer = 5;\n\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\n const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});\n const [translate] = useTranslate();\n\n // Create ref to store virtualize related data.\n const vi = useRef({\n itemHeight,\n bufferMultiplier,\n pInfo: {},\n totalRowsLoaded: undefined,\n isInitialized: false\n }).current;\n\n // tracking both state and pInfo.view to identify the initialization as in case of fullscreen, state will be available but pInfo.view won't\n const isInitialized = state && !!Object.keys(vi.pInfo.view ?? {}).length;\n\n const getTotalRowsIncludingBuffer = useCallback(() => {\n if (isEmpty(vi.totalRowsLoaded)) return;\n return hasMoreResults ? vi.totalRowsLoaded + rowBuffer : vi.totalRowsLoaded;\n }, [vi.totalRowsLoaded, hasMoreResults]);\n\n const getRowContainer = useCallback(() => vi.rContainer, [vi.rContainer]);\n const getPContainer = useCallback(() => vi.pContainer, [vi.pContainer]);\n const getBContainer = useCallback(() => vi.bContainer, [vi.bContainer]);\n\n // API used when user want to scroll to top programmatically.\n // Though component auto scroll to top if no element is in view.\n // But calling this API upfront might save one extra call to Fetch API.\n const scrollToTop = useCallback(() => {\n if (!isInitialized) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n false,\n true\n );\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }, [id, vi, getPContainer, callback, isInitialized]);\n\n // expose APIs and properties here to help client to communicate.\n useImperativeHandle(inputRef, () => ({\n getParentContainer: getPContainer,\n scrollToTop,\n vi,\n id\n }));\n\n const { width, height } = useMemo(\n () => ({\n width: getValueWithUnit(viewWidth, '100%'),\n height: getValueWithUnit(viewHeight, 'auto')\n }),\n [viewWidth, viewHeight]\n );\n\n const maxHeight = useMemo(() => getMaxHeight(viewMaxHeight), [viewMaxHeight]);\n\n // Calculate the pagination indexes and notify callback.\n // resetIsFetchingWhenNoNewIndexes - flag specific for isViewNotFilled\n // If view is not filled, we want to call this but resting isFetch to false\n // goes to this method when callback is note fired.\n const getPagination = useCallback(\n (isRefresh = false, resetIsFetchingWhenNoNewIndexes = false) => {\n if (!isFetching || resetIsFetchingWhenNoNewIndexes) {\n const pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n isRefresh,\n true\n );\n const { startIndex, endIndex } = pInfo.view;\n // if new indexes are subset of existing state indexes, no need to update the consumer.\n if (\n isRefresh ||\n !state ||\n !(startIndex >= state.startIndex && endIndex <= state.endIndex)\n ) {\n vi.pInfo = pInfo;\n if (state) {\n const { startIndex: oldStartIndex, endIndex: oldEndIndex } = state;\n if (startIndex < oldStartIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingUp: true };\n });\n }\n if (endIndex > oldEndIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingDown: true };\n });\n }\n }\n\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n } else if (resetIsFetchingWhenNoNewIndexes) {\n setLoadingIndicatorInfo({});\n }\n }\n },\n [isFetching, getPContainer, getTotalRowsIncludingBuffer, vi, state, callback, id]\n );\n\n // update average stats for next calculation.\n const updateAvarageInVirtualizeInstance = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight, averageNumberOfItemsInARow, averageRowHeight } =\n currentEstimation;\n Object.assign(vi, {\n itemCount: (itemCount + vi.itemCount || itemCount) / 2,\n rowContainerHeight:\n (rowContainerHeight + vi.rowContainerHeight || rowContainerHeight) / 2,\n averageNumberOfItemsInARow:\n (averageNumberOfItemsInARow + vi.averageNumberOfItemsInARow ||\n averageNumberOfItemsInARow) / 2,\n averageRowHeight: (averageRowHeight + vi.averageRowHeight || averageRowHeight) / 2\n });\n },\n [vi]\n );\n\n const getBufferHeight = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let h = 0;\n if (itemCount > 0)\n h =\n (getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()) / itemCount) *\n rowContainerHeight;\n return h;\n },\n [getTotalRowsIncludingBuffer]\n );\n\n const getScrollTop = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let scrollTop = 0;\n if (itemCount > 0) {\n const scrollNodeTopChange =\n // eslint-disable-next-line no-unsafe-optional-chaining\n vi.pInfo?.bufferNewCords?.top - vi.pInfo?.bufferOldCords?.top || 0;\n scrollTop = (vi.pInfo.topRowIndex / itemCount) * rowContainerHeight - scrollNodeTopChange;\n }\n return scrollTop;\n },\n [vi]\n );\n\n const onRowContainerDimensionChange = useCallback(() => {\n const { height: rowContainerHeight, width: rowContainerWidth } =\n getRowContainer()?.getBoundingClientRect() ?? {};\n // trigger virtualizer operations only when row container has some height and width\n if (rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [getRowContainer]);\n\n useResizeObserver(getRowContainer, onRowContainerDimensionChange);\n\n const [updateScrollTop] = useScroll(\n getPagination,\n getPContainer,\n vi,\n getTotalRowsIncludingBuffer(),\n renderHeader,\n isFetching,\n viewHeight,\n PAGINATION_TRIGGER_RATIOS\n );\n\n useLayoutEffect(() => {\n const rContainer = getRowContainer();\n if (state && state.startIndex >= 0 && vi && rContainer) {\n setAttributesOnItems(state, rContainer);\n }\n });\n\n useLayoutEffect(() => {\n if (isFetching || !isInitialized) return;\n\n const rowElements = Array.from(getRowContainer().children || []).filter(a =>\n a.hasAttribute('data-key')\n );\n if (!rowElements.length) {\n vi.totalRowsLoaded = 0;\n return;\n }\n\n const lastRow = rowElements[rowElements.length - 1];\n const lastRowDataIndex = parseInt(lastRow.getAttribute('data-index'), 10);\n const newCount = hasMoreResults ? lastRowDataIndex + 1 + rowBuffer : lastRowDataIndex + 1;\n\n // if user is scrolling up/down within the already encountered records, the record count shouldn't update\n if (newCount < getTotalRowsIncludingBuffer() && !resetCount) return;\n\n vi.totalRowsLoaded = lastRowDataIndex + 1;\n countUpdateCallback(vi.totalRowsLoaded);\n }, [children, isFetching]);\n\n // Get estimate and update buffer height\n useLayoutEffect(() => {\n if (!isInitialized) return;\n\n vi.currentEstimation = getCurrentEstimation(getRowContainer(), true);\n updateAvarageInVirtualizeInstance(vi.currentEstimation);\n const h = getBufferHeight(vi.currentEstimation);\n getBContainer().style.height = `${h}px`;\n }, [\n vi,\n children,\n rContainerDimensionUpdate,\n getBContainer,\n getBufferHeight,\n getRowContainer,\n getTotalRowsIncludingBuffer,\n updateAvarageInVirtualizeInstance\n ]);\n\n useLayoutEffect(() => {\n if (isFetching || !isInitialized) return;\n\n const pContainer = getPContainer();\n const scrollTop = getScrollTop(vi.currentEstimation);\n if (vi.pInfo.view.startIndex !== 0) pContainer.scrollTop = scrollTop;\n\n // Setting scrollTop from pContainer.scrollTop as getScrollTop can return value with higher decimal accuracy.\n // but scrollTop attribute from HTML element will round it automatically.\n updateScrollTop(pContainer.scrollTop);\n updateRowContainerTop(\n vi,\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n state,\n pContainer,\n pContainer.scrollTop\n );\n }, [\n vi,\n state,\n isFetching,\n getScrollTop,\n getPContainer,\n updateScrollTop,\n getTotalRowsIncludingBuffer\n ]);\n\n // On mount that means state is not initialized yet, trigger pagination.\n // or whenever count changes or width /height of view port changes, if view is not filled with data, get indexes again.\n useEffect(() => {\n if (isFetching) return;\n\n if (!isInitialized) {\n getPagination(true);\n return;\n }\n\n if (\n isViewNotFilled(\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n getPContainer(),\n renderHeader\n )\n ) {\n getPagination(false, true);\n } else {\n setLoadingIndicatorInfo({});\n }\n }, [\n vi,\n isFetching,\n children,\n viewWidth,\n viewHeight,\n renderHeader,\n rContainerDimensionUpdate,\n getPagination,\n getPContainer,\n getTotalRowsIncludingBuffer\n ]);\n\n return (\n <StyledPContainer\n $style={{\n maxHeight,\n minHeight: !vi.totalRowsLoaded ? '100px' : 'auto',\n renderFooter,\n itemHeight,\n height,\n width\n }}\n data-total-records={vi.totalRowsLoaded}\n className='pContainer'\n ref={c => {\n vi.pContainer = c;\n }}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={c => {\n vi.bContainer = c;\n }}\n >\n <div\n className={`${rowContainerClass} row-container`}\n ref={c => {\n vi.rContainer = c;\n }}\n role='rowgroup'\n >\n {/* Show loader only when there are some rows otherwise the parent spinner on RS should appear.\n Since in case of infinite table, totalRowsLoaded is derived from the rows only, using totalRowsLoaded here. */}\n {vi.totalRowsLoaded >= 0 &&\n showLoadingIndicator &&\n isFetching &&\n loadingIndicatorInfo.isScrollingUp && (\n <StyledLoader $style={{ bottom: '100%' }}>\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n {children}\n {vi.totalRowsLoaded >= 0 &&\n showLoadingIndicator &&\n isFetching &&\n loadingIndicatorInfo.isScrollingDown && (\n <StyledLoader $style={{ top: '100%' }}>\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n </div>\n {vi.totalRowsLoaded === 0 && !isFetching\n ? renderEmptyRecords && renderEmptyRecords()\n : null}\n {renderFooter && renderFooter()}\n </StyledPContainer>\n );\n }\n);\n\nVirtualizeInfinite.propTypes = {\n id: PropTypes.string.isRequired,\n viewHeight: PropTypes.number,\n viewWidth: PropTypes.number,\n itemHeight: PropTypes.number,\n callback: PropTypes.func,\n isFetching: PropTypes.bool,\n hasMoreResults: PropTypes.bool,\n rowContainerClass: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,\n renderHeader: PropTypes.func,\n renderFooter: PropTypes.func,\n state: PropTypes.shape({\n startIndex: PropTypes.number,\n endIndex: PropTypes.number\n }),\n bufferMultiplier: PropTypes.number,\n viewMaxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n showLoadingIndicator: PropTypes.bool,\n resetCount: PropTypes.bool,\n countUpdateCallback: PropTypes.func,\n renderEmptyRecords: PropTypes.func\n};\n\nVirtualizeInfinite.defaultProps = {\n bufferMultiplier: 2,\n callback: () => {},\n isFetching: false,\n hasMoreResults: false,\n rowContainerClass: '',\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false,\n resetCount: false,\n countUpdateCallback: () => {},\n renderEmptyRecords: null\n};\n\nVirtualizeInfinite.displayName = 'VirtualizeInfinite';\n\nexport default memo(VirtualizeInfinite);\n"]}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* This component is only used for grouped table
|
|
4
|
+
*/
|
|
2
5
|
import { forwardRef, memo, useEffect, useRef, useCallback, useImperativeHandle, useMemo, useLayoutEffect, useState } from 'react';
|
|
3
6
|
import Styled from 'styled-components';
|
|
4
7
|
import PropTypes from 'prop-types';
|
|
5
8
|
import { defaultThemeProp, Progress } from '@pega/cosmos-react-core';
|
|
6
9
|
import { isEmpty } from 'pega-repeating-structures-core';
|
|
7
|
-
import EmptyContainer from '../DefaultComponents/EmptyContainer';
|
|
8
10
|
import useTranslate from '../../Hooks/useTranslate';
|
|
9
11
|
import { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';
|
|
10
12
|
import getPaginationInfo from './Pagination';
|
|
11
13
|
import useScroll from './UseScroll';
|
|
12
|
-
import { getCurrentEstimation, updateRowContainerTop, setAttributesOnItems, isViewNotFilled, getRecordCountForLayoutPaint,
|
|
14
|
+
import { getCurrentEstimation, updateRowContainerTop, setAttributesOnItems, isViewNotFilled, getRecordCountForLayoutPaint, getValueWithUnit, getMaxHeight, getPContainerClientWidth } from './utility';
|
|
13
15
|
import useResizeObserver from './UseResizeObserver';
|
|
14
16
|
function getBContainerMinHeight(props) {
|
|
15
17
|
return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';
|
|
@@ -35,7 +37,6 @@ const StyledPContainer = Styled.div `
|
|
|
35
37
|
props.$style.height?.startsWith?.('auto')
|
|
36
38
|
? 'relative'
|
|
37
39
|
: 'sticky'};
|
|
38
|
-
width: 0;
|
|
39
40
|
min-height: ${props => getBContainerMinHeight(props)};
|
|
40
41
|
border-radius: inherit;
|
|
41
42
|
}
|
|
@@ -46,11 +47,11 @@ const StyledLoader = Styled.div `
|
|
|
46
47
|
justify-content: center;
|
|
47
48
|
padding: 0.5rem;
|
|
48
49
|
position: absolute;
|
|
49
|
-
width:
|
|
50
|
+
width: 100%;
|
|
50
51
|
left: ${props => `var(${props.$style.left})`};
|
|
51
52
|
top: ${props => `var(${props.$style.top})`};
|
|
52
53
|
`;
|
|
53
|
-
const Virtualize = forwardRef(({ id, viewHeight, viewWidth, totalRecordCount, itemHeight, callback, isFetching, rowContainerClass, children, renderHeader, renderFooter, state, bufferMultiplier, viewMaxHeight, showLoadingIndicator }, inputRef) => {
|
|
54
|
+
const Virtualize = forwardRef(({ id, viewHeight, viewWidth, totalRecordCount, itemHeight, callback, isFetching, rowContainerClass, children, renderHeader, renderFooter, state, bufferMultiplier, viewMaxHeight, showLoadingIndicator, renderEmptyRecords }, inputRef) => {
|
|
54
55
|
const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();
|
|
55
56
|
const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});
|
|
56
57
|
const [translate] = useTranslate();
|
|
@@ -85,7 +86,7 @@ const Virtualize = forwardRef(({ id, viewHeight, viewWidth, totalRecordCount, it
|
|
|
85
86
|
height: getValueWithUnit(viewHeight, 'auto')
|
|
86
87
|
}), [viewWidth, viewHeight]);
|
|
87
88
|
const maxHeight = useMemo(() => getMaxHeight(viewMaxHeight), [viewMaxHeight]);
|
|
88
|
-
const minHeight = useMemo(() => (totalRecordCount
|
|
89
|
+
const minHeight = useMemo(() => (!totalRecordCount ? '100px' : 'auto'), [totalRecordCount]);
|
|
89
90
|
// Calculate the pagination indexes and notify callback.
|
|
90
91
|
// resetIsFetchingWhenNoNewIndexes - flag specific for isViewNotFilled
|
|
91
92
|
// If view is not filled, we want to call this but restting isFetch to false
|
|
@@ -216,8 +217,7 @@ const Virtualize = forwardRef(({ id, viewHeight, viewWidth, totalRecordCount, it
|
|
|
216
217
|
getRowContainer,
|
|
217
218
|
getBContainer
|
|
218
219
|
]);
|
|
219
|
-
//
|
|
220
|
-
// because bContainer has 0 width and row-container's width doesn't changes in sync with pContainer
|
|
220
|
+
// Added this block to overcome clipping issue for group header.
|
|
221
221
|
const onPContainerDimensionUpdate = useCallback(() => {
|
|
222
222
|
getPContainer()?.style.setProperty('--container-width', `${getPContainerClientWidth(getPContainer())}px`);
|
|
223
223
|
}, [getPContainer]);
|
|
@@ -262,15 +262,21 @@ const Virtualize = forwardRef(({ id, viewHeight, viewWidth, totalRecordCount, it
|
|
|
262
262
|
vi.pContainer = c;
|
|
263
263
|
}, children: [renderHeader && renderHeader(), _jsxs("div", { className: 'bContainer', ref: c => {
|
|
264
264
|
vi.bContainer = c;
|
|
265
|
-
}, children: [
|
|
265
|
+
}, children: [totalRecordCount >= 0 &&
|
|
266
|
+
showLoadingIndicator &&
|
|
267
|
+
isFetching &&
|
|
268
|
+
loadingIndicatorInfo.isScrollingUp && (_jsx(StyledLoader, { "$style": {
|
|
266
269
|
top: '--above-loader-top',
|
|
267
270
|
left: '--loader-left'
|
|
268
271
|
}, children: _jsx(Progress, { className: 'above-loader', placement: 'block', tabIndex: 0, "aria-label": translate('Loading more results') }) })), _jsx("div", { className: `${rowContainerClass} row-container`, ref: c => {
|
|
269
272
|
vi.rContainer = c;
|
|
270
|
-
},
|
|
273
|
+
}, role: 'rowgroup', children: totalRecordCount === 0 && !isFetching ? null : children }), totalRecordCount >= 0 &&
|
|
274
|
+
showLoadingIndicator &&
|
|
275
|
+
isFetching &&
|
|
276
|
+
loadingIndicatorInfo.isScrollingDown && (_jsx(StyledLoader, { "$style": {
|
|
271
277
|
top: '--below-loader-top',
|
|
272
278
|
left: '--loader-left'
|
|
273
|
-
}, children: _jsx(Progress, { className: 'below-loader', placement: 'block', tabIndex: 0, "aria-label": translate('Loading more results') }) }))] }), totalRecordCount === 0 ?
|
|
279
|
+
}, children: _jsx(Progress, { className: 'below-loader', placement: 'block', tabIndex: 0, "aria-label": translate('Loading more results') }) }))] }), totalRecordCount === 0 ? renderEmptyRecords && renderEmptyRecords() : null, renderFooter && renderFooter()] }));
|
|
274
280
|
});
|
|
275
281
|
Virtualize.propTypes = {
|
|
276
282
|
id: PropTypes.string.isRequired,
|
|
@@ -290,7 +296,8 @@ Virtualize.propTypes = {
|
|
|
290
296
|
}),
|
|
291
297
|
bufferMultiplier: PropTypes.number,
|
|
292
298
|
viewMaxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
293
|
-
showLoadingIndicator: PropTypes.bool
|
|
299
|
+
showLoadingIndicator: PropTypes.bool,
|
|
300
|
+
renderEmptyRecords: PropTypes.func
|
|
294
301
|
};
|
|
295
302
|
Virtualize.defaultProps = {
|
|
296
303
|
bufferMultiplier: 2,
|
|
@@ -304,7 +311,8 @@ Virtualize.defaultProps = {
|
|
|
304
311
|
state: undefined,
|
|
305
312
|
totalRecordCount: undefined,
|
|
306
313
|
viewMaxHeight: undefined,
|
|
307
|
-
showLoadingIndicator: false
|
|
314
|
+
showLoadingIndicator: false,
|
|
315
|
+
renderEmptyRecords: null
|
|
308
316
|
};
|
|
309
317
|
Virtualize.displayName = 'Virtualize';
|
|
310
318
|
export default memo(Virtualize);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,E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,CAAC;QACrB,UAAU,EAAE,SAAS,CAAC,MAAM;QAC5B,QAAQ,EAAE,SAAS,CAAC,MAAM;KAC3B,CAAC;IACF,gBAAgB,EAAE,SAAS,CAAC,MAAM;IAClC,aAAa,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxE,oBAAoB,EAAE,SAAS,CAAC,IAAI;CACrC,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG;IACxB,gBAAgB,EAAE,CAAC;IACnB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,UAAU,EAAE,KAAK;IACjB,iBAAiB,EAAE,EAAE;IACrB,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS;IAChB,gBAAgB,EAAE,SAAS;IAC3B,aAAa,EAAE,SAAS;IACxB,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,eAAe,IAAI,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n memo,\n useEffect,\n useRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useLayoutEffect,\n useState\n} from 'react';\nimport Styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { defaultThemeProp, Progress } from '@pega/cosmos-react-core';\nimport { isEmpty } from 'pega-repeating-structures-core';\n\nimport EmptyContainer from '../DefaultComponents/EmptyContainer';\nimport useTranslate from '../../Hooks/useTranslate';\nimport { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n updateRowContainerTop,\n setAttributesOnItems,\n isViewNotFilled,\n getRecordCountForLayoutPaint,\n getPContainerClientWidth,\n getValueWithUnit,\n getMaxHeight\n} from './utility';\nimport useResizeObserver from './UseResizeObserver';\n\nfunction getBContainerMinHeight(props) {\n return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';\n}\n\nconst StyledPContainer = Styled.div`\n position: relative;\n overflow: auto;\n max-height: ${props => props.$style.maxHeight};\n width: ${props => props.$style.width};\n height: ${props => props.$style.height};\n min-height: ${props => props.$style.minHeight};\n\n &:has(${StyledSkeletonRow}) {\n overflow: hidden;\n }\n\n /**\n * When height and maxHeight is auto, virtualization is not going to happen and the scroll jump on row deletion scenario is not going to happen.\n * In such cases, using relative position as sticky was used to fix scroll jump in firefox during virtualization.\n */\n .bContainer {\n position: ${props =>\n props.$style.maxHeight?.startsWith?.('auto') &&\n props.$style.height?.startsWith?.('auto')\n ? 'relative'\n : 'sticky'};\n width: 0;\n min-height: ${props => getBContainerMinHeight(props)};\n border-radius: inherit;\n }\n`;\n\nStyledPContainer.defaultProps = defaultThemeProp;\n\nconst StyledLoader = Styled.div`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: var(--container-width);\n left: ${props => `var(${props.$style.left})`};\n top: ${props => `var(${props.$style.top})`};\n`;\n\nconst Virtualize = forwardRef(\n (\n {\n id,\n viewHeight,\n viewWidth,\n totalRecordCount,\n itemHeight,\n callback,\n isFetching,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n viewMaxHeight,\n showLoadingIndicator\n },\n inputRef\n ) => {\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\n const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});\n const [translate] = useTranslate();\n // Create ref to store virtualize related data.\n const vi = useRef({\n itemHeight,\n bufferMultiplier,\n pInfo: {}\n }).current;\n\n const getRowContainer = useCallback(() => vi.rContainer, [vi.rContainer]);\n const getPContainer = useCallback(() => vi.pContainer, [vi.pContainer]);\n const getBContainer = useCallback(() => vi.bContainer, [vi.bContainer]);\n\n // API used when user want to scroll to top programmatically.\n // Though component auto scroll to top if no element is in view.\n // But calling this API upfront might save one extra call to Fetch API.\n const scrollToTop = useCallback(() => {\n if (!state) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n false,\n true\n );\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }, [id, vi, state, getPContainer]);\n\n // expose APIs and properties here to help client to communicate.\n useImperativeHandle(inputRef, () => ({\n getParentContainer: getPContainer,\n scrollToTop,\n vi,\n id\n }));\n\n const { width, height } = useMemo(\n () => ({\n width: getValueWithUnit(viewWidth, '100%'),\n height: getValueWithUnit(viewHeight, 'auto')\n }),\n [viewWidth, viewHeight]\n );\n\n const maxHeight = useMemo(() => getMaxHeight(viewMaxHeight), [viewMaxHeight]);\n\n const minHeight = useMemo(\n () => (totalRecordCount === 0 ? '100px' : 'auto'),\n [totalRecordCount]\n );\n\n // Calculate the pagination indexes and notify callback.\n // resetIsFetchingWhenNoNewIndexes - flag specific for isViewNotFilled\n // If view is not filled, we want to call this but restting isFetch to false\n // goes to this methid when callback is note fired.\n const getPagination = useCallback(\n (isRefresh = false, resetIsFetchingWhenNoNewIndexes = false) => {\n if (resetIsFetchingWhenNoNewIndexes) {\n setLoadingIndicatorInfo({});\n }\n const pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n isRefresh\n );\n const { startIndex, endIndex } = pInfo.view;\n // if new indexes are subset of existing state indexes, no need to update the consumer.\n if (!state || !(startIndex >= state.startIndex && endIndex <= state.endIndex)) {\n vi.pInfo = pInfo;\n if (state) {\n const { startIndex: oldStartIndex, endIndex: oldEndIndex } = state;\n if (startIndex < oldStartIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingUp: true };\n });\n }\n if (endIndex > oldEndIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingDown: true };\n });\n }\n }\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }\n },\n [vi, totalRecordCount, state, callback, id, getPContainer]\n );\n\n // update average stats for next calculation.\n const updateAverageInVirtualizeInstance = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight, averageNumberOfItemsInARow, averageRowHeight } =\n currentEstimation;\n Object.assign(vi, {\n itemCount: (itemCount + vi.itemCount || itemCount) / 2,\n rowContainerHeight:\n (rowContainerHeight + vi.rowContainerHeight || rowContainerHeight) / 2,\n averageNumberOfItemsInARow:\n (averageNumberOfItemsInARow + vi.averageNumberOfItemsInARow ||\n averageNumberOfItemsInARow) / 2,\n averageRowHeight: (averageRowHeight + vi.averageRowHeight || averageRowHeight) / 2\n });\n },\n [vi]\n );\n\n const getBufferHeight = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let h = 0;\n if (itemCount > 0)\n h = (getRecordCountForLayoutPaint(totalRecordCount) / itemCount) * rowContainerHeight;\n return h;\n },\n [totalRecordCount]\n );\n\n const getScrollTop = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let scrollTop = 0;\n if (itemCount > 0) {\n const scrollNodeTopChange =\n // eslint-disable-next-line no-unsafe-optional-chaining\n vi.pInfo?.bufferNewCords?.top - vi.pInfo?.bufferOldCords?.top || 0;\n scrollTop = (vi.pInfo.topRowIndex / itemCount) * rowContainerHeight - scrollNodeTopChange;\n }\n return scrollTop;\n },\n [vi]\n );\n\n const onRowContainerDimensionChange = useCallback(() => {\n const { height: rowContainerHeight, width: rowContainerWidth } =\n getRowContainer()?.getBoundingClientRect() ?? {};\n // trigger virtualizer operations only when row container has some height and width\n if (rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [getRowContainer]);\n\n // observe on row container to adjust the buffer container height.\n useResizeObserver(getRowContainer, onRowContainerDimensionChange);\n\n const [updateScrollTop] = useScroll(\n getPagination,\n getPContainer,\n vi,\n totalRecordCount,\n renderHeader,\n isFetching,\n viewHeight\n );\n\n useLayoutEffect(() => {\n const rContainer = getRowContainer();\n if (state && state.startIndex >= 0 && vi && rContainer) {\n setAttributesOnItems(state, rContainer);\n }\n });\n\n // Get estimate and update buffer height\n useLayoutEffect(() => {\n if (state && !isEmpty(totalRecordCount)) {\n vi.currentEstimation = getCurrentEstimation(getRowContainer());\n updateAverageInVirtualizeInstance(vi.currentEstimation);\n const h = Math.floor(getBufferHeight(vi.currentEstimation));\n const previousHeight = getBContainer().offsetHeight;\n\n getBContainer().style.height = `${h}px`;\n vi.bContainerHeight = h;\n\n // if there was no previous height, then keep the scrolltop to 0 by default\n if (h !== previousHeight && previousHeight) {\n const pContainer = getPContainer();\n const scrollTop = getScrollTop(vi.currentEstimation);\n if (scrollTop >= 0) {\n pContainer.scrollTop = scrollTop;\n }\n }\n }\n }, [\n rContainerDimensionUpdate,\n getBContainer,\n getBufferHeight,\n getRowContainer,\n state,\n totalRecordCount,\n updateAverageInVirtualizeInstance,\n vi,\n getPContainer,\n getScrollTop\n ]);\n\n // update parent scroll top and row container top.\n useLayoutEffect(() => {\n if (state && !isEmpty(totalRecordCount)) {\n const pContainer = getPContainer();\n\n // Setting scrollTop from pContainer.scrollTop as getScrollTop can return value with higher decimal accuracy.\n // but scrollTop attribute from HTML element will round it automatically.\n updateScrollTop(pContainer.scrollTop);\n updateRowContainerTop(\n vi,\n getRecordCountForLayoutPaint(totalRecordCount),\n state,\n pContainer,\n pContainer.scrollTop\n );\n\n const topLoaderHeight = 80;\n let top = getRowContainer().style.top;\n if (!top) {\n top = 0;\n }\n getBContainer().style.setProperty(\n '--above-loader-top',\n `${parseInt(top, 10) - topLoaderHeight}px`\n );\n\n getBContainer().style.setProperty(\n '--below-loader-top',\n `${parseInt(top, 10) + getRowContainer().offsetHeight}px`\n );\n }\n }, [\n getPContainer,\n getScrollTop,\n state,\n updateScrollTop,\n vi,\n rContainerDimensionUpdate,\n totalRecordCount,\n getRowContainer,\n getBContainer\n ]);\n\n // setting pContainer's width whenever pContainer dimension updates,\n // because bContainer has 0 width and row-container's width doesn't changes in sync with pContainer\n const onPContainerDimensionUpdate = useCallback(() => {\n getPContainer()?.style.setProperty(\n '--container-width',\n `${getPContainerClientWidth(getPContainer())}px`\n );\n }, [getPContainer]);\n\n // observe on pContainer to adjust the width of row container.\n useResizeObserver(getPContainer, onPContainerDimensionUpdate);\n\n // On mount that means state is not initialized yet, trigger pagination.\n // or whenever count changes or width /height of view port changes, if view is not filled with data, get indexes again.\n useEffect(() => {\n if (state && !isFetching && !isEmpty(totalRecordCount)) {\n if (\n isViewNotFilled(\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n getPContainer(),\n renderHeader\n )\n )\n getPagination(false, true);\n else {\n setLoadingIndicatorInfo({});\n }\n } else if (!state || !Object.keys(vi.pInfo).length) getPagination(true);\n }, [\n rContainerDimensionUpdate,\n state,\n vi,\n totalRecordCount,\n viewHeight,\n viewWidth,\n renderHeader,\n getPagination,\n getPContainer\n ]);\n\n useEffect(() => {\n if (!isFetching) return;\n getBContainer().style.setProperty('--loader-left', `${getPContainer().scrollLeft}px`);\n }, [isFetching, getPContainer()?.scrollLeft]);\n\n return (\n <StyledPContainer\n $style={{\n maxHeight,\n minHeight,\n renderFooter,\n itemHeight,\n height,\n width\n }}\n data-total-records={totalRecordCount}\n className='pContainer'\n ref={c => {\n vi.pContainer = c;\n }}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={c => {\n vi.bContainer = c;\n }}\n >\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingUp && (\n <StyledLoader\n $style={{\n top: '--above-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n <div\n className={`${rowContainerClass} row-container`}\n ref={c => {\n vi.rContainer = c;\n }}\n style={{ width: 'var(--container-width)' }}\n role='rowgroup'\n >\n {/** Do not add any other element in row-container apart from the rows as it will generate incorrect estimations */}\n {children}\n </div>\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingDown && (\n <StyledLoader\n $style={{\n top: '--below-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n {totalRecordCount === 0 ? <EmptyContainer /> : null}\n {renderFooter && renderFooter()}\n </StyledPContainer>\n );\n }\n);\n\nVirtualize.propTypes = {\n id: PropTypes.string.isRequired,\n viewHeight: PropTypes.number,\n viewWidth: PropTypes.number,\n totalRecordCount: PropTypes.number,\n itemHeight: PropTypes.number,\n callback: PropTypes.func,\n isFetching: PropTypes.bool,\n rowContainerClass: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,\n renderHeader: PropTypes.func,\n renderFooter: PropTypes.func,\n state: PropTypes.shape({\n startIndex: PropTypes.number,\n endIndex: PropTypes.number\n }),\n bufferMultiplier: PropTypes.number,\n viewMaxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n showLoadingIndicator: PropTypes.bool\n};\n\nVirtualize.defaultProps = {\n bufferMultiplier: 2,\n callback: () => {},\n isFetching: false,\n rowContainerClass: '',\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n totalRecordCount: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false\n};\n\nVirtualize.displayName = 'Virtualize';\n\nexport default memo(Virtualize);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/index.jsx"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC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AC1B,iBAAiB,EAAE,SAAS,CAAC,MAAM;IACnC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU;IAC7E,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC;QACrB,UAAU,EAAE,SAAS,CAAC,MAAM;QAC5B,QAAQ,EAAE,SAAS,CAAC,MAAM;KAC3B,CAAC;IACF,gBAAgB,EAAE,SAAS,CAAC,MAAM;IAClC,aAAa,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxE,oBAAoB,EAAE,SAAS,CAAC,IAAI;IACpC,kBAAkB,EAAE,SAAS,CAAC,IAAI;CACnC,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG;IACxB,gBAAgB,EAAE,CAAC;IACnB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,UAAU,EAAE,KAAK;IACjB,iBAAiB,EAAE,EAAE;IACrB,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS;IAChB,gBAAgB,EAAE,SAAS;IAC3B,aAAa,EAAE,SAAS;IACxB,oBAAoB,EAAE,KAAK;IAC3B,kBAAkB,EAAE,IAAI;CACzB,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,eAAe,IAAI,CAAC,UAAU,CAAC,CAAC","sourcesContent":["/**\n * This component is only used for grouped table\n */\n\nimport {\n forwardRef,\n memo,\n useEffect,\n useRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useLayoutEffect,\n useState\n} from 'react';\nimport Styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { defaultThemeProp, Progress } from '@pega/cosmos-react-core';\nimport { isEmpty } from 'pega-repeating-structures-core';\n\nimport useTranslate from '../../Hooks/useTranslate';\nimport { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n updateRowContainerTop,\n setAttributesOnItems,\n isViewNotFilled,\n getRecordCountForLayoutPaint,\n getValueWithUnit,\n getMaxHeight,\n getPContainerClientWidth\n} from './utility';\nimport useResizeObserver from './UseResizeObserver';\n\nfunction getBContainerMinHeight(props) {\n return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';\n}\n\nconst StyledPContainer = Styled.div`\n position: relative;\n overflow: auto;\n max-height: ${props => props.$style.maxHeight};\n width: ${props => props.$style.width};\n height: ${props => props.$style.height};\n min-height: ${props => props.$style.minHeight};\n\n &:has(${StyledSkeletonRow}) {\n overflow: hidden;\n }\n\n /**\n * When height and maxHeight is auto, virtualization is not going to happen and the scroll jump on row deletion scenario is not going to happen.\n * In such cases, using relative position as sticky was used to fix scroll jump in firefox during virtualization.\n */\n .bContainer {\n position: ${props =>\n props.$style.maxHeight?.startsWith?.('auto') &&\n props.$style.height?.startsWith?.('auto')\n ? 'relative'\n : 'sticky'};\n min-height: ${props => getBContainerMinHeight(props)};\n border-radius: inherit;\n }\n`;\n\nStyledPContainer.defaultProps = defaultThemeProp;\n\nconst StyledLoader = Styled.div`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: 100%;\n left: ${props => `var(${props.$style.left})`};\n top: ${props => `var(${props.$style.top})`};\n`;\n\nconst Virtualize = forwardRef(\n (\n {\n id,\n viewHeight,\n viewWidth,\n totalRecordCount,\n itemHeight,\n callback,\n isFetching,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n viewMaxHeight,\n showLoadingIndicator,\n renderEmptyRecords\n },\n inputRef\n ) => {\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\n const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});\n const [translate] = useTranslate();\n // Create ref to store virtualize related data.\n const vi = useRef({\n itemHeight,\n bufferMultiplier,\n pInfo: {}\n }).current;\n\n const getRowContainer = useCallback(() => vi.rContainer, [vi.rContainer]);\n const getPContainer = useCallback(() => vi.pContainer, [vi.pContainer]);\n const getBContainer = useCallback(() => vi.bContainer, [vi.bContainer]);\n\n // API used when user want to scroll to top programmatically.\n // Though component auto scroll to top if no element is in view.\n // But calling this API upfront might save one extra call to Fetch API.\n const scrollToTop = useCallback(() => {\n if (!state) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n false,\n true\n );\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }, [id, vi, state, getPContainer]);\n\n // expose APIs and properties here to help client to communicate.\n useImperativeHandle(inputRef, () => ({\n getParentContainer: getPContainer,\n scrollToTop,\n vi,\n id\n }));\n\n const { width, height } = useMemo(\n () => ({\n width: getValueWithUnit(viewWidth, '100%'),\n height: getValueWithUnit(viewHeight, 'auto')\n }),\n [viewWidth, viewHeight]\n );\n\n const maxHeight = useMemo(() => getMaxHeight(viewMaxHeight), [viewMaxHeight]);\n\n const minHeight = useMemo(() => (!totalRecordCount ? '100px' : 'auto'), [totalRecordCount]);\n\n // Calculate the pagination indexes and notify callback.\n // resetIsFetchingWhenNoNewIndexes - flag specific for isViewNotFilled\n // If view is not filled, we want to call this but restting isFetch to false\n // goes to this methid when callback is note fired.\n const getPagination = useCallback(\n (isRefresh = false, resetIsFetchingWhenNoNewIndexes = false) => {\n if (resetIsFetchingWhenNoNewIndexes) {\n setLoadingIndicatorInfo({});\n }\n const pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n isRefresh\n );\n const { startIndex, endIndex } = pInfo.view;\n // if new indexes are subset of existing state indexes, no need to update the consumer.\n if (!state || !(startIndex >= state.startIndex && endIndex <= state.endIndex)) {\n vi.pInfo = pInfo;\n if (state) {\n const { startIndex: oldStartIndex, endIndex: oldEndIndex } = state;\n if (startIndex < oldStartIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingUp: true };\n });\n }\n if (endIndex > oldEndIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingDown: true };\n });\n }\n }\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }\n },\n [vi, totalRecordCount, state, callback, id, getPContainer]\n );\n\n // update average stats for next calculation.\n const updateAverageInVirtualizeInstance = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight, averageNumberOfItemsInARow, averageRowHeight } =\n currentEstimation;\n Object.assign(vi, {\n itemCount: (itemCount + vi.itemCount || itemCount) / 2,\n rowContainerHeight:\n (rowContainerHeight + vi.rowContainerHeight || rowContainerHeight) / 2,\n averageNumberOfItemsInARow:\n (averageNumberOfItemsInARow + vi.averageNumberOfItemsInARow ||\n averageNumberOfItemsInARow) / 2,\n averageRowHeight: (averageRowHeight + vi.averageRowHeight || averageRowHeight) / 2\n });\n },\n [vi]\n );\n\n const getBufferHeight = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let h = 0;\n if (itemCount > 0)\n h = (getRecordCountForLayoutPaint(totalRecordCount) / itemCount) * rowContainerHeight;\n return h;\n },\n [totalRecordCount]\n );\n\n const getScrollTop = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let scrollTop = 0;\n if (itemCount > 0) {\n const scrollNodeTopChange =\n // eslint-disable-next-line no-unsafe-optional-chaining\n vi.pInfo?.bufferNewCords?.top - vi.pInfo?.bufferOldCords?.top || 0;\n scrollTop = (vi.pInfo.topRowIndex / itemCount) * rowContainerHeight - scrollNodeTopChange;\n }\n return scrollTop;\n },\n [vi]\n );\n\n const onRowContainerDimensionChange = useCallback(() => {\n const { height: rowContainerHeight, width: rowContainerWidth } =\n getRowContainer()?.getBoundingClientRect() ?? {};\n\n // trigger virtualizer operations only when row container has some height and width\n if (rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [getRowContainer]);\n\n // observe on row container to adjust the buffer container height.\n useResizeObserver(getRowContainer, onRowContainerDimensionChange);\n\n const [updateScrollTop] = useScroll(\n getPagination,\n getPContainer,\n vi,\n totalRecordCount,\n renderHeader,\n isFetching,\n viewHeight\n );\n\n useLayoutEffect(() => {\n const rContainer = getRowContainer();\n if (state && state.startIndex >= 0 && vi && rContainer) {\n setAttributesOnItems(state, rContainer);\n }\n });\n\n // Get estimate and update buffer height\n useLayoutEffect(() => {\n if (state && !isEmpty(totalRecordCount)) {\n vi.currentEstimation = getCurrentEstimation(getRowContainer());\n updateAverageInVirtualizeInstance(vi.currentEstimation);\n const h = Math.floor(getBufferHeight(vi.currentEstimation));\n const previousHeight = getBContainer().offsetHeight;\n\n getBContainer().style.height = `${h}px`;\n vi.bContainerHeight = h;\n\n // if there was no previous height, then keep the scrolltop to 0 by default\n if (h !== previousHeight && previousHeight) {\n const pContainer = getPContainer();\n const scrollTop = getScrollTop(vi.currentEstimation);\n if (scrollTop >= 0) {\n pContainer.scrollTop = scrollTop;\n }\n }\n }\n }, [\n rContainerDimensionUpdate,\n getBContainer,\n getBufferHeight,\n getRowContainer,\n state,\n totalRecordCount,\n updateAverageInVirtualizeInstance,\n vi,\n getPContainer,\n getScrollTop\n ]);\n\n // update parent scroll top and row container top.\n useLayoutEffect(() => {\n if (state && !isEmpty(totalRecordCount)) {\n const pContainer = getPContainer();\n\n // Setting scrollTop from pContainer.scrollTop as getScrollTop can return value with higher decimal accuracy.\n // but scrollTop attribute from HTML element will round it automatically.\n updateScrollTop(pContainer.scrollTop);\n updateRowContainerTop(\n vi,\n getRecordCountForLayoutPaint(totalRecordCount),\n state,\n pContainer,\n pContainer.scrollTop\n );\n\n const topLoaderHeight = 80;\n let top = getRowContainer().style.top;\n if (!top) {\n top = 0;\n }\n getBContainer().style.setProperty(\n '--above-loader-top',\n `${parseInt(top, 10) - topLoaderHeight}px`\n );\n\n getBContainer().style.setProperty(\n '--below-loader-top',\n `${parseInt(top, 10) + getRowContainer().offsetHeight}px`\n );\n }\n }, [\n getPContainer,\n getScrollTop,\n state,\n updateScrollTop,\n vi,\n rContainerDimensionUpdate,\n totalRecordCount,\n getRowContainer,\n getBContainer\n ]);\n\n // Added this block to overcome clipping issue for group header.\n const onPContainerDimensionUpdate = useCallback(() => {\n getPContainer()?.style.setProperty(\n '--container-width',\n `${getPContainerClientWidth(getPContainer())}px`\n );\n }, [getPContainer]);\n\n // observe on pContainer to adjust the width of row container.\n useResizeObserver(getPContainer, onPContainerDimensionUpdate);\n\n // On mount that means state is not initialized yet, trigger pagination.\n // or whenever count changes or width /height of view port changes, if view is not filled with data, get indexes again.\n useEffect(() => {\n if (state && !isFetching && !isEmpty(totalRecordCount)) {\n if (\n isViewNotFilled(\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n getPContainer(),\n renderHeader\n )\n )\n getPagination(false, true);\n else {\n setLoadingIndicatorInfo({});\n }\n } else if (!state || !Object.keys(vi.pInfo).length) getPagination(true);\n }, [\n rContainerDimensionUpdate,\n state,\n vi,\n totalRecordCount,\n viewHeight,\n viewWidth,\n renderHeader,\n getPagination,\n getPContainer\n ]);\n\n useEffect(() => {\n if (!isFetching) return;\n getBContainer().style.setProperty('--loader-left', `${getPContainer().scrollLeft}px`);\n }, [isFetching, getPContainer()?.scrollLeft]);\n\n return (\n <StyledPContainer\n $style={{\n maxHeight,\n minHeight,\n renderFooter,\n itemHeight,\n height,\n width\n }}\n data-total-records={totalRecordCount}\n className='pContainer'\n ref={c => {\n vi.pContainer = c;\n }}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={c => {\n vi.bContainer = c;\n }}\n >\n {/* Show loader only when there are some rows otherwise the parent spinner on RS should appear.\n Since in case of grouped table, presence of totalRecordsCount is always available and is tied with the rows, using totalRecordsCount here. */}\n {totalRecordCount >= 0 &&\n showLoadingIndicator &&\n isFetching &&\n loadingIndicatorInfo.isScrollingUp && (\n <StyledLoader\n $style={{\n top: '--above-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n <div\n className={`${rowContainerClass} row-container`}\n ref={c => {\n vi.rContainer = c;\n }}\n role='rowgroup'\n >\n {/** Do not add any other element in row-container apart from the rows as it will generate incorrect estimations */}\n {totalRecordCount === 0 && !isFetching ? null : children}\n </div>\n {totalRecordCount >= 0 &&\n showLoadingIndicator &&\n isFetching &&\n loadingIndicatorInfo.isScrollingDown && (\n <StyledLoader\n $style={{\n top: '--below-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n {totalRecordCount === 0 ? renderEmptyRecords && renderEmptyRecords() : null}\n {renderFooter && renderFooter()}\n </StyledPContainer>\n );\n }\n);\n\nVirtualize.propTypes = {\n id: PropTypes.string.isRequired,\n viewHeight: PropTypes.number,\n viewWidth: PropTypes.number,\n totalRecordCount: PropTypes.number,\n itemHeight: PropTypes.number,\n callback: PropTypes.func,\n isFetching: PropTypes.bool,\n rowContainerClass: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,\n renderHeader: PropTypes.func,\n renderFooter: PropTypes.func,\n state: PropTypes.shape({\n startIndex: PropTypes.number,\n endIndex: PropTypes.number\n }),\n bufferMultiplier: PropTypes.number,\n viewMaxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n showLoadingIndicator: PropTypes.bool,\n renderEmptyRecords: PropTypes.func\n};\n\nVirtualize.defaultProps = {\n bufferMultiplier: 2,\n callback: () => {},\n isFetching: false,\n rowContainerClass: '',\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n totalRecordCount: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false,\n renderEmptyRecords: null\n};\n\nVirtualize.displayName = 'Virtualize';\n\nexport default memo(Virtualize);\n"]}
|
|
@@ -5,7 +5,7 @@ export declare function isPaginationRequestCompleted(requestedIndexes?: {
|
|
|
5
5
|
}, receivedIndexes?: {
|
|
6
6
|
startIndex: number;
|
|
7
7
|
endIndex: number;
|
|
8
|
-
}): boolean | undefined;
|
|
8
|
+
}): number | boolean | undefined;
|
|
9
9
|
export declare function isViewNotFilled(totalRecordCount: number, vi: {
|
|
10
10
|
rContainer: HTMLDivElement;
|
|
11
11
|
}, pContainer: HTMLDivElement, renderHeader: boolean): boolean | 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/utility.ts"],"names":[],"mappings":"AAOA,wBAAgB,4BAA4B,CAAC,gBAAgB,EAAE,MAAM,UAEpE;AAID,wBAAgB,4BAA4B,CAC1C,gBAAgB,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC3D,eAAe,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/utility.ts"],"names":[],"mappings":"AAOA,wBAAgB,4BAA4B,CAAC,gBAAgB,EAAE,MAAM,UAEpE;AAID,wBAAgB,4BAA4B,CAC1C,gBAAgB,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC3D,eAAe,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,gCAW3D;AAED,wBAA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C,UAAU,EAAE,WAAW,QAKxB;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,WAAW,sBAU/D;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAClC,YAAY,EAAE,MAAM,GAAG,MAAM,GAC5B,MAAM,GAAG,MAAM,CAMjB;AAED,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAG/E"}
|
|
@@ -12,8 +12,9 @@ export function isPaginationRequestCompleted(requestedIndexes, receivedIndexes)
|
|
|
12
12
|
// about updated index though pagination is really not required.
|
|
13
13
|
return (receivedIndexes &&
|
|
14
14
|
requestedIndexes &&
|
|
15
|
-
receivedIndexes.startIndex === requestedIndexes.startIndex &&
|
|
16
|
-
|
|
15
|
+
((receivedIndexes.startIndex === requestedIndexes.startIndex &&
|
|
16
|
+
receivedIndexes.endIndex === requestedIndexes.endIndex) ||
|
|
17
|
+
(Object.keys(requestedIndexes).length === 0 && receivedIndexes.endIndex)));
|
|
17
18
|
}
|
|
18
19
|
export function isViewNotFilled(totalRecordCount, vi, pContainer, renderHeader) {
|
|
19
20
|
const parentContainerPosition = pContainer.getBoundingClientRect();
|