@drivenets/design-system 0.12.1 → 0.13.0

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 (81) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/index.cjs +1097 -308
  3. package/dist/index.d.cts +1118 -982
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +1118 -982
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1089 -309
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +31 -31
  11. package/src/components/ds-date-input/ds-date-input.utils.ts +2 -2
  12. package/src/components/ds-drawer/ds-drawer.tsx +2 -0
  13. package/src/components/ds-form-control/ds-form-control.tsx +14 -11
  14. package/src/components/ds-form-control/ds-form-control.types.ts +4 -0
  15. package/src/components/ds-grid/ds-grid.tsx +1 -2
  16. package/src/components/ds-modal/ds-modal.tsx +3 -0
  17. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.module.scss +21 -2
  18. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx +14 -11
  19. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +1 -6
  20. package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +2 -2
  21. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +2 -0
  22. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx +42 -11
  23. package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +24 -4
  24. package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +22 -1
  25. package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +22 -0
  26. package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +1 -0
  27. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +19 -0
  28. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +2 -1
  29. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.types.ts +1 -1
  30. package/src/components/ds-table/components/edit/cell-editors/cell-editors.module.scss +3 -0
  31. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx +27 -0
  32. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx +50 -0
  33. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx +51 -0
  34. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx +36 -0
  35. package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx +50 -0
  36. package/src/components/ds-table/components/edit/cell-editors/index.ts +14 -0
  37. package/src/components/ds-table/components/edit/cell-editors/table-edit-form-control.tsx +31 -0
  38. package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.module.scss +28 -0
  39. package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx +39 -0
  40. package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.types.ts +7 -0
  41. package/src/components/ds-table/components/edit/ds-table-editable-cell/index.ts +2 -0
  42. package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.module.scss +48 -0
  43. package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx +76 -0
  44. package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.types.ts +5 -0
  45. package/src/components/ds-table/components/edit/ds-table-editing-cell/index.ts +2 -0
  46. package/src/components/ds-table/context/ds-table-context.ts +79 -1
  47. package/src/components/ds-table/ds-table-column.types.ts +12 -0
  48. package/src/components/ds-table/ds-table.module.scss +100 -10
  49. package/src/components/ds-table/ds-table.tsx +18 -19
  50. package/src/components/ds-table/ds-table.types.ts +52 -0
  51. package/src/components/ds-table/filters/adapters/create-checkbox-filter-adapter.tsx +24 -40
  52. package/src/components/ds-table/filters/adapters/create-dual-range-filter-adapter.tsx +10 -31
  53. package/src/components/ds-table/filters/adapters/create-filter-adapter.ts +6 -98
  54. package/src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.module.scss +36 -0
  55. package/src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.tsx +92 -13
  56. package/src/components/ds-table/filters/components/checkbox-filter/index.ts +1 -1
  57. package/src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.module.scss +42 -0
  58. package/src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.tsx +89 -0
  59. package/src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.types.ts +25 -0
  60. package/src/components/ds-table/filters/components/column-filter-popover/index.ts +5 -0
  61. package/src/components/ds-table/filters/hooks/use-table-filters.ts +113 -78
  62. package/src/components/ds-table/filters/index.ts +2 -44
  63. package/src/components/ds-table/filters/types/column-meta.augmentation.ts +19 -0
  64. package/src/components/ds-table/filters/types/filter-adapter.types.ts +48 -81
  65. package/src/components/ds-table/hooks/use-cell-editor.ts +81 -0
  66. package/src/components/ds-table/index.ts +29 -0
  67. package/src/components/ds-table/utils/column-size.ts +9 -8
  68. package/src/components/ds-tag/ds-tag.tsx +2 -2
  69. package/src/components/ds-workspace-layout/ds-workspace-layout.context.ts +19 -0
  70. package/src/components/ds-workspace-layout/ds-workspace-layout.module.scss +166 -0
  71. package/src/components/ds-workspace-layout/ds-workspace-layout.tsx +135 -0
  72. package/src/components/ds-workspace-layout/ds-workspace-layout.types.ts +52 -0
  73. package/src/components/ds-workspace-layout/index.ts +11 -0
  74. package/src/index.ts +1 -1
  75. package/src/styles/_scrollbars.scss +37 -0
  76. package/src/utils/restore-document-body-modal-styles.ts +44 -0
  77. package/src/utils/use-ark-dialog-body-lock-cleanup.ts +36 -0
  78. package/src/components/ds-workspace/ds-workspace.module.scss +0 -55
  79. package/src/components/ds-workspace/ds-workspace.tsx +0 -37
  80. package/src/components/ds-workspace/ds-workspace.types.ts +0 -17
  81. package/src/components/ds-workspace/index.ts +0 -8
package/dist/index.cjs CHANGED
@@ -3225,7 +3225,7 @@ const Title$2 = (t0) => {
3225
3225
  } else t2 = $[5];
3226
3226
  return t2;
3227
3227
  };
3228
- const Body$4 = (t0) => {
3228
+ const Body$5 = (t0) => {
3229
3229
  const $ = (0, react_compiler_runtime.c)(6);
3230
3230
  const { style, className, children } = t0;
3231
3231
  let t1;
@@ -3273,7 +3273,7 @@ const Actions$3 = (t0) => {
3273
3273
  return t2;
3274
3274
  };
3275
3275
  DsAlertBanner.Title = Title$2;
3276
- DsAlertBanner.Body = Body$4;
3276
+ DsAlertBanner.Body = Body$5;
3277
3277
  DsAlertBanner.Actions = Actions$3;
3278
3278
  //#endregion
3279
3279
  //#region src/components/ds-alert-banner/ds-alert-banner.types.ts
@@ -5549,7 +5549,7 @@ const Header$4 = (t0) => {
5549
5549
  /**
5550
5550
  * Card body - main content area.
5551
5551
  */
5552
- const Body$3 = (t0) => {
5552
+ const Body$4 = (t0) => {
5553
5553
  const $ = (0, react_compiler_runtime.c)(12);
5554
5554
  let children;
5555
5555
  let className;
@@ -5637,7 +5637,7 @@ const Footer$3 = (t0) => {
5637
5637
  const DsCard = {
5638
5638
  Root: Root$2,
5639
5639
  Header: Header$4,
5640
- Body: Body$3,
5640
+ Body: Body$4,
5641
5641
  Footer: Footer$3
5642
5642
  };
5643
5643
  //#endregion
@@ -5675,7 +5675,7 @@ const useDsCatalogLayoutContext = () => {
5675
5675
  };
5676
5676
  //#endregion
5677
5677
  //#region src/components/ds-catalog-layout/ds-catalog-layout.tsx
5678
- const DEFAULT_LOCALE = Object.freeze({
5678
+ const DEFAULT_LOCALE$1 = Object.freeze({
5679
5679
  pinButtonLabel: "Pin side menu",
5680
5680
  unpinButtonLabel: "Unpin side menu"
5681
5681
  });
@@ -5780,7 +5780,7 @@ const Header$3 = (t0) => {
5780
5780
  } else t2 = $[7];
5781
5781
  return t2;
5782
5782
  };
5783
- const Body$2 = (t0) => {
5783
+ const Body$3 = (t0) => {
5784
5784
  const $ = (0, react_compiler_runtime.c)(8);
5785
5785
  let className;
5786
5786
  let rest;
@@ -5811,7 +5811,7 @@ const Body$2 = (t0) => {
5811
5811
  } else t2 = $[7];
5812
5812
  return t2;
5813
5813
  };
5814
- const SideMenu = (t0) => {
5814
+ const SideMenu$1 = (t0) => {
5815
5815
  const $ = (0, react_compiler_runtime.c)(32);
5816
5816
  let children;
5817
5817
  let className;
@@ -5857,7 +5857,7 @@ const SideMenu = (t0) => {
5857
5857
  }
5858
5858
  (0, react.useEffect)(t2, t3);
5859
5859
  const isExpanded = pinned || isHovering;
5860
- const ariaLabel = pinned ? locale?.unpinButtonLabel ?? DEFAULT_LOCALE.unpinButtonLabel : locale?.pinButtonLabel ?? DEFAULT_LOCALE.pinButtonLabel;
5860
+ const ariaLabel = pinned ? locale?.unpinButtonLabel ?? DEFAULT_LOCALE$1.unpinButtonLabel : locale?.pinButtonLabel ?? DEFAULT_LOCALE$1.pinButtonLabel;
5861
5861
  let t4;
5862
5862
  if ($[11] !== className) {
5863
5863
  t4 = (0, classnames.default)(ds_catalog_layout_module_default.sideMenu, className);
@@ -6050,8 +6050,8 @@ const ContentHeader = (t0) => {
6050
6050
  return t6;
6051
6051
  };
6052
6052
  DsCatalogLayout.Header = Header$3;
6053
- DsCatalogLayout.Body = Body$2;
6054
- DsCatalogLayout.SideMenu = SideMenu;
6053
+ DsCatalogLayout.Body = Body$3;
6054
+ DsCatalogLayout.SideMenu = SideMenu$1;
6055
6055
  DsCatalogLayout.Content = Content$1;
6056
6056
  DsCatalogLayout.ContentHeader = ContentHeader;
6057
6057
  //#endregion
@@ -8278,6 +8278,78 @@ var ds_drawer_module_default = {
8278
8278
  "toolbar": "MWmQHa_toolbar"
8279
8279
  };
8280
8280
  //#endregion
8281
+ //#region src/utils/restore-document-body-modal-styles.ts
8282
+ const SCROLL_LOCK_ATTRIBUTE = "data-scroll-lock";
8283
+ const INERT_ATTRIBUTE = "data-inert";
8284
+ const ARIA_HIDDEN_MARKER = "data-aria-hidden";
8285
+ /**
8286
+ * Clears document body styles and attributes left by Zag dialog modal effects when a
8287
+ * dialog instance tears down without a normal close transition.
8288
+ *
8289
+ * No-op unless a leak sentinel is present: in the common case Zag restores the body on
8290
+ * unmount itself, and we must not clobber styles the host app owns.
8291
+ */
8292
+ const restoreDocumentBodyModalStyles = (doc = document) => {
8293
+ const { body, documentElement } = doc;
8294
+ if (!(body.hasAttribute(SCROLL_LOCK_ATTRIBUTE) || body.hasAttribute(INERT_ATTRIBUTE) || body.style.pointerEvents === "none")) return;
8295
+ body.removeAttribute(SCROLL_LOCK_ATTRIBUTE);
8296
+ body.removeAttribute(INERT_ATTRIBUTE);
8297
+ body.removeAttribute(ARIA_HIDDEN_MARKER);
8298
+ if (body.getAttribute("aria-hidden") === "true") body.removeAttribute("aria-hidden");
8299
+ body.style.removeProperty("overflow");
8300
+ body.style.removeProperty("pointer-events");
8301
+ body.style.removeProperty("position");
8302
+ body.style.removeProperty("top");
8303
+ body.style.removeProperty("left");
8304
+ body.style.removeProperty("right");
8305
+ if (body.style.length === 0) body.removeAttribute("style");
8306
+ documentElement.style.removeProperty("--scrollbar-width");
8307
+ };
8308
+ //#endregion
8309
+ //#region src/utils/use-ark-dialog-body-lock-cleanup.ts
8310
+ const activeBodyLockInstances = /* @__PURE__ */ new Set();
8311
+ const scheduleBodyLockRestoreIfIdle = () => {
8312
+ queueMicrotask(() => {
8313
+ if (activeBodyLockInstances.size > 0) return;
8314
+ restoreDocumentBodyModalStyles();
8315
+ });
8316
+ };
8317
+ /**
8318
+ * Ensures Zag dialog body scroll-lock and modal pointer blocking are released when
8319
+ * an Ark dialog unmounts while still open (e.g. close + conditional unmount + navigate).
8320
+ */
8321
+ const useArkDialogBodyLockCleanup = (open, enabled) => {
8322
+ const $ = (0, react_compiler_runtime.c)(5);
8323
+ let t0;
8324
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
8325
+ t0 = Symbol("ark-dialog-body-lock");
8326
+ $[0] = t0;
8327
+ } else t0 = $[0];
8328
+ const instanceIdRef = (0, react.useRef)(t0);
8329
+ let t1;
8330
+ let t2;
8331
+ if ($[1] !== enabled || $[2] !== open) {
8332
+ t1 = () => {
8333
+ if (!open || !enabled) return;
8334
+ const instanceId = instanceIdRef.current;
8335
+ activeBodyLockInstances.add(instanceId);
8336
+ return () => {
8337
+ activeBodyLockInstances.delete(instanceId);
8338
+ scheduleBodyLockRestoreIfIdle();
8339
+ };
8340
+ };
8341
+ t2 = [open, enabled];
8342
+ $[1] = enabled;
8343
+ $[2] = open;
8344
+ $[3] = t1;
8345
+ $[4] = t2;
8346
+ } else {
8347
+ t1 = $[3];
8348
+ t2 = $[4];
8349
+ }
8350
+ (0, react.useLayoutEffect)(t1, t2);
8351
+ };
8352
+ //#endregion
8281
8353
  //#region src/components/ds-drawer/ds-drawer.tsx
8282
8354
  const DsDrawer = (t0) => {
8283
8355
  const $ = (0, react_compiler_runtime.c)(25);
@@ -8289,6 +8361,7 @@ const DsDrawer = (t0) => {
8289
8361
  const closeOnInteractOutside = t5 === void 0 ? false : t5;
8290
8362
  const portal = t6 === void 0 ? false : t6;
8291
8363
  const resolvedColumns = useResponsiveValue(columns);
8364
+ useArkDialogBodyLockCleanup(open, backdrop);
8292
8365
  let t7;
8293
8366
  if ($[0] !== onOpenChange) {
8294
8367
  t7 = (details) => {
@@ -8477,7 +8550,7 @@ const Toolbar = (t0) => {
8477
8550
  } else t2 = $[5];
8478
8551
  return t2;
8479
8552
  };
8480
- const Body$1 = (t0) => {
8553
+ const Body$2 = (t0) => {
8481
8554
  const $ = (0, react_compiler_runtime.c)(6);
8482
8555
  const { style, className, children } = t0;
8483
8556
  let t1;
@@ -8550,7 +8623,7 @@ DsDrawer.Header = Header$2;
8550
8623
  DsDrawer.Title = Title$1;
8551
8624
  DsDrawer.CloseTrigger = CloseTrigger$1;
8552
8625
  DsDrawer.Toolbar = Toolbar;
8553
- DsDrawer.Body = Body$1;
8626
+ DsDrawer.Body = Body$2;
8554
8627
  DsDrawer.Footer = Footer$2;
8555
8628
  DsDrawer.Actions = Actions$1;
8556
8629
  //#endregion
@@ -9098,6 +9171,7 @@ const DsModal = (t0) => {
9098
9171
  const dividers = t2 === void 0 ? false : t2;
9099
9172
  const modal = t3 === void 0 ? true : t3;
9100
9173
  const closeOnInteractOutside = t4 === void 0 ? false : t4;
9174
+ useArkDialogBodyLockCleanup(open, modal);
9101
9175
  let t5;
9102
9176
  if ($[0] !== onOpenChange) {
9103
9177
  t5 = (details) => {
@@ -9244,7 +9318,7 @@ const CloseTrigger = (t0) => {
9244
9318
  } else t2 = $[3];
9245
9319
  return t2;
9246
9320
  };
9247
- const Body = (t0) => {
9321
+ const Body$1 = (t0) => {
9248
9322
  const $ = (0, react_compiler_runtime.c)(6);
9249
9323
  const { style, className, children } = t0;
9250
9324
  let t1;
@@ -9316,7 +9390,7 @@ const Actions = (t0) => {
9316
9390
  DsModal.Header = Header$1;
9317
9391
  DsModal.Title = Title;
9318
9392
  DsModal.CloseTrigger = CloseTrigger;
9319
- DsModal.Body = Body;
9393
+ DsModal.Body = Body$1;
9320
9394
  DsModal.Footer = Footer$1;
9321
9395
  DsModal.Actions = Actions;
9322
9396
  //#endregion
@@ -13160,66 +13234,50 @@ const DsFormControlDescription = (t0) => {
13160
13234
  return t2;
13161
13235
  };
13162
13236
  const DsFormControl = (t0) => {
13163
- const $ = (0, react_compiler_runtime.c)(28);
13164
- const { id, status, label, required: t1, slots, message, messageIcon: t2, className, style, children } = t0;
13165
- const required = t1 === void 0 ? false : t1;
13166
- const messageIcon = t2 === void 0 ? "info" : t2;
13237
+ const $ = (0, react_compiler_runtime.c)(23);
13238
+ const { id, status, label, hideLabel: t1, required: t2, slots, message, messageIcon: t3, className, style, children } = t0;
13239
+ const hideLabel = t1 === void 0 ? false : t1;
13240
+ const required = t2 === void 0 ? false : t2;
13241
+ const messageIcon = t3 === void 0 ? "info" : t3;
13167
13242
  const generatedId = (0, react.useId)();
13168
13243
  const controlId = id || generatedId;
13169
- let t3;
13244
+ let t4;
13170
13245
  if ($[0] !== controlId) {
13171
- t3 = { controlId };
13246
+ t4 = { controlId };
13172
13247
  $[0] = controlId;
13173
- $[1] = t3;
13174
- } else t3 = $[1];
13175
- const t4 = status && message && ds_form_control_module_default[status];
13176
- let t5;
13177
- if ($[2] !== className || $[3] !== t4) {
13178
- t5 = (0, classnames.default)(ds_form_control_module_default.container, className, t4);
13179
- $[2] = className;
13180
- $[3] = t4;
13181
- $[4] = t5;
13182
- } else t5 = $[4];
13248
+ $[1] = t4;
13249
+ } else t4 = $[1];
13250
+ const t5 = status && message && ds_form_control_module_default[status];
13183
13251
  let t6;
13184
- if ($[5] !== required) {
13185
- t6 = (0, classnames.default)(ds_form_control_module_default.label, { [ds_form_control_module_default.required]: required });
13186
- $[5] = required;
13187
- $[6] = t6;
13188
- } else t6 = $[6];
13252
+ if ($[2] !== className || $[3] !== t5) {
13253
+ t6 = (0, classnames.default)(ds_form_control_module_default.container, className, t5);
13254
+ $[2] = className;
13255
+ $[3] = t5;
13256
+ $[4] = t6;
13257
+ } else t6 = $[4];
13189
13258
  let t7;
13190
- if ($[7] !== controlId || $[8] !== label || $[9] !== t6) {
13191
- t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
13192
- htmlFor: controlId,
13193
- className: t6,
13194
- children: label
13259
+ if ($[5] !== controlId || $[6] !== hideLabel || $[7] !== label || $[8] !== required || $[9] !== slots) {
13260
+ t7 = !hideLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13261
+ className: ds_form_control_module_default.labelContainer,
13262
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
13263
+ htmlFor: controlId,
13264
+ className: (0, classnames.default)(ds_form_control_module_default.label, { [ds_form_control_module_default.required]: required }),
13265
+ children: label
13266
+ }), slots?.endAdornment && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13267
+ className: ds_form_control_module_default.endAdornment,
13268
+ children: slots.endAdornment
13269
+ })]
13195
13270
  });
13196
- $[7] = controlId;
13197
- $[8] = label;
13198
- $[9] = t6;
13271
+ $[5] = controlId;
13272
+ $[6] = hideLabel;
13273
+ $[7] = label;
13274
+ $[8] = required;
13275
+ $[9] = slots;
13199
13276
  $[10] = t7;
13200
13277
  } else t7 = $[10];
13201
13278
  let t8;
13202
- if ($[11] !== slots) {
13203
- t8 = slots?.endAdornment && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13204
- className: ds_form_control_module_default.endAdornment,
13205
- children: slots.endAdornment
13206
- });
13207
- $[11] = slots;
13208
- $[12] = t8;
13209
- } else t8 = $[12];
13210
- let t9;
13211
- if ($[13] !== t7 || $[14] !== t8) {
13212
- t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13213
- className: ds_form_control_module_default.labelContainer,
13214
- children: [t7, t8]
13215
- });
13216
- $[13] = t7;
13217
- $[14] = t8;
13218
- $[15] = t9;
13219
- } else t9 = $[15];
13220
- let t10;
13221
- if ($[16] !== message || $[17] !== messageIcon) {
13222
- t10 = message && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13279
+ if ($[11] !== message || $[12] !== messageIcon) {
13280
+ t8 = message && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13223
13281
  className: ds_form_control_module_default.message,
13224
13282
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
13225
13283
  icon: messageIcon,
@@ -13227,39 +13285,39 @@ const DsFormControl = (t0) => {
13227
13285
  filled: true
13228
13286
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: message })]
13229
13287
  });
13230
- $[16] = message;
13231
- $[17] = messageIcon;
13232
- $[18] = t10;
13233
- } else t10 = $[18];
13234
- let t11;
13235
- if ($[19] !== children || $[20] !== style || $[21] !== t10 || $[22] !== t5 || $[23] !== t9) {
13236
- t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13237
- className: t5,
13288
+ $[11] = message;
13289
+ $[12] = messageIcon;
13290
+ $[13] = t8;
13291
+ } else t8 = $[13];
13292
+ let t9;
13293
+ if ($[14] !== children || $[15] !== style || $[16] !== t6 || $[17] !== t7 || $[18] !== t8) {
13294
+ t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13295
+ className: t6,
13238
13296
  style,
13239
13297
  children: [
13240
- t9,
13298
+ t7,
13241
13299
  children,
13242
- t10
13300
+ t8
13243
13301
  ]
13244
13302
  });
13245
- $[19] = children;
13246
- $[20] = style;
13247
- $[21] = t10;
13248
- $[22] = t5;
13249
- $[23] = t9;
13250
- $[24] = t11;
13251
- } else t11 = $[24];
13252
- let t12;
13253
- if ($[25] !== t11 || $[26] !== t3) {
13254
- t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormControlContext.Provider, {
13255
- value: t3,
13256
- children: t11
13303
+ $[14] = children;
13304
+ $[15] = style;
13305
+ $[16] = t6;
13306
+ $[17] = t7;
13307
+ $[18] = t8;
13308
+ $[19] = t9;
13309
+ } else t9 = $[19];
13310
+ let t10;
13311
+ if ($[20] !== t4 || $[21] !== t9) {
13312
+ t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormControlContext.Provider, {
13313
+ value: t4,
13314
+ children: t9
13257
13315
  });
13258
- $[25] = t11;
13259
- $[26] = t3;
13260
- $[27] = t12;
13261
- } else t12 = $[27];
13262
- return t12;
13316
+ $[20] = t4;
13317
+ $[21] = t9;
13318
+ $[22] = t10;
13319
+ } else t10 = $[22];
13320
+ return t10;
13263
13321
  };
13264
13322
  DsFormControl.TextInput = controlify(DsTextInput);
13265
13323
  DsFormControl.NumberInput = controlify(DsNumberInput);
@@ -18137,68 +18195,9 @@ const systemStatuses = [
18137
18195
  //#endregion
18138
18196
  //#region src/components/ds-table/filters/adapters/create-filter-adapter.ts
18139
18197
  /**
18140
- * Base factory function to create a filter adapter
18141
- *
18142
- * This is the core function that all specialized filter adapters use internally.
18143
- * Use this when checkbox or dual-range adapters don't fit your requirements.
18144
- *
18145
- * ## When to use directly:
18146
- * - Complex filtering logic (e.g., editor + date range)
18147
- * - Unique UI that doesn't fit generic patterns
18148
- * - Combining multiple sub-filters
18149
- * - Special chip generation requirements
18150
- *
18151
- * ## When to use specialized helpers instead:
18152
- * - **Checkbox filters**: Use `createCheckboxFilterAdapter` for multi-select
18153
- * - **Range filters**: Use `createDualRangeFilterAdapter` for numeric ranges
18154
- *
18155
- * ## Example:
18156
- * ```typescript
18157
- * interface MyFilterValue {
18158
- * users: string[];
18159
- * dateRange: { from?: Date; to?: Date };
18160
- * }
18161
- *
18162
- * const myFilter = createFilterAdapter<DataType, MyFilterValue>({
18163
- * id: 'myColumn',
18164
- * label: 'My Filter',
18165
- * initialValue: { users: [], dateRange: {} },
18166
- *
18167
- * filterFn: (row, columnId, filterValue) => {
18168
- * // Your custom logic
18169
- * return matchesUsers && matchesDateRange;
18170
- * },
18171
- *
18172
- * toChips: (value) => {
18173
- * // Generate chips from your filter value
18174
- * return chips;
18175
- * },
18176
- *
18177
- * fromChip: (chip, currentValue) => {
18178
- * // Remove chip's effect from value
18179
- * return updatedValue;
18180
- * },
18181
- *
18182
- * getActiveFiltersCount: (value) => {
18183
- * // Count active filters (0 means none active)
18184
- * return count;
18185
- * },
18186
- *
18187
- * renderFilter: (value, onChange) => (
18188
- * <YourCustomFilterComponent
18189
- * value={value}
18190
- * onChange={onChange}
18191
- * />
18192
- * ),
18193
- * });
18194
- * ```
18195
- *
18196
- * ## Reference Implementation:
18197
- * See `workflow-filters.config.tsx` for a complete example (lastEditedFilterAdapter).
18198
- *
18199
- * ## Note:
18200
- * Most use cases are covered by `createCheckboxFilterAdapter` or `createDualRangeFilterAdapter`.
18201
- * Only use this base function directly when you need completely custom filter logic.
18198
+ * Base factory used by every specialized adapter. Reach for it only when
18199
+ * `createCheckboxFilterAdapter` / `createDualRangeFilterAdapter` don't fit
18200
+ * (custom UI, mixed sub-filters, bespoke chip logic).
18202
18201
  */
18203
18202
  function createFilterAdapter(config) {
18204
18203
  return {
@@ -18215,31 +18214,78 @@ function createFilterAdapter(config) {
18215
18214
  };
18216
18215
  }
18217
18216
  //#endregion
18217
+ //#region src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.module.scss
18218
+ var checkbox_filter_module_default = {
18219
+ "checkboxItem": "H6sVkG_checkboxItem",
18220
+ "empty": "H6sVkG_empty",
18221
+ "list": "H6sVkG_list",
18222
+ "root": "H6sVkG_root"
18223
+ };
18224
+ //#endregion
18218
18225
  //#region src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.tsx
18219
- const CheckboxFilter = ({ items, renderer, selectedItems, onSelectionChange }) => {
18226
+ const CheckboxFilter = ({ items, renderer, selectedItems, onSelectionChange, searchable = false, selectAll = false, locale, className }) => {
18227
+ const { allLabel = "All", searchPlaceholder = "Search", noMatchesLabel = "No matches" } = locale ?? {};
18228
+ const [query, setQuery] = (0, react.useState)("");
18229
+ const visibleItems = searchable ? items.filter((item) => item.label.toLowerCase().includes(query.trim().toLowerCase())) : items;
18220
18230
  const handleCheckedChange = (selected, checked) => {
18221
18231
  if (checked) onSelectionChange([...selectedItems, selected]);
18222
18232
  else onSelectionChange(selectedItems.filter((item) => item.value !== selected.value));
18223
18233
  };
18224
- return items.map((item) => {
18225
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsCheckbox, {
18226
- label: renderer ? renderer(item) : item.label,
18227
- checked: selectedItems.findIndex((selectedItem) => selectedItem.value === item.value) > -1,
18228
- onCheckedChange: (newState) => handleCheckedChange(item, newState === true)
18229
- }, JSON.stringify(item.value));
18234
+ const visibleSelectedCount = visibleItems.filter((item) => selectedItems.some((selected) => selected.value === item.value)).length;
18235
+ const allVisibleSelected = visibleItems.length > 0 && visibleSelectedCount === visibleItems.length;
18236
+ const someVisibleSelected = visibleSelectedCount > 0 && !allVisibleSelected;
18237
+ const handleSelectAllChange = (next) => {
18238
+ const shouldSelect = next === true;
18239
+ const visibleValues = new Set(visibleItems.map((item) => item.value));
18240
+ const withoutVisible = selectedItems.filter((item) => !visibleValues.has(item.value));
18241
+ onSelectionChange(shouldSelect ? [...withoutVisible, ...visibleItems] : withoutVisible);
18242
+ };
18243
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18244
+ className: (0, classnames.default)(checkbox_filter_module_default.root, className),
18245
+ children: [searchable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTextInput, {
18246
+ value: query,
18247
+ placeholder: searchPlaceholder,
18248
+ onValueChange: setQuery,
18249
+ slots: { startAdornment: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
18250
+ icon: "search",
18251
+ size: "tiny"
18252
+ }) }
18253
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18254
+ className: checkbox_filter_module_default.list,
18255
+ role: "group",
18256
+ children: [
18257
+ selectAll && visibleItems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsCheckbox, {
18258
+ className: checkbox_filter_module_default.checkboxItem,
18259
+ label: allLabel,
18260
+ checked: allVisibleSelected ? true : someVisibleSelected ? "indeterminate" : false,
18261
+ onCheckedChange: handleSelectAllChange
18262
+ }),
18263
+ visibleItems.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18264
+ className: checkbox_filter_module_default.empty,
18265
+ children: noMatchesLabel
18266
+ }),
18267
+ visibleItems.map((item) => {
18268
+ const label = renderer ? renderer(item) : item.label;
18269
+ const checked = selectedItems.some((selected) => selected.value === item.value);
18270
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsCheckbox, {
18271
+ className: checkbox_filter_module_default.checkboxItem,
18272
+ label,
18273
+ checked,
18274
+ onCheckedChange: (next) => handleCheckedChange(item, next === true)
18275
+ }, JSON.stringify(item.value));
18276
+ })
18277
+ ]
18278
+ })]
18230
18279
  });
18231
18280
  };
18232
18281
  //#endregion
18233
18282
  //#region src/components/ds-table/filters/adapters/create-checkbox-filter-adapter.tsx
18234
18283
  /**
18235
- * Factory function to create a checkbox filter adapter
18236
- *
18237
- * Handles multi-select checkbox filtering with inclusion model:
18238
- * - Empty selection = show all data (no filter active)
18239
- * - Selected items = show only those items
18284
+ * Multi-select inclusion filter: empty selection shows every row, selected
18285
+ * items show only those rows.
18240
18286
  */
18241
18287
  function createCheckboxFilterAdapter(config) {
18242
- const { id, label, items, renderer, chipLabelTemplate = (item) => `${label}: ${item.label}`, cellRenderer, getRowValue = (row) => row.getValue(id) } = config;
18288
+ const { id, label, items, renderer, chipLabelTemplate = (item) => `${label}: ${item.label}`, cellRenderer, getRowValue = (row) => row.getValue(id), searchable = false, selectAll = false, locale } = config;
18243
18289
  return createFilterAdapter({
18244
18290
  id,
18245
18291
  label,
@@ -18271,7 +18317,10 @@ function createCheckboxFilterAdapter(config) {
18271
18317
  items,
18272
18318
  renderer,
18273
18319
  selectedItems: value,
18274
- onSelectionChange: onChange
18320
+ onSelectionChange: onChange,
18321
+ searchable,
18322
+ selectAll,
18323
+ locale
18275
18324
  });
18276
18325
  }
18277
18326
  });
@@ -18356,10 +18405,7 @@ const RangeFilter = ({ label, value, onChange, onClear }) => {
18356
18405
  };
18357
18406
  //#endregion
18358
18407
  //#region src/components/ds-table/filters/adapters/create-dual-range-filter-adapter.tsx
18359
- /**
18360
- * Factory function to create a dual-range filter adapter
18361
- * Handles filtering on multiple numeric ranges within a single column
18362
- */
18408
+ /** Filter over multiple numeric ranges within one column (AND across fields). */
18363
18409
  function createDualRangeFilterAdapter(config) {
18364
18410
  const { id, label, fields, formatNumber = (num) => num.toLocaleString("en-US"), getRowValue = (row) => row.getValue(id) } = config;
18365
18411
  const initialValue = {};
@@ -18438,28 +18484,16 @@ function createDualRangeFilterAdapter(config) {
18438
18484
  }
18439
18485
  //#endregion
18440
18486
  //#region src/components/ds-table/filters/hooks/use-table-filters.ts
18487
+ const resolveColumnAdapterId = (meta) => {
18488
+ if (!meta) return;
18489
+ if ("render" in meta) return meta.filterId;
18490
+ if (meta.adapter) return meta.adapter.id;
18491
+ return meta.adapterId;
18492
+ };
18441
18493
  /**
18442
- * Hook to orchestrate table filtering with adapters.
18443
- * Manages filter state, generates chips, and handles column definitions.
18444
- *
18445
- * **Uncontrolled mode** (default): Filters are managed internally.
18446
- * **Controlled mode**: Filters are managed externally via appliedFilters/onFiltersChange.
18447
- *
18448
- * @example
18449
- * // Uncontrolled mode
18450
- * const { filterChips, handlers } = useTableFilters({
18451
- * filterAdapters: adapters,
18452
- * baseColumns: columns,
18453
- * });
18454
- *
18455
- * @example
18456
- * // Controlled mode (e.g., URL-driven filtering)
18457
- * const { filterChips, handlers } = useTableFilters({
18458
- * filterAdapters: adapters,
18459
- * baseColumns: columns,
18460
- * appliedFilters: filtersFromUrl,
18461
- * onFiltersChange: (filters) => updateUrlAndRefetch(filters),
18462
- * });
18494
+ * Orchestrates table filtering: drafts → applied state, chips, nav counts, and
18495
+ * column wiring. Uncontrolled by default; pass `appliedFilters` +
18496
+ * `onFiltersChange` for URL-driven / external state.
18463
18497
  */
18464
18498
  function useTableFilters({ filterAdapters, baseColumns, appliedFilters: externalAppliedFilters, onFiltersChange: setExternalAppliedFilters }) {
18465
18499
  const _filterAdapters = filterAdapters;
@@ -18494,13 +18528,28 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
18494
18528
  count: adapter.getActiveFiltersCount(draftFilters[adapter.id])
18495
18529
  }));
18496
18530
  const enhancedColumns = !baseColumns ? [] : baseColumns.map((col) => {
18497
- const adapter = _filterAdapters.find((a) => a.id === col.id);
18531
+ const metaFilter = col.meta?.filter;
18532
+ const adapterIdFromMeta = resolveColumnAdapterId(metaFilter);
18533
+ const adapter = adapterIdFromMeta && _filterAdapters.find((a) => a.id === adapterIdFromMeta) || _filterAdapters.find((a) => a.id === col.id);
18498
18534
  if (!adapter) return col;
18499
18535
  const cellRenderer = adapter.cellRenderer;
18536
+ const appliedValue = appliedFilters[adapter.id];
18537
+ const resolvedFilter = metaFilter ? {
18538
+ filterId: adapter.id,
18539
+ hasActiveFilter: appliedValue !== void 0 && adapter.getActiveFiltersCount(appliedValue) > 0,
18540
+ render: () => renderForId(adapter.id),
18541
+ onApply: () => applyColumnFilter(adapter.id),
18542
+ onClear: () => clearColumnFilter(adapter.id),
18543
+ onCancel: () => cancelColumnFilter(adapter.id)
18544
+ } : void 0;
18500
18545
  return {
18501
18546
  ...col,
18502
18547
  filterFn: adapter.columnFilterFn,
18503
- ...cellRenderer && { cell: (info) => cellRenderer(info.getValue()) }
18548
+ ...cellRenderer && { cell: (info) => cellRenderer(info.getValue()) },
18549
+ ...resolvedFilter && { meta: {
18550
+ ...col.meta,
18551
+ filter: resolvedFilter
18552
+ } }
18504
18553
  };
18505
18554
  });
18506
18555
  const updateFilter = (filterId, value) => {
@@ -18521,6 +18570,29 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
18521
18570
  setPendingFilters({});
18522
18571
  setAppliedFilters({});
18523
18572
  };
18573
+ const omitKey = (source, filterId) => Object.fromEntries(Object.entries(source).filter(([key]) => key !== filterId));
18574
+ const applyColumnFilter = (filterId) => {
18575
+ const adapter = _filterAdapters.find((a) => a.id === filterId);
18576
+ if (!adapter) return;
18577
+ const draftValue = draftFilters[filterId];
18578
+ setAppliedFilters(adapter.getActiveFiltersCount(draftValue) > 0 ? {
18579
+ ...appliedFilters,
18580
+ [filterId]: draftValue
18581
+ } : omitKey(appliedFilters, filterId));
18582
+ setPendingFilters((prev) => omitKey(prev, filterId));
18583
+ };
18584
+ const cancelColumnFilter = (filterId) => {
18585
+ setPendingFilters((prev) => omitKey(prev, filterId));
18586
+ };
18587
+ const clearColumnFilter = (filterId) => {
18588
+ const adapter = _filterAdapters.find((a) => a.id === filterId);
18589
+ if (!adapter) return;
18590
+ setPendingFilters((prev) => ({
18591
+ ...omitKey(prev, filterId),
18592
+ [filterId]: adapter.initialValue
18593
+ }));
18594
+ if (appliedFilters[filterId] !== void 0) setAppliedFilters(omitKey(appliedFilters, filterId));
18595
+ };
18524
18596
  const deleteChip = (chip) => {
18525
18597
  const filterKey = typeof chip.metadata?.key === "string" ? chip.metadata.key : void 0;
18526
18598
  if (!filterKey) return;
@@ -18534,13 +18606,15 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
18534
18606
  [filterKey]: newValue
18535
18607
  });
18536
18608
  };
18537
- const renderFilterContent = (selectedFilter) => {
18538
- const adapter = _filterAdapters.find((a) => a.id === selectedFilter.id);
18609
+ const renderForId = (filterId) => {
18610
+ const adapter = _filterAdapters.find((a) => a.id === filterId);
18539
18611
  if (!adapter) return null;
18540
18612
  const value = draftFilters[adapter.id];
18541
18613
  const onChange = (newValue) => updateFilter(adapter.id, newValue);
18542
18614
  return adapter.renderFilter(value, onChange);
18543
18615
  };
18616
+ const renderFilterContent = (selectedFilter) => renderForId(selectedFilter.id);
18617
+ const renderColumnFilter = (filterId) => renderForId(filterId);
18544
18618
  return {
18545
18619
  filterState: draftFilters,
18546
18620
  columnFilters,
@@ -18551,12 +18625,94 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
18551
18625
  updateFilter,
18552
18626
  applyFilters,
18553
18627
  clearAll,
18554
- deleteChip
18628
+ deleteChip,
18629
+ applyColumnFilter,
18630
+ cancelColumnFilter,
18631
+ clearColumnFilter
18555
18632
  },
18556
- renderFilterContent
18633
+ renderFilterContent,
18634
+ renderColumnFilter
18557
18635
  };
18558
18636
  }
18559
18637
  //#endregion
18638
+ //#region src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.module.scss
18639
+ var column_filter_popover_module_default = {
18640
+ "body": "_0oV9a_body",
18641
+ "content": "_0oV9a_content",
18642
+ "footer": "_0oV9a_footer",
18643
+ "trigger": "_0oV9a_trigger",
18644
+ "triggerActive": "_0oV9a_triggerActive",
18645
+ "triggerOpen": "_0oV9a_triggerOpen"
18646
+ };
18647
+ //#endregion
18648
+ //#region src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.tsx
18649
+ const stopPropagation = (event) => event.stopPropagation();
18650
+ /**
18651
+ * Per-column filter popover anchored to a header cell: funnel trigger,
18652
+ * adapter UI as the body, Clear / Save footer wired to `useTableFilters`.
18653
+ */
18654
+ const DsTableColumnFilterPopover = ({ children, hasActiveFilter, onApply, onClear, onCancel, locale, className }) => {
18655
+ const { triggerAriaLabel = "Filter column", clearLabel = "Clear", saveLabel = "Save" } = locale ?? {};
18656
+ const [open, setOpen] = (0, react.useState)(false);
18657
+ const handleOpenChange = (details) => {
18658
+ if (open && !details.open) onCancel();
18659
+ setOpen(details.open);
18660
+ };
18661
+ const handleSave = () => {
18662
+ onApply();
18663
+ setOpen(false);
18664
+ };
18665
+ const handleClear = () => {
18666
+ onClear();
18667
+ setOpen(false);
18668
+ };
18669
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_ark_ui_react_popover.Popover.Root, {
18670
+ open,
18671
+ onOpenChange: handleOpenChange,
18672
+ positioning: {
18673
+ placement: "bottom-end",
18674
+ gutter: 4
18675
+ },
18676
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ark_ui_react_popover.Popover.Trigger, {
18677
+ asChild: true,
18678
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsButtonV3, {
18679
+ variant: "tertiary",
18680
+ size: "tiny",
18681
+ className: (0, classnames.default)(column_filter_popover_module_default.trigger, hasActiveFilter && column_filter_popover_module_default.triggerActive, open && column_filter_popover_module_default.triggerOpen),
18682
+ "aria-label": triggerAriaLabel,
18683
+ "data-active": hasActiveFilter ? "true" : void 0,
18684
+ onClick: (event) => event.stopPropagation(),
18685
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
18686
+ icon: "filter_alt",
18687
+ variant: "outlined",
18688
+ filled: hasActiveFilter,
18689
+ size: "tiny"
18690
+ })
18691
+ })
18692
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ark_ui_react_portal.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ark_ui_react_popover.Popover.Positioner, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_ark_ui_react_popover.Popover.Content, {
18693
+ className: (0, classnames.default)(column_filter_popover_module_default.content, className),
18694
+ onClick: stopPropagation,
18695
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18696
+ className: column_filter_popover_module_default.body,
18697
+ children
18698
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18699
+ className: column_filter_popover_module_default.footer,
18700
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsButtonV3, {
18701
+ variant: "secondary",
18702
+ size: "small",
18703
+ onClick: handleClear,
18704
+ children: clearLabel
18705
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsButtonV3, {
18706
+ variant: "primary",
18707
+ size: "small",
18708
+ onClick: handleSave,
18709
+ children: saveLabel
18710
+ })]
18711
+ })]
18712
+ }) }) })]
18713
+ });
18714
+ };
18715
+ //#endregion
18560
18716
  //#region src/components/ds-table/components/core-table/core-table.module.scss
18561
18717
  var core_table_module_default = {
18562
18718
  "table": "JP3Vta_table",
@@ -18693,6 +18849,9 @@ const DsTableBulkActions = ({ numSelectedRows, actions, onClearSelection }) => {
18693
18849
  //#endregion
18694
18850
  //#region src/components/ds-table/components/ds-table-header/ds-table-header.module.scss
18695
18851
  var ds_table_header_module_default = {
18852
+ "filterableHeader": "-2rCNG_filterableHeader",
18853
+ "filterActive": "-2rCNG_filterActive",
18854
+ "filterTriggerContainer": "-2rCNG_filterTriggerContainer",
18696
18855
  "headerCell": "-2rCNG_headerCell",
18697
18856
  "headerRow": "-2rCNG_headerRow",
18698
18857
  "headerRowNoBorder": "-2rCNG_headerRowNoBorder",
@@ -18727,18 +18886,83 @@ const useDsTableContext = () => {
18727
18886
  if (!context) throw new Error("useDsTableContext must be used within DsTable");
18728
18887
  return context;
18729
18888
  };
18889
+ /**
18890
+ * Hoisted editing state for single-cell-at-a-time inline editing.
18891
+ * Lives on {@link DsTableContext} so cell renderers and editors share one provider.
18892
+ */
18893
+ const useEditingState = (onCellEdit, onCellValidate) => {
18894
+ const [editing, setEditing] = (0, react.useState)(null);
18895
+ const onCellEditRef = (0, react.useRef)(onCellEdit);
18896
+ onCellEditRef.current = onCellEdit;
18897
+ const onCellValidateRef = (0, react.useRef)(onCellValidate);
18898
+ onCellValidateRef.current = onCellValidate;
18899
+ const editingRef = (0, react.useRef)(editing);
18900
+ editingRef.current = editing;
18901
+ return {
18902
+ editing,
18903
+ beginEdit: (0, react.useCallback)((cell) => {
18904
+ const current = editingRef.current;
18905
+ if (current) {
18906
+ if (current.cell.row.id === cell.row.id && current.cell.column.id === cell.column.id) return;
18907
+ }
18908
+ setEditing({
18909
+ cell,
18910
+ draftValue: cell.getValue(),
18911
+ error: null
18912
+ });
18913
+ }, []),
18914
+ setDraft: (0, react.useCallback)((value) => {
18915
+ const current = editingRef.current;
18916
+ if (!current) return;
18917
+ setEditing({
18918
+ ...current,
18919
+ draftValue: value,
18920
+ error: null
18921
+ });
18922
+ }, []),
18923
+ commit: (0, react.useCallback)((overrideValue) => {
18924
+ const current = editingRef.current;
18925
+ if (!current) return;
18926
+ const valueToCommit = overrideValue !== void 0 ? overrideValue : current.draftValue;
18927
+ const error = onCellValidateRef.current?.(current.cell.row.original, current.cell.column.id, valueToCommit) ?? null;
18928
+ if (error !== null) {
18929
+ setEditing({
18930
+ ...current,
18931
+ draftValue: valueToCommit,
18932
+ error
18933
+ });
18934
+ return;
18935
+ }
18936
+ onCellEditRef.current?.(current.cell.row.original, current.cell.column.id, valueToCommit);
18937
+ setEditing(null);
18938
+ }, []),
18939
+ cancel: (0, react.useCallback)(() => {
18940
+ setEditing(null);
18941
+ }, [])
18942
+ };
18943
+ };
18730
18944
  //#endregion
18731
18945
  //#region src/components/ds-table/utils/column-size.ts
18732
18946
  /**
18733
- * Generates the appropriate style object for a table column/cell based on its size and virtualization state
18947
+ * Generates the appropriate style object for a table column/cell based on its size
18948
+ *
18949
+ * Custom-sized columns get a fixed `width` plus `minWidth` and `flexShrink: 0` so
18950
+ * they enforce horizontal overflow on the table container. Default-sized columns
18951
+ * grow to fill the row evenly via `flex: 1`.
18734
18952
  *
18735
18953
  * @param columnSize - The size of the column
18736
- * @param virtualized - Whether the table is virtualized
18737
- * @returns Style object or undefined if no custom styling is needed
18954
+ * @returns Style object for the column/cell
18738
18955
  */
18739
- const getColumnSizeStyle = (columnSize, virtualized) => {
18740
- if (columnSize !== _tanstack_react_table.defaultColumnSizing.size) return { width: columnSize };
18741
- if (virtualized) return { flex: 1 };
18956
+ const getColumnSizeStyle = (columnSize) => {
18957
+ if (columnSize !== _tanstack_react_table.defaultColumnSizing.size) return {
18958
+ width: columnSize,
18959
+ minWidth: columnSize,
18960
+ flexShrink: 0
18961
+ };
18962
+ return {
18963
+ flex: 1,
18964
+ minWidth: 0
18965
+ };
18742
18966
  };
18743
18967
  /**
18744
18968
  * Column id used for the synthetic expander column injected when `expandable` is set.
@@ -18762,33 +18986,49 @@ const DsTableHeader = ({ table }) => {
18762
18986
  children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableRow, {
18763
18987
  className: (0, classnames.default)(ds_table_header_module_default.headerRow, !bordered && ds_table_header_module_default.headerRowNoBorder, virtualized && ds_table_header_module_default.headerRowVirtualized),
18764
18988
  children: headerGroup.headers.map((header) => {
18765
- const headerStyle = getColumnSizeStyle(header.column.getSize(), virtualized);
18989
+ const headerStyle = getColumnSizeStyle(header.column.getSize());
18766
18990
  const canSort = header.column.getCanSort();
18767
18991
  const isSelectColumn = header.column.id === SELECT_COLUMN_ID;
18992
+ const metaFilter = header.column.columnDef.meta?.filter;
18993
+ const resolvedFilter = metaFilter && "render" in metaFilter ? metaFilter : void 0;
18994
+ const hasActiveColumnFilter = resolvedFilter?.hasActiveFilter ?? false;
18768
18995
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableHead, {
18769
- className: (0, classnames.default)(ds_table_header_module_default.headerCell, canSort && ds_table_header_module_default.sortableHeader, isSelectColumn && ds_table_header_module_default.selectHeaderCell),
18996
+ className: (0, classnames.default)(ds_table_header_module_default.headerCell, canSort && ds_table_header_module_default.sortableHeader, isSelectColumn && ds_table_header_module_default.selectHeaderCell, resolvedFilter && ds_table_header_module_default.filterableHeader, hasActiveColumnFilter && ds_table_header_module_default.filterActive),
18770
18997
  onClick: header.column.getToggleSortingHandler(),
18771
18998
  style: headerStyle,
18772
18999
  children: header.isPlaceholder ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18773
19000
  className: ds_table_header_module_default.headerSortContainer,
18774
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsStack, {
18775
- direction: "column",
18776
- justifyContent: "center",
18777
- width: "100%",
18778
- children: (0, _tanstack_react_table.flexRender)(header.column.columnDef.header, header.getContext())
18779
- }), canSort && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18780
- className: ds_table_header_module_default.pageButtonIconContainer,
18781
- children: {
18782
- asc: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
18783
- icon: "arrow_drop_up",
18784
- className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
18785
- }),
18786
- desc: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
18787
- icon: "arrow_drop_down",
18788
- className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
19001
+ children: [
19002
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsStack, {
19003
+ direction: "column",
19004
+ justifyContent: "center",
19005
+ width: "100%",
19006
+ children: (0, _tanstack_react_table.flexRender)(header.column.columnDef.header, header.getContext())
19007
+ }),
19008
+ canSort && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19009
+ className: ds_table_header_module_default.pageButtonIconContainer,
19010
+ children: {
19011
+ asc: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
19012
+ icon: "arrow_drop_up",
19013
+ className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
19014
+ }),
19015
+ desc: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
19016
+ icon: "arrow_drop_down",
19017
+ className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
19018
+ })
19019
+ }[header.column.getIsSorted()] ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon) })
19020
+ }),
19021
+ resolvedFilter && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19022
+ className: ds_table_header_module_default.filterTriggerContainer,
19023
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableColumnFilterPopover, {
19024
+ hasActiveFilter: resolvedFilter.hasActiveFilter,
19025
+ onApply: resolvedFilter.onApply,
19026
+ onClear: resolvedFilter.onClear,
19027
+ onCancel: resolvedFilter.onCancel,
19028
+ children: resolvedFilter.render()
18789
19029
  })
18790
- }[header.column.getIsSorted()] ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon) })
18791
- })]
19030
+ })
19031
+ ]
18792
19032
  })
18793
19033
  }, header.id);
18794
19034
  })
@@ -18803,20 +19043,124 @@ var ds_table_module_default = {
18803
19043
  "dataTableContainer": "iL9mtW_dataTableContainer",
18804
19044
  "emptyState": "iL9mtW_emptyState",
18805
19045
  "fullWidth": "iL9mtW_fullWidth",
18806
- "rotate": "iL9mtW_rotate",
18807
- "rotate-135": "iL9mtW_rotate-135",
18808
- "rotate-180": "iL9mtW_rotate-180",
18809
- "rotate-225": "iL9mtW_rotate-225",
18810
- "rotate-270": "iL9mtW_rotate-270",
18811
- "rotate-315": "iL9mtW_rotate-315",
18812
- "rotate-45": "iL9mtW_rotate-45",
18813
- "rotate-90": "iL9mtW_rotate-90",
19046
+ "scrollbar-thin": "iL9mtW_scrollbar-thin",
18814
19047
  "table": "iL9mtW_table",
18815
19048
  "tableNoBorder": "iL9mtW_tableNoBorder",
18816
- "virtualized": "iL9mtW_virtualized",
18817
19049
  "virtualizedContainer": "iL9mtW_virtualizedContainer"
18818
19050
  };
18819
19051
  //#endregion
19052
+ //#region src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.module.scss
19053
+ var ds_table_editable_cell_module_default = {
19054
+ "editButton": "g5FEoW_editButton",
19055
+ "root": "g5FEoW_root"
19056
+ };
19057
+ //#endregion
19058
+ //#region src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx
19059
+ const DsTableEditableCell = ({ cell, children }) => {
19060
+ const { beginEdit, editing } = useDsTableContext();
19061
+ const isEditing = editing !== null && editing.cell.row.id === cell.row.id && editing.cell.column.id === cell.column.id;
19062
+ const handleEdit = (event) => {
19063
+ event.stopPropagation();
19064
+ beginEdit(cell);
19065
+ };
19066
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
19067
+ className: ds_table_editable_cell_module_default.root,
19068
+ "data-active": isEditing ? "" : void 0,
19069
+ onDoubleClick: handleEdit,
19070
+ tabIndex: 0,
19071
+ role: "button",
19072
+ "aria-label": "Double-click to edit",
19073
+ children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsButtonV3, {
19074
+ className: ds_table_editable_cell_module_default.editButton,
19075
+ variant: "tertiary",
19076
+ size: "small",
19077
+ icon: "edit",
19078
+ "aria-label": "Edit cell",
19079
+ onClick: handleEdit
19080
+ })]
19081
+ });
19082
+ };
19083
+ //#endregion
19084
+ //#region src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.module.scss
19085
+ var ds_table_editing_cell_module_default = {
19086
+ "actions": "-EpLaa_actions",
19087
+ "editAnchor": "-EpLaa_editAnchor",
19088
+ "overlay": "-EpLaa_overlay",
19089
+ "row": "-EpLaa_row",
19090
+ "slot": "-EpLaa_slot"
19091
+ };
19092
+ //#endregion
19093
+ //#region src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx
19094
+ const DsTableEditingCell = ({ cell }) => {
19095
+ const { commit, cancel } = useDsTableContext();
19096
+ const columnDef = cell.column.columnDef;
19097
+ const editAnchorRef = (0, react.useRef)(null);
19098
+ const handleSubmit = (event) => {
19099
+ event.preventDefault();
19100
+ event.stopPropagation();
19101
+ commit();
19102
+ };
19103
+ (0, react.useEffect)(() => {
19104
+ const handleKeyDown = (event) => {
19105
+ if (event.key !== "Escape") return;
19106
+ if (!editAnchorRef.current?.contains(document.activeElement)) return;
19107
+ event.preventDefault();
19108
+ event.stopPropagation();
19109
+ cancel();
19110
+ };
19111
+ document.addEventListener("keydown", handleKeyDown);
19112
+ return () => {
19113
+ document.removeEventListener("keydown", handleKeyDown);
19114
+ };
19115
+ }, [cancel]);
19116
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19117
+ ref: editAnchorRef,
19118
+ className: ds_table_editing_cell_module_default.editAnchor,
19119
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("form", {
19120
+ className: ds_table_editing_cell_module_default.overlay,
19121
+ onSubmit: handleSubmit,
19122
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DsStack, {
19123
+ direction: "row",
19124
+ gap: "var(--3xs)",
19125
+ alignItems: "flex-start",
19126
+ width: "100%",
19127
+ className: ds_table_editing_cell_module_default.row,
19128
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsStack, {
19129
+ flex: "1 1 auto",
19130
+ className: ds_table_editing_cell_module_default.slot,
19131
+ children: columnDef.editCell ? (0, _tanstack_react_table.flexRender)(columnDef.editCell, cell.getContext()) : null
19132
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DsStack, {
19133
+ direction: "row",
19134
+ gap: "var(--3xs)",
19135
+ className: ds_table_editing_cell_module_default.actions,
19136
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsButtonV3, {
19137
+ type: "button",
19138
+ variant: "tertiary",
19139
+ size: "small",
19140
+ icon: "close",
19141
+ "aria-label": "Cancel edit",
19142
+ onClick: (event) => {
19143
+ event.stopPropagation();
19144
+ cancel();
19145
+ },
19146
+ style: { color: "var(--icon-error)" }
19147
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsButtonV3, {
19148
+ type: "submit",
19149
+ variant: "tertiary",
19150
+ size: "small",
19151
+ icon: "check",
19152
+ "aria-label": "Confirm edit",
19153
+ onClick: (event) => {
19154
+ event.stopPropagation();
19155
+ },
19156
+ style: { color: "var(--icon-success)" }
19157
+ })]
19158
+ })]
19159
+ })
19160
+ })
19161
+ });
19162
+ };
19163
+ //#endregion
18820
19164
  //#region src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss
18821
19165
  var ds_table_cell_module_default = {
18822
19166
  "cellActions": "UprPSq_cellActions",
@@ -18828,20 +19172,19 @@ var ds_table_cell_module_default = {
18828
19172
  };
18829
19173
  //#endregion
18830
19174
  //#region src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx
18831
- const DsDefaultTableCell = ({ cell }) => {
18832
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18833
- className: ds_table_cell_module_default.tableCellEllipsis,
18834
- children: (0, _tanstack_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext())
18835
- });
18836
- };
18837
19175
  const DsTableCell = ({ row, cell, primaryRowActions = [], secondaryRowActions = [] }) => {
19176
+ const { editing } = useDsTableContext();
19177
+ const isCellBeingEdited = editing !== null && editing.cell.row.id === row.id && editing.cell.column.id === cell.column.id;
18838
19178
  const visiblePrimary = primaryRowActions.filter((action) => !action.hidden?.(row.original));
18839
19179
  const visibleSecondary = secondaryRowActions.filter((action) => !action.hidden?.(row.original));
18840
- if (visiblePrimary.length || visibleSecondary.length) {
19180
+ if (!isCellBeingEdited && (visiblePrimary.length || visibleSecondary.length)) {
18841
19181
  const hasSecondaryRowActions = visibleSecondary.length > 0;
18842
19182
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18843
19183
  className: ds_table_cell_module_default.lastCell,
18844
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsDefaultTableCell, { cell }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
19184
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CellContent, {
19185
+ cell,
19186
+ isCellBeingEdited
19187
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18845
19188
  className: ds_table_cell_module_default.cellActions,
18846
19189
  children: [visiblePrimary.map((action, i) => {
18847
19190
  const isDisabled = action.disabled?.(row.original);
@@ -18892,13 +19235,32 @@ const DsTableCell = ({ row, cell, primaryRowActions = [], secondaryRowActions =
18892
19235
  })]
18893
19236
  });
18894
19237
  }
18895
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsDefaultTableCell, { cell });
19238
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CellContent, {
19239
+ cell,
19240
+ isCellBeingEdited
19241
+ });
18896
19242
  };
18897
- //#endregion
19243
+ const CellContent = ({ cell, isCellBeingEdited }) => {
19244
+ const isEditable = typeof cell.column.columnDef.editCell === "function";
19245
+ if (isCellBeingEdited) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableEditingCell, { cell });
19246
+ if (isEditable) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableEditableCell, {
19247
+ cell,
19248
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19249
+ className: ds_table_cell_module_default.tableCellEllipsis,
19250
+ children: (0, _tanstack_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext())
19251
+ })
19252
+ });
19253
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19254
+ className: ds_table_cell_module_default.tableCellEllipsis,
19255
+ children: (0, _tanstack_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext())
19256
+ });
19257
+ };
19258
+ //#endregion
18898
19259
  //#region src/components/ds-table/components/ds-table-row/ds-table-row.module.scss
18899
19260
  var ds_table_row_module_default = {
18900
19261
  "cellReorder": "t8OZCq_cellReorder",
18901
19262
  "clickableRow": "t8OZCq_clickableRow",
19263
+ "editableCell": "t8OZCq_editableCell",
18902
19264
  "expandableCell": "t8OZCq_expandableCell",
18903
19265
  "expanded": "t8OZCq_expanded",
18904
19266
  "expandedRow": "t8OZCq_expandedRow",
@@ -18967,7 +19329,7 @@ const DsTableRow = ({ ref, row, isSelected }) => {
18967
19329
  }, cell.id);
18968
19330
  const isLastColumn = idx === row.getVisibleCells().length - 1;
18969
19331
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
18970
- className: (0, classnames.default)(ds_table_row_module_default.tableCell, cell.column.id === "expander" && ds_table_row_module_default.expandableCell, cell.column.id === "select" && ds_table_row_module_default.selectableCell),
19332
+ className: (0, classnames.default)(ds_table_row_module_default.tableCell, cell.column.id === "expander" && ds_table_row_module_default.expandableCell, cell.column.id === "select" && ds_table_row_module_default.selectableCell, typeof cell.column.columnDef.editCell === "function" && ds_table_row_module_default.editableCell),
18971
19333
  style: cellStyle,
18972
19334
  children: isLastColumn ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableCell, {
18973
19335
  row,
@@ -19087,13 +19449,16 @@ function useDragAndDrop({ isDragEnabled, onOrderChange, items }) {
19087
19449
  //#region src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.module.scss
19088
19450
  var ds_table_body_virtualized_module_default = {
19089
19451
  "body": "vRRk8q_body",
19090
- "emptyState": "vRRk8q_emptyState"
19452
+ "emptyState": "vRRk8q_emptyState",
19453
+ "scrollbar-thin": "vRRk8q_scrollbar-thin",
19454
+ "sentinel": "vRRk8q_sentinel"
19091
19455
  };
19092
19456
  //#endregion
19093
19457
  //#region src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss
19094
19458
  var ds_table_row_virtualized_module_default = {
19095
19459
  "cell": "NcME7q_cell",
19096
19460
  "clickableRow": "NcME7q_clickableRow",
19461
+ "editableCell": "NcME7q_editableCell",
19097
19462
  "expandableCell": "NcME7q_expandableCell",
19098
19463
  "expanded": "NcME7q_expanded",
19099
19464
  "expandedRow": "NcME7q_expandedRow",
@@ -19133,8 +19498,8 @@ const DsTableRowVirtualized = ({ row, isSelected, rowsMapRef, rowHeightsMapRef,
19133
19498
  children: isExpandedRowContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, { children: renderExpandedRow?.(row.original) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: row.getVisibleCells().map((cell, idx) => {
19134
19499
  const isLastColumn = idx === row.getVisibleCells().length - 1;
19135
19500
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
19136
- style: getColumnSizeStyle(cell.column.getSize(), true),
19137
- className: (0, classnames.default)(ds_table_row_virtualized_module_default.cell, cell.column.id === "expander" && ds_table_row_virtualized_module_default.expandableCell, cell.column.id === "select" && ds_table_row_virtualized_module_default.selectableCell),
19501
+ style: getColumnSizeStyle(cell.column.getSize()),
19502
+ className: (0, classnames.default)(ds_table_row_virtualized_module_default.cell, cell.column.id === "expander" && ds_table_row_virtualized_module_default.expandableCell, cell.column.id === "select" && ds_table_row_virtualized_module_default.selectableCell, typeof cell.column.columnDef.editCell === "function" && ds_table_row_virtualized_module_default.editableCell),
19138
19503
  children: isLastColumn ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableCell, {
19139
19504
  row,
19140
19505
  cell,
@@ -19179,9 +19544,10 @@ const useInfiniteScroll = (scrollElementRef, rowCount, config) => {
19179
19544
  };
19180
19545
  //#endregion
19181
19546
  //#region src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx
19182
- const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimateSize, overscan, onScroll, rowSelection, infiniteScroll }) => {
19547
+ const DsTableBodyVirtualized = ({ table, emptyState, estimateSize, overscan, onScroll, rowSelection, infiniteScroll }) => {
19183
19548
  const rowsMapRef = (0, react.useRef)(/* @__PURE__ */ new Map());
19184
19549
  const rowHeightsMapRef = (0, react.useRef)(/* @__PURE__ */ new Map());
19550
+ const tbodyRef = (0, react.useRef)(null);
19185
19551
  const { rows } = table.getRowModel();
19186
19552
  const rowsAndExpandedRowContent = rows.flatMap((row) => row.getIsExpanded() ? [{ row }, {
19187
19553
  row,
@@ -19191,14 +19557,14 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
19191
19557
  const item = rowsAndExpandedRowContent[index];
19192
19558
  return item ? `${item.row.id}${item.isExpandedRowContent ? "-expanded-content" : ""}` : String(index);
19193
19559
  };
19194
- const { loadDataIfNeeded } = useInfiniteScroll(tableContainerRef, rows.length, infiniteScroll);
19560
+ const { loadDataIfNeeded } = useInfiniteScroll(tbodyRef, rows.length, infiniteScroll);
19195
19561
  const rowVirtualizer = (0, _tanstack_react_virtual.useVirtualizer)({
19196
19562
  count: rowsAndExpandedRowContent.length,
19197
19563
  estimateSize: (index) => {
19198
19564
  return rowHeightsMapRef.current.get(getItemKey(index)) || estimateSize;
19199
19565
  },
19200
19566
  getItemKey,
19201
- getScrollElement: () => tableContainerRef.current,
19567
+ getScrollElement: () => tbodyRef.current,
19202
19568
  measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (element) => element.getBoundingClientRect().height : void 0,
19203
19569
  overscan: overscan ?? 5,
19204
19570
  onChange: (instance, sync) => {
@@ -19231,6 +19597,7 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
19231
19597
  rowVirtualizer.measure();
19232
19598
  }, [table.getState()]);
19233
19599
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableBody, {
19600
+ ref: tbodyRef,
19234
19601
  rowsMapRef,
19235
19602
  rowHeightsMapRef,
19236
19603
  rowVirtualizer,
@@ -19239,12 +19606,13 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
19239
19606
  rowSelection
19240
19607
  });
19241
19608
  };
19242
- function DsTableBody({ rowVirtualizer, rowsMapRef, rowHeightsMapRef, rowsAndExpandedRowContent, emptyState, rowSelection }) {
19609
+ function DsTableBody({ ref, rowVirtualizer, rowsMapRef, rowHeightsMapRef, rowsAndExpandedRowContent, emptyState, rowSelection }) {
19243
19610
  const virtualRows = rowVirtualizer.getVirtualItems();
19244
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableBody, {
19611
+ const totalSize = rowVirtualizer.getTotalSize();
19612
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TableBody, {
19613
+ ref,
19245
19614
  className: ds_table_body_virtualized_module_default.body,
19246
- style: { height: `${rowVirtualizer.getTotalSize().toString()}px` },
19247
- children: virtualRows.length > 0 ? virtualRows.map((virtualRow) => {
19615
+ children: [virtualRows.length > 0 ? virtualRows.map((virtualRow) => {
19248
19616
  const row = rowsAndExpandedRowContent[virtualRow.index];
19249
19617
  if (!row) return null;
19250
19618
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableRowVirtualized, {
@@ -19259,7 +19627,12 @@ function DsTableBody({ rowVirtualizer, rowsMapRef, rowHeightsMapRef, rowsAndExpa
19259
19627
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableRow, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
19260
19628
  className: ds_table_body_virtualized_module_default.emptyState,
19261
19629
  children: emptyState || "No results."
19262
- }) })
19630
+ }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
19631
+ "aria-hidden": true,
19632
+ className: ds_table_body_virtualized_module_default.sentinel,
19633
+ style: { top: `${totalSize.toString()}px` },
19634
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {})
19635
+ })]
19263
19636
  });
19264
19637
  }
19265
19638
  //#endregion
@@ -19272,7 +19645,7 @@ const ROW_SIZE_HEIGHT_MAP = {
19272
19645
  /**
19273
19646
  * Design system Table component
19274
19647
  */
19275
- const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = false, virtualizedOptions, className, onRowClick, emptyState, stickyHeader = true, bordered = true, fullWidth = true, rowSize = "medium", expandable = false, renderExpandedRow, selectable = false, showSelectAllCheckbox = true, onSelectionChange, onSortingChange, onScroll, actions = [], onRowDoubleClick, primaryRowActions = [], secondaryRowActions, reorderable = false, onOrderChange, columnFilters: externalColumnFilters, onColumnFiltersChange, columnVisibility: externalColumnVisibility, onColumnVisibilityChange, activeRowId, infiniteScroll }) => {
19648
+ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = false, virtualizedOptions, className, onRowClick, emptyState, stickyHeader = true, bordered = true, fullWidth = true, rowSize = "medium", expandable = false, renderExpandedRow, selectable = false, showSelectAllCheckbox = true, onSelectionChange, onSortingChange, onScroll, actions = [], onRowDoubleClick, primaryRowActions = [], secondaryRowActions, reorderable = false, onOrderChange, columnFilters: externalColumnFilters, onColumnFiltersChange, columnVisibility: externalColumnVisibility, onColumnVisibilityChange, activeRowId, infiniteScroll, onCellEdit, onCellValidate }) => {
19276
19649
  const [data, setData] = react.useState(tableData);
19277
19650
  const [sorting, setSorting] = react.useState([]);
19278
19651
  const [internalColumnFilters, setInternalColumnFilters] = react.useState([]);
@@ -19438,18 +19811,19 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
19438
19811
  secondaryRowActions,
19439
19812
  renderExpandedRow,
19440
19813
  virtualized,
19441
- activeRowId
19814
+ activeRowId,
19815
+ onCellEdit,
19816
+ ...useEditingState(onCellEdit, onCellValidate)
19442
19817
  };
19443
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DsTableContext.Provider, {
19818
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableContext.Provider, {
19444
19819
  value: contextValue,
19445
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19820
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
19446
19821
  ref: tableContainerRef,
19447
19822
  className: (0, classnames.default)(ds_table_module_default.container, !virtualized && ds_table_module_default.dataTableContainer, virtualized && ds_table_module_default.virtualizedContainer, isBulkActionsVisible && ds_table_module_default.bulkActionsVisible, className),
19448
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DragWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Table, {
19449
- className: (0, classnames.default)(fullWidth && ds_table_module_default.fullWidth, !bordered && ds_table_module_default.tableNoBorder, virtualized && ds_table_module_default.virtualized),
19823
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DragWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Table, {
19824
+ className: (0, classnames.default)(fullWidth && ds_table_module_default.fullWidth, !bordered && ds_table_module_default.tableNoBorder),
19450
19825
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableHeader, { table }), virtualized ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableBodyVirtualized, {
19451
19826
  table,
19452
- tableContainerRef,
19453
19827
  emptyState,
19454
19828
  estimateSize: virtualizedOptions?.estimateSize || ROW_SIZE_HEIGHT_MAP[rowSize],
19455
19829
  overscan: virtualizedOptions?.overscan,
@@ -19460,15 +19834,175 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
19460
19834
  row,
19461
19835
  isSelected: !!rowSelection[row.id]
19462
19836
  }, row.id)) : renderEmptyState() }) })]
19463
- }) })
19464
- }), selectable && actions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableBulkActions, {
19465
- numSelectedRows: selectedRows.length,
19466
- actions: actions.map((action) => ({
19467
- ...action,
19468
- onClick: () => action.onClick(selectedRows)
19469
- })),
19470
- onClearSelection: table.resetRowSelection
19471
- })]
19837
+ }) }), selectable && actions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableBulkActions, {
19838
+ numSelectedRows: selectedRows.length,
19839
+ actions: actions.map((action) => ({
19840
+ ...action,
19841
+ onClick: () => action.onClick(selectedRows)
19842
+ })),
19843
+ onClearSelection: table.resetRowSelection
19844
+ })]
19845
+ })
19846
+ });
19847
+ };
19848
+ //#endregion
19849
+ //#region src/components/ds-table/hooks/use-cell-editor.ts
19850
+ /**
19851
+ * Wires a TanStack Table `editCell` renderer into DsTable's hoisted editing state.
19852
+ * Only mount this hook inside `ColumnDef.editCell` — the table cell layer handles
19853
+ * entering edit mode on double-click.
19854
+ */
19855
+ const useCellEditor = ({ cellContext }) => {
19856
+ const ctx = useDsTableContext();
19857
+ const { row, column, getValue } = cellContext;
19858
+ const isActiveCell = ctx.editing !== null && ctx.editing.cell.row.id === row.id && ctx.editing.cell.column.id === column.id;
19859
+ const value = isActiveCell && ctx.editing ? ctx.editing.draftValue : getValue();
19860
+ const error = isActiveCell && ctx.editing ? ctx.editing.error : null;
19861
+ const setValue = (next) => {
19862
+ ctx.setDraft(next);
19863
+ };
19864
+ const commit = (overrideValue) => {
19865
+ ctx.commit(overrideValue);
19866
+ };
19867
+ const cancel = () => {
19868
+ ctx.cancel();
19869
+ };
19870
+ const stopPropagation = (event) => {
19871
+ event.stopPropagation();
19872
+ };
19873
+ return {
19874
+ value,
19875
+ error,
19876
+ setValue,
19877
+ commit,
19878
+ cancel,
19879
+ stopPropagation,
19880
+ editorContainerProps: {
19881
+ onKeyDown: () => {},
19882
+ onClick: stopPropagation,
19883
+ onDoubleClick: stopPropagation
19884
+ }
19885
+ };
19886
+ };
19887
+ //#endregion
19888
+ //#region src/components/ds-table/components/edit/cell-editors/cell-editors.module.scss
19889
+ var cell_editors_module_default = { "fullWidth": "m8hPaq_fullWidth" };
19890
+ //#endregion
19891
+ //#region src/components/ds-table/components/edit/cell-editors/table-edit-form-control.tsx
19892
+ const TableEditFormControl = ({ cellContext, error, children }) => {
19893
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsFormControl, {
19894
+ hideLabel: true,
19895
+ label: String(cellContext.column.columnDef.header ?? cellContext.column.id),
19896
+ className: cell_editors_module_default.fullWidth,
19897
+ status: error ? "error" : void 0,
19898
+ message: error ?? void 0,
19899
+ messageIcon: "cancel",
19900
+ children
19901
+ });
19902
+ };
19903
+ //#endregion
19904
+ //#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx
19905
+ /** Text input editor for table cells. Render via `ColumnDef.editCell`. */
19906
+ const DsTableEditCellText = ({ cellContext, placeholder, maxLength }) => {
19907
+ const { value, setValue, error } = useCellEditor({ cellContext });
19908
+ const inputRef = (0, react.useRef)(null);
19909
+ (0, react.useEffect)(() => {
19910
+ const input = inputRef.current;
19911
+ if (!input) return;
19912
+ input.focus();
19913
+ input.select();
19914
+ }, []);
19915
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableEditFormControl, {
19916
+ cellContext,
19917
+ error,
19918
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsFormControl.TextInput, {
19919
+ ref: inputRef,
19920
+ className: cell_editors_module_default.fullWidth,
19921
+ value,
19922
+ placeholder,
19923
+ maxLength,
19924
+ onValueChange: setValue,
19925
+ slots: error ? { endAdornment: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
19926
+ icon: "error",
19927
+ size: "tiny"
19928
+ }) } : void 0
19929
+ })
19930
+ });
19931
+ };
19932
+ //#endregion
19933
+ //#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx
19934
+ /** Number input editor for table cells. Render via `ColumnDef.editCell`. */
19935
+ const DsTableEditCellNumber = ({ cellContext, min, max, step }) => {
19936
+ const { value, setValue, error } = useCellEditor({ cellContext });
19937
+ const inputRef = (0, react.useRef)(null);
19938
+ (0, react.useEffect)(() => {
19939
+ const input = inputRef.current;
19940
+ if (!input) return;
19941
+ input.focus();
19942
+ input.select();
19943
+ }, []);
19944
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableEditFormControl, {
19945
+ cellContext,
19946
+ error,
19947
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsFormControl.NumberInput, {
19948
+ ref: inputRef,
19949
+ className: cell_editors_module_default.fullWidth,
19950
+ value,
19951
+ min,
19952
+ max,
19953
+ step,
19954
+ onValueChange: setValue
19955
+ })
19956
+ });
19957
+ };
19958
+ //#endregion
19959
+ //#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx
19960
+ /** Select editor for table cells. Render via `ColumnDef.editCell`. */
19961
+ const DsTableEditCellSelect = ({ cellContext, options, placeholder }) => {
19962
+ const { value, setValue, error } = useCellEditor({ cellContext });
19963
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableEditFormControl, {
19964
+ cellContext,
19965
+ error,
19966
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsFormControl.Select, {
19967
+ className: cell_editors_module_default.fullWidth,
19968
+ value,
19969
+ options,
19970
+ placeholder,
19971
+ onValueChange: setValue
19972
+ })
19973
+ });
19974
+ };
19975
+ //#endregion
19976
+ //#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx
19977
+ /** Date picker editor for table cells. Render via `ColumnDef.editCell`. */
19978
+ const DsTableEditCellDate = ({ cellContext, min, max, placeholder }) => {
19979
+ const { value, setValue, error } = useCellEditor({ cellContext });
19980
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableEditFormControl, {
19981
+ cellContext,
19982
+ error,
19983
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsFormControl.DatePicker, {
19984
+ className: cell_editors_module_default.fullWidth,
19985
+ value,
19986
+ min,
19987
+ max,
19988
+ placeholder,
19989
+ onChange: setValue,
19990
+ slotProps: error ? { input: { slots: { endAdornment: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
19991
+ icon: "error",
19992
+ size: "tiny"
19993
+ }) } } } : void 0
19994
+ })
19995
+ });
19996
+ };
19997
+ //#endregion
19998
+ //#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx
19999
+ /** Checkbox editor for table cells. Render via `ColumnDef.editCell`. */
20000
+ const DsTableEditCellCheckbox = ({ cellContext, disabled }) => {
20001
+ const { value, setValue } = useCellEditor({ cellContext });
20002
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsCheckbox, {
20003
+ checked: value,
20004
+ disabled,
20005
+ onCheckedChange: (checked) => setValue(checked === true)
19472
20006
  });
19473
20007
  };
19474
20008
  //#endregion
@@ -20431,19 +20965,37 @@ DsVerticalTabs.List = DsVerticalTabsList;
20431
20965
  DsVerticalTabs.Tab = DsVerticalTabsTab;
20432
20966
  DsVerticalTabs.Content = DsVerticalTabsContent;
20433
20967
  //#endregion
20434
- //#region src/components/ds-workspace/ds-workspace.module.scss
20435
- var ds_workspace_module_default = {
20436
- "content": "XEdo8q_content",
20437
- "fillParent": "XEdo8q_fillParent",
20438
- "footer": "XEdo8q_footer",
20439
- "header": "XEdo8q_header",
20440
- "root": "XEdo8q_root",
20441
- "subHeader": "XEdo8q_subHeader"
20968
+ //#region src/components/ds-workspace-layout/ds-workspace-layout.module.scss
20969
+ var ds_workspace_layout_module_default = {
20970
+ "body": "pc7Upa_body",
20971
+ "content": "pc7Upa_content",
20972
+ "contentWithLeftPanel": "pc7Upa_contentWithLeftPanel",
20973
+ "fillParent": "pc7Upa_fillParent",
20974
+ "footer": "pc7Upa_footer",
20975
+ "header": "pc7Upa_header",
20976
+ "leftPanel": "pc7Upa_leftPanel",
20977
+ "root": "pc7Upa_root",
20978
+ "sideMenu": "pc7Upa_sideMenu",
20979
+ "sideMenuPanel": "pc7Upa_sideMenuPanel",
20980
+ "sideMenuPinButton": "pc7Upa_sideMenuPinButton",
20981
+ "subHeader": "pc7Upa_subHeader"
20982
+ };
20983
+ //#endregion
20984
+ //#region src/components/ds-workspace-layout/ds-workspace-layout.context.ts
20985
+ const DsWorkspaceLayoutContext = (0, react.createContext)(null);
20986
+ const useDsWorkspaceLayoutContext = () => {
20987
+ const context = (0, react.useContext)(DsWorkspaceLayoutContext);
20988
+ if (!context) throw new Error("DsWorkspaceLayout compound components must be used within DsWorkspaceLayout");
20989
+ return context;
20442
20990
  };
20443
20991
  //#endregion
20444
- //#region src/components/ds-workspace/ds-workspace.tsx
20445
- const DsWorkspace = (t0) => {
20446
- const $ = (0, react_compiler_runtime.c)(10);
20992
+ //#region src/components/ds-workspace-layout/ds-workspace-layout.tsx
20993
+ const DEFAULT_LOCALE = Object.freeze({
20994
+ pinButtonLabel: "Pin side menu",
20995
+ unpinButtonLabel: "Unpin side menu"
20996
+ });
20997
+ const DsWorkspaceLayout = (t0) => {
20998
+ const $ = (0, react_compiler_runtime.c)(17);
20447
20999
  let className;
20448
21000
  let rest;
20449
21001
  let t1;
@@ -20459,24 +21011,58 @@ const DsWorkspace = (t0) => {
20459
21011
  t1 = $[3];
20460
21012
  }
20461
21013
  const fillParent = t1 === void 0 ? false : t1;
21014
+ const [hasLeftSidePanel, setHasLeftSidePanel] = (0, react.useState)(false);
20462
21015
  let t2;
20463
- if ($[4] !== className || $[5] !== fillParent) {
20464
- t2 = (0, classnames.default)(ds_workspace_module_default.root, { [ds_workspace_module_default.fillParent]: fillParent }, className);
20465
- $[4] = className;
20466
- $[5] = fillParent;
20467
- $[6] = t2;
20468
- } else t2 = $[6];
21016
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
21017
+ t2 = () => setHasLeftSidePanel(true);
21018
+ $[4] = t2;
21019
+ } else t2 = $[4];
21020
+ const registerLeftSidePanel = t2;
20469
21021
  let t3;
20470
- if ($[7] !== rest || $[8] !== t2) {
20471
- t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21022
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
21023
+ t3 = () => setHasLeftSidePanel(false);
21024
+ $[5] = t3;
21025
+ } else t3 = $[5];
21026
+ const unregisterLeftSidePanel = t3;
21027
+ let t4;
21028
+ if ($[6] !== hasLeftSidePanel) {
21029
+ t4 = {
21030
+ hasLeftSidePanel,
21031
+ registerLeftSidePanel,
21032
+ unregisterLeftSidePanel
21033
+ };
21034
+ $[6] = hasLeftSidePanel;
21035
+ $[7] = t4;
21036
+ } else t4 = $[7];
21037
+ const contextValue = t4;
21038
+ let t5;
21039
+ if ($[8] !== className || $[9] !== fillParent) {
21040
+ t5 = (0, classnames.default)(ds_workspace_layout_module_default.root, { [ds_workspace_layout_module_default.fillParent]: fillParent }, className);
21041
+ $[8] = className;
21042
+ $[9] = fillParent;
21043
+ $[10] = t5;
21044
+ } else t5 = $[10];
21045
+ let t6;
21046
+ if ($[11] !== rest || $[12] !== t5) {
21047
+ t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
20472
21048
  ...rest,
20473
- className: t2
21049
+ className: t5
20474
21050
  });
20475
- $[7] = rest;
20476
- $[8] = t2;
20477
- $[9] = t3;
20478
- } else t3 = $[9];
20479
- return t3;
21051
+ $[11] = rest;
21052
+ $[12] = t5;
21053
+ $[13] = t6;
21054
+ } else t6 = $[13];
21055
+ let t7;
21056
+ if ($[14] !== contextValue || $[15] !== t6) {
21057
+ t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsWorkspaceLayoutContext.Provider, {
21058
+ value: contextValue,
21059
+ children: t6
21060
+ });
21061
+ $[14] = contextValue;
21062
+ $[15] = t6;
21063
+ $[16] = t7;
21064
+ } else t7 = $[16];
21065
+ return t7;
20480
21066
  };
20481
21067
  const Header = (t0) => {
20482
21068
  const $ = (0, react_compiler_runtime.c)(8);
@@ -20493,7 +21079,7 @@ const Header = (t0) => {
20493
21079
  }
20494
21080
  let t1;
20495
21081
  if ($[3] !== className) {
20496
- t1 = (0, classnames.default)(ds_workspace_module_default.header, className);
21082
+ t1 = (0, classnames.default)(ds_workspace_layout_module_default.header, className);
20497
21083
  $[3] = className;
20498
21084
  $[4] = t1;
20499
21085
  } else t1 = $[4];
@@ -20524,7 +21110,7 @@ const SubHeader = (t0) => {
20524
21110
  }
20525
21111
  let t1;
20526
21112
  if ($[3] !== className) {
20527
- t1 = (0, classnames.default)(ds_workspace_module_default.subHeader, className);
21113
+ t1 = (0, classnames.default)(ds_workspace_layout_module_default.subHeader, className);
20528
21114
  $[3] = className;
20529
21115
  $[4] = t1;
20530
21116
  } else t1 = $[4];
@@ -20540,8 +21126,41 @@ const SubHeader = (t0) => {
20540
21126
  } else t2 = $[7];
20541
21127
  return t2;
20542
21128
  };
20543
- /** Stacking context for non-portal drawer containment. */
21129
+ /** Content area: column layout, 24px vertical margins, 16px gap, 40px horizontal margins (24px when LeftPanel is mounted). */
20544
21130
  const Content = (t0) => {
21131
+ const $ = (0, react_compiler_runtime.c)(9);
21132
+ let className;
21133
+ let rest;
21134
+ if ($[0] !== t0) {
21135
+ ({className, ...rest} = t0);
21136
+ $[0] = t0;
21137
+ $[1] = className;
21138
+ $[2] = rest;
21139
+ } else {
21140
+ className = $[1];
21141
+ rest = $[2];
21142
+ }
21143
+ const { hasLeftSidePanel } = useDsWorkspaceLayoutContext();
21144
+ let t1;
21145
+ if ($[3] !== className || $[4] !== hasLeftSidePanel) {
21146
+ t1 = (0, classnames.default)(ds_workspace_layout_module_default.content, { [ds_workspace_layout_module_default.contentWithLeftPanel]: hasLeftSidePanel }, className);
21147
+ $[3] = className;
21148
+ $[4] = hasLeftSidePanel;
21149
+ $[5] = t1;
21150
+ } else t1 = $[5];
21151
+ let t2;
21152
+ if ($[6] !== rest || $[7] !== t1) {
21153
+ t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21154
+ ...rest,
21155
+ className: t1
21156
+ });
21157
+ $[6] = rest;
21158
+ $[7] = t1;
21159
+ $[8] = t2;
21160
+ } else t2 = $[8];
21161
+ return t2;
21162
+ };
21163
+ const Footer = (t0) => {
20545
21164
  const $ = (0, react_compiler_runtime.c)(8);
20546
21165
  let className;
20547
21166
  let rest;
@@ -20556,13 +21175,13 @@ const Content = (t0) => {
20556
21175
  }
20557
21176
  let t1;
20558
21177
  if ($[3] !== className) {
20559
- t1 = (0, classnames.default)(ds_workspace_module_default.content, className);
21178
+ t1 = (0, classnames.default)(ds_workspace_layout_module_default.footer, className);
20560
21179
  $[3] = className;
20561
21180
  $[4] = t1;
20562
21181
  } else t1 = $[4];
20563
21182
  let t2;
20564
21183
  if ($[5] !== rest || $[6] !== t1) {
20565
- t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21184
+ t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("footer", {
20566
21185
  ...rest,
20567
21186
  className: t1
20568
21187
  });
@@ -20572,7 +21191,7 @@ const Content = (t0) => {
20572
21191
  } else t2 = $[7];
20573
21192
  return t2;
20574
21193
  };
20575
- const Footer = (t0) => {
21194
+ const Body = (t0) => {
20576
21195
  const $ = (0, react_compiler_runtime.c)(8);
20577
21196
  let className;
20578
21197
  let rest;
@@ -20585,15 +21204,16 @@ const Footer = (t0) => {
20585
21204
  className = $[1];
20586
21205
  rest = $[2];
20587
21206
  }
21207
+ useDsWorkspaceLayoutContext();
20588
21208
  let t1;
20589
21209
  if ($[3] !== className) {
20590
- t1 = (0, classnames.default)(ds_workspace_module_default.footer, className);
21210
+ t1 = (0, classnames.default)(ds_workspace_layout_module_default.body, className);
20591
21211
  $[3] = className;
20592
21212
  $[4] = t1;
20593
21213
  } else t1 = $[4];
20594
21214
  let t2;
20595
21215
  if ($[5] !== rest || $[6] !== t1) {
20596
- t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("footer", {
21216
+ t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
20597
21217
  ...rest,
20598
21218
  className: t1
20599
21219
  });
@@ -20603,10 +21223,170 @@ const Footer = (t0) => {
20603
21223
  } else t2 = $[7];
20604
21224
  return t2;
20605
21225
  };
20606
- DsWorkspace.Header = Header;
20607
- DsWorkspace.SubHeader = SubHeader;
20608
- DsWorkspace.Content = Content;
20609
- DsWorkspace.Footer = Footer;
21226
+ const SideMenu = (t0) => {
21227
+ const $ = (0, react_compiler_runtime.c)(28);
21228
+ let children;
21229
+ let className;
21230
+ let locale;
21231
+ let onPinnedChange;
21232
+ let rest;
21233
+ let t1;
21234
+ if ($[0] !== t0) {
21235
+ ({className, pinned: t1, onPinnedChange, locale, children, ...rest} = t0);
21236
+ $[0] = t0;
21237
+ $[1] = children;
21238
+ $[2] = className;
21239
+ $[3] = locale;
21240
+ $[4] = onPinnedChange;
21241
+ $[5] = rest;
21242
+ $[6] = t1;
21243
+ } else {
21244
+ children = $[1];
21245
+ className = $[2];
21246
+ locale = $[3];
21247
+ onPinnedChange = $[4];
21248
+ rest = $[5];
21249
+ t1 = $[6];
21250
+ }
21251
+ const pinned = t1 === void 0 ? false : t1;
21252
+ useDsWorkspaceLayoutContext();
21253
+ const [isHovering, setIsHovering] = (0, react.useState)(false);
21254
+ const isExpanded = pinned || isHovering;
21255
+ const ariaLabel = pinned ? locale?.unpinButtonLabel ?? DEFAULT_LOCALE.unpinButtonLabel : locale?.pinButtonLabel ?? DEFAULT_LOCALE.pinButtonLabel;
21256
+ let t2;
21257
+ if ($[7] !== className) {
21258
+ t2 = (0, classnames.default)(ds_workspace_layout_module_default.sideMenu, className);
21259
+ $[7] = className;
21260
+ $[8] = t2;
21261
+ } else t2 = $[8];
21262
+ let t3;
21263
+ if ($[9] !== pinned) {
21264
+ t3 = pinned ? { "data-pinned": "" } : {};
21265
+ $[9] = pinned;
21266
+ $[10] = t3;
21267
+ } else t3 = $[10];
21268
+ let t4;
21269
+ if ($[11] !== isExpanded) {
21270
+ t4 = isExpanded ? { "data-expanded": "" } : {};
21271
+ $[11] = isExpanded;
21272
+ $[12] = t4;
21273
+ } else t4 = $[12];
21274
+ let t5;
21275
+ let t6;
21276
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
21277
+ t5 = () => setIsHovering(true);
21278
+ t6 = () => setIsHovering(false);
21279
+ $[13] = t5;
21280
+ $[14] = t6;
21281
+ } else {
21282
+ t5 = $[13];
21283
+ t6 = $[14];
21284
+ }
21285
+ let t7;
21286
+ if ($[15] !== ariaLabel || $[16] !== onPinnedChange || $[17] !== pinned) {
21287
+ t7 = onPinnedChange ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
21288
+ type: "button",
21289
+ className: ds_workspace_layout_module_default.sideMenuPinButton,
21290
+ onClick: () => onPinnedChange(!pinned),
21291
+ "aria-label": ariaLabel,
21292
+ "aria-pressed": pinned,
21293
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
21294
+ icon: "keep",
21295
+ size: "small",
21296
+ filled: pinned
21297
+ })
21298
+ }) : null;
21299
+ $[15] = ariaLabel;
21300
+ $[16] = onPinnedChange;
21301
+ $[17] = pinned;
21302
+ $[18] = t7;
21303
+ } else t7 = $[18];
21304
+ let t8;
21305
+ if ($[19] !== children || $[20] !== t7) {
21306
+ t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21307
+ className: ds_workspace_layout_module_default.sideMenuPanel,
21308
+ onMouseEnter: t5,
21309
+ onMouseLeave: t6,
21310
+ children: [t7, children]
21311
+ });
21312
+ $[19] = children;
21313
+ $[20] = t7;
21314
+ $[21] = t8;
21315
+ } else t8 = $[21];
21316
+ let t9;
21317
+ if ($[22] !== rest || $[23] !== t2 || $[24] !== t3 || $[25] !== t4 || $[26] !== t8) {
21318
+ t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
21319
+ ...rest,
21320
+ className: t2,
21321
+ ...t3,
21322
+ ...t4,
21323
+ children: t8
21324
+ });
21325
+ $[22] = rest;
21326
+ $[23] = t2;
21327
+ $[24] = t3;
21328
+ $[25] = t4;
21329
+ $[26] = t8;
21330
+ $[27] = t9;
21331
+ } else t9 = $[27];
21332
+ return t9;
21333
+ };
21334
+ const LeftPanel = (t0) => {
21335
+ const $ = (0, react_compiler_runtime.c)(12);
21336
+ let className;
21337
+ let rest;
21338
+ if ($[0] !== t0) {
21339
+ ({className, ...rest} = t0);
21340
+ $[0] = t0;
21341
+ $[1] = className;
21342
+ $[2] = rest;
21343
+ } else {
21344
+ className = $[1];
21345
+ rest = $[2];
21346
+ }
21347
+ const { registerLeftSidePanel, unregisterLeftSidePanel } = useDsWorkspaceLayoutContext();
21348
+ let t1;
21349
+ let t2;
21350
+ if ($[3] !== registerLeftSidePanel || $[4] !== unregisterLeftSidePanel) {
21351
+ t1 = () => {
21352
+ registerLeftSidePanel();
21353
+ return unregisterLeftSidePanel;
21354
+ };
21355
+ t2 = [registerLeftSidePanel, unregisterLeftSidePanel];
21356
+ $[3] = registerLeftSidePanel;
21357
+ $[4] = unregisterLeftSidePanel;
21358
+ $[5] = t1;
21359
+ $[6] = t2;
21360
+ } else {
21361
+ t1 = $[5];
21362
+ t2 = $[6];
21363
+ }
21364
+ (0, react.useEffect)(t1, t2);
21365
+ let t3;
21366
+ if ($[7] !== className) {
21367
+ t3 = (0, classnames.default)(ds_workspace_layout_module_default.leftPanel, className);
21368
+ $[7] = className;
21369
+ $[8] = t3;
21370
+ } else t3 = $[8];
21371
+ let t4;
21372
+ if ($[9] !== rest || $[10] !== t3) {
21373
+ t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
21374
+ ...rest,
21375
+ className: t3
21376
+ });
21377
+ $[9] = rest;
21378
+ $[10] = t3;
21379
+ $[11] = t4;
21380
+ } else t4 = $[11];
21381
+ return t4;
21382
+ };
21383
+ DsWorkspaceLayout.Header = Header;
21384
+ DsWorkspaceLayout.SubHeader = SubHeader;
21385
+ DsWorkspaceLayout.Content = Content;
21386
+ DsWorkspaceLayout.Footer = Footer;
21387
+ DsWorkspaceLayout.Body = Body;
21388
+ DsWorkspaceLayout.SideMenu = SideMenu;
21389
+ DsWorkspaceLayout.LeftPanel = LeftPanel;
20610
21390
  //#endregion
20611
21391
  exports.BREAKPOINT_LG = BREAKPOINT_LG;
20612
21392
  exports.DsAlertBanner = DsAlertBanner;
@@ -20673,6 +21453,14 @@ exports.DsStepContent = DsStepContent;
20673
21453
  exports.DsStepper = DsStepper;
20674
21454
  exports.DsSystemStatus = DsSystemStatus;
20675
21455
  exports.DsTable = DsTable;
21456
+ exports.DsTableColumnFilterPopover = DsTableColumnFilterPopover;
21457
+ exports.DsTableEditCellCheckbox = DsTableEditCellCheckbox;
21458
+ exports.DsTableEditCellDate = DsTableEditCellDate;
21459
+ exports.DsTableEditCellNumber = DsTableEditCellNumber;
21460
+ exports.DsTableEditCellSelect = DsTableEditCellSelect;
21461
+ exports.DsTableEditCellText = DsTableEditCellText;
21462
+ exports.DsTableEditableCell = DsTableEditableCell;
21463
+ exports.DsTableEditingCell = DsTableEditingCell;
20676
21464
  exports.DsTabs = DsTabs;
20677
21465
  exports.DsTag = DsTag;
20678
21466
  exports.DsTagFilter = DsTagFilter;
@@ -20686,7 +21474,7 @@ exports.DsTooltip = DsTooltip;
20686
21474
  exports.DsTree = DsTree;
20687
21475
  exports.DsTypography = DsTypography;
20688
21476
  exports.DsVerticalTabs = DsVerticalTabs;
20689
- exports.DsWorkspace = DsWorkspace;
21477
+ exports.DsWorkspaceLayout = DsWorkspaceLayout;
20690
21478
  exports.FatalFileUploadError = FatalFileUploadError;
20691
21479
  exports.FileUpload = FileUpload;
20692
21480
  exports.FileUploadError = FileUploadError;
@@ -20734,6 +21522,7 @@ exports.tagSizes = tagSizes;
20734
21522
  exports.tagVariants = tagVariants;
20735
21523
  exports.textInputSizes = textInputSizes;
20736
21524
  exports.useBreakpoint = useBreakpoint;
21525
+ exports.useCellEditor = useCellEditor;
20737
21526
  exports.useCheckboxSelectAll = useCheckboxSelectAll;
20738
21527
  exports.useFileUpload = useFileUpload;
20739
21528
  exports.useResponsiveValue = useResponsiveValue;