@caspeco/casper-ui-library 7.9.0 → 7.9.2
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.
|
@@ -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;AAO/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;CACvC;AAED,QAAA,MAAM,iBAAiB,GAAI,KAAK,SAAS,SAAS,EAAE,2HAQjD,iBAAiB,CAAC,KAAK,CAAC,GAAG,eAAe,
|
|
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;AAO/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;CACvC;AAED,QAAA,MAAM,iBAAiB,GAAI,KAAK,SAAS,SAAS,EAAE,2HAQjD,iBAAiB,CAAC,KAAK,CAAC,GAAG,eAAe,4CAsJ5C,CAAC;AAEF,eAAO,MAAM,YAAY,EAA8B,OAAO,iBAAiB,CAAC"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { useVirtualizer as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
import { TableHeaderRow as
|
|
1
|
+
import { jsxs as S, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Table as j, Thead as E, Box as M, Tbody as y } from "@chakra-ui/react";
|
|
3
|
+
import { useVirtualizer as $ } from "../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
4
|
+
import { memo as D, useRef as L, useMemo as u } from "react";
|
|
5
|
+
import { useTableContext as O } from "./table-context.js";
|
|
6
|
+
import { TableHeaderRow as Y } from "./table-header-row.js";
|
|
7
7
|
import { TableRow as v } from "./table-row.js";
|
|
8
|
-
const
|
|
9
|
-
onClickRow:
|
|
10
|
-
onRowClickIndication:
|
|
11
|
-
hideTableHeaderDropdown:
|
|
8
|
+
const k = ({
|
|
9
|
+
onClickRow: m,
|
|
10
|
+
onRowClickIndication: b,
|
|
11
|
+
hideTableHeaderDropdown: w,
|
|
12
12
|
showRowHoverStyle: g = !0,
|
|
13
|
-
stickyHeaders:
|
|
14
|
-
virtualization:
|
|
15
|
-
...
|
|
13
|
+
stickyHeaders: h,
|
|
14
|
+
virtualization: a,
|
|
15
|
+
...R
|
|
16
16
|
}) => {
|
|
17
|
-
const t =
|
|
17
|
+
const t = O(), i = L(null), z = u(() => h ? {
|
|
18
18
|
position: "sticky",
|
|
19
19
|
top: 0,
|
|
20
20
|
zIndex: 1
|
|
21
|
-
} : {}, [
|
|
21
|
+
} : {}, [h]), c = u(
|
|
22
22
|
() => t.table.getRowModel().rows,
|
|
23
23
|
// The dependencies are needed to ensure that the rows are recalculated when any of these change
|
|
24
24
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -29,65 +29,81 @@ const q = ({
|
|
|
29
29
|
t.sorting,
|
|
30
30
|
t.data
|
|
31
31
|
]
|
|
32
|
-
),
|
|
32
|
+
), p = c.length, l = !!a, f = a?.estimateRowHeight ?? 40, x = a?.overscan ?? 5, B = a?.height ?? "600px", H = u(
|
|
33
33
|
() => ({
|
|
34
|
-
count:
|
|
35
|
-
getScrollElement: () =>
|
|
36
|
-
estimateSize: () =>
|
|
37
|
-
overscan:
|
|
38
|
-
enabled:
|
|
34
|
+
count: p,
|
|
35
|
+
getScrollElement: () => i.current,
|
|
36
|
+
estimateSize: () => f,
|
|
37
|
+
overscan: x,
|
|
38
|
+
enabled: l,
|
|
39
|
+
onChange: (o, d) => {
|
|
40
|
+
d && i.current && document.activeElement !== i.current && i.current.focus();
|
|
41
|
+
}
|
|
39
42
|
}),
|
|
40
|
-
[
|
|
41
|
-
),
|
|
42
|
-
if (!
|
|
43
|
-
return /* @__PURE__ */ e(
|
|
44
|
-
const
|
|
43
|
+
[l, f, x, p]
|
|
44
|
+
), C = $(H), n = l ? C.getVirtualItems() : [], I = () => {
|
|
45
|
+
if (!l)
|
|
46
|
+
return /* @__PURE__ */ e(y, { children: c.map((s) => {
|
|
47
|
+
const r = s.getVisibleCells();
|
|
45
48
|
return /* @__PURE__ */ e(
|
|
46
49
|
v,
|
|
47
50
|
{
|
|
48
|
-
row:
|
|
49
|
-
visibleCells:
|
|
50
|
-
onClickRow:
|
|
51
|
-
onRowClickIndication:
|
|
51
|
+
row: s,
|
|
52
|
+
visibleCells: r,
|
|
53
|
+
onClickRow: m,
|
|
54
|
+
onRowClickIndication: b,
|
|
52
55
|
showRowHoverStyle: g
|
|
53
56
|
},
|
|
54
|
-
|
|
57
|
+
s.id
|
|
55
58
|
);
|
|
56
59
|
}) });
|
|
57
|
-
const
|
|
58
|
-
return /* @__PURE__ */ y
|
|
59
|
-
|
|
60
|
-
n.map((
|
|
61
|
-
const
|
|
62
|
-
if (!
|
|
63
|
-
const
|
|
60
|
+
const o = n.length > 0 ? n[0]?.start ?? 0 : 0, d = n.length > 0 ? C.getTotalSize() - (n[n.length - 1]?.end ?? 0) : 0, V = c[0]?.getVisibleCells().length ?? t.table.getVisibleLeafColumns().length;
|
|
61
|
+
return /* @__PURE__ */ S(y, { children: [
|
|
62
|
+
o > 0 && /* @__PURE__ */ e("tr", { style: { height: `${o}px` }, "aria-hidden": "true", children: /* @__PURE__ */ e("td", { colSpan: V }) }),
|
|
63
|
+
n.map((s) => {
|
|
64
|
+
const r = c[s.index];
|
|
65
|
+
if (!r) return null;
|
|
66
|
+
const _ = r.getVisibleCells();
|
|
64
67
|
return /* @__PURE__ */ e(
|
|
65
68
|
v,
|
|
66
69
|
{
|
|
67
|
-
row:
|
|
68
|
-
visibleCells:
|
|
69
|
-
onClickRow:
|
|
70
|
-
onRowClickIndication:
|
|
70
|
+
row: r,
|
|
71
|
+
visibleCells: _,
|
|
72
|
+
onClickRow: m,
|
|
73
|
+
onRowClickIndication: b,
|
|
71
74
|
showRowHoverStyle: g
|
|
72
75
|
},
|
|
73
|
-
|
|
76
|
+
r.id
|
|
74
77
|
);
|
|
75
78
|
}),
|
|
76
|
-
|
|
79
|
+
d > 0 && /* @__PURE__ */ e("tr", { style: { height: `${d}px` }, "aria-hidden": "true", children: /* @__PURE__ */ e("td", { colSpan: V }) })
|
|
77
80
|
] });
|
|
78
|
-
},
|
|
79
|
-
/* @__PURE__ */ e(
|
|
80
|
-
|
|
81
|
+
}, T = /* @__PURE__ */ S(j, { ...R, id: t.id, children: [
|
|
82
|
+
/* @__PURE__ */ e(E, { style: z, children: t.table.getHeaderGroups().map((o) => /* @__PURE__ */ e(
|
|
83
|
+
Y,
|
|
81
84
|
{
|
|
82
|
-
headerGroup:
|
|
83
|
-
hideTableHeaderDropdown:
|
|
85
|
+
headerGroup: o,
|
|
86
|
+
hideTableHeaderDropdown: w
|
|
84
87
|
},
|
|
85
|
-
|
|
88
|
+
o.id
|
|
86
89
|
)) }),
|
|
87
90
|
I()
|
|
88
91
|
] });
|
|
89
|
-
return
|
|
90
|
-
|
|
92
|
+
return l ? /* @__PURE__ */ e(
|
|
93
|
+
M,
|
|
94
|
+
{
|
|
95
|
+
ref: i,
|
|
96
|
+
overflowY: "auto",
|
|
97
|
+
height: B,
|
|
98
|
+
position: "relative",
|
|
99
|
+
tabIndex: -1,
|
|
100
|
+
outline: "none",
|
|
101
|
+
_focus: { outline: "none", boxShadow: "none" },
|
|
102
|
+
_focusVisible: { outline: "none", boxShadow: "none" },
|
|
103
|
+
children: T
|
|
104
|
+
}
|
|
105
|
+
) : T;
|
|
106
|
+
}, P = D(k);
|
|
91
107
|
export {
|
|
92
|
-
|
|
108
|
+
P as TableContent
|
|
93
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/table-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,yBAAyB,EAA8C,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"table-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/table-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,yBAAyB,EAA8C,MAAM,kBAAkB,CAAC;AAmF9G,eAAO,MAAM,WAAW,EAAE,yBAExB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createMultiStyleConfigHelpers as
|
|
2
|
-
import { ThemeColorVariable as o, ThemeSpaceVariable as r, ThemeFontVariable as
|
|
1
|
+
import { createMultiStyleConfigHelpers as a, defineStyle as e } from "@chakra-ui/react";
|
|
2
|
+
import { ThemeColorVariable as o, ThemeSpaceVariable as r, ThemeFontVariable as n } from "../../theme-types.js";
|
|
3
3
|
import { ThemeFontSizeToken as t } from "../theme-tokens.js";
|
|
4
4
|
import { tableAnatomy as l } from "../../../packages/casper-ui-library/node_modules/@chakra-ui/anatomy/dist/esm/components.js";
|
|
5
|
-
const { definePartsStyle: d, defineMultiStyleConfig: i } =
|
|
5
|
+
const { definePartsStyle: d, defineMultiStyleConfig: i } = a(l.keys), p = e({
|
|
6
6
|
position: "relative",
|
|
7
|
-
fontFamily:
|
|
7
|
+
fontFamily: n.Body,
|
|
8
8
|
fontSize: t.Small,
|
|
9
9
|
th: {
|
|
10
10
|
padding: "0px",
|
|
@@ -28,12 +28,14 @@ const { definePartsStyle: d, defineMultiStyleConfig: i } = n(l.keys), b = e({
|
|
|
28
28
|
gap: r.XSmall,
|
|
29
29
|
_last: {
|
|
30
30
|
borderRight: "none"
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"&:has(input)": { padding: "0px !important" },
|
|
33
|
+
"&:has(textarea)": { padding: "0px !important" }
|
|
32
34
|
},
|
|
33
35
|
tr: {
|
|
34
36
|
borderColor: o.OnBackgroundBorder
|
|
35
37
|
}
|
|
36
|
-
}),
|
|
38
|
+
}), b = e({
|
|
37
39
|
cursor: "pointer",
|
|
38
40
|
backgroundColor: o.Surface,
|
|
39
41
|
div: {
|
|
@@ -42,9 +44,9 @@ const { definePartsStyle: d, defineMultiStyleConfig: i } = n(l.keys), b = e({
|
|
|
42
44
|
fontWeight: 400
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
|
-
}),
|
|
47
|
+
}), s = e({
|
|
46
48
|
color: o.OnBackground
|
|
47
|
-
}),
|
|
49
|
+
}), c = e({
|
|
48
50
|
borderTop: "1px solid",
|
|
49
51
|
_first: {
|
|
50
52
|
borderTop: "none"
|
|
@@ -59,14 +61,14 @@ const { definePartsStyle: d, defineMultiStyleConfig: i } = n(l.keys), b = e({
|
|
|
59
61
|
backgroundColor: o.OnBackgroundSubdued
|
|
60
62
|
}
|
|
61
63
|
}), u = d({
|
|
62
|
-
table:
|
|
63
|
-
tfoot:
|
|
64
|
-
th:
|
|
65
|
-
tr:
|
|
64
|
+
table: p,
|
|
65
|
+
tfoot: s,
|
|
66
|
+
th: b,
|
|
67
|
+
tr: c,
|
|
66
68
|
thead: g
|
|
67
|
-
}),
|
|
69
|
+
}), x = i({
|
|
68
70
|
baseStyle: u
|
|
69
71
|
});
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
x as tableConfig
|
|
72
74
|
};
|