@wavemaker-ai/react-runtime 1.0.0-rc.314 → 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/actions/navigation-action.d.ts +1 -0
- package/actions/navigation-action.js +34 -9
- 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.d.ts +6 -0
- package/components/auth/RoleAuthGuard.js +66 -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/search/index.js +2 -1
- package/components/basic/search/providers.js +2 -2
- package/components/basic/spinner/index.d.ts +2 -0
- package/components/basic/tile/index.d.ts +2 -0
- package/components/basic/tree/Components/TreeNodeComponent.d.ts +1 -1
- package/components/basic/tree/Components/TreeNodeComponent.js +14 -8
- package/components/basic/tree/hooks/useTreePersistedState.d.ts +3 -0
- package/components/basic/tree/hooks/useTreePersistedState.js +38 -0
- package/components/basic/tree/index.d.ts +3 -0
- package/components/basic/tree/index.js +105 -30
- package/components/basic/tree/props.d.ts +18 -1
- package/components/basic/tree/utils.d.ts +16 -1
- package/components/basic/tree/utils.js +111 -0
- package/components/basic/video/index.d.ts +2 -0
- package/components/chart/index.d.ts +2 -0
- package/components/chart/src/dataUtils.js +1 -1
- package/components/common/customTemplate/useCustomTemplate.js +1 -1
- 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-column/index.js +2 -1
- 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 +33 -26
- 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 +14 -23
- 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/pagination/hooks/usePagination.js +0 -1
- 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 +20 -2
- 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/columnBuilder.d.ts +1 -1
- package/components/data/table/utils/columnBuilder.js +7 -4
- package/components/data/table/utils/crud-handlers.js +10 -10
- package/components/data/table/utils/index.d.ts +11 -8
- package/components/data/table/utils/index.js +90 -12
- 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/layout/leftnav/index.js +21 -2
- package/components/layout/leftnav/props.d.ts +9 -0
- package/components/layout/leftnav/utils/page-class-util.d.ts +9 -0
- package/components/layout/leftnav/utils/page-class-util.js +28 -0
- 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/navigation/popover/index.js +1 -0
- package/components/page/index.js +22 -6
- package/components/page/page-context.d.ts +4 -0
- package/components/page/page-context.js +5 -0
- package/components/page/partial/index.d.ts +2 -0
- package/components/page/partial-container/index.js +1 -4
- 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 +5 -6
- package/higherOrder/BaseAppProps.d.ts +1 -0
- package/higherOrder/BasePage.js +4 -12
- package/higherOrder/props.d.ts +10 -0
- package/higherOrder/withBaseWrapper.js +3 -0
- package/hooks/useAuth.js +3 -0
- package/hooks/useDataSourceSubscription.js +1 -1
- package/hooks/useHttp.js +0 -4
- package/hooks/useLayoutSize.d.ts +6 -0
- package/hooks/useLayoutSize.js +12 -0
- package/package-lock.json +229 -203
- package/package.json +3 -3
- package/runtime-dynamic/app-initializer.js +1 -1
- package/runtime-dynamic/components/use-dynamic-component.js +12 -31
- package/runtime-dynamic/factories/build-base-page-like-component.d.ts +1 -1
- package/runtime-dynamic/factories/dynamic-component.js +9 -1
- package/runtime-dynamic/factories/prefab-factory.d.ts +1 -1
- package/runtime-dynamic/factories/utils.d.ts +1 -1
- package/runtime-dynamic/main.js +1 -3
- package/runtime-dynamic/services/component-ref-provider.d.ts +19 -4
- package/runtime-dynamic/services/component-ref-provider.js +18 -38
- package/runtime-dynamic/services/index.d.ts +2 -3
- package/runtime-dynamic/services/index.js +1 -18
- package/runtime-dynamic/services/resource-manager.d.ts +2 -3
- package/runtime-dynamic/services/resource-manager.js +13 -17
- package/runtime-dynamic/services/script-executor.js +5 -8
- package/runtime-dynamic/services/variable-registry.js +3 -4
- package/utils/attr.js +1 -9
- package/utils/custom-expression/index.js +4 -1
- package/utils/custom-expression/parser.js +4 -2
- package/utils/format-util.js +2 -3
- package/utils/state-persistance.d.ts +1 -1
- package/runtime-dynamic/services/cache.d.ts +0 -29
- package/runtime-dynamic/services/cache.js +0 -51
- package/utils/form-state.util.d.ts +0 -62
- package/utils/form-state.util.js +0 -109
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Form State Utility
|
|
3
|
-
*
|
|
4
|
-
* Handles form field registration and management within the widget context.
|
|
5
|
-
* This utility provides centralized logic for registering form fields and form widgets
|
|
6
|
-
* to their parent form context.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Interface for widget properties related to form field registration
|
|
10
|
-
*/
|
|
11
|
-
interface FormFieldWidget {
|
|
12
|
-
name?: string;
|
|
13
|
-
formName?: string;
|
|
14
|
-
field?: string;
|
|
15
|
-
fieldName?: string;
|
|
16
|
-
formKey?: string;
|
|
17
|
-
parentForm?: string;
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Interface for the context structure where form fields are registered
|
|
22
|
-
*/
|
|
23
|
-
interface WidgetsContext {
|
|
24
|
-
[formName: string]: {
|
|
25
|
-
formfields: Record<string, any>;
|
|
26
|
-
formWidgets: Record<string, any>;
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Checks if a widget should be registered as a form field
|
|
32
|
-
* @param widget - The widget object to check
|
|
33
|
-
* @returns true if the widget should be registered as a form field
|
|
34
|
-
*/
|
|
35
|
-
export declare const shouldRegisterFormField: (widget: FormFieldWidget) => boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Registers a form field widget with its parent form in the context
|
|
38
|
-
* This creates references in both formfields and formWidgets collections
|
|
39
|
-
*
|
|
40
|
-
* @param widgetsContext - The Widgets context object where forms are stored
|
|
41
|
-
* @param widget - The widget/proxy to register
|
|
42
|
-
* @param widgetProps - The widget properties containing form metadata
|
|
43
|
-
*/
|
|
44
|
-
export declare const registerFormField: (widgetsContext: WidgetsContext, widget: any, widgetProps: FormFieldWidget, newContext: any) => void;
|
|
45
|
-
/**
|
|
46
|
-
* Ensures the form structure exists in the widgets context and registers a form field
|
|
47
|
-
* with safe object spreading to merge properties
|
|
48
|
-
*
|
|
49
|
-
* @param widgetsContext - The Widgets context object where forms are stored
|
|
50
|
-
* @param fieldProps - The field properties to register
|
|
51
|
-
*/
|
|
52
|
-
export declare const registerFormFieldSafe: (widgetsContext: WidgetsContext, fieldProps: FormFieldWidget) => void;
|
|
53
|
-
/**
|
|
54
|
-
* Unregisters a form field from its parent form
|
|
55
|
-
*
|
|
56
|
-
* @param widgetsContext - The Widgets context object where forms are stored
|
|
57
|
-
* @param formName - The name of the parent form
|
|
58
|
-
* @param fieldName - The name of the field to unregister
|
|
59
|
-
* @param formKey - Optional form key (defaults to fieldName if not provided)
|
|
60
|
-
*/
|
|
61
|
-
export declare const unregisterFormField: (widgetsContext: WidgetsContext, formName: string, fieldName: string, formKey?: string) => void;
|
|
62
|
-
export {};
|
package/utils/form-state.util.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import get from "lodash-es/get";
|
|
18
|
-
const isFormField = (widgetName) => {
|
|
19
|
-
return !(widgetName == null ? void 0 : widgetName.includes("formWidget"));
|
|
20
|
-
};
|
|
21
|
-
const shouldRegisterFormField = (widget) => {
|
|
22
|
-
const isField = get(widget, "field", "false") === "true";
|
|
23
|
-
const hasFormName = Boolean(widget.formName);
|
|
24
|
-
const isNotFormWidget = isFormField(widget.name);
|
|
25
|
-
return isField && hasFormName && isNotFormWidget;
|
|
26
|
-
};
|
|
27
|
-
const hasParentForm = (formName) => {
|
|
28
|
-
return Boolean();
|
|
29
|
-
};
|
|
30
|
-
const registerFormField = (widgetsContext, widget, widgetProps, newContext) => {
|
|
31
|
-
var _a;
|
|
32
|
-
const formName = widgetProps == null ? void 0 : widgetProps.formName;
|
|
33
|
-
if (!formName || !shouldRegisterFormField(widgetProps)) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const formKey = widgetProps.formKey || widgetProps.fieldName;
|
|
37
|
-
const fieldName = widgetProps.fieldName;
|
|
38
|
-
if (!formKey || !fieldName) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (!widgetsContext[formName]) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
widgetsContext[formName].formfields = widgetsContext[formName].formfields || {};
|
|
45
|
-
widgetsContext[formName].formWidgets = widgetsContext[formName].formWidgets || {};
|
|
46
|
-
widgetsContext[formName].formfields[formKey] = widget;
|
|
47
|
-
widgetsContext[formName].formWidgets[fieldName] = widget;
|
|
48
|
-
widgetsContext[formName].formfields[`${fieldName}_formWidget`] = widget;
|
|
49
|
-
widgetsContext[formName].formWidgets[`${fieldName}_formWidget`] = widget;
|
|
50
|
-
const parentFormName = (_a = widgetsContext[formName]) == null ? void 0 : _a.parentForm;
|
|
51
|
-
if (parentFormName && widgetsContext[parentFormName]) {
|
|
52
|
-
widgetsContext[parentFormName].formfields = widgetsContext[parentFormName].formfields || {};
|
|
53
|
-
widgetsContext[parentFormName].formWidgets = widgetsContext[parentFormName].formWidgets || {};
|
|
54
|
-
widgetsContext[parentFormName].formfields[formKey] = widget;
|
|
55
|
-
widgetsContext[parentFormName].formWidgets[fieldName] = widget;
|
|
56
|
-
widgetsContext[parentFormName].formfields[`${formKey}_formWidget`] = widget;
|
|
57
|
-
widgetsContext[parentFormName].formWidgets[`${fieldName}_formWidget`] = widget;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const registerFormFieldSafe = (widgetsContext, fieldProps) => {
|
|
61
|
-
var _a;
|
|
62
|
-
const formName = fieldProps == null ? void 0 : fieldProps.formName;
|
|
63
|
-
if (!formName || !shouldRegisterFormField(fieldProps)) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const formKey = fieldProps.formKey || fieldProps.fieldName;
|
|
67
|
-
const fieldName = fieldProps.fieldName;
|
|
68
|
-
if (!formKey || !fieldName) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
function register(formName2, formKey2, fieldName2, fieldProps2) {
|
|
72
|
-
var _a2, _b, _c, _d, _e;
|
|
73
|
-
(_a2 = widgetsContext[formName2]) != null ? _a2 : widgetsContext[formName2] = {
|
|
74
|
-
formfields: {},
|
|
75
|
-
formWidgets: {}
|
|
76
|
-
};
|
|
77
|
-
(_c = (_b = widgetsContext[formName2]).formfields) != null ? _c : _b.formfields = {};
|
|
78
|
-
(_e = (_d = widgetsContext[formName2]).formWidgets) != null ? _e : _d.formWidgets = {};
|
|
79
|
-
widgetsContext[formName2].formfields[formKey2] = __spreadValues({}, fieldProps2);
|
|
80
|
-
widgetsContext[formName2].formWidgets[fieldName2] = __spreadValues({}, fieldProps2);
|
|
81
|
-
widgetsContext[formName2].formfields[`${fieldName2}_formWidget`] = __spreadValues({}, fieldProps2);
|
|
82
|
-
widgetsContext[formName2].formWidgets[`${fieldName2}_formWidget`] = __spreadValues({}, fieldProps2);
|
|
83
|
-
}
|
|
84
|
-
register(formName, formKey, fieldName, fieldProps);
|
|
85
|
-
const parentForm = (_a = widgetsContext[formName]) == null ? void 0 : _a.parentForm;
|
|
86
|
-
if (parentForm) {
|
|
87
|
-
register(parentForm, formKey, fieldName, fieldProps);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const unregisterFormField = (widgetsContext, formName, fieldName, formKey) => {
|
|
91
|
-
if (!widgetsContext[formName]) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const keyToRemove = formKey || fieldName;
|
|
95
|
-
if (widgetsContext[formName].formfields) {
|
|
96
|
-
delete widgetsContext[formName].formfields[keyToRemove];
|
|
97
|
-
delete widgetsContext[formName].formfields[`${fieldName}_formWidget`];
|
|
98
|
-
}
|
|
99
|
-
if (widgetsContext[formName].formWidgets) {
|
|
100
|
-
delete widgetsContext[formName].formWidgets[fieldName];
|
|
101
|
-
delete widgetsContext[formName].formWidgets[`${fieldName}_formWidget`];
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
export {
|
|
105
|
-
registerFormField,
|
|
106
|
-
registerFormFieldSafe,
|
|
107
|
-
shouldRegisterFormField,
|
|
108
|
-
unregisterFormField
|
|
109
|
-
};
|