@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,80 @@
|
|
|
1
|
+
import View from './generators/ViewGenerator';
|
|
2
|
+
import initializeFeatures from './features/featureFactory';
|
|
3
|
+
import initializePubSub from './pubSub';
|
|
4
|
+
import initializeReducers from './reducers';
|
|
5
|
+
import RsCore from './RsCore';
|
|
6
|
+
import StateResolver, { initializeFetchDataHandler } from './StateResolver';
|
|
7
|
+
import { areColumnWidthsCalculated, normalizeMeta } from './utils/util';
|
|
8
|
+
import defaultConfig from './config/config';
|
|
9
|
+
import { nonPersonalizationViewKey } from './constants';
|
|
10
|
+
import { MOUNT, AFTER_RENDER, UNMOUNT } from './pubSub/events';
|
|
11
|
+
import RsInternal from './RsInternal';
|
|
12
|
+
import RsStore from './RsStore';
|
|
13
|
+
import RsProps from './RsProps';
|
|
14
|
+
/**
|
|
15
|
+
* Initializes {@link RsInternal} object.
|
|
16
|
+
* @param args {@link RsCoreBootArgs rs core initial args}
|
|
17
|
+
* @returns - {@link RsInternal}
|
|
18
|
+
*/
|
|
19
|
+
function initializeInternalState(args) {
|
|
20
|
+
const { formatters, renderFormatterTypeMap, toolBarOptions, onRowClickAction, apiContext, renderFactory, presets, persistedInfo, dispatch, meta, mode, styleFormats, ...viewOptions } = args;
|
|
21
|
+
// TODO: add some validation to check if all the required props are available
|
|
22
|
+
const rsInternal = new RsInternal();
|
|
23
|
+
const normalizedMeta = normalizeMeta({
|
|
24
|
+
...meta,
|
|
25
|
+
id: meta.id ?? nonPersonalizationViewKey,
|
|
26
|
+
isPreset: true
|
|
27
|
+
}, defaultConfig);
|
|
28
|
+
const rsStore = new RsStore(normalizedMeta, [normalizedMeta, ...presets], true, false);
|
|
29
|
+
rsInternal.setRsStore(rsStore);
|
|
30
|
+
const rsProps = new RsProps(apiContext, { dispatch }, {
|
|
31
|
+
persistedInfo,
|
|
32
|
+
mode,
|
|
33
|
+
renderFactory,
|
|
34
|
+
formatters,
|
|
35
|
+
renderFormatterTypeMap,
|
|
36
|
+
toolBarOptions,
|
|
37
|
+
onRowClickAction,
|
|
38
|
+
styleFormats
|
|
39
|
+
});
|
|
40
|
+
rsInternal.setRsProps(rsProps);
|
|
41
|
+
rsInternal.setPubSubUtils(initializePubSub(rsInternal));
|
|
42
|
+
const rsStateResolver = new StateResolver(initializeReducers(rsInternal), initializeFetchDataHandler(rsInternal), rsInternal);
|
|
43
|
+
rsInternal.setRsStateResolver(rsStateResolver);
|
|
44
|
+
const view = new View({ ...viewOptions, meta: rsStore.meta }, rsInternal);
|
|
45
|
+
rsInternal.updateView(view);
|
|
46
|
+
const [beforeRenderFeatures, afterRenderFeatures] = initializeFeatures(rsInternal);
|
|
47
|
+
rsInternal.setAfterRenderFeatures(afterRenderFeatures);
|
|
48
|
+
rsStateResolver.setMiddlewares(beforeRenderFeatures);
|
|
49
|
+
return rsInternal;
|
|
50
|
+
}
|
|
51
|
+
// the API for consumer layer
|
|
52
|
+
/**
|
|
53
|
+
* Initializes the core library and returns an instance of the Repeating Structures Core library.
|
|
54
|
+
*/
|
|
55
|
+
export default function initializeRsCore(args) {
|
|
56
|
+
const rsInternal = initializeInternalState(args);
|
|
57
|
+
rsInternal.getPubSubUtils().subscribe(MOUNT, () => {
|
|
58
|
+
rsInternal.getRsStore().isMounted = true;
|
|
59
|
+
});
|
|
60
|
+
rsInternal.getPubSubUtils().subscribe(UNMOUNT, () => {
|
|
61
|
+
rsInternal.getRsStore().isMounted = false;
|
|
62
|
+
});
|
|
63
|
+
rsInternal.getPubSubUtils().subscribe(AFTER_RENDER, () => {
|
|
64
|
+
if (rsInternal.getView().isInstantRender !== false || !rsInternal.getRsStore().isMounted)
|
|
65
|
+
return;
|
|
66
|
+
rsInternal.getAfterRenderFeatures()();
|
|
67
|
+
// TODO: need to figure out better way to handle initial animation prevention
|
|
68
|
+
/**
|
|
69
|
+
* we are depending on column widths due to the auto resize of column feature
|
|
70
|
+
* which runs after the rows fetch and then resizes the column widths, thus
|
|
71
|
+
* animating the columns.
|
|
72
|
+
*/
|
|
73
|
+
if (areColumnWidthsCalculated(rsInternal.getView().state?.columnWidths)) {
|
|
74
|
+
rsInternal.getRsStore().isInitialRender = false;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
// TODO: Add subscription for UNMOUNT event and do the cleanup in rsCore
|
|
78
|
+
return new RsCore(rsInternal);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,4BAA4B,CAAC;AAC9C,OAAO,kBAAkB,MAAM,2BAA2B,CAAC;AAC3D,OAAO,gBAAgB,MAAM,UAAU,CAAC;AACxC,OAAO,kBAAkB,MAAM,YAAY,CAAC;AAC5C,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,aAAa,EAAE,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAA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wE;IAExE,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","sourcesContent":["import type RsCoreBootArgs from '../../types/RsCoreBootArgs.types';\n\nimport View from './generators/ViewGenerator';\nimport initializeFeatures from './features/featureFactory';\nimport initializePubSub from './pubSub';\nimport initializeReducers from './reducers';\nimport RsCore from './RsCore';\nimport StateResolver, { initializeFetchDataHandler } from './StateResolver';\nimport { areColumnWidthsCalculated, normalizeMeta } from './utils/util';\nimport defaultConfig from './config/config';\nimport { nonPersonalizationViewKey } from './constants';\nimport { MOUNT, AFTER_RENDER, UNMOUNT } from './pubSub/events';\nimport RsInternal from './RsInternal';\nimport RsStore from './RsStore';\nimport RsProps from './RsProps';\n\n/**\n * Initializes {@link RsInternal} object.\n * @param args {@link RsCoreBootArgs rs core initial args}\n * @returns - {@link RsInternal}\n */\nfunction initializeInternalState(args: RsCoreBootArgs) {\n const {\n formatters,\n renderFormatterTypeMap,\n toolBarOptions,\n onRowClickAction,\n apiContext,\n renderFactory,\n presets,\n persistedInfo,\n dispatch,\n meta,\n mode,\n styleFormats,\n ...viewOptions\n } = args;\n\n // TODO: add some validation to check if all the required props are available\n const rsInternal = new RsInternal();\n const normalizedMeta = normalizeMeta(\n {\n ...meta,\n id: meta.id ?? nonPersonalizationViewKey,\n isPreset: true\n },\n defaultConfig\n );\n const rsStore = new RsStore(normalizedMeta, [normalizedMeta, ...presets], true, false);\n rsInternal.setRsStore(rsStore);\n const rsProps = new RsProps(\n apiContext,\n { dispatch },\n {\n persistedInfo,\n mode,\n renderFactory,\n formatters,\n renderFormatterTypeMap,\n toolBarOptions,\n onRowClickAction,\n styleFormats\n }\n );\n rsInternal.setRsProps(rsProps);\n\n rsInternal.setPubSubUtils(initializePubSub(rsInternal));\n\n const rsStateResolver = new StateResolver(\n initializeReducers(rsInternal),\n initializeFetchDataHandler(rsInternal),\n rsInternal\n );\n rsInternal.setRsStateResolver(rsStateResolver);\n\n const view = new View({ ...viewOptions, meta: rsStore.meta }, rsInternal);\n rsInternal.updateView(view);\n\n const [beforeRenderFeatures, afterRenderFeatures] = initializeFeatures(rsInternal);\n rsInternal.setAfterRenderFeatures(afterRenderFeatures);\n\n rsStateResolver.setMiddlewares(beforeRenderFeatures);\n return rsInternal;\n}\n\n// the API for consumer layer\n/**\n * Initializes the core library and returns an instance of the Repeating Structures Core library.\n */\nexport default function initializeRsCore(args: RsCoreBootArgs): RsCore {\n const rsInternal = initializeInternalState(args);\n\n rsInternal.getPubSubUtils().subscribe(MOUNT, () => {\n rsInternal.getRsStore().isMounted = true;\n });\n\n rsInternal.getPubSubUtils().subscribe(UNMOUNT, () => {\n rsInternal.getRsStore().isMounted = false;\n });\n\n rsInternal.getPubSubUtils().subscribe(AFTER_RENDER, () => {\n if (rsInternal.getView().isInstantRender !== false || !rsInternal.getRsStore().isMounted)\n return;\n rsInternal.getAfterRenderFeatures()();\n\n // TODO: need to figure out better way to handle initial animation prevention\n /**\n * we are depending on column widths due to the auto resize of column feature\n * which runs after the rows fetch and then resizes the column widths, thus\n * animating the columns.\n */\n if (areColumnWidthsCalculated(rsInternal.getView().state?.columnWidths)) {\n rsInternal.getRsStore().isInitialRender = false;\n }\n });\n\n // TODO: Add subscription for UNMOUNT event and do the cleanup in rsCore\n\n return new RsCore(rsInternal);\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const BEFORE_FETCH = "BEFORE_FETCH";
|
|
2
|
+
export declare const AFTER_FETCH = "AFTER_FETCH";
|
|
3
|
+
export declare const MOUNT = "MOUNT";
|
|
4
|
+
export declare const UNMOUNT = "UNMOUNT";
|
|
5
|
+
export declare const AFTER_RENDER = "AFTER_RENDER";
|
|
6
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/core/pubSub/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,YAAY,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../src/core/pubSub/events.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC;AAC7B,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC","sourcesContent":["export const BEFORE_FETCH = 'BEFORE_FETCH';\nexport const AFTER_FETCH = 'AFTER_FETCH';\nexport const MOUNT = 'MOUNT';\nexport const UNMOUNT = 'UNMOUNT';\nexport const AFTER_RENDER = 'AFTER_RENDER';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export default function initializePubSub(context: any): {
|
|
2
|
+
publish: (eventName: string, ...args: (() => void)[]) => void;
|
|
3
|
+
subscribe: (eventName: string, callback: () => void) => {
|
|
4
|
+
unsubscribe: () => void;
|
|
5
|
+
} | undefined;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/pubSub/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,GAAG;yBAGP,MAAM,WAAW,CAAC,MAAM,IAAI,CAAC,EAAE;2BAa3B,MAAM,YAAY,MAAM,IAAI;;;EAmB7E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default function initializePubSub(context) {
|
|
2
|
+
const subscribers = context.getSubscribers();
|
|
3
|
+
const publish = function publish(eventName, ...args) {
|
|
4
|
+
if (!subscribers || !Array.isArray(subscribers[eventName]))
|
|
5
|
+
return;
|
|
6
|
+
subscribers[eventName].forEach((callback) => {
|
|
7
|
+
if (args) {
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
args.push(this);
|
|
10
|
+
}
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
const payload = args || [this];
|
|
13
|
+
callback(...payload);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
const subscribe = function subscribe(eventName, callback) {
|
|
17
|
+
if (subscribers) {
|
|
18
|
+
if (!Array.isArray(subscribers[eventName])) {
|
|
19
|
+
subscribers[eventName] = [];
|
|
20
|
+
}
|
|
21
|
+
const length = subscribers[eventName].push(callback);
|
|
22
|
+
return {
|
|
23
|
+
unsubscribe: () => {
|
|
24
|
+
subscribers[eventName].splice(length - 1, 1);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
publish,
|
|
32
|
+
subscribe
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/pubSub/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAY;IACnD,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAE7C,MAAM,OAAO,GAAG,SAAS,OAAO,CAAC,SAAiB,EAAE,GAAG,IAAoB;QACzE,IAAI,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;YAAE,OAAO;QACnE,WAAW,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,QAAa,EAAE,EAAE;YAC/C,IAAI,IAAI,EAAE,CAAC;gBACT,aAAa;gBACb,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;YACD,aAAa;YACb,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/B,QAAQ,CAAC,GAAG,OAAO,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,SAAS,SAAS,CAAC,SAAiB,EAAE,QAAoB;QAC1E,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;gBAC3C,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;YAC9B,CAAC;YACD,MAAM,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrD,OAAO;gBACL,WAAW,EAAE,GAAG,EAAE;oBAChB,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC/C,CAAC;aACF,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO;QACL,OAAO;QACP,SAAS;KACV,CAAC;AACJ,CAAC","sourcesContent":["export default function initializePubSub(context: any) {\n const subscribers = context.getSubscribers();\n\n const publish = function publish(eventName: string, ...args: (() => void)[]) {\n if (!subscribers || !Array.isArray(subscribers[eventName])) return;\n subscribers[eventName].forEach((callback: any) => {\n if (args) {\n // @ts-ignore\n args.push(this);\n }\n // @ts-ignore\n const payload = args || [this];\n callback(...payload);\n });\n };\n\n const subscribe = function subscribe(eventName: string, callback: () => void) {\n if (subscribers) {\n if (!Array.isArray(subscribers[eventName])) {\n subscribers[eventName] = [];\n }\n const length = subscribers[eventName].push(callback);\n return {\n unsubscribe: () => {\n subscribers[eventName].splice(length - 1, 1);\n }\n };\n }\n return undefined;\n };\n\n return {\n publish,\n subscribe\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregation.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/aggregation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;gCAEhC,KAAK,UAAU,MAAM;AAA5C,wBAmCE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import ActionTypes from '../actions/actionConstants';
|
|
2
|
+
export default (state, action) => {
|
|
3
|
+
const { type } = action;
|
|
4
|
+
if (type === ActionTypes.UPDATE_AGGREGATION) {
|
|
5
|
+
const { columnId, type: aggregationType } = action.payload;
|
|
6
|
+
const aggregationInfo = state.aggregationInfo ? [...state.aggregationInfo] : [];
|
|
7
|
+
const currentIndex = aggregationInfo.findIndex(t => t.columnId === columnId);
|
|
8
|
+
if (currentIndex >= 0) {
|
|
9
|
+
// if current aggregation is of same type just return same state as no-op
|
|
10
|
+
if (aggregationInfo[currentIndex].type === action.payload.type) {
|
|
11
|
+
return state;
|
|
12
|
+
}
|
|
13
|
+
aggregationInfo.splice(currentIndex, 1);
|
|
14
|
+
}
|
|
15
|
+
if (aggregationType) {
|
|
16
|
+
const index = currentIndex >= 0 ? currentIndex : aggregationInfo.length;
|
|
17
|
+
aggregationInfo.splice(index, 0, {
|
|
18
|
+
columnId,
|
|
19
|
+
type: aggregationType
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
...state,
|
|
24
|
+
aggregationInfo
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
if (type === ActionTypes.UPDATE_AGGREGATIONS) {
|
|
28
|
+
return {
|
|
29
|
+
...state,
|
|
30
|
+
aggregationInfo: action.payload
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return state;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=aggregation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregation.js","sourceRoot":"","sources":["../../../../src/core/reducers/aggregation.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAGrD,eAAe,CAAC,KAAY,EAAE,MAAc,EAAE,EAAE;IAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAExB,IAAI,IAAI,KAAK,WAAW,CAAC,kBAAkB,EAAE,CAAC;QAC5C,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;QAC3D,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,MAAM,YAAY,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;QAC7E,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC;YACtB,yEAAyE;YACzE,IAAI,eAAe,CAAC,YAAY,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBAC/D,OAAO,KAAK,CAAC;YACf,CAAC;YACD,eAAe,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,KAAK,GAAG,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC;YACxE,eAAe,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE;gBAC/B,QAAQ;gBACR,IAAI,EAAE,eAAe;aACtB,CAAC,CAAC;QACL,CAAC;QACD,OAAO;YACL,GAAG,KAAK;YACR,eAAe;SAChB,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,KAAK,WAAW,CAAC,mBAAmB,EAAE,CAAC;QAC7C,OAAO;YACL,GAAG,KAAK;YACR,eAAe,EAAE,MAAM,CAAC,OAAO;SAChC,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport ActionTypes from '../actions/actionConstants';\nimport type { Action } from '../actions/actions.types';\n\nexport default (state: State, action: Action) => {\n const { type } = action;\n\n if (type === ActionTypes.UPDATE_AGGREGATION) {\n const { columnId, type: aggregationType } = action.payload;\n const aggregationInfo = state.aggregationInfo ? [...state.aggregationInfo] : [];\n const currentIndex = aggregationInfo.findIndex(t => t.columnId === columnId);\n if (currentIndex >= 0) {\n // if current aggregation is of same type just return same state as no-op\n if (aggregationInfo[currentIndex].type === action.payload.type) {\n return state;\n }\n aggregationInfo.splice(currentIndex, 1);\n }\n if (aggregationType) {\n const index = currentIndex >= 0 ? currentIndex : aggregationInfo.length;\n aggregationInfo.splice(index, 0, {\n columnId,\n type: aggregationType\n });\n }\n return {\n ...state,\n aggregationInfo\n };\n }\n\n if (type === ActionTypes.UPDATE_AGGREGATIONS) {\n return {\n ...state,\n aggregationInfo: action.payload\n };\n }\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;gCAEhC,KAAK,UAAU,MAAM;AAA5C,wBAWE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ActionTypes from '../actions/actionConstants';
|
|
2
|
+
export default (state, action) => {
|
|
3
|
+
const { type } = action;
|
|
4
|
+
if (type === ActionTypes.BOOTSTRAP) {
|
|
5
|
+
return {
|
|
6
|
+
...state,
|
|
7
|
+
bootstrap: true
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return state;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../src/core/reducers/bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAGrD,eAAe,CAAC,KAAY,EAAE,MAAc,EAAE,EAAE;IAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAExB,IAAI,IAAI,KAAK,WAAW,CAAC,SAAS,EAAE,CAAC;QACnC,OAAO;YACL,GAAG,KAAK;YACR,SAAS,EAAE,IAAI;SAChB,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport ActionTypes from '../actions/actionConstants';\nimport type { Action } from '../actions/actions.types';\n\nexport default (state: State, action: Action) => {\n const { type } = action;\n\n if (type === ActionTypes.BOOTSTRAP) {\n return {\n ...state,\n bootstrap: true\n };\n }\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnAlias.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/columnAlias.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;gCAEhC,KAAK,UAAU,MAAM;AAA5C,wBA0BE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import ActionTypes from '../actions/actionConstants';
|
|
2
|
+
export default (state, action) => {
|
|
3
|
+
const { type } = action;
|
|
4
|
+
if (type === ActionTypes.CHANGE_LABEL) {
|
|
5
|
+
const { columnId, label } = action.payload;
|
|
6
|
+
const columnAlias = { ...state.columnAlias };
|
|
7
|
+
// If label not present remove field from aliases
|
|
8
|
+
if (!label)
|
|
9
|
+
delete columnAlias[columnId];
|
|
10
|
+
// If label present add to aliases
|
|
11
|
+
else
|
|
12
|
+
columnAlias[columnId] = label.trim();
|
|
13
|
+
return {
|
|
14
|
+
...state,
|
|
15
|
+
columnAlias
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
// Replaces aliases with new aliases
|
|
19
|
+
if (type === ActionTypes.REPLACE_LABELS) {
|
|
20
|
+
const { aliases = {} } = action.payload;
|
|
21
|
+
return {
|
|
22
|
+
...state,
|
|
23
|
+
columnAlias: { ...aliases }
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return state;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=columnAlias.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnAlias.js","sourceRoot":"","sources":["../../../../src/core/reducers/columnAlias.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAGrD,eAAe,CAAC,KAAY,EAAE,MAAc,EAAE,EAAE;IAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAExB,IAAI,IAAI,KAAK,WAAW,CAAC,YAAY,EAAE,CAAC;QACtC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;QAC3C,MAAM,WAAW,GAAG,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAC7C,iDAAiD;QACjD,IAAI,CAAC,KAAK;YAAE,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,kCAAkC;;YAC7B,WAAW,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC1C,OAAO;YACL,GAAG,KAAK;YACR,WAAW;SACZ,CAAC;IACJ,CAAC;IACD,oCAAoC;IACpC,IAAI,IAAI,KAAK,WAAW,CAAC,cAAc,EAAE,CAAC;QACxC,MAAM,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;QAExC,OAAO;YACL,GAAG,KAAK;YACR,WAAW,EAAE,EAAE,GAAG,OAAO,EAAE;SAC5B,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport ActionTypes from '../actions/actionConstants';\nimport type { Action } from '../actions/actions.types';\n\nexport default (state: State, action: Action) => {\n const { type } = action;\n\n if (type === ActionTypes.CHANGE_LABEL) {\n const { columnId, label } = action.payload;\n const columnAlias = { ...state.columnAlias };\n // If label not present remove field from aliases\n if (!label) delete columnAlias[columnId];\n // If label present add to aliases\n else columnAlias[columnId] = label.trim();\n return {\n ...state,\n columnAlias\n };\n }\n // Replaces aliases with new aliases\n if (type === ActionTypes.REPLACE_LABELS) {\n const { aliases = {} } = action.payload;\n\n return {\n ...state,\n columnAlias: { ...aliases }\n };\n }\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionalStyleFormat.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/conditionalStyleFormat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;gCAEhC,KAAK,UAAU,MAAM;AAA5C,wBAYE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ActionTypes from '../actions/actionConstants';
|
|
2
|
+
export default (state, action) => {
|
|
3
|
+
const { type } = action;
|
|
4
|
+
if (type === ActionTypes.SET_CONDITIONAL_STYLE_FORMATS) {
|
|
5
|
+
const { payload } = action;
|
|
6
|
+
return {
|
|
7
|
+
...state,
|
|
8
|
+
conditionalStyleFormats: payload
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return state;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=conditionalStyleFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionalStyleFormat.js","sourceRoot":"","sources":["../../../../src/core/reducers/conditionalStyleFormat.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAGrD,eAAe,CAAC,KAAY,EAAE,MAAc,EAAE,EAAE;IAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAExB,IAAI,IAAI,KAAK,WAAW,CAAC,6BAA6B,EAAE,CAAC;QACvD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO;YACL,GAAG,KAAK;YACR,uBAAuB,EAAE,OAAO;SACjC,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport ActionTypes from '../actions/actionConstants';\nimport type { Action } from '../actions/actions.types';\n\nexport default (state: State, action: Action) => {\n const { type } = action;\n\n if (type === ActionTypes.SET_CONDITIONAL_STYLE_FORMATS) {\n const { payload } = action;\n return {\n ...state,\n conditionalStyleFormats: payload\n };\n }\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customColumn.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/customColumn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;gCAEhC,KAAK,UAAU,MAAM;AAA5C,wBAmDE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import ActionTypes from '../actions/actionConstants';
|
|
2
|
+
export default (state, action) => {
|
|
3
|
+
const { type } = action;
|
|
4
|
+
switch (type) {
|
|
5
|
+
case ActionTypes.COLUMN_MERGE: {
|
|
6
|
+
const { sourceId, targetId, title = '', templateName, bHideColumns, uniqueID } = action.payload;
|
|
7
|
+
const customFields = state.customFields ? [...state.customFields] : [];
|
|
8
|
+
const sourceCustom = customFields.find(c => c.id === sourceId);
|
|
9
|
+
const targetCustom = customFields.find(c => c.id === targetId);
|
|
10
|
+
const sourceExpression = sourceCustom?.expression || [sourceId];
|
|
11
|
+
const targerExpression = targetCustom?.expression || [targetId];
|
|
12
|
+
// We are keeping operation in array to differentiate it with operand.
|
|
13
|
+
customFields.push({
|
|
14
|
+
expression: [...sourceExpression, ...targerExpression, [templateName]],
|
|
15
|
+
id: uniqueID,
|
|
16
|
+
label: title,
|
|
17
|
+
primaryColumnId: sourceCustom?.primaryColumnId || targetCustom?.primaryColumnId || sourceId
|
|
18
|
+
});
|
|
19
|
+
/* Properties added to payload are used in customColumn feature JS to trigger other actions */
|
|
20
|
+
if (bHideColumns)
|
|
21
|
+
action.payload.hideColumns = [sourceId, targetId];
|
|
22
|
+
return {
|
|
23
|
+
...state,
|
|
24
|
+
customFields
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
case ActionTypes.CUSTOM_COLUMN_DELETE: {
|
|
28
|
+
const { columnId } = action.payload;
|
|
29
|
+
const ids = Array.isArray(columnId) ? columnId : [columnId];
|
|
30
|
+
return {
|
|
31
|
+
...state,
|
|
32
|
+
customFields: state.customFields?.filter(c => !ids.includes(c.id))
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
default: {
|
|
36
|
+
return state;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=customColumn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customColumn.js","sourceRoot":"","sources":["../../../../src/core/reducers/customColumn.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAGrD,eAAe,CAAC,KAAY,EAAE,MAAc,EAAE,EAAE;IAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM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AAC,CAAC;YACtC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;YACpC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC5D,OAAO;gBACL,GAAG,KAAK;gBACR,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aACnE,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport ActionTypes from '../actions/actionConstants';\nimport type { Action } from '../actions/actions.types';\n\nexport default (state: State, action: Action) => {\n const { type } = action;\n\n switch (type) {\n case ActionTypes.COLUMN_MERGE: {\n const {\n sourceId,\n targetId,\n title = '',\n templateName,\n bHideColumns,\n uniqueID\n } = action.payload;\n const customFields = state.customFields ? [...state.customFields] : [];\n\n const sourceCustom = customFields.find(c => c.id === sourceId);\n const targetCustom = customFields.find(c => c.id === targetId);\n\n const sourceExpression = sourceCustom?.expression || [sourceId];\n const targerExpression = targetCustom?.expression || [targetId];\n\n // We are keeping operation in array to differentiate it with operand.\n customFields.push({\n expression: [...sourceExpression, ...targerExpression, [templateName]],\n id: uniqueID,\n label: title,\n primaryColumnId: sourceCustom?.primaryColumnId || targetCustom?.primaryColumnId || sourceId\n });\n\n /* Properties added to payload are used in customColumn feature JS to trigger other actions */\n if (bHideColumns) action.payload.hideColumns = [sourceId, targetId];\n\n return {\n ...state,\n customFields\n };\n }\n\n case ActionTypes.CUSTOM_COLUMN_DELETE: {\n const { columnId } = action.payload;\n const ids = Array.isArray(columnId) ? columnId : [columnId];\n return {\n ...state,\n customFields: state.customFields?.filter(c => !ids.includes(c.id))\n };\n }\n\n default: {\n return state;\n }\n }\n};\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { State } from '../../../types/State.types';
|
|
2
|
+
import type RsInternal from '../RsInternal';
|
|
3
|
+
import type { Action } from '../actions/actions.types';
|
|
4
|
+
declare const _default: (state: State, action: Action, { getView }: RsInternal) => State;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=dragDrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragDrop.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/dragDrop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAwB,MAAM,EAAE,MAAM,0BAA0B,CAAC;gCAsEtD,KAAK,UAAU,MAAM,eAAe,UAAU;AAArE,wBA8DE"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import ActionTypes from '../actions/actionConstants';
|
|
2
|
+
function insertMutatively(order, sourceColId, targetColId, isFrozen = false) {
|
|
3
|
+
const sourceIndex = order.indexOf(sourceColId);
|
|
4
|
+
let targetIndex = order.indexOf(targetColId);
|
|
5
|
+
const movingDirection = sourceIndex > targetIndex ? 'movingLeft' : 'movingRight';
|
|
6
|
+
let removeIndex;
|
|
7
|
+
// Is moving Left?
|
|
8
|
+
if (movingDirection === 'movingLeft') {
|
|
9
|
+
if (isFrozen) {
|
|
10
|
+
targetIndex += 1;
|
|
11
|
+
}
|
|
12
|
+
order.splice(targetIndex, 0, sourceColId); // add the source column at targetPosition
|
|
13
|
+
removeIndex = sourceIndex + 1;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
order.splice(targetIndex + 1, 0, sourceColId); // add the source column at targetPosition
|
|
17
|
+
removeIndex = sourceIndex;
|
|
18
|
+
}
|
|
19
|
+
order.splice(removeIndex, 1); // remove that source element at previous index
|
|
20
|
+
}
|
|
21
|
+
// Update state when any of payload column is freeze.
|
|
22
|
+
const updateStateIfFreeze = (isSourceColumnFreeze, isTargetColumnFreeze, state, payload, newOrder) => {
|
|
23
|
+
const { freezeColumns = [] } = state;
|
|
24
|
+
const { sourceColId, targetColId } = payload;
|
|
25
|
+
// if source column is freeze but not target
|
|
26
|
+
if (isSourceColumnFreeze && !isTargetColumnFreeze) {
|
|
27
|
+
const freezeIndex = freezeColumns.indexOf(sourceColId);
|
|
28
|
+
freezeColumns.splice(freezeIndex, 1); // remove from freeze
|
|
29
|
+
insertMutatively(newOrder, sourceColId, targetColId, true); // position it relatively in colOrder
|
|
30
|
+
return { ...state, freezeColumns: freezeColumns.concat([]), colOrder: newOrder };
|
|
31
|
+
}
|
|
32
|
+
// if source column is not freeze but target is
|
|
33
|
+
if (!isSourceColumnFreeze && isTargetColumnFreeze) {
|
|
34
|
+
const freezeIndex = freezeColumns.indexOf(targetColId);
|
|
35
|
+
freezeColumns.splice(freezeIndex, 0, `${sourceColId}`);
|
|
36
|
+
return { ...state, freezeColumns: freezeColumns.concat([]) };
|
|
37
|
+
}
|
|
38
|
+
// if both are freeze
|
|
39
|
+
if (isSourceColumnFreeze && isTargetColumnFreeze) {
|
|
40
|
+
insertMutatively(freezeColumns, sourceColId, targetColId);
|
|
41
|
+
return { ...state, freezeColumns: freezeColumns.concat([]) };
|
|
42
|
+
}
|
|
43
|
+
return state;
|
|
44
|
+
};
|
|
45
|
+
const getColumnOrder = (view) => {
|
|
46
|
+
// view.columns[column].style.order gives correct order by considering both state.colOrder and meta columns positions.
|
|
47
|
+
const clonedColumns = [...view.columns];
|
|
48
|
+
return clonedColumns
|
|
49
|
+
.sort(({ style: { order: order1 } }, { style: { order: order2 } }) => order1 - order2)
|
|
50
|
+
.map(column => `${column.field.id}`);
|
|
51
|
+
};
|
|
52
|
+
export default (state, action, { getView }) => {
|
|
53
|
+
const { type } = action;
|
|
54
|
+
switch (type) {
|
|
55
|
+
case ActionTypes.COLUMN_DRAG_DROP: {
|
|
56
|
+
const { sourceColId, targetColId } = action.payload;
|
|
57
|
+
if (sourceColId === targetColId) {
|
|
58
|
+
return state;
|
|
59
|
+
}
|
|
60
|
+
const { freezeColumns = [] } = state;
|
|
61
|
+
const columnOrder = getColumnOrder(getView());
|
|
62
|
+
const isSourceColumnFreeze = freezeColumns?.includes(sourceColId);
|
|
63
|
+
const isTargetColumnFreeze = freezeColumns?.includes(targetColId);
|
|
64
|
+
// if any column is freeze
|
|
65
|
+
if (isSourceColumnFreeze || isTargetColumnFreeze) {
|
|
66
|
+
return updateStateIfFreeze(isSourceColumnFreeze, isTargetColumnFreeze, state, action.payload, columnOrder);
|
|
67
|
+
}
|
|
68
|
+
// No Column is freezed so just re-order
|
|
69
|
+
const sourceIndex = columnOrder.indexOf(sourceColId);
|
|
70
|
+
const targetIndex = columnOrder.indexOf(targetColId);
|
|
71
|
+
if (targetIndex === -1 || sourceIndex === -1) {
|
|
72
|
+
return state;
|
|
73
|
+
}
|
|
74
|
+
insertMutatively(columnOrder, sourceColId, targetColId);
|
|
75
|
+
return { ...state, colOrder: columnOrder };
|
|
76
|
+
}
|
|
77
|
+
case ActionTypes.UPDATE_COLUMN_ORDER: {
|
|
78
|
+
const { colOrder } = state;
|
|
79
|
+
// @ts-expect-error the type for payload is wrong. It is [string] which will not work with Array.includes.
|
|
80
|
+
// Actually this if block is dead block as the calling layer of this action has a check of !colOrder.includes(action.payload)
|
|
81
|
+
if (!colOrder || colOrder.includes(action.payload)) {
|
|
82
|
+
return state;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
...state,
|
|
86
|
+
colOrder: [...colOrder].concat(action.payload)
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
case ActionTypes.NEW_COLUMN_ORDER: {
|
|
90
|
+
return {
|
|
91
|
+
...state,
|
|
92
|
+
colOrder: [...action.payload]
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
default: {
|
|
96
|
+
return state;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=dragDrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragDrop.js","sourceRoot":"","sources":["../../../../src/core/reducers/dragDrop.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAIrD,SAAS,gBAAgB,CACvB,KAAe,EACf,WAAmB,EACnB,WAAmB,EACnB,QAAQ,GAAG,KAAK;IAEhB,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/C,IAAI,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAE7C,MAAM,eAAe,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC;IAEjF,IAAI,WAAW,CAAC;IAChB,kBAAkB;IAClB,IAAI,eAAe,KAAK,YAAY,EAAE,CAAC;QACrC,IAAI,QAAQ,EAAE,CAAC;YACb,WAAW,IAAI,CAAC,CAAC;QACnB,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,0CAA0C;QACrF,WAAW,GAAG,WAAW,GAAG,CAAC,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,0CAA0C;QACzF,WAAW,GAAG,WAAW,CAAC;IAC5B,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,+CAA+C;AAC/E,CAAC;AAED,qDAAqD;AACrD,MAAM,mBAAmB,GAAG,CAC1B,oBAA6B,EAC7B,oBAA6B,EAC7B,KAAY,EACZ,OAAwC,EACxC,QAAkB,EAClB,E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W,CAAC,CAAC;YACrD,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YACrD,IAAI,WAAW,KAAK,CAAC,CAAC,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;gBAC7C,OAAO,KAAK,CAAC;YACf,CAAC;YAED,gBAAgB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;YAExD,OAAO,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;QAC7C,CAAC;QAED,KAAK,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC;YACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;YAC3B,0GAA0G;YAC1G,6HAA6H;YAC7H,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO;gBACL,GAAG,KAAK;gBACR,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;aAC/C,CAAC;QACJ,CAAC;QAED,KAAK,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAClC,OAAO;gBACL,GAAG,KAAK;gBACR,QAAQ,EAAE,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;aAC9B,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport type RsInternal from '../RsInternal';\nimport ActionTypes from '../actions/actionConstants';\nimport type { ColumnDragDropAction, Action } from '../actions/actions.types';\nimport type View from '../generators/ViewGenerator';\n\nfunction insertMutatively(\n order: string[],\n sourceColId: string,\n targetColId: string,\n isFrozen = false\n) {\n const sourceIndex = order.indexOf(sourceColId);\n let targetIndex = order.indexOf(targetColId);\n\n const movingDirection = sourceIndex > targetIndex ? 'movingLeft' : 'movingRight';\n\n let removeIndex;\n // Is moving Left?\n if (movingDirection === 'movingLeft') {\n if (isFrozen) {\n targetIndex += 1;\n }\n order.splice(targetIndex, 0, sourceColId); // add the source column at targetPosition\n removeIndex = sourceIndex + 1;\n } else {\n order.splice(targetIndex + 1, 0, sourceColId); // add the source column at targetPosition\n removeIndex = sourceIndex;\n }\n order.splice(removeIndex, 1); // remove that source element at previous index\n}\n\n// Update state when any of payload column is freeze.\nconst updateStateIfFreeze = (\n isSourceColumnFreeze: boolean,\n isTargetColumnFreeze: boolean,\n state: State,\n payload: ColumnDragDropAction['payload'],\n newOrder: string[]\n) => {\n const { freezeColumns = [] } = state;\n const { sourceColId, targetColId } = payload;\n // if source column is freeze but not target\n if (isSourceColumnFreeze && !isTargetColumnFreeze) {\n const freezeIndex = freezeColumns.indexOf(sourceColId);\n freezeColumns.splice(freezeIndex, 1); // remove from freeze\n insertMutatively(newOrder, sourceColId, targetColId, true); // position it relatively in colOrder\n return { ...state, freezeColumns: freezeColumns.concat([]), colOrder: newOrder };\n }\n\n // if source column is not freeze but target is\n if (!isSourceColumnFreeze && isTargetColumnFreeze) {\n const freezeIndex = freezeColumns.indexOf(targetColId);\n freezeColumns.splice(freezeIndex, 0, `${sourceColId}`);\n return { ...state, freezeColumns: freezeColumns.concat([]) };\n }\n\n // if both are freeze\n if (isSourceColumnFreeze && isTargetColumnFreeze) {\n insertMutatively(freezeColumns, sourceColId, targetColId);\n return { ...state, freezeColumns: freezeColumns.concat([]) };\n }\n return state;\n};\n\nconst getColumnOrder = (view: View): string[] => {\n // view.columns[column].style.order gives correct order by considering both state.colOrder and meta columns positions.\n const clonedColumns = [...view.columns!];\n return clonedColumns\n .sort(({ style: { order: order1 } }, { style: { order: order2 } }) => order1 - order2)\n .map(column => `${column.field.id}`);\n};\n\nexport default (state: State, action: Action, { getView }: RsInternal) => {\n const { type } = action;\n switch (type) {\n case ActionTypes.COLUMN_DRAG_DROP: {\n const { sourceColId, targetColId } = action.payload;\n if (sourceColId === targetColId) {\n return state;\n }\n\n const { freezeColumns = [] } = state;\n const columnOrder = getColumnOrder(getView());\n\n const isSourceColumnFreeze = freezeColumns?.includes(sourceColId);\n const isTargetColumnFreeze = freezeColumns?.includes(targetColId);\n\n // if any column is freeze\n if (isSourceColumnFreeze || isTargetColumnFreeze) {\n return updateStateIfFreeze(\n isSourceColumnFreeze,\n isTargetColumnFreeze,\n state,\n action.payload,\n columnOrder\n );\n }\n\n // No Column is freezed so just re-order\n const sourceIndex = columnOrder.indexOf(sourceColId);\n const targetIndex = columnOrder.indexOf(targetColId);\n if (targetIndex === -1 || sourceIndex === -1) {\n return state;\n }\n\n insertMutatively(columnOrder, sourceColId, targetColId);\n\n return { ...state, colOrder: columnOrder };\n }\n\n case ActionTypes.UPDATE_COLUMN_ORDER: {\n const { colOrder } = state;\n // @ts-expect-error the type for payload is wrong. It is [string] which will not work with Array.includes.\n // Actually this if block is dead block as the calling layer of this action has a check of !colOrder.includes(action.payload)\n if (!colOrder || colOrder.includes(action.payload)) {\n return state;\n }\n return {\n ...state,\n colOrder: [...colOrder].concat(action.payload)\n };\n }\n\n case ActionTypes.NEW_COLUMN_ORDER: {\n return {\n ...state,\n colOrder: [...action.payload]\n };\n }\n\n default: {\n return state;\n }\n }\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAA0B,MAAM,0BAA0B,CAAC;gCA0BxD,KAAK,UAAU,MAAM;AAA5C,wBA4CE"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import ActionTypes from '../actions/actionConstants';
|
|
2
|
+
function updateStatus(changeSet, payload) {
|
|
3
|
+
const { key, name, status } = payload;
|
|
4
|
+
if (name && changeSet[key][name]) {
|
|
5
|
+
changeSet[key][name].status = status;
|
|
6
|
+
}
|
|
7
|
+
else {
|
|
8
|
+
Object.keys(changeSet[key]).forEach(k => {
|
|
9
|
+
changeSet[key][k].status = status;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function clearChangeSet(changeSet, payload) {
|
|
14
|
+
const { key, name } = payload;
|
|
15
|
+
if (name && changeSet[key][name]) {
|
|
16
|
+
delete changeSet[key][name];
|
|
17
|
+
if (Object.keys(changeSet[key]).length === 0) {
|
|
18
|
+
delete changeSet[key];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
delete changeSet[key];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export default (state, action) => {
|
|
26
|
+
const { type } = action;
|
|
27
|
+
switch (type) {
|
|
28
|
+
case ActionTypes.CHANGE_CELL_MODE: {
|
|
29
|
+
return { ...state, editInfo: action.payload };
|
|
30
|
+
}
|
|
31
|
+
case ActionTypes.UPDATE_CHANGE_SET: {
|
|
32
|
+
const { newValue, status, key, name } = action.payload;
|
|
33
|
+
const changeSet = { ...(state.changeSet || {}) };
|
|
34
|
+
const rowData = changeSet[key];
|
|
35
|
+
if (rowData) {
|
|
36
|
+
rowData[name] = { value: newValue, status };
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
changeSet[key] = { [name]: { value: newValue, status } };
|
|
40
|
+
}
|
|
41
|
+
return { ...state, changeSet };
|
|
42
|
+
}
|
|
43
|
+
case ActionTypes.SUBMIT_CHANGE_SET: {
|
|
44
|
+
const { key, name } = action.payload;
|
|
45
|
+
const changeSet = { ...state.changeSet };
|
|
46
|
+
if (!changeSet || !changeSet[key] || (name && !changeSet[key][name])) {
|
|
47
|
+
return state;
|
|
48
|
+
}
|
|
49
|
+
updateStatus(changeSet, action.payload);
|
|
50
|
+
return { ...state, changeSet };
|
|
51
|
+
}
|
|
52
|
+
case ActionTypes.CLEAR_CHANGE_SET: {
|
|
53
|
+
const { key, name } = action.payload;
|
|
54
|
+
const changeSet = { ...(state.changeSet || null) };
|
|
55
|
+
if (!changeSet || !changeSet[key] || (name && !changeSet[key][name])) {
|
|
56
|
+
return state;
|
|
57
|
+
}
|
|
58
|
+
clearChangeSet(changeSet, action.payload);
|
|
59
|
+
return { ...state, changeSet };
|
|
60
|
+
}
|
|
61
|
+
default:
|
|
62
|
+
return state;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../../src/core/reducers/edit.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAGrD,SAAS,YAAY,CAAC,SAA0C,EAAE,OAA+B;IAC/F,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACtC,IAAI,IAAI,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACtC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AACD,SAAS,cAAc,CACrB,SAA0C,EAC1C,OAA+B;IAE/B,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAC9B,IAAI,IAAI,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,SAAS,CAAC,GAAG,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nC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;YACrC,MAAM,SAAS,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;YACzC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;gBACrE,OAAO,KAAK,CAAC;YACf,CAAC;YACD,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YACxC,OAAO,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,CAAC;QACjC,CAAC;QACD,KAAK,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAClC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;YACrC,MAAM,SAAS,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,EAAE,CAAC;YACnD,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;gBACrE,OAAO,KAAK,CAAC;YACf,CAAC;YACD,cAAc,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YAE1C,OAAO,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,CAAC;QACjC,CAAC;QACD;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport ActionTypes from '../actions/actionConstants';\nimport type { Action, SubmitChangeSetPayload } from '../actions/actions.types';\n\nfunction updateStatus(changeSet: NonNullable<State['changeSet']>, payload: SubmitChangeSetPayload) {\n const { key, name, status } = payload;\n if (name && changeSet[key][name]) {\n changeSet[key][name].status = status;\n } else {\n Object.keys(changeSet[key]).forEach(k => {\n changeSet[key][k].status = status;\n });\n }\n}\nfunction clearChangeSet(\n changeSet: NonNullable<State['changeSet']>,\n payload: SubmitChangeSetPayload\n) {\n const { key, name } = payload;\n if (name && changeSet[key][name]) {\n delete changeSet[key][name];\n if (Object.keys(changeSet[key]).length === 0) {\n delete changeSet[key];\n }\n } else {\n delete changeSet[key];\n }\n}\nexport default (state: State, action: Action) => {\n const { type } = action;\n\n switch (type) {\n case ActionTypes.CHANGE_CELL_MODE: {\n return { ...state, editInfo: action.payload };\n }\n\n case ActionTypes.UPDATE_CHANGE_SET: {\n const { newValue, status, key, name } = action.payload;\n\n const changeSet = { ...(state.changeSet || {}) };\n const rowData = changeSet[key];\n if (rowData) {\n rowData[name] = { value: newValue, status };\n } else {\n changeSet[key] = { [name]: { value: newValue, status } };\n }\n\n return { ...state, changeSet };\n }\n\n case ActionTypes.SUBMIT_CHANGE_SET: {\n const { key, name } = action.payload;\n const changeSet = { ...state.changeSet };\n if (!changeSet || !changeSet[key] || (name && !changeSet[key][name])) {\n return state;\n }\n updateStatus(changeSet, action.payload);\n return { ...state, changeSet };\n }\n case ActionTypes.CLEAR_CHANGE_SET: {\n const { key, name } = action.payload;\n const changeSet = { ...(state.changeSet || null) };\n if (!changeSet || !changeSet[key] || (name && !changeSet[key][name])) {\n return state;\n }\n clearChangeSet(changeSet, action.payload);\n\n return { ...state, changeSet };\n }\n default:\n return state;\n }\n};\n"]}
|