@caspeco/casper-ui-library 9.0.0 → 9.0.1
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.
- package/dist/components/table/table-content.d.ts.map +1 -1
- package/dist/components/table/table-content.js +35 -32
- package/dist/components/table/table-header-row.d.ts.map +1 -1
- package/dist/components/table/table-header-row.js +34 -33
- package/dist/node_modules/@dnd-kit/dom/index.js +15 -15
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-content.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS/C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnE,UAAU,qBAAqB;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS;IACrE;;OAEG;IACH,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;IAEV;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC;;OAEG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACzD;AAED,KAAK,sBAAsB,CAAC,KAAK,SAAS,SAAS,IAAI,iBAAiB,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC;AAElG,QAAA,MAAM,iBAAiB,GAAI,KAAK,SAAS,SAAS,EAAE,8BAGjD,sBAAsB,CAAC,KAAK,CAAC,4CAM/B,CAAC;
|
|
1
|
+
{"version":3,"file":"table-content.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS/C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnE,UAAU,qBAAqB;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS;IACrE;;OAEG;IACH,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;IAEV;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC;;OAEG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACzD;AAED,KAAK,sBAAsB,CAAC,KAAK,SAAS,SAAS,IAAI,iBAAiB,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC;AAElG,QAAA,MAAM,iBAAiB,GAAI,KAAK,SAAS,SAAS,EAAE,8BAGjD,sBAAsB,CAAC,KAAK,CAAC,4CAM/B,CAAC;AA+MF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAA8B,OAAO,iBAAiB,CAAC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as t, jsxs as x } from "react/jsx-runtime";
|
|
2
2
|
import { Table as h, Box as y } from "@chakra-ui/react";
|
|
3
|
-
import {
|
|
4
|
-
import { DragDropProvider as
|
|
5
|
-
import { useVirtualizer as
|
|
6
|
-
import { memo as
|
|
3
|
+
import { AutoScroller as v, Feedback as D } from "../../node_modules/@dnd-kit/dom/index.js";
|
|
4
|
+
import { DragDropProvider as B } from "../../node_modules/@dnd-kit/react/index.js";
|
|
5
|
+
import { useVirtualizer as H } from "../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
6
|
+
import { memo as I, useMemo as f, useRef as k } from "react";
|
|
7
7
|
import { useTableContext as C } from "./table-context.js";
|
|
8
|
-
import { TableHeaderRow as
|
|
8
|
+
import { TableHeaderRow as E } from "./table-header-row.js";
|
|
9
9
|
import { TableRow as R } from "./table-row.js";
|
|
10
|
-
const
|
|
10
|
+
const M = ({
|
|
11
11
|
virtualization: a,
|
|
12
12
|
...s
|
|
13
|
-
}) => a ? /* @__PURE__ */ t(
|
|
13
|
+
}) => a ? /* @__PURE__ */ t(_, { ...s, virtualization: a }) : /* @__PURE__ */ t(j, { ...s }), _ = ({
|
|
14
14
|
onClickRow: a,
|
|
15
15
|
onRowClickIndication: s,
|
|
16
|
-
showRowHoverStyle:
|
|
16
|
+
showRowHoverStyle: u = !0,
|
|
17
17
|
virtualization: i,
|
|
18
18
|
...r
|
|
19
19
|
}) => {
|
|
20
|
-
const e = C(), o =
|
|
20
|
+
const e = C(), o = k(null), n = f(
|
|
21
21
|
() => e.table.getRowModel().rows,
|
|
22
22
|
// The dependencies are needed to ensure that the rows are recalculated when any of these change
|
|
23
23
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -29,7 +29,7 @@ const E = ({
|
|
|
29
29
|
e.data,
|
|
30
30
|
e.columnOrder
|
|
31
31
|
]
|
|
32
|
-
),
|
|
32
|
+
), c = f(() => {
|
|
33
33
|
const g = i.estimateRowHeight ?? 40, b = i.overscan ?? 5;
|
|
34
34
|
return {
|
|
35
35
|
count: n.length,
|
|
@@ -37,28 +37,28 @@ const E = ({
|
|
|
37
37
|
estimateSize: () => g,
|
|
38
38
|
overscan: b,
|
|
39
39
|
enabled: !0,
|
|
40
|
-
onChange: (w,
|
|
41
|
-
|
|
40
|
+
onChange: (w, d) => {
|
|
41
|
+
d && o.current && document.activeElement !== o.current && o.current.focus();
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
}, [i.estimateRowHeight, i.overscan, n]),
|
|
45
|
-
const g = l.length > 0 ? l[0]?.start ?? 0 : 0, b = l.length > 0 ?
|
|
44
|
+
}, [i.estimateRowHeight, i.overscan, n]), m = H(c), l = m.getVirtualItems(), S = () => {
|
|
45
|
+
const g = l.length > 0 ? l[0]?.start ?? 0 : 0, b = l.length > 0 ? m.getTotalSize() - (l[l.length - 1]?.end ?? 0) : 0, p = n[0]?.getVisibleCells().length ?? e.table.getVisibleLeafColumns().length;
|
|
46
46
|
return /* @__PURE__ */ x(h.Body, { children: [
|
|
47
47
|
g > 0 && /* @__PURE__ */ t("tr", { style: { height: `${g}px` }, "aria-hidden": "true", children: /* @__PURE__ */ t("td", { colSpan: p }) }),
|
|
48
48
|
l.map((w) => {
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
const V =
|
|
49
|
+
const d = n[w.index];
|
|
50
|
+
if (!d) return null;
|
|
51
|
+
const V = d.getVisibleCells();
|
|
52
52
|
return /* @__PURE__ */ t(
|
|
53
53
|
R,
|
|
54
54
|
{
|
|
55
|
-
row:
|
|
55
|
+
row: d,
|
|
56
56
|
visibleCells: V,
|
|
57
57
|
onClickRow: a,
|
|
58
58
|
onRowClickIndication: s,
|
|
59
|
-
showRowHoverStyle:
|
|
59
|
+
showRowHoverStyle: u
|
|
60
60
|
},
|
|
61
|
-
|
|
61
|
+
d.id
|
|
62
62
|
);
|
|
63
63
|
}),
|
|
64
64
|
b > 0 && /* @__PURE__ */ t("tr", { style: { height: `${b}px` }, "aria-hidden": "true", children: /* @__PURE__ */ t("td", { colSpan: p }) })
|
|
@@ -78,10 +78,10 @@ const E = ({
|
|
|
78
78
|
children: /* @__PURE__ */ t(T, { ...r, children: S() })
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
|
-
},
|
|
81
|
+
}, j = ({
|
|
82
82
|
onClickRow: a,
|
|
83
83
|
onRowClickIndication: s,
|
|
84
|
-
showRowHoverStyle:
|
|
84
|
+
showRowHoverStyle: u = !0,
|
|
85
85
|
...i
|
|
86
86
|
}) => {
|
|
87
87
|
const r = C(), e = f(
|
|
@@ -105,7 +105,7 @@ const E = ({
|
|
|
105
105
|
visibleCells: n,
|
|
106
106
|
onClickRow: a,
|
|
107
107
|
onRowClickIndication: s,
|
|
108
|
-
showRowHoverStyle:
|
|
108
|
+
showRowHoverStyle: u
|
|
109
109
|
},
|
|
110
110
|
o.id
|
|
111
111
|
);
|
|
@@ -113,34 +113,37 @@ const E = ({
|
|
|
113
113
|
}, T = ({
|
|
114
114
|
hideTableHeaderDropdown: a,
|
|
115
115
|
stickyHeaders: s,
|
|
116
|
-
portalContainerRef:
|
|
116
|
+
portalContainerRef: u,
|
|
117
117
|
children: i,
|
|
118
118
|
...r
|
|
119
119
|
}) => {
|
|
120
120
|
const e = C(), o = /* @__PURE__ */ x(h.Root, { ...r, id: e.id, children: [
|
|
121
121
|
/* @__PURE__ */ t(h.Header, { "data-sticky-headers": s, children: e.table.getHeaderGroups().map((n) => /* @__PURE__ */ t(
|
|
122
|
-
|
|
122
|
+
E,
|
|
123
123
|
{
|
|
124
124
|
headerGroup: n,
|
|
125
125
|
hideTableHeaderDropdown: a,
|
|
126
|
-
portalContainerRef:
|
|
126
|
+
portalContainerRef: u
|
|
127
127
|
},
|
|
128
128
|
n.id
|
|
129
129
|
)) }),
|
|
130
130
|
i
|
|
131
131
|
] });
|
|
132
132
|
return e.enableColumnReorder ? /* @__PURE__ */ t(
|
|
133
|
-
|
|
133
|
+
B,
|
|
134
134
|
{
|
|
135
135
|
onDragEnd: (n) => {
|
|
136
|
-
const { operation:
|
|
137
|
-
|
|
136
|
+
const { operation: c } = n, m = String(c.source?.id), l = String(c.target?.id);
|
|
137
|
+
m !== l && e.handleDragEnd(m, l);
|
|
138
138
|
},
|
|
139
|
-
plugins: (n) => [
|
|
139
|
+
plugins: (n) => [
|
|
140
|
+
...n.filter((c) => c !== v),
|
|
141
|
+
D.configure({ dropAnimation: null })
|
|
142
|
+
],
|
|
140
143
|
children: o
|
|
141
144
|
}
|
|
142
145
|
) : o;
|
|
143
|
-
},
|
|
146
|
+
}, q = I(M);
|
|
144
147
|
export {
|
|
145
|
-
|
|
148
|
+
q as TableContent
|
|
146
149
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-header-row.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-row.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAK/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;
|
|
1
|
+
{"version":3,"file":"table-header-row.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-row.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAK/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;AA6OF,eAAO,MAAM,cAAc,EAAoC,OAAO,uBAAuB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { closestCenter as D } from "../../node_modules/@dnd-kit/collision/dist/i
|
|
|
4
4
|
import { SortableKeyboardPlugin as z } from "../../node_modules/@dnd-kit/dom/sortable.js";
|
|
5
5
|
import { useSortable as H } from "../../node_modules/@dnd-kit/react/sortable.js";
|
|
6
6
|
import { flexRender as P } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
7
|
-
import { memo as V, useCallback as
|
|
7
|
+
import { memo as V, useCallback as k, useMemo as F } from "react";
|
|
8
8
|
import { useTableContext as u } from "./table-context.js";
|
|
9
9
|
import { TableHeaderDropdown as L } from "./table-header-dropdown.js";
|
|
10
10
|
import { translations as B } from "./translations.js";
|
|
@@ -12,14 +12,14 @@ import { Flex as I } from "../flex/flex.js";
|
|
|
12
12
|
import { Divider as O } from "../divider/divider.js";
|
|
13
13
|
import { Menu as j } from "../menu/menu.js";
|
|
14
14
|
import { MenuButton as N } from "../menu/menu-button.js";
|
|
15
|
-
import { MenuList as
|
|
16
|
-
import { Checkbox as
|
|
17
|
-
import { MenuItem as
|
|
15
|
+
import { MenuList as W } from "../menu/menu-list.js";
|
|
16
|
+
import { Checkbox as $ } from "../checkbox/checkbox.js";
|
|
17
|
+
import { MenuItem as E } from "../menu/menu-item.js";
|
|
18
18
|
import { IconButton as K } from "../icon-button/icon-button.js";
|
|
19
19
|
import { DeleteIcon as Q } from "../icon/icons/delete-icon.js";
|
|
20
|
-
import { Button as
|
|
21
|
-
import { ThemeColorVariable as
|
|
22
|
-
import { TreeViewCollapseIcon as
|
|
20
|
+
import { Button as U } from "../button/button.js";
|
|
21
|
+
import { ThemeColorVariable as m, ThemeSpaceVariable as h, ThemeFontSizeVariable as q, ThemeFontVariable as G } from "../../theme/theme-types.js";
|
|
22
|
+
import { TreeViewCollapseIcon as J } from "../icon/icons/tree-view-collapse-icon.js";
|
|
23
23
|
const X = ({
|
|
24
24
|
headerGroup: t,
|
|
25
25
|
hideTableHeaderDropdown: r,
|
|
@@ -36,9 +36,9 @@ const X = ({
|
|
|
36
36
|
backgroundColor: "transparent !important"
|
|
37
37
|
},
|
|
38
38
|
"& div span": {
|
|
39
|
-
color:
|
|
39
|
+
color: m.OnBackground
|
|
40
40
|
},
|
|
41
|
-
borderBottom: `1px solid ${
|
|
41
|
+
borderBottom: `1px solid ${m.OnBackgroundBorder}`,
|
|
42
42
|
paddingLeft: a ? "24px" : void 0
|
|
43
43
|
},
|
|
44
44
|
scope: "col",
|
|
@@ -67,7 +67,7 @@ const X = ({
|
|
|
67
67
|
}) => {
|
|
68
68
|
const o = u(), { column: n } = t, c = i && !n.columnDef.meta?.disableColumnReorder, {
|
|
69
69
|
ref: S,
|
|
70
|
-
isDragging:
|
|
70
|
+
isDragging: d,
|
|
71
71
|
isDropTarget: M
|
|
72
72
|
} = H({
|
|
73
73
|
id: n.id,
|
|
@@ -75,15 +75,15 @@ const X = ({
|
|
|
75
75
|
disabled: !c,
|
|
76
76
|
collisionDetector: D,
|
|
77
77
|
plugins: [z]
|
|
78
|
-
}), y =
|
|
79
|
-
const p = b.getIsPinned(),
|
|
78
|
+
}), y = k((b) => {
|
|
79
|
+
const p = b.getIsPinned(), R = b.getSize();
|
|
80
80
|
return {
|
|
81
81
|
position: p ? "sticky" : "relative",
|
|
82
82
|
left: p ? `${b.getStart("left")}px` : void 0,
|
|
83
|
-
backgroundColor: p ?
|
|
83
|
+
backgroundColor: p ? m.Background : void 0,
|
|
84
84
|
zIndex: p ? 1 : 0,
|
|
85
|
-
width:
|
|
86
|
-
maxWidth:
|
|
85
|
+
width: R,
|
|
86
|
+
maxWidth: R
|
|
87
87
|
};
|
|
88
88
|
}, []);
|
|
89
89
|
return /* @__PURE__ */ e(
|
|
@@ -92,14 +92,15 @@ const X = ({
|
|
|
92
92
|
className: "tableHeaderCell",
|
|
93
93
|
textAlign: n.columnDef.meta?.isNumeric ? "end" : "start",
|
|
94
94
|
zIndex: n.getIsPinned() ? 2 : 1,
|
|
95
|
-
cursor: i ?
|
|
96
|
-
opacity:
|
|
97
|
-
backgroundColor: M ?
|
|
95
|
+
cursor: i ? d ? "grabbing" : "pointer" : void 0,
|
|
96
|
+
opacity: d ? 0.5 : 1,
|
|
97
|
+
backgroundColor: M || d ? m.Background : void 0,
|
|
98
98
|
scope: "col",
|
|
99
99
|
style: {
|
|
100
100
|
...y(n),
|
|
101
|
-
borderBottom: `1px solid ${
|
|
102
|
-
paddingLeft: a && s ? "24px" : void 0
|
|
101
|
+
borderBottom: `1px solid ${m.OnBackgroundBorder}`,
|
|
102
|
+
paddingLeft: a && s ? "24px" : void 0,
|
|
103
|
+
...c ? { userSelect: "none", WebkitUserSelect: "none" } : {}
|
|
103
104
|
},
|
|
104
105
|
children: /* @__PURE__ */ e(v, { showSelectAll: o.canSelectRows && a, children: /* @__PURE__ */ e(f, { children: r ? /* @__PURE__ */ e(g, { paddingLeft: h.Small, children: P(t.column.columnDef.header, t.getContext()) }) : /* @__PURE__ */ e(
|
|
105
106
|
L,
|
|
@@ -123,21 +124,21 @@ const X = ({
|
|
|
123
124
|
/* @__PURE__ */ e(g, { justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Z, {}) }),
|
|
124
125
|
r
|
|
125
126
|
] }) : /* @__PURE__ */ e(f, { children: r }), Z = () => {
|
|
126
|
-
const t = u(), r =
|
|
127
|
+
const t = u(), r = k(
|
|
127
128
|
({ checked: a }) => {
|
|
128
129
|
const i = typeof a == "boolean" ? a : !1, o = t.getSelectableRowIds();
|
|
129
130
|
i ? t.setSelectedRowIds((n) => [.../* @__PURE__ */ new Set([...n, ...o])]) : t.setSelectedRowIds((n) => n.filter((c) => !o.includes(c)));
|
|
130
131
|
},
|
|
131
132
|
[t]
|
|
132
133
|
), { allIsSelected: s, shouldShowIndeterminateState: l } = F(() => {
|
|
133
|
-
const i = t.table.getRowModel().flatRows, o = new Set(t.selectedRowIds), n = t.getSelectableRowIds(), c = n.length > 0 && n.every((
|
|
134
|
+
const i = t.table.getRowModel().flatRows, o = new Set(t.selectedRowIds), n = t.getSelectableRowIds(), c = n.length > 0 && n.every((d) => o.has(d)), S = i.some((d) => o.has(d.id));
|
|
134
135
|
return {
|
|
135
136
|
allIsSelected: c,
|
|
136
137
|
shouldShowIndeterminateState: S && !c
|
|
137
138
|
};
|
|
138
139
|
}, [t]);
|
|
139
140
|
return /* @__PURE__ */ e(
|
|
140
|
-
|
|
141
|
+
$,
|
|
141
142
|
{
|
|
142
143
|
isChecked: s,
|
|
143
144
|
isIndeterminate: l,
|
|
@@ -151,9 +152,9 @@ const X = ({
|
|
|
151
152
|
g,
|
|
152
153
|
{
|
|
153
154
|
pl: h.Small,
|
|
154
|
-
color:
|
|
155
|
-
fontFamily:
|
|
156
|
-
fontSize:
|
|
155
|
+
color: m.OnBackground,
|
|
156
|
+
fontFamily: G.Body,
|
|
157
|
+
fontSize: q.Medium,
|
|
157
158
|
whiteSpace: "nowrap",
|
|
158
159
|
css: { fontVariantNumeric: "normal" },
|
|
159
160
|
children: o
|
|
@@ -161,15 +162,15 @@ const X = ({
|
|
|
161
162
|
),
|
|
162
163
|
/* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(O, { orientation: "vertical", height: "20px" }) }),
|
|
163
164
|
/* @__PURE__ */ e(I, { gap: h.Small, align: "center", children: i ? /* @__PURE__ */ w(j, { children: [
|
|
164
|
-
/* @__PURE__ */ e(N, { variant: "ghost", rightIcon:
|
|
165
|
-
/* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(
|
|
165
|
+
/* @__PURE__ */ e(N, { variant: "ghost", rightIcon: J, size: "sm", children: l.action }),
|
|
166
|
+
/* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(W, { children: s.map((n) => /* @__PURE__ */ e(x, { isMenuItem: !0, action: n }, n.name)) }) })
|
|
166
167
|
] }) : s.map((n) => /* @__PURE__ */ e(x, { isMenuItem: !1, action: n }, n.name)) })
|
|
167
168
|
] });
|
|
168
169
|
}, x = ({ isMenuItem: t, action: r }) => {
|
|
169
|
-
const { selectedRowIds: s, localeString: l } = u(), a = B[l], i =
|
|
170
|
+
const { selectedRowIds: s, localeString: l } = u(), a = B[l], i = k(() => {
|
|
170
171
|
r.onClick(s || []);
|
|
171
172
|
}, [r, s]);
|
|
172
|
-
return t ? /* @__PURE__ */ e(
|
|
173
|
+
return t ? /* @__PURE__ */ e(E, { onClick: i, value: r.name, children: r.variant === "delete" ? /* @__PURE__ */ e(g, { as: "span", color: m.Error, children: r.name }) : r.name }) : r.variant === "delete" ? /* @__PURE__ */ e(
|
|
173
174
|
K,
|
|
174
175
|
{
|
|
175
176
|
onClick: i,
|
|
@@ -178,8 +179,8 @@ const X = ({
|
|
|
178
179
|
size: "sm",
|
|
179
180
|
variant: "ghost"
|
|
180
181
|
}
|
|
181
|
-
) : /* @__PURE__ */ e(
|
|
182
|
-
},
|
|
182
|
+
) : /* @__PURE__ */ e(U, { onClick: i, size: "sm", variant: "ghost", children: r.name });
|
|
183
|
+
}, ke = V(X);
|
|
183
184
|
export {
|
|
184
|
-
|
|
185
|
+
ke as TableHeaderRow
|
|
185
186
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Plugin as ue, DragDropManager as ur, resolveCustomizable as qe, Sensor as Te, ActivationController as hr, CorePlugin as ft, descriptor as fr, Droppable as pr, Draggable as vr, configurator as pt, ActivationConstraint as an } from "../abstract/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { canScroll as mr, detectScrollIntent as gr, scheduler as $e, isKeyboardEvent as vt, getRoot as Me, generateUniqueId as et, isSafari as br, Listeners as ln, isElement as le, isHTMLElement as cn, getFrameTransform as Ie, getEventCoordinates as ce, getDocuments as yr, getDocument as Ne, scrollIntoViewIfNeeded as _r, DOMRectangle as N, ScrollDirection as R, getScrollableAncestors as Ht, isInteractiveElement as wr, isTextInput as Sr, PositionObserver as Er, isDocument as xr, isShadowRoot as kr, getComputedStyles as dn, parseTranslate as un, getFixedPositionOffset as hn, Styles as Ar, supportsPopover as Vt, showPopover as we, getWindow as fn, prefersReducedMotion as pn, getElementFromPoint as Dr, isPointerEvent as Or, getFrameElement as qt, cloneElement as Cr, supportsStyle as Gt, getFinalKeyframe as Pr, animateTransform as Tr, ProxiedElements as Jt } from "./utilities.js";
|
|
3
3
|
import { computed as tt, deepEqual as $r, effects as Mr, reactive as F, derived as Ge } from "../state/dist/index.js";
|
|
4
4
|
import { Axes as vn, Point as Ir, Rectangle as mn, exceedsDistance as nt } from "../geometry/dist/index.js";
|
|
5
5
|
import { defaultCollisionDetection as Rr } from "../collision/dist/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { effect as J, untracked as M, signal as gn, batch as Wr } from "../../@preact/signals-core/dist/signals-core.module.js";
|
|
7
7
|
var Lr = Object.create, mt = Object.defineProperty, Fr = Object.defineProperties, zr = Object.getOwnPropertyDescriptor, Nr = Object.getOwnPropertyDescriptors, Re = Object.getOwnPropertySymbols, bn = Object.prototype.hasOwnProperty, yn = Object.prototype.propertyIsEnumerable, _n = (e, t) => (t = Symbol[e]) ? t : /* @__PURE__ */ Symbol.for("Symbol." + e), he = (e) => {
|
|
8
8
|
throw TypeError(e);
|
|
9
9
|
}, rt = (e, t, n) => t in e ? mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Se = (e, t) => {
|
|
@@ -84,7 +84,7 @@ var Gr = ["dragover", "dragmove"], Jr = class extends ue {
|
|
|
84
84
|
let d, c, h, u;
|
|
85
85
|
const p = (v = u) => {
|
|
86
86
|
!h || !v || h?.nodeValue !== v && (h.nodeValue = v);
|
|
87
|
-
}, w = () =>
|
|
87
|
+
}, w = () => $e.schedule(p), k = Qr(
|
|
88
88
|
w,
|
|
89
89
|
a
|
|
90
90
|
), C = Object.entries(s).map(
|
|
@@ -114,7 +114,7 @@ var Gr = ["dragover", "dragmove"], Jr = class extends ue {
|
|
|
114
114
|
for (const P of this.manager.registry.draggables.value) {
|
|
115
115
|
const S = (v = P.handle) != null ? v : P.element;
|
|
116
116
|
if (S) {
|
|
117
|
-
(!d || !c) && g.add(b), (!Hr(S) ||
|
|
117
|
+
(!d || !c) && g.add(b), (!Hr(S) || br()) && !S.hasAttribute("tabindex") && g.add(() => S.setAttribute("tabindex", "0")), !S.hasAttribute("role") && S.tagName.toLowerCase() !== "button" && g.add(
|
|
118
118
|
() => S.setAttribute("role", Zt.role)
|
|
119
119
|
), S.hasAttribute("aria-roledescription") || g.add(
|
|
120
120
|
() => S.setAttribute(
|
|
@@ -134,7 +134,7 @@ var Gr = ["dragover", "dragmove"], Jr = class extends ue {
|
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
g.size > 0 &&
|
|
137
|
+
g.size > 0 && $e.schedule(m);
|
|
138
138
|
}), this.destroy = () => {
|
|
139
139
|
super.destroy(), d?.remove(), c?.remove(), C.forEach((v) => v());
|
|
140
140
|
};
|
|
@@ -199,12 +199,12 @@ var Zr = class extends ue {
|
|
|
199
199
|
get sourceRoot() {
|
|
200
200
|
var e;
|
|
201
201
|
const { source: t } = this.manager.dragOperation;
|
|
202
|
-
return
|
|
202
|
+
return Me((e = t?.element) != null ? e : null);
|
|
203
203
|
}
|
|
204
204
|
get targetRoot() {
|
|
205
205
|
var e;
|
|
206
206
|
const { target: t } = this.manager.dragOperation;
|
|
207
|
-
return
|
|
207
|
+
return Me((e = t?.element) != null ? e : null);
|
|
208
208
|
}
|
|
209
209
|
get roots() {
|
|
210
210
|
const { status: e } = this.manager.dragOperation;
|
|
@@ -577,7 +577,7 @@ Pe = /* @__PURE__ */ new WeakSet();
|
|
|
577
577
|
Mn = function(e) {
|
|
578
578
|
const { overlay: t } = this;
|
|
579
579
|
if (!t || !e) return;
|
|
580
|
-
const n =
|
|
580
|
+
const n = Me(t);
|
|
581
581
|
if (n)
|
|
582
582
|
return e.addRoot(n);
|
|
583
583
|
};
|
|
@@ -869,9 +869,9 @@ var zn, lt, Ae, Et, Y, ct, Ke = class extends (lt = ft, zn = [F], lt) {
|
|
|
869
869
|
if (h?.isLocked())
|
|
870
870
|
return !1;
|
|
871
871
|
for (const u of a) {
|
|
872
|
-
const p =
|
|
872
|
+
const p = mr(u, d);
|
|
873
873
|
if (p.x || p.y) {
|
|
874
|
-
const { speed: w, direction: k } =
|
|
874
|
+
const { speed: w, direction: k } = gr(
|
|
875
875
|
u,
|
|
876
876
|
f,
|
|
877
877
|
c
|
|
@@ -891,7 +891,7 @@ var zn, lt, Ae, Et, Y, ct, Ke = class extends (lt = ft, zn = [F], lt) {
|
|
|
891
891
|
x: g,
|
|
892
892
|
y: m
|
|
893
893
|
}
|
|
894
|
-
}),
|
|
894
|
+
}), $e.schedule(y(this, ct)), !0;
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
897
|
}
|
|
@@ -905,7 +905,7 @@ var zn, lt, Ae, Et, Y, ct, Ke = class extends (lt = ft, zn = [F], lt) {
|
|
|
905
905
|
if (!s)
|
|
906
906
|
return null;
|
|
907
907
|
const a = Dr(
|
|
908
|
-
|
|
908
|
+
Me(o?.element),
|
|
909
909
|
s.current
|
|
910
910
|
);
|
|
911
911
|
return a && (t = a), a ?? t;
|
|
@@ -1075,7 +1075,7 @@ var be = Object.freeze({
|
|
|
1075
1075
|
const { element: i } = n;
|
|
1076
1076
|
if (!i)
|
|
1077
1077
|
throw new Error("Source draggable does not have an associated element");
|
|
1078
|
-
t.preventDefault(), t.stopImmediatePropagation(),
|
|
1078
|
+
t.preventDefault(), t.stopImmediatePropagation(), _r(i);
|
|
1079
1079
|
const { center: s } = new N(i);
|
|
1080
1080
|
if (this.manager.actions.start({
|
|
1081
1081
|
event: t,
|
|
@@ -1291,7 +1291,7 @@ var dt = Object.freeze({
|
|
|
1291
1291
|
(w) => this.handleStart(n, w)
|
|
1292
1292
|
);
|
|
1293
1293
|
c.signal.onabort = () => this.handleCancel(t), c.onEvent(t), this.controller = c;
|
|
1294
|
-
const h =
|
|
1294
|
+
const h = yr(), u = this.listeners.bind(h, [
|
|
1295
1295
|
{
|
|
1296
1296
|
type: "pointermove",
|
|
1297
1297
|
listener: (w) => this.handlePointerMove(w, n)
|
|
@@ -1328,7 +1328,7 @@ var dt = Object.freeze({
|
|
|
1328
1328
|
}
|
|
1329
1329
|
if (this.manager.dragOperation.status.dragging) {
|
|
1330
1330
|
const s = ce(t), o = Ie(n.element);
|
|
1331
|
-
s.x = s.x * o.scaleX + o.x, s.y = s.y * o.scaleY + o.y, t.preventDefault(), t.stopPropagation(), this.latest.event = t, this.latest.coordinates = s,
|
|
1331
|
+
s.x = s.x * o.scaleX + o.x, s.y = s.y * o.scaleY + o.y, t.preventDefault(), t.stopPropagation(), this.latest.event = t, this.latest.coordinates = s, $e.schedule(this.handleMove);
|
|
1332
1332
|
}
|
|
1333
1333
|
}
|
|
1334
1334
|
handlePointerUp(t) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caspeco/casper-ui-library",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"prettier": "@caspeco/prettier-config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -69,7 +69,9 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@chakra-ui/anatomy": "^2.3.4",
|
|
72
|
+
"@dnd-kit/abstract": "^0.3.2",
|
|
72
73
|
"@dnd-kit/collision": "^0.3.2",
|
|
74
|
+
"@dnd-kit/dom": "^0.3.2",
|
|
73
75
|
"@dnd-kit/react": "^0.3.2",
|
|
74
76
|
"@floating-ui/dom": "^1.7.6",
|
|
75
77
|
"@tanstack/react-table": "^8.21.3",
|