@tedi-design-system/react 18.1.0-rc.2 → 18.1.0-rc.20

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 (155) hide show
  1. package/_virtual/index.es13.js +2 -2
  2. package/_virtual/index.es14.js +2 -2
  3. package/bundle-stats.html +1 -1
  4. package/community.cjs.js +1 -1
  5. package/community.es.js +156 -152
  6. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
  7. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
  8. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  9. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
  10. package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
  11. package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
  12. package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
  13. package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
  14. package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  15. package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
  16. package/external/prop-types/external/react-is/index.cjs.js +1 -1
  17. package/external/prop-types/external/react-is/index.es.js +1 -1
  18. package/external/react-is/index.cjs.js +1 -1
  19. package/external/react-is/index.es.js +1 -1
  20. package/external/toposort/index.cjs.js +1 -1
  21. package/external/toposort/index.es.js +1 -1
  22. package/index.css +1 -1
  23. package/package.json +1 -1
  24. package/src/community/components/anchor/anchor.d.ts +1 -0
  25. package/src/community/components/button/button.d.ts +1 -0
  26. package/src/community/components/card/card-content/card-content.d.ts +3 -0
  27. package/src/community/components/card/card-header/card-header.d.ts +3 -0
  28. package/src/community/components/card/card-notification/card-notification.d.ts +3 -0
  29. package/src/community/components/card/card.d.ts +3 -0
  30. package/src/community/components/dropdown/dropdown.cjs.js +1 -1
  31. package/src/community/components/dropdown/dropdown.d.ts +3 -0
  32. package/src/community/components/dropdown/dropdown.es.js +5 -6
  33. package/src/community/components/form/choice-group/choice-group.d.ts +3 -0
  34. package/src/community/components/form/file-upload/file-upload.d.ts +6 -0
  35. package/src/community/components/form/radio/radio.d.ts +3 -0
  36. package/src/community/components/form/select/select.d.ts +3 -0
  37. package/src/community/components/form/toggle/toggle.cjs.js +1 -1
  38. package/src/community/components/form/toggle/toggle.d.ts +3 -0
  39. package/src/community/components/form/toggle/toggle.es.js +5 -6
  40. package/src/community/components/layout/header/components/header-language/header-language.d.ts +3 -0
  41. package/src/community/components/layout/header/components/header-role/header-role.d.ts +3 -0
  42. package/src/community/components/layout/header/components/sidenav-toggle/sidenav-toggle.d.ts +3 -0
  43. package/src/community/components/layout/header/header/header.d.ts +3 -0
  44. package/src/community/components/layout/sidenav/sidenav.d.ts +3 -0
  45. package/src/community/components/map-components/base-map-selection/base-map-option.cjs.js +1 -0
  46. package/src/community/components/map-components/base-map-selection/base-map-option.d.ts +64 -0
  47. package/src/community/components/map-components/base-map-selection/base-map-option.es.js +75 -0
  48. package/src/community/components/map-components/base-map-selection/base-map-selection.cjs.js +1 -1
  49. package/src/community/components/map-components/base-map-selection/base-map-selection.d.ts +37 -22
  50. package/src/community/components/map-components/base-map-selection/base-map-selection.es.js +76 -17
  51. package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.cjs.js +1 -1
  52. package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.es.js +5 -1
  53. package/src/community/components/map-components/button-group/button-group.module.scss.cjs.js +1 -1
  54. package/src/community/components/map-components/button-group/button-group.module.scss.es.js +1 -0
  55. package/src/community/components/map-components/left-panel/left-panel-content.cjs.js +1 -1
  56. package/src/community/components/map-components/left-panel/left-panel-content.d.ts +10 -5
  57. package/src/community/components/map-components/left-panel/left-panel-content.es.js +7 -21
  58. package/src/community/components/map-components/left-panel/left-panel-footer.cjs.js +1 -1
  59. package/src/community/components/map-components/left-panel/left-panel-footer.d.ts +11 -1
  60. package/src/community/components/map-components/left-panel/left-panel-footer.es.js +7 -24
  61. package/src/community/components/map-components/left-panel/left-panel-header.cjs.js +1 -1
  62. package/src/community/components/map-components/left-panel/left-panel-header.d.ts +11 -1
  63. package/src/community/components/map-components/left-panel/left-panel-header.es.js +7 -62
  64. package/src/community/components/map-components/left-panel/left-panel.cjs.js +1 -1
  65. package/src/community/components/map-components/left-panel/left-panel.d.ts +67 -5
  66. package/src/community/components/map-components/left-panel/left-panel.es.js +85 -14
  67. package/src/community/components/map-components/left-panel/left-panel.module.scss.cjs.js +1 -1
  68. package/src/community/components/map-components/left-panel/left-panel.module.scss.es.js +4 -4
  69. package/src/community/components/map-components/map-button/map-button.cjs.js +1 -1
  70. package/src/community/components/map-components/map-button/map-button.d.ts +8 -3
  71. package/src/community/components/map-components/map-button/map-button.es.js +42 -33
  72. package/src/community/components/map-components/map-button/map-button.module.scss.cjs.js +1 -1
  73. package/src/community/components/map-components/map-button/map-button.module.scss.es.js +3 -0
  74. package/src/community/components/map-components/resizer/resizer.cjs.js +1 -1
  75. package/src/community/components/map-components/resizer/resizer.es.js +9 -10
  76. package/src/community/components/map-components/split-pane/split-pane.cjs.js +1 -0
  77. package/src/community/components/map-components/split-pane/split-pane.d.ts +37 -0
  78. package/src/community/components/map-components/split-pane/split-pane.es.js +128 -0
  79. package/src/community/components/map-components/split-pane/split-pane.module.scss.cjs.js +1 -0
  80. package/src/community/components/map-components/split-pane/split-pane.module.scss.es.js +17 -0
  81. package/src/community/components/status/status.d.ts +3 -0
  82. package/src/community/components/table/table.d.ts +3 -0
  83. package/src/community/components/tag/tag.d.ts +3 -0
  84. package/src/community/components/toggle-open/toggle-open.d.ts +3 -0
  85. package/src/community/components/tooltip/tooltip-trigger.d.ts +3 -0
  86. package/src/community/components/tooltip/tooltip.d.ts +3 -0
  87. package/src/community/index.d.ts +1 -0
  88. package/src/tedi/components/buttons/collapse-button/collapse-button.cjs.js +1 -1
  89. package/src/tedi/components/buttons/collapse-button/collapse-button.es.js +2 -1
  90. package/src/tedi/components/content/table/table.cjs.js +1 -1
  91. package/src/tedi/components/content/table/table.d.ts +8 -5
  92. package/src/tedi/components/content/table/table.es.js +308 -295
  93. package/src/tedi/components/form/file-dropzone/file-dropzone.cjs.js +1 -1
  94. package/src/tedi/components/form/file-dropzone/file-dropzone.es.js +90 -79
  95. package/src/tedi/components/form/file-upload/file-upload.cjs.js +1 -1
  96. package/src/tedi/components/form/file-upload/file-upload.d.ts +4 -1
  97. package/src/tedi/components/form/file-upload/file-upload.es.js +138 -119
  98. package/src/tedi/components/form/file-upload/file-upload.module.scss.cjs.js +1 -1
  99. package/src/tedi/components/form/file-upload/file-upload.module.scss.es.js +1 -1
  100. package/src/tedi/components/form/search/search.cjs.js +1 -1
  101. package/src/tedi/components/form/search/search.es.js +60 -40
  102. package/src/tedi/components/form/search/search.module.scss.cjs.js +1 -1
  103. package/src/tedi/components/form/search/search.module.scss.es.js +7 -3
  104. package/src/tedi/components/layout/header/components/header-language/header-language.cjs.js +1 -0
  105. package/src/tedi/components/layout/header/components/header-language/header-language.es.js +105 -0
  106. package/src/tedi/components/layout/header/components/header-language/header-language.module.scss.cjs.js +1 -0
  107. package/src/tedi/components/layout/header/components/header-language/header-language.module.scss.es.js +12 -0
  108. package/src/tedi/components/layout/header/components/header-login/header-login.cjs.js +1 -0
  109. package/src/tedi/components/layout/header/components/header-login/header-login.es.js +36 -0
  110. package/src/tedi/components/layout/header/components/header-login/header-login.module.scss.cjs.js +1 -0
  111. package/src/tedi/components/layout/header/components/header-login/header-login.module.scss.es.js +8 -0
  112. package/src/tedi/components/layout/header/components/header-logout/header-logout.cjs.js +1 -0
  113. package/src/tedi/components/layout/header/components/header-logout/header-logout.es.js +33 -0
  114. package/src/tedi/components/layout/header/components/header-logout/header-logout.module.scss.cjs.js +1 -0
  115. package/src/tedi/components/layout/header/components/header-logout/header-logout.module.scss.es.js +7 -0
  116. package/src/tedi/components/layout/header/components/header-mobile-button/header-mobile-button.cjs.js +1 -0
  117. package/src/tedi/components/layout/header/components/header-mobile-button/header-mobile-button.es.js +25 -0
  118. package/src/tedi/components/layout/header/components/header-mobile-button/header-mobile-button.module.scss.cjs.js +1 -0
  119. package/src/tedi/components/layout/header/components/header-mobile-button/header-mobile-button.module.scss.es.js +10 -0
  120. package/src/tedi/components/layout/header/components/header-profile/header-profile.cjs.js +1 -0
  121. package/src/tedi/components/layout/header/components/header-profile/header-profile.es.js +136 -0
  122. package/src/tedi/components/layout/header/components/header-profile/header-profile.module.scss.cjs.js +1 -0
  123. package/src/tedi/components/layout/header/components/header-profile/header-profile.module.scss.es.js +14 -0
  124. package/src/tedi/components/layout/header/components/header-role/header-role-representatives.cjs.js +1 -0
  125. package/src/tedi/components/layout/header/components/header-role/header-role-representatives.es.js +89 -0
  126. package/src/tedi/components/layout/header/components/header-role/header-role.cjs.js +1 -0
  127. package/src/tedi/components/layout/header/components/header-role/header-role.es.js +162 -0
  128. package/src/tedi/components/layout/header/components/header-role/header-role.module.scss.cjs.js +1 -0
  129. package/src/tedi/components/layout/header/components/header-role/header-role.module.scss.es.js +25 -0
  130. package/src/tedi/components/layout/header/components/header-search/header-search.cjs.js +1 -0
  131. package/src/tedi/components/layout/header/components/header-search/header-search.es.js +60 -0
  132. package/src/tedi/components/layout/header/components/header-search/header-search.module.scss.cjs.js +1 -0
  133. package/src/tedi/components/layout/header/components/header-search/header-search.module.scss.es.js +9 -0
  134. package/src/tedi/components/layout/header/header.cjs.js +1 -0
  135. package/src/tedi/components/layout/header/header.es.js +63 -0
  136. package/src/tedi/components/layout/header/header.module.scss.cjs.js +1 -0
  137. package/src/tedi/components/layout/header/header.module.scss.es.js +13 -0
  138. package/src/tedi/components/layout/hide-at/hide-at.cjs.js +1 -0
  139. package/src/tedi/components/layout/hide-at/hide-at.es.js +10 -0
  140. package/src/tedi/components/layout/show-at/show-at.cjs.js +1 -0
  141. package/src/tedi/components/layout/show-at/show-at.es.js +10 -0
  142. package/src/tedi/components/tags/tag/tag.cjs.js +1 -1
  143. package/src/tedi/components/tags/tag/tag.d.ts +9 -0
  144. package/src/tedi/components/tags/tag/tag.es.js +18 -17
  145. package/src/tedi/helpers/hooks/use-file-upload.cjs.js +1 -1
  146. package/src/tedi/helpers/hooks/use-file-upload.es.js +71 -66
  147. package/src/tedi/index.d.ts +3 -0
  148. package/src/tedi/providers/label-provider/label-provider.cjs.js +1 -1
  149. package/src/tedi/providers/label-provider/label-provider.d.ts +2 -2
  150. package/src/tedi/providers/label-provider/label-provider.es.js +2 -2
  151. package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
  152. package/src/tedi/providers/label-provider/labels-map.d.ts +49 -0
  153. package/src/tedi/providers/label-provider/labels-map.es.js +114 -65
  154. package/tedi.cjs.js +1 -1
  155. package/tedi.es.js +303 -281
@@ -1,33 +1,33 @@
1
- import { jsx as i, jsxs as de } from "react/jsx-runtime";
2
- import { useReactTable as mn, flexRender as xe } from "../../../../../external/@tanstack/react-table/build/lib/index.es.js";
1
+ import { jsx as i, jsxs as se } from "react/jsx-runtime";
2
+ import { useReactTable as bn, flexRender as Se } from "../../../../../external/@tanstack/react-table/build/lib/index.es.js";
3
3
  import k from "../../../../../external/classnames/index.es.js";
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
- import { Icon as ht } from "../../base/icon/icon.es.js";
6
- import { CollapseButton as hn } from "../../buttons/collapse-button/collapse-button.es.js";
7
- import { Checkbox as bt } from "../../form/checkbox/checkbox.es.js";
8
- import { Radio as wn } from "../../form/radio/radio.es.js";
9
- import { TextField as _n } from "../../form/textfield/textfield.es.js";
4
+ import { useRef as A, useId as hn, useMemo as w, useCallback as N, useState as K, useEffect as ht, Fragment as wn } from "react";
5
+ import { Icon as _t } from "../../base/icon/icon.es.js";
6
+ import { CollapseButton as _n } from "../../buttons/collapse-button/collapse-button.es.js";
7
+ import { Checkbox as wt } from "../../form/checkbox/checkbox.es.js";
8
+ import { Radio as vn } from "../../form/radio/radio.es.js";
9
+ import { TextField as Cn } from "../../form/textfield/textfield.es.js";
10
10
  import l from "./table.module.scss.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
- import { TableHeaderButton as xn } from "./table-header-button/table-header-button.es.js";
14
- import { TableToolbar as Sn } from "./table-toolbar/table-toolbar.es.js";
15
- import { useTablePersistence as Dn } from "./use-table-persistence.es.js";
16
- import { useLabels as Rn } from "../../../providers/label-provider/use-labels.es.js";
17
- import { getCoreRowModel as yn, getFilteredRowModel as In, getSortedRowModel as kn, getExpandedRowModel as En, getPaginationRowModel as Tn } from "../../../../../external/@tanstack/table-core/build/lib/index.es.js";
18
- import { Pagination as Nn } from "../../navigation/pagination/pagination.es.js";
19
- const eo = (R, E) => (V) => {
11
+ import { TableColumnsMenu as xn } from "./table-columns-menu/table-columns-menu.es.js";
12
+ import { TableContext as Sn } from "./table-context.es.js";
13
+ import { TableHeaderButton as Dn } from "./table-header-button/table-header-button.es.js";
14
+ import { TableToolbar as Rn } from "./table-toolbar/table-toolbar.es.js";
15
+ import { useTablePersistence as yn } from "./use-table-persistence.es.js";
16
+ import { useLabels as In } from "../../../providers/label-provider/use-labels.es.js";
17
+ import { getCoreRowModel as kn, getFilteredRowModel as Tn, getSortedRowModel as En, getExpandedRowModel as Nn, getPaginationRowModel as On } from "../../../../../external/@tanstack/table-core/build/lib/index.es.js";
18
+ import { Pagination as $n } from "../../navigation/pagination/pagination.es.js";
19
+ const no = (R, T) => (V) => {
20
20
  const x = V.index;
21
21
  if (x < 0 || x >= R.length) return 1;
22
- const O = E(R[x]);
23
- if (x > 0 && E(R[x - 1]) === O) return 0;
24
- let T = 1;
25
- for (let A = x + 1; A < R.length && E(R[A]) === O; A++)
26
- T++;
27
- return T;
28
- }, wt = "data-tedi-drag-handle", On = ({
22
+ const O = T(R[x]);
23
+ if (x > 0 && T(R[x - 1]) === O) return 0;
24
+ let E = 1;
25
+ for (let F = x + 1; F < R.length && T(R[F]) === O; F++)
26
+ E++;
27
+ return E;
28
+ }, vt = "data-tedi-drag-handle", Ln = ({
29
29
  label: R,
30
- onHandlePointerDown: E,
30
+ onHandlePointerDown: T,
31
31
  id: V,
32
32
  pickedUp: x,
33
33
  onKeyDown: O
@@ -41,29 +41,29 @@ const eo = (R, E) => (V) => {
41
41
  }),
42
42
  "aria-label": R,
43
43
  "aria-pressed": x,
44
- onClick: (T) => T.stopPropagation(),
45
- onMouseDown: E,
46
- onTouchStart: E,
44
+ onClick: (E) => E.stopPropagation(),
45
+ onMouseDown: T,
46
+ onTouchStart: T,
47
47
  onKeyDown: O,
48
- [wt]: "",
49
- children: /* @__PURE__ */ i(ht, { name: "drag_indicator", size: 18, color: "inherit" })
48
+ [vt]: "",
49
+ children: /* @__PURE__ */ i(_t, { name: "drag_indicator", size: 18, color: "inherit" })
50
50
  }
51
- ), $n = (R) => {
51
+ ), Pn = (R) => {
52
52
  const {
53
- row: E,
53
+ row: T,
54
54
  rowClassName: V,
55
55
  rowStyle: x,
56
56
  isActiveRow: O,
57
- clickable: T,
58
- onClick: A,
59
- onKeyDownHandler: De,
60
- ariaRowIndex: Re,
57
+ clickable: E,
58
+ onClick: F,
59
+ onKeyDownHandler: Re,
60
+ ariaRowIndex: ye,
61
61
  columnProps: oe,
62
62
  draggable: ce,
63
63
  dragHandleLabel: ue,
64
64
  dragHandlers: u,
65
- dragHandleId: ye,
66
- dragHandlePickedUp: Ie,
65
+ dragHandleId: Ie,
66
+ dragHandlePickedUp: ke,
67
67
  dragOverColumnId: ge
68
68
  } = R;
69
69
  return /* @__PURE__ */ i(
@@ -77,15 +77,15 @@ const eo = (R, E) => (V) => {
77
77
  onDragLeave: u == null ? void 0 : u.onDragLeave,
78
78
  onDragEnd: u == null ? void 0 : u.onDragEnd,
79
79
  onDrop: u == null ? void 0 : u.onDrop,
80
- onClick: T && A ? () => A(E) : void 0,
81
- onKeyDown: T ? De : void 0,
82
- tabIndex: T ? 0 : void 0,
83
- role: T ? "button" : void 0,
84
- "aria-rowindex": Re,
80
+ onClick: E && F ? () => F(T) : void 0,
81
+ onKeyDown: E ? Re : void 0,
82
+ tabIndex: E ? 0 : void 0,
83
+ role: E ? "button" : void 0,
84
+ "aria-rowindex": ye,
85
85
  "aria-current": O ? "true" : void 0,
86
- children: E.getVisibleCells().map(($) => {
86
+ children: T.getVisibleCells().map(($) => {
87
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);
88
+ const g = $.column.columnDef.meta, z = oe == null ? void 0 : oe($.column.id), le = ce && $.column.id === De, B = !!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
  {
@@ -96,102 +96,102 @@ const eo = (R, E) => (V) => {
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
98
  [l["tedi-table__cell--drag-handle"]]: le,
99
- [l["tedi-table__cell--drag-over"]]: z
99
+ [l["tedi-table__cell--drag-over"]]: B
100
100
  },
101
- F == null ? void 0 : F.className
101
+ z == null ? void 0 : z.className
102
102
  ),
103
- style: F == null ? void 0 : F.style,
103
+ style: z == null ? void 0 : z.style,
104
104
  children: le ? /* @__PURE__ */ i(
105
- On,
105
+ Ln,
106
106
  {
107
107
  label: ue,
108
108
  onHandlePointerDown: (u == null ? void 0 : u.onHandlePointerDown) ?? (() => {
109
109
  }),
110
110
  onKeyDown: u == null ? void 0 : u.onKeyDown,
111
- id: ye,
112
- pickedUp: Ie
111
+ id: Ie,
112
+ pickedUp: ke
113
113
  }
114
- ) : xe($.column.columnDef.cell, $.getContext())
114
+ ) : Se($.column.columnDef.cell, $.getContext())
115
115
  },
116
116
  $.id
117
117
  );
118
118
  })
119
119
  }
120
120
  );
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
121
+ }, Me = "__select__", je = "__expand__", De = "__drag__", de = () => !0, An = {
122
+ text: de,
123
+ select: de,
124
+ "multi-select": de,
125
+ "date-range": de,
126
+ "date-range-period": de
127
127
  };
128
- function Pn(R) {
128
+ function Fn(R) {
129
129
  return Array.isArray(R.columns);
130
130
  }
131
- function _t(R) {
131
+ function Ct(R) {
132
132
  const {
133
- id: E,
133
+ id: T,
134
134
  data: V,
135
135
  columns: x,
136
136
  size: O = "medium",
137
- caption: T,
138
- state: A,
139
- defaultState: De,
140
- onStateChange: Re,
137
+ caption: E,
138
+ state: F,
139
+ defaultState: Re,
140
+ onStateChange: ye,
141
141
  persist: oe,
142
142
  emptyState: ce,
143
143
  emptyStateRole: ue,
144
144
  className: u,
145
- children: ye,
146
- striped: Ie = !1,
145
+ children: Ie,
146
+ striped: ke = !1,
147
147
  verticalBorders: ge = !1,
148
148
  borderless: $ = !1,
149
149
  stickyFirstColumn: g = !1,
150
- stickyHeader: F = !1,
150
+ stickyHeader: z = !1,
151
151
  maxHeight: le,
152
- onRowClick: z,
152
+ onRowClick: B,
153
153
  activeRowId: G,
154
154
  rowHover: pe,
155
- enableRowSelection: Me,
156
- selectionMode: ke = "multiple",
157
- highlightSelectedRows: vt = !0,
155
+ enableRowSelection: We,
156
+ selectionMode: Te = "multiple",
157
+ highlightSelectedRows: xt = !0,
158
158
  enableColumnFilters: Ee = !1,
159
- renderSubComponent: W,
160
- getRowCanExpand: je,
161
- getSubRows: We,
162
- getRowId: Ct,
163
- expandTrigger: Te = "button",
164
- paginateExpandedRows: xt = !1,
159
+ renderSubComponent: X,
160
+ getRowCanExpand: Xe,
161
+ getSubRows: Ye,
162
+ getRowId: St,
163
+ expandTrigger: Ne = "button",
164
+ paginateExpandedRows: Dt = !1,
165
165
  pagination: M,
166
- autoResetPageIndex: St = !0,
167
- manualPagination: X = !1,
168
- manualSorting: Ne = !1,
169
- manualFiltering: Oe = !1,
170
- pageCount: Xe,
166
+ autoResetPageIndex: Rt,
167
+ manualPagination: j = !1,
168
+ manualSorting: Oe = !1,
169
+ manualFiltering: $e = !1,
170
+ pageCount: qe,
171
171
  rowCount: me,
172
- checkboxProps: $e,
173
- radioProps: Ye,
174
- collapseProps: qe,
175
- rowProps: Le,
176
- columnProps: j,
172
+ checkboxProps: Le,
173
+ radioProps: Je,
174
+ collapseProps: Qe,
175
+ rowProps: Pe,
176
+ columnProps: W,
177
177
  reorderableRows: S = !1,
178
178
  onRowDrop: L,
179
179
  reorderableColumns: Y = !1
180
- } = R, { getLabel: b } = Rn(), Je = ce ?? b("table.no-data"), q = H(b);
180
+ } = R, { getLabel: b } = In(), Ze = ce ?? b("table.no-data"), q = A(b);
181
181
  q.current = b;
182
- const Dt = fn(), p = E ?? Dt, h = w(() => M ? M === !0 ? { pageSize: 10, pageSizeOptions: [10, 25, 50], paginationProps: void 0 } : {
182
+ const yt = hn(), p = T ?? yt, 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,
185
185
  paginationProps: M.paginationProps
186
- } : null, [M]), y = h !== null, Rt = w(() => {
186
+ } : null, [M]), y = h !== null, It = w(() => {
187
187
  const e = h == null ? void 0 : h.pageSizeOptions;
188
188
  return Array.isArray(e) && e.length > 0 ? e : void 0;
189
- }, [h]), [P, D] = Dn({
189
+ }, [h]), [P, D] = yn({
190
190
  persist: oe,
191
- controlled: A,
192
- defaultState: De,
193
- onStateChange: Re
194
- }), yt = N(
191
+ controlled: F,
192
+ defaultState: Re,
193
+ onStateChange: ye
194
+ }), kt = N(
195
195
  (e) => {
196
196
  D((n) => {
197
197
  const t = n.columnVisibility ?? {};
@@ -199,7 +199,7 @@ function _t(R) {
199
199
  });
200
200
  },
201
201
  [D]
202
- ), It = N(
202
+ ), Tt = N(
203
203
  (e) => {
204
204
  D((n) => {
205
205
  const t = n.rowSelection ?? {};
@@ -207,7 +207,7 @@ function _t(R) {
207
207
  });
208
208
  },
209
209
  [D]
210
- ), kt = N(
210
+ ), Et = N(
211
211
  (e) => {
212
212
  D((n) => {
213
213
  const t = n.expanded ?? {};
@@ -215,7 +215,7 @@ function _t(R) {
215
215
  });
216
216
  },
217
217
  [D]
218
- ), Et = N(
218
+ ), Nt = N(
219
219
  (e) => {
220
220
  D((n) => {
221
221
  const t = n.columnFilters ?? [];
@@ -223,7 +223,7 @@ function _t(R) {
223
223
  });
224
224
  },
225
225
  [D]
226
- ), Tt = N(
226
+ ), Ot = N(
227
227
  (e) => {
228
228
  D((n) => {
229
229
  const t = n.columnOrder ?? [];
@@ -231,7 +231,7 @@ function _t(R) {
231
231
  });
232
232
  },
233
233
  [D]
234
- ), Nt = N(
234
+ ), $t = N(
235
235
  (e) => {
236
236
  D((n) => {
237
237
  const t = n.sorting ?? [];
@@ -239,7 +239,7 @@ function _t(R) {
239
239
  });
240
240
  },
241
241
  [D]
242
- ), Ot = N(
242
+ ), Lt = N(
243
243
  (e) => {
244
244
  D((n) => {
245
245
  const t = n.pagination ?? {
@@ -250,31 +250,31 @@ function _t(R) {
250
250
  });
251
251
  },
252
252
  [D, h]
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
- ), zt = w(() => {
253
+ ), ae = !!(X || Ye), et = !!We, Pt = w(() => kn(), []), At = w(() => $e ? void 0 : Tn(), [$e]), Ft = w(() => Oe ? void 0 : En(), [Oe]), zt = w(() => ae ? Nn() : void 0, [ae]), Bt = w(
254
+ () => y && !j ? On() : void 0,
255
+ [y, j]
256
+ ), Ut = w(() => {
257
257
  const e = [];
258
258
  if (S && e.push({
259
- id: Se,
259
+ id: De,
260
260
  enableSorting: !1,
261
261
  enableHiding: !1,
262
262
  enableColumnFilter: !1,
263
263
  size: 40,
264
264
  header: "",
265
265
  cell: () => null
266
- }), Qe) {
267
- const n = ke === "single", t = `${p}-select`;
266
+ }), et) {
267
+ const n = Te === "single", t = `${p}-select`;
268
268
  e.push({
269
- id: Ve,
269
+ id: Me,
270
270
  enableSorting: !1,
271
271
  enableHiding: !1,
272
272
  enableColumnFilter: !1,
273
273
  size: 40,
274
274
  header: n ? "" : ({ table: o }) => /* @__PURE__ */ i(
275
- bt,
275
+ wt,
276
276
  {
277
- ...$e,
277
+ ...Le,
278
278
  id: `${p}-select-all`,
279
279
  name: `${p}-select-all`,
280
280
  label: q.current("table.select-all", o.getIsAllPageRowsSelected()),
@@ -286,9 +286,9 @@ function _t(R) {
286
286
  }
287
287
  ),
288
288
  cell: ({ row: o }) => n ? /* @__PURE__ */ i(
289
- wn,
289
+ vn,
290
290
  {
291
- ...Ye,
291
+ ...Je,
292
292
  id: `${p}-select-${o.id}`,
293
293
  name: t,
294
294
  label: q.current("table.select-row", o.getIsSelected()),
@@ -301,9 +301,9 @@ function _t(R) {
301
301
  }
302
302
  }
303
303
  ) : /* @__PURE__ */ i(
304
- bt,
304
+ wt,
305
305
  {
306
- ...$e,
306
+ ...Le,
307
307
  id: `${p}-select-${o.id}`,
308
308
  name: `${p}-select-${o.id}`,
309
309
  label: q.current("table.select-row", o.getIsSelected()),
@@ -318,7 +318,7 @@ function _t(R) {
318
318
  });
319
319
  }
320
320
  return ae && e.push({
321
- id: Ge,
321
+ id: je,
322
322
  enableSorting: !1,
323
323
  enableHiding: !1,
324
324
  enableColumnFilter: !1,
@@ -335,13 +335,13 @@ function _t(R) {
335
335
  (o.key === "Enter" || o.key === " ") && o.stopPropagation();
336
336
  },
337
337
  children: /* @__PURE__ */ i(
338
- hn,
338
+ _n,
339
339
  {
340
- arrowType: Te === "row" ? "default" : "secondary",
341
- ...qe,
340
+ arrowType: Ne === "row" ? "default" : "secondary",
341
+ ...Qe,
342
342
  hideText: !0,
343
343
  id: `${p}-expand-${n.id}`,
344
- "aria-controls": W ? t : void 0,
344
+ "aria-controls": X ? t : void 0,
345
345
  openText: q.current("table.expand-row"),
346
346
  closeText: q.current("table.collapse-row"),
347
347
  open: n.getIsExpanded(),
@@ -354,87 +354,99 @@ function _t(R) {
354
354
  }), [...e, ...x];
355
355
  }, [
356
356
  x,
357
- Qe,
358
- ke,
359
- ae,
360
- W,
357
+ et,
361
358
  Te,
359
+ ae,
360
+ X,
361
+ Ne,
362
362
  S,
363
363
  p,
364
- $e,
365
- Ye,
366
- qe
367
- ]), Bt = w(() => ({}), []), Ut = w(() => ({}), []), Ht = w(() => [], []), Kt = w(() => [], []), Vt = w(() => [], []), Gt = w(
364
+ Le,
365
+ Je,
366
+ Qe
367
+ ]), Ht = w(() => ({}), []), Kt = w(() => ({}), []), Vt = w(() => [], []), Gt = w(() => [], []), Mt = w(() => [], []), jt = w(
368
368
  () => ({ pageIndex: 0, pageSize: (h == null ? void 0 : h.pageSize) ?? 10 }),
369
369
  [h]
370
- ), s = mn({
370
+ ), d = bn({
371
371
  data: V,
372
- columns: zt,
372
+ columns: Ut,
373
373
  state: {
374
374
  columnVisibility: P.columnVisibility,
375
- columnOrder: P.columnOrder ?? Kt,
376
- rowSelection: P.rowSelection ?? Bt,
377
- expanded: P.expanded ?? Ut,
378
- columnFilters: P.columnFilters ?? Ht,
379
- sorting: P.sorting ?? Vt,
380
- pagination: y ? P.pagination ?? Gt : void 0
375
+ columnOrder: P.columnOrder ?? Gt,
376
+ rowSelection: P.rowSelection ?? Ht,
377
+ expanded: P.expanded ?? Kt,
378
+ columnFilters: P.columnFilters ?? Vt,
379
+ sorting: P.sorting ?? Mt,
380
+ pagination: y ? P.pagination ?? jt : void 0
381
381
  },
382
- enableRowSelection: Me,
383
- enableMultiRowSelection: ke !== "single",
382
+ enableRowSelection: We,
383
+ enableMultiRowSelection: Te !== "single",
384
384
  enableColumnFilters: Ee,
385
- autoResetPageIndex: St,
386
- paginateExpandedRows: y && !X ? xt : !0,
387
- manualPagination: X,
388
- manualSorting: Ne,
389
- manualFiltering: Oe,
385
+ autoResetPageIndex: Rt ?? !j,
386
+ paginateExpandedRows: y && !j ? Dt : !0,
387
+ manualPagination: j,
388
+ manualSorting: Oe,
389
+ manualFiltering: $e,
390
390
  // `pageCount` only matters in manual mode; TanStack ignores it otherwise.
391
- pageCount: X && Xe !== void 0 ? Xe : void 0,
392
- rowCount: X && me !== void 0 ? me : void 0,
393
- getRowCanExpand: W ? je ?? (() => !0) : je,
394
- getSubRows: We,
395
- getRowId: Ct,
396
- onColumnVisibilityChange: yt,
397
- onColumnOrderChange: Tt,
398
- onRowSelectionChange: It,
399
- onExpandedChange: kt,
400
- onColumnFiltersChange: Et,
401
- onSortingChange: Nt,
402
- onPaginationChange: y ? Ot : void 0,
403
- filterFns: Ln,
404
- getCoreRowModel: $t,
405
- getFilteredRowModel: Lt,
406
- getExpandedRowModel: At,
407
- getSortedRowModel: Pt,
408
- getPaginationRowModel: Ft
409
- }), Mt = w(
410
- () => ({ table: s, size: O, id: p, state: P }),
411
- [s, O, p, P]
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(
391
+ pageCount: j && qe !== void 0 ? qe : void 0,
392
+ rowCount: j && me !== void 0 ? me : void 0,
393
+ getRowCanExpand: X ? Xe ?? (() => !0) : Xe,
394
+ getSubRows: Ye,
395
+ getRowId: St,
396
+ onColumnVisibilityChange: kt,
397
+ onColumnOrderChange: Ot,
398
+ onRowSelectionChange: Tt,
399
+ onExpandedChange: Et,
400
+ onColumnFiltersChange: Nt,
401
+ onSortingChange: $t,
402
+ onPaginationChange: y ? Lt : void 0,
403
+ filterFns: An,
404
+ getCoreRowModel: Pt,
405
+ getFilteredRowModel: At,
406
+ getExpandedRowModel: zt,
407
+ getSortedRowModel: Ft,
408
+ getPaginationRowModel: Bt
409
+ }), Wt = w(
410
+ () => ({ table: d, size: O, id: p, state: P }),
411
+ [d, O, p, P]
412
+ ), Ae = A(null), fe = N(() => {
413
+ Ae.current && (Ae.current.scrollTop = 0);
414
+ }, []), Xt = N(
415
+ (e) => {
416
+ d.setPageIndex(e - 1), fe();
417
+ },
418
+ [d, fe]
419
+ ), Yt = N(
420
+ (e) => {
421
+ d.setPageSize(e), fe();
422
+ },
423
+ [d, fe]
424
+ ), qt = d.getHeaderGroups().length > 1, be = Ne === "row" && ae, Jt = pe ?? (!!B || be), Qt = k(
413
425
  l["tedi-table"],
414
426
  l[`tedi-table--${O}`],
415
427
  {
416
- [l["tedi-table--striped"]]: Ie,
428
+ [l["tedi-table--striped"]]: ke,
417
429
  [l["tedi-table--vertical-borders"]]: ge,
418
430
  [l["tedi-table--borderless"]]: $,
419
431
  [l["tedi-table--sticky-first-column"]]: g,
420
- [l["tedi-table--sticky-header"]]: F,
421
- [l["tedi-table--clickable-rows"]]: !!z || fe,
422
- [l["tedi-table--row-hover"]]: Yt,
432
+ [l["tedi-table--sticky-header"]]: z,
433
+ [l["tedi-table--clickable-rows"]]: !!B || be,
434
+ [l["tedi-table--row-hover"]]: Jt,
423
435
  [l["tedi-table--has-pagination"]]: y,
424
- [l["tedi-table--grouped-headers"]]: Xt
436
+ [l["tedi-table--grouped-headers"]]: qt
425
437
  },
426
438
  u
427
- ), _ = s.getRowModel().rows, be = s.getHeaderGroups(), Ze = s.getFooterGroups(), et = s.getVisibleLeafColumns(), he = et.length, Jt = Ze.some(
439
+ ), _ = d.getRowModel().rows, he = d.getHeaderGroups(), tt = d.getFooterGroups(), nt = d.getVisibleLeafColumns(), we = nt.length, Zt = tt.some(
428
440
  (e) => e.headers.some((n) => n.column.columnDef.footer !== void 0)
429
- ), tt = (e) => !!z || fe && e.getCanExpand(), nt = (e) => {
430
- fe && e.getCanExpand() && e.toggleExpanded(), z == null || z(e);
431
- }, Qt = (e) => (n) => {
432
- tt(e) && n.target === n.currentTarget && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), nt(e));
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(
441
+ ), ot = (e) => !!B || be && e.getCanExpand(), lt = (e) => {
442
+ be && e.getCanExpand() && e.toggleExpanded(), B == null || B(e);
443
+ }, en = (e) => (n) => {
444
+ ot(e) && n.target === n.currentTarget && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), lt(e));
445
+ }, at = he.length + (Ee ? 1 : 0), it = d.getState().pagination, tn = y ? it.pageIndex * it.pageSize : 0, nn = y ? me ?? d.getFilteredRowModel().rows.length : _.length, on = y ? at + nn : void 0, [rt, Fe] = K(null), [ln, _e] = K(null), J = A(null), Q = A(null), [st, ze] = K(null), [dt, ve] = K(null), Z = A(null), ee = A(null), [ct, Be] = K(null), Ce = A([]), [ut, Ue] = K(null), ie = A(-1), [an, U] = K(""), xe = A(null), [rn, gt] = K(0), He = w(
434
446
  () => S ? new Map(_.map((e) => [e.id, e.index])) : /* @__PURE__ */ new Map(),
435
447
  [S, _]
436
448
  );
437
- ft(() => {
449
+ ht(() => {
438
450
  if (!S && !Y) return;
439
451
  const e = () => {
440
452
  Q.current = null, ee.current = null;
@@ -443,7 +455,7 @@ function _t(R) {
443
455
  window.removeEventListener("mouseup", e), window.removeEventListener("touchend", e);
444
456
  };
445
457
  }, [S, Y]);
446
- const an = N(
458
+ const sn = N(
447
459
  (e) => ({
448
460
  onHandlePointerDown: () => {
449
461
  Q.current = e;
@@ -466,38 +478,38 @@ function _t(R) {
466
478
  f.className = o.className, f.style.cssText = `width:${a.width}px;table-layout:fixed;border-collapse:collapse;`;
467
479
  const v = document.createElement("tbody"), C = t.cloneNode(!0);
468
480
  C.classList.add(l["tedi-table__row--drag-preview"]);
469
- const d = Array.from(C.children);
481
+ const s = Array.from(C.children);
470
482
  r.forEach((te, I) => {
471
- const U = d[I];
472
- if (!U) return;
483
+ const H = s[I];
484
+ if (!H) return;
473
485
  const re = te.getBoundingClientRect();
474
- U.style.width = `${re.width}px`, U.style.minWidth = `${re.width}px`, U.style.maxWidth = `${re.width}px`;
486
+ H.style.width = `${re.width}px`, H.style.minWidth = `${re.width}px`, H.style.maxWidth = `${re.width}px`;
475
487
  }), 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);
476
488
  }
477
- J.current = e, Pe(e);
489
+ J.current = e, Fe(e);
478
490
  },
479
491
  onDragOver: (n) => {
480
- !J.current || J.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", we(e));
492
+ !J.current || J.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", _e(e));
481
493
  },
482
494
  onDragLeave: () => {
483
- we((n) => n === e ? null : n);
495
+ _e((n) => n === e ? null : n);
484
496
  },
485
497
  onDragEnd: () => {
486
- J.current = null, Q.current = null, Pe(null), we(null);
498
+ J.current = null, Q.current = null, Fe(null), _e(null);
487
499
  },
488
500
  onDrop: (n) => {
489
501
  n.preventDefault();
490
502
  const t = J.current, o = e;
491
- if (J.current = null, Q.current = null, Pe(null), we(null), !t || t === o) return;
492
- const a = Be.get(t), r = Be.get(o);
503
+ if (J.current = null, Q.current = null, Fe(null), _e(null), !t || t === o) return;
504
+ const a = He.get(t), r = He.get(o);
493
505
  a === void 0 || r === void 0 || L == null || L({ fromId: t, toId: o, fromIndex: a, toIndex: r });
494
506
  }
495
507
  }),
496
- [Be, L]
497
- ), ut = (e, n, t) => {
508
+ [He, L]
509
+ ), pt = (e, n, t) => {
498
510
  const o = e.slice(), [a] = o.splice(n, 1);
499
511
  return o.splice(t, 0, a), o;
500
- }, rn = N(
512
+ }, dn = N(
501
513
  (e) => ({
502
514
  onHandlePointerDown: () => {
503
515
  ee.current = e;
@@ -519,63 +531,63 @@ function _t(R) {
519
531
  const f = document.createElement("thead"), v = document.createElement("tr");
520
532
  v.className = l["tedi-table__row"];
521
533
  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);
534
+ 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, ze(e);
523
535
  },
524
536
  onDragOver: (n) => {
525
- !Z.current || Z.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", _e(e));
537
+ !Z.current || Z.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", ve(e));
526
538
  },
527
539
  onDragLeave: () => {
528
- _e((n) => n === e ? null : n);
540
+ ve((n) => n === e ? null : n);
529
541
  },
530
542
  onDragEnd: () => {
531
- Z.current = null, ee.current = null, Ae(null), _e(null);
543
+ Z.current = null, ee.current = null, ze(null), ve(null);
532
544
  },
533
545
  onDrop: (n) => {
534
546
  n.preventDefault();
535
547
  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);
538
- c < 0 || f < 0 || s.setColumnOrder(ut(r, c, f));
548
+ if (Z.current = null, ee.current = null, ze(null), ve(null), !t || t === o) return;
549
+ const a = d.getState().columnOrder, r = a.length > 0 ? a : d.getAllLeafColumns().map((v) => v.id), c = r.indexOf(t), f = r.indexOf(o);
550
+ c < 0 || f < 0 || d.setColumnOrder(pt(r, c, f));
539
551
  }
540
552
  }),
541
- [s]
542
- ), dn = (e) => `${p}-col-reorder-${e}`, sn = (e) => `${p}-row-reorder-${e}`, gt = () => s.getVisibleLeafColumns().filter((e) => !e.parent && e.id !== Se && e.id !== Ve && e.id !== Ge).map((e) => e.id), Ue = (e) => {
543
- const n = s.getColumn(e), t = n == null ? void 0 : n.columnDef.meta;
553
+ [d]
554
+ ), cn = (e) => `${p}-col-reorder-${e}`, un = (e) => `${p}-row-reorder-${e}`, mt = () => d.getVisibleLeafColumns().filter((e) => !e.parent && e.id !== De && e.id !== Me && e.id !== je).map((e) => e.id), Ke = (e) => {
555
+ const n = d.getColumn(e), t = n == null ? void 0 : n.columnDef.meta;
544
556
  return (t == null ? void 0 : t.label) ?? (typeof (n == null ? void 0 : n.columnDef.header) == "string" ? n.columnDef.header : e);
545
- }, pt = (e, n) => {
546
- const t = gt(), o = t.indexOf(n);
557
+ }, ft = (e, n) => {
558
+ const t = mt(), o = t.indexOf(n);
547
559
  if (o < 0) return;
548
560
  const a = o + e;
549
561
  if (a < 0 || a >= t.length) return;
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);
562
+ const r = pt(t, o, a), c = d.getState().columnOrder.length > 0 ? [...d.getState().columnOrder] : d.getAllLeafColumns().map((s) => s.id), f = new Set(t);
551
563
  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);
555
- }, cn = (e, n) => {
564
+ const C = c.map((s) => f.has(s) ? r[v++] : s);
565
+ for (const s of r) C.includes(s) || C.push(s);
566
+ d.setColumnOrder(C), U(b("table.reorder.move", Ke(n), a + 1)), xe.current = { kind: "column", id: n }, gt((s) => s + 1);
567
+ }, gn = (e, n) => {
556
568
  if (!Y) return;
557
- const t = dt;
569
+ const t = ct;
558
570
  switch (e.key) {
559
571
  case " ":
560
572
  case "Enter":
561
573
  if (e.preventDefault(), t === null)
562
- ve.current = [...s.getState().columnOrder ?? []], Fe(n), B(b("table.reorder.pickup", Ue(n)));
574
+ Ce.current = [...d.getState().columnOrder ?? []], Be(n), U(b("table.reorder.pickup", Ke(n)));
563
575
  else {
564
- const o = gt().indexOf(t) + 1;
565
- Fe(null), ve.current = [], B(b("table.reorder.drop", Ue(t), o));
576
+ const o = mt().indexOf(t) + 1;
577
+ Be(null), Ce.current = [], U(b("table.reorder.drop", Ke(t), o));
566
578
  }
567
579
  break;
568
580
  case "Escape":
569
- t !== null && (e.preventDefault(), s.setColumnOrder(ve.current), Fe(null), ve.current = [], B(b("table.reorder.cancel")));
581
+ t !== null && (e.preventDefault(), d.setColumnOrder(Ce.current), Be(null), Ce.current = [], U(b("table.reorder.cancel")));
570
582
  break;
571
583
  case "ArrowLeft":
572
- t !== null && (e.preventDefault(), pt(-1, t));
584
+ t !== null && (e.preventDefault(), ft(-1, t));
573
585
  break;
574
586
  case "ArrowRight":
575
- t !== null && (e.preventDefault(), pt(1, t));
587
+ t !== null && (e.preventDefault(), ft(1, t));
576
588
  break;
577
589
  }
578
- }, mt = (e, n) => {
590
+ }, bt = (e, n) => {
579
591
  const t = _.findIndex((c) => c.original === n);
580
592
  if (t < 0) return;
581
593
  const o = t + e;
@@ -586,18 +598,18 @@ function _t(R) {
586
598
  toId: r.id,
587
599
  fromIndex: a.index,
588
600
  toIndex: r.index
589
- }), B(b("table.row-reorder.move", o + 1)), Ce.current = { kind: "row", original: n }, ct((c) => c + 1);
590
- }, un = (e, n) => {
601
+ }), U(b("table.row-reorder.move", o + 1)), xe.current = { kind: "row", original: n }, gt((c) => c + 1);
602
+ }, pn = (e, n) => {
591
603
  if (!S) return;
592
- const t = st;
604
+ const t = ut;
593
605
  switch (e.key) {
594
606
  case " ":
595
607
  case "Enter":
596
608
  if (e.preventDefault(), t === null)
597
- ze(n.original), ie.current = n.index, B(b("table.row-reorder.pickup", _.indexOf(n) + 1));
609
+ Ue(n.original), ie.current = n.index, U(b("table.row-reorder.pickup", _.indexOf(n) + 1));
598
610
  else {
599
611
  const o = _.findIndex((a) => a.original === t) + 1;
600
- ze(null), ie.current = -1, B(b("table.row-reorder.drop", o));
612
+ Ue(null), ie.current = -1, U(b("table.row-reorder.drop", o));
601
613
  }
602
614
  break;
603
615
  case "Escape":
@@ -613,22 +625,22 @@ function _t(R) {
613
625
  toIndex: ie.current
614
626
  });
615
627
  }
616
- ze(null), ie.current = -1, B(b("table.row-reorder.cancel"));
628
+ Ue(null), ie.current = -1, U(b("table.row-reorder.cancel"));
617
629
  }
618
630
  break;
619
631
  case "ArrowUp":
620
- t !== null && (e.preventDefault(), mt(-1, t));
632
+ t !== null && (e.preventDefault(), bt(-1, t));
621
633
  break;
622
634
  case "ArrowDown":
623
- t !== null && (e.preventDefault(), mt(1, t));
635
+ t !== null && (e.preventDefault(), bt(1, t));
624
636
  break;
625
637
  }
626
638
  };
627
- return ft(() => {
639
+ return ht(() => {
628
640
  var t;
629
- const e = Ce.current;
641
+ const e = xe.current;
630
642
  if (!e) return;
631
- Ce.current = null;
643
+ xe.current = null;
632
644
  let n;
633
645
  if (e.kind === "column")
634
646
  n = `${p}-col-reorder-${e.id}`;
@@ -637,34 +649,35 @@ function _t(R) {
637
649
  n = o ? `${p}-row-reorder-${o.id}` : null;
638
650
  }
639
651
  n && ((t = document.getElementById(n)) == null || t.focus());
640
- }, [ln, _, p]), /* @__PURE__ */ i(Cn.Provider, { value: Mt, children: /* @__PURE__ */ de("div", { className: qt, "data-name": "tedi-table", children: [
641
- ye,
642
- (S || Y) && /* @__PURE__ */ i("div", { className: l["tedi-table__sr-only"], "aria-live": "polite", "aria-atomic": "true", children: on }),
652
+ }, [rn, _, p]), /* @__PURE__ */ i(Sn.Provider, { value: Wt, children: /* @__PURE__ */ se("div", { className: Qt, "data-name": "tedi-table", children: [
653
+ Ie,
654
+ (S || Y) && /* @__PURE__ */ i("div", { className: l["tedi-table__sr-only"], "aria-live": "polite", "aria-atomic": "true", children: an }),
643
655
  /* @__PURE__ */ i(
644
656
  "div",
645
657
  {
658
+ ref: Ae,
646
659
  className: l["tedi-table__scroll"],
647
660
  style: le !== void 0 ? { maxHeight: le, overflowY: "auto" } : void 0,
648
- children: /* @__PURE__ */ de(
661
+ children: /* @__PURE__ */ se(
649
662
  "table",
650
663
  {
651
- id: E,
664
+ id: T,
652
665
  className: l["tedi-table__table"],
653
- "aria-rowcount": tn,
654
- "aria-colcount": he > 0 ? he : void 0,
666
+ "aria-rowcount": on,
667
+ "aria-colcount": we > 0 ? we : void 0,
655
668
  children: [
656
- T && /* @__PURE__ */ i("caption", { className: l["tedi-table__caption"], children: T }),
657
- /* @__PURE__ */ de("thead", { className: l["tedi-table__head"], children: [
658
- be.map((e, n) => /* @__PURE__ */ i(
669
+ E && /* @__PURE__ */ i("caption", { className: l["tedi-table__caption"], children: E }),
670
+ /* @__PURE__ */ se("thead", { className: l["tedi-table__head"], children: [
671
+ he.map((e, n) => /* @__PURE__ */ i(
659
672
  "tr",
660
673
  {
661
674
  className: l["tedi-table__row"],
662
675
  "aria-rowindex": y ? n + 1 : void 0,
663
676
  children: e.headers.map((t) => {
664
- const o = t.subHeaders.length > 0, a = !!t.column.parent, r = Pn(t.column.columnDef), c = !r && !a;
677
+ const o = t.subHeaders.length > 0, a = !!t.column.parent, r = Fn(t.column.columnDef), c = !r && !a;
665
678
  if (t.isPlaceholder && !c || !t.isPlaceholder && c && n > 0)
666
679
  return null;
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;
680
+ const f = c ? he.length - n : 1, v = t.column.getIsSorted(), C = t.column.getCanSort() ? v === "asc" ? "ascending" : v === "desc" ? "descending" : "none" : void 0, s = t.column.columnDef.meta, te = (s == null ? void 0 : s.label) ?? (typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : void 0), I = W == null ? void 0 : W(t.column.id), H = t.column.getSize(), re = t.column.id === De || t.column.id === Me || t.column.id === je, ne = Y && c && !re, m = ne ? dn(t.column.id) : void 0, mn = ne && st === t.column.id, fn = ne && dt === t.column.id && st !== t.column.id, Ve = ne && ct === t.column.id;
668
681
  return /* @__PURE__ */ i(
669
682
  "th",
670
683
  {
@@ -680,39 +693,39 @@ function _t(R) {
680
693
  l["tedi-table__header-cell"],
681
694
  {
682
695
  [l["tedi-table__header-cell--group"]]: o,
683
- [l["tedi-table__header-cell--dragging"]]: gn,
684
- [l["tedi-table__header-cell--drag-over"]]: pn,
685
- [l["tedi-table__header-cell--picked-up"]]: He,
686
- [l[`tedi-table__cell--align-${d == null ? void 0 : d.align}`]]: d == null ? void 0 : d.align,
687
- [l[`tedi-table__cell--valign-${d == null ? void 0 : d.vAlign}`]]: d == null ? void 0 : d.vAlign
696
+ [l["tedi-table__header-cell--dragging"]]: mn,
697
+ [l["tedi-table__header-cell--drag-over"]]: fn,
698
+ [l["tedi-table__header-cell--picked-up"]]: Ve,
699
+ [l[`tedi-table__cell--align-${s == null ? void 0 : s.align}`]]: s == null ? void 0 : s.align,
700
+ [l[`tedi-table__cell--valign-${s == null ? void 0 : s.vAlign}`]]: s == null ? void 0 : s.vAlign
688
701
  },
689
702
  I == null ? void 0 : I.className
690
703
  ),
691
704
  scope: "col",
692
705
  "aria-sort": C,
693
706
  "aria-label": te ?? (r ? void 0 : t.column.id),
694
- style: U || I != null && I.style ? { ...U ? { width: U } : null, ...I == null ? void 0 : I.style } : void 0,
695
- children: ne && m ? /* @__PURE__ */ de("span", { className: l["tedi-table__header-cell-inner"], children: [
707
+ style: H || I != null && I.style ? { ...H ? { width: H } : null, ...I == null ? void 0 : I.style } : void 0,
708
+ children: ne && m ? /* @__PURE__ */ se("span", { className: l["tedi-table__header-cell-inner"], children: [
696
709
  /* @__PURE__ */ i(
697
710
  "button",
698
711
  {
699
712
  type: "button",
700
- id: dn(t.column.id),
713
+ id: cn(t.column.id),
701
714
  className: k(l["tedi-table__drag-handle"], {
702
- [l["tedi-table__drag-handle--picked-up"]]: He
715
+ [l["tedi-table__drag-handle--picked-up"]]: Ve
703
716
  }),
704
717
  "aria-label": b("table.drag-column", te ?? t.column.id),
705
- "aria-pressed": He,
706
- onClick: (Ke) => Ke.stopPropagation(),
718
+ "aria-pressed": Ve,
719
+ onClick: (Ge) => Ge.stopPropagation(),
707
720
  onMouseDown: m.onHandlePointerDown,
708
721
  onTouchStart: m.onHandlePointerDown,
709
- onKeyDown: (Ke) => cn(Ke, t.column.id),
710
- [wt]: "",
711
- children: /* @__PURE__ */ i(ht, { name: "drag_indicator", size: 18, color: "inherit" })
722
+ onKeyDown: (Ge) => gn(Ge, t.column.id),
723
+ [vt]: "",
724
+ children: /* @__PURE__ */ i(_t, { name: "drag_indicator", size: 18, color: "inherit" })
712
725
  }
713
726
  ),
714
- xe(t.column.columnDef.header, t.getContext())
715
- ] }) : xe(t.column.columnDef.header, t.getContext())
727
+ Se(t.column.columnDef.header, t.getContext())
728
+ ] }) : Se(t.column.columnDef.header, t.getContext())
716
729
  },
717
730
  t.id
718
731
  );
@@ -724,9 +737,9 @@ function _t(R) {
724
737
  "tr",
725
738
  {
726
739
  className: k(l["tedi-table__row"], l["tedi-table__row--filter"]),
727
- "aria-rowindex": y ? be.length + 1 : void 0,
728
- children: et.map((e) => {
729
- const n = e.columnDef.meta, t = (n == null ? void 0 : n.label) ?? (typeof e.columnDef.header == "string" ? e.columnDef.header : e.id), o = `${p}-filter-${e.id}`, a = j == null ? void 0 : j(e.id);
740
+ "aria-rowindex": y ? he.length + 1 : void 0,
741
+ children: nt.map((e) => {
742
+ const n = e.columnDef.meta, t = (n == null ? void 0 : n.label) ?? (typeof e.columnDef.header == "string" ? e.columnDef.header : e.id), o = `${p}-filter-${e.id}`, a = W == null ? void 0 : W(e.id);
730
743
  return /* @__PURE__ */ i(
731
744
  "th",
732
745
  {
@@ -734,7 +747,7 @@ function _t(R) {
734
747
  style: a == null ? void 0 : a.style,
735
748
  scope: "col",
736
749
  children: e.getCanFilter() && /* @__PURE__ */ i(
737
- _n,
750
+ Cn,
738
751
  {
739
752
  size: "small",
740
753
  placeholder: b("table.filter-placeholder"),
@@ -757,57 +770,57 @@ function _t(R) {
757
770
  /* @__PURE__ */ i("tbody", { className: l["tedi-table__body"], children: _.length === 0 ? /* @__PURE__ */ i("tr", { className: l["tedi-table__row"], children: /* @__PURE__ */ i(
758
771
  "td",
759
772
  {
760
- colSpan: Math.max(1, he),
773
+ colSpan: Math.max(1, we),
761
774
  className: k(l["tedi-table__cell"], l["tedi-table__cell--placeholder"]),
762
- children: ue ? /* @__PURE__ */ i("div", { role: ue, children: Je }) : Je
775
+ children: ue ? /* @__PURE__ */ i("div", { role: ue, children: Ze }) : Ze
763
776
  }
764
777
  ) }) : _.map((e, n) => {
765
- const t = tt(e), o = G !== void 0 && e.id === G, a = Le == null ? void 0 : Le(e), r = k(
778
+ const t = ot(e), o = G !== void 0 && e.id === G, a = Pe == null ? void 0 : Pe(e), r = k(
766
779
  l["tedi-table__row"],
767
780
  {
768
- [l["tedi-table__row--selected"]]: vt && e.getIsSelected(),
781
+ [l["tedi-table__row--selected"]]: xt && e.getIsSelected(),
769
782
  [l["tedi-table__row--active"]]: o,
770
783
  [l["tedi-table__row--clickable"]]: t,
771
784
  [l["tedi-table__row--sub-row"]]: e.depth > 0
772
785
  },
773
786
  a == null ? void 0 : a.className
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 = {
787
+ ), c = y ? at + tn + n + 1 : void 0, f = `${p}-sub-${e.id}`, v = S && rt === e.id, C = S && ln === e.id && rt !== e.id, s = S && ut === e.original, te = {
775
788
  row: e,
776
789
  rowClassName: k(r, {
777
790
  [l["tedi-table__row--dragging"]]: v,
778
791
  [l["tedi-table__row--drag-over"]]: C,
779
- [l["tedi-table__row--picked-up"]]: d
792
+ [l["tedi-table__row--picked-up"]]: s
780
793
  }),
781
794
  rowStyle: a == null ? void 0 : a.style,
782
795
  isActiveRow: o,
783
796
  clickable: t,
784
- onClick: nt,
785
- onKeyDownHandler: Qt(e),
797
+ onClick: lt,
798
+ onKeyDownHandler: en(e),
786
799
  ariaRowIndex: c,
787
- columnProps: j,
800
+ columnProps: W,
788
801
  draggable: S,
789
802
  dragHandleLabel: b("table.drag-row"),
790
- dragHandlers: S ? { ...an(e.id), onKeyDown: (I) => un(I, e) } : void 0,
791
- dragHandleId: S ? sn(e.id) : void 0,
792
- dragHandlePickedUp: d,
793
- dragOverColumnId: Y ? rt : null
803
+ dragHandlers: S ? { ...sn(e.id), onKeyDown: (I) => pn(I, e) } : void 0,
804
+ dragHandleId: S ? un(e.id) : void 0,
805
+ dragHandlePickedUp: s,
806
+ dragOverColumnId: Y ? dt : null
794
807
  };
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(
808
+ return /* @__PURE__ */ se(wn, { children: [
809
+ /* @__PURE__ */ i(Pn, { ...te }),
810
+ X && e.getIsExpanded() && /* @__PURE__ */ i("tr", { className: k(l["tedi-table__row"], l["tedi-table__row--sub-component"]), children: /* @__PURE__ */ i(
798
811
  "td",
799
812
  {
800
813
  id: f,
801
814
  role: "region",
802
815
  "aria-label": b("table.row-details"),
803
- colSpan: Math.max(1, he),
816
+ colSpan: Math.max(1, we),
804
817
  className: k(l["tedi-table__cell"], l["tedi-table__cell--sub-component"]),
805
- children: W(e)
818
+ children: X(e)
806
819
  }
807
820
  ) })
808
821
  ] }, e.id);
809
822
  }) }),
810
- Jt && /* @__PURE__ */ i("tfoot", { className: l["tedi-table__foot"], children: Ze.map((e) => /* @__PURE__ */ i("tr", { className: l["tedi-table__row"], children: e.headers.map((n) => {
823
+ Zt && /* @__PURE__ */ i("tfoot", { className: l["tedi-table__foot"], children: tt.map((e) => /* @__PURE__ */ i("tr", { className: l["tedi-table__row"], children: e.headers.map((n) => {
811
824
  const t = n.column.columnDef.meta;
812
825
  return /* @__PURE__ */ i(
813
826
  "td",
@@ -817,7 +830,7 @@ function _t(R) {
817
830
  [l[`tedi-table__cell--align-${t == null ? void 0 : t.align}`]]: t == null ? void 0 : t.align,
818
831
  [l[`tedi-table__cell--valign-${t == null ? void 0 : t.vAlign}`]]: t == null ? void 0 : t.vAlign
819
832
  }),
820
- children: n.isPlaceholder ? null : xe(n.column.columnDef.footer, n.getContext())
833
+ children: n.isPlaceholder ? null : Se(n.column.columnDef.footer, n.getContext())
821
834
  },
822
835
  n.id
823
836
  );
@@ -828,27 +841,27 @@ function _t(R) {
828
841
  }
829
842
  ),
830
843
  y && /* @__PURE__ */ i("div", { className: l["tedi-table__pagination"], children: /* @__PURE__ */ i(
831
- Nn,
844
+ $n,
832
845
  {
833
846
  ...h == null ? void 0 : h.paginationProps,
834
- pageCount: Math.max(1, s.getPageCount()),
835
- page: s.getState().pagination.pageIndex + 1,
836
- onPageChange: jt,
837
- totalItems: me ?? s.getFilteredRowModel().rows.length,
838
- pageSize: s.getState().pagination.pageSize,
839
- pageSizeOptions: Rt,
840
- onPageSizeChange: Wt
847
+ pageCount: Math.max(1, d.getPageCount()),
848
+ page: d.getState().pagination.pageIndex + 1,
849
+ onPageChange: Xt,
850
+ totalItems: me ?? d.getFilteredRowModel().rows.length,
851
+ pageSize: d.getState().pagination.pageSize,
852
+ pageSizeOptions: It,
853
+ onPageSizeChange: Yt
841
854
  }
842
855
  ) })
843
856
  ] }) });
844
857
  }
845
- _t.displayName = "Table";
846
- const to = Object.assign(_t, {
847
- Toolbar: Sn,
848
- ColumnsMenu: vn,
849
- HeaderButton: xn
858
+ Ct.displayName = "Table";
859
+ const oo = Object.assign(Ct, {
860
+ Toolbar: Rn,
861
+ ColumnsMenu: xn,
862
+ HeaderButton: Dn
850
863
  });
851
864
  export {
852
- to as Table,
853
- eo as groupRowSpan
865
+ oo as Table,
866
+ no as groupRowSpan
854
867
  };