@wavemaker/react-runtime 11.14.1-16.6404
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.js +32 -0
- package/actions/login-action.js +53 -0
- package/actions/logout-action.js +41 -0
- package/actions/navigation-action.js +145 -0
- package/actions/notification-action.js +147 -0
- package/actions/timer-action.js +164 -0
- package/actions/toast-provider.js +111 -0
- package/actions/toast.js +115 -0
- package/actions/toast.service.js +94 -0
- package/actions/types/index.js +11 -0
- package/components/advanced/carousel/index.js +456 -0
- package/components/advanced/carousel/props.js +5 -0
- package/components/advanced/carousel/template.js +72 -0
- package/components/advanced/login/index.js +307 -0
- package/components/advanced/login/props.js +5 -0
- package/components/advanced/marquee/index.js +158 -0
- package/components/advanced/marquee/props.js +5 -0
- package/components/basic/anchor/index.js +239 -0
- package/components/basic/anchor/props.js +5 -0
- package/components/basic/audio/index.js +61 -0
- package/components/basic/html/index.js +158 -0
- package/components/basic/icon/index.js +85 -0
- package/components/basic/iframe/iframe.utils.js +10 -0
- package/components/basic/iframe/index.js +95 -0
- package/components/basic/label/index.js +139 -0
- package/components/basic/message/index.js +120 -0
- package/components/basic/message/props.js +5 -0
- package/components/basic/picture/index.js +117 -0
- package/components/basic/picture/props.js +5 -0
- package/components/basic/progress-bar/index.js +168 -0
- package/components/basic/progress-bar/props.js +18 -0
- package/components/basic/progress-circle/index.js +196 -0
- package/components/basic/progress-circle/props.js +16 -0
- package/components/basic/richtexteditor/index.js +533 -0
- package/components/basic/richtexteditor/props.js +5 -0
- package/components/basic/search/index.js +1023 -0
- package/components/basic/search/props.js +5 -0
- package/components/basic/search/providers.js +350 -0
- package/components/basic/spinner/index.js +202 -0
- package/components/basic/spinner/props.js +12 -0
- package/components/basic/tile/index.js +91 -0
- package/components/basic/tree/Components/TreeNodeComponent.js +142 -0
- package/components/basic/tree/index.js +503 -0
- package/components/basic/tree/props.js +5 -0
- package/components/basic/tree/utils.js +154 -0
- package/components/basic/video/index.js +85 -0
- package/components/basic/video/props.js +5 -0
- package/components/chart/components/barColumnChart/index.js +132 -0
- package/components/chart/components/barColumnChart/props.js +5 -0
- package/components/chart/components/bubbleChart/index.js +176 -0
- package/components/chart/components/bubbleChart/props.js +5 -0
- package/components/chart/components/chartLegend/components/ClassicLegendItem.js +39 -0
- package/components/chart/components/chartLegend/components/FuriousLegendItem.js +81 -0
- package/components/chart/components/chartLegend/index.js +69 -0
- package/components/chart/components/chartLegend/props.js +5 -0
- package/components/chart/components/chartLegend/utils.js +31 -0
- package/components/chart/components/chartTooltip/index.js +53 -0
- package/components/chart/components/chartTooltip/styles.js +37 -0
- package/components/chart/components/chartTooltip/utils.js +23 -0
- package/components/chart/components/cumulativeLineChart/index.js +113 -0
- package/components/chart/components/cumulativeLineChart/props.js +5 -0
- package/components/chart/components/cumulativeLineChart/utils.js +34 -0
- package/components/chart/components/index.js +40 -0
- package/components/chart/components/lineAreaChart/index.js +140 -0
- package/components/chart/components/lineAreaChart/props.js +5 -0
- package/components/chart/components/noDataMessage/index.js +27 -0
- package/components/chart/components/pieDonutChart/index.js +171 -0
- package/components/chart/components/pieDonutChart/props.js +5 -0
- package/components/chart/constant.js +72 -0
- package/components/chart/index.js +930 -0
- package/components/chart/props.js +5 -0
- package/components/chart/utils.js +691 -0
- package/components/common/AppSpinner.js +36 -0
- package/components/common/app-spinner.js +26 -0
- package/components/common/index.js +12 -0
- package/components/constants.js +1208 -0
- package/components/container/accordion/accordion-pane/index.js +108 -0
- package/components/container/accordion/accordion-pane/props.js +11 -0
- package/components/container/accordion/index.js +232 -0
- package/components/container/accordion/props.js +13 -0
- package/components/container/alignment-utils.js +183 -0
- package/components/container/index.js +188 -0
- package/components/container/layout-grid/grid-column/index.js +34 -0
- package/components/container/layout-grid/grid-row/index.js +24 -0
- package/components/container/layout-grid/index.js +33 -0
- package/components/container/linear-layout/index.js +72 -0
- package/components/container/linear-layout/linear-layout-item/index.js +43 -0
- package/components/container/panel/components/panel-header/index.js +144 -0
- package/components/container/panel/components/panel-header/props.js +5 -0
- package/components/container/panel/hooks.js +144 -0
- package/components/container/panel/index.js +286 -0
- package/components/container/panel/props.js +5 -0
- package/components/container/props.js +5 -0
- package/components/container/tabs/index.js +379 -0
- package/components/container/tabs/props.js +20 -0
- package/components/container/tabs/tab-pane/index.js +42 -0
- package/components/container/tabs/tab-pane/props.js +5 -0
- package/components/container/wizard/WizardContext.js +16 -0
- package/components/container/wizard/components/StepComponents.js +100 -0
- package/components/container/wizard/components/WizardStep.js +89 -0
- package/components/container/wizard/index.js +710 -0
- package/components/container/wizard/props.js +5 -0
- package/components/container/wizard/utils.js +133 -0
- package/components/container/wizard/wizard-action/index.js +22 -0
- package/components/container/wizard/wizard-step/index.js +94 -0
- package/components/data/card/card-actions/index.js +24 -0
- package/components/data/card/card-content/index.js +38 -0
- package/components/data/card/card-footer/index.js +24 -0
- package/components/data/card/index.js +246 -0
- package/components/data/card/props.js +5 -0
- package/components/data/form/base-form/constant.js +39 -0
- package/components/data/form/base-form/index.js +460 -0
- package/components/data/form/base-form/props.js +29 -0
- package/components/data/form/base-form/utils.js +42 -0
- package/components/data/form/dynamic-fields/index.js +196 -0
- package/components/data/form/dynamic-fields/props.js +5 -0
- package/components/data/form/dynamic-fields/utils.js +237 -0
- package/components/data/form/form-action/index.js +71 -0
- package/components/data/form/form-body/index.js +26 -0
- package/components/data/form/form-context.js +34 -0
- package/components/data/form/form-controller/props.js +19 -0
- package/components/data/form/form-controller/validation-contrustor.js +313 -0
- package/components/data/form/form-controller/withFormController.js +320 -0
- package/components/data/form/form-field/base-field.js +138 -0
- package/components/data/form/form-field/index.js +36 -0
- package/components/data/form/form-field/props.js +5 -0
- package/components/data/form/form-footer/index.js +26 -0
- package/components/data/form/form-header/index.js +56 -0
- package/components/data/form/index.js +39 -0
- package/components/data/form/props.js +5 -0
- package/components/data/list/components/GroupHeader.js +35 -0
- package/components/data/list/components/GroupedListItems.js +98 -0
- package/components/data/list/components/ListContainer.js +27 -0
- package/components/data/list/components/ListDND.js +241 -0
- package/components/data/list/components/ListHeader.js +59 -0
- package/components/data/list/components/ListItem.js +148 -0
- package/components/data/list/components/ListItemWithTemplate.js +59 -0
- package/components/data/list/components/ListItems.js +231 -0
- package/components/data/list/components/ListPagination.js +165 -0
- package/components/data/list/components/LoadMoreButton.js +39 -0
- package/components/data/list/components/NoDataMessage.js +22 -0
- package/components/data/list/components/StandardListItems.js +84 -0
- package/components/data/list/components/index.js +119 -0
- package/components/data/list/components/props.js +5 -0
- package/components/data/list/hooks/index.js +75 -0
- package/components/data/list/hooks/props.js +5 -0
- package/components/data/list/hooks/useCurrentPageItems.js +48 -0
- package/components/data/list/hooks/useGroupedData.js +37 -0
- package/components/data/list/hooks/useListData.js +60 -0
- package/components/data/list/hooks/useListEffects.js +285 -0
- package/components/data/list/hooks/useListEventHandlers.js +291 -0
- package/components/data/list/hooks/useListPagination.js +168 -0
- package/components/data/list/hooks/useListState.js +98 -0
- package/components/data/list/hooks/useListStateManager.js +195 -0
- package/components/data/list/hooks/usePaginatedGroupedData.js +121 -0
- package/components/data/list/index.js +611 -0
- package/components/data/list/props.js +5 -0
- package/components/data/list/templates/media-template.js +53 -0
- package/components/data/list/utils/constants.js +81 -0
- package/components/data/list/utils/list-helpers.js +173 -0
- package/components/data/list/utils/list-widget-methods.js +114 -0
- package/components/data/live-filter/index.js +279 -0
- package/components/data/live-filter/props.js +12 -0
- package/components/data/live-form/index.js +93 -0
- package/components/data/live-form/props.js +16 -0
- package/components/data/pagination/components/BasicPagination.js +77 -0
- package/components/data/pagination/components/ClassicPagination.js +191 -0
- package/components/data/pagination/components/InlinePagination.js +99 -0
- package/components/data/pagination/components/LoadingComponent.js +31 -0
- package/components/data/pagination/components/PageSizeSelector.js +175 -0
- package/components/data/pagination/components/PagerNavigation.js +105 -0
- package/components/data/pagination/components/TotalRecords.js +52 -0
- package/components/data/pagination/components/index.js +47 -0
- package/components/data/pagination/components/props.js +5 -0
- package/components/data/pagination/hooks/index.js +19 -0
- package/components/data/pagination/hooks/props.js +5 -0
- package/components/data/pagination/hooks/useNavigationSize.js +44 -0
- package/components/data/pagination/hooks/usePagination.js +796 -0
- package/components/data/pagination/index.js +322 -0
- package/components/data/table/components/AddNewRow.js +190 -0
- package/components/data/table/components/EditableCell.js +91 -0
- package/components/data/table/components/FieldValidationError.js +24 -0
- package/components/data/table/components/RowExpansionButton.js +74 -0
- package/components/data/table/components/TableBody.js +279 -0
- package/components/data/table/components/TableFilters.js +325 -0
- package/components/data/table/components/TableFooterActions.js +48 -0
- package/components/data/table/components/TableHeader.js +174 -0
- package/components/data/table/components/TablePanelHeading.js +68 -0
- package/components/data/table/components/index.js +74 -0
- package/components/data/table/hooks/index.js +219 -0
- package/components/data/table/hooks/useCellState.js +117 -0
- package/components/data/table/hooks/useDynamicColumns.js +85 -0
- package/components/data/table/hooks/useEditingState.js +47 -0
- package/components/data/table/hooks/useFormWidget.js +184 -0
- package/components/data/table/hooks/usePaginationState.js +60 -0
- package/components/data/table/hooks/usePanelStructure.js +40 -0
- package/components/data/table/hooks/useResponsiveColumns.js +34 -0
- package/components/data/table/hooks/useRowExpansion.js +110 -0
- package/components/data/table/hooks/useRowHandlers.js +38 -0
- package/components/data/table/hooks/useRowSelection.js +213 -0
- package/components/data/table/hooks/useServerSideSorting.js +165 -0
- package/components/data/table/hooks/useTableColumns.js +263 -0
- package/components/data/table/hooks/useTableData.js +154 -0
- package/components/data/table/hooks/useTableEdit.js +467 -0
- package/components/data/table/hooks/useTableEffects.js +139 -0
- package/components/data/table/hooks/useTableFilter.js +389 -0
- package/components/data/table/hooks/useTableInitialization.js +103 -0
- package/components/data/table/hooks/useTableState.js +69 -0
- package/components/data/table/hooks/useTableStateManager.js +558 -0
- package/components/data/table/index.js +1295 -0
- package/components/data/table/live-table/index.js +232 -0
- package/components/data/table/props.js +5 -0
- package/components/data/table/table-action/index.js +78 -0
- package/components/data/table/table-column/index.js +35 -0
- package/components/data/table/table-row/index.js +49 -0
- package/components/data/table/table-row-action/index.js +74 -0
- package/components/data/table/utils/buildSelectionColumns.js +173 -0
- package/components/data/table/utils/columnBuilder.js +209 -0
- package/components/data/table/utils/columnProxy.js +48 -0
- package/components/data/table/utils/columnWidthDistribution.js +98 -0
- package/components/data/table/utils/constants.js +80 -0
- package/components/data/table/utils/crud-handlers.js +518 -0
- package/components/data/table/utils/dynamic-columns.js +118 -0
- package/components/data/table/utils/index.js +607 -0
- package/components/data/table/utils/renderDisplayCell.js +183 -0
- package/components/data/table/utils/selectionUtils.js +166 -0
- package/components/data/table/utils/table-helpers.js +100 -0
- package/components/data/table/utils/validation.js +124 -0
- package/components/data/types.js +113 -0
- package/components/data/utils/field-data-utils.js +66 -0
- package/components/data/utils/filter-field-util.js +81 -0
- package/components/data/utils/index.js +216 -0
- package/components/dialogs/alert-dialog/index.js +80 -0
- package/components/dialogs/confirm-dialog/index.js +105 -0
- package/components/dialogs/dialog/index.js +56 -0
- package/components/dialogs/dialog-actions/index.js +18 -0
- package/components/dialogs/dialog-body/index.js +21 -0
- package/components/dialogs/dialog-content/index.js +30 -0
- package/components/dialogs/dialog-header/index.js +93 -0
- package/components/dialogs/iframe-dialog/index.js +114 -0
- package/components/dialogs/index.js +129 -0
- package/components/dialogs/login-dialog/index.js +369 -0
- package/components/dialogs/login-dialog/props.js +5 -0
- package/components/dialogs/page-dialog/index.js +96 -0
- package/components/dialogs/withDialogWrapper.js +108 -0
- package/components/form/button/index.js +216 -0
- package/components/form/button-group/index.js +60 -0
- package/components/input/calendar/index.js +546 -0
- package/components/input/calendar/props.js +5 -0
- package/components/input/calendar/utils.js +340 -0
- package/components/input/chips/SortableChip/index.js +115 -0
- package/components/input/chips/SortableChip/props.js +5 -0
- package/components/input/chips/index.js +488 -0
- package/components/input/chips/props.js +5 -0
- package/components/input/chips/utils.js +259 -0
- package/components/input/color-picker/index.js +678 -0
- package/components/input/color-picker/props.js +5 -0
- package/components/input/composite/index.js +137 -0
- package/components/input/currency/index.js +263 -0
- package/components/input/currency/props.js +5 -0
- package/components/input/default/checkbox/index.js +230 -0
- package/components/input/default/checkbox/props.js +5 -0
- package/components/input/default/checkboxset/index.js +476 -0
- package/components/input/default/checkboxset/props.js +5 -0
- package/components/input/default/radioset/index.js +379 -0
- package/components/input/default/radioset/props.js +5 -0
- package/components/input/default/switch/index.js +490 -0
- package/components/input/default/switch/prop.js +5 -0
- package/components/input/epoch/date/components/DatePickerPopover.js +220 -0
- package/components/input/epoch/date/index.js +520 -0
- package/components/input/epoch/date/props.js +5 -0
- package/components/input/epoch/date/styled.js +70 -0
- package/components/input/epoch/date/utils.js +108 -0
- package/components/input/epoch/datetime/index.js +656 -0
- package/components/input/epoch/datetime/props.js +5 -0
- package/components/input/epoch/datetime/styled.js +90 -0
- package/components/input/epoch/datetime/utils.js +244 -0
- package/components/input/epoch/time/index.js +412 -0
- package/components/input/epoch/time/props.js +5 -0
- package/components/input/epoch/time/utils.js +209 -0
- package/components/input/fileupload/Utils.js +134 -0
- package/components/input/fileupload/components/ListItems.js +140 -0
- package/components/input/fileupload/components/MultiUpload.js +85 -0
- package/components/input/fileupload/components/SingleUpload.js +65 -0
- package/components/input/fileupload/index.js +170 -0
- package/components/input/fileupload/props.js +5 -0
- package/components/input/fileupload/useFileUpload.js +400 -0
- package/components/input/number/index.js +295 -0
- package/components/input/number/props.js +5 -0
- package/components/input/rating/index.js +368 -0
- package/components/input/rating/props.js +5 -0
- package/components/input/select/index.js +344 -0
- package/components/input/select/props.js +5 -0
- package/components/input/slider/index.js +167 -0
- package/components/input/slider/props.js +5 -0
- package/components/input/text/index.js +434 -0
- package/components/input/text/props.js +5 -0
- package/components/input/text/util.js +179 -0
- package/components/input/textarea/index.js +347 -0
- package/components/input/textarea/props.js +5 -0
- package/components/layout/footer/index.js +30 -0
- package/components/layout/header/index.js +30 -0
- package/components/layout/leftnav/index.js +44 -0
- package/components/layout/rightnav/index.js +32 -0
- package/components/layout/topnav/index.js +34 -0
- package/components/navbar/index.js +41 -0
- package/components/navbar/nav/index.js +102 -0
- package/components/navbar/nav/props.js +5 -0
- package/components/navbar/nav-item/index.js +44 -0
- package/components/navigation/breadcrumb/index.js +56 -0
- package/components/navigation/breadcrumb/props.js +5 -0
- package/components/navigation/menu/components/ListItems.js +66 -0
- package/components/navigation/menu/constants.js +101 -0
- package/components/navigation/menu/index.js +807 -0
- package/components/navigation/menu/props.js +5 -0
- package/components/navigation/popover/index.js +209 -0
- package/components/navigation/popover/props.js +15 -0
- package/components/page/content/index.js +28 -0
- package/components/page/error-boundary/index.js +108 -0
- package/components/page/index.js +137 -0
- package/components/page/page-content/index.js +23 -0
- package/components/page/partial/index.js +36 -0
- package/components/page/partial-container/index.js +48 -0
- package/components/page/props.js +5 -0
- package/components/page/toast-container/index.js +33 -0
- package/components/prefab/container/index.js +46 -0
- package/components/prefab/index.js +67 -0
- package/context/AppContext.js +25 -0
- package/context/AppSpinnerProvider.js +43 -0
- package/context/LocalizationProvider.js +79 -0
- package/context/PrefabContext.js +66 -0
- package/context/WidgetProvider.js +187 -0
- package/core/app-config.js +1 -0
- package/core/app.service.js +357 -0
- package/core/appVariablesStore.js +20 -0
- package/core/appstore.js +88 -0
- package/core/constants/currency-constant.js +1071 -0
- package/core/constants/events.js +34 -0
- package/core/constants/index.js +27 -0
- package/core/dialog.service.js +76 -0
- package/core/event-notifier.js +151 -0
- package/core/formatter/date-formatters.js +222 -0
- package/core/formatter/index.js +131 -0
- package/core/formatter/number-formatters.js +142 -0
- package/core/formatter/security-formatters.js +323 -0
- package/core/formatter/string-formatters.js +52 -0
- package/core/formatter/types.js +18 -0
- package/core/formatters.js +24 -0
- package/core/proxy-service.js +412 -0
- package/core/script-registry.js +63 -0
- package/core/security.service.js +11 -0
- package/core/util/common.js +33 -0
- package/core/util/dom.js +107 -0
- package/core/util/index.js +136 -0
- package/core/util/security.js +184 -0
- package/core/util/utils.js +189 -0
- package/core/widget-observer.js +98 -0
- package/higherOrder/BaseApp.js +430 -0
- package/higherOrder/BaseAppProps.js +5 -0
- package/higherOrder/BaseDateTime.js +251 -0
- package/higherOrder/BasePage.js +715 -0
- package/higherOrder/BasePartial.js +124 -0
- package/higherOrder/BasePrefab.js +145 -0
- package/higherOrder/DataNav.js +377 -0
- package/higherOrder/helper.js +43 -0
- package/higherOrder/props.js +5 -0
- package/higherOrder/withBaseWrapper.js +183 -0
- package/hooks/useAccess.js +308 -0
- package/hooks/useAppConfig.js +42 -0
- package/hooks/useAuth.js +562 -0
- package/hooks/useDataSourceSubscription.js +125 -0
- package/hooks/useDebounce.js +76 -0
- package/hooks/useDeviceVisibility.js +49 -0
- package/hooks/useHttp.js +338 -0
- package/libs/index.js +20 -0
- package/mui-config/theme-provider.js +17 -0
- package/mui-config/theme.js +371 -0
- package/package-lock.json +10177 -0
- package/package.json +95 -0
- package/store/index.js +33 -0
- package/store/middleware/navigationMiddleware.js +48 -0
- package/store/slices/appConfigSlice.js +103 -0
- package/store/slices/authSlice.js +508 -0
- package/store/slices/i18nSlice.js +206 -0
- package/types/index.js +15 -0
- package/utils/dataset-util.js +174 -0
- package/utils/eval-expression.js +32 -0
- package/utils/form-state.util.js +140 -0
- package/utils/form-utils.js +187 -0
- package/utils/format-util.js +260 -0
- package/utils/page-params-util.js +24 -0
- package/utils/resource-url.js +27 -0
- package/utils/state-persistance.js +343 -0
- package/utils/style-utils.js +73 -0
- package/utils/transformedDataset-utils.js +633 -0
- package/utils/widget-cleanup-util.js +84 -0
- package/utils/widgets.js +99 -0
- package/variables/base-variable.js +173 -0
- package/variables/constants.js +27 -0
- package/variables/live-variable.js +166 -0
- package/variables/model-variable.js +77 -0
- package/variables/service-variable.js +307 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.BaseApp = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _cloneDeep = _interopRequireDefault(require("lodash-es/cloneDeep"));
|
|
14
|
+
var _isEqual = _interopRequireDefault(require("lodash-es/isEqual"));
|
|
15
|
+
var _get2 = _interopRequireDefault(require("lodash-es/get"));
|
|
16
|
+
var _store = require("../store");
|
|
17
|
+
var _useAuth = require("../hooks/useAuth");
|
|
18
|
+
var _i18nSlice = require("../store/slices/i18nSlice");
|
|
19
|
+
var _appstore = _interopRequireDefault(require("../core/appstore"));
|
|
20
|
+
var _appVariablesStore = require("../core/appVariablesStore");
|
|
21
|
+
var _AppContext = _interopRequireDefault(require("../context/AppContext"));
|
|
22
|
+
var _eventNotifier = _interopRequireDefault(require("../core/event-notifier"));
|
|
23
|
+
var _dialog = _interopRequireDefault(require("../core/dialog.service"));
|
|
24
|
+
var _app = require("../core/app.service");
|
|
25
|
+
var _proxyService = require("../core/proxy-service");
|
|
26
|
+
var _helper = require("./helper");
|
|
27
|
+
var _authSlice = require("../store/slices/authSlice");
|
|
28
|
+
var _AppSpinnerProvider = _interopRequireDefault(require("../context/AppSpinnerProvider"));
|
|
29
|
+
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" != _typeof(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); }
|
|
30
|
+
var __jsx = _react["default"].createElement;
|
|
31
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
32
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
33
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
34
|
+
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; }
|
|
35
|
+
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; }
|
|
36
|
+
// HOC function that wraps the app component
|
|
37
|
+
var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript, getAppVariables) {
|
|
38
|
+
var appInfo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
39
|
+
var AppContextComponent = function AppContextComponent(props) {
|
|
40
|
+
var _info$appConfig;
|
|
41
|
+
var dispatch = (0, _store.useAppDispatch)();
|
|
42
|
+
var authContext = (0, _useAuth.useAuth)();
|
|
43
|
+
var i18n = (0, _store.useAppSelector)(function (state) {
|
|
44
|
+
return state.i18n;
|
|
45
|
+
});
|
|
46
|
+
var info = (0, _store.useAppSelector)(function (state) {
|
|
47
|
+
return state.info;
|
|
48
|
+
});
|
|
49
|
+
var _useState = (0, _react.useState)(_objectSpread(_objectSpread({}, _helper.BaseAppInitialState), {}, {
|
|
50
|
+
updateActivePage: updateActivePage,
|
|
51
|
+
changeLocale: changeLocale,
|
|
52
|
+
selectedLocale: i18n.selectedLocale || "en",
|
|
53
|
+
baseUrl: (info === null || info === void 0 || (_info$appConfig = info.appConfig) === null || _info$appConfig === void 0 ? void 0 : _info$appConfig.url) || "",
|
|
54
|
+
appConfig: _objectSpread(_objectSpread({}, info === null || info === void 0 ? void 0 : info.appConfig), {}, {
|
|
55
|
+
SecurityService: authContext,
|
|
56
|
+
loggedInUser: (0, _cloneDeep["default"])(authContext === null || authContext === void 0 ? void 0 : authContext.loggedInUser) || _authSlice.defaultUserState
|
|
57
|
+
}),
|
|
58
|
+
serviceDefinitions: (0, _cloneDeep["default"])((info === null || info === void 0 ? void 0 : info.serviceDefs) || {}),
|
|
59
|
+
notifyApp: notifyApp,
|
|
60
|
+
eval: evaluateExpression,
|
|
61
|
+
openActionDialog: openActionDialog,
|
|
62
|
+
executeStartAppOperations: executeStartAppOperations,
|
|
63
|
+
importModule: _helper.importModule,
|
|
64
|
+
Widgets: {}
|
|
65
|
+
})),
|
|
66
|
+
appContext = _useState[0],
|
|
67
|
+
setAppContext = _useState[1];
|
|
68
|
+
var appProxyRef = (0, _react.useRef)(null);
|
|
69
|
+
var isInitializedRef = (0, _react.useRef)(false);
|
|
70
|
+
var serviceErrorSubscriptionRef = (0, _react.useRef)(null);
|
|
71
|
+
var isVariablesExecutedRef = (0, _react.useRef)(false);
|
|
72
|
+
var registrationTimeoutRef = (0, _react.useRef)(null);
|
|
73
|
+
var pendingWidgetRegistrations = (0, _react.useRef)({});
|
|
74
|
+
|
|
75
|
+
// Set up service error listener using EventNotifier (outside useEffect)
|
|
76
|
+
(0, _react.useEffect)(function () {
|
|
77
|
+
var unsubscribe = _eventNotifier["default"].ROOT.subscribe("SERVICE_ERROR", function (variable, error, options) {
|
|
78
|
+
var _options$xhrObj, _options$xhrObj2, _appProxyRef$current;
|
|
79
|
+
// if error is 401, show login dialog
|
|
80
|
+
if ((options === null || options === void 0 || (_options$xhrObj = options.xhrObj) === null || _options$xhrObj === void 0 ? void 0 : _options$xhrObj.status) === 401) {
|
|
81
|
+
(0, _app.handle401)();
|
|
82
|
+
}
|
|
83
|
+
if ((options === null || options === void 0 || (_options$xhrObj2 = options.xhrObj) === null || _options$xhrObj2 === void 0 ? void 0 : _options$xhrObj2.code) === "ERR_CANCELED") {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if ((_appProxyRef$current = appProxyRef.current) !== null && _appProxyRef$current !== void 0 && _appProxyRef$current.onServiceError && typeof appProxyRef.current.onServiceError === "function") {
|
|
87
|
+
appProxyRef.current.onServiceError(error, options.xhrObj);
|
|
88
|
+
}
|
|
89
|
+
notifyApp(error, "error", "Service Error");
|
|
90
|
+
});
|
|
91
|
+
serviceErrorSubscriptionRef.current = unsubscribe;
|
|
92
|
+
// Cleanup function
|
|
93
|
+
return function () {
|
|
94
|
+
if (serviceErrorSubscriptionRef.current) {
|
|
95
|
+
serviceErrorSubscriptionRef.current();
|
|
96
|
+
}
|
|
97
|
+
// Clear any pending widget registration timeout
|
|
98
|
+
if (registrationTimeoutRef.current) {
|
|
99
|
+
clearTimeout(registrationTimeoutRef.current);
|
|
100
|
+
registrationTimeoutRef.current = null;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}, []);
|
|
104
|
+
|
|
105
|
+
// Initialize app once
|
|
106
|
+
(0, _react.useEffect)(function () {
|
|
107
|
+
if (!(info !== null && info !== void 0 && info.serviceDefs)) return;
|
|
108
|
+
if (isInitializedRef.current) return;
|
|
109
|
+
isInitializedRef.current = true;
|
|
110
|
+
|
|
111
|
+
// initialize app
|
|
112
|
+
initializeApp();
|
|
113
|
+
// Cleanup function
|
|
114
|
+
return function () {
|
|
115
|
+
// Clean up service error subscription
|
|
116
|
+
if (serviceErrorSubscriptionRef.current) {
|
|
117
|
+
serviceErrorSubscriptionRef.current();
|
|
118
|
+
}
|
|
119
|
+
// Clear any pending widget registration timeout
|
|
120
|
+
if (registrationTimeoutRef.current) {
|
|
121
|
+
clearTimeout(registrationTimeoutRef.current);
|
|
122
|
+
registrationTimeoutRef.current = null;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}, [info === null || info === void 0 ? void 0 : info.serviceDefs]);
|
|
126
|
+
function openActionDialog(notification, title) {
|
|
127
|
+
setAppContext(function (prev) {
|
|
128
|
+
if (title) {
|
|
129
|
+
prev.Common[title].open();
|
|
130
|
+
}
|
|
131
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
132
|
+
notification: notification
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function executeStartAppOperations() {
|
|
137
|
+
return _executeStartAppOperations.apply(this, arguments);
|
|
138
|
+
}
|
|
139
|
+
function _executeStartAppOperations() {
|
|
140
|
+
_executeStartAppOperations = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
141
|
+
var startUpVariables, appVariables, variablePromises;
|
|
142
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
143
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
144
|
+
case 0:
|
|
145
|
+
if (!isVariablesExecutedRef.current) {
|
|
146
|
+
_context4.next = 2;
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
return _context4.abrupt("return");
|
|
150
|
+
case 2:
|
|
151
|
+
isVariablesExecutedRef.current = true;
|
|
152
|
+
startUpVariables = appInfo.startUpVariables || [];
|
|
153
|
+
appVariables = appProxyRef.current.Variables; // Execute startup variables
|
|
154
|
+
variablePromises = startUpVariables.map(/*#__PURE__*/function () {
|
|
155
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(varName) {
|
|
156
|
+
var variable;
|
|
157
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
158
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
159
|
+
case 0:
|
|
160
|
+
variable = appVariables[varName];
|
|
161
|
+
if (!(variable && variable.invoke && typeof variable.invoke === "function")) {
|
|
162
|
+
_context3.next = 12;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
_context3.prev = 2;
|
|
166
|
+
_context3.next = 5;
|
|
167
|
+
return variable.invoke();
|
|
168
|
+
case 5:
|
|
169
|
+
return _context3.abrupt("return", _context3.sent);
|
|
170
|
+
case 8:
|
|
171
|
+
_context3.prev = 8;
|
|
172
|
+
_context3.t0 = _context3["catch"](2);
|
|
173
|
+
console.warn("Error invoking startup variable ".concat(varName, ":"), _context3.t0);
|
|
174
|
+
return _context3.abrupt("return", null);
|
|
175
|
+
case 12:
|
|
176
|
+
return _context3.abrupt("return", Promise.resolve());
|
|
177
|
+
case 13:
|
|
178
|
+
case "end":
|
|
179
|
+
return _context3.stop();
|
|
180
|
+
}
|
|
181
|
+
}, _callee3, null, [[2, 8]]);
|
|
182
|
+
}));
|
|
183
|
+
return function (_x) {
|
|
184
|
+
return _ref3.apply(this, arguments);
|
|
185
|
+
};
|
|
186
|
+
}());
|
|
187
|
+
_context4.prev = 6;
|
|
188
|
+
_context4.next = 9;
|
|
189
|
+
return Promise.allSettled(variablePromises);
|
|
190
|
+
case 9:
|
|
191
|
+
// Call onAppVariablesReady after startup variables are loaded
|
|
192
|
+
if (appProxyRef.current.onAppVariablesReady && typeof appProxyRef.current.onAppVariablesReady === "function") {
|
|
193
|
+
appProxyRef.current.onAppVariablesReady();
|
|
194
|
+
}
|
|
195
|
+
_context4.next = 15;
|
|
196
|
+
break;
|
|
197
|
+
case 12:
|
|
198
|
+
_context4.prev = 12;
|
|
199
|
+
_context4.t0 = _context4["catch"](6);
|
|
200
|
+
console.error("Error during app startup operations:", _context4.t0);
|
|
201
|
+
case 15:
|
|
202
|
+
case "end":
|
|
203
|
+
return _context4.stop();
|
|
204
|
+
}
|
|
205
|
+
}, _callee4, null, [[6, 12]]);
|
|
206
|
+
}));
|
|
207
|
+
return _executeStartAppOperations.apply(this, arguments);
|
|
208
|
+
}
|
|
209
|
+
var initializeApp = /*#__PURE__*/function () {
|
|
210
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
211
|
+
var appProxy, appVariables, _get, APP_VARIABLES, executeAppStartup;
|
|
212
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
213
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
214
|
+
case 0:
|
|
215
|
+
_context2.prev = 0;
|
|
216
|
+
appProxy = (0, _proxyService.createStateProxy)(appContext, [], setAppContext);
|
|
217
|
+
appProxyRef.current = appProxy;
|
|
218
|
+
|
|
219
|
+
// Get app variables
|
|
220
|
+
appVariables = {
|
|
221
|
+
Variables: {},
|
|
222
|
+
Actions: {}
|
|
223
|
+
};
|
|
224
|
+
if (getAppVariables && typeof getAppVariables === "function") {
|
|
225
|
+
appVariables = getAppVariables(appProxy);
|
|
226
|
+
} else {
|
|
227
|
+
// Fallback to appstore
|
|
228
|
+
APP_VARIABLES = (_get = _appstore["default"].get("AppConfig")) === null || _get === void 0 ? void 0 : _get.appVariables;
|
|
229
|
+
if (APP_VARIABLES) {
|
|
230
|
+
appVariables = (0, _appVariablesStore.getAppVariablesInstance)(appProxy, APP_VARIABLES);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Set variables and actions in app proxy
|
|
235
|
+
appProxy.Variables = appVariables.Variables;
|
|
236
|
+
appProxy.Actions = appVariables.Actions;
|
|
237
|
+
|
|
238
|
+
// Initialize app script and register callbacks
|
|
239
|
+
if (addAppScript && typeof addAppScript === "function") {
|
|
240
|
+
addAppScript(appProxy);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Execute app startup operations
|
|
244
|
+
executeAppStartup = /*#__PURE__*/function () {
|
|
245
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
246
|
+
var startUpActions, _iterator, _step, actionName, action;
|
|
247
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
248
|
+
while (1) switch (_context.prev = _context.next) {
|
|
249
|
+
case 0:
|
|
250
|
+
startUpActions = appInfo.startUpActions || []; // Execute startup actions
|
|
251
|
+
_iterator = _createForOfIteratorHelper(startUpActions);
|
|
252
|
+
try {
|
|
253
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
254
|
+
actionName = _step.value;
|
|
255
|
+
action = appVariables.Actions[actionName];
|
|
256
|
+
if (action && action.invoke && typeof action.invoke === "function") {
|
|
257
|
+
try {
|
|
258
|
+
action.invoke();
|
|
259
|
+
} catch (error) {
|
|
260
|
+
console.warn("Error invoking startup action ".concat(actionName, ":"), error);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
} catch (err) {
|
|
265
|
+
_iterator.e(err);
|
|
266
|
+
} finally {
|
|
267
|
+
_iterator.f();
|
|
268
|
+
}
|
|
269
|
+
case 3:
|
|
270
|
+
case "end":
|
|
271
|
+
return _context.stop();
|
|
272
|
+
}
|
|
273
|
+
}, _callee);
|
|
274
|
+
}));
|
|
275
|
+
return function executeAppStartup() {
|
|
276
|
+
return _ref2.apply(this, arguments);
|
|
277
|
+
};
|
|
278
|
+
}(); // Execute startup operations
|
|
279
|
+
_context2.next = 11;
|
|
280
|
+
return executeAppStartup();
|
|
281
|
+
case 11:
|
|
282
|
+
// Initialize DialogService in appstore
|
|
283
|
+
_appstore["default"].DialogService.set(_dialog["default"]);
|
|
284
|
+
|
|
285
|
+
// Set app as ready and update context
|
|
286
|
+
setAppContext(function (prev) {
|
|
287
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
288
|
+
Variables: appVariables.Variables,
|
|
289
|
+
Actions: appVariables.Actions,
|
|
290
|
+
appProxy: appProxy,
|
|
291
|
+
isAppReady: true
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
_context2.next = 19;
|
|
295
|
+
break;
|
|
296
|
+
case 15:
|
|
297
|
+
_context2.prev = 15;
|
|
298
|
+
_context2.t0 = _context2["catch"](0);
|
|
299
|
+
console.error("Error initializing app:", _context2.t0);
|
|
300
|
+
setAppContext(function (prev) {
|
|
301
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
302
|
+
isAppReady: true
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
case 19:
|
|
306
|
+
case "end":
|
|
307
|
+
return _context2.stop();
|
|
308
|
+
}
|
|
309
|
+
}, _callee2, null, [[0, 15]]);
|
|
310
|
+
}));
|
|
311
|
+
return function initializeApp() {
|
|
312
|
+
return _ref.apply(this, arguments);
|
|
313
|
+
};
|
|
314
|
+
}();
|
|
315
|
+
function evaluateExpression(fn) {
|
|
316
|
+
var failOnError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
317
|
+
try {
|
|
318
|
+
return fn.call(appContext);
|
|
319
|
+
} catch (e) {
|
|
320
|
+
if (failOnError) {
|
|
321
|
+
throw e;
|
|
322
|
+
} else {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function updateActivePage(pageName) {
|
|
328
|
+
if (appProxyRef.current) {
|
|
329
|
+
var _appProxyRef$current2;
|
|
330
|
+
appProxyRef.current.lastActivePage = (_appProxyRef$current2 = appProxyRef.current) === null || _appProxyRef$current2 === void 0 ? void 0 : _appProxyRef$current2.activePageName;
|
|
331
|
+
appProxyRef.current.activePageName = pageName;
|
|
332
|
+
appProxyRef.current.activePage = appProxyRef.current;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
// Change locale function
|
|
336
|
+
function changeLocale(locale) {
|
|
337
|
+
dispatch((0, _i18nSlice.setSelectedLocaleAndLoadBundle)({
|
|
338
|
+
locale: locale
|
|
339
|
+
}));
|
|
340
|
+
}
|
|
341
|
+
function notifyApp(message, type, title) {
|
|
342
|
+
// App-level notification
|
|
343
|
+
var notificationAction = (0, _get2["default"])(appContext, "Actions.appNotification");
|
|
344
|
+
if (notificationAction) {
|
|
345
|
+
var appNotification = notificationAction.config.paramProvider();
|
|
346
|
+
var newParams = function newParams() {
|
|
347
|
+
return {
|
|
348
|
+
text: message || "Success",
|
|
349
|
+
content: "inline",
|
|
350
|
+
"class": type || "Success",
|
|
351
|
+
duration: appNotification.duration || 3000,
|
|
352
|
+
toasterPosition: appNotification.toasterPosition || "bottom right"
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
notificationAction.config.paramProvider = newParams;
|
|
356
|
+
notificationAction.invoke();
|
|
357
|
+
} else {
|
|
358
|
+
console.warn('The default Action "appNotification" doesn\'t exist in the app. App notified following error:\n ', message);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// For app Level Common Widgets
|
|
363
|
+
var commonComponentsArray = (0, _react.useRef)(function () {
|
|
364
|
+
var commonProp = appInfo === null || appInfo === void 0 ? void 0 : appInfo.common;
|
|
365
|
+
if (!commonProp) {
|
|
366
|
+
return [];
|
|
367
|
+
}
|
|
368
|
+
if (Array.isArray(commonProp)) {
|
|
369
|
+
return commonProp.map(function (comp) {
|
|
370
|
+
return {
|
|
371
|
+
component: comp
|
|
372
|
+
};
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return [{
|
|
376
|
+
component: commonProp
|
|
377
|
+
}];
|
|
378
|
+
}());
|
|
379
|
+
var registerCommonComponent = function registerCommonComponent(commonContext) {
|
|
380
|
+
if (!(commonContext !== null && commonContext !== void 0 && commonContext.Widgets)) return;
|
|
381
|
+
|
|
382
|
+
// Collect all widgets from this component
|
|
383
|
+
Object.keys(commonContext.Widgets).forEach(function (widgetName) {
|
|
384
|
+
pendingWidgetRegistrations.current[widgetName] = commonContext.Widgets[widgetName];
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
// Clear existing timeout and set a new one to batch updates
|
|
388
|
+
if (registrationTimeoutRef.current) {
|
|
389
|
+
clearTimeout(registrationTimeoutRef.current);
|
|
390
|
+
}
|
|
391
|
+
registrationTimeoutRef.current = setTimeout(function () {
|
|
392
|
+
var updatedWidgets = _objectSpread(_objectSpread({}, appContext.Common), pendingWidgetRegistrations.current);
|
|
393
|
+
if (!(0, _isEqual["default"])(updatedWidgets, appContext.Common)) {
|
|
394
|
+
setAppContext(function (prev) {
|
|
395
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
396
|
+
Common: updatedWidgets
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// Clear pending registrations after update
|
|
402
|
+
pendingWidgetRegistrations.current = {};
|
|
403
|
+
registrationTimeoutRef.current = null;
|
|
404
|
+
}, 0); // Use setTimeout with 0 to batch all synchronous calls
|
|
405
|
+
};
|
|
406
|
+
var renderCommonComponents = function renderCommonComponents() {
|
|
407
|
+
if (commonComponentsArray.current.length === 0) return null;
|
|
408
|
+
return commonComponentsArray.current.map(function (commonInfo, index) {
|
|
409
|
+
var Component = commonInfo.component;
|
|
410
|
+
return __jsx(_react["default"].Fragment, {
|
|
411
|
+
key: "component-wrapper-".concat(index)
|
|
412
|
+
}, __jsx(Component, {
|
|
413
|
+
key: "common-component-".concat(index),
|
|
414
|
+
onRender: function onRender(commonComponent) {
|
|
415
|
+
return registerCommonComponent(commonComponent);
|
|
416
|
+
}
|
|
417
|
+
}));
|
|
418
|
+
});
|
|
419
|
+
};
|
|
420
|
+
return __jsx(_AppContext["default"].Provider, {
|
|
421
|
+
value: {
|
|
422
|
+
state: appContext,
|
|
423
|
+
proxy: appProxyRef.current
|
|
424
|
+
}
|
|
425
|
+
}, __jsx(_AppSpinnerProvider["default"], null, renderCommonComponents(), __jsx(WrappedComponent, props)));
|
|
426
|
+
};
|
|
427
|
+
AppContextComponent.displayName = "BaseApp(".concat(WrappedComponent.displayName || WrappedComponent.name || "Component", ")");
|
|
428
|
+
return AppContextComponent;
|
|
429
|
+
};
|
|
430
|
+
var _default = exports["default"] = BaseApp;
|