@pega/lists-core 8.0.0-build.27.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +185 -0
- package/README.md +80 -0
- package/SECURITY.md +11 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -0
- package/lib/src/core/RsCore.d.ts +37 -0
- package/lib/src/core/RsCore.d.ts.map +1 -0
- package/lib/src/core/RsCore.js +48 -0
- package/lib/src/core/RsCore.js.map +1 -0
- package/lib/src/core/RsInternal.d.ts +85 -0
- package/lib/src/core/RsInternal.d.ts.map +1 -0
- package/lib/src/core/RsInternal.js +104 -0
- package/lib/src/core/RsInternal.js.map +1 -0
- package/lib/src/core/RsProps.d.ts +52 -0
- package/lib/src/core/RsProps.d.ts.map +1 -0
- package/lib/src/core/RsProps.js +47 -0
- package/lib/src/core/RsProps.js.map +1 -0
- package/lib/src/core/RsStore.d.ts +62 -0
- package/lib/src/core/RsStore.d.ts.map +1 -0
- package/lib/src/core/RsStore.js +59 -0
- package/lib/src/core/RsStore.js.map +1 -0
- package/lib/src/core/StateResolver.d.ts +45 -0
- package/lib/src/core/StateResolver.d.ts.map +1 -0
- package/lib/src/core/StateResolver.js +276 -0
- package/lib/src/core/StateResolver.js.map +1 -0
- package/lib/src/core/a11y/BaseA11y.d.ts +161 -0
- package/lib/src/core/a11y/BaseA11y.d.ts.map +1 -0
- package/lib/src/core/a11y/BaseA11y.js +549 -0
- package/lib/src/core/a11y/BaseA11y.js.map +1 -0
- package/lib/src/core/actions/actionConstants.d.ts +77 -0
- package/lib/src/core/actions/actionConstants.d.ts.map +1 -0
- package/lib/src/core/actions/actionConstants.js +79 -0
- package/lib/src/core/actions/actionConstants.js.map +1 -0
- package/lib/src/core/actions/actions.d.ts +400 -0
- package/lib/src/core/actions/actions.d.ts.map +1 -0
- package/lib/src/core/actions/actions.js +537 -0
- package/lib/src/core/actions/actions.js.map +1 -0
- package/lib/src/core/actions/actions.types.d.ts +504 -0
- package/lib/src/core/actions/actions.types.d.ts.map +1 -0
- package/lib/src/core/actions/actions.types.js +5 -0
- package/lib/src/core/actions/actions.types.js.map +1 -0
- package/lib/src/core/config/config.d.ts +9 -0
- package/lib/src/core/config/config.d.ts.map +1 -0
- package/lib/src/core/config/config.js +93 -0
- package/lib/src/core/config/config.js.map +1 -0
- package/lib/src/core/config/filterConfig.d.ts +123 -0
- package/lib/src/core/config/filterConfig.d.ts.map +1 -0
- package/lib/src/core/config/filterConfig.js +238 -0
- package/lib/src/core/config/filterConfig.js.map +1 -0
- package/lib/src/core/constants.d.ts +146 -0
- package/lib/src/core/constants.d.ts.map +1 -0
- package/lib/src/core/constants.js +124 -0
- package/lib/src/core/constants.js.map +1 -0
- package/lib/src/core/features/featureFactory.d.ts +52 -0
- package/lib/src/core/features/featureFactory.d.ts.map +1 -0
- package/lib/src/core/features/featureFactory.js +118 -0
- package/lib/src/core/features/featureFactory.js.map +1 -0
- package/lib/src/core/features/uIFeatures/afterRender/animation.d.ts +24 -0
- package/lib/src/core/features/uIFeatures/afterRender/animation.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/afterRender/animation.js +157 -0
- package/lib/src/core/features/uIFeatures/afterRender/animation.js.map +1 -0
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts +29 -0
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js +114 -0
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js.map +1 -0
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts +38 -0
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js +157 -0
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js.map +1 -0
- package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.d.ts +16 -0
- package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js +32 -0
- package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts +25 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js +139 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.d.ts +18 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.js +46 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustMaxHeight.d.ts +13 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustMaxHeight.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustMaxHeight.js +38 -0
- package/lib/src/core/features/uIFeatures/beforeRender/adjustMaxHeight.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts +11 -0
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js +48 -0
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/animation.d.ts +25 -0
- package/lib/src/core/features/uIFeatures/beforeRender/animation.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/animation.js +106 -0
- package/lib/src/core/features/uIFeatures/beforeRender/animation.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts +18 -0
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js +56 -0
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.d.ts +7 -0
- package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.js +34 -0
- package/lib/src/core/features/uIFeatures/beforeRender/changePersonalisation.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.d.ts +10 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.js +72 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnAlias.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnDisplayMode.d.ts +9 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnDisplayMode.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnDisplayMode.js +26 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnDisplayMode.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.d.ts +9 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.js +29 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnFormatter.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.d.ts +11 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.js +38 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnOrder.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts +11 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js +199 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/index.d.ts +5 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/index.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/index.js +29 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/index.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts +14 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js +118 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSort.d.ts +8 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSort.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSort.js +25 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnSort.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.d.ts +9 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.js +26 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnToggle.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.d.ts +12 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.js +57 -0
- package/lib/src/core/features/uIFeatures/beforeRender/columnVisualOrder.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.d.ts +9 -0
- package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.js +36 -0
- package/lib/src/core/features/uIFeatures/beforeRender/conditionalStyleFormat.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/customColumn.d.ts +9 -0
- package/lib/src/core/features/uIFeatures/beforeRender/customColumn.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js +70 -0
- package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/edit.d.ts +12 -0
- package/lib/src/core/features/uIFeatures/beforeRender/edit.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/edit.js +94 -0
- package/lib/src/core/features/uIFeatures/beforeRender/edit.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.d.ts +9 -0
- package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.js +26 -0
- package/lib/src/core/features/uIFeatures/beforeRender/errorColumn.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/filter.d.ts +10 -0
- package/lib/src/core/features/uIFeatures/beforeRender/filter.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/filter.js +36 -0
- package/lib/src/core/features/uIFeatures/beforeRender/filter.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/freeze.d.ts +15 -0
- package/lib/src/core/features/uIFeatures/beforeRender/freeze.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/freeze.js +119 -0
- package/lib/src/core/features/uIFeatures/beforeRender/freeze.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts +38 -0
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js +451 -0
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/groupsorting.d.ts +7 -0
- package/lib/src/core/features/uIFeatures/beforeRender/groupsorting.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/groupsorting.js +36 -0
- package/lib/src/core/features/uIFeatures/beforeRender/groupsorting.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.d.ts +7 -0
- package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.js +76 -0
- package/lib/src/core/features/uIFeatures/beforeRender/moveListRecords.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/personalization.d.ts +16 -0
- package/lib/src/core/features/uIFeatures/beforeRender/personalization.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/personalization.js +306 -0
- package/lib/src/core/features/uIFeatures/beforeRender/personalization.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.d.ts +7 -0
- package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js +59 -0
- package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.d.ts +7 -0
- package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.js +30 -0
- package/lib/src/core/features/uIFeatures/beforeRender/prepareRows.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/refresh.d.ts +15 -0
- package/lib/src/core/features/uIFeatures/beforeRender/refresh.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/refresh.js +40 -0
- package/lib/src/core/features/uIFeatures/beforeRender/refresh.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/renderHeader.d.ts +7 -0
- package/lib/src/core/features/uIFeatures/beforeRender/renderHeader.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/renderHeader.js +21 -0
- package/lib/src/core/features/uIFeatures/beforeRender/renderHeader.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/resetFetch.d.ts +7 -0
- package/lib/src/core/features/uIFeatures/beforeRender/resetFetch.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/resetFetch.js +55 -0
- package/lib/src/core/features/uIFeatures/beforeRender/resetFetch.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.d.ts +7 -0
- package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.js +24 -0
- package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.d.ts +9 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js +232 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.d.ts +7 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.js +18 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowSelect.d.ts +23 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowSelect.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowSelect.js +135 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowSelect.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/scrollToTop.d.ts +14 -0
- package/lib/src/core/features/uIFeatures/beforeRender/scrollToTop.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/scrollToTop.js +36 -0
- package/lib/src/core/features/uIFeatures/beforeRender/scrollToTop.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts +19 -0
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js +157 -0
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts +29 -0
- package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js +214 -0
- package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/toggleHeaderIcons.d.ts +11 -0
- package/lib/src/core/features/uIFeatures/beforeRender/toggleHeaderIcons.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/toggleHeaderIcons.js +26 -0
- package/lib/src/core/features/uIFeatures/beforeRender/toggleHeaderIcons.js.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.d.ts +12 -0
- package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.js +51 -0
- package/lib/src/core/features/uIFeatures/beforeRender/toggleSelectAllCheckbox.js.map +1 -0
- package/lib/src/core/features/uIFeatures/index.d.ts +55 -0
- package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -0
- package/lib/src/core/features/uIFeatures/index.js +95 -0
- package/lib/src/core/features/uIFeatures/index.js.map +1 -0
- package/lib/src/core/generators/ColumnGenerator.d.ts +349 -0
- package/lib/src/core/generators/ColumnGenerator.d.ts.map +1 -0
- package/lib/src/core/generators/ColumnGenerator.js +725 -0
- package/lib/src/core/generators/ColumnGenerator.js.map +1 -0
- package/lib/src/core/generators/ColumnGenerator.types.d.ts +149 -0
- package/lib/src/core/generators/ColumnGenerator.types.d.ts.map +1 -0
- package/lib/src/core/generators/ColumnGenerator.types.js +2 -0
- package/lib/src/core/generators/ColumnGenerator.types.js.map +1 -0
- package/lib/src/core/generators/GroupGenerator.d.ts +59 -0
- package/lib/src/core/generators/GroupGenerator.d.ts.map +1 -0
- package/lib/src/core/generators/GroupGenerator.js +64 -0
- package/lib/src/core/generators/GroupGenerator.js.map +1 -0
- package/lib/src/core/generators/RowGenerator.d.ts +97 -0
- package/lib/src/core/generators/RowGenerator.d.ts.map +1 -0
- package/lib/src/core/generators/RowGenerator.js +285 -0
- package/lib/src/core/generators/RowGenerator.js.map +1 -0
- package/lib/src/core/generators/RowGenerator.types.d.ts +95 -0
- package/lib/src/core/generators/RowGenerator.types.d.ts.map +1 -0
- package/lib/src/core/generators/RowGenerator.types.js +2 -0
- package/lib/src/core/generators/RowGenerator.types.js.map +1 -0
- package/lib/src/core/generators/ViewGenerator.d.ts +280 -0
- package/lib/src/core/generators/ViewGenerator.d.ts.map +1 -0
- package/lib/src/core/generators/ViewGenerator.js +585 -0
- package/lib/src/core/generators/ViewGenerator.js.map +1 -0
- package/lib/src/core/generators/ViewGenerator.types.d.ts +180 -0
- package/lib/src/core/generators/ViewGenerator.types.d.ts.map +1 -0
- package/lib/src/core/generators/ViewGenerator.types.js +2 -0
- package/lib/src/core/generators/ViewGenerator.types.js.map +1 -0
- package/lib/src/core/generators/__tests__/viewUtilityMockSetup.d.ts +69 -0
- package/lib/src/core/generators/__tests__/viewUtilityMockSetup.d.ts.map +1 -0
- package/lib/src/core/generators/__tests__/viewUtilityMockSetup.js +16 -0
- package/lib/src/core/generators/__tests__/viewUtilityMockSetup.js.map +1 -0
- package/lib/src/core/generators/viewUtilityMethods.d.ts +316 -0
- package/lib/src/core/generators/viewUtilityMethods.d.ts.map +1 -0
- package/lib/src/core/generators/viewUtilityMethods.js +542 -0
- package/lib/src/core/generators/viewUtilityMethods.js.map +1 -0
- package/lib/src/core/index.d.ts +7 -0
- package/lib/src/core/index.d.ts.map +1 -0
- package/lib/src/core/index.js +80 -0
- package/lib/src/core/index.js.map +1 -0
- package/lib/src/core/pubSub/events.d.ts +6 -0
- package/lib/src/core/pubSub/events.d.ts.map +1 -0
- package/lib/src/core/pubSub/events.js +6 -0
- package/lib/src/core/pubSub/events.js.map +1 -0
- package/lib/src/core/pubSub/index.d.ts +7 -0
- package/lib/src/core/pubSub/index.d.ts.map +1 -0
- package/lib/src/core/pubSub/index.js +35 -0
- package/lib/src/core/pubSub/index.js.map +1 -0
- package/lib/src/core/reducers/aggregation.d.ts +5 -0
- package/lib/src/core/reducers/aggregation.d.ts.map +1 -0
- package/lib/src/core/reducers/aggregation.js +35 -0
- package/lib/src/core/reducers/aggregation.js.map +1 -0
- package/lib/src/core/reducers/bootstrap.d.ts +5 -0
- package/lib/src/core/reducers/bootstrap.d.ts.map +1 -0
- package/lib/src/core/reducers/bootstrap.js +12 -0
- package/lib/src/core/reducers/bootstrap.js.map +1 -0
- package/lib/src/core/reducers/columnAlias.d.ts +5 -0
- package/lib/src/core/reducers/columnAlias.d.ts.map +1 -0
- package/lib/src/core/reducers/columnAlias.js +28 -0
- package/lib/src/core/reducers/columnAlias.js.map +1 -0
- package/lib/src/core/reducers/conditionalStyleFormat.d.ts +5 -0
- package/lib/src/core/reducers/conditionalStyleFormat.d.ts.map +1 -0
- package/lib/src/core/reducers/conditionalStyleFormat.js +13 -0
- package/lib/src/core/reducers/conditionalStyleFormat.js.map +1 -0
- package/lib/src/core/reducers/customColumn.d.ts +5 -0
- package/lib/src/core/reducers/customColumn.d.ts.map +1 -0
- package/lib/src/core/reducers/customColumn.js +40 -0
- package/lib/src/core/reducers/customColumn.js.map +1 -0
- package/lib/src/core/reducers/dragDrop.d.ts +6 -0
- package/lib/src/core/reducers/dragDrop.d.ts.map +1 -0
- package/lib/src/core/reducers/dragDrop.js +100 -0
- package/lib/src/core/reducers/dragDrop.js.map +1 -0
- package/lib/src/core/reducers/edit.d.ts +5 -0
- package/lib/src/core/reducers/edit.d.ts.map +1 -0
- package/lib/src/core/reducers/edit.js +65 -0
- package/lib/src/core/reducers/edit.js.map +1 -0
- package/lib/src/core/reducers/error.d.ts +69 -0
- package/lib/src/core/reducers/error.d.ts.map +1 -0
- package/lib/src/core/reducers/error.js +21 -0
- package/lib/src/core/reducers/error.js.map +1 -0
- package/lib/src/core/reducers/externalState.d.ts +5 -0
- package/lib/src/core/reducers/externalState.d.ts.map +1 -0
- package/lib/src/core/reducers/externalState.js +20 -0
- package/lib/src/core/reducers/externalState.js.map +1 -0
- package/lib/src/core/reducers/filter.d.ts +5 -0
- package/lib/src/core/reducers/filter.d.ts.map +1 -0
- package/lib/src/core/reducers/filter.js +29 -0
- package/lib/src/core/reducers/filter.js.map +1 -0
- package/lib/src/core/reducers/forceUpdate.d.ts +5 -0
- package/lib/src/core/reducers/forceUpdate.d.ts.map +1 -0
- package/lib/src/core/reducers/forceUpdate.js +25 -0
- package/lib/src/core/reducers/forceUpdate.js.map +1 -0
- package/lib/src/core/reducers/freeze.d.ts +5 -0
- package/lib/src/core/reducers/freeze.d.ts.map +1 -0
- package/lib/src/core/reducers/freeze.js +36 -0
- package/lib/src/core/reducers/freeze.js.map +1 -0
- package/lib/src/core/reducers/grouping.d.ts +5 -0
- package/lib/src/core/reducers/grouping.d.ts.map +1 -0
- package/lib/src/core/reducers/grouping.js +142 -0
- package/lib/src/core/reducers/grouping.js.map +1 -0
- package/lib/src/core/reducers/index.d.ts +5 -0
- package/lib/src/core/reducers/index.d.ts.map +1 -0
- package/lib/src/core/reducers/index.js +77 -0
- package/lib/src/core/reducers/index.js.map +1 -0
- package/lib/src/core/reducers/moveRecords.d.ts +5 -0
- package/lib/src/core/reducers/moveRecords.d.ts.map +1 -0
- package/lib/src/core/reducers/moveRecords.js +10 -0
- package/lib/src/core/reducers/moveRecords.js.map +1 -0
- package/lib/src/core/reducers/notificationsReducer.d.ts +4 -0
- package/lib/src/core/reducers/notificationsReducer.d.ts.map +1 -0
- package/lib/src/core/reducers/notificationsReducer.js +49 -0
- package/lib/src/core/reducers/notificationsReducer.js.map +1 -0
- package/lib/src/core/reducers/paginations.d.ts +5 -0
- package/lib/src/core/reducers/paginations.d.ts.map +1 -0
- package/lib/src/core/reducers/paginations.js +19 -0
- package/lib/src/core/reducers/paginations.js.map +1 -0
- package/lib/src/core/reducers/personalizationDirtyReducer.d.ts +5 -0
- package/lib/src/core/reducers/personalizationDirtyReducer.d.ts.map +1 -0
- package/lib/src/core/reducers/personalizationDirtyReducer.js +46 -0
- package/lib/src/core/reducers/personalizationDirtyReducer.js.map +1 -0
- package/lib/src/core/reducers/personalizationReducer.d.ts +5 -0
- package/lib/src/core/reducers/personalizationReducer.d.ts.map +1 -0
- package/lib/src/core/reducers/personalizationReducer.js +238 -0
- package/lib/src/core/reducers/personalizationReducer.js.map +1 -0
- package/lib/src/core/reducers/refresh.d.ts +5 -0
- package/lib/src/core/reducers/refresh.d.ts.map +1 -0
- package/lib/src/core/reducers/refresh.js +16 -0
- package/lib/src/core/reducers/refresh.js.map +1 -0
- package/lib/src/core/reducers/renderFormatter.d.ts +5 -0
- package/lib/src/core/reducers/renderFormatter.d.ts.map +1 -0
- package/lib/src/core/reducers/renderFormatter.js +22 -0
- package/lib/src/core/reducers/renderFormatter.js.map +1 -0
- package/lib/src/core/reducers/resize.d.ts +5 -0
- package/lib/src/core/reducers/resize.d.ts.map +1 -0
- package/lib/src/core/reducers/resize.js +32 -0
- package/lib/src/core/reducers/resize.js.map +1 -0
- package/lib/src/core/reducers/rowSelect.d.ts +5 -0
- package/lib/src/core/reducers/rowSelect.d.ts.map +1 -0
- package/lib/src/core/reducers/rowSelect.js +86 -0
- package/lib/src/core/reducers/rowSelect.js.map +1 -0
- package/lib/src/core/reducers/sanitize.d.ts +5 -0
- package/lib/src/core/reducers/sanitize.d.ts.map +1 -0
- package/lib/src/core/reducers/sanitize.js +21 -0
- package/lib/src/core/reducers/sanitize.js.map +1 -0
- package/lib/src/core/reducers/search.d.ts +5 -0
- package/lib/src/core/reducers/search.d.ts.map +1 -0
- package/lib/src/core/reducers/search.js +13 -0
- package/lib/src/core/reducers/search.js.map +1 -0
- package/lib/src/core/reducers/showHeaderIcons.d.ts +5 -0
- package/lib/src/core/reducers/showHeaderIcons.d.ts.map +1 -0
- package/lib/src/core/reducers/showHeaderIcons.js +13 -0
- package/lib/src/core/reducers/showHeaderIcons.js.map +1 -0
- package/lib/src/core/reducers/smallScreen.d.ts +5 -0
- package/lib/src/core/reducers/smallScreen.d.ts.map +1 -0
- package/lib/src/core/reducers/smallScreen.js +22 -0
- package/lib/src/core/reducers/smallScreen.js.map +1 -0
- package/lib/src/core/reducers/sort.d.ts +5 -0
- package/lib/src/core/reducers/sort.d.ts.map +1 -0
- package/lib/src/core/reducers/sort.js +71 -0
- package/lib/src/core/reducers/sort.js.map +1 -0
- package/lib/src/core/reducers/versioning/index.d.ts +16 -0
- package/lib/src/core/reducers/versioning/index.d.ts.map +1 -0
- package/lib/src/core/reducers/versioning/index.js +46 -0
- package/lib/src/core/reducers/versioning/index.js.map +1 -0
- package/lib/src/core/reducers/versioning/v1.d.ts +136 -0
- package/lib/src/core/reducers/versioning/v1.d.ts.map +1 -0
- package/lib/src/core/reducers/versioning/v1.js +156 -0
- package/lib/src/core/reducers/versioning/v1.js.map +1 -0
- package/lib/src/core/reducers/visibility.d.ts +5 -0
- package/lib/src/core/reducers/visibility.d.ts.map +1 -0
- package/lib/src/core/reducers/visibility.js +49 -0
- package/lib/src/core/reducers/visibility.js.map +1 -0
- package/lib/src/core/test/junitMocks.d.ts +756 -0
- package/lib/src/core/test/junitMocks.d.ts.map +1 -0
- package/lib/src/core/test/junitMocks.js +2923 -0
- package/lib/src/core/test/junitMocks.js.map +1 -0
- package/lib/src/core/test/samples/a11ySample.d.ts +8 -0
- package/lib/src/core/test/samples/a11ySample.d.ts.map +1 -0
- package/lib/src/core/test/samples/a11ySample.js +1131 -0
- package/lib/src/core/test/samples/a11ySample.js.map +1 -0
- package/lib/src/core/test/samples/a11ySampleWithLoaders.d.ts +8 -0
- package/lib/src/core/test/samples/a11ySampleWithLoaders.d.ts.map +1 -0
- package/lib/src/core/test/samples/a11ySampleWithLoaders.js +1134 -0
- package/lib/src/core/test/samples/a11ySampleWithLoaders.js.map +1 -0
- package/lib/src/core/test/samples/utils.d.ts +2 -0
- package/lib/src/core/test/samples/utils.d.ts.map +1 -0
- package/lib/src/core/test/samples/utils.js +9 -0
- package/lib/src/core/test/samples/utils.js.map +1 -0
- package/lib/src/core/test/utils/rowDragDropUtils.d.ts +20 -0
- package/lib/src/core/test/utils/rowDragDropUtils.d.ts.map +1 -0
- package/lib/src/core/test/utils/rowDragDropUtils.js +98 -0
- package/lib/src/core/test/utils/rowDragDropUtils.js.map +1 -0
- package/lib/src/core/utils/condition-utils.d.ts +15 -0
- package/lib/src/core/utils/condition-utils.d.ts.map +1 -0
- package/lib/src/core/utils/condition-utils.js +114 -0
- package/lib/src/core/utils/condition-utils.js.map +1 -0
- package/lib/src/core/utils/util.d.ts +380 -0
- package/lib/src/core/utils/util.d.ts.map +1 -0
- package/lib/src/core/utils/util.js +912 -0
- package/lib/src/core/utils/util.js.map +1 -0
- package/lib/src/core/utils/util.types.d.ts +43 -0
- package/lib/src/core/utils/util.types.d.ts.map +1 -0
- package/lib/src/core/utils/util.types.js +2 -0
- package/lib/src/core/utils/util.types.js.map +1 -0
- package/lib/types/ApiContext.types.d.ts +392 -0
- package/lib/types/ApiContext.types.d.ts.map +1 -0
- package/lib/types/ApiContext.types.js +2 -0
- package/lib/types/ApiContext.types.js.map +1 -0
- package/lib/types/Meta.types.d.ts +705 -0
- package/lib/types/Meta.types.d.ts.map +1 -0
- package/lib/types/Meta.types.js +37 -0
- package/lib/types/Meta.types.js.map +1 -0
- package/lib/types/RsCoreBootArgs.types.d.ts +103 -0
- package/lib/types/RsCoreBootArgs.types.d.ts.map +1 -0
- package/lib/types/RsCoreBootArgs.types.js +2 -0
- package/lib/types/RsCoreBootArgs.types.js.map +1 -0
- package/lib/types/State.types.d.ts +374 -0
- package/lib/types/State.types.d.ts.map +1 -0
- package/lib/types/State.types.js +5 -0
- package/lib/types/State.types.js.map +1 -0
- package/lib/types.d.ts +30 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { actionColumnResize, actionColumnsAutoSize, actionColumnAutoSize, actionForceUpdate } from '../../../../actions/actions';
|
|
2
|
+
import { TEMPLATES, SELECTION_MODES, rowSelectColumnMeta } from '../../../../constants';
|
|
3
|
+
import { withMemoization } from '../../../../utils/util';
|
|
4
|
+
import { autoSizeOfColumns } from './autoSize';
|
|
5
|
+
/*
|
|
6
|
+
* If columnWidths are undefined, there is no active personalization invloved in the current view
|
|
7
|
+
* So triggering auto column sizing, which depends on column content.
|
|
8
|
+
* in case of nested groupings, skipping group headers from being counted as a row
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Checks if {@link View.domContainer dom container} has any rows with visible cells.
|
|
12
|
+
* @param columns
|
|
13
|
+
* @param domContainer
|
|
14
|
+
* @returns true if dom container has any rows available, otherwise false.
|
|
15
|
+
*/
|
|
16
|
+
const checkDomContainerHasAnyRows = (columns, domContainer) => {
|
|
17
|
+
for (const column of columns) {
|
|
18
|
+
if (!column.hidden) {
|
|
19
|
+
const cells = domContainer
|
|
20
|
+
? domContainer.querySelectorAll(`[data-col-id="${column.field.id}"]`)
|
|
21
|
+
: [];
|
|
22
|
+
if (cells.length > 1) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Checks if any data rows are available in dom container. It does not includes grouped rows.
|
|
31
|
+
* @returns true if data rows are available, otherwise false.
|
|
32
|
+
*/
|
|
33
|
+
const checkDomContainerHasDataRows = (domContainer) => {
|
|
34
|
+
return !!(domContainer && domContainer.querySelectorAll('.row[aria-rowindex]').length);
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Executes the autosizing feature on row selection column.
|
|
38
|
+
*/
|
|
39
|
+
function autosizeRowSelectionColumn([{ getView, dispatch }]) {
|
|
40
|
+
const { columns = [], getDomContainer, meta } = getView();
|
|
41
|
+
if (meta.selectionMode && Object.values(SELECTION_MODES).includes(meta.selectionMode)) {
|
|
42
|
+
const col = columns.find(c => c.field.id === rowSelectColumnMeta.field.id);
|
|
43
|
+
if (col)
|
|
44
|
+
dispatch(actionColumnAutoSize(col, getDomContainer(), true));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Executes the autosizing feature on all the columns. It dispatches an action that updates {@link State.columnWidths} slice with the calculated widths for all the columns.
|
|
49
|
+
* @param param featureProps
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
export function runColumnSizing([{ getState, getView, getRsStore, dispatch }]) {
|
|
53
|
+
const { columns = [], getDomContainer, meta } = getView();
|
|
54
|
+
if (meta.template !== TEMPLATES.TABLE)
|
|
55
|
+
return;
|
|
56
|
+
const rsStore = getRsStore();
|
|
57
|
+
const domContainer = getDomContainer();
|
|
58
|
+
const runColumnSizingOnRowsAvailable = !rsStore.columnSizingTriggerdOnRowsAvailable && checkDomContainerHasDataRows(domContainer);
|
|
59
|
+
// if there is no group/data row to size in DOM, don't run column sizing
|
|
60
|
+
if (!checkDomContainerHasAnyRows(columns, domContainer) ||
|
|
61
|
+
(rsStore.autosizeTriggered && !runColumnSizingOnRowsAvailable)) {
|
|
62
|
+
// if in current render cycle the rows were not painted, check for autosizing in next cycle
|
|
63
|
+
if (!rsStore.autosizeTriggered) {
|
|
64
|
+
dispatch(actionForceUpdate(false, { forceCalculateAutoWidth: true }));
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* If one of the table's ancestors is in a hidden state, the autosize calculations will not function correctly
|
|
70
|
+
* since the domContainer's offsetWidth will be 0. To address this scenario, a resize observer is attached for this use case.
|
|
71
|
+
* It triggers autosize whenever the offsetWidth of the domContainer increases from 0 once the ancestors are
|
|
72
|
+
* made visible. */
|
|
73
|
+
if (domContainer?.offsetWidth === 0) {
|
|
74
|
+
const observer = new ResizeObserver(entries => {
|
|
75
|
+
for (const entry of entries) {
|
|
76
|
+
if (entry.contentRect.width > 0) {
|
|
77
|
+
runColumnSizing([
|
|
78
|
+
{
|
|
79
|
+
getState,
|
|
80
|
+
getView,
|
|
81
|
+
getRsStore,
|
|
82
|
+
dispatch
|
|
83
|
+
}
|
|
84
|
+
]);
|
|
85
|
+
observer.unobserve(entry.target);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
observer.observe(domContainer);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
rsStore.autosizeTriggered = true;
|
|
93
|
+
// skipping column animation on next run if column size changed after personalization change or delete
|
|
94
|
+
rsStore.skipColumnAnimationOnNextRun = true;
|
|
95
|
+
if (runColumnSizingOnRowsAvailable) {
|
|
96
|
+
// Fresh column sizing will run only once for a view when the rows are loaded for the first time in DOM
|
|
97
|
+
rsStore.columnSizingTriggerdOnRowsAvailable = true;
|
|
98
|
+
dispatch(actionColumnsAutoSize(columns, domContainer, true));
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// Incremental column sizing on show/hide of columns or table refresh or on view change with grouping applied
|
|
102
|
+
dispatch(actionColumnResize(autoSizeOfColumns(columns, domContainer)));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* It resets the {@link RsStore.autosizeTriggered autosize status} on RsStore.
|
|
107
|
+
* @param param featureProps
|
|
108
|
+
*/
|
|
109
|
+
function resetAutosizeStatus([{ getRsStore }]) {
|
|
110
|
+
// This parent flag checks if any type of sizing is triggered on the table including table header/groups/rows.
|
|
111
|
+
getRsStore().autosizeTriggered = false;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Manages the autosizing feature of columns in the view. This includes the following actions:
|
|
115
|
+
* 1. **Executing Autosize for All Columns**:
|
|
116
|
+
*
|
|
117
|
+
* This action is triggered when any of the following properties change:
|
|
118
|
+
* - {@link State.personalization.active}
|
|
119
|
+
* - {@link View.rows}
|
|
120
|
+
* - {@link RsStore.autosizeTriggered}
|
|
121
|
+
* - {@link State.refresh}
|
|
122
|
+
* - {@link State.hiddenColumns}
|
|
123
|
+
* - {@link State.forceUpdateFeatures.forceCalculateAutoWidth}
|
|
124
|
+
* 2. **Resetting Autosize Status**:
|
|
125
|
+
*
|
|
126
|
+
* This action is triggered when any of the following properties change:
|
|
127
|
+
* - {@link State.personalization.active}
|
|
128
|
+
* - {@link State.refresh}
|
|
129
|
+
* - {@link State.hiddenColumns}
|
|
130
|
+
* - {@link State.customFields}
|
|
131
|
+
*
|
|
132
|
+
* 3. **Executing Autosize on Row Selection Column**:
|
|
133
|
+
*
|
|
134
|
+
* This action is triggered when any of the following properties change:
|
|
135
|
+
* - {@link State.groups}
|
|
136
|
+
* - {@link State.responsive.sm}
|
|
137
|
+
*/
|
|
138
|
+
export default () => {
|
|
139
|
+
const memoizedRunColumnSizing = withMemoization(runColumnSizing);
|
|
140
|
+
const memoizedResetAutosizeStatus = withMemoization(resetAutosizeStatus);
|
|
141
|
+
const memoizedAutosizeRowSelectionColumn = withMemoization(autosizeRowSelectionColumn);
|
|
142
|
+
return function execute(featureProps) {
|
|
143
|
+
const state = featureProps.getState();
|
|
144
|
+
// AutoSize by default
|
|
145
|
+
memoizedResetAutosizeStatus([featureProps], [state.personalization?.active, state.refresh, state.hiddenColumns, state.customFields]);
|
|
146
|
+
memoizedRunColumnSizing([featureProps], [
|
|
147
|
+
state.personalization?.active,
|
|
148
|
+
featureProps.getView().rows,
|
|
149
|
+
featureProps.getRsStore().autosizeTriggered,
|
|
150
|
+
state.refresh,
|
|
151
|
+
state.hiddenColumns,
|
|
152
|
+
state.forceUpdateFeatures?.forceCalculateAutoWidth
|
|
153
|
+
]);
|
|
154
|
+
memoizedAutosizeRowSelectionColumn([featureProps], [state.groups, state.responsive?.sm]);
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;GAIG;AACH;;;;;GAKG;AACH,MAAM,2BAA2B,GAAG,CAClC,OAAqC,EACrC,YAAkC,EAClC,EAAE;IACF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,KAAK,GAAG,YAAY;gBACxB,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;gBACrE,CAAC,CAAC,EAAE,CAAC;YACP,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,4BAA4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AC;IAC1E,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAAC,CAAC,EAAE,UAAU,EAAE,CAA+B;IACzE,8GAA8G;IAC9G,UAAU,EAAE,CAAC,iBAAiB,GAAG,KAAK,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAe,GAAG,EAAE;IAClB,MAAM,uBAAuB,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;IACjE,MAAM,2BAA2B,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;IACzE,MAAM,kCAAkC,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC;IACvF,OAAO,SAAS,OAAO,CAAC,YAA0B;QAChD,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QACtC,sBAAsB;QACtB,2BAA2B,CACzB,CAAC,YAAY,CAAC,EACd,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC,CACxF,CAAC;QACF,uBAAuB,CACrB,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,eAAe,EAAE,MAAM;YAC7B,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI;YAC3B,YAAY,CAAC,UAAU,EAAE,CAAC,iBAAiB;YAC3C,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,aAAa;YACnB,KAAK,CAAC,mBAAmB,EAAE,uBAAuB;SACnD,CACF,CAAC;QACF,kCAAkC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport {\n actionColumnResize,\n actionColumnsAutoSize,\n actionColumnAutoSize,\n actionForceUpdate\n} from '../../../../actions/actions';\nimport { TEMPLATES, SELECTION_MODES, rowSelectColumnMeta } from '../../../../constants';\nimport { withMemoization } from '../../../../utils/util';\nimport type { FeatureProps } from '../../../featureFactory';\nimport type View from '../../../../generators/ViewGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../../../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type RsStore from '../../../../RsStore';\n\nimport { autoSizeOfColumns } from './autoSize';\n\n/*\n * If columnWidths are undefined, there is no active personalization invloved in the current view\n * So triggering auto column sizing, which depends on column content.\n * in case of nested groupings, skipping group headers from being counted as a row\n */\n/**\n * Checks if {@link View.domContainer dom container} has any rows with visible cells.\n * @param columns\n * @param domContainer\n * @returns true if dom container has any rows available, otherwise false.\n */\nconst checkDomContainerHasAnyRows = (\n columns: NonNullable<View['columns']>,\n domContainer: View['domContainer']\n) => {\n for (const column of columns) {\n if (!column.hidden) {\n const cells = domContainer\n ? domContainer.querySelectorAll(`[data-col-id=\"${column.field.id}\"]`)\n : [];\n if (cells.length > 1) {\n return true;\n }\n }\n }\n return false;\n};\n\n/**\n * Checks if any data rows are available in dom container. It does not includes grouped rows.\n * @returns true if data rows are available, otherwise false.\n */\nconst checkDomContainerHasDataRows = (domContainer: View['domContainer']) => {\n return !!(domContainer && domContainer.querySelectorAll('.row[aria-rowindex]').length);\n};\n\n/**\n * Executes the autosizing feature on row selection column.\n */\nfunction autosizeRowSelectionColumn([{ getView, dispatch }]: [featureProps: FeatureProps]) {\n const { columns = [], getDomContainer, meta } = getView();\n if (meta.selectionMode && Object.values(SELECTION_MODES).includes(meta.selectionMode)) {\n const col = columns.find(c => c.field.id === rowSelectColumnMeta.field.id);\n if (col) dispatch(actionColumnAutoSize(col, getDomContainer()!, true));\n }\n}\n\n/**\n * Executes the autosizing feature on all the columns. It dispatches an action that updates {@link State.columnWidths} slice with the calculated widths for all the columns.\n * @param param featureProps\n * @returns\n */\nexport function runColumnSizing([{ getState, getView, getRsStore, dispatch }]: [\n featureProps: OmitStrict<FeatureProps, 'getOriginalState' | 'getRsProps'>\n]) {\n const { columns = [], getDomContainer, meta } = getView();\n\n if (meta.template !== TEMPLATES.TABLE) return;\n\n const rsStore = getRsStore();\n const domContainer = getDomContainer();\n const runColumnSizingOnRowsAvailable =\n !rsStore.columnSizingTriggerdOnRowsAvailable && checkDomContainerHasDataRows(domContainer);\n\n // if there is no group/data row to size in DOM, don't run column sizing\n if (\n !checkDomContainerHasAnyRows(columns, domContainer) ||\n (rsStore.autosizeTriggered && !runColumnSizingOnRowsAvailable)\n ) {\n // if in current render cycle the rows were not painted, check for autosizing in next cycle\n if (!rsStore.autosizeTriggered) {\n dispatch(actionForceUpdate(false, { forceCalculateAutoWidth: true }));\n }\n return;\n }\n\n /**\n * If one of the table's ancestors is in a hidden state, the autosize calculations will not function correctly\n * since the domContainer's offsetWidth will be 0. To address this scenario, a resize observer is attached for this use case.\n * It triggers autosize whenever the offsetWidth of the domContainer increases from 0 once the ancestors are\n * made visible. */\n if (domContainer?.offsetWidth === 0) {\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.contentRect.width > 0) {\n runColumnSizing([\n {\n getState,\n getView,\n getRsStore,\n dispatch\n }\n ]);\n observer.unobserve(entry.target);\n }\n }\n });\n observer.observe(domContainer);\n return;\n }\n\n rsStore.autosizeTriggered = true;\n // skipping column animation on next run if column size changed after personalization change or delete\n rsStore.skipColumnAnimationOnNextRun = true;\n\n if (runColumnSizingOnRowsAvailable) {\n // Fresh column sizing will run only once for a view when the rows are loaded for the first time in DOM\n rsStore.columnSizingTriggerdOnRowsAvailable = true;\n dispatch(actionColumnsAutoSize(columns, domContainer!, true));\n } else {\n // Incremental column sizing on show/hide of columns or table refresh or on view change with grouping applied\n dispatch(actionColumnResize(autoSizeOfColumns(columns, domContainer!)));\n }\n}\n\n/**\n * It resets the {@link RsStore.autosizeTriggered autosize status} on RsStore.\n * @param param featureProps\n */\nfunction resetAutosizeStatus([{ getRsStore }]: [featureProps: FeatureProps]) {\n // This parent flag checks if any type of sizing is triggered on the table including table header/groups/rows.\n getRsStore().autosizeTriggered = false;\n}\n\n/**\n * Manages the autosizing feature of columns in the view. This includes the following actions:\n * 1. **Executing Autosize for All Columns**:\n *\n * This action is triggered when any of the following properties change:\n * - {@link State.personalization.active}\n * - {@link View.rows}\n * - {@link RsStore.autosizeTriggered}\n * - {@link State.refresh}\n * - {@link State.hiddenColumns}\n * - {@link State.forceUpdateFeatures.forceCalculateAutoWidth}\n * 2. **Resetting Autosize Status**:\n *\n * This action is triggered when any of the following properties change:\n * - {@link State.personalization.active}\n * - {@link State.refresh}\n * - {@link State.hiddenColumns}\n * - {@link State.customFields}\n *\n * 3. **Executing Autosize on Row Selection Column**:\n *\n * This action is triggered when any of the following properties change:\n * - {@link State.groups}\n * - {@link State.responsive.sm}\n */\nexport default () => {\n const memoizedRunColumnSizing = withMemoization(runColumnSizing);\n const memoizedResetAutosizeStatus = withMemoization(resetAutosizeStatus);\n const memoizedAutosizeRowSelectionColumn = withMemoization(autosizeRowSelectionColumn);\n return function execute(featureProps: FeatureProps) {\n const state = featureProps.getState();\n // AutoSize by default\n memoizedResetAutosizeStatus(\n [featureProps],\n [state.personalization?.active, state.refresh, state.hiddenColumns, state.customFields]\n );\n memoizedRunColumnSizing(\n [featureProps],\n [\n state.personalization?.active,\n featureProps.getView().rows,\n featureProps.getRsStore().autosizeTriggered,\n state.refresh,\n state.hiddenColumns,\n state.forceUpdateFeatures?.forceCalculateAutoWidth\n ]\n );\n memoizedAutosizeRowSelectionColumn([featureProps], [state.groups, state.responsive?.sm]);\n };\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FeatureProps } from '../../../featureFactory';
|
|
2
|
+
/** Toggles CSS class `pContainerScroll` on {@link RootVirtualizer.getParentContainer parentContainer} (scrollable element of the virtualizer) by comparing scrollWidth and clientWidth of parentContainer.
|
|
3
|
+
* @param featureProps - A tuple containing an object of feature props.
|
|
4
|
+
* @returns void
|
|
5
|
+
*/
|
|
6
|
+
export declare const customizePContainer: ([{ getView }]: [featureProps: FeatureProps]) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Customizes the behavior of the scrollable of virtualizer i.e. {@link RootVirtualizer.getParentContainer parentContainer}.
|
|
9
|
+
*
|
|
10
|
+
* This customization includes toggling the CSS class `pContainerScroll` on the `parentContainer`. The `pContainerScroll` class is toggled based on changes to specific state properties, including:
|
|
11
|
+
* - {@link State.hiddenColumns}
|
|
12
|
+
* - {@link State.columnWidths}
|
|
13
|
+
*/
|
|
14
|
+
declare const _default: () => (featureProps: FeatureProps) => void;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/customizeParentContainer/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAO5D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,kBAAmB,CAAC,YAAY,EAAE,YAAY,CAAC,SAW9E,CAAC;AAEF;;;;;;GAMG;6CAIqC,YAAY;AAHpD,wBAQE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { withMemoization } from '../../../../utils/util';
|
|
2
|
+
/** Toggles CSS class `pContainerScroll` on {@link RootVirtualizer.getParentContainer parentContainer} (scrollable element of the virtualizer) by comparing scrollWidth and clientWidth of parentContainer.
|
|
3
|
+
* @param featureProps - A tuple containing an object of feature props.
|
|
4
|
+
* @returns void
|
|
5
|
+
*/
|
|
6
|
+
export const customizePContainer = ([{ getView }]) => {
|
|
7
|
+
const parentContainer = getView().virtualizeElements.rootVirtualiser?.getParentContainer();
|
|
8
|
+
if (parentContainer) {
|
|
9
|
+
const { scrollWidth, clientWidth, classList } = parentContainer;
|
|
10
|
+
if (scrollWidth > clientWidth) {
|
|
11
|
+
classList.add('pContainerScroll');
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
classList.remove('pContainerScroll');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Customizes the behavior of the scrollable of virtualizer i.e. {@link RootVirtualizer.getParentContainer parentContainer}.
|
|
20
|
+
*
|
|
21
|
+
* This customization includes toggling the CSS class `pContainerScroll` on the `parentContainer`. The `pContainerScroll` class is toggled based on changes to specific state properties, including:
|
|
22
|
+
* - {@link State.hiddenColumns}
|
|
23
|
+
* - {@link State.columnWidths}
|
|
24
|
+
*/
|
|
25
|
+
export default () => {
|
|
26
|
+
const memoisedCustomizePContainer = withMemoization(customizePContainer);
|
|
27
|
+
return function execute(featureProps) {
|
|
28
|
+
const { hiddenColumns, columnWidths } = featureProps.getState();
|
|
29
|
+
memoisedCustomizePContainer([featureProps], [hiddenColumns, columnWidths]);
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/customizeParentContainer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQzD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,CAA+B,EAAE,EAAE;IACjF,MAAM,eAAe,GAAG,OAAO,EAAE,CAAC,kBAAkB,CAAC,eAAe,EAAE,kBAAkB,EAAE,CAAC;IAE3F,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC;QAChE,IAAI,WAAW,GAAG,WAAW,EAAE,CAAC;YAC9B,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,eAAe,GAAG,EAAE;IAClB,MAAM,2BAA2B,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;IAEzE,OAAO,SAAS,OAAO,CAAC,YAA0B;QAChD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QAEhE,2BAA2B,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { withMemoization } from '../../../../utils/util';\nimport type { FeatureProps } from '../../../featureFactory';\n// Used in JsDoc.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { RootVirtualizer } from '../../../../generators/ViewGenerator.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../../../../types/State.types';\n\n/** Toggles CSS class `pContainerScroll` on {@link RootVirtualizer.getParentContainer parentContainer} (scrollable element of the virtualizer) by comparing scrollWidth and clientWidth of parentContainer.\n * @param featureProps - A tuple containing an object of feature props.\n * @returns void\n */\nexport const customizePContainer = ([{ getView }]: [featureProps: FeatureProps]) => {\n const parentContainer = getView().virtualizeElements.rootVirtualiser?.getParentContainer();\n\n if (parentContainer) {\n const { scrollWidth, clientWidth, classList } = parentContainer;\n if (scrollWidth > clientWidth) {\n classList.add('pContainerScroll');\n } else {\n classList.remove('pContainerScroll');\n }\n }\n};\n\n/**\n * Customizes the behavior of the scrollable of virtualizer i.e. {@link RootVirtualizer.getParentContainer parentContainer}.\n *\n * This customization includes toggling the CSS class `pContainerScroll` on the `parentContainer`. The `pContainerScroll` class is toggled based on changes to specific state properties, including:\n * - {@link State.hiddenColumns}\n * - {@link State.columnWidths}\n */\nexport default () => {\n const memoisedCustomizePContainer = withMemoization(customizePContainer);\n\n return function execute(featureProps: FeatureProps) {\n const { hiddenColumns, columnWidths } = featureProps.getState();\n\n memoisedCustomizePContainer([featureProps], [hiddenColumns, columnWidths]);\n };\n};\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type RsInternal from '../../../RsInternal';
|
|
2
|
+
import type { BeforeRenderFeatureProps } from '../../featureFactory';
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the {@link View.bodyHeight body height} of the view.
|
|
5
|
+
* @param param.0 {@link BeforeRenderFeatureProps}.
|
|
6
|
+
* @returns void
|
|
7
|
+
*/
|
|
8
|
+
export declare function execute([{ getView, dispatch }]: [featureProps: BeforeRenderFeatureProps]): void;
|
|
9
|
+
/**
|
|
10
|
+
* Calculates the {@link View.bodyHeight body height} of the view and toggles `resize listener` to the `window`.
|
|
11
|
+
*
|
|
12
|
+
* 1. The `body height` is calculated only on initial mount of the Repeating structures, if following properties are provided in {@link Meta}:
|
|
13
|
+
* - {@link Meta.height}
|
|
14
|
+
* - {@link Meta.numberOfRows}
|
|
15
|
+
*
|
|
16
|
+
* 2. The `resize listener` is attached/removed on initial mount of Repeating structures, after considering the values for following properties in {@link Meta}:
|
|
17
|
+
* - {@link Meta.height}
|
|
18
|
+
* - {@link Meta.numberOfRows}
|
|
19
|
+
*
|
|
20
|
+
* Additionally the `resize listener` will be removed on `UNMOUNT` event publish.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
declare const _default: (rsInternal: RsInternal) => (featureProps: BeforeRenderFeatureProps) => void;
|
|
24
|
+
export default _default;
|
|
25
|
+
//# sourceMappingURL=adjustHeight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustHeight.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeight.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AASrE;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,YAAY,EAAE,wBAAwB,CAAC,QAgFxF;AAwBD;;;;;;;;;;;;;GAaG;qCACyB,UAAU,oBAkBd,wBAAwB;AAlBhD,wBA4BE"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { UNMOUNT } from '../../../pubSub/events';
|
|
2
|
+
import { actionUpdateTableHeight } from '../../../actions/actions';
|
|
3
|
+
import { withMemoization } from '../../../utils/util';
|
|
4
|
+
const getVirtualizer = (view) => {
|
|
5
|
+
return view.virtualizeElements?.rootVirtualiser;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Calculates the {@link View.bodyHeight body height} of the view.
|
|
9
|
+
* @param param.0 {@link BeforeRenderFeatureProps}.
|
|
10
|
+
* @returns void
|
|
11
|
+
*/
|
|
12
|
+
export function execute([{ getView, dispatch }]) {
|
|
13
|
+
// Don't need to calculate height if numberOfRows is defined or view is in basicMode and virtualizer is used
|
|
14
|
+
// because, virtualizer will set the height to auto which is a contradition
|
|
15
|
+
const basicMode = getView().meta.basicMode;
|
|
16
|
+
const isVirtualizerUsed = !!getVirtualizer(getView());
|
|
17
|
+
const isNumberOfRowsDefined = !!getView().meta.numberOfRows;
|
|
18
|
+
if (isNumberOfRowsDefined || (basicMode && isVirtualizerUsed)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// start calculating height
|
|
22
|
+
const { bodyHeight = 0, meta: { height: { height = 0, minHeight = 0, fitHeightToElement, deltaAdjustment = 0 } = {} } } = getView();
|
|
23
|
+
const domContainer = getView().getDomContainer();
|
|
24
|
+
if (!domContainer)
|
|
25
|
+
return;
|
|
26
|
+
let calcHeight = 0;
|
|
27
|
+
// @ts-expect-error minHeight can be string. TODO fix this.
|
|
28
|
+
const extraHeight = Math.abs(domContainer.offsetHeight - (bodyHeight || minHeight));
|
|
29
|
+
let styleHeight = 0;
|
|
30
|
+
let targetEle;
|
|
31
|
+
let temp = domContainer;
|
|
32
|
+
// Height is the first priority
|
|
33
|
+
if (height) {
|
|
34
|
+
// @ts-expect-error bodyHeight can be string. TODO fix this.
|
|
35
|
+
calcHeight = Math.abs(height - domContainer.offsetHeight - bodyHeight);
|
|
36
|
+
}
|
|
37
|
+
else if (fitHeightToElement) {
|
|
38
|
+
// Height is not available then fitHeightToElement is priority
|
|
39
|
+
/**
|
|
40
|
+
* nodeType = 1 mean any element node other than document
|
|
41
|
+
* nodeType = 9 mean document object
|
|
42
|
+
*/
|
|
43
|
+
if (fitHeightToElement.nodeType === 1 ||
|
|
44
|
+
fitHeightToElement.nodeType === 9) {
|
|
45
|
+
targetEle = fitHeightToElement;
|
|
46
|
+
}
|
|
47
|
+
else if (fitHeightToElement === 'document') {
|
|
48
|
+
targetEle = document;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
targetEle = document.querySelector(fitHeightToElement);
|
|
52
|
+
}
|
|
53
|
+
if (targetEle) {
|
|
54
|
+
let eleHeight = targetEle.offsetHeight;
|
|
55
|
+
if (targetEle === document) {
|
|
56
|
+
eleHeight = targetEle.documentElement.clientHeight;
|
|
57
|
+
}
|
|
58
|
+
while (temp !== null && temp !== undefined && temp !== targetEle) {
|
|
59
|
+
temp = temp.parentElement;
|
|
60
|
+
if (temp !== null) {
|
|
61
|
+
const style = window.getComputedStyle(temp);
|
|
62
|
+
const margin = parseFloat(style.marginTop) + parseFloat(style.marginBottom);
|
|
63
|
+
const padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
|
|
64
|
+
styleHeight = styleHeight + margin + padding;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
calcHeight = eleHeight - extraHeight - styleHeight;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
// @ts-expect-error minHeight, deltaAdjustment can be string. TODO fix this.
|
|
72
|
+
calcHeight = Math.abs(minHeight - extraHeight - deltaAdjustment);
|
|
73
|
+
}
|
|
74
|
+
// minHeight is the priority
|
|
75
|
+
// tableHeight should not be less than minHeight
|
|
76
|
+
// calcHeight = minHeight > calcHeight + extraHeight ? minHeight : calcHeight;
|
|
77
|
+
// adjustment is from config if they want to adjust some height plus or mis
|
|
78
|
+
// instance.tableHeight = calcHeight - deltaAdjustment;
|
|
79
|
+
// @ts-expect-error deltaAdjustment can be string. TODO fix this.
|
|
80
|
+
if (getView().bodyHeight !== calcHeight - deltaAdjustment) {
|
|
81
|
+
// @ts-expect-error deltaAdjustment can be string. TODO fix this.
|
|
82
|
+
getView().setProp('bodyHeight', calcHeight - deltaAdjustment);
|
|
83
|
+
// dispatch a action so that component re-render when this method is invoked from resize handler
|
|
84
|
+
dispatch(actionUpdateTableHeight(getView().bodyHeight));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Toggles the `resize listener` on `window`
|
|
89
|
+
* @param param.0 {@link BeforeRenderFeatureProps}.
|
|
90
|
+
* @param param.1 Resize listener.
|
|
91
|
+
* @returns void
|
|
92
|
+
*/
|
|
93
|
+
function attachResize([{ getView }, resizeListener]) {
|
|
94
|
+
const { meta: { height: { height, fitHeightToElement, autoSize = true } = {}, basicMode, numberOfRows } } = getView();
|
|
95
|
+
const isNumberOfRowsDefined = !!numberOfRows;
|
|
96
|
+
if (!basicMode && !isNumberOfRowsDefined && !height && fitHeightToElement && autoSize) {
|
|
97
|
+
window.removeEventListener('resize', resizeListener);
|
|
98
|
+
window.addEventListener('resize', resizeListener);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
window.removeEventListener('resize', resizeListener);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Calculates the {@link View.bodyHeight body height} of the view and toggles `resize listener` to the `window`.
|
|
106
|
+
*
|
|
107
|
+
* 1. The `body height` is calculated only on initial mount of the Repeating structures, if following properties are provided in {@link Meta}:
|
|
108
|
+
* - {@link Meta.height}
|
|
109
|
+
* - {@link Meta.numberOfRows}
|
|
110
|
+
*
|
|
111
|
+
* 2. The `resize listener` is attached/removed on initial mount of Repeating structures, after considering the values for following properties in {@link Meta}:
|
|
112
|
+
* - {@link Meta.height}
|
|
113
|
+
* - {@link Meta.numberOfRows}
|
|
114
|
+
*
|
|
115
|
+
* Additionally the `resize listener` will be removed on `UNMOUNT` event publish.
|
|
116
|
+
*
|
|
117
|
+
*/
|
|
118
|
+
export default (rsInternal) => {
|
|
119
|
+
const { getView, getRsStateResolver, getPubSubUtils } = rsInternal;
|
|
120
|
+
const { dispatch } = getRsStateResolver();
|
|
121
|
+
const instExecute = execute.bind(null, [{ getView, dispatch }]);
|
|
122
|
+
let timeoutId = null;
|
|
123
|
+
const resizeListener = () => {
|
|
124
|
+
// prevent execution of previous setTimeout
|
|
125
|
+
clearTimeout(timeoutId);
|
|
126
|
+
// change width from the state object after 150 milliseconds
|
|
127
|
+
timeoutId = setTimeout(() => instExecute(), 500);
|
|
128
|
+
};
|
|
129
|
+
getPubSubUtils().subscribe(UNMOUNT, () => {
|
|
130
|
+
window.removeEventListener('resize', resizeListener);
|
|
131
|
+
});
|
|
132
|
+
const memoisedExecute = withMemoization(execute);
|
|
133
|
+
const memoisedAttachResize = withMemoization(attachResize);
|
|
134
|
+
return (featureProps) => {
|
|
135
|
+
memoisedExecute([featureProps], [featureProps.getView().meta.numberOfRows, featureProps.getView().meta.height]);
|
|
136
|
+
memoisedAttachResize([featureProps, resizeListener], [featureProps.getView().meta.numberOfRows, featureProps.getView().meta.height]);
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=adjustHeight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustHeight.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBA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C,IAAI,CAAC,MAAM,CAAC,CAC/E,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { UNMOUNT } from '../../../pubSub/events';\nimport { actionUpdateTableHeight } from '../../../actions/actions';\nimport { withMemoization } from '../../../utils/util';\nimport type RsInternal from '../../../RsInternal';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\nimport type View from '../../../generators/ViewGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { Meta } from '../../../../../types/Meta.types';\n\nconst getVirtualizer = (view: View) => {\n return view.virtualizeElements?.rootVirtualiser;\n};\n\n/**\n * Calculates the {@link View.bodyHeight body height} of the view.\n * @param param.0 {@link BeforeRenderFeatureProps}.\n * @returns void\n */\nexport function execute([{ getView, dispatch }]: [featureProps: BeforeRenderFeatureProps]) {\n // Don't need to calculate height if numberOfRows is defined or view is in basicMode and virtualizer is used\n // because, virtualizer will set the height to auto which is a contradition\n const basicMode = getView().meta.basicMode;\n const isVirtualizerUsed = !!getVirtualizer(getView());\n const isNumberOfRowsDefined = !!getView().meta.numberOfRows;\n if (isNumberOfRowsDefined || (basicMode && isVirtualizerUsed)) {\n return;\n }\n\n // start calculating height\n const {\n bodyHeight = 0,\n meta: { height: { height = 0, minHeight = 0, fitHeightToElement, deltaAdjustment = 0 } = {} }\n } = getView();\n\n const domContainer = getView().getDomContainer();\n\n if (!domContainer) return;\n\n let calcHeight = 0;\n // @ts-expect-error minHeight can be string. TODO fix this.\n const extraHeight = Math.abs(domContainer.offsetHeight - (bodyHeight || minHeight));\n let styleHeight = 0;\n let targetEle;\n let temp = domContainer;\n // Height is the first priority\n if (height) {\n // @ts-expect-error bodyHeight can be string. TODO fix this.\n calcHeight = Math.abs(height - domContainer.offsetHeight - bodyHeight);\n } else if (fitHeightToElement) {\n // Height is not available then fitHeightToElement is priority\n /**\n * nodeType = 1 mean any element node other than document\n * nodeType = 9 mean document object\n */\n if (\n (fitHeightToElement as HTMLElement).nodeType === 1 ||\n (fitHeightToElement as HTMLElement).nodeType === 9\n ) {\n targetEle = fitHeightToElement;\n } else if (fitHeightToElement === 'document') {\n targetEle = document;\n } else {\n targetEle = document.querySelector(fitHeightToElement as string);\n }\n if (targetEle) {\n let eleHeight = (targetEle as HTMLElement).offsetHeight;\n if (targetEle === document) {\n eleHeight = targetEle.documentElement.clientHeight;\n }\n\n while (temp !== null && temp !== undefined && temp !== targetEle) {\n temp = temp.parentElement!;\n if (temp !== null) {\n const style = window.getComputedStyle(temp);\n const margin = parseFloat(style.marginTop) + parseFloat(style.marginBottom);\n const padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n styleHeight = styleHeight + margin + padding;\n }\n }\n calcHeight = eleHeight - extraHeight - styleHeight;\n }\n } else {\n // @ts-expect-error minHeight, deltaAdjustment can be string. TODO fix this.\n calcHeight = Math.abs(minHeight - extraHeight - deltaAdjustment);\n }\n\n // minHeight is the priority\n // tableHeight should not be less than minHeight\n // calcHeight = minHeight > calcHeight + extraHeight ? minHeight : calcHeight;\n // adjustment is from config if they want to adjust some height plus or mis\n // instance.tableHeight = calcHeight - deltaAdjustment;\n // @ts-expect-error deltaAdjustment can be string. TODO fix this.\n if (getView().bodyHeight !== calcHeight - deltaAdjustment) {\n // @ts-expect-error deltaAdjustment can be string. TODO fix this.\n getView().setProp('bodyHeight', calcHeight - deltaAdjustment);\n // dispatch a action so that component re-render when this method is invoked from resize handler\n dispatch(actionUpdateTableHeight(getView().bodyHeight));\n }\n}\n\n/**\n * Toggles the `resize listener` on `window`\n * @param param.0 {@link BeforeRenderFeatureProps}.\n * @param param.1 Resize listener.\n * @returns void\n */\nfunction attachResize([{ getView }, resizeListener]: [\n featureProps: BeforeRenderFeatureProps,\n resizeListener: () => void\n]) {\n const {\n meta: { height: { height, fitHeightToElement, autoSize = true } = {}, basicMode, numberOfRows }\n } = getView();\n const isNumberOfRowsDefined = !!numberOfRows;\n if (!basicMode && !isNumberOfRowsDefined && !height && fitHeightToElement && autoSize) {\n window.removeEventListener('resize', resizeListener);\n window.addEventListener('resize', resizeListener);\n } else {\n window.removeEventListener('resize', resizeListener);\n }\n}\n\n/**\n * Calculates the {@link View.bodyHeight body height} of the view and toggles `resize listener` to the `window`.\n *\n * 1. The `body height` is calculated only on initial mount of the Repeating structures, if following properties are provided in {@link Meta}:\n * - {@link Meta.height}\n * - {@link Meta.numberOfRows}\n *\n * 2. The `resize listener` is attached/removed on initial mount of Repeating structures, after considering the values for following properties in {@link Meta}:\n * - {@link Meta.height}\n * - {@link Meta.numberOfRows}\n *\n * Additionally the `resize listener` will be removed on `UNMOUNT` event publish.\n *\n */\nexport default (rsInternal: RsInternal) => {\n const { getView, getRsStateResolver, getPubSubUtils } = rsInternal;\n const { dispatch } = getRsStateResolver();\n const instExecute = execute.bind(null, [{ getView, dispatch } as BeforeRenderFeatureProps]);\n let timeoutId: ReturnType<typeof setTimeout> | null = null;\n const resizeListener = () => {\n // prevent execution of previous setTimeout\n clearTimeout(timeoutId!);\n // change width from the state object after 150 milliseconds\n timeoutId = setTimeout(() => instExecute(), 500);\n };\n\n getPubSubUtils().subscribe(UNMOUNT, () => {\n window.removeEventListener('resize', resizeListener);\n });\n\n const memoisedExecute = withMemoization(execute);\n const memoisedAttachResize = withMemoization(attachResize);\n return (featureProps: BeforeRenderFeatureProps) => {\n memoisedExecute(\n [featureProps],\n [featureProps.getView().meta.numberOfRows, featureProps.getView().meta.height]\n );\n memoisedAttachResize(\n [featureProps, resizeListener],\n [featureProps.getView().meta.numberOfRows, featureProps.getView().meta.height]\n );\n };\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BeforeRenderFeatureProps } from '../../featureFactory';
|
|
2
|
+
/**
|
|
3
|
+
* Adjusts the {@link View.bodyHeight bodyHeight} of the view.
|
|
4
|
+
* @param param0 - {@link BeforeRenderFeatureProps}
|
|
5
|
+
*/
|
|
6
|
+
export declare function updateBodyHeight([{ getView, getState }]: [
|
|
7
|
+
featureProps: BeforeRenderFeatureProps
|
|
8
|
+
]): void;
|
|
9
|
+
/**
|
|
10
|
+
* Adjusts the {@link View.bodyHeight bodyHeight} of the view based on the following properties change:
|
|
11
|
+
* - {@link State.selectedHeightOption}.
|
|
12
|
+
* - {@link Meta.numberOfRows}.
|
|
13
|
+
* - {@link Meta.template}.
|
|
14
|
+
* - {@link State.groups}.
|
|
15
|
+
*/
|
|
16
|
+
declare const _default: () => (featureProps: BeforeRenderFeatureProps) => void;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=adjustHeightToFitRecords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustHeightToFitRecords.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAQrE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE;IACxD,YAAY,EAAE,wBAAwB;CACvC,QAwBA;AACD;;;;;;GAMG;6CAIqC,wBAAwB;AAHhE,wBAcE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { withMemoization } from '../../../utils/util';
|
|
2
|
+
import { rowDensityClasses, TEMPLATES } from '../../../constants';
|
|
3
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
4
|
+
/**
|
|
5
|
+
* Adjusts the {@link View.bodyHeight bodyHeight} of the view.
|
|
6
|
+
* @param param0 - {@link BeforeRenderFeatureProps}
|
|
7
|
+
*/
|
|
8
|
+
export function updateBodyHeight([{ getView, getState }]) {
|
|
9
|
+
const { meta: { numberOfRows, template } } = getView();
|
|
10
|
+
// row height is calculated based on the height provided for each row in the styledtablecontainer.jsx styles
|
|
11
|
+
let rowHeight;
|
|
12
|
+
let headerHeight;
|
|
13
|
+
if (getState().selectedHeightOption) {
|
|
14
|
+
rowHeight = rowDensityClasses[getState().selectedHeightOption].rowHeight;
|
|
15
|
+
headerHeight = 45;
|
|
16
|
+
}
|
|
17
|
+
if (template === TEMPLATES.TIMELINE) {
|
|
18
|
+
rowHeight = 41;
|
|
19
|
+
headerHeight = 56;
|
|
20
|
+
if (!getState().groups?.[0]?.dateFunction) {
|
|
21
|
+
headerHeight = 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (rowHeight && numberOfRows) {
|
|
25
|
+
getView().setProp('bodyHeight', rowHeight * numberOfRows + headerHeight);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Adjusts the {@link View.bodyHeight bodyHeight} of the view based on the following properties change:
|
|
30
|
+
* - {@link State.selectedHeightOption}.
|
|
31
|
+
* - {@link Meta.numberOfRows}.
|
|
32
|
+
* - {@link Meta.template}.
|
|
33
|
+
* - {@link State.groups}.
|
|
34
|
+
*/
|
|
35
|
+
export default () => {
|
|
36
|
+
const memoisedFunc = withMemoization(updateBodyHeight);
|
|
37
|
+
return function execute(featureProps) {
|
|
38
|
+
memoisedFunc([featureProps], [
|
|
39
|
+
featureProps.getState().selectedHeightOption,
|
|
40
|
+
featureProps.getView().meta.numberOfRows,
|
|
41
|
+
featureProps.getView().meta.template,
|
|
42
|
+
featureProps.getState().groups
|
|
43
|
+
]);
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=adjustHeightToFitRecords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustHeightToFitRecords.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustHeightToFitRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAOlE,qDAAqD;AAErD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,C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ent":["import { withMemoization } from '../../../utils/util';\nimport { rowDensityClasses, TEMPLATES } from '../../../constants';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\n// The below types are being used in JsDocs.\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { State } from '../../../../../types/State.types';\nimport type { Meta } from '../../../../../types/Meta.types';\nimport type View from '../../../generators/ViewGenerator';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * Adjusts the {@link View.bodyHeight bodyHeight} of the view.\n * @param param0 - {@link BeforeRenderFeatureProps}\n */\nexport function updateBodyHeight([{ getView, getState }]: [\n featureProps: BeforeRenderFeatureProps\n]) {\n const {\n meta: { numberOfRows, template }\n } = getView();\n\n // row height is calculated based on the height provided for each row in the styledtablecontainer.jsx styles\n let rowHeight;\n let headerHeight;\n if (getState().selectedHeightOption) {\n rowHeight = rowDensityClasses[getState().selectedHeightOption!].rowHeight;\n headerHeight = 45;\n }\n\n if (template === TEMPLATES.TIMELINE) {\n rowHeight = 41;\n headerHeight = 56;\n if (!getState().groups?.[0]?.dateFunction) {\n headerHeight = 0;\n }\n }\n\n if (rowHeight && numberOfRows) {\n getView().setProp('bodyHeight', rowHeight * numberOfRows + headerHeight!);\n }\n}\n/**\n * Adjusts the {@link View.bodyHeight bodyHeight} of the view based on the following properties change:\n * - {@link State.selectedHeightOption}.\n * - {@link Meta.numberOfRows}.\n * - {@link Meta.template}.\n * - {@link State.groups}.\n */\nexport default () => {\n const memoisedFunc = withMemoization(updateBodyHeight);\n\n return function execute(featureProps: BeforeRenderFeatureProps) {\n memoisedFunc(\n [featureProps],\n [\n featureProps.getState().selectedHeightOption,\n featureProps.getView().meta.numberOfRows,\n featureProps.getView().meta.template,\n featureProps.getState().groups\n ]\n );\n };\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type RsInternal from '../../../RsInternal';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the {@link View.bodyMaxHeight bodyMaxHeight} of the view
|
|
4
|
+
* @param getView - A function that returns current {@link View}.
|
|
5
|
+
* @returns void
|
|
6
|
+
*/
|
|
7
|
+
export declare function updateBodyMaxHeight(getView: RsInternal['getView']): void;
|
|
8
|
+
/**
|
|
9
|
+
* Calculates the {@link View.bodyMaxHeight bodyMaxHeight} of the view on mount of the RS component.
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: (rsInternal: RsInternal) => void;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=adjustMaxHeight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustMaxHeight.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustMaxHeight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAKlD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,QA0BjE;AAED;;GAEG;qCACyB,UAAU;AAAtC,wBAGE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MOUNT } from '../../../pubSub/events';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the {@link View.bodyMaxHeight bodyMaxHeight} of the view
|
|
4
|
+
* @param getView - A function that returns current {@link View}.
|
|
5
|
+
* @returns void
|
|
6
|
+
*/
|
|
7
|
+
export function updateBodyMaxHeight(getView) {
|
|
8
|
+
const { meta: { height: { maxHeight } = {} } } = getView();
|
|
9
|
+
if (maxHeight === undefined)
|
|
10
|
+
return;
|
|
11
|
+
const domContainer = getView().getDomContainer();
|
|
12
|
+
const pContainer = getView().virtualizeElements.rootVirtualiser?.getParentContainer();
|
|
13
|
+
// pContainer might not be present if RSCore consumer does not use virtualizer.(Eg. Timeline view in RS)
|
|
14
|
+
// TODO: Decouple Dom nodes logic from RSCore.
|
|
15
|
+
if (!domContainer || !pContainer)
|
|
16
|
+
return;
|
|
17
|
+
const extraHeight = domContainer.offsetHeight - pContainer.offsetHeight;
|
|
18
|
+
let calcMaxHeight;
|
|
19
|
+
if (typeof maxHeight === 'string' && maxHeight.startsWith('--')) {
|
|
20
|
+
// Means it is a css variable which is a string and it needs to be computed with calc function
|
|
21
|
+
// If css variable is not defined then fallback to default max height i.e 550px
|
|
22
|
+
const defaultMaxHeight = `calc(550px + ${extraHeight}px + 32px)`;
|
|
23
|
+
calcMaxHeight = `calc(var(${maxHeight}, ${defaultMaxHeight}) - ${extraHeight}px - 32px)`;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
// It is a number
|
|
27
|
+
calcMaxHeight = `${maxHeight - extraHeight - 32}px`;
|
|
28
|
+
}
|
|
29
|
+
getView().setProp('bodyMaxHeight', calcMaxHeight);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Calculates the {@link View.bodyMaxHeight bodyMaxHeight} of the view on mount of the RS component.
|
|
33
|
+
*/
|
|
34
|
+
export default (rsInternal) => {
|
|
35
|
+
const { getView, getPubSubUtils } = rsInternal;
|
|
36
|
+
getPubSubUtils().subscribe(MOUNT, updateBodyMaxHeight.bind(null, getView));
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=adjustMaxHeight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustMaxHeight.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/adjustMaxHeight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAI/C;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAA8B;IAChE,MAAM,EACJ,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EACrC,GAAG,OAAO,EAAE,CAAC;IAEd,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO;IAEpC,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC,eAAe,EAAE,CAAC;IACjD,MAAM,UAAU,GAAG,OAAO,EAAE,CAAC,kBAAkB,CAAC,eAAe,EAAE,kBAAkB,EAAE,CAAC;IACtF,wGAAwG;IACxG,8CAA8C;IAC9C,IAAI,CAAC,YAAY,IAAI,CAAC,UAAU;QAAE,OAAO;IAEzC,MAAM,WAAW,GAAG,YAAY,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;IAExE,IAAI,aAAqB,CAAC;IAC1B,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAChE,8FAA8F;QAC9F,+EAA+E;QAC/E,MAAM,gBAAgB,GAAG,gBAAgB,WAAW,YAAY,CAAC;QACjE,aAAa,GAAG,YAAY,SAAS,KAAK,gBAAgB,OAAO,WAAW,YAAY,CAAC;IAC3F,CAAC;SAAM,CAAC;QACN,iBAAiB;QACjB,aAAa,GAAG,GAAI,SAAoB,GAAG,WAAW,GAAG,EAAE,IAAI,CAAC;IAClE,CAAC;IACD,OAAO,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,eAAe,CAAC,UAAsB,EAAE,EAAE;IACxC,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;IAC/C,cAAc,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7E,CAAC,CAAC","sourcesContent":["import type RsInternal from '../../../RsInternal';\nimport { MOUNT } from '../../../pubSub/events';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type View from '../../../generators/ViewGenerator';\n\n/**\n * Calculates the {@link View.bodyMaxHeight bodyMaxHeight} of the view\n * @param getView - A function that returns current {@link View}.\n * @returns void\n */\nexport function updateBodyMaxHeight(getView: RsInternal['getView']) {\n const {\n meta: { height: { maxHeight } = {} }\n } = getView();\n\n if (maxHeight === undefined) return;\n\n const domContainer = getView().getDomContainer();\n const pContainer = getView().virtualizeElements.rootVirtualiser?.getParentContainer();\n // pContainer might not be present if RSCore consumer does not use virtualizer.(Eg. Timeline view in RS)\n // TODO: Decouple Dom nodes logic from RSCore.\n if (!domContainer || !pContainer) return;\n\n const extraHeight = domContainer.offsetHeight - pContainer.offsetHeight;\n\n let calcMaxHeight: string;\n if (typeof maxHeight === 'string' && maxHeight.startsWith('--')) {\n // Means it is a css variable which is a string and it needs to be computed with calc function\n // If css variable is not defined then fallback to default max height i.e 550px\n const defaultMaxHeight = `calc(550px + ${extraHeight}px + 32px)`;\n calcMaxHeight = `calc(var(${maxHeight}, ${defaultMaxHeight}) - ${extraHeight}px - 32px)`;\n } else {\n // It is a number\n calcMaxHeight = `${(maxHeight as number) - extraHeight - 32}px`;\n }\n getView().setProp('bodyMaxHeight', calcMaxHeight);\n}\n\n/**\n * Calculates the {@link View.bodyMaxHeight bodyMaxHeight} of the view on mount of the RS component.\n */\nexport default (rsInternal: RsInternal) => {\n const { getView, getPubSubUtils } = rsInternal;\n getPubSubUtils().subscribe(MOUNT, updateBodyMaxHeight.bind(null, getView));\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BeforeRenderFeatureProps } from '../../featureFactory';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the aggregate values for columns when any of the following state properties are changed:
|
|
4
|
+
* - {@link State.aggregationInfo}
|
|
5
|
+
* - {@link State.filterExpression}
|
|
6
|
+
* - `query` in {@link State.search}
|
|
7
|
+
* - `active` in {@link State.personalization}
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: () => (featureProps: BeforeRenderFeatureProps) => Promise<void>;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=aggregation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregation.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/aggregation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAmCrE;;;;;;GAMG;6CAI2C,wBAAwB;AAHtE,wBAgBE"}
|