@wavemaker-ai/react-runtime 1.0.0-rc.322 → 1.0.0-rc.324
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 +16 -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/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/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/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-field/index.js +5 -4
- 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 +5 -1
- 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/useListEventHandlers.js +3 -2
- package/components/data/list/index.d.ts +5 -1
- package/components/data/list/index.js +17 -4
- package/components/data/list/props.d.ts +14 -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 +1 -1
- package/components/data/table/components/TableDataRow.js +16 -3
- package/components/data/table/components/TableHeader.js +1 -1
- package/components/data/table/components/TablePanelHeading.js +14 -2
- package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
- package/components/data/table/hooks/useTableColumns.js +2 -2
- package/components/data/table/hooks/useTableData.js +30 -1
- package/components/data/table/index.d.ts +4 -0
- package/components/data/table/index.js +47 -30
- package/components/data/table/live-table/index.d.ts +1 -0
- package/components/data/table/props.d.ts +11 -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 +97 -71
- package/components/data/table/utils/columnBuilder.d.ts +13 -0
- package/components/data/table/utils/columnBuilder.js +27 -18
- package/components/data/table/utils/columnWidthDistribution.d.ts +1 -1
- package/components/data/table/utils/columnWidthDistribution.js +4 -1
- package/components/data/table/utils/constants.d.ts +1 -1
- package/components/data/table/utils/constants.js +1 -1
- 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-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/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/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 +9 -4
- 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 +8 -2
- package/components/page/partial/index.d.ts +1 -0
- 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.js +1 -1
- package/core/util/index.d.ts +2 -0
- package/core/util/index.js +29 -0
- package/higherOrder/BasePage.js +81 -26
- package/higherOrder/props.d.ts +1 -0
- package/higherOrder/useActivePageReactivity.d.ts +21 -0
- package/higherOrder/useActivePageReactivity.js +57 -0
- package/higherOrder/withBaseWrapper.js +2 -0
- package/higherOrder/withRenderLogger.d.ts +15 -0
- package/higherOrder/withRenderLogger.js +53 -0
- package/hooks/useAuth.js +7 -1
- package/package-lock.json +219 -198
- package/package.json +4 -3
- package/runtime-dynamic/factories/dynamic-component.js +18 -5
- package/runtime-dynamic/factories/utils.js +7 -1
- package/runtime-dynamic/services/compile-render.js +2 -1
- 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/svg-icon.d.ts +27 -0
- package/utils/svg-icon.js +75 -0
|
@@ -25,10 +25,13 @@ import { getButtonClasses } from "../utils";
|
|
|
25
25
|
import WmMenu from "../../../navigation/menu";
|
|
26
26
|
import { DataSource } from "../../types";
|
|
27
27
|
import { isEmpty, values } from "lodash";
|
|
28
|
+
import { WmAppIcon } from "../../../common/WmAppIcon";
|
|
28
29
|
const TablePanelHeadingComponent = ({
|
|
29
30
|
title,
|
|
30
31
|
subheading,
|
|
31
32
|
iconclass,
|
|
33
|
+
iconurl,
|
|
34
|
+
prefabName,
|
|
32
35
|
exportformat = [],
|
|
33
36
|
headerActions,
|
|
34
37
|
spacing = "normal",
|
|
@@ -121,7 +124,16 @@ const TablePanelHeadingComponent = ({
|
|
|
121
124
|
[datasource, columns, sortInfo, filterInfo, exportdatasize, onBeforeExport, listener]
|
|
122
125
|
);
|
|
123
126
|
return /* @__PURE__ */ jsx(Box, { className: "panel-heading", children: /* @__PURE__ */ jsxs(Box, { component: "h3", className: "panel-title", children: [
|
|
124
|
-
/* @__PURE__ */ jsx(Box, { className: "pull-left", children:
|
|
127
|
+
/* @__PURE__ */ jsx(Box, { className: "pull-left", children: /* @__PURE__ */ jsx(
|
|
128
|
+
WmAppIcon,
|
|
129
|
+
{
|
|
130
|
+
iconclass,
|
|
131
|
+
iconurl,
|
|
132
|
+
prefabName,
|
|
133
|
+
defaultClasses: iconurl ? "panel-image-icon" : "panel-icon",
|
|
134
|
+
alt: "Table icon"
|
|
135
|
+
}
|
|
136
|
+
) }),
|
|
125
137
|
/* @__PURE__ */ jsxs(Box, { className: "pull-left", children: [
|
|
126
138
|
title && /* @__PURE__ */ jsx(Box, { component: "div", className: "heading", children: title }),
|
|
127
139
|
subheading && /* @__PURE__ */ jsx(Box, { component: "div", className: "description", children: subheading })
|
|
@@ -171,7 +183,7 @@ const TablePanelHeadingComponent = ({
|
|
|
171
183
|
};
|
|
172
184
|
TablePanelHeadingComponent.displayName = "TablePanelHeading";
|
|
173
185
|
const TablePanelHeading = memo(TablePanelHeadingComponent, (prevProps, nextProps) => {
|
|
174
|
-
return prevProps.title === nextProps.title && prevProps.subheading === nextProps.subheading && prevProps.iconclass === nextProps.iconclass && prevProps.exportformat === nextProps.exportformat && prevProps.headerActions === nextProps.headerActions && prevProps.spacing === nextProps.spacing && prevProps.isGridEditMode === nextProps.isGridEditMode && prevProps.isLoading === nextProps.isLoading && prevProps.listener === nextProps.listener && prevProps.datasource === nextProps.datasource && prevProps.columns === nextProps.columns && prevProps.sortInfo === nextProps.sortInfo && prevProps.filterInfo === nextProps.filterInfo && prevProps.exportdatasize === nextProps.exportdatasize && prevProps.onBeforeExport === nextProps.onBeforeExport;
|
|
186
|
+
return prevProps.title === nextProps.title && prevProps.subheading === nextProps.subheading && prevProps.iconclass === nextProps.iconclass && prevProps.iconurl === nextProps.iconurl && prevProps.exportformat === nextProps.exportformat && prevProps.headerActions === nextProps.headerActions && prevProps.spacing === nextProps.spacing && prevProps.isGridEditMode === nextProps.isGridEditMode && prevProps.isLoading === nextProps.isLoading && prevProps.listener === nextProps.listener && prevProps.datasource === nextProps.datasource && prevProps.columns === nextProps.columns && prevProps.sortInfo === nextProps.sortInfo && prevProps.filterInfo === nextProps.filterInfo && prevProps.exportdatasize === nextProps.exportdatasize && prevProps.onBeforeExport === nextProps.onBeforeExport;
|
|
175
187
|
});
|
|
176
188
|
export {
|
|
177
189
|
TablePanelHeading
|
|
@@ -208,9 +208,9 @@ const useTableColumns = ({
|
|
|
208
208
|
const rowId = ((_a = row == null ? void 0 : row.original) == null ? void 0 : _a._wmTableRowId) || (row == null ? void 0 : row.id);
|
|
209
209
|
const isEditingThisRow = isRowEditing(rowId);
|
|
210
210
|
const shouldRenderEditableCell = (editmode === "inline" || editmode === "quickedit") && isEditingThisRow && !wmColumn.readonly;
|
|
211
|
-
return /* @__PURE__ */ jsx(
|
|
211
|
+
return /* @__PURE__ */ jsx("span", { "data-col-identifier": wmColumn.field, children: shouldRenderEditableCell ? renderEditableCell(wmColumn, row.original, rowId) : renderDisplayCell(wmColumn, row.original, listener, cellState) });
|
|
212
212
|
},
|
|
213
|
-
[editmode,
|
|
213
|
+
[editmode, isRowEditing, renderEditableCell, cellState, listener]
|
|
214
214
|
);
|
|
215
215
|
const filteredRowActions = useMemo(() => {
|
|
216
216
|
if (editmode === "quickedit") {
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
import React, { useState, useCallback, useRef, useMemo, useEffect } from "react";
|
|
2
21
|
import { isEqual } from "lodash-es";
|
|
3
22
|
import { addUniqueRowIds, extractDataArray, TABLE_MESSAGES, INTERNAL_PROPERTIES } from "../utils";
|
|
@@ -39,8 +58,18 @@ const useTableData = ({
|
|
|
39
58
|
listener,
|
|
40
59
|
widgetName
|
|
41
60
|
}) => {
|
|
61
|
+
const rowIdCacheRef = useRef([]);
|
|
42
62
|
const processedDataset = useMemo(() => {
|
|
43
|
-
const
|
|
63
|
+
const extracted = extractDataArray(dataset);
|
|
64
|
+
const cachedIds = rowIdCacheRef.current;
|
|
65
|
+
const prestamped = extracted.map((item, i) => {
|
|
66
|
+
if (!item || typeof item !== "object" || item._wmTableRowId || item.id || item.ID || item.Id || !cachedIds[i]) {
|
|
67
|
+
return item;
|
|
68
|
+
}
|
|
69
|
+
return __spreadProps(__spreadValues({}, item), { _wmTableRowId: cachedIds[i] });
|
|
70
|
+
});
|
|
71
|
+
const withIds = addUniqueRowIds(prestamped);
|
|
72
|
+
rowIdCacheRef.current = withIds.map((r) => r == null ? void 0 : r._wmTableRowId);
|
|
44
73
|
return removeEmptyRecords(withIds);
|
|
45
74
|
}, [dataset]);
|
|
46
75
|
const [internalDataset, setInternalDataset] = useState(processedDataset);
|
|
@@ -26,6 +26,7 @@ declare const WmTableStandalone: React.ComponentType<{
|
|
|
26
26
|
title?: string;
|
|
27
27
|
subheading?: string;
|
|
28
28
|
iconclass?: string;
|
|
29
|
+
iconurl?: string;
|
|
29
30
|
dataset?: any;
|
|
30
31
|
navigation?: import("../list/props").INavigation;
|
|
31
32
|
isdynamictable?: boolean;
|
|
@@ -141,6 +142,7 @@ declare const WmTableStandalone: React.ComponentType<{
|
|
|
141
142
|
prefabName?: string;
|
|
142
143
|
loading?: boolean;
|
|
143
144
|
showSkeleton?: boolean;
|
|
145
|
+
widget?: string;
|
|
144
146
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
145
147
|
export { WmTableStandalone as WmTable };
|
|
146
148
|
declare const WmTable: React.ComponentType<{
|
|
@@ -167,6 +169,7 @@ declare const WmTable: React.ComponentType<{
|
|
|
167
169
|
title?: string;
|
|
168
170
|
subheading?: string;
|
|
169
171
|
iconclass?: string;
|
|
172
|
+
iconurl?: string;
|
|
170
173
|
dataset?: any;
|
|
171
174
|
navigation?: import("../list/props").INavigation;
|
|
172
175
|
isdynamictable?: boolean;
|
|
@@ -282,6 +285,7 @@ declare const WmTable: React.ComponentType<{
|
|
|
282
285
|
prefabName?: string;
|
|
283
286
|
loading?: boolean;
|
|
284
287
|
showSkeleton?: boolean;
|
|
288
|
+
widget?: string;
|
|
285
289
|
}>;
|
|
286
290
|
/**
|
|
287
291
|
* The WmTable component is used to display data in a tabular format.
|
|
@@ -35,6 +35,7 @@ import React, {
|
|
|
35
35
|
memo,
|
|
36
36
|
useCallback,
|
|
37
37
|
useEffect,
|
|
38
|
+
useLayoutEffect,
|
|
38
39
|
useMemo,
|
|
39
40
|
useState,
|
|
40
41
|
useRef
|
|
@@ -42,7 +43,7 @@ import React, {
|
|
|
42
43
|
import {
|
|
43
44
|
WmSkeleton,
|
|
44
45
|
SKELETON_REGISTRY,
|
|
45
|
-
|
|
46
|
+
useShouldShowSkeleton
|
|
46
47
|
} from "../../common/wm-skeleton";
|
|
47
48
|
import {
|
|
48
49
|
useReactTable,
|
|
@@ -134,6 +135,7 @@ const WmTableComponent = memo(
|
|
|
134
135
|
title,
|
|
135
136
|
subheading,
|
|
136
137
|
iconclass,
|
|
138
|
+
iconurl,
|
|
137
139
|
exportOptions = [],
|
|
138
140
|
shownavigation = true,
|
|
139
141
|
onDemandLoad = false,
|
|
@@ -214,6 +216,7 @@ const WmTableComponent = memo(
|
|
|
214
216
|
"title",
|
|
215
217
|
"subheading",
|
|
216
218
|
"iconclass",
|
|
219
|
+
"iconurl",
|
|
217
220
|
"exportOptions",
|
|
218
221
|
"shownavigation",
|
|
219
222
|
"onDemandLoad",
|
|
@@ -683,11 +686,9 @@ const WmTableComponent = memo(
|
|
|
683
686
|
const selectionColumn = buildSelectionColumns({
|
|
684
687
|
useRadioSelect,
|
|
685
688
|
useMultiSelect,
|
|
686
|
-
selectedRowIds,
|
|
687
689
|
handleRadioSelection,
|
|
688
690
|
handleMultiSelection,
|
|
689
691
|
handleSelectAll,
|
|
690
|
-
internalDataset,
|
|
691
692
|
radioselecttitle,
|
|
692
693
|
radioselectarialabel,
|
|
693
694
|
multiselecttitle,
|
|
@@ -702,8 +703,6 @@ const WmTableComponent = memo(
|
|
|
702
703
|
baseColumns,
|
|
703
704
|
useRadioSelect,
|
|
704
705
|
useMultiSelect,
|
|
705
|
-
selectedRowIds,
|
|
706
|
-
internalDataset,
|
|
707
706
|
handleRadioSelection,
|
|
708
707
|
handleMultiSelection,
|
|
709
708
|
handleSelectAll,
|
|
@@ -758,6 +757,20 @@ const WmTableComponent = memo(
|
|
|
758
757
|
columnSource: columnsProxy,
|
|
759
758
|
listenerRef
|
|
760
759
|
});
|
|
760
|
+
const [pendingDatarender, setPendingDatarender] = useState(false);
|
|
761
|
+
const queueOnDatarenderAfterPaint = useCallback(() => {
|
|
762
|
+
if (!onDatarender) return;
|
|
763
|
+
setPendingDatarender(true);
|
|
764
|
+
}, [onDatarender]);
|
|
765
|
+
const invokeOnDatarender = useCallback(() => {
|
|
766
|
+
var _a2;
|
|
767
|
+
if (!onDatarender) return;
|
|
768
|
+
if (name && (listener == null ? void 0 : listener.Widgets[name]) && tableContainerRef.current) {
|
|
769
|
+
listener.Widgets[name].nativeElement = tableContainerRef.current;
|
|
770
|
+
}
|
|
771
|
+
const data = internalDataset;
|
|
772
|
+
onDatarender((_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name], { $data: data, data });
|
|
773
|
+
}, [onDatarender, name]);
|
|
761
774
|
columnsStateRef.current = columns;
|
|
762
775
|
const columnsForTable = useMemo(() => {
|
|
763
776
|
const base = columnsStateRef.current || [];
|
|
@@ -766,7 +779,7 @@ const WmTableComponent = memo(
|
|
|
766
779
|
const override = field ? columnOverrides[field] || {} : {};
|
|
767
780
|
return __spreadValues(__spreadValues(__spreadValues({}, col), override), Object.keys(override).length > 0 ? { meta: __spreadValues(__spreadValues({}, col.meta), override) } : {});
|
|
768
781
|
});
|
|
769
|
-
}, [columns, columnOverrides, columnsVersion
|
|
782
|
+
}, [columns, columnOverrides, columnsVersion]);
|
|
770
783
|
const ColClassSignature = useMemo(() => {
|
|
771
784
|
try {
|
|
772
785
|
return (columnsForTable || []).map((col) => {
|
|
@@ -1086,11 +1099,18 @@ const WmTableComponent = memo(
|
|
|
1086
1099
|
prevPageIndexRef.current = currentPageIndex;
|
|
1087
1100
|
if (!isEqual(prevDatasetRef.current, internalDataset)) {
|
|
1088
1101
|
prevDatasetRef.current = internalDataset;
|
|
1102
|
+
const data = internalDataset.map((row) => {
|
|
1103
|
+
if (row && typeof row === "object") {
|
|
1104
|
+
const _a3 = row, { _wmTableRowId, getProperty } = _a3, rest2 = __objRest(_a3, ["_wmTableRowId", "getProperty"]);
|
|
1105
|
+
return rest2;
|
|
1106
|
+
}
|
|
1107
|
+
return row;
|
|
1108
|
+
});
|
|
1089
1109
|
if (onBeforedatarender) {
|
|
1090
1110
|
onBeforedatarender(
|
|
1091
1111
|
(_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name],
|
|
1092
1112
|
// widget reference
|
|
1093
|
-
|
|
1113
|
+
data,
|
|
1094
1114
|
// data
|
|
1095
1115
|
columnsProxy
|
|
1096
1116
|
// columns (including dynamic ones)
|
|
@@ -1099,28 +1119,17 @@ const WmTableComponent = memo(
|
|
|
1099
1119
|
(key) => columnsProxy[key].customExpression
|
|
1100
1120
|
);
|
|
1101
1121
|
if (customExprKeys.length > 0) {
|
|
1102
|
-
void mergeParsedCustomColumns().finally(
|
|
1103
|
-
|
|
1122
|
+
void mergeParsedCustomColumns().finally(queueOnDatarenderAfterPaint);
|
|
1123
|
+
} else {
|
|
1124
|
+
queueOnDatarenderAfterPaint();
|
|
1104
1125
|
}
|
|
1105
1126
|
const nextRows = internalDataset.map(
|
|
1106
1127
|
(r) => typeof r === "object" && r !== null ? __spreadValues({}, r) : r
|
|
1107
1128
|
);
|
|
1108
1129
|
setInternalDataset(nextRows);
|
|
1130
|
+
} else if (onDatarender) {
|
|
1131
|
+
queueOnDatarenderAfterPaint();
|
|
1109
1132
|
}
|
|
1110
|
-
requestAnimationFrame(() => {
|
|
1111
|
-
var _a3;
|
|
1112
|
-
if (onDatarender) {
|
|
1113
|
-
if (name && (listener == null ? void 0 : listener.Widgets[name]) && tableContainerRef.current) {
|
|
1114
|
-
listener.Widgets[name].nativeElement = tableContainerRef.current;
|
|
1115
|
-
}
|
|
1116
|
-
onDatarender(
|
|
1117
|
-
(_a3 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a3[name],
|
|
1118
|
-
// widget reference to match Angular format
|
|
1119
|
-
{ $data: internalDataset, data: internalDataset }
|
|
1120
|
-
// match Angular's format with both $data and data
|
|
1121
|
-
);
|
|
1122
|
-
}
|
|
1123
|
-
});
|
|
1124
1133
|
}
|
|
1125
1134
|
}
|
|
1126
1135
|
}, [
|
|
@@ -1133,8 +1142,14 @@ const WmTableComponent = memo(
|
|
|
1133
1142
|
table.getState().pagination.pageIndex,
|
|
1134
1143
|
setInternalDataset,
|
|
1135
1144
|
columnsProxy,
|
|
1136
|
-
mergeParsedCustomColumns
|
|
1145
|
+
mergeParsedCustomColumns,
|
|
1146
|
+
queueOnDatarenderAfterPaint
|
|
1137
1147
|
]);
|
|
1148
|
+
useLayoutEffect(() => {
|
|
1149
|
+
if (!onDatarender || !pendingDatarender) return;
|
|
1150
|
+
setPendingDatarender(false);
|
|
1151
|
+
invokeOnDatarender();
|
|
1152
|
+
}, [pendingDatarender, invokeOnDatarender, onDatarender]);
|
|
1138
1153
|
useEffect(() => {
|
|
1139
1154
|
if (!onBeforedatarender) return;
|
|
1140
1155
|
if (internalDataset.length === 0) return;
|
|
@@ -1404,10 +1419,10 @@ const WmTableComponent = memo(
|
|
|
1404
1419
|
const headerGroups = table.getHeaderGroups();
|
|
1405
1420
|
const leafHeaderGroup = headerGroups.length ? headerGroups[headerGroups.length - 1] : void 0;
|
|
1406
1421
|
const leafHeaders = ((leafHeaderGroup == null ? void 0 : leafHeaderGroup.headers) || []).filter((h) => !h.isPlaceholder);
|
|
1407
|
-
const base = leafHeaders.map((h) =>
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
})
|
|
1422
|
+
const base = leafHeaders.map((h) => {
|
|
1423
|
+
const w = `${h.column.getSize()}px`;
|
|
1424
|
+
return { key: h.column.id, width: w, style: { width: w } };
|
|
1425
|
+
});
|
|
1411
1426
|
return base;
|
|
1412
1427
|
}, [table, columnSizing, columnsVersion, showheader, ColClassSignature]);
|
|
1413
1428
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1427,6 +1442,8 @@ const WmTableComponent = memo(
|
|
|
1427
1442
|
title,
|
|
1428
1443
|
subheading,
|
|
1429
1444
|
iconclass,
|
|
1445
|
+
iconurl,
|
|
1446
|
+
prefabName: props.prefabName,
|
|
1430
1447
|
exportformat,
|
|
1431
1448
|
headerActions,
|
|
1432
1449
|
spacing,
|
|
@@ -1501,7 +1518,7 @@ const WmTableComponent = memo(
|
|
|
1501
1518
|
tableName: name
|
|
1502
1519
|
}
|
|
1503
1520
|
),
|
|
1504
|
-
/* @__PURE__ */ jsx("colgroup", { children: colGroupSpec.map((c) => /* @__PURE__ */ jsx("col", { style:
|
|
1521
|
+
/* @__PURE__ */ jsx("colgroup", { children: colGroupSpec.map((c) => /* @__PURE__ */ jsx("col", { style: c.style, width: c.width }, c.key)) })
|
|
1505
1522
|
] }),
|
|
1506
1523
|
internalDataset.length > 0 && /* @__PURE__ */ jsx(
|
|
1507
1524
|
TableBodyComponent,
|
|
@@ -1664,7 +1681,7 @@ const WmTableComponent = memo(
|
|
|
1664
1681
|
);
|
|
1665
1682
|
WmTableComponent.displayName = "WmTableComponent";
|
|
1666
1683
|
const WmTableWithProvider = (props) => {
|
|
1667
|
-
if (
|
|
1684
|
+
if (useShouldShowSkeleton(props.loading, props.showSkeleton))
|
|
1668
1685
|
return /* @__PURE__ */ jsx(
|
|
1669
1686
|
WmSkeleton,
|
|
1670
1687
|
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmTable"]), {
|
|
@@ -121,6 +121,10 @@ export interface TableProps {
|
|
|
121
121
|
* CSS class for the table icon.
|
|
122
122
|
*/
|
|
123
123
|
iconclass?: string;
|
|
124
|
+
/**
|
|
125
|
+
* URL for the table icon (.svg renders inline, other URLs as image).
|
|
126
|
+
*/
|
|
127
|
+
iconurl?: string;
|
|
124
128
|
/**
|
|
125
129
|
* The collection of data items to display in the table.
|
|
126
130
|
*/
|
|
@@ -885,6 +889,8 @@ export interface TablePanelHeadingProps {
|
|
|
885
889
|
title?: string;
|
|
886
890
|
subheading?: string;
|
|
887
891
|
iconclass?: string;
|
|
892
|
+
iconurl?: string;
|
|
893
|
+
prefabName?: string;
|
|
888
894
|
exportformat?: any[];
|
|
889
895
|
headerActions: any[];
|
|
890
896
|
spacing?: TablePanelSpacing;
|
|
@@ -930,11 +936,13 @@ export interface ActionButtonConfig {
|
|
|
930
936
|
export interface BuildSelectionColumnsProps {
|
|
931
937
|
useRadioSelect: boolean;
|
|
932
938
|
useMultiSelect: boolean;
|
|
933
|
-
|
|
939
|
+
/** @deprecated Header now reads from table.getIsAllRowsSelected() — no longer used internally. */
|
|
940
|
+
selectedRowIds?: string[];
|
|
934
941
|
handleRadioSelection: (rowId: string, rowData?: any) => void;
|
|
935
942
|
handleMultiSelection: (rowId: string, rowData: any, isSelected: boolean) => void;
|
|
936
943
|
handleSelectAll: (isSelected: boolean) => void;
|
|
937
|
-
|
|
944
|
+
/** @deprecated Header now reads from table.getIsAllRowsSelected() — no longer used internally. */
|
|
945
|
+
internalDataset?: any[];
|
|
938
946
|
radioselecttitle?: string;
|
|
939
947
|
radioselectarialabel?: string;
|
|
940
948
|
multiselecttitle?: string;
|
|
@@ -1068,6 +1076,7 @@ export interface UsePanelStructureProps {
|
|
|
1068
1076
|
title?: string;
|
|
1069
1077
|
subheading?: string;
|
|
1070
1078
|
iconclass?: string;
|
|
1079
|
+
iconurl?: string;
|
|
1071
1080
|
exportformat?: any[];
|
|
1072
1081
|
headerActions: any[];
|
|
1073
1082
|
footerActions: any[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ColumnDef } from "@tanstack/react-table";
|
|
2
2
|
import { BuildSelectionColumnsProps } from "../props";
|
|
3
|
-
export declare const buildSelectionColumns: ({ useRadioSelect, useMultiSelect,
|
|
3
|
+
export declare const buildSelectionColumns: ({ useRadioSelect, useMultiSelect, handleRadioSelection, handleMultiSelection, handleSelectAll, radioselecttitle, radioselectarialabel, multiselecttitle, multiselectarialabel, tableName, }: BuildSelectionColumnsProps) => ColumnDef<any> | null;
|
|
@@ -1,49 +1,116 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Radio, Checkbox, FormControlLabel, Tooltip } from "@mui/material";
|
|
3
3
|
import { TABLE_MESSAGES } from "./constants";
|
|
4
|
+
const getSelectionMeta = (ctx) => {
|
|
5
|
+
var _a, _b, _c, _d;
|
|
6
|
+
return (_d = (_c = (_b = (_a = ctx.column) == null ? void 0 : _a.columnDef) == null ? void 0 : _b.meta) == null ? void 0 : _c.selection) != null ? _d : {};
|
|
7
|
+
};
|
|
8
|
+
function RadioSelectCell(ctx) {
|
|
9
|
+
const { row } = ctx;
|
|
10
|
+
const rowId = row.id;
|
|
11
|
+
const isSelected = row.getIsSelected();
|
|
12
|
+
const { handleRadioSelection, radioselecttitle, radioselectarialabel, tableName } = getSelectionMeta(ctx);
|
|
13
|
+
return /* @__PURE__ */ jsx(Box, { sx: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx(Tooltip, { title: radioselecttitle != null ? radioselecttitle : "", placement: "top", children: /* @__PURE__ */ jsx(Box, { className: "radio app-radio", children: /* @__PURE__ */ jsx(
|
|
14
|
+
FormControlLabel,
|
|
15
|
+
{
|
|
16
|
+
control: /* @__PURE__ */ jsx(
|
|
17
|
+
Radio,
|
|
18
|
+
{
|
|
19
|
+
checked: isSelected,
|
|
20
|
+
onChange: () => handleRadioSelection == null ? void 0 : handleRadioSelection(rowId, row.original),
|
|
21
|
+
value: rowId,
|
|
22
|
+
name: `wmRadioselect-${tableName != null ? tableName : "table"}`,
|
|
23
|
+
inputProps: {
|
|
24
|
+
"aria-label": radioselectarialabel
|
|
25
|
+
},
|
|
26
|
+
rowselectinput: "",
|
|
27
|
+
size: "small"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
label: "",
|
|
31
|
+
className: "caption"
|
|
32
|
+
}
|
|
33
|
+
) }) }) });
|
|
34
|
+
}
|
|
35
|
+
RadioSelectCell.displayName = "RadioSelectCell";
|
|
36
|
+
function MultiSelectCell(ctx) {
|
|
37
|
+
const { row } = ctx;
|
|
38
|
+
const rowId = row.id;
|
|
39
|
+
const isSelected = row.getIsSelected();
|
|
40
|
+
const { handleMultiSelection, multiselecttitle, multiselectarialabel } = getSelectionMeta(ctx);
|
|
41
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", justifyContent: "center" }, children: [
|
|
42
|
+
/* @__PURE__ */ jsx(Tooltip, { title: multiselecttitle != null ? multiselecttitle : "", placement: "top", children: /* @__PURE__ */ jsx(Box, { className: "app-checkbox checkbox", children: /* @__PURE__ */ jsx(
|
|
43
|
+
Checkbox,
|
|
44
|
+
{
|
|
45
|
+
checked: isSelected,
|
|
46
|
+
onChange: (e) => handleMultiSelection == null ? void 0 : handleMultiSelection(rowId, row.original, e.target.checked),
|
|
47
|
+
value: rowId,
|
|
48
|
+
name: "gridMultiSelect",
|
|
49
|
+
inputProps: {
|
|
50
|
+
"aria-label": multiselectarialabel,
|
|
51
|
+
role: "checkbox",
|
|
52
|
+
"aria-live": "assertive"
|
|
53
|
+
},
|
|
54
|
+
size: "small",
|
|
55
|
+
sx: {
|
|
56
|
+
padding: 0
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
) }) }),
|
|
60
|
+
isSelected ? /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "assertive", children: "Row Selected" }) : /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "assertive", children: "Row Deselected" })
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
MultiSelectCell.displayName = "MultiSelectCell";
|
|
64
|
+
function MultiSelectHeader({ table, column }) {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
const isAllSelected = table.getIsAllRowsSelected();
|
|
67
|
+
const isSomeSelected = table.getIsSomeRowsSelected();
|
|
68
|
+
const { handleSelectAll } = (_b = (_a = column.columnDef.meta) == null ? void 0 : _a.selection) != null ? _b : {};
|
|
69
|
+
return /* @__PURE__ */ jsx(Box, { sx: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx(Box, { className: "app-checkbox checkbox", children: /* @__PURE__ */ jsx(
|
|
70
|
+
Checkbox,
|
|
71
|
+
{
|
|
72
|
+
checked: isAllSelected,
|
|
73
|
+
indeterminate: isSomeSelected && !isAllSelected,
|
|
74
|
+
onChange: (e) => handleSelectAll == null ? void 0 : handleSelectAll(e.target.checked),
|
|
75
|
+
size: "small",
|
|
76
|
+
inputProps: {
|
|
77
|
+
"aria-label": "Select all rows"
|
|
78
|
+
},
|
|
79
|
+
sx: {
|
|
80
|
+
padding: 0
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
) }) });
|
|
84
|
+
}
|
|
85
|
+
MultiSelectHeader.displayName = "MultiSelectHeader";
|
|
4
86
|
const buildSelectionColumns = ({
|
|
5
87
|
useRadioSelect,
|
|
6
88
|
useMultiSelect,
|
|
7
|
-
selectedRowIds,
|
|
8
89
|
handleRadioSelection,
|
|
9
90
|
handleMultiSelection,
|
|
10
91
|
handleSelectAll,
|
|
11
|
-
internalDataset,
|
|
12
92
|
radioselecttitle = "",
|
|
13
93
|
radioselectarialabel = TABLE_MESSAGES.radioSelectAriaLabel,
|
|
14
94
|
multiselecttitle = "",
|
|
15
95
|
multiselectarialabel = TABLE_MESSAGES.multiSelectAriaLabel,
|
|
16
96
|
tableName = "table"
|
|
17
97
|
}) => {
|
|
98
|
+
const selection = {
|
|
99
|
+
handleRadioSelection,
|
|
100
|
+
handleMultiSelection,
|
|
101
|
+
handleSelectAll,
|
|
102
|
+
radioselecttitle,
|
|
103
|
+
radioselectarialabel,
|
|
104
|
+
multiselecttitle,
|
|
105
|
+
multiselectarialabel,
|
|
106
|
+
tableName
|
|
107
|
+
};
|
|
18
108
|
if (useRadioSelect) {
|
|
19
109
|
return {
|
|
20
110
|
id: "radioSelect",
|
|
21
111
|
header: () => /* @__PURE__ */ jsx(Box, { sx: { display: "flex", justifyContent: "center" } }),
|
|
22
|
-
cell:
|
|
23
|
-
|
|
24
|
-
const isSelected = row.getIsSelected();
|
|
25
|
-
return /* @__PURE__ */ jsx(Box, { sx: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx(Tooltip, { title: radioselecttitle, placement: "top", children: /* @__PURE__ */ jsx(Box, { className: "radio app-radio", children: /* @__PURE__ */ jsx(
|
|
26
|
-
FormControlLabel,
|
|
27
|
-
{
|
|
28
|
-
control: /* @__PURE__ */ jsx(
|
|
29
|
-
Radio,
|
|
30
|
-
{
|
|
31
|
-
checked: isSelected,
|
|
32
|
-
onChange: () => handleRadioSelection(rowId, row.original),
|
|
33
|
-
value: rowId,
|
|
34
|
-
name: `wmRadioselect-${tableName}`,
|
|
35
|
-
inputProps: {
|
|
36
|
-
"aria-label": radioselectarialabel
|
|
37
|
-
},
|
|
38
|
-
rowselectinput: "",
|
|
39
|
-
size: "small"
|
|
40
|
-
}
|
|
41
|
-
),
|
|
42
|
-
label: "",
|
|
43
|
-
className: "caption"
|
|
44
|
-
}
|
|
45
|
-
) }) }) });
|
|
46
|
-
},
|
|
112
|
+
cell: RadioSelectCell,
|
|
113
|
+
meta: { selection },
|
|
47
114
|
size: 40,
|
|
48
115
|
minSize: 40,
|
|
49
116
|
maxSize: 40,
|
|
@@ -53,50 +120,9 @@ const buildSelectionColumns = ({
|
|
|
53
120
|
if (useMultiSelect) {
|
|
54
121
|
return {
|
|
55
122
|
id: "multiSelect",
|
|
56
|
-
header:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return /* @__PURE__ */ jsx(Box, { sx: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx(Box, { className: "app-checkbox checkbox", children: /* @__PURE__ */ jsx(
|
|
60
|
-
Checkbox,
|
|
61
|
-
{
|
|
62
|
-
checked: isAllSelected,
|
|
63
|
-
indeterminate: false,
|
|
64
|
-
onChange: (e) => handleSelectAll(e.target.checked),
|
|
65
|
-
size: "small",
|
|
66
|
-
inputProps: {
|
|
67
|
-
"aria-label": "Select all rows"
|
|
68
|
-
},
|
|
69
|
-
sx: {
|
|
70
|
-
padding: 0
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
) }) });
|
|
74
|
-
},
|
|
75
|
-
cell: ({ row }) => {
|
|
76
|
-
const rowId = row.id;
|
|
77
|
-
const isSelected = row.getIsSelected();
|
|
78
|
-
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", justifyContent: "center" }, children: [
|
|
79
|
-
/* @__PURE__ */ jsx(Tooltip, { title: multiselecttitle, placement: "top", children: /* @__PURE__ */ jsx(Box, { className: "app-checkbox checkbox", children: /* @__PURE__ */ jsx(
|
|
80
|
-
Checkbox,
|
|
81
|
-
{
|
|
82
|
-
checked: isSelected,
|
|
83
|
-
onChange: (e) => handleMultiSelection(rowId, row.original, e.target.checked),
|
|
84
|
-
value: rowId,
|
|
85
|
-
name: "gridMultiSelect",
|
|
86
|
-
inputProps: {
|
|
87
|
-
"aria-label": multiselectarialabel,
|
|
88
|
-
role: "checkbox",
|
|
89
|
-
"aria-live": "assertive"
|
|
90
|
-
},
|
|
91
|
-
size: "small",
|
|
92
|
-
sx: {
|
|
93
|
-
padding: 0
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
) }) }),
|
|
97
|
-
isSelected ? /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "assertive", children: "Row Selected" }) : /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "assertive", children: "Row Deselected" })
|
|
98
|
-
] });
|
|
99
|
-
},
|
|
123
|
+
header: MultiSelectHeader,
|
|
124
|
+
cell: MultiSelectCell,
|
|
125
|
+
meta: { selection },
|
|
100
126
|
size: 40,
|
|
101
127
|
minSize: 40,
|
|
102
128
|
maxSize: 40,
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ColumnDef } from "@tanstack/react-table";
|
|
3
3
|
import { WmTableColumnProps, ActionButtonConfig } from "../props";
|
|
4
|
+
/**
|
|
5
|
+
* Per-column render config stored in `meta._cell`.
|
|
6
|
+
*
|
|
7
|
+
* Why nested under `_cell` instead of flat in `meta`:
|
|
8
|
+
* RowCells spreads `...otherMeta` into the TableCell `style` prop for WaveMaker style
|
|
9
|
+
* passthrough. Storing a function (`renderCell`) or a complex object (`wmColumn`) flat
|
|
10
|
+
* in meta would spread them into the DOM `style` attribute, producing React warnings.
|
|
11
|
+
* A single `_cell` key is destructured out in RowCells before the spread.
|
|
12
|
+
*/
|
|
13
|
+
export interface DataCellMeta {
|
|
14
|
+
wmColumn: WmTableColumnProps;
|
|
15
|
+
renderCell: (wmColumn: WmTableColumnProps, row: any) => React.ReactNode;
|
|
16
|
+
}
|
|
4
17
|
/**
|
|
5
18
|
* Creates row index column definition
|
|
6
19
|
*/
|