@wavemaker-ai/react-runtime 1.0.0-rc.324 → 1.0.0-rc.328

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.
Files changed (124) hide show
  1. package/components/basic/anchor/index.js +3 -0
  2. package/components/basic/icon/index.js +36 -5
  3. package/components/basic/iframe/index.js +18 -8
  4. package/components/basic/label/index.js +4 -3
  5. package/components/basic/search/index.d.ts +72 -3
  6. package/components/basic/search/index.js +75 -21
  7. package/components/basic/search/props.d.ts +4 -0
  8. package/components/common/WmAppIcon/index.js +11 -8
  9. package/components/common/WmAppIcon/props.d.ts +2 -0
  10. package/components/container/accordion/accordion-pane/index.d.ts +1 -0
  11. package/components/container/accordion/accordion-pane/index.js +7 -3
  12. package/components/container/accordion/accordion-pane/props.d.ts +1 -0
  13. package/components/container/index.js +18 -5
  14. package/components/container/layout-grid/grid-row/index.js +1 -1
  15. package/components/container/panel/components/panel-header/index.js +1 -3
  16. package/components/container/tabs/tab-pane/index.d.ts +1 -0
  17. package/components/container/tabs/tab-pane/index.js +2 -2
  18. package/components/container/tabs/tab-pane/props.d.ts +1 -0
  19. package/components/container/wizard/index.js +11 -10
  20. package/components/container/wizard/utils.js +1 -0
  21. package/components/data/form/base-form/hooks/useFormSubmission.d.ts +1 -1
  22. package/components/data/form/base-form/hooks/useFormSubmission.js +3 -1
  23. package/components/data/form/base-form/index.js +11 -14
  24. package/components/data/form/base-form/props.d.ts +3 -0
  25. package/components/data/form/dynamic-fields/WmxDynamicFormField.d.ts +11 -0
  26. package/components/data/form/dynamic-fields/WmxDynamicFormField.js +77 -0
  27. package/components/data/form/dynamic-fields/index.js +12 -1
  28. package/components/data/form/form-controller/withFormController.js +19 -16
  29. package/components/data/form/form-field/base-field.js +8 -5
  30. package/components/data/form/form-field/index.js +15 -8
  31. package/components/data/form/form-field/props.d.ts +1 -0
  32. package/components/data/list/components/ListItemWithTemplate.js +5 -2
  33. package/components/data/list/hooks/useListEffects.js +1 -1
  34. package/components/data/list/index.js +14 -5
  35. package/components/data/list/utils/constants.d.ts +0 -1
  36. package/components/data/list/utils/constants.js +0 -2
  37. package/components/data/table/components/RowCells.js +20 -4
  38. package/components/data/table/components/TableBody.js +5 -3
  39. package/components/data/table/components/TableHeader.js +14 -8
  40. package/components/data/table/components/TablePanelHeading.js +1 -1
  41. package/components/data/table/hooks/useDynamicColumns.js +1 -1
  42. package/components/data/table/hooks/useRowExpansion.js +41 -31
  43. package/components/data/table/hooks/useRowHandlers.d.ts +4 -2
  44. package/components/data/table/hooks/useRowHandlers.js +23 -12
  45. package/components/data/table/hooks/useRowSelection.d.ts +1 -1
  46. package/components/data/table/hooks/useRowSelection.js +80 -66
  47. package/components/data/table/hooks/useServerSideSorting.js +0 -1
  48. package/components/data/table/hooks/useTableColumns.js +16 -8
  49. package/components/data/table/hooks/useTableData.js +0 -1
  50. package/components/data/table/hooks/useTableEdit.js +0 -1
  51. package/components/data/table/hooks/useTableState.js +14 -2
  52. package/components/data/table/index.js +94 -61
  53. package/components/data/table/live-table/index.js +0 -1
  54. package/components/data/table/props.d.ts +8 -0
  55. package/components/data/table/utils/buildSelectionColumns.js +2 -4
  56. package/components/data/table/utils/columnBuilder.d.ts +16 -2
  57. package/components/data/table/utils/columnBuilder.js +14 -9
  58. package/components/data/table/utils/columnWidthDistribution.js +10 -0
  59. package/components/data/table/utils/constants.d.ts +0 -4
  60. package/components/data/table/utils/constants.js +0 -7
  61. package/components/data/table/utils/dynamic-columns.d.ts +1 -1
  62. package/components/data/table/utils/dynamic-columns.js +3 -8
  63. package/components/data/table/utils/expansionColumn.d.ts +23 -0
  64. package/components/data/table/utils/expansionColumn.js +56 -0
  65. package/components/data/table/utils/index.d.ts +23 -3
  66. package/components/data/table/utils/index.js +60 -20
  67. package/components/data/table/utils/selectionUtils.d.ts +5 -0
  68. package/components/data/table/utils/selectionUtils.js +5 -0
  69. package/components/dialogs/dialog/index.js +3 -2
  70. package/components/dialogs/dialog-header/index.js +1 -1
  71. package/components/dialogs/index.js +14 -2
  72. package/components/input/chips/index.js +29 -5
  73. package/components/input/color-picker/index.js +4 -6
  74. package/components/input/default/radioset/index.js +2 -1
  75. package/components/input/epoch/date/index.js +1 -1
  76. package/components/input/select/index.js +3 -5
  77. package/components/input/text/index.js +2 -2
  78. package/components/input/textarea/index.js +42 -17
  79. package/components/navbar/nav/index.js +10 -5
  80. package/components/navigation/breadcrumb/index.js +2 -1
  81. package/components/navigation/popover/index.js +24 -8
  82. package/components/page/index.js +1 -1
  83. package/components/page/page-content/index.js +30 -6
  84. package/components/page/page-content/props.d.ts +1 -0
  85. package/components/page/partial-container/index.js +2 -1
  86. package/components/prefab/index.js +3 -2
  87. package/components/prefab/props.d.ts +1 -0
  88. package/components/wmx/WmxRenderer.d.ts +8 -0
  89. package/components/wmx/WmxRenderer.js +57 -0
  90. package/context/WidgetProvider.js +2 -1
  91. package/core/appstore.js +1 -1
  92. package/core/proxy-service.d.ts +1 -0
  93. package/core/proxy-service.js +53 -2
  94. package/core/util/index.d.ts +0 -2
  95. package/core/util/index.js +3 -30
  96. package/higherOrder/BasePage.js +36 -54
  97. package/higherOrder/DataNav.js +4 -1
  98. package/higherOrder/withBaseWrapper.js +9 -7
  99. package/hooks/useHttp.js +4 -2
  100. package/hooks/useLayoutSize.js +1 -1
  101. package/package-lock.json +240 -607
  102. package/package.json +3 -3
  103. package/runtime-dynamic/app-initializer.js +2 -1
  104. package/runtime-dynamic/components/partial-content.js +4 -1
  105. package/runtime-dynamic/components/wmx-placeholder.d.ts +18 -0
  106. package/runtime-dynamic/components/wmx-placeholder.js +48 -0
  107. package/runtime-dynamic/factories/dynamic-component.js +26 -3
  108. package/runtime-dynamic/main.js +6 -0
  109. package/runtime-dynamic/services/compile-render.js +75 -12
  110. package/runtime-dynamic/services/css-scoping.d.ts +2 -0
  111. package/runtime-dynamic/services/css-scoping.js +39 -20
  112. package/store/slices/i18nSlice.d.ts +0 -1
  113. package/store/slices/i18nSlice.js +0 -2
  114. package/utils/custom-expression/parser.js +11 -8
  115. package/utils/layoutsize-util.js +12 -7
  116. package/utils/style-utils.d.ts +6 -0
  117. package/utils/style-utils.js +10 -0
  118. package/utils/transformedDataset-utils.d.ts +3 -3
  119. package/utils/transformedDataset-utils.js +1 -2
  120. package/utils/wmx.utils.d.ts +6 -0
  121. package/utils/wmx.utils.js +41 -0
  122. package/variables/crud-variable.js +1 -1
  123. package/variables/live-variable.js +1 -1
  124. package/variables/service-variable.js +6 -3
@@ -82,6 +82,7 @@ import {
82
82
  parseTableRowActions,
83
83
  parseTableActions,
84
84
  parseTableRowExpansion,
85
+ isRowExpansionVisible,
85
86
  getSpacingClasses,
86
87
  TABLE_CSS_CLASSES,
87
88
  TABLE_MESSAGES,
@@ -89,9 +90,14 @@ import {
89
90
  saveTableState,
90
91
  clearTableState,
91
92
  addUniqueRowIds,
92
- cleanRowData
93
+ cleanRowData,
94
+ getDomHiddenColStyle
93
95
  } from "./utils";
94
96
  import { hasTableGroups } from "./utils/groupHeaderUtils";
97
+ import {
98
+ buildExpansionColSpec,
99
+ getExpansionColumnInsertIndex
100
+ } from "./utils/expansionColumn";
95
101
  import { handleNewRowNavigation } from "./utils";
96
102
  import {
97
103
  TablePanelHeading,
@@ -196,7 +202,8 @@ const WmTableComponent = memo(
196
202
  exportdatasize,
197
203
  onBeforeexport,
198
204
  onAfterexport,
199
- styles
205
+ styles,
206
+ viewParent
200
207
  } = _c, rest = __objRest(_c, [
201
208
  "name",
202
209
  "dataset",
@@ -277,7 +284,8 @@ const WmTableComponent = memo(
277
284
  "exportdatasize",
278
285
  "onBeforeexport",
279
286
  "onAfterexport",
280
- "styles"
287
+ "styles",
288
+ "viewParent"
281
289
  ]);
282
290
  const effectiveStorageKey = useMemo(
283
291
  () => name + ((listener == null ? void 0 : listener.partialName) ? `__${listener == null ? void 0 : listener.partialName}` : ""),
@@ -456,6 +464,8 @@ const WmTableComponent = memo(
456
464
  onRowdeselect,
457
465
  listener,
458
466
  navigation,
467
+ viewParent,
468
+ widgetRegistrationKey,
459
469
  onSyncSelectedItems
460
470
  });
461
471
  const { activeRowIds, setActiveRow, handleRowActiveClick, isRowActive } = useTableState({
@@ -473,14 +483,7 @@ const WmTableComponent = memo(
473
483
  children,
474
484
  listener
475
485
  });
476
- const {
477
- wmTableColumns,
478
- tableStructure,
479
- rowActions,
480
- headerActions,
481
- footerActions,
482
- rowExpansionConfig
483
- } = useMemo(() => {
486
+ const { wmTableColumns, tableStructure, headerActions, footerActions, rowExpansionConfig } = useMemo(() => {
484
487
  const allTableActions = parseTableActions(children);
485
488
  const headerActions2 = allTableActions.filter((action) => {
486
489
  const position = action.position || "footer";
@@ -495,16 +498,21 @@ const WmTableComponent = memo(
495
498
  const staticColumns = parseTableColumns(children, internalDataset);
496
499
  const hasGroups = structure.some((item) => "isGroup" in item && item.isGroup);
497
500
  const finalColumns = hasGroups && flatColumns.length > 0 ? flatColumns : staticColumns.length > 0 ? staticColumns : isDynamicTable && dynamicColumns.length > 0 ? dynamicColumns : flatColumns;
501
+ const parsedExpansion = parseTableRowExpansion(children);
498
502
  return {
499
503
  wmTableColumns: finalColumns,
500
504
  tableStructure: structure,
501
- rowActions: parseTableRowActions(children),
502
505
  tableActions: allTableActions,
503
506
  headerActions: headerActions2,
504
507
  footerActions: footerActions2,
505
- rowExpansionConfig: parseTableRowExpansion(children)
508
+ rowExpansionConfig: parsedExpansion
506
509
  };
507
510
  }, [children, internalDataset, isDynamicTable, dynamicColumns]);
511
+ const visibleRowExpansionConfig = useMemo(
512
+ () => isRowExpansionVisible(rowExpansionConfig, internalDataset) ? rowExpansionConfig : null,
513
+ [rowExpansionConfig, internalDataset]
514
+ );
515
+ const rowActions = useMemo(() => parseTableRowActions(children), [children]);
508
516
  const [columnsVersion, setColumnsVersion] = useState(0);
509
517
  const [columnOverrides, setColumnOverrides] = useState(
510
518
  {}
@@ -558,8 +566,8 @@ const WmTableComponent = memo(
558
566
  updatemessage,
559
567
  errormessage,
560
568
  showToast,
561
- hasRowExpansion: rowExpansionConfig ? rowExpansionConfig.show : false,
562
- expansionPosition: rowExpansionConfig ? parseInt(String(rowExpansionConfig.position || "0"), 10) : 0,
569
+ hasRowExpansion: visibleRowExpansionConfig ? true : false,
570
+ expansionPosition: visibleRowExpansionConfig ? parseInt(String(visibleRowExpansionConfig.position || "0"), 10) : 0,
563
571
  datasource,
564
572
  binddataset,
565
573
  onSuccess,
@@ -582,7 +590,9 @@ const WmTableComponent = memo(
582
590
  useMultiSelect,
583
591
  isrowselectable,
584
592
  listener,
585
- name
593
+ viewParent,
594
+ name,
595
+ widgetRegistrationKey
586
596
  });
587
597
  useEffect(() => {
588
598
  const currentPage = paginationState.pageIndex;
@@ -956,7 +966,7 @@ const WmTableComponent = memo(
956
966
  listener.Widgets[name].dataNavigator = paginationWidget;
957
967
  }
958
968
  },
959
- [name, listener]
969
+ [name]
960
970
  );
961
971
  const sortInfoForExport = useMemo(() => {
962
972
  if (sorting.length > 0) {
@@ -1275,7 +1285,7 @@ const WmTableComponent = memo(
1275
1285
  }
1276
1286
  deleteRecord(row, tableRef.current);
1277
1287
  },
1278
- [deleteRecord, onBeforerowdelete, listener, name, internalDataset]
1288
+ [deleteRecord, onBeforerowdelete, name, internalDataset]
1279
1289
  );
1280
1290
  const refresh = useCallback(
1281
1291
  async (newData = false) => {
@@ -1346,23 +1356,33 @@ const WmTableComponent = memo(
1346
1356
  selectPageSize,
1347
1357
  rowDefInstances
1348
1358
  };
1349
- syncSelectedItemsImplRef.current = (newSelectedIds) => {
1359
+ const getRowId = (row) => row._wmTableRowId || String(row.id);
1360
+ const pushSelectedItemsToWidget = (selectedIds) => {
1350
1361
  if (!(listener == null ? void 0 : listener.onChange)) return;
1351
- const getRowId = (row) => row._wmTableRowId || String(row.id);
1352
1362
  const selectedRows = internalDataset.filter(
1353
- (row) => newSelectedIds.includes(getRowId(row))
1363
+ (row) => selectedIds.includes(getRowId(row))
1354
1364
  );
1355
1365
  const selectedItems = cleanRowData(selectedRows);
1356
- if (!isEqual(prevSelectedRow.current, selectedItems)) {
1357
- prevSelectedRow.current = selectedItems;
1358
- if (tableApisRegistered.current) {
1359
- listener.onChange(widgetRegistrationKey, { selectedItems });
1360
- } else {
1361
- tableApisRegistered.current = true;
1362
- listener.onChange(widgetRegistrationKey, __spreadProps(__spreadValues({}, tableApis), { selectedItems }));
1363
- }
1366
+ if (selectedIds.length === 0) {
1367
+ prevSelectedRow.current = null;
1364
1368
  }
1369
+ if (isEqual(prevSelectedRow.current, selectedItems)) {
1370
+ return;
1371
+ }
1372
+ prevSelectedRow.current = selectedItems;
1373
+ const selectionPayload = {
1374
+ selectedItems,
1375
+ selecteditem: selectedItems,
1376
+ selectedItem: selectedItems.length === 1 ? selectedItems[0] : selectedItems
1377
+ };
1378
+ if (tableApisRegistered.current) {
1379
+ listener.onChange(widgetRegistrationKey, selectionPayload);
1380
+ return;
1381
+ }
1382
+ tableApisRegistered.current = true;
1383
+ listener.onChange(widgetRegistrationKey, __spreadValues(__spreadValues({}, tableApis), selectionPayload));
1365
1384
  };
1385
+ syncSelectedItemsImplRef.current = pushSelectedItemsToWidget;
1366
1386
  useEffect(() => {
1367
1387
  var _a2, _b2, _c2;
1368
1388
  if (parentForm && name && ((_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[parentForm])) {
@@ -1386,32 +1406,14 @@ const WmTableComponent = memo(
1386
1406
  }
1387
1407
  }
1388
1408
  }, [parentForm, parentFormColumns]);
1389
- const updateSelectedItem = () => {
1390
- if (!(listener == null ? void 0 : listener.onChange)) return;
1391
- const getRowId = (row) => row._wmTableRowId || String(row.id);
1392
- let selectedRows = [];
1393
- if ((useRadioSelect || useMultiSelect) && selectedRowIds.length > 0) {
1394
- selectedRows = internalDataset.filter((row) => selectedRowIds.includes(getRowId(row)));
1395
- } else if (activeRowIds.length > 0) {
1396
- selectedRows = internalDataset.filter(
1397
- (row) => activeRowIds.includes(getRowId(row))
1398
- );
1399
- }
1400
- const cleanedRows = cleanRowData(selectedRows);
1401
- const selectedItems = cleanedRows.length > 0 ? cleanedRows : [];
1402
- if (!isEqual(prevSelectedRow.current, selectedItems)) {
1403
- prevSelectedRow.current = selectedItems;
1404
- if (tableApisRegistered.current) {
1405
- listener.onChange(widgetRegistrationKey, { selectedItems });
1406
- return;
1407
- }
1408
- tableApisRegistered.current = true;
1409
- listener.onChange(widgetRegistrationKey, __spreadProps(__spreadValues({}, tableApis), { selectedItems }));
1410
- }
1411
- };
1412
1409
  useEffect(() => {
1413
- updateSelectedItem();
1414
- }, [activeRowIds, selectedRowIds, useRadioSelect, useMultiSelect, internalDataset, name]);
1410
+ if (!useRadioSelect && !useMultiSelect) return;
1411
+ pushSelectedItemsToWidget(selectedRowIds);
1412
+ }, [internalDataset, selectedRowIds, useRadioSelect, useMultiSelect]);
1413
+ useEffect(() => {
1414
+ if (useRadioSelect || useMultiSelect) return;
1415
+ pushSelectedItemsToWidget(activeRowIds != null ? activeRowIds : []);
1416
+ }, [activeRowIds, useRadioSelect, useMultiSelect]);
1415
1417
  const isTableLoading = useMemo(() => {
1416
1418
  return loading && navigation !== "On-Demand" && internalDataset.length === 0;
1417
1419
  }, [loading, navigation, internalDataset.length]);
@@ -1420,17 +1422,47 @@ const WmTableComponent = memo(
1420
1422
  const leafHeaderGroup = headerGroups.length ? headerGroups[headerGroups.length - 1] : void 0;
1421
1423
  const leafHeaders = ((leafHeaderGroup == null ? void 0 : leafHeaderGroup.headers) || []).filter((h) => !h.isPlaceholder);
1422
1424
  const base = leafHeaders.map((h) => {
1425
+ const meta = h.column.columnDef.meta;
1426
+ const hiddenColStyle = getDomHiddenColStyle(meta);
1423
1427
  const w = `${h.column.getSize()}px`;
1424
- return { key: h.column.id, width: w, style: { width: w } };
1428
+ return {
1429
+ key: h.column.id,
1430
+ width: hiddenColStyle ? void 0 : w,
1431
+ style: hiddenColStyle != null ? hiddenColStyle : { width: w },
1432
+ domHidden: !!hiddenColStyle
1433
+ };
1425
1434
  });
1435
+ if (visibleRowExpansionConfig) {
1436
+ const expansionInsertIndex = getExpansionColumnInsertIndex(
1437
+ leafHeaders,
1438
+ visibleRowExpansionConfig,
1439
+ {
1440
+ appendForGroupedTable: !!(tableStructure && hasTableGroups(tableStructure))
1441
+ }
1442
+ );
1443
+ if (expansionInsertIndex >= 0) {
1444
+ base.splice(expansionInsertIndex, 0, __spreadProps(__spreadValues({}, buildExpansionColSpec(visibleRowExpansionConfig.columnwidth)), {
1445
+ domHidden: false
1446
+ }));
1447
+ }
1448
+ }
1426
1449
  return base;
1427
- }, [table, columnSizing, columnsVersion, showheader, ColClassSignature]);
1450
+ }, [
1451
+ table,
1452
+ columnSizing,
1453
+ columnsVersion,
1454
+ showheader,
1455
+ ColClassSignature,
1456
+ visibleRowExpansionConfig,
1457
+ tableStructure
1458
+ ]);
1428
1459
  return /* @__PURE__ */ jsxs(
1429
1460
  Box,
1430
1461
  __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
1431
1462
  ref: tableContainerRef,
1432
1463
  hidden: props.hidden,
1433
- className: `app-grid app-panel panel app-datagrid ${className}`.trim()
1464
+ className: `app-grid app-panel panel app-datagrid ${className}`.trim(),
1465
+ "data-widget-id": props["data-widget-id"]
1434
1466
  }, { name }), { editmode }), { navigation }), { title }), {
1435
1467
  currentpage: table.getState().pagination.pageIndex + 1
1436
1468
  }), {
@@ -1504,7 +1536,7 @@ const WmTableComponent = memo(
1504
1536
  sorting,
1505
1537
  columnSizing,
1506
1538
  rowSelection,
1507
- rowExpansionConfig,
1539
+ rowExpansionConfig: visibleRowExpansionConfig,
1508
1540
  columnsVersion,
1509
1541
  filterMode: filtermode,
1510
1542
  columnFilters,
@@ -1520,7 +1552,7 @@ const WmTableComponent = memo(
1520
1552
  ),
1521
1553
  /* @__PURE__ */ jsx("colgroup", { children: colGroupSpec.map((c) => /* @__PURE__ */ jsx("col", { style: c.style, width: c.width }, c.key)) })
1522
1554
  ] }),
1523
- internalDataset.length > 0 && /* @__PURE__ */ jsx(
1555
+ (internalDataset.length > 0 || !isTableLoading) && /* @__PURE__ */ jsx(
1524
1556
  TableBodyComponent,
1525
1557
  {
1526
1558
  table,
@@ -1534,7 +1566,7 @@ const WmTableComponent = memo(
1534
1566
  nodatamessage,
1535
1567
  loadingdatamsg,
1536
1568
  isLoading: datasource == null ? void 0 : datasource.loading,
1537
- rowExpansionConfig,
1569
+ rowExpansionConfig: visibleRowExpansionConfig,
1538
1570
  expandedRows,
1539
1571
  toggleRowExpansion: handleToggleRowExpansion,
1540
1572
  isRowExpanded,
@@ -1547,7 +1579,8 @@ const WmTableComponent = memo(
1547
1579
  isAddingNewRow,
1548
1580
  customExpressionColumns: customColumns,
1549
1581
  customColumnsRevision,
1550
- columnsVersion
1582
+ columnsVersion,
1583
+ registerRowDefInstance
1551
1584
  }
1552
1585
  ),
1553
1586
  summaryRowEnabled && summaryRowDefs.length > 0 && /* @__PURE__ */ jsx(
@@ -34,7 +34,6 @@ import Box from "@mui/material/Box";
34
34
  import { useWidgetProxy } from "../../../../context/WidgetProvider";
35
35
  import withStandalone from "../../../../higherOrder/withStandalone";
36
36
  function isWmTableChildType(displayName) {
37
- console.log("displayName", displayName);
38
37
  return displayName === "WmTable" || displayName === "WmTableStandalone" || displayName === "withStandalone(WmTable)";
39
38
  }
40
39
  const WmLiveTable = (props) => {
@@ -752,6 +752,10 @@ export interface TableRowProps {
752
752
  * Rendering function for content.
753
753
  */
754
754
  renderPartial?: (props: Record<string, any>, onLoad: () => void, currentItem: any) => ReactNode;
755
+ /**
756
+ * Per-row callback from codegen for row-bound attrs (e.g. show, disabled).
757
+ */
758
+ tableRowProps?: (rowData: any) => Partial<TableRowProps>;
755
759
  /**
756
760
  * Children components.
757
761
  */
@@ -1109,6 +1113,8 @@ export interface UseRowSelectionProps {
1109
1113
  onRowdeselect?: (event: any, widget: any, row: any) => void;
1110
1114
  listener?: any;
1111
1115
  navigation?: string;
1116
+ viewParent?: any;
1117
+ widgetRegistrationKey?: string;
1112
1118
  onSyncSelectedItems?: (selectedIds: string[]) => void;
1113
1119
  }
1114
1120
  export interface UseRowSelectionReturn {
@@ -1257,7 +1263,9 @@ export interface UseRowHandlersProps {
1257
1263
  useMultiSelect?: boolean;
1258
1264
  isrowselectable?: boolean;
1259
1265
  listener?: any;
1266
+ viewParent?: any;
1260
1267
  name: string;
1268
+ widgetRegistrationKey?: string;
1261
1269
  }
1262
1270
  export interface UseRowHandlersReturn {
1263
1271
  handleRowClick: (event: MouseEvent, rowData: any, rowId: string) => void;
@@ -38,7 +38,7 @@ function MultiSelectCell(ctx) {
38
38
  const rowId = row.id;
39
39
  const isSelected = row.getIsSelected();
40
40
  const { handleMultiSelection, multiselecttitle, multiselectarialabel } = getSelectionMeta(ctx);
41
- return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", justifyContent: "center" }, children: [
41
+ return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex" }, children: [
42
42
  /* @__PURE__ */ jsx(Tooltip, { title: multiselecttitle != null ? multiselecttitle : "", placement: "top", children: /* @__PURE__ */ jsx(Box, { className: "app-checkbox checkbox", children: /* @__PURE__ */ jsx(
43
43
  Checkbox,
44
44
  {
@@ -64,13 +64,11 @@ MultiSelectCell.displayName = "MultiSelectCell";
64
64
  function MultiSelectHeader({ table, column }) {
65
65
  var _a, _b;
66
66
  const isAllSelected = table.getIsAllRowsSelected();
67
- const isSomeSelected = table.getIsSomeRowsSelected();
68
67
  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(
68
+ return /* @__PURE__ */ jsx(Box, { sx: { display: "flex", width: "100%" }, children: /* @__PURE__ */ jsx(Box, { className: "app-checkbox checkbox", children: /* @__PURE__ */ jsx(
70
69
  Checkbox,
71
70
  {
72
71
  checked: isAllSelected,
73
- indeterminate: isSomeSelected && !isAllSelected,
74
72
  onChange: (e) => handleSelectAll == null ? void 0 : handleSelectAll(e.target.checked),
75
73
  size: "small",
76
74
  inputProps: {
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { ColumnDef } from "@tanstack/react-table";
1
+ import React, { type ReactElement } from "react";
2
+ import { ColumnDef, CellContext } from "@tanstack/react-table";
3
3
  import { WmTableColumnProps, ActionButtonConfig } from "../props";
4
4
  /**
5
5
  * Per-column render config stored in `meta._cell`.
@@ -14,6 +14,20 @@ export interface DataCellMeta {
14
14
  wmColumn: WmTableColumnProps;
15
15
  renderCell: (wmColumn: WmTableColumnProps, row: any) => React.ReactNode;
16
16
  }
17
+ /** Actions-column render config stored in `meta._actions` (namespaced like `_cell`). */
18
+ export interface ActionCellMeta {
19
+ renderActionCell: (ctx: CellContext<any, unknown>) => React.ReactNode;
20
+ }
21
+ /**
22
+ * Stable cell renderer for the actions column. Same motivation as DataCell: flexRender
23
+ * uses `cell` as the component TYPE, so a changing renderActionCell identity would
24
+ * unmount/remount the row action buttons. Read the renderer from `meta._actions` instead.
25
+ */
26
+ declare function ActionCell(ctx: CellContext<any, unknown>): ReactElement;
27
+ declare namespace ActionCell {
28
+ var displayName: string;
29
+ }
30
+ export { ActionCell };
17
31
  /**
18
32
  * Creates row index column definition
19
33
  */
@@ -41,6 +41,12 @@ function DataCell(ctx) {
41
41
  return /* @__PURE__ */ jsx(Fragment, { children: renderCell(wmColumn, ctx.row) });
42
42
  }
43
43
  DataCell.displayName = "DataCell";
44
+ function ActionCell(ctx) {
45
+ var _a;
46
+ const { renderActionCell } = (_a = ctx.column.columnDef.meta) == null ? void 0 : _a._actions;
47
+ return /* @__PURE__ */ jsx(Fragment, { children: renderActionCell(ctx) });
48
+ }
49
+ ActionCell.displayName = "ActionCell";
44
50
  const createRowIndexColumn = () => ({
45
51
  id: "rowIndex",
46
52
  header: "S. No.",
@@ -56,11 +62,12 @@ const createDataColumn = (wmColumn, renderCell, index = 0) => {
56
62
  const colClassProp = (_a = wmColumn.colClass) != null ? _a : wmColumn["col-class"];
57
63
  let columnSize;
58
64
  if (wmColumn.width) {
59
- columnSize = parseInt(wmColumn.width);
65
+ columnSize = parseWidth(wmColumn.width);
60
66
  } else if ((_b = wmColumn.styles) == null ? void 0 : _b.width) {
61
67
  columnSize = parseWidth(wmColumn.styles.width);
62
68
  }
63
69
  const accessorKey = wmColumn.field || wmColumn.name;
70
+ const isDomHidden = wmColumn.show === false;
64
71
  const columnId = (accessorKey == null ? void 0 : accessorKey.replace(/\./g, "_")) || (typeof wmColumn.caption === "string" && wmColumn.caption ? wmColumn.caption : void 0) || `column_${index}`;
65
72
  return __spreadProps(__spreadValues({
66
73
  id: columnId,
@@ -69,12 +76,10 @@ const createDataColumn = (wmColumn, renderCell, index = 0) => {
69
76
  // Supports nested properties like "department.store.employee"
70
77
  accessorFn: wmColumn.sortby ? (row) => get(row, wmColumn.sortby || "") : void 0,
71
78
  header: wmColumn.caption,
72
- size: columnSize,
73
- minSize: 50
74
- }, columnSize ? {} : { maxSize: 500 }), {
75
- // Only set maxSize for auto-sized columns
79
+ size: isDomHidden ? 0 : columnSize,
80
+ minSize: isDomHidden ? 0 : 50
81
+ }, isDomHidden ? { maxSize: 0 } : columnSize ? {} : { maxSize: 500 }), {
76
82
  enableResizing: true,
77
- // Enable resizing for all data columns
78
83
  cell: DataCell,
79
84
  enableSorting: wmColumn.sortable,
80
85
  // Pass column styles and properties through meta for TableCell styling and filtering
@@ -84,6 +89,7 @@ const createDataColumn = (wmColumn, renderCell, index = 0) => {
84
89
  className: wmColumn == null ? void 0 : wmColumn.className,
85
90
  colClass: colClassProp
86
91
  }, wmColumn.styles), {
92
+ domHidden: isDomHidden,
87
93
  // Include widget types for filter rendering
88
94
  widgetType: wmColumn.widgetType,
89
95
  editWidgetType: wmColumn.editWidgetType,
@@ -102,9 +108,7 @@ const createDataColumn = (wmColumn, renderCell, index = 0) => {
102
108
  const createDataColumns = (wmTableColumns, renderCell) => {
103
109
  const columns = [];
104
110
  wmTableColumns.forEach((wmColumn, index) => {
105
- if (wmColumn.show) {
106
- columns.push(createDataColumn(wmColumn, renderCell, index));
107
- }
111
+ columns.push(createDataColumn(wmColumn, renderCell, index));
108
112
  });
109
113
  return columns;
110
114
  };
@@ -186,6 +190,7 @@ const getActionColumnSize = (editmode) => {
186
190
  return editmode === "quickedit" ? { size: 80, minSize: 60 } : { size: 100, minSize: 80 };
187
191
  };
188
192
  export {
193
+ ActionCell,
189
194
  createDataColumn,
190
195
  createDataColumns,
191
196
  createDefaultColumnProps,
@@ -18,7 +18,14 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  const NON_DATA_COLUMN_IDS = ["radioSelect", "multiSelect", "rowIndex", "actions"];
21
+ const isDomHiddenColumn = (column) => {
22
+ var _a;
23
+ return !!((_a = column.meta) == null ? void 0 : _a.domHidden);
24
+ };
21
25
  const isDataColumn = (column) => {
26
+ if (isDomHiddenColumn(column)) {
27
+ return false;
28
+ }
22
29
  return !NON_DATA_COLUMN_IDS.includes(column.id || "");
23
30
  };
24
31
  const hasExplicitWidth = (column) => {
@@ -31,6 +38,9 @@ const distributeColumnWidths = (columns, tableWidth) => {
31
38
  let usedWidth = 0;
32
39
  let dataColumnsNeedingWidth = 0;
33
40
  columns.forEach((column) => {
41
+ if (isDomHiddenColumn(column)) {
42
+ return;
43
+ }
34
44
  if (!isDataColumn(column)) {
35
45
  const size = column.size || getDefaultColumnSize(column.id || "");
36
46
  usedWidth += size;
@@ -45,8 +45,4 @@ export declare const INTERACTIVE_CLASSES: readonly ["MuiInputBase", "MuiSelect",
45
45
  export declare const INTERACTIVE_ROLES: readonly ["button", "textbox", "combobox", "listbox"];
46
46
  export declare const INTERACTIVE_DATA_ROLES: readonly ["input", "select", "date", "time", "color", "editor", "checkbox", "radio", "slider", "chips", "rating"];
47
47
  export declare const INTERACTIVE_TAG_NAMES: readonly ["INPUT", "BUTTON", "SELECT", "TEXTAREA", "A", "LABEL"];
48
- export declare const DYNAMIC_COLUMNS_CONFIG: {
49
- readonly maxColumns: 20;
50
- readonly sampleSize: 3;
51
- };
52
48
  export declare const UNSUPPORTED_STATE_PERSISTENCE_TYPES: readonly string[];
@@ -112,19 +112,12 @@ const INTERACTIVE_TAG_NAMES = [
112
112
  "A",
113
113
  "LABEL"
114
114
  ];
115
- const DYNAMIC_COLUMNS_CONFIG = {
116
- maxColumns: 20,
117
- // Maximum number of columns to generate from data (matching Angular behavior)
118
- sampleSize: 3
119
- // Number of rows to sample for column detection
120
- };
121
115
  const UNSUPPORTED_STATE_PERSISTENCE_TYPES = [
122
116
  "Scroll",
123
117
  "On-Demand",
124
118
  "Inline"
125
119
  ];
126
120
  export {
127
- DYNAMIC_COLUMNS_CONFIG,
128
121
  INTERACTIVE_CLASSES,
129
122
  INTERACTIVE_DATA_ROLES,
130
123
  INTERACTIVE_ROLES,
@@ -25,7 +25,7 @@ export interface PreparedFieldTerminal {
25
25
  *
26
26
  * Uses lodash `pickBy` to drop internal keys in one pass per object; recursion stays shallow.
27
27
  */
28
- export declare const prepareFieldsFromMergedRow: (mergedRow: Record<string, any>, upperBound?: number) => PreparedFieldTerminal[];
28
+ export declare const prepareFieldsFromMergedRow: (mergedRow: Record<string, any>) => PreparedFieldTerminal[];
29
29
  /**
30
30
  * Generate column definitions from data array.
31
31
  * Uses Angular-style nested flattening (prepareFieldDefs) so dynamic tables and
@@ -21,7 +21,6 @@ import isArray from "lodash-es/isArray";
21
21
  import pickBy from "lodash-es/pickBy";
22
22
  import startCase from "lodash-es/startCase";
23
23
  import { createDefaultColumnProps } from "./columnBuilder";
24
- import { DYNAMIC_COLUMNS_CONFIG } from "./constants";
25
24
  import { INTERNAL_PROPERTIES } from "./index";
26
25
  const INTERNAL_FIELD_PATTERNS = [
27
26
  "_wm",
@@ -93,11 +92,9 @@ function relatedFieldsFromKey(rawKey) {
93
92
  function isLeafColumnValue(value) {
94
93
  return value === null || value === void 0 || typeof value !== "object" || value instanceof Date || isArray(value) && !value[0];
95
94
  }
96
- const prepareFieldsFromMergedRow = (mergedRow, upperBound = DYNAMIC_COLUMNS_CONFIG.maxColumns) => {
95
+ const prepareFieldsFromMergedRow = (mergedRow) => {
97
96
  const terminals = [];
98
- let columnCount = 0;
99
97
  const pushTerminal = (fieldPath, relatedTable, relatedField) => {
100
- if (columnCount >= upperBound) return;
101
98
  const displayName = displayNameForFieldPath(fieldPath);
102
99
  terminals.push({
103
100
  displayName,
@@ -106,14 +103,12 @@ const prepareFieldsFromMergedRow = (mergedRow, upperBound = DYNAMIC_COLUMNS_CONF
106
103
  relatedTable,
107
104
  relatedField: relatedField != null ? relatedField : displayName
108
105
  });
109
- columnCount += 1;
110
106
  };
111
107
  const pushFieldDef = (node, prefix, depth) => {
112
- if (columnCount >= upperBound || depth > MAX_FIELD_DEPTH || node == null) return;
108
+ if (depth > MAX_FIELD_DEPTH || node == null) return;
113
109
  if (!isPlainRecord(node)) return;
114
110
  const visible = pickBy(node, (_v, k) => !isInternalField(String(k)));
115
111
  forEach(visible, (value, rawKey) => {
116
- if (columnCount >= upperBound) return;
117
112
  const path = prefix ? `${prefix}.${rawKey}` : rawKey;
118
113
  const rel = relatedFieldsFromKey(rawKey);
119
114
  if (isLeafColumnValue(value)) {
@@ -155,7 +150,7 @@ const generateColumnsFromData = (data) => {
155
150
  if (!merged) {
156
151
  return [];
157
152
  }
158
- const terminals = prepareFieldsFromMergedRow(merged, DYNAMIC_COLUMNS_CONFIG.maxColumns);
153
+ const terminals = prepareFieldsFromMergedRow(merged);
159
154
  if (terminals.length === 0) {
160
155
  return [];
161
156
  }
@@ -0,0 +1,23 @@
1
+ import type { CSSProperties } from "react";
2
+ /** Minimal header shape for expansion insert-index calculation (TanStack Header-compatible). */
3
+ export type ExpansionColumnHeaderLike = {
4
+ id: string;
5
+ column: {
6
+ id: string;
7
+ columnDef?: unknown;
8
+ };
9
+ };
10
+ /**
11
+ * Index at which the row-expansion `<th>` / `<td>` / `<col>` is inserted.
12
+ * Mirrors Angular datatable.js preparedHeaderData row-expansion placement.
13
+ */
14
+ export declare function getExpansionColumnInsertIndex(headers: ReadonlyArray<ExpansionColumnHeaderLike>, rowExpansionConfig: {
15
+ position?: string | number;
16
+ } | null | undefined, options?: {
17
+ appendForGroupedTable?: boolean;
18
+ }): number;
19
+ export declare function buildExpansionColSpec(columnwidth?: string): {
20
+ key: string;
21
+ width: string;
22
+ style: CSSProperties;
23
+ };
@@ -0,0 +1,56 @@
1
+ const SYSTEM_HEADER_IDS = /* @__PURE__ */ new Set([
2
+ "multiSelect",
3
+ "radioSelect",
4
+ "row-index",
5
+ "rowIndex",
6
+ "actions"
7
+ ]);
8
+ function findFirstDataColumnIndex(headers) {
9
+ for (let i = 0; i < headers.length; i++) {
10
+ if (!SYSTEM_HEADER_IDS.has(headers[i].id)) {
11
+ return i;
12
+ }
13
+ }
14
+ return 0;
15
+ }
16
+ function getExpansionColumnInsertIndex(headers, rowExpansionConfig, options) {
17
+ if (!rowExpansionConfig) return -1;
18
+ if (options == null ? void 0 : options.appendForGroupedTable) {
19
+ return headers.length;
20
+ }
21
+ const position = rowExpansionConfig.position;
22
+ if (position === "-1" || position === -1) {
23
+ return Math.max(0, headers.length - 1);
24
+ }
25
+ if (typeof position === "number" || typeof position === "string" && !isNaN(Number(position))) {
26
+ return findFirstDataColumnIndex([...headers]) + Number(position);
27
+ }
28
+ if (typeof position === "string") {
29
+ const columnIndex = headers.findIndex((header) => {
30
+ var _a;
31
+ if (header.id === position || header.column.id === position) {
32
+ return true;
33
+ }
34
+ const accessorKey = (_a = header.column.columnDef) == null ? void 0 : _a.accessorKey;
35
+ if (accessorKey === position) {
36
+ return true;
37
+ }
38
+ const normalizedPosition = position.replace(/\./g, "_");
39
+ return header.id === normalizedPosition || header.column.id === normalizedPosition;
40
+ });
41
+ return columnIndex >= 0 ? columnIndex + 1 : 0;
42
+ }
43
+ return 0;
44
+ }
45
+ function buildExpansionColSpec(columnwidth) {
46
+ const w = columnwidth || "50px";
47
+ return {
48
+ key: "row-expansion",
49
+ width: w,
50
+ style: { width: w }
51
+ };
52
+ }
53
+ export {
54
+ buildExpansionColSpec,
55
+ getExpansionColumnInsertIndex
56
+ };