stone-kit 0.0.653 → 0.0.654
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as m, Fragment as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as m, Fragment as R, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as D, useEffect as W } from "react";
|
|
3
3
|
import { c as G } from "../../../index-rKuIKazb.js";
|
|
4
4
|
import { s as e, O as H } from "../../../Option-a48eBPyn.js";
|
|
5
5
|
import { NewIcon as j } from "../../NewIcon/ui/NewIcon.js";
|
|
6
6
|
import { Category as J } from "./Category.js";
|
|
7
7
|
import { handleClickModeOption as K, handleClickModeCategory as Q } from "../model/selectMode.js";
|
|
8
|
-
const
|
|
9
|
-
options:
|
|
8
|
+
const a = G.bind(e), ee = ({
|
|
9
|
+
options: t,
|
|
10
10
|
placeholder: z = "Выберите опции",
|
|
11
11
|
error: B,
|
|
12
12
|
disabled: g,
|
|
@@ -18,63 +18,63 @@ const s = G.bind(e), ee = ({
|
|
|
18
18
|
onBlur: u,
|
|
19
19
|
selectedValues: c = [],
|
|
20
20
|
isBtn: O = !1,
|
|
21
|
-
btnName:
|
|
22
|
-
clickableOptions:
|
|
21
|
+
btnName: y,
|
|
22
|
+
clickableOptions: C,
|
|
23
23
|
isListRight: P = !1,
|
|
24
24
|
sizeIcon: d,
|
|
25
|
-
mode:
|
|
26
|
-
onClickItem:
|
|
25
|
+
mode: s = "options",
|
|
26
|
+
onClickItem: v,
|
|
27
27
|
onCLickSelect: N,
|
|
28
28
|
size_s: S = "large",
|
|
29
29
|
size_m: k,
|
|
30
30
|
size_l: $
|
|
31
31
|
}) => {
|
|
32
|
-
|
|
33
|
-
const [l, x] =
|
|
34
|
-
|
|
32
|
+
t = Array.isArray(t) ? [.../* @__PURE__ */ new Set([...t])] : [];
|
|
33
|
+
const [l, x] = w(c), [o, h] = w(!1), p = D(null), A = (r) => {
|
|
34
|
+
v && v(r);
|
|
35
35
|
const n = {
|
|
36
|
-
option:
|
|
36
|
+
option: r,
|
|
37
37
|
selectedOptions: l,
|
|
38
38
|
disabledOptions: f,
|
|
39
39
|
setSelectedOptions: x,
|
|
40
40
|
onChange: F,
|
|
41
|
-
mode:
|
|
42
|
-
optionsParentArr:
|
|
41
|
+
mode: s,
|
|
42
|
+
optionsParentArr: t
|
|
43
43
|
};
|
|
44
|
-
Array.isArray(
|
|
44
|
+
Array.isArray(r) ? Q(n) : K(n);
|
|
45
45
|
}, _ = () => {
|
|
46
46
|
u && u(l);
|
|
47
47
|
};
|
|
48
48
|
W(() => {
|
|
49
|
-
const
|
|
49
|
+
const r = (n) => {
|
|
50
50
|
const q = n.target;
|
|
51
|
-
if (
|
|
51
|
+
if (p.current && !p.current.contains(n.target)) {
|
|
52
52
|
if (q.closest("svg"))
|
|
53
53
|
return;
|
|
54
|
-
|
|
54
|
+
h(!1);
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
return document.addEventListener("click",
|
|
58
|
-
document.removeEventListener("click",
|
|
57
|
+
return document.addEventListener("click", r), () => {
|
|
58
|
+
document.removeEventListener("click", r);
|
|
59
59
|
};
|
|
60
60
|
}, []);
|
|
61
|
-
const
|
|
61
|
+
const E = D(c);
|
|
62
62
|
return W(() => {
|
|
63
|
-
c.length !==
|
|
63
|
+
c.length !== E.current.length && (x(c), E.current = c);
|
|
64
64
|
}, [c]), /* @__PURE__ */ m(
|
|
65
65
|
"div",
|
|
66
66
|
{
|
|
67
|
-
ref:
|
|
68
|
-
className:
|
|
67
|
+
ref: p,
|
|
68
|
+
className: a(e.multiSelectWrapper, { [e.multiSelectWrapperError]: B }, L),
|
|
69
69
|
tabIndex: 0,
|
|
70
70
|
onBlur: _,
|
|
71
71
|
children: [
|
|
72
|
-
/* @__PURE__ */ m("div", { className:
|
|
73
|
-
!O && /* @__PURE__ */ m(
|
|
72
|
+
/* @__PURE__ */ m("div", { className: a(e.inputWrapper), children: [
|
|
73
|
+
!O && /* @__PURE__ */ m(R, { children: [
|
|
74
74
|
/* @__PURE__ */ i(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
|
-
className:
|
|
77
|
+
className: a(
|
|
78
78
|
e.selectedOptions,
|
|
79
79
|
e[`${S}-size`],
|
|
80
80
|
e[`${k}-size_m`],
|
|
@@ -82,7 +82,7 @@ const s = G.bind(e), ee = ({
|
|
|
82
82
|
{ [e.selectedOptionsNotEmpty]: l.length > 0 },
|
|
83
83
|
{ [e.selectOptionsDisabled]: g }
|
|
84
84
|
),
|
|
85
|
-
onClick: () =>
|
|
85
|
+
onClick: () => h(!o),
|
|
86
86
|
children: l.length === 0 ? z : "Выбрано " + l.length
|
|
87
87
|
}
|
|
88
88
|
),
|
|
@@ -96,11 +96,11 @@ const s = G.bind(e), ee = ({
|
|
|
96
96
|
}
|
|
97
97
|
)
|
|
98
98
|
] }),
|
|
99
|
-
O && /* @__PURE__ */ m(
|
|
99
|
+
O && /* @__PURE__ */ m(R, { children: [
|
|
100
100
|
/* @__PURE__ */ i(
|
|
101
101
|
"button",
|
|
102
102
|
{
|
|
103
|
-
className:
|
|
103
|
+
className: a(
|
|
104
104
|
e.selectedOptions,
|
|
105
105
|
e[`${S}-size`],
|
|
106
106
|
e[`${k}-size_m`],
|
|
@@ -110,9 +110,9 @@ const s = G.bind(e), ee = ({
|
|
|
110
110
|
b
|
|
111
111
|
),
|
|
112
112
|
onClick: () => {
|
|
113
|
-
N && N(),
|
|
113
|
+
N && N(), h(!o);
|
|
114
114
|
},
|
|
115
|
-
children:
|
|
115
|
+
children: y
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
118
|
/* @__PURE__ */ i(
|
|
@@ -121,36 +121,36 @@ const s = G.bind(e), ee = ({
|
|
|
121
121
|
name: "filter",
|
|
122
122
|
deg: o ? "180" : "0",
|
|
123
123
|
size: d ?? "24",
|
|
124
|
-
additionalClass:
|
|
124
|
+
additionalClass: a(e.icon, { [e.iconBtn]: !y })
|
|
125
125
|
}
|
|
126
126
|
)
|
|
127
127
|
] })
|
|
128
128
|
] }),
|
|
129
|
-
o && /* @__PURE__ */ m("div", { className:
|
|
130
|
-
|
|
129
|
+
o && /* @__PURE__ */ m("div", { className: a(e.optionsList, { [e.listRight]: P }, M), children: [
|
|
130
|
+
s === "options" && (t == null ? void 0 : t.map((r, n) => /* @__PURE__ */ i(
|
|
131
131
|
H,
|
|
132
132
|
{
|
|
133
133
|
disabledOptions: f,
|
|
134
|
-
clickableOptions:
|
|
134
|
+
clickableOptions: C,
|
|
135
135
|
selectedOptions: l,
|
|
136
136
|
sizeIcon: d,
|
|
137
|
-
option:
|
|
138
|
-
handleOptionClick:
|
|
137
|
+
option: r,
|
|
138
|
+
handleOptionClick: A
|
|
139
139
|
},
|
|
140
140
|
n
|
|
141
141
|
))),
|
|
142
|
-
(
|
|
143
|
-
(
|
|
142
|
+
(s === "category" || s === "double") && (t == null ? void 0 : t.map(
|
|
143
|
+
(r, n) => "options" in r ? /* @__PURE__ */ i(
|
|
144
144
|
J,
|
|
145
145
|
{
|
|
146
146
|
disabledOptions: f,
|
|
147
|
-
clickableOptions:
|
|
147
|
+
clickableOptions: C,
|
|
148
148
|
selectedOptions: l,
|
|
149
149
|
sizeIcon: d,
|
|
150
|
-
category:
|
|
151
|
-
mode:
|
|
150
|
+
category: r,
|
|
151
|
+
mode: s,
|
|
152
152
|
selectedValues: c,
|
|
153
|
-
handleOptionClick:
|
|
153
|
+
handleOptionClick: A
|
|
154
154
|
},
|
|
155
155
|
n
|
|
156
156
|
) : null
|