@wavemaker/react-runtime 11.14.3-rc.6401 → 11.14.4-rc.647538
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 +3 -5
- package/actions/notification-action.js +3 -6
- package/components/basic/anchor/index.js +7 -6
- package/components/basic/label/index.js +2 -2
- package/components/basic/search/index.js +3 -7
- package/components/chart/components/barColumnChart/index.js +4 -2
- package/components/chart/components/pieDonutChart/index.js +1 -3
- package/components/chart/index.js +39 -72
- package/components/chart/utils.js +12 -23
- package/components/container/index.js +7 -6
- package/components/container/panel/components/panel-header/index.js +2 -3
- package/components/container/panel/index.js +9 -13
- package/components/container/tabs/index.js +0 -1
- package/components/container/tabs/tab-pane/index.js +3 -39
- package/components/container/wizard/index.js +57 -187
- package/components/container/wizard/utils.js +1 -1
- package/components/container/wizard/wizard-action/index.js +4 -9
- package/components/container/wizard/wizard-step/index.js +8 -21
- package/components/data/form/base-form/index.js +11 -51
- package/components/data/form/form-controller/withFormController.js +10 -7
- package/components/data/list/components/GroupedListItems.js +1 -5
- package/components/data/list/components/ListItemWithTemplate.js +1 -4
- package/components/data/list/hooks/useListEffects.js +14 -34
- package/components/data/list/hooks/useListEventHandlers.js +2 -18
- package/components/data/list/hooks/useListState.js +2 -15
- package/components/data/list/index.js +0 -1
- package/components/data/list/utils/list-helpers.js +5 -3
- package/components/data/list/utils/list-widget-methods.js +1 -1
- package/components/data/live-filter/index.js +5 -6
- package/components/data/live-form/index.js +14 -24
- package/components/data/table/components/TableBody.js +21 -5
- package/components/data/table/components/TableHeader.js +1 -5
- package/components/data/table/index.js +5 -21
- package/components/data/utils/field-data-utils.js +1 -1
- package/components/dialogs/index.js +16 -14
- package/components/input/currency/index.js +7 -11
- package/components/input/default/checkbox/index.js +3 -2
- package/components/input/default/checkboxset/index.js +22 -2
- package/components/input/default/radioset/index.js +4 -5
- package/components/input/epoch/datetime/index.js +2 -6
- package/components/input/epoch/time/index.js +1 -2
- package/components/input/number/index.js +2 -2
- package/components/input/text/util.js +0 -2
- package/components/input/textarea/index.js +24 -22
- package/components/layout/leftnav/index.js +1 -1
- package/components/navbar/nav/index.js +7 -97
- package/components/navbar/nav-item/index.js +2 -5
- package/components/navigation/menu/index.js +12 -73
- package/components/navigation/popover/index.js +0 -2
- package/components/page/error-boundary/index.js +0 -1
- package/components/prefab/container/index.js +3 -10
- package/context/LocalizationProvider.js +0 -1
- package/context/PrefabContext.js +13 -138
- package/context/WidgetProvider.js +2 -2
- package/core/constants/events.js +6 -12
- package/core/constants/index.js +11 -6
- package/core/formatter/number-formatters.js +1 -1
- package/core/proxy-service.js +36 -72
- package/core/util/utils.js +4 -23
- package/higherOrder/BaseApp.js +18 -60
- package/higherOrder/BasePage.js +77 -99
- package/higherOrder/BasePrefab.js +5 -13
- package/higherOrder/withBaseWrapper.js +3 -3
- package/hooks/useDataSourceSubscription.js +1 -1
- package/hooks/useHttp.js +13 -20
- package/mui-config/theme.js +0 -3
- package/package-lock.json +747 -704
- package/package.json +3 -3
- package/store/index.js +1 -5
- package/variables/service-variable.js +14 -17
- package/components/chart/hooks/useBarYAxisExtras.js +0 -52
- package/components/chart/hooks/useXAxisConfig.js +0 -98
- package/utils/lib-error-skipper.js +0 -196
package/core/proxy-service.js
CHANGED
|
@@ -28,8 +28,8 @@ var createArrayProxy = function createArrayProxy(array, widgetName, propName, se
|
|
|
28
28
|
return array;
|
|
29
29
|
}
|
|
30
30
|
var arrayProxy = new Proxy(array, {
|
|
31
|
-
get: function get(target, prop
|
|
32
|
-
var value =
|
|
31
|
+
get: function get(target, prop) {
|
|
32
|
+
var value = target[prop];
|
|
33
33
|
|
|
34
34
|
// If it's a mutating method, wrap it to trigger updates
|
|
35
35
|
if (typeof prop === "string" && MUTATING_ARRAY_METHODS.includes(prop) && typeof value === "function") {
|
|
@@ -50,8 +50,8 @@ var createArrayProxy = function createArrayProxy(array, widgetName, propName, se
|
|
|
50
50
|
}
|
|
51
51
|
return value;
|
|
52
52
|
},
|
|
53
|
-
set: function set(target, prop, value
|
|
54
|
-
var result = Reflect.set(target, prop, value
|
|
53
|
+
set: function set(target, prop, value) {
|
|
54
|
+
var result = Reflect.set(target, prop, value);
|
|
55
55
|
|
|
56
56
|
// Trigger update for index assignments (arr[0] = value)
|
|
57
57
|
if (typeof prop === "string" && /^\d+$/.test(prop)) {
|
|
@@ -74,8 +74,8 @@ var createStateArrayProxy = function createStateArrayProxy(array, path, propName
|
|
|
74
74
|
return array;
|
|
75
75
|
}
|
|
76
76
|
var arrayProxy = new Proxy(array, {
|
|
77
|
-
get: function get(target, prop
|
|
78
|
-
var value =
|
|
77
|
+
get: function get(target, prop) {
|
|
78
|
+
var value = target[prop];
|
|
79
79
|
|
|
80
80
|
// If it's a mutating method, wrap it to trigger updates
|
|
81
81
|
if (typeof prop === "string" && MUTATING_ARRAY_METHODS.includes(prop) && typeof value === "function") {
|
|
@@ -104,8 +104,8 @@ var createStateArrayProxy = function createStateArrayProxy(array, path, propName
|
|
|
104
104
|
}
|
|
105
105
|
return value;
|
|
106
106
|
},
|
|
107
|
-
set: function set(target, prop, value
|
|
108
|
-
var result = Reflect.set(target, prop, value
|
|
107
|
+
set: function set(target, prop, value) {
|
|
108
|
+
var result = Reflect.set(target, prop, value);
|
|
109
109
|
|
|
110
110
|
// Trigger update for index assignments (arr[0] = value)
|
|
111
111
|
if (typeof prop === "string" && /^\d+$/.test(prop)) {
|
|
@@ -135,15 +135,14 @@ var createWidgetProxy = exports.createWidgetProxy = function createWidgetProxy(w
|
|
|
135
135
|
return widget;
|
|
136
136
|
}
|
|
137
137
|
var proxy = new Proxy(widget, {
|
|
138
|
-
set: function set(target, prop, value
|
|
138
|
+
set: function set(target, prop, value) {
|
|
139
139
|
// Ignore internal properties
|
|
140
140
|
if ((0, _typeof2["default"])(prop) === "symbol" || prop === "prototype") {
|
|
141
|
-
return
|
|
141
|
+
return true;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
// Skip if value hasn't changed
|
|
145
|
-
|
|
146
|
-
if (currentVal === value) {
|
|
145
|
+
if (target[prop] === value) {
|
|
147
146
|
return true;
|
|
148
147
|
}
|
|
149
148
|
|
|
@@ -152,7 +151,7 @@ var createWidgetProxy = exports.createWidgetProxy = function createWidgetProxy(w
|
|
|
152
151
|
var widgetId = widget["data-widget-id"];
|
|
153
152
|
(0, _scriptRegistry.trackOverriddenProps)(widgetName, prop, value, widgetId);
|
|
154
153
|
}
|
|
155
|
-
|
|
154
|
+
target[prop] = value;
|
|
156
155
|
setPageContext(function (prevContext) {
|
|
157
156
|
// Check if widget-id matches before updating context
|
|
158
157
|
var currentWidget = prevContext.Widgets[widgetName];
|
|
@@ -174,9 +173,9 @@ var createWidgetProxy = exports.createWidgetProxy = function createWidgetProxy(w
|
|
|
174
173
|
});
|
|
175
174
|
return true;
|
|
176
175
|
},
|
|
177
|
-
get: function get(target, prop
|
|
176
|
+
get: function get(target, prop) {
|
|
178
177
|
if ((0, _typeof2["default"])(prop) === "symbol" || prop === "prototype") {
|
|
179
|
-
return
|
|
178
|
+
return undefined;
|
|
180
179
|
}
|
|
181
180
|
|
|
182
181
|
// setProperty method to set properties dynamically
|
|
@@ -189,7 +188,7 @@ var createWidgetProxy = exports.createWidgetProxy = function createWidgetProxy(w
|
|
|
189
188
|
|
|
190
189
|
// Special getter for $element - return jQuery-like wrapped element
|
|
191
190
|
if (prop === "$element") {
|
|
192
|
-
var rawElement =
|
|
191
|
+
var rawElement = target[prop];
|
|
193
192
|
if (rawElement) {
|
|
194
193
|
// If already wrapped, return as-is
|
|
195
194
|
if (rawElement.length === 1 && (0, _dom.isDOMElement)(rawElement[0])) {
|
|
@@ -202,22 +201,17 @@ var createWidgetProxy = exports.createWidgetProxy = function createWidgetProxy(w
|
|
|
202
201
|
}
|
|
203
202
|
|
|
204
203
|
// Try to find element in DOM directly
|
|
205
|
-
var
|
|
206
|
-
var element = (0, _widgetObserver.findWidgetElement)(widgetName,
|
|
204
|
+
var widgetId = widget["data-widget-id"];
|
|
205
|
+
var element = (0, _widgetObserver.findWidgetElement)(widgetName, widgetId);
|
|
207
206
|
if (element) {
|
|
208
207
|
var wrappedElement = (0, _dom.wrapWithNativeDOM)(element);
|
|
209
|
-
|
|
210
|
-
value: wrappedElement,
|
|
211
|
-
writable: true,
|
|
212
|
-
configurable: true,
|
|
213
|
-
enumerable: false
|
|
214
|
-
});
|
|
208
|
+
target[prop] = wrappedElement; // Cache the wrapped element
|
|
215
209
|
return wrappedElement;
|
|
216
210
|
}
|
|
217
211
|
|
|
218
212
|
// Register for future element updates if not found
|
|
219
213
|
if (!target._elementCallbackRegistered) {
|
|
220
|
-
var key =
|
|
214
|
+
var key = widgetId ? "".concat(widgetName, ":").concat(widgetId) : widgetName;
|
|
221
215
|
var callbacks = _widgetObserver.widgetElementCallbacks.get(key);
|
|
222
216
|
if (!callbacks) {
|
|
223
217
|
callbacks = new Set();
|
|
@@ -225,30 +219,14 @@ var createWidgetProxy = exports.createWidgetProxy = function createWidgetProxy(w
|
|
|
225
219
|
}
|
|
226
220
|
callbacks.add(function (element) {
|
|
227
221
|
if (element) {
|
|
228
|
-
|
|
229
|
-
Reflect.defineProperty(target, prop, {
|
|
230
|
-
value: wrapped,
|
|
231
|
-
writable: true,
|
|
232
|
-
configurable: true,
|
|
233
|
-
enumerable: false
|
|
234
|
-
});
|
|
222
|
+
target[prop] = (0, _dom.wrapWithNativeDOM)(element);
|
|
235
223
|
}
|
|
236
224
|
});
|
|
237
|
-
|
|
238
|
-
value: true,
|
|
239
|
-
writable: true,
|
|
240
|
-
configurable: true,
|
|
241
|
-
enumerable: false
|
|
242
|
-
});
|
|
225
|
+
target._elementCallbackRegistered = true;
|
|
243
226
|
}
|
|
244
227
|
return null;
|
|
245
228
|
}
|
|
246
|
-
var value =
|
|
247
|
-
var widgetId = widget["data-widget-id"];
|
|
248
|
-
var widgetOverrides = (0, _scriptRegistry.getWidgetOverrides)(widgetName, widgetId);
|
|
249
|
-
if (prop in widgetOverrides) {
|
|
250
|
-
return widgetOverrides[prop];
|
|
251
|
-
}
|
|
229
|
+
var value = target[prop];
|
|
252
230
|
|
|
253
231
|
// Return DOM elements directly to preserve their context
|
|
254
232
|
if ((0, _dom.isDOMElement)(value)) {
|
|
@@ -300,12 +278,7 @@ var createPageProxy = exports.createPageProxy = function createPageProxy(target,
|
|
|
300
278
|
if (widget !== originalTarget || Object.keys(widget).length > Object.keys(originalTarget).length) {
|
|
301
279
|
// Copy all properties from widget to originalTarget
|
|
302
280
|
for (var key in widget) {
|
|
303
|
-
|
|
304
|
-
value: widget[key],
|
|
305
|
-
writable: true,
|
|
306
|
-
configurable: true,
|
|
307
|
-
enumerable: true
|
|
308
|
-
});
|
|
281
|
+
originalTarget[key] = widget[key];
|
|
309
282
|
}
|
|
310
283
|
}
|
|
311
284
|
return _proxy;
|
|
@@ -331,18 +304,9 @@ var createPageProxy = exports.createPageProxy = function createPageProxy(target,
|
|
|
331
304
|
var originalTarget = originalTargets.get(proxy);
|
|
332
305
|
|
|
333
306
|
// Only copy changed properties
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
var oldVal = originalTarget[key];
|
|
338
|
-
if (oldVal !== newVal) {
|
|
339
|
-
Reflect.defineProperty(originalTarget, key, {
|
|
340
|
-
value: newVal,
|
|
341
|
-
writable: true,
|
|
342
|
-
configurable: true,
|
|
343
|
-
enumerable: true
|
|
344
|
-
});
|
|
345
|
-
}
|
|
307
|
+
for (var key in widgetValue) {
|
|
308
|
+
if (originalTarget[key] !== widgetValue[key]) {
|
|
309
|
+
originalTarget[key] = widgetValue[key];
|
|
346
310
|
}
|
|
347
311
|
}
|
|
348
312
|
} else if (widgetValue && (0, _typeof2["default"])(widgetValue) === "object") {
|
|
@@ -350,6 +314,11 @@ var createPageProxy = exports.createPageProxy = function createPageProxy(target,
|
|
|
350
314
|
var _proxy2 = createWidgetProxy(widgetValue, widgetName, setPageContext);
|
|
351
315
|
widgetProxies.set(widgetName, _proxy2);
|
|
352
316
|
}
|
|
317
|
+
setPageContext(function (prev) {
|
|
318
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
319
|
+
Widgets: widgetsTarget
|
|
320
|
+
});
|
|
321
|
+
});
|
|
353
322
|
return true;
|
|
354
323
|
}
|
|
355
324
|
});
|
|
@@ -360,8 +329,7 @@ var createStateProxy = exports.createStateProxy = function createStateProxy(obj)
|
|
|
360
329
|
// Cache for nested proxies
|
|
361
330
|
var nestedProxies = new Map();
|
|
362
331
|
return new Proxy(obj, {
|
|
363
|
-
get: function get(target, prop
|
|
364
|
-
var _value$constructor;
|
|
332
|
+
get: function get(target, prop) {
|
|
365
333
|
if (prop === "eval") {
|
|
366
334
|
return function (fn) {
|
|
367
335
|
var failOnError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -384,15 +352,12 @@ var createStateProxy = exports.createStateProxy = function createStateProxy(obj)
|
|
|
384
352
|
if (!(prop in target)) {
|
|
385
353
|
return undefined;
|
|
386
354
|
}
|
|
387
|
-
var value =
|
|
355
|
+
var value = target[prop];
|
|
388
356
|
|
|
389
357
|
// Return primitives directly
|
|
390
358
|
if ((0, _typeof2["default"])(value) !== "object" || value === null) {
|
|
391
359
|
return value;
|
|
392
360
|
}
|
|
393
|
-
if ((value === null || value === void 0 || (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name) === "ServiceVariable") {
|
|
394
|
-
return value;
|
|
395
|
-
}
|
|
396
361
|
|
|
397
362
|
// Return DOM elements directly without proxying
|
|
398
363
|
if ((0, _dom.isDOMElement)(value)) {
|
|
@@ -414,15 +379,14 @@ var createStateProxy = exports.createStateProxy = function createStateProxy(obj)
|
|
|
414
379
|
nestedProxies.set(prop, nestedProxy);
|
|
415
380
|
return nestedProxy;
|
|
416
381
|
},
|
|
417
|
-
set: function set(target, prop, value
|
|
382
|
+
set: function set(target, prop, value) {
|
|
418
383
|
// Skip if value hasn't changed
|
|
419
|
-
|
|
420
|
-
if (currentVal === value) {
|
|
384
|
+
if (target[prop] === value) {
|
|
421
385
|
return true;
|
|
422
386
|
}
|
|
423
387
|
|
|
424
388
|
// Update target directly
|
|
425
|
-
|
|
389
|
+
target[prop] = value;
|
|
426
390
|
|
|
427
391
|
// Clear cached proxy if value is an object (but not an array)
|
|
428
392
|
if ((0, _typeof2["default"])(value) === "object" && value !== null && !Array.isArray(value) && nestedProxies.has(prop)) {
|
package/core/util/utils.js
CHANGED
|
@@ -4,11 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.triggerItemAction = exports.openLink = exports.isJQueryError = exports.isInsecureContentRequest = exports.getUrlParams = exports.getRouteNameFromLink = exports.
|
|
7
|
+
exports.triggerItemAction = exports.openLink = exports.isJQueryError = exports.isInsecureContentRequest = exports.getUrlParams = exports.getRouteNameFromLink = exports.Utils = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _navigationMiddleware = require("@wavemaker/react-runtime/store/middleware/navigationMiddleware");
|
|
10
10
|
var _constants = require("../constants");
|
|
11
|
-
var _navigation = require("next/navigation");
|
|
12
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; } } }; }
|
|
13
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; } }
|
|
14
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; }
|
|
@@ -172,23 +171,13 @@ var triggerItemAction = exports.triggerItemAction = function triggerItemAction(i
|
|
|
172
171
|
var routeName = getRouteNameFromLink(originalLink);
|
|
173
172
|
routeName = (0, _constants.hyperLinkMofify)(routeName);
|
|
174
173
|
if (Object.keys(queryParams).length > 0) {
|
|
175
|
-
|
|
176
|
-
var queryString = Object.entries(queryParams).filter(function (_ref) {
|
|
174
|
+
var queryString = Object.entries(queryParams).map(function (_ref) {
|
|
177
175
|
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
178
|
-
|
|
176
|
+
key = _ref2[0],
|
|
179
177
|
value = _ref2[1];
|
|
180
|
-
return value !== undefined && value !== null && value !== "";
|
|
181
|
-
}).map(function (_ref3) {
|
|
182
|
-
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
183
|
-
key = _ref4[0],
|
|
184
|
-
value = _ref4[1];
|
|
185
178
|
return "".concat(key, "=").concat(encodeURIComponent(value));
|
|
186
179
|
}).join("&");
|
|
187
|
-
|
|
188
|
-
router === null || router === void 0 || router.push("".concat(routeName, "?").concat(queryString));
|
|
189
|
-
} else {
|
|
190
|
-
router === null || router === void 0 || router.push(routeName);
|
|
191
|
-
}
|
|
180
|
+
router === null || router === void 0 || router.push("".concat(routeName, "?").concat(queryString));
|
|
192
181
|
} else {
|
|
193
182
|
router === null || router === void 0 || router.push(routeName);
|
|
194
183
|
}
|
|
@@ -197,12 +186,4 @@ var triggerItemAction = exports.triggerItemAction = function triggerItemAction(i
|
|
|
197
186
|
// For external links, use as-is (don't apply hyperLinkMofify)
|
|
198
187
|
openLink(originalLink, linkTarget);
|
|
199
188
|
}
|
|
200
|
-
};
|
|
201
|
-
var getCurrentPath = exports.getCurrentPath = function getCurrentPath() {
|
|
202
|
-
var path = (0, _navigation.usePathname)();
|
|
203
|
-
return path;
|
|
204
|
-
};
|
|
205
|
-
var getItemLink = exports.getItemLink = function getItemLink(item, props) {
|
|
206
|
-
var linkProperty = props.itemlink || "link";
|
|
207
|
-
return item[linkProperty];
|
|
208
189
|
};
|
package/higherOrder/BaseApp.js
CHANGED
|
@@ -57,14 +57,12 @@ var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript,
|
|
|
57
57
|
}),
|
|
58
58
|
serviceDefinitions: (0, _cloneDeep["default"])((info === null || info === void 0 ? void 0 : info.serviceDefs) || {}),
|
|
59
59
|
notifyApp: notifyApp,
|
|
60
|
-
notify: notify,
|
|
61
60
|
eval: evaluateExpression,
|
|
62
61
|
openActionDialog: openActionDialog,
|
|
63
62
|
executeStartAppOperations: executeStartAppOperations,
|
|
64
63
|
importModule: _helper.importModule,
|
|
65
|
-
Widgets: {}
|
|
66
|
-
|
|
67
|
-
}, appInfo)),
|
|
64
|
+
Widgets: {}
|
|
65
|
+
})),
|
|
68
66
|
appContext = _useState[0],
|
|
69
67
|
setAppContext = _useState[1];
|
|
70
68
|
var appProxyRef = (0, _react.useRef)(null);
|
|
@@ -73,7 +71,6 @@ var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript,
|
|
|
73
71
|
var isVariablesExecutedRef = (0, _react.useRef)(false);
|
|
74
72
|
var registrationTimeoutRef = (0, _react.useRef)(null);
|
|
75
73
|
var pendingWidgetRegistrations = (0, _react.useRef)({});
|
|
76
|
-
var subscribersRef = (0, _react.useRef)(new Map());
|
|
77
74
|
|
|
78
75
|
// Set up service error listener using EventNotifier (outside useEffect)
|
|
79
76
|
(0, _react.useEffect)(function () {
|
|
@@ -191,24 +188,21 @@ var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript,
|
|
|
191
188
|
_context4.next = 9;
|
|
192
189
|
return Promise.allSettled(variablePromises);
|
|
193
190
|
case 9:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
// Call onAppVariablesReady after startup variables are loaded
|
|
192
|
+
if (appProxyRef.current.onAppVariablesReady && typeof appProxyRef.current.onAppVariablesReady === "function") {
|
|
193
|
+
appProxyRef.current.onAppVariablesReady();
|
|
197
194
|
}
|
|
198
|
-
_context4.next =
|
|
199
|
-
return appProxyRef.current.onAppVariablesReady();
|
|
200
|
-
case 12:
|
|
201
|
-
_context4.next = 17;
|
|
195
|
+
_context4.next = 15;
|
|
202
196
|
break;
|
|
203
|
-
case
|
|
204
|
-
_context4.prev =
|
|
197
|
+
case 12:
|
|
198
|
+
_context4.prev = 12;
|
|
205
199
|
_context4.t0 = _context4["catch"](6);
|
|
206
200
|
console.error("Error during app startup operations:", _context4.t0);
|
|
207
|
-
case
|
|
201
|
+
case 15:
|
|
208
202
|
case "end":
|
|
209
203
|
return _context4.stop();
|
|
210
204
|
}
|
|
211
|
-
}, _callee4, null, [[6,
|
|
205
|
+
}, _callee4, null, [[6, 12]]);
|
|
212
206
|
}));
|
|
213
207
|
return _executeStartAppOperations.apply(this, arguments);
|
|
214
208
|
}
|
|
@@ -281,13 +275,10 @@ var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript,
|
|
|
281
275
|
return function executeAppStartup() {
|
|
282
276
|
return _ref2.apply(this, arguments);
|
|
283
277
|
};
|
|
284
|
-
}();
|
|
278
|
+
}(); // Execute startup operations
|
|
285
279
|
_context2.next = 11;
|
|
286
|
-
return executeStartAppOperations();
|
|
287
|
-
case 11:
|
|
288
|
-
_context2.next = 13;
|
|
289
280
|
return executeAppStartup();
|
|
290
|
-
case
|
|
281
|
+
case 11:
|
|
291
282
|
// Initialize DialogService in appstore
|
|
292
283
|
_appstore["default"].DialogService.set(_dialog["default"]);
|
|
293
284
|
|
|
@@ -300,10 +291,10 @@ var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript,
|
|
|
300
291
|
isAppReady: true
|
|
301
292
|
});
|
|
302
293
|
});
|
|
303
|
-
_context2.next =
|
|
294
|
+
_context2.next = 19;
|
|
304
295
|
break;
|
|
305
|
-
case
|
|
306
|
-
_context2.prev =
|
|
296
|
+
case 15:
|
|
297
|
+
_context2.prev = 15;
|
|
307
298
|
_context2.t0 = _context2["catch"](0);
|
|
308
299
|
console.error("Error initializing app:", _context2.t0);
|
|
309
300
|
setAppContext(function (prev) {
|
|
@@ -311,11 +302,11 @@ var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript,
|
|
|
311
302
|
isAppReady: true
|
|
312
303
|
});
|
|
313
304
|
});
|
|
314
|
-
case
|
|
305
|
+
case 19:
|
|
315
306
|
case "end":
|
|
316
307
|
return _context2.stop();
|
|
317
308
|
}
|
|
318
|
-
}, _callee2, null, [[0,
|
|
309
|
+
}, _callee2, null, [[0, 15]]);
|
|
319
310
|
}));
|
|
320
311
|
return function initializeApp() {
|
|
321
312
|
return _ref.apply(this, arguments);
|
|
@@ -338,40 +329,7 @@ var BaseApp = exports.BaseApp = function BaseApp(WrappedComponent, addAppScript,
|
|
|
338
329
|
var _appProxyRef$current2;
|
|
339
330
|
appProxyRef.current.lastActivePage = (_appProxyRef$current2 = appProxyRef.current) === null || _appProxyRef$current2 === void 0 ? void 0 : _appProxyRef$current2.activePageName;
|
|
340
331
|
appProxyRef.current.activePageName = pageName;
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
function subscribe(eventName, callback) {
|
|
344
|
-
if (!eventName || typeof callback !== "function") {
|
|
345
|
-
return function () {};
|
|
346
|
-
}
|
|
347
|
-
if (!subscribersRef.current.has(eventName)) {
|
|
348
|
-
subscribersRef.current.set(eventName, new Set());
|
|
349
|
-
}
|
|
350
|
-
var subscribers = subscribersRef.current.get(eventName);
|
|
351
|
-
subscribers.add(callback);
|
|
352
|
-
return function () {
|
|
353
|
-
var subs = subscribersRef.current.get(eventName);
|
|
354
|
-
if (subs) {
|
|
355
|
-
subs["delete"](callback);
|
|
356
|
-
if (subs.size === 0) {
|
|
357
|
-
subscribersRef.current["delete"](eventName);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
function notify(eventName, value) {
|
|
363
|
-
if (!eventName) {
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
var subscribers = subscribersRef.current.get(eventName);
|
|
367
|
-
if (subscribers && subscribers.size > 0) {
|
|
368
|
-
subscribers.forEach(function (callback) {
|
|
369
|
-
try {
|
|
370
|
-
callback(value);
|
|
371
|
-
} catch (error) {
|
|
372
|
-
console.error("Error in subscriber callback for ".concat(eventName, ":"), error);
|
|
373
|
-
}
|
|
374
|
-
});
|
|
332
|
+
appProxyRef.current.activePage = appProxyRef.current;
|
|
375
333
|
}
|
|
376
334
|
}
|
|
377
335
|
// Change locale function
|