@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseProps, Prettify } from "@wavemaker-ai/react-runtime/higherOrder/props";
|
|
2
2
|
export interface FormFieldProps {
|
|
3
|
+
name: string;
|
|
3
4
|
/**
|
|
4
5
|
* Whether the field is read-only.
|
|
5
6
|
*/
|
|
@@ -197,6 +198,13 @@ export interface FormFieldProps {
|
|
|
197
198
|
formName: string;
|
|
198
199
|
parentForm?: string;
|
|
199
200
|
destroy?: (names: string[]) => void;
|
|
201
|
+
asyncValidators?: any[];
|
|
202
|
+
setValidators?: (validators: any[]) => void;
|
|
203
|
+
setAsyncValidators?: (asyncValidators: any[]) => void;
|
|
204
|
+
observe?: any[];
|
|
205
|
+
observeOn?: any[];
|
|
206
|
+
reset?: () => void;
|
|
207
|
+
setValidationMessage?: (message: string) => void;
|
|
200
208
|
}
|
|
201
209
|
/**
|
|
202
210
|
* Combined props for the WmFormField component, including base WaveMaker props.
|
|
@@ -25,8 +25,21 @@ import WmFormHeader from "./form-header";
|
|
|
25
25
|
import FormDynamicFieldsSection from "./form-dynamic-section";
|
|
26
26
|
import { removeInvalidAttributes } from "../../../utils/attr";
|
|
27
27
|
import withStandalone from "../../../higherOrder/withStandalone";
|
|
28
|
+
import {
|
|
29
|
+
WmSkeleton,
|
|
30
|
+
SKELETON_REGISTRY,
|
|
31
|
+
shouldShowSkeleton
|
|
32
|
+
} from "../../common/wm-skeleton";
|
|
28
33
|
const WmForm = (props) => {
|
|
29
34
|
var _a, _b, _c, _d;
|
|
35
|
+
if (shouldShowSkeleton(props.loading, props.showSkeleton))
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
WmSkeleton,
|
|
38
|
+
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmForm"]), {
|
|
39
|
+
className: props.className,
|
|
40
|
+
styles: props.styles
|
|
41
|
+
})
|
|
42
|
+
);
|
|
30
43
|
const shouldHideHeader = props.isLayoutDialog || props.isInsideWizard;
|
|
31
44
|
const shouldInjectDynamicFields = Array.isArray(props.metadata) && props.metadata.length > 0;
|
|
32
45
|
return /* @__PURE__ */ jsxs(
|
|
@@ -19,6 +19,7 @@ declare const WmListStandalone: React.ComponentType<{
|
|
|
19
19
|
columnalign?: import("./props").IColumnAlignment;
|
|
20
20
|
multiselect?: boolean;
|
|
21
21
|
loadingdatamsg?: string;
|
|
22
|
+
skeletonRows?: number;
|
|
22
23
|
loadingicon?: string;
|
|
23
24
|
maxsize?: number;
|
|
24
25
|
statehandler?: StorageType;
|
|
@@ -67,9 +68,12 @@ declare const WmListStandalone: React.ComponentType<{
|
|
|
67
68
|
gap?: string;
|
|
68
69
|
columngap?: string;
|
|
69
70
|
standalone?: boolean;
|
|
71
|
+
layoutWidth?: string;
|
|
72
|
+
layoutHeight?: string;
|
|
70
73
|
hidden?: boolean;
|
|
71
74
|
prefabName?: string;
|
|
72
75
|
key?: string;
|
|
76
|
+
loading?: boolean;
|
|
73
77
|
name?: string;
|
|
74
78
|
id?: string;
|
|
75
79
|
children?: React.ReactNode;
|
|
@@ -110,6 +114,7 @@ declare const WmListStandalone: React.ComponentType<{
|
|
|
110
114
|
outbound?: Record<string, any>;
|
|
111
115
|
formfield?: boolean;
|
|
112
116
|
updateon?: string;
|
|
117
|
+
showSkeleton?: boolean;
|
|
113
118
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
114
119
|
export { WmListStandalone as WmList };
|
|
115
120
|
/**
|
|
@@ -171,5 +176,7 @@ declare const _default: React.ComponentType<{
|
|
|
171
176
|
updateon?: string;
|
|
172
177
|
dataset?: any;
|
|
173
178
|
prefabName?: string;
|
|
179
|
+
loading?: boolean;
|
|
180
|
+
showSkeleton?: boolean;
|
|
174
181
|
}>;
|
|
175
182
|
export default _default;
|
|
@@ -34,6 +34,11 @@ import { useWidgetProxy } from "../../../context/WidgetProvider";
|
|
|
34
34
|
import { InlineNavigation } from "../pagination/components";
|
|
35
35
|
import { NoDataMessage, useDragAndDrop } from "./components";
|
|
36
36
|
import { AppSpinner } from "../../common";
|
|
37
|
+
import {
|
|
38
|
+
WmSkeleton,
|
|
39
|
+
SKELETON_REGISTRY,
|
|
40
|
+
shouldShowSkeleton
|
|
41
|
+
} from "../../common/wm-skeleton";
|
|
37
42
|
import {
|
|
38
43
|
useListData,
|
|
39
44
|
useListState,
|
|
@@ -68,6 +73,7 @@ import { DataSource } from "../types";
|
|
|
68
73
|
import isEqual from "lodash-es/isEqual";
|
|
69
74
|
import { filterAutoLayoutClasses } from "../../../utils/style-utils";
|
|
70
75
|
import withStandalone from "../../../higherOrder/withStandalone";
|
|
76
|
+
import { useLayoutSize } from "../../../hooks/useLayoutSize";
|
|
71
77
|
const WmList = (props) => {
|
|
72
78
|
var _a, _b, _c, _d, _e;
|
|
73
79
|
const {
|
|
@@ -155,6 +161,7 @@ const WmList = (props) => {
|
|
|
155
161
|
} = props;
|
|
156
162
|
const datasetHashRef = useRef([]);
|
|
157
163
|
const [currentDataset, setCurrentDataset] = useState(null);
|
|
164
|
+
const ListWrapperRef = useRef(null);
|
|
158
165
|
const Widgets = useWidgetProxy(void 0, standalone);
|
|
159
166
|
const widgetInstance = Widgets[name];
|
|
160
167
|
const effectiveStateHandlerForSubscription = navigation === LIST_NAVIGATION_TYPES.ON_DEMAND || navigation === LIST_NAVIGATION_TYPES.SCROLL ? "none" : statehandler;
|
|
@@ -458,6 +465,7 @@ const WmList = (props) => {
|
|
|
458
465
|
}
|
|
459
466
|
})();
|
|
460
467
|
}, [datasource]);
|
|
468
|
+
useLayoutSize(ListWrapperRef, props.layoutWidth, props.layoutHeight);
|
|
461
469
|
const showHorizontalScrollSentinel = showNavigation && navigation === LIST_NAVIGATION_TYPES.SCROLL && (direction === LIST_DIRECTION.HORIZONTAL || direction === "row");
|
|
462
470
|
const hostAutoLayoutPrefixes = ["pos-", ...INSETION_POSITION, "zi-", "w-", "h-"];
|
|
463
471
|
const wrapper_autoLayout_Classes = useMemo(
|
|
@@ -482,6 +490,15 @@ const WmList = (props) => {
|
|
|
482
490
|
}),
|
|
483
491
|
[direction, wrap, alignment, gap, columngap]
|
|
484
492
|
);
|
|
493
|
+
if (shouldShowSkeleton(props.loading, props.showSkeleton))
|
|
494
|
+
return /* @__PURE__ */ jsx(
|
|
495
|
+
WmSkeleton,
|
|
496
|
+
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmList"]), {
|
|
497
|
+
rows: props.skeletonRows,
|
|
498
|
+
className,
|
|
499
|
+
styles
|
|
500
|
+
})
|
|
501
|
+
);
|
|
485
502
|
return /* @__PURE__ */ jsxs(
|
|
486
503
|
Box,
|
|
487
504
|
__spreadProps(__spreadValues({
|
|
@@ -496,6 +513,7 @@ const WmList = (props) => {
|
|
|
496
513
|
"data-name": name
|
|
497
514
|
}, { name }), {
|
|
498
515
|
"data-navigation": navigation,
|
|
516
|
+
ref: ListWrapperRef,
|
|
499
517
|
children: [
|
|
500
518
|
/* @__PURE__ */ jsx(ListHeader, { title, subheading, iconclass }),
|
|
501
519
|
/* @__PURE__ */ jsx(AppSpinner, { show: (_e = datasource == null ? void 0 : datasource.loading) != null ? _e : false, spinnermessages: [loadingdatamsg] }),
|
|
@@ -107,6 +107,11 @@ export interface ListProps<T = ListItemData> {
|
|
|
107
107
|
* Message to display while loading data.
|
|
108
108
|
*/
|
|
109
109
|
loadingdatamsg?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Number of skeleton list items shown while loading.
|
|
112
|
+
* @default 5
|
|
113
|
+
*/
|
|
114
|
+
skeletonRows?: number;
|
|
110
115
|
/**
|
|
111
116
|
* CSS class for the loading icon.
|
|
112
117
|
*/
|
|
@@ -285,6 +290,8 @@ export interface ListProps<T = ListItemData> {
|
|
|
285
290
|
* Whether this is a standalone list.
|
|
286
291
|
*/
|
|
287
292
|
standalone?: boolean;
|
|
293
|
+
layoutWidth?: string;
|
|
294
|
+
layoutHeight?: string;
|
|
288
295
|
}
|
|
289
296
|
/**
|
|
290
297
|
* Props specific to the WmListItem component.
|
|
@@ -58,12 +58,15 @@ const RowCells = memo(
|
|
|
58
58
|
const columnId = ((_b = cell == null ? void 0 : cell.column) == null ? void 0 : _b.id) || ((_c = cell == null ? void 0 : cell.column.columnDef) == null ? void 0 : _c.accessorKey) || "";
|
|
59
59
|
const colClass = getColClass(colClassExpression, rowData, columnId);
|
|
60
60
|
const customRender = customExpressionColumns == null ? void 0 : customExpressionColumns[columnId];
|
|
61
|
+
const hasCustomCellContent = !!customRender;
|
|
62
|
+
const cellValue = cell.getValue();
|
|
63
|
+
const cellTitle = hasCustomCellContent ? void 0 : cellValue != null && cellValue !== "" ? String(cellValue) : "";
|
|
61
64
|
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
62
65
|
hasExpansion && cellIndex === expansionInsertIndex && renderExpansionCell(rowId, rowData),
|
|
63
66
|
/* @__PURE__ */ jsx(
|
|
64
67
|
TableCell,
|
|
65
68
|
{
|
|
66
|
-
title:
|
|
69
|
+
title: cellTitle,
|
|
67
70
|
role: "cell",
|
|
68
71
|
tabIndex: 0,
|
|
69
72
|
"data-col-id": cellIndex,
|
|
@@ -19,12 +19,14 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import React, { useMemo } from "react";
|
|
21
21
|
import { generateColumnsFromData, isValidDataForColumns } from "../utils/dynamic-columns";
|
|
22
|
+
import { getChildComponentDisplayName } from "../utils";
|
|
22
23
|
const hasTableColumnsInChildren = (children) => {
|
|
23
24
|
let found = false;
|
|
24
25
|
React.Children.forEach(children, (child) => {
|
|
25
26
|
if (!(child == null ? void 0 : child.props)) return;
|
|
26
27
|
const name = child.props.name || "";
|
|
27
|
-
|
|
28
|
+
const displayName = getChildComponentDisplayName(child);
|
|
29
|
+
if (name.includes("wm_table_column") || name.includes("col_") || displayName.includes("WmTableColumn")) {
|
|
28
30
|
found = true;
|
|
29
31
|
} else if (name.includes("group")) {
|
|
30
32
|
if (hasTableColumnsInChildren(child.props.children)) {
|
|
@@ -53,6 +53,8 @@ declare const WmTableStandalone: React.ComponentType<{
|
|
|
53
53
|
errormessage?: string;
|
|
54
54
|
nodatamessage?: string;
|
|
55
55
|
loadingdatamsg?: string;
|
|
56
|
+
skeletonRows?: number;
|
|
57
|
+
skeletonColumns?: number;
|
|
56
58
|
insertmessage?: string;
|
|
57
59
|
updatemessage?: string;
|
|
58
60
|
deletemessage?: string;
|
|
@@ -137,6 +139,8 @@ declare const WmTableStandalone: React.ComponentType<{
|
|
|
137
139
|
formfield?: boolean;
|
|
138
140
|
updateon?: string;
|
|
139
141
|
prefabName?: string;
|
|
142
|
+
loading?: boolean;
|
|
143
|
+
showSkeleton?: boolean;
|
|
140
144
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
141
145
|
export { WmTableStandalone as WmTable };
|
|
142
146
|
declare const WmTable: React.ComponentType<{
|
|
@@ -190,6 +194,8 @@ declare const WmTable: React.ComponentType<{
|
|
|
190
194
|
errormessage?: string;
|
|
191
195
|
nodatamessage?: string;
|
|
192
196
|
loadingdatamsg?: string;
|
|
197
|
+
skeletonRows?: number;
|
|
198
|
+
skeletonColumns?: number;
|
|
193
199
|
insertmessage?: string;
|
|
194
200
|
updatemessage?: string;
|
|
195
201
|
deletemessage?: string;
|
|
@@ -274,6 +280,8 @@ declare const WmTable: React.ComponentType<{
|
|
|
274
280
|
formfield?: boolean;
|
|
275
281
|
updateon?: string;
|
|
276
282
|
prefabName?: string;
|
|
283
|
+
loading?: boolean;
|
|
284
|
+
showSkeleton?: boolean;
|
|
277
285
|
}>;
|
|
278
286
|
/**
|
|
279
287
|
* The WmTable component is used to display data in a tabular format.
|
|
@@ -39,6 +39,11 @@ import React, {
|
|
|
39
39
|
useState,
|
|
40
40
|
useRef
|
|
41
41
|
} from "react";
|
|
42
|
+
import {
|
|
43
|
+
WmSkeleton,
|
|
44
|
+
SKELETON_REGISTRY,
|
|
45
|
+
shouldShowSkeleton
|
|
46
|
+
} from "../../common/wm-skeleton";
|
|
42
47
|
import {
|
|
43
48
|
useReactTable,
|
|
44
49
|
getCoreRowModel,
|
|
@@ -1659,6 +1664,16 @@ const WmTableComponent = memo(
|
|
|
1659
1664
|
);
|
|
1660
1665
|
WmTableComponent.displayName = "WmTableComponent";
|
|
1661
1666
|
const WmTableWithProvider = (props) => {
|
|
1667
|
+
if (shouldShowSkeleton(props.loading, props.showSkeleton))
|
|
1668
|
+
return /* @__PURE__ */ jsx(
|
|
1669
|
+
WmSkeleton,
|
|
1670
|
+
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmTable"]), {
|
|
1671
|
+
rows: props.skeletonRows,
|
|
1672
|
+
columns: props.skeletonColumns,
|
|
1673
|
+
className: props.className,
|
|
1674
|
+
styles: props.styles
|
|
1675
|
+
})
|
|
1676
|
+
);
|
|
1662
1677
|
return /* @__PURE__ */ jsx(EditedRowsProvider, { children: /* @__PURE__ */ jsx(WmTableComponent, __spreadValues({}, props)) });
|
|
1663
1678
|
};
|
|
1664
1679
|
WmTableWithProvider.displayName = "WmTable";
|
|
@@ -230,6 +230,16 @@ export interface TableProps {
|
|
|
230
230
|
* Message to display while loading data.
|
|
231
231
|
*/
|
|
232
232
|
loadingdatamsg?: string;
|
|
233
|
+
/**
|
|
234
|
+
* Number of skeleton body rows shown while loading.
|
|
235
|
+
* @default 5
|
|
236
|
+
*/
|
|
237
|
+
skeletonRows?: number;
|
|
238
|
+
/**
|
|
239
|
+
* Number of skeleton columns shown while loading.
|
|
240
|
+
* @default 4
|
|
241
|
+
*/
|
|
242
|
+
skeletonColumns?: number;
|
|
233
243
|
/**
|
|
234
244
|
* Message to display after successful record insertion.
|
|
235
245
|
*/
|
|
@@ -38,6 +38,8 @@ export interface TableGroup {
|
|
|
38
38
|
styles?: React.CSSProperties;
|
|
39
39
|
}
|
|
40
40
|
export type TableStructureItem = TableGroup | WmTableColumnProps;
|
|
41
|
+
/** Resolve displayName from a React element, including memo/withBaseWrapper layers */
|
|
42
|
+
export declare function getChildComponentDisplayName(child: any): string;
|
|
41
43
|
export declare const parseTableColumns: (children: React.ReactNode, dataset: any) => WmTableColumnProps[];
|
|
42
44
|
export declare const getAggregateFunctions: (dataset: any[], binding: string) => Record<string, Function>;
|
|
43
45
|
export declare const parseTableStructureWithGroups: (children: React.ReactNode) => TableStructureItem[];
|
|
@@ -186,6 +186,16 @@ function transformExpression(exp) {
|
|
|
186
186
|
}
|
|
187
187
|
return exp;
|
|
188
188
|
}
|
|
189
|
+
function getChildComponentDisplayName(child) {
|
|
190
|
+
if (!(child == null ? void 0 : child.type)) return "";
|
|
191
|
+
const type = child.type;
|
|
192
|
+
const name = type.displayName || type.name || "";
|
|
193
|
+
const inner = type.type || type.render;
|
|
194
|
+
if (inner) {
|
|
195
|
+
return inner.displayName || inner.name || name;
|
|
196
|
+
}
|
|
197
|
+
return name;
|
|
198
|
+
}
|
|
189
199
|
const parseTableColumns = (children, dataset) => {
|
|
190
200
|
const columns = [];
|
|
191
201
|
React.Children.forEach(children, (child) => {
|
|
@@ -249,6 +259,7 @@ const parseTableStructureWithGroups = (children) => {
|
|
|
249
259
|
React.Children.forEach(children, (child) => {
|
|
250
260
|
if (!child || !child.props) return;
|
|
251
261
|
const childName = get(child, "props.name", "");
|
|
262
|
+
const displayName = getChildComponentDisplayName(child);
|
|
252
263
|
if (childName.includes("group")) {
|
|
253
264
|
const props = get(child, "props", {});
|
|
254
265
|
const group = {
|
|
@@ -264,7 +275,7 @@ const parseTableStructureWithGroups = (children) => {
|
|
|
264
275
|
// Recursive for nested groups
|
|
265
276
|
};
|
|
266
277
|
structure.push(group);
|
|
267
|
-
} else if (childName.includes("wm_table_column") || childName.includes("col_")) {
|
|
278
|
+
} else if (childName.includes("wm_table_column") || childName.includes("col_") || (displayName == null ? void 0 : displayName.includes("WmTableColumn"))) {
|
|
268
279
|
const props = get(child, "props", {});
|
|
269
280
|
const column = __spreadValues({
|
|
270
281
|
field: get(props, "binding"),
|
|
@@ -303,7 +314,8 @@ const flattenTableStructure = (structure) => {
|
|
|
303
314
|
const parseTableRowActions = (children) => {
|
|
304
315
|
const actions = [];
|
|
305
316
|
React.Children.forEach(children, (child) => {
|
|
306
|
-
|
|
317
|
+
var _a;
|
|
318
|
+
if (child && child.props && child.props.name && (child.props.name.includes("wm_table_row_action") || ((_a = child.type) == null ? void 0 : _a.displayName) === "WmTableRowAction")) {
|
|
307
319
|
const props = get(child, "props", {});
|
|
308
320
|
const actionProps = assign({}, props);
|
|
309
321
|
if (child.key) {
|
|
@@ -317,7 +329,8 @@ const parseTableRowActions = (children) => {
|
|
|
317
329
|
const parseTableActions = (children) => {
|
|
318
330
|
const actions = [];
|
|
319
331
|
React.Children.forEach(children, (child) => {
|
|
320
|
-
|
|
332
|
+
var _a;
|
|
333
|
+
if (child && child.props && child.props.name && (child.props.name.includes("wm_table_action") || ((_a = child.type) == null ? void 0 : _a.displayName) === "WmTableAction")) {
|
|
321
334
|
const props = get(child, "props", {});
|
|
322
335
|
const actionProps = assign({}, props);
|
|
323
336
|
if (child.key) {
|
|
@@ -658,6 +671,7 @@ export {
|
|
|
658
671
|
getAggregateFunctions,
|
|
659
672
|
getBooleanDataset,
|
|
660
673
|
getButtonClasses,
|
|
674
|
+
getChildComponentDisplayName,
|
|
661
675
|
getColClass,
|
|
662
676
|
getRowIdsFromDataset,
|
|
663
677
|
getSpacingClasses,
|
|
@@ -69,6 +69,8 @@ declare const WmAlertDialogStandalone: {
|
|
|
69
69
|
updateon?: string;
|
|
70
70
|
dataset?: any;
|
|
71
71
|
prefabName?: string;
|
|
72
|
+
loading?: boolean;
|
|
73
|
+
showSkeleton?: boolean;
|
|
72
74
|
} & import("../withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
73
75
|
displayName: string;
|
|
74
76
|
};
|
|
@@ -152,6 +154,8 @@ declare const _default: {
|
|
|
152
154
|
updateon?: string;
|
|
153
155
|
dataset?: any;
|
|
154
156
|
prefabName?: string;
|
|
157
|
+
loading?: boolean;
|
|
158
|
+
showSkeleton?: boolean;
|
|
155
159
|
} & import("../withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
156
160
|
displayName: string;
|
|
157
161
|
};
|
|
@@ -70,6 +70,8 @@ declare const WmConfirmDialogStandalone: {
|
|
|
70
70
|
updateon?: string;
|
|
71
71
|
dataset?: any;
|
|
72
72
|
prefabName?: string;
|
|
73
|
+
loading?: boolean;
|
|
74
|
+
showSkeleton?: boolean;
|
|
73
75
|
} & import("@wavemaker-ai/react-runtime/components/dialogs/withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
74
76
|
displayName: string;
|
|
75
77
|
};
|
|
@@ -154,6 +156,8 @@ declare const _default: {
|
|
|
154
156
|
updateon?: string;
|
|
155
157
|
dataset?: any;
|
|
156
158
|
prefabName?: string;
|
|
159
|
+
loading?: boolean;
|
|
160
|
+
showSkeleton?: boolean;
|
|
157
161
|
} & import("@wavemaker-ai/react-runtime/components/dialogs/withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
158
162
|
displayName: string;
|
|
159
163
|
};
|
|
@@ -74,6 +74,8 @@ declare const WmDialogStandalone: {
|
|
|
74
74
|
updateon?: string;
|
|
75
75
|
dataset?: any;
|
|
76
76
|
prefabName?: string;
|
|
77
|
+
loading?: boolean;
|
|
78
|
+
showSkeleton?: boolean;
|
|
77
79
|
} & import("@wavemaker-ai/react-runtime/components/dialogs/withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
78
80
|
displayName: string;
|
|
79
81
|
};
|
|
@@ -164,6 +166,8 @@ declare const _default: {
|
|
|
164
166
|
updateon?: string;
|
|
165
167
|
dataset?: any;
|
|
166
168
|
prefabName?: string;
|
|
169
|
+
loading?: boolean;
|
|
170
|
+
showSkeleton?: boolean;
|
|
167
171
|
} & import("@wavemaker-ai/react-runtime/components/dialogs/withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
168
172
|
displayName: string;
|
|
169
173
|
};
|
|
@@ -79,6 +79,8 @@ declare const WmIframeDialogStandalone: {
|
|
|
79
79
|
updateon?: string;
|
|
80
80
|
dataset?: any;
|
|
81
81
|
prefabName?: string;
|
|
82
|
+
loading?: boolean;
|
|
83
|
+
showSkeleton?: boolean;
|
|
82
84
|
} & import("@wavemaker-ai/react-runtime/components/dialogs/withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
83
85
|
displayName: string;
|
|
84
86
|
};
|
|
@@ -172,6 +174,8 @@ declare const _default: {
|
|
|
172
174
|
updateon?: string;
|
|
173
175
|
dataset?: any;
|
|
174
176
|
prefabName?: string;
|
|
177
|
+
loading?: boolean;
|
|
178
|
+
showSkeleton?: boolean;
|
|
175
179
|
} & import("@wavemaker-ai/react-runtime/components/dialogs/withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
176
180
|
displayName: string;
|
|
177
181
|
};
|
|
@@ -76,6 +76,8 @@ declare const WmLoginDialogStandalone: {
|
|
|
76
76
|
updateon?: string;
|
|
77
77
|
dataset?: any;
|
|
78
78
|
prefabName?: string;
|
|
79
|
+
loading?: boolean;
|
|
80
|
+
showSkeleton?: boolean;
|
|
79
81
|
} & import("../withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
80
82
|
displayName: string;
|
|
81
83
|
};
|
|
@@ -157,6 +159,8 @@ declare const _default: {
|
|
|
157
159
|
updateon?: string;
|
|
158
160
|
dataset?: any;
|
|
159
161
|
prefabName?: string;
|
|
162
|
+
loading?: boolean;
|
|
163
|
+
showSkeleton?: boolean;
|
|
160
164
|
} & import("../withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
161
165
|
displayName: string;
|
|
162
166
|
};
|
|
@@ -71,6 +71,8 @@ declare const WmPageDialogStandalone: {
|
|
|
71
71
|
formfield?: boolean;
|
|
72
72
|
updateon?: string;
|
|
73
73
|
dataset?: any;
|
|
74
|
+
loading?: boolean;
|
|
75
|
+
showSkeleton?: boolean;
|
|
74
76
|
} & import("@wavemaker-ai/react-runtime/components/dialogs/withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
75
77
|
displayName: string;
|
|
76
78
|
};
|
|
@@ -156,6 +158,8 @@ declare const _default: {
|
|
|
156
158
|
formfield?: boolean;
|
|
157
159
|
updateon?: string;
|
|
158
160
|
dataset?: any;
|
|
161
|
+
loading?: boolean;
|
|
162
|
+
showSkeleton?: boolean;
|
|
159
163
|
} & import("@wavemaker-ai/react-runtime/components/dialogs/withDialogWrapper").BaseDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
160
164
|
displayName: string;
|
|
161
165
|
};
|
|
@@ -37,6 +37,11 @@ import Box from "@mui/material/Box";
|
|
|
37
37
|
import Button from "@mui/material/Button";
|
|
38
38
|
import Badge from "@mui/material/Badge";
|
|
39
39
|
import { withBaseWrapper } from "../../../higherOrder/withBaseWrapper";
|
|
40
|
+
import {
|
|
41
|
+
WmSkeleton,
|
|
42
|
+
SKELETON_REGISTRY,
|
|
43
|
+
shouldShowSkeleton
|
|
44
|
+
} from "../../common/wm-skeleton";
|
|
40
45
|
import { prefixPrefabResourceUrl } from "../../../utils/resource-url";
|
|
41
46
|
import { removeInvalidAttributes } from "../../../utils/attr";
|
|
42
47
|
const DEFAULT_CLASS = "btn app-button";
|
|
@@ -174,6 +179,8 @@ const WmButton = memo(
|
|
|
174
179
|
}
|
|
175
180
|
};
|
|
176
181
|
const EVENTS = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, onBlur && { onBlur: handleOnBlur }), onFocus && { onFocus: handleOnFocus }), onMouseEnter && { onMouseEnter: handleMouseEnter }), onMouseLeave && { onMouseLeave: handleMouseLeave }), onDoubleClick && { onDoubleClick: handleDoubleClick }), onKeydown && { onKeyDown: handleKeyDown }), onKeyup && { onKeyUp: handleKeyUp }), onClick && { onClick: handleClick }), onKeypress && { onKeyPress: handleKeyPress }), { onMouseDown: handleMouseDown });
|
|
182
|
+
if (shouldShowSkeleton(props.loading, props.showSkeleton))
|
|
183
|
+
return /* @__PURE__ */ jsx(WmSkeleton, __spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmButton"]), { className, styles }));
|
|
177
184
|
return /* @__PURE__ */ jsxs(
|
|
178
185
|
Button,
|
|
179
186
|
__spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues({
|
|
@@ -293,7 +300,9 @@ const WmButton = memo(
|
|
|
293
300
|
"onClick",
|
|
294
301
|
"show",
|
|
295
302
|
"styles",
|
|
296
|
-
"className"
|
|
303
|
+
"className",
|
|
304
|
+
"loading",
|
|
305
|
+
"showSkeleton"
|
|
297
306
|
];
|
|
298
307
|
return keys.every((key) => prev[key] === current[key]);
|
|
299
308
|
}
|
|
@@ -66,6 +66,8 @@ export declare const WmCalendar: React.ForwardRefExoticComponent<Omit<{
|
|
|
66
66
|
formfield?: boolean;
|
|
67
67
|
updateon?: string;
|
|
68
68
|
prefabName?: string;
|
|
69
|
+
loading?: boolean;
|
|
70
|
+
showSkeleton?: boolean;
|
|
69
71
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
70
72
|
/**
|
|
71
73
|
* The WmCalendar component provides an interactive calendar with event support, day/week/month views.
|
|
@@ -126,5 +128,7 @@ declare const _default: React.ComponentType<{
|
|
|
126
128
|
updateon?: string;
|
|
127
129
|
dataset?: any;
|
|
128
130
|
prefabName?: string;
|
|
131
|
+
loading?: boolean;
|
|
132
|
+
showSkeleton?: boolean;
|
|
129
133
|
}>;
|
|
130
134
|
export default _default;
|
|
@@ -137,13 +137,14 @@ const WmCalendar = forwardRef((props, ref) => {
|
|
|
137
137
|
}, [calendartype, controls]);
|
|
138
138
|
const invokeCallback = useCallback(
|
|
139
139
|
(eventName, eventData) => {
|
|
140
|
+
var _a2;
|
|
140
141
|
const { $start, $end, $view, $data, $event, $newData, $oldData, $delta, $revertFunc, $ui } = eventData;
|
|
141
142
|
switch (eventName) {
|
|
142
143
|
case "select":
|
|
143
144
|
onSelect == null ? void 0 : onSelect($start, $end, $view, $data);
|
|
144
145
|
break;
|
|
145
146
|
case "beforerender":
|
|
146
|
-
onBeforerender == null ? void 0 : onBeforerender(eventData, listener == null ? void 0 : listener.Widgets[name]);
|
|
147
|
+
onBeforerender == null ? void 0 : onBeforerender(eventData, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
|
|
147
148
|
break;
|
|
148
149
|
case "eventdrop":
|
|
149
150
|
onEventdrop == null ? void 0 : onEventdrop($event, $newData, $oldData, $delta, $revertFunc, $ui, $view);
|
|
@@ -99,6 +99,8 @@ declare const WmChipsStandalone: React.ComponentType<import("../../data/form/for
|
|
|
99
99
|
formfield?: boolean;
|
|
100
100
|
updateon?: string;
|
|
101
101
|
prefabName?: string;
|
|
102
|
+
loading?: boolean;
|
|
103
|
+
showSkeleton?: boolean;
|
|
102
104
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
103
105
|
export { WmChipsStandalone as WmChips };
|
|
104
106
|
/**
|
|
@@ -220,5 +222,7 @@ declare const _default: React.ComponentType<{
|
|
|
220
222
|
formfield?: boolean;
|
|
221
223
|
updateon?: string;
|
|
222
224
|
prefabName?: string;
|
|
225
|
+
loading?: boolean;
|
|
226
|
+
showSkeleton?: boolean;
|
|
223
227
|
}>;
|
|
224
228
|
export default _default;
|