@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,51 +1,68 @@
1
1
  "use no memo";
2
- import { useTableContext as e } from "./table-context.js";
3
- import { TableCell as t } from "./table-cell.js";
4
- import { memo as n, useCallback as r, useMemo as i } from "react";
5
- import { Table as a } from "@chakra-ui/react";
6
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- var c = n(({ row: n, visibleCells: c, onClickRow: l, showRowHoverStyle: u, onRowClickIndication: d }) => {
8
- let f = e(), p = r((e) => {
9
- l && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l(n.original, e));
10
- }, [l, n.original]), m = r((e) => {
11
- e.stopPropagation(), n.getToggleSelectedHandler(), l && l(n.original, e), d && f.setRowHighlight({ [e.currentTarget.id]: !0 });
2
+ import { ROW_SORTABLE_TYPE as e } from "./table.constants.js";
3
+ import { useTableContext as t } from "./table-context.js";
4
+ import { closestCenter as n } from "../../node_modules/@dnd-kit/collision/dist/index.js";
5
+ import { SortableKeyboardPlugin as r } from "../../node_modules/@dnd-kit/dom/sortable.js";
6
+ import { useSortable as i } from "../../node_modules/@dnd-kit/react/sortable.js";
7
+ import { TableCell as a } from "./table-cell.js";
8
+ import { memo as o, useCallback as s, useMemo as c } from "react";
9
+ import { Table as l } from "@chakra-ui/react";
10
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
+ var f = o(({ row: o, visibleCells: f, onClickRow: p, showRowHoverStyle: m, onRowClickIndication: h }) => {
12
+ let g = t(), _ = o.depth === 0, v = g.rowReorderMode === "enabled" && _, { ref: y, handleRef: b, isDragging: x, isDropTarget: S } = i({
13
+ id: o.id,
14
+ index: o.index,
15
+ type: e,
16
+ accept: e,
17
+ group: e,
18
+ disabled: !v,
19
+ collisionDetector: n,
20
+ plugins: [r]
21
+ }), C = s((e) => {
22
+ p && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), p(o.original, e));
23
+ }, [p, o.original]), w = s((e) => {
24
+ e.stopPropagation(), o.getToggleSelectedHandler(), p && p(o.original, e), h && g.setRowHighlight({ [e.currentTarget.id]: !0 });
12
25
  }, [
13
- n,
14
- l,
15
- d,
16
- f
17
- ]), h = i(() => n.getIsSelected() || f.selectedRowIds?.includes(n.id), [
18
- n,
19
- f.rowHighlight,
20
- f.selectedRowIds
21
- ]), g = f.getRowActions?.(n.original), _ = (e) => f.disableSelectionCheckbox?.(e) ?? !1;
22
- return /* @__PURE__ */ s(a.Row, {
23
- id: n.id,
24
- tabIndex: l ? 0 : void 0,
25
- onClick: m,
26
- onKeyDown: p,
27
- cursor: l ? "pointer" : void 0,
28
- "data-row-selected": h,
29
- "data-allow-hovered": u,
30
- "data-is-root-level": n.depth === 0,
31
- children: [c.map((e, r) => {
32
- let i = r === 0;
33
- return /* @__PURE__ */ o(t, {
26
+ o,
27
+ p,
28
+ h,
29
+ g
30
+ ]), T = c(() => o.getIsSelected() || g.selectedRowIds?.includes(o.id), [
31
+ o,
32
+ g.rowHighlight,
33
+ g.selectedRowIds
34
+ ]), E = g.getRowActions?.(o.original), D = (e) => g.disableSelectionCheckbox?.(e) ?? !1;
35
+ return /* @__PURE__ */ d(l.Row, {
36
+ ref: v ? y : void 0,
37
+ id: o.id,
38
+ tabIndex: p ? 0 : void 0,
39
+ onClick: w,
40
+ onKeyDown: C,
41
+ cursor: p ? "pointer" : void 0,
42
+ "data-row-selected": T,
43
+ "data-allow-hovered": m,
44
+ "data-is-root-level": o.depth === 0,
45
+ "data-dragging": x || void 0,
46
+ "data-drop-target": S || void 0,
47
+ children: [f.map((e, t) => {
48
+ let n = t === 0;
49
+ return /* @__PURE__ */ u(a, {
34
50
  cell: e,
35
- visibleCells: c,
36
- row: n,
37
- rowIsExpanded: n.getIsExpanded(),
38
- breakingContentState: f.breakingContentState,
39
- localeString: f.localeString,
40
- actionMenu: i ? g : void 0,
41
- canSelectRows: f.canSelectRows && i,
42
- isCheckboxDisabled: _(n)
51
+ visibleCells: f,
52
+ row: o,
53
+ rowIsExpanded: o.getIsExpanded(),
54
+ breakingContentState: g.breakingContentState,
55
+ localeString: g.localeString,
56
+ actionMenu: n ? E : void 0,
57
+ canSelectRows: g.canSelectRows && n,
58
+ isCheckboxDisabled: D(o),
59
+ dragHandleRef: n && v ? b : void 0
43
60
  }, e.id);
44
- }), f.enableColumnResizing && /* @__PURE__ */ o(a.Cell, {
61
+ }), g.enableColumnResizing && /* @__PURE__ */ u(l.Cell, {
45
62
  "aria-hidden": !0,
46
63
  style: { borderBottom: 0 }
47
64
  })]
48
- }, n.id);
65
+ }, o.id);
49
66
  });
50
67
  //#endregion
51
- export { c as TableRow };
68
+ export { f as TableRow };
@@ -0,0 +1,8 @@
1
+ import { Locales } from './translations.js';
2
+ export declare const TableSortedReorderPrompt: ({ isOpen, localeString, onCancel, onConfirm, }: {
3
+ isOpen: boolean;
4
+ localeString: Locales;
5
+ onCancel: () => void;
6
+ onConfirm: () => void;
7
+ }) => import("react").JSX.Element;
8
+ //# sourceMappingURL=table-sorted-reorder-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-sorted-reorder-prompt.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-sorted-reorder-prompt.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,wBAAwB,GAAI,gDAKtC;IACF,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;CACtB,gCA8BA,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { require_compiler_runtime as e } from "../../node_modules/react/compiler-runtime.js";
2
+ import { ThemeColorVariable as t, ThemeFontSizeVariable as n, ThemeFontVariable as r, ThemeSpaceVariable as i } from "../../theme/theme-types.js";
3
+ import { Text as a } from "../text/text.js";
4
+ import { Button as o } from "../button/button.js";
5
+ import { Flex as s } from "../flex/flex.js";
6
+ import { Modal as c } from "../modal/modal.js";
7
+ import { ModalBody as l } from "../modal/modal-body.js";
8
+ import { ModalFooter as u } from "../modal/modal-footer.js";
9
+ import { ModalHeader as d } from "../modal/modal-header.js";
10
+ import { translations as f } from "./translations.js";
11
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
12
+ //#region lib/components/table/table-sorted-reorder-prompt.tsx
13
+ var h = e(), g = (e) => {
14
+ let g = (0, h.c)(19), { isOpen: _, localeString: v, onCancel: y, onConfirm: b } = e, x = f[v], S;
15
+ g[0] === x.reorderSortedTitle ? S = g[1] : (S = /* @__PURE__ */ p(d, {
16
+ p: i.Medium,
17
+ children: /* @__PURE__ */ p(a, {
18
+ color: t.OnSurfaceHeader,
19
+ fontFamily: r.SubHeader,
20
+ fontWeight: "medium",
21
+ fontSize: n.XLarge,
22
+ children: x.reorderSortedTitle
23
+ })
24
+ }), g[0] = x.reorderSortedTitle, g[1] = S);
25
+ let C;
26
+ g[2] === x.reorderSortedBody ? C = g[3] : (C = /* @__PURE__ */ p(l, {
27
+ px: i.Medium,
28
+ children: /* @__PURE__ */ p(a, { children: x.reorderSortedBody })
29
+ }), g[2] = x.reorderSortedBody, g[3] = C);
30
+ let w;
31
+ g[4] !== y || g[5] !== x.cancel ? (w = /* @__PURE__ */ p(o, {
32
+ variant: "secondary",
33
+ onClick: y,
34
+ children: x.cancel
35
+ }), g[4] = y, g[5] = x.cancel, g[6] = w) : w = g[6];
36
+ let T;
37
+ g[7] !== b || g[8] !== x.reorderSortedConfirm ? (T = /* @__PURE__ */ p(o, {
38
+ variant: "primary",
39
+ onClick: b,
40
+ children: x.reorderSortedConfirm
41
+ }), g[7] = b, g[8] = x.reorderSortedConfirm, g[9] = T) : T = g[9];
42
+ let E;
43
+ g[10] !== w || g[11] !== T ? (E = /* @__PURE__ */ p(u, {
44
+ p: i.Medium,
45
+ children: /* @__PURE__ */ m(s, {
46
+ gap: i.Small,
47
+ justify: "flex-end",
48
+ w: "100%",
49
+ children: [w, T]
50
+ })
51
+ }), g[10] = w, g[11] = T, g[12] = E) : E = g[12];
52
+ let D;
53
+ return g[13] !== _ || g[14] !== y || g[15] !== S || g[16] !== C || g[17] !== E ? (D = /* @__PURE__ */ m(c, {
54
+ isOpen: _,
55
+ onClose: y,
56
+ children: [
57
+ S,
58
+ C,
59
+ E
60
+ ]
61
+ }), g[13] = _, g[14] = y, g[15] = S, g[16] = C, g[17] = E, g[18] = D) : D = g[18], D;
62
+ };
63
+ //#endregion
64
+ export { g as TableSortedReorderPrompt };
@@ -15,11 +15,11 @@ import { Switch as h } from "../switch/switch.js";
15
15
  import { DEFAULT_PAGE_SIZE_OPTIONS as g } from "./table.constants.js";
16
16
  import { getColumnLabel as _ } from "./helper.js";
17
17
  import { useTableContext as v } from "./table-context.js";
18
- import { closestCenter as y } from "../../node_modules/@dnd-kit/collision/dist/index.js";
19
- import { DragDropProvider as b } from "../../node_modules/@dnd-kit/react/index.js";
20
- import { SortableKeyboardPlugin as x, isSortableOperation as S } from "../../node_modules/@dnd-kit/dom/sortable.js";
21
- import { useSortable as C } from "../../node_modules/@dnd-kit/react/sortable.js";
22
- import { translations as w } from "./translations.js";
18
+ import { translations as y } from "./translations.js";
19
+ import { closestCenter as b } from "../../node_modules/@dnd-kit/collision/dist/index.js";
20
+ import { DragDropProvider as x } from "../../node_modules/@dnd-kit/react/index.js";
21
+ import { SortableKeyboardPlugin as S, isSortableOperation as C } from "../../node_modules/@dnd-kit/dom/sortable.js";
22
+ import { useSortable as w } from "../../node_modules/@dnd-kit/react/sortable.js";
23
23
  import { memo as T, useCallback as E, useState as D } from "react";
24
24
  import { Box as O, Flex as k, Portal as A } from "@chakra-ui/react";
25
25
  import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
@@ -30,27 +30,27 @@ var F = (e, t, n, r) => {
30
30
  let i = n.findIndex((e) => e.id === r.sourceId), a = n.findIndex((e) => e.id === r.targetId);
31
31
  return i < 0 || a < 0 || i === a ? "none" : i < a && t > i && t <= a ? "translateY(-100%)" : i > a && t >= a && t < i ? "translateY(100%)" : "none";
32
32
  }, I = (e) => {
33
- if (!S(e)) return null;
33
+ if (!C(e)) return null;
34
34
  let { source: t, target: n } = e;
35
35
  return t && n ? {
36
36
  source: t,
37
37
  target: n
38
38
  } : null;
39
39
  }, L = ({ pageSize: n, onPageSizeChange: i }) => {
40
- let y = v(), x = w[y.localeString], S = !!i && Number.isInteger(n), [C, T] = D(null), L = y.table.getAllLeafColumns().filter((e) => e.getCanHide()), R = L.filter((e) => e.getIsVisible()), B = L.filter((e) => !e.getIsVisible()).sort((e, t) => {
40
+ let b = v(), S = y[b.localeString], C = !!i && Number.isInteger(n), [w, T] = D(null), L = b.table.getAllLeafColumns().filter((e) => e.getCanHide()), R = L.filter((e) => e.getIsVisible()), B = L.filter((e) => !e.getIsVisible()).sort((e, t) => {
41
41
  let n = _(e.columnDef.header, e.id), r = _(t.columnDef.header, t.id);
42
- return n.localeCompare(r, y.localeString, { sensitivity: "base" });
43
- }), V = E(() => y.table.getAllColumns().length === Object.keys(y.breakingContentState).length && !Object.values(y.breakingContentState).includes(!1), [y.breakingContentState, y.table]), H = E(({ checked: e }) => {
42
+ return n.localeCompare(r, b.localeString, { sensitivity: "base" });
43
+ }), V = E(() => b.table.getAllColumns().length === Object.keys(b.breakingContentState).length && !Object.values(b.breakingContentState).includes(!1), [b.breakingContentState, b.table]), H = E(({ checked: e }) => {
44
44
  let t = {};
45
- y.table.getAllColumns().forEach((n) => {
45
+ b.table.getAllColumns().forEach((n) => {
46
46
  t[n.id] = e;
47
- }), y.setBreakingContentState(t), y.onBreakingContentChange?.(t);
48
- }, [y]);
47
+ }), b.setBreakingContentState(t), b.onBreakingContentChange?.(t);
48
+ }, [b]);
49
49
  return /* @__PURE__ */ M(k, { children: /* @__PURE__ */ N(s, {
50
50
  closeOnSelect: !1,
51
51
  isLazy: !0,
52
52
  children: [/* @__PURE__ */ M(c, {
53
- "aria-label": x.presets,
53
+ "aria-label": S.presets,
54
54
  variant: "ghost",
55
55
  p: "unset",
56
56
  w: "40px",
@@ -61,12 +61,12 @@ var F = (e, t, n, r) => {
61
61
  color: e.OnSurfaceSubdued,
62
62
  py: r.Small,
63
63
  px: r.Medium,
64
- children: x.shownInTable
64
+ children: S.shownInTable
65
65
  }),
66
66
  /* @__PURE__ */ N(O, {
67
67
  maxHeight: "400px",
68
68
  overflowY: "auto",
69
- children: [/* @__PURE__ */ M(b, {
69
+ children: [/* @__PURE__ */ M(x, {
70
70
  onDragOver: (e) => {
71
71
  let t = I(e.operation);
72
72
  t && T({
@@ -77,14 +77,14 @@ var F = (e, t, n, r) => {
77
77
  onDragEnd: (e) => {
78
78
  let t = I(e.operation);
79
79
  P(() => {
80
- T(null), t && y.handleDragEnd(String(t.source.id), String(t.target.id));
80
+ T(null), t && b.handleDragEnd(String(t.source.id), String(t.target.id));
81
81
  });
82
82
  },
83
83
  children: R.map((e, t) => /* @__PURE__ */ M(z, {
84
84
  column: e,
85
85
  index: t,
86
86
  isDisabled: R.length === 1,
87
- translateY: F(e.id, t, R, C)
87
+ translateY: F(e.id, t, R, w)
88
88
  }, e.id))
89
89
  }), B.length > 0 && /* @__PURE__ */ N(j, { children: [
90
90
  /* @__PURE__ */ M(l, {}),
@@ -92,7 +92,7 @@ var F = (e, t, n, r) => {
92
92
  color: e.OnSurfaceSubdued,
93
93
  py: r.Small,
94
94
  px: r.Medium,
95
- children: x.hiddenInTable
95
+ children: S.hiddenInTable
96
96
  }),
97
97
  B.map((e) => /* @__PURE__ */ N(u, {
98
98
  itemType: "checkbox",
@@ -101,8 +101,8 @@ var F = (e, t, n, r) => {
101
101
  isChecked: e.getIsVisible(),
102
102
  onCheckedChange: ({ checked: t }) => {
103
103
  if (e.toggleVisibility(!!t), t) {
104
- let t = y.columnOrder.filter((t) => t !== e.id);
105
- t.push(e.id), y.setColumnOrder(t);
104
+ let t = b.columnOrder.filter((t) => t !== e.id);
105
+ t.push(e.id), b.setColumnOrder(t);
106
106
  }
107
107
  }
108
108
  })]
@@ -110,12 +110,12 @@ var F = (e, t, n, r) => {
110
110
  ] })]
111
111
  }),
112
112
  /* @__PURE__ */ M(l, {}),
113
- S && /* @__PURE__ */ N(j, { children: [
113
+ C && /* @__PURE__ */ N(j, { children: [
114
114
  /* @__PURE__ */ M(o, {
115
115
  color: e.OnSurfaceSubdued,
116
116
  py: r.Small,
117
117
  px: r.Medium,
118
- children: x.rowsPerPage
118
+ children: S.rowsPerPage
119
119
  }),
120
120
  /* @__PURE__ */ M(m, {
121
121
  gap: "unset",
@@ -124,7 +124,7 @@ var F = (e, t, n, r) => {
124
124
  children: g.map((e) => /* @__PURE__ */ N(u, {
125
125
  itemType: "radio",
126
126
  value: String(e),
127
- children: [x.numberOfRows.replace("{count}", String(e)), /* @__PURE__ */ M(p, { value: String(e) })]
127
+ children: [S.numberOfRows.replace("{count}", String(e)), /* @__PURE__ */ M(p, { value: String(e) })]
128
128
  }, e))
129
129
  }),
130
130
  /* @__PURE__ */ M(l, {})
@@ -132,18 +132,18 @@ var F = (e, t, n, r) => {
132
132
  /* @__PURE__ */ N(u, {
133
133
  itemType: "switch",
134
134
  value: "breakingContent",
135
- children: [x.breakingContent, /* @__PURE__ */ M(h, {
135
+ children: [S.breakingContent, /* @__PURE__ */ M(h, {
136
136
  onCheckedChange: H,
137
137
  isChecked: V()
138
138
  })]
139
139
  })
140
140
  ] }) })]
141
141
  }) });
142
- }, R = [x], z = ({ column: a, index: o, isDisabled: s, translateY: c }) => {
143
- let { ref: l, handleRef: d, isDragging: p } = C({
142
+ }, R = [S], z = ({ column: a, index: o, isDisabled: s, translateY: c }) => {
143
+ let { ref: l, handleRef: d, isDragging: p } = w({
144
144
  id: a.id,
145
145
  index: o,
146
- collisionDetector: y,
146
+ collisionDetector: b,
147
147
  plugins: R
148
148
  });
149
149
  return /* @__PURE__ */ M(O, {
@@ -17,4 +17,6 @@ export declare const EditableTable: () => import("react").JSX.Element;
17
17
  export declare const HeaderTextWrappingTable: () => import("react").JSX.Element;
18
18
  export declare const NestedTableWithToolbar: () => import("react").JSX.Element;
19
19
  export declare const ResizableTable: () => import("react").JSX.Element;
20
+ export declare const ReorderableTable: () => import("react").JSX.Element;
21
+ export declare const ReorderableTableWithHandlesShown: () => import("react").JSX.Element;
20
22
  //# sourceMappingURL=table.composition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.composition.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AA8GH,eAAO,MAAM,UAAU,mCAoEtB,CAAC;AAEF,eAAO,MAAM,WAAW,mCAyDvB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAqBD,eAAO,MAAM,aAAa,mCAqEzB,CAAC;AAKF,eAAO,MAAM,uBAAuB,mCAyCnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,mCAmElC,CAAC;AAIF,eAAO,MAAM,cAAc,mCA+D1B,CAAC"}
1
+ {"version":3,"file":"table.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.composition.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AA8GH,eAAO,MAAM,UAAU,mCAoEtB,CAAC;AAEF,eAAO,MAAM,WAAW,mCAyDvB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAqBD,eAAO,MAAM,aAAa,mCAqEzB,CAAC;AAKF,eAAO,MAAM,uBAAuB,mCAyCnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,mCAmElC,CAAC;AAIF,eAAO,MAAM,cAAc,mCA+D1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCA8B5B,CAAC;AAEF,eAAO,MAAM,gCAAgC,mCAI5C,CAAC"}
@@ -3,4 +3,19 @@ export declare const RESIZABLE_COLUMN_MIN_SIZE = 80;
3
3
  /** How much one arrow-key press changes a column's width, and how much the same press with Shift does. */
4
4
  export declare const RESIZABLE_COLUMN_KEYBOARD_STEP = 10;
5
5
  export declare const RESIZABLE_COLUMN_KEYBOARD_LARGE_STEP = 50;
6
+ /**
7
+ * Width of one control slot at the start of a row's first cell. The grip, the row action menu and the
8
+ * checkbox each take a slot. They float over the cell, so the cell adds this much padding per slot to
9
+ * keep them off its text.
10
+ */
11
+ export declare const ROW_SLOT_WIDTH = 24;
12
+ /**
13
+ * How far a press on the grip has to move before it counts as trying to drag. This is only needed while a
14
+ * sort blocks dragging: dnd-kit is switched off then, so the table watches the press itself, and a few
15
+ * pixels of slack stop a plain click from looking like a drag.
16
+ */
17
+ export declare const BLOCKED_DRAG_THRESHOLD_PX = 4;
18
+ /** Rows and columns share the same `DragDropProvider`, so each sortable identifies its type. */
19
+ export declare const ROW_SORTABLE_TYPE = "table-row";
20
+ export declare const COLUMN_SORTABLE_TYPE = "table-column";
6
21
  //# sourceMappingURL=table.constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.constants.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,4BAA6B,CAAC;AAEpE,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,0GAA0G;AAC1G,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,eAAO,MAAM,oCAAoC,KAAK,CAAC"}
1
+ {"version":3,"file":"table.constants.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,4BAA6B,CAAC;AAEpE,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,0GAA0G;AAC1G,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,eAAO,MAAM,oCAAoC,KAAK,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,gGAAgG;AAChG,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAC7C,eAAO,MAAM,oBAAoB,iBAAiB,CAAC"}
@@ -4,6 +4,6 @@ var e = [
4
4
  25,
5
5
  50,
6
6
  100
7
- ];
7
+ ], t = "table-row", n = "table-column";
8
8
  //#endregion
9
- export { e as DEFAULT_PAGE_SIZE_OPTIONS };
9
+ export { n as COLUMN_SORTABLE_TYPE, e as DEFAULT_PAGE_SIZE_OPTIONS, t as ROW_SORTABLE_TYPE };
@@ -4,5 +4,5 @@ import { TableData, TableProps } from './types.js';
4
4
  *
5
5
  * @see Docs https://caspeco.github.io/casper-ui-library/components/table
6
6
  */
7
- export declare function Table<TData extends TableData>({ columns, data, totalDataCount, localeString, expandedState, initialExpandedState, initialBreakingContentState, initialColumnVisibilityState, columnVisibilityState, onColumnVisibilityChange, onExpandedChange, onBreakingContentChange, getRowId, getRowActions, id, customRowIndication, onSortingChange, initialSortingState, sortingState, onSelectionChange, initialSelectionState, selectionState, selectionActions, disableSelectionCheckbox, enableColumnReorder, columnOrderState, initialColumnOrder, onColumnOrderChange, enableColumnResizing, initialColumnSizingState, onColumnSizingChange, children, }: TableProps<TData>): import("react").JSX.Element;
7
+ export declare function Table<TData extends TableData>({ columns, data, totalDataCount, localeString, expandedState, initialExpandedState, initialBreakingContentState, initialColumnVisibilityState, columnVisibilityState, onColumnVisibilityChange, onExpandedChange, onBreakingContentChange, getRowId, getRowActions, id, customRowIndication, onSortingChange, initialSortingState, sortingState, onSelectionChange, initialSelectionState, selectionState, selectionActions, disableSelectionCheckbox, enableColumnReorder, columnOrderState, initialColumnOrder, onColumnOrderChange, enableColumnResizing, initialColumnSizingState, onColumnSizingChange, enableRowReorder, onRowOrderChange, children, }: TableProps<TData>): import("react").JSX.Element;
8
8
  //# sourceMappingURL=table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,SAAS,SAAS,EAAE,EAC9C,OAAO,EACP,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,oBAAyB,EACzB,2BAAgC,EAChC,4BAA4B,EAC5B,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,QAAQ,EACR,aAAa,EACb,EAAE,EACF,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,GACR,EAAE,UAAU,CAAC,KAAK,CAAC,+BAsCnB"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,SAAS,SAAS,EAAE,EAC9C,OAAO,EACP,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,oBAAyB,EACzB,2BAAgC,EAChC,4BAA4B,EAC5B,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,QAAQ,EACR,aAAa,EACb,EAAE,EACF,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,GACR,EAAE,UAAU,CAAC,KAAK,CAAC,+BAwCnB"}
@@ -2,7 +2,7 @@
2
2
  import { TableProvider as e } from "./table-context-provider.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  //#region lib/components/table/table.tsx
5
- function n({ columns: n, data: r, totalDataCount: i, localeString: a, expandedState: o, initialExpandedState: s = {}, initialBreakingContentState: c = {}, initialColumnVisibilityState: l, columnVisibilityState: u, onColumnVisibilityChange: d, onExpandedChange: f, onBreakingContentChange: p, getRowId: m, getRowActions: h, id: g, customRowIndication: _, onSortingChange: v, initialSortingState: y, sortingState: b, onSelectionChange: x, initialSelectionState: S, selectionState: C, selectionActions: w, disableSelectionCheckbox: T, enableColumnReorder: E, columnOrderState: D, initialColumnOrder: O, onColumnOrderChange: k, enableColumnResizing: A, initialColumnSizingState: j, onColumnSizingChange: M, children: N }) {
5
+ function n({ columns: n, data: r, totalDataCount: i, localeString: a, expandedState: o, initialExpandedState: s = {}, initialBreakingContentState: c = {}, initialColumnVisibilityState: l, columnVisibilityState: u, onColumnVisibilityChange: d, onExpandedChange: f, onBreakingContentChange: p, getRowId: m, getRowActions: h, id: g, customRowIndication: _, onSortingChange: v, initialSortingState: y, sortingState: b, onSelectionChange: x, initialSelectionState: S, selectionState: C, selectionActions: w, disableSelectionCheckbox: T, enableColumnReorder: E, columnOrderState: D, initialColumnOrder: O, onColumnOrderChange: k, enableColumnResizing: A, initialColumnSizingState: j, onColumnSizingChange: M, enableRowReorder: N, onRowOrderChange: P, children: F }) {
6
6
  return /* @__PURE__ */ t(e, {
7
7
  columns: n,
8
8
  data: r,
@@ -35,7 +35,9 @@ function n({ columns: n, data: r, totalDataCount: i, localeString: a, expandedSt
35
35
  enableColumnResizing: A,
36
36
  initialColumnSizingState: j,
37
37
  onColumnSizingChange: M,
38
- children: N
38
+ enableRowReorder: N,
39
+ onRowOrderChange: P,
40
+ children: F
39
41
  });
40
42
  }
41
43
  //#endregion
@@ -34,6 +34,17 @@ export declare const translations: {
34
34
  deleteSelectedRows: string;
35
35
  shownInTable: string;
36
36
  hiddenInTable: string;
37
+ clearSorting: string;
38
+ reorderRow: string;
39
+ cancel: string;
40
+ reorderSortedTitle: string;
41
+ reorderSortedBody: string;
42
+ reorderSortedConfirm: string;
43
+ reorderInstructions: string;
44
+ reorderPickedUp: string;
45
+ reorderMovedTo: string;
46
+ reorderDropped: string;
47
+ reorderCancelled: string;
37
48
  };
38
49
  "en-US": {
39
50
  sortUp: string;
@@ -66,6 +77,17 @@ export declare const translations: {
66
77
  deleteSelectedRows: string;
67
78
  shownInTable: string;
68
79
  hiddenInTable: string;
80
+ clearSorting: string;
81
+ reorderRow: string;
82
+ cancel: string;
83
+ reorderSortedTitle: string;
84
+ reorderSortedBody: string;
85
+ reorderSortedConfirm: string;
86
+ reorderInstructions: string;
87
+ reorderPickedUp: string;
88
+ reorderMovedTo: string;
89
+ reorderDropped: string;
90
+ reorderCancelled: string;
69
91
  };
70
92
  "en-GB": {
71
93
  sortUp: string;
@@ -98,6 +120,17 @@ export declare const translations: {
98
120
  deleteSelectedRows: string;
99
121
  shownInTable: string;
100
122
  hiddenInTable: string;
123
+ clearSorting: string;
124
+ reorderRow: string;
125
+ cancel: string;
126
+ reorderSortedTitle: string;
127
+ reorderSortedBody: string;
128
+ reorderSortedConfirm: string;
129
+ reorderInstructions: string;
130
+ reorderPickedUp: string;
131
+ reorderMovedTo: string;
132
+ reorderDropped: string;
133
+ reorderCancelled: string;
101
134
  };
102
135
  "nb-NO": {
103
136
  sortUp: string;
@@ -130,6 +163,17 @@ export declare const translations: {
130
163
  deleteSelectedRows: string;
131
164
  shownInTable: string;
132
165
  hiddenInTable: string;
166
+ clearSorting: string;
167
+ reorderRow: string;
168
+ cancel: string;
169
+ reorderSortedTitle: string;
170
+ reorderSortedBody: string;
171
+ reorderSortedConfirm: string;
172
+ reorderInstructions: string;
173
+ reorderPickedUp: string;
174
+ reorderMovedTo: string;
175
+ reorderDropped: string;
176
+ reorderCancelled: string;
133
177
  };
134
178
  "da-DK": {
135
179
  sortUp: string;
@@ -162,6 +206,17 @@ export declare const translations: {
162
206
  deleteSelectedRows: string;
163
207
  shownInTable: string;
164
208
  hiddenInTable: string;
209
+ clearSorting: string;
210
+ reorderRow: string;
211
+ cancel: string;
212
+ reorderSortedTitle: string;
213
+ reorderSortedBody: string;
214
+ reorderSortedConfirm: string;
215
+ reorderInstructions: string;
216
+ reorderPickedUp: string;
217
+ reorderMovedTo: string;
218
+ reorderDropped: string;
219
+ reorderCancelled: string;
165
220
  };
166
221
  "fr-FR": {
167
222
  sortUp: string;
@@ -194,6 +249,17 @@ export declare const translations: {
194
249
  deleteSelectedRows: string;
195
250
  shownInTable: string;
196
251
  hiddenInTable: string;
252
+ clearSorting: string;
253
+ reorderRow: string;
254
+ cancel: string;
255
+ reorderSortedTitle: string;
256
+ reorderSortedBody: string;
257
+ reorderSortedConfirm: string;
258
+ reorderInstructions: string;
259
+ reorderPickedUp: string;
260
+ reorderMovedTo: string;
261
+ reorderDropped: string;
262
+ reorderCancelled: string;
197
263
  };
198
264
  "nl-BE": {
199
265
  sortUp: string;
@@ -226,6 +292,17 @@ export declare const translations: {
226
292
  deleteSelectedRows: string;
227
293
  shownInTable: string;
228
294
  hiddenInTable: string;
295
+ clearSorting: string;
296
+ reorderRow: string;
297
+ cancel: string;
298
+ reorderSortedTitle: string;
299
+ reorderSortedBody: string;
300
+ reorderSortedConfirm: string;
301
+ reorderInstructions: string;
302
+ reorderPickedUp: string;
303
+ reorderMovedTo: string;
304
+ reorderDropped: string;
305
+ reorderCancelled: string;
229
306
  };
230
307
  };
231
308
  //# sourceMappingURL=translations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../lib/components/table/translations.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1F,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;CAAE,UAE1F;AAmCD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmKxB,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../lib/components/table/translations.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1F,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;CAAE,UAE1F;AAgDD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoOxB,CAAC"}