@wavemaker-ai/react-runtime 1.0.0-rc.309
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/actions/base-action.d.ts +7 -0
- package/actions/base-action.js +30 -0
- package/actions/login-action.d.ts +11 -0
- package/actions/login-action.js +54 -0
- package/actions/logout-action.d.ts +10 -0
- package/actions/logout-action.js +39 -0
- package/actions/navigation-action.d.ts +35 -0
- package/actions/navigation-action.js +381 -0
- package/actions/notification-action.d.ts +20 -0
- package/actions/notification-action.js +164 -0
- package/actions/timer-action.d.ts +27 -0
- package/actions/timer-action.js +162 -0
- package/actions/toast-provider.d.ts +12 -0
- package/actions/toast-provider.js +111 -0
- package/actions/toast.d.ts +7 -0
- package/actions/toast.js +117 -0
- package/actions/toast.service.d.ts +17 -0
- package/actions/toast.service.js +93 -0
- package/actions/types/index.d.ts +26 -0
- package/actions/types/index.js +11 -0
- package/components/advanced/carousel/index.d.ts +72 -0
- package/components/advanced/carousel/index.js +467 -0
- package/components/advanced/carousel/props.d.ts +40 -0
- package/components/advanced/carousel/props.js +5 -0
- package/components/advanced/carousel/template.d.ts +72 -0
- package/components/advanced/carousel/template.js +83 -0
- package/components/advanced/login/index.d.ts +75 -0
- package/components/advanced/login/index.js +317 -0
- package/components/advanced/login/props.d.ts +41 -0
- package/components/advanced/login/props.js +5 -0
- package/components/advanced/marquee/index.d.ts +68 -0
- package/components/advanced/marquee/index.js +169 -0
- package/components/advanced/marquee/props.d.ts +32 -0
- package/components/advanced/marquee/props.js +5 -0
- package/components/basic/anchor/index.d.ts +83 -0
- package/components/basic/anchor/index.js +255 -0
- package/components/basic/anchor/props.d.ts +76 -0
- package/components/basic/anchor/props.js +5 -0
- package/components/basic/audio/index.d.ts +72 -0
- package/components/basic/audio/index.js +73 -0
- package/components/basic/audio/props.d.ts +48 -0
- package/components/basic/audio/props.js +5 -0
- package/components/basic/html/index.d.ts +69 -0
- package/components/basic/html/index.js +224 -0
- package/components/basic/html/props.d.ts +32 -0
- package/components/basic/html/props.js +5 -0
- package/components/basic/html/utils.d.ts +4 -0
- package/components/basic/html/utils.js +36 -0
- package/components/basic/icon/index.d.ts +71 -0
- package/components/basic/icon/index.js +93 -0
- package/components/basic/icon/props.d.ts +46 -0
- package/components/basic/icon/props.js +5 -0
- package/components/basic/iframe/iframe.utils.d.ts +2 -0
- package/components/basic/iframe/iframe.utils.js +17 -0
- package/components/basic/iframe/index.d.ts +67 -0
- package/components/basic/iframe/index.js +111 -0
- package/components/basic/iframe/props.d.ts +27 -0
- package/components/basic/iframe/props.js +5 -0
- package/components/basic/label/index.d.ts +72 -0
- package/components/basic/label/index.js +145 -0
- package/components/basic/label/props.d.ts +54 -0
- package/components/basic/label/props.js +5 -0
- package/components/basic/message/index.d.ts +18 -0
- package/components/basic/message/index.js +146 -0
- package/components/basic/message/props.d.ts +51 -0
- package/components/basic/message/props.js +5 -0
- package/components/basic/picture/index.d.ts +75 -0
- package/components/basic/picture/index.js +131 -0
- package/components/basic/picture/props.d.ts +57 -0
- package/components/basic/picture/props.js +5 -0
- package/components/basic/progress-bar/index.d.ts +73 -0
- package/components/basic/progress-bar/index.js +183 -0
- package/components/basic/progress-bar/props.d.ts +66 -0
- package/components/basic/progress-bar/props.js +41 -0
- package/components/basic/progress-circle/index.d.ts +78 -0
- package/components/basic/progress-circle/index.js +197 -0
- package/components/basic/progress-circle/props.d.ts +80 -0
- package/components/basic/progress-circle/props.js +39 -0
- package/components/basic/richtexteditor/index.d.ts +143 -0
- package/components/basic/richtexteditor/index.js +513 -0
- package/components/basic/richtexteditor/props.d.ts +89 -0
- package/components/basic/richtexteditor/props.js +5 -0
- package/components/basic/search/index.d.ts +178 -0
- package/components/basic/search/index.js +1257 -0
- package/components/basic/search/props.d.ts +233 -0
- package/components/basic/search/props.js +5 -0
- package/components/basic/search/providers.d.ts +53 -0
- package/components/basic/search/providers.js +415 -0
- package/components/basic/spinner/index.d.ts +74 -0
- package/components/basic/spinner/index.js +205 -0
- package/components/basic/spinner/props.d.ts +63 -0
- package/components/basic/spinner/props.js +27 -0
- package/components/basic/tile/index.d.ts +68 -0
- package/components/basic/tile/index.js +104 -0
- package/components/basic/tile/props.d.ts +11 -0
- package/components/basic/tile/props.js +5 -0
- package/components/basic/tree/Components/TreeNodeComponent.d.ts +4 -0
- package/components/basic/tree/Components/TreeNodeComponent.js +174 -0
- package/components/basic/tree/hooks/useTreePartialNodeApi.d.ts +17 -0
- package/components/basic/tree/hooks/useTreePartialNodeApi.js +157 -0
- package/components/basic/tree/index.d.ts +83 -0
- package/components/basic/tree/index.js +529 -0
- package/components/basic/tree/props.d.ts +127 -0
- package/components/basic/tree/props.js +5 -0
- package/components/basic/tree/utils.d.ts +39 -0
- package/components/basic/tree/utils.js +272 -0
- package/components/basic/video/index.d.ts +79 -0
- package/components/basic/video/index.js +108 -0
- package/components/basic/video/props.d.ts +77 -0
- package/components/basic/video/props.js +5 -0
- package/components/chart/index.d.ts +129 -0
- package/components/chart/index.js +58 -0
- package/components/chart/props.d.ts +188 -0
- package/components/chart/props.js +81 -0
- package/components/chart/src/ChartRenderer.d.ts +14 -0
- package/components/chart/src/ChartRenderer.js +226 -0
- package/components/chart/src/chart.d.ts +4 -0
- package/components/chart/src/chart.js +284 -0
- package/components/chart/src/chartStyles.generated.d.ts +7 -0
- package/components/chart/src/chartStyles.generated.js +14 -0
- package/components/chart/src/chartUtils.d.ts +26 -0
- package/components/chart/src/chartUtils.js +461 -0
- package/components/chart/src/constants.d.ts +28 -0
- package/components/chart/src/constants.js +139 -0
- package/components/chart/src/css.d.js +1 -0
- package/components/chart/src/d3Setup.d.ts +11 -0
- package/components/chart/src/d3Setup.js +37 -0
- package/components/chart/src/dataUtils.d.ts +79 -0
- package/components/chart/src/dataUtils.js +612 -0
- package/components/chart/src/formatUtils.d.ts +5 -0
- package/components/chart/src/formatUtils.js +63 -0
- package/components/chart/src/index.d.ts +3 -0
- package/components/chart/src/index.js +25 -0
- package/components/chart/src/nvd3Source.generated.d.ts +6 -0
- package/components/chart/src/nvd3Source.generated.js +13 -0
- package/components/chart/src/pieDonutResponsiveLayout.d.ts +30 -0
- package/components/chart/src/pieDonutResponsiveLayout.js +155 -0
- package/components/chart/src/types.d.ts +115 -0
- package/components/chart/src/types.js +5 -0
- package/components/common/AppSpinner.d.ts +9 -0
- package/components/common/AppSpinner.js +36 -0
- package/components/common/app-spinner.d.ts +5 -0
- package/components/common/app-spinner.js +26 -0
- package/components/common/index.d.ts +1 -0
- package/components/common/index.js +12 -0
- package/components/constants.d.ts +1135 -0
- package/components/constants.js +1211 -0
- package/components/container/accordion/accordion-pane/index.d.ts +81 -0
- package/components/container/accordion/accordion-pane/index.js +126 -0
- package/components/container/accordion/accordion-pane/props.d.ts +88 -0
- package/components/container/accordion/accordion-pane/props.js +24 -0
- package/components/container/accordion/index.d.ts +76 -0
- package/components/container/accordion/index.js +254 -0
- package/components/container/accordion/props.d.ts +57 -0
- package/components/container/accordion/props.js +21 -0
- package/components/container/index.d.ts +84 -0
- package/components/container/index.js +178 -0
- package/components/container/layout-grid/grid-column/index.d.ts +70 -0
- package/components/container/layout-grid/grid-column/index.js +45 -0
- package/components/container/layout-grid/grid-column/props.d.ts +27 -0
- package/components/container/layout-grid/grid-column/props.js +5 -0
- package/components/container/layout-grid/grid-row/index.d.ts +66 -0
- package/components/container/layout-grid/grid-row/index.js +31 -0
- package/components/container/layout-grid/grid-row/props.d.ts +6 -0
- package/components/container/layout-grid/grid-row/props.js +5 -0
- package/components/container/layout-grid/index.d.ts +68 -0
- package/components/container/layout-grid/index.js +40 -0
- package/components/container/layout-grid/props.d.ts +6 -0
- package/components/container/layout-grid/props.js +5 -0
- package/components/container/linear-layout/index.d.ts +67 -0
- package/components/container/linear-layout/index.js +83 -0
- package/components/container/linear-layout/linear-layout-item/index.d.ts +64 -0
- package/components/container/linear-layout/linear-layout-item/index.js +54 -0
- package/components/container/linear-layout/linear-layout-item/props.d.ts +14 -0
- package/components/container/linear-layout/linear-layout-item/props.js +5 -0
- package/components/container/linear-layout/props.d.ts +41 -0
- package/components/container/linear-layout/props.js +5 -0
- package/components/container/panel/components/panel-content/index.d.ts +8 -0
- package/components/container/panel/components/panel-content/index.js +18 -0
- package/components/container/panel/components/panel-header/index.d.ts +4 -0
- package/components/container/panel/components/panel-header/index.js +149 -0
- package/components/container/panel/components/panel-header/props.d.ts +50 -0
- package/components/container/panel/components/panel-header/props.js +5 -0
- package/components/container/panel/hooks.d.ts +22 -0
- package/components/container/panel/hooks.js +144 -0
- package/components/container/panel/index.d.ts +118 -0
- package/components/container/panel/index.js +307 -0
- package/components/container/panel/props.d.ts +158 -0
- package/components/container/panel/props.js +5 -0
- package/components/container/props.d.ts +72 -0
- package/components/container/props.js +5 -0
- package/components/container/repeat-template/index.d.ts +82 -0
- package/components/container/repeat-template/index.js +45 -0
- package/components/container/repeat-template/props.d.ts +6 -0
- package/components/container/repeat-template/props.js +5 -0
- package/components/container/tabs/index.d.ts +84 -0
- package/components/container/tabs/index.js +556 -0
- package/components/container/tabs/props.d.ts +104 -0
- package/components/container/tabs/props.js +40 -0
- package/components/container/tabs/tab-pane/index.d.ts +91 -0
- package/components/container/tabs/tab-pane/index.js +131 -0
- package/components/container/tabs/tab-pane/props.d.ts +84 -0
- package/components/container/tabs/tab-pane/props.js +5 -0
- package/components/container/tabs/utils.d.ts +17 -0
- package/components/container/tabs/utils.js +51 -0
- package/components/container/wizard/WizardContext.d.ts +4 -0
- package/components/container/wizard/WizardContext.js +16 -0
- package/components/container/wizard/components/StepComponents.d.ts +16 -0
- package/components/container/wizard/components/StepComponents.js +101 -0
- package/components/container/wizard/components/WizardStep.d.ts +5 -0
- package/components/container/wizard/components/WizardStep.js +96 -0
- package/components/container/wizard/index.d.ts +166 -0
- package/components/container/wizard/index.js +967 -0
- package/components/container/wizard/props.d.ts +281 -0
- package/components/container/wizard/props.js +5 -0
- package/components/container/wizard/utils.d.ts +12 -0
- package/components/container/wizard/utils.js +178 -0
- package/components/container/wizard/wizard-action/index.d.ts +18 -0
- package/components/container/wizard/wizard-action/index.js +97 -0
- package/components/container/wizard/wizard-step/index.d.ts +63 -0
- package/components/container/wizard/wizard-step/index.js +124 -0
- package/components/data/card/card-actions/index.d.ts +67 -0
- package/components/data/card/card-actions/index.js +32 -0
- package/components/data/card/card-content/index.d.ts +67 -0
- package/components/data/card/card-content/index.js +38 -0
- package/components/data/card/card-footer/index.d.ts +67 -0
- package/components/data/card/card-footer/index.js +32 -0
- package/components/data/card/index.d.ts +89 -0
- package/components/data/card/index.js +247 -0
- package/components/data/card/props.d.ts +131 -0
- package/components/data/card/props.js +5 -0
- package/components/data/form/base-form/constant.d.ts +33 -0
- package/components/data/form/base-form/constant.js +39 -0
- package/components/data/form/base-form/hooks/index.d.ts +7 -0
- package/components/data/form/base-form/hooks/index.js +77 -0
- package/components/data/form/base-form/hooks/useFormDataSync.d.ts +16 -0
- package/components/data/form/base-form/hooks/useFormDataSync.js +238 -0
- package/components/data/form/base-form/hooks/useFormOperations.d.ts +13 -0
- package/components/data/form/base-form/hooks/useFormOperations.js +175 -0
- package/components/data/form/base-form/hooks/useFormSubmission.d.ts +11 -0
- package/components/data/form/base-form/hooks/useFormSubmission.js +291 -0
- package/components/data/form/base-form/hooks/useFormValidation.d.ts +11 -0
- package/components/data/form/base-form/hooks/useFormValidation.js +176 -0
- package/components/data/form/base-form/hooks/useParentFormRelationship.d.ts +12 -0
- package/components/data/form/base-form/hooks/useParentFormRelationship.js +127 -0
- package/components/data/form/base-form/index.d.ts +3 -0
- package/components/data/form/base-form/index.js +802 -0
- package/components/data/form/base-form/props.d.ts +297 -0
- package/components/data/form/base-form/props.js +180 -0
- package/components/data/form/base-form/utils.d.ts +75 -0
- package/components/data/form/base-form/utils.js +411 -0
- package/components/data/form/dynamic-fields/constant.d.ts +1 -0
- package/components/data/form/dynamic-fields/constant.js +53 -0
- package/components/data/form/dynamic-fields/index.d.ts +2 -0
- package/components/data/form/dynamic-fields/index.js +167 -0
- package/components/data/form/dynamic-fields/props.d.ts +70 -0
- package/components/data/form/dynamic-fields/props.js +5 -0
- package/components/data/form/dynamic-fields/utils.d.ts +46 -0
- package/components/data/form/dynamic-fields/utils.js +272 -0
- package/components/data/form/form-action/index.d.ts +137 -0
- package/components/data/form/form-action/index.js +94 -0
- package/components/data/form/form-body/index.d.ts +5 -0
- package/components/data/form/form-body/index.js +28 -0
- package/components/data/form/form-context.d.ts +91 -0
- package/components/data/form/form-context.js +65 -0
- package/components/data/form/form-controller/hooks/index.d.ts +7 -0
- package/components/data/form/form-controller/hooks/index.js +132 -0
- package/components/data/form/form-controller/props.d.ts +139 -0
- package/components/data/form/form-controller/props.js +19 -0
- package/components/data/form/form-controller/utils.d.ts +5 -0
- package/components/data/form/form-controller/utils.js +135 -0
- package/components/data/form/form-controller/validation-contrustor.d.ts +3 -0
- package/components/data/form/form-controller/validation-contrustor.js +573 -0
- package/components/data/form/form-controller/withFormController.d.ts +3 -0
- package/components/data/form/form-controller/withFormController.js +309 -0
- package/components/data/form/form-dynamic-section/index.d.ts +5 -0
- package/components/data/form/form-dynamic-section/index.js +46 -0
- package/components/data/form/form-dynamic-section/props.d.ts +5 -0
- package/components/data/form/form-dynamic-section/props.js +5 -0
- package/components/data/form/form-field/base-field.d.ts +3 -0
- package/components/data/form/form-field/base-field.js +172 -0
- package/components/data/form/form-field/index.d.ts +14 -0
- package/components/data/form/form-field/index.js +87 -0
- package/components/data/form/form-field/props.d.ts +206 -0
- package/components/data/form/form-field/props.js +5 -0
- package/components/data/form/form-footer/index.d.ts +6 -0
- package/components/data/form/form-footer/index.js +27 -0
- package/components/data/form/form-header/index.d.ts +12 -0
- package/components/data/form/form-header/index.js +61 -0
- package/components/data/form/index.d.ts +4 -0
- package/components/data/form/index.js +76 -0
- package/components/data/form/props.d.ts +130 -0
- package/components/data/form/props.js +5 -0
- package/components/data/list/components/GroupHeader.d.ts +6 -0
- package/components/data/list/components/GroupHeader.js +35 -0
- package/components/data/list/components/GroupedListItems.d.ts +6 -0
- package/components/data/list/components/GroupedListItems.js +108 -0
- package/components/data/list/components/ListContainer.d.ts +6 -0
- package/components/data/list/components/ListContainer.js +27 -0
- package/components/data/list/components/ListDND.d.ts +39 -0
- package/components/data/list/components/ListDND.js +246 -0
- package/components/data/list/components/ListHeader.d.ts +7 -0
- package/components/data/list/components/ListHeader.js +50 -0
- package/components/data/list/components/ListItem.d.ts +18 -0
- package/components/data/list/components/ListItem.js +166 -0
- package/components/data/list/components/ListItemWithTemplate.d.ts +6 -0
- package/components/data/list/components/ListItemWithTemplate.js +113 -0
- package/components/data/list/components/ListItems.d.ts +7 -0
- package/components/data/list/components/ListItems.js +231 -0
- package/components/data/list/components/ListPagination.d.ts +7 -0
- package/components/data/list/components/ListPagination.js +183 -0
- package/components/data/list/components/LoadMoreButton.d.ts +6 -0
- package/components/data/list/components/LoadMoreButton.js +35 -0
- package/components/data/list/components/NoDataMessage.d.ts +6 -0
- package/components/data/list/components/NoDataMessage.js +22 -0
- package/components/data/list/components/StandardListItems.d.ts +6 -0
- package/components/data/list/components/StandardListItems.js +88 -0
- package/components/data/list/components/index.d.ts +12 -0
- package/components/data/list/components/index.js +119 -0
- package/components/data/list/components/props.d.ts +245 -0
- package/components/data/list/components/props.js +5 -0
- package/components/data/list/hooks/index.d.ts +11 -0
- package/components/data/list/hooks/index.js +75 -0
- package/components/data/list/hooks/props.d.ts +89 -0
- package/components/data/list/hooks/props.js +5 -0
- package/components/data/list/hooks/useCurrentPageItems.d.ts +6 -0
- package/components/data/list/hooks/useCurrentPageItems.js +48 -0
- package/components/data/list/hooks/useGroupedData.d.ts +9 -0
- package/components/data/list/hooks/useGroupedData.js +37 -0
- package/components/data/list/hooks/useListData.d.ts +9 -0
- package/components/data/list/hooks/useListData.js +60 -0
- package/components/data/list/hooks/useListEffects.d.ts +67 -0
- package/components/data/list/hooks/useListEffects.js +355 -0
- package/components/data/list/hooks/useListEventHandlers.d.ts +9 -0
- package/components/data/list/hooks/useListEventHandlers.js +323 -0
- package/components/data/list/hooks/useListPagination.d.ts +8 -0
- package/components/data/list/hooks/useListPagination.js +163 -0
- package/components/data/list/hooks/useListState.d.ts +28 -0
- package/components/data/list/hooks/useListState.js +114 -0
- package/components/data/list/hooks/useListStateManager.d.ts +26 -0
- package/components/data/list/hooks/useListStateManager.js +195 -0
- package/components/data/list/hooks/usePaginatedGroupedData.d.ts +6 -0
- package/components/data/list/hooks/usePaginatedGroupedData.js +134 -0
- package/components/data/list/index.d.ts +174 -0
- package/components/data/list/index.js +691 -0
- package/components/data/list/props.d.ts +405 -0
- package/components/data/list/props.js +5 -0
- package/components/data/list/templates/media-template.d.ts +2 -0
- package/components/data/list/templates/media-template.js +50 -0
- package/components/data/list/utils/constants.d.ts +52 -0
- package/components/data/list/utils/constants.js +82 -0
- package/components/data/list/utils/list-helpers.d.ts +41 -0
- package/components/data/list/utils/list-helpers.js +187 -0
- package/components/data/list/utils/list-widget-methods.d.ts +4 -0
- package/components/data/list/utils/list-widget-methods.js +159 -0
- package/components/data/list/utils/widget-instance-utils.d.ts +33 -0
- package/components/data/list/utils/widget-instance-utils.js +83 -0
- package/components/data/live-filter/index.d.ts +15 -0
- package/components/data/live-filter/index.js +304 -0
- package/components/data/live-filter/props.d.ts +96 -0
- package/components/data/live-filter/props.js +16 -0
- package/components/data/live-form/index.d.ts +15 -0
- package/components/data/live-form/index.js +143 -0
- package/components/data/live-form/props.d.ts +50 -0
- package/components/data/live-form/props.js +20 -0
- package/components/data/pagination/components/BasicPagination.d.ts +3 -0
- package/components/data/pagination/components/BasicPagination.js +133 -0
- package/components/data/pagination/components/ClassicPagination.d.ts +3 -0
- package/components/data/pagination/components/ClassicPagination.js +191 -0
- package/components/data/pagination/components/InlinePagination.d.ts +11 -0
- package/components/data/pagination/components/InlinePagination.js +99 -0
- package/components/data/pagination/components/LoadingComponent.d.ts +3 -0
- package/components/data/pagination/components/LoadingComponent.js +31 -0
- package/components/data/pagination/components/PageSizeSelector.d.ts +3 -0
- package/components/data/pagination/components/PageSizeSelector.js +188 -0
- package/components/data/pagination/components/PagerNavigation.d.ts +3 -0
- package/components/data/pagination/components/PagerNavigation.js +105 -0
- package/components/data/pagination/components/TotalRecords.d.ts +3 -0
- package/components/data/pagination/components/TotalRecords.js +48 -0
- package/components/data/pagination/components/index.d.ts +6 -0
- package/components/data/pagination/components/index.js +47 -0
- package/components/data/pagination/components/props.d.ts +54 -0
- package/components/data/pagination/components/props.js +5 -0
- package/components/data/pagination/hooks/index.d.ts +2 -0
- package/components/data/pagination/hooks/index.js +19 -0
- package/components/data/pagination/hooks/props.d.ts +232 -0
- package/components/data/pagination/hooks/props.js +5 -0
- package/components/data/pagination/hooks/useNavigationSize.d.ts +5 -0
- package/components/data/pagination/hooks/useNavigationSize.js +44 -0
- package/components/data/pagination/hooks/usePagination.d.ts +35 -0
- package/components/data/pagination/hooks/usePagination.js +1095 -0
- package/components/data/pagination/index.d.ts +13 -0
- package/components/data/pagination/index.js +454 -0
- package/components/data/table/components/AddNewRow.d.ts +3 -0
- package/components/data/table/components/AddNewRow.js +194 -0
- package/components/data/table/components/EditableCell.d.ts +4 -0
- package/components/data/table/components/EditableCell.js +92 -0
- package/components/data/table/components/FieldValidationError.d.ts +4 -0
- package/components/data/table/components/FieldValidationError.js +24 -0
- package/components/data/table/components/RowCells.d.ts +29 -0
- package/components/data/table/components/RowCells.js +81 -0
- package/components/data/table/components/RowExpansionButton.d.ts +4 -0
- package/components/data/table/components/RowExpansionButton.js +74 -0
- package/components/data/table/components/SummaryCell.d.ts +3 -0
- package/components/data/table/components/SummaryCell.js +111 -0
- package/components/data/table/components/SummaryRow.d.ts +3 -0
- package/components/data/table/components/SummaryRow.js +54 -0
- package/components/data/table/components/SummaryRowFooter.d.ts +3 -0
- package/components/data/table/components/SummaryRowFooter.js +46 -0
- package/components/data/table/components/TableBody.d.ts +3 -0
- package/components/data/table/components/TableBody.js +278 -0
- package/components/data/table/components/TableDataRow.d.ts +27 -0
- package/components/data/table/components/TableDataRow.js +119 -0
- package/components/data/table/components/TableFilters.d.ts +24 -0
- package/components/data/table/components/TableFilters.js +429 -0
- package/components/data/table/components/TableFooterActions.d.ts +3 -0
- package/components/data/table/components/TableFooterActions.js +48 -0
- package/components/data/table/components/TableHeader.d.ts +3 -0
- package/components/data/table/components/TableHeader.js +450 -0
- package/components/data/table/components/TablePanelHeading.d.ts +3 -0
- package/components/data/table/components/TablePanelHeading.js +202 -0
- package/components/data/table/components/index.d.ts +12 -0
- package/components/data/table/components/index.js +95 -0
- package/components/data/table/hooks/index.d.ts +19 -0
- package/components/data/table/hooks/index.js +231 -0
- package/components/data/table/hooks/use-edited-rows.d.ts +16 -0
- package/components/data/table/hooks/use-edited-rows.js +141 -0
- package/components/data/table/hooks/useCellState.d.ts +10 -0
- package/components/data/table/hooks/useCellState.js +110 -0
- package/components/data/table/hooks/useCustomExpressionColumns.d.ts +16 -0
- package/components/data/table/hooks/useCustomExpressionColumns.js +88 -0
- package/components/data/table/hooks/useDynamicColumns.d.ts +34 -0
- package/components/data/table/hooks/useDynamicColumns.js +105 -0
- package/components/data/table/hooks/useEditingState.d.ts +5 -0
- package/components/data/table/hooks/useEditingState.js +47 -0
- package/components/data/table/hooks/useFormWidget.d.ts +2 -0
- package/components/data/table/hooks/useFormWidget.js +190 -0
- package/components/data/table/hooks/usePaginationState.d.ts +6 -0
- package/components/data/table/hooks/usePaginationState.js +81 -0
- package/components/data/table/hooks/usePanelStructure.d.ts +2 -0
- package/components/data/table/hooks/usePanelStructure.js +43 -0
- package/components/data/table/hooks/useResponsiveColumns.d.ts +84 -0
- package/components/data/table/hooks/useResponsiveColumns.js +34 -0
- package/components/data/table/hooks/useRowExpansion.d.ts +5 -0
- package/components/data/table/hooks/useRowExpansion.js +140 -0
- package/components/data/table/hooks/useRowHandlers.d.ts +5 -0
- package/components/data/table/hooks/useRowHandlers.js +72 -0
- package/components/data/table/hooks/useRowSelection.d.ts +2 -0
- package/components/data/table/hooks/useRowSelection.js +428 -0
- package/components/data/table/hooks/useServerSideSorting.d.ts +26 -0
- package/components/data/table/hooks/useServerSideSorting.js +203 -0
- package/components/data/table/hooks/useTableColumns.d.ts +2 -0
- package/components/data/table/hooks/useTableColumns.js +360 -0
- package/components/data/table/hooks/useTableData.d.ts +2 -0
- package/components/data/table/hooks/useTableData.js +199 -0
- package/components/data/table/hooks/useTableEdit.d.ts +4 -0
- package/components/data/table/hooks/useTableEdit.js +651 -0
- package/components/data/table/hooks/useTableEffects.d.ts +25 -0
- package/components/data/table/hooks/useTableEffects.js +157 -0
- package/components/data/table/hooks/useTableFilter.d.ts +26 -0
- package/components/data/table/hooks/useTableFilter.js +389 -0
- package/components/data/table/hooks/useTableInitialization.d.ts +5 -0
- package/components/data/table/hooks/useTableInitialization.js +105 -0
- package/components/data/table/hooks/useTableState.d.ts +2 -0
- package/components/data/table/hooks/useTableState.js +75 -0
- package/components/data/table/hooks/useTableStateManager.d.ts +38 -0
- package/components/data/table/hooks/useTableStateManager.js +633 -0
- package/components/data/table/index.d.ts +287 -0
- package/components/data/table/index.js +1830 -0
- package/components/data/table/live-table/index.d.ts +75 -0
- package/components/data/table/live-table/index.js +283 -0
- package/components/data/table/props.d.ts +1368 -0
- package/components/data/table/props.js +5 -0
- package/components/data/table/table-action/index.d.ts +65 -0
- package/components/data/table/table-action/index.js +94 -0
- package/components/data/table/table-column/index.d.ts +65 -0
- package/components/data/table/table-column/index.js +44 -0
- package/components/data/table/table-group/index.d.ts +13 -0
- package/components/data/table/table-group/index.js +26 -0
- package/components/data/table/table-row/index.d.ts +65 -0
- package/components/data/table/table-row/index.js +58 -0
- package/components/data/table/table-row-action/index.d.ts +69 -0
- package/components/data/table/table-row-action/index.js +95 -0
- package/components/data/table/utils/buildSelectionColumns.d.ts +3 -0
- package/components/data/table/utils/buildSelectionColumns.js +161 -0
- package/components/data/table/utils/columnBuilder.d.ts +35 -0
- package/components/data/table/utils/columnBuilder.js +225 -0
- package/components/data/table/utils/columnProxy.d.ts +21 -0
- package/components/data/table/utils/columnProxy.js +117 -0
- package/components/data/table/utils/columnWidthDistribution.d.ts +22 -0
- package/components/data/table/utils/columnWidthDistribution.js +98 -0
- package/components/data/table/utils/constants.d.ts +52 -0
- package/components/data/table/utils/constants.js +84 -0
- package/components/data/table/utils/crud-handlers.d.ts +11 -0
- package/components/data/table/utils/crud-handlers.js +523 -0
- package/components/data/table/utils/dynamic-columns.d.ts +38 -0
- package/components/data/table/utils/dynamic-columns.js +222 -0
- package/components/data/table/utils/groupHeaderUtils.d.ts +18 -0
- package/components/data/table/utils/groupHeaderUtils.js +102 -0
- package/components/data/table/utils/index.d.ts +101 -0
- package/components/data/table/utils/index.js +849 -0
- package/components/data/table/utils/renderDisplayCell.d.ts +11 -0
- package/components/data/table/utils/renderDisplayCell.js +183 -0
- package/components/data/table/utils/script-page-size-broadcast.d.ts +2 -0
- package/components/data/table/utils/script-page-size-broadcast.js +45 -0
- package/components/data/table/utils/selectionUtils.d.ts +37 -0
- package/components/data/table/utils/selectionUtils.js +165 -0
- package/components/data/table/utils/table-helpers.d.ts +62 -0
- package/components/data/table/utils/table-helpers.js +100 -0
- package/components/data/table/utils/validation.d.ts +13 -0
- package/components/data/table/utils/validation.js +125 -0
- package/components/data/types.d.ts +104 -0
- package/components/data/types.js +113 -0
- package/components/data/utils/field-data-utils.d.ts +7 -0
- package/components/data/utils/field-data-utils.js +66 -0
- package/components/data/utils/filter-field-util.d.ts +13 -0
- package/components/data/utils/filter-field-util.js +81 -0
- package/components/data/utils/index.d.ts +90 -0
- package/components/data/utils/index.js +216 -0
- package/components/dialogs/alert-dialog/index.d.ts +158 -0
- package/components/dialogs/alert-dialog/index.js +90 -0
- package/components/dialogs/alert-dialog/props.d.ts +43 -0
- package/components/dialogs/alert-dialog/props.js +5 -0
- package/components/dialogs/confirm-dialog/index.d.ts +160 -0
- package/components/dialogs/confirm-dialog/index.js +115 -0
- package/components/dialogs/confirm-dialog/props.d.ts +47 -0
- package/components/dialogs/confirm-dialog/props.js +5 -0
- package/components/dialogs/dialog/index.d.ts +170 -0
- package/components/dialogs/dialog/index.js +73 -0
- package/components/dialogs/dialog/props.d.ts +66 -0
- package/components/dialogs/dialog/props.js +5 -0
- package/components/dialogs/dialog-actions/index.d.ts +67 -0
- package/components/dialogs/dialog-actions/index.js +28 -0
- package/components/dialogs/dialog-actions/props.d.ts +14 -0
- package/components/dialogs/dialog-actions/props.js +5 -0
- package/components/dialogs/dialog-body/index.d.ts +66 -0
- package/components/dialogs/dialog-body/index.js +32 -0
- package/components/dialogs/dialog-body/props.d.ts +15 -0
- package/components/dialogs/dialog-body/props.js +5 -0
- package/components/dialogs/dialog-content/index.d.ts +69 -0
- package/components/dialogs/dialog-content/index.js +43 -0
- package/components/dialogs/dialog-content/props.d.ts +27 -0
- package/components/dialogs/dialog-content/props.js +5 -0
- package/components/dialogs/dialog-header/index.d.ts +84 -0
- package/components/dialogs/dialog-header/index.js +104 -0
- package/components/dialogs/dialog-header/props.d.ts +73 -0
- package/components/dialogs/dialog-header/props.js +5 -0
- package/components/dialogs/iframe-dialog/index.d.ts +178 -0
- package/components/dialogs/iframe-dialog/index.js +131 -0
- package/components/dialogs/iframe-dialog/props.d.ts +83 -0
- package/components/dialogs/iframe-dialog/props.js +5 -0
- package/components/dialogs/index.d.ts +4 -0
- package/components/dialogs/index.js +139 -0
- package/components/dialogs/login-dialog/index.d.ts +163 -0
- package/components/dialogs/login-dialog/index.js +370 -0
- package/components/dialogs/login-dialog/props.d.ts +98 -0
- package/components/dialogs/login-dialog/props.js +5 -0
- package/components/dialogs/page-dialog/index.d.ts +162 -0
- package/components/dialogs/page-dialog/index.js +105 -0
- package/components/dialogs/page-dialog/props.d.ts +59 -0
- package/components/dialogs/page-dialog/props.js +5 -0
- package/components/dialogs/props.d.ts +41 -0
- package/components/dialogs/props.js +5 -0
- package/components/dialogs/withDialogWrapper.d.ts +59 -0
- package/components/dialogs/withDialogWrapper.js +124 -0
- package/components/form/button/index.d.ts +77 -0
- package/components/form/button/index.js +255 -0
- package/components/form/button/props.d.ts +71 -0
- package/components/form/button/props.js +5 -0
- package/components/form/button-group/index.d.ts +69 -0
- package/components/form/button-group/index.js +74 -0
- package/components/form/button-group/props.d.ts +24 -0
- package/components/form/button-group/props.js +5 -0
- package/components/input/calendar/index.d.ts +130 -0
- package/components/input/calendar/index.js +566 -0
- package/components/input/calendar/props.d.ts +105 -0
- package/components/input/calendar/props.js +5 -0
- package/components/input/calendar/utils.d.ts +51 -0
- package/components/input/calendar/utils.js +336 -0
- package/components/input/chips/SortableChip/index.d.ts +4 -0
- package/components/input/chips/SortableChip/index.js +115 -0
- package/components/input/chips/SortableChip/props.d.ts +16 -0
- package/components/input/chips/SortableChip/props.js +5 -0
- package/components/input/chips/index.d.ts +224 -0
- package/components/input/chips/index.js +583 -0
- package/components/input/chips/props.d.ts +232 -0
- package/components/input/chips/props.js +5 -0
- package/components/input/chips/utils.d.ts +22 -0
- package/components/input/chips/utils.js +292 -0
- package/components/input/color-picker/index.d.ts +151 -0
- package/components/input/color-picker/index.js +689 -0
- package/components/input/color-picker/props.d.ts +131 -0
- package/components/input/color-picker/props.js +5 -0
- package/components/input/composite/index.d.ts +69 -0
- package/components/input/composite/index.js +147 -0
- package/components/input/composite/props.d.ts +23 -0
- package/components/input/composite/props.js +5 -0
- package/components/input/currency/index.d.ts +175 -0
- package/components/input/currency/index.js +265 -0
- package/components/input/currency/props.d.ts +154 -0
- package/components/input/currency/props.js +5 -0
- package/components/input/default/checkbox/index.d.ts +150 -0
- package/components/input/default/checkbox/index.js +253 -0
- package/components/input/default/checkbox/props.d.ts +78 -0
- package/components/input/default/checkbox/props.js +5 -0
- package/components/input/default/checkboxset/index.d.ts +191 -0
- package/components/input/default/checkboxset/index.js +478 -0
- package/components/input/default/checkboxset/props.d.ts +199 -0
- package/components/input/default/checkboxset/props.js +5 -0
- package/components/input/default/checkboxset/utils.d.ts +2 -0
- package/components/input/default/checkboxset/utils.js +30 -0
- package/components/input/default/radioset/index.d.ts +182 -0
- package/components/input/default/radioset/index.js +364 -0
- package/components/input/default/radioset/props.d.ts +172 -0
- package/components/input/default/radioset/props.js +5 -0
- package/components/input/default/switch/index.d.ts +174 -0
- package/components/input/default/switch/index.js +519 -0
- package/components/input/default/switch/prop.d.ts +153 -0
- package/components/input/default/switch/prop.js +5 -0
- package/components/input/epoch/date/components/DatePickerPopover.d.ts +4 -0
- package/components/input/epoch/date/components/DatePickerPopover.js +218 -0
- package/components/input/epoch/date/index.d.ts +86 -0
- package/components/input/epoch/date/index.js +606 -0
- package/components/input/epoch/date/props.d.ts +274 -0
- package/components/input/epoch/date/props.js +5 -0
- package/components/input/epoch/date/styled.d.ts +3 -0
- package/components/input/epoch/date/styled.js +70 -0
- package/components/input/epoch/date/utils.d.ts +20 -0
- package/components/input/epoch/date/utils.js +201 -0
- package/components/input/epoch/datetime/index.d.ts +86 -0
- package/components/input/epoch/datetime/index.js +717 -0
- package/components/input/epoch/datetime/props.d.ts +212 -0
- package/components/input/epoch/datetime/props.js +5 -0
- package/components/input/epoch/datetime/utils.d.ts +20 -0
- package/components/input/epoch/datetime/utils.js +283 -0
- package/components/input/epoch/time/index.d.ts +86 -0
- package/components/input/epoch/time/index.js +478 -0
- package/components/input/epoch/time/props.d.ts +155 -0
- package/components/input/epoch/time/props.js +5 -0
- package/components/input/epoch/time/utils.d.ts +24 -0
- package/components/input/epoch/time/utils.js +240 -0
- package/components/input/fileupload/Utils.d.ts +14 -0
- package/components/input/fileupload/Utils.js +139 -0
- package/components/input/fileupload/components/ListItems.d.ts +11 -0
- package/components/input/fileupload/components/ListItems.js +135 -0
- package/components/input/fileupload/components/MultiUpload.d.ts +4 -0
- package/components/input/fileupload/components/MultiUpload.js +78 -0
- package/components/input/fileupload/components/SingleUpload.d.ts +4 -0
- package/components/input/fileupload/components/SingleUpload.js +58 -0
- package/components/input/fileupload/index.d.ts +92 -0
- package/components/input/fileupload/index.js +179 -0
- package/components/input/fileupload/props.d.ts +320 -0
- package/components/input/fileupload/props.js +5 -0
- package/components/input/fileupload/useFileUpload.d.ts +36 -0
- package/components/input/fileupload/useFileUpload.js +414 -0
- package/components/input/number/index.d.ts +164 -0
- package/components/input/number/index.js +406 -0
- package/components/input/number/props.d.ts +119 -0
- package/components/input/number/props.js +5 -0
- package/components/input/rating/index.d.ts +208 -0
- package/components/input/rating/index.js +461 -0
- package/components/input/rating/props.d.ts +195 -0
- package/components/input/rating/props.js +5 -0
- package/components/input/select/index.d.ts +173 -0
- package/components/input/select/index.js +492 -0
- package/components/input/select/props.d.ts +134 -0
- package/components/input/select/props.js +5 -0
- package/components/input/slider/index.d.ts +162 -0
- package/components/input/slider/index.js +337 -0
- package/components/input/slider/props.d.ts +101 -0
- package/components/input/slider/props.js +5 -0
- package/components/input/text/index.d.ts +177 -0
- package/components/input/text/index.js +499 -0
- package/components/input/text/props.d.ts +141 -0
- package/components/input/text/props.js +5 -0
- package/components/input/text/util.d.ts +42 -0
- package/components/input/text/util.js +334 -0
- package/components/input/textarea/index.d.ts +151 -0
- package/components/input/textarea/index.js +366 -0
- package/components/input/textarea/props.d.ts +85 -0
- package/components/input/textarea/props.js +5 -0
- package/components/input/upload/index.d.ts +142 -0
- package/components/input/upload/index.js +133 -0
- package/components/input/upload/props.d.ts +61 -0
- package/components/input/upload/props.js +5 -0
- package/components/input/util/index.d.ts +1 -0
- package/components/input/util/index.js +11 -0
- package/components/layout/footer/index.d.ts +15 -0
- package/components/layout/footer/index.js +37 -0
- package/components/layout/footer/props.d.ts +8 -0
- package/components/layout/footer/props.js +5 -0
- package/components/layout/header/index.d.ts +15 -0
- package/components/layout/header/index.js +40 -0
- package/components/layout/header/props.d.ts +8 -0
- package/components/layout/header/props.js +5 -0
- package/components/layout/leftnav/index.d.ts +15 -0
- package/components/layout/leftnav/index.js +54 -0
- package/components/layout/leftnav/props.d.ts +25 -0
- package/components/layout/leftnav/props.js +5 -0
- package/components/layout/rightnav/index.d.ts +15 -0
- package/components/layout/rightnav/index.js +38 -0
- package/components/layout/rightnav/props.d.ts +13 -0
- package/components/layout/rightnav/props.js +5 -0
- package/components/layout/topnav/index.d.ts +15 -0
- package/components/layout/topnav/index.js +40 -0
- package/components/layout/topnav/props.d.ts +8 -0
- package/components/layout/topnav/props.js +5 -0
- package/components/navbar/index.d.ts +70 -0
- package/components/navbar/index.js +101 -0
- package/components/navbar/nav/index.d.ts +90 -0
- package/components/navbar/nav/index.js +244 -0
- package/components/navbar/nav/props.d.ts +56 -0
- package/components/navbar/nav/props.js +5 -0
- package/components/navbar/nav-item/index.d.ts +63 -0
- package/components/navbar/nav-item/index.js +66 -0
- package/components/navbar/nav-item/props.d.ts +29 -0
- package/components/navbar/nav-item/props.js +5 -0
- package/components/navigation/breadcrumb/index.d.ts +66 -0
- package/components/navigation/breadcrumb/index.js +67 -0
- package/components/navigation/breadcrumb/props.d.ts +6 -0
- package/components/navigation/breadcrumb/props.js +5 -0
- package/components/navigation/menu/components/ListItems.d.ts +23 -0
- package/components/navigation/menu/components/ListItems.js +71 -0
- package/components/navigation/menu/constants.d.ts +53 -0
- package/components/navigation/menu/constants.js +102 -0
- package/components/navigation/menu/hooks/useHoverState.hook.d.ts +17 -0
- package/components/navigation/menu/hooks/useHoverState.hook.js +48 -0
- package/components/navigation/menu/hooks/useKeyboardMovements.hook.d.ts +12 -0
- package/components/navigation/menu/hooks/useKeyboardMovements.hook.js +37 -0
- package/components/navigation/menu/hooks/useTransformedDataset.hook.d.ts +5 -0
- package/components/navigation/menu/hooks/useTransformedDataset.hook.js +15 -0
- package/components/navigation/menu/index.d.ts +105 -0
- package/components/navigation/menu/index.js +1031 -0
- package/components/navigation/menu/props.d.ts +74 -0
- package/components/navigation/menu/props.js +5 -0
- package/components/navigation/menu/utils/action-task.d.ts +1 -0
- package/components/navigation/menu/utils/action-task.js +14 -0
- package/components/navigation/menu/utils/role-filter.d.ts +9 -0
- package/components/navigation/menu/utils/role-filter.js +76 -0
- package/components/navigation/popover/index.d.ts +97 -0
- package/components/navigation/popover/index.js +310 -0
- package/components/navigation/popover/props.d.ts +28 -0
- package/components/navigation/popover/props.js +13 -0
- package/components/page/content/index.d.ts +15 -0
- package/components/page/content/index.js +35 -0
- package/components/page/content/props.d.ts +6 -0
- package/components/page/content/props.js +5 -0
- package/components/page/error-boundary/index.d.ts +13 -0
- package/components/page/error-boundary/index.js +119 -0
- package/components/page/error-boundary/props.d.ts +30 -0
- package/components/page/error-boundary/props.js +5 -0
- package/components/page/index.d.ts +15 -0
- package/components/page/index.js +151 -0
- package/components/page/page-content/index.d.ts +15 -0
- package/components/page/page-content/index.js +34 -0
- package/components/page/page-content/props.d.ts +16 -0
- package/components/page/page-content/props.js +5 -0
- package/components/page/partial/index.d.ts +61 -0
- package/components/page/partial/index.js +46 -0
- package/components/page/partial/props.d.ts +6 -0
- package/components/page/partial/props.js +5 -0
- package/components/page/partial-container/index.d.ts +13 -0
- package/components/page/partial-container/index.js +112 -0
- package/components/page/partial-container/props.d.ts +38 -0
- package/components/page/partial-container/props.js +5 -0
- package/components/page/props.d.ts +33 -0
- package/components/page/props.js +5 -0
- package/components/page/toast-container/index.d.ts +13 -0
- package/components/page/toast-container/index.js +43 -0
- package/components/page/toast-container/props.d.ts +8 -0
- package/components/page/toast-container/props.js +5 -0
- package/components/prefab/container/index.d.ts +12 -0
- package/components/prefab/container/index.js +64 -0
- package/components/prefab/container/props.d.ts +23 -0
- package/components/prefab/container/props.js +5 -0
- package/components/prefab/index.d.ts +12 -0
- package/components/prefab/index.js +69 -0
- package/components/prefab/props.d.ts +18 -0
- package/components/prefab/props.js +5 -0
- package/context/AppContext.d.ts +9 -0
- package/context/AppContext.js +25 -0
- package/context/AppSpinnerProvider.d.ts +15 -0
- package/context/AppSpinnerProvider.js +43 -0
- package/context/LayoutProvider.d.ts +7 -0
- package/context/LayoutProvider.js +66 -0
- package/context/LocalizationProvider.d.ts +4 -0
- package/context/LocalizationProvider.js +80 -0
- package/context/PrefabContext.d.ts +15 -0
- package/context/PrefabContext.js +195 -0
- package/context/WidgetProvider.d.ts +19 -0
- package/context/WidgetProvider.js +274 -0
- package/core/app-config.js +1 -0
- package/core/app.service.d.ts +19 -0
- package/core/app.service.js +366 -0
- package/core/appVariablesStore.d.ts +5 -0
- package/core/appVariablesStore.js +23 -0
- package/core/appstore.d.ts +35 -0
- package/core/appstore.js +88 -0
- package/core/constants/currency-constant.d.ts +11 -0
- package/core/constants/currency-constant.js +1071 -0
- package/core/constants/events.d.ts +24 -0
- package/core/constants/events.js +63 -0
- package/core/constants/index.d.ts +10 -0
- package/core/constants/index.js +49 -0
- package/core/dialog.service.d.ts +31 -0
- package/core/dialog.service.js +75 -0
- package/core/event-notifier.d.ts +20 -0
- package/core/event-notifier.js +150 -0
- package/core/formatter/array-formatters.d.ts +4 -0
- package/core/formatter/array-formatters.js +33 -0
- package/core/formatter/date-formatters.d.ts +9 -0
- package/core/formatter/date-formatters.js +245 -0
- package/core/formatter/index.d.ts +19 -0
- package/core/formatter/index.js +133 -0
- package/core/formatter/number-formatters.d.ts +20 -0
- package/core/formatter/number-formatters.js +181 -0
- package/core/formatter/security-formatters.d.ts +25 -0
- package/core/formatter/security-formatters.js +321 -0
- package/core/formatter/string-formatters.d.ts +10 -0
- package/core/formatter/string-formatters.js +49 -0
- package/core/formatter/types.d.ts +33 -0
- package/core/formatter/types.js +18 -0
- package/core/formatters.d.ts +3 -0
- package/core/formatters.js +24 -0
- package/core/proxy-service.d.ts +6 -0
- package/core/proxy-service.js +571 -0
- package/core/script-registry.d.ts +23 -0
- package/core/script-registry.js +149 -0
- package/core/security.service.d.ts +12 -0
- package/core/security.service.js +11 -0
- package/core/util/compare.d.ts +1 -0
- package/core/util/compare.js +36 -0
- package/core/util/dom.d.ts +4 -0
- package/core/util/dom.js +107 -0
- package/core/util/index.d.ts +65 -0
- package/core/util/index.js +191 -0
- package/core/util/safe-is-equal.js +156 -0
- package/core/util/security.d.ts +64 -0
- package/core/util/security.js +183 -0
- package/core/util/utils.d.ts +34 -0
- package/core/util/utils.js +228 -0
- package/core/widget-observer.d.ts +3 -0
- package/core/widget-observer.js +98 -0
- package/higherOrder/BaseApp.d.ts +13 -0
- package/higherOrder/BaseApp.js +614 -0
- package/higherOrder/BaseAppProps.d.ts +37 -0
- package/higherOrder/BaseAppProps.js +5 -0
- package/higherOrder/BaseDateTime.d.ts +62 -0
- package/higherOrder/BaseDateTime.js +268 -0
- package/higherOrder/BasePage.d.ts +10 -0
- package/higherOrder/BasePage.js +909 -0
- package/higherOrder/BasePartial.d.ts +7 -0
- package/higherOrder/BasePartial.js +125 -0
- package/higherOrder/BasePrefab.d.ts +17 -0
- package/higherOrder/BasePrefab.js +234 -0
- package/higherOrder/DataNav.d.ts +53 -0
- package/higherOrder/DataNav.js +461 -0
- package/higherOrder/helper.d.ts +32 -0
- package/higherOrder/helper.js +81 -0
- package/higherOrder/props.d.ts +116 -0
- package/higherOrder/props.js +5 -0
- package/higherOrder/withBaseWrapper.d.ts +5 -0
- package/higherOrder/withBaseWrapper.js +218 -0
- package/higherOrder/withStandalone.d.ts +11 -0
- package/higherOrder/withStandalone.js +29 -0
- package/hooks/useAccess.d.ts +18 -0
- package/hooks/useAccess.js +321 -0
- package/hooks/useAppConfig.d.ts +3 -0
- package/hooks/useAppConfig.js +42 -0
- package/hooks/useAuth.d.ts +55 -0
- package/hooks/useAuth.js +568 -0
- package/hooks/useDataSourceSubscription.d.ts +15 -0
- package/hooks/useDataSourceSubscription.js +125 -0
- package/hooks/useDebounce.d.ts +21 -0
- package/hooks/useDebounce.js +76 -0
- package/hooks/useDeviceVisibility.d.ts +4 -0
- package/hooks/useDeviceVisibility.js +49 -0
- package/hooks/useHttp.d.ts +57 -0
- package/hooks/useHttp.js +531 -0
- package/libs/index.js +13 -0
- package/libs/prefab/index.js +20 -0
- package/mui-config/theme-provider.d.ts +3 -0
- package/mui-config/theme-provider.js +17 -0
- package/mui-config/theme.d.ts +2 -0
- package/mui-config/theme.js +364 -0
- package/package-lock.json +16455 -0
- package/package.json +135 -0
- package/providers/AppProviders.js +27 -0
- package/runtime-dynamic/App.d.ts +7 -0
- package/runtime-dynamic/App.js +144 -0
- package/runtime-dynamic/app-initializer.d.ts +15 -0
- package/runtime-dynamic/app-initializer.js +447 -0
- package/runtime-dynamic/components/ErrorBoundary.d.ts +18 -0
- package/runtime-dynamic/components/ErrorBoundary.js +93 -0
- package/runtime-dynamic/components/PageWrapper.d.ts +1 -0
- package/runtime-dynamic/components/PageWrapper.js +43 -0
- package/runtime-dynamic/components/PrefabPreview.d.ts +1 -0
- package/runtime-dynamic/components/PrefabPreview.js +84 -0
- package/runtime-dynamic/components/partial-content.d.ts +15 -0
- package/runtime-dynamic/components/partial-content.js +50 -0
- package/runtime-dynamic/components/prefab-content.d.ts +10 -0
- package/runtime-dynamic/components/prefab-content.js +31 -0
- package/runtime-dynamic/components/use-dynamic-component.d.ts +10 -0
- package/runtime-dynamic/components/use-dynamic-component.js +165 -0
- package/runtime-dynamic/factories/build-base-page-like-component.d.ts +8 -0
- package/runtime-dynamic/factories/build-base-page-like-component.js +59 -0
- package/runtime-dynamic/factories/prefab-factory.d.ts +3 -0
- package/runtime-dynamic/factories/prefab-factory.js +82 -0
- package/runtime-dynamic/factories/startup-info.d.ts +6 -0
- package/runtime-dynamic/factories/startup-info.js +28 -0
- package/runtime-dynamic/factories/utils.d.ts +23 -0
- package/runtime-dynamic/factories/utils.js +131 -0
- package/runtime-dynamic/index.d.ts +14 -0
- package/runtime-dynamic/index.js +191 -0
- package/runtime-dynamic/main.d.ts +2 -0
- package/runtime-dynamic/main.js +84 -0
- package/runtime-dynamic/preview-mode.d.ts +15 -0
- package/runtime-dynamic/preview-mode.js +31 -0
- package/runtime-dynamic/preview-navigation.d.ts +6 -0
- package/runtime-dynamic/preview-navigation.js +38 -0
- package/runtime-dynamic/preview-resource-base.d.ts +12 -0
- package/runtime-dynamic/preview-resource-base.js +65 -0
- package/runtime-dynamic/registry/component-registry.d.ts +3 -0
- package/runtime-dynamic/registry/component-registry.js +353 -0
- package/runtime-dynamic/registry/custom-widget-registry.d.ts +7 -0
- package/runtime-dynamic/registry/custom-widget-registry.js +18 -0
- package/runtime-dynamic/registry/index.d.ts +2 -0
- package/runtime-dynamic/registry/index.js +63 -0
- package/runtime-dynamic/registry/store.d.ts +9 -0
- package/runtime-dynamic/registry/store.js +26 -0
- package/runtime-dynamic/routes.d.ts +2 -0
- package/runtime-dynamic/routes.js +107 -0
- package/runtime-dynamic/services/app-extension-provider.d.ts +1 -0
- package/runtime-dynamic/services/app-extension-provider.js +45 -0
- package/runtime-dynamic/services/cache.d.ts +29 -0
- package/runtime-dynamic/services/cache.js +57 -0
- package/runtime-dynamic/services/component-ref-provider.d.ts +12 -0
- package/runtime-dynamic/services/component-ref-provider.js +149 -0
- package/runtime-dynamic/services/css-scoping.d.ts +2 -0
- package/runtime-dynamic/services/css-scoping.js +53 -0
- package/runtime-dynamic/services/fragment-url.d.ts +16 -0
- package/runtime-dynamic/services/fragment-url.js +74 -0
- package/runtime-dynamic/services/index.d.ts +10 -0
- package/runtime-dynamic/services/index.js +152 -0
- package/runtime-dynamic/services/markup-transpiler.d.ts +12 -0
- package/runtime-dynamic/services/markup-transpiler.js +250 -0
- package/runtime-dynamic/services/prefab-resources.d.ts +18 -0
- package/runtime-dynamic/services/prefab-resources.js +159 -0
- package/runtime-dynamic/services/resource-manager.d.ts +2 -0
- package/runtime-dynamic/services/resource-manager.js +66 -0
- package/runtime-dynamic/services/script-executor.d.ts +8 -0
- package/runtime-dynamic/services/script-executor.js +90 -0
- package/runtime-dynamic/services/variable-factory.d.ts +2 -0
- package/runtime-dynamic/services/variable-factory.js +260 -0
- package/runtime-dynamic/services/variable-registry.d.ts +12 -0
- package/runtime-dynamic/services/variable-registry.js +118 -0
- package/runtime-dynamic/services/variable-transpiler.d.ts +5 -0
- package/runtime-dynamic/services/variable-transpiler.js +159 -0
- package/runtime-dynamic/shims/next-image.d.ts +35 -0
- package/runtime-dynamic/shims/next-image.js +60 -0
- package/runtime-dynamic/shims/next-link.d.ts +25 -0
- package/runtime-dynamic/shims/next-link.js +33 -0
- package/runtime-dynamic/shims/next-navigation.d.ts +16 -0
- package/runtime-dynamic/shims/next-navigation.js +52 -0
- package/runtime-dynamic/utils/index.d.ts +9 -0
- package/runtime-dynamic/utils/index.js +40 -0
- package/store/bindActions/i18nActions.d.ts +7 -0
- package/store/bindActions/i18nActions.js +18 -0
- package/store/index.d.ts +18 -0
- package/store/index.js +40 -0
- package/store/middleware/navigationMiddleware.d.ts +10 -0
- package/store/middleware/navigationMiddleware.js +48 -0
- package/store/middleware/pendingTabNavigationIntentMiddleware.d.ts +6 -0
- package/store/middleware/pendingTabNavigationIntentMiddleware.js +25 -0
- package/store/slices/appConfigSlice.d.ts +21 -0
- package/store/slices/appConfigSlice.js +105 -0
- package/store/slices/authSlice.d.ts +54 -0
- package/store/slices/authSlice.js +526 -0
- package/store/slices/i18nSlice.d.ts +25 -0
- package/store/slices/i18nSlice.js +206 -0
- package/store/slices/navigationSlice.d.ts +7 -0
- package/store/slices/navigationSlice.js +35 -0
- package/store/viewport.service.d.ts +45 -0
- package/store/viewport.service.js +255 -0
- package/tsconfig.declaration.tsbuildinfo +1 -0
- package/types/global.d.js +3 -0
- package/types/index.d.ts +64 -0
- package/types/index.js +15 -0
- package/utils/attr.d.ts +1 -0
- package/utils/attr.js +92 -0
- package/utils/custom-expression/index.d.ts +43 -0
- package/utils/custom-expression/index.js +161 -0
- package/utils/custom-expression/parser.d.ts +15 -0
- package/utils/custom-expression/parser.js +208 -0
- package/utils/dataset-util.d.ts +31 -0
- package/utils/dataset-util.js +173 -0
- package/utils/eval-expression.js +32 -0
- package/utils/form-state.util.d.ts +62 -0
- package/utils/form-state.util.js +167 -0
- package/utils/form-utils.d.ts +84 -0
- package/utils/form-utils.js +232 -0
- package/utils/format-util.d.ts +25 -0
- package/utils/format-util.js +300 -0
- package/utils/layoutsize-util.d.ts +1 -0
- package/utils/layoutsize-util.js +57 -0
- package/utils/lib-error-skipper.d.ts +11 -0
- package/utils/lib-error-skipper.js +75 -0
- package/utils/page-params-util.d.ts +20 -0
- package/utils/page-params-util.js +56 -0
- package/utils/pending-tab-navigation-intent.d.ts +4 -0
- package/utils/pending-tab-navigation-intent.js +25 -0
- package/utils/resource-url.d.ts +1 -0
- package/utils/resource-url.js +27 -0
- package/utils/state-persistance.d.ts +27 -0
- package/utils/state-persistance.js +411 -0
- package/utils/style-utils.d.ts +28 -0
- package/utils/style-utils.js +92 -0
- package/utils/transformedDataset-utils.d.ts +67 -0
- package/utils/transformedDataset-utils.js +645 -0
- package/utils/widget-cleanup-util.d.ts +32 -0
- package/utils/widget-cleanup-util.js +109 -0
- package/utils/widgets.d.ts +3 -0
- package/utils/widgets.js +97 -0
- package/variables/base-variable.d.ts +61 -0
- package/variables/base-variable.js +180 -0
- package/variables/constants.d.ts +21 -0
- package/variables/constants.js +27 -0
- package/variables/crud-variable.d.ts +39 -0
- package/variables/crud-variable.js +227 -0
- package/variables/live-variable.d.ts +58 -0
- package/variables/live-variable.js +226 -0
- package/variables/metadata.service.d.ts +24 -0
- package/variables/metadata.service.js +122 -0
- package/variables/model-variable.d.ts +12 -0
- package/variables/model-variable.js +86 -0
- package/variables/service-variable.d.ts +41 -0
- package/variables/service-variable.js +356 -0
- package/wm-namespace.d.ts +11 -0
- package/wm-namespace.js +14 -0
|
@@ -0,0 +1,1830 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports["default"] = exports.WmTableComponent = exports.WmTable = void 0;
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
18
|
+
var _reactTable = require("@tanstack/react-table");
|
|
19
|
+
var _material = require("@mui/material");
|
|
20
|
+
var _lodashEs = require("lodash-es");
|
|
21
|
+
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker-ai/react-runtime/higherOrder/withBaseWrapper"));
|
|
22
|
+
var _pagination = _interopRequireDefault(require("@wavemaker-ai/react-runtime/components/data/pagination"));
|
|
23
|
+
var _hooks = require("./hooks");
|
|
24
|
+
var _utils = require("./utils");
|
|
25
|
+
var _groupHeaderUtils = require("./utils/groupHeaderUtils");
|
|
26
|
+
var _components = require("./components");
|
|
27
|
+
var _buildSelectionColumns = require("./utils/buildSelectionColumns");
|
|
28
|
+
var _LoadingComponent = _interopRequireDefault(require("@wavemaker-ai/react-runtime/components/data/pagination/components/LoadingComponent"));
|
|
29
|
+
var _columnProxy = require("./utils/columnProxy");
|
|
30
|
+
var _useDataSourceSubscription = require("@wavemaker-ai/react-runtime/hooks/useDataSourceSubscription");
|
|
31
|
+
var _crudHandlers = require("./utils/crud-handlers");
|
|
32
|
+
var _types = require("@wavemaker-ai/react-runtime/components/data/types");
|
|
33
|
+
var _useEditedRows = require("./hooks/use-edited-rows");
|
|
34
|
+
var _scriptPageSizeBroadcast = require("./utils/script-page-size-broadcast");
|
|
35
|
+
var _withStandalone = _interopRequireDefault(require("@wavemaker-ai/react-runtime/higherOrder/withStandalone"));
|
|
36
|
+
var _excluded = ["name", "dataset", "navigation", "children", "listener", "pagesize", "navigationalign", "showrecordcount", "maxsize", "boundarylinks", "allowpagesizechange", "pagesizeoptions", "formposition", "editmode", "spacing", "title", "subheading", "iconclass", "exportOptions", "shownavigation", "onDemandLoad", "showrowindex", "showheader", "enablesort", "enablecolumnselection", "onColumnselect", "onColumndeselect", "radioselect", "radioselecttitle", "radioselectarialabel", "multiselect", "multiselecttitle", "multiselectarialabel", "gridfirstrowselect", "isrowselectable", "rowClass", "deleteoktext", "deletecanceltext", "confirmdelete", "errormessage", "nodatamessage", "loadingdatamsg", "insertmessage", "updatemessage", "deletemessage", "ondemandmessage", "viewlessmessage", "showviewlessbutton", "onRowDelete", "onRowUpdate", "datasource", "binddataset", "onSuccess", "onError", "onRowinsert", "onRowupdate", "onRowdelete", "onRowclick", "onSort", "onBeforerowdelete", "onBeforefilter", "onHeaderclick", "onRowselect", "onRowdeselect", "onSetrecord", "statehandler", "formName", "parentForm", "filtermode", "filteronkeypress", "searchlabel", "onBeforedatarender", "onDatarender", "className", "exportformat", "exportdatasize", "onBeforeexport", "onAfterexport", "styles"];
|
|
37
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
38
|
+
var __jsx = _react["default"].createElement;
|
|
39
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
40
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
41
|
+
var WmTableComponent = exports.WmTableComponent = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
42
|
+
var _listener$App, _listener$Widgets2, _datasource$paginatio2, _table$getState$pagin, _datasource$paginatio4;
|
|
43
|
+
var name = props.name,
|
|
44
|
+
_props$dataset = props.dataset,
|
|
45
|
+
dataset = _props$dataset === void 0 ? [] : _props$dataset,
|
|
46
|
+
_props$navigation = props.navigation,
|
|
47
|
+
navigation = _props$navigation === void 0 ? "Basic" : _props$navigation,
|
|
48
|
+
children = props.children,
|
|
49
|
+
listener = props.listener,
|
|
50
|
+
_props$pagesize = props.pagesize,
|
|
51
|
+
pagesize = _props$pagesize === void 0 ? 5 : _props$pagesize,
|
|
52
|
+
_props$navigationalig = props.navigationalign,
|
|
53
|
+
navigationalign = _props$navigationalig === void 0 ? "left" : _props$navigationalig,
|
|
54
|
+
_props$showrecordcoun = props.showrecordcount,
|
|
55
|
+
showrecordcount = _props$showrecordcoun === void 0 ? false : _props$showrecordcoun,
|
|
56
|
+
_props$maxsize = props.maxsize,
|
|
57
|
+
maxsize = _props$maxsize === void 0 ? 5 : _props$maxsize,
|
|
58
|
+
_props$boundarylinks = props.boundarylinks,
|
|
59
|
+
boundarylinks = _props$boundarylinks === void 0 ? false : _props$boundarylinks,
|
|
60
|
+
_props$allowpagesizec = props.allowpagesizechange,
|
|
61
|
+
allowpagesizechange = _props$allowpagesizec === void 0 ? false : _props$allowpagesizec,
|
|
62
|
+
_props$pagesizeoption = props.pagesizeoptions,
|
|
63
|
+
pagesizeoptions = _props$pagesizeoption === void 0 ? "5,10,20,50,100" : _props$pagesizeoption,
|
|
64
|
+
_props$formposition = props.formposition,
|
|
65
|
+
formposition = _props$formposition === void 0 ? "bottom" : _props$formposition,
|
|
66
|
+
_props$editmode = props.editmode,
|
|
67
|
+
editmode = _props$editmode === void 0 ? "none" : _props$editmode,
|
|
68
|
+
_props$spacing = props.spacing,
|
|
69
|
+
spacing = _props$spacing === void 0 ? "normal" : _props$spacing,
|
|
70
|
+
title = props.title,
|
|
71
|
+
subheading = props.subheading,
|
|
72
|
+
iconclass = props.iconclass,
|
|
73
|
+
_props$exportOptions = props.exportOptions,
|
|
74
|
+
exportOptions = _props$exportOptions === void 0 ? [] : _props$exportOptions,
|
|
75
|
+
_props$shownavigation = props.shownavigation,
|
|
76
|
+
shownavigation = _props$shownavigation === void 0 ? true : _props$shownavigation,
|
|
77
|
+
_props$onDemandLoad = props.onDemandLoad,
|
|
78
|
+
onDemandLoad = _props$onDemandLoad === void 0 ? false : _props$onDemandLoad,
|
|
79
|
+
_props$showrowindex = props.showrowindex,
|
|
80
|
+
showrowindex = _props$showrowindex === void 0 ? false : _props$showrowindex,
|
|
81
|
+
_props$showheader = props.showheader,
|
|
82
|
+
showheader = _props$showheader === void 0 ? true : _props$showheader,
|
|
83
|
+
_props$enablesort = props.enablesort,
|
|
84
|
+
enablesort = _props$enablesort === void 0 ? true : _props$enablesort,
|
|
85
|
+
_props$enablecolumnse = props.enablecolumnselection,
|
|
86
|
+
enablecolumnselection = _props$enablecolumnse === void 0 ? false : _props$enablecolumnse,
|
|
87
|
+
onColumnselect = props.onColumnselect,
|
|
88
|
+
onColumndeselect = props.onColumndeselect,
|
|
89
|
+
_props$radioselect = props.radioselect,
|
|
90
|
+
radioselect = _props$radioselect === void 0 ? false : _props$radioselect,
|
|
91
|
+
_props$radioselecttit = props.radioselecttitle,
|
|
92
|
+
radioselecttitle = _props$radioselecttit === void 0 ? "" : _props$radioselecttit,
|
|
93
|
+
_props$radioselectari = props.radioselectarialabel,
|
|
94
|
+
radioselectarialabel = _props$radioselectari === void 0 ? _utils.TABLE_MESSAGES.radioSelectAriaLabel : _props$radioselectari,
|
|
95
|
+
_props$multiselect = props.multiselect,
|
|
96
|
+
multiselect = _props$multiselect === void 0 ? false : _props$multiselect,
|
|
97
|
+
_props$multiselecttit = props.multiselecttitle,
|
|
98
|
+
multiselecttitle = _props$multiselecttit === void 0 ? "" : _props$multiselecttit,
|
|
99
|
+
_props$multiselectari = props.multiselectarialabel,
|
|
100
|
+
multiselectarialabel = _props$multiselectari === void 0 ? _utils.TABLE_MESSAGES.multiSelectAriaLabel : _props$multiselectari,
|
|
101
|
+
_props$gridfirstrowse = props.gridfirstrowselect,
|
|
102
|
+
gridfirstrowselect = _props$gridfirstrowse === void 0 ? false : _props$gridfirstrowse,
|
|
103
|
+
_props$isrowselectabl = props.isrowselectable,
|
|
104
|
+
isrowselectable = _props$isrowselectabl === void 0 ? false : _props$isrowselectabl,
|
|
105
|
+
_props$rowClass = props.rowClass,
|
|
106
|
+
rowClass = _props$rowClass === void 0 ? "" : _props$rowClass,
|
|
107
|
+
_props$deleteoktext = props.deleteoktext,
|
|
108
|
+
deleteoktext = _props$deleteoktext === void 0 ? _utils.TABLE_MESSAGES.deleteOkText : _props$deleteoktext,
|
|
109
|
+
_props$deletecancelte = props.deletecanceltext,
|
|
110
|
+
deletecanceltext = _props$deletecancelte === void 0 ? _utils.TABLE_MESSAGES.deleteCancelText : _props$deletecancelte,
|
|
111
|
+
_props$confirmdelete = props.confirmdelete,
|
|
112
|
+
confirmdelete = _props$confirmdelete === void 0 ? _utils.TABLE_MESSAGES.deleteConfirmMessage : _props$confirmdelete,
|
|
113
|
+
_props$errormessage = props.errormessage,
|
|
114
|
+
errormessage = _props$errormessage === void 0 ? _utils.TABLE_MESSAGES.operationError : _props$errormessage,
|
|
115
|
+
_props$nodatamessage = props.nodatamessage,
|
|
116
|
+
nodatamessage = _props$nodatamessage === void 0 ? _utils.TABLE_MESSAGES.noDataMessage : _props$nodatamessage,
|
|
117
|
+
_props$loadingdatamsg = props.loadingdatamsg,
|
|
118
|
+
loadingdatamsg = _props$loadingdatamsg === void 0 ? _utils.TABLE_MESSAGES.loadingMessage : _props$loadingdatamsg,
|
|
119
|
+
_props$insertmessage = props.insertmessage,
|
|
120
|
+
insertmessage = _props$insertmessage === void 0 ? _utils.TABLE_MESSAGES.insertSuccess : _props$insertmessage,
|
|
121
|
+
_props$updatemessage = props.updatemessage,
|
|
122
|
+
updatemessage = _props$updatemessage === void 0 ? _utils.TABLE_MESSAGES.updateSuccess : _props$updatemessage,
|
|
123
|
+
_props$deletemessage = props.deletemessage,
|
|
124
|
+
deletemessage = _props$deletemessage === void 0 ? _utils.TABLE_MESSAGES.deleteSuccess : _props$deletemessage,
|
|
125
|
+
_props$ondemandmessag = props.ondemandmessage,
|
|
126
|
+
ondemandmessage = _props$ondemandmessag === void 0 ? "Load More" : _props$ondemandmessag,
|
|
127
|
+
_props$viewlessmessag = props.viewlessmessage,
|
|
128
|
+
viewlessmessage = _props$viewlessmessag === void 0 ? "View Less" : _props$viewlessmessag,
|
|
129
|
+
_props$showviewlessbu = props.showviewlessbutton,
|
|
130
|
+
showviewlessbutton = _props$showviewlessbu === void 0 ? false : _props$showviewlessbu,
|
|
131
|
+
onRowDelete = props.onRowDelete,
|
|
132
|
+
onRowUpdate = props.onRowUpdate,
|
|
133
|
+
datasource = props.datasource,
|
|
134
|
+
binddataset = props.binddataset,
|
|
135
|
+
onSuccess = props.onSuccess,
|
|
136
|
+
onError = props.onError,
|
|
137
|
+
onRowinsert = props.onRowinsert,
|
|
138
|
+
onRowupdate = props.onRowupdate,
|
|
139
|
+
onRowdelete = props.onRowdelete,
|
|
140
|
+
onRowclick = props.onRowclick,
|
|
141
|
+
onSort = props.onSort,
|
|
142
|
+
onBeforerowdelete = props.onBeforerowdelete,
|
|
143
|
+
onBeforefilter = props.onBeforefilter,
|
|
144
|
+
onHeaderclick = props.onHeaderclick,
|
|
145
|
+
onRowselect = props.onRowselect,
|
|
146
|
+
onRowdeselect = props.onRowdeselect,
|
|
147
|
+
onSetrecord = props.onSetrecord,
|
|
148
|
+
statehandler = props.statehandler,
|
|
149
|
+
formName = props.formName,
|
|
150
|
+
parentForm = props.parentForm,
|
|
151
|
+
filtermode = props.filtermode,
|
|
152
|
+
_props$filteronkeypre = props.filteronkeypress,
|
|
153
|
+
filteronkeypress = _props$filteronkeypre === void 0 ? false : _props$filteronkeypre,
|
|
154
|
+
_props$searchlabel = props.searchlabel,
|
|
155
|
+
searchlabel = _props$searchlabel === void 0 ? "Search" : _props$searchlabel,
|
|
156
|
+
onBeforedatarender = props.onBeforedatarender,
|
|
157
|
+
onDatarender = props.onDatarender,
|
|
158
|
+
className = props.className,
|
|
159
|
+
exportformat = props.exportformat,
|
|
160
|
+
exportdatasize = props.exportdatasize,
|
|
161
|
+
onBeforeexport = props.onBeforeexport,
|
|
162
|
+
onAfterexport = props.onAfterexport,
|
|
163
|
+
styles = props.styles,
|
|
164
|
+
rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
165
|
+
// When same partial is used multiple times (e.g. in tabs), use unique storage key to prevent state collision
|
|
166
|
+
var effectiveStorageKey = (0, _react.useMemo)(function () {
|
|
167
|
+
return name + (listener !== null && listener !== void 0 && listener.partialName ? "__".concat(listener === null || listener === void 0 ? void 0 : listener.partialName) : "");
|
|
168
|
+
}, [name, listener === null || listener === void 0 ? void 0 : listener.partialName]);
|
|
169
|
+
var widgetRegistrationKey = props["item-id"] || name;
|
|
170
|
+
var listenerRef = (0, _react.useRef)(listener);
|
|
171
|
+
listenerRef.current = listener;
|
|
172
|
+
var loading = (datasource === null || datasource === void 0 ? void 0 : datasource.loading) || false;
|
|
173
|
+
var prevDatasetRef = (0, _react.useRef)(dataset);
|
|
174
|
+
var prevSelectedRow = (0, _react.useRef)(null);
|
|
175
|
+
var tableApisRegistered = (0, _react.useRef)(false);
|
|
176
|
+
|
|
177
|
+
// State for accumulated data in Scroll and On-Demand navigation modes
|
|
178
|
+
var _useState = (0, _react.useState)([]),
|
|
179
|
+
accumulatedData = _useState[0],
|
|
180
|
+
setAccumulatedData = _useState[1];
|
|
181
|
+
|
|
182
|
+
// Callback to receive accumulated data from pagination (for Scroll and On-Demand)
|
|
183
|
+
var handleAccumulatedDataUpdate = (0, _react.useCallback)(function (data) {
|
|
184
|
+
// Only update if data has actually changed to prevent unnecessary re-renders
|
|
185
|
+
setAccumulatedData(function (prevData) {
|
|
186
|
+
// If lengths are different, it's definitely new data
|
|
187
|
+
if (prevData.length !== data.length) {
|
|
188
|
+
return data;
|
|
189
|
+
}
|
|
190
|
+
// Otherwise keep the previous reference to avoid re-render
|
|
191
|
+
return prevData;
|
|
192
|
+
});
|
|
193
|
+
}, []);
|
|
194
|
+
|
|
195
|
+
// Reset accumulated data when navigation changes
|
|
196
|
+
(0, _react.useEffect)(function () {
|
|
197
|
+
if (navigation !== "Scroll" && navigation !== "On-Demand") {
|
|
198
|
+
setAccumulatedData([]);
|
|
199
|
+
}
|
|
200
|
+
}, [navigation]);
|
|
201
|
+
var notifyApp = listener === null || listener === void 0 || (_listener$App = listener.App) === null || _listener$App === void 0 ? void 0 : _listener$App.notifyApp;
|
|
202
|
+
|
|
203
|
+
// Create a centralized toast notification function
|
|
204
|
+
var showToast = (0, _react.useCallback)(function (message, type) {
|
|
205
|
+
if (notifyApp) {
|
|
206
|
+
notifyApp(message, type);
|
|
207
|
+
}
|
|
208
|
+
}, [notifyApp]);
|
|
209
|
+
|
|
210
|
+
// Determine if we're using server-side pagination
|
|
211
|
+
// Check if datasource is API-aware (server-side) rather than checking runtime pagination data
|
|
212
|
+
var isServerSidePagination = (0, _react.useCallback)(function () {
|
|
213
|
+
if (navigation === "None") {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
return !!(datasource && datasource.execute && datasource.execute(_types.DataSource.Operation.IS_PAGEABLE));
|
|
217
|
+
}, [datasource, navigation]);
|
|
218
|
+
|
|
219
|
+
// Disable state management for Scroll navigation
|
|
220
|
+
var effectiveStateHandler = navigation === "Scroll" ? "none" : statehandler;
|
|
221
|
+
|
|
222
|
+
// Use datasource subscription for SSP state restoration - RUN FIRST
|
|
223
|
+
// This hook must run before other hooks to ensure datasource state is properly initialized
|
|
224
|
+
(0, _useDataSourceSubscription.useDataSourceSubscription)({
|
|
225
|
+
datasource: datasource,
|
|
226
|
+
statehandler: effectiveStateHandler,
|
|
227
|
+
name: name,
|
|
228
|
+
widgetType: "table",
|
|
229
|
+
onPageRestored: function onPageRestored() {
|
|
230
|
+
// This will be called when datasource loads with restored page
|
|
231
|
+
// The page is already set in datasource options, so we don't need to do anything here
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// Use custom hooks for organized functionality
|
|
236
|
+
var _useTableData = (0, _hooks.useTableData)({
|
|
237
|
+
dataset: dataset,
|
|
238
|
+
onRowDelete: onRowDelete,
|
|
239
|
+
deleteoktext: deleteoktext,
|
|
240
|
+
deletecanceltext: deletecanceltext,
|
|
241
|
+
confirmdelete: confirmdelete,
|
|
242
|
+
deletemessage: deletemessage,
|
|
243
|
+
errormessage: errormessage,
|
|
244
|
+
showToast: showToast,
|
|
245
|
+
datasource: datasource,
|
|
246
|
+
binddataset: binddataset,
|
|
247
|
+
onSuccess: onSuccess,
|
|
248
|
+
onError: onError,
|
|
249
|
+
onRowdelete: onRowdelete,
|
|
250
|
+
isServerSidePagination: isServerSidePagination(),
|
|
251
|
+
listener: listener,
|
|
252
|
+
widgetName: name
|
|
253
|
+
}),
|
|
254
|
+
internalDataset = _useTableData.internalDataset,
|
|
255
|
+
setInternalDataset = _useTableData.setInternalDataset,
|
|
256
|
+
_deleteRecord = _useTableData.deleteRecord,
|
|
257
|
+
renderConfirmDialog = _useTableData.renderConfirmDialog;
|
|
258
|
+
var _useFormWidget = (0, _hooks.useFormWidget)({
|
|
259
|
+
listener: listener
|
|
260
|
+
}),
|
|
261
|
+
renderFormWidget = _useFormWidget.renderFormWidget;
|
|
262
|
+
|
|
263
|
+
// Use generic cell state hook for managing cell values and selections
|
|
264
|
+
// Use the table name as unique ID to prevent collisions between multiple tables
|
|
265
|
+
var cellState = (0, _hooks.useCellState)(name);
|
|
266
|
+
|
|
267
|
+
// Ref holding the "sync selectedItems" implementation, assigned each render after
|
|
268
|
+
// tableApis is defined. A stable wrapper is passed to useRowSelection so it can
|
|
269
|
+
// call the latest version without being in its dependency array.
|
|
270
|
+
var syncSelectedItemsImplRef = (0, _react.useRef)(null);
|
|
271
|
+
var onSyncSelectedItems = (0, _react.useCallback)(function (ids) {
|
|
272
|
+
var _syncSelectedItemsImp;
|
|
273
|
+
return (_syncSelectedItemsImp = syncSelectedItemsImplRef.current) === null || _syncSelectedItemsImp === void 0 ? void 0 : _syncSelectedItemsImp.call(syncSelectedItemsImplRef, ids);
|
|
274
|
+
}, []);
|
|
275
|
+
|
|
276
|
+
// ==================== STATE PERSISTENCE ====================
|
|
277
|
+
// Restore persisted state before initializing table
|
|
278
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
279
|
+
var _datasource$paginatio;
|
|
280
|
+
// Skip state restoration for Scroll navigation
|
|
281
|
+
if (navigation === "Scroll") {
|
|
282
|
+
return {
|
|
283
|
+
initialPage: 1,
|
|
284
|
+
initialPageSize: pagesize,
|
|
285
|
+
initialActualPageSize: undefined,
|
|
286
|
+
initialSearchState: undefined,
|
|
287
|
+
initialSortState: undefined
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
var persisted = (0, _utils.getTableState)(name, effectiveStateHandler);
|
|
291
|
+
var sortedPageSizeOptions = (pagesizeoptions || "").split(",").map(function (v) {
|
|
292
|
+
return Number(v.trim());
|
|
293
|
+
}).filter(function (n) {
|
|
294
|
+
return !Number.isNaN(n);
|
|
295
|
+
}).sort(function (a, b) {
|
|
296
|
+
return a - b;
|
|
297
|
+
});
|
|
298
|
+
var hasExplicitPersistedPageSize = persisted != null && persisted.pagesize !== undefined && persisted.pagesize !== null;
|
|
299
|
+
|
|
300
|
+
// Align with Angular TableComponent.setDefaultPageSize: when allowpagesizechange is on
|
|
301
|
+
// and there is no persisted pagesize, use the smallest pagesize option (not design-time pagesize).
|
|
302
|
+
var defaultPageSizeFromOptions = allowpagesizechange && sortedPageSizeOptions.length > 0 && !hasExplicitPersistedPageSize ? sortedPageSizeOptions[0] : 20;
|
|
303
|
+
|
|
304
|
+
// Determine the actual page size (original datasource page size)
|
|
305
|
+
var actualPageSize;
|
|
306
|
+
if ((persisted === null || persisted === void 0 ? void 0 : persisted.actualpagesize) !== undefined) {
|
|
307
|
+
// If we have a persisted actualPageSize, use it (it should never change)
|
|
308
|
+
actualPageSize = persisted.actualpagesize;
|
|
309
|
+
} else if (datasource !== null && datasource !== void 0 && (_datasource$paginatio = datasource.pagination) !== null && _datasource$paginatio !== void 0 && _datasource$paginatio.size) {
|
|
310
|
+
// Otherwise, if this is the first load, capture it from datasource
|
|
311
|
+
actualPageSize = datasource.pagination.size;
|
|
312
|
+
} else if (datasource !== null && datasource !== void 0 && datasource.maxResults) {
|
|
313
|
+
// Fallback to maxResults if available
|
|
314
|
+
actualPageSize = datasource.maxResults;
|
|
315
|
+
}
|
|
316
|
+
if (persisted) {
|
|
317
|
+
// Check if there's an active filter/search state
|
|
318
|
+
var hasActiveFilter = persisted.search && persisted.search.length > 0;
|
|
319
|
+
|
|
320
|
+
// If there's an active filter, don't restore pagination - start from page 1
|
|
321
|
+
// The server will return new filtered data, so old pagination is invalid
|
|
322
|
+
var restoredPage = hasActiveFilter ? 1 : persisted.pagination || 1;
|
|
323
|
+
var persistedPageSize = hasExplicitPersistedPageSize ? persisted.pagesize : defaultPageSizeFromOptions !== null && defaultPageSizeFromOptions !== void 0 ? defaultPageSizeFromOptions : pagesize;
|
|
324
|
+
|
|
325
|
+
// Set datasource maxResults if we have a persisted pageSize and datasource
|
|
326
|
+
if (isServerSidePagination() && datasource && datasource.maxResults !== undefined && hasExplicitPersistedPageSize) {
|
|
327
|
+
datasource.maxResults = persistedPageSize;
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
initialPage: restoredPage,
|
|
331
|
+
initialPageSize: persistedPageSize,
|
|
332
|
+
initialActualPageSize: actualPageSize,
|
|
333
|
+
initialSearchState: persisted.search || undefined,
|
|
334
|
+
initialSortState: persisted.sort || undefined
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
var initialPageSize = defaultPageSizeFromOptions !== undefined ? defaultPageSizeFromOptions : actualPageSize || pagesize;
|
|
338
|
+
return {
|
|
339
|
+
initialPage: 1,
|
|
340
|
+
initialPageSize: initialPageSize,
|
|
341
|
+
initialActualPageSize: pagesize,
|
|
342
|
+
initialSearchState: undefined,
|
|
343
|
+
initialSortState: undefined
|
|
344
|
+
};
|
|
345
|
+
}, [name, effectiveStateHandler, pagesize, isServerSidePagination(), datasource, navigation]),
|
|
346
|
+
initialPage = _useMemo.initialPage,
|
|
347
|
+
initialPageSize = _useMemo.initialPageSize,
|
|
348
|
+
initialActualPageSize = _useMemo.initialActualPageSize,
|
|
349
|
+
initialSearchState = _useMemo.initialSearchState,
|
|
350
|
+
initialSortState = _useMemo.initialSortState;
|
|
351
|
+
|
|
352
|
+
// Create a ref to hold the table instance
|
|
353
|
+
var tableRef = _react["default"].useRef(null);
|
|
354
|
+
|
|
355
|
+
// Create a ref to hold the table container DOM element
|
|
356
|
+
var tableContainerRef = _react["default"].useRef(null);
|
|
357
|
+
|
|
358
|
+
// Track previous page index to detect actual page changes
|
|
359
|
+
var prevPageIndexRef = (0, _react.useRef)(-1);
|
|
360
|
+
|
|
361
|
+
// Use pagination state hook - manages controlled pagination state
|
|
362
|
+
var _usePaginationState = (0, _hooks.usePaginationState)({
|
|
363
|
+
initialPage: initialPage,
|
|
364
|
+
initialPageSize: initialPageSize,
|
|
365
|
+
editmode: editmode,
|
|
366
|
+
internalDataset: internalDataset,
|
|
367
|
+
datasource: datasource,
|
|
368
|
+
isServerSidePagination: isServerSidePagination()
|
|
369
|
+
}),
|
|
370
|
+
paginationState = _usePaginationState.paginationState,
|
|
371
|
+
setPaginationState = _usePaginationState.setPaginationState,
|
|
372
|
+
handlePaginationChange = _usePaginationState.handlePaginationChange,
|
|
373
|
+
handlePageSizeChangeBase = _usePaginationState.handlePageSizeChange;
|
|
374
|
+
|
|
375
|
+
// Multiselect is only valid when editmode is "quickedit" or "inline"
|
|
376
|
+
var effectiveMultiselect = multiselect;
|
|
377
|
+
|
|
378
|
+
// Use row selection hook
|
|
379
|
+
var _useRowSelection = (0, _hooks.useRowSelection)({
|
|
380
|
+
radioselect: radioselect,
|
|
381
|
+
multiselect: effectiveMultiselect,
|
|
382
|
+
gridfirstrowselect: gridfirstrowselect,
|
|
383
|
+
internalDataset: internalDataset,
|
|
384
|
+
cellState: cellState,
|
|
385
|
+
name: name,
|
|
386
|
+
statehandler: effectiveStateHandler,
|
|
387
|
+
initialActualPageSize: initialActualPageSize,
|
|
388
|
+
getTableState: function getTableState() {
|
|
389
|
+
return tableRef.current ? {
|
|
390
|
+
currentPage: tableRef.current.getState().pagination.pageIndex + 1,
|
|
391
|
+
currentPageSize: tableRef.current.getState().pagination.pageSize
|
|
392
|
+
} : {
|
|
393
|
+
currentPage: 1,
|
|
394
|
+
currentPageSize: initialPageSize
|
|
395
|
+
};
|
|
396
|
+
},
|
|
397
|
+
onRowselect: onRowselect,
|
|
398
|
+
onRowdeselect: onRowdeselect,
|
|
399
|
+
listener: listener,
|
|
400
|
+
navigation: navigation,
|
|
401
|
+
onSyncSelectedItems: onSyncSelectedItems
|
|
402
|
+
}),
|
|
403
|
+
selectedRowIds = _useRowSelection.selectedRowIds,
|
|
404
|
+
useMultiSelect = _useRowSelection.useMultiSelect,
|
|
405
|
+
useRadioSelect = _useRowSelection.useRadioSelect,
|
|
406
|
+
handleRadioSelection = _useRowSelection.handleRadioSelection,
|
|
407
|
+
handleMultiSelection = _useRowSelection.handleMultiSelection,
|
|
408
|
+
handleSelectAll = _useRowSelection.handleSelectAll,
|
|
409
|
+
handleRowSelectionClick = _useRowSelection.handleRowSelectionClick,
|
|
410
|
+
isRowSelected = _useRowSelection.isRowSelected;
|
|
411
|
+
|
|
412
|
+
// Use table state hook
|
|
413
|
+
var _useTableState = (0, _hooks.useTableState)({
|
|
414
|
+
editMode: editmode,
|
|
415
|
+
radioselect: radioselect,
|
|
416
|
+
multiselect: effectiveMultiselect
|
|
417
|
+
}),
|
|
418
|
+
activeRowIds = _useTableState.activeRowIds,
|
|
419
|
+
setActiveRow = _useTableState.setActiveRow,
|
|
420
|
+
handleRowActiveClick = _useTableState.handleRowActiveClick,
|
|
421
|
+
isRowActive = _useTableState.isRowActive;
|
|
422
|
+
|
|
423
|
+
// Sync activeRowIds with selectedRowIds when selection modes are active
|
|
424
|
+
// This ensures that when rows are selected/deselected, the active state follows
|
|
425
|
+
(0, _react.useEffect)(function () {
|
|
426
|
+
if (useRadioSelect || useMultiSelect) {
|
|
427
|
+
setActiveRow(selectedRowIds);
|
|
428
|
+
}
|
|
429
|
+
}, [selectedRowIds, useRadioSelect, useMultiSelect, setActiveRow]);
|
|
430
|
+
|
|
431
|
+
// Use dynamic columns hook to generate columns from data when no children are provided.
|
|
432
|
+
// Use the raw dataset prop (not internalDataset) so column structure (keys/schema) is
|
|
433
|
+
// derived from the actual API response — even when all values are empty strings,
|
|
434
|
+
// removeEmptyRecords would otherwise wipe out internalDataset and leave dynamicColumns empty.
|
|
435
|
+
var _useDynamicColumns = (0, _hooks.useDynamicColumns)({
|
|
436
|
+
dataset: dataset || [],
|
|
437
|
+
children: children,
|
|
438
|
+
listener: listener
|
|
439
|
+
}),
|
|
440
|
+
dynamicColumns = _useDynamicColumns.dynamicColumns,
|
|
441
|
+
isDynamicTable = _useDynamicColumns.isDynamicTable;
|
|
442
|
+
|
|
443
|
+
// Parse table structure from children using utilities
|
|
444
|
+
var _useMemo2 = (0, _react.useMemo)(function () {
|
|
445
|
+
var allTableActions = (0, _utils.parseTableActions)(children);
|
|
446
|
+
var headerActions = allTableActions.filter(function (action) {
|
|
447
|
+
var position = action.position || "footer";
|
|
448
|
+
return position === "header" || position.includes("header");
|
|
449
|
+
});
|
|
450
|
+
var footerActions = allTableActions.filter(function (action) {
|
|
451
|
+
var position = action.position || "footer";
|
|
452
|
+
return position === "footer" || position.includes("footer") || !action.position;
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
// Parse table structure with groups support
|
|
456
|
+
var structure = (0, _utils.parseTableStructureWithGroups)(children);
|
|
457
|
+
var flatColumns = (0, _utils.flattenTableStructure)(structure);
|
|
458
|
+
|
|
459
|
+
// Get static columns from children
|
|
460
|
+
var staticColumns = (0, _utils.parseTableColumns)(children, internalDataset);
|
|
461
|
+
|
|
462
|
+
// Check if we have groups in the structure
|
|
463
|
+
var hasGroups = structure.some(function (item) {
|
|
464
|
+
return "isGroup" in item && item.isGroup;
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
// Determine final columns:
|
|
468
|
+
// - If groups exist, use flatColumns (from structure) to preserve group structure
|
|
469
|
+
// - Otherwise, prefer static columns, then dynamic columns, then flat columns from structure
|
|
470
|
+
var finalColumns = hasGroups && flatColumns.length > 0 ? flatColumns : staticColumns.length > 0 ? staticColumns : isDynamicTable && dynamicColumns.length > 0 ? dynamicColumns : flatColumns;
|
|
471
|
+
return {
|
|
472
|
+
wmTableColumns: finalColumns,
|
|
473
|
+
tableStructure: structure,
|
|
474
|
+
rowActions: (0, _utils.parseTableRowActions)(children),
|
|
475
|
+
tableActions: allTableActions,
|
|
476
|
+
headerActions: headerActions,
|
|
477
|
+
footerActions: footerActions,
|
|
478
|
+
rowExpansionConfig: (0, _utils.parseTableRowExpansion)(children)
|
|
479
|
+
};
|
|
480
|
+
}, [children, internalDataset, isDynamicTable, dynamicColumns]),
|
|
481
|
+
wmTableColumns = _useMemo2.wmTableColumns,
|
|
482
|
+
tableStructure = _useMemo2.tableStructure,
|
|
483
|
+
rowActions = _useMemo2.rowActions,
|
|
484
|
+
headerActions = _useMemo2.headerActions,
|
|
485
|
+
footerActions = _useMemo2.footerActions,
|
|
486
|
+
rowExpansionConfig = _useMemo2.rowExpansionConfig;
|
|
487
|
+
var _useState2 = (0, _react.useState)(0),
|
|
488
|
+
columnsVersion = _useState2[0],
|
|
489
|
+
setColumnsVersion = _useState2[1];
|
|
490
|
+
var _useState3 = (0, _react.useState)({}),
|
|
491
|
+
columnOverrides = _useState3[0],
|
|
492
|
+
setColumnOverrides = _useState3[1];
|
|
493
|
+
var applyOverride = (0, _react.useCallback)(function (field, key, value) {
|
|
494
|
+
setColumnOverrides(function (prev) {
|
|
495
|
+
return _objectSpread(_objectSpread({}, prev), {}, (0, _defineProperty2["default"])({}, field, _objectSpread(_objectSpread({}, prev[field] || {}), {}, (0, _defineProperty2["default"])({}, key, value))));
|
|
496
|
+
});
|
|
497
|
+
}, []);
|
|
498
|
+
|
|
499
|
+
/** Merge script-driven overrides (e.g. onBeforedatarender) onto WM column defs.
|
|
500
|
+
* Dynamic columns may be regenerated as new objects with default show:true while columnOverrides persist. */
|
|
501
|
+
var wmTableColumnsWithOverrides = (0, _react.useMemo)(function () {
|
|
502
|
+
return wmTableColumns.map(function (col) {
|
|
503
|
+
var f = col === null || col === void 0 ? void 0 : col.field;
|
|
504
|
+
if (!f) return col;
|
|
505
|
+
var o = columnOverrides[f];
|
|
506
|
+
if (!o || Object.keys(o).length === 0) return col;
|
|
507
|
+
return _objectSpread(_objectSpread({}, col), o);
|
|
508
|
+
});
|
|
509
|
+
}, [wmTableColumns, columnOverrides]);
|
|
510
|
+
|
|
511
|
+
// Use unified table edit functionality
|
|
512
|
+
var _useTableEdit = (0, _hooks.useTableEdit)({
|
|
513
|
+
editMode: editmode,
|
|
514
|
+
internalDataset: internalDataset,
|
|
515
|
+
setInternalDataset: setInternalDataset,
|
|
516
|
+
wmTableColumns: wmTableColumnsWithOverrides,
|
|
517
|
+
cellState: cellState,
|
|
518
|
+
renderFormWidget: renderFormWidget,
|
|
519
|
+
listener: listener,
|
|
520
|
+
onRowUpdate: onRowUpdate,
|
|
521
|
+
onRowDelete: onRowDelete,
|
|
522
|
+
onNewRowAdded: function onNewRowAdded(newRecord) {
|
|
523
|
+
// Use shared navigation utility function
|
|
524
|
+
(0, _utils.handleNewRowNavigation)(tableRef, newRecord, internalDataset);
|
|
525
|
+
},
|
|
526
|
+
showrowindex: showrowindex,
|
|
527
|
+
radioselect: radioselect,
|
|
528
|
+
multiselect: effectiveMultiselect,
|
|
529
|
+
rowActions: rowActions,
|
|
530
|
+
formposition: formposition,
|
|
531
|
+
insertmessage: insertmessage,
|
|
532
|
+
updatemessage: updatemessage,
|
|
533
|
+
errormessage: errormessage,
|
|
534
|
+
showToast: showToast,
|
|
535
|
+
hasRowExpansion: rowExpansionConfig ? rowExpansionConfig.show : false,
|
|
536
|
+
expansionPosition: rowExpansionConfig ? parseInt(String(rowExpansionConfig.position || "0"), 10) : 0,
|
|
537
|
+
datasource: datasource,
|
|
538
|
+
binddataset: binddataset,
|
|
539
|
+
onSuccess: onSuccess,
|
|
540
|
+
onError: onError,
|
|
541
|
+
onRowinsert: onRowinsert,
|
|
542
|
+
onRowupdate: onRowupdate,
|
|
543
|
+
onRowdelete: onRowdelete,
|
|
544
|
+
tableRef: tableRef,
|
|
545
|
+
isServerSidePagination: isServerSidePagination(),
|
|
546
|
+
tableName: name
|
|
547
|
+
}),
|
|
548
|
+
editingRowId = _useTableEdit.editingRowId,
|
|
549
|
+
isRowEditing = _useTableEdit.isRowEditing,
|
|
550
|
+
startEditing = _useTableEdit.startEditing,
|
|
551
|
+
cancelEditing = _useTableEdit.cancelEditing,
|
|
552
|
+
saveEditing = _useTableEdit.saveEditing,
|
|
553
|
+
renderEditableCell = _useTableEdit.renderEditableCell,
|
|
554
|
+
isAddingNewRow = _useTableEdit.isAddingNewRow,
|
|
555
|
+
handleAddNewRowClick = _useTableEdit.handleAddNewRowClick,
|
|
556
|
+
renderAddNewRow = _useTableEdit.renderAddNewRow,
|
|
557
|
+
handleTableEditRowClick = _useTableEdit.handleRowClick,
|
|
558
|
+
handleTableEditKeyDown = _useTableEdit.handleKeyDown;
|
|
559
|
+
|
|
560
|
+
// Use the row handlers hook
|
|
561
|
+
var _useRowHandlers = (0, _hooks.useRowHandlers)({
|
|
562
|
+
editingRowId: editingRowId,
|
|
563
|
+
isAddingNewRow: isAddingNewRow,
|
|
564
|
+
handleRowSelectionClick: handleRowSelectionClick,
|
|
565
|
+
handleTableEditRowClick: handleTableEditRowClick,
|
|
566
|
+
handleRowActiveClick: handleRowActiveClick,
|
|
567
|
+
onRowclick: onRowclick,
|
|
568
|
+
useRadioSelect: useRadioSelect,
|
|
569
|
+
useMultiSelect: useMultiSelect,
|
|
570
|
+
isrowselectable: isrowselectable,
|
|
571
|
+
listener: listener,
|
|
572
|
+
name: name
|
|
573
|
+
}),
|
|
574
|
+
handleRowClick = _useRowHandlers.handleRowClick;
|
|
575
|
+
|
|
576
|
+
// Effect to cancel editing when page changes
|
|
577
|
+
(0, _react.useEffect)(function () {
|
|
578
|
+
var currentPage = paginationState.pageIndex;
|
|
579
|
+
// Skip on initial render (when prevPageIndexRef is still -1)
|
|
580
|
+
// The ref is initialized to -1 and only updated after first data render
|
|
581
|
+
if (prevPageIndexRef.current !== -1 && currentPage !== prevPageIndexRef.current && isAddingNewRow) {
|
|
582
|
+
cancelEditing();
|
|
583
|
+
}
|
|
584
|
+
// Don't update the ref here - it's updated in the data render effect
|
|
585
|
+
}, [paginationState.pageIndex, isAddingNewRow, cancelEditing]);
|
|
586
|
+
|
|
587
|
+
// Track sorting and column sizing states
|
|
588
|
+
var _useState4 = (0, _react.useState)(function () {
|
|
589
|
+
// Convert initialSortState to TanStack Table sorting format
|
|
590
|
+
if (initialSortState) {
|
|
591
|
+
return [{
|
|
592
|
+
id: initialSortState.field,
|
|
593
|
+
desc: initialSortState.direction === "desc"
|
|
594
|
+
}];
|
|
595
|
+
}
|
|
596
|
+
return [];
|
|
597
|
+
}),
|
|
598
|
+
sorting = _useState4[0],
|
|
599
|
+
setSorting = _useState4[1];
|
|
600
|
+
var _useState5 = (0, _react.useState)({}),
|
|
601
|
+
columnSizing = _useState5[0],
|
|
602
|
+
setColumnSizing = _useState5[1];
|
|
603
|
+
var _useState6 = (0, _react.useState)(false),
|
|
604
|
+
isResizing = _useState6[0],
|
|
605
|
+
setIsResizing = _useState6[1];
|
|
606
|
+
|
|
607
|
+
// Column selection handlers - just call the external callbacks
|
|
608
|
+
// The class toggling is handled directly in TableHeaderComponent
|
|
609
|
+
var handleColumnSelect = (0, _react.useCallback)(function (event, columnId, colDef, columnData) {
|
|
610
|
+
if (onColumnselect) {
|
|
611
|
+
onColumnselect(event, {
|
|
612
|
+
field: columnId,
|
|
613
|
+
colDef: colDef,
|
|
614
|
+
data: columnData
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
}, [onColumnselect]);
|
|
618
|
+
var handleColumnDeselect = (0, _react.useCallback)(function (event, columnId, colDef, columnData) {
|
|
619
|
+
if (onColumndeselect) {
|
|
620
|
+
onColumndeselect(event, {
|
|
621
|
+
field: columnId,
|
|
622
|
+
colDef: colDef,
|
|
623
|
+
data: columnData
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
}, [onColumndeselect]);
|
|
627
|
+
|
|
628
|
+
// Custom sorting change handler that resets page to 1 when sorting changes
|
|
629
|
+
var handleSortingChange = (0, _react.useCallback)(function (updaterOrValue) {
|
|
630
|
+
var newSorting = typeof updaterOrValue === "function" ? updaterOrValue(sorting) : updaterOrValue;
|
|
631
|
+
setSorting(updaterOrValue);
|
|
632
|
+
// Reset to first page when sorting changes
|
|
633
|
+
setPaginationState(function (prev) {
|
|
634
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
635
|
+
pageIndex: 0
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
// Trigger onSort callback if provided
|
|
640
|
+
if (onSort && newSorting.length > 0) {
|
|
641
|
+
var _listener$Widgets;
|
|
642
|
+
var sortData = {
|
|
643
|
+
field: newSorting[0].id,
|
|
644
|
+
direction: newSorting[0].desc ? "desc" : "asc"
|
|
645
|
+
};
|
|
646
|
+
onSort(null, listener === null || listener === void 0 || (_listener$Widgets = listener.Widgets) === null || _listener$Widgets === void 0 ? void 0 : _listener$Widgets[name], sortData);
|
|
647
|
+
}
|
|
648
|
+
}, [sorting, name]);
|
|
649
|
+
|
|
650
|
+
// Use row expansion hook
|
|
651
|
+
var _useRowExpansion = (0, _hooks.useRowExpansion)({
|
|
652
|
+
rowExpansionConfig: rowExpansionConfig,
|
|
653
|
+
internalDataset: internalDataset
|
|
654
|
+
}),
|
|
655
|
+
expandedRows = _useRowExpansion.expandedRows,
|
|
656
|
+
toggleRowExpansion = _useRowExpansion.toggleRowExpansion,
|
|
657
|
+
isRowExpanded = _useRowExpansion.isRowExpanded,
|
|
658
|
+
registerRowDefInstance = _useRowExpansion.registerRowDefInstance,
|
|
659
|
+
rowDefInstances = _useRowExpansion.rowDefInstances;
|
|
660
|
+
var handleToggleRowExpansion = (0, _react.useCallback)(function (rowId, rowData) {
|
|
661
|
+
if (listener !== null && listener !== void 0 && listener.onChange) {
|
|
662
|
+
var selecteditem = (0, _utils.cleanRowData)(rowData);
|
|
663
|
+
if (!(0, _lodashEs.isEqual)(prevSelectedRow.current, selecteditem)) {
|
|
664
|
+
prevSelectedRow.current = selecteditem;
|
|
665
|
+
listener.onChange(widgetRegistrationKey, {
|
|
666
|
+
selecteditem: selecteditem
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
setTimeout(function () {
|
|
671
|
+
return toggleRowExpansion(rowId, rowData);
|
|
672
|
+
}, 0);
|
|
673
|
+
}, [name]);
|
|
674
|
+
|
|
675
|
+
// Use table columns hook to get column definitions
|
|
676
|
+
var _useTableColumns = (0, _hooks.useTableColumns)({
|
|
677
|
+
wmTableColumns: wmTableColumnsWithOverrides,
|
|
678
|
+
columnsVersion: columnsVersion,
|
|
679
|
+
rowActions: rowActions,
|
|
680
|
+
listener: listener,
|
|
681
|
+
deleteRecord: function deleteRecord(rowData) {
|
|
682
|
+
return _deleteRecord(rowData, tableRef.current);
|
|
683
|
+
},
|
|
684
|
+
showrowindex: showrowindex,
|
|
685
|
+
editmode: editmode,
|
|
686
|
+
isDynamicTable: isDynamicTable,
|
|
687
|
+
renderEditableCell: renderEditableCell,
|
|
688
|
+
isRowEditing: isRowEditing,
|
|
689
|
+
startEditing: startEditing,
|
|
690
|
+
cancelEditing: cancelEditing,
|
|
691
|
+
saveEditing: saveEditing,
|
|
692
|
+
editingRowId: editingRowId,
|
|
693
|
+
cellState: cellState,
|
|
694
|
+
isResizing: isResizing,
|
|
695
|
+
handleRowClick: handleRowClick,
|
|
696
|
+
handleRadioSelection: handleRadioSelection,
|
|
697
|
+
handleMultiSelection: handleMultiSelection,
|
|
698
|
+
useRadioSelect: useRadioSelect,
|
|
699
|
+
useMultiSelect: useMultiSelect,
|
|
700
|
+
isRowSelected: isRowSelected
|
|
701
|
+
}),
|
|
702
|
+
baseColumns = _useTableColumns.columns;
|
|
703
|
+
|
|
704
|
+
// Add radio select or multiselect column if enabled and memoize with stable references
|
|
705
|
+
var columns = (0, _react.useMemo)(function () {
|
|
706
|
+
var selectionColumn = (0, _buildSelectionColumns.buildSelectionColumns)({
|
|
707
|
+
useRadioSelect: useRadioSelect,
|
|
708
|
+
useMultiSelect: useMultiSelect,
|
|
709
|
+
selectedRowIds: selectedRowIds,
|
|
710
|
+
handleRadioSelection: handleRadioSelection,
|
|
711
|
+
handleMultiSelection: handleMultiSelection,
|
|
712
|
+
handleSelectAll: handleSelectAll,
|
|
713
|
+
internalDataset: internalDataset,
|
|
714
|
+
radioselecttitle: radioselecttitle,
|
|
715
|
+
radioselectarialabel: radioselectarialabel,
|
|
716
|
+
multiselecttitle: multiselecttitle,
|
|
717
|
+
multiselectarialabel: multiselectarialabel,
|
|
718
|
+
tableName: name
|
|
719
|
+
});
|
|
720
|
+
if (selectionColumn) {
|
|
721
|
+
return [selectionColumn].concat((0, _toConsumableArray2["default"])(baseColumns));
|
|
722
|
+
}
|
|
723
|
+
return baseColumns;
|
|
724
|
+
}, [baseColumns, useRadioSelect, useMultiSelect, selectedRowIds, internalDataset, handleRadioSelection, handleMultiSelection, handleSelectAll, radioselecttitle, radioselectarialabel, multiselecttitle, multiselectarialabel, name]);
|
|
725
|
+
|
|
726
|
+
//column proxy changes
|
|
727
|
+
var columnsStateRef = (0, _react.useRef)(columns);
|
|
728
|
+
var parentFormColumns = (listener === null || listener === void 0 || (_listener$Widgets2 = listener.Widgets) === null || _listener$Widgets2 === void 0 || (_listener$Widgets2 = _listener$Widgets2[parentForm]) === null || _listener$Widgets2 === void 0 ? void 0 : _listener$Widgets2.dataoutput) || {};
|
|
729
|
+
var _useState7 = (0, _react.useState)([]),
|
|
730
|
+
summaryRowDefs = _useState7[0],
|
|
731
|
+
setSummaryRowDefs = _useState7[1];
|
|
732
|
+
var _useState8 = (0, _react.useState)(false),
|
|
733
|
+
summaryRowEnabled = _useState8[0],
|
|
734
|
+
setSummaryRowEnabled = _useState8[1];
|
|
735
|
+
var _useState9 = (0, _react.useState)([]),
|
|
736
|
+
summaryRowDefObjects = _useState9[0],
|
|
737
|
+
setSummaryRowDefObjects = _useState9[1];
|
|
738
|
+
// Store column show property for summary rows: [rowIndex][columnKey] => show boolean
|
|
739
|
+
var _useState0 = (0, _react.useState)({}),
|
|
740
|
+
summaryRowColumnShow = _useState0[0],
|
|
741
|
+
setSummaryRowColumnShow = _useState0[1];
|
|
742
|
+
var setSummaryRowDef = (0, _react.useCallback)(function (columnKey, data, rowIndex, refresh, show) {
|
|
743
|
+
setSummaryRowDefs(function (prev) {
|
|
744
|
+
var newDefs = (0, _toConsumableArray2["default"])(prev);
|
|
745
|
+
newDefs[rowIndex] = _objectSpread(_objectSpread({}, newDefs[rowIndex]), {}, (0, _defineProperty2["default"])({}, columnKey, data));
|
|
746
|
+
return newDefs;
|
|
747
|
+
});
|
|
748
|
+
setSummaryRowDefObjects(function (prev) {
|
|
749
|
+
var newObjs = (0, _toConsumableArray2["default"])(prev);
|
|
750
|
+
newObjs[rowIndex] = _objectSpread(_objectSpread({}, newObjs[rowIndex]), {}, (0, _defineProperty2["default"])({}, columnKey, data));
|
|
751
|
+
return newObjs;
|
|
752
|
+
});
|
|
753
|
+
// Store column's show property
|
|
754
|
+
if (show !== undefined) {
|
|
755
|
+
setSummaryRowColumnShow(function (prev) {
|
|
756
|
+
var newShow = _objectSpread({}, prev);
|
|
757
|
+
if (!newShow[rowIndex]) {
|
|
758
|
+
newShow[rowIndex] = {};
|
|
759
|
+
}
|
|
760
|
+
newShow[rowIndex] = _objectSpread(_objectSpread({}, newShow[rowIndex]), {}, (0, _defineProperty2["default"])({}, columnKey, show));
|
|
761
|
+
return newShow;
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
setSummaryRowEnabled(true);
|
|
765
|
+
}, []);
|
|
766
|
+
var columnsProxy = (0, _react.useMemo)(function () {
|
|
767
|
+
return (0, _columnProxy.createColumnsProxy)(wmTableColumns, applyOverride, setColumnsVersion, setSummaryRowDef);
|
|
768
|
+
}, [wmTableColumns, applyOverride, setColumnsVersion, setSummaryRowDef]);
|
|
769
|
+
var _useCustomExpressionC = (0, _hooks.useCustomExpressionColumns)({
|
|
770
|
+
columnSource: columnsProxy,
|
|
771
|
+
listenerRef: listenerRef
|
|
772
|
+
}),
|
|
773
|
+
customColumns = _useCustomExpressionC.customColumns,
|
|
774
|
+
customColumnsRevision = _useCustomExpressionC.customColumnsRevision,
|
|
775
|
+
customExpressionSignature = _useCustomExpressionC.customExpressionSignature,
|
|
776
|
+
mergeParsedCustomColumns = _useCustomExpressionC.mergeParsedCustomColumns;
|
|
777
|
+
columnsStateRef.current = columns;
|
|
778
|
+
var columnsForTable = (0, _react.useMemo)(function () {
|
|
779
|
+
var base = columnsStateRef.current || [];
|
|
780
|
+
return base.map(function (col) {
|
|
781
|
+
var field = col.accessorKey || col.id;
|
|
782
|
+
var override = field ? columnOverrides[field] || {} : {};
|
|
783
|
+
return _objectSpread(_objectSpread(_objectSpread({}, col), override), Object.keys(override).length > 0 ? {
|
|
784
|
+
meta: _objectSpread(_objectSpread({}, col.meta), override)
|
|
785
|
+
} : {});
|
|
786
|
+
});
|
|
787
|
+
}, [columns, columnOverrides, columnsVersion, editingRowId]);
|
|
788
|
+
|
|
789
|
+
// Compute class signature from columns meta.className to trigger header and body re-render on class updates
|
|
790
|
+
var ColClassSignature = (0, _react.useMemo)(function () {
|
|
791
|
+
try {
|
|
792
|
+
return (columnsForTable || []).map(function (col) {
|
|
793
|
+
var m = col === null || col === void 0 ? void 0 : col.meta;
|
|
794
|
+
return [m === null || m === void 0 ? void 0 : m.className, m === null || m === void 0 ? void 0 : m.colClass].map(function (v) {
|
|
795
|
+
return String(v !== null && v !== void 0 ? v : "");
|
|
796
|
+
}).join(":");
|
|
797
|
+
}).join("|");
|
|
798
|
+
} catch (_unused) {
|
|
799
|
+
return "";
|
|
800
|
+
}
|
|
801
|
+
}, [columnsForTable]);
|
|
802
|
+
|
|
803
|
+
// Use filter hook for filtering functionality
|
|
804
|
+
var _useTableFilter = (0, _hooks.useTableFilter)({
|
|
805
|
+
filterMode: filtermode,
|
|
806
|
+
columns: columnsForTable,
|
|
807
|
+
dataset: (navigation === "Scroll" || navigation === "On-Demand") && accumulatedData.length > 0 ? accumulatedData : internalDataset,
|
|
808
|
+
initialSearchState: initialSearchState
|
|
809
|
+
}),
|
|
810
|
+
globalFilter = _useTableFilter.globalFilter,
|
|
811
|
+
setGlobalFilterOriginal = _useTableFilter.setGlobalFilter,
|
|
812
|
+
globalSearchColumn = _useTableFilter.globalSearchColumn,
|
|
813
|
+
setGlobalSearchColumn = _useTableFilter.setGlobalSearchColumn,
|
|
814
|
+
columnFilters = _useTableFilter.columnFilters,
|
|
815
|
+
setColumnFilterOriginal = _useTableFilter.setColumnFilter,
|
|
816
|
+
filteredData = _useTableFilter.filteredData,
|
|
817
|
+
getFilterFields = _useTableFilter.getFilterFields,
|
|
818
|
+
transformFilterFields = _useTableFilter.transformFilterFields;
|
|
819
|
+
|
|
820
|
+
// Wrap filter setters to reset page when filters change
|
|
821
|
+
var setGlobalFilter = (0, _react.useCallback)(function (value) {
|
|
822
|
+
setGlobalFilterOriginal(value);
|
|
823
|
+
// Reset to first page when filter changes
|
|
824
|
+
setPaginationState(function (prev) {
|
|
825
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
826
|
+
pageIndex: 0
|
|
827
|
+
});
|
|
828
|
+
});
|
|
829
|
+
}, [setGlobalFilterOriginal]);
|
|
830
|
+
var setColumnFilter = (0, _react.useCallback)(function (columnId, value, matchMode) {
|
|
831
|
+
setColumnFilterOriginal(columnId, value, matchMode);
|
|
832
|
+
// Reset to first page when filter changes
|
|
833
|
+
setPaginationState(function (prev) {
|
|
834
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
835
|
+
pageIndex: 0
|
|
836
|
+
});
|
|
837
|
+
});
|
|
838
|
+
}, [setColumnFilterOriginal]);
|
|
839
|
+
|
|
840
|
+
// Use refs to track resizing state and debounce timer
|
|
841
|
+
var resizeTimeoutRef = (0, _react.useRef)(null);
|
|
842
|
+
|
|
843
|
+
// Memoize the column sizing change handler with smart resizing detection
|
|
844
|
+
var handleColumnSizingChange = (0, _react.useCallback)(function (updaterOrValue) {
|
|
845
|
+
// Only update resizing state if it's not already true
|
|
846
|
+
setIsResizing(function (prev) {
|
|
847
|
+
if (!prev) return true;
|
|
848
|
+
return prev;
|
|
849
|
+
});
|
|
850
|
+
setColumnSizing(updaterOrValue);
|
|
851
|
+
|
|
852
|
+
// Clear any existing timeout
|
|
853
|
+
if (resizeTimeoutRef.current) {
|
|
854
|
+
clearTimeout(resizeTimeoutRef.current);
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
// Set a debounced timeout to detect when resizing has stopped
|
|
858
|
+
resizeTimeoutRef.current = setTimeout(function () {
|
|
859
|
+
setIsResizing(false);
|
|
860
|
+
}, 150); // 150ms delay to detect when user stops resizing
|
|
861
|
+
}, []);
|
|
862
|
+
|
|
863
|
+
// Create custom row selection state for TanStack Table
|
|
864
|
+
// Uses unified selectedRowIds array - works for both radio select (1 item) and multiselect (multiple items)
|
|
865
|
+
var rowSelection = (0, _react.useMemo)(function () {
|
|
866
|
+
var selection = {};
|
|
867
|
+
selectedRowIds.forEach(function (id) {
|
|
868
|
+
selection[id] = true;
|
|
869
|
+
});
|
|
870
|
+
return selection;
|
|
871
|
+
}, [selectedRowIds]);
|
|
872
|
+
|
|
873
|
+
// Determine if we're using server-side sorting (same as server-side pagination)
|
|
874
|
+
var isServerSideSorting = isServerSidePagination();
|
|
875
|
+
|
|
876
|
+
// Use accumulated data for Scroll and On-Demand navigation, otherwise use normal dataset
|
|
877
|
+
var tableData = (0, _react.useMemo)(function () {
|
|
878
|
+
// For Scroll and On-Demand, use accumulated data from pagination
|
|
879
|
+
if ((navigation === "Scroll" || navigation === "On-Demand") && accumulatedData.length > 0) {
|
|
880
|
+
// For server-side pagination, don't apply client-side filtering as server already filters
|
|
881
|
+
return filtermode && !isServerSidePagination() ? filteredData : accumulatedData;
|
|
882
|
+
}
|
|
883
|
+
// For server-side pagination, use internalDataset directly (already filtered by server)
|
|
884
|
+
// Client-side filtering should only be applied for client-side pagination
|
|
885
|
+
return filtermode && !isServerSidePagination() ? filteredData : internalDataset;
|
|
886
|
+
}, [navigation, accumulatedData, filteredData, internalDataset, filtermode, isServerSidePagination]);
|
|
887
|
+
|
|
888
|
+
// Memoize pagination options to prevent unnecessary re-renders
|
|
889
|
+
var memoizedPagination = (0, _react.useMemo)(function () {
|
|
890
|
+
return {
|
|
891
|
+
pageSize: navigation === "None" ? (tableData === null || tableData === void 0 ? void 0 : tableData.length) || 0 : paginationState.pageSize,
|
|
892
|
+
pageIndex: paginationState.pageIndex
|
|
893
|
+
};
|
|
894
|
+
}, [navigation, tableData === null || tableData === void 0 ? void 0 : tableData.length, paginationState.pageSize, paginationState.pageIndex]);
|
|
895
|
+
var table = (0, _reactTable.useReactTable)({
|
|
896
|
+
data: tableData,
|
|
897
|
+
columns: columnsForTable,
|
|
898
|
+
state: {
|
|
899
|
+
sorting: sorting,
|
|
900
|
+
columnSizing: columnSizing,
|
|
901
|
+
rowSelection: rowSelection,
|
|
902
|
+
// Add row selection state
|
|
903
|
+
pagination: memoizedPagination
|
|
904
|
+
},
|
|
905
|
+
onSortingChange: handleSortingChange,
|
|
906
|
+
onColumnSizingChange: handleColumnSizingChange,
|
|
907
|
+
onPaginationChange: setPaginationState,
|
|
908
|
+
getCoreRowModel: (0, _reactTable.getCoreRowModel)(),
|
|
909
|
+
// Only use pagination model for client-side pagination
|
|
910
|
+
getPaginationRowModel: isServerSidePagination() ? undefined : (0, _reactTable.getPaginationRowModel)(),
|
|
911
|
+
// Use sorted row model only for client-side sorting
|
|
912
|
+
getSortedRowModel: isServerSideSorting ? undefined : (0, _reactTable.getSortedRowModel)(),
|
|
913
|
+
enableSorting: enablesort,
|
|
914
|
+
enableSortingRemoval: false,
|
|
915
|
+
autoResetPageIndex: false,
|
|
916
|
+
enableColumnResizing: true,
|
|
917
|
+
columnResizeMode: "onChange",
|
|
918
|
+
// Keep onChange for real-time visual feedback
|
|
919
|
+
enableRowSelection: true,
|
|
920
|
+
// Enable row selection
|
|
921
|
+
// Use manual pagination and sorting for server-side operations
|
|
922
|
+
manualPagination: isServerSidePagination(),
|
|
923
|
+
manualSorting: isServerSideSorting,
|
|
924
|
+
pageCount: isServerSidePagination() && datasource !== null && datasource !== void 0 && (_datasource$paginatio2 = datasource.pagination) !== null && _datasource$paginatio2 !== void 0 && _datasource$paginatio2.totalPages ? datasource.pagination.totalPages : undefined,
|
|
925
|
+
getRowId: function getRowId(row) {
|
|
926
|
+
return row._wmTableRowId || String(row.id) || (0, _lodashEs.uniqueId)("row_");
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
// Update the table ref
|
|
931
|
+
tableRef.current = table;
|
|
932
|
+
|
|
933
|
+
// Memoize filter fields to prevent unnecessary re-renders in useServerSideSorting
|
|
934
|
+
var memoizedFilterFields = (0, _react.useMemo)(function () {
|
|
935
|
+
if (!filtermode) return {};
|
|
936
|
+
var searchObj = filtermode === "search" ? [{
|
|
937
|
+
field: globalSearchColumn,
|
|
938
|
+
value: globalFilter,
|
|
939
|
+
matchMode: "anywhereignorecase",
|
|
940
|
+
type: "string"
|
|
941
|
+
}] : transformFilterFields(columnFilters);
|
|
942
|
+
return getFilterFields(searchObj);
|
|
943
|
+
}, [filtermode, globalSearchColumn, globalFilter, columnFilters, getFilterFields, transformFilterFields]);
|
|
944
|
+
|
|
945
|
+
// Memoize logical operator
|
|
946
|
+
var memoizedLogicalOp = (0, _react.useMemo)(function () {
|
|
947
|
+
return filtermode === "search" && !globalSearchColumn ? "OR" : "AND";
|
|
948
|
+
}, [filtermode, globalSearchColumn]);
|
|
949
|
+
|
|
950
|
+
// Use server-side sorting hook to handle data fetching
|
|
951
|
+
(0, _hooks.useServerSideSorting)({
|
|
952
|
+
datasource: datasource,
|
|
953
|
+
sorting: sorting,
|
|
954
|
+
setInternalDataset: setInternalDataset,
|
|
955
|
+
showToast: showToast,
|
|
956
|
+
isServerSidePagination: isServerSidePagination(),
|
|
957
|
+
pageIndex: table.getState().pagination.pageIndex,
|
|
958
|
+
onError: onError,
|
|
959
|
+
onBeforefilter: onBeforefilter,
|
|
960
|
+
filterFields: memoizedFilterFields,
|
|
961
|
+
logicalOp: memoizedLogicalOp,
|
|
962
|
+
listener: listener,
|
|
963
|
+
name: name
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
// Panel structure management
|
|
967
|
+
var _usePanelStructure = (0, _hooks.usePanelStructure)({
|
|
968
|
+
title: title,
|
|
969
|
+
subheading: subheading,
|
|
970
|
+
iconclass: iconclass,
|
|
971
|
+
exportformat: exportformat,
|
|
972
|
+
headerActions: headerActions,
|
|
973
|
+
footerActions: footerActions,
|
|
974
|
+
shownavigation: shownavigation,
|
|
975
|
+
onDemandLoad: onDemandLoad,
|
|
976
|
+
internalDataset: internalDataset,
|
|
977
|
+
pagesize: pagesize,
|
|
978
|
+
allowpagesizechange: allowpagesizechange,
|
|
979
|
+
datasource: datasource,
|
|
980
|
+
showrecordcount: showrecordcount
|
|
981
|
+
}),
|
|
982
|
+
showPanelHeading = _usePanelStructure.showPanelHeading,
|
|
983
|
+
showPagination = _usePanelStructure.showPagination;
|
|
984
|
+
|
|
985
|
+
// Callback: when pagination widget is ready, set table.dataNavigator = pagination widget proxy
|
|
986
|
+
var handlePaginationWidgetReady = (0, _react.useCallback)(function (paginationWidget) {
|
|
987
|
+
var _listener$Widgets3;
|
|
988
|
+
if (name && listener !== null && listener !== void 0 && (_listener$Widgets3 = listener.Widgets) !== null && _listener$Widgets3 !== void 0 && _listener$Widgets3[name]) {
|
|
989
|
+
listener.Widgets[name].dataNavigator = paginationWidget;
|
|
990
|
+
}
|
|
991
|
+
}, [name, listener]);
|
|
992
|
+
|
|
993
|
+
// Memoize sortInfo for export to prevent unnecessary re-renders
|
|
994
|
+
var sortInfoForExport = (0, _react.useMemo)(function () {
|
|
995
|
+
if (sorting.length > 0) {
|
|
996
|
+
return {
|
|
997
|
+
field: sorting[0].id,
|
|
998
|
+
direction: sorting[0].desc ? "desc" : "asc"
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
return undefined;
|
|
1002
|
+
}, [sorting]);
|
|
1003
|
+
|
|
1004
|
+
// Update grid edit mode (includes inline editing and add new row)
|
|
1005
|
+
var isGridEditModeComplete = isAddingNewRow || editingRowId !== null;
|
|
1006
|
+
|
|
1007
|
+
// Generate spacing-related classes based on spacing prop
|
|
1008
|
+
var spacingClasses = (0, _utils.getSpacingClasses)(spacing);
|
|
1009
|
+
|
|
1010
|
+
// ==================== STATE MANAGEMENT ====================
|
|
1011
|
+
// Prepare filter data based on filter mode - always in array format
|
|
1012
|
+
var filterDataForState = (0, _react.useMemo)(function () {
|
|
1013
|
+
if (!filtermode) return undefined;
|
|
1014
|
+
if (filtermode === "search") {
|
|
1015
|
+
if (globalFilter || globalSearchColumn) {
|
|
1016
|
+
// Find column type for the selected search column
|
|
1017
|
+
var columnType = globalSearchColumn ? function (_col$meta, _col$meta2) {
|
|
1018
|
+
var col = (0, _lodashEs.find)(columnsForTable, function (c) {
|
|
1019
|
+
var column = c;
|
|
1020
|
+
return column.accessorKey === globalSearchColumn || column.id === globalSearchColumn;
|
|
1021
|
+
});
|
|
1022
|
+
return (col === null || col === void 0 || (_col$meta = col.meta) === null || _col$meta === void 0 ? void 0 : _col$meta.type) || (col === null || col === void 0 || (_col$meta2 = col.meta) === null || _col$meta2 === void 0 ? void 0 : _col$meta2.editinputtype) || "string";
|
|
1023
|
+
}() : "string";
|
|
1024
|
+
return [{
|
|
1025
|
+
field: globalSearchColumn || "",
|
|
1026
|
+
value: globalFilter,
|
|
1027
|
+
matchMode: "anywhereignorecase",
|
|
1028
|
+
type: columnType
|
|
1029
|
+
}];
|
|
1030
|
+
}
|
|
1031
|
+
} else if (filtermode === "multicolumn") {
|
|
1032
|
+
var activeFilters = Object.entries(columnFilters).filter(function (_ref) {
|
|
1033
|
+
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
1034
|
+
_ = _ref2[0],
|
|
1035
|
+
filter = _ref2[1];
|
|
1036
|
+
return filter.value;
|
|
1037
|
+
}).map(function (_ref3) {
|
|
1038
|
+
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
1039
|
+
field = _ref4[0],
|
|
1040
|
+
filter = _ref4[1];
|
|
1041
|
+
// Find column type for each field
|
|
1042
|
+
var columnType = function (_col$meta3, _col$meta4) {
|
|
1043
|
+
var col = (0, _lodashEs.find)(columnsForTable, function (c) {
|
|
1044
|
+
var column = c;
|
|
1045
|
+
return column.accessorKey === field || column.id === field;
|
|
1046
|
+
});
|
|
1047
|
+
return (col === null || col === void 0 || (_col$meta3 = col.meta) === null || _col$meta3 === void 0 ? void 0 : _col$meta3.type) || (col === null || col === void 0 || (_col$meta4 = col.meta) === null || _col$meta4 === void 0 ? void 0 : _col$meta4.editinputtype) || "string";
|
|
1048
|
+
}();
|
|
1049
|
+
return {
|
|
1050
|
+
field: field,
|
|
1051
|
+
value: filter.value,
|
|
1052
|
+
matchMode: filter.matchMode,
|
|
1053
|
+
type: columnType
|
|
1054
|
+
};
|
|
1055
|
+
});
|
|
1056
|
+
return activeFilters.length > 0 ? activeFilters : undefined;
|
|
1057
|
+
}
|
|
1058
|
+
return undefined;
|
|
1059
|
+
}, [filtermode, globalFilter, globalSearchColumn, columnFilters, columnsForTable]);
|
|
1060
|
+
|
|
1061
|
+
// Convert TanStack Table sorting state to our format
|
|
1062
|
+
var sortDataForState = (0, _react.useMemo)(function () {
|
|
1063
|
+
if (sorting.length > 0) {
|
|
1064
|
+
var firstSort = sorting[0]; // We only support single column sorting for state persistence
|
|
1065
|
+
return {
|
|
1066
|
+
field: firstSort.id,
|
|
1067
|
+
direction: firstSort.desc ? "desc" : "asc"
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
return undefined;
|
|
1071
|
+
}, [sorting]);
|
|
1072
|
+
var stateManager = (0, _hooks.useTableStateManager)({
|
|
1073
|
+
name: name,
|
|
1074
|
+
storage: effectiveStateHandler,
|
|
1075
|
+
currentPage: table.getState().pagination.pageIndex + 1,
|
|
1076
|
+
currentPageSize: table.getState().pagination.pageSize,
|
|
1077
|
+
selectedRowIds: selectedRowIds,
|
|
1078
|
+
internalDataset: internalDataset,
|
|
1079
|
+
initialActualPageSize: initialActualPageSize,
|
|
1080
|
+
datasource: datasource,
|
|
1081
|
+
multiselect: effectiveMultiselect,
|
|
1082
|
+
filterData: filterDataForState,
|
|
1083
|
+
sortData: sortDataForState,
|
|
1084
|
+
navigation: navigation,
|
|
1085
|
+
isStateConfigured: effectiveStateHandler !== undefined && effectiveStateHandler !== "none",
|
|
1086
|
+
defaultPageSize: initialPageSize,
|
|
1087
|
+
initialSortState: initialSortState,
|
|
1088
|
+
initialFilterState: initialSearchState
|
|
1089
|
+
});
|
|
1090
|
+
|
|
1091
|
+
// Enhanced page size change handler with state persistence
|
|
1092
|
+
var handlePageSizeChange = (0, _react.useCallback)(function (newPageSize) {
|
|
1093
|
+
// Get old page size before updating for state persistence
|
|
1094
|
+
var oldPageSize = paginationState.pageSize;
|
|
1095
|
+
|
|
1096
|
+
// Call base handler from hook
|
|
1097
|
+
handlePageSizeChangeBase(newPageSize);
|
|
1098
|
+
|
|
1099
|
+
// Skip state persistence for Scroll navigation
|
|
1100
|
+
if (navigation !== "Scroll") {
|
|
1101
|
+
// Get current persisted state to access all selected items across pages
|
|
1102
|
+
var currentPersistedState = (0, _utils.getTableState)(name, effectiveStateHandler);
|
|
1103
|
+
|
|
1104
|
+
// Build the state for page size change
|
|
1105
|
+
var newState = stateManager.getStateForPageSizeChange(newPageSize, currentPersistedState === null || currentPersistedState === void 0 ? void 0 : currentPersistedState.selectedItem, oldPageSize // Pass the old page size
|
|
1106
|
+
);
|
|
1107
|
+
|
|
1108
|
+
// Clear the existing state first to avoid merge issues with setWidgetState
|
|
1109
|
+
(0, _utils.clearTableState)(name, effectiveStateHandler);
|
|
1110
|
+
|
|
1111
|
+
// Only save if there's something to save (not in default state)
|
|
1112
|
+
if (Object.keys(newState).length > 0) {
|
|
1113
|
+
// If pagesize equals default, remove it from the state
|
|
1114
|
+
if (newPageSize === initialPageSize) {
|
|
1115
|
+
delete newState.pagesize;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
// Only save if there are still properties after removing default pagesize
|
|
1119
|
+
if (Object.keys(newState).length > 0) {
|
|
1120
|
+
(0, _utils.saveTableState)(name, effectiveStateHandler, newState);
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}, [handlePageSizeChangeBase, name, effectiveStateHandler, stateManager, initialPageSize, navigation]);
|
|
1125
|
+
|
|
1126
|
+
// slectPageSize callback fix
|
|
1127
|
+
var selectPageSize = (0, _react.useCallback)(function (pagesize) {
|
|
1128
|
+
if (!allowpagesizechange && !pagesize) return;
|
|
1129
|
+
var pageSizeOptions = (pagesizeoptions || "5,10,20,50,100").split(",").map(function (v) {
|
|
1130
|
+
return Number(v.trim());
|
|
1131
|
+
}).filter(function (n) {
|
|
1132
|
+
return !Number.isNaN(n);
|
|
1133
|
+
}).sort(function (a, b) {
|
|
1134
|
+
return a - b;
|
|
1135
|
+
});
|
|
1136
|
+
if (pageSizeOptions.length === 0) return;
|
|
1137
|
+
var nv = Number(pagesize);
|
|
1138
|
+
var clamped = nv < pageSizeOptions[0] || nv > pageSizeOptions[pageSizeOptions.length - 1] || !pageSizeOptions.includes(nv) ? pageSizeOptions[0] : nv;
|
|
1139
|
+
handlePageSizeChange(clamped);
|
|
1140
|
+
// Broadcast so other tabs with same name (e.g. first/active tab) also get the script's value
|
|
1141
|
+
if (effectiveStorageKey !== name) {
|
|
1142
|
+
(0, _scriptPageSizeBroadcast.broadcastScriptPageSize)(name, effectiveStorageKey, clamped);
|
|
1143
|
+
}
|
|
1144
|
+
}, [allowpagesizechange, pagesizeoptions, handlePageSizeChange, effectiveStorageKey, name]);
|
|
1145
|
+
|
|
1146
|
+
// Subscribe to script page size broadcast - when script calls selectPageSize on another tab,
|
|
1147
|
+
// we receive the value and update (fixes first tab showing 20 when script targeted last tab)
|
|
1148
|
+
(0, _react.useEffect)(function () {
|
|
1149
|
+
if (effectiveStorageKey === name) return;
|
|
1150
|
+
return (0, _scriptPageSizeBroadcast.subscribeToScriptPageSizeBroadcast)(name, effectiveStorageKey, function (value) {
|
|
1151
|
+
// Receiving tab must set pageSize so remount uses correct initialPageSize
|
|
1152
|
+
handlePageSizeChange(value);
|
|
1153
|
+
});
|
|
1154
|
+
}, [name, effectiveStorageKey, handlePageSizeChange]);
|
|
1155
|
+
|
|
1156
|
+
// Call data render callbacks for dynamic tables or when data changes
|
|
1157
|
+
(0, _react.useEffect)(function () {
|
|
1158
|
+
// For dynamic tables, call callbacks when we have data
|
|
1159
|
+
// For static tables, call callbacks when we have both data and columns
|
|
1160
|
+
var shouldCallCallbacks = isDynamicTable ? internalDataset.length > 0 : internalDataset.length > 0 && wmTableColumns.length > 0;
|
|
1161
|
+
if (shouldCallCallbacks) {
|
|
1162
|
+
var currentPageIndex = table.getState().pagination.pageIndex;
|
|
1163
|
+
|
|
1164
|
+
// Update the tracked page index
|
|
1165
|
+
prevPageIndexRef.current = currentPageIndex;
|
|
1166
|
+
|
|
1167
|
+
// Only call callbacks if data has actually changed
|
|
1168
|
+
if (!(0, _lodashEs.isEqual)(prevDatasetRef.current, internalDataset)) {
|
|
1169
|
+
prevDatasetRef.current = internalDataset;
|
|
1170
|
+
|
|
1171
|
+
// Call onBeforedatarender callback
|
|
1172
|
+
if (onBeforedatarender) {
|
|
1173
|
+
var _listener$Widgets4;
|
|
1174
|
+
onBeforedatarender(listener === null || listener === void 0 || (_listener$Widgets4 = listener.Widgets) === null || _listener$Widgets4 === void 0 ? void 0 : _listener$Widgets4[name],
|
|
1175
|
+
// widget reference
|
|
1176
|
+
internalDataset,
|
|
1177
|
+
// data
|
|
1178
|
+
columnsProxy // columns (including dynamic ones)
|
|
1179
|
+
);
|
|
1180
|
+
var customExprKeys = Object.keys(columnsProxy).filter(function (key) {
|
|
1181
|
+
return columnsProxy[key].customExpression;
|
|
1182
|
+
});
|
|
1183
|
+
if (customExprKeys.length > 0) {
|
|
1184
|
+
void mergeParsedCustomColumns()["finally"](function () {});
|
|
1185
|
+
}
|
|
1186
|
+
var nextRows = internalDataset.map(function (r) {
|
|
1187
|
+
return (0, _typeof2["default"])(r) === "object" && r !== null ? _objectSpread({}, r) : r;
|
|
1188
|
+
});
|
|
1189
|
+
setInternalDataset(nextRows);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
// Schedule onDatarender callback after rendering is complete
|
|
1193
|
+
// Use requestAnimationFrame to ensure DOM is fully painted
|
|
1194
|
+
requestAnimationFrame(function () {
|
|
1195
|
+
if (onDatarender) {
|
|
1196
|
+
var _listener$Widgets5;
|
|
1197
|
+
if (name && listener !== null && listener !== void 0 && listener.Widgets[name] && tableContainerRef.current) {
|
|
1198
|
+
listener.Widgets[name].nativeElement = tableContainerRef.current;
|
|
1199
|
+
}
|
|
1200
|
+
onDatarender(listener === null || listener === void 0 || (_listener$Widgets5 = listener.Widgets) === null || _listener$Widgets5 === void 0 ? void 0 : _listener$Widgets5[name],
|
|
1201
|
+
// widget reference to match Angular format
|
|
1202
|
+
{
|
|
1203
|
+
$data: internalDataset,
|
|
1204
|
+
data: internalDataset
|
|
1205
|
+
} // match Angular's format with both $data and data
|
|
1206
|
+
);
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}, [internalDataset, wmTableColumns, onBeforedatarender, onDatarender, name, isDynamicTable, table.getState().pagination.pageIndex, setInternalDataset, columnsProxy, mergeParsedCustomColumns]);
|
|
1212
|
+
|
|
1213
|
+
// Re-parse when custom-expression markup signature changes, or when rows appear after empty dataset.
|
|
1214
|
+
(0, _react.useEffect)(function () {
|
|
1215
|
+
if (!onBeforedatarender) return;
|
|
1216
|
+
if (internalDataset.length === 0) return;
|
|
1217
|
+
void mergeParsedCustomColumns();
|
|
1218
|
+
}, [customExpressionSignature, mergeParsedCustomColumns, onBeforedatarender, internalDataset.length]);
|
|
1219
|
+
// Use table initialization hook
|
|
1220
|
+
(0, _hooks.useTableInitialization)({
|
|
1221
|
+
internalDataset: internalDataset,
|
|
1222
|
+
wmTableColumns: wmTableColumnsWithOverrides,
|
|
1223
|
+
cellState: cellState,
|
|
1224
|
+
gridfirstrowselect: gridfirstrowselect,
|
|
1225
|
+
useRadioSelect: useRadioSelect,
|
|
1226
|
+
useMultiSelect: useMultiSelect,
|
|
1227
|
+
setActiveRow: setActiveRow,
|
|
1228
|
+
selectedRowIds: selectedRowIds,
|
|
1229
|
+
formName: formName,
|
|
1230
|
+
editmode: editmode,
|
|
1231
|
+
activeRowIds: activeRowIds,
|
|
1232
|
+
listener: listener
|
|
1233
|
+
});
|
|
1234
|
+
|
|
1235
|
+
// Use table effects hook for state persistence
|
|
1236
|
+
var _useTableEffects = (0, _hooks.useTableEffects)({
|
|
1237
|
+
name: name,
|
|
1238
|
+
navigation: navigation,
|
|
1239
|
+
datasource: datasource,
|
|
1240
|
+
internalDataset: internalDataset,
|
|
1241
|
+
statehandler: effectiveStateHandler,
|
|
1242
|
+
selectedRowIds: selectedRowIds,
|
|
1243
|
+
currentPage: table.getState().pagination.pageIndex + 1,
|
|
1244
|
+
// Convert to 1-based
|
|
1245
|
+
currentPageSize: table.getState().pagination.pageSize,
|
|
1246
|
+
sorting: sorting,
|
|
1247
|
+
isGridEditMode: isGridEditModeComplete,
|
|
1248
|
+
stateManager: stateManager,
|
|
1249
|
+
initialActualPageSize: initialActualPageSize
|
|
1250
|
+
}),
|
|
1251
|
+
restoredPageNumber = _useTableEffects.restoredPageNumber,
|
|
1252
|
+
restoredSelectedIndices = _useTableEffects.restoredSelectedIndices,
|
|
1253
|
+
setIsRestoringSelection = _useTableEffects.setIsRestoringSelection;
|
|
1254
|
+
|
|
1255
|
+
// Apply restored state
|
|
1256
|
+
(0, _react.useEffect)(function () {
|
|
1257
|
+
if (restoredPageNumber !== null && restoredPageNumber > 1) {
|
|
1258
|
+
// Set the restored page (convert to 0-based index)
|
|
1259
|
+
table.setPageIndex(restoredPageNumber - 1);
|
|
1260
|
+
}
|
|
1261
|
+
}, [restoredPageNumber, table]);
|
|
1262
|
+
|
|
1263
|
+
// Track if we've already restored selection to avoid loops
|
|
1264
|
+
var hasRestoredSelectionRef = (0, _react.useRef)(false);
|
|
1265
|
+
(0, _react.useEffect)(function () {
|
|
1266
|
+
if (restoredSelectedIndices.length > 0 && internalDataset.length > 0 && !hasRestoredSelectionRef.current) {
|
|
1267
|
+
// Mark as restored to prevent running again
|
|
1268
|
+
hasRestoredSelectionRef.current = true;
|
|
1269
|
+
|
|
1270
|
+
// Set flag to prevent saving while restoring
|
|
1271
|
+
setIsRestoringSelection(true);
|
|
1272
|
+
|
|
1273
|
+
// Apply restored selections by converting indices to row IDs
|
|
1274
|
+
if (useMultiSelect) {
|
|
1275
|
+
// For multiselect, set all restored items by index
|
|
1276
|
+
var _selectedRowIds = [];
|
|
1277
|
+
restoredSelectedIndices.forEach(function (index) {
|
|
1278
|
+
if (index >= 0 && index < internalDataset.length) {
|
|
1279
|
+
var row = internalDataset[index];
|
|
1280
|
+
if (row && row._wmTableRowId) {
|
|
1281
|
+
handleMultiSelection(row._wmTableRowId, row, true);
|
|
1282
|
+
// Collect all selected row IDs
|
|
1283
|
+
_selectedRowIds.push(row._wmTableRowId);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
});
|
|
1287
|
+
// Set all selected rows as active
|
|
1288
|
+
if (_selectedRowIds.length > 0) {
|
|
1289
|
+
setActiveRow(_selectedRowIds);
|
|
1290
|
+
}
|
|
1291
|
+
} else {
|
|
1292
|
+
// For radio select or default mode (single selection), only restore the first selection
|
|
1293
|
+
var firstIndex = restoredSelectedIndices[0];
|
|
1294
|
+
if (firstIndex >= 0 && firstIndex < internalDataset.length) {
|
|
1295
|
+
var row = internalDataset[firstIndex];
|
|
1296
|
+
if (row && row._wmTableRowId) {
|
|
1297
|
+
handleRadioSelection(row._wmTableRowId, row);
|
|
1298
|
+
// Also set as active row for single selection
|
|
1299
|
+
setActiveRow(row._wmTableRowId);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
// Reset flag after restoration is complete
|
|
1305
|
+
setTimeout(function () {
|
|
1306
|
+
setIsRestoringSelection(false);
|
|
1307
|
+
}, 0);
|
|
1308
|
+
}
|
|
1309
|
+
}, [restoredSelectedIndices, internalDataset, useMultiSelect, handleMultiSelection, handleRadioSelection, setIsRestoringSelection]);
|
|
1310
|
+
|
|
1311
|
+
// Cleanup resize timeout on unmount and when component updates
|
|
1312
|
+
(0, _react.useEffect)(function () {
|
|
1313
|
+
var currentTimeout = resizeTimeoutRef.current;
|
|
1314
|
+
return function () {
|
|
1315
|
+
if (currentTimeout) {
|
|
1316
|
+
clearTimeout(currentTimeout);
|
|
1317
|
+
}
|
|
1318
|
+
};
|
|
1319
|
+
}, []);
|
|
1320
|
+
|
|
1321
|
+
// Create wrapper functions for external API
|
|
1322
|
+
var editRow = (0, _react.useCallback)(function (event, widget, row) {
|
|
1323
|
+
if (!row || !row._wmTableRowId) {
|
|
1324
|
+
console.warn("Invalid row data provided to editRow");
|
|
1325
|
+
return;
|
|
1326
|
+
}
|
|
1327
|
+
startEditing(row, row._wmTableRowId);
|
|
1328
|
+
}, [startEditing]);
|
|
1329
|
+
var deleteRow = (0, _react.useCallback)(/*#__PURE__*/function () {
|
|
1330
|
+
var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(event, widget, row) {
|
|
1331
|
+
var _listener$Widgets6, cleanedRow, rowIndex, result;
|
|
1332
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
1333
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1334
|
+
case 0:
|
|
1335
|
+
if (row) {
|
|
1336
|
+
_context.next = 3;
|
|
1337
|
+
break;
|
|
1338
|
+
}
|
|
1339
|
+
console.warn("Invalid row data provided to deleteRow");
|
|
1340
|
+
return _context.abrupt("return");
|
|
1341
|
+
case 3:
|
|
1342
|
+
if (!onBeforerowdelete) {
|
|
1343
|
+
_context.next = 11;
|
|
1344
|
+
break;
|
|
1345
|
+
}
|
|
1346
|
+
cleanedRow = (0, _utils.cleanRowData)([row])[0];
|
|
1347
|
+
rowIndex = internalDataset.findIndex(function (r) {
|
|
1348
|
+
return r._wmTableRowId === row._wmTableRowId || r.id !== undefined && r.id === row.id;
|
|
1349
|
+
});
|
|
1350
|
+
_context.next = 8;
|
|
1351
|
+
return onBeforerowdelete(event, listener === null || listener === void 0 || (_listener$Widgets6 = listener.Widgets) === null || _listener$Widgets6 === void 0 ? void 0 : _listener$Widgets6[name], cleanedRow, {
|
|
1352
|
+
rowIndex: rowIndex,
|
|
1353
|
+
data: cleanedRow
|
|
1354
|
+
});
|
|
1355
|
+
case 8:
|
|
1356
|
+
result = _context.sent;
|
|
1357
|
+
if (!(result === false)) {
|
|
1358
|
+
_context.next = 11;
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1361
|
+
return _context.abrupt("return");
|
|
1362
|
+
case 11:
|
|
1363
|
+
_deleteRecord(row, tableRef.current);
|
|
1364
|
+
case 12:
|
|
1365
|
+
case "end":
|
|
1366
|
+
return _context.stop();
|
|
1367
|
+
}
|
|
1368
|
+
}, _callee);
|
|
1369
|
+
}));
|
|
1370
|
+
return function (_x, _x2, _x3) {
|
|
1371
|
+
return _ref5.apply(this, arguments);
|
|
1372
|
+
};
|
|
1373
|
+
}(), [_deleteRecord, onBeforerowdelete, listener, name, internalDataset]);
|
|
1374
|
+
|
|
1375
|
+
// Refresh table data
|
|
1376
|
+
var refresh = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
1377
|
+
var newData,
|
|
1378
|
+
_datasource$paginatio3,
|
|
1379
|
+
currentTable,
|
|
1380
|
+
targetPage,
|
|
1381
|
+
currentPageSize,
|
|
1382
|
+
shouldNavigateToLastPage,
|
|
1383
|
+
totalElements,
|
|
1384
|
+
totalAfterAdd,
|
|
1385
|
+
lastPage,
|
|
1386
|
+
response,
|
|
1387
|
+
dataWithIds,
|
|
1388
|
+
_listener$Widgets7,
|
|
1389
|
+
_args2 = arguments;
|
|
1390
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
1391
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1392
|
+
case 0:
|
|
1393
|
+
newData = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : false;
|
|
1394
|
+
if (datasource) {
|
|
1395
|
+
_context2.next = 4;
|
|
1396
|
+
break;
|
|
1397
|
+
}
|
|
1398
|
+
console.warn("No datasource available for refresh");
|
|
1399
|
+
return _context2.abrupt("return");
|
|
1400
|
+
case 4:
|
|
1401
|
+
_context2.prev = 4;
|
|
1402
|
+
// Use tableRef.current to access the latest table instance
|
|
1403
|
+
currentTable = tableRef.current;
|
|
1404
|
+
if (currentTable) {
|
|
1405
|
+
_context2.next = 9;
|
|
1406
|
+
break;
|
|
1407
|
+
}
|
|
1408
|
+
console.warn("Table instance not available");
|
|
1409
|
+
return _context2.abrupt("return");
|
|
1410
|
+
case 9:
|
|
1411
|
+
targetPage = currentTable.getState().pagination.pageIndex + 1;
|
|
1412
|
+
currentPageSize = ((_datasource$paginatio3 = datasource.pagination) === null || _datasource$paginatio3 === void 0 ? void 0 : _datasource$paginatio3.size) || currentTable.getState().pagination.pageSize;
|
|
1413
|
+
shouldNavigateToLastPage = false; // If newData is true and we have pagination metadata, calculate the last page
|
|
1414
|
+
if (newData && datasource.pagination) {
|
|
1415
|
+
totalElements = datasource.pagination.totalElements;
|
|
1416
|
+
if (totalElements !== undefined && currentPageSize > 0) {
|
|
1417
|
+
// Calculate the last page
|
|
1418
|
+
// For example: 15 elements with page size 5 = 3 pages
|
|
1419
|
+
// Adding 1 element makes it 16 elements = 4 pages (since page 3 is full)
|
|
1420
|
+
totalAfterAdd = totalElements + 1;
|
|
1421
|
+
lastPage = Math.ceil(totalAfterAdd / currentPageSize);
|
|
1422
|
+
targetPage = lastPage;
|
|
1423
|
+
shouldNavigateToLastPage = true;
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
// For server-side pagination, use datasource invoke
|
|
1428
|
+
if (!isServerSidePagination()) {
|
|
1429
|
+
_context2.next = 20;
|
|
1430
|
+
break;
|
|
1431
|
+
}
|
|
1432
|
+
_context2.next = 16;
|
|
1433
|
+
return (0, _crudHandlers.refreshDataSource)(datasource, {
|
|
1434
|
+
page: targetPage,
|
|
1435
|
+
pagesize: currentPageSize,
|
|
1436
|
+
filterFields: memoizedFilterFields || {},
|
|
1437
|
+
condition: memoizedLogicalOp
|
|
1438
|
+
});
|
|
1439
|
+
case 16:
|
|
1440
|
+
response = _context2.sent;
|
|
1441
|
+
// The datasource should update its data property automatically
|
|
1442
|
+
// which will trigger a re-render through the dataset prop
|
|
1443
|
+
if (response && response.data) {
|
|
1444
|
+
dataWithIds = (0, _utils.addUniqueRowIds)(response.data);
|
|
1445
|
+
setInternalDataset(dataWithIds);
|
|
1446
|
+
|
|
1447
|
+
// Set the table to the last page AFTER data is loaded
|
|
1448
|
+
if (shouldNavigateToLastPage) {
|
|
1449
|
+
// Use requestAnimationFrame for better performance than setTimeout
|
|
1450
|
+
requestAnimationFrame(function () {
|
|
1451
|
+
currentTable.setPageIndex(targetPage);
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
_context2.next = 21;
|
|
1456
|
+
break;
|
|
1457
|
+
case 20:
|
|
1458
|
+
// For client-side pagination, just set the page index
|
|
1459
|
+
if (shouldNavigateToLastPage) {
|
|
1460
|
+
currentTable.setPageIndex(targetPage);
|
|
1461
|
+
}
|
|
1462
|
+
case 21:
|
|
1463
|
+
_context2.next = 28;
|
|
1464
|
+
break;
|
|
1465
|
+
case 23:
|
|
1466
|
+
_context2.prev = 23;
|
|
1467
|
+
_context2.t0 = _context2["catch"](4);
|
|
1468
|
+
console.error("Error refreshing table data:", _context2.t0);
|
|
1469
|
+
if (showToast) {
|
|
1470
|
+
showToast("Failed to refresh table data", "Error");
|
|
1471
|
+
}
|
|
1472
|
+
if (onError) {
|
|
1473
|
+
onError(null, listener === null || listener === void 0 || (_listener$Widgets7 = listener.Widgets) === null || _listener$Widgets7 === void 0 ? void 0 : _listener$Widgets7[name], _context2.t0, "refresh");
|
|
1474
|
+
}
|
|
1475
|
+
case 28:
|
|
1476
|
+
case "end":
|
|
1477
|
+
return _context2.stop();
|
|
1478
|
+
}
|
|
1479
|
+
}, _callee2, null, [[4, 23]]);
|
|
1480
|
+
})), [datasource, isServerSidePagination(), setInternalDataset, showToast, onError, name]); // Removed 'table' from dependencies to prevent recreation
|
|
1481
|
+
|
|
1482
|
+
var tableApis = {
|
|
1483
|
+
columns: columnsProxy,
|
|
1484
|
+
addNewRow: handleAddNewRowClick,
|
|
1485
|
+
editRow: editRow,
|
|
1486
|
+
deleteRow: deleteRow,
|
|
1487
|
+
refresh: refresh,
|
|
1488
|
+
datasource: datasource,
|
|
1489
|
+
dataset: dataset,
|
|
1490
|
+
selectPageSize: selectPageSize,
|
|
1491
|
+
rowDefInstances: rowDefInstances
|
|
1492
|
+
};
|
|
1493
|
+
|
|
1494
|
+
// Keep the sync-selected-items implementation up-to-date every render so that
|
|
1495
|
+
// the stable onSyncSelectedItems callback (passed to useRowSelection) always has
|
|
1496
|
+
// access to the latest tableApis / internalDataset / listener values.
|
|
1497
|
+
syncSelectedItemsImplRef.current = function (newSelectedIds) {
|
|
1498
|
+
if (!(listener !== null && listener !== void 0 && listener.onChange)) return;
|
|
1499
|
+
var getRowId = function getRowId(row) {
|
|
1500
|
+
return row._wmTableRowId || String(row.id);
|
|
1501
|
+
};
|
|
1502
|
+
var selectedRows = internalDataset.filter(function (row) {
|
|
1503
|
+
return newSelectedIds.includes(getRowId(row));
|
|
1504
|
+
});
|
|
1505
|
+
var selectedItems = (0, _utils.cleanRowData)(selectedRows);
|
|
1506
|
+
if (!(0, _lodashEs.isEqual)(prevSelectedRow.current, selectedItems)) {
|
|
1507
|
+
prevSelectedRow.current = selectedItems;
|
|
1508
|
+
if (tableApisRegistered.current) {
|
|
1509
|
+
listener.onChange(widgetRegistrationKey, {
|
|
1510
|
+
selectedItems: selectedItems
|
|
1511
|
+
});
|
|
1512
|
+
} else {
|
|
1513
|
+
tableApisRegistered.current = true;
|
|
1514
|
+
listener.onChange(widgetRegistrationKey, _objectSpread(_objectSpread({}, tableApis), {}, {
|
|
1515
|
+
selectedItems: selectedItems
|
|
1516
|
+
}));
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
};
|
|
1520
|
+
|
|
1521
|
+
// Register table with parent form's formWidgets when parentForm is present
|
|
1522
|
+
(0, _react.useEffect)(function () {
|
|
1523
|
+
var _listener$Widgets8;
|
|
1524
|
+
if (parentForm && name && listener !== null && listener !== void 0 && (_listener$Widgets8 = listener.Widgets) !== null && _listener$Widgets8 !== void 0 && _listener$Widgets8[parentForm]) {
|
|
1525
|
+
var _listener$Widgets9;
|
|
1526
|
+
var _columns = listener === null || listener === void 0 || (_listener$Widgets9 = listener.Widgets) === null || _listener$Widgets9 === void 0 || (_listener$Widgets9 = _listener$Widgets9[name]) === null || _listener$Widgets9 === void 0 ? void 0 : _listener$Widgets9.columns;
|
|
1527
|
+
var defaultValues = Object.entries(_columns || {}).reduce(function (acc, _ref7) {
|
|
1528
|
+
var _ref8 = (0, _slicedToArray2["default"])(_ref7, 2),
|
|
1529
|
+
key = _ref8[0],
|
|
1530
|
+
value = _ref8[1];
|
|
1531
|
+
if ((value === null || value === void 0 ? void 0 : value.defaultValue) !== undefined) {
|
|
1532
|
+
acc[key] = value;
|
|
1533
|
+
}
|
|
1534
|
+
return acc;
|
|
1535
|
+
}, {});
|
|
1536
|
+
|
|
1537
|
+
// If all values are undefined, pass empty array, else pass object of default values
|
|
1538
|
+
var valuesToPass = Object.keys(defaultValues).length === 0 ? [] : defaultValues;
|
|
1539
|
+
if (parentFormColumns) {
|
|
1540
|
+
listener === null || listener === void 0 || listener.onChange(parentForm, {
|
|
1541
|
+
dataoutput: _objectSpread(_objectSpread({}, parentFormColumns), {}, (0, _defineProperty2["default"])({}, name, valuesToPass))
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
}, [parentForm, parentFormColumns]);
|
|
1546
|
+
var updateSelectedItem = function updateSelectedItem() {
|
|
1547
|
+
if (!(listener !== null && listener !== void 0 && listener.onChange)) return;
|
|
1548
|
+
|
|
1549
|
+
// Helper to get row ID
|
|
1550
|
+
var getRowId = function getRowId(row) {
|
|
1551
|
+
return row._wmTableRowId || String(row.id);
|
|
1552
|
+
};
|
|
1553
|
+
|
|
1554
|
+
// Get selected rows based on selection mode
|
|
1555
|
+
var selectedRows = [];
|
|
1556
|
+
if ((useRadioSelect || useMultiSelect) && selectedRowIds.length > 0) {
|
|
1557
|
+
selectedRows = internalDataset.filter(function (row) {
|
|
1558
|
+
return selectedRowIds.includes(getRowId(row));
|
|
1559
|
+
});
|
|
1560
|
+
} else if (activeRowIds.length > 0) {
|
|
1561
|
+
selectedRows = internalDataset.filter(function (row) {
|
|
1562
|
+
return activeRowIds.includes(getRowId(row));
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
// Clean and format selecteditem - always return as array
|
|
1567
|
+
var cleanedRows = (0, _utils.cleanRowData)(selectedRows);
|
|
1568
|
+
|
|
1569
|
+
// Always return selectedItems as an array (empty array if nothing selected)
|
|
1570
|
+
var selectedItems = cleanedRows.length > 0 ? cleanedRows : [];
|
|
1571
|
+
|
|
1572
|
+
// Update only if changed
|
|
1573
|
+
if (!(0, _lodashEs.isEqual)(prevSelectedRow.current, selectedItems)) {
|
|
1574
|
+
prevSelectedRow.current = selectedItems;
|
|
1575
|
+
if (tableApisRegistered.current) {
|
|
1576
|
+
listener.onChange(widgetRegistrationKey, {
|
|
1577
|
+
selectedItems: selectedItems
|
|
1578
|
+
});
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
tableApisRegistered.current = true;
|
|
1582
|
+
listener.onChange(widgetRegistrationKey, _objectSpread(_objectSpread({}, tableApis), {}, {
|
|
1583
|
+
selectedItems: selectedItems
|
|
1584
|
+
}));
|
|
1585
|
+
}
|
|
1586
|
+
};
|
|
1587
|
+
|
|
1588
|
+
// Expose active/selected row data through listener
|
|
1589
|
+
// This updates whenever the active/selected row changes (when user clicks on a row)
|
|
1590
|
+
(0, _react.useEffect)(function () {
|
|
1591
|
+
updateSelectedItem();
|
|
1592
|
+
}, [activeRowIds, selectedRowIds, useRadioSelect, useMultiSelect, internalDataset, name]);
|
|
1593
|
+
|
|
1594
|
+
// `table` reference is stable; header groups can change as state changes (pagination/columns/etc).
|
|
1595
|
+
// So include state-based deps to avoid stale/empty colgroup.
|
|
1596
|
+
var colGroupSpec = (0, _react.useMemo)(function () {
|
|
1597
|
+
var headerGroups = table.getHeaderGroups();
|
|
1598
|
+
var leafHeaderGroup = headerGroups.length ? headerGroups[headerGroups.length - 1] : undefined;
|
|
1599
|
+
var leafHeaders = ((leafHeaderGroup === null || leafHeaderGroup === void 0 ? void 0 : leafHeaderGroup.headers) || []).filter(function (h) {
|
|
1600
|
+
return !h.isPlaceholder;
|
|
1601
|
+
});
|
|
1602
|
+
|
|
1603
|
+
// Build base spec from TanStack columns
|
|
1604
|
+
var base = leafHeaders.map(function (h) {
|
|
1605
|
+
return {
|
|
1606
|
+
key: h.column.id,
|
|
1607
|
+
width: "".concat(h.column.getSize(), "px")
|
|
1608
|
+
};
|
|
1609
|
+
});
|
|
1610
|
+
return base;
|
|
1611
|
+
}, [table, columnSizing, columnsVersion, showheader, ColClassSignature]);
|
|
1612
|
+
return __jsx(_material.Box, {
|
|
1613
|
+
ref: tableContainerRef,
|
|
1614
|
+
hidden: props.hidden,
|
|
1615
|
+
className: "app-grid app-panel panel app-datagrid ".concat(className).trim(),
|
|
1616
|
+
name: name,
|
|
1617
|
+
editmode: editmode,
|
|
1618
|
+
navigation: navigation,
|
|
1619
|
+
title: title,
|
|
1620
|
+
currentpage: table.getState().pagination.pageIndex + 1
|
|
1621
|
+
}, renderConfirmDialog(), showPanelHeading && __jsx(_components.TablePanelHeading, {
|
|
1622
|
+
title: title,
|
|
1623
|
+
subheading: subheading,
|
|
1624
|
+
iconclass: iconclass,
|
|
1625
|
+
exportformat: exportformat,
|
|
1626
|
+
headerActions: headerActions,
|
|
1627
|
+
spacing: spacing,
|
|
1628
|
+
isGridEditMode: isGridEditModeComplete,
|
|
1629
|
+
isLoading: datasource === null || datasource === void 0 ? void 0 : datasource.loading,
|
|
1630
|
+
listener: listener,
|
|
1631
|
+
datasource: datasource,
|
|
1632
|
+
columns: wmTableColumnsWithOverrides,
|
|
1633
|
+
sortInfo: sortInfoForExport,
|
|
1634
|
+
filterInfo: filterDataForState,
|
|
1635
|
+
exportdatasize: exportdatasize,
|
|
1636
|
+
onBeforeExport: onBeforeexport
|
|
1637
|
+
}), __jsx(_material.Box, {
|
|
1638
|
+
className: "app-datagrid",
|
|
1639
|
+
onKeyDown: function onKeyDown(e) {
|
|
1640
|
+
return handleTableEditKeyDown(e);
|
|
1641
|
+
}
|
|
1642
|
+
}, filtermode === "search" && __jsx(_components.GlobalSearchFilter, {
|
|
1643
|
+
filteronkeypress: filteronkeypress,
|
|
1644
|
+
value: globalFilter,
|
|
1645
|
+
onChange: setGlobalFilter,
|
|
1646
|
+
selectedColumn: globalSearchColumn,
|
|
1647
|
+
onColumnChange: setGlobalSearchColumn,
|
|
1648
|
+
columns: columnsForTable,
|
|
1649
|
+
searchLabel: searchlabel,
|
|
1650
|
+
name: name,
|
|
1651
|
+
listener: listener
|
|
1652
|
+
}), __jsx(_material.Box, {
|
|
1653
|
+
className: "table-container table-responsive"
|
|
1654
|
+
}, __jsx(_material.Box, {
|
|
1655
|
+
className: "app-grid-header"
|
|
1656
|
+
}, __jsx(_material.Box, {
|
|
1657
|
+
className: "app-grid-header-inner",
|
|
1658
|
+
style: _objectSpread({
|
|
1659
|
+
height: "100%",
|
|
1660
|
+
overflow: "auto",
|
|
1661
|
+
position: "relative"
|
|
1662
|
+
}, styles)
|
|
1663
|
+
}, loading && navigation !== "On-Demand" && __jsx(_LoadingComponent["default"], {
|
|
1664
|
+
message: loadingdatamsg
|
|
1665
|
+
}), __jsx(_material.Table, {
|
|
1666
|
+
key: "table-".concat(isDynamicTable ? "dynamic" : "static", "-").concat(wmTableColumns.length, "-page-").concat(table.getState().pagination.pageIndex) // Force complete rebuild on pagination
|
|
1667
|
+
,
|
|
1668
|
+
className: "".concat(_utils.TABLE_CSS_CLASSES.gridDefault, " table-striped table-hover ").concat(spacingClasses).trim(),
|
|
1669
|
+
sx: _objectSpread({
|
|
1670
|
+
width: props.width || "100%"
|
|
1671
|
+
}, tableStructure && (0, _groupHeaderUtils.hasTableGroups)(tableStructure) ? {
|
|
1672
|
+
tableLayout: "fixed",
|
|
1673
|
+
minWidth: table.getTotalSize()
|
|
1674
|
+
} : {}),
|
|
1675
|
+
name: name
|
|
1676
|
+
}, showheader && wmTableColumns.length > 0 && __jsx(_react["default"].Fragment, null, __jsx(_components.TableHeaderComponent, {
|
|
1677
|
+
table: table,
|
|
1678
|
+
enablesort: enablesort,
|
|
1679
|
+
enablecolumnselection: enablecolumnselection,
|
|
1680
|
+
rowClass: rowClass,
|
|
1681
|
+
ColClassSignature: ColClassSignature,
|
|
1682
|
+
sorting: sorting,
|
|
1683
|
+
columnSizing: columnSizing,
|
|
1684
|
+
rowSelection: rowSelection,
|
|
1685
|
+
rowExpansionConfig: rowExpansionConfig,
|
|
1686
|
+
columnsVersion: columnsVersion,
|
|
1687
|
+
filterMode: filtermode,
|
|
1688
|
+
columnFilters: columnFilters,
|
|
1689
|
+
onColumnFilterChange: setColumnFilter,
|
|
1690
|
+
renderFormWidget: renderFormWidget,
|
|
1691
|
+
listener: listener,
|
|
1692
|
+
tableStructure: tableStructure,
|
|
1693
|
+
onColumnSelect: handleColumnSelect,
|
|
1694
|
+
onColumnDeselect: handleColumnDeselect,
|
|
1695
|
+
onHeaderclick: onHeaderclick,
|
|
1696
|
+
tableName: name
|
|
1697
|
+
}), __jsx("colgroup", null, colGroupSpec.map(function (c) {
|
|
1698
|
+
return __jsx("col", {
|
|
1699
|
+
key: c.key,
|
|
1700
|
+
style: {
|
|
1701
|
+
width: c.width
|
|
1702
|
+
},
|
|
1703
|
+
width: c.width
|
|
1704
|
+
});
|
|
1705
|
+
}))), internalDataset.length > 0 && __jsx(_components.TableBodyComponent, {
|
|
1706
|
+
table: table,
|
|
1707
|
+
columns: columns,
|
|
1708
|
+
rowClass: rowClass,
|
|
1709
|
+
formposition: formposition,
|
|
1710
|
+
renderAddNewRow: renderAddNewRow,
|
|
1711
|
+
onRowClick: handleRowClick,
|
|
1712
|
+
isRowActive: isRowActive,
|
|
1713
|
+
isRowSelected: isRowSelected,
|
|
1714
|
+
nodatamessage: nodatamessage,
|
|
1715
|
+
loadingdatamsg: loadingdatamsg,
|
|
1716
|
+
isLoading: datasource === null || datasource === void 0 ? void 0 : datasource.loading,
|
|
1717
|
+
rowExpansionConfig: rowExpansionConfig,
|
|
1718
|
+
expandedRows: expandedRows,
|
|
1719
|
+
toggleRowExpansion: handleToggleRowExpansion,
|
|
1720
|
+
isRowExpanded: isRowExpanded,
|
|
1721
|
+
rowsVersion: tableData.length,
|
|
1722
|
+
ColClassSignature: ColClassSignature,
|
|
1723
|
+
tableData: tableData,
|
|
1724
|
+
editingRowId: editingRowId,
|
|
1725
|
+
activeRowIds: activeRowIds,
|
|
1726
|
+
selectedRowIds: selectedRowIds,
|
|
1727
|
+
isAddingNewRow: isAddingNewRow,
|
|
1728
|
+
customExpressionColumns: customColumns,
|
|
1729
|
+
customColumnsRevision: customColumnsRevision,
|
|
1730
|
+
columnsVersion: columnsVersion
|
|
1731
|
+
}), summaryRowEnabled && summaryRowDefs.length > 0 && __jsx(_components.SummaryRowFooter, {
|
|
1732
|
+
summaryRowDefs: summaryRowDefs,
|
|
1733
|
+
summaryRowDefObjects: summaryRowDefObjects,
|
|
1734
|
+
columns: wmTableColumnsWithOverrides,
|
|
1735
|
+
tableName: name,
|
|
1736
|
+
summaryRowColumnShow: summaryRowColumnShow
|
|
1737
|
+
})))))), __jsx(_material.Box, {
|
|
1738
|
+
className: "panel-footer clearfix"
|
|
1739
|
+
}, showPagination && __jsx(_material.Box, {
|
|
1740
|
+
className: "app-datagrid-paginator"
|
|
1741
|
+
}, __jsx(_pagination["default"], {
|
|
1742
|
+
name: name,
|
|
1743
|
+
dataset: filtermode ? filteredData : internalDataset,
|
|
1744
|
+
maxResults: (_table$getState$pagin = table.getState().pagination.pageSize) !== null && _table$getState$pagin !== void 0 ? _table$getState$pagin : initialPageSize,
|
|
1745
|
+
currentPage: table.getState().pagination.pageIndex + 1,
|
|
1746
|
+
navigation: navigation,
|
|
1747
|
+
navigationalign: navigationalign,
|
|
1748
|
+
showrecordcount: showrecordcount,
|
|
1749
|
+
maxsize: maxsize,
|
|
1750
|
+
boundarylinks: boundarylinks,
|
|
1751
|
+
directionlinks: true,
|
|
1752
|
+
allowpagesizechange: allowpagesizechange,
|
|
1753
|
+
pagesizeoptions: pagesizeoptions,
|
|
1754
|
+
listener: listener,
|
|
1755
|
+
onPaginationChange: handlePaginationChange,
|
|
1756
|
+
onSetRecord: onSetrecord,
|
|
1757
|
+
onPageSizeChange: handlePageSizeChange,
|
|
1758
|
+
onDataUpdate: handleAccumulatedDataUpdate,
|
|
1759
|
+
onPaginationWidgetReady: handlePaginationWidgetReady
|
|
1760
|
+
// Pass pagination metadata from datasource if available
|
|
1761
|
+
,
|
|
1762
|
+
paginationMeta: datasource === null || datasource === void 0 ? void 0 : datasource.pagination,
|
|
1763
|
+
totalItems: datasource === null || datasource === void 0 || (_datasource$paginatio4 = datasource.pagination) === null || _datasource$paginatio4 === void 0 ? void 0 : _datasource$paginatio4.totalElements
|
|
1764
|
+
// Pass datasource for API-based pagination
|
|
1765
|
+
,
|
|
1766
|
+
datasource: datasource
|
|
1767
|
+
// Pass server-side pagination flag
|
|
1768
|
+
,
|
|
1769
|
+
isServerSidePagination: isServerSidePagination()
|
|
1770
|
+
// Pass additional invoke options for server-side operations
|
|
1771
|
+
,
|
|
1772
|
+
datasourceInvokeOptions: isServerSidePagination() ? {
|
|
1773
|
+
orderBy: sorting.length > 0 ? sorting.map(function (s) {
|
|
1774
|
+
return "".concat(s.id, " ").concat(s.desc ? "desc" : "asc");
|
|
1775
|
+
}).join(", ") : undefined,
|
|
1776
|
+
filterFields: memoizedFilterFields,
|
|
1777
|
+
condition: memoizedLogicalOp
|
|
1778
|
+
} : undefined
|
|
1779
|
+
// On-Demand navigation props
|
|
1780
|
+
,
|
|
1781
|
+
ondemandmessage: ondemandmessage,
|
|
1782
|
+
viewlessmessage: viewlessmessage,
|
|
1783
|
+
showviewlessbutton: showviewlessbutton
|
|
1784
|
+
})), __jsx(_components.TableFooterActions, {
|
|
1785
|
+
footerActions: footerActions,
|
|
1786
|
+
spacing: spacing,
|
|
1787
|
+
isGridEditMode: isGridEditModeComplete,
|
|
1788
|
+
isLoading: datasource === null || datasource === void 0 ? void 0 : datasource.loading,
|
|
1789
|
+
listener: listener
|
|
1790
|
+
})));
|
|
1791
|
+
}, function (prev, current) {
|
|
1792
|
+
// Check if core data and configuration props are the same
|
|
1793
|
+
var keys = ["dataset", "editmode", "navigation", "pagesize", "showrowindex", "showheader", "enablesort", "radioselect", "radioselecttitle", "radioselectarialabel", "multiselect", "multiselecttitle", "multiselectarialabel", "gridfirstrowselect", "rowClass", "deleteoktext", "deletecanceltext", "confirmdelete", "errormessage", "nodatamessage", "loadingdatamsg", "insertmessage", "updatemessage", "deletemessage", "spacing", "title", "subheading", "iconclass", "allowpagesizechange", "pagesizeoptions", "showrecordcount", "shownavigation", "datasource", "binddataset", "onSuccess", "onError", "onRowinsert", "onRowupdate", "onRowdelete", "onSort", "onBeforerowdelete", "onHeaderclick", "onRowselect", "onRowdeselect", "statehandler", "filtermode", "children", "listener", "hidden"];
|
|
1794
|
+
|
|
1795
|
+
// First check the simple props
|
|
1796
|
+
var simplePropsEqual = keys.every(function (key) {
|
|
1797
|
+
return prev[key] === current[key];
|
|
1798
|
+
});
|
|
1799
|
+
if (!simplePropsEqual) return false;
|
|
1800
|
+
|
|
1801
|
+
// Check if children structure has changed (column/action definitions)
|
|
1802
|
+
var prevChildrenCount = _react["default"].Children.count(prev.children);
|
|
1803
|
+
var currentChildrenCount = _react["default"].Children.count(current.children);
|
|
1804
|
+
if (prevChildrenCount !== currentChildrenCount) return false;
|
|
1805
|
+
|
|
1806
|
+
// If all checks pass, consider components equal (skip re-render)
|
|
1807
|
+
return true;
|
|
1808
|
+
});
|
|
1809
|
+
WmTableComponent.displayName = "WmTableComponent";
|
|
1810
|
+
|
|
1811
|
+
// Wrapper component that provides EditedRowsContext to WmTableComponent
|
|
1812
|
+
var WmTableWithProvider = function WmTableWithProvider(props) {
|
|
1813
|
+
return __jsx(_useEditedRows.EditedRowsProvider, null, __jsx(WmTableComponent, props));
|
|
1814
|
+
};
|
|
1815
|
+
WmTableWithProvider.displayName = "WmTable";
|
|
1816
|
+
var WmTableStandalone = exports.WmTable = (0, _withStandalone["default"])(WmTableWithProvider);
|
|
1817
|
+
// @ts-ignore
|
|
1818
|
+
var WmTable = (0, _withBaseWrapper["default"])(WmTableWithProvider);
|
|
1819
|
+
WmTable.displayName = "WmTable";
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* The WmTable component is used to display data in a tabular format.
|
|
1823
|
+
*
|
|
1824
|
+
* - [Playground](https://react-components.wavemaker.ai/?path=/story/data-data-table--showcase)
|
|
1825
|
+
*
|
|
1826
|
+
* - [Docs](https://react-components.wavemaker.ai/?path=/story/data-data-table--docs)
|
|
1827
|
+
*
|
|
1828
|
+
* @param props - {@link WmTableProps}
|
|
1829
|
+
*/
|
|
1830
|
+
var _default = exports["default"] = WmTable;
|