stone-kit 0.0.520 → 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,48 +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
|
|
7
|
-
import { Button as
|
|
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:
|
|
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
|
+
import { Button as u } from "../../Button/ui/Button.js";
|
|
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
|
-
|
|
32
|
-
const N = (a) => {
|
|
33
|
-
if (u.some((l) => l.value === a.value))
|
|
32
|
+
const [N, o] = w(!1), [s, _] = w(C), O = (a) => {
|
|
33
|
+
if (B.some((r) => r.value === a.value))
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
36
|
-
_(
|
|
35
|
+
const n = s.some((r) => r.value === a.value) ? s.filter((r) => r.value !== a.value) : [...s, a];
|
|
36
|
+
_(n);
|
|
37
|
+
}, f = () => {
|
|
38
|
+
l == null || l(i), _([]);
|
|
39
|
+
}, S = () => {
|
|
40
|
+
f(), o(!1);
|
|
41
|
+
}, M = () => {
|
|
42
|
+
o(!1);
|
|
37
43
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ d(g, { children: [
|
|
39
45
|
/* @__PURE__ */ t(
|
|
40
46
|
"div",
|
|
41
47
|
{
|
|
42
48
|
className: e.root,
|
|
43
|
-
onClick: () =>
|
|
49
|
+
onClick: () => {
|
|
50
|
+
o((a) => !a);
|
|
51
|
+
},
|
|
44
52
|
children: /* @__PURE__ */ t(
|
|
45
|
-
|
|
53
|
+
k,
|
|
46
54
|
{
|
|
47
55
|
name: "filter",
|
|
48
56
|
size: "16"
|
|
@@ -50,11 +58,11 @@ const b = "_root_1fkwh_1", g = "_filterWithSaveModal_1fkwh_15", y = "_modalAddBo
|
|
|
50
58
|
)
|
|
51
59
|
}
|
|
52
60
|
),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
61
|
+
/* @__PURE__ */ d(
|
|
62
|
+
y,
|
|
55
63
|
{
|
|
56
|
-
isOpen:
|
|
57
|
-
emitIsOpen:
|
|
64
|
+
isOpen: N,
|
|
65
|
+
emitIsOpen: o,
|
|
58
66
|
isTransparentBack: !0,
|
|
59
67
|
additionalClassModalBody: e.modalAddBody,
|
|
60
68
|
additionalClass: e.filterWithSaveModal,
|
|
@@ -63,9 +71,9 @@ const b = "_root_1fkwh_1", g = "_filterWithSaveModal_1fkwh_15", y = "_modalAddBo
|
|
|
63
71
|
"div",
|
|
64
72
|
{
|
|
65
73
|
className: e.closeBtn,
|
|
66
|
-
onClick:
|
|
74
|
+
onClick: S,
|
|
67
75
|
children: /* @__PURE__ */ t(
|
|
68
|
-
|
|
76
|
+
k,
|
|
69
77
|
{
|
|
70
78
|
name: "close",
|
|
71
79
|
size: "24"
|
|
@@ -74,68 +82,70 @@ const b = "_root_1fkwh_1", g = "_filterWithSaveModal_1fkwh_15", y = "_modalAddBo
|
|
|
74
82
|
}
|
|
75
83
|
),
|
|
76
84
|
/* @__PURE__ */ t("div", { className: e.modalTitle, children: "Фильтры" }),
|
|
77
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ d("div", { className: e.tabSWitcherWrapper, children: [
|
|
78
86
|
/* @__PURE__ */ t("div", { className: e.switcherTitle, children: "Готовность" }),
|
|
79
87
|
/* @__PURE__ */ t("div", { className: e.switcherScroll, children: /* @__PURE__ */ t(
|
|
80
|
-
|
|
88
|
+
W,
|
|
81
89
|
{
|
|
82
90
|
variant: "grayRow",
|
|
83
91
|
addClassName: e.tabs,
|
|
84
92
|
isApart: !0,
|
|
85
|
-
children:
|
|
86
|
-
var
|
|
87
|
-
const
|
|
93
|
+
children: i == null ? void 0 : i.map((a, n) => {
|
|
94
|
+
var v;
|
|
95
|
+
const r = a.value;
|
|
88
96
|
return /* @__PURE__ */ t(
|
|
89
|
-
|
|
97
|
+
W.Item,
|
|
90
98
|
{
|
|
91
|
-
itemsLength:
|
|
99
|
+
itemsLength: i == null ? void 0 : i.length,
|
|
92
100
|
mini: !0,
|
|
93
|
-
value:
|
|
101
|
+
value: r,
|
|
94
102
|
onClick: () => {
|
|
95
103
|
},
|
|
96
|
-
checked: ((
|
|
97
|
-
onChange: () =>
|
|
98
|
-
|
|
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,
|
|
99
111
|
addItemClassName: e.tabSwitcher,
|
|
100
|
-
children:
|
|
112
|
+
children: r
|
|
101
113
|
},
|
|
102
|
-
|
|
114
|
+
n
|
|
103
115
|
);
|
|
104
116
|
})
|
|
105
117
|
}
|
|
106
118
|
) })
|
|
107
119
|
] }),
|
|
108
|
-
/* @__PURE__ */ t("div", { className: e.selectWrapper, children:
|
|
109
|
-
|
|
120
|
+
/* @__PURE__ */ t("div", { className: e.selectWrapper, children: h == null ? void 0 : h.map((a, n) => /* @__PURE__ */ t(
|
|
121
|
+
A,
|
|
110
122
|
{
|
|
111
123
|
addClassName: e.filterOption,
|
|
112
124
|
disabledOptions: [],
|
|
113
125
|
clickableOptions: [],
|
|
114
|
-
selectedOptions:
|
|
126
|
+
selectedOptions: s,
|
|
115
127
|
option: a,
|
|
116
|
-
handleOptionClick:
|
|
128
|
+
handleOptionClick: O
|
|
117
129
|
},
|
|
118
|
-
|
|
130
|
+
n
|
|
119
131
|
)) }),
|
|
120
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ d("div", { className: e.btnWrapper, children: [
|
|
121
133
|
/* @__PURE__ */ t(
|
|
122
|
-
|
|
134
|
+
u,
|
|
123
135
|
{
|
|
124
136
|
as: "button",
|
|
125
137
|
variant: "gray",
|
|
126
138
|
additionalClass: e.resetBtn,
|
|
127
|
-
onClick:
|
|
128
|
-
p(r), _([]);
|
|
129
|
-
},
|
|
139
|
+
onClick: f,
|
|
130
140
|
children: "Сбросить"
|
|
131
141
|
}
|
|
132
142
|
),
|
|
133
143
|
/* @__PURE__ */ t(
|
|
134
|
-
|
|
144
|
+
u,
|
|
135
145
|
{
|
|
136
146
|
as: "button",
|
|
137
147
|
additionalClass: e.saveBtn,
|
|
138
|
-
onClick:
|
|
148
|
+
onClick: M,
|
|
139
149
|
children: "Сохранить"
|
|
140
150
|
}
|
|
141
151
|
)
|
|
@@ -146,5 +156,5 @@ const b = "_root_1fkwh_1", g = "_filterWithSaveModal_1fkwh_15", y = "_modalAddBo
|
|
|
146
156
|
] });
|
|
147
157
|
};
|
|
148
158
|
export {
|
|
149
|
-
|
|
159
|
+
T as FilterWithSave
|
|
150
160
|
};
|