@tedi-design-system/react 18.0.0-rc.30 → 18.0.0-rc.31

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 (32) hide show
  1. package/bundle-stats.html +1 -1
  2. package/index.css +1 -1
  3. package/package.json +2 -2
  4. package/src/community/components/layout/header/components/header-role/header-role.cjs.js +1 -1
  5. package/src/community/components/layout/header/components/header-role/header-role.es.js +1 -1
  6. package/src/community/components/layout/sidenav/sidenav.cjs.js +1 -1
  7. package/src/community/components/layout/sidenav/sidenav.es.js +1 -1
  8. package/src/community/components/vertical-stepper/step-item/step-item.cjs.js +1 -1
  9. package/src/community/components/vertical-stepper/step-item/step-item.es.js +1 -1
  10. package/src/tedi/components/buttons/collapse-button/collapse-button.cjs.js +1 -1
  11. package/src/tedi/components/buttons/collapse-button/collapse-button.es.js +31 -14
  12. package/src/tedi/components/content/collapse/collapse.cjs.js +1 -0
  13. package/src/tedi/components/{buttons → content}/collapse/collapse.d.ts +17 -0
  14. package/src/tedi/components/content/collapse/collapse.es.js +84 -0
  15. package/src/tedi/components/content/collapse/collapse.module.scss.cjs.js +1 -0
  16. package/src/tedi/components/content/collapse/collapse.module.scss.es.js +8 -0
  17. package/src/tedi/components/content/table/table.cjs.js +1 -1
  18. package/src/tedi/components/content/table/table.d.ts +6 -6
  19. package/src/tedi/components/content/table/table.es.js +125 -126
  20. package/src/tedi/components/layout/footer/footer-section/footer-section.cjs.js +1 -1
  21. package/src/tedi/components/layout/footer/footer-section/footer-section.es.js +12 -11
  22. package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.cjs.js +1 -1
  23. package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.es.js +116 -120
  24. package/src/tedi/components/layout/sidenav/sidenav.module.scss.cjs.js +1 -1
  25. package/src/tedi/components/layout/sidenav/sidenav.module.scss.es.js +1 -1
  26. package/src/tedi/index.d.ts +1 -1
  27. package/tedi.cjs.js +1 -1
  28. package/tedi.es.js +1 -1
  29. package/src/tedi/components/buttons/collapse/collapse.cjs.js +0 -1
  30. package/src/tedi/components/buttons/collapse/collapse.es.js +0 -114
  31. package/src/tedi/components/buttons/collapse/collapse.module.scss.cjs.js +0 -1
  32. package/src/tedi/components/buttons/collapse/collapse.module.scss.es.js +0 -19
@@ -1,15 +1,15 @@
1
- import { jsx as i, jsxs as re } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as de } from "react/jsx-runtime";
2
2
  import { useReactTable as mn, flexRender as xe } from "../../../../../external/@tanstack/react-table/build/lib/index.es.js";
3
3
  import k from "../../../../../external/classnames/index.es.js";
4
4
  import { useRef as H, useId as fn, useMemo as w, useCallback as N, useState as K, useEffect as ft, Fragment as bn } from "react";
5
5
  import { Icon as ht } from "../../base/icon/icon.es.js";
6
- import { Collapse as hn } from "../../buttons/collapse/collapse.es.js";
6
+ import { CollapseButton as hn } from "../../buttons/collapse-button/collapse-button.es.js";
7
7
  import { Checkbox as bt } from "../../form/checkbox/checkbox.es.js";
8
8
  import { Radio as wn } from "../../form/radio/radio.es.js";
9
9
  import { TextField as _n } from "../../form/textfield/textfield.es.js";
10
10
  import l from "./table.module.scss.es.js";
11
- import { TableColumnsMenu as Cn } from "./table-columns-menu/table-columns-menu.es.js";
12
- import { TableContext as vn } from "./table-context.es.js";
11
+ import { TableColumnsMenu as vn } from "./table-columns-menu/table-columns-menu.es.js";
12
+ import { TableContext as Cn } from "./table-context.es.js";
13
13
  import { TableHeaderButton as xn } from "./table-header-button/table-header-button.es.js";
14
14
  import { TableToolbar as Sn } from "./table-toolbar/table-toolbar.es.js";
15
15
  import { useTablePersistence as Dn } from "./use-table-persistence.es.js";
@@ -58,20 +58,20 @@ const eo = (R, E) => (V) => {
58
58
  onClick: A,
59
59
  onKeyDownHandler: De,
60
60
  ariaRowIndex: Re,
61
- columnProps: ne,
62
- draggable: se,
63
- dragHandleLabel: ce,
61
+ columnProps: oe,
62
+ draggable: ce,
63
+ dragHandleLabel: ue,
64
64
  dragHandlers: u,
65
65
  dragHandleId: ye,
66
66
  dragHandlePickedUp: Ie,
67
- dragOverColumnId: ue
67
+ dragOverColumnId: ge
68
68
  } = R;
69
69
  return /* @__PURE__ */ i(
70
70
  "tr",
71
71
  {
72
72
  className: V,
73
73
  style: x,
74
- draggable: se || void 0,
74
+ draggable: ce || void 0,
75
75
  onDragStart: u == null ? void 0 : u.onDragStart,
76
76
  onDragOver: u == null ? void 0 : u.onDragOver,
77
77
  onDragLeave: u == null ? void 0 : u.onDragLeave,
@@ -84,8 +84,8 @@ const eo = (R, E) => (V) => {
84
84
  "aria-rowindex": Re,
85
85
  "aria-current": O ? "true" : void 0,
86
86
  children: E.getVisibleCells().map(($) => {
87
- var ge;
88
- const g = $.column.columnDef.meta, F = ne == null ? void 0 : ne($.column.id), oe = se && $.column.id === Se, z = !!ue && $.column.id === ue, G = (ge = g == null ? void 0 : g.rowSpan) == null ? void 0 : ge.call(g, $.row);
87
+ var pe;
88
+ const g = $.column.columnDef.meta, F = oe == null ? void 0 : oe($.column.id), le = ce && $.column.id === Se, z = !!ge && $.column.id === ge, G = (pe = g == null ? void 0 : g.rowSpan) == null ? void 0 : pe.call(g, $.row);
89
89
  return G === 0 ? null : /* @__PURE__ */ i(
90
90
  "td",
91
91
  {
@@ -95,16 +95,16 @@ const eo = (R, E) => (V) => {
95
95
  {
96
96
  [l[`tedi-table__cell--align-${g == null ? void 0 : g.align}`]]: g == null ? void 0 : g.align,
97
97
  [l[`tedi-table__cell--valign-${g == null ? void 0 : g.vAlign}`]]: g == null ? void 0 : g.vAlign,
98
- [l["tedi-table__cell--drag-handle"]]: oe,
98
+ [l["tedi-table__cell--drag-handle"]]: le,
99
99
  [l["tedi-table__cell--drag-over"]]: z
100
100
  },
101
101
  F == null ? void 0 : F.className
102
102
  ),
103
103
  style: F == null ? void 0 : F.style,
104
- children: oe ? /* @__PURE__ */ i(
104
+ children: le ? /* @__PURE__ */ i(
105
105
  On,
106
106
  {
107
- label: ce,
107
+ label: ue,
108
108
  onHandlePointerDown: (u == null ? void 0 : u.onHandlePointerDown) ?? (() => {
109
109
  }),
110
110
  onKeyDown: u == null ? void 0 : u.onKeyDown,
@@ -118,12 +118,12 @@ const eo = (R, E) => (V) => {
118
118
  })
119
119
  }
120
120
  );
121
- }, Ve = "__select__", Ge = "__expand__", Se = "__drag__", de = () => !0, Ln = {
122
- text: de,
123
- select: de,
124
- "multi-select": de,
125
- "date-range": de,
126
- "date-range-period": de
121
+ }, Ve = "__select__", Ge = "__expand__", Se = "__drag__", se = () => !0, Ln = {
122
+ text: se,
123
+ select: se,
124
+ "multi-select": se,
125
+ "date-range": se,
126
+ "date-range-period": se
127
127
  };
128
128
  function Pn(R) {
129
129
  return Array.isArray(R.columns);
@@ -138,33 +138,33 @@ function _t(R) {
138
138
  state: A,
139
139
  defaultState: De,
140
140
  onStateChange: Re,
141
- persist: ne,
142
- emptyState: se,
143
- emptyStateRole: ce,
141
+ persist: oe,
142
+ emptyState: ce,
143
+ emptyStateRole: ue,
144
144
  className: u,
145
145
  children: ye,
146
146
  striped: Ie = !1,
147
- verticalBorders: ue = !1,
147
+ verticalBorders: ge = !1,
148
148
  borderless: $ = !1,
149
149
  stickyFirstColumn: g = !1,
150
150
  stickyHeader: F = !1,
151
- maxHeight: oe,
151
+ maxHeight: le,
152
152
  onRowClick: z,
153
153
  activeRowId: G,
154
- rowHover: ge,
154
+ rowHover: pe,
155
155
  enableRowSelection: Me,
156
156
  selectionMode: ke = "multiple",
157
- highlightSelectedRows: Ct = !0,
157
+ highlightSelectedRows: vt = !0,
158
158
  enableColumnFilters: Ee = !1,
159
- renderSubComponent: pe,
159
+ renderSubComponent: W,
160
160
  getRowCanExpand: je,
161
161
  getSubRows: We,
162
- getRowId: vt,
162
+ getRowId: Ct,
163
163
  expandTrigger: Te = "button",
164
164
  paginateExpandedRows: xt = !1,
165
165
  pagination: M,
166
166
  autoResetPageIndex: St = !0,
167
- manualPagination: W = !1,
167
+ manualPagination: X = !1,
168
168
  manualSorting: Ne = !1,
169
169
  manualFiltering: Oe = !1,
170
170
  pageCount: Xe,
@@ -176,9 +176,9 @@ function _t(R) {
176
176
  columnProps: j,
177
177
  reorderableRows: S = !1,
178
178
  onRowDrop: L,
179
- reorderableColumns: X = !1
180
- } = R, { getLabel: b } = Rn(), Je = se ?? b("table.no-data"), Y = H(b);
181
- Y.current = b;
179
+ reorderableColumns: Y = !1
180
+ } = R, { getLabel: b } = Rn(), Je = ce ?? b("table.no-data"), q = H(b);
181
+ q.current = b;
182
182
  const Dt = fn(), p = E ?? Dt, h = w(() => M ? M === !0 ? { pageSize: 10, pageSizeOptions: [10, 25, 50], paginationProps: void 0 } : {
183
183
  pageSize: M.pageSize ?? 10,
184
184
  pageSizeOptions: M.pageSizeOptions === void 0 ? [10, 25, 50] : M.pageSizeOptions,
@@ -187,7 +187,7 @@ function _t(R) {
187
187
  const e = h == null ? void 0 : h.pageSizeOptions;
188
188
  return Array.isArray(e) && e.length > 0 ? e : void 0;
189
189
  }, [h]), [P, D] = Dn({
190
- persist: ne,
190
+ persist: oe,
191
191
  controlled: A,
192
192
  defaultState: De,
193
193
  onStateChange: Re
@@ -250,9 +250,9 @@ function _t(R) {
250
250
  });
251
251
  },
252
252
  [D, h]
253
- ), le = !!(pe || We), Qe = !!Me, $t = w(() => yn(), []), Lt = w(() => Oe ? void 0 : In(), [Oe]), Pt = w(() => Ne ? void 0 : kn(), [Ne]), At = w(() => le ? En() : void 0, [le]), Ft = w(
254
- () => y && !W ? Tn() : void 0,
255
- [y, W]
253
+ ), ae = !!(W || We), Qe = !!Me, $t = w(() => yn(), []), Lt = w(() => Oe ? void 0 : In(), [Oe]), Pt = w(() => Ne ? void 0 : kn(), [Ne]), At = w(() => ae ? En() : void 0, [ae]), Ft = w(
254
+ () => y && !X ? Tn() : void 0,
255
+ [y, X]
256
256
  ), zt = w(() => {
257
257
  const e = [];
258
258
  if (S && e.push({
@@ -277,7 +277,7 @@ function _t(R) {
277
277
  ...$e,
278
278
  id: `${p}-select-all`,
279
279
  name: `${p}-select-all`,
280
- label: Y.current("table.select-all", o.getIsAllPageRowsSelected()),
280
+ label: q.current("table.select-all", o.getIsAllPageRowsSelected()),
281
281
  hideLabel: !0,
282
282
  value: "all",
283
283
  checked: o.getIsAllPageRowsSelected(),
@@ -291,7 +291,7 @@ function _t(R) {
291
291
  ...Ye,
292
292
  id: `${p}-select-${o.id}`,
293
293
  name: t,
294
- label: Y.current("table.select-row", o.getIsSelected()),
294
+ label: q.current("table.select-row", o.getIsSelected()),
295
295
  hideLabel: !0,
296
296
  value: o.id,
297
297
  checked: o.getIsSelected(),
@@ -306,7 +306,7 @@ function _t(R) {
306
306
  ...$e,
307
307
  id: `${p}-select-${o.id}`,
308
308
  name: `${p}-select-${o.id}`,
309
- label: Y.current("table.select-row", o.getIsSelected()),
309
+ label: q.current("table.select-row", o.getIsSelected()),
310
310
  hideLabel: !0,
311
311
  value: o.id,
312
312
  checked: o.getIsSelected(),
@@ -317,7 +317,7 @@ function _t(R) {
317
317
  )
318
318
  });
319
319
  }
320
- return le && e.push({
320
+ return ae && e.push({
321
321
  id: Ge,
322
322
  enableSorting: !1,
323
323
  enableHiding: !1,
@@ -337,17 +337,15 @@ function _t(R) {
337
337
  children: /* @__PURE__ */ i(
338
338
  hn,
339
339
  {
340
- iconOnly: !0,
341
340
  arrowType: Te === "row" ? "default" : "secondary",
342
- hideCollapseText: !0,
343
341
  ...qe,
342
+ hideText: !0,
344
343
  id: `${p}-expand-${n.id}`,
345
- controlsId: t,
346
- openText: Y.current("table.expand-row"),
347
- closeText: Y.current("table.collapse-row"),
344
+ "aria-controls": W ? t : void 0,
345
+ openText: q.current("table.expand-row"),
346
+ closeText: q.current("table.collapse-row"),
348
347
  open: n.getIsExpanded(),
349
- onToggle: () => n.toggleExpanded(),
350
- children: null
348
+ onOpenChange: () => n.toggleExpanded()
351
349
  }
352
350
  )
353
351
  }
@@ -358,7 +356,8 @@ function _t(R) {
358
356
  x,
359
357
  Qe,
360
358
  ke,
361
- le,
359
+ ae,
360
+ W,
362
361
  Te,
363
362
  S,
364
363
  p,
@@ -384,16 +383,16 @@ function _t(R) {
384
383
  enableMultiRowSelection: ke !== "single",
385
384
  enableColumnFilters: Ee,
386
385
  autoResetPageIndex: St,
387
- paginateExpandedRows: y && !W ? xt : !0,
388
- manualPagination: W,
386
+ paginateExpandedRows: y && !X ? xt : !0,
387
+ manualPagination: X,
389
388
  manualSorting: Ne,
390
389
  manualFiltering: Oe,
391
390
  // `pageCount` only matters in manual mode; TanStack ignores it otherwise.
392
- pageCount: W && Xe !== void 0 ? Xe : void 0,
393
- rowCount: W && me !== void 0 ? me : void 0,
394
- getRowCanExpand: pe ? je ?? (() => !0) : je,
391
+ pageCount: X && Xe !== void 0 ? Xe : void 0,
392
+ rowCount: X && me !== void 0 ? me : void 0,
393
+ getRowCanExpand: W ? je ?? (() => !0) : je,
395
394
  getSubRows: We,
396
- getRowId: vt,
395
+ getRowId: Ct,
397
396
  onColumnVisibilityChange: yt,
398
397
  onColumnOrderChange: Tt,
399
398
  onRowSelectionChange: It,
@@ -410,12 +409,12 @@ function _t(R) {
410
409
  }), Mt = w(
411
410
  () => ({ table: s, size: O, id: p, state: P }),
412
411
  [s, O, p, P]
413
- ), jt = N((e) => s.setPageIndex(e - 1), [s]), Wt = N((e) => s.setPageSize(e), [s]), Xt = s.getHeaderGroups().length > 1, fe = Te === "row" && le, Yt = ge ?? (!!z || fe), qt = k(
412
+ ), jt = N((e) => s.setPageIndex(e - 1), [s]), Wt = N((e) => s.setPageSize(e), [s]), Xt = s.getHeaderGroups().length > 1, fe = Te === "row" && ae, Yt = pe ?? (!!z || fe), qt = k(
414
413
  l["tedi-table"],
415
414
  l[`tedi-table--${O}`],
416
415
  {
417
416
  [l["tedi-table--striped"]]: Ie,
418
- [l["tedi-table--vertical-borders"]]: ue,
417
+ [l["tedi-table--vertical-borders"]]: ge,
419
418
  [l["tedi-table--borderless"]]: $,
420
419
  [l["tedi-table--sticky-first-column"]]: g,
421
420
  [l["tedi-table--sticky-header"]]: F,
@@ -431,30 +430,30 @@ function _t(R) {
431
430
  fe && e.getCanExpand() && e.toggleExpanded(), z == null || z(e);
432
431
  }, Qt = (e) => (n) => {
433
432
  tt(e) && n.target === n.currentTarget && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), nt(e));
434
- }, ot = be.length + (Ee ? 1 : 0), lt = s.getState().pagination, Zt = y ? lt.pageIndex * lt.pageSize : 0, en = y ? me ?? s.getFilteredRowModel().rows.length : _.length, tn = y ? ot + en : void 0, [at, Pe] = K(null), [nn, we] = K(null), q = H(null), J = H(null), [it, Ae] = K(null), [rt, _e] = K(null), Q = H(null), Z = H(null), [dt, Fe] = K(null), Ce = H([]), [st, ze] = K(null), ae = H(-1), [on, B] = K(""), ve = H(null), [ln, ct] = K(0), Be = w(
433
+ }, ot = be.length + (Ee ? 1 : 0), lt = s.getState().pagination, Zt = y ? lt.pageIndex * lt.pageSize : 0, en = y ? me ?? s.getFilteredRowModel().rows.length : _.length, tn = y ? ot + en : void 0, [at, Pe] = K(null), [nn, we] = K(null), J = H(null), Q = H(null), [it, Ae] = K(null), [rt, _e] = K(null), Z = H(null), ee = H(null), [dt, Fe] = K(null), ve = H([]), [st, ze] = K(null), ie = H(-1), [on, B] = K(""), Ce = H(null), [ln, ct] = K(0), Be = w(
435
434
  () => S ? new Map(_.map((e) => [e.id, e.index])) : /* @__PURE__ */ new Map(),
436
435
  [S, _]
437
436
  );
438
437
  ft(() => {
439
- if (!S && !X) return;
438
+ if (!S && !Y) return;
440
439
  const e = () => {
441
- J.current = null, Z.current = null;
440
+ Q.current = null, ee.current = null;
442
441
  };
443
442
  return window.addEventListener("mouseup", e), window.addEventListener("touchend", e), () => {
444
443
  window.removeEventListener("mouseup", e), window.removeEventListener("touchend", e);
445
444
  };
446
- }, [S, X]);
445
+ }, [S, Y]);
447
446
  const an = N(
448
447
  (e) => ({
449
448
  onHandlePointerDown: () => {
450
- J.current = e;
449
+ Q.current = e;
451
450
  },
452
451
  onDragStart: (n) => {
453
- if (J.current !== e) {
452
+ if (Q.current !== e) {
454
453
  n.preventDefault();
455
454
  return;
456
455
  }
457
- J.current = null, n.dataTransfer.effectAllowed = "move";
456
+ Q.current = null, n.dataTransfer.effectAllowed = "move";
458
457
  try {
459
458
  n.dataTransfer.setData("text/plain", e);
460
459
  } catch {
@@ -465,31 +464,31 @@ function _t(R) {
465
464
  c.style.cssText = `position:fixed;top:-10000px;left:0;width:${a.width}px;pointer-events:none;`;
466
465
  const f = document.createElement("table");
467
466
  f.className = o.className, f.style.cssText = `width:${a.width}px;table-layout:fixed;border-collapse:collapse;`;
468
- const C = document.createElement("tbody"), v = t.cloneNode(!0);
469
- v.classList.add(l["tedi-table__row--drag-preview"]);
470
- const d = Array.from(v.children);
471
- r.forEach((ee, I) => {
467
+ const v = document.createElement("tbody"), C = t.cloneNode(!0);
468
+ C.classList.add(l["tedi-table__row--drag-preview"]);
469
+ const d = Array.from(C.children);
470
+ r.forEach((te, I) => {
472
471
  const U = d[I];
473
472
  if (!U) return;
474
- const ie = ee.getBoundingClientRect();
475
- U.style.width = `${ie.width}px`, U.style.minWidth = `${ie.width}px`, U.style.maxWidth = `${ie.width}px`;
476
- }), C.appendChild(v), f.appendChild(C), c.appendChild(f), document.body.appendChild(c), n.dataTransfer.setDragImage(c, 24, a.height / 2), window.setTimeout(() => c.remove(), 0);
473
+ const re = te.getBoundingClientRect();
474
+ U.style.width = `${re.width}px`, U.style.minWidth = `${re.width}px`, U.style.maxWidth = `${re.width}px`;
475
+ }), v.appendChild(C), f.appendChild(v), c.appendChild(f), document.body.appendChild(c), n.dataTransfer.setDragImage(c, 24, a.height / 2), window.setTimeout(() => c.remove(), 0);
477
476
  }
478
- q.current = e, Pe(e);
477
+ J.current = e, Pe(e);
479
478
  },
480
479
  onDragOver: (n) => {
481
- !q.current || q.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", we(e));
480
+ !J.current || J.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", we(e));
482
481
  },
483
482
  onDragLeave: () => {
484
483
  we((n) => n === e ? null : n);
485
484
  },
486
485
  onDragEnd: () => {
487
- q.current = null, J.current = null, Pe(null), we(null);
486
+ J.current = null, Q.current = null, Pe(null), we(null);
488
487
  },
489
488
  onDrop: (n) => {
490
489
  n.preventDefault();
491
- const t = q.current, o = e;
492
- if (q.current = null, J.current = null, Pe(null), we(null), !t || t === o) return;
490
+ const t = J.current, o = e;
491
+ if (J.current = null, Q.current = null, Pe(null), we(null), !t || t === o) return;
493
492
  const a = Be.get(t), r = Be.get(o);
494
493
  a === void 0 || r === void 0 || L == null || L({ fromId: t, toId: o, fromIndex: a, toIndex: r });
495
494
  }
@@ -501,14 +500,14 @@ function _t(R) {
501
500
  }, rn = N(
502
501
  (e) => ({
503
502
  onHandlePointerDown: () => {
504
- Z.current = e;
503
+ ee.current = e;
505
504
  },
506
505
  onDragStart: (n) => {
507
- if (Z.current !== e) {
506
+ if (ee.current !== e) {
508
507
  n.preventDefault();
509
508
  return;
510
509
  }
511
- Z.current = null, n.dataTransfer.effectAllowed = "move";
510
+ ee.current = null, n.dataTransfer.effectAllowed = "move";
512
511
  try {
513
512
  n.dataTransfer.setData("text/plain", e);
514
513
  } catch {
@@ -517,25 +516,25 @@ function _t(R) {
517
516
  a.style.cssText = `position:fixed;top:-10000px;left:0;width:${o.width}px;pointer-events:none;`;
518
517
  const r = document.createElement("table"), c = t.closest("table");
519
518
  r.className = (c == null ? void 0 : c.className) ?? "", r.style.cssText = `width:${o.width}px;table-layout:fixed;border-collapse:collapse;`;
520
- const f = document.createElement("thead"), C = document.createElement("tr");
521
- C.className = l["tedi-table__row"];
522
- const v = t.cloneNode(!0);
523
- v.classList.add(l["tedi-table__header-cell--drag-preview"]), v.style.width = `${o.width}px`, C.appendChild(v), f.appendChild(C), r.appendChild(f), a.appendChild(r), document.body.appendChild(a), n.dataTransfer.setDragImage(a, o.width / 2, o.height / 2), window.setTimeout(() => a.remove(), 0), Q.current = e, Ae(e);
519
+ const f = document.createElement("thead"), v = document.createElement("tr");
520
+ v.className = l["tedi-table__row"];
521
+ const C = t.cloneNode(!0);
522
+ C.classList.add(l["tedi-table__header-cell--drag-preview"]), C.style.width = `${o.width}px`, v.appendChild(C), f.appendChild(v), r.appendChild(f), a.appendChild(r), document.body.appendChild(a), n.dataTransfer.setDragImage(a, o.width / 2, o.height / 2), window.setTimeout(() => a.remove(), 0), Z.current = e, Ae(e);
524
523
  },
525
524
  onDragOver: (n) => {
526
- !Q.current || Q.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", _e(e));
525
+ !Z.current || Z.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", _e(e));
527
526
  },
528
527
  onDragLeave: () => {
529
528
  _e((n) => n === e ? null : n);
530
529
  },
531
530
  onDragEnd: () => {
532
- Q.current = null, Z.current = null, Ae(null), _e(null);
531
+ Z.current = null, ee.current = null, Ae(null), _e(null);
533
532
  },
534
533
  onDrop: (n) => {
535
534
  n.preventDefault();
536
- const t = Q.current, o = e;
537
- if (Q.current = null, Z.current = null, Ae(null), _e(null), !t || t === o) return;
538
- const a = s.getState().columnOrder, r = a.length > 0 ? a : s.getAllLeafColumns().map((C) => C.id), c = r.indexOf(t), f = r.indexOf(o);
535
+ const t = Z.current, o = e;
536
+ if (Z.current = null, ee.current = null, Ae(null), _e(null), !t || t === o) return;
537
+ const a = s.getState().columnOrder, r = a.length > 0 ? a : s.getAllLeafColumns().map((v) => v.id), c = r.indexOf(t), f = r.indexOf(o);
539
538
  c < 0 || f < 0 || s.setColumnOrder(ut(r, c, f));
540
539
  }
541
540
  }),
@@ -549,25 +548,25 @@ function _t(R) {
549
548
  const a = o + e;
550
549
  if (a < 0 || a >= t.length) return;
551
550
  const r = ut(t, o, a), c = s.getState().columnOrder.length > 0 ? [...s.getState().columnOrder] : s.getAllLeafColumns().map((d) => d.id), f = new Set(t);
552
- let C = 0;
553
- const v = c.map((d) => f.has(d) ? r[C++] : d);
554
- for (const d of r) v.includes(d) || v.push(d);
555
- s.setColumnOrder(v), B(b("table.reorder.move", Ue(n), a + 1)), ve.current = { kind: "column", id: n }, ct((d) => d + 1);
551
+ let v = 0;
552
+ const C = c.map((d) => f.has(d) ? r[v++] : d);
553
+ for (const d of r) C.includes(d) || C.push(d);
554
+ s.setColumnOrder(C), B(b("table.reorder.move", Ue(n), a + 1)), Ce.current = { kind: "column", id: n }, ct((d) => d + 1);
556
555
  }, cn = (e, n) => {
557
- if (!X) return;
556
+ if (!Y) return;
558
557
  const t = dt;
559
558
  switch (e.key) {
560
559
  case " ":
561
560
  case "Enter":
562
561
  if (e.preventDefault(), t === null)
563
- Ce.current = [...s.getState().columnOrder ?? []], Fe(n), B(b("table.reorder.pickup", Ue(n)));
562
+ ve.current = [...s.getState().columnOrder ?? []], Fe(n), B(b("table.reorder.pickup", Ue(n)));
564
563
  else {
565
564
  const o = gt().indexOf(t) + 1;
566
- Fe(null), Ce.current = [], B(b("table.reorder.drop", Ue(t), o));
565
+ Fe(null), ve.current = [], B(b("table.reorder.drop", Ue(t), o));
567
566
  }
568
567
  break;
569
568
  case "Escape":
570
- t !== null && (e.preventDefault(), s.setColumnOrder(Ce.current), Fe(null), Ce.current = [], B(b("table.reorder.cancel")));
569
+ t !== null && (e.preventDefault(), s.setColumnOrder(ve.current), Fe(null), ve.current = [], B(b("table.reorder.cancel")));
571
570
  break;
572
571
  case "ArrowLeft":
573
572
  t !== null && (e.preventDefault(), pt(-1, t));
@@ -587,7 +586,7 @@ function _t(R) {
587
586
  toId: r.id,
588
587
  fromIndex: a.index,
589
588
  toIndex: r.index
590
- }), B(b("table.row-reorder.move", o + 1)), ve.current = { kind: "row", original: n }, ct((c) => c + 1);
589
+ }), B(b("table.row-reorder.move", o + 1)), Ce.current = { kind: "row", original: n }, ct((c) => c + 1);
591
590
  }, un = (e, n) => {
592
591
  if (!S) return;
593
592
  const t = st;
@@ -595,26 +594,26 @@ function _t(R) {
595
594
  case " ":
596
595
  case "Enter":
597
596
  if (e.preventDefault(), t === null)
598
- ze(n.original), ae.current = n.index, B(b("table.row-reorder.pickup", _.indexOf(n) + 1));
597
+ ze(n.original), ie.current = n.index, B(b("table.row-reorder.pickup", _.indexOf(n) + 1));
599
598
  else {
600
599
  const o = _.findIndex((a) => a.original === t) + 1;
601
- ze(null), ae.current = -1, B(b("table.row-reorder.drop", o));
600
+ ze(null), ie.current = -1, B(b("table.row-reorder.drop", o));
602
601
  }
603
602
  break;
604
603
  case "Escape":
605
604
  if (t !== null) {
606
605
  e.preventDefault();
607
606
  const o = _.findIndex((a) => a.original === t);
608
- if (o >= 0 && ae.current >= 0) {
607
+ if (o >= 0 && ie.current >= 0) {
609
608
  const a = _[o];
610
609
  L == null || L({
611
610
  fromId: a.id,
612
611
  toId: a.id,
613
612
  fromIndex: a.index,
614
- toIndex: ae.current
613
+ toIndex: ie.current
615
614
  });
616
615
  }
617
- ze(null), ae.current = -1, B(b("table.row-reorder.cancel"));
616
+ ze(null), ie.current = -1, B(b("table.row-reorder.cancel"));
618
617
  }
619
618
  break;
620
619
  case "ArrowUp":
@@ -627,9 +626,9 @@ function _t(R) {
627
626
  };
628
627
  return ft(() => {
629
628
  var t;
630
- const e = ve.current;
629
+ const e = Ce.current;
631
630
  if (!e) return;
632
- ve.current = null;
631
+ Ce.current = null;
633
632
  let n;
634
633
  if (e.kind === "column")
635
634
  n = `${p}-col-reorder-${e.id}`;
@@ -638,15 +637,15 @@ function _t(R) {
638
637
  n = o ? `${p}-row-reorder-${o.id}` : null;
639
638
  }
640
639
  n && ((t = document.getElementById(n)) == null || t.focus());
641
- }, [ln, _, p]), /* @__PURE__ */ i(vn.Provider, { value: Mt, children: /* @__PURE__ */ re("div", { className: qt, "data-name": "tedi-table", children: [
640
+ }, [ln, _, p]), /* @__PURE__ */ i(Cn.Provider, { value: Mt, children: /* @__PURE__ */ de("div", { className: qt, "data-name": "tedi-table", children: [
642
641
  ye,
643
- (S || X) && /* @__PURE__ */ i("div", { className: l["tedi-table__sr-only"], "aria-live": "polite", "aria-atomic": "true", children: on }),
642
+ (S || Y) && /* @__PURE__ */ i("div", { className: l["tedi-table__sr-only"], "aria-live": "polite", "aria-atomic": "true", children: on }),
644
643
  /* @__PURE__ */ i(
645
644
  "div",
646
645
  {
647
646
  className: l["tedi-table__scroll"],
648
- style: oe !== void 0 ? { maxHeight: oe, overflowY: "auto" } : void 0,
649
- children: /* @__PURE__ */ re(
647
+ style: le !== void 0 ? { maxHeight: le, overflowY: "auto" } : void 0,
648
+ children: /* @__PURE__ */ de(
650
649
  "table",
651
650
  {
652
651
  id: E,
@@ -655,7 +654,7 @@ function _t(R) {
655
654
  "aria-colcount": he > 0 ? he : void 0,
656
655
  children: [
657
656
  T && /* @__PURE__ */ i("caption", { className: l["tedi-table__caption"], children: T }),
658
- /* @__PURE__ */ re("thead", { className: l["tedi-table__head"], children: [
657
+ /* @__PURE__ */ de("thead", { className: l["tedi-table__head"], children: [
659
658
  be.map((e, n) => /* @__PURE__ */ i(
660
659
  "tr",
661
660
  {
@@ -665,13 +664,13 @@ function _t(R) {
665
664
  const o = t.subHeaders.length > 0, a = !!t.column.parent, r = Pn(t.column.columnDef), c = !r && !a;
666
665
  if (t.isPlaceholder && !c || !t.isPlaceholder && c && n > 0)
667
666
  return null;
668
- const f = c ? be.length - n : 1, C = t.column.getIsSorted(), v = t.column.getCanSort() ? C === "asc" ? "ascending" : C === "desc" ? "descending" : "none" : void 0, d = t.column.columnDef.meta, ee = (d == null ? void 0 : d.label) ?? (typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : void 0), I = j == null ? void 0 : j(t.column.id), U = t.column.getSize(), ie = t.column.id === Se || t.column.id === Ve || t.column.id === Ge, te = X && c && !ie, m = te ? rn(t.column.id) : void 0, gn = te && it === t.column.id, pn = te && rt === t.column.id && it !== t.column.id, He = te && dt === t.column.id;
667
+ const f = c ? be.length - n : 1, v = t.column.getIsSorted(), C = t.column.getCanSort() ? v === "asc" ? "ascending" : v === "desc" ? "descending" : "none" : void 0, d = t.column.columnDef.meta, te = (d == null ? void 0 : d.label) ?? (typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : void 0), I = j == null ? void 0 : j(t.column.id), U = t.column.getSize(), re = t.column.id === Se || t.column.id === Ve || t.column.id === Ge, ne = Y && c && !re, m = ne ? rn(t.column.id) : void 0, gn = ne && it === t.column.id, pn = ne && rt === t.column.id && it !== t.column.id, He = ne && dt === t.column.id;
669
668
  return /* @__PURE__ */ i(
670
669
  "th",
671
670
  {
672
671
  colSpan: t.colSpan,
673
672
  rowSpan: f > 1 ? f : void 0,
674
- draggable: te || void 0,
673
+ draggable: ne || void 0,
675
674
  onDragStart: m == null ? void 0 : m.onDragStart,
676
675
  onDragOver: m == null ? void 0 : m.onDragOver,
677
676
  onDragLeave: m == null ? void 0 : m.onDragLeave,
@@ -690,10 +689,10 @@ function _t(R) {
690
689
  I == null ? void 0 : I.className
691
690
  ),
692
691
  scope: "col",
693
- "aria-sort": v,
694
- "aria-label": ee ?? (r ? void 0 : t.column.id),
692
+ "aria-sort": C,
693
+ "aria-label": te ?? (r ? void 0 : t.column.id),
695
694
  style: U || I != null && I.style ? { ...U ? { width: U } : null, ...I == null ? void 0 : I.style } : void 0,
696
- children: te && m ? /* @__PURE__ */ re("span", { className: l["tedi-table__header-cell-inner"], children: [
695
+ children: ne && m ? /* @__PURE__ */ de("span", { className: l["tedi-table__header-cell-inner"], children: [
697
696
  /* @__PURE__ */ i(
698
697
  "button",
699
698
  {
@@ -702,7 +701,7 @@ function _t(R) {
702
701
  className: k(l["tedi-table__drag-handle"], {
703
702
  [l["tedi-table__drag-handle--picked-up"]]: He
704
703
  }),
705
- "aria-label": b("table.drag-column", ee ?? t.column.id),
704
+ "aria-label": b("table.drag-column", te ?? t.column.id),
706
705
  "aria-pressed": He,
707
706
  onClick: (Ke) => Ke.stopPropagation(),
708
707
  onMouseDown: m.onHandlePointerDown,
@@ -760,23 +759,23 @@ function _t(R) {
760
759
  {
761
760
  colSpan: Math.max(1, he),
762
761
  className: k(l["tedi-table__cell"], l["tedi-table__cell--placeholder"]),
763
- children: ce ? /* @__PURE__ */ i("div", { role: ce, children: Je }) : Je
762
+ children: ue ? /* @__PURE__ */ i("div", { role: ue, children: Je }) : Je
764
763
  }
765
764
  ) }) : _.map((e, n) => {
766
765
  const t = tt(e), o = G !== void 0 && e.id === G, a = Le == null ? void 0 : Le(e), r = k(
767
766
  l["tedi-table__row"],
768
767
  {
769
- [l["tedi-table__row--selected"]]: Ct && e.getIsSelected(),
768
+ [l["tedi-table__row--selected"]]: vt && e.getIsSelected(),
770
769
  [l["tedi-table__row--active"]]: o,
771
770
  [l["tedi-table__row--clickable"]]: t,
772
771
  [l["tedi-table__row--sub-row"]]: e.depth > 0
773
772
  },
774
773
  a == null ? void 0 : a.className
775
- ), c = y ? ot + Zt + n + 1 : void 0, f = `${p}-sub-${e.id}`, C = S && at === e.id, v = S && nn === e.id && at !== e.id, d = S && st === e.original, ee = {
774
+ ), c = y ? ot + Zt + n + 1 : void 0, f = `${p}-sub-${e.id}`, v = S && at === e.id, C = S && nn === e.id && at !== e.id, d = S && st === e.original, te = {
776
775
  row: e,
777
776
  rowClassName: k(r, {
778
- [l["tedi-table__row--dragging"]]: C,
779
- [l["tedi-table__row--drag-over"]]: v,
777
+ [l["tedi-table__row--dragging"]]: v,
778
+ [l["tedi-table__row--drag-over"]]: C,
780
779
  [l["tedi-table__row--picked-up"]]: d
781
780
  }),
782
781
  rowStyle: a == null ? void 0 : a.style,
@@ -791,11 +790,11 @@ function _t(R) {
791
790
  dragHandlers: S ? { ...an(e.id), onKeyDown: (I) => un(I, e) } : void 0,
792
791
  dragHandleId: S ? sn(e.id) : void 0,
793
792
  dragHandlePickedUp: d,
794
- dragOverColumnId: X ? rt : null
793
+ dragOverColumnId: Y ? rt : null
795
794
  };
796
- return /* @__PURE__ */ re(bn, { children: [
797
- /* @__PURE__ */ i($n, { ...ee }),
798
- pe && e.getIsExpanded() && /* @__PURE__ */ i("tr", { className: k(l["tedi-table__row"], l["tedi-table__row--sub-component"]), children: /* @__PURE__ */ i(
795
+ return /* @__PURE__ */ de(bn, { children: [
796
+ /* @__PURE__ */ i($n, { ...te }),
797
+ W && e.getIsExpanded() && /* @__PURE__ */ i("tr", { className: k(l["tedi-table__row"], l["tedi-table__row--sub-component"]), children: /* @__PURE__ */ i(
799
798
  "td",
800
799
  {
801
800
  id: f,
@@ -803,7 +802,7 @@ function _t(R) {
803
802
  "aria-label": b("table.row-details"),
804
803
  colSpan: Math.max(1, he),
805
804
  className: k(l["tedi-table__cell"], l["tedi-table__cell--sub-component"]),
806
- children: pe(e)
805
+ children: W(e)
807
806
  }
808
807
  ) })
809
808
  ] }, e.id);
@@ -846,7 +845,7 @@ function _t(R) {
846
845
  _t.displayName = "Table";
847
846
  const to = Object.assign(_t, {
848
847
  Toolbar: Sn,
849
- ColumnsMenu: Cn,
848
+ ColumnsMenu: vn,
850
849
  HeaderButton: xn
851
850
  });
852
851
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("../../../../../../external/classnames/index.cjs.js"),d=require("react"),g=require("../../../base/icon/icon.cjs.js"),q=require("../../../base/typography/heading/heading.cjs.js"),b=require("../../../buttons/collapse/collapse.cjs.js"),t=require("../footer.module.scss.cjs.js"),N=require("../footer-context.cjs.js"),i=require("../../../../helpers/hooks/use-breakpoint.cjs.js"),u=({heading:o,icon:s,collapsible:f=!1,defaultOpen:p=!1,iconBreakpoint:m="lg",children:n,className:x})=>{const r=i.default(),{mobileBreakpoint:_}=d.useContext(N.FooterContext),l=i.isBreakpointBelow(r,_),j=i.isBreakpointBelow(r,m),c=f&&l,h=d.useId();return e.jsxs("div",{"data-name":"footer-section",className:a.default(t.default["tedi-footer-section"],{[t.default["tedi-footer-section--collapsible"]]:c},x),children:[s&&!j&&e.jsx("span",{className:t.default["tedi-footer-section__icon"],children:e.jsx(g.Icon,{name:s,color:"white",size:24})}),e.jsx("div",{className:a.default(t.default["tedi-footer-section__container"],{[t.default["tedi-footer-section__container--mobile"]]:l}),children:c?e.jsx(b.Collapse,{id:`tedi-footer-section-${h}`,title:e.jsx(q.Heading,{element:"h6",color:"white",children:o}),size:"small",inverted:!0,hideCollapseText:!0,defaultOpen:p,toggleLabel:typeof o=="string"?o:void 0,className:t.default["tedi-footer-section__collapse"],titleRowProps:{gutter:0},children:e.jsx("div",{className:t.default["tedi-footer-section__content-inner"],children:n})}):e.jsxs(e.Fragment,{children:[e.jsx("strong",{className:t.default["tedi-footer-section__heading"],children:o}),e.jsx("div",{className:t.default["tedi-footer-section__content"],children:n})]})})]})};u.displayName="Footer.Section";exports.FooterSection=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("../../../../../../external/classnames/index.cjs.js"),d=require("react"),h=require("../../../base/icon/icon.cjs.js"),q=require("../../../base/typography/heading/heading.cjs.js"),b=require("../../../content/collapse/collapse.cjs.js"),t=require("../footer.module.scss.cjs.js"),N=require("../footer-context.cjs.js"),i=require("../../../../helpers/hooks/use-breakpoint.cjs.js"),u=({heading:o,icon:s,collapsible:f=!1,defaultOpen:p=!1,iconBreakpoint:m="lg",children:n,className:x})=>{const l=i.default(),{mobileBreakpoint:_}=d.useContext(N.FooterContext),r=i.isBreakpointBelow(l,_),g=i.isBreakpointBelow(l,m),c=f&&r,j=d.useId();return e.jsxs("div",{"data-name":"footer-section",className:a.default(t.default["tedi-footer-section"],{[t.default["tedi-footer-section--collapsible"]]:c},x),children:[s&&!g&&e.jsx("span",{className:t.default["tedi-footer-section__icon"],children:e.jsx(h.Icon,{name:s,color:"white",size:24})}),e.jsx("div",{className:a.default(t.default["tedi-footer-section__container"],{[t.default["tedi-footer-section__container--mobile"]]:r}),children:c?e.jsx(b.Collapse,{id:`tedi-footer-section-${j}`,title:e.jsx(q.Heading,{element:"h6",color:"white",children:o}),size:"small",inverted:!0,hideCollapseText:!0,fullRowToggle:!0,defaultOpen:p,toggleLabel:typeof o=="string"?o:void 0,className:t.default["tedi-footer-section__collapse"],titleRowProps:{gutter:0},children:e.jsx("div",{className:t.default["tedi-footer-section__content-inner"],children:n})}):e.jsxs(e.Fragment,{children:[e.jsx("strong",{className:t.default["tedi-footer-section__heading"],children:o}),e.jsx("div",{className:t.default["tedi-footer-section__content"],children:n})]})})]})};u.displayName="Footer.Section";exports.FooterSection=u;