@wavemaker-ai/react-runtime 1.0.0-rc.317 → 1.0.0-rc.322
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/advanced/carousel/index.d.ts +2 -0
- package/components/advanced/carousel/template.d.ts +2 -0
- package/components/advanced/login/index.d.ts +2 -0
- package/components/advanced/marquee/index.d.ts +2 -0
- package/components/auth/RoleAuthGuard.js +1 -0
- package/components/basic/anchor/index.d.ts +2 -0
- package/components/basic/anchor/index.js +1 -1
- package/components/basic/audio/index.d.ts +2 -0
- package/components/basic/html/index.d.ts +2 -0
- package/components/basic/icon/index.d.ts +2 -0
- package/components/basic/iframe/index.d.ts +2 -0
- package/components/basic/label/index.d.ts +2 -0
- package/components/basic/label/index.js +17 -3
- package/components/basic/picture/index.d.ts +2 -0
- package/components/basic/picture/index.js +20 -1
- package/components/basic/progress-bar/index.d.ts +2 -0
- package/components/basic/progress-circle/index.d.ts +2 -0
- package/components/basic/progress-circle/index.js +2 -1
- package/components/basic/richtexteditor/index.d.ts +4 -0
- package/components/basic/richtexteditor/index.js +16 -15
- package/components/basic/search/index.d.ts +4 -0
- package/components/basic/spinner/index.d.ts +2 -0
- package/components/basic/tile/index.d.ts +2 -0
- package/components/basic/tree/index.d.ts +2 -0
- package/components/basic/video/index.d.ts +2 -0
- package/components/chart/index.d.ts +2 -0
- package/components/common/index.d.ts +2 -0
- package/components/common/index.js +5 -1
- package/components/common/wm-skeleton.d.ts +95 -0
- package/components/common/wm-skeleton.js +346 -0
- package/components/container/accordion/accordion-pane/index.d.ts +2 -0
- package/components/container/accordion/index.d.ts +4 -0
- package/components/container/accordion/index.js +23 -1
- package/components/container/accordion/props.d.ts +10 -0
- package/components/container/index.d.ts +2 -0
- package/components/container/index.js +2 -4
- package/components/container/layout-grid/grid-column/index.d.ts +2 -0
- package/components/container/layout-grid/grid-row/index.d.ts +2 -0
- package/components/container/layout-grid/index.d.ts +2 -0
- package/components/container/linear-layout/index.d.ts +2 -0
- package/components/container/linear-layout/linear-layout-item/index.d.ts +2 -0
- package/components/container/panel/index.d.ts +2 -0
- package/components/container/repeat-template/index.d.ts +2 -0
- package/components/container/tabs/index.d.ts +4 -0
- package/components/container/tabs/index.js +23 -1
- package/components/container/tabs/props.d.ts +10 -0
- package/components/container/tabs/tab-pane/index.d.ts +2 -0
- package/components/container/wizard/index.d.ts +8 -0
- package/components/container/wizard/index.js +27 -3
- package/components/container/wizard/props.d.ts +10 -0
- package/components/container/wizard/wizard-step/index.d.ts +2 -0
- package/components/data/card/card-actions/index.d.ts +2 -0
- package/components/data/card/card-content/index.d.ts +2 -0
- package/components/data/card/card-footer/index.d.ts +2 -0
- package/components/data/card/index.d.ts +2 -0
- package/components/data/card/index.js +12 -6
- package/components/data/form/base-form/hooks/useFormOperations.d.ts +1 -1
- package/components/data/form/base-form/hooks/useFormOperations.js +3 -3
- package/components/data/form/base-form/index.js +30 -25
- package/components/data/form/base-form/props.d.ts +1 -1
- package/components/data/form/dynamic-fields/index.js +3 -0
- package/components/data/form/form-action/index.d.ts +4 -0
- package/components/data/form/form-controller/hooks/index.js +2 -1
- package/components/data/form/form-controller/withFormController.js +11 -16
- package/components/data/form/form-field/base-field.js +0 -5
- package/components/data/form/form-field/index.js +99 -13
- package/components/data/form/form-field/props.d.ts +8 -0
- package/components/data/form/index.js +13 -0
- package/components/data/list/index.d.ts +7 -0
- package/components/data/list/index.js +18 -0
- package/components/data/list/props.d.ts +7 -0
- package/components/data/table/components/RowCells.js +4 -1
- package/components/data/table/hooks/useDynamicColumns.js +3 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +2 -0
- package/components/data/table/index.d.ts +8 -0
- package/components/data/table/index.js +15 -0
- package/components/data/table/live-table/index.d.ts +2 -0
- package/components/data/table/props.d.ts +10 -0
- package/components/data/table/table-action/index.d.ts +2 -0
- package/components/data/table/table-column/index.d.ts +2 -0
- package/components/data/table/table-row/index.d.ts +2 -0
- package/components/data/table/table-row-action/index.d.ts +2 -0
- package/components/data/table/utils/index.d.ts +2 -0
- package/components/data/table/utils/index.js +17 -3
- package/components/dialogs/alert-dialog/index.d.ts +4 -0
- package/components/dialogs/confirm-dialog/index.d.ts +4 -0
- package/components/dialogs/dialog/index.d.ts +4 -0
- package/components/dialogs/dialog-actions/index.d.ts +2 -0
- package/components/dialogs/dialog-body/index.d.ts +2 -0
- package/components/dialogs/dialog-content/index.d.ts +2 -0
- package/components/dialogs/dialog-header/index.d.ts +2 -0
- package/components/dialogs/iframe-dialog/index.d.ts +4 -0
- package/components/dialogs/login-dialog/index.d.ts +4 -0
- package/components/dialogs/page-dialog/index.d.ts +4 -0
- package/components/form/button/index.d.ts +2 -0
- package/components/form/button/index.js +10 -1
- package/components/form/button-group/index.d.ts +2 -0
- package/components/input/calendar/index.d.ts +4 -0
- package/components/input/calendar/index.js +2 -1
- package/components/input/chips/index.d.ts +4 -0
- package/components/input/color-picker/index.d.ts +4 -0
- package/components/input/color-picker/index.js +18 -7
- package/components/input/composite/index.d.ts +2 -0
- package/components/input/currency/index.d.ts +4 -0
- package/components/input/default/checkbox/index.d.ts +4 -0
- package/components/input/default/checkboxset/index.d.ts +4 -0
- package/components/input/default/checkboxset/index.js +7 -5
- package/components/input/default/radioset/index.d.ts +4 -0
- package/components/input/default/radioset/index.js +2 -1
- package/components/input/default/switch/index.d.ts +4 -0
- package/components/input/default/switch/index.js +17 -13
- package/components/input/epoch/date/index.d.ts +2 -0
- package/components/input/epoch/date/index.js +30 -14
- package/components/input/epoch/datetime/index.d.ts +2 -0
- package/components/input/epoch/datetime/index.js +12 -8
- package/components/input/epoch/time/index.d.ts +2 -0
- package/components/input/epoch/time/index.js +21 -15
- package/components/input/fileupload/index.d.ts +2 -0
- package/components/input/number/index.d.ts +4 -0
- package/components/input/number/index.js +4 -3
- package/components/input/rating/index.d.ts +4 -0
- package/components/input/select/index.d.ts +4 -0
- package/components/input/slider/index.d.ts +4 -0
- package/components/input/slider/index.js +4 -2
- package/components/input/text/index.d.ts +4 -0
- package/components/input/text/index.js +16 -8
- package/components/input/textarea/index.d.ts +4 -0
- package/components/input/upload/index.d.ts +4 -0
- package/components/input/upload/index.js +6 -4
- package/components/navbar/index.d.ts +2 -0
- package/components/navbar/nav/index.d.ts +2 -0
- package/components/navbar/nav-item/index.d.ts +2 -0
- package/components/navigation/breadcrumb/index.d.ts +2 -0
- package/components/navigation/menu/index.d.ts +2 -0
- package/components/navigation/menu/index.js +2 -2
- package/components/navigation/popover/index.d.ts +2 -0
- package/components/page/partial/index.d.ts +2 -0
- package/context/AppContext.d.ts +2 -0
- package/context/AppContext.js +20 -1
- package/context/WidgetProvider.js +0 -3
- package/core/proxy-service.d.ts +2 -0
- package/core/proxy-service.js +25 -0
- package/higherOrder/BaseApp.js +1 -3
- package/higherOrder/BaseAppProps.d.ts +1 -1
- package/higherOrder/BasePage.js +4 -2
- package/higherOrder/props.d.ts +10 -0
- package/higherOrder/withBaseWrapper.js +3 -0
- package/hooks/useAuth.js +3 -0
- package/hooks/useLayoutSize.d.ts +6 -0
- package/hooks/useLayoutSize.js +12 -0
- package/package-lock.json +230 -204
- package/package.json +3 -3
- package/runtime-dynamic/components/use-dynamic-component.js +6 -11
- package/runtime-dynamic/main.js +1 -3
- package/runtime-dynamic/services/component-ref-provider.d.ts +1 -1
- package/runtime-dynamic/services/component-ref-provider.js +14 -11
- package/runtime-dynamic/services/resource-manager.js +10 -4
- package/runtime-dynamic/services/script-executor.js +4 -1
- package/runtime-dynamic/services/variable-registry.js +3 -0
- package/utils/attr.js +0 -1
- package/utils/format-util.js +2 -3
- package/utils/form-state.util.d.ts +0 -62
- package/utils/form-state.util.js +0 -109
|
@@ -79,18 +79,19 @@ const WmTime = (props) => {
|
|
|
79
79
|
);
|
|
80
80
|
const handleTimeChange = useCallback(
|
|
81
81
|
(newTime, event2, shouldClosePicker = false) => {
|
|
82
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
82
83
|
if (!newTime) {
|
|
83
84
|
const oldValue = displayValue;
|
|
84
85
|
setInternalValue(null);
|
|
85
86
|
setDisplayValue("");
|
|
86
87
|
setValidationResult({ isValid: true });
|
|
87
88
|
invokeOnChange == null ? void 0 : invokeOnChange("", { $event: event2, type: "change" });
|
|
88
|
-
if (name && (listener == null ? void 0 : listener.Widgets[name])) {
|
|
89
|
+
if (name && ((_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name])) {
|
|
89
90
|
listener.Widgets[name].displayValue = "";
|
|
90
91
|
}
|
|
91
92
|
updateListener(name, listener, props, "", null, "");
|
|
92
|
-
if (onChange && name && (listener == null ? void 0 : listener.Widgets[name])) {
|
|
93
|
-
onChange(event2, listener == null ? void 0 : listener.Widgets[name], "", oldValue);
|
|
93
|
+
if (onChange && name && ((_b = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b[name])) {
|
|
94
|
+
onChange(event2, (_c = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _c[name], "", oldValue);
|
|
94
95
|
}
|
|
95
96
|
if (shouldClosePicker) setShowPicker == null ? void 0 : setShowPicker(false);
|
|
96
97
|
return;
|
|
@@ -109,7 +110,7 @@ const WmTime = (props) => {
|
|
|
109
110
|
const outputFormattedValue = formatDisplayTimeValue(newTime, outputformat);
|
|
110
111
|
setDisplayValue(formattedValue);
|
|
111
112
|
invokeOnChange == null ? void 0 : invokeOnChange(outputFormattedValue, { $event: event2, type: "change" });
|
|
112
|
-
if (name && (listener == null ? void 0 : listener.Widgets[name])) {
|
|
113
|
+
if (name && ((_d = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _d[name])) {
|
|
113
114
|
listener.Widgets[name].displayValue = formattedValue;
|
|
114
115
|
}
|
|
115
116
|
updateListener(
|
|
@@ -120,13 +121,13 @@ const WmTime = (props) => {
|
|
|
120
121
|
formatDisplayTimeValue(newTime, "timestamp"),
|
|
121
122
|
outputFormattedValue
|
|
122
123
|
);
|
|
123
|
-
if (onChange && name && (listener == null ? void 0 : listener.Widgets[name])) {
|
|
124
|
-
onChange(event2, name && (listener == null ? void 0 : listener.Widgets[name]), outputFormattedValue, displayValue);
|
|
124
|
+
if (onChange && name && ((_e = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _e[name])) {
|
|
125
|
+
onChange(event2, name && ((_f = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _f[name]), outputFormattedValue, displayValue);
|
|
125
126
|
}
|
|
126
127
|
} else {
|
|
127
128
|
const formattedValue = formatDisplayTimeValue(newTime, timepattern);
|
|
128
|
-
if (onChange && name && (listener == null ? void 0 : listener.Widgets[name]) && props.formfield) {
|
|
129
|
-
onChange(event2, name && (listener == null ? void 0 : listener.Widgets[name]), formattedValue, displayValue);
|
|
129
|
+
if (onChange && name && ((_g = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _g[name]) && props.formfield) {
|
|
130
|
+
onChange(event2, name && ((_h = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _h[name]), formattedValue, displayValue);
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
if (shouldClosePicker) setShowPicker == null ? void 0 : setShowPicker(false);
|
|
@@ -166,6 +167,7 @@ const WmTime = (props) => {
|
|
|
166
167
|
}, [setShowPicker]);
|
|
167
168
|
const handleInputChange = useCallback(
|
|
168
169
|
(event2) => {
|
|
170
|
+
var _a, _b, _c, _d;
|
|
169
171
|
try {
|
|
170
172
|
const inputValue = event2.target.value;
|
|
171
173
|
if (!inputValue) {
|
|
@@ -180,8 +182,8 @@ const WmTime = (props) => {
|
|
|
180
182
|
);
|
|
181
183
|
if (!formatValidation.isValid) {
|
|
182
184
|
setValidationResult(formatValidation);
|
|
183
|
-
if (onChange && name && (listener == null ? void 0 : listener.Widgets[name]) && props.formfield) {
|
|
184
|
-
onChange(event2, listener == null ? void 0 : listener.Widgets[name], inputValue, displayValue);
|
|
185
|
+
if (onChange && name && ((_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]) && props.formfield) {
|
|
186
|
+
onChange(event2, (_b = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b[name], inputValue, displayValue);
|
|
185
187
|
}
|
|
186
188
|
setDisplayValue(inputValue);
|
|
187
189
|
return;
|
|
@@ -199,8 +201,8 @@ const WmTime = (props) => {
|
|
|
199
201
|
if (rangeValidation.isValid) {
|
|
200
202
|
handleTimeChange(parsedTime.toDate(), event2, false);
|
|
201
203
|
} else {
|
|
202
|
-
if (onChange && name && (listener == null ? void 0 : listener.Widgets[name]) && props.formfield) {
|
|
203
|
-
onChange(event2, listener == null ? void 0 : listener.Widgets[name], inputValue, displayValue);
|
|
204
|
+
if (onChange && name && ((_c = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _c[name]) && props.formfield) {
|
|
205
|
+
onChange(event2, (_d = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _d[name], inputValue, displayValue);
|
|
204
206
|
}
|
|
205
207
|
setDisplayValue(inputValue);
|
|
206
208
|
}
|
|
@@ -227,6 +229,7 @@ const WmTime = (props) => {
|
|
|
227
229
|
);
|
|
228
230
|
const handleClick = useCallback(
|
|
229
231
|
(event2) => {
|
|
232
|
+
var _a;
|
|
230
233
|
try {
|
|
231
234
|
if (disabled || readonly || isCurrentTime) return;
|
|
232
235
|
if (anchorRef.current && !anchorRef.current.contains(document.activeElement)) {
|
|
@@ -236,7 +239,7 @@ const WmTime = (props) => {
|
|
|
236
239
|
setShowPicker == null ? void 0 : setShowPicker(true);
|
|
237
240
|
}
|
|
238
241
|
if (onClick && name) {
|
|
239
|
-
onClick(event2, listener == null ? void 0 : listener.Widgets[name]);
|
|
242
|
+
onClick(event2, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
240
243
|
}
|
|
241
244
|
} catch (error) {
|
|
242
245
|
console.error("Error in handleClick:", error);
|
|
@@ -321,7 +324,7 @@ const WmTime = (props) => {
|
|
|
321
324
|
} else if (datavalue instanceof Date) {
|
|
322
325
|
parsed = moment(datavalue);
|
|
323
326
|
} else {
|
|
324
|
-
parsed = moment(datavalue, timepattern, true);
|
|
327
|
+
parsed = moment(parseTimeValue(datavalue, timepattern), timepattern, true);
|
|
325
328
|
}
|
|
326
329
|
setInternalValue(parsed);
|
|
327
330
|
if (parsed.isValid()) {
|
|
@@ -388,7 +391,10 @@ const WmTime = (props) => {
|
|
|
388
391
|
value: displayValue,
|
|
389
392
|
onChange: handleInputChange,
|
|
390
393
|
onClick: handleClick,
|
|
391
|
-
onFocus: (event2) =>
|
|
394
|
+
onFocus: (event2) => {
|
|
395
|
+
var _a;
|
|
396
|
+
return onFocus && name && onFocus(event2, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
397
|
+
},
|
|
392
398
|
onBlur: (event2) => {
|
|
393
399
|
var _a;
|
|
394
400
|
return onBlur && name && ((_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]) ? onBlur(event2, listener.Widgets[name]) : void 0;
|
|
@@ -69,6 +69,8 @@ declare const WmNumberStandalone: React.ComponentType<import("../../data/form/fo
|
|
|
69
69
|
formfield?: boolean;
|
|
70
70
|
dataset?: any;
|
|
71
71
|
prefabName?: string;
|
|
72
|
+
loading?: boolean;
|
|
73
|
+
showSkeleton?: boolean;
|
|
72
74
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
73
75
|
export { WmNumberStandalone as WmNumber };
|
|
74
76
|
/**
|
|
@@ -160,5 +162,7 @@ declare const _default: React.ComponentType<{
|
|
|
160
162
|
formfield?: boolean;
|
|
161
163
|
dataset?: any;
|
|
162
164
|
prefabName?: string;
|
|
165
|
+
loading?: boolean;
|
|
166
|
+
showSkeleton?: boolean;
|
|
163
167
|
}>;
|
|
164
168
|
export default _default;
|
|
@@ -347,12 +347,13 @@ const WmNumber = memo(
|
|
|
347
347
|
}
|
|
348
348
|
}, [initialDataValue, initialMaxDataValue, initialMaxValue, isMaxWidget]);
|
|
349
349
|
useEffect(() => {
|
|
350
|
+
var _a;
|
|
350
351
|
if (inputEl.current) {
|
|
351
352
|
const focus = () => {
|
|
352
|
-
var
|
|
353
|
-
(
|
|
353
|
+
var _a2;
|
|
354
|
+
(_a2 = inputEl.current) == null ? void 0 : _a2.focus();
|
|
354
355
|
};
|
|
355
|
-
if (listener == null ? void 0 : listener.Widgets[name]) {
|
|
356
|
+
if ((_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]) {
|
|
356
357
|
listener.Widgets[name].focus = focus;
|
|
357
358
|
}
|
|
358
359
|
}
|
|
@@ -91,6 +91,8 @@ declare const WmRatingStandalone: React.ComponentType<import("../../data/form/fo
|
|
|
91
91
|
formfield?: boolean;
|
|
92
92
|
updateon?: string;
|
|
93
93
|
prefabName?: string;
|
|
94
|
+
loading?: boolean;
|
|
95
|
+
showSkeleton?: boolean;
|
|
94
96
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
95
97
|
export { WmRatingStandalone as WmRating };
|
|
96
98
|
/**
|
|
@@ -204,5 +206,7 @@ declare const _default: React.ComponentType<{
|
|
|
204
206
|
formfield?: boolean;
|
|
205
207
|
updateon?: string;
|
|
206
208
|
prefabName?: string;
|
|
209
|
+
loading?: boolean;
|
|
210
|
+
showSkeleton?: boolean;
|
|
207
211
|
}>;
|
|
208
212
|
export default _default;
|
|
@@ -73,6 +73,8 @@ declare const WmSelectStandalone: React.ComponentType<import("../../data/form/fo
|
|
|
73
73
|
formfield?: boolean;
|
|
74
74
|
updateon?: string;
|
|
75
75
|
prefabName?: string;
|
|
76
|
+
loading?: boolean;
|
|
77
|
+
showSkeleton?: boolean;
|
|
76
78
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
77
79
|
export { WmSelectStandalone as WmSelect };
|
|
78
80
|
/**
|
|
@@ -169,5 +171,7 @@ declare const _default: React.ComponentType<{
|
|
|
169
171
|
formfield?: boolean;
|
|
170
172
|
updateon?: string;
|
|
171
173
|
prefabName?: string;
|
|
174
|
+
loading?: boolean;
|
|
175
|
+
showSkeleton?: boolean;
|
|
172
176
|
}>;
|
|
173
177
|
export default _default;
|
|
@@ -67,6 +67,8 @@ declare const WmSliderStandalone: React.ComponentType<import("../../data/form/fo
|
|
|
67
67
|
updateon?: string;
|
|
68
68
|
dataset?: any;
|
|
69
69
|
prefabName?: string;
|
|
70
|
+
loading?: boolean;
|
|
71
|
+
showSkeleton?: boolean;
|
|
70
72
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
71
73
|
export { WmSliderStandalone as WmSlider };
|
|
72
74
|
/**
|
|
@@ -158,5 +160,7 @@ declare const _default: React.ComponentType<{
|
|
|
158
160
|
updateon?: string;
|
|
159
161
|
dataset?: any;
|
|
160
162
|
prefabName?: string;
|
|
163
|
+
loading?: boolean;
|
|
164
|
+
showSkeleton?: boolean;
|
|
161
165
|
}>;
|
|
162
166
|
export default _default;
|
|
@@ -83,9 +83,10 @@ const WmSlider = memo(
|
|
|
83
83
|
);
|
|
84
84
|
const handleInputChange = useCallback(
|
|
85
85
|
(event) => {
|
|
86
|
+
var _a;
|
|
86
87
|
const newVal = Number(event.target.value);
|
|
87
88
|
setValue(newVal);
|
|
88
|
-
if (listener == null ? void 0 : listener.Widgets[name]) {
|
|
89
|
+
if ((_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]) {
|
|
89
90
|
listener.Widgets[name].displayValue = newVal;
|
|
90
91
|
}
|
|
91
92
|
if (onChange) {
|
|
@@ -172,10 +173,11 @@ const WmSlider = memo(
|
|
|
172
173
|
}, [props.minvalue, props.maxvalue, step, markerlabeltext, showmarkers]);
|
|
173
174
|
const applyValue = useCallback(
|
|
174
175
|
(newVal) => {
|
|
176
|
+
var _a;
|
|
175
177
|
const oldVal = prevDatavalueRef.current;
|
|
176
178
|
setValue(newVal);
|
|
177
179
|
prevDatavalueRef.current = newVal;
|
|
178
|
-
if (listener == null ? void 0 : listener.Widgets[name]) {
|
|
180
|
+
if ((_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]) {
|
|
179
181
|
listener.Widgets[name].displayValue = newVal;
|
|
180
182
|
}
|
|
181
183
|
if (onChange) {
|
|
@@ -76,6 +76,8 @@ declare const WmTextStandalone: import("react").ComponentType<import("../../data
|
|
|
76
76
|
formfield?: boolean;
|
|
77
77
|
dataset?: any;
|
|
78
78
|
prefabName?: string;
|
|
79
|
+
loading?: boolean;
|
|
80
|
+
showSkeleton?: boolean;
|
|
79
81
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
80
82
|
export { WmTextStandalone as WmText };
|
|
81
83
|
/**
|
|
@@ -173,5 +175,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
173
175
|
formfield?: boolean;
|
|
174
176
|
dataset?: any;
|
|
175
177
|
prefabName?: string;
|
|
178
|
+
loading?: boolean;
|
|
179
|
+
showSkeleton?: boolean;
|
|
176
180
|
}>;
|
|
177
181
|
export default _default;
|
|
@@ -289,6 +289,7 @@ const WmText = memo(
|
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
291
|
const handleBlur = (e) => {
|
|
292
|
+
var _a;
|
|
292
293
|
if (readonly || disabled) {
|
|
293
294
|
return;
|
|
294
295
|
}
|
|
@@ -306,14 +307,16 @@ const WmText = memo(
|
|
|
306
307
|
setIsTouched(true);
|
|
307
308
|
setIsDirty(true);
|
|
308
309
|
}
|
|
309
|
-
onBlur == null ? void 0 : onBlur(e, listener == null ? void 0 : listener.Widgets[name]);
|
|
310
|
+
onBlur == null ? void 0 : onBlur(e, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
310
311
|
};
|
|
311
312
|
const handleFocus = (e) => {
|
|
312
|
-
|
|
313
|
+
var _a;
|
|
314
|
+
onFocus == null ? void 0 : onFocus(e, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
313
315
|
};
|
|
314
316
|
const handleKeyDown = (e) => {
|
|
315
317
|
delay(() => {
|
|
316
|
-
|
|
318
|
+
var _a;
|
|
319
|
+
onKeydown == null ? void 0 : onKeydown(e, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
317
320
|
if (e.key === "Enter") {
|
|
318
321
|
debouncedUpdateValue(rawValue);
|
|
319
322
|
}
|
|
@@ -321,24 +324,29 @@ const WmText = memo(
|
|
|
321
324
|
};
|
|
322
325
|
const handleKeyPress = (e) => {
|
|
323
326
|
delay(() => {
|
|
324
|
-
|
|
327
|
+
var _a;
|
|
328
|
+
onKeypress == null ? void 0 : onKeypress(e, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
325
329
|
}, 0);
|
|
326
330
|
};
|
|
327
331
|
const handleKeyUp = (e) => {
|
|
328
332
|
delay(() => {
|
|
329
|
-
|
|
333
|
+
var _a;
|
|
334
|
+
onKeyup == null ? void 0 : onKeyup(e, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
330
335
|
}, 0);
|
|
331
336
|
};
|
|
332
337
|
const handleLeadingIconClick = (e) => {
|
|
338
|
+
var _a;
|
|
333
339
|
e.preventDefault();
|
|
334
|
-
onLeadingiconclick == null ? void 0 : onLeadingiconclick(e, listener == null ? void 0 : listener.Widgets[name]);
|
|
340
|
+
onLeadingiconclick == null ? void 0 : onLeadingiconclick(e, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
335
341
|
};
|
|
336
342
|
const handleTrailingIconClick = (e) => {
|
|
343
|
+
var _a;
|
|
337
344
|
e.preventDefault();
|
|
338
|
-
onTrailingiconclick == null ? void 0 : onTrailingiconclick(e, listener == null ? void 0 : listener.Widgets[name]);
|
|
345
|
+
onTrailingiconclick == null ? void 0 : onTrailingiconclick(e, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
339
346
|
};
|
|
340
347
|
const handleMouseEnter = (e) => {
|
|
341
|
-
|
|
348
|
+
var _a;
|
|
349
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
342
350
|
setIsTouched(true);
|
|
343
351
|
};
|
|
344
352
|
const events = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
@@ -63,6 +63,8 @@ declare const WmTextareaStandalone: React.ComponentType<import("../../data/form/
|
|
|
63
63
|
formfield?: boolean;
|
|
64
64
|
dataset?: any;
|
|
65
65
|
prefabName?: string;
|
|
66
|
+
loading?: boolean;
|
|
67
|
+
showSkeleton?: boolean;
|
|
66
68
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
67
69
|
export { WmTextareaStandalone as WmTextarea };
|
|
68
70
|
/**
|
|
@@ -147,5 +149,7 @@ declare const _default: React.ComponentType<{
|
|
|
147
149
|
formfield?: boolean;
|
|
148
150
|
dataset?: any;
|
|
149
151
|
prefabName?: string;
|
|
152
|
+
loading?: boolean;
|
|
153
|
+
showSkeleton?: boolean;
|
|
150
154
|
}>;
|
|
151
155
|
export default _default;
|
|
@@ -58,6 +58,8 @@ declare const WithForm: React.NamedExoticComponent<import("../../data/form/form-
|
|
|
58
58
|
updateon?: string;
|
|
59
59
|
dataset?: any;
|
|
60
60
|
prefabName?: string;
|
|
61
|
+
loading?: boolean;
|
|
62
|
+
showSkeleton?: boolean;
|
|
61
63
|
}>;
|
|
62
64
|
/**
|
|
63
65
|
* The WmUpload component provides a file upload input for form fields with blob support.
|
|
@@ -138,5 +140,7 @@ declare const _default: React.ComponentType<{
|
|
|
138
140
|
updateon?: string;
|
|
139
141
|
dataset?: any;
|
|
140
142
|
prefabName?: string;
|
|
143
|
+
loading?: boolean;
|
|
144
|
+
showSkeleton?: boolean;
|
|
141
145
|
}>;
|
|
142
146
|
export default _default;
|
|
@@ -45,7 +45,7 @@ const WmUpload = memo(
|
|
|
45
45
|
const prevDatavalue = useRef(datavalue);
|
|
46
46
|
const isImage = (formField == null ? void 0 : formField.filetype) === "image";
|
|
47
47
|
const handleFileChange = (event) => {
|
|
48
|
-
var _a, _b, _c;
|
|
48
|
+
var _a, _b, _c, _d;
|
|
49
49
|
const file = ((_a = event.target.files) == null ? void 0 : _a[0]) || null;
|
|
50
50
|
if (type === "file") {
|
|
51
51
|
(_b = listener == null ? void 0 : listener.onChange) == null ? void 0 : _b.call(listener, props.fieldName || props.name, {
|
|
@@ -59,7 +59,7 @@ const WmUpload = memo(
|
|
|
59
59
|
if (onChange) {
|
|
60
60
|
onChange(
|
|
61
61
|
event,
|
|
62
|
-
listener == null ? void 0 : listener.Widgets[name],
|
|
62
|
+
(_d = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _d[name],
|
|
63
63
|
type === "file" ? file : event.target.value,
|
|
64
64
|
prevDatavalue.current
|
|
65
65
|
);
|
|
@@ -67,13 +67,15 @@ const WmUpload = memo(
|
|
|
67
67
|
prevDatavalue.current = file;
|
|
68
68
|
};
|
|
69
69
|
const handleFileFocus = (event) => {
|
|
70
|
+
var _a;
|
|
70
71
|
if (onFocus) {
|
|
71
|
-
onFocus(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
72
|
+
onFocus(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
75
|
const handleFileBlur = (event) => {
|
|
76
|
+
var _a;
|
|
75
77
|
if (onBlur) {
|
|
76
|
-
onBlur(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
78
|
+
onBlur(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
77
79
|
}
|
|
78
80
|
};
|
|
79
81
|
const renderExistingFile = useCallback(() => {
|
|
@@ -63,6 +63,8 @@ declare const _default: import("react").MemoExoticComponent<import("react").Comp
|
|
|
63
63
|
updateon?: string;
|
|
64
64
|
dataset?: any;
|
|
65
65
|
prefabName?: string;
|
|
66
|
+
loading?: boolean;
|
|
67
|
+
showSkeleton?: boolean;
|
|
66
68
|
title?: string;
|
|
67
69
|
brandHref?: string;
|
|
68
70
|
showToggle?: boolean;
|
|
@@ -31,6 +31,7 @@ declare const _default: React.ComponentType<{
|
|
|
31
31
|
type?: "button" | "anchor";
|
|
32
32
|
prefabName?: string;
|
|
33
33
|
key?: string;
|
|
34
|
+
loading?: boolean;
|
|
34
35
|
id?: string;
|
|
35
36
|
caption?: string;
|
|
36
37
|
ref?: React.RefObject<HTMLElement> | React.RefObject<null>;
|
|
@@ -73,6 +74,7 @@ declare const _default: React.ComponentType<{
|
|
|
73
74
|
formfield?: boolean;
|
|
74
75
|
updateon?: string;
|
|
75
76
|
dataset?: any;
|
|
77
|
+
showSkeleton?: boolean;
|
|
76
78
|
orderby?: string;
|
|
77
79
|
iconclass?: string;
|
|
78
80
|
onSelect?: ($event: React.MouseEvent<HTMLElement>, widget: any, $item: any) => void;
|
|
@@ -366,7 +366,7 @@ const WmMenu = memo((props) => {
|
|
|
366
366
|
);
|
|
367
367
|
const handleMenuItemClick = useCallback(
|
|
368
368
|
(event, item) => {
|
|
369
|
-
var _a2, _b2, _c2, _d, _e;
|
|
369
|
+
var _a2, _b2, _c2, _d, _e, _f;
|
|
370
370
|
event = event.nativeEvent;
|
|
371
371
|
const { label, icon, link } = getNodeProperties(item);
|
|
372
372
|
if (item.children && item.children.length > 0 || !link || link === "#") {
|
|
@@ -396,7 +396,7 @@ const WmMenu = memo((props) => {
|
|
|
396
396
|
if (isFromNav && onNavItemActivate) {
|
|
397
397
|
onNavItemActivate();
|
|
398
398
|
}
|
|
399
|
-
if (name && (listener == null ? void 0 : listener.Widgets[name])) {
|
|
399
|
+
if (name && ((_f = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _f[name])) {
|
|
400
400
|
listener.Widgets[name].displayValue = label;
|
|
401
401
|
}
|
|
402
402
|
if (listener == null ? void 0 : listener.onChange) {
|
package/context/AppContext.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ interface AppProviderProps {
|
|
|
6
6
|
declare const AppContext: import("react").Context<AppProviderProps>;
|
|
7
7
|
export declare const useAppContext: () => BaseAppProps;
|
|
8
8
|
export declare const useAppProxy: () => any;
|
|
9
|
+
export declare const useAppNotificationAction: () => any;
|
|
10
|
+
export declare const useNotifyApp: () => any;
|
|
9
11
|
export default AppContext;
|
package/context/AppContext.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext } from "react";
|
|
2
|
+
import get from "lodash-es/get";
|
|
2
3
|
const AppContext = createContext(void 0);
|
|
3
4
|
const useAppContext = () => {
|
|
4
5
|
var _a;
|
|
@@ -16,9 +17,27 @@ const useAppProxy = () => {
|
|
|
16
17
|
}
|
|
17
18
|
return context;
|
|
18
19
|
};
|
|
20
|
+
const useAppNotificationAction = () => {
|
|
21
|
+
var _a;
|
|
22
|
+
const context = (_a = useContext(AppContext)) == null ? void 0 : _a.proxy;
|
|
23
|
+
if (context === void 0) {
|
|
24
|
+
throw new Error("useNotificationAction must be used within an AppProvider");
|
|
25
|
+
}
|
|
26
|
+
return get(context, "Actions.appNotification", null);
|
|
27
|
+
};
|
|
28
|
+
const useNotifyApp = () => {
|
|
29
|
+
var _a;
|
|
30
|
+
const context = (_a = useContext(AppContext)) == null ? void 0 : _a.proxy;
|
|
31
|
+
if (context === void 0) {
|
|
32
|
+
throw new Error("useNotifyApp must be used within an AppProvider");
|
|
33
|
+
}
|
|
34
|
+
return context.notifyApp;
|
|
35
|
+
};
|
|
19
36
|
var AppContext_default = AppContext;
|
|
20
37
|
export {
|
|
21
38
|
AppContext_default as default,
|
|
22
39
|
useAppContext,
|
|
23
|
-
|
|
40
|
+
useAppNotificationAction,
|
|
41
|
+
useAppProxy,
|
|
42
|
+
useNotifyApp
|
|
24
43
|
};
|
|
@@ -32,7 +32,6 @@ import get from "lodash-es/get";
|
|
|
32
32
|
import debounce from "lodash-es/debounce";
|
|
33
33
|
import { useDebounceCallback } from "../hooks/useDebounce";
|
|
34
34
|
import { HttpProvider } from "../hooks/useHttp";
|
|
35
|
-
import { registerFormField, registerFormFieldSafe } from "../utils/form-state.util";
|
|
36
35
|
import { removeWidgetsFromContext } from "../utils/widget-cleanup-util";
|
|
37
36
|
import { EVENTEMITTER_METHODS } from "../core/constants/events";
|
|
38
37
|
import { createWidgetProxy } from "../core/proxy-service";
|
|
@@ -100,7 +99,6 @@ const WidgetProvider = ({
|
|
|
100
99
|
setPageContext,
|
|
101
100
|
registry
|
|
102
101
|
);
|
|
103
|
-
registerFormField(newContext.Widgets, widgetProxy, incomingWidget, newContext);
|
|
104
102
|
registerMethod(newContext, widgetProxy, widgetName);
|
|
105
103
|
}
|
|
106
104
|
});
|
|
@@ -159,7 +157,6 @@ const WidgetProvider = ({
|
|
|
159
157
|
pageContext.App.Widgets[widgetName] = props;
|
|
160
158
|
}
|
|
161
159
|
}
|
|
162
|
-
registerFormFieldSafe(pageContext.Widgets, props);
|
|
163
160
|
};
|
|
164
161
|
}, [isAppWidgetRegisterNeeded]);
|
|
165
162
|
const debouncedEmitRef = useRef(
|
package/core/proxy-service.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { PageContextState, ProxyTarget } from "@wavemaker-ai/react-runtime/types";
|
|
2
2
|
import { OverriddenPropsRegistry } from "@wavemaker-ai/react-runtime/core/script-registry";
|
|
3
3
|
import BaseAppProps from "../higherOrder/BaseAppProps";
|
|
4
|
+
import { FormFieldProps } from "../components/data/form/form-field/props";
|
|
4
5
|
export declare const createWidgetProxy: (widget: any, widgetName: string, setPageContext: any, overriddenPropsRegistry?: OverriddenPropsRegistry) => any;
|
|
5
6
|
export declare const createPageProxy: (target: ProxyTarget, setPageContext: React.Dispatch<React.SetStateAction<PageContextState>>, overriddenPropsRegistry?: OverriddenPropsRegistry) => ProxyTarget;
|
|
6
7
|
export declare const createStateProxy: (obj: PageContextState | BaseAppProps, path: string[], setPageContext: React.Dispatch<React.SetStateAction<PageContextState>> | React.Dispatch<React.SetStateAction<BaseAppProps>>, overriddenPropsRegistry?: OverriddenPropsRegistry) => ProxyTarget;
|
|
8
|
+
export declare const createFormFieldProxy: (formField: FormFieldProps, setState: React.Dispatch<React.SetStateAction<FormFieldProps>>, overriddenItemsRef: React.MutableRefObject<Record<string, any>>, formProxy: any) => any;
|
package/core/proxy-service.js
CHANGED
|
@@ -500,7 +500,32 @@ const createStateProxy = (obj, path = [], setPageContext, overriddenPropsRegistr
|
|
|
500
500
|
}
|
|
501
501
|
});
|
|
502
502
|
};
|
|
503
|
+
const createFormFieldProxy = (formField, setState, overriddenItemsRef, formProxy) => {
|
|
504
|
+
const fieldProxy = new Proxy(formField, {
|
|
505
|
+
get: (target, prop) => {
|
|
506
|
+
return target[prop];
|
|
507
|
+
},
|
|
508
|
+
set: (target, prop, value) => {
|
|
509
|
+
target[prop] = value;
|
|
510
|
+
overriddenItemsRef.current[prop] = value;
|
|
511
|
+
setState(__spreadValues({}, target));
|
|
512
|
+
return true;
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
const name = formField.name;
|
|
516
|
+
const key = formField.formKey;
|
|
517
|
+
if (key) {
|
|
518
|
+
formProxy.formfields[key] = fieldProxy;
|
|
519
|
+
formProxy.formWidgets[key] = fieldProxy;
|
|
520
|
+
}
|
|
521
|
+
formProxy.formfields[`${name}_formWidget`] = fieldProxy;
|
|
522
|
+
formProxy.formWidgets[`${name}_formWidget`] = fieldProxy;
|
|
523
|
+
formProxy.formfields[`${name}`] = fieldProxy;
|
|
524
|
+
formProxy.formWidgets[`${name}`] = fieldProxy;
|
|
525
|
+
return fieldProxy;
|
|
526
|
+
};
|
|
503
527
|
export {
|
|
528
|
+
createFormFieldProxy,
|
|
504
529
|
createPageProxy,
|
|
505
530
|
createStateProxy,
|
|
506
531
|
createWidgetProxy
|
package/higherOrder/BaseApp.js
CHANGED
|
@@ -373,9 +373,6 @@ const BaseApp = (WrappedComponent, addAppScript, getAppVariables, appInfo = {})
|
|
|
373
373
|
renderPartial: (props2, onLoad) => /* @__PURE__ */ jsx(
|
|
374
374
|
WmPartialContainer,
|
|
375
375
|
{
|
|
376
|
-
onRender: (commonComponent) => {
|
|
377
|
-
appProxyRef.current.Common = commonComponent;
|
|
378
|
-
},
|
|
379
376
|
onLoad,
|
|
380
377
|
"data-widget-id": "common-partial-container",
|
|
381
378
|
content: props2.content,
|
|
@@ -413,6 +410,7 @@ const BaseApp = (WrappedComponent, addAppScript, getAppVariables, appInfo = {})
|
|
|
413
410
|
wmSetDependency("metadata", metadataService);
|
|
414
411
|
wmSetDependency("appManager", {
|
|
415
412
|
notify,
|
|
413
|
+
notifyApp,
|
|
416
414
|
pushToSessionFailureRequests,
|
|
417
415
|
executeSessionFailureRequests,
|
|
418
416
|
handle401
|
|
@@ -12,7 +12,6 @@ export interface BaseAppProps {
|
|
|
12
12
|
isAppReady: boolean;
|
|
13
13
|
changeLocale: (locale: string) => void;
|
|
14
14
|
selectedLocale: string;
|
|
15
|
-
appLocale?: any;
|
|
16
15
|
/** Locale bundle–style formats; synced from Redux `i18n`. */
|
|
17
16
|
localeFormats: LocaleFormatsProxy;
|
|
18
17
|
getDependency: (name: string) => any;
|
|
@@ -34,5 +33,6 @@ export interface BaseAppProps {
|
|
|
34
33
|
Widgets?: Record<string, ProxyTarget>;
|
|
35
34
|
subscribe: (eventName: string, callback: Function) => () => void;
|
|
36
35
|
autoUpdateVariables: string[];
|
|
36
|
+
appLocale?: Record<string, any>;
|
|
37
37
|
}
|
|
38
38
|
export default BaseAppProps;
|
package/higherOrder/BasePage.js
CHANGED
|
@@ -309,9 +309,11 @@ const withPageContext = (WrappedComponent, addPageScript, getVariables, componen
|
|
|
309
309
|
appProxy.updateActivePage(pageName2);
|
|
310
310
|
appProxy.activePage = pageProxy;
|
|
311
311
|
appProxy.activePageName = pageName2;
|
|
312
|
-
Object.
|
|
312
|
+
Object.setPrototypeOf(appProxy.Widgets, pageProxy.Widgets);
|
|
313
313
|
} else if ((componentInfo == null ? void 0 : componentInfo.componentName) === "Common" && (componentInfo == null ? void 0 : componentInfo.componentType) === "PARTIAL" && appProxy) {
|
|
314
|
-
Object.
|
|
314
|
+
Object.keys(pageProxy.Widgets).forEach((key) => {
|
|
315
|
+
appProxy.Widgets[key] = pageProxy.Widgets[key];
|
|
316
|
+
});
|
|
315
317
|
}
|
|
316
318
|
addPageScript(appProxy, pageProxy);
|
|
317
319
|
wrapWithThirdPartyErrorGuard(
|