@wavemaker-ai/react-runtime 1.0.0-rc.317 → 1.0.0-rc.319
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 +225 -199
- 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
|
@@ -62,6 +62,8 @@ declare const WmColorPickerStandalone: React.ComponentType<import("../../data/fo
|
|
|
62
62
|
updateon?: string;
|
|
63
63
|
dataset?: any;
|
|
64
64
|
prefabName?: string;
|
|
65
|
+
loading?: boolean;
|
|
66
|
+
showSkeleton?: boolean;
|
|
65
67
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
66
68
|
export { WmColorPickerStandalone as WmColorPicker };
|
|
67
69
|
/**
|
|
@@ -147,5 +149,7 @@ declare const _default: React.ComponentType<{
|
|
|
147
149
|
updateon?: string;
|
|
148
150
|
dataset?: any;
|
|
149
151
|
prefabName?: string;
|
|
152
|
+
loading?: boolean;
|
|
153
|
+
showSkeleton?: boolean;
|
|
150
154
|
}>;
|
|
151
155
|
export default _default;
|
|
@@ -298,6 +298,7 @@ const WmColorPicker = memo(
|
|
|
298
298
|
);
|
|
299
299
|
const handleInputChange = useCallback(
|
|
300
300
|
(event) => {
|
|
301
|
+
var _a2;
|
|
301
302
|
const newValue = event.target.value;
|
|
302
303
|
setInputValue(newValue);
|
|
303
304
|
if (newValue === "") {
|
|
@@ -311,7 +312,7 @@ const WmColorPicker = memo(
|
|
|
311
312
|
if (onChange && name) {
|
|
312
313
|
onChange(
|
|
313
314
|
event,
|
|
314
|
-
listener == null ? void 0 : listener.Widgets[name],
|
|
315
|
+
(_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name],
|
|
315
316
|
newValue,
|
|
316
317
|
colorValue
|
|
317
318
|
);
|
|
@@ -321,6 +322,7 @@ const WmColorPicker = memo(
|
|
|
321
322
|
);
|
|
322
323
|
const handleInputBlur = useCallback(
|
|
323
324
|
(event) => {
|
|
325
|
+
var _a2;
|
|
324
326
|
if (autoclose !== AUTOCLOSE_TYPE.NEVER && !isInteractingWithPicker && pickerRef.current && !pickerRef.current.contains(event.relatedTarget)) {
|
|
325
327
|
setIsOpen(false);
|
|
326
328
|
handleFloatingLabel("close");
|
|
@@ -333,15 +335,16 @@ const WmColorPicker = memo(
|
|
|
333
335
|
}
|
|
334
336
|
}
|
|
335
337
|
if (onBlur) {
|
|
336
|
-
onBlur(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
338
|
+
onBlur(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
337
339
|
}
|
|
338
340
|
},
|
|
339
341
|
[autoclose, isInteractingWithPicker, inputValue, validateAndSetColor, setInputValue, onBlur]
|
|
340
342
|
);
|
|
341
343
|
const handleInputFocus = useCallback(
|
|
342
344
|
(event) => {
|
|
345
|
+
var _a2;
|
|
343
346
|
if (onFocus) {
|
|
344
|
-
onFocus(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
347
|
+
onFocus(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
345
348
|
}
|
|
346
349
|
openPicker();
|
|
347
350
|
handleFloatingLabel("open");
|
|
@@ -350,10 +353,11 @@ const WmColorPicker = memo(
|
|
|
350
353
|
);
|
|
351
354
|
const handleInputClick = useCallback(
|
|
352
355
|
(event) => {
|
|
356
|
+
var _a2;
|
|
353
357
|
event.stopPropagation();
|
|
354
358
|
if (!isReadonlyOrDisabled) {
|
|
355
359
|
if (onClick && name) {
|
|
356
|
-
onClick(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
360
|
+
onClick(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
357
361
|
}
|
|
358
362
|
openPicker();
|
|
359
363
|
handleFloatingLabel("open");
|
|
@@ -372,6 +376,7 @@ const WmColorPicker = memo(
|
|
|
372
376
|
);
|
|
373
377
|
const handleColorChange = useCallback(
|
|
374
378
|
(color, event) => {
|
|
379
|
+
var _a2;
|
|
375
380
|
const { r, g, b, a } = color.rgb;
|
|
376
381
|
const rgbaColor = { r, g, b, a };
|
|
377
382
|
setColorValue(rgbaColor);
|
|
@@ -395,7 +400,7 @@ const WmColorPicker = memo(
|
|
|
395
400
|
if (onChange) {
|
|
396
401
|
onChange(
|
|
397
402
|
customEvent,
|
|
398
|
-
listener == null ? void 0 : listener.Widgets[name],
|
|
403
|
+
(_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name],
|
|
399
404
|
newValue,
|
|
400
405
|
inputValue
|
|
401
406
|
);
|
|
@@ -548,8 +553,14 @@ const WmColorPicker = memo(
|
|
|
548
553
|
onBlur: handleInputBlur,
|
|
549
554
|
onFocus: handleInputFocus,
|
|
550
555
|
onClick: handleInputClick,
|
|
551
|
-
onMouseEnter: (event) =>
|
|
552
|
-
|
|
556
|
+
onMouseEnter: (event) => {
|
|
557
|
+
var _a2;
|
|
558
|
+
return onMouseEnter && onMouseEnter(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
559
|
+
},
|
|
560
|
+
onMouseLeave: (event) => {
|
|
561
|
+
var _a2;
|
|
562
|
+
return onMouseLeave && onMouseLeave(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
563
|
+
},
|
|
553
564
|
"aria-label": arialabel,
|
|
554
565
|
"aria-readonly": readonly
|
|
555
566
|
}
|
|
@@ -74,6 +74,8 @@ declare const WmCurrencyStandalone: React.ComponentType<import("../../data/form/
|
|
|
74
74
|
formfield?: boolean;
|
|
75
75
|
dataset?: any;
|
|
76
76
|
prefabName?: string;
|
|
77
|
+
loading?: boolean;
|
|
78
|
+
showSkeleton?: boolean;
|
|
77
79
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
78
80
|
export { WmCurrencyStandalone as WmCurrency };
|
|
79
81
|
/**
|
|
@@ -171,5 +173,7 @@ declare const _default: React.ComponentType<{
|
|
|
171
173
|
formfield?: boolean;
|
|
172
174
|
dataset?: any;
|
|
173
175
|
prefabName?: string;
|
|
176
|
+
loading?: boolean;
|
|
177
|
+
showSkeleton?: boolean;
|
|
174
178
|
}>;
|
|
175
179
|
export default _default;
|
|
@@ -62,6 +62,8 @@ declare const WmCheckboxStandalone: React.ComponentType<import("../../../data/fo
|
|
|
62
62
|
updateon?: string;
|
|
63
63
|
dataset?: any;
|
|
64
64
|
prefabName?: string;
|
|
65
|
+
loading?: boolean;
|
|
66
|
+
showSkeleton?: boolean;
|
|
65
67
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
66
68
|
export { WmCheckboxStandalone as WmCheckbox };
|
|
67
69
|
/**
|
|
@@ -146,5 +148,7 @@ declare const _default: React.ComponentType<{
|
|
|
146
148
|
updateon?: string;
|
|
147
149
|
dataset?: any;
|
|
148
150
|
prefabName?: string;
|
|
151
|
+
loading?: boolean;
|
|
152
|
+
showSkeleton?: boolean;
|
|
149
153
|
}>;
|
|
150
154
|
export default _default;
|
|
@@ -84,6 +84,8 @@ declare const WmCheckboxsetStandalone: React.ComponentType<import("../../../data
|
|
|
84
84
|
formfield?: boolean;
|
|
85
85
|
updateon?: string;
|
|
86
86
|
prefabName?: string;
|
|
87
|
+
loading?: boolean;
|
|
88
|
+
showSkeleton?: boolean;
|
|
87
89
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
88
90
|
export { WmCheckboxsetStandalone as WmCheckboxset };
|
|
89
91
|
/**
|
|
@@ -189,5 +191,7 @@ declare const _default: React.ComponentType<{
|
|
|
189
191
|
formfield?: boolean;
|
|
190
192
|
updateon?: string;
|
|
191
193
|
prefabName?: string;
|
|
194
|
+
loading?: boolean;
|
|
195
|
+
showSkeleton?: boolean;
|
|
192
196
|
}>;
|
|
193
197
|
export default _default;
|
|
@@ -228,7 +228,7 @@ const WmCheckboxset = memo(
|
|
|
228
228
|
}, []);
|
|
229
229
|
const handleCheckboxChange = useCallback(
|
|
230
230
|
(event, key, dataObject) => {
|
|
231
|
-
var _a;
|
|
231
|
+
var _a, _b, _c;
|
|
232
232
|
if (disabled || readonly) return;
|
|
233
233
|
const currentSelectedKeys = Array.isArray(localSelectedKeys) ? localSelectedKeys : [];
|
|
234
234
|
const isCurrentlySelected = currentSelectedKeys.some((k) => {
|
|
@@ -282,10 +282,10 @@ const WmCheckboxset = memo(
|
|
|
282
282
|
onchange(newKeys);
|
|
283
283
|
}
|
|
284
284
|
if (onChange && name) {
|
|
285
|
-
onChange(event, listener == null ? void 0 : listener.Widgets[name], newKeys, currentSelectedKeys);
|
|
285
|
+
onChange(event, (_b = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b[name], newKeys, currentSelectedKeys);
|
|
286
286
|
}
|
|
287
287
|
if (onClick && name) {
|
|
288
|
-
onClick(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
288
|
+
onClick(event, (_c = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _c[name]);
|
|
289
289
|
}
|
|
290
290
|
if (listener == null ? void 0 : listener.onChange) {
|
|
291
291
|
const displayValues = getCheckboxsetDisplayValues(
|
|
@@ -462,13 +462,15 @@ const WmCheckboxset = memo(
|
|
|
462
462
|
return /* @__PURE__ */ jsx(List, { className: clsx(DEFAULT_CLASS, itemclass, listclass), sx: styles, children: /* @__PURE__ */ jsx(ListItem, { children: /* @__PURE__ */ jsx(ListItemText, { primary: "No items to display" }) }) });
|
|
463
463
|
}
|
|
464
464
|
const handleMouseEnter = (event) => {
|
|
465
|
+
var _a;
|
|
465
466
|
if (onMouseEnter) {
|
|
466
|
-
onMouseEnter(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
467
|
+
onMouseEnter(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
467
468
|
}
|
|
468
469
|
};
|
|
469
470
|
const handleMouseLeave = (event) => {
|
|
471
|
+
var _a;
|
|
470
472
|
if (onMouseLeave) {
|
|
471
|
-
onMouseLeave(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
473
|
+
onMouseLeave(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
472
474
|
}
|
|
473
475
|
};
|
|
474
476
|
return /* @__PURE__ */ jsxs(
|
|
@@ -79,6 +79,8 @@ declare const WmRadiosetStandalone: React.ComponentType<import("../../../data/fo
|
|
|
79
79
|
formfield?: boolean;
|
|
80
80
|
updateon?: string;
|
|
81
81
|
prefabName?: string;
|
|
82
|
+
loading?: boolean;
|
|
83
|
+
showSkeleton?: boolean;
|
|
82
84
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
83
85
|
export { WmRadiosetStandalone as WmRadioset };
|
|
84
86
|
/**
|
|
@@ -180,5 +182,7 @@ declare const _default: React.ComponentType<{
|
|
|
180
182
|
formfield?: boolean;
|
|
181
183
|
updateon?: string;
|
|
182
184
|
prefabName?: string;
|
|
185
|
+
loading?: boolean;
|
|
186
|
+
showSkeleton?: boolean;
|
|
183
187
|
}>;
|
|
184
188
|
export default _default;
|
|
@@ -178,12 +178,13 @@ const WmRadioset = memo(
|
|
|
178
178
|
}, [datavalue]);
|
|
179
179
|
const handleGroupClick = useCallback(
|
|
180
180
|
(key, event) => {
|
|
181
|
+
var _a;
|
|
181
182
|
setExpandedItems((prevState) => __spreadProps(__spreadValues({}, prevState), { [key]: !prevState[key] }));
|
|
182
183
|
if (externalHandleHeaderClick && event) {
|
|
183
184
|
externalHandleHeaderClick(key);
|
|
184
185
|
}
|
|
185
186
|
if (onClick) {
|
|
186
|
-
onClick(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
187
|
+
onClick(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
187
188
|
}
|
|
188
189
|
},
|
|
189
190
|
[externalHandleHeaderClick]
|
|
@@ -74,6 +74,8 @@ declare const WmSwitchStandalone: React.ComponentType<import("../../../data/form
|
|
|
74
74
|
formfield?: boolean;
|
|
75
75
|
updateon?: string;
|
|
76
76
|
prefabName?: string;
|
|
77
|
+
loading?: boolean;
|
|
78
|
+
showSkeleton?: boolean;
|
|
77
79
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
78
80
|
export { WmSwitchStandalone as WmSwitch };
|
|
79
81
|
/**
|
|
@@ -170,5 +172,7 @@ declare const _default: React.ComponentType<{
|
|
|
170
172
|
formfield?: boolean;
|
|
171
173
|
updateon?: string;
|
|
172
174
|
prefabName?: string;
|
|
175
|
+
loading?: boolean;
|
|
176
|
+
showSkeleton?: boolean;
|
|
173
177
|
}>;
|
|
174
178
|
export default _default;
|
|
@@ -186,6 +186,7 @@ const useSwitch = (props) => {
|
|
|
186
186
|
}, [selectedItem, updateHighlighter]);
|
|
187
187
|
const selectOpt = useCallback(
|
|
188
188
|
(event, index, option) => {
|
|
189
|
+
var _a, _b;
|
|
189
190
|
event.preventDefault();
|
|
190
191
|
if (disabled) return;
|
|
191
192
|
const selectedValue = {
|
|
@@ -206,17 +207,17 @@ const useSwitch = (props) => {
|
|
|
206
207
|
setDatasetItems(updatedItems);
|
|
207
208
|
setModelByKey(keys);
|
|
208
209
|
setModelByValue(keys.map((key) => {
|
|
209
|
-
var
|
|
210
|
-
return (
|
|
210
|
+
var _a2;
|
|
211
|
+
return (_a2 = find(updatedItems, { key })) == null ? void 0 : _a2.value;
|
|
211
212
|
}));
|
|
212
213
|
setSelectedItem(find(updatedItems, { selected: true }) || null);
|
|
213
214
|
const datavalueArray = keys.map((key) => {
|
|
214
|
-
var
|
|
215
|
-
return (
|
|
215
|
+
var _a2;
|
|
216
|
+
return (_a2 = find(updatedItems, { key })) == null ? void 0 : _a2.value;
|
|
216
217
|
});
|
|
217
218
|
const displayValueArray = keys.map((key) => {
|
|
218
|
-
var
|
|
219
|
-
return (
|
|
219
|
+
var _a2;
|
|
220
|
+
return (_a2 = find(updatedItems, { key })) == null ? void 0 : _a2.label;
|
|
220
221
|
});
|
|
221
222
|
selectedValue.datavalue = datavalueArray;
|
|
222
223
|
selectedValue.displayValue = displayValueArray;
|
|
@@ -229,10 +230,10 @@ const useSwitch = (props) => {
|
|
|
229
230
|
if (onChange) {
|
|
230
231
|
onChange(
|
|
231
232
|
event,
|
|
232
|
-
listener == null ? void 0 : listener.Widgets[name],
|
|
233
|
+
(_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name],
|
|
233
234
|
keys.map((key) => {
|
|
234
|
-
var
|
|
235
|
-
return (
|
|
235
|
+
var _a2;
|
|
236
|
+
return (_a2 = find(updatedItems, { key })) == null ? void 0 : _a2.value;
|
|
236
237
|
}),
|
|
237
238
|
keys
|
|
238
239
|
);
|
|
@@ -267,7 +268,7 @@ const useSwitch = (props) => {
|
|
|
267
268
|
if (onChange) {
|
|
268
269
|
onChange(
|
|
269
270
|
event,
|
|
270
|
-
listener == null ? void 0 : listener.Widgets[name],
|
|
271
|
+
(_b = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b[name],
|
|
271
272
|
selectedOption.value,
|
|
272
273
|
selectedItem == null ? void 0 : selectedItem.label
|
|
273
274
|
);
|
|
@@ -284,17 +285,20 @@ const useSwitch = (props) => {
|
|
|
284
285
|
[datasetItems, disabled, multiple, onChange, onBlur, onClick, selectedItem, btnWidth, listener]
|
|
285
286
|
);
|
|
286
287
|
const handleOnMouseEnter = (event, option) => {
|
|
288
|
+
var _a;
|
|
287
289
|
if (disabled || !onMouseEnter) return;
|
|
288
|
-
onMouseEnter(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
290
|
+
onMouseEnter(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
289
291
|
};
|
|
290
292
|
const handleOnMouseLeave = (event, option) => {
|
|
293
|
+
var _a;
|
|
291
294
|
if (disabled || !onMouseLeave) return;
|
|
292
|
-
onMouseLeave(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
295
|
+
onMouseLeave(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
293
296
|
};
|
|
294
297
|
const handleOnClick = (event, index, option) => {
|
|
298
|
+
var _a;
|
|
295
299
|
const selectedValue = selectOpt(event, index, option);
|
|
296
300
|
if (disabled || !onClick) return;
|
|
297
|
-
onClick(event, Object.assign({}, listener == null ? void 0 : listener.Widgets[name], selectedValue));
|
|
301
|
+
onClick(event, Object.assign({}, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name], selectedValue));
|
|
298
302
|
};
|
|
299
303
|
return {
|
|
300
304
|
datasetItems,
|
|
@@ -336,6 +336,7 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
336
336
|
);
|
|
337
337
|
const clearDateValue = useCallback(
|
|
338
338
|
(invokeOnChange2, updatePrevDatavalue2, updateBoundVariable2, setInputValue2, setSelectedDate2, setInvalidDateTimeFormat2, setDateNotInRange2) => {
|
|
339
|
+
var _a2, _b2;
|
|
339
340
|
const oldValue = inputValue;
|
|
340
341
|
invokeOnChange2 == null ? void 0 : invokeOnChange2("");
|
|
341
342
|
updatePrevDatavalue2 == null ? void 0 : updatePrevDatavalue2("");
|
|
@@ -351,8 +352,8 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
351
352
|
timestamp: null
|
|
352
353
|
}));
|
|
353
354
|
}
|
|
354
|
-
if (onChange && name && ((listener == null ? void 0 : listener.Widgets[name]) || props.standalone)) {
|
|
355
|
-
onChange({}, listener == null ? void 0 : listener.Widgets[name], "", oldValue);
|
|
355
|
+
if (onChange && name && (((_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]) || props.standalone)) {
|
|
356
|
+
onChange({}, (_b2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b2[name], "", oldValue);
|
|
356
357
|
}
|
|
357
358
|
},
|
|
358
359
|
[name, onChange, props, inputValue]
|
|
@@ -392,6 +393,7 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
392
393
|
}, [disabled, readonly]);
|
|
393
394
|
const updateDateValue = useCallback(
|
|
394
395
|
(date) => {
|
|
396
|
+
var _a2, _b2, _c;
|
|
395
397
|
const outputValue = formatDate(date.toDate(), outputformat);
|
|
396
398
|
const displayValue = moment(date.toDate()).locale(currentLocale).format(convertToMomentFormat(datepattern));
|
|
397
399
|
invokeOnChange == null ? void 0 : invokeOnChange(outputValue);
|
|
@@ -399,7 +401,7 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
399
401
|
updateBoundVariable == null ? void 0 : updateBoundVariable(outputValue);
|
|
400
402
|
setInputValue(displayValue);
|
|
401
403
|
const oldValue = inputValue;
|
|
402
|
-
if (name && (listener == null ? void 0 : listener.Widgets[name])) {
|
|
404
|
+
if (name && ((_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name])) {
|
|
403
405
|
listener.Widgets[name].displayValue = displayValue;
|
|
404
406
|
}
|
|
405
407
|
if (listener == null ? void 0 : listener.onChange) {
|
|
@@ -408,10 +410,10 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
408
410
|
timestamp: formatDate(date.toDate(), "timestamp")
|
|
409
411
|
}));
|
|
410
412
|
}
|
|
411
|
-
if (onChange && name && ((listener == null ? void 0 : listener.Widgets[name]) || props.standalone)) {
|
|
413
|
+
if (onChange && name && (((_b2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b2[name]) || props.standalone)) {
|
|
412
414
|
onChange(
|
|
413
415
|
{},
|
|
414
|
-
name && (listener == null ? void 0 : listener.Widgets[name]),
|
|
416
|
+
name && ((_c = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _c[name]),
|
|
415
417
|
outputValue,
|
|
416
418
|
oldValue
|
|
417
419
|
);
|
|
@@ -478,6 +480,7 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
478
480
|
);
|
|
479
481
|
const handleInputChange = useCallback(
|
|
480
482
|
(event) => {
|
|
483
|
+
var _a2, _b2, _c, _d;
|
|
481
484
|
if (dataentrymode === "picker") return;
|
|
482
485
|
const value = event.target.value;
|
|
483
486
|
setInputValue(value);
|
|
@@ -496,16 +499,16 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
496
499
|
const parsedDate = datepattern === "timestamp" ? moment(parseInt(value, 10)) : moment(value, convertToMomentFormat(datepattern), true);
|
|
497
500
|
if (!parsedDate.isValid()) {
|
|
498
501
|
handleValidationError("invalidFormat", props.required);
|
|
499
|
-
if (onChange && name && ((listener == null ? void 0 : listener.Widgets[name]) || props.standalone) && props.formfield) {
|
|
500
|
-
onChange({}, listener == null ? void 0 : listener.Widgets[name], value, inputValue);
|
|
502
|
+
if (onChange && name && (((_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]) || props.standalone) && props.formfield) {
|
|
503
|
+
onChange({}, (_b2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b2[name], value, inputValue);
|
|
501
504
|
}
|
|
502
505
|
return;
|
|
503
506
|
}
|
|
504
507
|
setInvalidDateTimeFormat(false);
|
|
505
508
|
const dateObj = parsedDate.toDate();
|
|
506
509
|
if (!validateDateWithProps(dateObj)) {
|
|
507
|
-
if (onChange && name && ((listener == null ? void 0 : listener.Widgets[name]) || props.standalone) && props.formfield) {
|
|
508
|
-
onChange({}, listener == null ? void 0 : listener.Widgets[name], value, inputValue);
|
|
510
|
+
if (onChange && name && (((_c = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _c[name]) || props.standalone) && props.formfield) {
|
|
511
|
+
onChange({}, (_d = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _d[name], value, inputValue);
|
|
509
512
|
}
|
|
510
513
|
return;
|
|
511
514
|
}
|
|
@@ -610,8 +613,9 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
610
613
|
);
|
|
611
614
|
const handleInputClick = useCallback(
|
|
612
615
|
(event) => {
|
|
616
|
+
var _a2;
|
|
613
617
|
if (onClick && name) {
|
|
614
|
-
onClick(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
618
|
+
onClick(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
615
619
|
}
|
|
616
620
|
if (shouldOpenOnInput && !readonly && !disabled) {
|
|
617
621
|
handleIconButtonClick(event);
|
|
@@ -651,8 +655,14 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
651
655
|
name,
|
|
652
656
|
className: `form-control app-textbox app-dateinput display-input`,
|
|
653
657
|
style: __spreadValues({}, getWidthStyle(width)),
|
|
654
|
-
onMouseEnter: (event) =>
|
|
655
|
-
|
|
658
|
+
onMouseEnter: (event) => {
|
|
659
|
+
var _a2;
|
|
660
|
+
return onMouseEnter && name && onMouseEnter(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
661
|
+
},
|
|
662
|
+
onMouseLeave: (event) => {
|
|
663
|
+
var _a2;
|
|
664
|
+
return onMouseLeave && name && onMouseLeave(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
665
|
+
}
|
|
656
666
|
}
|
|
657
667
|
},
|
|
658
668
|
InputProps: {
|
|
@@ -675,8 +685,14 @@ const WmDate = forwardRef((props, ref) => {
|
|
|
675
685
|
onChange: handleInputChange,
|
|
676
686
|
onKeyDown: handleInputKeyDown,
|
|
677
687
|
onClick: handleInputClick,
|
|
678
|
-
onFocus: (event) =>
|
|
679
|
-
|
|
688
|
+
onFocus: (event) => {
|
|
689
|
+
var _a2;
|
|
690
|
+
return onFocus && name && onFocus(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
691
|
+
},
|
|
692
|
+
onBlur: (event) => {
|
|
693
|
+
var _a2;
|
|
694
|
+
return onBlur && name && onBlur(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
695
|
+
},
|
|
680
696
|
style: getWidthStyle(width)
|
|
681
697
|
}
|
|
682
698
|
),
|
|
@@ -173,9 +173,10 @@ const WmDateTime = memo(
|
|
|
173
173
|
);
|
|
174
174
|
const handleFinalDateChange = useCallback(
|
|
175
175
|
(date, event) => {
|
|
176
|
+
var _a2, _b2, _c, _d;
|
|
176
177
|
if (!date) {
|
|
177
|
-
if (onChange && name && (listener == null ? void 0 : listener.Widgets[name]) && props.formfield) {
|
|
178
|
-
onChange(event, listener == null ? void 0 : listener.Widgets[name], "", displayValue);
|
|
178
|
+
if (onChange && name && ((_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]) && props.formfield) {
|
|
179
|
+
onChange(event, (_b2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b2[name], "", displayValue);
|
|
179
180
|
}
|
|
180
181
|
setValidationFailureMessage("");
|
|
181
182
|
setLocalDateValue(null);
|
|
@@ -197,8 +198,8 @@ const WmDateTime = memo(
|
|
|
197
198
|
return;
|
|
198
199
|
}
|
|
199
200
|
if (!validateDateWithProps(date)) {
|
|
200
|
-
if (onChange && name && (listener == null ? void 0 : listener.Widgets[name]) && props.formfield && event) {
|
|
201
|
-
onChange(event, listener == null ? void 0 : listener.Widgets[name], dateString, displayValue);
|
|
201
|
+
if (onChange && name && ((_c = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _c[name]) && props.formfield && event) {
|
|
202
|
+
onChange(event, (_d = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _d[name], dateString, displayValue);
|
|
202
203
|
}
|
|
203
204
|
return;
|
|
204
205
|
}
|
|
@@ -325,6 +326,7 @@ const WmDateTime = memo(
|
|
|
325
326
|
}, [tempDateValue, handleFinalDateChange]);
|
|
326
327
|
const handleInputChange = useCallback(
|
|
327
328
|
(event) => {
|
|
329
|
+
var _a2, _b2;
|
|
328
330
|
if (dataentrymode === "picker") return;
|
|
329
331
|
const value = event.target.value;
|
|
330
332
|
setDisplayValue(value);
|
|
@@ -344,8 +346,8 @@ const WmDateTime = memo(
|
|
|
344
346
|
}
|
|
345
347
|
} else {
|
|
346
348
|
if (required) {
|
|
347
|
-
if (onChange && name && (listener == null ? void 0 : listener.Widgets[name]) && props.formfield) {
|
|
348
|
-
onChange(event, listener == null ? void 0 : listener.Widgets[name], value, displayValue);
|
|
349
|
+
if (onChange && name && ((_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]) && props.formfield) {
|
|
350
|
+
onChange(event, (_b2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b2[name], value, displayValue);
|
|
349
351
|
}
|
|
350
352
|
setInvalidFormat(true);
|
|
351
353
|
}
|
|
@@ -551,17 +553,19 @@ const WmDateTime = memo(
|
|
|
551
553
|
label: floatinglabel,
|
|
552
554
|
onClick: handleInputClick,
|
|
553
555
|
onFocus: (event) => {
|
|
556
|
+
var _a2;
|
|
554
557
|
if (readonly || disabled || isCurrentDate) {
|
|
555
558
|
event.target.blur();
|
|
556
559
|
return;
|
|
557
560
|
}
|
|
558
561
|
if (onFocus && name) {
|
|
559
|
-
onFocus(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
562
|
+
onFocus(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
560
563
|
}
|
|
561
564
|
},
|
|
562
565
|
onBlur: (event) => {
|
|
566
|
+
var _a2;
|
|
563
567
|
if (readonly) return;
|
|
564
|
-
onBlur && name && onBlur(event, listener == null ? void 0 : listener.Widgets[name]);
|
|
568
|
+
onBlur && name && onBlur(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
565
569
|
},
|
|
566
570
|
onChange: handleInputChange,
|
|
567
571
|
onMouseEnter: (event) => {
|