@wavemaker-ai/react-runtime 1.0.0-rc.647499 → 1.0.0-rc.647565
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/.npmignore +4 -0
- package/actions/base-action.js +12 -29
- package/actions/login-action.js +35 -52
- package/actions/logout-action.js +21 -38
- package/actions/navigation-action.js +251 -346
- package/actions/notification-action.js +121 -149
- package/actions/timer-action.js +95 -151
- package/actions/toast-provider.js +62 -76
- package/actions/toast.js +95 -91
- package/actions/toast.service.js +59 -79
- package/actions/types/index.js +6 -9
- package/components/advanced/carousel/index.js +358 -366
- package/components/advanced/carousel/props.js +0 -5
- package/components/advanced/carousel/template.js +102 -80
- package/components/advanced/login/index.js +227 -285
- package/components/advanced/login/props.js +0 -5
- package/components/advanced/marquee/index.js +169 -163
- package/components/advanced/marquee/props.js +0 -5
- package/components/basic/anchor/index.js +207 -187
- package/components/basic/anchor/props.js +0 -5
- package/components/basic/audio/index.js +110 -72
- package/components/basic/audio/props.js +0 -5
- package/components/basic/html/index.js +163 -203
- package/components/basic/html/props.js +0 -5
- package/components/basic/html/utils.js +30 -28
- package/components/basic/icon/index.js +98 -84
- package/components/basic/icon/props.js +0 -5
- package/components/basic/iframe/iframe.utils.js +7 -16
- package/components/basic/iframe/index.js +97 -103
- package/components/basic/iframe/props.js +0 -5
- package/components/basic/label/index.js +156 -134
- package/components/basic/label/props.js +0 -5
- package/components/basic/message/index.js +129 -113
- package/components/basic/message/props.js +0 -5
- package/components/basic/picture/index.js +156 -127
- package/components/basic/picture/props.js +0 -5
- package/components/basic/progress-bar/index.js +240 -176
- package/components/basic/progress-bar/props.js +5 -31
- package/components/basic/progress-circle/index.js +166 -183
- package/components/basic/progress-circle/props.js +14 -34
- package/components/basic/richtexteditor/index.js +430 -396
- package/components/basic/richtexteditor/props.js +0 -5
- package/components/basic/search/index.js +812 -931
- package/components/basic/search/props.js +0 -5
- package/components/basic/search/providers.js +233 -380
- package/components/basic/spinner/index.js +210 -200
- package/components/basic/spinner/props.js +4 -22
- package/components/basic/tile/index.js +73 -81
- package/components/basic/tile/props.js +0 -5
- package/components/basic/tree/Components/TreeNodeComponent.js +238 -170
- package/components/basic/tree/hooks/useTreePartialNodeApi.js +143 -135
- package/components/basic/tree/index.js +378 -454
- package/components/basic/tree/props.js +0 -5
- package/components/basic/tree/utils.js +129 -185
- package/components/basic/video/index.js +161 -107
- package/components/basic/video/props.js +0 -5
- package/components/chart/index.js +42 -50
- package/components/chart/props.js +31 -37
- package/components/chart/src/ChartRenderer.js +172 -154
- package/components/chart/src/chart.js +391 -213
- package/components/chart/src/chartStyles.generated.js +6 -14
- package/components/chart/src/chartUtils.js +228 -272
- package/components/chart/src/constants.d.ts +13 -0
- package/components/chart/src/constants.js +316 -90
- package/components/chart/src/d3Setup.js +11 -30
- package/components/chart/src/dataUtils.js +362 -446
- package/components/chart/src/formatUtils.js +47 -38
- package/components/chart/src/index.js +11 -19
- package/components/chart/src/nvd3Source.generated.js +5 -13
- package/components/chart/src/pieDonutResponsiveLayout.d.ts +5 -0
- package/components/chart/src/pieDonutResponsiveLayout.js +76 -96
- package/components/chart/src/types.js +0 -5
- package/components/common/AppSpinner.js +17 -33
- package/components/common/app-spinner.js +11 -22
- package/components/common/customTemplate/index.d.ts +3 -0
- package/components/common/customTemplate/index.js +6 -0
- package/components/common/customTemplate/props.d.ts +20 -0
- package/components/common/customTemplate/props.js +0 -0
- package/components/common/customTemplate/template.d.ts +3 -0
- package/components/common/customTemplate/template.js +27 -0
- package/components/common/customTemplate/useCustomTemplate.d.ts +8 -0
- package/components/common/customTemplate/useCustomTemplate.js +17 -0
- package/components/common/customTemplate/utils.d.ts +6 -0
- package/components/common/customTemplate/utils.js +12 -0
- package/components/common/index.js +4 -12
- package/components/constants.js +81 -77
- package/components/container/accordion/accordion-pane/index.js +105 -118
- package/components/container/accordion/accordion-pane/props.js +5 -21
- package/components/container/accordion/index.js +225 -243
- package/components/container/accordion/props.js +5 -16
- package/components/container/index.js +214 -150
- package/components/container/layout-grid/grid-column/index.js +68 -43
- package/components/container/layout-grid/grid-column/props.js +0 -5
- package/components/container/layout-grid/grid-row/index.js +12 -29
- package/components/container/layout-grid/grid-row/props.js +0 -5
- package/components/container/layout-grid/index.js +53 -38
- package/components/container/layout-grid/props.js +0 -5
- package/components/container/linear-layout/index.js +56 -60
- package/components/container/linear-layout/linear-layout-item/index.js +43 -47
- package/components/container/linear-layout/linear-layout-item/props.js +0 -5
- package/components/container/linear-layout/props.js +0 -5
- package/components/container/panel/components/panel-content/index.js +7 -16
- package/components/container/panel/components/panel-header/index.js +166 -146
- package/components/container/panel/components/panel-header/props.js +0 -5
- package/components/container/panel/hooks.js +76 -102
- package/components/container/panel/index.js +289 -252
- package/components/container/panel/props.js +0 -5
- package/components/container/props.js +0 -5
- package/components/container/repeat-template/index.js +65 -44
- package/components/container/repeat-template/props.js +0 -5
- package/components/container/tabs/index.js +517 -526
- package/components/container/tabs/props.js +5 -28
- package/components/container/tabs/tab-pane/index.js +105 -100
- package/components/container/tabs/tab-pane/props.js +0 -5
- package/components/container/tabs/utils.js +30 -35
- package/components/container/wizard/WizardContext.js +9 -11
- package/components/container/wizard/components/StepComponents.js +76 -99
- package/components/container/wizard/components/WizardStep.js +107 -85
- package/components/container/wizard/index.js +791 -921
- package/components/container/wizard/props.js +0 -5
- package/components/container/wizard/utils.js +97 -131
- package/components/container/wizard/wizard-action/index.js +41 -81
- package/components/container/wizard/wizard-step/index.js +140 -120
- package/components/data/card/card-actions/index.js +13 -31
- package/components/data/card/card-content/index.js +27 -36
- package/components/data/card/card-footer/index.js +13 -31
- package/components/data/card/index.js +192 -199
- package/components/data/card/props.js +0 -5
- package/components/data/form/base-form/constant.js +5 -8
- package/components/data/form/base-form/hooks/index.js +26 -77
- package/components/data/form/base-form/hooks/useFormDataSync.js +106 -212
- package/components/data/form/base-form/hooks/useFormOperations.js +109 -161
- package/components/data/form/base-form/hooks/useFormSubmission.js +220 -280
- package/components/data/form/base-form/hooks/useFormValidation.js +119 -168
- package/components/data/form/base-form/hooks/useParentFormRelationship.js +67 -103
- package/components/data/form/base-form/index.js +531 -646
- package/components/data/form/base-form/props.js +74 -151
- package/components/data/form/base-form/utils.js +210 -323
- package/components/data/form/dynamic-fields/constant.js +43 -53
- package/components/data/form/dynamic-fields/index.js +135 -144
- package/components/data/form/dynamic-fields/props.js +0 -5
- package/components/data/form/dynamic-fields/utils.js +99 -158
- package/components/data/form/form-action/index.js +107 -85
- package/components/data/form/form-body/index.js +52 -26
- package/components/data/form/form-context.js +43 -59
- package/components/data/form/form-controller/hooks/index.js +43 -57
- package/components/data/form/form-controller/props.js +5 -8
- package/components/data/form/form-controller/utils.js +54 -49
- package/components/data/form/form-controller/validation-contrustor.js +203 -426
- package/components/data/form/form-controller/withFormController.js +319 -269
- package/components/data/form/form-dynamic-section/index.js +47 -41
- package/components/data/form/form-dynamic-section/props.js +0 -5
- package/components/data/form/form-field/base-field.js +97 -109
- package/components/data/form/form-field/index.js +91 -82
- package/components/data/form/form-field/props.js +0 -5
- package/components/data/form/form-footer/index.js +52 -25
- package/components/data/form/form-header/index.js +61 -58
- package/components/data/form/index.js +95 -74
- package/components/data/form/props.js +0 -5
- package/components/data/list/components/GroupHeader.js +34 -33
- package/components/data/list/components/GroupedListItems.js +108 -104
- package/components/data/list/components/ListContainer.js +22 -27
- package/components/data/list/components/ListDND.js +193 -185
- package/components/data/list/components/ListHeader.js +32 -49
- package/components/data/list/components/ListItem.js +153 -146
- package/components/data/list/components/ListItemWithTemplate.js +87 -105
- package/components/data/list/components/ListItems.js +180 -194
- package/components/data/list/components/ListPagination.js +127 -153
- package/components/data/list/components/LoadMoreButton.js +25 -33
- package/components/data/list/components/NoDataMessage.js +9 -22
- package/components/data/list/components/StandardListItems.js +79 -85
- package/components/data/list/components/index.js +31 -119
- package/components/data/list/components/props.js +0 -5
- package/components/data/list/hooks/index.js +22 -75
- package/components/data/list/hooks/props.js +0 -5
- package/components/data/list/hooks/useCurrentPageItems.js +20 -38
- package/components/data/list/hooks/useGroupedData.js +19 -33
- package/components/data/list/hooks/useListData.js +17 -47
- package/components/data/list/hooks/useListEffects.js +168 -237
- package/components/data/list/hooks/useListEventHandlers.js +301 -285
- package/components/data/list/hooks/useListPagination.js +90 -136
- package/components/data/list/hooks/useListState.js +49 -91
- package/components/data/list/hooks/useListStateManager.js +104 -159
- package/components/data/list/hooks/usePaginatedGroupedData.js +74 -110
- package/components/data/list/index.d.ts +1 -0
- package/components/data/list/index.js +579 -621
- package/components/data/list/props.d.ts +4 -0
- package/components/data/list/props.js +0 -5
- package/components/data/list/templates/media-template.js +29 -50
- package/components/data/list/utils/constants.js +20 -32
- package/components/data/list/utils/list-helpers.d.ts +2 -1
- package/components/data/list/utils/list-helpers.js +71 -115
- package/components/data/list/utils/list-widget-methods.js +56 -76
- package/components/data/list/utils/widget-instance-utils.js +20 -57
- package/components/data/live-filter/index.js +219 -271
- package/components/data/live-filter/props.js +5 -12
- package/components/data/live-form/index.js +68 -91
- package/components/data/live-form/props.js +5 -12
- package/components/data/pagination/components/BasicPagination.js +124 -104
- package/components/data/pagination/components/ClassicPagination.js +167 -190
- package/components/data/pagination/components/InlinePagination.js +97 -98
- package/components/data/pagination/components/LoadingComponent.js +17 -30
- package/components/data/pagination/components/PageSizeSelector.js +176 -169
- package/components/data/pagination/components/PagerNavigation.js +84 -105
- package/components/data/pagination/components/TotalRecords.js +48 -47
- package/components/data/pagination/components/index.js +14 -47
- package/components/data/pagination/components/props.js +0 -5
- package/components/data/pagination/hooks/index.js +6 -19
- package/components/data/pagination/hooks/props.js +0 -5
- package/components/data/pagination/hooks/useNavigationSize.js +12 -21
- package/components/data/pagination/hooks/usePagination.js +702 -905
- package/components/data/pagination/index.js +336 -389
- package/components/data/table/components/AddNewRow.js +122 -154
- package/components/data/table/components/EditableCell.js +68 -75
- package/components/data/table/components/FieldValidationError.js +19 -20
- package/components/data/table/components/RowCells.js +97 -80
- package/components/data/table/components/RowExpansionButton.js +43 -39
- package/components/data/table/components/SummaryCell.js +54 -88
- package/components/data/table/components/SummaryRow.js +45 -52
- package/components/data/table/components/SummaryRowFooter.js +35 -42
- package/components/data/table/components/TableBody.js +222 -218
- package/components/data/table/components/TableDataRow.js +113 -106
- package/components/data/table/components/TableFilters.js +391 -390
- package/components/data/table/components/TableFooterActions.js +25 -32
- package/components/data/table/components/TableHeader.js +460 -435
- package/components/data/table/components/TablePanelHeading.js +157 -181
- package/components/data/table/components/index.js +27 -95
- package/components/data/table/hooks/index.js +21 -230
- package/components/data/table/hooks/use-edited-rows.js +59 -94
- package/components/data/table/hooks/useCellState.js +58 -83
- package/components/data/table/hooks/useCustomExpressionColumns.js +65 -86
- package/components/data/table/hooks/useDynamicColumns.js +59 -92
- package/components/data/table/hooks/useEditingState.js +30 -41
- package/components/data/table/hooks/useFormWidget.js +163 -172
- package/components/data/table/hooks/usePaginationState.js +67 -77
- package/components/data/table/hooks/usePanelStructure.js +47 -41
- package/components/data/table/hooks/useResponsiveColumns.js +14 -20
- package/components/data/table/hooks/useRowExpansion.js +131 -127
- package/components/data/table/hooks/useRowHandlers.js +56 -69
- package/components/data/table/hooks/useRowSelection.js +249 -329
- package/components/data/table/hooks/useServerSideSorting.js +109 -175
- package/components/data/table/hooks/useTableColumns.js +322 -331
- package/components/data/table/hooks/useTableData.js +111 -166
- package/components/data/table/hooks/useTableEdit.js +526 -564
- package/components/data/table/hooks/useTableEffects.js +60 -107
- package/components/data/table/hooks/useTableFilter.js +244 -237
- package/components/data/table/hooks/useTableInitialization.js +44 -76
- package/components/data/table/hooks/useTableState.js +39 -61
- package/components/data/table/hooks/useTableStateManager.js +295 -468
- package/components/data/table/index.js +1553 -1713
- package/components/data/table/live-table/index.js +157 -219
- package/components/data/table/props.js +0 -5
- package/components/data/table/table-action/index.js +97 -75
- package/components/data/table/table-column/index.js +48 -42
- package/components/data/table/table-group/index.js +7 -25
- package/components/data/table/table-row/index.js +63 -55
- package/components/data/table/table-row-action/index.js +102 -77
- package/components/data/table/utils/buildSelectionColumns.js +86 -137
- package/components/data/table/utils/columnBuilder.js +116 -158
- package/components/data/table/utils/columnProxy.js +48 -66
- package/components/data/table/utils/columnWidthDistribution.js +40 -64
- package/components/data/table/utils/constants.js +92 -40
- package/components/data/table/utils/crud-handlers.js +292 -473
- package/components/data/table/utils/dynamic-columns.js +99 -144
- package/components/data/table/utils/groupHeaderUtils.js +36 -61
- package/components/data/table/utils/index.d.ts +8 -5
- package/components/data/table/utils/index.js +419 -639
- package/components/data/table/utils/renderDisplayCell.js +127 -169
- package/components/data/table/utils/script-page-size-broadcast.js +17 -29
- package/components/data/table/utils/selectionUtils.js +59 -113
- package/components/data/table/utils/table-helpers.js +38 -74
- package/components/data/table/utils/validation.js +35 -78
- package/components/data/table/utils/widgetMapping.d.ts +5 -0
- package/components/data/table/utils/widgetMapping.js +41 -0
- package/components/data/types.js +112 -112
- package/components/data/utils/field-data-utils.js +38 -42
- package/components/data/utils/filter-field-util.js +42 -44
- package/components/data/utils/index.js +112 -111
- package/components/dialogs/alert-dialog/index.js +83 -78
- package/components/dialogs/alert-dialog/props.js +0 -5
- package/components/dialogs/confirm-dialog/index.js +102 -92
- package/components/dialogs/confirm-dialog/props.js +0 -5
- package/components/dialogs/dialog/index.js +93 -69
- package/components/dialogs/dialog/props.js +0 -5
- package/components/dialogs/dialog-actions/index.js +12 -26
- package/components/dialogs/dialog-actions/props.js +0 -5
- package/components/dialogs/dialog-body/index.js +13 -30
- package/components/dialogs/dialog-body/props.js +0 -5
- package/components/dialogs/dialog-content/index.js +48 -41
- package/components/dialogs/dialog-content/props.js +0 -5
- package/components/dialogs/dialog-header/index.js +88 -101
- package/components/dialogs/dialog-header/props.js +0 -5
- package/components/dialogs/iframe-dialog/index.js +136 -128
- package/components/dialogs/iframe-dialog/props.js +0 -5
- package/components/dialogs/index.js +104 -101
- package/components/dialogs/login-dialog/index.js +285 -347
- package/components/dialogs/login-dialog/props.js +0 -5
- package/components/dialogs/page-dialog/index.js +95 -86
- package/components/dialogs/page-dialog/props.js +0 -5
- package/components/dialogs/props.js +0 -5
- package/components/dialogs/withDialogWrapper.js +110 -83
- package/components/form/button/index.js +296 -245
- package/components/form/button/props.js +0 -5
- package/components/form/button-group/index.js +80 -69
- package/components/form/button-group/props.js +0 -5
- package/components/input/calendar/index.js +409 -362
- package/components/input/calendar/props.js +0 -5
- package/components/input/calendar/utils.js +164 -172
- package/components/input/chips/SortableChip/index.js +109 -100
- package/components/input/chips/SortableChip/props.js +0 -5
- package/components/input/chips/index.js +663 -570
- package/components/input/chips/props.js +0 -5
- package/components/input/chips/utils.js +131 -122
- package/components/input/color-picker/index.js +536 -594
- package/components/input/color-picker/props.js +0 -5
- package/components/input/composite/index.js +71 -110
- package/components/input/composite/props.js +0 -5
- package/components/input/currency/index.js +277 -224
- package/components/input/currency/props.js +0 -5
- package/components/input/default/checkbox/index.js +329 -250
- package/components/input/default/checkbox/props.js +0 -5
- package/components/input/default/checkboxset/index.d.ts +2 -0
- package/components/input/default/checkboxset/index.js +529 -446
- package/components/input/default/checkboxset/props.d.ts +4 -0
- package/components/input/default/checkboxset/props.js +0 -5
- package/components/input/default/checkboxset/utils.js +15 -25
- package/components/input/default/radioset/index.d.ts +2 -0
- package/components/input/default/radioset/index.js +409 -350
- package/components/input/default/radioset/props.d.ts +6 -0
- package/components/input/default/radioset/props.js +0 -5
- package/components/input/default/switch/index.js +494 -458
- package/components/input/default/switch/prop.js +0 -5
- package/components/input/epoch/date/components/DatePickerPopover.js +242 -193
- package/components/input/epoch/date/index.js +638 -518
- package/components/input/epoch/date/props.js +0 -5
- package/components/input/epoch/date/styled.js +61 -70
- package/components/input/epoch/date/utils.js +67 -115
- package/components/input/epoch/datetime/index.js +758 -695
- package/components/input/epoch/datetime/props.js +0 -5
- package/components/input/epoch/datetime/utils.js +121 -186
- package/components/input/epoch/time/index.js +441 -415
- package/components/input/epoch/time/props.js +0 -5
- package/components/input/epoch/time/utils.js +101 -112
- package/components/input/fileupload/Utils.js +70 -97
- package/components/input/fileupload/components/ListItems.js +132 -130
- package/components/input/fileupload/components/MultiUpload.js +80 -77
- package/components/input/fileupload/components/SingleUpload.js +57 -57
- package/components/input/fileupload/index.js +253 -178
- package/components/input/fileupload/props.js +0 -5
- package/components/input/fileupload/useFileUpload.js +209 -258
- package/components/input/number/index.js +434 -393
- package/components/input/number/props.js +0 -5
- package/components/input/rating/index.js +401 -394
- package/components/input/rating/props.js +0 -5
- package/components/input/select/index.js +408 -463
- package/components/input/select/props.js +0 -5
- package/components/input/slider/index.js +339 -332
- package/components/input/slider/props.js +0 -5
- package/components/input/text/index.d.ts +3 -3
- package/components/input/text/index.js +438 -475
- package/components/input/text/props.d.ts +1 -1
- package/components/input/text/props.js +0 -5
- package/components/input/text/util.js +82 -222
- package/components/input/textarea/index.js +322 -358
- package/components/input/textarea/props.js +0 -5
- package/components/input/upload/index.js +135 -131
- package/components/input/upload/props.js +0 -5
- package/components/input/util/index.js +9 -11
- package/components/layout/footer/index.js +12 -35
- package/components/layout/footer/props.js +0 -5
- package/components/layout/header/index.js +12 -38
- package/components/layout/header/props.js +0 -5
- package/components/layout/leftnav/index.js +38 -44
- package/components/layout/leftnav/props.js +0 -5
- package/components/layout/rightnav/index.js +12 -36
- package/components/layout/rightnav/props.js +0 -5
- package/components/layout/topnav/index.js +24 -38
- package/components/layout/topnav/props.js +0 -5
- package/components/navbar/index.js +119 -98
- package/components/navbar/nav/index.js +236 -232
- package/components/navbar/nav/props.js +0 -5
- package/components/navbar/nav-item/index.js +74 -65
- package/components/navbar/nav-item/props.js +0 -5
- package/components/navigation/breadcrumb/index.js +38 -61
- package/components/navigation/breadcrumb/props.js +0 -5
- package/components/navigation/menu/components/ListItems.js +76 -67
- package/components/navigation/menu/constants.js +27 -42
- package/components/navigation/menu/hooks/useHoverState.hook.js +20 -47
- package/components/navigation/menu/hooks/useKeyboardMovements.hook.js +34 -28
- package/components/navigation/menu/hooks/useTransformedDataset.hook.js +21 -14
- package/components/navigation/menu/index.js +911 -846
- package/components/navigation/menu/props.js +0 -5
- package/components/navigation/menu/utils/action-task.js +6 -9
- package/components/navigation/menu/utils/role-filter.js +41 -56
- package/components/navigation/popover/index.js +191 -205
- package/components/navigation/popover/props.js +5 -8
- package/components/page/content/index.js +9 -31
- package/components/page/content/props.js +0 -5
- package/components/page/error-boundary/index.js +115 -105
- package/components/page/error-boundary/props.js +0 -5
- package/components/page/index.js +84 -102
- package/components/page/page-content/index.js +21 -30
- package/components/page/page-content/props.js +0 -5
- package/components/page/partial/index.js +50 -45
- package/components/page/partial/props.js +0 -5
- package/components/page/partial-container/index.js +81 -107
- package/components/page/partial-container/props.d.ts +1 -1
- package/components/page/partial-container/props.js +0 -5
- package/components/page/props.js +0 -5
- package/components/page/toast-container/index.js +20 -41
- package/components/page/toast-container/props.js +0 -5
- package/components/prefab/container/index.js +60 -53
- package/components/prefab/container/props.js +0 -5
- package/components/prefab/index.js +76 -61
- package/components/prefab/props.js +0 -5
- package/context/AppContext.d.ts +1 -1
- package/context/AppContext.js +17 -18
- package/context/AppSpinnerProvider.js +19 -34
- package/context/LayoutProvider.js +54 -57
- package/context/LocalizationProvider.js +34 -49
- package/context/PrefabContext.js +68 -119
- package/context/WidgetProvider.js +160 -166
- package/core/app-config.js +0 -1
- package/core/app.service.js +200 -327
- package/core/appVariablesStore.js +10 -15
- package/core/appstore.js +37 -53
- package/core/constants/currency-constant.js +81 -83
- package/core/constants/events.js +34 -44
- package/core/constants/index.js +21 -31
- package/core/dialog.service.js +52 -72
- package/core/event-notifier.js +94 -131
- package/core/formatter/array-formatters.js +18 -32
- package/core/formatter/date-formatters.js +140 -204
- package/core/formatter/index.js +64 -117
- package/core/formatter/number-formatters.js +115 -159
- package/core/formatter/security-formatters.js +233 -283
- package/core/formatter/string-formatters.js +23 -45
- package/core/formatter/types.js +12 -18
- package/core/formatters.js +6 -24
- package/core/proxy-service.js +242 -306
- package/core/script-registry.js +87 -134
- package/core/security.service.js +8 -11
- package/core/util/compare.js +13 -25
- package/core/util/dom.js +32 -63
- package/core/util/index.d.ts +5 -0
- package/core/util/index.js +95 -95
- package/core/util/safe-is-equal.js +42 -94
- package/core/util/security.js +114 -153
- package/core/util/utils.d.ts +8 -1
- package/core/util/utils.js +124 -132
- package/core/widget-observer.js +34 -61
- package/higherOrder/BaseApp.js +327 -500
- package/higherOrder/BaseAppProps.js +0 -5
- package/higherOrder/BaseDateTime.js +277 -231
- package/higherOrder/BasePage.js +479 -735
- package/higherOrder/BasePartial.js +87 -114
- package/higherOrder/BasePrefab.js +190 -206
- package/higherOrder/DataNav.js +287 -302
- package/higherOrder/helper.js +62 -48
- package/higherOrder/props.js +0 -5
- package/higherOrder/withBaseWrapper.js +123 -168
- package/higherOrder/withStandalone.js +28 -26
- package/hooks/useAccess.js +113 -289
- package/hooks/useAppConfig.js +15 -40
- package/hooks/useAuth.js +256 -495
- package/hooks/useDataSourceSubscription.d.ts +3 -3
- package/hooks/useDataSourceSubscription.js +99 -109
- package/hooks/useDebounce.js +28 -56
- package/hooks/useDeviceVisibility.js +14 -23
- package/hooks/useHttp.d.ts +1 -0
- package/hooks/useHttp.js +318 -493
- package/libs/index.js +4 -13
- package/libs/prefab/index.js +6 -20
- package/mui-config/theme-provider.js +9 -17
- package/mui-config/theme.js +6 -9
- package/package-lock.json +808 -3177
- package/package.json +3 -19
- package/providers/AppProviders.js +21 -24
- package/runtime-dynamic/App.js +65 -93
- package/runtime-dynamic/app-initializer.js +207 -400
- package/runtime-dynamic/components/ErrorBoundary.js +59 -76
- package/runtime-dynamic/components/PageWrapper.js +23 -35
- package/runtime-dynamic/components/PrefabPreview.js +40 -69
- package/runtime-dynamic/components/partial-content.d.ts +2 -3
- package/runtime-dynamic/components/partial-content.js +66 -48
- package/runtime-dynamic/components/prefab-content.js +37 -30
- package/runtime-dynamic/components/use-dynamic-component.js +62 -150
- package/runtime-dynamic/factories/build-base-page-like-component.js +44 -58
- package/runtime-dynamic/factories/dynamic-component.d.ts +9 -0
- package/runtime-dynamic/factories/dynamic-component.js +83 -0
- package/runtime-dynamic/factories/prefab-factory.js +60 -81
- package/runtime-dynamic/factories/startup-info.js +12 -25
- package/runtime-dynamic/factories/utils.d.ts +1 -9
- package/runtime-dynamic/factories/utils.js +47 -130
- package/runtime-dynamic/index.js +56 -191
- package/runtime-dynamic/main.js +42 -70
- package/runtime-dynamic/preview-mode.js +14 -29
- package/runtime-dynamic/preview-navigation.js +21 -30
- package/runtime-dynamic/preview-path.d.ts +5 -0
- package/runtime-dynamic/preview-path.js +13 -0
- package/runtime-dynamic/preview-resource-base.js +15 -31
- package/runtime-dynamic/registry/component-registry.js +269 -334
- package/runtime-dynamic/registry/custom-widget-registry.js +11 -15
- package/runtime-dynamic/registry/index.js +24 -63
- package/runtime-dynamic/registry/store.d.ts +1 -0
- package/runtime-dynamic/registry/store.js +18 -23
- package/runtime-dynamic/routes.js +53 -81
- package/runtime-dynamic/services/app-extension-provider.js +17 -44
- package/runtime-dynamic/services/autolayout-inject.d.ts +4 -0
- package/runtime-dynamic/services/autolayout-inject.js +27 -0
- package/runtime-dynamic/services/cache.js +27 -33
- package/runtime-dynamic/services/compile-render.d.ts +9 -0
- package/runtime-dynamic/services/compile-render.js +142 -0
- package/runtime-dynamic/services/component-ref-provider.js +70 -124
- package/runtime-dynamic/services/css-scoping.js +27 -28
- package/runtime-dynamic/services/fragment-url.js +37 -50
- package/runtime-dynamic/services/index.js +48 -152
- package/runtime-dynamic/services/markup-transpiler.d.ts +2 -2
- package/runtime-dynamic/services/markup-transpiler.js +39 -231
- package/runtime-dynamic/services/prefab-resources.js +42 -130
- package/runtime-dynamic/services/resource-manager.d.ts +2 -1
- package/runtime-dynamic/services/resource-manager.js +32 -63
- package/runtime-dynamic/services/script-executor.js +50 -61
- package/runtime-dynamic/services/variable-factory.js +141 -184
- package/runtime-dynamic/services/variable-registry.js +69 -115
- package/runtime-dynamic/services/variable-transpiler.js +73 -103
- package/runtime-dynamic/shims/next-image.js +79 -50
- package/runtime-dynamic/shims/next-link.js +58 -32
- package/runtime-dynamic/shims/next-navigation.js +17 -34
- package/runtime-dynamic/utils/index.d.ts +2 -0
- package/runtime-dynamic/utils/index.js +22 -24
- package/store/bindActions/i18nActions.js +16 -18
- package/store/index.js +29 -35
- package/store/middleware/navigationMiddleware.js +25 -45
- package/store/middleware/pendingTabNavigationIntentMiddleware.js +20 -25
- package/store/slices/appConfigSlice.js +65 -94
- package/store/slices/authSlice.js +317 -471
- package/store/slices/i18nSlice.js +169 -168
- package/store/slices/navigationSlice.js +22 -20
- package/store/util/resolve-path.d.ts +1 -0
- package/store/util/resolve-path.js +7 -0
- package/store/viewport.service.js +150 -194
- package/types/index.js +10 -15
- package/utils/attr.js +198 -41
- package/utils/custom-expression/index.js +55 -151
- package/utils/custom-expression/parser.js +106 -182
- package/utils/dataset-util.js +113 -154
- package/utils/eval-expression.js +10 -19
- package/utils/form-state.util.js +60 -118
- package/utils/form-utils.js +49 -190
- package/utils/format-util.js +113 -184
- package/utils/layoutsize-util.js +11 -17
- package/utils/lib-error-skipper.js +54 -52
- package/utils/page-params-util.js +50 -40
- package/utils/pending-tab-navigation-intent.js +7 -17
- package/utils/resource-url.js +8 -19
- package/utils/state-persistance.js +136 -253
- package/utils/style-utils.d.ts +2 -0
- package/utils/style-utils.js +25 -74
- package/utils/transformedDataset-utils.js +353 -381
- package/utils/widget-cleanup-util.js +42 -74
- package/utils/widgets.js +19 -31
- package/variables/base-variable.js +117 -166
- package/variables/constants.js +5 -8
- package/variables/crud-variable.js +150 -181
- package/variables/live-variable.d.ts +1 -1
- package/variables/live-variable.js +140 -174
- package/variables/metadata.service.js +74 -116
- package/variables/model-variable.js +68 -78
- package/variables/service-variable.js +171 -285
- package/wm-namespace.js +11 -14
- package/components/chart/src/css.d.js +0 -1
- package/tsconfig.declaration.tsbuildinfo +0 -1
- package/types/global.d.js +0 -3
package/higherOrder/BasePage.js
CHANGED
|
@@ -1,210 +1,190 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
Object.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return state.auth.securityConfig;
|
|
82
|
-
});
|
|
83
|
-
var isAuthenticated = (0, _store.useAppSelector)(function (state) {
|
|
84
|
-
var _state$auth$loggedInU;
|
|
85
|
-
return (_state$auth$loggedInU = state.auth.loggedInUser) === null || _state$auth$loggedInU === void 0 ? void 0 : _state$auth$loggedInU.isAuthenticated;
|
|
86
|
-
});
|
|
87
|
-
var loggedInUser = (0, _store.useAppSelector)(function (state) {
|
|
88
|
-
return state.auth.loggedInUser;
|
|
89
|
-
});
|
|
90
|
-
var appConfig = (0, _store.useAppSelector)(function (state) {
|
|
91
|
-
return state.info.appConfig;
|
|
92
|
-
});
|
|
93
|
-
var pendingAccordionExpansion = (0, _store.useAppSelector)(function (state) {
|
|
94
|
-
return state.navigation.pendingAccordionExpansion;
|
|
95
|
-
});
|
|
96
|
-
var pendingTabSelection = (0, _store.useAppSelector)(function (state) {
|
|
97
|
-
return state.navigation.pendingTabSelection;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
import { jsx } from "react/jsx-runtime";
|
|
22
|
+
import { useState, useEffect, useRef, useMemo, useCallback } from "react";
|
|
23
|
+
import { useSearchParams } from "next/navigation";
|
|
24
|
+
import isEqual from "lodash-es/isEqual";
|
|
25
|
+
import cloneDeep from "lodash-es/cloneDeep";
|
|
26
|
+
import merge from "lodash-es/merge";
|
|
27
|
+
import compare from "../core/util/compare";
|
|
28
|
+
import { WidgetProvider } from "../context/WidgetProvider";
|
|
29
|
+
import { WmSpinner } from "../components/basic/spinner";
|
|
30
|
+
import { getAppVariablesInstance } from "../core/appVariablesStore";
|
|
31
|
+
import { useAppSelector, useAppDispatch } from "../store";
|
|
32
|
+
import { useAppContext } from "../context/AppContext";
|
|
33
|
+
import useAccess from "../hooks/useAccess";
|
|
34
|
+
import { redirectToLogin } from "../store/slices/authSlice";
|
|
35
|
+
import {
|
|
36
|
+
VariableEvents
|
|
37
|
+
} from "../types";
|
|
38
|
+
import { createStateProxy } from "../core/proxy-service";
|
|
39
|
+
import {
|
|
40
|
+
accordionExpansionHandler,
|
|
41
|
+
mergeVariablesAndActions,
|
|
42
|
+
tabSelectionHandler
|
|
43
|
+
} from "./helper";
|
|
44
|
+
import { toastService } from "../actions/toast.service";
|
|
45
|
+
import appstore from "../core/appstore";
|
|
46
|
+
import {
|
|
47
|
+
createOverriddenPropsRegistry,
|
|
48
|
+
withSuspendedTracking
|
|
49
|
+
} from "../core/script-registry";
|
|
50
|
+
import formatters from "../core/formatters";
|
|
51
|
+
import { useAppProxy } from "../context/AppContext";
|
|
52
|
+
import {
|
|
53
|
+
computeMergedPageParams,
|
|
54
|
+
computePartialParamKey,
|
|
55
|
+
extractPartialParamValues
|
|
56
|
+
} from "../utils/page-params-util";
|
|
57
|
+
import { useAppSpinner } from "../context/AppSpinnerProvider";
|
|
58
|
+
import get from "lodash-es/get";
|
|
59
|
+
import { EVENTEMITTER_METHODS } from "../core/constants/events";
|
|
60
|
+
import { wrapWithThirdPartyErrorGuard } from "../utils/lib-error-skipper";
|
|
61
|
+
import { viewportService } from "../store/viewport.service";
|
|
62
|
+
import { formatMessage } from "../core/util";
|
|
63
|
+
const withPageContext = (WrappedComponent, addPageScript, getVariables, componentInfo, prefabInfo) => {
|
|
64
|
+
const PageContextComponent = (props) => {
|
|
65
|
+
var _a, _b, _c;
|
|
66
|
+
const dispatch = useAppDispatch();
|
|
67
|
+
const { show, hide } = (_a = useAppSpinner()) != null ? _a : {};
|
|
68
|
+
const i18n = useAppSelector((state) => state.i18n);
|
|
69
|
+
const info = useAppSelector((state) => state.info);
|
|
70
|
+
const pageParams = useSearchParams();
|
|
71
|
+
const appContext = useAppContext();
|
|
72
|
+
const appProxy = useAppProxy();
|
|
73
|
+
const {
|
|
74
|
+
hasAccess,
|
|
75
|
+
loading: accessLoading,
|
|
76
|
+
error: accessError
|
|
77
|
+
} = useAccess({
|
|
78
|
+
componentName: (componentInfo == null ? void 0 : componentInfo.componentName) || "Main",
|
|
79
|
+
type: (componentInfo == null ? void 0 : componentInfo.componentType) || "PAGE"
|
|
98
80
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
81
|
+
const isSecurityEnabled = useAppSelector(
|
|
82
|
+
(state) => {
|
|
83
|
+
var _a2;
|
|
84
|
+
return (_a2 = state.auth.securityConfig) == null ? void 0 : _a2.isSecurityEnabled;
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
const securityConfig = useAppSelector((state) => state.auth.securityConfig);
|
|
88
|
+
const isAuthenticated = useAppSelector(
|
|
89
|
+
(state) => {
|
|
90
|
+
var _a2;
|
|
91
|
+
return (_a2 = state.auth.loggedInUser) == null ? void 0 : _a2.isAuthenticated;
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
const appConfig = useAppSelector((state) => state.info.appConfig);
|
|
95
|
+
const pendingAccordionExpansion = useAppSelector(
|
|
96
|
+
(state) => state.navigation.pendingAccordionExpansion
|
|
97
|
+
);
|
|
98
|
+
const pendingTabSelection = useAppSelector(
|
|
99
|
+
(state) => state.navigation.pendingTabSelection
|
|
100
|
+
);
|
|
101
|
+
const [isInitialized, setIsInitialized] = useState(false);
|
|
102
|
+
const [isLayoutReady, setIsLayoutReady] = useState(false);
|
|
103
|
+
const redirectHandledRef = useRef(false);
|
|
104
|
+
const subscriptionsRef = useRef([]);
|
|
105
|
+
const pendingStartupOpsRef = useRef(/* @__PURE__ */ new Set());
|
|
106
|
+
const startUpVariableLoadedRef = useRef(false);
|
|
107
|
+
const pageProxyRef = useRef(null);
|
|
108
|
+
const urlTabProcessedRef = useRef(false);
|
|
109
|
+
const isInitializingRef = useRef(false);
|
|
110
|
+
const isMountedRef = useRef(true);
|
|
111
|
+
const appVarSubscriptionsDoneRef = useRef(false);
|
|
112
|
+
const subscribedVariableNamesRef = useRef(/* @__PURE__ */ new Set());
|
|
113
|
+
const overriddenPropsRegistryRef = useRef(null);
|
|
114
|
+
const onStartupCompletedRef = useRef(false);
|
|
115
|
+
const [isPageReady, setIsPageReady] = useState(false);
|
|
116
|
+
const pageReady = useCallback(() => {
|
|
128
117
|
setIsPageReady(true);
|
|
129
118
|
}, []);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
var authLoggedInUser = (0, _store.useAppSelector)(function (state) {
|
|
173
|
-
return state.auth.loggedInUser;
|
|
174
|
-
});
|
|
175
|
-
(0, _react.useEffect)(function () {
|
|
119
|
+
const [pageContext, setPageContext] = useState(__spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
120
|
+
Widgets: {},
|
|
121
|
+
Variables: {},
|
|
122
|
+
Actions: {},
|
|
123
|
+
onReady: () => {
|
|
124
|
+
},
|
|
125
|
+
serviceDefinitions: cloneDeep(
|
|
126
|
+
(prefabInfo == null ? void 0 : prefabInfo.serviceDefs) || (appContext == null ? void 0 : appContext.serviceDefinitions) || {}
|
|
127
|
+
),
|
|
128
|
+
pageParams: props.pageParams || {},
|
|
129
|
+
baseUrl: (prefabInfo == null ? void 0 : prefabInfo.baseUrl) || ((_b = info == null ? void 0 : info.appConfig) == null ? void 0 : _b.url) || "",
|
|
130
|
+
appConfig: appContext == null ? void 0 : appContext.appConfig,
|
|
131
|
+
notification: {},
|
|
132
|
+
toaster: toastService,
|
|
133
|
+
onContentReady,
|
|
134
|
+
onChange: updateWidgetState,
|
|
135
|
+
pageReady,
|
|
136
|
+
App: {},
|
|
137
|
+
eval: appContext == null ? void 0 : appContext.eval,
|
|
138
|
+
appLocale: (componentInfo == null ? void 0 : componentInfo.appLocale) || i18n.appLocale || {},
|
|
139
|
+
localeFormats: {
|
|
140
|
+
date: i18n.dateFormat,
|
|
141
|
+
time: i18n.timeFormat,
|
|
142
|
+
currency: i18n.currencyCode
|
|
143
|
+
}
|
|
144
|
+
}, prefabInfo), props), componentInfo), {
|
|
145
|
+
executeStartup,
|
|
146
|
+
formatters,
|
|
147
|
+
Viewport: viewportService.getViewport(),
|
|
148
|
+
formatMessage,
|
|
149
|
+
overriddenPropsRegistryRef: overriddenPropsRegistryRef.current,
|
|
150
|
+
layoutReady,
|
|
151
|
+
activePageName: componentInfo == null ? void 0 : componentInfo.componentName
|
|
152
|
+
}));
|
|
153
|
+
const initialAppConfig = useMemo(() => appContext, [appContext]);
|
|
154
|
+
const partialParamValuesKey = computePartialParamKey(
|
|
155
|
+
componentInfo == null ? void 0 : componentInfo.componentType,
|
|
156
|
+
props.params,
|
|
157
|
+
props
|
|
158
|
+
);
|
|
159
|
+
const authLoggedInUser = useAppSelector((state) => state.auth.loggedInUser);
|
|
160
|
+
useEffect(() => {
|
|
176
161
|
if (!pageProxyRef.current) return;
|
|
177
162
|
pageProxyRef.current.appConfig.loggedInUser = authLoggedInUser;
|
|
178
|
-
setPageContext(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
loggedInUser: authLoggedInUser
|
|
182
|
-
})
|
|
183
|
-
});
|
|
184
|
-
});
|
|
163
|
+
setPageContext((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
164
|
+
appConfig: __spreadProps(__spreadValues({}, prev.appConfig), { loggedInUser: authLoggedInUser })
|
|
165
|
+
}));
|
|
185
166
|
}, [authLoggedInUser]);
|
|
186
|
-
|
|
187
|
-
pageContext.serviceDefinitions = (
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
pageContext.serviceDefinitions = cloneDeep(
|
|
169
|
+
(prefabInfo == null ? void 0 : prefabInfo.serviceDefs) || (appContext == null ? void 0 : appContext.serviceDefinitions) || {}
|
|
170
|
+
);
|
|
171
|
+
setPageContext((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
172
|
+
serviceDefinitions: cloneDeep(
|
|
173
|
+
(prefabInfo == null ? void 0 : prefabInfo.serviceDefs) || (appContext == null ? void 0 : appContext.serviceDefinitions) || {}
|
|
174
|
+
)
|
|
175
|
+
}));
|
|
176
|
+
}, [appContext == null ? void 0 : appContext.serviceDefinitions, prefabInfo == null ? void 0 : prefabInfo.serviceDefs]);
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
if ((componentInfo == null ? void 0 : componentInfo.componentType) !== "PARTIAL" || !pageProxyRef.current) {
|
|
197
179
|
return;
|
|
198
180
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
var
|
|
205
|
-
|
|
206
|
-
newValue = _ref3[1];
|
|
207
|
-
if (!(0, _isEqual["default"])((_pageProxyRef$current = pageProxyRef.current.pageParams) === null || _pageProxyRef$current === void 0 ? void 0 : _pageProxyRef$current[key], newValue)) {
|
|
181
|
+
const paramValues = extractPartialParamValues(
|
|
182
|
+
props.params || [],
|
|
183
|
+
props
|
|
184
|
+
);
|
|
185
|
+
Object.entries(paramValues).forEach(([key, newValue]) => {
|
|
186
|
+
var _a2;
|
|
187
|
+
if (!isEqual((_a2 = pageProxyRef.current.pageParams) == null ? void 0 : _a2[key], newValue)) {
|
|
208
188
|
if (!pageProxyRef.current.pageParams) {
|
|
209
189
|
pageProxyRef.current.pageParams = {};
|
|
210
190
|
}
|
|
@@ -212,70 +192,67 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
212
192
|
}
|
|
213
193
|
});
|
|
214
194
|
}, [partialParamValuesKey]);
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
var _appConfig$pages;
|
|
219
|
-
if ((componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.componentType) !== "PAGE" || redirectHandledRef.current || accessLoading || !isSecurityEnabled) {
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
var _a2;
|
|
197
|
+
if ((componentInfo == null ? void 0 : componentInfo.componentType) !== "PAGE" || redirectHandledRef.current || accessLoading || !isSecurityEnabled) {
|
|
220
198
|
return;
|
|
221
199
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
// Redirect to login if page requires authentication and user is not authenticated
|
|
230
|
-
var requiresAuth = (pageConfig === null || pageConfig === void 0 ? void 0 : pageConfig.permission) === "Authenticated" || (pageConfig === null || pageConfig === void 0 ? void 0 : pageConfig.permission) === "Role";
|
|
200
|
+
const pageConfig = (_a2 = appConfig == null ? void 0 : appConfig.pages) == null ? void 0 : _a2.find(
|
|
201
|
+
(p) => {
|
|
202
|
+
var _a3;
|
|
203
|
+
return p.name.toLowerCase() === ((_a3 = componentInfo == null ? void 0 : componentInfo.componentName) == null ? void 0 : _a3.toLowerCase());
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
const requiresAuth = (pageConfig == null ? void 0 : pageConfig.permission) === "Authenticated" || (pageConfig == null ? void 0 : pageConfig.permission) === "Role";
|
|
231
207
|
if (requiresAuth && !isAuthenticated) {
|
|
232
208
|
redirectHandledRef.current = true;
|
|
233
|
-
dispatch(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
209
|
+
dispatch(
|
|
210
|
+
redirectToLogin({
|
|
211
|
+
redirectTo: componentInfo == null ? void 0 : componentInfo.componentName,
|
|
212
|
+
securityConfig
|
|
213
|
+
})
|
|
214
|
+
);
|
|
237
215
|
}
|
|
238
|
-
}, [
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
216
|
+
}, [
|
|
217
|
+
accessLoading,
|
|
218
|
+
isSecurityEnabled,
|
|
219
|
+
isAuthenticated,
|
|
220
|
+
appConfig,
|
|
221
|
+
componentInfo == null ? void 0 : componentInfo.componentType,
|
|
222
|
+
componentInfo == null ? void 0 : componentInfo.componentName,
|
|
223
|
+
dispatch,
|
|
224
|
+
securityConfig
|
|
225
|
+
]);
|
|
226
|
+
const shouldInitialize = useMemo(() => {
|
|
227
|
+
var _a2, _b2;
|
|
243
228
|
if (appContext && !appContext.isAppReady) {
|
|
244
229
|
return false;
|
|
245
230
|
}
|
|
246
|
-
|
|
247
|
-
// Wait for access check to complete
|
|
248
231
|
if (accessLoading) {
|
|
249
232
|
return false;
|
|
250
233
|
}
|
|
251
|
-
|
|
252
|
-
// Don't initialize if no access
|
|
253
234
|
if (!hasAccess && isSecurityEnabled) {
|
|
254
235
|
if (isAuthenticated) {
|
|
255
|
-
|
|
256
|
-
|
|
236
|
+
appContext == null ? void 0 : appContext.notifyApp(
|
|
237
|
+
((_b2 = (_a2 = pageContext == null ? void 0 : pageContext.appLocale) == null ? void 0 : _a2.LABELS) == null ? void 0 : _b2.ACCESS_DENIED) || "Access Denied",
|
|
238
|
+
"Error"
|
|
239
|
+
);
|
|
257
240
|
}
|
|
258
241
|
return false;
|
|
259
242
|
}
|
|
260
243
|
return true;
|
|
261
|
-
}, [appContext
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
(0, _react.useEffect)(function () {
|
|
265
|
-
if (!(appContext !== null && appContext !== void 0 && appContext.isAppReady) || !pageProxyRef.current) {
|
|
244
|
+
}, [appContext == null ? void 0 : appContext.isAppReady, accessLoading, hasAccess, isSecurityEnabled, isAuthenticated]);
|
|
245
|
+
useEffect(() => {
|
|
246
|
+
if (!(appContext == null ? void 0 : appContext.isAppReady) || !pageProxyRef.current) {
|
|
266
247
|
return;
|
|
267
248
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
var updatedVariables = _objectSpread(_objectSpread({}, prev.Variables), appContext.Variables || {});
|
|
272
|
-
var updatedActions = _objectSpread(_objectSpread({}, prev.Actions), appContext.Actions || {});
|
|
273
|
-
|
|
274
|
-
// Update proxy with the same object references
|
|
249
|
+
setPageContext((prev) => {
|
|
250
|
+
const updatedVariables = __spreadValues(__spreadValues({}, prev.Variables), appContext.Variables || {});
|
|
251
|
+
const updatedActions = __spreadValues(__spreadValues({}, prev.Actions), appContext.Actions || {});
|
|
275
252
|
pageProxyRef.current.Variables = updatedVariables;
|
|
276
253
|
pageProxyRef.current.Actions = updatedActions;
|
|
277
|
-
return
|
|
278
|
-
App:
|
|
254
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
255
|
+
App: __spreadProps(__spreadValues({}, prev.App), {
|
|
279
256
|
Variables: appContext.Variables || {},
|
|
280
257
|
Actions: appContext.Actions || {}
|
|
281
258
|
}),
|
|
@@ -283,135 +260,93 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
283
260
|
Actions: updatedActions
|
|
284
261
|
});
|
|
285
262
|
});
|
|
286
|
-
}, [appContext
|
|
287
|
-
|
|
288
|
-
// Main initialization effect - runs only when conditions are met
|
|
289
|
-
(0, _react.useEffect)(function () {
|
|
290
|
-
// Early returns for non-initialization cases
|
|
263
|
+
}, [appContext == null ? void 0 : appContext.isAppReady, appContext == null ? void 0 : appContext.Variables, appContext == null ? void 0 : appContext.Actions]);
|
|
264
|
+
useEffect(() => {
|
|
291
265
|
if (!shouldInitialize || isInitialized || isInitializingRef.current || !isMountedRef.current) {
|
|
292
266
|
return;
|
|
293
267
|
}
|
|
294
|
-
|
|
295
|
-
// Set initialization flag
|
|
296
268
|
isInitializingRef.current = true;
|
|
297
|
-
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
(0, _libErrorSkipper.wrapWithThirdPartyErrorGuard)(pageProxy, appContext, (componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.componentName) || "Prefab");
|
|
372
|
-
|
|
373
|
-
// Setup global wm object for pages
|
|
374
|
-
if ((componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.componentType) === "PAGE") {
|
|
375
|
-
global.wm = appProxy ? _objectSpread(_objectSpread({}, pageProxy), {}, {
|
|
376
|
-
App: appProxy
|
|
377
|
-
}) : pageProxy;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
// Mark as initialized
|
|
381
|
-
setIsInitialized(true);
|
|
382
|
-
} catch (error) {
|
|
383
|
-
console.error("Error during component initialization:", error);
|
|
384
|
-
// Still mark as initialized to prevent hanging
|
|
385
|
-
setIsInitialized(true);
|
|
386
|
-
} finally {
|
|
387
|
-
isInitializingRef.current = false;
|
|
388
|
-
}
|
|
389
|
-
case 1:
|
|
390
|
-
case "end":
|
|
391
|
-
return _context.stop();
|
|
392
|
-
}
|
|
393
|
-
}, _callee);
|
|
394
|
-
}));
|
|
395
|
-
return function initializeComponent() {
|
|
396
|
-
return _ref4.apply(this, arguments);
|
|
397
|
-
};
|
|
398
|
-
}();
|
|
269
|
+
const initializeComponent = async () => {
|
|
270
|
+
var _a2;
|
|
271
|
+
try {
|
|
272
|
+
overriddenPropsRegistryRef.current = createOverriddenPropsRegistry();
|
|
273
|
+
const pageProxy = createStateProxy(
|
|
274
|
+
pageContext,
|
|
275
|
+
[],
|
|
276
|
+
setPageContext,
|
|
277
|
+
overriddenPropsRegistryRef.current
|
|
278
|
+
);
|
|
279
|
+
pageProxyRef.current = pageProxy;
|
|
280
|
+
const pageVariables = getVariables(pageProxy);
|
|
281
|
+
let appVariables = { Variables: {}, Actions: {} };
|
|
282
|
+
if (appContext == null ? void 0 : appContext.isAppReady) {
|
|
283
|
+
appVariables = {
|
|
284
|
+
Variables: appContext.Variables || {},
|
|
285
|
+
Actions: appContext.Actions || {}
|
|
286
|
+
};
|
|
287
|
+
} else {
|
|
288
|
+
const APP_VARIABLES = appstore.get("AppConfig").appVariables;
|
|
289
|
+
appVariables = APP_VARIABLES ? getAppVariablesInstance(pageProxy, APP_VARIABLES) : { Variables: {}, Actions: {} };
|
|
290
|
+
}
|
|
291
|
+
const { Variables, Actions } = mergeVariablesAndActions(pageVariables, appVariables);
|
|
292
|
+
const urlParams = Object.fromEntries(pageParams.entries());
|
|
293
|
+
const newParams = computeMergedPageParams(urlParams, {
|
|
294
|
+
componentType: componentInfo == null ? void 0 : componentInfo.componentType,
|
|
295
|
+
props
|
|
296
|
+
});
|
|
297
|
+
pageProxy.pageParams = newParams;
|
|
298
|
+
if ((componentInfo == null ? void 0 : componentInfo.componentType) !== "PAGE") {
|
|
299
|
+
pageProxy.partialParams = newParams;
|
|
300
|
+
(_a2 = props.onLoad) == null ? void 0 : _a2.call(props, pageProxy);
|
|
301
|
+
}
|
|
302
|
+
appProxy.appLocale = i18n.appLocale || {};
|
|
303
|
+
const localeFormats = {
|
|
304
|
+
date: i18n.dateFormat,
|
|
305
|
+
time: i18n.timeFormat,
|
|
306
|
+
currency: i18n.currencyCode
|
|
307
|
+
};
|
|
308
|
+
appProxy.localeFormats = localeFormats;
|
|
309
|
+
pageProxy.localeFormats = localeFormats;
|
|
310
|
+
pageProxy.Variables = Variables;
|
|
311
|
+
pageProxy.Actions = Actions;
|
|
312
|
+
pageProxy.pageReady = pageReady;
|
|
313
|
+
pageProxy.App = __spreadValues(__spreadValues({}, appProxy), initialAppConfig);
|
|
314
|
+
pageProxy.selectedLocale = i18n.selectedLocale || "en";
|
|
315
|
+
pageProxy.overriddenPropsRegistry = overriddenPropsRegistryRef.current;
|
|
316
|
+
setupVariableSubscriptions(pageVariables.Variables);
|
|
317
|
+
if ((componentInfo == null ? void 0 : componentInfo.componentType) === "PAGE" && appProxy) {
|
|
318
|
+
const pageName2 = componentInfo == null ? void 0 : componentInfo.componentName;
|
|
319
|
+
appProxy.updateActivePage(pageName2);
|
|
320
|
+
appProxy.activePage = pageProxy;
|
|
321
|
+
appProxy.activePageName = pageName2;
|
|
322
|
+
Object.assign(appProxy.Widgets, pageProxy.Widgets);
|
|
323
|
+
} else if ((componentInfo == null ? void 0 : componentInfo.componentName) === "Common" && (componentInfo == null ? void 0 : componentInfo.componentType) === "PARTIAL" && appProxy) {
|
|
324
|
+
Object.assign(appProxy.Widgets, pageProxy.Widgets);
|
|
325
|
+
}
|
|
326
|
+
addPageScript(appProxy, pageProxy);
|
|
327
|
+
wrapWithThirdPartyErrorGuard(
|
|
328
|
+
pageProxy,
|
|
329
|
+
appContext,
|
|
330
|
+
(componentInfo == null ? void 0 : componentInfo.componentName) || "Prefab"
|
|
331
|
+
);
|
|
332
|
+
if ((componentInfo == null ? void 0 : componentInfo.componentType) === "PAGE") {
|
|
333
|
+
global.wm = appProxy ? __spreadProps(__spreadValues({}, pageProxy), { App: appProxy }) : pageProxy;
|
|
334
|
+
}
|
|
335
|
+
setIsInitialized(true);
|
|
336
|
+
} catch (error) {
|
|
337
|
+
console.error("Error during component initialization:", error);
|
|
338
|
+
setIsInitialized(true);
|
|
339
|
+
} finally {
|
|
340
|
+
isInitializingRef.current = false;
|
|
341
|
+
}
|
|
342
|
+
};
|
|
399
343
|
initializeComponent();
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
return function () {
|
|
403
|
-
var _overriddenPropsRegis;
|
|
404
|
-
// Cancel all pending page operations
|
|
344
|
+
return () => {
|
|
345
|
+
var _a2;
|
|
405
346
|
if (pageProxyRef.current) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
_ref5$Actions = _ref5.Actions,
|
|
410
|
-
Actions = _ref5$Actions === void 0 ? {} : _ref5$Actions;
|
|
411
|
-
|
|
412
|
-
// Cancel page variables
|
|
413
|
-
Object.values(Variables).forEach(function (variable) {
|
|
414
|
-
if (variable !== null && variable !== void 0 && variable.cancel && typeof variable.cancel === "function") {
|
|
347
|
+
const { Variables = {}, Actions = {} } = getVariables(pageProxyRef.current) || {};
|
|
348
|
+
Object.values(Variables).forEach((variable) => {
|
|
349
|
+
if ((variable == null ? void 0 : variable.cancel) && typeof variable.cancel === "function") {
|
|
415
350
|
try {
|
|
416
351
|
variable.cancel();
|
|
417
352
|
} catch (error) {
|
|
@@ -419,10 +354,8 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
419
354
|
}
|
|
420
355
|
}
|
|
421
356
|
});
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
Object.values(Actions).forEach(function (action) {
|
|
425
|
-
if (action !== null && action !== void 0 && action.cancel && typeof action.cancel === "function") {
|
|
357
|
+
Object.values(Actions).forEach((action) => {
|
|
358
|
+
if ((action == null ? void 0 : action.cancel) && typeof action.cancel === "function") {
|
|
426
359
|
try {
|
|
427
360
|
action.cancel();
|
|
428
361
|
} catch (error) {
|
|
@@ -431,135 +364,99 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
431
364
|
}
|
|
432
365
|
});
|
|
433
366
|
}
|
|
434
|
-
|
|
435
|
-
// Clear pending startup operations
|
|
436
367
|
pendingStartupOpsRef.current.clear();
|
|
437
|
-
(
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
// Unsubscribe from events
|
|
441
|
-
subscriptionsRef.current.forEach(function (_ref6) {
|
|
442
|
-
var variable = _ref6.variable,
|
|
443
|
-
event = _ref6.event,
|
|
444
|
-
handler = _ref6.handler;
|
|
445
|
-
if (variable !== null && variable !== void 0 && variable.unsubscribe) {
|
|
368
|
+
(_a2 = overriddenPropsRegistryRef.current) == null ? void 0 : _a2.clear();
|
|
369
|
+
subscriptionsRef.current.forEach(({ variable, event, handler }) => {
|
|
370
|
+
if (variable == null ? void 0 : variable.unsubscribe) {
|
|
446
371
|
try {
|
|
447
372
|
variable.unsubscribe(event, handler);
|
|
448
373
|
} catch (error) {
|
|
449
|
-
console.warn(
|
|
374
|
+
console.warn(`Failed to unsubscribe from ${event}:`, error);
|
|
450
375
|
}
|
|
451
376
|
}
|
|
452
377
|
});
|
|
453
378
|
subscriptionsRef.current = [];
|
|
454
379
|
};
|
|
455
|
-
}, [shouldInitialize]);
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
// This MUST happen before executeStartAppOperations() is called (via executeStartup)
|
|
459
|
-
// so that widgets can receive loading state updates when app variables are invoked
|
|
460
|
-
(0, _react.useEffect)(function () {
|
|
461
|
-
if (!(appContext !== null && appContext !== void 0 && appContext.isAppReady) || !pageProxyRef.current || appVarSubscriptionsDoneRef.current) {
|
|
380
|
+
}, [shouldInitialize]);
|
|
381
|
+
useEffect(() => {
|
|
382
|
+
if (!(appContext == null ? void 0 : appContext.isAppReady) || !pageProxyRef.current || appVarSubscriptionsDoneRef.current) {
|
|
462
383
|
return;
|
|
463
384
|
}
|
|
464
385
|
try {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
386
|
+
const { Variables: pageVars = {} } = getVariables(pageProxyRef.current) || {
|
|
387
|
+
Variables: {}
|
|
388
|
+
};
|
|
389
|
+
const pageVarNames = new Set(Object.keys(pageVars || {}));
|
|
390
|
+
subscribeAppVariablesIfNeeded(
|
|
391
|
+
appContext.Variables || {},
|
|
392
|
+
pageVarNames
|
|
393
|
+
);
|
|
472
394
|
appVarSubscriptionsDoneRef.current = true;
|
|
473
395
|
} catch (e) {
|
|
474
|
-
// no-op
|
|
475
396
|
}
|
|
476
|
-
}, [appContext
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
if (newValue && (0, _typeof2["default"])(newValue) === "object") {
|
|
488
|
-
newValue = (0, _cloneDeep["default"])(newValue);
|
|
397
|
+
}, [appContext == null ? void 0 : appContext.isAppReady]);
|
|
398
|
+
useEffect(() => {
|
|
399
|
+
if (prefabInfo && (componentInfo == null ? void 0 : componentInfo.componentType) === "PREFAB") {
|
|
400
|
+
const handlePrefabStateRefresh = (data) => {
|
|
401
|
+
const proxy = pageProxyRef.current;
|
|
402
|
+
Object.keys(data).forEach((key) => {
|
|
403
|
+
var _a2;
|
|
404
|
+
const propKey = data[key].key;
|
|
405
|
+
let newValue = (_a2 = data[key].newValue) != null ? _a2 : data[key].oldValue;
|
|
406
|
+
if (newValue && typeof newValue === "object") {
|
|
407
|
+
newValue = cloneDeep(newValue);
|
|
489
408
|
}
|
|
490
|
-
|
|
491
|
-
// Call onPropertyChange if available
|
|
492
409
|
if (proxy && proxy.onPropertyChange) {
|
|
493
410
|
proxy[propKey] = newValue;
|
|
494
411
|
proxy.onPropertyChange(propKey, newValue, data[key].oldValue);
|
|
495
412
|
}
|
|
496
413
|
});
|
|
497
414
|
};
|
|
498
|
-
|
|
499
|
-
return
|
|
500
|
-
|
|
415
|
+
EVENTEMITTER_METHODS.PREFAB_STATE_SYNC_ON(prefabInfo == null ? void 0 : prefabInfo.name, handlePrefabStateRefresh);
|
|
416
|
+
return () => {
|
|
417
|
+
EVENTEMITTER_METHODS.PREFAB_STATE_SYNC_OFF(prefabInfo == null ? void 0 : prefabInfo.name, handlePrefabStateRefresh);
|
|
501
418
|
};
|
|
502
419
|
}
|
|
503
|
-
}, [prefabInfo, componentInfo
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
var updateState = variable;
|
|
511
|
-
updateState.loading = event === _types.VariableEvents.BEFORE_INVOKE;
|
|
512
|
-
updateState.error = event === _types.VariableEvents.ERROR ? variable : null;
|
|
513
|
-
if ((0, _get["default"])(variable, "spinnerContext") === "page") {
|
|
420
|
+
}, [prefabInfo, componentInfo == null ? void 0 : componentInfo.componentType]);
|
|
421
|
+
const setupVariableSubscriptions = (variables) => {
|
|
422
|
+
const handleVariableEvent = (variableName, event, variable) => {
|
|
423
|
+
const updateState = variable;
|
|
424
|
+
updateState.loading = event === VariableEvents.BEFORE_INVOKE;
|
|
425
|
+
updateState.error = event === VariableEvents.ERROR ? variable : null;
|
|
426
|
+
if (get(variable, "spinnerContext") === "page") {
|
|
514
427
|
if (updateState.loading) {
|
|
515
|
-
|
|
428
|
+
const message = get(variable, "spinnerMessage");
|
|
516
429
|
show(message);
|
|
517
430
|
} else {
|
|
518
431
|
hide();
|
|
519
432
|
}
|
|
520
433
|
}
|
|
521
|
-
setPageContext(
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
})
|
|
525
|
-
});
|
|
526
|
-
if (event ===
|
|
527
|
-
pendingStartupOpsRef.current
|
|
434
|
+
setPageContext((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
435
|
+
Variables: __spreadProps(__spreadValues({}, prev.Variables), {
|
|
436
|
+
[variableName]: updateState
|
|
437
|
+
})
|
|
438
|
+
}));
|
|
439
|
+
if (event === VariableEvents.AFTER_INVOKE) {
|
|
440
|
+
pendingStartupOpsRef.current.delete(variableName);
|
|
528
441
|
}
|
|
529
442
|
};
|
|
530
|
-
|
|
531
|
-
// Set up subscriptions (avoid duplicates by name)
|
|
532
|
-
Object.entries(variables).forEach(function (_ref8) {
|
|
533
|
-
var _ref9 = (0, _slicedToArray2["default"])(_ref8, 2),
|
|
534
|
-
name = _ref9[0],
|
|
535
|
-
variable = _ref9[1];
|
|
443
|
+
Object.entries(variables).forEach(([name, variable]) => {
|
|
536
444
|
if (subscribedVariableNamesRef.current.has(name)) {
|
|
537
445
|
return;
|
|
538
446
|
}
|
|
539
|
-
Object.values(
|
|
540
|
-
|
|
541
|
-
return handleVariableEvent(name, event, variable);
|
|
542
|
-
};
|
|
447
|
+
Object.values(VariableEvents).forEach((event) => {
|
|
448
|
+
const handler = () => handleVariableEvent(name, event, variable);
|
|
543
449
|
if (variable && typeof variable.subscribe === "function") {
|
|
544
450
|
variable.subscribe(event, handler);
|
|
545
|
-
subscriptionsRef.current.push({
|
|
546
|
-
variable: variable,
|
|
547
|
-
event: event,
|
|
548
|
-
handler: handler
|
|
549
|
-
});
|
|
451
|
+
subscriptionsRef.current.push({ variable, event, handler });
|
|
550
452
|
}
|
|
551
453
|
});
|
|
552
454
|
subscribedVariableNamesRef.current.add(name);
|
|
553
455
|
});
|
|
554
456
|
};
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
var appVarsOnly = {};
|
|
559
|
-
Object.entries(appVars || {}).forEach(function (_ref0) {
|
|
560
|
-
var _ref1 = (0, _slicedToArray2["default"])(_ref0, 2),
|
|
561
|
-
name = _ref1[0],
|
|
562
|
-
variable = _ref1[1];
|
|
457
|
+
const subscribeAppVariablesIfNeeded = (appVars, pageVarNames) => {
|
|
458
|
+
const appVarsOnly = {};
|
|
459
|
+
Object.entries(appVars || {}).forEach(([name, variable]) => {
|
|
563
460
|
if (!pageVarNames.has(name) && !subscribedVariableNamesRef.current.has(name)) {
|
|
564
461
|
appVarsOnly[name] = variable;
|
|
565
462
|
}
|
|
@@ -568,203 +465,111 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
568
465
|
setupVariableSubscriptions(appVarsOnly);
|
|
569
466
|
}
|
|
570
467
|
};
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
return
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
startUpActions.forEach(function (name) {
|
|
584
|
-
return pendingStartupOpsRef.current.add(name);
|
|
585
|
-
});
|
|
586
|
-
|
|
587
|
-
// If no startup operations, mark as complete immediately
|
|
588
|
-
if (!(startUpActions.length === 0 && startUpVariables.length === 0)) {
|
|
589
|
-
_context2.next = 5;
|
|
590
|
-
break;
|
|
591
|
-
}
|
|
592
|
-
return _context2.abrupt("return");
|
|
593
|
-
case 5:
|
|
594
|
-
_context2.prev = 5;
|
|
595
|
-
// Execute startup actions
|
|
596
|
-
startUpActions.forEach(function (actionName) {
|
|
597
|
-
var _Actions$actionName;
|
|
598
|
-
if ((_Actions$actionName = Actions[actionName]) !== null && _Actions$actionName !== void 0 && _Actions$actionName.invoke) {
|
|
599
|
-
Actions[actionName].invoke();
|
|
600
|
-
}
|
|
601
|
-
pendingStartupOpsRef.current["delete"](String(actionName));
|
|
602
|
-
});
|
|
603
|
-
|
|
604
|
-
// Execute startup variables
|
|
605
|
-
variablePromises = startUpVariables.map(function (varName) {
|
|
606
|
-
var _Variables$varName;
|
|
607
|
-
if ((_Variables$varName = Variables[varName]) !== null && _Variables$varName !== void 0 && _Variables$varName.invoke) {
|
|
608
|
-
return Variables[varName].invoke()["catch"](function (error) {
|
|
609
|
-
console.log("Error invoking ".concat(varName, ":"), error);
|
|
610
|
-
return null;
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
return Promise.resolve();
|
|
614
|
-
});
|
|
615
|
-
_context2.next = 10;
|
|
616
|
-
return Promise.allSettled(variablePromises);
|
|
617
|
-
case 10:
|
|
618
|
-
startUpVariableLoadedRef.current = true;
|
|
619
|
-
pendingStartupOpsRef.current.clear();
|
|
620
|
-
setTimeout(function () {
|
|
621
|
-
if ((componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.componentType) === "PAGE") {
|
|
622
|
-
appContext === null || appContext === void 0 || appContext.notify("page-variables-data-loaded", {
|
|
623
|
-
pageName: componentInfo === null || componentInfo === void 0 ? void 0 : componentInfo.componentName
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
}, 0);
|
|
627
|
-
_context2.next = 18;
|
|
628
|
-
break;
|
|
629
|
-
case 15:
|
|
630
|
-
_context2.prev = 15;
|
|
631
|
-
_context2.t0 = _context2["catch"](5);
|
|
632
|
-
console.error("Error during startup operations:", _context2.t0);
|
|
633
|
-
case 18:
|
|
634
|
-
case "end":
|
|
635
|
-
return _context2.stop();
|
|
468
|
+
const executeStartupOperations = async (Variables, Actions) => {
|
|
469
|
+
const { startUpActions = [], startUpVariables = [] } = componentInfo || {};
|
|
470
|
+
startUpVariables.forEach((name) => pendingStartupOpsRef.current.add(name));
|
|
471
|
+
startUpActions.forEach((name) => pendingStartupOpsRef.current.add(name));
|
|
472
|
+
if (startUpActions.length === 0 && startUpVariables.length === 0) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
try {
|
|
476
|
+
startUpActions.forEach((actionName) => {
|
|
477
|
+
var _a2;
|
|
478
|
+
if ((_a2 = Actions[actionName]) == null ? void 0 : _a2.invoke) {
|
|
479
|
+
Actions[actionName].invoke();
|
|
636
480
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
481
|
+
pendingStartupOpsRef.current.delete(String(actionName));
|
|
482
|
+
});
|
|
483
|
+
const variablePromises = startUpVariables.map((varName) => {
|
|
484
|
+
var _a2;
|
|
485
|
+
if ((_a2 = Variables[varName]) == null ? void 0 : _a2.invoke) {
|
|
486
|
+
return Variables[varName].invoke().catch((error) => {
|
|
487
|
+
console.log(`Error invoking ${varName}:`, error);
|
|
488
|
+
return null;
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
return Promise.resolve();
|
|
492
|
+
});
|
|
493
|
+
await Promise.allSettled(variablePromises);
|
|
494
|
+
startUpVariableLoadedRef.current = true;
|
|
495
|
+
pendingStartupOpsRef.current.clear();
|
|
496
|
+
setTimeout(() => {
|
|
497
|
+
if ((componentInfo == null ? void 0 : componentInfo.componentType) === "PAGE") {
|
|
498
|
+
appContext == null ? void 0 : appContext.notify("page-variables-data-loaded", {
|
|
499
|
+
pageName: componentInfo == null ? void 0 : componentInfo.componentName
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}, 0);
|
|
503
|
+
} catch (error) {
|
|
504
|
+
console.error("Error during startup operations:", error);
|
|
505
|
+
}
|
|
506
|
+
};
|
|
643
507
|
function layoutReady() {
|
|
644
508
|
setIsLayoutReady(true);
|
|
645
509
|
}
|
|
646
|
-
|
|
647
|
-
// Widget state update function
|
|
648
510
|
function updateWidgetState(widgetName, newProps) {
|
|
649
511
|
if (!widgetName || !newProps || Object.keys(newProps).length === 0) return;
|
|
650
|
-
if ((
|
|
651
|
-
|
|
512
|
+
if (compare(pageContext.Widgets[widgetName], newProps)) return;
|
|
513
|
+
const registry = overriddenPropsRegistryRef.current;
|
|
652
514
|
if (registry) {
|
|
653
|
-
Object.keys(newProps).forEach(
|
|
654
|
-
if (newProps[key] !==
|
|
515
|
+
Object.keys(newProps).forEach((key) => {
|
|
516
|
+
if (newProps[key] !== void 0) {
|
|
655
517
|
registry.trackInternalUpdate(widgetName, key, newProps[key]);
|
|
656
518
|
}
|
|
657
519
|
});
|
|
658
520
|
}
|
|
659
|
-
setPageContext(
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
})
|
|
663
|
-
});
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
if (!(0, _isEqual["default"])((_pageContext$Widgets$ = pageContext.Widgets[widgetName]) === null || _pageContext$Widgets$ === void 0 ? void 0 : _pageContext$Widgets$[key], newProps === null || newProps === void 0 ? void 0 : newProps[key]) && (newProps === null || newProps === void 0 ? void 0 : newProps[key]) !== undefined) {
|
|
670
|
-
var _pageProxyRef$current2;
|
|
671
|
-
if ((_pageProxyRef$current2 = pageProxyRef.current) !== null && _pageProxyRef$current2 !== void 0 && (_pageProxyRef$current2 = _pageProxyRef$current2.Widgets) !== null && _pageProxyRef$current2 !== void 0 && _pageProxyRef$current2[widgetName]) {
|
|
521
|
+
setPageContext((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
522
|
+
Widgets: __spreadProps(__spreadValues({}, prev.Widgets), {
|
|
523
|
+
[widgetName]: __spreadValues(__spreadValues({}, prev.Widgets[widgetName]), newProps)
|
|
524
|
+
})
|
|
525
|
+
}));
|
|
526
|
+
withSuspendedTracking(overriddenPropsRegistryRef.current, () => {
|
|
527
|
+
Object.keys(newProps).forEach((key) => {
|
|
528
|
+
var _a2, _b2, _c2;
|
|
529
|
+
if (!isEqual((_a2 = pageContext.Widgets[widgetName]) == null ? void 0 : _a2[key], newProps == null ? void 0 : newProps[key]) && (newProps == null ? void 0 : newProps[key]) !== void 0) {
|
|
530
|
+
if ((_c2 = (_b2 = pageProxyRef.current) == null ? void 0 : _b2.Widgets) == null ? void 0 : _c2[widgetName]) {
|
|
672
531
|
pageProxyRef.current.Widgets[widgetName][key] = newProps[key];
|
|
673
532
|
}
|
|
674
533
|
}
|
|
675
534
|
});
|
|
676
535
|
});
|
|
677
536
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
537
|
+
async function onContentReady() {
|
|
538
|
+
if (pageContext.onReady) {
|
|
539
|
+
await pageContext.onReady();
|
|
540
|
+
}
|
|
541
|
+
if ((appContext == null ? void 0 : appContext.onPageReady) && pageContext.componentType === "PAGE") {
|
|
542
|
+
appContext.onPageReady(pageContext.componentName, pageProxyRef.current, void 0);
|
|
543
|
+
}
|
|
544
|
+
return Promise.resolve();
|
|
682
545
|
}
|
|
683
|
-
function
|
|
684
|
-
|
|
685
|
-
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
686
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
687
|
-
case 0:
|
|
688
|
-
if (!pageContext.onReady) {
|
|
689
|
-
_context4.next = 3;
|
|
690
|
-
break;
|
|
691
|
-
}
|
|
692
|
-
_context4.next = 3;
|
|
693
|
-
return pageContext.onReady();
|
|
694
|
-
case 3:
|
|
695
|
-
if (appContext !== null && appContext !== void 0 && appContext.onPageReady && pageContext.componentType === "PAGE") {
|
|
696
|
-
appContext.onPageReady(pageContext.componentName, pageProxyRef.current, undefined);
|
|
697
|
-
}
|
|
698
|
-
return _context4.abrupt("return", Promise.resolve());
|
|
699
|
-
case 5:
|
|
700
|
-
case "end":
|
|
701
|
-
return _context4.stop();
|
|
702
|
-
}
|
|
703
|
-
}, _callee4);
|
|
704
|
-
}));
|
|
705
|
-
return _onContentReady.apply(this, arguments);
|
|
546
|
+
async function executeStartup() {
|
|
547
|
+
await (appContext == null ? void 0 : appContext.executeStartAppOperations());
|
|
706
548
|
}
|
|
707
|
-
function
|
|
708
|
-
|
|
549
|
+
async function executePageStartup() {
|
|
550
|
+
await executeStartupOperations(pageContext.Variables, pageContext.Actions);
|
|
709
551
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
case "end":
|
|
719
|
-
return _context5.stop();
|
|
720
|
-
}
|
|
721
|
-
}, _callee5);
|
|
722
|
-
}));
|
|
723
|
-
return _executeStartup.apply(this, arguments);
|
|
724
|
-
}
|
|
725
|
-
function executePageStartup() {
|
|
726
|
-
return _executePageStartup.apply(this, arguments);
|
|
727
|
-
} // Update pageContext.appLocale when i18n.appLocale changes
|
|
728
|
-
function _executePageStartup() {
|
|
729
|
-
_executePageStartup = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
730
|
-
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
731
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
732
|
-
case 0:
|
|
733
|
-
_context6.next = 2;
|
|
734
|
-
return executeStartupOperations(pageContext.Variables, pageContext.Actions);
|
|
735
|
-
case 2:
|
|
736
|
-
case "end":
|
|
737
|
-
return _context6.stop();
|
|
738
|
-
}
|
|
739
|
-
}, _callee6);
|
|
740
|
-
}));
|
|
741
|
-
return _executePageStartup.apply(this, arguments);
|
|
742
|
-
}
|
|
743
|
-
(0, _react.useEffect)(function () {
|
|
744
|
-
var newAppLocale = (0, _merge["default"])({}, i18n.appLocale || {}, (prefabInfo === null || prefabInfo === void 0 ? void 0 : prefabInfo.appLocale) || {});
|
|
745
|
-
if (!(0, _isEqual["default"])(pageContext.appLocale, newAppLocale)) {
|
|
746
|
-
var _pageProxyRef$current3;
|
|
747
|
-
setPageContext(function (prev) {
|
|
748
|
-
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
749
|
-
appLocale: newAppLocale
|
|
750
|
-
});
|
|
751
|
-
});
|
|
752
|
-
if ((_pageProxyRef$current3 = pageProxyRef.current) !== null && _pageProxyRef$current3 !== void 0 && _pageProxyRef$current3.App) {
|
|
552
|
+
useEffect(() => {
|
|
553
|
+
var _a2;
|
|
554
|
+
const newAppLocale = merge({}, i18n.appLocale || {}, (prefabInfo == null ? void 0 : prefabInfo.appLocale) || {});
|
|
555
|
+
if (!isEqual(pageContext.appLocale, newAppLocale)) {
|
|
556
|
+
setPageContext((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
557
|
+
appLocale: newAppLocale
|
|
558
|
+
}));
|
|
559
|
+
if ((_a2 = pageProxyRef.current) == null ? void 0 : _a2.App) {
|
|
753
560
|
pageProxyRef.current.App.appLocale = newAppLocale;
|
|
754
561
|
}
|
|
755
562
|
}
|
|
756
563
|
}, [i18n.appLocale]);
|
|
757
|
-
|
|
758
|
-
|
|
564
|
+
useEffect(() => {
|
|
565
|
+
const localeFormats = {
|
|
759
566
|
date: i18n.dateFormat,
|
|
760
567
|
time: i18n.timeFormat,
|
|
761
568
|
currency: i18n.currencyCode
|
|
762
569
|
};
|
|
763
|
-
setPageContext(
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
});
|
|
767
|
-
});
|
|
570
|
+
setPageContext((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
571
|
+
localeFormats
|
|
572
|
+
}));
|
|
768
573
|
if (pageProxyRef.current) {
|
|
769
574
|
pageProxyRef.current.localeFormats = localeFormats;
|
|
770
575
|
if (pageProxyRef.current.App) {
|
|
@@ -772,138 +577,77 @@ var withPageContext = exports.withPageContext = function withPageContext(Wrapped
|
|
|
772
577
|
}
|
|
773
578
|
}
|
|
774
579
|
}, [i18n.dateFormat, i18n.timeFormat, i18n.currencyCode]);
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
if ((componentInfo
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
})
|
|
784
|
-
});
|
|
785
|
-
});
|
|
580
|
+
const pageName = (appProxy == null ? void 0 : appProxy.activePageName) || "";
|
|
581
|
+
useEffect(() => {
|
|
582
|
+
if ((componentInfo == null ? void 0 : componentInfo.componentType) === "PARTIAL" && pageName) {
|
|
583
|
+
setPageContext((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
584
|
+
App: __spreadProps(__spreadValues({}, prev.App), {
|
|
585
|
+
activePageName: pageName
|
|
586
|
+
})
|
|
587
|
+
}));
|
|
786
588
|
}
|
|
787
589
|
}, [pageName]);
|
|
788
|
-
|
|
789
|
-
// Execute startup when both conditions are met:
|
|
790
|
-
// 1. Page is initialized (context ready)
|
|
791
|
-
// 2. Page component has called pageReady() after widgets have rendered and subscribed
|
|
792
|
-
(0, _react.useEffect)(function () {
|
|
590
|
+
useEffect(() => {
|
|
793
591
|
if (isInitialized && isPageReady && isMountedRef.current && !onStartupCompletedRef.current && pageProxyRef.current) {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
case 5:
|
|
813
|
-
_context3.next = 7;
|
|
814
|
-
return executeStartup();
|
|
815
|
-
case 7:
|
|
816
|
-
_context3.next = 9;
|
|
817
|
-
return onContentReady();
|
|
818
|
-
case 9:
|
|
819
|
-
_context3.next = 11;
|
|
820
|
-
return executePageStartup();
|
|
821
|
-
case 11:
|
|
822
|
-
onStartupCompletedRef.current = true;
|
|
823
|
-
// Handle pending accordion expansion from navigation using Redux
|
|
824
|
-
if (pendingAccordionExpansion) {
|
|
825
|
-
(0, _helper.accordionExpansionHandler)(pageProxyRef, pendingAccordionExpansion, dispatch);
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
// Handle tab selection from URL query parameter or Redux
|
|
829
|
-
// URL parameter is only processed once on initial page load
|
|
830
|
-
// Redux state is used for programmatic navigation
|
|
831
|
-
tabNameFromUrl = !urlTabProcessedRef.current ? pageParams === null || pageParams === void 0 ? void 0 : pageParams.get("tabName") : null;
|
|
832
|
-
tabNameToSelect = tabNameFromUrl || pendingTabSelection;
|
|
833
|
-
if (tabNameToSelect) {
|
|
834
|
-
(0, _helper.tabSelectionHandler)(pageProxyRef, tabNameToSelect, dispatch);
|
|
835
|
-
}
|
|
836
|
-
case 16:
|
|
837
|
-
case "end":
|
|
838
|
-
return _context3.stop();
|
|
839
|
-
}
|
|
840
|
-
}, _callee3);
|
|
841
|
-
}));
|
|
842
|
-
return function runStartup() {
|
|
843
|
-
return _ref12.apply(this, arguments);
|
|
844
|
-
};
|
|
845
|
-
}();
|
|
592
|
+
const runStartup = async () => {
|
|
593
|
+
if (!isMountedRef.current) return;
|
|
594
|
+
if ((securityConfig == null ? void 0 : securityConfig.authenticated) && (appProxy == null ? void 0 : appProxy.executeSessionFailureRequests)) {
|
|
595
|
+
await appProxy.executeSessionFailureRequests();
|
|
596
|
+
}
|
|
597
|
+
await executeStartup();
|
|
598
|
+
await onContentReady();
|
|
599
|
+
await executePageStartup();
|
|
600
|
+
onStartupCompletedRef.current = true;
|
|
601
|
+
if (pendingAccordionExpansion) {
|
|
602
|
+
accordionExpansionHandler(pageProxyRef, pendingAccordionExpansion, dispatch);
|
|
603
|
+
}
|
|
604
|
+
const tabNameFromUrl = !urlTabProcessedRef.current ? pageParams == null ? void 0 : pageParams.get("tabName") : null;
|
|
605
|
+
const tabNameToSelect = tabNameFromUrl || pendingTabSelection;
|
|
606
|
+
if (tabNameToSelect) {
|
|
607
|
+
tabSelectionHandler(pageProxyRef, tabNameToSelect, dispatch);
|
|
608
|
+
}
|
|
609
|
+
};
|
|
846
610
|
runStartup();
|
|
847
611
|
}
|
|
848
612
|
}, [isInitialized, isPageReady]);
|
|
849
|
-
|
|
850
|
-
(0, _react.useEffect)(function () {
|
|
851
|
-
if (startupComplete && (pageContext.type === "PAGE" ? isLayoutReady : true)) {
|
|
852
|
-
onContentReady();
|
|
853
|
-
}
|
|
854
|
-
}, [startupComplete, isLayoutReady]);
|
|
855
|
-
(0, _react.useEffect)(function () {
|
|
613
|
+
useEffect(() => {
|
|
856
614
|
isMountedRef.current = true;
|
|
857
|
-
return
|
|
615
|
+
return () => {
|
|
858
616
|
isMountedRef.current = false;
|
|
859
|
-
|
|
860
|
-
_viewport.viewportService.destroy();
|
|
617
|
+
viewportService.destroy();
|
|
861
618
|
};
|
|
862
619
|
}, []);
|
|
863
|
-
|
|
864
|
-
// Handle access denied case
|
|
865
|
-
if (!accessLoading && !hasAccess && !(componentInfo !== null && componentInfo !== void 0 && componentInfo.isPartOfPrefab)) {
|
|
620
|
+
if (!accessLoading && !hasAccess && !(componentInfo == null ? void 0 : componentInfo.isPartOfPrefab)) {
|
|
866
621
|
return null;
|
|
867
622
|
}
|
|
868
|
-
|
|
869
|
-
// Handle access error case
|
|
870
623
|
if (accessError && !accessLoading) {
|
|
871
|
-
console.error(
|
|
624
|
+
console.error(`Access check failed for ${componentInfo == null ? void 0 : componentInfo.componentName}:`, accessError);
|
|
872
625
|
return null;
|
|
873
626
|
}
|
|
874
|
-
|
|
875
|
-
// Show loading spinner while checking access or app is not ready
|
|
876
627
|
if (accessLoading || appContext && !appContext.isAppReady || !isInitialized) {
|
|
877
|
-
return
|
|
878
|
-
name: "page",
|
|
879
|
-
caption: "",
|
|
880
|
-
listener: {}
|
|
881
|
-
});
|
|
628
|
+
return /* @__PURE__ */ jsx(WmSpinner, { name: "page", caption: "", listener: {} });
|
|
882
629
|
}
|
|
883
|
-
if (appContext
|
|
884
|
-
|
|
885
|
-
appContext.autoUpdateVariables.forEach(
|
|
886
|
-
var
|
|
887
|
-
((
|
|
630
|
+
if ((appContext == null ? void 0 : appContext.autoUpdateVariables) && onStartupCompletedRef.current) {
|
|
631
|
+
const appVariables = appContext.Variables;
|
|
632
|
+
appContext.autoUpdateVariables.forEach((value) => {
|
|
633
|
+
var _a2, _b2;
|
|
634
|
+
((_a2 = appVariables[value]) == null ? void 0 : _a2.invokeOnParamChange) && ((_b2 = appVariables[value]) == null ? void 0 : _b2.invokeOnParamChange());
|
|
888
635
|
});
|
|
889
636
|
}
|
|
890
|
-
if (
|
|
891
|
-
|
|
892
|
-
componentInfo
|
|
893
|
-
var
|
|
894
|
-
(
|
|
637
|
+
if (((_c = componentInfo == null ? void 0 : componentInfo.autoUpdateVariables) == null ? void 0 : _c.length) && onStartupCompletedRef.current) {
|
|
638
|
+
const pageVariables = pageContext.Variables;
|
|
639
|
+
componentInfo.autoUpdateVariables.forEach((value) => {
|
|
640
|
+
var _a2, _b2;
|
|
641
|
+
(_b2 = (_a2 = pageVariables[value]) == null ? void 0 : _a2.invokeOnParamChange) == null ? void 0 : _b2.call(_a2);
|
|
895
642
|
});
|
|
896
643
|
}
|
|
897
|
-
|
|
898
|
-
// Render the component
|
|
899
|
-
return __jsx(_WidgetProvider.WidgetProvider, {
|
|
900
|
-
value: {
|
|
901
|
-
value: pageContext,
|
|
902
|
-
proxy: pageProxyRef.current
|
|
903
|
-
}
|
|
904
|
-
}, __jsx(WrappedComponent, props));
|
|
644
|
+
return /* @__PURE__ */ jsx(WidgetProvider, { value: { value: pageContext, proxy: pageProxyRef.current }, children: /* @__PURE__ */ jsx(WrappedComponent, __spreadValues({}, props)) });
|
|
905
645
|
};
|
|
906
|
-
PageContextComponent.displayName =
|
|
646
|
+
PageContextComponent.displayName = `WithPageContext(${WrappedComponent.displayName || WrappedComponent.name || "Component"})`;
|
|
907
647
|
return PageContextComponent;
|
|
908
648
|
};
|
|
909
|
-
var
|
|
649
|
+
var BasePage_default = withPageContext;
|
|
650
|
+
export {
|
|
651
|
+
BasePage_default as default,
|
|
652
|
+
withPageContext
|
|
653
|
+
};
|