@wavemaker/react-runtime 11.14.2-rc.6311 → 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 +1115 -1013
- 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
|
@@ -51,8 +51,7 @@ var WmCurrency = function WmCurrency(props) {
|
|
|
51
51
|
inputmode = _props$inputmode === void 0 ? "natural" : _props$inputmode,
|
|
52
52
|
_props$decimalplaces = props.decimalplaces,
|
|
53
53
|
decimalplaces = _props$decimalplaces === void 0 ? 0 : _props$decimalplaces,
|
|
54
|
-
|
|
55
|
-
updateon = _props$updateon === void 0 ? "blur" : _props$updateon,
|
|
54
|
+
updateon = props.updateon,
|
|
56
55
|
_props$updatedelay = props.updatedelay,
|
|
57
56
|
updatedelay = _props$updatedelay === void 0 ? "0" : _props$updatedelay,
|
|
58
57
|
onChange = props.onChange,
|
|
@@ -101,7 +100,7 @@ var WmCurrency = function WmCurrency(props) {
|
|
|
101
100
|
var debouncedUpdateValue = (0, _react.useCallback)(lodash.debounce(function (value) {
|
|
102
101
|
var validation = validateValue(value);
|
|
103
102
|
setShowError(!validation.isValid);
|
|
104
|
-
if (onChange || listener !== null && listener !== void 0 && listener.onChange) {
|
|
103
|
+
if (validation.isValid && (onChange || listener !== null && listener !== void 0 && listener.onChange)) {
|
|
105
104
|
(0, _formatUtil.handleValidatedValueUpdate)(value, name, inputEl.current, onChange, listener, prevDatavalue, setPrevDatavalue, props);
|
|
106
105
|
}
|
|
107
106
|
}, parseInt(updatedelay || "10"), {
|
|
@@ -220,7 +219,7 @@ var WmCurrency = function WmCurrency(props) {
|
|
|
220
219
|
setPrevDatavalue(datavalue);
|
|
221
220
|
}
|
|
222
221
|
}, [initialDataValue]);
|
|
223
|
-
var events = _objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
222
|
+
var events = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, onClick ? {
|
|
224
223
|
onClick: handleClick
|
|
225
224
|
} : {}), onMouseEnter ? {
|
|
226
225
|
onMouseEnter: handleMouseEnter
|
|
@@ -228,12 +227,6 @@ var WmCurrency = function WmCurrency(props) {
|
|
|
228
227
|
onMouseLeave: handleMouseLeave
|
|
229
228
|
} : {}), onFocus ? {
|
|
230
229
|
onFocus: handleFocus
|
|
231
|
-
} : {}), onBlur ? {
|
|
232
|
-
onBlur: handleBlur
|
|
233
|
-
} : {}), onChange ? {
|
|
234
|
-
onChange: handleInputChange
|
|
235
|
-
} : {}), onKeyDown ? {
|
|
236
|
-
onKeyDown: handleKeyDown
|
|
237
230
|
} : {});
|
|
238
231
|
return __jsx(_material.Box, {
|
|
239
232
|
component: "div",
|
|
@@ -261,7 +254,10 @@ var WmCurrency = function WmCurrency(props) {
|
|
|
261
254
|
tabIndex: tabindex,
|
|
262
255
|
accessKey: shortcutkey,
|
|
263
256
|
style: styles,
|
|
264
|
-
ref: inputEl
|
|
257
|
+
ref: inputEl,
|
|
258
|
+
onChange: handleInputChange,
|
|
259
|
+
onBlur: handleBlur,
|
|
260
|
+
onKeyDown: handleKeyDown
|
|
265
261
|
})));
|
|
266
262
|
};
|
|
267
263
|
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)((0, _withFormController["default"])(/*#__PURE__*/_react["default"].memo(WmCurrency)));
|
|
@@ -55,6 +55,7 @@ var WmCheckbox = exports.WmCheckbox = /*#__PURE__*/(0, _react.memo)(function (pr
|
|
|
55
55
|
rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
56
56
|
var checkboxRef = (0, _react.useRef)(null);
|
|
57
57
|
var prevRefValue = (0, _react.useRef)(null);
|
|
58
|
+
var isInitialized = (0, _react.useRef)(false);
|
|
58
59
|
|
|
59
60
|
// Keep track of the actual value (not just boolean state)
|
|
60
61
|
var _React$useState = _react["default"].useState(function () {
|
|
@@ -74,13 +75,14 @@ var WmCheckbox = exports.WmCheckbox = /*#__PURE__*/(0, _react.memo)(function (pr
|
|
|
74
75
|
|
|
75
76
|
// Update actual value when datavalue prop changes
|
|
76
77
|
(0, _react.useEffect)(function () {
|
|
77
|
-
if (prevRefValue.current === datavalue) return;
|
|
78
|
+
if (prevRefValue.current === datavalue || isInitialized.current) return;
|
|
78
79
|
if (datavalue === null || datavalue === undefined) {
|
|
79
80
|
setActualValue(null);
|
|
80
81
|
} else {
|
|
81
82
|
var newValue = datavalue === checkedvalue ? checkedvalue : uncheckedvalue;
|
|
82
83
|
setActualValue(newValue);
|
|
83
84
|
prevRefValue.current = datavalue;
|
|
85
|
+
isInitialized.current = true;
|
|
84
86
|
var event = {
|
|
85
87
|
target: {
|
|
86
88
|
checked: newValue
|
|
@@ -95,7 +97,6 @@ var WmCheckbox = exports.WmCheckbox = /*#__PURE__*/(0, _react.memo)(function (pr
|
|
|
95
97
|
|
|
96
98
|
// Update our internal state with the actual value
|
|
97
99
|
setActualValue(newValue);
|
|
98
|
-
prevRefValue.current = newValue;
|
|
99
100
|
if (listener !== null && listener !== void 0 && listener.onChange) {
|
|
100
101
|
listener.onChange(props.fieldName || name, {
|
|
101
102
|
datavalue: newValue // Pass the actual value, not boolean
|
|
@@ -9,6 +9,7 @@ exports["default"] = exports.WmCheckboxset = void 0;
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
15
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
@@ -22,7 +23,6 @@ var _constants = require("@wavemaker/react-runtime/components/constants");
|
|
|
22
23
|
var _transformedDatasetUtils = require("@wavemaker/react-runtime/utils/transformedDataset-utils");
|
|
23
24
|
var _input = require("@base-ui-components/react/input");
|
|
24
25
|
var _withFormController = _interopRequireDefault(require("@wavemaker/react-runtime/components/data/form/form-controller/withFormController"));
|
|
25
|
-
var _listHelpers = require("@wavemaker/react-runtime/components/data/list/utils/list-helpers");
|
|
26
26
|
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" != _typeof3(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); }
|
|
27
27
|
var __jsx = _react["default"].createElement;
|
|
28
28
|
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; }
|
|
@@ -45,6 +45,26 @@ var normalizeDatavalue = function normalizeDatavalue(datavalue) {
|
|
|
45
45
|
// Convert single value to array
|
|
46
46
|
return [datavalue];
|
|
47
47
|
};
|
|
48
|
+
|
|
49
|
+
// Helper function to generate itemsPerRowClass
|
|
50
|
+
var generateItemsPerRowClass = function generateItemsPerRowClass(itemsperrow) {
|
|
51
|
+
if (!itemsperrow) {
|
|
52
|
+
return "col-xs-12";
|
|
53
|
+
}
|
|
54
|
+
if (isNaN(parseInt(itemsperrow, 10))) {
|
|
55
|
+
// Handle string of classes (e.g. "xs-1 sm-1 md-1 lg-1")
|
|
56
|
+
return itemsperrow.split(" ").map(function (cls) {
|
|
57
|
+
var _cls$split = cls.split("-"),
|
|
58
|
+
_cls$split2 = (0, _slicedToArray2["default"])(_cls$split, 2),
|
|
59
|
+
tier = _cls$split2[0],
|
|
60
|
+
value = _cls$split2[1];
|
|
61
|
+
return "col-".concat(tier, "-").concat(12 / parseInt(value, 10));
|
|
62
|
+
}).join(" ");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Handle single number value
|
|
66
|
+
return "col-xs-".concat(12 / parseInt(itemsperrow, 10));
|
|
67
|
+
};
|
|
48
68
|
var WmCheckboxset = exports.WmCheckboxset = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
49
69
|
var _props$disabled = props.disabled,
|
|
50
70
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
@@ -130,7 +150,7 @@ var WmCheckboxset = exports.WmCheckboxset = /*#__PURE__*/(0, _react.memo)(functi
|
|
|
130
150
|
|
|
131
151
|
// Generate itemsPerRowClass
|
|
132
152
|
var itemsPerRowClass = (0, _react.useMemo)(function () {
|
|
133
|
-
return (
|
|
153
|
+
return generateItemsPerRowClass(itemsperrow);
|
|
134
154
|
}, [itemsperrow]);
|
|
135
155
|
var transformedDataset = (0, _react.useMemo)(function () {
|
|
136
156
|
if (!dataset) return [];
|
|
@@ -22,7 +22,6 @@ var _transformedDatasetUtils = require("@wavemaker/react-runtime/utils/transform
|
|
|
22
22
|
var _constants = require("@wavemaker/react-runtime/components/constants");
|
|
23
23
|
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
24
24
|
var _withFormController = _interopRequireDefault(require("@wavemaker/react-runtime/components/data/form/form-controller/withFormController"));
|
|
25
|
-
var _listHelpers = require("@wavemaker/react-runtime/components/data/list/utils/list-helpers");
|
|
26
25
|
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); }
|
|
27
26
|
var __jsx = _react["default"].createElement;
|
|
28
27
|
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; }
|
|
@@ -126,9 +125,7 @@ var WmRadioset = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
126
125
|
var _useState6 = (0, _react.useState)(null),
|
|
127
126
|
error = _useState6[0],
|
|
128
127
|
setError = _useState6[1];
|
|
129
|
-
var itemsPerRowClass = (
|
|
130
|
-
return (0, _listHelpers.getItemsPerRowClass)(itemsperrow);
|
|
131
|
-
}, [itemsperrow]);
|
|
128
|
+
var itemsPerRowClass = "items-per-row-".concat(itemsperrow.replace(/\s+/g, "-"));
|
|
132
129
|
var handleBlur = (0, _react.useCallback)(function () {
|
|
133
130
|
if (onblur) onblur();
|
|
134
131
|
}, [onblur]);
|
|
@@ -185,7 +182,9 @@ var WmRadioset = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
185
182
|
}
|
|
186
183
|
}, [groupby, localDatasetItems, collapsible, transformedDataset]);
|
|
187
184
|
(0, _react.useEffect)(function () {
|
|
188
|
-
|
|
185
|
+
if (datavalue !== undefined) {
|
|
186
|
+
setSelectedKey(datavalue);
|
|
187
|
+
}
|
|
189
188
|
}, [datavalue]);
|
|
190
189
|
var handleGroupClick = (0, _react.useCallback)(function (key, event) {
|
|
191
190
|
setExpandedItems(function (prevState) {
|
|
@@ -14,10 +14,8 @@ var _TimePicker = require("@mui/x-date-pickers/TimePicker");
|
|
|
14
14
|
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
|
15
15
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
16
16
|
var _BaseDateTime = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/BaseDateTime"));
|
|
17
|
-
var _withFormController = _interopRequireDefault(require("@wavemaker/react-runtime/components/data/form/form-controller/withFormController"));
|
|
18
17
|
var _utils = require("./utils");
|
|
19
18
|
var _styled = require("./styled");
|
|
20
|
-
var _store = require("@wavemaker/react-runtime/store");
|
|
21
19
|
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); }
|
|
22
20
|
var __jsx = _react["default"].createElement;
|
|
23
21
|
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; }
|
|
@@ -33,9 +31,7 @@ var WmDateTime = exports.WmDateTime = function WmDateTime(props) {
|
|
|
33
31
|
shortcutkey = props.shortcutkey,
|
|
34
32
|
datavalue = props.datavalue,
|
|
35
33
|
_props$datepattern = props.datepattern,
|
|
36
|
-
datepattern = _props$datepattern === void 0 ?
|
|
37
|
-
return "".concat(state.i18n.dateFormat, " ").concat(state.i18n.timeFormat) || "MMM d, y h:mm:ss a";
|
|
38
|
-
}) : _props$datepattern,
|
|
34
|
+
datepattern = _props$datepattern === void 0 ? "MMM d, y h:mm:ss a" : _props$datepattern,
|
|
39
35
|
_props$hourstep = props.hourstep,
|
|
40
36
|
hourstep = _props$hourstep === void 0 ? 1 : _props$hourstep,
|
|
41
37
|
_props$minutestep = props.minutestep,
|
|
@@ -657,4 +653,4 @@ var WmDateTime = exports.WmDateTime = function WmDateTime(props) {
|
|
|
657
653
|
}));
|
|
658
654
|
};
|
|
659
655
|
WmDateTime.displayName = "WmDateTime";
|
|
660
|
-
var _default = exports["default"] = (0, _BaseDateTime["default"])(
|
|
656
|
+
var _default = exports["default"] = (0, _BaseDateTime["default"])(WmDateTime);
|
|
@@ -12,7 +12,6 @@ var _xDatePickers = require("@mui/x-date-pickers");
|
|
|
12
12
|
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _BaseDateTime = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/BaseDateTime"));
|
|
15
|
-
var _withFormController = _interopRequireDefault(require("@wavemaker/react-runtime/components/data/form/form-controller/withFormController"));
|
|
16
15
|
var _utils = require("./utils");
|
|
17
16
|
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); }
|
|
18
17
|
var __jsx = _react["default"].createElement;
|
|
@@ -410,4 +409,4 @@ var WmTime = function WmTime(props) {
|
|
|
410
409
|
}));
|
|
411
410
|
};
|
|
412
411
|
WmTime.displayName = "WmTime";
|
|
413
|
-
var _default = exports["default"] = (0, _BaseDateTime["default"])(
|
|
412
|
+
var _default = exports["default"] = (0, _BaseDateTime["default"])(WmTime);
|
|
@@ -104,8 +104,8 @@ var WmNumber = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
104
104
|
currentTarget: inputEl.current
|
|
105
105
|
};
|
|
106
106
|
listener === null || listener === void 0 || (_listener$onChange = listener.onChange) === null || _listener$onChange === void 0 || _listener$onChange.call(listener, props.fieldName || name, {
|
|
107
|
-
datavalue: value == null ? "" : value,
|
|
108
|
-
value: value == null ? "" : value,
|
|
107
|
+
datavalue: value == null ? "" : parseInt(value.toString()),
|
|
108
|
+
value: value == null ? "" : parseInt(value.toString()),
|
|
109
109
|
displayValue: value == null ? "" : value.toString()
|
|
110
110
|
}, value, prevDatavalue);
|
|
111
111
|
if (onChange) {
|
|
@@ -7,7 +7,6 @@ exports.autoCapitalize = autoCapitalize;
|
|
|
7
7
|
exports.removeDisplayFormat = exports.formatInput = void 0;
|
|
8
8
|
var formatInput = exports.formatInput = function formatInput(value, format) {
|
|
9
9
|
if (!format || !value) return value;
|
|
10
|
-
value = value.toString();
|
|
11
10
|
var digitsOnly = value.replace(/\D/g, "");
|
|
12
11
|
var formatDigits = format.replace(/[^9]/g, "");
|
|
13
12
|
var maxDigits = formatDigits.length;
|
|
@@ -147,7 +146,6 @@ var formatInput = exports.formatInput = function formatInput(value, format) {
|
|
|
147
146
|
*/
|
|
148
147
|
var removeDisplayFormat = exports.removeDisplayFormat = function removeDisplayFormat(value, format) {
|
|
149
148
|
if (!format || !value) return value;
|
|
150
|
-
value = value.toString();
|
|
151
149
|
|
|
152
150
|
// For alphanumeric formats (like AA-9999), keep both letters and numbers
|
|
153
151
|
if (format.includes("A")) {
|
|
@@ -100,30 +100,32 @@ var WmTextarea = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
100
100
|
};
|
|
101
101
|
}, [required, regexp, maxchars]);
|
|
102
102
|
var updateValue = (0, _react.useCallback)(function (newValue, validation) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
listener.onChange
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
charlength: newValue === null || newValue === void 0 ? void 0 : newValue.length
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
if (onChange) {
|
|
112
|
-
var syntheticEvent = {
|
|
113
|
-
target: {
|
|
103
|
+
if (validation.isValid) {
|
|
104
|
+
isInternalUpdate.current = true;
|
|
105
|
+
if (listener !== null && listener !== void 0 && listener.onChange) {
|
|
106
|
+
listener.onChange(props.fieldName || name, {
|
|
107
|
+
datavalue: newValue,
|
|
114
108
|
value: newValue,
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
109
|
+
charlength: newValue === null || newValue === void 0 ? void 0 : newValue.length
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (onChange) {
|
|
113
|
+
var syntheticEvent = {
|
|
114
|
+
target: {
|
|
115
|
+
value: newValue,
|
|
116
|
+
name: name
|
|
117
|
+
},
|
|
118
|
+
currentTarget: textareaRef.current
|
|
119
|
+
};
|
|
120
|
+
onChange(syntheticEvent, props, newValue, valueRef.current);
|
|
121
|
+
}
|
|
121
122
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
// We need this setTimeout to ensure external updates don't override
|
|
124
|
+
// our internal update immediately
|
|
125
|
+
setTimeout(function () {
|
|
126
|
+
isInternalUpdate.current = false;
|
|
127
|
+
}, 0);
|
|
128
|
+
}
|
|
127
129
|
}, [onChange, listener === null || listener === void 0 ? void 0 : listener.onChange]);
|
|
128
130
|
|
|
129
131
|
// Debounced update with stable reference
|
|
@@ -37,7 +37,7 @@ function WmLeftPanel(props) {
|
|
|
37
37
|
id: id,
|
|
38
38
|
component: "div",
|
|
39
39
|
sx: styles,
|
|
40
|
-
className: (0, _clsx["default"])(DEFAULT_CLASS, className, "col-sm-".concat(columnwidth, "
|
|
40
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, className, "col-sm-".concat(columnwidth, " app-nav-").concat(navtype))
|
|
41
41
|
}, children);
|
|
42
42
|
}
|
|
43
43
|
WmLeftPanel.displayName = "WmLeftPanel";
|
|
@@ -14,8 +14,7 @@ var _navItem = require("@wavemaker/react-runtime/components/navbar/nav-item");
|
|
|
14
14
|
var _anchor = require("@wavemaker/react-runtime/components/basic/anchor");
|
|
15
15
|
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
16
16
|
var _menu = _interopRequireDefault(require("@wavemaker/react-runtime/components/navigation/menu"));
|
|
17
|
-
var
|
|
18
|
-
var _utils2 = require("../../../core/util/utils");
|
|
17
|
+
var _constants = require("../../../core/constants");
|
|
19
18
|
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); }
|
|
20
19
|
var __jsx = _react["default"].createElement;
|
|
21
20
|
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; }
|
|
@@ -36,117 +35,30 @@ var WmNav = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
36
35
|
name = props.name,
|
|
37
36
|
styles = props.styles,
|
|
38
37
|
id = props.id;
|
|
39
|
-
var path = (0, _utils2.getCurrentPath)();
|
|
40
|
-
var _useState = (0, _react.useState)(null),
|
|
41
|
-
activeNavItemIndex = _useState[0],
|
|
42
|
-
setActiveNavItemIndex = _useState[1];
|
|
43
|
-
var _useState2 = (0, _react.useState)(null),
|
|
44
|
-
hoveredNavItemIndex = _useState2[0],
|
|
45
|
-
setHoveredNavItemIndex = _useState2[1];
|
|
46
|
-
var activeNavItemIndexRef = (0, _react.useRef)(null);
|
|
47
|
-
var triggerActionClickForAnchor = function triggerActionClickForAnchor(e, item) {
|
|
48
|
-
e === null || e === void 0 || e.preventDefault();
|
|
49
|
-
(0, _utils.triggerItemAction)({
|
|
50
|
-
label: getItemLabel(item),
|
|
51
|
-
link: item[props.itemlink || "link"],
|
|
52
|
-
target: item[props.itemtarget]
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// Helper function to get the label - handles both string and function
|
|
57
|
-
var getItemLabel = function getItemLabel(item) {
|
|
58
|
-
var itemlabel = props.itemlabel;
|
|
59
|
-
if (typeof itemlabel === "function") {
|
|
60
|
-
try {
|
|
61
|
-
return itemlabel(item);
|
|
62
|
-
} catch (error) {
|
|
63
|
-
console.warn("Error in itemlabel function:", error);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// If itemlabel is a string, use it as property name
|
|
68
|
-
if (typeof itemlabel === "string") {
|
|
69
|
-
return item[itemlabel];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Fallback
|
|
73
|
-
return item["label"];
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// Handler to activate nav item when menu detects active item or menu item is clicked
|
|
77
|
-
var handleNavItemActivate = (0, _react.useCallback)(function (navItemIndex) {
|
|
78
|
-
return function () {
|
|
79
|
-
activeNavItemIndexRef.current = navItemIndex;
|
|
80
|
-
setActiveNavItemIndex(navItemIndex);
|
|
81
|
-
};
|
|
82
|
-
}, []);
|
|
83
|
-
|
|
84
|
-
// Handler for nav item hover enter
|
|
85
|
-
var handleNavItemMouseEnter = (0, _react.useCallback)(function (index) {
|
|
86
|
-
return function (event) {
|
|
87
|
-
setHoveredNavItemIndex(index);
|
|
88
|
-
};
|
|
89
|
-
}, []);
|
|
90
|
-
|
|
91
|
-
// Handler for nav item hover leave
|
|
92
|
-
var handleNavItemMouseLeave = (0, _react.useCallback)(function (event) {
|
|
93
|
-
setHoveredNavItemIndex(null);
|
|
94
|
-
}, []);
|
|
95
|
-
|
|
96
|
-
// Check if nav item should be active - menu handles its own active detection
|
|
97
|
-
var isNavItemActive = (0, _react.useCallback)(function (item, index) {
|
|
98
|
-
var currentActiveIndex = activeNavItemIndexRef.current;
|
|
99
|
-
if (currentActiveIndex !== null && currentActiveIndex !== undefined) {
|
|
100
|
-
return currentActiveIndex === index;
|
|
101
|
-
}
|
|
102
|
-
var subActions = item["itemchildren"] || item["children"] || item["SubActions"];
|
|
103
|
-
var hasSubactions = Array.isArray(subActions) && subActions.length > 0;
|
|
104
|
-
if (hasSubactions) {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
var itemLink = (0, _utils2.getItemLink)(item, props);
|
|
108
|
-
if (itemLink) {
|
|
109
|
-
var currentRoute = "#/".concat(path.split("/").filter(Boolean).pop() || "");
|
|
110
|
-
if (itemLink === currentRoute || path === itemLink.replace("#", "")) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return false;
|
|
115
|
-
}, [activeNavItemIndex, path]);
|
|
116
38
|
var renderNavItem = function renderNavItem() {
|
|
117
39
|
if (props.dataset && props.dataset.length > 0) {
|
|
118
40
|
return props.dataset.map(function (item, index) {
|
|
119
|
-
var label = getItemLabel(item);
|
|
120
|
-
var isActive = isNavItemActive(item, index);
|
|
121
41
|
var subActions = item["itemchildren"] || item["children"] || item["SubActions"];
|
|
122
42
|
var hasSubactions = Array.isArray(subActions) && subActions.length > 0;
|
|
123
43
|
var childComponent = hasSubactions ? __jsx(_menu["default"], {
|
|
124
44
|
name: "",
|
|
125
45
|
itemlabel: props.itemlabel,
|
|
126
|
-
itemlink: props.itemlink,
|
|
127
|
-
itemicon: props.itemicon,
|
|
128
46
|
listener: {},
|
|
129
47
|
iconclass: item[props.itemicon],
|
|
130
|
-
caption: label,
|
|
48
|
+
caption: item[props.itemlabel || "label"],
|
|
131
49
|
dataset: subActions,
|
|
132
50
|
type: "anchor",
|
|
133
|
-
|
|
134
|
-
onNavItemActivate: handleNavItemActivate(index),
|
|
135
|
-
onSelect: props.onSelect,
|
|
136
|
-
isNavFromMenu: true
|
|
51
|
+
onSelect: props.onSelect
|
|
137
52
|
}) : __jsx(_anchor.WmAnchor, {
|
|
138
53
|
name: "",
|
|
139
54
|
listener: {},
|
|
140
|
-
caption: label,
|
|
55
|
+
caption: item[props.itemlabel || "label"],
|
|
141
56
|
iconclass: item[props.itemicon],
|
|
142
57
|
iconposition: item[props.iconposition],
|
|
143
58
|
iconheight: item[props.iconheight],
|
|
144
59
|
iconwidth: item[props.iconwidth],
|
|
145
60
|
iconmargin: item[props.iconmargin],
|
|
146
|
-
hyperlink: "
|
|
147
|
-
onClick: function onClick(e) {
|
|
148
|
-
return triggerActionClickForAnchor(e, item);
|
|
149
|
-
},
|
|
61
|
+
hyperlink: (0, _constants.hyperLinkMofify)(item[props.itemlink || "link"]),
|
|
150
62
|
target: item[props.itemtarget],
|
|
151
63
|
action: item[props.itemaction],
|
|
152
64
|
badgevalue: item[props.itembadge],
|
|
@@ -157,10 +69,8 @@ var WmNav = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
157
69
|
key: index,
|
|
158
70
|
name: "",
|
|
159
71
|
listener: {},
|
|
160
|
-
className:
|
|
161
|
-
hint: item[props.itemhint]
|
|
162
|
-
onMouseEnter: handleNavItemMouseEnter(index),
|
|
163
|
-
onMouseLeave: handleNavItemMouseLeave
|
|
72
|
+
className: hasSubactions ? "nav-".concat(type) : undefined,
|
|
73
|
+
hint: item[props.itemhint]
|
|
164
74
|
}, childComponent);
|
|
165
75
|
});
|
|
166
76
|
}
|
|
@@ -20,8 +20,7 @@ var WmNavItem = exports.WmNavItem = /*#__PURE__*/(0, _react.memo)(function (prop
|
|
|
20
20
|
var className = props.className,
|
|
21
21
|
styles = props.styles,
|
|
22
22
|
id = props.id,
|
|
23
|
-
|
|
24
|
-
onMouseLeave = props.onMouseLeave;
|
|
23
|
+
name = props.name;
|
|
25
24
|
return __jsx(_ListItem["default"], {
|
|
26
25
|
name: name,
|
|
27
26
|
id: id,
|
|
@@ -33,9 +32,7 @@ var WmNavItem = exports.WmNavItem = /*#__PURE__*/(0, _react.memo)(function (prop
|
|
|
33
32
|
padding: "inherit"
|
|
34
33
|
}),
|
|
35
34
|
className: (0, _clsx["default"])(DEFAULT_CLASS, className),
|
|
36
|
-
title: props.hint
|
|
37
|
-
onMouseEnter: onMouseEnter,
|
|
38
|
-
onMouseLeave: onMouseLeave
|
|
35
|
+
title: props.hint
|
|
39
36
|
}, props.children);
|
|
40
37
|
}, function (prev, current) {
|
|
41
38
|
var keys = ["className", "styles", "children"];
|