@wavemaker/react-runtime 11.15.2-rc.64737 → 11.15.4-rc.250
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/components/basic/richtexteditor/index.js +53 -9
- package/components/chart/index.js +2 -11
- package/components/common/AppSpinner.js +4 -1
- package/components/container/panel/components/panel-content/index.js +18 -0
- package/components/container/wizard/index.js +1 -1
- package/components/data/form/base-form/index.js +156 -105
- package/components/data/form/form-context.js +17 -1
- package/components/data/form/form-controller/hooks/index.js +127 -0
- package/components/data/form/form-controller/utils.js +52 -1
- package/components/data/form/form-controller/withFormController.js +10 -162
- package/components/data/form/form-dynamic-section/index.js +46 -0
- package/components/data/form/form-dynamic-section/props.js +5 -0
- package/components/data/form/index.js +5 -0
- package/components/data/list/hooks/useListEffects.js +10 -3
- package/components/data/list/hooks/useListEventHandlers.js +20 -15
- package/components/data/list/index.js +7 -8
- package/components/data/list/utils/list-helpers.js +21 -1
- package/components/data/list/utils/list-widget-methods.js +2 -0
- package/components/data/list/utils/widget-instance-utils.js +82 -0
- package/components/data/pagination/components/BasicPagination.js +1 -0
- package/components/data/pagination/components/PageSizeSelector.js +11 -3
- package/components/data/pagination/index.js +1 -2
- package/components/data/table/hooks/useServerSideSorting.js +10 -16
- package/components/data/table/index.js +55 -57
- package/components/data/table/utils/buildSelectionColumns.js +23 -32
- package/components/data/table/utils/index.js +7 -2
- package/components/dialogs/index.js +6 -0
- package/components/input/default/checkbox/index.js +5 -2
- package/components/input/epoch/date/components/DatePickerPopover.js +17 -2
- package/components/input/epoch/date/index.js +21 -17
- package/components/input/epoch/datetime/index.js +2 -4
- package/components/navigation/popover/index.js +8 -21
- package/components/page/partial-container/index.js +19 -1
- package/context/WidgetProvider.js +28 -14
- package/core/proxy-service.js +1 -2
- package/core/util/compare.js +6 -0
- package/higherOrder/BasePage.js +1 -1
- package/higherOrder/withBaseWrapper.js +22 -8
- package/libs/index.js +3 -10
- package/libs/prefab/index.js +20 -0
- package/package-lock.json +204 -158
- package/package.json +2 -2
- package/utils/lib-error-skipper.js +5 -2
- package/utils/state-persistance.js +42 -33
- package/utils/widget-cleanup-util.js +30 -0
- package/variables/live-variable.js +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/react-runtime",
|
|
3
|
-
"version": "11.15.
|
|
3
|
+
"version": "11.15.4-rc.250",
|
|
4
4
|
"description": "React runtime package for Wavemaker",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@types/react": "^19.2.8",
|
|
79
79
|
"@types/react-color": "^3.0.13",
|
|
80
80
|
"@types/react-dom": "^19.2.3",
|
|
81
|
-
"@wavemaker/variables": "11.15.
|
|
81
|
+
"@wavemaker/variables": "11.15.4-rc.250",
|
|
82
82
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
83
83
|
"eslint": "^9",
|
|
84
84
|
"eslint-config-next": "15.1.4",
|
|
@@ -20,7 +20,8 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
20
20
|
|
|
21
21
|
var UNSUPPORTED_LIBRARIES = {
|
|
22
22
|
jquery: {
|
|
23
|
-
|
|
23
|
+
// Use specific jQuery patterns - avoid matching Wavemaker vars like $index, $data
|
|
24
|
+
identifiers: ["jQuery", "$(", "$."],
|
|
24
25
|
errorMessage: "jQuery is not supported in React App",
|
|
25
26
|
notificationMessage: "jQuery functionality is not supported. Check console for details."
|
|
26
27
|
}
|
|
@@ -107,7 +108,9 @@ function detectUnsupportedLibrary(error) {
|
|
|
107
108
|
*/
|
|
108
109
|
var isJQueryError = exports.isJQueryError = function isJQueryError(error) {
|
|
109
110
|
if (!(error !== null && error !== void 0 && error.stack)) return false;
|
|
110
|
-
|
|
111
|
+
|
|
112
|
+
// Use specific jQuery patterns - avoid matching Wavemaker vars like $index, $data
|
|
113
|
+
var UnSupportedFunctionality = ["jQuery", "$(", "$."];
|
|
111
114
|
|
|
112
115
|
// Check if error message contains jQuery references
|
|
113
116
|
if (error.message && UnSupportedFunctionality.some(function (func) {
|
|
@@ -211,6 +211,41 @@ var uriToJson = function uriToJson(encodedObj) {
|
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
+
// URL state update batching - prevents Chrome IPC flooding (crbug.com/1038223) when many
|
|
215
|
+
// widgets call replaceState during the same React commit phase (e.g., multiple tables mounting)
|
|
216
|
+
var pendingUrlStates = null;
|
|
217
|
+
var urlStateRafId = null;
|
|
218
|
+
var flushPendingUrlState = function flushPendingUrlState() {
|
|
219
|
+
urlStateRafId = null;
|
|
220
|
+
if (pendingUrlStates === null) return;
|
|
221
|
+
var states = pendingUrlStates;
|
|
222
|
+
pendingUrlStates = null;
|
|
223
|
+
var currentUrl = window.location.href;
|
|
224
|
+
var url = new URL(window.location.href);
|
|
225
|
+
var urlParams = new URLSearchParams(url.search);
|
|
226
|
+
if ((0, _lodashEs.keys)(states).length > 0) {
|
|
227
|
+
var encodedState = jsonToUri(states);
|
|
228
|
+
urlParams["delete"](WM_STATE_URL_PARAM);
|
|
229
|
+
var newSearch = urlParams.toString();
|
|
230
|
+
if (newSearch) newSearch += "&";
|
|
231
|
+
newSearch += "".concat(WM_STATE_URL_PARAM, "=").concat(encodedState);
|
|
232
|
+
url.search = newSearch ? "?" + newSearch : "";
|
|
233
|
+
} else {
|
|
234
|
+
urlParams["delete"](WM_STATE_URL_PARAM);
|
|
235
|
+
url.search = urlParams.toString();
|
|
236
|
+
}
|
|
237
|
+
if (currentUrl !== url.toString() && !pageNavigationPending) {
|
|
238
|
+
var newPath = url.pathname + url.search;
|
|
239
|
+
window.history.replaceState(_objectSpread({}, window.history.state), "", newPath);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
var scheduleUrlStateUpdate = function scheduleUrlStateUpdate(states) {
|
|
243
|
+
pendingUrlStates = states;
|
|
244
|
+
if (urlStateRafId === null) {
|
|
245
|
+
urlStateRafId = requestAnimationFrame(flushPendingUrlState);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
|
|
214
249
|
// Get all widget states from storage
|
|
215
250
|
var getAllStates = function getAllStates(storage) {
|
|
216
251
|
switch (storage) {
|
|
@@ -229,6 +264,10 @@ var getAllStates = function getAllStates(storage) {
|
|
|
229
264
|
return {};
|
|
230
265
|
}
|
|
231
266
|
case "URL":
|
|
267
|
+
// Use pending state when available - ensures consistency when URL updates are batched
|
|
268
|
+
if (pendingUrlStates !== null) {
|
|
269
|
+
return _objectSpread({}, pendingUrlStates);
|
|
270
|
+
}
|
|
232
271
|
// Get the raw URL parameter value
|
|
233
272
|
var searchParams = window.location.search;
|
|
234
273
|
var match = searchParams.match(new RegExp("[?&]".concat(WM_STATE_URL_PARAM, "=([^&]+)")));
|
|
@@ -251,39 +290,9 @@ var setAllStates = function setAllStates(storage, states) {
|
|
|
251
290
|
sessionStorage.setItem(getStorageKey(), JSON.stringify(states));
|
|
252
291
|
break;
|
|
253
292
|
case "URL":
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if ((0, _lodashEs.keys)(states).length > 0) {
|
|
258
|
-
// Use Angular's encoding approach
|
|
259
|
-
var encodedState = jsonToUri(states);
|
|
260
|
-
|
|
261
|
-
// Remove existing wm_state param
|
|
262
|
-
urlParams["delete"](WM_STATE_URL_PARAM);
|
|
263
|
-
|
|
264
|
-
// Build URL manually to avoid double encoding
|
|
265
|
-
var newSearch = urlParams.toString();
|
|
266
|
-
if (newSearch) {
|
|
267
|
-
newSearch += "&";
|
|
268
|
-
}
|
|
269
|
-
newSearch += "".concat(WM_STATE_URL_PARAM, "=").concat(encodedState);
|
|
270
|
-
url.search = newSearch ? "?" + newSearch : "";
|
|
271
|
-
} else {
|
|
272
|
-
urlParams["delete"](WM_STATE_URL_PARAM);
|
|
273
|
-
url.search = urlParams.toString();
|
|
274
|
-
}
|
|
275
|
-
if (currentUrl !== url.toString()) {
|
|
276
|
-
// Skip URL state update if page navigation is pending to prevent
|
|
277
|
-
// URL update from overwriting the pending router.push()
|
|
278
|
-
if (pageNavigationPending) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// Use window.history.replaceState() to update URL without triggering re-render
|
|
283
|
-
// This is more efficient than router.replace() which causes component re-renders
|
|
284
|
-
var newPath = url.pathname + url.search;
|
|
285
|
-
window.history.replaceState(_objectSpread({}, window.history.state), "", newPath);
|
|
286
|
-
}
|
|
293
|
+
// Batch URL updates via requestAnimationFrame to prevent Chrome IPC flooding
|
|
294
|
+
// when many widgets (tables, lists, etc.) update state during the same commit phase
|
|
295
|
+
scheduleUrlStateUpdate(states);
|
|
287
296
|
break;
|
|
288
297
|
}
|
|
289
298
|
};
|
|
@@ -5,10 +5,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.createWidgetCleanup = void 0;
|
|
8
|
+
exports.removeWidgetsFromContext = removeWidgetsFromContext;
|
|
8
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
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; }
|
|
11
12
|
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; }
|
|
13
|
+
/**
|
|
14
|
+
* Removes widgets from page context, cleans up registry, and returns the new context.
|
|
15
|
+
* Returns prev unchanged if no widgets were present.
|
|
16
|
+
*
|
|
17
|
+
* @param prev - Current page context
|
|
18
|
+
* @param names - Widget names to remove
|
|
19
|
+
* @returns New context with widgets removed, or prev if no changes
|
|
20
|
+
*/
|
|
21
|
+
function removeWidgetsFromContext(prev, proxy, names) {
|
|
22
|
+
var widgets = prev === null || prev === void 0 ? void 0 : prev.Widgets;
|
|
23
|
+
if (!widgets) return prev;
|
|
24
|
+
var hasChanges = names.some(function (name) {
|
|
25
|
+
return name in widgets;
|
|
26
|
+
});
|
|
27
|
+
if (!hasChanges) return prev;
|
|
28
|
+
var registry = prev === null || prev === void 0 ? void 0 : prev.overriddenPropsRegistry;
|
|
29
|
+
var nextWidgets = _objectSpread({}, widgets);
|
|
30
|
+
names.forEach(function (name) {
|
|
31
|
+
nextWidgets[name] = undefined;
|
|
32
|
+
registry === null || registry === void 0 || registry.destroy(name);
|
|
33
|
+
if (proxy.Widgets) {
|
|
34
|
+
proxy.Widgets[name] = null;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
38
|
+
Widgets: nextWidgets
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
12
42
|
/**
|
|
13
43
|
* Configuration for the widget cleanup utility
|
|
14
44
|
*/
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
8
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -86,11 +87,28 @@ var LiveVariable = /*#__PURE__*/function (_LiveVariable3) {
|
|
|
86
87
|
}
|
|
87
88
|
};
|
|
88
89
|
_this = _callSuper(this, LiveVariable, [variableConfig]);
|
|
90
|
+
|
|
91
|
+
// Fix: The upstream manager's updateDataset() uses Object.defineProperty
|
|
92
|
+
// without configurable:true on a shared module-level emptyArr singleton.
|
|
93
|
+
// On repeated error handling, this causes "Cannot redefine property: data".
|
|
94
|
+
// Intercept dataSet assignments so every set produces a fresh array copy,
|
|
95
|
+
// ensuring the shared emptyArr reference is never mutated.
|
|
89
96
|
_this.config = config;
|
|
90
97
|
(0, _defineProperty2["default"])(_this, "params", {});
|
|
91
98
|
(0, _defineProperty2["default"])(_this, "filters", {});
|
|
92
99
|
(0, _defineProperty2["default"])(_this, "filterValues", {});
|
|
93
100
|
(0, _defineProperty2["default"])(_this, "lastFilters", {});
|
|
101
|
+
var _dataSet = _this.dataSet;
|
|
102
|
+
Object.defineProperty(_this, "dataSet", {
|
|
103
|
+
get: function get() {
|
|
104
|
+
return _dataSet;
|
|
105
|
+
},
|
|
106
|
+
set: function set(val) {
|
|
107
|
+
_dataSet = Array.isArray(val) ? (0, _toConsumableArray2["default"])(val) : val;
|
|
108
|
+
},
|
|
109
|
+
configurable: true,
|
|
110
|
+
enumerable: true
|
|
111
|
+
});
|
|
94
112
|
_this.dateFormatter = _formatters["default"].get("toDate");
|
|
95
113
|
_this.init();
|
|
96
114
|
return _this;
|