@orangelogic/design-system-react 1.0.0-alpha.6 → 1.0.0-alpha.8

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.
@@ -1,3 +1,6 @@
1
+ import {
2
+ Helpers
3
+ } from "./chunk-JKPFPEBM.js";
1
4
  import {
2
5
  CxFacetedFilter
3
6
  } from "./chunk-4JG5JUIF.js";
@@ -84,7 +87,7 @@ import { useCallback, useEffect as useEffect4, useImperativeHandle, useRef as us
84
87
  // packages/react/src/molecules/table/engine-loader.ts
85
88
  var pending;
86
89
  function loadTableEngine() {
87
- pending ??= import("./engine-4B6CSIGQ.js").then(
90
+ pending ??= import("./engine-KBF6F5TP.js").then(
88
91
  (engine) => ({ createTableEngine: engine.createTableEngine }),
89
92
  (error) => {
90
93
  pending = void 0;
@@ -977,7 +980,7 @@ function diff(before, after, className, dataPrefix, atomicTags) {
977
980
  }
978
981
 
979
982
  // packages/react/src/molecules/table/formatters.tsx
980
- import { jsx as jsx2 } from "react/jsx-runtime";
983
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
981
984
  var text = (value) => value == null ? "" : String(value);
982
985
  var size = (value) => value === "small" || value === "large" ? value : "medium";
983
986
  function labelText(label) {
@@ -996,6 +999,12 @@ function Formatted({ descriptor: d, active }) {
996
999
  const { readOnly } = useContext2(TableContext);
997
1000
  const p = d.params;
998
1001
  switch (d.formatter) {
1002
+ case "handle":
1003
+ return /* @__PURE__ */ jsxs("div", { className: "tabulator-row-handle-box", "aria-hidden": "true", children: [
1004
+ /* @__PURE__ */ jsx2("div", { className: "tabulator-row-handle-bar" }),
1005
+ /* @__PURE__ */ jsx2("div", { className: "tabulator-row-handle-bar" }),
1006
+ /* @__PURE__ */ jsx2("div", { className: "tabulator-row-handle-bar" })
1007
+ ] });
999
1008
  case "avatar":
1000
1009
  return /* @__PURE__ */ jsx2(CxAvatar, { className: "tabulator-native-avatar", image: typeof p.image === "string" ? p.image : void 0, initials: text(p.initials), label: text(p.label), shape: p.shape === "square" || p.shape === "rounded" ? p.shape : "circle", rootProps: { style: { "--size": typeof p.size === "string" ? p.size : "2rem" } } });
1001
1010
  case "number":
@@ -1239,7 +1248,7 @@ var table_chrome_default = {
1239
1248
  };
1240
1249
 
1241
1250
  // packages/react/src/molecules/table/table-chrome.tsx
1242
- import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
1251
+ import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
1243
1252
  function showTableToolbar(p) {
1244
1253
  return Boolean(p.pagination && !(p.noHeaderRowReserve && p.paginationPlacement?.startsWith("bottom")) || p.label || p.canAdd || p.addAction || p.canSearch || p.showSavedSearch || p.canSaveReport || p.canExportCsv || p.canExportXml || p.canExportPdf || p.canExportCustom || p.canSelectAll || p.dropdownFilters?.length || p.groupByOptions?.length || p.facetConfig || p.facets?.length || p.toolbarStart || p.toolbarEnd || p.selectAllActions);
1245
1254
  }
@@ -1314,8 +1323,8 @@ function TableChrome({ props: p, query, selection, selectionDisabled, facets, pa
1314
1323
  const canExport = Boolean(p.canExportCsv || p.canExportXml || p.canExportPdf || p.canExportCustom || p.canSaveReport);
1315
1324
  const selecting = Boolean(p.canSelectAll && selection.count);
1316
1325
  const hasActions = Boolean(p.canSelectAll || p.canSearch || p.dropdownFilters?.length || p.showSavedSearch || p.canAdd || p.addAction || p.groupByOptions?.length || canExport || facets.length || p.facetConfig || p.toolbarEnd);
1317
- return /* @__PURE__ */ jsxs("div", { className: table_chrome_default.root, children: [
1318
- showTableToolbar(p) && /* @__PURE__ */ jsxs(
1326
+ return /* @__PURE__ */ jsxs2("div", { className: table_chrome_default.root, children: [
1327
+ showTableToolbar(p) && /* @__PURE__ */ jsxs2(
1319
1328
  CxSpace,
1320
1329
  {
1321
1330
  className: table_chrome_default.toolbar,
@@ -1326,17 +1335,17 @@ function TableChrome({ props: p, query, selection, selectionDisabled, facets, pa
1326
1335
  "data-pagination-placement": p.pagination ? p.paginationPlacement ?? "top-end" : void 0,
1327
1336
  "data-no-reserve": p.noHeaderRowReserve ? "" : void 0,
1328
1337
  children: [
1329
- /* @__PURE__ */ jsxs("div", { className: table_chrome_default.header, "data-has-label": hasLabel ? "" : void 0, "data-has-pagination": hasPagination ? "" : void 0, children: [
1330
- /* @__PURE__ */ jsxs("div", { className: table_chrome_default.headerLabel, children: [
1338
+ /* @__PURE__ */ jsxs2("div", { className: table_chrome_default.header, "data-has-label": hasLabel ? "" : void 0, "data-has-pagination": hasPagination ? "" : void 0, children: [
1339
+ /* @__PURE__ */ jsxs2("div", { className: table_chrome_default.headerLabel, children: [
1331
1340
  p.label && /* @__PURE__ */ jsx4(CxTypography, { variant: "h3", children: p.label }),
1332
1341
  p.toolbarStart
1333
1342
  ] }),
1334
1343
  /* @__PURE__ */ jsx4("div", { className: table_chrome_default.headerPagination, children: hasPagination && /* @__PURE__ */ jsx4("div", { ref: paginationRef, className: table_chrome_default.pagination }) })
1335
1344
  ] }),
1336
- hasActions && /* @__PURE__ */ jsxs(CxSpace, { className: table_chrome_default.actions, justifyContent: "space-between", alignItems: "center", children: [
1337
- /* @__PURE__ */ jsxs(CxSpace, { className: table_chrome_default.actionsLeft, alignItems: "center", spacing: "x-small", children: [
1345
+ hasActions && /* @__PURE__ */ jsxs2(CxSpace, { className: table_chrome_default.actions, justifyContent: "space-between", alignItems: "center", children: [
1346
+ /* @__PURE__ */ jsxs2(CxSpace, { className: table_chrome_default.actionsLeft, alignItems: "center", spacing: "x-small", children: [
1338
1347
  p.canSelectAll && /* @__PURE__ */ jsx4(CxCheckbox, { rootProps: { className: table_chrome_default.selectAll }, "aria-label": t("selectAll", "Select all"), checked: selection.checked, indeterminate: selection.indeterminate, disabled: selectionDisabled, onCheckedChange: (detail) => onSelectAll(detail.value) }),
1339
- selecting ? p.selectAllActions : /* @__PURE__ */ jsxs(Fragment, { children: [
1348
+ selecting ? p.selectAllActions : /* @__PURE__ */ jsxs2(Fragment, { children: [
1340
1349
  p.canSearch && /* @__PURE__ */ jsx4("form", { className: table_chrome_default.search, onSubmit: (event) => {
1341
1350
  event.preventDefault();
1342
1351
  onSearch(search.trim());
@@ -1361,7 +1370,7 @@ function TableChrome({ props: p, query, selection, selectionDisabled, facets, pa
1361
1370
  }
1362
1371
  ) }),
1363
1372
  p.dropdownFilters?.length ? /* @__PURE__ */ jsx4(CxSpace, { alignItems: "center", spacing: "x-small", children: p.dropdownFilters.map((config) => /* @__PURE__ */ jsx4(DropdownFilter, { config, onChange: (value2) => onDropdown(config.id, value2) }, `${config.id}:${config.defaultOption ?? ""}`)) }) : null,
1364
- p.showSavedSearch && /* @__PURE__ */ jsx4(CxDropdown, { hoist: true, classNames: { base: table_chrome_default.savedSearch }, trigger: /* @__PURE__ */ jsx4(CxButton, { caret: true, children: t("savedSearches", "Saved Searches") }), children: /* @__PURE__ */ jsxs(CxMenu, { onSelect: (detail) => {
1373
+ p.showSavedSearch && /* @__PURE__ */ jsx4(CxDropdown, { hoist: true, classNames: { base: table_chrome_default.savedSearch }, trigger: /* @__PURE__ */ jsx4(CxButton, { caret: true, children: t("savedSearches", "Saved Searches") }), children: /* @__PURE__ */ jsxs2(CxMenu, { onSelect: (detail) => {
1365
1374
  const item = saved.find((entry) => entry.recordID === detail.item.value);
1366
1375
  if (item) {
1367
1376
  p.onSavedSearchSelect?.({ id: item.recordID, item });
@@ -1377,10 +1386,10 @@ function TableChrome({ props: p, query, selection, selectionDisabled, facets, pa
1377
1386
  (facets.length > 0 || p.facetConfig) && /* @__PURE__ */ jsx4(CxFacetedFilter, { facets, availableFacets: facets.map((facet) => facet.facetDetails), onChange: onFacets, externalFilters: p.additionalAppliedFilters, onRemove: (detail) => p.onRemoveAppliedFilter?.(detail.key) })
1378
1387
  ] })
1379
1388
  ] }),
1380
- /* @__PURE__ */ jsxs(CxSpace, { className: table_chrome_default.actionsRight, alignItems: "center", spacing: "x-small", children: [
1389
+ /* @__PURE__ */ jsxs2(CxSpace, { className: table_chrome_default.actionsRight, alignItems: "center", spacing: "x-small", children: [
1381
1390
  p.addAction ?? (p.canAdd && /* @__PURE__ */ jsx4(CxButton, { variant: "primary", prefix: /* @__PURE__ */ jsx4(CxIcon, { name: "add_2" }), onClick: p.onAdd, children: p.addLabel ?? t("add", "Add") })),
1382
1391
  p.groupByOptions?.length ? /* @__PURE__ */ jsx4(GroupBy, { options: p.groupByOptions, value: typeof p.groupBy === "string" ? p.groupBy : "", onChange: onGroupBy }) : null,
1383
- canExport && /* @__PURE__ */ jsx4(CxDropdown, { hoist: true, placement: "bottom-end", distance: 4, trigger: /* @__PURE__ */ jsx4(CxIconButton, { name: "more_horiz", outline: true, label: t("moreActions", "More actions") }), children: /* @__PURE__ */ jsxs(CxMenu, { onSelect: (detail) => {
1392
+ canExport && /* @__PURE__ */ jsx4(CxDropdown, { hoist: true, placement: "bottom-end", distance: 4, trigger: /* @__PURE__ */ jsx4(CxIconButton, { name: "more_horiz", outline: true, label: t("moreActions", "More actions") }), children: /* @__PURE__ */ jsxs2(CxMenu, { onSelect: (detail) => {
1384
1393
  const value2 = String(detail.item.value);
1385
1394
  if (value2 === "report") p.onSaveReport?.();
1386
1395
  else onExport(value2);
@@ -1397,7 +1406,7 @@ function TableChrome({ props: p, query, selection, selectionDisabled, facets, pa
1397
1406
  ]
1398
1407
  }
1399
1408
  ),
1400
- advanced && (p.renderAdvancedSearch?.() ?? /* @__PURE__ */ jsxs("form", { className: table_chrome_default.panel, onSubmit: (event) => {
1409
+ advanced && (p.renderAdvancedSearch?.() ?? /* @__PURE__ */ jsxs2("form", { className: table_chrome_default.panel, onSubmit: (event) => {
1401
1410
  event.preventDefault();
1402
1411
  if (field) onQuery({ filters: [...query.filters, { field, type: "=", value }] });
1403
1412
  setAdvanced(false);
@@ -1410,9 +1419,9 @@ function TableChrome({ props: p, query, selection, selectionDisabled, facets, pa
1410
1419
  event.preventDefault();
1411
1420
  onColumns(draft);
1412
1421
  setColumnEditor(false);
1413
- }, children: /* @__PURE__ */ jsxs("fieldset", { children: [
1422
+ }, children: /* @__PURE__ */ jsxs2("fieldset", { children: [
1414
1423
  /* @__PURE__ */ jsx4("legend", { children: t("editColumns", "Edit columns") }),
1415
- draft.map((edit, index) => /* @__PURE__ */ jsxs("div", { children: [
1424
+ draft.map((edit, index) => /* @__PURE__ */ jsxs2("div", { children: [
1416
1425
  /* @__PURE__ */ jsx4(CxCheckbox, { checked: edit.visible, disabled: Boolean(p.columns?.find((column) => column.field === edit.field)?.frozen), onCheckedChange: (detail) => setDraft(draft.map((item) => item === edit ? { ...item, visible: detail.value } : item)), children: p.columns?.find((column) => column.field === edit.field)?.title ?? edit.field }),
1417
1426
  /* @__PURE__ */ jsx4(CxButton, { "aria-label": `${t("moveColumnUp", "Move column up")}: ${edit.field}`, disabled: index === 0, onClick: () => setDraft((current) => {
1418
1427
  const next = [...current];
@@ -1423,8 +1432,8 @@ function TableChrome({ props: p, query, selection, selectionDisabled, facets, pa
1423
1432
  /* @__PURE__ */ jsx4(CxButton, { type: "submit", children: t("apply", "Apply") }),
1424
1433
  /* @__PURE__ */ jsx4(CxButton, { onClick: () => setColumnEditor(false), children: t("cancel", "Cancel") })
1425
1434
  ] }) }),
1426
- /* @__PURE__ */ jsxs("div", { className: table_chrome_default.tags, children: [
1427
- query.searchText && /* @__PURE__ */ jsxs(CxTag, { removable: true, onRemove: () => onSearch(""), children: [
1435
+ /* @__PURE__ */ jsxs2("div", { className: table_chrome_default.tags, children: [
1436
+ query.searchText && /* @__PURE__ */ jsxs2(CxTag, { removable: true, onRemove: () => onSearch(""), children: [
1428
1437
  t("searchTerm", "Search"),
1429
1438
  ": ",
1430
1439
  query.searchText
@@ -1440,7 +1449,7 @@ function GroupBy({ options, value, onChange }) {
1440
1449
  const [selected2, setSelected] = useState2(valid(value) ? value : null);
1441
1450
  useEffect3(() => setSelected(valid(value) ? value : null), [value]);
1442
1451
  const item = (id, label) => /* @__PURE__ */ jsx4(CxMenuItem, { className: selected2 === id ? table_chrome_default.groupBySelected : table_chrome_default.groupByOption, value: id ?? offGroup, type: "checkbox", checked: selected2 === id, children: label }, id ?? offGroup);
1443
- return /* @__PURE__ */ jsx4(CxDropdown, { hoist: true, classNames: { base: table_chrome_default.groupBy }, trigger: /* @__PURE__ */ jsx4(CxButton, { caret: true, children: t("groupBy", "Group by") }), children: /* @__PURE__ */ jsxs(CxMenu, { onSelect: (detail) => {
1452
+ return /* @__PURE__ */ jsx4(CxDropdown, { hoist: true, classNames: { base: table_chrome_default.groupBy }, trigger: /* @__PURE__ */ jsx4(CxButton, { caret: true, children: t("groupBy", "Group by") }), children: /* @__PURE__ */ jsxs2(CxMenu, { onSelect: (detail) => {
1444
1453
  const id = detail.item.value === offGroup ? null : String(detail.item.value);
1445
1454
  if (id !== null && !valid(id)) return;
1446
1455
  setSelected(id);
@@ -1591,6 +1600,9 @@ function getRowId(row, field) {
1591
1600
  }
1592
1601
  return synthetic;
1593
1602
  }
1603
+ function preserveRowIdentity(source, copy, field) {
1604
+ if (source[field] == null) syntheticIds.set(copy, getRowId(source, field));
1605
+ }
1594
1606
  function scopeSelection(state, universe) {
1595
1607
  return state.mode === "all" && state.universe !== universe ? { mode: "explicit", ids: [] } : state;
1596
1608
  }
@@ -1733,9 +1745,15 @@ var component_default4 = {
1733
1745
  };
1734
1746
 
1735
1747
  // packages/react/src/molecules/table/component.tsx
1736
- import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
1748
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
1737
1749
  var emptyRows = [];
1738
1750
  var emptyColumns = [];
1751
+ function cloneRows(rows, field) {
1752
+ const copies = [];
1753
+ const result = Helpers.deepClone(rows, void 0, copies);
1754
+ for (const { subject, copy } of copies) preserveRowIdentity(subject, copy, field);
1755
+ return result;
1756
+ }
1739
1757
  var explicitEmpty = () => ({ mode: "explicit", ids: [] });
1740
1758
  var aborted = () => new DOMException("Table request superseded", "AbortError");
1741
1759
  var clipboard = (p) => p.noClipboard ? false : p.readOnly ? p.clipboardAction === "paste" ? false : "copy" : p.clipboardAction === "copy" || p.clipboardAction === "paste" ? p.clipboardAction : true;
@@ -1829,7 +1847,9 @@ function projectTableOptions(p) {
1829
1847
  layoutColumnsOnNewData: true,
1830
1848
  selectableRange: p.noSelectable ? false : p.selectableRange ?? 1,
1831
1849
  showPaginationInput: !p.hidePaginationInput,
1832
- rowHeader: p.rowHeader ?? (p.movableRows ? { rowHandle: true, formatter: "handle", width: 40, headerSort: false } : p.responsiveLayout === "collapse" ? { formatter: "responsiveCollapse" } : void 0)
1850
+ // Pinned table.utils.ts movableRowDefaultRowHeader uses a centered menu
1851
+ // icon, not the engine's generic three-bar handle formatter.
1852
+ rowHeader: p.rowHeader ?? (p.movableRows ? { rowHandle: true, formatter: "icon", formatterParams: { icon: "menu" }, hozAlign: "center", title: "", width: 40, minWidth: 40, resizable: false, headerSort: false } : p.responsiveLayout === "collapse" ? { formatter: "responsiveCollapse" } : void 0)
1833
1853
  };
1834
1854
  return {
1835
1855
  ...p.engineOptions,
@@ -2042,7 +2062,10 @@ function CxTable(props) {
2042
2062
  const count = p.eligibleRowCount ?? remote.eligibleCount;
2043
2063
  if (!key || count === void 0) throw new Error("Remote select-all requires an authoritative eligibility count and universe");
2044
2064
  proposeSelection({ mode: "all", universe: key, excludedIds: [] });
2045
- } else proposeSelection(selectEnabled(getRows(true), p.rowIdField ?? "id", (row) => canSelectData(p, columnsRef.current, row)));
2065
+ } else {
2066
+ const rows = fullRows.current ? getRows(true) : engine.current?.getRows("active")?.map((row) => row.getData()) ?? p.data ?? emptyRows;
2067
+ proposeSelection(selectEnabled(rows, p.rowIdField ?? "id", (row) => canSelectData(p, columnsRef.current, row)));
2068
+ }
2046
2069
  }, [getRows, proposeSelection, remote]);
2047
2070
  const resolvedColumns = useCallback(() => {
2048
2071
  const adapt = (items) => items.map(({ renderCell, columns: children, ...column }) => ({
@@ -2134,7 +2157,7 @@ function CxTable(props) {
2134
2157
  setLoading(true);
2135
2158
  setError(null);
2136
2159
  try {
2137
- const { loadTableFile } = await import("./table-data-loader-K4AKR7WY.js");
2160
+ const { loadTableFile } = await import("./table-data-loader-FSL3V674.js");
2138
2161
  abort.signal.throwIfAborted();
2139
2162
  let resolved = [...columnsRef.current];
2140
2163
  let firstPage = false;
@@ -2260,7 +2283,7 @@ function CxTable(props) {
2260
2283
  },
2261
2284
  refresh: async () => {
2262
2285
  if (latest.current.dataUrl) await loadFileRef.current();
2263
- else await engine.current?.replaceData(remoteMode ? void 0 : [...latest.current.data ?? []]);
2286
+ else await engine.current?.replaceData(remoteMode ? void 0 : cloneRows(latest.current.data ?? [], latest.current.rowIdField ?? "id"));
2264
2287
  },
2265
2288
  getData: (options2) => getRows(options2?.filtered),
2266
2289
  exportData,
@@ -2321,7 +2344,7 @@ function CxTable(props) {
2321
2344
  started = true;
2322
2345
  observer?.disconnect();
2323
2346
  try {
2324
- const [module, helpers, native] = await Promise.all([(latest.current.loadEngine ?? loadTableEngine)(), import("./table-in-memory-data-4YEZ7VQ6.js"), import("./native-utils-26NGKBHJ.js")]);
2347
+ const [module, helpers, native] = await Promise.all([(latest.current.loadEngine ?? loadTableEngine)(), import("./table-in-memory-data-QEELMKFV.js"), import("./native-utils-26NGKBHJ.js")]);
2325
2348
  if (!alive() || !host.current) return;
2326
2349
  memory.current = helpers;
2327
2350
  slotRequest.current = (cell, renderCell) => {
@@ -2349,7 +2372,9 @@ function CxTable(props) {
2349
2372
  } }
2350
2373
  ] } : {}
2351
2374
  },
2352
- data: p.dataUrl ? [] : remoteSource ? void 0 : [...p.data ?? []],
2375
+ // The engine mutates row fields, including nested fields. Keep raw
2376
+ // React input intact so a refresh/reconstruction starts a fresh load.
2377
+ data: p.dataUrl ? [] : remoteSource ? void 0 : cloneRows(p.data ?? [], p.rowIdField ?? "id"),
2353
2378
  ajaxURL: p.ajaxURL,
2354
2379
  ajaxRequestFunc: remoteSource ? requestPage : void 0,
2355
2380
  ajaxConfig: { method: p.ajaxMethod ?? "GET" },
@@ -2505,16 +2530,16 @@ function CxTable(props) {
2505
2530
  const alive = () => generation.current === epoch && engine.current === table;
2506
2531
  applied.current = { table, query, data: props.data, columns };
2507
2532
  const reconcile = async () => {
2533
+ if (columnsChanged) {
2534
+ await replaceColumnsReady(table, resolvedColumns(), transaction.abort.signal);
2535
+ if (!alive()) return;
2536
+ }
2508
2537
  if (dataChanged) {
2509
2538
  replacingData.current = true;
2510
- await table.replaceData([...props.data ?? []]);
2539
+ await table.replaceData(cloneRows(props.data ?? [], props.rowIdField ?? "id"));
2511
2540
  if (!alive()) return;
2512
2541
  replacingData.current = false;
2513
2542
  }
2514
- if (columnsChanged) {
2515
- await replaceColumnsReady(table, resolvedColumns(), transaction.abort.signal);
2516
- if (!alive()) return;
2517
- }
2518
2543
  if (!old || columnsChanged || old.searchText !== query.searchText || !equalValue(old.filters, query.filters)) table.setFilter(projectFilters(query, () => table, props));
2519
2544
  if (!old || columnsChanged || !equalValue(old.headerFilters, query.headerFilters)) {
2520
2545
  const filterModule = table.modules?.filter;
@@ -2658,9 +2683,9 @@ function CxTable(props) {
2658
2683
  }
2659
2684
  }
2660
2685
  );
2661
- return /* @__PURE__ */ jsx5(TableContext.Provider, { value: { messages: props.messages, readOnly: props.readOnly }, children: /* @__PURE__ */ jsxs2("div", { ...props.rootProps, ref: element, inert: props.disabled || props.rootProps?.inert, "aria-disabled": props.disabled || void 0, className: [component_default4.root, props.rootProps?.className, props.className].filter(Boolean).join(" "), style: { ...props.rootProps?.style, ...props.style }, dir: provider.dir, children: [
2686
+ return /* @__PURE__ */ jsx5(TableContext.Provider, { value: { messages: props.messages, readOnly: props.readOnly }, children: /* @__PURE__ */ jsxs3("div", { ...props.rootProps, ref: element, inert: props.disabled || props.rootProps?.inert, "aria-disabled": props.disabled || void 0, className: [component_default4.root, props.rootProps?.className, props.className].filter(Boolean).join(" "), style: { ...props.rootProps?.style, ...props.style }, dir: provider.dir, children: [
2662
2687
  chrome,
2663
- /* @__PURE__ */ jsxs2("div", { className: component_default4.frame, "aria-busy": Boolean(props.loading || busy || externalBusy), children: [
2688
+ /* @__PURE__ */ jsxs3("div", { className: component_default4.frame, "aria-busy": Boolean(props.loading || busy || externalBusy), children: [
2664
2689
  /* @__PURE__ */ jsx5("div", { ...props.gridProps, ref: host, className: [component_default4.host, props.gridProps?.className].filter(Boolean).join(" "), "aria-label": props.gridProps?.["aria-label"] ?? props.label, "aria-disabled": props.disabled || void 0, "aria-readonly": props.readOnly || void 0 }),
2665
2690
  (props.loading || busy || externalBusy) && /* @__PURE__ */ jsx5("div", { className: "table-loading", role: "status", "aria-label": text2("loading", "Loading"), children: /* @__PURE__ */ jsx5(CxSpinner, {}) })
2666
2691
  ] }),
@@ -0,0 +1,61 @@
1
+ // packages/react/src/molecules/table/engine/core/tools/Helpers.ts
2
+ var Helpers = class {
3
+ static elVisible(el) {
4
+ return !(el.offsetWidth <= 0 && el.offsetHeight <= 0);
5
+ }
6
+ static elOffset(el) {
7
+ const box = el.getBoundingClientRect();
8
+ return {
9
+ left: box.left + window.pageXOffset - document.documentElement.clientLeft,
10
+ top: box.top + window.pageYOffset - document.documentElement.clientTop
11
+ };
12
+ }
13
+ static retrieveNestedData(separator, field, data) {
14
+ const structure = separator ? field.split(separator) : [field];
15
+ const length = structure.length;
16
+ let output;
17
+ for (let i = 0; i < length; i++) {
18
+ if (data === null || data === void 0) {
19
+ output = data;
20
+ break;
21
+ }
22
+ data = data[structure[i]];
23
+ output = data;
24
+ if (data === null || data === void 0) {
25
+ break;
26
+ }
27
+ }
28
+ return output;
29
+ }
30
+ static deepClone(obj, clone, list = []) {
31
+ const objectProto = Object.getPrototypeOf({});
32
+ const arrayProto = Object.getPrototypeOf([]);
33
+ if (!clone) {
34
+ clone = Object.assign(Array.isArray(obj) ? [] : {}, obj);
35
+ }
36
+ for (const i in obj) {
37
+ if (Object.hasOwn(obj, i)) {
38
+ const subject = obj[i];
39
+ let match;
40
+ let copy;
41
+ if (subject != null && typeof subject === "object" && (Object.getPrototypeOf(subject) === objectProto || Object.getPrototypeOf(subject) === arrayProto)) {
42
+ match = list.findIndex((item) => {
43
+ return item.subject === subject;
44
+ });
45
+ if (match > -1) {
46
+ clone[i] = list[match].copy;
47
+ } else {
48
+ copy = Object.assign(Array.isArray(subject) ? [] : {}, subject);
49
+ list.unshift({ copy, subject });
50
+ clone[i] = this.deepClone(subject, copy, list);
51
+ }
52
+ }
53
+ }
54
+ }
55
+ return clone;
56
+ }
57
+ };
58
+
59
+ export {
60
+ Helpers
61
+ };
@@ -13,6 +13,9 @@ import {
13
13
  setSanitizedHTML,
14
14
  starPolygon
15
15
  } from "./chunk-XF63X67O.js";
16
+ import {
17
+ Helpers
18
+ } from "./chunk-JKPFPEBM.js";
16
19
 
17
20
  // packages/react/src/molecules/table/engine/core/CoreFeature.ts
18
21
  var CoreFeature = class {
@@ -128,64 +131,6 @@ var CoreFeature = class {
128
131
  }
129
132
  };
130
133
 
131
- // packages/react/src/molecules/table/engine/core/tools/Helpers.ts
132
- var Helpers = class {
133
- static elVisible(el) {
134
- return !(el.offsetWidth <= 0 && el.offsetHeight <= 0);
135
- }
136
- static elOffset(el) {
137
- const box = el.getBoundingClientRect();
138
- return {
139
- left: box.left + window.pageXOffset - document.documentElement.clientLeft,
140
- top: box.top + window.pageYOffset - document.documentElement.clientTop
141
- };
142
- }
143
- static retrieveNestedData(separator, field, data) {
144
- const structure = separator ? field.split(separator) : [field];
145
- const length = structure.length;
146
- let output;
147
- for (let i = 0; i < length; i++) {
148
- if (data === null || data === void 0) {
149
- output = data;
150
- break;
151
- }
152
- data = data[structure[i]];
153
- output = data;
154
- if (data === null || data === void 0) {
155
- break;
156
- }
157
- }
158
- return output;
159
- }
160
- static deepClone(obj, clone, list = []) {
161
- const objectProto = Object.getPrototypeOf({});
162
- const arrayProto = Object.getPrototypeOf([]);
163
- if (!clone) {
164
- clone = Object.assign(Array.isArray(obj) ? [] : {}, obj);
165
- }
166
- for (const i in obj) {
167
- if (Object.hasOwn(obj, i)) {
168
- const subject = obj[i];
169
- let match;
170
- let copy;
171
- if (subject != null && typeof subject === "object" && (Object.getPrototypeOf(subject) === objectProto || Object.getPrototypeOf(subject) === arrayProto)) {
172
- match = list.findIndex((item) => {
173
- return item.subject === subject;
174
- });
175
- if (match > -1) {
176
- clone[i] = list[match].copy;
177
- } else {
178
- copy = Object.assign(Array.isArray(subject) ? [] : {}, subject);
179
- list.unshift({ copy, subject });
180
- clone[i] = this.deepClone(subject, copy, list);
181
- }
182
- }
183
- }
184
- }
185
- return clone;
186
- }
187
- };
188
-
189
134
  // packages/react/src/molecules/table/engine/core/tools/Popup.ts
190
135
  var isDebug = ENGINE_DEBUG;
191
136
  var Popup = class _Popup extends CoreFeature {
@@ -792,6 +737,7 @@ function isValidColor(value) {
792
737
  }
793
738
 
794
739
  // packages/react/src/molecules/table/engine/modules/Format/defaults/formatters/composite.ts
740
+ var sourceSpaceSpacings = /* @__PURE__ */ new Set(["3x-small", "2x-small", "x-small", "small", "medium", "large", "x-large", "2x-large", "3x-large", "4x-large"]);
795
741
  function getElementWrapper({
796
742
  spacing,
797
743
  style
@@ -931,13 +877,14 @@ function composite(cell, formatterParams, onRendered) {
931
877
  style: {
932
878
  display: "flex",
933
879
  flexDirection: resolvedDirection === "vertical" ? "column" : "row",
934
- gap: `var(--cx-spacing-${spacing})`,
880
+ gap: "var(--cx-table-composite-gap, var(--cx-spacing-large))",
935
881
  alignItems: align ?? "center",
936
882
  flexWrap: wrap ?? "nowrap",
937
883
  justifyContent: resolvedJustify,
938
884
  ...containerStyle ?? {}
939
885
  }
940
886
  });
887
+ if (sourceSpaceSpacings.has(spacing)) container.style.setProperty("--cx-table-composite-gap", `var(--cx-spacing-${spacing})`);
941
888
  const renderedSegments = [];
942
889
  formatterParams.elements.forEach((elementConfig) => {
943
890
  const rawElementValue = resolveElementValue({
@@ -1173,7 +1120,7 @@ function handle_default(cell, _formatterParams, _onRendered) {
1173
1120
  if (element) {
1174
1121
  element.classList.add("tabulator-row-handle");
1175
1122
  }
1176
- return "<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>";
1123
+ return bridgedFormatter(cell, "handle", {}, "");
1177
1124
  }
1178
1125
 
1179
1126
  // packages/react/src/molecules/table/engine/modules/Format/defaults/formatters/html.ts
@@ -5587,7 +5534,6 @@ var Validate = class _Validate extends Module {
5587
5534
 
5588
5535
  export {
5589
5536
  CoreFeature,
5590
- Helpers,
5591
5537
  Module,
5592
5538
  CellComponent,
5593
5539
  Format,
@@ -3,12 +3,11 @@ import {
3
3
  CoreFeature,
4
4
  Filter,
5
5
  Format,
6
- Helpers,
7
6
  Module,
8
7
  Sort,
9
8
  VALIDATION_MESSAGE_ATTRIBUTE,
10
9
  Validate
11
- } from "./chunk-G6UZTQ2O.js";
10
+ } from "./chunk-LFPE2WL6.js";
12
11
  import {
13
12
  CellSlotRegistry,
14
13
  CellSlotRequest,
@@ -29,9 +28,12 @@ import {
29
28
  svgElement,
30
29
  trailingDebounce
31
30
  } from "./chunk-XF63X67O.js";
31
+ import {
32
+ Helpers
33
+ } from "./chunk-JKPFPEBM.js";
32
34
  import {
33
35
  DEFAULT_GROUP_INDENT
34
- } from "./chunk-J5K7C2MK.js";
36
+ } from "./chunk-2RI7YDCC.js";
35
37
  import "./chunk-DA53AICR.js";
36
38
  import {
37
39
  __export
@@ -14078,6 +14080,10 @@ var Mutator = class _Mutator extends Module {
14078
14080
  static mutators = mutators_default;
14079
14081
  allowedTypes;
14080
14082
  enabled;
14083
+ // File rows are materialized before whole-file validation/filtering. They
14084
+ // can enter the engine repeatedly (first paint, completion, paging) without
14085
+ // becoming new input. Keep ownership out of the user's row data.
14086
+ preparedRows = /* @__PURE__ */ new WeakSet();
14081
14087
  constructor(table) {
14082
14088
  super(table);
14083
14089
  this.allowedTypes = ["", "data", "edit", "clipboard", "import"];
@@ -14102,8 +14108,14 @@ var Mutator = class _Mutator extends Module {
14102
14108
  this.subscribe("row-data-changing", this.rowDataChanged.bind(this));
14103
14109
  }
14104
14110
  rowDataChanged(row, tempData, updatedData) {
14111
+ if (updatedData === void 0 && this.preparedRows.has(tempData)) return tempData;
14105
14112
  return this.transformRow(tempData, "data", updatedData);
14106
14113
  }
14114
+ prepareRow(data) {
14115
+ if (this.preparedRows.has(data)) return;
14116
+ this.transformRow(data, "data");
14117
+ this.preparedRows.add(data);
14118
+ }
14107
14119
  // initialize column mutator
14108
14120
  initializeColumn(column) {
14109
14121
  let match = false;
@@ -1,4 +1,4 @@
1
- import "./chunk-J5K7C2MK.js";
1
+ import "./chunk-2RI7YDCC.js";
2
2
  import "./chunk-EXOVVZNP.js";
3
3
 
4
4
  // packages/react/src/molecules/table/table-csv-parser.ts
@@ -6,9 +6,10 @@ import {
6
6
  retainValidationWorker,
7
7
  rule_functions_default,
8
8
  validateBatch
9
- } from "./chunk-G6UZTQ2O.js";
9
+ } from "./chunk-LFPE2WL6.js";
10
10
  import "./chunk-XF63X67O.js";
11
- import "./chunk-J5K7C2MK.js";
11
+ import "./chunk-JKPFPEBM.js";
12
+ import "./chunk-2RI7YDCC.js";
12
13
  import "./chunk-DA53AICR.js";
13
14
  import "./chunk-EXOVVZNP.js";
14
15
 
@@ -272,7 +273,7 @@ function applyInMemoryDataMutators(rows, tabulatorInstance) {
272
273
  if (!mutatorModule) {
273
274
  return;
274
275
  }
275
- rows.forEach((row) => mutatorModule.transformRow(row, "data"));
276
+ rows.forEach((row) => mutatorModule.prepareRow(row));
276
277
  }
277
278
  function stampInMemoryMutateOnValidateRows(rows, columns, fromRowIndex, toRowIndex, validationResult) {
278
279
  const mutateOnValidateColumns = columns.filter(
package/dist/index.css CHANGED
@@ -25269,6 +25269,7 @@ button.component_dot-status {
25269
25269
  max-width: 100%;
25270
25270
  }
25271
25271
  .tabulator-slot[data-slot-kind=row-selection],
25272
+ .tabulator-slot[data-slot-kind=formatter]:has(> .tabulator-row-handle-box:only-child),
25272
25273
  .tabulator-slot[data-slot-kind=formatter]:has(> .tabulator-native-icon:only-child) {
25273
25274
  display: contents;
25274
25275
  }
package/dist/index.js CHANGED
@@ -27,8 +27,9 @@ import {
27
27
  } from "./chunks/chunk-Y7DTJRRL.js";
28
28
  import {
29
29
  CxTable
30
- } from "./chunks/chunk-NWKL2L5H.js";
31
- import "./chunks/chunk-J5K7C2MK.js";
30
+ } from "./chunks/chunk-652ZUGRK.js";
31
+ import "./chunks/chunk-JKPFPEBM.js";
32
+ import "./chunks/chunk-2RI7YDCC.js";
32
33
  import {
33
34
  CxTypeSubtypeSelect,
34
35
  decodeRowToken,
package/dist/table.css CHANGED
@@ -9116,6 +9116,7 @@ span.component_custom-icon--svg svg {
9116
9116
  max-width: 100%;
9117
9117
  }
9118
9118
  .tabulator-slot[data-slot-kind=row-selection],
9119
+ .tabulator-slot[data-slot-kind=formatter]:has(> .tabulator-row-handle-box:only-child),
9119
9120
  .tabulator-slot[data-slot-kind=formatter]:has(> .tabulator-native-icon:only-child) {
9120
9121
  display: contents;
9121
9122
  }
package/dist/table.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import './table.css';
2
2
  import {
3
3
  CxTable
4
- } from "./chunks/chunk-NWKL2L5H.js";
4
+ } from "./chunks/chunk-652ZUGRK.js";
5
+ import "./chunks/chunk-JKPFPEBM.js";
5
6
  import {
6
7
  DataSource,
7
8
  DateFilterCompareFormat,
@@ -10,7 +11,7 @@ import {
10
11
  SortDirection,
11
12
  TableClipboardAction,
12
13
  TableDataFormat
13
- } from "./chunks/chunk-J5K7C2MK.js";
14
+ } from "./chunks/chunk-2RI7YDCC.js";
14
15
  import "./chunks/chunk-4JG5JUIF.js";
15
16
  import "./chunks/chunk-WSU5KT62.js";
16
17
  import "./chunks/chunk-3XSIYTL5.js";
@@ -1,2 +1,3 @@
1
- export default function (this: any, cell: any, _formatterParams: any, _onRendered: (callback: () => void) => void): string;
1
+ import { type CellSlotRequest } from '../../../../native-utils';
2
+ export default function (this: any, cell: any, _formatterParams: any, _onRendered: (callback: () => void) => void): CellSlotRequest;
2
3
  //# sourceMappingURL=handle.d.ts.map
@@ -9,9 +9,11 @@ export default class Mutator extends Module {
9
9
  static readonly mutators: Record<string, MutatorFunction>;
10
10
  allowedTypes: string[];
11
11
  enabled: boolean;
12
+ private readonly preparedRows;
12
13
  constructor(table: Tabulator);
13
14
  initialize(): void;
14
15
  rowDataChanged(row: Row, tempData: any, updatedData: any): any;
16
+ prepareRow(data: Record<string, unknown>): void;
15
17
  initializeColumn(column: Column): void;
16
18
  lookupMutator(value: string | MutatorFunction | undefined): MutatorFunction | false;
17
19
  transformRow(data: any, type: string, updatedData?: any): any;
@@ -3375,7 +3375,7 @@ export declare enum DateFilterCompareFormat {
3375
3375
  export type EngineRowId = string | number;
3376
3376
  export type CellSlotDetachReason = 'virtualized' | 'column-hidden' | 'table-hidden';
3377
3377
  export type CellSlotReleaseReason = 'content-replaced' | 'row-replaced' | 'row-removed' | 'column-removed' | 'destroyed';
3378
- export type BridgedFormatterName = 'avatar' | 'date' | 'diff' | 'icon' | 'number' | 'switch' | 'tag' | 'time' | 'typography';
3378
+ export type BridgedFormatterName = 'avatar' | 'date' | 'diff' | 'handle' | 'icon' | 'number' | 'switch' | 'tag' | 'time' | 'typography';
3379
3379
  /**
3380
3380
  * Option/prefix content the pinned list editor put into cx-option / the
3381
3381
  * cx-select prefix slot: sanitized HTML (string labels/getItemLabel/prefix
@@ -16,6 +16,8 @@ export interface TableSelectionSummary {
16
16
  /** True when the row carries its own identity in `field`. */
17
17
  export declare function hasRowId(row: object, field: string): boolean;
18
18
  export declare function getRowId(row: object, field: string): TableRowId;
19
+ /** Engine-owned copies retain the semantic identity of unindexed input rows. */
20
+ export declare function preserveRowIdentity(source: object, copy: object, field: string): void;
19
21
  export declare function scopeSelection(state: TableSelection, universe: string): TableSelection;
20
22
  export declare function selected(state: TableSelection, id: TableRowId, universe?: string): boolean;
21
23
  export declare function toggleSelection(state: TableSelection, id: TableRowId, checked: boolean): TableSelection;
@@ -125,8 +125,8 @@ export declare function refreshInMemoryMutateOnValidateColumns(columns: ColumnDe
125
125
  * `CoreField.*` targets in the ingest review flow) must exist on every raw
126
126
  * row before worker validation reads them — otherwise rows on never-loaded
127
127
  * pages validate against `undefined` and every rule silently passes.
128
- * `transformRow` is idempotent here (copy mutators re-derive from source
129
- * fields), so re-running it when a page later loads is harmless.
128
+ * Mutators need not be idempotent. Mark these materialized rows so engine
129
+ * initialization does not transform them again on first paint or later pages.
130
130
  */
131
131
  export declare function applyInMemoryDataMutators(rows: Array<Record<string, unknown>>, tabulatorInstance: Tabulator | null): void;
132
132
  /**
package/package.json CHANGED
@@ -591,7 +591,7 @@
591
591
  "default": "./dist/assets/font-face.css"
592
592
  }
593
593
  },
594
- "version": "1.0.0-alpha.6",
594
+ "version": "1.0.0-alpha.8",
595
595
  "files": [
596
596
  "dist"
597
597
  ],