@wavemaker-ai/react-runtime 1.0.0-rc.309 → 1.0.0-rc.647469
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/navigation-action.js +5 -23
- package/components/advanced/carousel/index.d.ts +0 -1
- package/components/advanced/carousel/index.js +1 -2
- package/components/advanced/carousel/template.d.ts +0 -1
- package/components/advanced/carousel/template.js +1 -2
- package/components/advanced/login/index.d.ts +0 -1
- package/components/advanced/marquee/index.d.ts +0 -1
- package/components/advanced/marquee/index.js +1 -2
- package/components/basic/anchor/index.d.ts +0 -1
- package/components/basic/anchor/index.js +3 -4
- package/components/basic/audio/index.d.ts +0 -1
- package/components/basic/audio/index.js +2 -3
- package/components/basic/html/index.d.ts +0 -1
- package/components/basic/icon/index.d.ts +0 -1
- package/components/basic/icon/index.js +7 -4
- package/components/basic/iframe/iframe.utils.d.ts +1 -1
- package/components/basic/iframe/iframe.utils.js +4 -8
- package/components/basic/iframe/index.d.ts +0 -1
- package/components/basic/label/index.d.ts +0 -1
- package/components/basic/label/index.js +2 -3
- package/components/basic/message/index.js +1 -1
- package/components/basic/picture/index.d.ts +0 -1
- package/components/basic/picture/index.js +4 -3
- package/components/basic/progress-bar/index.d.ts +0 -1
- package/components/basic/progress-bar/index.js +1 -2
- package/components/basic/progress-circle/index.d.ts +0 -1
- package/components/basic/richtexteditor/index.d.ts +0 -2
- package/components/basic/search/index.d.ts +0 -3
- package/components/basic/search/index.js +4 -7
- package/components/basic/search/props.d.ts +0 -2
- package/components/basic/spinner/index.d.ts +0 -1
- package/components/basic/tile/index.d.ts +0 -1
- package/components/basic/tile/index.js +1 -2
- package/components/basic/tree/Components/TreeNodeComponent.js +5 -9
- package/components/basic/tree/index.d.ts +0 -1
- package/components/basic/tree/index.js +3 -14
- package/components/basic/tree/utils.d.ts +0 -2
- package/components/basic/tree/utils.js +1 -11
- package/components/basic/video/index.d.ts +0 -1
- package/components/basic/video/index.js +23 -40
- package/components/chart/index.d.ts +0 -1
- package/components/common/AppSpinner.js +5 -2
- package/components/container/accordion/accordion-pane/index.d.ts +0 -1
- package/components/container/accordion/accordion-pane/index.js +4 -1
- package/components/container/accordion/index.d.ts +0 -1
- package/components/container/index.d.ts +0 -3
- package/components/container/index.js +1 -6
- package/components/container/layout-grid/grid-column/index.d.ts +0 -1
- package/components/container/layout-grid/grid-row/index.d.ts +0 -1
- package/components/container/layout-grid/index.d.ts +0 -1
- package/components/container/layout-grid/index.js +8 -4
- package/components/container/linear-layout/index.d.ts +0 -1
- package/components/container/linear-layout/linear-layout-item/index.d.ts +0 -1
- package/components/container/panel/components/panel-header/index.js +6 -11
- package/components/container/panel/components/panel-header/props.d.ts +0 -5
- package/components/container/panel/index.d.ts +0 -1
- package/components/container/panel/index.js +1 -2
- package/components/container/props.d.ts +0 -2
- package/components/container/repeat-template/index.d.ts +1 -22
- package/components/container/repeat-template/index.js +1 -2
- package/components/container/tabs/index.d.ts +1 -3
- package/components/container/tabs/index.js +51 -102
- package/components/container/tabs/props.d.ts +0 -12
- package/components/container/tabs/tab-pane/index.d.ts +0 -1
- package/components/container/tabs/tab-pane/index.js +11 -28
- package/components/container/wizard/index.d.ts +0 -2
- package/components/container/wizard/wizard-step/index.d.ts +0 -1
- package/components/container/wizard/wizard-step/index.js +2 -2
- package/components/data/card/card-actions/index.d.ts +0 -1
- package/components/data/card/card-actions/index.js +5 -3
- package/components/data/card/card-content/index.d.ts +0 -1
- package/components/data/card/card-content/index.js +13 -3
- package/components/data/card/card-footer/index.d.ts +0 -1
- package/components/data/card/card-footer/index.js +5 -3
- package/components/data/card/index.d.ts +0 -1
- package/components/data/card/index.js +14 -3
- package/components/data/form/dynamic-fields/index.js +1 -7
- package/components/data/form/dynamic-fields/props.d.ts +0 -1
- package/components/data/form/form-action/index.d.ts +0 -2
- package/components/data/form/form-body/index.js +1 -2
- package/components/data/form/form-field/base-field.js +3 -4
- package/components/data/form/form-footer/index.js +1 -2
- package/components/data/list/components/ListItemWithTemplate.js +2 -4
- package/components/data/list/hooks/props.d.ts +2 -2
- package/components/data/list/hooks/useListEventHandlers.js +6 -6
- package/components/data/list/index.d.ts +0 -2
- package/components/data/list/index.js +4 -3
- package/components/data/list/props.d.ts +1 -2
- package/components/data/list/utils/list-widget-methods.d.ts +1 -2
- package/components/data/table/components/RowCells.d.ts +2 -16
- package/components/data/table/components/RowCells.js +24 -38
- package/components/data/table/components/TableBody.js +3 -11
- package/components/data/table/components/TableDataRow.d.ts +0 -3
- package/components/data/table/components/TableDataRow.js +3 -11
- package/components/data/table/components/TableHeader.js +4 -1
- package/components/data/table/hooks/index.d.ts +0 -1
- package/components/data/table/hooks/index.js +0 -12
- package/components/data/table/hooks/useDynamicColumns.js +1 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +0 -1
- package/components/data/table/hooks/useRowSelection.d.ts +1 -1
- package/components/data/table/hooks/useRowSelection.js +5 -26
- package/components/data/table/hooks/useTableInitialization.js +1 -2
- package/components/data/table/index.d.ts +0 -4
- package/components/data/table/index.js +12 -77
- package/components/data/table/live-table/index.d.ts +0 -1
- package/components/data/table/props.d.ts +0 -7
- package/components/data/table/table-action/index.d.ts +0 -1
- package/components/data/table/table-column/index.d.ts +0 -1
- package/components/data/table/table-row/index.d.ts +0 -1
- package/components/data/table/table-row-action/index.d.ts +0 -1
- package/components/data/table/utils/buildSelectionColumns.js +1 -7
- package/components/data/table/utils/columnBuilder.js +1 -1
- package/components/data/table/utils/index.js +2 -2
- package/components/data/table/utils/renderDisplayCell.js +1 -1
- package/components/dialogs/alert-dialog/index.d.ts +0 -2
- package/components/dialogs/confirm-dialog/index.d.ts +0 -2
- package/components/dialogs/dialog/index.d.ts +0 -2
- package/components/dialogs/dialog/index.js +4 -2
- package/components/dialogs/dialog-actions/index.d.ts +0 -1
- package/components/dialogs/dialog-body/index.d.ts +0 -1
- package/components/dialogs/dialog-content/index.d.ts +0 -1
- package/components/dialogs/dialog-header/index.d.ts +0 -1
- package/components/dialogs/iframe-dialog/index.d.ts +0 -2
- package/components/dialogs/login-dialog/index.d.ts +0 -2
- package/components/dialogs/page-dialog/index.d.ts +0 -2
- package/components/form/button/index.d.ts +0 -1
- package/components/form/button/index.js +3 -4
- package/components/form/button-group/index.d.ts +0 -1
- package/components/form/button-group/index.js +1 -2
- package/components/input/calendar/index.d.ts +0 -2
- package/components/input/chips/index.d.ts +0 -2
- package/components/input/color-picker/index.d.ts +0 -2
- package/components/input/composite/index.d.ts +0 -1
- package/components/input/currency/index.d.ts +0 -2
- package/components/input/default/checkbox/index.d.ts +0 -2
- package/components/input/default/checkboxset/index.d.ts +0 -2
- package/components/input/default/radioset/index.d.ts +0 -2
- package/components/input/default/switch/index.d.ts +0 -2
- package/components/input/epoch/date/components/DatePickerPopover.js +29 -11
- package/components/input/epoch/date/index.d.ts +0 -1
- package/components/input/epoch/datetime/index.d.ts +0 -1
- package/components/input/epoch/datetime/index.js +25 -10
- package/components/input/epoch/datetime/styled.d.ts +78 -0
- package/components/input/epoch/datetime/styled.js +90 -0
- package/components/input/epoch/time/index.d.ts +0 -1
- package/components/input/epoch/time/index.js +1 -1
- package/components/input/epoch/time/utils.d.ts +17 -0
- package/components/input/epoch/time/utils.js +18 -1
- package/components/input/fileupload/index.d.ts +0 -1
- package/components/input/number/index.d.ts +0 -2
- package/components/input/rating/index.d.ts +0 -2
- package/components/input/rating/index.js +17 -14
- package/components/input/select/index.d.ts +0 -2
- package/components/input/select/index.js +4 -1
- package/components/input/slider/index.d.ts +0 -2
- package/components/input/slider/index.js +12 -13
- package/components/input/text/index.d.ts +0 -2
- package/components/input/text/index.js +14 -3
- package/components/input/textarea/index.d.ts +0 -2
- package/components/input/textarea/index.js +10 -7
- package/components/input/upload/index.d.ts +0 -2
- package/components/input/upload/index.js +5 -3
- package/components/layout/footer/index.js +1 -2
- package/components/layout/footer/props.d.ts +0 -1
- package/components/layout/header/index.js +1 -2
- package/components/layout/header/props.d.ts +0 -1
- package/components/layout/leftnav/index.js +1 -2
- package/components/layout/leftnav/props.d.ts +0 -1
- package/components/layout/rightnav/index.js +1 -2
- package/components/layout/rightnav/props.d.ts +0 -1
- package/components/layout/topnav/index.js +1 -2
- package/components/layout/topnav/props.d.ts +0 -1
- package/components/navbar/index.d.ts +0 -1
- package/components/navbar/index.js +1 -2
- package/components/navbar/nav/index.d.ts +0 -1
- package/components/navbar/nav-item/index.d.ts +0 -1
- package/components/navbar/nav-item/index.js +1 -2
- package/components/navigation/breadcrumb/index.d.ts +0 -1
- package/components/navigation/menu/index.d.ts +0 -1
- package/components/navigation/menu/index.js +4 -5
- package/components/navigation/popover/index.d.ts +1 -2
- package/components/navigation/popover/index.js +1 -1
- package/components/page/error-boundary/index.js +5 -5
- package/components/page/index.js +9 -13
- package/components/page/partial/index.d.ts +0 -1
- package/components/prefab/container/index.js +1 -2
- package/context/WidgetProvider.js +2 -2
- package/core/app.service.js +35 -40
- package/core/constants/events.js +0 -6
- package/core/constants/index.d.ts +1 -9
- package/core/constants/index.js +5 -32
- package/core/formatter/date-formatters.d.ts +1 -1
- package/core/formatter/date-formatters.js +13 -38
- package/core/formatter/types.d.ts +1 -1
- package/core/proxy-service.js +5 -15
- package/core/util/index.js +2 -3
- package/higherOrder/BaseApp.js +2 -2
- package/higherOrder/BasePage.d.ts +17 -0
- package/higherOrder/BasePage.js +104 -53
- package/higherOrder/BasePrefab.js +59 -69
- package/higherOrder/props.d.ts +0 -1
- package/higherOrder/withBaseWrapper.js +4 -3
- package/hooks/useAccess.js +0 -13
- package/mui-config/theme.js +4 -1
- package/package-lock.json +605 -2630
- package/package.json +4 -23
- package/store/middleware/navigationMiddleware.js +1 -1
- package/store/slices/appConfigSlice.js +8 -10
- package/store/slices/authSlice.js +32 -46
- package/tsconfig.declaration.tsbuildinfo +1 -1
- package/types/index.d.ts +0 -1
- package/utils/attr.js +14 -71
- package/utils/lib-error-skipper.d.ts +26 -4
- package/utils/lib-error-skipper.js +165 -41
- package/utils/style-utils.d.ts +0 -6
- package/utils/style-utils.js +1 -10
- package/variables/metadata.service.js +3 -2
- package/variables/model-variable.js +7 -10
- package/variables/service-variable.d.ts +0 -1
- package/variables/service-variable.js +6 -26
- package/actions/base-action.d.ts +0 -7
- package/actions/login-action.d.ts +0 -11
- package/actions/logout-action.d.ts +0 -10
- package/actions/navigation-action.d.ts +0 -35
- package/actions/notification-action.d.ts +0 -20
- package/actions/timer-action.d.ts +0 -27
- package/components/data/table/hooks/useCustomExpressionColumns.d.ts +0 -16
- package/components/data/table/hooks/useCustomExpressionColumns.js +0 -88
- package/core/security.service.d.ts +0 -12
- package/mui-config/theme-provider.d.ts +0 -3
- package/mui-config/theme.d.ts +0 -2
- package/runtime-dynamic/App.d.ts +0 -7
- package/runtime-dynamic/App.js +0 -144
- package/runtime-dynamic/app-initializer.d.ts +0 -15
- package/runtime-dynamic/app-initializer.js +0 -447
- package/runtime-dynamic/components/ErrorBoundary.d.ts +0 -18
- package/runtime-dynamic/components/ErrorBoundary.js +0 -93
- package/runtime-dynamic/components/PageWrapper.d.ts +0 -1
- package/runtime-dynamic/components/PageWrapper.js +0 -43
- package/runtime-dynamic/components/PrefabPreview.d.ts +0 -1
- package/runtime-dynamic/components/PrefabPreview.js +0 -84
- package/runtime-dynamic/components/partial-content.d.ts +0 -15
- package/runtime-dynamic/components/partial-content.js +0 -50
- package/runtime-dynamic/components/prefab-content.d.ts +0 -10
- package/runtime-dynamic/components/prefab-content.js +0 -31
- package/runtime-dynamic/components/use-dynamic-component.d.ts +0 -10
- package/runtime-dynamic/components/use-dynamic-component.js +0 -165
- package/runtime-dynamic/factories/build-base-page-like-component.d.ts +0 -8
- package/runtime-dynamic/factories/build-base-page-like-component.js +0 -59
- package/runtime-dynamic/factories/prefab-factory.d.ts +0 -3
- package/runtime-dynamic/factories/prefab-factory.js +0 -82
- package/runtime-dynamic/factories/startup-info.d.ts +0 -6
- package/runtime-dynamic/factories/startup-info.js +0 -28
- package/runtime-dynamic/factories/utils.d.ts +0 -23
- package/runtime-dynamic/factories/utils.js +0 -131
- package/runtime-dynamic/index.d.ts +0 -14
- package/runtime-dynamic/index.js +0 -191
- package/runtime-dynamic/main.d.ts +0 -2
- package/runtime-dynamic/main.js +0 -84
- package/runtime-dynamic/preview-mode.d.ts +0 -15
- package/runtime-dynamic/preview-mode.js +0 -31
- package/runtime-dynamic/preview-navigation.d.ts +0 -6
- package/runtime-dynamic/preview-navigation.js +0 -38
- package/runtime-dynamic/preview-resource-base.d.ts +0 -12
- package/runtime-dynamic/preview-resource-base.js +0 -65
- package/runtime-dynamic/registry/component-registry.d.ts +0 -3
- package/runtime-dynamic/registry/component-registry.js +0 -353
- package/runtime-dynamic/registry/custom-widget-registry.d.ts +0 -7
- package/runtime-dynamic/registry/custom-widget-registry.js +0 -18
- package/runtime-dynamic/registry/index.d.ts +0 -2
- package/runtime-dynamic/registry/index.js +0 -63
- package/runtime-dynamic/registry/store.d.ts +0 -9
- package/runtime-dynamic/registry/store.js +0 -26
- package/runtime-dynamic/routes.d.ts +0 -2
- package/runtime-dynamic/routes.js +0 -107
- package/runtime-dynamic/services/app-extension-provider.d.ts +0 -1
- package/runtime-dynamic/services/app-extension-provider.js +0 -45
- package/runtime-dynamic/services/cache.d.ts +0 -29
- package/runtime-dynamic/services/cache.js +0 -57
- package/runtime-dynamic/services/component-ref-provider.d.ts +0 -12
- package/runtime-dynamic/services/component-ref-provider.js +0 -149
- package/runtime-dynamic/services/css-scoping.d.ts +0 -2
- package/runtime-dynamic/services/css-scoping.js +0 -53
- package/runtime-dynamic/services/fragment-url.d.ts +0 -16
- package/runtime-dynamic/services/fragment-url.js +0 -74
- package/runtime-dynamic/services/index.d.ts +0 -10
- package/runtime-dynamic/services/index.js +0 -152
- package/runtime-dynamic/services/markup-transpiler.d.ts +0 -12
- package/runtime-dynamic/services/markup-transpiler.js +0 -250
- package/runtime-dynamic/services/prefab-resources.d.ts +0 -18
- package/runtime-dynamic/services/prefab-resources.js +0 -159
- package/runtime-dynamic/services/resource-manager.d.ts +0 -2
- package/runtime-dynamic/services/resource-manager.js +0 -66
- package/runtime-dynamic/services/script-executor.d.ts +0 -8
- package/runtime-dynamic/services/script-executor.js +0 -90
- package/runtime-dynamic/services/variable-factory.d.ts +0 -2
- package/runtime-dynamic/services/variable-factory.js +0 -260
- package/runtime-dynamic/services/variable-registry.d.ts +0 -12
- package/runtime-dynamic/services/variable-registry.js +0 -118
- package/runtime-dynamic/services/variable-transpiler.d.ts +0 -5
- package/runtime-dynamic/services/variable-transpiler.js +0 -159
- package/runtime-dynamic/shims/next-image.d.ts +0 -35
- package/runtime-dynamic/shims/next-image.js +0 -60
- package/runtime-dynamic/shims/next-link.d.ts +0 -25
- package/runtime-dynamic/shims/next-link.js +0 -33
- package/runtime-dynamic/shims/next-navigation.d.ts +0 -16
- package/runtime-dynamic/shims/next-navigation.js +0 -52
- package/runtime-dynamic/utils/index.d.ts +0 -9
- package/runtime-dynamic/utils/index.js +0 -40
- package/utils/custom-expression/index.d.ts +0 -43
- package/utils/custom-expression/index.js +0 -161
- package/utils/custom-expression/parser.d.ts +0 -15
- package/utils/custom-expression/parser.js +0 -208
- package/utils/layoutsize-util.d.ts +0 -1
- package/utils/layoutsize-util.js +0 -57
|
@@ -228,7 +228,6 @@ var WidgetProvider = exports.WidgetProvider = function WidgetProvider(_ref) {
|
|
|
228
228
|
}, children));
|
|
229
229
|
};
|
|
230
230
|
var usePageContext = exports.usePageContext = function usePageContext(standalone) {
|
|
231
|
-
var context = (0, _react.useContext)(WidgetContext);
|
|
232
231
|
if (standalone) {
|
|
233
232
|
return {
|
|
234
233
|
pageContext: {},
|
|
@@ -237,16 +236,17 @@ var usePageContext = exports.usePageContext = function usePageContext(standalone
|
|
|
237
236
|
destroy: function destroy() {}
|
|
238
237
|
};
|
|
239
238
|
}
|
|
239
|
+
var context = (0, _react.useContext)(WidgetContext);
|
|
240
240
|
if (!context) {
|
|
241
241
|
throw new Error("useWidgetContext must be used within a WidgetProvider");
|
|
242
242
|
}
|
|
243
243
|
return context;
|
|
244
244
|
};
|
|
245
245
|
var useWidgetProxy = exports.useWidgetProxy = function useWidgetProxy(name, standalone) {
|
|
246
|
-
var context = (0, _react.useContext)(WidgetContext);
|
|
247
246
|
if (standalone) {
|
|
248
247
|
return {};
|
|
249
248
|
}
|
|
249
|
+
var context = (0, _react.useContext)(WidgetContext);
|
|
250
250
|
if (!context) {
|
|
251
251
|
throw new Error("useWidgetProxy must be used within a WidgetProvider");
|
|
252
252
|
}
|
package/core/app.service.js
CHANGED
|
@@ -20,7 +20,6 @@ var _authSlice = require("@wavemaker-ai/react-runtime/store/slices/authSlice");
|
|
|
20
20
|
var _get = _interopRequireDefault(require("lodash-es/get"));
|
|
21
21
|
var _isEmpty = _interopRequireDefault(require("lodash-es/isEmpty"));
|
|
22
22
|
var _appstore = _interopRequireDefault(require("./appstore"));
|
|
23
|
-
var _constants = require("@wavemaker-ai/react-runtime/core/constants");
|
|
24
23
|
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; }
|
|
25
24
|
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; }
|
|
26
25
|
function loadWmProperties(_x) {
|
|
@@ -124,7 +123,7 @@ var getRedirectPage = exports.getRedirectPage = function getRedirectPage(config,
|
|
|
124
123
|
};
|
|
125
124
|
var handle401 = exports.handle401 = /*#__PURE__*/function () {
|
|
126
125
|
var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(page, options) {
|
|
127
|
-
var state, securityConfig, router, loginConfig, userInfo, loginMethod,
|
|
126
|
+
var state, securityConfig, router, loginConfig, userInfo, loginMethod, sessionTimeoutConfig, sessionTimeoutMethod, sessionTimeoutQueryParams, queryString, loginQueryParams, _queryString, isNotOnLoginPage, hasQueryString;
|
|
128
127
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
129
128
|
while (1) switch (_context.prev = _context.next) {
|
|
130
129
|
case 0:
|
|
@@ -153,12 +152,8 @@ var handle401 = exports.handle401 = /*#__PURE__*/function () {
|
|
|
153
152
|
loginConfig = securityConfig.loginConfig || {};
|
|
154
153
|
userInfo = securityConfig.userInfo;
|
|
155
154
|
loginMethod = ((loginConfig === null || loginConfig === void 0 ? void 0 : loginConfig.type) || LOGIN_METHOD.PAGE).toUpperCase();
|
|
156
|
-
basePath = (0, _constants.getActiveRoutingBasePath)();
|
|
157
|
-
getCurrentPageName = function getCurrentPageName() {
|
|
158
|
-
return window.location.pathname.split("/").filter(Boolean).pop() || "";
|
|
159
|
-
};
|
|
160
155
|
if (!(userInfo !== null && userInfo !== void 0 && userInfo.userName)) {
|
|
161
|
-
_context.next =
|
|
156
|
+
_context.next = 30;
|
|
162
157
|
break;
|
|
163
158
|
}
|
|
164
159
|
sessionTimeoutConfig = loginConfig.sessionTimeout || {
|
|
@@ -166,57 +161,57 @@ var handle401 = exports.handle401 = /*#__PURE__*/function () {
|
|
|
166
161
|
};
|
|
167
162
|
sessionTimeoutMethod = (sessionTimeoutConfig.type || LOGIN_METHOD.DIALOG).toUpperCase();
|
|
168
163
|
_context.t0 = sessionTimeoutMethod;
|
|
169
|
-
_context.next = _context.t0 === LOGIN_METHOD.DIALOG ?
|
|
164
|
+
_context.next = _context.t0 === LOGIN_METHOD.DIALOG ? 19 : _context.t0 === LOGIN_METHOD.PAGE ? 21 : _context.t0 === LOGIN_METHOD.SSO ? 25 : 28;
|
|
170
165
|
break;
|
|
171
|
-
case
|
|
166
|
+
case 19:
|
|
172
167
|
showLoginDialog();
|
|
173
|
-
return _context.abrupt("break",
|
|
174
|
-
case
|
|
175
|
-
page = page ||
|
|
168
|
+
return _context.abrupt("break", 28);
|
|
169
|
+
case 21:
|
|
170
|
+
page = page || "";
|
|
176
171
|
sessionTimeoutQueryParams = mergeQueryParams({
|
|
177
172
|
redirectTo: page
|
|
178
173
|
}, options === null || options === void 0 ? void 0 : options.queryParams);
|
|
179
|
-
|
|
180
|
-
if (page !== sessionTimeoutLoginPage) {
|
|
174
|
+
if (page !== sessionTimeoutConfig.pageName) {
|
|
181
175
|
queryString = createQueryString(sessionTimeoutQueryParams);
|
|
182
|
-
|
|
183
|
-
router.push("".concat(loginPath).concat(queryString ? "?".concat(queryString) : ""));
|
|
176
|
+
router.push("".concat(sessionTimeoutConfig.pageName).concat(queryString ? "?".concat(queryString) : ""));
|
|
184
177
|
}
|
|
185
|
-
return _context.abrupt("break",
|
|
186
|
-
case
|
|
187
|
-
_context.next =
|
|
178
|
+
return _context.abrupt("break", 28);
|
|
179
|
+
case 25:
|
|
180
|
+
_context.next = 27;
|
|
188
181
|
return handleSSOLogin(loginConfig, options);
|
|
189
|
-
case
|
|
190
|
-
return _context.abrupt("break",
|
|
191
|
-
case
|
|
192
|
-
_context.next =
|
|
182
|
+
case 27:
|
|
183
|
+
return _context.abrupt("break", 28);
|
|
184
|
+
case 28:
|
|
185
|
+
_context.next = 45;
|
|
193
186
|
break;
|
|
194
|
-
case
|
|
187
|
+
case 30:
|
|
195
188
|
_context.t1 = loginMethod;
|
|
196
|
-
_context.next = _context.t1 === LOGIN_METHOD.DIALOG ?
|
|
189
|
+
_context.next = _context.t1 === LOGIN_METHOD.DIALOG ? 33 : _context.t1 === LOGIN_METHOD.PAGE ? 35 : _context.t1 === LOGIN_METHOD.SSO ? 42 : 45;
|
|
197
190
|
break;
|
|
198
|
-
case
|
|
191
|
+
case 33:
|
|
199
192
|
showLoginDialog(true);
|
|
200
|
-
return _context.abrupt("break",
|
|
201
|
-
case
|
|
202
|
-
page = page || getRedirectPage(securityConfig, page) ||
|
|
203
|
-
loginPageName = loginConfig.pageName || "Login";
|
|
204
|
-
_loginPath = "/".concat(basePath, "/").concat(loginPageName);
|
|
193
|
+
return _context.abrupt("break", 45);
|
|
194
|
+
case 35:
|
|
195
|
+
page = page || getRedirectPage(securityConfig, page) || "";
|
|
205
196
|
loginQueryParams = mergeQueryParams({
|
|
206
197
|
redirectTo: page
|
|
207
198
|
}, options === null || options === void 0 ? void 0 : options.queryParams);
|
|
208
199
|
_queryString = createQueryString(loginQueryParams);
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
200
|
+
/*
|
|
201
|
+
Prevents the page from refreshing if the user is already on the login page.
|
|
202
|
+
*/
|
|
203
|
+
isNotOnLoginPage = window.location.pathname.endsWith(loginConfig.pageName);
|
|
204
|
+
hasQueryString = _queryString !== "";
|
|
205
|
+
if (!isNotOnLoginPage && hasQueryString) {
|
|
206
|
+
router.push("".concat(loginConfig.pageName).concat(_queryString ? "?".concat(_queryString) : ""));
|
|
212
207
|
}
|
|
213
|
-
return _context.abrupt("break",
|
|
214
|
-
case
|
|
215
|
-
_context.next =
|
|
208
|
+
return _context.abrupt("break", 45);
|
|
209
|
+
case 42:
|
|
210
|
+
_context.next = 44;
|
|
216
211
|
return handleSSOLogin(loginConfig, options);
|
|
217
|
-
case
|
|
218
|
-
return _context.abrupt("break",
|
|
219
|
-
case
|
|
212
|
+
case 44:
|
|
213
|
+
return _context.abrupt("break", 45);
|
|
214
|
+
case 45:
|
|
220
215
|
case "end":
|
|
221
216
|
return _context.stop();
|
|
222
217
|
}
|
package/core/constants/events.js
CHANGED
|
@@ -10,12 +10,6 @@ var partialStateSyncEmitter = new _events["default"]();
|
|
|
10
10
|
var prefabStateSyncEmitter = new _events["default"]();
|
|
11
11
|
var layoutSyncEmitter = new _events["default"]();
|
|
12
12
|
|
|
13
|
-
// Pages with many partials/prefabs legitimately register one listener each.
|
|
14
|
-
// The default limit of 10 is too low for widget-heavy WaveMaker pages.
|
|
15
|
-
partialStateSyncEmitter.setMaxListeners(50);
|
|
16
|
-
prefabStateSyncEmitter.setMaxListeners(50);
|
|
17
|
-
layoutSyncEmitter.setMaxListeners(50);
|
|
18
|
-
|
|
19
13
|
// NOTE: Form-related events (CHILD_FORM_DATA_UPDATE, CHILD_FORM_FIELD_REGISTER) have been removed.
|
|
20
14
|
// Form communication now uses context-based callbacks via ParentFormDataContext:
|
|
21
15
|
// - onChildDataChange: For child forms to send data UP to root parent
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ROUTING_BASEPATH_PRODUCTION = "react-pages";
|
|
3
|
-
/** Studio / dynamic preview uses this segment in the browser URL (runtime-dynamic). */
|
|
4
|
-
export declare const PREVIEW_ROUTING_BASEPATH = "react-preview";
|
|
5
|
-
/**
|
|
6
|
-
* SPA routing segment for the current window (`react-pages` vs `react-preview`).
|
|
7
|
-
* Call when building navigation targets — not a one-time module-load constant.
|
|
8
|
-
*/
|
|
9
|
-
export declare function getActiveRoutingBasePath(): string;
|
|
1
|
+
export declare const ROUTING_BASEPATH = "react-pages";
|
|
10
2
|
export declare const hyperLinkMofify: (link: string) => string;
|
package/core/constants/index.js
CHANGED
|
@@ -3,44 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.hyperLinkMofify = void 0;
|
|
9
|
-
/** Production / default SPA URL segment (embedded apps, classic deploy). */
|
|
10
|
-
var ROUTING_BASEPATH_PRODUCTION = exports.ROUTING_BASEPATH_PRODUCTION = "react-pages";
|
|
11
|
-
|
|
12
|
-
/** Studio / dynamic preview uses this segment in the browser URL (runtime-dynamic). */
|
|
13
|
-
var PREVIEW_ROUTING_BASEPATH = exports.PREVIEW_ROUTING_BASEPATH = "react-preview";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* SPA routing segment for the current window (`react-pages` vs `react-preview`).
|
|
17
|
-
* Call when building navigation targets — not a one-time module-load constant.
|
|
18
|
-
*/
|
|
19
|
-
function getActiveRoutingBasePath() {
|
|
20
|
-
if (typeof window === "undefined") {
|
|
21
|
-
return ROUTING_BASEPATH_PRODUCTION;
|
|
22
|
-
}
|
|
23
|
-
var pathname = window.location.pathname;
|
|
24
|
-
var preview = "/".concat(PREVIEW_ROUTING_BASEPATH);
|
|
25
|
-
var prod = "/".concat(ROUTING_BASEPATH_PRODUCTION);
|
|
26
|
-
if (pathname.includes("".concat(preview, "/")) || pathname.endsWith(preview)) {
|
|
27
|
-
return PREVIEW_ROUTING_BASEPATH;
|
|
28
|
-
}
|
|
29
|
-
if (pathname.includes("".concat(prod, "/")) || pathname.endsWith(prod)) {
|
|
30
|
-
return ROUTING_BASEPATH_PRODUCTION;
|
|
31
|
-
}
|
|
32
|
-
return ROUTING_BASEPATH_PRODUCTION;
|
|
33
|
-
}
|
|
6
|
+
exports.hyperLinkMofify = exports.ROUTING_BASEPATH = void 0;
|
|
7
|
+
var ROUTING_BASEPATH = exports.ROUTING_BASEPATH = "react-pages";
|
|
34
8
|
var hyperLinkMofify = exports.hyperLinkMofify = function hyperLinkMofify(link) {
|
|
35
9
|
var hrefLink = "#";
|
|
36
10
|
if (link) {
|
|
37
|
-
var
|
|
11
|
+
var baseRegex = new RegExp("^/".concat(ROUTING_BASEPATH, "(/|$)"));
|
|
38
12
|
if (/^#/.test(link)) {
|
|
39
13
|
var suffix = link.replace(/^#/, "");
|
|
40
|
-
hrefLink = /^\/.*/.test(suffix) ? "/".concat(
|
|
14
|
+
hrefLink = /^\/.*/.test(suffix) ? "/".concat(ROUTING_BASEPATH).concat(suffix) : "/".concat(ROUTING_BASEPATH, "/").concat(suffix);
|
|
41
15
|
} else if (/^\//.test(link)) {
|
|
42
|
-
|
|
43
|
-
hrefLink = normalized.match(new RegExp("^/".concat(segment, "(/|$)"))) ? normalized : "/".concat(segment).concat(link);
|
|
16
|
+
hrefLink = baseRegex.test(link) ? link : "/".concat(ROUTING_BASEPATH).concat(link);
|
|
44
17
|
} else {
|
|
45
18
|
hrefLink = link;
|
|
46
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateFormatter } from "@wavemaker-ai/variables/src/types/date-formatter";
|
|
2
2
|
import { Formatter } from "./types";
|
|
3
3
|
export declare class DateToStringFormatter implements DateFormatter {
|
|
4
|
-
format(input: Date | string | number | null | undefined, format
|
|
4
|
+
format(input: Date | string | number | null | undefined, format: string): string;
|
|
5
5
|
private tryReconstructDateFromDecimal;
|
|
6
6
|
}
|
|
7
7
|
export declare class TimeFromNowFormatter implements Formatter {
|
|
@@ -9,41 +9,11 @@ exports.TimeFromNowFormatter = exports.DateToStringFormatter = void 0;
|
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
11
|
var momentLib = _interopRequireWildcard(require("moment-timezone/moment-timezone"));
|
|
12
|
-
var _appstore = _interopRequireDefault(require("../appstore"));
|
|
13
12
|
var _store = require("../../store");
|
|
14
13
|
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); }
|
|
15
14
|
// @ts-ignore
|
|
16
15
|
|
|
17
16
|
var moment = momentLib["default"] || window["moment"];
|
|
18
|
-
function resolveDateFormattingLocale() {
|
|
19
|
-
try {
|
|
20
|
-
var _appstore$I18nService, _appstore$I18nService2;
|
|
21
|
-
var fromI18n = (_appstore$I18nService = _appstore["default"].I18nService.get()) === null || _appstore$I18nService === void 0 || (_appstore$I18nService2 = _appstore$I18nService.getSelectedLocale) === null || _appstore$I18nService2 === void 0 ? void 0 : _appstore$I18nService2.call(_appstore$I18nService);
|
|
22
|
-
if (fromI18n != null && String(fromI18n).trim() !== "") {
|
|
23
|
-
return String(fromI18n).replace(/_/g, "-");
|
|
24
|
-
}
|
|
25
|
-
} catch (_unused) {
|
|
26
|
-
/* ignore */
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
var _store$getState;
|
|
30
|
-
var lang = ((_store$getState = _store.store.getState()) === null || _store$getState === void 0 || (_store$getState = _store$getState.info) === null || _store$getState === void 0 || (_store$getState = _store$getState.appConfig) === null || _store$getState === void 0 || (_store$getState = _store$getState.appProperties) === null || _store$getState === void 0 ? void 0 : _store$getState.defaultLanguage) || "en";
|
|
31
|
-
return String(lang).replace(/_/g, "-");
|
|
32
|
-
} catch (_unused2) {
|
|
33
|
-
return "en";
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** Mirrors Angular DatePipe when format is omitted: default medium date (`DATE_PIPE_DEFAULT_OPTIONS` or `mediumDate`). */
|
|
38
|
-
function formatMediumDateDefault(_moment, localeTag) {
|
|
39
|
-
try {
|
|
40
|
-
return new Intl.DateTimeFormat(localeTag || "en", {
|
|
41
|
-
dateStyle: "medium"
|
|
42
|
-
}).format(_moment.toDate());
|
|
43
|
-
} catch (_unused3) {
|
|
44
|
-
return _moment.isValid() ? _moment.locale(localeTag.split("-")[0] || "en").format("LL") : "";
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
17
|
var DateToStringFormatter = exports.DateToStringFormatter = /*#__PURE__*/function () {
|
|
48
18
|
function DateToStringFormatter() {
|
|
49
19
|
(0, _classCallCheck2["default"])(this, DateToStringFormatter);
|
|
@@ -52,6 +22,9 @@ var DateToStringFormatter = exports.DateToStringFormatter = /*#__PURE__*/functio
|
|
|
52
22
|
key: "format",
|
|
53
23
|
value: function format(input, _format) {
|
|
54
24
|
if (!input && input !== 0) return "";
|
|
25
|
+
|
|
26
|
+
// Normalize format string
|
|
27
|
+
_format = _format.replaceAll("y", "Y").replaceAll("d", "D").replaceAll("E", "d");
|
|
55
28
|
var _moment;
|
|
56
29
|
|
|
57
30
|
// Handle different input types
|
|
@@ -97,17 +70,19 @@ var DateToStringFormatter = exports.DateToStringFormatter = /*#__PURE__*/functio
|
|
|
97
70
|
if (_format === "UTC") {
|
|
98
71
|
return _moment.isValid() ? moment.utc(_moment).toString() : "";
|
|
99
72
|
}
|
|
100
|
-
var localeTag = resolveDateFormattingLocale();
|
|
101
73
|
|
|
102
|
-
//
|
|
103
|
-
|
|
104
|
-
|
|
74
|
+
// Get default language from store (with fallback)
|
|
75
|
+
var defaultLanguage = "en";
|
|
76
|
+
try {
|
|
77
|
+
var _store$getState;
|
|
78
|
+
defaultLanguage = ((_store$getState = _store.store.getState()) === null || _store$getState === void 0 || (_store$getState = _store$getState.info) === null || _store$getState === void 0 || (_store$getState = _store$getState.appConfig) === null || _store$getState === void 0 || (_store$getState = _store$getState.appProperties) === null || _store$getState === void 0 ? void 0 : _store$getState.defaultLanguage) || "en";
|
|
79
|
+
} catch (error) {
|
|
80
|
+
// Fallback to "en" if store is not available or not properly initialized
|
|
81
|
+
defaultLanguage = "en";
|
|
105
82
|
}
|
|
106
83
|
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
var primaryLang = localeTag.split("-")[0] || "en";
|
|
110
|
-
return _moment.isValid() ? _moment.locale(primaryLang).format(pattern) : "";
|
|
84
|
+
// Return formatted date or empty string if invalid
|
|
85
|
+
return _moment.isValid() ? _moment.locale(defaultLanguage).format(_format) : "";
|
|
111
86
|
}
|
|
112
87
|
}, {
|
|
113
88
|
key: "tryReconstructDateFromDecimal",
|
|
@@ -29,5 +29,5 @@ export declare enum SecurityContext {
|
|
|
29
29
|
RESOURCE_URL = 5
|
|
30
30
|
}
|
|
31
31
|
export interface DateFormatter {
|
|
32
|
-
format: (input: Date | string | number | null | undefined, format
|
|
32
|
+
format: (input: Date | string | number | null | undefined, format: string) => string;
|
|
33
33
|
}
|
package/core/proxy-service.js
CHANGED
|
@@ -219,9 +219,6 @@ var createWidgetProxy = exports.createWidgetProxy = function createWidgetProxy(w
|
|
|
219
219
|
if (!(0, _isString["default"])(widgetName)) {
|
|
220
220
|
return widget;
|
|
221
221
|
}
|
|
222
|
-
if (widget == null) {
|
|
223
|
-
return widget;
|
|
224
|
-
}
|
|
225
222
|
var proxy = new Proxy(widget, {
|
|
226
223
|
set: function set(target, prop, value, receiver) {
|
|
227
224
|
// Ignore internal properties
|
|
@@ -377,26 +374,19 @@ var createPageProxy = exports.createPageProxy = function createPageProxy(target,
|
|
|
377
374
|
if (widgetProxies.has(widgetName)) {
|
|
378
375
|
var _proxy = widgetProxies.get(widgetName);
|
|
379
376
|
var originalTarget = originalTargets.get(_proxy);
|
|
380
|
-
var safeWidget = widget != null && (0, _typeof2["default"])(widget) === "object" ? widget : null;
|
|
381
|
-
var safeOriginal = originalTarget != null && (0, _typeof2["default"])(originalTarget) === "object" ? originalTarget : null;
|
|
382
377
|
|
|
383
378
|
// Always sync properties to ensure proxy has latest data
|
|
384
379
|
// This is important when widget was initially created with minimal data
|
|
385
|
-
if (
|
|
380
|
+
if (widget !== originalTarget || Object.keys(widget).length > Object.keys(originalTarget).length) {
|
|
386
381
|
// Copy all properties from widget to originalTarget
|
|
387
|
-
for (var key in
|
|
388
|
-
Reflect.defineProperty(
|
|
389
|
-
value:
|
|
382
|
+
for (var key in widget) {
|
|
383
|
+
Reflect.defineProperty(originalTarget, key, {
|
|
384
|
+
value: widget[key],
|
|
390
385
|
writable: true,
|
|
391
386
|
configurable: true,
|
|
392
387
|
enumerable: true
|
|
393
388
|
});
|
|
394
389
|
}
|
|
395
|
-
// Pin widgetsTarget back to originalTarget so that subsequent GETs within the
|
|
396
|
-
// same synchronous call stack see widget === originalTarget (no re-sync).
|
|
397
|
-
// This prevents the sync from overwriting proxy mutations (e.g. selectedItems
|
|
398
|
-
// set via createWidgetProxy.set) with stale values from widgetsTarget.
|
|
399
|
-
widgetsTarget[widgetName] = safeOriginal;
|
|
400
390
|
}
|
|
401
391
|
return _proxy;
|
|
402
392
|
}
|
|
@@ -501,7 +491,7 @@ var _createStateProxy = exports.createStateProxy = function createStateProxy(obj
|
|
|
501
491
|
if ((0, _dom.isDOMElement)(value)) {
|
|
502
492
|
return value;
|
|
503
493
|
}
|
|
504
|
-
if (value instanceof Map
|
|
494
|
+
if (value instanceof Map) {
|
|
505
495
|
return value;
|
|
506
496
|
}
|
|
507
497
|
|
package/core/util/index.js
CHANGED
|
@@ -40,9 +40,8 @@ var MONTHNAMES = exports.MONTHNAMES = ["January", "February", "March", "April",
|
|
|
40
40
|
var checkPublicAccess = exports.checkPublicAccess = function checkPublicAccess(page) {
|
|
41
41
|
var _window$location$path, _store$getState$info$;
|
|
42
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
|
-
|
|
44
|
-
|
|
45
|
-
return p.name === pageName;
|
|
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;
|
|
46
45
|
})) === null || _store$getState$info$ === void 0 ? void 0 : _store$getState$info$.permission) === "PermitAll";
|
|
47
46
|
};
|
|
48
47
|
var setSessionStorageItem = exports.setSessionStorageItem = function setSessionStorageItem(key, value) {
|
package/higherOrder/BaseApp.js
CHANGED
|
@@ -216,8 +216,8 @@ var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript,
|
|
|
216
216
|
function openActionDialog(notification, title) {
|
|
217
217
|
setAppContext(function (prev) {
|
|
218
218
|
if (title) {
|
|
219
|
-
var _prev$
|
|
220
|
-
prev === null ||
|
|
219
|
+
var _prev$Common, _prev$Common$open;
|
|
220
|
+
(_prev$Common = prev.Common) === null || _prev$Common === void 0 || (_prev$Common = _prev$Common.Widgets) === null || _prev$Common === void 0 || (_prev$Common = _prev$Common[title]) === null || _prev$Common === void 0 || (_prev$Common$open = _prev$Common.open) === null || _prev$Common$open === void 0 || _prev$Common$open.call(_prev$Common);
|
|
221
221
|
}
|
|
222
222
|
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
223
223
|
notification: notification
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ProxyTarget, MockApp, WithPageContextProps, ComponentInfo } from "@wavemaker-ai/react-runtime/types";
|
|
3
|
+
/**
|
|
4
|
+
* Hook to signal that a page component has rendered and is ready.
|
|
5
|
+
* Call this at the top of your page component to trigger startup operations.
|
|
6
|
+
*
|
|
7
|
+
* This ensures widgets have mounted and subscribed before variables are invoked.
|
|
8
|
+
*
|
|
9
|
+
* @param componentName - The unique name of the component (e.g., "ChooseAPlansGrid")
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { usePageReady } from '@wavemaker-ai/react-runtime/higherOrder/BasePage';
|
|
13
|
+
*
|
|
14
|
+
* const ChooseAPlansGridComponent = () => {
|
|
15
|
+
* usePageReady("ChooseAPlansGrid"); // Signal ready on mount
|
|
16
|
+
* return <WmPage>...</WmPage>;
|
|
17
|
+
* };
|
|
18
|
+
*/
|
|
19
|
+
export declare const usePageReady: (componentName: string) => void;
|
|
3
20
|
export declare const withPageContext: <P extends object>(WrappedComponent: React.ComponentType<P>, addPageScript: (app: MockApp, pageProxy: ProxyTarget) => void, getVariables: (pageProxy: ProxyTarget) => {
|
|
4
21
|
Variables: Record<string, any>;
|
|
5
22
|
Actions: Record<string, any>;
|