@caspeco/casper-ui-library 7.0.0 → 7.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.
|
@@ -106,11 +106,10 @@ function be({
|
|
|
106
106
|
const $ = ce(I), R = (t) => {
|
|
107
107
|
if (!t || x || S)
|
|
108
108
|
return;
|
|
109
|
-
if (t.id === "_back") {
|
|
109
|
+
if (O.current?.parentNode?.querySelector("input")?.focus(), t.id === "_back") {
|
|
110
110
|
f.back();
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
O.current?.parentNode?.querySelector("input")?.focus();
|
|
114
113
|
const d = f.opened.length > 0 && f.opened[f.opened.length - 1]?.id === t.id;
|
|
115
114
|
if (!v && !d && t.children && t.children.length > 0) {
|
|
116
115
|
f.open(t), requestAnimationFrame(() => E.set(1));
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Tr as
|
|
3
|
-
import { memo as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { Tr as T } from "@chakra-ui/react";
|
|
3
|
+
import { memo as x, useMemo as l, useCallback as s } from "react";
|
|
4
4
|
import { TableCell as S } from "./table-cell.js";
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
import { ThemeColorVariable as
|
|
7
|
-
const
|
|
5
|
+
import { useTableContext as h } from "./table-context.js";
|
|
6
|
+
import { ThemeColorVariable as r } from "../../theme/theme-types.js";
|
|
7
|
+
const y = ({
|
|
8
8
|
row: e,
|
|
9
|
-
visibleCells:
|
|
9
|
+
visibleCells: a,
|
|
10
10
|
onClickRow: o,
|
|
11
|
-
showRowHoverStyle:
|
|
12
|
-
onRowClickIndication:
|
|
11
|
+
showRowHoverStyle: i,
|
|
12
|
+
onRowClickIndication: c
|
|
13
13
|
}) => {
|
|
14
|
-
const n =
|
|
14
|
+
const n = h(), u = l(() => ({ backgroundColor: i ? r.AccentHoverAlpha : "unset", ".action-menu-button": { opacity: 1 } }), [i]), g = s(
|
|
15
15
|
(t) => {
|
|
16
16
|
o && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), o(e.original, t));
|
|
17
17
|
},
|
|
18
18
|
[o, e.original]
|
|
19
|
-
),
|
|
19
|
+
), m = s(
|
|
20
20
|
(t) => {
|
|
21
|
-
t.stopPropagation(), e.getToggleSelectedHandler(), o && o(e.original, t),
|
|
21
|
+
t.stopPropagation(), e.getToggleSelectedHandler(), o && o(e.original, t), c && n.setRowSelection({ [t.currentTarget.id]: !0 });
|
|
22
22
|
},
|
|
23
|
-
[e, o,
|
|
24
|
-
),
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
23
|
+
[e, o, c, n]
|
|
24
|
+
), p = l(() => e.getIsSelected() ? r.AccentHoverAlpha : "unset", [e, n.rowSelection]), b = n.getRowActions?.(e.original);
|
|
25
|
+
return /* @__PURE__ */ d(
|
|
26
|
+
T,
|
|
27
27
|
{
|
|
28
28
|
id: e.id,
|
|
29
29
|
tabIndex: o ? 0 : void 0,
|
|
30
|
-
onClick:
|
|
31
|
-
onKeyDown:
|
|
32
|
-
borderTop: e.depth > 0 ? "none" : `1px solid ${
|
|
30
|
+
onClick: m,
|
|
31
|
+
onKeyDown: g,
|
|
32
|
+
borderTop: e.depth > 0 ? "none" : `1px solid ${r.OnBackgroundBorder}`,
|
|
33
33
|
cursor: o ? "pointer" : void 0,
|
|
34
|
-
backgroundColor:
|
|
35
|
-
_hover:
|
|
36
|
-
children:
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */
|
|
34
|
+
backgroundColor: p,
|
|
35
|
+
_hover: u,
|
|
36
|
+
children: a.map((t) => {
|
|
37
|
+
const f = t.column.getIndex() === 0;
|
|
38
|
+
return /* @__PURE__ */ d(
|
|
39
39
|
S,
|
|
40
40
|
{
|
|
41
41
|
cell: t,
|
|
42
|
-
visibleCells:
|
|
42
|
+
visibleCells: a,
|
|
43
43
|
row: e,
|
|
44
44
|
rowIsExpanded: e.getIsExpanded(),
|
|
45
45
|
breakingContentState: n.breakingContentState,
|
|
46
46
|
localeString: n.localeString,
|
|
47
|
-
actionMenu:
|
|
47
|
+
actionMenu: f ? b : void 0
|
|
48
48
|
},
|
|
49
49
|
t.id
|
|
50
50
|
);
|
|
@@ -52,7 +52,7 @@ const A = ({
|
|
|
52
52
|
},
|
|
53
53
|
e.id
|
|
54
54
|
);
|
|
55
|
-
},
|
|
55
|
+
}, k = x(y);
|
|
56
56
|
export {
|
|
57
|
-
|
|
57
|
+
k as TableRow
|
|
58
58
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caspeco/casper-ui-library",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"prettier": "@caspeco/prettier-config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"@testing-library/react": "^16.3.0",
|
|
36
36
|
"@testing-library/user-event": "^14.6.1",
|
|
37
37
|
"@types/jest": "^30.0.0",
|
|
38
|
-
"@types/node": "^24.7.
|
|
38
|
+
"@types/node": "^24.7.2",
|
|
39
39
|
"@types/react": "^18.3.12",
|
|
40
40
|
"@types/react-dom": "^18.3.1",
|
|
41
41
|
"@vitejs/plugin-react-swc": "^4.1.0",
|
|
42
42
|
"eslint": "^9.37.0",
|
|
43
|
-
"eslint-plugin-react-hooks": "^
|
|
43
|
+
"eslint-plugin-react-hooks": "^7.0.0",
|
|
44
44
|
"eslint-plugin-react-refresh": "^0.4.23",
|
|
45
45
|
"globals": "^16.4.0",
|
|
46
46
|
"jsdom": "^27.0.0",
|
|
47
47
|
"tsc-alias": "^1.8.16",
|
|
48
48
|
"typescript": "~5.9.3",
|
|
49
|
-
"typescript-eslint": "^8.
|
|
49
|
+
"typescript-eslint": "^8.46.0",
|
|
50
50
|
"vite": "^7.1.9",
|
|
51
51
|
"vite-plugin-dts": "^4.5.4",
|
|
52
52
|
"vite-tsconfig-paths": "^5.1.4",
|