stone-kit 0.0.521 → 0.0.522
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.
|
@@ -8,7 +8,15 @@ interface IFilterWithSave {
|
|
|
8
8
|
value: string;
|
|
9
9
|
state: boolean;
|
|
10
10
|
}[];
|
|
11
|
+
selectedTabs?: {
|
|
12
|
+
value: string;
|
|
13
|
+
state: boolean;
|
|
14
|
+
}[];
|
|
15
|
+
setSelectedTabs?: React.Dispatch<React.SetStateAction<{
|
|
16
|
+
value: string;
|
|
17
|
+
state: boolean;
|
|
18
|
+
}[]>>;
|
|
11
19
|
onChange?: (selectedOptions: TOption[]) => unknown;
|
|
12
20
|
}
|
|
13
|
-
export declare const FilterWithSave: ({ disabledOptions, tabs, selectOptions, onChange, selectedValues, }: IFilterWithSave) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const FilterWithSave: ({ disabledOptions, tabs, selectOptions, onChange, selectedValues, setSelectedTabs, selectedTabs, }: IFilterWithSave) => import("react/jsx-runtime").JSX.Element;
|
|
14
22
|
export {};
|
|
@@ -1,53 +1,56 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { NewIcon as
|
|
4
|
-
import { M as
|
|
5
|
-
import { S as
|
|
6
|
-
import { O as
|
|
1
|
+
import { jsxs as d, Fragment as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w } from "react";
|
|
3
|
+
import { NewIcon as k } from "../../NewIcon/ui/NewIcon.js";
|
|
4
|
+
import { M as y } from "../../../Modal-BZv6nlLe.js";
|
|
5
|
+
import { S as W } from "../../../SortSelect-Chp89Mue.js";
|
|
6
|
+
import { O as A } from "../../../Option-CyYM1iBJ.js";
|
|
7
7
|
import { Button as u } from "../../Button/ui/Button.js";
|
|
8
|
-
const
|
|
9
|
-
root:
|
|
10
|
-
filterWithSaveModal:
|
|
11
|
-
modalAddBody:
|
|
12
|
-
closeBtn:
|
|
13
|
-
modalTitle:
|
|
14
|
-
tabSWitcherWrapper:
|
|
15
|
-
switcherTitle:
|
|
16
|
-
switcherScroll:
|
|
17
|
-
tabs:
|
|
18
|
-
selectWrapper:
|
|
19
|
-
filterOption:
|
|
20
|
-
btnWrapper:
|
|
21
|
-
resetBtn:
|
|
22
|
-
saveBtn:
|
|
23
|
-
},
|
|
24
|
-
disabledOptions:
|
|
25
|
-
tabs:
|
|
26
|
-
selectOptions:
|
|
27
|
-
onChange:
|
|
28
|
-
selectedValues:
|
|
8
|
+
const I = "_root_1fkwh_1", x = "_filterWithSaveModal_1fkwh_15", j = "_modalAddBody_1fkwh_20", z = "_closeBtn_1fkwh_29", F = "_modalTitle_1fkwh_35", R = "_tabSWitcherWrapper_1fkwh_44", L = "_switcherTitle_1fkwh_52", q = "_switcherScroll_1fkwh_59", D = "_tabs_1fkwh_63", E = "_selectWrapper_1fkwh_68", G = "_filterOption_1fkwh_72", H = "_btnWrapper_1fkwh_79", J = "_resetBtn_1fkwh_85", K = "_saveBtn_1fkwh_86", e = {
|
|
9
|
+
root: I,
|
|
10
|
+
filterWithSaveModal: x,
|
|
11
|
+
modalAddBody: j,
|
|
12
|
+
closeBtn: z,
|
|
13
|
+
modalTitle: F,
|
|
14
|
+
tabSWitcherWrapper: R,
|
|
15
|
+
switcherTitle: L,
|
|
16
|
+
switcherScroll: q,
|
|
17
|
+
tabs: D,
|
|
18
|
+
selectWrapper: E,
|
|
19
|
+
filterOption: G,
|
|
20
|
+
btnWrapper: H,
|
|
21
|
+
resetBtn: J,
|
|
22
|
+
saveBtn: K
|
|
23
|
+
}, T = ({
|
|
24
|
+
disabledOptions: B = [],
|
|
25
|
+
tabs: i = [],
|
|
26
|
+
selectOptions: h = [],
|
|
27
|
+
onChange: P,
|
|
28
|
+
selectedValues: C = [],
|
|
29
|
+
setSelectedTabs: l,
|
|
30
|
+
selectedTabs: m
|
|
29
31
|
}) => {
|
|
30
|
-
const [
|
|
31
|
-
if (
|
|
32
|
+
const [N, o] = w(!1), [s, _] = w(C), O = (a) => {
|
|
33
|
+
if (B.some((r) => r.value === a.value))
|
|
32
34
|
return;
|
|
33
|
-
const
|
|
34
|
-
_(
|
|
35
|
+
const n = s.some((r) => r.value === a.value) ? s.filter((r) => r.value !== a.value) : [...s, a];
|
|
36
|
+
_(n);
|
|
35
37
|
}, f = () => {
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
f(),
|
|
39
|
-
},
|
|
38
|
+
l == null || l(i), _([]);
|
|
39
|
+
}, S = () => {
|
|
40
|
+
f(), o(!1);
|
|
41
|
+
}, M = () => {
|
|
42
|
+
o(!1);
|
|
40
43
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ d(g, { children: [
|
|
42
45
|
/* @__PURE__ */ t(
|
|
43
46
|
"div",
|
|
44
47
|
{
|
|
45
48
|
className: e.root,
|
|
46
49
|
onClick: () => {
|
|
47
|
-
|
|
50
|
+
o((a) => !a);
|
|
48
51
|
},
|
|
49
52
|
children: /* @__PURE__ */ t(
|
|
50
|
-
|
|
53
|
+
k,
|
|
51
54
|
{
|
|
52
55
|
name: "filter",
|
|
53
56
|
size: "16"
|
|
@@ -55,11 +58,11 @@ const y = "_root_1fkwh_1", A = "_filterWithSaveModal_1fkwh_15", I = "_modalAddBo
|
|
|
55
58
|
)
|
|
56
59
|
}
|
|
57
60
|
),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
61
|
+
/* @__PURE__ */ d(
|
|
62
|
+
y,
|
|
60
63
|
{
|
|
61
|
-
isOpen:
|
|
62
|
-
emitIsOpen:
|
|
64
|
+
isOpen: N,
|
|
65
|
+
emitIsOpen: o,
|
|
63
66
|
isTransparentBack: !0,
|
|
64
67
|
additionalClassModalBody: e.modalAddBody,
|
|
65
68
|
additionalClass: e.filterWithSaveModal,
|
|
@@ -68,9 +71,9 @@ const y = "_root_1fkwh_1", A = "_filterWithSaveModal_1fkwh_15", I = "_modalAddBo
|
|
|
68
71
|
"div",
|
|
69
72
|
{
|
|
70
73
|
className: e.closeBtn,
|
|
71
|
-
onClick:
|
|
74
|
+
onClick: S,
|
|
72
75
|
children: /* @__PURE__ */ t(
|
|
73
|
-
|
|
76
|
+
k,
|
|
74
77
|
{
|
|
75
78
|
name: "close",
|
|
76
79
|
size: "24"
|
|
@@ -79,50 +82,54 @@ const y = "_root_1fkwh_1", A = "_filterWithSaveModal_1fkwh_15", I = "_modalAddBo
|
|
|
79
82
|
}
|
|
80
83
|
),
|
|
81
84
|
/* @__PURE__ */ t("div", { className: e.modalTitle, children: "Фильтры" }),
|
|
82
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ d("div", { className: e.tabSWitcherWrapper, children: [
|
|
83
86
|
/* @__PURE__ */ t("div", { className: e.switcherTitle, children: "Готовность" }),
|
|
84
87
|
/* @__PURE__ */ t("div", { className: e.switcherScroll, children: /* @__PURE__ */ t(
|
|
85
|
-
|
|
88
|
+
W,
|
|
86
89
|
{
|
|
87
90
|
variant: "grayRow",
|
|
88
91
|
addClassName: e.tabs,
|
|
89
92
|
isApart: !0,
|
|
90
|
-
children:
|
|
93
|
+
children: i == null ? void 0 : i.map((a, n) => {
|
|
91
94
|
var v;
|
|
92
|
-
const
|
|
95
|
+
const r = a.value;
|
|
93
96
|
return /* @__PURE__ */ t(
|
|
94
|
-
|
|
97
|
+
W.Item,
|
|
95
98
|
{
|
|
96
|
-
itemsLength:
|
|
99
|
+
itemsLength: i == null ? void 0 : i.length,
|
|
97
100
|
mini: !0,
|
|
98
|
-
value:
|
|
101
|
+
value: r,
|
|
99
102
|
onClick: () => {
|
|
100
103
|
},
|
|
101
|
-
checked: ((v =
|
|
102
|
-
onChange: () =>
|
|
103
|
-
|
|
104
|
+
checked: ((v = m == null ? void 0 : m.find((p) => p.value === r)) == null ? void 0 : v.state) ?? !1,
|
|
105
|
+
onChange: () => {
|
|
106
|
+
l == null || l(
|
|
107
|
+
(p) => p.map((c) => c.value === r ? { ...c, state: !c.state } : c)
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
index: n,
|
|
104
111
|
addItemClassName: e.tabSwitcher,
|
|
105
|
-
children:
|
|
112
|
+
children: r
|
|
106
113
|
},
|
|
107
|
-
|
|
114
|
+
n
|
|
108
115
|
);
|
|
109
116
|
})
|
|
110
117
|
}
|
|
111
118
|
) })
|
|
112
119
|
] }),
|
|
113
|
-
/* @__PURE__ */ t("div", { className: e.selectWrapper, children:
|
|
114
|
-
|
|
120
|
+
/* @__PURE__ */ t("div", { className: e.selectWrapper, children: h == null ? void 0 : h.map((a, n) => /* @__PURE__ */ t(
|
|
121
|
+
A,
|
|
115
122
|
{
|
|
116
123
|
addClassName: e.filterOption,
|
|
117
124
|
disabledOptions: [],
|
|
118
125
|
clickableOptions: [],
|
|
119
|
-
selectedOptions:
|
|
126
|
+
selectedOptions: s,
|
|
120
127
|
option: a,
|
|
121
|
-
handleOptionClick:
|
|
128
|
+
handleOptionClick: O
|
|
122
129
|
},
|
|
123
|
-
|
|
130
|
+
n
|
|
124
131
|
)) }),
|
|
125
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ d("div", { className: e.btnWrapper, children: [
|
|
126
133
|
/* @__PURE__ */ t(
|
|
127
134
|
u,
|
|
128
135
|
{
|
|
@@ -138,7 +145,7 @@ const y = "_root_1fkwh_1", A = "_filterWithSaveModal_1fkwh_15", I = "_modalAddBo
|
|
|
138
145
|
{
|
|
139
146
|
as: "button",
|
|
140
147
|
additionalClass: e.saveBtn,
|
|
141
|
-
onClick:
|
|
148
|
+
onClick: M,
|
|
142
149
|
children: "Сохранить"
|
|
143
150
|
}
|
|
144
151
|
)
|
|
@@ -149,5 +156,5 @@ const y = "_root_1fkwh_1", A = "_filterWithSaveModal_1fkwh_15", I = "_modalAddBo
|
|
|
149
156
|
] });
|
|
150
157
|
};
|
|
151
158
|
export {
|
|
152
|
-
|
|
159
|
+
T as FilterWithSave
|
|
153
160
|
};
|