@alphakits/ui 2.4.2 → 2.4.4
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/calendar/components/months-table/component.js +22 -23
- package/dist/calendar/components/months-table/index.css +1 -1
- package/dist/calendar/components/months-table/index.module.css.js +4 -6
- package/dist/calendar/components/select-button/index.css +1 -1
- package/dist/calendar/index.css +1 -1
- package/dist/calendar-input/component.js +124 -121
- package/dist/checkbox-lists/mock.data.d.ts +81 -0
- package/dist/checkbox-lists/mock.data.js +207 -0
- package/dist/collapsable-row/fixtures.data.d.ts +99 -0
- package/dist/collapsable-row/fixtures.data.js +196 -0
- package/dist/confirm-popup/component.d.ts +21 -0
- package/dist/confirm-popup/component.js +119 -0
- package/dist/confirm-popup/index.css +1 -0
- package/dist/confirm-popup/index.d.ts +1 -0
- package/dist/confirm-popup/index.js +6 -0
- package/dist/confirm-popup/index.module.css.js +17 -0
- package/dist/form/component.js +16 -16
- package/dist/form/templates/filters-form/index.js +17 -17
- package/dist/form/templates/rest-form/form.js +75 -69
- package/dist/index.d.ts +1 -0
- package/dist/index.js +290 -286
- package/dist/modal/components/modals/modal.js +45 -42
- package/dist/popover/component.js +72 -55
- package/dist/radio-groups/mock.data.d.ts +9 -0
- package/dist/radio-groups/mock.data.js +82 -0
- package/dist/table/hooks/use-table-data.js +71 -67
- package/dist/theme-provider/default-themes.d.ts +4 -0
- package/dist/theme-provider/default-themes.js +4 -0
- package/dist/toast-plate/index.css +1 -1
- package/package.json +9 -27
|
@@ -1,67 +1,70 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { ButtonArrow as
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { jsxs as w, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import b from "classnames";
|
|
3
|
+
import { useState as v, useLayoutEffect as x, useCallback as k, useEffect as E } from "react";
|
|
4
|
+
import { ButtonArrow as g } from "../../../button-arrow/component.js";
|
|
5
|
+
import { showConfirm as F } from "../../../confirm-popup/component.js";
|
|
6
|
+
import s from "./index.module.css.js";
|
|
7
|
+
const y = {
|
|
7
8
|
s: 488,
|
|
8
9
|
m: 888,
|
|
9
10
|
full: "96%"
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
return () => cancelAnimationFrame(
|
|
11
|
+
}, h = 102, N = (e) => e === "full" ? `calc(-96vw - ${h}px)` : -y[e] - h, R = ({ modal: e, t: r, index: a, dirtyModals: m, closeModal: l, currentModalId: c }) => {
|
|
12
|
+
const f = N(e.props.size), [C, p] = v(f);
|
|
13
|
+
x(() => {
|
|
14
|
+
const o = requestAnimationFrame(() => p(0));
|
|
15
|
+
return () => cancelAnimationFrame(o);
|
|
15
16
|
}, [e.id]);
|
|
16
17
|
const u = k(
|
|
17
|
-
(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
(o) => m[o] ? F({
|
|
19
|
+
title: r("common:exitConfirm"),
|
|
20
|
+
confirmText: r("common:yes"),
|
|
21
|
+
cancelText: r("common:no"),
|
|
22
|
+
confirmView: "negative"
|
|
23
|
+
}) : Promise.resolve(!0),
|
|
21
24
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22
|
-
[
|
|
23
|
-
),
|
|
24
|
-
(
|
|
25
|
-
const { id:
|
|
26
|
-
u(
|
|
27
|
-
e.props.closeCallback && e.props.closeCallback(),
|
|
25
|
+
[m, r]
|
|
26
|
+
), t = k(
|
|
27
|
+
async (o) => {
|
|
28
|
+
const { id: n } = e;
|
|
29
|
+
await u(o || n) && (p(f), setTimeout(() => {
|
|
30
|
+
e.props.closeCallback && e.props.closeCallback(), l(o || n);
|
|
28
31
|
}, 250));
|
|
29
32
|
},
|
|
30
|
-
[
|
|
33
|
+
[l, u, e, f]
|
|
31
34
|
);
|
|
32
|
-
return
|
|
33
|
-
const
|
|
34
|
-
(
|
|
35
|
+
return E(() => {
|
|
36
|
+
const o = (n) => {
|
|
37
|
+
(n.key === "27" || n.key === "Escape") && t(c);
|
|
35
38
|
};
|
|
36
|
-
return e.id ===
|
|
37
|
-
window?.removeEventListener("keydown",
|
|
39
|
+
return e.id === c && window?.addEventListener("keydown", o), () => {
|
|
40
|
+
window?.removeEventListener("keydown", o);
|
|
38
41
|
};
|
|
39
|
-
}, [
|
|
42
|
+
}, [t, c, e.id]), /* @__PURE__ */ w(
|
|
40
43
|
"div",
|
|
41
44
|
{
|
|
42
|
-
className:
|
|
45
|
+
className: s.container,
|
|
43
46
|
style: {
|
|
44
|
-
zIndex: 9999998 +
|
|
47
|
+
zIndex: 9999998 + a
|
|
45
48
|
},
|
|
46
49
|
children: [
|
|
47
50
|
/* @__PURE__ */ i(
|
|
48
51
|
"div",
|
|
49
52
|
{
|
|
50
|
-
className:
|
|
53
|
+
className: b(s.right, s.content),
|
|
51
54
|
style: {
|
|
52
|
-
zIndex: 9999999 +
|
|
53
|
-
width:
|
|
54
|
-
right:
|
|
55
|
+
zIndex: 9999999 + a,
|
|
56
|
+
width: y[e.props.size],
|
|
57
|
+
right: C
|
|
55
58
|
},
|
|
56
|
-
children: /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */ i(e.modal, { ...e.props, close: () =>
|
|
59
|
+
children: /* @__PURE__ */ w("div", { className: s.inner, children: [
|
|
60
|
+
/* @__PURE__ */ i(e.modal, { ...e.props, close: () => t() }),
|
|
58
61
|
e.props.showCloser !== !1 && /* @__PURE__ */ i(
|
|
59
|
-
|
|
62
|
+
g,
|
|
60
63
|
{
|
|
61
|
-
className:
|
|
64
|
+
className: s.button,
|
|
62
65
|
size: "s",
|
|
63
66
|
type: "close",
|
|
64
|
-
onClick: () =>
|
|
67
|
+
onClick: () => t()
|
|
65
68
|
}
|
|
66
69
|
)
|
|
67
70
|
] })
|
|
@@ -70,10 +73,10 @@ const C = {
|
|
|
70
73
|
/* @__PURE__ */ i(
|
|
71
74
|
"button",
|
|
72
75
|
{
|
|
73
|
-
className:
|
|
76
|
+
className: s.bg,
|
|
74
77
|
"aria-label": "close_backdrop",
|
|
75
78
|
type: "button",
|
|
76
|
-
onClick: () =>
|
|
79
|
+
onClick: () => t()
|
|
77
80
|
}
|
|
78
81
|
)
|
|
79
82
|
]
|
|
@@ -81,5 +84,5 @@ const C = {
|
|
|
81
84
|
);
|
|
82
85
|
};
|
|
83
86
|
export {
|
|
84
|
-
|
|
87
|
+
R as Modal
|
|
85
88
|
};
|
|
@@ -1,109 +1,126 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { offset as L, flip as
|
|
1
|
+
import { jsx as i, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import { offset as L, flip as U, shift as z, arrow as V, useFloating as q, autoUpdate as B } from "@floating-ui/react-dom";
|
|
3
3
|
import c from "classnames";
|
|
4
|
-
import { useRef as g, useMemo as N, useEffect as
|
|
5
|
-
import { CSSTransition as
|
|
6
|
-
import { Portal as
|
|
7
|
-
import { Stack as
|
|
8
|
-
import { stackingOrder as
|
|
4
|
+
import { useRef as g, useMemo as N, useEffect as G, useCallback as H } from "react";
|
|
5
|
+
import { CSSTransition as J } from "react-transition-group";
|
|
6
|
+
import { Portal as K } from "../portal/component.js";
|
|
7
|
+
import { Stack as Q } from "../stack/component.js";
|
|
8
|
+
import { stackingOrder as W } from "../stack/context.js";
|
|
9
9
|
import e from "./index.module.css.js";
|
|
10
|
-
const
|
|
10
|
+
const X = {
|
|
11
11
|
timeout: 150
|
|
12
|
-
},
|
|
12
|
+
}, Y = {
|
|
13
13
|
enter: e.enter,
|
|
14
14
|
enterActive: e.enterActive,
|
|
15
15
|
exit: e.exit,
|
|
16
16
|
exitActive: e.exitActive
|
|
17
|
-
},
|
|
17
|
+
}, Z = J, tt = {
|
|
18
18
|
top: "bottom",
|
|
19
19
|
right: "left",
|
|
20
20
|
bottom: "top",
|
|
21
21
|
left: "right"
|
|
22
|
-
},
|
|
23
|
-
children:
|
|
24
|
-
getPortalContainer:
|
|
25
|
-
transition: m =
|
|
26
|
-
anchorElement:
|
|
22
|
+
}, mt = ({
|
|
23
|
+
children: b,
|
|
24
|
+
getPortalContainer: R,
|
|
25
|
+
transition: m = X,
|
|
26
|
+
anchorElement: h,
|
|
27
27
|
offset: n = [0, 0],
|
|
28
28
|
withArrow: o = !1,
|
|
29
|
-
withTransition:
|
|
30
|
-
position:
|
|
31
|
-
preventFlip:
|
|
32
|
-
popperClassName:
|
|
29
|
+
withTransition: y = !0,
|
|
30
|
+
position: A = "left",
|
|
31
|
+
preventFlip: d,
|
|
32
|
+
popperClassName: T,
|
|
33
33
|
arrowClassName: E,
|
|
34
34
|
className: O,
|
|
35
|
-
open:
|
|
35
|
+
open: s,
|
|
36
36
|
dataTestId: C,
|
|
37
37
|
update: l,
|
|
38
38
|
transitionDuration: F = `${m.timeout}ms`,
|
|
39
|
-
zIndex: I =
|
|
39
|
+
zIndex: I = W.POPOVER
|
|
40
40
|
}) => {
|
|
41
|
-
const
|
|
41
|
+
const f = g(null), u = g(null), M = N(
|
|
42
42
|
() => [
|
|
43
43
|
L({
|
|
44
44
|
crossAxis: n[0],
|
|
45
45
|
mainAxis: n[1]
|
|
46
46
|
}),
|
|
47
|
-
...
|
|
48
|
-
|
|
49
|
-
...o ? [
|
|
47
|
+
...d ? [] : [U()],
|
|
48
|
+
z({ padding: 4 }),
|
|
49
|
+
...o ? [V({ element: f })] : []
|
|
50
50
|
],
|
|
51
|
-
[n[0], n[1],
|
|
51
|
+
[n[0], n[1], d, o]
|
|
52
52
|
), {
|
|
53
53
|
refs: { setFloating: p },
|
|
54
54
|
floatingStyles: _,
|
|
55
55
|
middlewareData: a,
|
|
56
|
-
placement:
|
|
57
|
-
update:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
placement: v,
|
|
57
|
+
update: x,
|
|
58
|
+
isPositioned: k
|
|
59
|
+
} = q({
|
|
60
|
+
placement: A,
|
|
61
|
+
open: s,
|
|
62
|
+
elements: { reference: h },
|
|
63
|
+
whileElementsMounted: s ? B : void 0,
|
|
63
64
|
middleware: M
|
|
64
65
|
});
|
|
65
|
-
|
|
66
|
-
l && (l.current =
|
|
67
|
-
}, [
|
|
68
|
-
const
|
|
66
|
+
G(() => {
|
|
67
|
+
l && (l.current = x);
|
|
68
|
+
}, [x, l]);
|
|
69
|
+
const P = N(() => {
|
|
69
70
|
if (!o || !a.arrow)
|
|
70
71
|
return {};
|
|
71
|
-
const { x: t, y:
|
|
72
|
+
const { x: t, y: r } = a.arrow, j = v.split("-")[0], w = tt[j] ?? "bottom";
|
|
72
73
|
return {
|
|
73
74
|
position: "absolute",
|
|
74
75
|
left: t != null ? `${t}px` : void 0,
|
|
75
|
-
top:
|
|
76
|
+
top: r != null ? `${r}px` : void 0,
|
|
76
77
|
right: "",
|
|
77
78
|
bottom: "",
|
|
78
79
|
[w]: "-4px"
|
|
79
80
|
};
|
|
80
|
-
}, [o, a.arrow,
|
|
81
|
+
}, [o, a.arrow, v]), $ = H(
|
|
81
82
|
(t) => {
|
|
82
83
|
u.current = t, p(t);
|
|
83
84
|
},
|
|
84
85
|
[p]
|
|
85
|
-
),
|
|
86
|
+
), S = (t, r) => /* @__PURE__ */ i(
|
|
86
87
|
"div",
|
|
87
88
|
{
|
|
88
89
|
ref: $,
|
|
89
90
|
style: {
|
|
90
91
|
zIndex: t,
|
|
91
|
-
..._
|
|
92
|
+
..._,
|
|
93
|
+
/**
|
|
94
|
+
* Скрываем поповер до первого замера floating-ui: иначе
|
|
95
|
+
* на первом рендере `floatingStyles` ещё содержат дефолт
|
|
96
|
+
* `top: 0, left: 0, transform: translate(0, 0)`, а CSSTransition
|
|
97
|
+
* уже стартует fade-in. Получается визуальный "прыжок" из
|
|
98
|
+
* угла портала в правильную позицию. `isPositioned` становится
|
|
99
|
+
* `true` после первого измерения — к этому моменту координаты
|
|
100
|
+
* корректные и можно показывать.
|
|
101
|
+
*
|
|
102
|
+
* Не используем `display: none` или `opacity`, потому что:
|
|
103
|
+
* — `display: none` ломает измерения floating-ui (нулевые
|
|
104
|
+
* размеры) и блокирует CSSTransition;
|
|
105
|
+
* — `opacity` уже используется CSSTransition'ом для fade-in,
|
|
106
|
+
* переписывать его здесь — испортить анимацию.
|
|
107
|
+
*/
|
|
108
|
+
visibility: k ? "visible" : "hidden"
|
|
92
109
|
},
|
|
93
110
|
className: c(e.component, O),
|
|
94
111
|
children: /* @__PURE__ */ D(
|
|
95
112
|
"div",
|
|
96
113
|
{
|
|
97
114
|
"data-test-id": C,
|
|
98
|
-
className: c(e.inner,
|
|
99
|
-
style:
|
|
115
|
+
className: c(e.inner, T),
|
|
116
|
+
style: r,
|
|
100
117
|
children: [
|
|
101
|
-
|
|
102
|
-
o && /* @__PURE__ */
|
|
118
|
+
b,
|
|
119
|
+
o && /* @__PURE__ */ i(
|
|
103
120
|
"div",
|
|
104
121
|
{
|
|
105
|
-
ref:
|
|
106
|
-
style:
|
|
122
|
+
ref: f,
|
|
123
|
+
style: P,
|
|
107
124
|
className: c(e.arrow, E)
|
|
108
125
|
}
|
|
109
126
|
)
|
|
@@ -112,18 +129,18 @@ const W = {
|
|
|
112
129
|
)
|
|
113
130
|
}
|
|
114
131
|
);
|
|
115
|
-
return /* @__PURE__ */
|
|
116
|
-
|
|
132
|
+
return /* @__PURE__ */ i(Q, { value: I, children: (t) => /* @__PURE__ */ i(K, { getPortalContainer: R, children: y ? /* @__PURE__ */ i(
|
|
133
|
+
Z,
|
|
117
134
|
{
|
|
118
135
|
unmountOnExit: !0,
|
|
119
|
-
classNames:
|
|
136
|
+
classNames: Y,
|
|
120
137
|
...m,
|
|
121
|
-
in:
|
|
138
|
+
in: s,
|
|
122
139
|
nodeRef: u,
|
|
123
|
-
children:
|
|
140
|
+
children: S(t, { transitionDuration: F })
|
|
124
141
|
}
|
|
125
|
-
) :
|
|
142
|
+
) : s && S(t) }) });
|
|
126
143
|
};
|
|
127
144
|
export {
|
|
128
|
-
|
|
145
|
+
mt as Popover
|
|
129
146
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const t = [
|
|
2
|
+
{
|
|
3
|
+
id: 1,
|
|
4
|
+
title: "Tambov"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
id: 2,
|
|
8
|
+
title: "Moscow"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: 3,
|
|
12
|
+
title: "Voronezh"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 4,
|
|
16
|
+
title: "Lipetsk"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 5,
|
|
20
|
+
title: "SPB"
|
|
21
|
+
}
|
|
22
|
+
], o = [
|
|
23
|
+
{
|
|
24
|
+
id: 1,
|
|
25
|
+
title: "Questroom 1",
|
|
26
|
+
locationId: 1
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 4,
|
|
30
|
+
title: "Questroom 4",
|
|
31
|
+
locationId: 2
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 5,
|
|
35
|
+
title: "Questroom 5",
|
|
36
|
+
locationId: 2
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 6,
|
|
40
|
+
title: "Questroom 6",
|
|
41
|
+
locationId: 2
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 7,
|
|
45
|
+
title: "Questroom 7",
|
|
46
|
+
locationId: 3
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 10,
|
|
50
|
+
title: "Questroom 10",
|
|
51
|
+
locationId: 4
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 11,
|
|
55
|
+
title: "Questroom 11",
|
|
56
|
+
locationId: 4
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 12,
|
|
60
|
+
title: "Questroom 12",
|
|
61
|
+
locationId: 4
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 13,
|
|
65
|
+
title: "Questroom 13",
|
|
66
|
+
locationId: 5
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 14,
|
|
70
|
+
title: "Questroom 14",
|
|
71
|
+
locationId: 5
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 15,
|
|
75
|
+
title: "Questroom 15",
|
|
76
|
+
locationId: 5
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
export {
|
|
80
|
+
t as locations,
|
|
81
|
+
o as questrooms
|
|
82
|
+
};
|
|
@@ -1,119 +1,123 @@
|
|
|
1
|
-
import { useState as u, useCallback as
|
|
2
|
-
import { addQueryParam as
|
|
3
|
-
import { getQueryFromUrl as
|
|
1
|
+
import { useState as u, useRef as b, useCallback as l, useEffect as E } from "react";
|
|
2
|
+
import { addQueryParam as h } from "../utils/add-query-param.js";
|
|
3
|
+
import { getQueryFromUrl as j } from "../utils/get-query-from-url.js";
|
|
4
4
|
import "query-string";
|
|
5
|
-
import { removeQueryParam as
|
|
6
|
-
import { resetQueryParam as
|
|
7
|
-
import { serializeData as
|
|
8
|
-
const
|
|
5
|
+
import { removeQueryParam as B } from "../utils/remove-query-param.js";
|
|
6
|
+
import { resetQueryParam as G } from "../utils/reset-query-param.js";
|
|
7
|
+
import { serializeData as C } from "../utils/serialize-data.js";
|
|
8
|
+
const p = {
|
|
9
9
|
page: 1,
|
|
10
10
|
limit: 10,
|
|
11
11
|
where: {}
|
|
12
12
|
// остальное добавится по мере нужды (searchText, sort, order и т.д.)
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
const r =
|
|
14
|
+
function L(w, a) {
|
|
15
|
+
const r = w ?? p, n = {
|
|
16
16
|
...r,
|
|
17
|
-
...
|
|
17
|
+
...a,
|
|
18
18
|
where: {
|
|
19
19
|
...r.where ?? {},
|
|
20
|
-
...
|
|
20
|
+
...a.where ?? {}
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
return
|
|
23
|
+
return n.page && (n.page = +n.page), n.limit && (n.limit = +n.limit), n;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const [
|
|
27
|
-
|
|
25
|
+
function X({ promise: w, records: a, fromPath: r = !0 }) {
|
|
26
|
+
const [n, A] = u([]), [S, d] = u(!0), [T, Q] = u(!1), [U, q] = u(0), [F, k] = u(1), [c, f] = u(void 0), x = b(w);
|
|
27
|
+
x.current = w;
|
|
28
|
+
const v = b(a);
|
|
29
|
+
v.current = a;
|
|
30
|
+
const m = l(
|
|
31
|
+
(t) => r ? j() : t ?? c ?? p,
|
|
28
32
|
// params не включаем при fromPath: иначе setParams на каждом fetch
|
|
29
33
|
// даёт новую ссылку → computeQuery/updateData меняются → бесконечный цикл.
|
|
30
|
-
r ? [r] : [r,
|
|
31
|
-
), s =
|
|
34
|
+
r ? [r] : [r, c]
|
|
35
|
+
), s = l(
|
|
32
36
|
async (t) => {
|
|
33
|
-
const e =
|
|
34
|
-
if (Array.isArray(
|
|
35
|
-
|
|
37
|
+
const e = m(t), i = v.current, y = x.current;
|
|
38
|
+
if (Array.isArray(i) && (d(!1), A(C(i, e))), r || f(e), y) {
|
|
39
|
+
Q(!1), d(!0);
|
|
36
40
|
try {
|
|
37
41
|
const {
|
|
38
|
-
data: { items:
|
|
39
|
-
} = await
|
|
40
|
-
|
|
42
|
+
data: { items: o, meta: g }
|
|
43
|
+
} = await y(e);
|
|
44
|
+
q(g.totalItems), k(g.totalPages), A(o || []);
|
|
41
45
|
} catch {
|
|
42
|
-
|
|
46
|
+
Q(!0);
|
|
43
47
|
} finally {
|
|
44
|
-
|
|
48
|
+
d(!1);
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
|
-
[
|
|
49
|
-
),
|
|
52
|
+
[m, r]
|
|
53
|
+
), z = l(
|
|
50
54
|
(t) => {
|
|
51
55
|
if (r) {
|
|
52
|
-
|
|
56
|
+
h(t), s();
|
|
53
57
|
return;
|
|
54
58
|
}
|
|
55
|
-
const e =
|
|
56
|
-
|
|
59
|
+
const e = L(c, t);
|
|
60
|
+
f(e), s(e);
|
|
57
61
|
},
|
|
58
|
-
[r,
|
|
59
|
-
),
|
|
62
|
+
[r, c, s]
|
|
63
|
+
), D = l(
|
|
60
64
|
(t, e, i) => {
|
|
61
|
-
const
|
|
62
|
-
...
|
|
63
|
-
where: { ...
|
|
64
|
-
},
|
|
65
|
-
if (Array.isArray(
|
|
66
|
-
const
|
|
67
|
-
|
|
65
|
+
const y = t ?? p, o = {
|
|
66
|
+
...y,
|
|
67
|
+
where: { ...y.where ?? {} }
|
|
68
|
+
}, g = o.where?.[e];
|
|
69
|
+
if (Array.isArray(g) && i != null) {
|
|
70
|
+
const R = g.filter((_) => String(_) !== String(i));
|
|
71
|
+
R.length ? o.where[e] = R : delete o.where[e];
|
|
68
72
|
} else
|
|
69
|
-
|
|
70
|
-
return
|
|
73
|
+
o.where && e in o.where && delete o.where[e];
|
|
74
|
+
return o;
|
|
71
75
|
},
|
|
72
76
|
[]
|
|
73
|
-
),
|
|
77
|
+
), I = l(
|
|
74
78
|
(t, e) => {
|
|
75
79
|
if (r) {
|
|
76
|
-
|
|
80
|
+
B(t, e), s();
|
|
77
81
|
return;
|
|
78
82
|
}
|
|
79
|
-
const i =
|
|
80
|
-
|
|
83
|
+
const i = D(c, t, e);
|
|
84
|
+
f(i), s(i);
|
|
81
85
|
},
|
|
82
|
-
[r,
|
|
83
|
-
),
|
|
86
|
+
[r, c, s, D]
|
|
87
|
+
), V = l(
|
|
84
88
|
(t) => {
|
|
85
89
|
if (r) {
|
|
86
|
-
|
|
90
|
+
G(t), s();
|
|
87
91
|
return;
|
|
88
92
|
}
|
|
89
|
-
const e =
|
|
90
|
-
|
|
93
|
+
const e = L(p, t);
|
|
94
|
+
f(e), s(e);
|
|
91
95
|
},
|
|
92
96
|
[r, s]
|
|
93
97
|
);
|
|
94
|
-
|
|
98
|
+
E(() => {
|
|
95
99
|
s();
|
|
96
|
-
}, [s]),
|
|
97
|
-
if (Array.isArray(
|
|
98
|
-
const t =
|
|
99
|
-
|
|
100
|
+
}, [s]), E(() => {
|
|
101
|
+
if (Array.isArray(a)) {
|
|
102
|
+
const t = m();
|
|
103
|
+
r || f(t), d(!1), A(C(a, t));
|
|
100
104
|
}
|
|
101
|
-
}, [
|
|
102
|
-
const
|
|
105
|
+
}, [a, m]);
|
|
106
|
+
const Y = c ?? m();
|
|
103
107
|
return {
|
|
104
|
-
loading:
|
|
105
|
-
error:
|
|
106
|
-
data:
|
|
107
|
-
total:
|
|
108
|
-
params:
|
|
109
|
-
pagesCount:
|
|
108
|
+
loading: S,
|
|
109
|
+
error: T,
|
|
110
|
+
data: n,
|
|
111
|
+
total: U,
|
|
112
|
+
params: Y,
|
|
113
|
+
pagesCount: F,
|
|
110
114
|
updateData: s,
|
|
111
115
|
// НОВОЕ: наружу отдаём универсальные методы для управления параметрами
|
|
112
|
-
addParam:
|
|
113
|
-
removeParam:
|
|
114
|
-
resetParams:
|
|
116
|
+
addParam: z,
|
|
117
|
+
removeParam: I,
|
|
118
|
+
resetParams: V
|
|
115
119
|
};
|
|
116
120
|
}
|
|
117
121
|
export {
|
|
118
|
-
|
|
122
|
+
X as useTableData
|
|
119
123
|
};
|
|
@@ -18,6 +18,7 @@ export declare const defaultThemes: {
|
|
|
18
18
|
readonly thirdly: "#E7E8EA";
|
|
19
19
|
readonly quaternary: "#D5D6DC";
|
|
20
20
|
readonly 'special-super-light': "#FDFDFD";
|
|
21
|
+
readonly 'primary-inverted': "#0E0E0E";
|
|
21
22
|
readonly 'secondary-inverted': "#1C1C1E";
|
|
22
23
|
readonly 'special-big-objects': "#F8F8F9";
|
|
23
24
|
readonly positive: "#63C956";
|
|
@@ -46,6 +47,7 @@ export declare const defaultThemes: {
|
|
|
46
47
|
readonly attention: "#F19938";
|
|
47
48
|
readonly accent: "#2174EF";
|
|
48
49
|
readonly 'accent-special': "#649EF4";
|
|
50
|
+
readonly 'primary-inverted': "#F8F8F8";
|
|
49
51
|
readonly 'secondary-inverted': "#85858D";
|
|
50
52
|
readonly main: "#2174ef";
|
|
51
53
|
readonly static: "#FFFFFF";
|
|
@@ -92,6 +94,7 @@ export declare const defaultThemes: {
|
|
|
92
94
|
readonly thirdly: "#27272A";
|
|
93
95
|
readonly quaternary: "#36363A";
|
|
94
96
|
readonly 'special-super-light': "#18181970";
|
|
97
|
+
readonly 'primary-inverted': "#FFFFFF";
|
|
95
98
|
readonly 'secondary-inverted': "#F2F3F5";
|
|
96
99
|
readonly 'special-big-objects': "#171718";
|
|
97
100
|
readonly positive: "#32D74B";
|
|
@@ -120,6 +123,7 @@ export declare const defaultThemes: {
|
|
|
120
123
|
readonly attention: "#F19938";
|
|
121
124
|
readonly accent: "#2174EF";
|
|
122
125
|
readonly 'accent-special': "#649EF4";
|
|
126
|
+
readonly 'primary-inverted': "#0E0E0E";
|
|
123
127
|
readonly 'secondary-inverted': "#86868A";
|
|
124
128
|
readonly main: "#2174ef";
|
|
125
129
|
readonly static: "#FFFFFF";
|