@caspeco/casper-ui-library 8.2.2 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/components/modal/modal.spec.d.ts +0 -1
  2. package/dist/components/modal/modal.spec.d.ts.map +1 -1
  3. package/dist/components/paginator/paginator.composition.d.ts +1 -0
  4. package/dist/components/paginator/paginator.composition.d.ts.map +1 -1
  5. package/dist/components/paginator/paginator.d.ts +3 -1
  6. package/dist/components/paginator/paginator.d.ts.map +1 -1
  7. package/dist/components/paginator/paginator.js +12 -11
  8. package/dist/components/table/helper.d.ts +2 -0
  9. package/dist/components/table/helper.d.ts.map +1 -0
  10. package/dist/components/table/helper.js +7 -0
  11. package/dist/components/table/table-content.d.ts.map +1 -1
  12. package/dist/components/table/table-content.js +93 -80
  13. package/dist/components/table/table-context-provider.d.ts +10 -2
  14. package/dist/components/table/table-context-provider.d.ts.map +1 -1
  15. package/dist/components/table/table-context-provider.js +149 -110
  16. package/dist/components/table/table-header-row.d.ts.map +1 -1
  17. package/dist/components/table/table-header-row.js +170 -121
  18. package/dist/components/table/table-row.js +11 -11
  19. package/dist/components/table/table.d.ts +1 -1
  20. package/dist/components/table/table.d.ts.map +1 -1
  21. package/dist/components/table/table.js +16 -8
  22. package/dist/components/table/table.spec.d.ts +0 -1
  23. package/dist/components/table/table.spec.d.ts.map +1 -1
  24. package/dist/components/table/types.d.ts +21 -0
  25. package/dist/components/table/types.d.ts.map +1 -1
  26. package/dist/components/toggle-button/toggle-button.spec.d.ts +0 -1
  27. package/dist/components/toggle-button/toggle-button.spec.d.ts.map +1 -1
  28. package/dist/node_modules/@dnd-kit/abstract/index.js +1142 -0
  29. package/dist/node_modules/@dnd-kit/collision/dist/index.js +91 -0
  30. package/dist/node_modules/@dnd-kit/dom/index.js +1554 -0
  31. package/dist/node_modules/@dnd-kit/dom/sortable.js +631 -0
  32. package/dist/node_modules/@dnd-kit/dom/utilities.js +943 -0
  33. package/dist/node_modules/@dnd-kit/geometry/dist/index.js +200 -0
  34. package/dist/node_modules/@dnd-kit/react/hooks.js +69 -0
  35. package/dist/node_modules/@dnd-kit/react/index.js +235 -0
  36. package/dist/node_modules/@dnd-kit/react/sortable.js +129 -0
  37. package/dist/node_modules/@dnd-kit/react/utilities.js +11 -0
  38. package/dist/node_modules/@dnd-kit/state/dist/index.js +181 -0
  39. package/dist/node_modules/@preact/signals-core/dist/signals-core.module.js +265 -0
  40. package/dist/test-utils/hooks/setup-mock-resize-observer.d.ts +1 -1
  41. package/dist/test-utils/hooks/setup-mock-resize-observer.d.ts.map +1 -1
  42. package/dist/theme/theme-config/components/paginator-theme.d.ts +5 -19
  43. package/dist/theme/theme-config/components/paginator-theme.d.ts.map +1 -1
  44. package/dist/theme/theme-config/components/paginator-theme.js +34 -18
  45. package/package.json +3 -1
@@ -1,132 +1,171 @@
1
- import { jsx as $ } from "react/jsx-runtime";
2
- import { useControllableState as s } from "@chakra-ui/react";
3
- import { useReactTable as A } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
4
- import { useState as g, useCallback as o, useEffect as O } from "react";
5
- import { TableContext as ee } from "./table-context.js";
6
- import { getFilteredRowModel as te, getSortedRowModel as oe, getExpandedRowModel as le, getCoreRowModel as ne } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
7
- const ge = ({
8
- data: f,
9
- columns: T,
10
- children: V,
11
- expandedState: E,
12
- localeString: H,
13
- initialExpandedState: w = {},
14
- initialBreakingContentState: c = {},
15
- initialColumnVisibilityState: P = {},
16
- columnVisibilityState: j,
17
- onColumnVisibilityChange: k,
18
- onExpandedChange: b,
19
- getRowId: R,
20
- getRowActions: q,
21
- onBreakingContentChange: z,
22
- id: B,
23
- customRowIndication: i,
24
- onSortingChange: m,
25
- initialSortingState: D = [],
26
- sortingState: h,
27
- selectionState: G,
28
- initialSelectionState: I = [],
29
- onSelectionChange: S,
30
- selectionActions: C,
31
- disableSelectionCheckbox: r
1
+ import { jsx as ce } from "react/jsx-runtime";
2
+ import { useControllableState as d } from "@chakra-ui/react";
3
+ import { useReactTable as me } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
4
+ import { useState as b, useCallback as n, useEffect as Ce } from "react";
5
+ import { arrayMove as L } from "./helper.js";
6
+ import { TableContext as be } from "./table-context.js";
7
+ import { getFilteredRowModel as we, getSortedRowModel as he, getExpandedRowModel as Re, getCoreRowModel as ve } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
8
+ const Ee = ({
9
+ data: w,
10
+ columns: h,
11
+ children: k,
12
+ expandedState: q,
13
+ localeString: z,
14
+ initialExpandedState: R = {},
15
+ initialBreakingContentState: v = {},
16
+ initialColumnVisibilityState: A = {},
17
+ columnVisibilityState: B,
18
+ onColumnVisibilityChange: G,
19
+ onExpandedChange: M,
20
+ getRowId: S,
21
+ getRowActions: I,
22
+ onBreakingContentChange: J,
23
+ id: K,
24
+ customRowIndication: g,
25
+ onSortingChange: p,
26
+ initialSortingState: N = [],
27
+ sortingState: x,
28
+ selectionState: Q,
29
+ initialSelectionState: U = [],
30
+ onSelectionChange: y,
31
+ selectionActions: P,
32
+ disableSelectionCheckbox: u,
33
+ enableColumnReorder: V = !1,
34
+ columnOrderState: W,
35
+ initialColumnOrder: E,
36
+ onColumnOrderChange: X
32
37
  }) => {
33
- const [l, a] = s({
34
- value: E,
35
- onChange: b,
36
- defaultValue: w
37
- }), [n, M] = s({
38
- value: j,
39
- onChange: k,
40
- defaultValue: P
41
- }), [p, v] = s({
42
- value: h,
43
- onChange: m,
44
- defaultValue: D
45
- }), [J, K] = s({
46
- value: G,
47
- onChange: S,
48
- defaultValue: I
49
- }), [L, N] = g(
50
- c || {}
51
- ), [y, d] = g({}), [x, F] = g(null), Q = o((e) => (F(e), () => {
52
- F(null);
53
- }), []), U = o(() => x, [x]);
54
- O(() => {
55
- i && d(i);
56
- }, [i, d]);
57
- const W = o(
38
+ const [r, c] = d({
39
+ value: q,
40
+ onChange: M,
41
+ defaultValue: R
42
+ }), [a, F] = d({
43
+ value: B,
44
+ onChange: G,
45
+ defaultValue: A
46
+ }), [T, O] = d({
47
+ value: x,
48
+ onChange: p,
49
+ defaultValue: N
50
+ }), [Y, Z] = d({
51
+ value: Q,
52
+ onChange: y,
53
+ defaultValue: U
54
+ }), [f, s] = d({
55
+ value: W,
56
+ onChange: X,
57
+ defaultValue: E?.length ? E : h.map((e) => e.id).filter((e) => e !== void 0)
58
+ }), [_, $] = b(
59
+ v || {}
60
+ ), [H, m] = b({}), [j, D] = b(null), ee = n((e) => (D(e), () => {
61
+ D(null);
62
+ }), []), te = n(() => j, [j]);
63
+ Ce(() => {
64
+ g && m(g);
65
+ }, [g, m]);
66
+ const oe = n(
58
67
  (e) => {
59
68
  let t;
60
- typeof e == "function" ? t = e(n) : t = e, M(t);
69
+ typeof e == "function" ? t = e(a) : t = e, F(t);
61
70
  },
62
- [n, M]
63
- ), X = o(
71
+ [a, F]
72
+ ), ne = n(
64
73
  (e) => {
65
74
  let t;
66
- typeof e == "function" ? t = e(l) : t = e, a(t);
75
+ typeof e == "function" ? t = e(r) : t = e, c(t);
67
76
  },
68
- [l, a]
69
- ), Y = o(
77
+ [r, c]
78
+ ), le = n(
70
79
  (e) => {
71
- v(e);
80
+ O(e);
72
81
  },
73
- [v]
74
- ), u = A({
75
- columns: T,
76
- data: f,
77
- getCoreRowModel: ne(),
78
- getExpandedRowModel: le(),
79
- getSortedRowModel: oe(),
80
- getFilteredRowModel: te(),
81
- onColumnVisibilityChange: W,
82
- onExpandedChange: X,
82
+ [O]
83
+ ), ie = n(
84
+ (e) => {
85
+ const t = typeof e == "function" ? e(f) : e;
86
+ s(t);
87
+ },
88
+ [f, s]
89
+ ), o = me({
90
+ columns: h,
91
+ data: w,
92
+ getCoreRowModel: ve(),
93
+ getExpandedRowModel: Re(),
94
+ getSortedRowModel: he(),
95
+ getFilteredRowModel: we(),
96
+ onColumnVisibilityChange: oe,
97
+ onExpandedChange: ne,
98
+ onColumnOrderChange: ie,
83
99
  getSubRows: (e) => e.subRows,
84
- getRowId: R,
100
+ getRowId: S,
85
101
  enableSubRowSelection: !0,
86
102
  enableMultiRowSelection: !1,
87
103
  enableRowSelection: !0,
88
104
  state: {
89
- sorting: p,
90
- columnVisibility: n,
91
- expanded: l,
92
- rowSelection: y
105
+ sorting: T,
106
+ columnVisibility: a,
107
+ expanded: r,
108
+ rowSelection: H,
109
+ columnOrder: V ? f : void 0
110
+ },
111
+ manualSorting: x !== void 0
112
+ }), se = n(
113
+ (e, t) => {
114
+ if (e === t) return;
115
+ const ae = o.getColumn(e).getIsPinned(), fe = o.getColumn(t).getIsPinned();
116
+ if (ae === "left" || fe === "left") {
117
+ const i = o.getAllLeafColumns().filter((l) => l.getIsVisible()), C = i.map((l) => l.id), ge = L(
118
+ C,
119
+ C.indexOf(e),
120
+ C.indexOf(t)
121
+ ), ue = i.filter((l) => l.getIsPinned() === "left").length;
122
+ o.setColumnPinning((l) => ({
123
+ ...l,
124
+ left: ge.slice(0, ue)
125
+ }));
126
+ }
127
+ s((i) => L(i, i.indexOf(e), i.indexOf(t)));
93
128
  },
94
- manualSorting: h !== void 0
95
- }), Z = o(() => u.getRowModel().flatRows.filter((e) => !r?.(e)).map((e) => e.id), [r, u]), _ = {
96
- data: f,
97
- table: u,
98
- initialExpandedState: w,
99
- initialBreakingContentState: c,
100
- localeString: H,
101
- onExpandedChange: b,
102
- expanded: l,
103
- sorting: p,
104
- setSorting: Y,
105
- setExpanded: a,
106
- getRowId: R,
107
- getRowActions: q,
108
- breakingContentState: L,
109
- setBreakingContentState: N,
110
- onBreakingContentChange: z,
111
- id: B,
112
- setRowHighlight: d,
113
- rowHighlight: y,
114
- columnVisibility: n,
115
- onSortingChange: m,
116
- registerTableFilter: Q,
117
- getTableFilterMethods: U,
118
- canSelectRows: S !== void 0 || C !== void 0,
119
- setSelectedRowIds: K,
120
- selectedRowIds: J,
121
- selectionActions: C,
122
- disableSelectionCheckbox: r,
123
- getSelectableRowIds: Z
129
+ [s, o]
130
+ ), de = n(() => o.getRowModel().flatRows.filter((e) => !u?.(e)).map((e) => e.id), [u, o]), re = {
131
+ data: w,
132
+ table: o,
133
+ initialExpandedState: R,
134
+ initialBreakingContentState: v,
135
+ localeString: z,
136
+ onExpandedChange: M,
137
+ expanded: r,
138
+ sorting: T,
139
+ setSorting: le,
140
+ setExpanded: c,
141
+ getRowId: S,
142
+ getRowActions: I,
143
+ breakingContentState: _,
144
+ setBreakingContentState: $,
145
+ onBreakingContentChange: J,
146
+ id: K,
147
+ setRowHighlight: m,
148
+ rowHighlight: H,
149
+ columnVisibility: a,
150
+ onSortingChange: p,
151
+ registerTableFilter: ee,
152
+ getTableFilterMethods: te,
153
+ canSelectRows: y !== void 0 || P !== void 0,
154
+ setSelectedRowIds: Z,
155
+ selectedRowIds: Y,
156
+ selectionActions: P,
157
+ disableSelectionCheckbox: u,
158
+ getSelectableRowIds: de,
159
+ enableColumnReorder: V,
160
+ columnOrder: f,
161
+ setColumnOrder: s,
162
+ handleDragEnd: se
124
163
  };
125
164
  return (
126
165
  // This is correct but there's no easy way to type the context statically with generics
127
- /* @__PURE__ */ $(ee.Provider, { value: _, children: V })
166
+ /* @__PURE__ */ ce(be.Provider, { value: re, children: k })
128
167
  );
129
168
  };
130
169
  export {
131
- ge as TableProvider
170
+ Ee as TableProvider
132
171
  };
@@ -1 +1 @@
1
- {"version":3,"file":"table-header-row.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-row.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAoB/F,OAAO,KAAK,EAAmB,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEpE,KAAK,mBAAmB,CAAC,KAAK,SAAS,SAAS,IAAI;IACnD,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,uBAAuB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,QAAA,MAAM,uBAAuB,GAAI,KAAK,SAAS,SAAS,EAAE,+DAIvD,mBAAmB,CAAC,KAAK,CAAC,GAAG;IAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CAAE,4CAiD3F,CAAC;AAuPF,eAAO,MAAM,cAAc,EAAoC,OAAO,uBAAuB,CAAC"}
1
+ {"version":3,"file":"table-header-row.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-row.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AA0B/F,OAAO,KAAK,EAAmB,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEpE,KAAK,mBAAmB,CAAC,KAAK,SAAS,SAAS,IAAI;IACnD,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,uBAAuB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,QAAA,MAAM,uBAAuB,GAAI,KAAK,SAAS,SAAS,EAAE,+DAIvD,mBAAmB,CAAC,KAAK,CAAC,GAAG;IAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CAAE,4CAkD3F,CAAC;AA0TF,eAAO,MAAM,cAAc,EAAoC,OAAO,uBAAuB,CAAC"}
@@ -1,187 +1,236 @@
1
- import { jsx as e, Fragment as b, jsxs as C } from "react/jsx-runtime";
2
- import { Tr as A, Th as B, useMediaQuery as z, Portal as D } from "@chakra-ui/react";
1
+ import { jsx as t, Fragment as I, jsxs as x } from "react/jsx-runtime";
2
+ import { Tr as A, Th as k, useMediaQuery as H, Portal as P } from "@chakra-ui/react";
3
3
  import { flexRender as V } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
4
- import { memo as H, useRef as L, useCallback as R, useLayoutEffect as P, useMemo as F } from "react";
5
- import { useTableContext as f } from "./table-context.js";
6
- import { TableHeaderDropdown as O } from "./table-header-dropdown.js";
7
- import { translations as v } from "./translations.js";
8
- import { Flex as I } from "../flex/flex.js";
9
- import { Box as S } from "../box/box.js";
10
- import { Divider as N } from "../divider/divider.js";
11
- import { Menu as j } from "../menu/menu.js";
12
- import { MenuButton as E } from "../menu/menu-button.js";
13
- import { Icons as y } from "../icon/types.js";
14
- import { MenuList as $ } from "../menu/menu-list.js";
15
- import { Checkbox as W } from "../checkbox/checkbox.js";
16
- import { MenuItem as Q } from "../menu/menu-item.js";
17
- import { IconButton as X } from "../icon-button/icon-button.js";
18
- import { Button as q } from "../button/button.js";
19
- import { ThemeColorVariable as g, ThemeSpaceVariable as p, ThemeFontSizeVariable as G, ThemeFontVariable as J } from "../../theme/theme-types.js";
20
- const K = ({
21
- headerGroup: t,
4
+ import { memo as L, useRef as N, useCallback as B, useLayoutEffect as O, forwardRef as F, useMemo as $ } from "react";
5
+ import { closestCenter as j } from "../../node_modules/@dnd-kit/collision/dist/index.js";
6
+ import { SortableKeyboardPlugin as E } from "../../node_modules/@dnd-kit/dom/sortable.js";
7
+ import { useSortable as W } from "../../node_modules/@dnd-kit/react/sortable.js";
8
+ import { useTableContext as C } from "./table-context.js";
9
+ import { TableHeaderDropdown as K } from "./table-header-dropdown.js";
10
+ import { translations as T } from "./translations.js";
11
+ import { Flex as R } from "../flex/flex.js";
12
+ import { Box as b } from "../box/box.js";
13
+ import { Divider as Q } from "../divider/divider.js";
14
+ import { Menu as X } from "../menu/menu.js";
15
+ import { MenuButton as q } from "../menu/menu-button.js";
16
+ import { Icons as M } from "../icon/types.js";
17
+ import { MenuList as G } from "../menu/menu-list.js";
18
+ import { Checkbox as J } from "../checkbox/checkbox.js";
19
+ import { MenuItem as U } from "../menu/menu-item.js";
20
+ import { IconButton as Y } from "../icon-button/icon-button.js";
21
+ import { Button as Z } from "../button/button.js";
22
+ import { ThemeColorVariable as u, ThemeSpaceVariable as S, ThemeFontSizeVariable as _, ThemeFontVariable as ee } from "../../theme/theme-types.js";
23
+ const te = ({
24
+ headerGroup: n,
22
25
  hideTableHeaderDropdown: o,
23
26
  portalContainerRef: s
24
27
  }) => {
25
- const i = f(), c = !!i.getRowActions, l = (i.selectedRowIds?.length ?? 0) > 0 && (i.selectionActions?.length ?? 0) > 0;
26
- return /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(A, { children: l ? /* @__PURE__ */ e(
27
- B,
28
+ const i = C(), a = !!i.getRowActions, c = (i.selectedRowIds?.length ?? 0) > 0 && (i.selectionActions?.length ?? 0) > 0;
29
+ return /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(A, { children: c ? /* @__PURE__ */ t(
30
+ k,
28
31
  {
29
- colSpan: t.headers.length,
32
+ colSpan: n.headers.length,
30
33
  sx: {
31
34
  cursor: "default",
32
35
  "& div:hover": {
33
36
  backgroundColor: "transparent !important"
34
37
  },
35
38
  "div span": {
36
- color: g.OnBackground
39
+ color: u.OnBackground
37
40
  }
38
41
  },
39
42
  zIndex: 1,
40
43
  style: {
41
- borderBottom: `1px solid ${g.OnBackgroundBorder}`,
42
- paddingLeft: c ? "24px" : void 0
44
+ borderBottom: `1px solid ${u.OnBackgroundBorder}`,
45
+ paddingLeft: a ? "24px" : void 0
43
46
  },
44
- children: /* @__PURE__ */ e(M, { showSelectAll: !0, children: /* @__PURE__ */ e(Z, {}) })
47
+ children: /* @__PURE__ */ t(z, { showSelectAll: !0, children: /* @__PURE__ */ t(le, {}) })
45
48
  }
46
- ) : /* @__PURE__ */ e(b, { children: t.headers.map((n) => /* @__PURE__ */ e(
47
- U,
49
+ ) : /* @__PURE__ */ t(I, { children: n.headers.map((r, e) => /* @__PURE__ */ t(
50
+ ne,
48
51
  {
49
- header: n,
52
+ header: r,
50
53
  hideTableHeaderDropdown: o,
51
- applyActionMenuPadding: c,
54
+ applyActionMenuPadding: a,
52
55
  portalContainerRef: s,
53
- isFirstColumn: n.column.getIndex() === 0
56
+ isFirstColumn: !r.isPlaceholder && e === 0,
57
+ enableColumnReorder: i.enableColumnReorder
54
58
  },
55
- n.id
56
- )) }) }, t.id) });
57
- }, U = ({
58
- header: t,
59
+ r.id
60
+ )) }) }, n.id) });
61
+ }, ne = ({
62
+ header: n,
59
63
  hideTableHeaderDropdown: o,
60
64
  applyActionMenuPadding: s,
61
65
  portalContainerRef: i,
62
- isFirstColumn: c = !1
66
+ isFirstColumn: a = !1,
67
+ enableColumnReorder: c = !1
63
68
  }) => {
64
- const l = L(null), n = f(), { column: r } = t, m = R((d) => {
65
- const a = d.getIsPinned(), u = d.getSize();
69
+ const r = N(null), e = C(), { column: l } = n, g = B((d) => {
70
+ const h = d.getIsPinned(), p = d.getSize();
66
71
  return {
67
- position: a ? "sticky" : "relative",
68
- left: a ? `${d.getStart("left")}px` : void 0,
69
- backgroundColor: a ? g.Background : void 0,
70
- zIndex: a ? 1 : 0,
71
- width: u,
72
- maxWidth: u
72
+ position: h ? "sticky" : "relative",
73
+ left: h ? `${d.getStart("left")}px` : void 0,
74
+ backgroundColor: h ? u.Background : void 0,
75
+ zIndex: h ? 1 : 0,
76
+ width: p,
77
+ maxWidth: p
73
78
  };
74
79
  }, []);
75
- return P(() => {
76
- const d = l.current;
80
+ O(() => {
81
+ const d = r.current;
77
82
  if (!d) return;
78
- const a = r.id, u = (h) => {
79
- h > 0 && n.table.getState().columnSizing[a] !== h && n.table.setColumnSizing((w) => ({ ...w, [a]: h }));
80
- }, k = new ResizeObserver((h) => {
81
- const w = h[0];
83
+ const h = l.id, p = (f) => {
84
+ f > 0 && e.table.getState().columnSizing[h] !== f && e.table.setColumnSizing((w) => ({ ...w, [h]: f }));
85
+ }, v = new ResizeObserver((f) => {
86
+ const w = f[0];
82
87
  if (!w) return;
83
- const T = w.borderBoxSize?.[0]?.inlineSize ?? d.getBoundingClientRect().width;
84
- u(T);
88
+ const D = w.borderBoxSize?.[0]?.inlineSize ?? d.getBoundingClientRect().width;
89
+ p(D);
85
90
  });
86
- return k.observe(d), u(d.getBoundingClientRect().width), () => k.disconnect();
87
- }, []), /* @__PURE__ */ e(
88
- B,
91
+ return v.observe(d), p(d.getBoundingClientRect().width), () => v.disconnect();
92
+ }, []);
93
+ const m = /* @__PURE__ */ t(z, { showSelectAll: e.canSelectRows && a, children: /* @__PURE__ */ t(I, { children: o ? /* @__PURE__ */ t(b, { paddingLeft: S.Small, children: V(n.column.columnDef.header, n.getContext()) }) : /* @__PURE__ */ t(
94
+ K,
95
+ {
96
+ header: n,
97
+ breakingContentState: e.breakingContentState,
98
+ columnVisibility: e.columnVisibility,
99
+ headerGroup: e.table.getHeaderGroups(),
100
+ localeString: e.localeString,
101
+ setBreakingContentState: e.setBreakingContentState,
102
+ setSorting: e.setSorting,
103
+ sorting: e.sorting,
104
+ onBreakingContentChange: e.onBreakingContentChange,
105
+ portalContainerRef: i
106
+ }
107
+ ) }) });
108
+ return c ? /* @__PURE__ */ t(
109
+ oe,
110
+ {
111
+ ref: r,
112
+ columnId: l.id,
113
+ columnIndex: l.getIndex(),
114
+ disableColumnReorder: l.columnDef.meta?.disableColumnReorder,
115
+ isNumeric: l.columnDef.meta?.isNumeric,
116
+ zIndex: l.getIsPinned() ? 2 : 1,
117
+ style: {
118
+ ...g(l),
119
+ borderBottom: `1px solid ${u.OnBackgroundBorder}`,
120
+ paddingLeft: a && s ? "24px" : void 0
121
+ },
122
+ children: m
123
+ }
124
+ ) : /* @__PURE__ */ t(
125
+ k,
89
126
  {
90
- ref: l,
127
+ ref: r,
91
128
  className: "tableHeaderCell",
92
- isNumeric: r.columnDef.meta?.isNumeric,
93
- zIndex: r.getIsPinned() ? 2 : 1,
129
+ isNumeric: l.columnDef.meta?.isNumeric,
130
+ zIndex: l.getIsPinned() ? 2 : 1,
94
131
  style: {
95
- ...m(r),
96
- borderBottom: `1px solid ${g.OnBackgroundBorder}`,
97
- paddingLeft: c && s ? "24px" : void 0
132
+ ...g(l),
133
+ borderBottom: `1px solid ${u.OnBackgroundBorder}`,
134
+ paddingLeft: a && s ? "24px" : void 0
98
135
  },
99
- children: /* @__PURE__ */ e(M, { showSelectAll: n.canSelectRows && c, children: /* @__PURE__ */ e(b, { children: o ? /* @__PURE__ */ e(S, { paddingLeft: p.Small, children: V(t.column.columnDef.header, t.getContext()) }) : /* @__PURE__ */ e(
100
- O,
101
- {
102
- header: t,
103
- breakingContentState: n.breakingContentState,
104
- columnVisibility: n.columnVisibility,
105
- headerGroup: n.table.getHeaderGroups(),
106
- localeString: n.localeString,
107
- setBreakingContentState: n.setBreakingContentState,
108
- setSorting: n.setSorting,
109
- sorting: n.sorting,
110
- onBreakingContentChange: n.onBreakingContentChange,
111
- portalContainerRef: i
112
- }
113
- ) }) })
136
+ children: m
137
+ }
138
+ );
139
+ }, oe = F(({ columnId: n, columnIndex: o, isNumeric: s, disableColumnReorder: i, zIndex: a, style: c, children: r }, e) => {
140
+ const { ref: l, isDragging: g, isDropTarget: m } = W({
141
+ id: n,
142
+ index: o,
143
+ disabled: i,
144
+ collisionDetector: j,
145
+ plugins: [E]
146
+ });
147
+ return /* @__PURE__ */ t(
148
+ k,
149
+ {
150
+ ref: (d) => {
151
+ l(d), typeof e == "function" ? e(d) : e && (e.current = d);
152
+ },
153
+ className: "tableHeaderCell",
154
+ isNumeric: s,
155
+ zIndex: a,
156
+ style: {
157
+ ...c,
158
+ cursor: g ? "grabbing" : "pointer",
159
+ opacity: g ? 0.5 : 1,
160
+ backgroundColor: m ? u.Background : void 0
161
+ },
162
+ children: r
114
163
  }
115
164
  );
116
- }, M = ({ showSelectAll: t, children: o }) => t ? /* @__PURE__ */ C(I, { w: "100%", align: "center", children: [
117
- /* @__PURE__ */ e(S, { justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Y, {}) }),
165
+ }), z = ({ showSelectAll: n, children: o }) => n ? /* @__PURE__ */ x(R, { w: "100%", align: "center", children: [
166
+ /* @__PURE__ */ t(b, { justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ t(re, {}) }),
118
167
  o
119
- ] }) : /* @__PURE__ */ e(b, { children: o }), Y = () => {
120
- const t = f(), o = R(
121
- (c) => {
122
- const l = c.target.checked, n = t.getSelectableRowIds();
123
- l ? t.setSelectedRowIds((r) => [.../* @__PURE__ */ new Set([...r, ...n])]) : t.setSelectedRowIds((r) => r.filter((m) => !n.includes(m)));
168
+ ] }) : /* @__PURE__ */ t(I, { children: o }), re = () => {
169
+ const n = C(), o = B(
170
+ (a) => {
171
+ const c = a.target.checked, r = n.getSelectableRowIds();
172
+ c ? n.setSelectedRowIds((e) => [.../* @__PURE__ */ new Set([...e, ...r])]) : n.setSelectedRowIds((e) => e.filter((l) => !r.includes(l)));
124
173
  },
125
- [t]
126
- ), { allIsSelected: s, shouldShowIndeterminateState: i } = F(() => {
127
- const l = t.table.getRowModel().flatRows, n = new Set(t.selectedRowIds), r = t.getSelectableRowIds(), m = r.length > 0 && r.every((a) => n.has(a)), d = l.some((a) => n.has(a.id));
174
+ [n]
175
+ ), { allIsSelected: s, shouldShowIndeterminateState: i } = $(() => {
176
+ const c = n.table.getRowModel().flatRows, r = new Set(n.selectedRowIds), e = n.getSelectableRowIds(), l = e.length > 0 && e.every((m) => r.has(m)), g = c.some((m) => r.has(m.id));
128
177
  return {
129
- allIsSelected: m,
130
- shouldShowIndeterminateState: d && !m
178
+ allIsSelected: l,
179
+ shouldShowIndeterminateState: g && !l
131
180
  };
132
- }, [t]);
133
- return /* @__PURE__ */ e(
134
- W,
181
+ }, [n]);
182
+ return /* @__PURE__ */ t(
183
+ J,
135
184
  {
136
185
  isChecked: s,
137
186
  isIndeterminate: i,
138
187
  onChange: o
139
188
  }
140
189
  );
141
- }, Z = () => {
142
- const { localeString: t, selectedRowIds: o = [], selectionActions: s = [] } = f(), i = v[t], [c] = z("(min-width: 48em)"), l = s.length > 3 || !c, n = o.length === 1 ? i.selectedSingular.replace("{count}", "1") : i.selected.replace("{count}", o.length.toString());
143
- return /* @__PURE__ */ C(
144
- I,
190
+ }, le = () => {
191
+ const { localeString: n, selectedRowIds: o = [], selectionActions: s = [] } = C(), i = T[n], [a] = H("(min-width: 48em)"), c = s.length > 3 || !a, r = o.length === 1 ? i.selectedSingular.replace("{count}", "1") : i.selected.replace("{count}", o.length.toString());
192
+ return /* @__PURE__ */ x(
193
+ R,
145
194
  {
146
- gap: p.Medium,
195
+ gap: S.Medium,
147
196
  align: "center",
148
197
  alignContent: "center",
149
- marginBottom: p.XSmall,
198
+ marginBottom: S.XSmall,
150
199
  children: [
151
- /* @__PURE__ */ e(
152
- S,
200
+ /* @__PURE__ */ t(
201
+ b,
153
202
  {
154
- pl: p.Small,
155
- color: g.OnBackground,
156
- fontFamily: J.Body,
157
- fontSize: G.Medium,
203
+ pl: S.Small,
204
+ color: u.OnBackground,
205
+ fontFamily: ee.Body,
206
+ fontSize: _.Medium,
158
207
  whiteSpace: "nowrap",
159
208
  style: { fontVariantNumeric: "normal" },
160
- children: n
209
+ children: r
161
210
  }
162
211
  ),
163
- /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(N, { orientation: "vertical", height: "20px" }) }),
164
- /* @__PURE__ */ e(I, { gap: p.Small, align: "center", children: l ? /* @__PURE__ */ C(j, { children: [
165
- /* @__PURE__ */ e(E, { variant: "ghost", rightIcon: y.TreeViewCollapse, children: i.action }),
166
- /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e($, { children: s.map((r) => /* @__PURE__ */ e(x, { isMenuItem: !0, action: r }, r.name)) }) })
167
- ] }) : s.map((r) => /* @__PURE__ */ e(x, { isMenuItem: !1, action: r }, r.name)) })
212
+ /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t(Q, { orientation: "vertical", height: "20px" }) }),
213
+ /* @__PURE__ */ t(R, { gap: S.Small, align: "center", children: c ? /* @__PURE__ */ x(X, { children: [
214
+ /* @__PURE__ */ t(q, { variant: "ghost", rightIcon: M.TreeViewCollapse, children: i.action }),
215
+ /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(G, { children: s.map((e) => /* @__PURE__ */ t(y, { isMenuItem: !0, action: e }, e.name)) }) })
216
+ ] }) : s.map((e) => /* @__PURE__ */ t(y, { isMenuItem: !1, action: e }, e.name)) })
168
217
  ]
169
218
  }
170
219
  );
171
- }, x = ({ isMenuItem: t, action: o }) => {
172
- const { selectedRowIds: s, localeString: i } = f(), c = v[i], l = R(() => {
220
+ }, y = ({ isMenuItem: n, action: o }) => {
221
+ const { selectedRowIds: s, localeString: i } = C(), a = T[i], c = B(() => {
173
222
  o.onClick(s || []);
174
223
  }, [o, s]);
175
- return t ? /* @__PURE__ */ e(Q, { onClick: l, children: o.variant === "delete" ? /* @__PURE__ */ e(S, { as: "span", color: g.Error, children: o.name }) : o.name }) : o.variant === "delete" ? /* @__PURE__ */ e(
176
- X,
224
+ return n ? /* @__PURE__ */ t(U, { onClick: c, children: o.variant === "delete" ? /* @__PURE__ */ t(b, { as: "span", color: u.Error, children: o.name }) : o.name }) : o.variant === "delete" ? /* @__PURE__ */ t(
225
+ Y,
177
226
  {
178
- onClick: l,
179
- icon: y.Delete,
180
- "aria-label": c.deleteSelectedRows,
227
+ onClick: c,
228
+ icon: M.Delete,
229
+ "aria-label": a.deleteSelectedRows,
181
230
  variant: "ghost"
182
231
  }
183
- ) : /* @__PURE__ */ e(q, { onClick: l, variant: "ghost", children: o.name });
184
- }, we = H(K);
232
+ ) : /* @__PURE__ */ t(Z, { onClick: c, variant: "ghost", children: o.name });
233
+ }, Te = L(te);
185
234
  export {
186
- we as TableHeaderRow
235
+ Te as TableHeaderRow
187
236
  };