@caspeco/casper-ui-library 10.7.3 → 10.9.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 (63) hide show
  1. package/README.md +1 -0
  2. package/dist/components/rich-text-editor/boolean-control.js +1 -1
  3. package/dist/components/rich-text-editor/rich-text-editor-control.js +1 -1
  4. package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
  5. package/dist/components/rich-text-editor/use-rich-text-editor.js +1 -1
  6. package/dist/components/table/helper.d.ts +3 -0
  7. package/dist/components/table/helper.d.ts.map +1 -1
  8. package/dist/components/table/helper.js +17 -11
  9. package/dist/components/table/index.d.ts +1 -1
  10. package/dist/components/table/index.d.ts.map +1 -1
  11. package/dist/components/table/table-cell.d.ts +2 -1
  12. package/dist/components/table/table-cell.d.ts.map +1 -1
  13. package/dist/components/table/table-cell.js +62 -55
  14. package/dist/components/table/table-content.d.ts.map +1 -1
  15. package/dist/components/table/table-content.js +84 -56
  16. package/dist/components/table/table-context-provider.d.ts +17 -2
  17. package/dist/components/table/table-context-provider.d.ts.map +1 -1
  18. package/dist/components/table/table-context-provider.js +179 -122
  19. package/dist/components/table/table-drag-accessibility.d.ts +11 -0
  20. package/dist/components/table/table-drag-accessibility.d.ts.map +1 -0
  21. package/dist/components/table/table-drag-accessibility.js +22 -0
  22. package/dist/components/table/table-header-dropdown.d.ts +3 -5
  23. package/dist/components/table/table-header-dropdown.d.ts.map +1 -1
  24. package/dist/components/table/table-header-dropdown.js +116 -108
  25. package/dist/components/table/table-header-dropdown.spec.d.ts +2 -0
  26. package/dist/components/table/table-header-dropdown.spec.d.ts.map +1 -0
  27. package/dist/components/table/table-header-row.d.ts.map +1 -1
  28. package/dist/components/table/table-header-row.js +70 -63
  29. package/dist/components/table/table-recipe.d.ts.map +1 -1
  30. package/dist/components/table/table-recipe.js +6 -0
  31. package/dist/components/table/table-row-drag-handle.d.ts +6 -0
  32. package/dist/components/table/table-row-drag-handle.d.ts.map +1 -0
  33. package/dist/components/table/table-row-drag-handle.js +53 -0
  34. package/dist/components/table/table-row-reorder.spec.d.ts +2 -0
  35. package/dist/components/table/table-row-reorder.spec.d.ts.map +1 -0
  36. package/dist/components/table/table-row.d.ts.map +1 -1
  37. package/dist/components/table/table-row.js +59 -42
  38. package/dist/components/table/table-sorted-reorder-prompt.d.ts +8 -0
  39. package/dist/components/table/table-sorted-reorder-prompt.d.ts.map +1 -0
  40. package/dist/components/table/table-sorted-reorder-prompt.js +64 -0
  41. package/dist/components/table/table-toolbar-settings.js +27 -27
  42. package/dist/components/table/table.composition.d.ts +2 -0
  43. package/dist/components/table/table.composition.d.ts.map +1 -1
  44. package/dist/components/table/table.constants.d.ts +15 -0
  45. package/dist/components/table/table.constants.d.ts.map +1 -1
  46. package/dist/components/table/table.constants.js +2 -2
  47. package/dist/components/table/table.d.ts +1 -1
  48. package/dist/components/table/table.d.ts.map +1 -1
  49. package/dist/components/table/table.js +4 -2
  50. package/dist/components/table/translations.d.ts +77 -0
  51. package/dist/components/table/translations.d.ts.map +1 -1
  52. package/dist/components/table/translations.js +72 -6
  53. package/dist/components/table/types.d.ts +37 -5
  54. package/dist/components/table/types.d.ts.map +1 -1
  55. package/dist/node_modules/@tiptap/core/dist/index.js +725 -951
  56. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +37 -13
  57. package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +11 -0
  58. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +1 -3
  59. package/dist/node_modules/@tiptap/extension-list/dist/index.js +101 -128
  60. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +3 -2
  61. package/dist/node_modules/@tiptap/extensions/dist/index.js +6 -7
  62. package/dist/{node_modules → packages/casper-ui-library/node_modules}/@tiptap/react/dist/index.js +24 -24
  63. package/package.json +10 -9
@@ -1,131 +1,139 @@
1
1
  "use no memo";
2
2
  import { ThemeColorVariable as e, ThemeFontSizeVariable as t, ThemeIconSizeVariable as n, ThemeSpaceVariable as r } from "../../theme/theme-types.js";
3
- import { FilterIcon as i } from "../icon/icons/filter-icon.js";
4
- import { HideIcon as a } from "../icon/icons/hide-icon.js";
5
- import { SortAscIcon as o } from "../icon/icons/sort-asc-icon.js";
6
- import { SortDescIcon as s } from "../icon/icons/sort-desc-icon.js";
7
- import { ThumbtackIcon as c } from "../icon/icons/thumbtack-icon.js";
8
- import { Text as l } from "../text/text.js";
9
- import { Box as u } from "../box/box.js";
10
- import { Menu as d } from "../menu/menu.js";
11
- import { MenuBoxButton as f } from "../menu/menu-box-button.js";
12
- import { MenuDivider as p } from "../menu/menu-divider.js";
13
- import { MenuItem as m } from "../menu/menu-item.js";
14
- import { MenuList as h } from "../menu/menu-list.js";
15
- import { Switch as g } from "../switch/switch.js";
16
- import { flexRender as _ } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
17
- import { useTableContext as v } from "./table-context.js";
18
- import { translations as y } from "./translations.js";
19
- import { memo as b, useCallback as x, useMemo as S } from "react";
20
- import { Portal as C } from "@chakra-ui/react";
21
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
22
- var D = b(({ header: b, breakingContentState: D, onBreakingContentChange: O, setBreakingContentState: k, headerGroup: A, sorting: j, setSorting: M, localeString: N, portalContainerRef: P, dragRef: F }) => {
23
- let I = y[N], { getTableFilterMethods: L } = v(), R = x(({ checked: e }) => {
24
- let t = {
25
- ...D,
26
- [b.column.id]: e
3
+ import { CloseIcon as i } from "../icon/icons/close-icon.js";
4
+ import { FilterIcon as a } from "../icon/icons/filter-icon.js";
5
+ import { HideIcon as o } from "../icon/icons/hide-icon.js";
6
+ import { SortAscIcon as s } from "../icon/icons/sort-asc-icon.js";
7
+ import { SortDescIcon as c } from "../icon/icons/sort-desc-icon.js";
8
+ import { ThumbtackIcon as l } from "../icon/icons/thumbtack-icon.js";
9
+ import { Text as u } from "../text/text.js";
10
+ import { Box as d } from "../box/box.js";
11
+ import { Menu as f } from "../menu/menu.js";
12
+ import { MenuBoxButton as p } from "../menu/menu-box-button.js";
13
+ import { MenuDivider as m } from "../menu/menu-divider.js";
14
+ import { MenuItem as h } from "../menu/menu-item.js";
15
+ import { MenuList as g } from "../menu/menu-list.js";
16
+ import { Switch as _ } from "../switch/switch.js";
17
+ import { flexRender as v } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
18
+ import { useTableContext as y } from "./table-context.js";
19
+ import { translations as b } from "./translations.js";
20
+ import { memo as x, useCallback as S, useMemo as C } from "react";
21
+ import { Portal as w } from "@chakra-ui/react";
22
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
23
+ //#region lib/components/table/table-header-dropdown.tsx
24
+ var O = ({ portalContainerRef: i, dragRef: a, ...o }) => {
25
+ let { header: l, sorting: u } = o, m = C(() => {
26
+ let e = u.find((e) => e.id === l.column.id);
27
+ return /* @__PURE__ */ D(T, { children: [e && (e.desc ? /* @__PURE__ */ E(c, { size: n.XSmall }) : /* @__PURE__ */ E(s, { size: n.XSmall })), /* @__PURE__ */ E(d, {
28
+ minW: 0,
29
+ overflowWrap: "break-word",
30
+ children: v(l.column.columnDef.header, l.getContext())
31
+ })] });
32
+ }, [l, u]);
33
+ return /* @__PURE__ */ E(f, {
34
+ isLazy: !0,
35
+ children: ({ isOpen: n }) => /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(p, {
36
+ ref: a,
37
+ color: e.OnBackgroundSubdued,
38
+ textTransform: "none",
39
+ fontSize: t.Small,
40
+ h: "40px",
41
+ display: "flex",
42
+ textAlign: "inherit",
43
+ alignItems: "center",
44
+ lineHeight: "1.2",
45
+ padding: `0px 0px 0px ${r.Small}`,
46
+ backgroundColor: n ? e.BackgroundDisabled : "unset",
47
+ w: "100%",
48
+ children: v(m, l.getContext())
49
+ }), /* @__PURE__ */ E(w, {
50
+ container: i,
51
+ children: /* @__PURE__ */ E(g, {
52
+ fontSize: t.Medium,
53
+ children: /* @__PURE__ */ E(k, { ...o })
54
+ })
55
+ })] })
56
+ });
57
+ }, k = ({ header: e, breakingContentState: t, onBreakingContentChange: n, setBreakingContentState: r, headerGroup: d, sorting: f, setSorting: p, localeString: g }) => {
58
+ let v = b[g], { getTableFilterMethods: x } = y(), w = S(({ checked: i }) => {
59
+ let a = {
60
+ ...t,
61
+ [e.column.id]: i
27
62
  };
28
- k(t), O?.(t);
63
+ r(a), n?.(a);
29
64
  }, [
30
- D,
31
- b.column.id,
32
- O,
33
- k
34
- ]), z = x((e) => {
65
+ t,
66
+ e.column.id,
67
+ n,
68
+ r
69
+ ]), O = S((e) => {
35
70
  let t = e.getIndex();
36
- A.forEach((n) => {
71
+ d.forEach((n) => {
37
72
  n.headers.forEach((n, r) => {
38
73
  let { column: i } = n;
39
74
  e.getIsPinned() ? r >= t && i.pin(!1) : r <= t && i.pin("left");
40
75
  });
41
76
  });
42
- }, [A]), B = S(() => /* @__PURE__ */ E(w, { children: [j.find((e) => e.id === b.column.id) && (j.find((e) => e.desc) ? /* @__PURE__ */ T(s, { size: n.XSmall }) : /* @__PURE__ */ T(o, { size: n.XSmall })), /* @__PURE__ */ T(u, {
43
- minW: 0,
44
- overflowWrap: "break-word",
45
- children: _(b.column.columnDef.header, b.getContext())
46
- })] }), [b, j]), V = S(() => L()?.canFilterOnColumn(b.column.id) ?? !1, [b.column.id, L]), H = S(() => /* @__PURE__ */ E(w, { children: [
47
- b.column.getCanSort() && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(m, {
48
- onClick: () => M([{
49
- desc: !1,
50
- id: b.column.id
51
- }]),
52
- leftIcon: o,
53
- value: "sort-asc",
54
- children: /* @__PURE__ */ T(l, { children: I.sortUp })
55
- }), /* @__PURE__ */ T(m, {
56
- onClick: () => M([{
57
- desc: !0,
58
- id: b.column.id
59
- }]),
60
- leftIcon: s,
61
- value: "sort-desc",
62
- children: /* @__PURE__ */ T(l, { children: I.sortDown })
63
- })] }),
64
- V && /* @__PURE__ */ T(m, {
77
+ }, [d]), k = C(() => x()?.canFilterOnColumn(e.column.id) ?? !1, [e.column.id, x]);
78
+ return /* @__PURE__ */ D(T, { children: [
79
+ e.column.getCanSort() && /* @__PURE__ */ D(T, { children: [
80
+ /* @__PURE__ */ E(h, {
81
+ onClick: () => p([{
82
+ desc: !1,
83
+ id: e.column.id
84
+ }]),
85
+ leftIcon: s,
86
+ value: "sort-asc",
87
+ children: /* @__PURE__ */ E(u, { children: v.sortUp })
88
+ }),
89
+ /* @__PURE__ */ E(h, {
90
+ onClick: () => p([{
91
+ desc: !0,
92
+ id: e.column.id
93
+ }]),
94
+ leftIcon: c,
95
+ value: "sort-desc",
96
+ children: /* @__PURE__ */ E(u, { children: v.sortDown })
97
+ }),
98
+ f.some((t) => t.id === e.column.id) && /* @__PURE__ */ E(h, {
99
+ onClick: () => p(f.filter((t) => t.id !== e.column.id)),
100
+ leftIcon: i,
101
+ value: "clear-sorting",
102
+ children: /* @__PURE__ */ E(u, { children: v.clearSorting })
103
+ })
104
+ ] }),
105
+ k && /* @__PURE__ */ E(h, {
65
106
  onClick: () => {
66
- let e = L();
67
- e?.onToggleFilterVisibility && e.onToggleFilterVisibility(b.column.id);
107
+ let t = x();
108
+ t?.onToggleFilterVisibility && t.onToggleFilterVisibility(e.column.id);
68
109
  },
69
- leftIcon: i,
110
+ leftIcon: a,
70
111
  value: "filter",
71
- children: /* @__PURE__ */ T(l, { children: I.filter })
112
+ children: /* @__PURE__ */ E(u, { children: v.filter })
72
113
  }),
73
- (b.column.getCanSort() || V) && /* @__PURE__ */ T(p, {}),
74
- b.column.getCanHide() && /* @__PURE__ */ T(m, {
75
- onClick: b.column.getToggleVisibilityHandler(),
76
- leftIcon: a,
114
+ (e.column.getCanSort() || k) && /* @__PURE__ */ E(m, {}),
115
+ e.column.getCanHide() && /* @__PURE__ */ E(h, {
116
+ onClick: e.column.getToggleVisibilityHandler(),
117
+ leftIcon: o,
77
118
  value: "hide",
78
- children: /* @__PURE__ */ T(l, { children: I.hideColumn })
119
+ children: /* @__PURE__ */ E(u, { children: v.hideColumn })
79
120
  }),
80
- /* @__PURE__ */ T(m, {
81
- onClick: () => z(b.column),
82
- leftIcon: c,
121
+ /* @__PURE__ */ E(h, {
122
+ onClick: () => O(e.column),
123
+ leftIcon: l,
83
124
  value: "pin",
84
- children: /* @__PURE__ */ T(l, { children: b.column.getIsPinned() ? I.stopPinningColumn : I.pinUpToColumn })
125
+ children: /* @__PURE__ */ E(u, { children: e.column.getIsPinned() ? v.stopPinningColumn : v.pinUpToColumn })
85
126
  }),
86
- /* @__PURE__ */ T(p, {}),
87
- /* @__PURE__ */ E(m, {
127
+ /* @__PURE__ */ E(m, {}),
128
+ /* @__PURE__ */ D(h, {
88
129
  itemType: "switch",
89
130
  value: "breaking-content",
90
- children: [I.breakingContent, /* @__PURE__ */ T(g, {
91
- onCheckedChange: R,
92
- isChecked: D[b.column.id]
131
+ children: [v.breakingContent, /* @__PURE__ */ E(_, {
132
+ onCheckedChange: w,
133
+ isChecked: t[e.column.id]
93
134
  })]
94
135
  })
95
- ] }), [
96
- D,
97
- V,
98
- L,
99
- z,
100
- b.column,
101
- R,
102
- M,
103
- I
104
- ]);
105
- return /* @__PURE__ */ T(d, {
106
- isLazy: !0,
107
- children: ({ isOpen: n }) => /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(f, {
108
- ref: F,
109
- color: e.OnBackgroundSubdued,
110
- textTransform: "none",
111
- fontSize: t.Small,
112
- h: "40px",
113
- display: "flex",
114
- textAlign: "inherit",
115
- alignItems: "center",
116
- lineHeight: "1.2",
117
- padding: `0px 0px 0px ${r.Small}`,
118
- backgroundColor: n ? e.BackgroundDisabled : "unset",
119
- w: "100%",
120
- children: _(B, b.getContext())
121
- }), /* @__PURE__ */ T(C, {
122
- container: P,
123
- children: /* @__PURE__ */ T(h, {
124
- fontSize: t.Medium,
125
- children: H
126
- })
127
- })] })
128
- });
129
- });
136
+ ] });
137
+ }, A = x(O);
130
138
  //#endregion
131
- export { D as TableHeaderDropdown };
139
+ export { A as TableHeaderDropdown };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=table-header-dropdown.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-header-dropdown.spec.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-dropdown.spec.tsx"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"table-header-row.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-row.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAO/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,gCAmD3F,CAAC;AAiQF,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":"AAgBA,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAQ/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;AAMF,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,gCAwD3F,CAAC;AAoQF,eAAO,MAAM,cAAc,EAAoC,OAAO,uBAAuB,CAAC"}
@@ -12,65 +12,73 @@ import { MenuList as f } from "../menu/menu-list.js";
12
12
  import { Checkbox as p } from "../checkbox/checkbox.js";
13
13
  import { Divider as m } from "../divider/divider.js";
14
14
  import { flexRender as h } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
15
- import { getColumnWidth as g, getPinnedLeft as _ } from "./helper.js";
16
- import { useTableContext as v } from "./table-context.js";
17
- import { closestCenter as y } from "../../node_modules/@dnd-kit/collision/dist/index.js";
18
- import { SortableKeyboardPlugin as b } from "../../node_modules/@dnd-kit/dom/sortable.js";
19
- import { useSortable as x } from "../../node_modules/@dnd-kit/react/sortable.js";
20
- import { interpolate as S, translations as C } from "./translations.js";
21
- import { ColumnResizeHandle as w } from "./table-column-resize-handle.js";
22
- import { TableHeaderDropdown as T } from "./table-header-dropdown.js";
23
- import { memo as E, useCallback as D, useMemo as O } from "react";
24
- import { Box as k, Portal as A, Table as j, useMediaQuery as M } from "@chakra-ui/react";
25
- import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
15
+ import { COLUMN_SORTABLE_TYPE as g } from "./table.constants.js";
16
+ import { getColumnWidth as _, getPinnedLeft as v } from "./helper.js";
17
+ import { useTableContext as y } from "./table-context.js";
18
+ import { interpolate as b, translations as x } from "./translations.js";
19
+ import { closestCenter as S } from "../../node_modules/@dnd-kit/collision/dist/index.js";
20
+ import { SortableKeyboardPlugin as C } from "../../node_modules/@dnd-kit/dom/sortable.js";
21
+ import { useSortable as w } from "../../node_modules/@dnd-kit/react/sortable.js";
22
+ import { ColumnResizeHandle as T } from "./table-column-resize-handle.js";
23
+ import { TableHeaderDropdown as E } from "./table-header-dropdown.js";
24
+ import { memo as D, useCallback as O, useMemo as k } from "react";
25
+ import { Box as A, Portal as j, Table as M, useMediaQuery as N } from "@chakra-ui/react";
26
+ import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
26
27
  //#region lib/components/table/table-header-row.tsx
27
- var I = ({ headerGroup: t, hideTableHeaderDropdown: n, portalContainerRef: r }) => {
28
- let i = v(), a = !!i.getRowActions, o = (i.selectedRowIds?.length ?? 0) > 0 && (i.selectionActions?.length ?? 0) > 0, s = +!!i.enableColumnResizing;
29
- return /* @__PURE__ */ P(N, { children: /* @__PURE__ */ P(j.Row, { children: o ? /* @__PURE__ */ P(j.ColumnHeader, {
30
- colSpan: t.headers.length + s,
28
+ function L(e, t) {
29
+ return (e ? 24 : 0) + (t ? 24 : 0);
30
+ }
31
+ var R = ({ headerGroup: t, hideTableHeaderDropdown: n, portalContainerRef: r }) => {
32
+ let i = y(), a = !!i.getRowActions, o = L(a, i.rowReorderMode !== "off"), s = (i.selectedRowIds?.length ?? 0) > 0 && (i.selectionActions?.length ?? 0) > 0, c = +!!i.enableColumnResizing;
33
+ return /* @__PURE__ */ F(P, { children: /* @__PURE__ */ F(M.Row, { children: s ? /* @__PURE__ */ F(M.ColumnHeader, {
34
+ colSpan: t.headers.length + c,
31
35
  cursor: "default",
32
36
  css: {
33
37
  "& div:not(label *):hover": { backgroundColor: "transparent !important" },
34
38
  "& div span": { color: e.OnBackground },
35
39
  borderBottom: `1px solid ${e.OnBackgroundBorder}`,
36
- paddingLeft: a ? "24px" : void 0
40
+ paddingLeft: o ? `${o}px` : void 0
37
41
  },
38
42
  scope: "col",
39
43
  zIndex: 1,
40
- children: /* @__PURE__ */ P(z, {
44
+ children: /* @__PURE__ */ F(V, {
41
45
  showSelectAll: !0,
42
- children: /* @__PURE__ */ P(V, {})
46
+ children: /* @__PURE__ */ F(U, {})
43
47
  })
44
- }) : /* @__PURE__ */ F(N, { children: [t.headers.map((e, t) => /* @__PURE__ */ P(L, {
48
+ }) : /* @__PURE__ */ I(P, { children: [t.headers.map((e, t) => /* @__PURE__ */ F(z, {
45
49
  header: e,
46
50
  hideTableHeaderDropdown: n,
47
51
  applyActionMenuPadding: a,
48
52
  portalContainerRef: r,
49
53
  isFirstColumn: !e.isPlaceholder && t === 0,
54
+ leadingSlotsWidth: o,
50
55
  enableColumnReorder: i.enableColumnReorder
51
- }, e.id)), i.enableColumnResizing && /* @__PURE__ */ P(R, {})] }) }, t.id) });
52
- }, L = ({ header: t, hideTableHeaderDropdown: n, applyActionMenuPadding: i, portalContainerRef: a, isFirstColumn: o = !1, enableColumnReorder: s = !1 }) => {
53
- let c = v(), { column: l } = t, u = c.enableColumnResizing, d = u && l.getCanResize(), f = s && !l.columnDef.meta?.disableColumnReorder, { ref: p, isDragging: m, isDropTarget: S } = x({
56
+ }, e.id)), i.enableColumnResizing && /* @__PURE__ */ F(B, {})] }) }, t.id) });
57
+ }, z = ({ header: t, hideTableHeaderDropdown: n, portalContainerRef: i, isFirstColumn: a = !1, leadingSlotsWidth: o = 0, enableColumnReorder: s = !1 }) => {
58
+ let c = y(), { column: l } = t, u = c.enableColumnResizing, d = u && l.getCanResize(), f = s && !l.columnDef.meta?.disableColumnReorder, { ref: p, isDragging: m, isDropTarget: b } = w({
54
59
  id: l.id,
55
60
  index: l.getIndex(),
61
+ type: g,
62
+ accept: g,
63
+ group: g,
56
64
  disabled: !f,
57
- collisionDetector: y,
58
- plugins: [b]
65
+ collisionDetector: S,
66
+ plugins: [C]
59
67
  });
60
- return /* @__PURE__ */ F(j.ColumnHeader, {
68
+ return /* @__PURE__ */ I(M.ColumnHeader, {
61
69
  className: "tableHeaderCell",
62
70
  textAlign: l.columnDef.meta?.isNumeric ? "end" : "start",
63
71
  zIndex: l.getIsPinned() ? 2 : 1,
64
72
  cursor: s ? m ? "grabbing" : "pointer" : void 0,
65
73
  opacity: m ? .5 : 1,
66
- backgroundColor: S || m ? e.Background : void 0,
74
+ backgroundColor: b || m ? e.Background : void 0,
67
75
  scope: "col",
68
76
  style: {
69
77
  ...((t) => {
70
- let n = t.getIsPinned(), r = g(t, u);
78
+ let n = t.getIsPinned(), r = _(t, u);
71
79
  return {
72
80
  position: n ? "sticky" : "relative",
73
- left: n ? _(t, u) : void 0,
81
+ left: n ? v(t, u) : void 0,
74
82
  backgroundColor: n ? e.Background : void 0,
75
83
  zIndex: +!!n,
76
84
  width: r,
@@ -78,125 +86,124 @@ var I = ({ headerGroup: t, hideTableHeaderDropdown: n, portalContainerRef: r })
78
86
  };
79
87
  })(l),
80
88
  borderBottom: `1px solid ${e.OnBackgroundBorder}`,
81
- paddingLeft: o && i ? "24px" : void 0,
89
+ paddingLeft: a && o ? `${o}px` : void 0,
82
90
  ...f ? {
83
91
  userSelect: "none",
84
92
  WebkitUserSelect: "none"
85
93
  } : {}
86
94
  },
87
- children: [/* @__PURE__ */ P(z, {
88
- showSelectAll: c.canSelectRows && o,
89
- children: /* @__PURE__ */ P(N, { children: n ? /* @__PURE__ */ P(k, {
95
+ children: [/* @__PURE__ */ F(V, {
96
+ showSelectAll: c.canSelectRows && a,
97
+ children: /* @__PURE__ */ F(P, { children: n ? /* @__PURE__ */ F(A, {
90
98
  paddingLeft: r.Small,
91
99
  children: h(t.column.columnDef.header, t.getContext())
92
- }) : /* @__PURE__ */ P(T, {
100
+ }) : /* @__PURE__ */ F(E, {
93
101
  header: t,
94
102
  breakingContentState: c.breakingContentState,
95
- columnVisibility: c.columnVisibility,
96
103
  headerGroup: c.table.getHeaderGroups(),
97
104
  localeString: c.localeString,
98
105
  setBreakingContentState: c.setBreakingContentState,
99
106
  setSorting: c.setSorting,
100
107
  sorting: c.sorting,
101
108
  onBreakingContentChange: c.onBreakingContentChange,
102
- portalContainerRef: a,
109
+ portalContainerRef: i,
103
110
  dragRef: f ? p : void 0
104
111
  }) })
105
- }), d && /* @__PURE__ */ P(w, { header: t })]
112
+ }), d && /* @__PURE__ */ F(T, { header: t })]
106
113
  });
107
- }, R = () => /* @__PURE__ */ P(j.ColumnHeader, {
114
+ }, B = () => /* @__PURE__ */ F(M.ColumnHeader, {
108
115
  "aria-hidden": !0,
109
116
  scope: "col",
110
117
  style: { borderBottom: `1px solid ${e.OnBackgroundBorder}` }
111
- }), z = ({ showSelectAll: e, children: t }) => e ? /* @__PURE__ */ F(l, {
118
+ }), V = ({ showSelectAll: e, children: t }) => e ? /* @__PURE__ */ I(l, {
112
119
  w: "100%",
113
120
  align: "center",
114
- children: [/* @__PURE__ */ P(k, {
121
+ children: [/* @__PURE__ */ F(A, {
115
122
  justifyContent: "center",
116
123
  alignItems: "center",
117
- children: /* @__PURE__ */ P(B, {})
124
+ children: /* @__PURE__ */ F(H, {})
118
125
  }), t]
119
- }) : /* @__PURE__ */ P(N, { children: t }), B = () => {
120
- let e = v(), t = D(({ checked: t }) => {
126
+ }) : /* @__PURE__ */ F(P, { children: t }), H = () => {
127
+ let e = y(), t = O(({ checked: t }) => {
121
128
  let n = typeof t == "boolean" && t, r = e.getSelectableRowIds();
122
129
  n ? e.setSelectedRowIds((e) => [.../* @__PURE__ */ new Set([...e, ...r])]) : e.setSelectedRowIds((e) => e.filter((e) => !r.includes(e)));
123
- }, [e]), { allIsSelected: n, shouldShowIndeterminateState: r } = O(() => {
130
+ }, [e]), { allIsSelected: n, shouldShowIndeterminateState: r } = k(() => {
124
131
  let t = e.table.getRowModel().flatRows, n = new Set(e.selectedRowIds), r = e.getSelectableRowIds(), i = r.length > 0 && r.every((e) => n.has(e));
125
132
  return {
126
133
  allIsSelected: i,
127
134
  shouldShowIndeterminateState: t.some((e) => n.has(e.id)) && !i
128
135
  };
129
136
  }, [e]);
130
- return /* @__PURE__ */ P(p, {
137
+ return /* @__PURE__ */ F(p, {
131
138
  isChecked: n,
132
139
  isIndeterminate: r,
133
140
  onCheckedChange: t
134
141
  });
135
- }, V = () => {
136
- let { localeString: i, selectedRowIds: s = [], selectionActions: u = [], totalDataCount: d } = v(), p = C[i], [h] = M(["(min-width: 48em)"]), g = u.length > 3 || !h, _ = s.length, y = d ? S(p.selectedWithTotal, {
142
+ }, U = () => {
143
+ let { localeString: i, selectedRowIds: s = [], selectionActions: u = [], totalDataCount: d } = y(), p = x[i], [h] = N(["(min-width: 48em)"]), g = u.length > 3 || !h, _ = s.length, v = d ? b(p.selectedWithTotal, {
137
144
  count: _,
138
145
  total: d
139
- }) : s.length === 1 ? S(p.selectedSingular, { count: 1 }) : S(p.selected, { count: _ });
140
- return /* @__PURE__ */ F(l, {
146
+ }) : s.length === 1 ? b(p.selectedSingular, { count: 1 }) : b(p.selected, { count: _ });
147
+ return /* @__PURE__ */ I(l, {
141
148
  gap: r.Medium,
142
149
  align: "center",
143
150
  alignContent: "center",
144
151
  children: [
145
- /* @__PURE__ */ P(k, {
152
+ /* @__PURE__ */ F(A, {
146
153
  pl: r.Small,
147
154
  color: e.OnBackground,
148
155
  fontFamily: n.Body,
149
156
  fontSize: t.Medium,
150
157
  whiteSpace: "nowrap",
151
158
  css: { fontVariantNumeric: "normal" },
152
- children: y
159
+ children: v
153
160
  }),
154
- /* @__PURE__ */ P(k, { children: /* @__PURE__ */ P(m, {
161
+ /* @__PURE__ */ F(A, { children: /* @__PURE__ */ F(m, {
155
162
  orientation: "vertical",
156
163
  height: "20px"
157
164
  }) }),
158
- /* @__PURE__ */ P(l, {
165
+ /* @__PURE__ */ F(l, {
159
166
  gap: r.Small,
160
167
  align: "center",
161
- children: g ? /* @__PURE__ */ F(o, { children: [/* @__PURE__ */ P(c, {
168
+ children: g ? /* @__PURE__ */ I(o, { children: [/* @__PURE__ */ F(c, {
162
169
  variant: "ghost",
163
170
  rightIcon: a,
164
171
  size: "sm",
165
172
  children: p.action
166
- }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(f, { children: u.map((e) => /* @__PURE__ */ P(H, {
173
+ }), /* @__PURE__ */ F(j, { children: /* @__PURE__ */ F(f, { children: u.map((e) => /* @__PURE__ */ F(W, {
167
174
  isMenuItem: !0,
168
175
  action: e
169
- }, e.name)) }) })] }) : u.map((e) => /* @__PURE__ */ P(H, {
176
+ }, e.name)) }) })] }) : u.map((e) => /* @__PURE__ */ F(W, {
170
177
  isMenuItem: !1,
171
178
  action: e
172
179
  }, e.name))
173
180
  })
174
181
  ]
175
182
  });
176
- }, H = ({ isMenuItem: t, action: n }) => {
177
- let { selectedRowIds: r, localeString: a } = v(), o = C[a], c = D(() => {
183
+ }, W = ({ isMenuItem: t, action: n }) => {
184
+ let { selectedRowIds: r, localeString: a } = y(), o = x[a], c = O(() => {
178
185
  n.onClick(r || []);
179
186
  }, [n, r]);
180
- return t ? /* @__PURE__ */ P(d, {
187
+ return t ? /* @__PURE__ */ F(d, {
181
188
  onClick: c,
182
189
  value: n.name,
183
- children: n.variant === "delete" ? /* @__PURE__ */ P(k, {
190
+ children: n.variant === "delete" ? /* @__PURE__ */ F(A, {
184
191
  as: "span",
185
192
  color: e.Error,
186
193
  children: n.name
187
194
  }) : n.name
188
- }) : n.variant === "delete" ? /* @__PURE__ */ P(u, {
195
+ }) : n.variant === "delete" ? /* @__PURE__ */ F(u, {
189
196
  onClick: c,
190
197
  icon: i,
191
198
  "aria-label": o.deleteSelectedRows,
192
199
  size: "sm",
193
200
  variant: "ghost"
194
- }) : /* @__PURE__ */ P(s, {
201
+ }) : /* @__PURE__ */ F(s, {
195
202
  onClick: c,
196
203
  size: "sm",
197
204
  variant: "ghost",
198
205
  children: n.name
199
206
  });
200
- }, U = E(I);
207
+ }, G = D(R);
201
208
  //#endregion
202
- export { U as TableHeaderRow };
209
+ export { G as TableHeaderRow };
@@ -1 +1 @@
1
- {"version":3,"file":"table-recipe.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-recipe.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,KAAK,oBAAoB,EAIzB,MAAM,kBAAkB,CAAC;AAgG1B,eAAO,MAAM,WAAW,EAAE,oBAUxB,CAAC"}
1
+ {"version":3,"file":"table-recipe.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-recipe.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,KAAK,oBAAoB,EAIzB,MAAM,kBAAkB,CAAC;AA2G1B,eAAO,MAAM,WAAW,EAAE,oBAUxB,CAAC"}
@@ -45,8 +45,14 @@ var o = {
45
45
  borderTop: "none",
46
46
  _first: { borderTop: "none" },
47
47
  "&[data-row-selected=\"true\"]": { backgroundColor: t.AccentHoverAlpha },
48
+ "&[data-dragging=\"true\"]": {
49
+ opacity: .5,
50
+ "& .row-drag-handle": { opacity: 1 }
51
+ },
52
+ "&[data-drop-target=\"true\"]": { backgroundColor: t.AccentHoverAlpha },
48
53
  _hover: {
49
54
  "& .action-menu-button": { opacity: 1 },
55
+ "& .row-drag-handle": { opacity: 1 },
50
56
  "&[data-allow-hovered=\"true\"]": { backgroundColor: t.AccentHoverAlpha }
51
57
  },
52
58
  "&[data-is-root-level=\"true\"]:not(:first-of-type)": { "& > td": { borderTop: `1px solid ${t.OnBackgroundBorder}` } }
@@ -0,0 +1,6 @@
1
+ import { Locales } from './translations.js';
2
+ export declare const TableRowDragHandle: import('react').MemoExoticComponent<({ localeString, handleRef, }: {
3
+ localeString: Locales;
4
+ handleRef?: (element: Element | null) => void;
5
+ }) => import("react").JSX.Element>;
6
+ //# sourceMappingURL=table-row-drag-handle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-row-drag-handle.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-row-drag-handle.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AA0F5D,eAAO,MAAM,kBAAkB,qEA9E5B;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9C,iCA2EkE,CAAC"}
@@ -0,0 +1,53 @@
1
+ "use no memo";
2
+ import { ThemeColorVariable as e, ThemeIconSizeVariable as t } from "../../theme/theme-types.js";
3
+ import { GripMoreIcon as n } from "../icon/icons/grip-more-icon.js";
4
+ import { useTableContext as r } from "./table-context.js";
5
+ import { translations as i } from "./translations.js";
6
+ import { memo as a, useRef as o } from "react";
7
+ import { Box as s } from "@chakra-ui/react";
8
+ import { jsx as c } from "react/jsx-runtime";
9
+ var l = a(({ localeString: a, handleRef: l }) => {
10
+ let u = i[a], { rowReorderMode: d, setIsSortedReorderPromptOpen: f } = r(), p = d === "blockedBySort", m = o(null), h = (e) => {
11
+ p && (m.current = {
12
+ x: e.clientX,
13
+ y: e.clientY
14
+ }, e.currentTarget.setPointerCapture(e.pointerId));
15
+ }, g = (e) => {
16
+ let t = m.current;
17
+ t && (Math.hypot(e.clientX - t.x, e.clientY - t.y) < 4 || (m.current = null, f(!0)));
18
+ }, _ = () => {
19
+ m.current = null;
20
+ };
21
+ return /* @__PURE__ */ c(s, {
22
+ ref: l,
23
+ onPointerDown: h,
24
+ onPointerMove: g,
25
+ onPointerUp: _,
26
+ onPointerCancel: _,
27
+ onClick: (e) => e.stopPropagation(),
28
+ onKeyDown: (e) => {
29
+ e.stopPropagation(), p && (e.key === " " || e.key === "Enter") && (e.preventDefault(), f(!0));
30
+ },
31
+ role: "button",
32
+ "aria-label": u.reorderRow,
33
+ tabIndex: 0,
34
+ className: "row-drag-handle",
35
+ position: "absolute",
36
+ left: "0",
37
+ top: "0",
38
+ height: "100%",
39
+ width: "24px",
40
+ display: "flex",
41
+ alignItems: "center",
42
+ justifyContent: "center",
43
+ color: e.OnBackgroundSubdued,
44
+ opacity: 0,
45
+ _focusVisible: { opacity: 1 },
46
+ cursor: "grab",
47
+ userSelect: "none",
48
+ css: { "&:active": { cursor: "grabbing" } },
49
+ children: /* @__PURE__ */ c(n, { size: t.Small })
50
+ });
51
+ });
52
+ //#endregion
53
+ export { l as TableRowDragHandle };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=table-row-reorder.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-row-reorder.spec.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-row-reorder.spec.tsx"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"table-row.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-row.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAIvD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnE,KAAK,aAAa,CAAC,KAAK,SAAS,SAAS,IAAI;IAC7C,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9B,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC;IACnD,UAAU,CAAC,EAAE,CACZ,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,EACxB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KACnF,IAAI,CAAC;IACV,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,QAAA,MAAM,aAAa,GAAI,KAAK,SAAS,SAAS,EAAE,6EAM7C,aAAa,CAAC,KAAK,CAAC,gCA2EtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAA0B,OAAO,aAAa,CAAC"}
1
+ {"version":3,"file":"table-row.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-row.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAKvD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnE,KAAK,aAAa,CAAC,KAAK,SAAS,SAAS,IAAI;IAC7C,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9B,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC;IACnD,UAAU,CAAC,EAAE,CACZ,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,EACxB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KACnF,IAAI,CAAC;IACV,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,QAAA,MAAM,aAAa,GAAI,KAAK,SAAS,SAAS,EAAE,6EAM7C,aAAa,CAAC,KAAK,CAAC,gCAiGtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAA0B,OAAO,aAAa,CAAC"}