@wavemaker-ai/react-runtime 1.0.0-rc.322 → 1.0.0-rc.326
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/login-action.js +1 -1
- package/components/advanced/carousel/index.d.ts +1 -0
- package/components/advanced/carousel/template.d.ts +1 -0
- package/components/advanced/login/index.d.ts +1 -0
- package/components/advanced/marquee/index.d.ts +1 -0
- package/components/basic/anchor/index.d.ts +1 -0
- package/components/basic/anchor/index.js +19 -14
- package/components/basic/audio/index.d.ts +1 -0
- package/components/basic/html/index.d.ts +1 -0
- package/components/basic/icon/index.d.ts +1 -0
- package/components/basic/icon/index.js +13 -16
- package/components/basic/iframe/index.d.ts +1 -0
- package/components/basic/label/index.d.ts +1 -0
- package/components/basic/label/index.js +5 -3
- package/components/basic/label/props.d.ts +1 -1
- package/components/basic/picture/index.d.ts +1 -0
- package/components/basic/picture/index.js +3 -2
- package/components/basic/progress-bar/index.d.ts +1 -0
- package/components/basic/progress-circle/index.d.ts +1 -0
- package/components/basic/richtexteditor/index.d.ts +2 -0
- package/components/basic/search/index.d.ts +6 -0
- package/components/basic/search/index.js +69 -9
- package/components/basic/search/props.d.ts +4 -0
- package/components/basic/spinner/index.d.ts +2 -0
- package/components/basic/spinner/index.js +11 -9
- package/components/basic/spinner/props.d.ts +5 -0
- package/components/basic/tile/index.d.ts +1 -0
- package/components/basic/tree/index.d.ts +1 -0
- package/components/basic/video/index.d.ts +1 -0
- package/components/chart/index.d.ts +2 -0
- package/components/chart/props.d.ts +1 -0
- package/components/chart/src/chart.js +12 -1
- package/components/chart/src/types.d.ts +2 -0
- package/components/common/WmAppIcon/index.d.ts +15 -0
- package/components/common/WmAppIcon/index.js +130 -0
- package/components/common/WmAppIcon/props.d.ts +17 -0
- package/components/common/WmAppIcon/props.js +0 -0
- package/components/common/index.d.ts +3 -1
- package/components/common/index.js +10 -2
- package/components/common/wm-skeleton.d.ts +7 -0
- package/components/common/wm-skeleton.js +11 -1
- package/components/container/accordion/accordion-pane/index.d.ts +2 -0
- package/components/container/accordion/accordion-pane/index.js +10 -1
- package/components/container/accordion/accordion-pane/props.d.ts +1 -0
- package/components/container/accordion/index.d.ts +1 -0
- package/components/container/accordion/index.js +2 -2
- package/components/container/index.d.ts +1 -0
- package/components/container/index.js +6 -1
- package/components/container/layout-grid/grid-column/index.d.ts +1 -0
- package/components/container/layout-grid/grid-row/index.d.ts +1 -0
- package/components/container/layout-grid/grid-row/index.js +1 -1
- package/components/container/layout-grid/index.d.ts +1 -0
- package/components/container/linear-layout/index.d.ts +1 -0
- package/components/container/linear-layout/linear-layout-item/index.d.ts +1 -0
- package/components/container/panel/components/panel-header/index.js +16 -16
- package/components/container/panel/index.d.ts +1 -0
- package/components/container/repeat-template/index.d.ts +1 -0
- package/components/container/tabs/index.d.ts +1 -0
- package/components/container/tabs/index.js +18 -18
- package/components/container/tabs/props.d.ts +1 -0
- package/components/container/tabs/tab-pane/index.d.ts +2 -0
- package/components/container/tabs/tab-pane/index.js +2 -0
- package/components/container/tabs/tab-pane/props.d.ts +1 -0
- package/components/container/wizard/components/StepComponents.js +14 -6
- package/components/container/wizard/index.d.ts +2 -0
- package/components/container/wizard/index.js +2 -2
- package/components/container/wizard/props.d.ts +4 -0
- package/components/container/wizard/wizard-step/index.d.ts +1 -0
- package/components/container/wizard/wizard-step/index.js +6 -0
- package/components/data/card/card-actions/index.d.ts +1 -0
- package/components/data/card/card-content/index.d.ts +1 -0
- package/components/data/card/card-footer/index.d.ts +1 -0
- package/components/data/card/index.d.ts +1 -0
- package/components/data/card/index.js +13 -6
- package/components/data/form/base-form/hooks/useFormSubmission.d.ts +1 -1
- package/components/data/form/base-form/hooks/useFormSubmission.js +3 -1
- package/components/data/form/base-form/index.js +11 -14
- package/components/data/form/base-form/props.d.ts +3 -0
- package/components/data/form/dynamic-fields/index.js +1 -0
- package/components/data/form/form-action/index.d.ts +2 -0
- package/components/data/form/form-action/index.js +6 -4
- package/components/data/form/form-controller/withFormController.js +19 -2
- package/components/data/form/form-field/base-field.js +8 -5
- package/components/data/form/form-field/index.js +14 -9
- package/components/data/form/form-field/props.d.ts +1 -0
- package/components/data/form/form-header/index.d.ts +1 -1
- package/components/data/form/form-header/index.js +10 -1
- package/components/data/form/index.js +5 -3
- package/components/data/form/props.d.ts +1 -0
- package/components/data/list/components/ListHeader.js +19 -3
- package/components/data/list/components/ListItemWithTemplate.js +10 -3
- package/components/data/list/components/ListItems.d.ts +1 -1
- package/components/data/list/components/ListItems.js +5 -1
- package/components/data/list/components/LoadMoreButton.js +14 -2
- package/components/data/list/components/StandardListItems.js +1 -1
- package/components/data/list/components/props.d.ts +11 -5
- package/components/data/list/hooks/props.d.ts +2 -2
- package/components/data/list/hooks/useListEffects.js +1 -1
- package/components/data/list/hooks/useListEventHandlers.js +3 -2
- package/components/data/list/index.d.ts +5 -1
- package/components/data/list/index.js +28 -7
- package/components/data/list/props.d.ts +14 -2
- package/components/data/list/utils/constants.d.ts +0 -1
- package/components/data/list/utils/constants.js +0 -2
- package/components/data/list/utils/list-helpers.d.ts +5 -1
- package/components/data/list/utils/list-helpers.js +10 -0
- package/components/data/pagination/components/PageSizeSelector.js +49 -155
- package/components/data/pagination/hooks/usePagination.js +24 -1
- package/components/data/table/components/RowCells.js +18 -4
- package/components/data/table/components/TableBody.js +5 -3
- package/components/data/table/components/TableDataRow.js +16 -3
- package/components/data/table/components/TableHeader.js +10 -8
- package/components/data/table/components/TablePanelHeading.js +15 -3
- package/components/data/table/hooks/useDynamicColumns.js +1 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
- package/components/data/table/hooks/useRowExpansion.js +41 -31
- package/components/data/table/hooks/useRowHandlers.js +0 -1
- package/components/data/table/hooks/useServerSideSorting.js +0 -1
- package/components/data/table/hooks/useTableColumns.js +17 -9
- package/components/data/table/hooks/useTableData.js +30 -2
- package/components/data/table/hooks/useTableEdit.js +0 -1
- package/components/data/table/index.d.ts +4 -0
- package/components/data/table/index.js +93 -47
- package/components/data/table/live-table/index.d.ts +1 -0
- package/components/data/table/live-table/index.js +0 -1
- package/components/data/table/props.d.ts +15 -2
- package/components/data/table/table-action/index.d.ts +1 -0
- package/components/data/table/table-column/index.d.ts +1 -0
- package/components/data/table/table-row/index.d.ts +1 -0
- package/components/data/table/table-row-action/index.d.ts +1 -0
- package/components/data/table/utils/buildSelectionColumns.d.ts +1 -1
- package/components/data/table/utils/buildSelectionColumns.js +95 -71
- package/components/data/table/utils/columnBuilder.d.ts +29 -2
- package/components/data/table/utils/columnBuilder.js +40 -26
- package/components/data/table/utils/columnWidthDistribution.d.ts +1 -1
- package/components/data/table/utils/columnWidthDistribution.js +14 -1
- package/components/data/table/utils/constants.d.ts +0 -4
- package/components/data/table/utils/constants.js +0 -7
- package/components/data/table/utils/dynamic-columns.d.ts +1 -1
- package/components/data/table/utils/dynamic-columns.js +3 -8
- package/components/data/table/utils/expansionColumn.d.ts +23 -0
- package/components/data/table/utils/expansionColumn.js +56 -0
- package/components/data/table/utils/index.d.ts +14 -2
- package/components/data/table/utils/index.js +45 -19
- package/components/dialogs/alert-dialog/index.d.ts +2 -0
- package/components/dialogs/confirm-dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.js +3 -2
- package/components/dialogs/dialog-actions/index.d.ts +1 -0
- package/components/dialogs/dialog-body/index.d.ts +1 -0
- package/components/dialogs/dialog-content/index.d.ts +1 -0
- package/components/dialogs/dialog-header/index.d.ts +1 -0
- package/components/dialogs/dialog-header/index.js +11 -12
- package/components/dialogs/iframe-dialog/index.d.ts +2 -0
- package/components/dialogs/login-dialog/index.d.ts +4 -0
- package/components/dialogs/login-dialog/index.js +2 -1
- package/components/dialogs/login-dialog/props.d.ts +1 -0
- package/components/dialogs/page-dialog/index.d.ts +4 -0
- package/components/dialogs/page-dialog/index.js +2 -1
- package/components/dialogs/page-dialog/props.d.ts +1 -0
- package/components/form/button/index.d.ts +1 -0
- package/components/form/button/index.js +29 -33
- package/components/form/button-group/index.d.ts +1 -0
- package/components/input/calendar/index.d.ts +2 -0
- package/components/input/chips/index.d.ts +2 -0
- package/components/input/chips/index.js +9 -3
- package/components/input/chips/utils.d.ts +5 -0
- package/components/input/chips/utils.js +29 -0
- package/components/input/color-picker/index.d.ts +2 -0
- package/components/input/composite/index.d.ts +1 -0
- package/components/input/composite/index.js +1 -0
- package/components/input/currency/index.d.ts +2 -0
- package/components/input/default/checkbox/index.d.ts +6 -0
- package/components/input/default/checkbox/index.js +48 -18
- package/components/input/default/checkbox/props.d.ts +8 -0
- package/components/input/default/checkboxset/index.d.ts +2 -0
- package/components/input/default/radioset/index.d.ts +2 -0
- package/components/input/default/radioset/index.js +2 -1
- package/components/input/default/switch/index.d.ts +6 -0
- package/components/input/default/switch/index.js +36 -9
- package/components/input/default/switch/prop.d.ts +2 -0
- package/components/input/epoch/date/index.d.ts +1 -0
- package/components/input/epoch/datetime/index.d.ts +1 -0
- package/components/input/epoch/time/index.d.ts +1 -0
- package/components/input/fileupload/components/ListItems.d.ts +5 -1
- package/components/input/fileupload/components/ListItems.js +27 -5
- package/components/input/fileupload/components/MultiUpload.js +12 -1
- package/components/input/fileupload/components/SingleUpload.js +12 -1
- package/components/input/fileupload/index.d.ts +3 -0
- package/components/input/fileupload/index.js +11 -0
- package/components/input/fileupload/props.d.ts +10 -0
- package/components/input/number/index.d.ts +2 -0
- package/components/input/rating/index.d.ts +6 -0
- package/components/input/rating/index.js +10 -5
- package/components/input/rating/props.d.ts +8 -0
- package/components/input/select/index.d.ts +2 -0
- package/components/input/select/index.js +1 -2
- package/components/input/slider/index.d.ts +6 -0
- package/components/input/slider/index.js +19 -2
- package/components/input/slider/props.d.ts +2 -0
- package/components/input/text/index.d.ts +7 -1
- package/components/input/text/index.js +25 -6
- package/components/input/text/props.d.ts +8 -0
- package/components/input/textarea/index.d.ts +2 -0
- package/components/input/textarea/index.js +10 -5
- package/components/input/textarea/util.d.ts +1 -0
- package/components/input/textarea/util.js +17 -0
- package/components/input/upload/index.d.ts +2 -0
- package/components/navbar/index.d.ts +7 -0
- package/components/navbar/index.js +21 -7
- package/components/navbar/nav/index.d.ts +1 -0
- package/components/navbar/nav-item/index.d.ts +1 -0
- package/components/navigation/breadcrumb/index.d.ts +1 -0
- package/components/navigation/menu/index.d.ts +3 -1
- package/components/navigation/menu/index.js +22 -4
- package/components/navigation/menu/props.d.ts +1 -0
- package/components/navigation/popover/index.d.ts +1 -0
- package/components/navigation/popover/index.js +23 -9
- package/components/page/index.js +1 -1
- package/components/page/page-content/index.js +6 -2
- package/components/page/partial/index.d.ts +1 -0
- package/components/page/partial-container/index.js +2 -1
- package/components/prefab/index.js +3 -2
- package/components/prefab/props.d.ts +1 -0
- package/context/WidgetProvider.js +2 -1
- package/core/appstore.d.ts +10 -0
- package/core/appstore.js +9 -1
- package/core/constants/events.d.ts +3 -0
- package/core/constants/events.js +13 -1
- package/core/proxy-service.d.ts +1 -0
- package/core/proxy-service.js +54 -3
- package/core/util/index.d.ts +2 -0
- package/core/util/index.js +32 -1
- package/higherOrder/BasePage.js +106 -30
- package/higherOrder/props.d.ts +1 -0
- package/higherOrder/useActivePageReactivity.d.ts +21 -0
- package/higherOrder/useActivePageReactivity.js +57 -0
- package/higherOrder/withBaseWrapper.js +11 -7
- package/higherOrder/withRenderLogger.d.ts +15 -0
- package/higherOrder/withRenderLogger.js +53 -0
- package/hooks/useAuth.js +7 -1
- package/package-lock.json +273 -263
- package/package.json +4 -3
- package/runtime-dynamic/components/partial-content.js +3 -1
- package/runtime-dynamic/factories/dynamic-component.js +44 -8
- package/runtime-dynamic/factories/utils.js +7 -1
- package/runtime-dynamic/services/compile-render.js +2 -1
- package/runtime-dynamic/services/css-scoping.d.ts +2 -0
- package/runtime-dynamic/services/css-scoping.js +39 -20
- package/store/slices/i18nSlice.d.ts +2 -0
- package/store/slices/i18nSlice.js +3 -1
- package/types/index.d.ts +6 -0
- package/utils/attr.js +4 -1
- package/utils/custom-expression/parser.js +11 -8
- package/utils/svg-icon.d.ts +27 -0
- package/utils/svg-icon.js +75 -0
- package/utils/transformedDataset-utils.d.ts +3 -3
- package/utils/transformedDataset-utils.js +1 -2
|
@@ -37,7 +37,7 @@ const DATASET_SYNC_KEYS = [
|
|
|
37
37
|
];
|
|
38
38
|
const WmFormField = memo(
|
|
39
39
|
(props) => {
|
|
40
|
-
var _a, _b;
|
|
40
|
+
var _a, _b, _c, _d;
|
|
41
41
|
const { show = true, deferload } = props;
|
|
42
42
|
const [proxyProps, setProxyProps] = useState(__spreadProps(__spreadValues({}, props), {
|
|
43
43
|
show: show == null ? void 0 : show.toString(),
|
|
@@ -49,6 +49,7 @@ const WmFormField = memo(
|
|
|
49
49
|
const overriddenItemsRef = useRef({});
|
|
50
50
|
const fieldKey = props.formKey || props.name;
|
|
51
51
|
const defaultValueRegisteredRef = useRef(false);
|
|
52
|
+
const showfield = (_b = (_a = overriddenItemsRef == null ? void 0 : overriddenItemsRef.current) == null ? void 0 : _a.show) != null ? _b : show;
|
|
52
53
|
const formReady = (formProxy == null ? void 0 : formProxy.listener) !== void 0;
|
|
53
54
|
const reset = useCallback(
|
|
54
55
|
(value) => {
|
|
@@ -66,10 +67,10 @@ const WmFormField = memo(
|
|
|
66
67
|
const onChangeHandler = useCallback(
|
|
67
68
|
(name, data) => {
|
|
68
69
|
Object.keys(data).forEach((key) => {
|
|
69
|
-
fieldProxyRef.current[key] = key === "datavalue" && isNumber ? Number(data[key]) : data[key];
|
|
70
|
+
fieldProxyRef.current[key] = key === "datavalue" && isNumber && !Array.isArray(data[key]) ? Number(data[key]) : data[key];
|
|
70
71
|
});
|
|
71
72
|
setProxyProps((prev) => {
|
|
72
|
-
return __spreadValues(__spreadValues({}, prev), isNumber ? __spreadProps(__spreadValues({}, data), { datavalue: Number(data.datavalue) }) : data);
|
|
73
|
+
return __spreadValues(__spreadValues({}, prev), isNumber && data.datavalue !== void 0 && !Array.isArray(data.datavalue) ? __spreadProps(__spreadValues({}, data), { datavalue: Number(data.datavalue) }) : data);
|
|
73
74
|
});
|
|
74
75
|
},
|
|
75
76
|
[isNumber]
|
|
@@ -109,14 +110,17 @@ const WmFormField = memo(
|
|
|
109
110
|
});
|
|
110
111
|
}, [props.dataset, props.datafield, props.displayfield, props.displaylabel, props.searchkey]);
|
|
111
112
|
function renderFormFields() {
|
|
112
|
-
var _a2, _b2,
|
|
113
|
+
var _a2, _b2, _c2, _d2, _e, _f, _g;
|
|
113
114
|
if (props.formRef) {
|
|
114
115
|
const errors = (_a2 = props.formRef) == null ? void 0 : _a2.errors;
|
|
115
116
|
const formKey = (_b2 = props.formKey) != null ? _b2 : props.name;
|
|
116
117
|
const fieldError = formKey && errors ? get(errors, formKey) : void 0;
|
|
117
118
|
const invalid = Boolean(fieldError);
|
|
118
119
|
const invalidCls = invalid ? " text-danger " : "";
|
|
119
|
-
return /* @__PURE__ */ jsx(Fragment, { children: (
|
|
120
|
+
return /* @__PURE__ */ jsx(Fragment, { children: (_g = props == null ? void 0 : props.renderFormFields) == null ? void 0 : _g.call(props, __spreadProps(__spreadValues(__spreadValues({}, proxyProps), overriddenItemsRef.current), {
|
|
121
|
+
show: showfield,
|
|
122
|
+
disabled: (_d2 = (_c2 = overriddenItemsRef == null ? void 0 : overriddenItemsRef.current) == null ? void 0 : _c2.disabled) != null ? _d2 : props == null ? void 0 : props.disabled,
|
|
123
|
+
readonly: (_f = (_e = overriddenItemsRef == null ? void 0 : overriddenItemsRef.current) == null ? void 0 : _e.readonly) != null ? _f : props == null ? void 0 : props.readonly,
|
|
120
124
|
fieldError,
|
|
121
125
|
validators: props.validators,
|
|
122
126
|
asyncValidators: props.asyncValidators,
|
|
@@ -130,13 +134,14 @@ const WmFormField = memo(
|
|
|
130
134
|
return null;
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
|
-
const
|
|
137
|
+
const isDynamicFormField = typeof props.className === "string" && props.className.includes("app-dynamic-form-field");
|
|
138
|
+
const itemsPerRowClass = !isDynamicFormField && ((_c = props.formRef) == null ? void 0 : _c.itemsPerRow) || "";
|
|
134
139
|
if (!fieldProxyRef.current) {
|
|
135
140
|
return null;
|
|
136
141
|
}
|
|
137
142
|
const isDeferLoad = deferload === true;
|
|
138
|
-
const showValue = ((
|
|
139
|
-
if (!showValue && isDeferLoad) {
|
|
143
|
+
const showValue = ((_d = proxyProps == null ? void 0 : proxyProps.show) == null ? void 0 : _d.toString()) !== "false";
|
|
144
|
+
if ((!showValue || showfield) && isDeferLoad) {
|
|
140
145
|
return null;
|
|
141
146
|
}
|
|
142
147
|
const shouldHide = !showValue && !isDeferLoad;
|
|
@@ -146,7 +151,7 @@ const WmFormField = memo(
|
|
|
146
151
|
return /* @__PURE__ */ jsx(
|
|
147
152
|
"div",
|
|
148
153
|
{
|
|
149
|
-
className: clsx(props.className,
|
|
154
|
+
className: clsx(props.className, itemsPerRowClass, DEFAULT_CLASS),
|
|
150
155
|
id: props.id,
|
|
151
156
|
style: __spreadValues(__spreadValues({}, props.conditionalstyle), props.styles),
|
|
152
157
|
"data-displayname": props.displayname,
|
|
@@ -205,6 +205,7 @@ export interface FormFieldProps {
|
|
|
205
205
|
observeOn?: any[];
|
|
206
206
|
reset?: () => void;
|
|
207
207
|
setValidationMessage?: (message: string) => void;
|
|
208
|
+
disabled?: boolean;
|
|
208
209
|
}
|
|
209
210
|
/**
|
|
210
211
|
* Combined props for the WmFormField component, including base WaveMaker props.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WmFormProps } from "../props";
|
|
2
|
-
type FormHeaderProps = Pick<WmFormProps, "title" | "subheading" | "iconclass" | "collapsible" | "expanded" | "headerActions" | "expandCollapsePanel" | "isViewMode">;
|
|
2
|
+
type FormHeaderProps = Pick<WmFormProps, "title" | "subheading" | "iconclass" | "iconurl" | "prefabName" | "collapsible" | "expanded" | "headerActions" | "expandCollapsePanel" | "isViewMode">;
|
|
3
3
|
declare const WmFormHeader: {
|
|
4
4
|
(props: FormHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
@@ -24,7 +24,16 @@ import WmFormActions from "../form-action";
|
|
|
24
24
|
import { WmButton } from "../../../form/button";
|
|
25
25
|
const WmFormHeader = (props) => {
|
|
26
26
|
return /* @__PURE__ */ jsx("div", { className: "panel-heading", children: /* @__PURE__ */ jsxs("h3", { className: "panel-title", children: [
|
|
27
|
-
/* @__PURE__ */ jsx("div", { className: "pull-left", children: props.iconclass && /* @__PURE__ */ jsx(
|
|
27
|
+
/* @__PURE__ */ jsx("div", { className: "pull-left", children: (props.iconclass || props.iconurl) && /* @__PURE__ */ jsx(
|
|
28
|
+
WmIcon,
|
|
29
|
+
{
|
|
30
|
+
name: "",
|
|
31
|
+
listener: {},
|
|
32
|
+
iconclass: props.iconclass || "",
|
|
33
|
+
iconurl: props.iconurl,
|
|
34
|
+
prefabName: props.prefabName
|
|
35
|
+
}
|
|
36
|
+
) }),
|
|
28
37
|
/* @__PURE__ */ jsxs("div", { className: "pull-left", children: [
|
|
29
38
|
/* @__PURE__ */ jsx("div", { className: "heading", children: props.title }),
|
|
30
39
|
/* @__PURE__ */ jsx("div", { className: "description", children: props.subheading })
|
|
@@ -28,11 +28,11 @@ import withStandalone from "../../../higherOrder/withStandalone";
|
|
|
28
28
|
import {
|
|
29
29
|
WmSkeleton,
|
|
30
30
|
SKELETON_REGISTRY,
|
|
31
|
-
|
|
31
|
+
useShouldShowSkeleton
|
|
32
32
|
} from "../../common/wm-skeleton";
|
|
33
33
|
const WmForm = (props) => {
|
|
34
34
|
var _a, _b, _c, _d;
|
|
35
|
-
if (
|
|
35
|
+
if (useShouldShowSkeleton(props.loading, props.showSkeleton))
|
|
36
36
|
return /* @__PURE__ */ jsx(
|
|
37
37
|
WmSkeleton,
|
|
38
38
|
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmForm"]), {
|
|
@@ -61,12 +61,14 @@ const WmForm = (props) => {
|
|
|
61
61
|
ref: props.formElementRef,
|
|
62
62
|
noValidate: props.validationtype !== "html",
|
|
63
63
|
children: [
|
|
64
|
-
!shouldHideHeader && ((props == null ? void 0 : props.title) || (props == null ? void 0 : props.subheading) || (props == null ? void 0 : props.iconclass) || (props == null ? void 0 : props.headerActions) && props.headerActions.length > 0 || (props == null ? void 0 : props.collapsible)) && /* @__PURE__ */ jsx(
|
|
64
|
+
!shouldHideHeader && ((props == null ? void 0 : props.title) || (props == null ? void 0 : props.subheading) || (props == null ? void 0 : props.iconclass) || (props == null ? void 0 : props.iconurl) || (props == null ? void 0 : props.headerActions) && props.headerActions.length > 0 || (props == null ? void 0 : props.collapsible)) && /* @__PURE__ */ jsx(
|
|
65
65
|
WmFormHeader,
|
|
66
66
|
{
|
|
67
67
|
title: props.title,
|
|
68
68
|
subheading: props.subheading,
|
|
69
69
|
iconclass: props.iconclass,
|
|
70
|
+
iconurl: props.iconurl,
|
|
71
|
+
prefabName: props.prefabName,
|
|
70
72
|
collapsible: props.collapsible,
|
|
71
73
|
expanded: props.expanded,
|
|
72
74
|
headerActions: props.headerActions,
|
|
@@ -2,10 +2,26 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Box from "@mui/material/Box";
|
|
3
3
|
import Typography from "@mui/material/Typography";
|
|
4
4
|
import DOMPurify from "dompurify";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { WmAppIcon } from "../../../common/WmAppIcon";
|
|
6
|
+
const ListHeader = ({
|
|
7
|
+
title,
|
|
8
|
+
subheading,
|
|
9
|
+
iconclass,
|
|
10
|
+
iconurl,
|
|
11
|
+
prefabName
|
|
12
|
+
}) => {
|
|
13
|
+
if (!title && !subheading && !iconclass && !iconurl) return null;
|
|
7
14
|
return /* @__PURE__ */ jsx(Box, { component: "div", className: "panel-heading", children: /* @__PURE__ */ jsxs(Typography, { className: "panel-title wm-all-unset", variant: "h6", children: [
|
|
8
|
-
/* @__PURE__ */ jsx("span", { className: "pull-left", children:
|
|
15
|
+
/* @__PURE__ */ jsx("span", { className: "pull-left", children: /* @__PURE__ */ jsx(
|
|
16
|
+
WmAppIcon,
|
|
17
|
+
{
|
|
18
|
+
iconclass,
|
|
19
|
+
iconurl,
|
|
20
|
+
prefabName,
|
|
21
|
+
defaultClasses: "panel-icon",
|
|
22
|
+
alt: "List icon"
|
|
23
|
+
}
|
|
24
|
+
) }),
|
|
9
25
|
/* @__PURE__ */ jsxs("span", { className: "pull-left", children: [
|
|
10
26
|
title && /* @__PURE__ */ jsx(
|
|
11
27
|
Typography,
|
|
@@ -3,8 +3,10 @@ import { useCallback, useRef, useEffect, useMemo } from "react";
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { WmListItem } from "./ListItem";
|
|
5
5
|
import { MediaWmListtemplate } from "../templates/media-template";
|
|
6
|
+
import { resolveDisableItem } from "../utils/list-helpers";
|
|
6
7
|
import { useWidgetProxy } from "../../../../context/WidgetProvider";
|
|
7
8
|
import isPlainObject from "lodash-es/isPlainObject";
|
|
9
|
+
import isEmpty from "lodash-es/isEmpty";
|
|
8
10
|
const ListItemWithTemplate = ({
|
|
9
11
|
item,
|
|
10
12
|
index,
|
|
@@ -37,7 +39,7 @@ const ListItemWithTemplate = ({
|
|
|
37
39
|
const getCurrentItemWidgets = useCallback(
|
|
38
40
|
($index) => {
|
|
39
41
|
const cached = widgetCacheRef.current.get($index);
|
|
40
|
-
if (cached) {
|
|
42
|
+
if (cached && !isEmpty(cached)) {
|
|
41
43
|
return cached;
|
|
42
44
|
}
|
|
43
45
|
const items = {};
|
|
@@ -51,7 +53,9 @@ const ListItemWithTemplate = ({
|
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
|
|
56
|
+
if (!isEmpty(items)) {
|
|
57
|
+
widgetCacheRef.current.set($index, items);
|
|
58
|
+
}
|
|
55
59
|
return items;
|
|
56
60
|
},
|
|
57
61
|
[WidgetProxy, name]
|
|
@@ -64,11 +68,14 @@ const ListItemWithTemplate = ({
|
|
|
64
68
|
return typeof itemclass === "function" ? itemclass(item) : itemclass;
|
|
65
69
|
}, [itemclass, item]);
|
|
66
70
|
const itemLayoutAttrs = itemAttrs ? itemAttrs(item, globalIndex != null ? globalIndex : index) : void 0;
|
|
71
|
+
const resolvedDisableItem = useMemo(() => {
|
|
72
|
+
return resolveDisableItem(disableitem, item, globalIndex != null ? globalIndex : index);
|
|
73
|
+
}, [disableitem, item, globalIndex, index]);
|
|
67
74
|
return /* @__PURE__ */ jsx(
|
|
68
75
|
WmListItem,
|
|
69
76
|
{
|
|
70
77
|
item,
|
|
71
|
-
disableItem:
|
|
78
|
+
disableItem: resolvedDisableItem,
|
|
72
79
|
itemClass: clsx(resolvedItemClass, itemsPerRowClass),
|
|
73
80
|
index: globalIndex != null ? globalIndex : index,
|
|
74
81
|
isFirst,
|
|
@@ -4,4 +4,4 @@ import { ListItemData } from "../props";
|
|
|
4
4
|
* Main ListItems component - orchestrates rendering of list items
|
|
5
5
|
* with support for grouping, pagination, and on-demand loading
|
|
6
6
|
*/
|
|
7
|
-
export declare const ListItems: <T extends ListItemData = ListItemData>({ items, groupedData, groupby, navigation, currentPage, pagesize, visibleItems, orderby, disableitem, itemclass, itemsPerRowClass, direction, enablereorder, activeItems, name, tabIndex, renderItem, itemTemplate, nodatamessage, ondemandmessage, loadingicon, loadingdatamsg, paginationclass, isLoadingMore, collapsible, showcount, groupCollapsed, handleListItemClick, handleListItemDoubleClick, handleListItemMouseEnter, handleListItemMouseLeave, handleDragEnd, handleLoadMore, handleHeaderClick, onBeforedatarender, onRender, widgetInstance, rawDataset, datasource, totalItems, isServerSidePagination, showNavigation, itemAttrs, hasListGroupAutoLayout, standalone, }: ListItemsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const ListItems: <T extends ListItemData = ListItemData>({ items, groupedData, groupby, navigation, currentPage, pagesize, visibleItems, orderby, disableitem, itemclass, itemsPerRowClass, direction, enablereorder, activeItems, name, tabIndex, renderItem, itemTemplate, nodatamessage, ondemandmessage, loadingicon, loadingiconurl, loadingdatamsg, paginationclass, isLoadingMore, prefabName, collapsible, showcount, groupCollapsed, handleListItemClick, handleListItemDoubleClick, handleListItemMouseEnter, handleListItemMouseLeave, handleDragEnd, handleLoadMore, handleHeaderClick, onBeforedatarender, onRender, widgetInstance, rawDataset, datasource, totalItems, isServerSidePagination, showNavigation, itemAttrs, hasListGroupAutoLayout, standalone, }: ListItemsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -27,9 +27,11 @@ const ListItems = ({
|
|
|
27
27
|
nodatamessage,
|
|
28
28
|
ondemandmessage,
|
|
29
29
|
loadingicon,
|
|
30
|
+
loadingiconurl,
|
|
30
31
|
loadingdatamsg,
|
|
31
32
|
paginationclass,
|
|
32
33
|
isLoadingMore,
|
|
34
|
+
prefabName,
|
|
33
35
|
collapsible,
|
|
34
36
|
showcount,
|
|
35
37
|
groupCollapsed,
|
|
@@ -205,9 +207,11 @@ const ListItems = ({
|
|
|
205
207
|
paginationclass,
|
|
206
208
|
isLoadingMore,
|
|
207
209
|
loadingicon,
|
|
210
|
+
loadingiconurl,
|
|
208
211
|
loadingdatamsg,
|
|
209
212
|
ondemandmessage,
|
|
210
|
-
onLoadMore: handleLoadMore
|
|
213
|
+
onLoadMore: handleLoadMore,
|
|
214
|
+
prefabName
|
|
211
215
|
}
|
|
212
216
|
)
|
|
213
217
|
] });
|
|
@@ -2,13 +2,16 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import Box from "@mui/material/Box";
|
|
4
4
|
import Button from "@mui/material/Button";
|
|
5
|
+
import { WmAppIcon } from "../../../common/WmAppIcon";
|
|
5
6
|
const LoadMoreButton = ({
|
|
6
7
|
paginationclass,
|
|
7
8
|
isLoadingMore,
|
|
8
9
|
loadingicon,
|
|
10
|
+
loadingiconurl,
|
|
9
11
|
loadingdatamsg,
|
|
10
12
|
ondemandmessage,
|
|
11
|
-
onLoadMore
|
|
13
|
+
onLoadMore,
|
|
14
|
+
prefabName
|
|
12
15
|
}) => /* @__PURE__ */ jsx(Box, { component: "div", className: "panel-footer wm-load-more-footer wm-text-center", children: /* @__PURE__ */ jsx(
|
|
13
16
|
Button,
|
|
14
17
|
{
|
|
@@ -17,7 +20,16 @@ const LoadMoreButton = ({
|
|
|
17
20
|
onClick: onLoadMore,
|
|
18
21
|
disabled: isLoadingMore,
|
|
19
22
|
children: isLoadingMore ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
|
-
/* @__PURE__ */ jsx(
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
WmAppIcon,
|
|
25
|
+
{
|
|
26
|
+
iconclass: loadingicon ? `${loadingicon} fa-spin` : "fa fa-circle-o-notch fa-spin",
|
|
27
|
+
iconurl: loadingiconurl,
|
|
28
|
+
prefabName,
|
|
29
|
+
defaultClasses: clsx("app-icon", "me-2"),
|
|
30
|
+
alt: ""
|
|
31
|
+
}
|
|
32
|
+
),
|
|
21
33
|
loadingdatamsg
|
|
22
34
|
] }) : ondemandmessage
|
|
23
35
|
}
|
|
@@ -35,7 +35,7 @@ const StandardListItems = ({
|
|
|
35
35
|
const itemId = getItemId(item, globalIndex);
|
|
36
36
|
const isFirst = index === 0;
|
|
37
37
|
const isLast = index === currentItems.length - 1;
|
|
38
|
-
const isActive = (Array.isArray(activeItems) || activeItems instanceof Set) && some(Array.from(activeItems), (active) => active._wmListItemId === item._wmListItemId);
|
|
38
|
+
const isActive = (Array.isArray(activeItems) || activeItems instanceof Set) && some(Array.from(activeItems), (active) => active._wmListItemId && item._wmListItemId && active._wmListItemId === item._wmListItemId);
|
|
39
39
|
return /* @__PURE__ */ jsx(
|
|
40
40
|
ListItemWithTemplate,
|
|
41
41
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { GroupedDataItem } from "../hooks";
|
|
3
|
-
import { INavigation, IDirection, IAlignment, ListItemData, ListPaginationChangeHandler, ListSetRecordHandler, ListBeforeDataRenderHandler } from "../props";
|
|
3
|
+
import { INavigation, IDirection, IAlignment, DisableItemProp, ListItemData, ListPaginationChangeHandler, ListSetRecordHandler, ListBeforeDataRenderHandler } from "../props";
|
|
4
4
|
import { DragEndEvent } from "@dnd-kit/core";
|
|
5
5
|
export type DefaultEventHandler<T = ListItemData> = (event: React.MouseEvent, item: T) => void;
|
|
6
6
|
export interface ListPaginationProps {
|
|
@@ -58,7 +58,7 @@ export interface ListItemsProps<T = ListItemData> {
|
|
|
58
58
|
orderby?: string;
|
|
59
59
|
startIndex?: number;
|
|
60
60
|
endIndex?: number;
|
|
61
|
-
disableitem:
|
|
61
|
+
disableitem: DisableItemProp<T>;
|
|
62
62
|
itemclass: string | ((item: T) => string | null | undefined);
|
|
63
63
|
itemsPerRowClass: string;
|
|
64
64
|
direction: IDirection;
|
|
@@ -71,9 +71,11 @@ export interface ListItemsProps<T = ListItemData> {
|
|
|
71
71
|
nodatamessage: string;
|
|
72
72
|
ondemandmessage: string;
|
|
73
73
|
loadingicon: string;
|
|
74
|
+
loadingiconurl?: string;
|
|
74
75
|
loadingdatamsg: string;
|
|
75
76
|
paginationclass: string;
|
|
76
77
|
isLoadingMore: boolean;
|
|
78
|
+
prefabName?: string;
|
|
77
79
|
collapsible: boolean;
|
|
78
80
|
showcount: boolean;
|
|
79
81
|
groupCollapsed: Record<string, boolean>;
|
|
@@ -102,6 +104,8 @@ export interface ListHeaderProps {
|
|
|
102
104
|
title?: string;
|
|
103
105
|
subheading?: string;
|
|
104
106
|
iconclass?: string;
|
|
107
|
+
iconurl?: string;
|
|
108
|
+
prefabName?: string;
|
|
105
109
|
}
|
|
106
110
|
export interface ListTemplateProps {
|
|
107
111
|
children: React.ReactNode;
|
|
@@ -128,9 +132,11 @@ export interface LoadMoreButtonProps {
|
|
|
128
132
|
paginationclass: string;
|
|
129
133
|
isLoadingMore: boolean;
|
|
130
134
|
loadingicon: string;
|
|
135
|
+
loadingiconurl?: string;
|
|
131
136
|
loadingdatamsg: string;
|
|
132
137
|
ondemandmessage: string;
|
|
133
138
|
onLoadMore: () => void;
|
|
139
|
+
prefabName?: string;
|
|
134
140
|
}
|
|
135
141
|
export interface GroupHeaderProps {
|
|
136
142
|
groupKey: string;
|
|
@@ -155,7 +161,7 @@ export interface ListItemWithTemplateProps<T extends ListItemData = ListItemData
|
|
|
155
161
|
itemId: string;
|
|
156
162
|
isFirst: boolean;
|
|
157
163
|
isLast: boolean;
|
|
158
|
-
disableitem:
|
|
164
|
+
disableitem: DisableItemProp<T>;
|
|
159
165
|
itemclass: string | ((item: T, index?: number) => string | null | undefined);
|
|
160
166
|
itemsPerRowClass: string;
|
|
161
167
|
name: string;
|
|
@@ -177,7 +183,7 @@ export interface StandardListItemsProps<T extends ListItemData = ListItemData> {
|
|
|
177
183
|
currentPageItems: CurrentPageItemsResult<T>;
|
|
178
184
|
direction: string;
|
|
179
185
|
enablereorder: boolean;
|
|
180
|
-
disableitem:
|
|
186
|
+
disableitem: DisableItemProp<T>;
|
|
181
187
|
itemclass: string | ((item: T, index?: number) => string | null | undefined);
|
|
182
188
|
itemsPerRowClass: string;
|
|
183
189
|
name: string;
|
|
@@ -198,7 +204,7 @@ export interface GroupedListItemsProps<T extends ListItemData = ListItemData> {
|
|
|
198
204
|
groupedData: GroupedDataItem<T>[];
|
|
199
205
|
paginatedGroupedData: PaginatedGroupedDataItem<T>[];
|
|
200
206
|
direction: string;
|
|
201
|
-
disableitem:
|
|
207
|
+
disableitem: DisableItemProp<T>;
|
|
202
208
|
itemclass: string | ((item: T, index?: number) => string | null | undefined);
|
|
203
209
|
itemsPerRowClass: string;
|
|
204
210
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DefaultEventHandler, IPaginationMeta } from "../components/props";
|
|
3
|
-
import { WmListProps, ListItemData, ListPaginationChangeHandler, ListSetRecordHandler, ListItemEventHandler, ListSelectHandler } from "../props";
|
|
3
|
+
import { WmListProps, DisableItemProp, ListItemData, ListPaginationChangeHandler, ListSetRecordHandler, ListItemEventHandler, ListSelectHandler } from "../props";
|
|
4
4
|
export interface GroupedDataItem<T = ListItemData> {
|
|
5
5
|
key: string;
|
|
6
6
|
data: T[];
|
|
@@ -11,7 +11,7 @@ export type UseListDataProps<T = ListItemData> = Pick<WmListProps<T>, "datafield
|
|
|
11
11
|
export interface UseListEventHandlersProps<T extends ListItemData = ListItemData> {
|
|
12
12
|
items: T[];
|
|
13
13
|
multiselect: boolean;
|
|
14
|
-
disableitem:
|
|
14
|
+
disableitem: DisableItemProp<T>;
|
|
15
15
|
selectionlimit: number;
|
|
16
16
|
collapsible: boolean;
|
|
17
17
|
selectedItems: T[];
|
|
@@ -112,7 +112,7 @@ const useListEffects = (props) => {
|
|
|
112
112
|
selectPageSize: (size) => widgetMethodsRef.current.selectPageSize(size)
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
}, [name, showNavigation, items]);
|
|
115
|
+
}, [name, showNavigation, items == null ? void 0 : items.length]);
|
|
116
116
|
useEffect(() => {
|
|
117
117
|
if ((listener == null ? void 0 : listener.onChange) && props.navigation !== LIST_NAVIGATION_TYPES.NONE) {
|
|
118
118
|
listener.onChange(name, {
|
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { useCallback, useRef, useEffect } from "react";
|
|
21
21
|
import { findIndex, includes, filter, slice, min, max } from "lodash-es";
|
|
22
|
-
import { getSelectedItemWidgets } from "../utils/list-helpers";
|
|
22
|
+
import { getSelectedItemWidgets, resolveDisableItem } from "../utils/list-helpers";
|
|
23
23
|
import { useWidgetProxy } from "../../../../context/WidgetProvider";
|
|
24
24
|
import { setWidgetIndex, setWidgetPageIndex, setWidgetItem } from "../utils/widget-instance-utils";
|
|
25
25
|
const useListEventHandlers = (props) => {
|
|
@@ -82,7 +82,8 @@ const useListEventHandlers = (props) => {
|
|
|
82
82
|
);
|
|
83
83
|
const handleListItemClick = useCallback(
|
|
84
84
|
(event, item) => {
|
|
85
|
-
|
|
85
|
+
const itemIndex = findIndex(items, (i) => i === item);
|
|
86
|
+
if (resolveDisableItem(disableitem, item, itemIndex)) return;
|
|
86
87
|
const selectCount = selectedItems.length;
|
|
87
88
|
const isItemSelected = includes(selectedItems, item);
|
|
88
89
|
const isItemActive = activeItems.has(item);
|
|
@@ -8,10 +8,11 @@ declare const WmListStandalone: React.ComponentType<{
|
|
|
8
8
|
dataset?: any;
|
|
9
9
|
datasource?: import("../../../variables/live-variable").LiveVariableConfig;
|
|
10
10
|
direction?: import("./props").IDirection;
|
|
11
|
-
disableitem?:
|
|
11
|
+
disableitem?: import("./props").DisableItemProp<ListItemData>;
|
|
12
12
|
enablereorder?: boolean;
|
|
13
13
|
groupby?: string;
|
|
14
14
|
iconclass?: string;
|
|
15
|
+
iconurl?: string;
|
|
15
16
|
itemclass?: string | ((item: ListItemData) => string | null | undefined);
|
|
16
17
|
itemsperrow?: string;
|
|
17
18
|
listclass?: string;
|
|
@@ -21,6 +22,7 @@ declare const WmListStandalone: React.ComponentType<{
|
|
|
21
22
|
loadingdatamsg?: string;
|
|
22
23
|
skeletonRows?: number;
|
|
23
24
|
loadingicon?: string;
|
|
25
|
+
loadingiconurl?: string;
|
|
24
26
|
maxsize?: number;
|
|
25
27
|
statehandler?: StorageType;
|
|
26
28
|
navigation?: import("./props").INavigation;
|
|
@@ -115,6 +117,7 @@ declare const WmListStandalone: React.ComponentType<{
|
|
|
115
117
|
formfield?: boolean;
|
|
116
118
|
updateon?: string;
|
|
117
119
|
showSkeleton?: boolean;
|
|
120
|
+
widget?: string;
|
|
118
121
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
119
122
|
export { WmListStandalone as WmList };
|
|
120
123
|
/**
|
|
@@ -178,5 +181,6 @@ declare const _default: React.ComponentType<{
|
|
|
178
181
|
prefabName?: string;
|
|
179
182
|
loading?: boolean;
|
|
180
183
|
showSkeleton?: boolean;
|
|
184
|
+
widget?: string;
|
|
181
185
|
}>;
|
|
182
186
|
export default _default;
|
|
@@ -37,7 +37,7 @@ import { AppSpinner } from "../../common";
|
|
|
37
37
|
import {
|
|
38
38
|
WmSkeleton,
|
|
39
39
|
SKELETON_REGISTRY,
|
|
40
|
-
|
|
40
|
+
useShouldShowSkeleton
|
|
41
41
|
} from "../../common/wm-skeleton";
|
|
42
42
|
import {
|
|
43
43
|
useListData,
|
|
@@ -56,8 +56,7 @@ import {
|
|
|
56
56
|
LIST_DEFAULTS,
|
|
57
57
|
LIST_MESSAGES,
|
|
58
58
|
LIST_ALIGN,
|
|
59
|
-
LIST_DIRECTION
|
|
60
|
-
INSETION_POSITION
|
|
59
|
+
LIST_DIRECTION
|
|
61
60
|
} from "./utils/constants";
|
|
62
61
|
import {
|
|
63
62
|
getItemsPerRowClass,
|
|
@@ -122,9 +121,11 @@ const WmList = (props) => {
|
|
|
122
121
|
title = "",
|
|
123
122
|
subheading = "",
|
|
124
123
|
iconclass = "",
|
|
124
|
+
iconurl,
|
|
125
125
|
nodatamessage = LIST_MESSAGES.NO_DATA,
|
|
126
126
|
loadingdatamsg = LIST_MESSAGES.LOADING,
|
|
127
|
-
loadingicon = "fa-
|
|
127
|
+
loadingicon = "fa fa-circle-o-notch",
|
|
128
|
+
loadingiconurl,
|
|
128
129
|
ondemandmessage = LIST_MESSAGES.LOAD_MORE,
|
|
129
130
|
// Styling Classes
|
|
130
131
|
listclass = "list-group media-list",
|
|
@@ -467,7 +468,16 @@ const WmList = (props) => {
|
|
|
467
468
|
}, [datasource]);
|
|
468
469
|
useLayoutSize(ListWrapperRef, props.layoutWidth, props.layoutHeight);
|
|
469
470
|
const showHorizontalScrollSentinel = showNavigation && navigation === LIST_NAVIGATION_TYPES.SCROLL && (direction === LIST_DIRECTION.HORIZONTAL || direction === "row");
|
|
470
|
-
const hostAutoLayoutPrefixes = [
|
|
471
|
+
const hostAutoLayoutPrefixes = [
|
|
472
|
+
"wm-pos-",
|
|
473
|
+
"wm-top",
|
|
474
|
+
"wm-bottom",
|
|
475
|
+
"wm-left",
|
|
476
|
+
"wm-right",
|
|
477
|
+
"wm-zi-",
|
|
478
|
+
"wm-w-",
|
|
479
|
+
"wm-h-"
|
|
480
|
+
];
|
|
471
481
|
const wrapper_autoLayout_Classes = useMemo(
|
|
472
482
|
() => filterAutoLayoutClasses(layoutClassName, hostAutoLayoutPrefixes),
|
|
473
483
|
[layoutClassName]
|
|
@@ -490,7 +500,7 @@ const WmList = (props) => {
|
|
|
490
500
|
}),
|
|
491
501
|
[direction, wrap, alignment, gap, columngap]
|
|
492
502
|
);
|
|
493
|
-
if (
|
|
503
|
+
if (useShouldShowSkeleton(props.loading, props.showSkeleton))
|
|
494
504
|
return /* @__PURE__ */ jsx(
|
|
495
505
|
WmSkeleton,
|
|
496
506
|
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmList"]), {
|
|
@@ -515,7 +525,16 @@ const WmList = (props) => {
|
|
|
515
525
|
"data-navigation": navigation,
|
|
516
526
|
ref: ListWrapperRef,
|
|
517
527
|
children: [
|
|
518
|
-
/* @__PURE__ */ jsx(
|
|
528
|
+
/* @__PURE__ */ jsx(
|
|
529
|
+
ListHeader,
|
|
530
|
+
{
|
|
531
|
+
title,
|
|
532
|
+
subheading,
|
|
533
|
+
iconclass,
|
|
534
|
+
iconurl,
|
|
535
|
+
prefabName: props.prefabName
|
|
536
|
+
}
|
|
537
|
+
),
|
|
519
538
|
/* @__PURE__ */ jsx(AppSpinner, { show: (_e = datasource == null ? void 0 : datasource.loading) != null ? _e : false, spinnermessages: [loadingdatamsg] }),
|
|
520
539
|
/* @__PURE__ */ jsxs(
|
|
521
540
|
InlineNavigation,
|
|
@@ -570,9 +589,11 @@ const WmList = (props) => {
|
|
|
570
589
|
nodatamessage,
|
|
571
590
|
ondemandmessage,
|
|
572
591
|
loadingicon,
|
|
592
|
+
loadingiconurl,
|
|
573
593
|
loadingdatamsg,
|
|
574
594
|
paginationclass,
|
|
575
595
|
isLoadingMore: listState.isLoadingMore,
|
|
596
|
+
prefabName: props.prefabName,
|
|
576
597
|
collapsible,
|
|
577
598
|
showcount,
|
|
578
599
|
groupCollapsed: listState.groupCollapsed,
|
|
@@ -25,6 +25,10 @@ export type IColumnAlignment = "start" | "center" | "end";
|
|
|
25
25
|
export type ListItemData = Record<string, unknown> & {
|
|
26
26
|
_wmListItemId?: string;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Per-item disable flag: static boolean or callback evaluated per list row.
|
|
30
|
+
*/
|
|
31
|
+
export type DisableItemProp<T = ListItemData> = boolean | ((item: T, index: number) => boolean);
|
|
28
32
|
export type ListItemEventHandler = (event: React.MouseEvent, widget: unknown) => void;
|
|
29
33
|
export type ListPageEventHandler = (event: React.MouseEvent | null, page: number) => void;
|
|
30
34
|
export type ListReorderEventHandler<T = ListItemData> = (event: React.MouseEvent | null, data: T[], changedItem: T) => void;
|
|
@@ -64,9 +68,9 @@ export interface ListProps<T = ListItemData> {
|
|
|
64
68
|
*/
|
|
65
69
|
direction?: IDirection;
|
|
66
70
|
/**
|
|
67
|
-
* Whether to disable list items.
|
|
71
|
+
* Whether to disable list items (boolean or per-item callback).
|
|
68
72
|
*/
|
|
69
|
-
disableitem?:
|
|
73
|
+
disableitem?: DisableItemProp<T>;
|
|
70
74
|
/**
|
|
71
75
|
* Whether to enable reordering of list items.
|
|
72
76
|
*/
|
|
@@ -79,6 +83,10 @@ export interface ListProps<T = ListItemData> {
|
|
|
79
83
|
* CSS class for the list icon.
|
|
80
84
|
*/
|
|
81
85
|
iconclass?: string;
|
|
86
|
+
/**
|
|
87
|
+
* URL for the list icon (.svg renders inline, other URLs as image).
|
|
88
|
+
*/
|
|
89
|
+
iconurl?: string;
|
|
82
90
|
/**
|
|
83
91
|
* CSS class or function returning a class for each list item.
|
|
84
92
|
*/
|
|
@@ -116,6 +124,10 @@ export interface ListProps<T = ListItemData> {
|
|
|
116
124
|
* CSS class for the loading icon.
|
|
117
125
|
*/
|
|
118
126
|
loadingicon?: string;
|
|
127
|
+
/**
|
|
128
|
+
* URL for the loading icon (.svg renders inline, other URLs as image).
|
|
129
|
+
*/
|
|
130
|
+
loadingiconurl?: string;
|
|
119
131
|
/**
|
|
120
132
|
* Maximum size of the collection.
|
|
121
133
|
*/
|
|
@@ -56,12 +56,10 @@ const DEFAULT_PAGINATION_META = {
|
|
|
56
56
|
number: 0,
|
|
57
57
|
empty: true
|
|
58
58
|
};
|
|
59
|
-
const INSETION_POSITION = ["top", "bottom", "left", "right"];
|
|
60
59
|
export {
|
|
61
60
|
APP_LOCALE,
|
|
62
61
|
DEFAULT_CLS,
|
|
63
62
|
DEFAULT_PAGINATION_META,
|
|
64
|
-
INSETION_POSITION,
|
|
65
63
|
LIST_ALIGN,
|
|
66
64
|
LIST_DEFAULTS,
|
|
67
65
|
LIST_DIRECTION,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAlignment, IDirection, ListItemData } from "../props";
|
|
1
|
+
import { DisableItemProp, IAlignment, IDirection, ListItemData } from "../props";
|
|
2
2
|
import { StorageType } from "@wavemaker-ai/react-runtime/utils/state-persistance";
|
|
3
3
|
/**
|
|
4
4
|
* Get items per row CSS classes based on configuration
|
|
@@ -20,6 +20,10 @@ export declare function hasListGroupAutoLayoutClass(layoutProps: {
|
|
|
20
20
|
gap?: unknown;
|
|
21
21
|
columngap?: unknown;
|
|
22
22
|
}): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves disableitem prop to a boolean for a single list row.
|
|
25
|
+
*/
|
|
26
|
+
export declare const resolveDisableItem: <T extends ListItemData>(disableitem: DisableItemProp<T> | undefined, item: T, index: number) => boolean;
|
|
23
27
|
/**
|
|
24
28
|
* Get safe dataset ensuring it's always an array
|
|
25
29
|
* @param dataset - Input dataset of any type
|