@wavemaker/react-runtime 11.14.1-rc.236
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 +10183 -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,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.formatMessage = exports.deepCopy = exports.checkPublicAccess = exports._get = exports.VALIDATOR = exports.MONTHNAMES = exports.MATCH_MODES = void 0;
|
|
8
|
+
exports.getCurrentMonth = getCurrentMonth;
|
|
9
|
+
exports.isDefined = exports.getValidJSON = exports.getSessionStorageItem = void 0;
|
|
10
|
+
exports.reload = reload;
|
|
11
|
+
exports.toNumber = exports.setSessionStorageItem = exports.replace = void 0;
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
var _get2 = _interopRequireDefault(require("lodash-es/get"));
|
|
14
|
+
var _store = require("@wavemaker/react-runtime/store");
|
|
15
|
+
var _lodashEs = require("lodash-es");
|
|
16
|
+
var VALIDATOR = exports.VALIDATOR = {
|
|
17
|
+
REQUIRED: "required",
|
|
18
|
+
MAXCHARS: "maxchars",
|
|
19
|
+
MINVALUE: "minvalue",
|
|
20
|
+
MAXVALUE: "maxvalue",
|
|
21
|
+
REGEXP: "regexp",
|
|
22
|
+
MINDATE: "mindate",
|
|
23
|
+
MAXDATE: "maxdate",
|
|
24
|
+
MINTIME: "mintime",
|
|
25
|
+
MAXTIME: "maxtime",
|
|
26
|
+
EXCLUDEDATES: "excludedates",
|
|
27
|
+
EXCLUDEDAYS: "excludedays"
|
|
28
|
+
};
|
|
29
|
+
var MATCH_MODES = exports.MATCH_MODES = {
|
|
30
|
+
STARTS_WITH_IGNORE_CASE: "startignorecase",
|
|
31
|
+
STARTS_WITH: "start",
|
|
32
|
+
ENDS_WITH_IGNORE_CASE: "endignorecase",
|
|
33
|
+
ENDS_WITH: "end",
|
|
34
|
+
CONTAINS: "anywhere",
|
|
35
|
+
CONTAINS_IGNORE_CASE: "anywhereignorecase",
|
|
36
|
+
IS_EQUAL_WITH_IGNORE_CASE: "exactignorecase",
|
|
37
|
+
IS_EQUAL: "exact"
|
|
38
|
+
};
|
|
39
|
+
var MONTHNAMES = exports.MONTHNAMES = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
40
|
+
var checkPublicAccess = exports.checkPublicAccess = function checkPublicAccess(page) {
|
|
41
|
+
var _window$location$path, _store$getState$info$;
|
|
42
|
+
var pageName = page || ((_window$location$path = window.location.pathname) === null || _window$location$path === void 0 ? void 0 : _window$location$path.split("/").at(-1));
|
|
43
|
+
return ((_store$getState$info$ = _store.store.getState().info.appConfig) === null || _store$getState$info$ === void 0 || (_store$getState$info$ = _store$getState$info$.pages) === null || _store$getState$info$ === void 0 || (_store$getState$info$ = _store$getState$info$.find(function (page) {
|
|
44
|
+
return page.name === pageName;
|
|
45
|
+
})) === null || _store$getState$info$ === void 0 ? void 0 : _store$getState$info$.permission) === "PermitAll";
|
|
46
|
+
};
|
|
47
|
+
var setSessionStorageItem = exports.setSessionStorageItem = function setSessionStorageItem(key, value) {
|
|
48
|
+
var id = _store.store.getState().info.appConfig.appProperties.displayName;
|
|
49
|
+
var item = window.sessionStorage.getItem(id);
|
|
50
|
+
if (item) {
|
|
51
|
+
item = JSON.parse(item);
|
|
52
|
+
} else {
|
|
53
|
+
item = {};
|
|
54
|
+
}
|
|
55
|
+
item[key] = value;
|
|
56
|
+
window.sessionStorage.setItem(id, JSON.stringify(item));
|
|
57
|
+
};
|
|
58
|
+
var getSessionStorageItem = exports.getSessionStorageItem = function getSessionStorageItem(key) {
|
|
59
|
+
var id = _store.store.getState().info.appConfig.appProperties.displayName;
|
|
60
|
+
var item = window && window.sessionStorage && window.sessionStorage.getItem(id);
|
|
61
|
+
if (item) {
|
|
62
|
+
item = JSON.parse(item);
|
|
63
|
+
return item[key];
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var formatMessage = exports.formatMessage = function formatMessage(fragment, expression) {
|
|
67
|
+
return (0, _get2["default"])(fragment, "appLocale.".concat(expression), expression);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Reload the app
|
|
71
|
+
function reload() {
|
|
72
|
+
window.location.reload();
|
|
73
|
+
}
|
|
74
|
+
var toNumber = exports.toNumber = function toNumber(value) {
|
|
75
|
+
if (value === null || value === undefined) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return Number(value);
|
|
79
|
+
};
|
|
80
|
+
var _get = exports._get = _get2["default"];
|
|
81
|
+
var _deepCopy = function _deepCopy(o1) {
|
|
82
|
+
for (var _len = arguments.length, o2 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
83
|
+
o2[_key - 1] = arguments[_key];
|
|
84
|
+
}
|
|
85
|
+
o2.forEach(function (o) {
|
|
86
|
+
if (o) {
|
|
87
|
+
Object.keys(o).forEach(function (k) {
|
|
88
|
+
var v = o[k];
|
|
89
|
+
if (v && !(0, _lodashEs.isString)(v) && !(0, _lodashEs.isArray)(v) && (0, _typeof2["default"])(v) === "object") {
|
|
90
|
+
o1[k] = _deepCopy(o1[k] || {}, o[k]);
|
|
91
|
+
} else {
|
|
92
|
+
o1[k] = _deepCopy(v);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return o1;
|
|
98
|
+
};
|
|
99
|
+
var deepCopy = exports.deepCopy = function deepCopy() {
|
|
100
|
+
for (var _len2 = arguments.length, objects = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
101
|
+
objects[_key2] = arguments[_key2];
|
|
102
|
+
}
|
|
103
|
+
return _deepCopy.apply(void 0, [{}].concat(objects));
|
|
104
|
+
};
|
|
105
|
+
var getValidJSON = exports.getValidJSON = function getValidJSON(content) {
|
|
106
|
+
if (!content) {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
var parsedIntValue = parseInt(content, 10);
|
|
111
|
+
return (0, _lodashEs.isObject)(content) || !isNaN(parsedIntValue) ? content : JSON.parse(content);
|
|
112
|
+
} catch (e) {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
var isDefined = exports.isDefined = function isDefined(v) {
|
|
117
|
+
return typeof v !== "undefined";
|
|
118
|
+
};
|
|
119
|
+
var replace = exports.replace = function replace(template, map, parseError) {
|
|
120
|
+
var regEx = /\$\{([^\}]+)\}/g;
|
|
121
|
+
if (!template) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (parseError) {
|
|
125
|
+
regEx = /\{([^\}]+)\}/g;
|
|
126
|
+
}
|
|
127
|
+
return template.replace(regEx, function (match, key) {
|
|
128
|
+
return (0, _get2["default"])(map, key);
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// Get current month function
|
|
133
|
+
function getCurrentMonth() {
|
|
134
|
+
var currentDate = new Date();
|
|
135
|
+
return MONTHNAMES[currentDate.getMonth()];
|
|
136
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useTrustAs = exports.useSafeUrl = exports.useSafeStyle = exports.useSafeResourceUrl = exports.useSafeHtml = exports.securityService = exports.isInsecureContentRequest = exports.SecurityService = exports.SecurityContext = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
12
|
+
var _startsWith = _interopRequireDefault(require("lodash-es/startsWith"));
|
|
13
|
+
var _react = require("react");
|
|
14
|
+
var _SecurityService;
|
|
15
|
+
/**
|
|
16
|
+
* Security context types that can be trusted
|
|
17
|
+
*/
|
|
18
|
+
var SecurityContext = exports.SecurityContext = /*#__PURE__*/function (SecurityContext) {
|
|
19
|
+
SecurityContext["HTML"] = "HTML";
|
|
20
|
+
SecurityContext["STYLE"] = "STYLE";
|
|
21
|
+
SecurityContext["SCRIPT"] = "SCRIPT";
|
|
22
|
+
SecurityContext["URL"] = "URL";
|
|
23
|
+
SecurityContext["RESOURCE_URL"] = "RESOURCE_URL";
|
|
24
|
+
return SecurityContext;
|
|
25
|
+
}({});
|
|
26
|
+
/**
|
|
27
|
+
* Security service for sanitizing and trusting content
|
|
28
|
+
*/
|
|
29
|
+
var SecurityService = exports.SecurityService = /*#__PURE__*/function () {
|
|
30
|
+
function SecurityService() {
|
|
31
|
+
(0, _classCallCheck2["default"])(this, SecurityService);
|
|
32
|
+
} // Private constructor to enforce singleton
|
|
33
|
+
(0, _createClass2["default"])(SecurityService, [{
|
|
34
|
+
key: "sanitizeHtml",
|
|
35
|
+
value:
|
|
36
|
+
/**
|
|
37
|
+
* Sanitize HTML content
|
|
38
|
+
*/
|
|
39
|
+
function sanitizeHtml(content) {
|
|
40
|
+
if (!content) return "";
|
|
41
|
+
return _dompurify["default"].sanitize(content, {
|
|
42
|
+
USE_PROFILES: {
|
|
43
|
+
html: true
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Sanitize style content
|
|
50
|
+
*/
|
|
51
|
+
}, {
|
|
52
|
+
key: "sanitizeStyle",
|
|
53
|
+
value: function sanitizeStyle(content) {
|
|
54
|
+
if (!content) return "";
|
|
55
|
+
return _dompurify["default"].sanitize(content, {
|
|
56
|
+
USE_PROFILES: {
|
|
57
|
+
html: true
|
|
58
|
+
},
|
|
59
|
+
ALLOWED_TAGS: ["style"],
|
|
60
|
+
ALLOWED_ATTR: ["type"]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Sanitize script content
|
|
66
|
+
*/
|
|
67
|
+
}, {
|
|
68
|
+
key: "sanitizeScript",
|
|
69
|
+
value: function sanitizeScript(content) {
|
|
70
|
+
if (!content) return "";
|
|
71
|
+
// Note: DOMPurify strips scripts by default for security
|
|
72
|
+
// Only use this for trusted sources
|
|
73
|
+
return content;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Sanitize URL
|
|
78
|
+
*/
|
|
79
|
+
}, {
|
|
80
|
+
key: "sanitizeUrl",
|
|
81
|
+
value: function sanitizeUrl(content) {
|
|
82
|
+
if (!content) return "";
|
|
83
|
+
// Basic URL sanitization
|
|
84
|
+
var url = content.trim().toLowerCase();
|
|
85
|
+
if (url.startsWith("javascript:") || url.startsWith("data:") || url.startsWith("vbscript:")) {
|
|
86
|
+
return "";
|
|
87
|
+
}
|
|
88
|
+
return content;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Sanitize Resource URL
|
|
93
|
+
*/
|
|
94
|
+
}, {
|
|
95
|
+
key: "sanitizeResourceUrl",
|
|
96
|
+
value: function sanitizeResourceUrl(content) {
|
|
97
|
+
if (!content) return "";
|
|
98
|
+
// First sanitize as a regular URL, then cast to resource URL
|
|
99
|
+
var sanitizedUrl = this.sanitizeUrl(content);
|
|
100
|
+
return sanitizedUrl ? String(sanitizedUrl) : "";
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Trust content based on security context
|
|
105
|
+
*/
|
|
106
|
+
}, {
|
|
107
|
+
key: "trustAs",
|
|
108
|
+
value: function trustAs(content, context) {
|
|
109
|
+
if (!content) return "";
|
|
110
|
+
switch (context) {
|
|
111
|
+
case SecurityContext.HTML:
|
|
112
|
+
return this.sanitizeHtml(content);
|
|
113
|
+
case SecurityContext.STYLE:
|
|
114
|
+
return this.sanitizeStyle(content);
|
|
115
|
+
case SecurityContext.SCRIPT:
|
|
116
|
+
return this.sanitizeScript(content);
|
|
117
|
+
case SecurityContext.URL:
|
|
118
|
+
return this.sanitizeUrl(content);
|
|
119
|
+
case SecurityContext.RESOURCE_URL:
|
|
120
|
+
return this.sanitizeResourceUrl(content);
|
|
121
|
+
default:
|
|
122
|
+
return "";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}], [{
|
|
126
|
+
key: "getInstance",
|
|
127
|
+
value: function getInstance() {
|
|
128
|
+
if (!SecurityService.instance) {
|
|
129
|
+
SecurityService.instance = new SecurityService();
|
|
130
|
+
}
|
|
131
|
+
return SecurityService.instance;
|
|
132
|
+
}
|
|
133
|
+
}]);
|
|
134
|
+
return SecurityService;
|
|
135
|
+
}(); // Create hooks for easy use in React components
|
|
136
|
+
_SecurityService = SecurityService;
|
|
137
|
+
(0, _defineProperty2["default"])(SecurityService, "instance", void 0);
|
|
138
|
+
var useTrustAs = exports.useTrustAs = function useTrustAs(content, context) {
|
|
139
|
+
return (0, _react.useMemo)(function () {
|
|
140
|
+
return SecurityService.getInstance().trustAs(content, context);
|
|
141
|
+
}, [content, context]);
|
|
142
|
+
};
|
|
143
|
+
var useSafeHtml = exports.useSafeHtml = function useSafeHtml(content) {
|
|
144
|
+
return (0, _react.useMemo)(function () {
|
|
145
|
+
return SecurityService.getInstance().sanitizeHtml(content);
|
|
146
|
+
}, [content]);
|
|
147
|
+
};
|
|
148
|
+
var useSafeStyle = exports.useSafeStyle = function useSafeStyle(content) {
|
|
149
|
+
return (0, _react.useMemo)(function () {
|
|
150
|
+
return SecurityService.getInstance().sanitizeStyle(content);
|
|
151
|
+
}, [content]);
|
|
152
|
+
};
|
|
153
|
+
var useSafeUrl = exports.useSafeUrl = function useSafeUrl(content) {
|
|
154
|
+
return (0, _react.useMemo)(function () {
|
|
155
|
+
return SecurityService.getInstance().sanitizeUrl(content);
|
|
156
|
+
}, [content]);
|
|
157
|
+
};
|
|
158
|
+
var useSafeResourceUrl = exports.useSafeResourceUrl = function useSafeResourceUrl(content) {
|
|
159
|
+
return (0, _react.useMemo)(function () {
|
|
160
|
+
return SecurityService.getInstance().sanitizeResourceUrl(content);
|
|
161
|
+
}, [content]);
|
|
162
|
+
};
|
|
163
|
+
var isInsecureContentRequest = exports.isInsecureContentRequest = function isInsecureContentRequest(url) {
|
|
164
|
+
var REGEX_DATA_URL = /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i;
|
|
165
|
+
var parser = document.createElement("a");
|
|
166
|
+
parser.href = url;
|
|
167
|
+
|
|
168
|
+
// for relative urls IE returns the protocol as empty string
|
|
169
|
+
if (parser.protocol === "") {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// If the inputted source is a base64 url, do not throw insecure content error
|
|
174
|
+
if (REGEX_DATA_URL.test(url)) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
if ((0, _startsWith["default"])(location.href, "https://")) {
|
|
178
|
+
return parser.protocol !== "https:" && parser.protocol !== "wss:";
|
|
179
|
+
}
|
|
180
|
+
return false;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// Export singleton instance
|
|
184
|
+
var securityService = exports.securityService = SecurityService.getInstance();
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.triggerItemAction = exports.openLink = exports.isJQueryError = exports.isInsecureContentRequest = exports.getUrlParams = exports.getRouteNameFromLink = exports.Utils = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _navigationMiddleware = require("@wavemaker/react-runtime/store/middleware/navigationMiddleware");
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
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; } } }; }
|
|
12
|
+
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; } }
|
|
13
|
+
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; }
|
|
14
|
+
var REGEX = {
|
|
15
|
+
SNAKE_CASE: /[A-Z]/g,
|
|
16
|
+
ANDROID: /Android/i,
|
|
17
|
+
IPHONE: /iPhone/i,
|
|
18
|
+
IPOD: /iPod/i,
|
|
19
|
+
IPAD: /iPad/i,
|
|
20
|
+
MAC: /Mac/i,
|
|
21
|
+
ANDROID_TABLET: /android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i,
|
|
22
|
+
MOBILE: /Mobile/i,
|
|
23
|
+
WINDOWS: /Windows Phone/i,
|
|
24
|
+
SUPPORTED_IMAGE_FORMAT: /\.(bmp|gif|jpe|jpg|jpeg|tif|tiff|pbm|png|ico)$/i,
|
|
25
|
+
SUPPORTED_FILE_FORMAT: /\.(txt|js|css|html|script|properties|json|java|xml|smd|xmi|sql|log|wsdl|vm|ftl|jrxml|yml|yaml|md|less|jsp)$/i,
|
|
26
|
+
SUPPORTED_AUDIO_FORMAT: /\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,
|
|
27
|
+
SUPPORTED_VIDEO_FORMAT: /\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,
|
|
28
|
+
PAGE_RESOURCE_PATH: /^\/pages\/.*\.(js|css|html|json)$/,
|
|
29
|
+
MIN_PAGE_RESOURCE_PATH: /.*(page.min.html)$/,
|
|
30
|
+
VALID_EMAIL: /^[a-zA-Z][\w.+]+@[a-zA-Z_]+?\.[a-zA-Z.]{1,4}[a-zA-Z]$/,
|
|
31
|
+
VALID_WEB_URL: /^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,
|
|
32
|
+
VALID_WEBSOCKET_URL: /^(ws[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,
|
|
33
|
+
VALID_RELATIVE_URL: /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,
|
|
34
|
+
REPLACE_PATTERN: /\$\{([^\}]+)\}/g,
|
|
35
|
+
ZIP_FILE: /\.zip$/i,
|
|
36
|
+
EXE_FILE: /\.exe$/i,
|
|
37
|
+
NO_QUOTES_ALLOWED: /^[^'|"]*$/,
|
|
38
|
+
NO_DOUBLE_QUOTES_ALLOWED: /^[^"]*$/,
|
|
39
|
+
VALID_HTML: /<[a-z][\s\S]*>/i,
|
|
40
|
+
VALID_PASSWORD: /^[0-9a-zA-Z-_.@&*!#$%]+$/,
|
|
41
|
+
SPECIAL_CHARACTERS: /[^A-Z0-9a-z_]+/i,
|
|
42
|
+
APP_SERVER_URL_FORMAT: /^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9\.\-]+([:]?[0-9]{2,5}|\.[a-zA-Z]{2,5}[\.]{0,1})\/+[^?#&=]+$/,
|
|
43
|
+
JSON_DATE_FORMAT: /\d{4}-[0-1]\d-[0-3]\d(T[0-2]\d:[0-5]\d:[0-5]\d.\d{1,3}Z$)?/,
|
|
44
|
+
DATA_URL: /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,
|
|
45
|
+
ISO_DATE_FORMAT: /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* this method checks if a given string starts with the given string
|
|
50
|
+
*/
|
|
51
|
+
var stringStartsWith = function stringStartsWith(str, startsWith, ignoreCase) {
|
|
52
|
+
if (!str) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
var regEx = new RegExp("^" + startsWith, ignoreCase ? "i" : "");
|
|
56
|
+
return regEx.test(str);
|
|
57
|
+
};
|
|
58
|
+
var isInsecureContentRequest = exports.isInsecureContentRequest = function isInsecureContentRequest(url) {
|
|
59
|
+
var parser = document.createElement("a");
|
|
60
|
+
parser.href = url;
|
|
61
|
+
|
|
62
|
+
// for relative urls IE returns the protocol as empty string
|
|
63
|
+
if (parser.protocol === "") {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// If the inputted source is a base64 url, do not throw insecure content error
|
|
68
|
+
if (REGEX.DATA_URL.test(url)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
if (stringStartsWith(location.href, "https://")) {
|
|
72
|
+
return parser.protocol !== "https:" && parser.protocol !== "wss:";
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
};
|
|
76
|
+
var Utils = exports.Utils = {
|
|
77
|
+
isInsecureContentRequest: isInsecureContentRequest
|
|
78
|
+
};
|
|
79
|
+
var isJQueryError = exports.isJQueryError = function isJQueryError(error) {
|
|
80
|
+
if (!error.stack) return false;
|
|
81
|
+
var UnSupportedFunctionality = ["jQuery", "$"];
|
|
82
|
+
|
|
83
|
+
// Get the first line of stack that points to your code
|
|
84
|
+
if (error.message && UnSupportedFunctionality.some(function (func) {
|
|
85
|
+
return error.message.includes(func);
|
|
86
|
+
})) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
var stackLines = error.stack.split("\n");
|
|
90
|
+
var _iterator = _createForOfIteratorHelper(stackLines),
|
|
91
|
+
_step;
|
|
92
|
+
try {
|
|
93
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
94
|
+
var line = _step.value;
|
|
95
|
+
// Skip internal/node_modules lines, look for your code
|
|
96
|
+
if (!line.includes("node_modules") && !line.includes("internal")) {
|
|
97
|
+
// Check if this line contains jQuery access
|
|
98
|
+
if (line.toLowerCase().includes("jquery") || line.toLowerCase().includes("$")) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
} catch (err) {
|
|
104
|
+
_iterator.e(err);
|
|
105
|
+
} finally {
|
|
106
|
+
_iterator.f();
|
|
107
|
+
}
|
|
108
|
+
return false;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Extracts query parameters from a URL using URLSearchParams
|
|
113
|
+
* @param link - URL string (e.g., "#/page?param1=value1¶m2=value2")
|
|
114
|
+
* @returns Object with query parameters (automatically URL-decoded)
|
|
115
|
+
*/
|
|
116
|
+
var getUrlParams = exports.getUrlParams = function getUrlParams(link) {
|
|
117
|
+
var params = {};
|
|
118
|
+
var index = link.indexOf("?");
|
|
119
|
+
if (index !== -1) {
|
|
120
|
+
var queryString = link.substring(index + 1);
|
|
121
|
+
var searchParams = new URLSearchParams(queryString);
|
|
122
|
+
searchParams.forEach(function (value, key) {
|
|
123
|
+
params[key] = value;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return params;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Extracts route name from a link
|
|
131
|
+
* @param link - URL string (e.g., "#/page?param=value")
|
|
132
|
+
* @returns Route name (e.g., "/page")
|
|
133
|
+
*/
|
|
134
|
+
var getRouteNameFromLink = exports.getRouteNameFromLink = function getRouteNameFromLink(link) {
|
|
135
|
+
link = link.replace("#/", "/");
|
|
136
|
+
var index = link.indexOf("?");
|
|
137
|
+
if (index !== -1) {
|
|
138
|
+
link = link.substring(0, index);
|
|
139
|
+
}
|
|
140
|
+
return link;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Opens a link in browser window
|
|
145
|
+
* @param link - URL to open
|
|
146
|
+
* @param target - Target attribute (_blank, _self, etc.)
|
|
147
|
+
*/
|
|
148
|
+
var openLink = exports.openLink = function openLink(link) {
|
|
149
|
+
var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "_self";
|
|
150
|
+
window.open(link, target);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Triggers navigation action for menu item
|
|
155
|
+
* Mimics Angular WaveMaker behavior:
|
|
156
|
+
* 1. Executes item.action if present
|
|
157
|
+
* 2. Then navigates to item.link if present
|
|
158
|
+
*/
|
|
159
|
+
var triggerItemAction = exports.triggerItemAction = function triggerItemAction(item) {
|
|
160
|
+
var router = (0, _navigationMiddleware.getRouterInstance)();
|
|
161
|
+
var originalLink = item === null || item === void 0 ? void 0 : item.link;
|
|
162
|
+
var linkTarget = item === null || item === void 0 ? void 0 : item.target;
|
|
163
|
+
if (!originalLink || originalLink === "#" || originalLink === "javascript:void(0)") {
|
|
164
|
+
return; // No navigation needed
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Check if it's an internal navigation link (starts with # but not external)
|
|
168
|
+
if (originalLink.startsWith("#") && (!linkTarget || linkTarget === "_self")) {
|
|
169
|
+
// Internal navigation - handle both "#/page" and "#page" formats
|
|
170
|
+
var queryParams = getUrlParams(originalLink);
|
|
171
|
+
var routeName = getRouteNameFromLink(originalLink);
|
|
172
|
+
routeName = (0, _constants.hyperLinkMofify)(routeName);
|
|
173
|
+
if (Object.keys(queryParams).length > 0) {
|
|
174
|
+
var queryString = Object.entries(queryParams).map(function (_ref) {
|
|
175
|
+
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
176
|
+
key = _ref2[0],
|
|
177
|
+
value = _ref2[1];
|
|
178
|
+
return "".concat(key, "=").concat(encodeURIComponent(value));
|
|
179
|
+
}).join("&");
|
|
180
|
+
router === null || router === void 0 || router.push("".concat(routeName, "?").concat(queryString));
|
|
181
|
+
} else {
|
|
182
|
+
router === null || router === void 0 || router.push(routeName);
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
// External link or link with different target
|
|
186
|
+
// For external links, use as-is (don't apply hyperLinkMofify)
|
|
187
|
+
openLink(originalLink, linkTarget);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.widgetElementCallbacks = exports.findWidgetElement = void 0;
|
|
7
|
+
// Global DOM observer for widget element tracking
|
|
8
|
+
var globalObserver = null;
|
|
9
|
+
var widgetElementCallbacks = exports.widgetElementCallbacks = new Map();
|
|
10
|
+
|
|
11
|
+
// Initialize global observer once
|
|
12
|
+
var initializeGlobalObserver = function initializeGlobalObserver() {
|
|
13
|
+
if (globalObserver || typeof window === "undefined") return;
|
|
14
|
+
globalObserver = new MutationObserver(function (mutations) {
|
|
15
|
+
mutations.forEach(function (mutation) {
|
|
16
|
+
// Handle added nodes
|
|
17
|
+
mutation.addedNodes.forEach(function (node) {
|
|
18
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
19
|
+
checkForWidgetElements(node);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
globalObserver.observe(document.body, {
|
|
25
|
+
childList: true,
|
|
26
|
+
subtree: true
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Check if element matches any registered widgets
|
|
31
|
+
var checkForWidgetElements = function checkForWidgetElements(element) {
|
|
32
|
+
var widgetId = element.getAttribute("data-widget-id");
|
|
33
|
+
var name = element.getAttribute("name");
|
|
34
|
+
if (name) {
|
|
35
|
+
var key = widgetId ? "".concat(name, ":").concat(widgetId) : name;
|
|
36
|
+
var callbacks = widgetElementCallbacks.get(key);
|
|
37
|
+
if (callbacks) {
|
|
38
|
+
callbacks.forEach(function (callback) {
|
|
39
|
+
return callback(element);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Check descendants
|
|
45
|
+
var descendants = element.querySelectorAll("[data-widget-id], [name]");
|
|
46
|
+
descendants.forEach(function (desc) {
|
|
47
|
+
var descWidgetId = desc.getAttribute("data-widget-id");
|
|
48
|
+
var descName = desc.getAttribute("name");
|
|
49
|
+
if (descName) {
|
|
50
|
+
var _key = descWidgetId ? "".concat(descName, ":").concat(descWidgetId) : descName;
|
|
51
|
+
var _callbacks = widgetElementCallbacks.get(_key);
|
|
52
|
+
if (_callbacks) {
|
|
53
|
+
_callbacks.forEach(function (callback) {
|
|
54
|
+
return callback(desc);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Helper function to find widget elements
|
|
62
|
+
var findWidgetElement = exports.findWidgetElement = function findWidgetElement(widgetName, widgetId) {
|
|
63
|
+
// Strategy 1: Find by widget-id (most specific)
|
|
64
|
+
if (widgetId) {
|
|
65
|
+
var _element = document.querySelector("[data-widget-id=\"".concat(widgetId, "\"]"));
|
|
66
|
+
if (_element) return _element;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Strategy 2: Find by name attribute
|
|
70
|
+
if (widgetName) {
|
|
71
|
+
var _element2 = document.querySelector("[name=\"".concat(widgetName, "\"]"));
|
|
72
|
+
if (_element2) return _element2;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Strategy 3: Find by class name
|
|
76
|
+
if (widgetName) {
|
|
77
|
+
var _element3 = document.querySelector(".".concat(widgetName));
|
|
78
|
+
if (_element3) return _element3;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Strategy 4: Find by id
|
|
82
|
+
if (widgetName) {
|
|
83
|
+
var _element4 = document.querySelector("#".concat(widgetName));
|
|
84
|
+
if (_element4) return _element4;
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Export the widget element callbacks map for use in proxy service
|
|
90
|
+
|
|
91
|
+
// Auto-initialize observer
|
|
92
|
+
if (typeof window !== "undefined") {
|
|
93
|
+
if (document.readyState === "loading") {
|
|
94
|
+
document.addEventListener("DOMContentLoaded", initializeGlobalObserver);
|
|
95
|
+
} else {
|
|
96
|
+
initializeGlobalObserver();
|
|
97
|
+
}
|
|
98
|
+
}
|