@alphakits/ui 2.4.0 → 2.4.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.
- package/dist/form/templates/rest-form/form.js +67 -65
- package/dist/modal/components/modals/modal.js +40 -39
- package/dist/modal/context.js +30 -33
- package/dist/modal/hooks/use-modal.js +42 -39
- package/dist/popover/component.js +63 -65
- package/dist/table/components/empty-list/index.d.ts +2 -1
- package/dist/table/components/empty-list/index.js +6 -3
- package/dist/table/components/error/index.d.ts +2 -1
- package/dist/table/components/error/index.js +8 -5
- package/dist/table/hooks/use-table-data.d.ts +1 -1
- package/dist/table/hooks/use-table-data.js +66 -62
- package/dist/table/index.css +1 -1
- package/dist/table/table.js +96 -96
- package/package.json +1 -1
|
@@ -1,109 +1,111 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Flex as
|
|
6
|
-
import { FlexColumns as
|
|
7
|
-
import { IconButton as
|
|
8
|
-
import { ModalContext as
|
|
9
|
-
import { Sidepanel as
|
|
10
|
-
import { ToastPlate as
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import V from "@alphakits/icons/dist/TrashM";
|
|
3
|
+
import D, { useContext as H, useRef as q, useCallback as x, useEffect as G } from "react";
|
|
4
|
+
import { Button as F } from "../../../button/component.js";
|
|
5
|
+
import { Flex as J } from "../../../flex/component.js";
|
|
6
|
+
import { FlexColumns as K } from "../../../flex-columns/component.js";
|
|
7
|
+
import { IconButton as L } from "../../../icon-button/component.js";
|
|
8
|
+
import { ModalContext as N } from "../../../modal/context.js";
|
|
9
|
+
import { Sidepanel as O } from "../../../sidepanel/component.js";
|
|
10
|
+
import { ToastPlate as I } from "../../../toast-plate/component.js";
|
|
11
11
|
function ie({
|
|
12
|
-
recordId:
|
|
13
|
-
title:
|
|
12
|
+
recordId: R,
|
|
13
|
+
title: M,
|
|
14
14
|
subtitle: T,
|
|
15
|
-
headerBottomAddons:
|
|
15
|
+
headerBottomAddons: b,
|
|
16
16
|
initialValues: w,
|
|
17
17
|
submitButtonText: y,
|
|
18
|
-
customFooter:
|
|
19
|
-
loading:
|
|
20
|
-
updating:
|
|
18
|
+
customFooter: B,
|
|
19
|
+
loading: n,
|
|
20
|
+
updating: i,
|
|
21
21
|
removing: s,
|
|
22
|
-
customValidationFields:
|
|
23
|
-
validate:
|
|
24
|
-
save:
|
|
22
|
+
customValidationFields: Q,
|
|
23
|
+
validate: U,
|
|
24
|
+
save: W,
|
|
25
25
|
remove: a,
|
|
26
|
-
close:
|
|
27
|
-
back:
|
|
26
|
+
close: S,
|
|
27
|
+
back: z,
|
|
28
28
|
t: r,
|
|
29
|
-
children:
|
|
30
|
-
headerAddon:
|
|
31
|
-
error:
|
|
29
|
+
children: P,
|
|
30
|
+
headerAddon: h,
|
|
31
|
+
error: X,
|
|
32
32
|
softError: d,
|
|
33
|
-
...
|
|
33
|
+
...g
|
|
34
34
|
}) {
|
|
35
|
-
const { setModalDirty: e, currentModalId:
|
|
35
|
+
const { setModalDirty: e, currentModalId: l } = H(N), c = q("");
|
|
36
|
+
!c.current && l && (c.current = l);
|
|
37
|
+
const t = c.current || l, { submitCount: m, handleSubmit: C, isValid: f, ...u } = g, v = !!R && !!a, k = x(
|
|
36
38
|
() => {
|
|
37
|
-
e(
|
|
39
|
+
e(t, !1), C();
|
|
38
40
|
},
|
|
39
41
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
-
[
|
|
41
|
-
),
|
|
42
|
-
e(
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
[t, e, C]
|
|
43
|
+
), j = x(() => {
|
|
44
|
+
e(t, !1), confirm(r("common:deleteConfirm")) && a?.();
|
|
45
|
+
}, [t, r, e, a]);
|
|
46
|
+
G(() => {
|
|
47
|
+
n || e(t, u.dirty);
|
|
48
|
+
}, [u.dirty, n, t, e]);
|
|
49
|
+
const A = v || h ? /* @__PURE__ */ p(D.Fragment, { children: [
|
|
50
|
+
h,
|
|
51
|
+
v && /* @__PURE__ */ o(
|
|
52
|
+
L,
|
|
51
53
|
{
|
|
52
54
|
dataTestId: "removeTariffBtn",
|
|
53
55
|
size: "m",
|
|
54
|
-
disabled:
|
|
56
|
+
disabled: i,
|
|
55
57
|
loading: s,
|
|
56
|
-
onClick:
|
|
57
|
-
icon:
|
|
58
|
+
onClick: j,
|
|
59
|
+
icon: V
|
|
58
60
|
}
|
|
59
61
|
)
|
|
60
62
|
] }) : null;
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
|
|
63
|
+
return /* @__PURE__ */ o(
|
|
64
|
+
O,
|
|
63
65
|
{
|
|
64
|
-
headerRightAddons:
|
|
65
|
-
title:
|
|
66
|
+
headerRightAddons: A,
|
|
67
|
+
title: M,
|
|
66
68
|
subtitle: T,
|
|
67
|
-
loading:
|
|
68
|
-
headerBottomAddons: (
|
|
69
|
-
|
|
70
|
-
!!d && /* @__PURE__ */
|
|
71
|
-
!
|
|
69
|
+
loading: i || s || n,
|
|
70
|
+
headerBottomAddons: (b || !!d || !f && !!m) && /* @__PURE__ */ p(K, { columns: 1, gr: 8, children: [
|
|
71
|
+
b,
|
|
72
|
+
!!d && /* @__PURE__ */ o(I, { view: "negative", children: d }),
|
|
73
|
+
!f && !!m && /* @__PURE__ */ o(I, { view: "negative", children: "Please correct errors before submitting form." })
|
|
72
74
|
] }),
|
|
73
|
-
back:
|
|
75
|
+
back: z,
|
|
74
76
|
t: r,
|
|
75
|
-
bottomAddons:
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
|
|
77
|
+
bottomAddons: B || /* @__PURE__ */ p(J, { gap: "md", children: [
|
|
78
|
+
/* @__PURE__ */ o(
|
|
79
|
+
F,
|
|
78
80
|
{
|
|
79
81
|
view: "primary",
|
|
80
82
|
size: "s",
|
|
81
83
|
block: !0,
|
|
82
|
-
loading:
|
|
83
|
-
disabled:
|
|
84
|
+
loading: n,
|
|
85
|
+
disabled: i || s,
|
|
84
86
|
dataTestId: "buttonSave",
|
|
85
|
-
onClick: () =>
|
|
87
|
+
onClick: () => k(),
|
|
86
88
|
children: r(y || "save")
|
|
87
89
|
}
|
|
88
90
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
91
|
+
/* @__PURE__ */ o(
|
|
92
|
+
F,
|
|
91
93
|
{
|
|
92
94
|
block: !0,
|
|
93
95
|
view: "secondary",
|
|
94
96
|
size: "s",
|
|
95
97
|
dataTestId: "buttonCancel",
|
|
96
|
-
onClick:
|
|
98
|
+
onClick: S,
|
|
97
99
|
children: r("cancel")
|
|
98
100
|
}
|
|
99
101
|
)
|
|
100
102
|
] }),
|
|
101
|
-
children:
|
|
102
|
-
submitCount:
|
|
103
|
-
isValid:
|
|
104
|
-
handleSubmit:
|
|
103
|
+
children: P({
|
|
104
|
+
submitCount: m,
|
|
105
|
+
isValid: f,
|
|
106
|
+
handleSubmit: k,
|
|
105
107
|
initialValues: w,
|
|
106
|
-
...
|
|
108
|
+
...u
|
|
107
109
|
})
|
|
108
110
|
}
|
|
109
111
|
);
|
|
@@ -1,78 +1,79 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as h, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import y from "classnames";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { ButtonArrow as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
3
|
+
import { useState as E, useLayoutEffect as g, useCallback as k, useEffect as v } from "react";
|
|
4
|
+
import { ButtonArrow as x } from "../../../button-arrow/component.js";
|
|
5
|
+
import t from "./index.module.css.js";
|
|
6
|
+
const C = {
|
|
7
7
|
s: 488,
|
|
8
8
|
m: 888,
|
|
9
9
|
full: "96%"
|
|
10
|
-
},
|
|
11
|
-
const c =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
}, w = 102, F = (e) => e === "full" ? `calc(-96vw - ${w}px)` : -C[e] - w, O = ({ modal: e, t: f, index: l, dirtyModals: p, closeModal: a, currentModalId: r }) => {
|
|
11
|
+
const c = F(e.props.size), [b, m] = E(c);
|
|
12
|
+
g(() => {
|
|
13
|
+
const s = requestAnimationFrame(() => m(0));
|
|
14
|
+
return () => cancelAnimationFrame(s);
|
|
15
|
+
}, [e.id]);
|
|
16
|
+
const u = k(
|
|
16
17
|
(s) => (
|
|
17
18
|
// eslint-disable-next-line no-restricted-globals
|
|
18
|
-
!
|
|
19
|
+
!p[s] || confirm(f("common:exitConfirm"))
|
|
19
20
|
),
|
|
20
21
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
|
-
[
|
|
22
|
-
),
|
|
22
|
+
[p, f]
|
|
23
|
+
), n = k(
|
|
23
24
|
(s) => {
|
|
24
|
-
const { id:
|
|
25
|
-
u(s ||
|
|
26
|
-
e.props.closeCallback && e.props.closeCallback(),
|
|
25
|
+
const { id: o } = e;
|
|
26
|
+
u(s || o) && (m(c), setTimeout(() => {
|
|
27
|
+
e.props.closeCallback && e.props.closeCallback(), a(s || o);
|
|
27
28
|
}, 250));
|
|
28
29
|
},
|
|
29
|
-
[
|
|
30
|
+
[a, u, e, c]
|
|
30
31
|
);
|
|
31
|
-
return
|
|
32
|
-
const s = (
|
|
33
|
-
(
|
|
32
|
+
return v(() => {
|
|
33
|
+
const s = (o) => {
|
|
34
|
+
(o.key === "27" || o.key === "Escape") && n(r);
|
|
34
35
|
};
|
|
35
36
|
return e.id === r && window?.addEventListener("keydown", s), () => {
|
|
36
37
|
window?.removeEventListener("keydown", s);
|
|
37
38
|
};
|
|
38
|
-
}, [
|
|
39
|
+
}, [n, r, e.id]), /* @__PURE__ */ h(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
|
-
className:
|
|
42
|
+
className: t.container,
|
|
42
43
|
style: {
|
|
43
|
-
zIndex: 9999998 +
|
|
44
|
+
zIndex: 9999998 + l
|
|
44
45
|
},
|
|
45
46
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ i(
|
|
47
48
|
"div",
|
|
48
49
|
{
|
|
49
|
-
className: y(
|
|
50
|
+
className: y(t.right, t.content),
|
|
50
51
|
style: {
|
|
51
|
-
zIndex: 9999999 +
|
|
52
|
-
width:
|
|
53
|
-
right:
|
|
52
|
+
zIndex: 9999999 + l,
|
|
53
|
+
width: C[e.props.size],
|
|
54
|
+
right: b
|
|
54
55
|
},
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
e.props.showCloser !== !1 && /* @__PURE__ */
|
|
58
|
-
|
|
56
|
+
children: /* @__PURE__ */ h("div", { className: t.inner, children: [
|
|
57
|
+
/* @__PURE__ */ i(e.modal, { ...e.props, close: () => n() }),
|
|
58
|
+
e.props.showCloser !== !1 && /* @__PURE__ */ i(
|
|
59
|
+
x,
|
|
59
60
|
{
|
|
60
|
-
className:
|
|
61
|
+
className: t.button,
|
|
61
62
|
size: "s",
|
|
62
63
|
type: "close",
|
|
63
|
-
onClick: () =>
|
|
64
|
+
onClick: () => n()
|
|
64
65
|
}
|
|
65
66
|
)
|
|
66
67
|
] })
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ i(
|
|
70
71
|
"button",
|
|
71
72
|
{
|
|
72
|
-
className:
|
|
73
|
+
className: t.bg,
|
|
73
74
|
"aria-label": "close_backdrop",
|
|
74
75
|
type: "button",
|
|
75
|
-
onClick: () =>
|
|
76
|
+
onClick: () => n()
|
|
76
77
|
}
|
|
77
78
|
)
|
|
78
79
|
]
|
|
@@ -80,5 +81,5 @@ const h = {
|
|
|
80
81
|
);
|
|
81
82
|
};
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
O as Modal
|
|
84
85
|
};
|
package/dist/modal/context.js
CHANGED
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Portal as
|
|
4
|
-
import { Modals as
|
|
1
|
+
import { jsxs as M, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import c, { useMemo as p } from "react";
|
|
3
|
+
import { Portal as u } from "../portal/component.js";
|
|
4
|
+
import { Modals as x } from "./components/modals/index.js";
|
|
5
5
|
import { useModal as f } from "./hooks/use-modal.js";
|
|
6
|
-
const
|
|
6
|
+
const v = c.createContext({
|
|
7
7
|
modals: [],
|
|
8
8
|
currentModalId: "",
|
|
9
9
|
openModal: () => () => {
|
|
10
10
|
},
|
|
11
11
|
setModalDirty: () => {
|
|
12
12
|
}
|
|
13
|
-
}),
|
|
14
|
-
const { modals:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
currentModalId: e
|
|
23
|
-
},
|
|
24
|
-
children: [
|
|
25
|
-
/* @__PURE__ */ a(c, { getPortalContainer: o ? () => o : void 0, children: /* @__PURE__ */ a(
|
|
26
|
-
p,
|
|
27
|
-
{
|
|
28
|
-
modals: r,
|
|
29
|
-
dirtyModals: n,
|
|
30
|
-
closeModal: s,
|
|
31
|
-
openModal: t,
|
|
32
|
-
setModalDirty: d,
|
|
33
|
-
currentModalId: e
|
|
34
|
-
}
|
|
35
|
-
) }),
|
|
36
|
-
l
|
|
37
|
-
]
|
|
38
|
-
}
|
|
13
|
+
}), D = ({ children: l, t: n, portal: d }) => {
|
|
14
|
+
const { modals: o, openModal: r, setModalDirty: t, currentModalId: e, dirtyModals: s, closeModal: i } = f(n), m = p(
|
|
15
|
+
() => ({
|
|
16
|
+
modals: o,
|
|
17
|
+
openModal: r,
|
|
18
|
+
setModalDirty: t,
|
|
19
|
+
currentModalId: e
|
|
20
|
+
}),
|
|
21
|
+
[o, r, t, e]
|
|
39
22
|
);
|
|
23
|
+
return /* @__PURE__ */ M(v.Provider, { value: m, children: [
|
|
24
|
+
/* @__PURE__ */ a(u, { getPortalContainer: d ? () => d : void 0, children: /* @__PURE__ */ a(
|
|
25
|
+
x,
|
|
26
|
+
{
|
|
27
|
+
modals: o,
|
|
28
|
+
dirtyModals: s,
|
|
29
|
+
closeModal: i,
|
|
30
|
+
openModal: r,
|
|
31
|
+
setModalDirty: t,
|
|
32
|
+
currentModalId: e
|
|
33
|
+
}
|
|
34
|
+
) }),
|
|
35
|
+
l
|
|
36
|
+
] });
|
|
40
37
|
};
|
|
41
38
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
v as ModalContext,
|
|
40
|
+
D as ModalProvider
|
|
44
41
|
};
|
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { v4 as
|
|
3
|
-
import { deletePropertyById as
|
|
4
|
-
const x = (
|
|
5
|
-
const [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
l((o) =>
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import d, { useRef as S, useCallback as s, useEffect as b } from "react";
|
|
2
|
+
import { v4 as h } from "uuid";
|
|
3
|
+
import { deletePropertyById as v } from "../utils/delete-property-by-id.js";
|
|
4
|
+
const x = (n) => {
|
|
5
|
+
const [r, l] = d.useState([]), [M, f] = d.useState(""), [p, a] = d.useState({}), c = S(n);
|
|
6
|
+
c.current = n;
|
|
7
|
+
const i = s((t) => {
|
|
8
|
+
a((e) => v(e, t)), l((e) => e.filter((o) => o.id !== t));
|
|
9
|
+
}, []), u = s((t) => {
|
|
10
|
+
l((e) => [...e, t]);
|
|
11
|
+
}, []), m = s((t, e) => {
|
|
12
|
+
t && a((o) => o[t] === e ? o : {
|
|
13
|
+
...o,
|
|
14
|
+
[t]: e
|
|
15
|
+
});
|
|
16
|
+
}, []);
|
|
17
|
+
return b(() => {
|
|
18
|
+
const t = [...r].pop()?.id;
|
|
19
|
+
f(t || ""), document.body.style.overflow = r.length ? "hidden" : "unset";
|
|
20
|
+
}, [r]), {
|
|
21
|
+
openModal: s(
|
|
22
|
+
(t, e = "s", o = !0) => (y, I) => {
|
|
23
|
+
const R = h();
|
|
24
|
+
u({
|
|
25
|
+
id: R,
|
|
26
|
+
modal: t,
|
|
27
|
+
props: {
|
|
28
|
+
size: e,
|
|
29
|
+
showCloser: o,
|
|
30
|
+
closeCallback: I,
|
|
31
|
+
t: c.current,
|
|
32
|
+
...y
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
[u]
|
|
37
|
+
),
|
|
38
|
+
modals: r,
|
|
39
|
+
setModalDirty: m,
|
|
40
|
+
currentModalId: M,
|
|
41
|
+
dirtyModals: p,
|
|
42
|
+
closeModal: i
|
|
40
43
|
};
|
|
41
44
|
};
|
|
42
45
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { useRef as g,
|
|
1
|
+
import { jsx as r, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import { offset as L, flip as P, shift as U, arrow as z, useFloating as V, autoUpdate as q } from "@floating-ui/react-dom";
|
|
3
|
+
import c from "classnames";
|
|
4
|
+
import { useRef as g, useMemo as N, useEffect as B, useCallback as G } from "react";
|
|
5
5
|
import { CSSTransition as H } from "react-transition-group";
|
|
6
6
|
import { Portal as J } from "../portal/component.js";
|
|
7
7
|
import { Stack as K } from "../stack/component.js";
|
|
@@ -21,92 +21,90 @@ const W = {
|
|
|
21
21
|
left: "right"
|
|
22
22
|
}, ct = ({
|
|
23
23
|
children: R,
|
|
24
|
-
getPortalContainer:
|
|
25
|
-
transition:
|
|
26
|
-
anchorElement:
|
|
27
|
-
offset:
|
|
28
|
-
withArrow:
|
|
29
|
-
withTransition:
|
|
30
|
-
position:
|
|
31
|
-
preventFlip:
|
|
32
|
-
popperClassName:
|
|
24
|
+
getPortalContainer: b,
|
|
25
|
+
transition: m = W,
|
|
26
|
+
anchorElement: A,
|
|
27
|
+
offset: n = [0, 0],
|
|
28
|
+
withArrow: o = !1,
|
|
29
|
+
withTransition: T = !0,
|
|
30
|
+
position: h = "left",
|
|
31
|
+
preventFlip: f,
|
|
32
|
+
popperClassName: y,
|
|
33
33
|
arrowClassName: E,
|
|
34
34
|
className: O,
|
|
35
|
-
open:
|
|
35
|
+
open: i,
|
|
36
36
|
dataTestId: C,
|
|
37
37
|
update: l,
|
|
38
|
-
transitionDuration: F = `${
|
|
39
|
-
zIndex:
|
|
38
|
+
transitionDuration: F = `${m.timeout}ms`,
|
|
39
|
+
zIndex: I = Q.POPOVER
|
|
40
40
|
}) => {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
const d = g(null), u = g(null), M = N(
|
|
42
|
+
() => [
|
|
43
|
+
L({
|
|
44
|
+
crossAxis: n[0],
|
|
45
|
+
mainAxis: n[1]
|
|
46
|
+
}),
|
|
47
|
+
...f ? [] : [P()],
|
|
48
|
+
U({ padding: 4 }),
|
|
49
|
+
...o ? [z({ element: d })] : []
|
|
50
|
+
],
|
|
51
|
+
[n[0], n[1], f, o]
|
|
52
|
+
), {
|
|
53
|
+
refs: { setFloating: p },
|
|
54
|
+
floatingStyles: _,
|
|
55
|
+
middlewareData: a,
|
|
56
|
+
placement: x,
|
|
57
|
+
update: S
|
|
58
|
+
} = V({
|
|
59
|
+
placement: h,
|
|
60
|
+
open: i,
|
|
61
|
+
elements: { reference: A },
|
|
62
|
+
whileElementsMounted: i ? q : void 0,
|
|
63
|
+
middleware: M
|
|
62
64
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
o();
|
|
69
|
-
}, [o]);
|
|
70
|
-
const M = B(() => {
|
|
71
|
-
if (!i || !c.arrow)
|
|
65
|
+
B(() => {
|
|
66
|
+
l && (l.current = S);
|
|
67
|
+
}, [S, l]);
|
|
68
|
+
const k = N(() => {
|
|
69
|
+
if (!o || !a.arrow)
|
|
72
70
|
return {};
|
|
73
|
-
const { x: t, y: s } =
|
|
71
|
+
const { x: t, y: s } = a.arrow, j = x.split("-")[0], w = Z[j] ?? "bottom";
|
|
74
72
|
return {
|
|
75
73
|
position: "absolute",
|
|
76
74
|
left: t != null ? `${t}px` : void 0,
|
|
77
75
|
top: s != null ? `${s}px` : void 0,
|
|
78
76
|
right: "",
|
|
79
77
|
bottom: "",
|
|
80
|
-
[
|
|
78
|
+
[w]: "-4px"
|
|
81
79
|
};
|
|
82
|
-
}, [
|
|
80
|
+
}, [o, a.arrow, x]), $ = G(
|
|
83
81
|
(t) => {
|
|
84
|
-
|
|
82
|
+
u.current = t, p(t);
|
|
85
83
|
},
|
|
86
|
-
[
|
|
84
|
+
[p]
|
|
87
85
|
), v = (t, s) => /* @__PURE__ */ r(
|
|
88
86
|
"div",
|
|
89
87
|
{
|
|
90
|
-
ref:
|
|
88
|
+
ref: $,
|
|
91
89
|
style: {
|
|
92
90
|
zIndex: t,
|
|
93
|
-
...
|
|
91
|
+
..._
|
|
94
92
|
},
|
|
95
|
-
className:
|
|
96
|
-
children: /* @__PURE__ */
|
|
93
|
+
className: c(e.component, O),
|
|
94
|
+
children: /* @__PURE__ */ D(
|
|
97
95
|
"div",
|
|
98
96
|
{
|
|
99
97
|
"data-test-id": C,
|
|
100
|
-
className:
|
|
98
|
+
className: c(e.inner, y),
|
|
101
99
|
style: s,
|
|
102
100
|
children: [
|
|
103
101
|
R,
|
|
104
|
-
|
|
102
|
+
o && /* @__PURE__ */ r(
|
|
105
103
|
"div",
|
|
106
104
|
{
|
|
107
|
-
ref:
|
|
108
|
-
style:
|
|
109
|
-
className:
|
|
105
|
+
ref: d,
|
|
106
|
+
style: k,
|
|
107
|
+
className: c(e.arrow, E)
|
|
110
108
|
}
|
|
111
109
|
)
|
|
112
110
|
]
|
|
@@ -114,17 +112,17 @@ const W = {
|
|
|
114
112
|
)
|
|
115
113
|
}
|
|
116
114
|
);
|
|
117
|
-
return /* @__PURE__ */ r(K, { value:
|
|
115
|
+
return /* @__PURE__ */ r(K, { value: I, children: (t) => /* @__PURE__ */ r(J, { getPortalContainer: b, children: T ? /* @__PURE__ */ r(
|
|
118
116
|
Y,
|
|
119
117
|
{
|
|
120
118
|
unmountOnExit: !0,
|
|
121
119
|
classNames: X,
|
|
122
|
-
...
|
|
123
|
-
in:
|
|
124
|
-
nodeRef:
|
|
120
|
+
...m,
|
|
121
|
+
in: i,
|
|
122
|
+
nodeRef: u,
|
|
125
123
|
children: v(t, { transitionDuration: F })
|
|
126
124
|
}
|
|
127
|
-
) :
|
|
125
|
+
) : i && v(t) }) });
|
|
128
126
|
};
|
|
129
127
|
export {
|
|
130
128
|
ct as Popover
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { Typography as i } from "../../../typography/component.js";
|
|
3
3
|
import { translate as m } from "../../languages/index.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import e from "./index.module.css.js";
|
|
5
|
+
const c = ({
|
|
6
|
+
language: r,
|
|
7
|
+
columnsLength: o
|
|
8
|
+
}) => /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: o, className: e.empty_list, children: /* @__PURE__ */ t(i.Text, { color: "primary", view: "title", children: m(r)("emptyList") }) }) });
|
|
6
9
|
export {
|
|
7
|
-
|
|
10
|
+
c as EmptyList
|
|
8
11
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { translate as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
2
|
+
import { Typography as e } from "../../../typography/component.js";
|
|
3
|
+
import { translate as i } from "../../languages/index.js";
|
|
4
|
+
import l from "./index.module.css.js";
|
|
5
|
+
const c = ({
|
|
6
|
+
language: o,
|
|
7
|
+
columnsLength: t
|
|
8
|
+
}) => /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: t, className: l.empty_list, children: /* @__PURE__ */ r(e.Text, { color: "primary", view: "title", children: i(o)("error") }) }) });
|
|
6
9
|
export {
|
|
7
|
-
|
|
10
|
+
c as TableError
|
|
8
11
|
};
|
|
@@ -10,7 +10,7 @@ export declare function useTableData<T extends object>({ promise, records, fromP
|
|
|
10
10
|
error: boolean;
|
|
11
11
|
data: T[];
|
|
12
12
|
total: number;
|
|
13
|
-
params: QueryDTO
|
|
13
|
+
params: QueryDTO;
|
|
14
14
|
pagesCount: number;
|
|
15
15
|
updateData: (forcedQuery?: QueryDTO) => Promise<void>;
|
|
16
16
|
addParam: (patch: Query) => void;
|
|
@@ -1,115 +1,119 @@
|
|
|
1
1
|
import { useState as u, useCallback as c, useEffect as D } from "react";
|
|
2
|
-
import { addQueryParam as
|
|
3
|
-
import { getQueryFromUrl as
|
|
2
|
+
import { addQueryParam as I } from "../utils/add-query-param.js";
|
|
3
|
+
import { getQueryFromUrl as R } from "../utils/get-query-from-url.js";
|
|
4
4
|
import "query-string";
|
|
5
|
-
import { removeQueryParam as
|
|
6
|
-
import { resetQueryParam as
|
|
5
|
+
import { removeQueryParam as V } from "../utils/remove-query-param.js";
|
|
6
|
+
import { resetQueryParam as Y } from "../utils/reset-query-param.js";
|
|
7
7
|
import { serializeData as b } from "../utils/serialize-data.js";
|
|
8
|
-
const
|
|
8
|
+
const d = {
|
|
9
9
|
page: 1,
|
|
10
10
|
limit: 10,
|
|
11
11
|
where: {}
|
|
12
12
|
// остальное добавится по мере нужды (searchText, sort, order и т.д.)
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
const
|
|
14
|
+
function E(f, n) {
|
|
15
|
+
const r = f ?? d, a = {
|
|
16
|
+
...r,
|
|
16
17
|
...n,
|
|
17
|
-
...s,
|
|
18
18
|
where: {
|
|
19
|
-
...
|
|
20
|
-
...
|
|
19
|
+
...r.where ?? {},
|
|
20
|
+
...n.where ?? {}
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
return a.page && (a.page = +a.page), a.limit && (a.limit = +a.limit), a;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const [a,
|
|
27
|
-
(t) =>
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
function M({ promise: f, records: n, fromPath: r = !0 }) {
|
|
26
|
+
const [a, p] = u([]), [h, w] = u(!0), [C, A] = u(!1), [L, S] = u(0), [T, U] = u(1), [o, m] = u(void 0), y = c(
|
|
27
|
+
(t) => r ? R() : t ?? o ?? d,
|
|
28
|
+
// params не включаем при fromPath: иначе setParams на каждом fetch
|
|
29
|
+
// даёт новую ссылку → computeQuery/updateData меняются → бесконечный цикл.
|
|
30
|
+
r ? [r] : [r, o]
|
|
31
|
+
), s = c(
|
|
30
32
|
async (t) => {
|
|
31
|
-
const e =
|
|
32
|
-
if (Array.isArray(
|
|
33
|
-
|
|
33
|
+
const e = y(t);
|
|
34
|
+
if (Array.isArray(n) && (w(!1), p(b(n, e))), m(e), f) {
|
|
35
|
+
A(!1), w(!0);
|
|
34
36
|
try {
|
|
35
37
|
const {
|
|
36
|
-
data: { items: i, meta:
|
|
38
|
+
data: { items: i, meta: g }
|
|
37
39
|
} = await f(e);
|
|
38
|
-
|
|
40
|
+
S(g.totalItems), U(g.totalPages), p(i || []);
|
|
39
41
|
} catch {
|
|
40
|
-
|
|
42
|
+
A(!0);
|
|
41
43
|
} finally {
|
|
42
|
-
|
|
44
|
+
w(!1);
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
},
|
|
46
|
-
[
|
|
47
|
-
),
|
|
48
|
+
[y, n, f]
|
|
49
|
+
), q = c(
|
|
48
50
|
(t) => {
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
+
if (r) {
|
|
52
|
+
I(t), s();
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
|
-
const e =
|
|
54
|
-
m(e),
|
|
55
|
+
const e = E(o, t);
|
|
56
|
+
m(e), s(e);
|
|
55
57
|
},
|
|
56
|
-
[
|
|
57
|
-
),
|
|
58
|
+
[r, o, s]
|
|
59
|
+
), Q = c(
|
|
58
60
|
(t, e, i) => {
|
|
59
|
-
const
|
|
60
|
-
...
|
|
61
|
-
where: { ...
|
|
61
|
+
const g = t ?? d, l = {
|
|
62
|
+
...g,
|
|
63
|
+
where: { ...g.where ?? {} }
|
|
62
64
|
}, x = l.where?.[e];
|
|
63
65
|
if (Array.isArray(x) && i != null) {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
+
const v = x.filter((z) => String(z) !== String(i));
|
|
67
|
+
v.length ? l.where[e] = v : delete l.where[e];
|
|
66
68
|
} else
|
|
67
69
|
l.where && e in l.where && delete l.where[e];
|
|
68
70
|
return l;
|
|
69
71
|
},
|
|
70
72
|
[]
|
|
71
|
-
),
|
|
73
|
+
), F = c(
|
|
72
74
|
(t, e) => {
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
+
if (r) {
|
|
76
|
+
V(t, e), s();
|
|
75
77
|
return;
|
|
76
78
|
}
|
|
77
|
-
const i =
|
|
78
|
-
m(i),
|
|
79
|
+
const i = Q(o, t, e);
|
|
80
|
+
m(i), s(i);
|
|
79
81
|
},
|
|
80
|
-
[
|
|
81
|
-
),
|
|
82
|
+
[r, o, s, Q]
|
|
83
|
+
), P = c(
|
|
82
84
|
(t) => {
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
+
if (r) {
|
|
86
|
+
Y(t), s();
|
|
85
87
|
return;
|
|
86
88
|
}
|
|
87
|
-
const e =
|
|
88
|
-
m(e),
|
|
89
|
+
const e = E(d, t);
|
|
90
|
+
m(e), s(e);
|
|
89
91
|
},
|
|
90
|
-
[
|
|
92
|
+
[r, s]
|
|
91
93
|
);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}, [
|
|
95
|
-
if (Array.isArray(
|
|
96
|
-
const t =
|
|
97
|
-
m(t),
|
|
94
|
+
D(() => {
|
|
95
|
+
s();
|
|
96
|
+
}, [s]), D(() => {
|
|
97
|
+
if (Array.isArray(n)) {
|
|
98
|
+
const t = y();
|
|
99
|
+
m(t), w(!1), p(b(n, t));
|
|
98
100
|
}
|
|
99
|
-
}, [
|
|
100
|
-
|
|
101
|
+
}, [n, y]);
|
|
102
|
+
const k = o ?? y();
|
|
103
|
+
return {
|
|
104
|
+
loading: h,
|
|
101
105
|
error: C,
|
|
102
106
|
data: a,
|
|
103
107
|
total: L,
|
|
104
|
-
params:
|
|
105
|
-
pagesCount:
|
|
106
|
-
updateData:
|
|
108
|
+
params: k,
|
|
109
|
+
pagesCount: T,
|
|
110
|
+
updateData: s,
|
|
107
111
|
// НОВОЕ: наружу отдаём универсальные методы для управления параметрами
|
|
108
|
-
addParam:
|
|
109
|
-
removeParam:
|
|
110
|
-
resetParams:
|
|
112
|
+
addParam: q,
|
|
113
|
+
removeParam: F,
|
|
114
|
+
resetParams: P
|
|
111
115
|
};
|
|
112
116
|
}
|
|
113
117
|
export {
|
|
114
|
-
|
|
118
|
+
M as useTableData
|
|
115
119
|
};
|
package/dist/table/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--text-primary-color: var(--color-text-primary);--text-secondary-color: var(--color-text-secondary);--text-tertiary-color: var(--color-text-tertiary);--border-radius: 4px;--focus-color: var(--color-border-link);--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, sans-serif;--disabled-cursor: not-allowed;--arrow-transform: rotate(180deg)}.table_wrapper_SeB5{width:100%;box-sizing:border-box;position:relative}.table_9sbd{position:relative;box-sizing:border-box;border:1px solid var(--color-border-secondary);border-radius:12px 12px 0 0;background:var(--color-bg-primary);box-shadow:var(--shadow-xs);overflow:hidden}.table_9sbd table{width:100%;border-collapse:collapse;background:var(--color-bg-primary);table-layout:
|
|
1
|
+
:root{--text-primary-color: var(--color-text-primary);--text-secondary-color: var(--color-text-secondary);--text-tertiary-color: var(--color-text-tertiary);--border-radius: 4px;--focus-color: var(--color-border-link);--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, sans-serif;--disabled-cursor: not-allowed;--arrow-transform: rotate(180deg)}.table_wrapper_SeB5{width:100%;box-sizing:border-box;position:relative}.table_9sbd{position:relative;box-sizing:border-box;border:1px solid var(--color-border-secondary);border-radius:12px 12px 0 0;background:var(--color-bg-primary);box-shadow:var(--shadow-xs);overflow:hidden}.table_9sbd table{width:100%;border-collapse:collapse;background:var(--color-bg-primary);table-layout:auto}.table_9sbd tbody tr td{transition:background-color .15s ease}.table_9sbd.no_footer_julO{border-radius:12px}.fill_Q-ic{height:-webkit-fill-available;flex-grow:1;display:flex;flex-direction:column}.fill_Q-ic .table_9sbd{flex-grow:1;overflow:hidden}.fill_Q-ic .table_9sbd:hover{overflow:auto}.clickable_k4S8{cursor:pointer}.clickable_k4S8:hover td{background-color:color-mix(in srgb,var(--color-bg-secondary) 92%,var(--color-bg-primary))}
|
package/dist/table/table.js
CHANGED
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Cells as
|
|
5
|
-
import { EmptyList as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
function
|
|
15
|
-
columns:
|
|
16
|
-
searchPlaceholder:
|
|
17
|
-
records:
|
|
18
|
-
hideSearch:
|
|
19
|
-
rightHeaderAddons:
|
|
20
|
-
leftHeaderAddons:
|
|
21
|
-
filtersButtonLabel:
|
|
22
|
-
createButtonLabel:
|
|
23
|
-
loading:
|
|
24
|
-
height:
|
|
25
|
-
view:
|
|
26
|
-
tagsBuilder:
|
|
1
|
+
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import X, { useMemo as E, useCallback as Y } from "react";
|
|
3
|
+
import f from "classnames";
|
|
4
|
+
import { Cells as Z } from "./components/cells/index.js";
|
|
5
|
+
import { EmptyList as $ } from "./components/empty-list/index.js";
|
|
6
|
+
import { Loading as A } from "./components/loading/index.js";
|
|
7
|
+
import { Pagination as tt } from "./components/pagination/index.js";
|
|
8
|
+
import { TableHeader as at } from "./components/table-header/index.js";
|
|
9
|
+
import { useTableData as rt } from "./hooks/use-table-data.js";
|
|
10
|
+
import { getTags as ot } from "./utils/get-tags.js";
|
|
11
|
+
import { prepareRows as et } from "./utils/prepare-rows.js";
|
|
12
|
+
import e from "./index.module.css.js";
|
|
13
|
+
import { TableError as st } from "./components/error/index.js";
|
|
14
|
+
function Lt({
|
|
15
|
+
columns: o,
|
|
16
|
+
searchPlaceholder: N = "Поиск по таблице",
|
|
17
|
+
records: j,
|
|
18
|
+
hideSearch: P,
|
|
19
|
+
rightHeaderAddons: g,
|
|
20
|
+
leftHeaderAddons: b,
|
|
21
|
+
filtersButtonLabel: H,
|
|
22
|
+
createButtonLabel: R,
|
|
23
|
+
loading: S,
|
|
24
|
+
height: _ = "fill",
|
|
25
|
+
view: s = "default",
|
|
26
|
+
tagsBuilder: w,
|
|
27
27
|
promise: u,
|
|
28
|
-
onRowClick:
|
|
29
|
-
onCreateClick:
|
|
28
|
+
onRowClick: L,
|
|
29
|
+
onCreateClick: i,
|
|
30
30
|
onFiltersClick: m,
|
|
31
|
-
refetch:
|
|
32
|
-
language:
|
|
33
|
-
fromPath:
|
|
31
|
+
refetch: B,
|
|
32
|
+
language: n,
|
|
33
|
+
fromPath: F = !0
|
|
34
34
|
}) {
|
|
35
35
|
const {
|
|
36
|
-
loading:
|
|
37
|
-
error:
|
|
36
|
+
loading: M,
|
|
37
|
+
error: T,
|
|
38
38
|
data: y,
|
|
39
39
|
total: V,
|
|
40
|
-
params:
|
|
40
|
+
params: a,
|
|
41
41
|
pagesCount: q,
|
|
42
42
|
updateData: c,
|
|
43
43
|
addParam: z,
|
|
44
44
|
removeParam: G,
|
|
45
|
-
resetParams:
|
|
46
|
-
} =
|
|
45
|
+
resetParams: C
|
|
46
|
+
} = rt({
|
|
47
47
|
promise: u,
|
|
48
|
-
records:
|
|
49
|
-
fromPath:
|
|
50
|
-
}), k =
|
|
48
|
+
records: j,
|
|
49
|
+
fromPath: F
|
|
50
|
+
}), k = E(
|
|
51
51
|
() => [...y || []].sort(
|
|
52
|
-
(
|
|
52
|
+
(t, l) => (t.sortPosition || 0) - (l.sortPosition || 0)
|
|
53
53
|
),
|
|
54
54
|
[y]
|
|
55
|
-
), I = (
|
|
56
|
-
(
|
|
57
|
-
|
|
55
|
+
), I = (t) => L?.(t, c), J = i ? () => i(c) : void 0, K = Y(
|
|
56
|
+
(t) => {
|
|
57
|
+
C(t);
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
),
|
|
61
|
-
submitCallback: (
|
|
62
|
-
initialValues:
|
|
63
|
-
}) : null, d = (
|
|
64
|
-
z(
|
|
65
|
-
}, O = (
|
|
66
|
-
G(
|
|
67
|
-
}, Q =
|
|
68
|
-
params:
|
|
59
|
+
[C]
|
|
60
|
+
), x = () => m ? m({
|
|
61
|
+
submitCallback: (t) => K(t),
|
|
62
|
+
initialValues: a
|
|
63
|
+
}) : null, d = (t) => {
|
|
64
|
+
z(t);
|
|
65
|
+
}, O = (t, l) => {
|
|
66
|
+
G(t, l);
|
|
67
|
+
}, Q = ot({
|
|
68
|
+
params: a?.where || {},
|
|
69
69
|
onDelete: O,
|
|
70
|
-
tagsBuilder:
|
|
71
|
-
onClick:
|
|
72
|
-
}),
|
|
73
|
-
() =>
|
|
74
|
-
columns:
|
|
75
|
-
view:
|
|
70
|
+
tagsBuilder: w,
|
|
71
|
+
onClick: x
|
|
72
|
+
}), v = E(
|
|
73
|
+
() => et({
|
|
74
|
+
columns: o,
|
|
75
|
+
view: s,
|
|
76
76
|
data: k,
|
|
77
|
-
refetch:
|
|
77
|
+
refetch: B || c
|
|
78
78
|
}),
|
|
79
79
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
80
|
-
[k,
|
|
81
|
-
), p =
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
(!
|
|
84
|
-
|
|
80
|
+
[k, o, s]
|
|
81
|
+
), p = M || S, D = !!u;
|
|
82
|
+
return /* @__PURE__ */ h("div", { className: f(e.table_wrapper, e[_], e[s]), children: [
|
|
83
|
+
(!P || g || b || i || m) && /* @__PURE__ */ r(
|
|
84
|
+
at,
|
|
85
85
|
{
|
|
86
|
-
language:
|
|
87
|
-
hideSearch:
|
|
88
|
-
rightHeaderAddons:
|
|
89
|
-
leftHeaderAddons:
|
|
90
|
-
searchText:
|
|
86
|
+
language: n,
|
|
87
|
+
hideSearch: P,
|
|
88
|
+
rightHeaderAddons: g,
|
|
89
|
+
leftHeaderAddons: b,
|
|
90
|
+
searchText: a?.searchText || "",
|
|
91
91
|
addParam: d,
|
|
92
|
-
searchPlaceholder:
|
|
93
|
-
filtersButtonLabel:
|
|
92
|
+
searchPlaceholder: N,
|
|
93
|
+
filtersButtonLabel: H,
|
|
94
94
|
tags: Q,
|
|
95
95
|
onCreateClick: J,
|
|
96
|
-
createButtonLabel:
|
|
97
|
-
onFiltersClick:
|
|
96
|
+
createButtonLabel: R,
|
|
97
|
+
onFiltersClick: x,
|
|
98
98
|
showFiltersButton: !!m,
|
|
99
|
-
compact:
|
|
99
|
+
compact: s === "compact"
|
|
100
100
|
}
|
|
101
101
|
),
|
|
102
|
-
/* @__PURE__ */ r("div", { className:
|
|
102
|
+
/* @__PURE__ */ r("div", { className: f(e.table, { [e.no_footer]: !D }), children: /* @__PURE__ */ h("table", { cellSpacing: "0", cellPadding: "0", children: [
|
|
103
103
|
/* @__PURE__ */ r(
|
|
104
|
-
|
|
104
|
+
Z,
|
|
105
105
|
{
|
|
106
|
-
sort:
|
|
107
|
-
order:
|
|
106
|
+
sort: a?.sort,
|
|
107
|
+
order: a?.order,
|
|
108
108
|
addParam: d,
|
|
109
|
-
columns:
|
|
110
|
-
compact:
|
|
109
|
+
columns: o,
|
|
110
|
+
compact: s === "compact"
|
|
111
111
|
}
|
|
112
112
|
),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
115
|
-
!
|
|
116
|
-
p && /* @__PURE__ */ r(
|
|
117
|
-
|
|
113
|
+
/* @__PURE__ */ h("tbody", { children: [
|
|
114
|
+
T && /* @__PURE__ */ r(st, { columnsLength: o.length, language: n }),
|
|
115
|
+
!v.length && !p && !T && /* @__PURE__ */ r($, { columnsLength: o.length, language: n }),
|
|
116
|
+
p && /* @__PURE__ */ r(A, { columnsLength: o.length }),
|
|
117
|
+
v.map(({ row: t, cells: l }) => /* @__PURE__ */ r(
|
|
118
118
|
"tr",
|
|
119
119
|
{
|
|
120
|
-
onClick: () => I(
|
|
121
|
-
className:
|
|
120
|
+
onClick: () => I(t),
|
|
121
|
+
className: f({ [e.clickable]: !!L }),
|
|
122
122
|
style: { visibility: p ? "collapse" : "visible" },
|
|
123
|
-
children:
|
|
123
|
+
children: l.map((U, W) => X.cloneElement(U, { key: W }))
|
|
124
124
|
},
|
|
125
|
-
String(
|
|
125
|
+
String(t.id)
|
|
126
126
|
))
|
|
127
127
|
] })
|
|
128
128
|
] }) }),
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
D && /* @__PURE__ */ r(
|
|
130
|
+
tt,
|
|
131
131
|
{
|
|
132
|
-
language:
|
|
133
|
-
currentPage:
|
|
134
|
-
recordsPerPage:
|
|
132
|
+
language: n,
|
|
133
|
+
currentPage: a ? +a.page : 1,
|
|
134
|
+
recordsPerPage: a ? +a.limit : 10,
|
|
135
135
|
pagesCount: +q,
|
|
136
136
|
addParam: d,
|
|
137
137
|
total: +V
|
|
@@ -140,5 +140,5 @@ function ha({
|
|
|
140
140
|
] });
|
|
141
141
|
}
|
|
142
142
|
export {
|
|
143
|
-
|
|
143
|
+
Lt as Table
|
|
144
144
|
};
|