stone-kit 0.0.777 → 0.0.779
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/components/NewIcon/ui/NewIcon.js +1 -1
- package/dist/components/Select/model/selectMode.d.ts +3 -3
- package/dist/components/Select/model/selectMode.js +32 -29
- package/dist/components/Select/ui/Select.js +19 -19
- package/dist/components/Select/ui/Select.types.d.ts +1 -1
- package/dist/components/SummarySelect/ui/SummarySelect.js +52 -34
- package/package.json +1 -1
|
@@ -214,7 +214,7 @@ const d = ({
|
|
|
214
214
|
title: t,
|
|
215
215
|
titleId: l,
|
|
216
216
|
...r
|
|
217
|
-
}, a) => /* @__PURE__ */ e.createElement("svg", { width:
|
|
217
|
+
}, a) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: a, "aria-labelledby": l, ...r }, t ? /* @__PURE__ */ e.createElement("title", { id: l }, t) : null, /* @__PURE__ */ e.createElement("path", { d: "M12.0004 2C9.34927 2.00287 6.8075 3.05704 4.93284 4.93121C3.05818 6.80539 2.00374 9.3465 2.00087 11.997C1.89588 19.9721 11.2996 24.8506 17.7502 20.1753C17.8429 20.1137 17.9223 20.0341 17.9837 19.9413C18.0451 19.8484 18.0873 19.7442 18.1078 19.6348C18.1282 19.5254 18.1266 19.413 18.1028 19.3043C18.0791 19.1955 18.0339 19.0926 17.9697 19.0017C17.9056 18.9107 17.8238 18.8335 17.7294 18.7746C17.6349 18.7158 17.5295 18.6764 17.4196 18.659C17.3096 18.6415 17.1973 18.6462 17.0892 18.6728C16.9811 18.6995 16.8794 18.7475 16.7902 18.8141C11.4171 22.7071 3.58414 18.6433 3.66747 11.997C4.12495 0.945319 19.8776 0.947818 20.3334 11.997V13.6631C20.3334 14.105 20.1578 14.5288 19.8453 14.8413C19.5327 15.1538 19.1088 15.3293 18.6668 15.3293C18.2248 15.3293 17.8009 15.1538 17.4884 14.8413C17.1758 14.5288 17.0002 14.105 17.0002 13.6631V11.997C16.7902 5.39148 7.20981 5.39231 7.00065 11.997C7.01035 13.01 7.32685 13.9963 7.90843 14.8259C8.49002 15.6555 9.30939 16.2895 10.2586 16.6443C11.2077 16.999 12.2421 17.0579 13.2255 16.8132C14.2088 16.5685 15.0949 16.0317 15.7669 15.2735C16.1284 15.9113 16.6902 16.4122 17.3653 16.6985C18.0403 16.9848 18.791 17.0405 19.5009 16.8571C20.2109 16.6737 20.8406 16.2613 21.2924 15.6839C21.7441 15.1065 21.9929 14.3962 22 13.6631V11.997C21.9971 9.3465 20.9427 6.80539 19.068 4.93121C17.1934 3.05704 14.6516 2.00287 12.0004 2ZM12.0004 15.3293C11.1164 15.3293 10.2686 14.9782 9.64352 14.3533C9.01842 13.7284 8.66725 12.8808 8.66725 11.997C8.66725 11.1132 9.01842 10.2656 9.64352 9.64067C10.2686 9.01574 11.1164 8.66465 12.0004 8.66465C12.8845 8.66465 13.7323 9.01574 14.3574 9.64067C14.9824 10.2656 15.3336 11.1132 15.3336 11.997C15.3336 12.8808 14.9824 13.7284 14.3574 14.3533C13.7323 14.9782 12.8845 15.3293 12.0004 15.3293Z", fill: "white" })), i0 = o(s0), i = {}, w0 = {
|
|
218
218
|
arrowRight: () => /* @__PURE__ */ n(l0, {}),
|
|
219
219
|
loader: () => /* @__PURE__ */ n(h, {}),
|
|
220
220
|
filter: () => /* @__PURE__ */ n(f, {}),
|
|
@@ -7,9 +7,9 @@ export type TClickOptionProps = {
|
|
|
7
7
|
selectedOptions: TOption[];
|
|
8
8
|
setSelectedOptions: (value: SetStateAction<TOption[]>) => void;
|
|
9
9
|
mode: TModeSelect;
|
|
10
|
-
onChange?: (
|
|
10
|
+
onChange?: (selectedOptions: TOption[]) => unknown;
|
|
11
11
|
optionsParentArr?: TCategory[] | TOption[];
|
|
12
12
|
};
|
|
13
|
-
declare const handleClickModeOption: ({ option, setSelectedOptions, selectedOptions, disabledOptions, onChange, mode, optionsParentArr }: TClickOptionProps) => void;
|
|
14
|
-
declare const handleClickModeCategory: ({ option, setSelectedOptions, selectedOptions, disabledOptions, onChange }: TClickOptionProps) => void;
|
|
13
|
+
declare const handleClickModeOption: ({ option, setSelectedOptions, selectedOptions, disabledOptions, onChange, mode, optionsParentArr, }: TClickOptionProps) => void;
|
|
14
|
+
declare const handleClickModeCategory: ({ option, setSelectedOptions, selectedOptions, disabledOptions, onChange, }: TClickOptionProps) => void;
|
|
15
15
|
export { handleClickModeCategory, handleClickModeOption };
|
|
@@ -1,46 +1,49 @@
|
|
|
1
|
-
const
|
|
1
|
+
const J = ({
|
|
2
2
|
option: e,
|
|
3
|
-
setSelectedOptions:
|
|
4
|
-
selectedOptions:
|
|
5
|
-
disabledOptions:
|
|
3
|
+
setSelectedOptions: s,
|
|
4
|
+
selectedOptions: l,
|
|
5
|
+
disabledOptions: u,
|
|
6
6
|
onChange: c,
|
|
7
|
-
mode:
|
|
8
|
-
optionsParentArr:
|
|
7
|
+
mode: y,
|
|
8
|
+
optionsParentArr: f
|
|
9
9
|
}) => {
|
|
10
10
|
if (!Array.isArray(e)) {
|
|
11
|
-
if (
|
|
11
|
+
if (u.includes(e))
|
|
12
12
|
return;
|
|
13
|
-
let i =
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
let i = l.some((r) => r.value === e.value) ? l.filter((r) => r.value !== e.value) : [...l, e];
|
|
14
|
+
if (y === "single") {
|
|
15
|
+
const r = [e];
|
|
16
|
+
s(r), c && c(r);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (y === "double") {
|
|
20
|
+
"options" in e && (l.map((t) => JSON.stringify(t)).includes(JSON.stringify(e)) ? i = i.filter(
|
|
21
|
+
(t) => !e.options.map((a) => JSON.stringify(a)).includes(JSON.stringify(t))
|
|
22
|
+
) : Array.isArray(e.options) && (i = [...i, ...e.options]));
|
|
23
|
+
const r = f == null ? void 0 : f.filter((S) => "options" in S && S.options.includes(e))[0];
|
|
24
|
+
!(r && l.map((S) => JSON.stringify(S)).includes(JSON.stringify(r))) && r && i.push(r);
|
|
18
25
|
}
|
|
19
|
-
|
|
26
|
+
s(i), c && c(i);
|
|
20
27
|
}
|
|
21
|
-
},
|
|
28
|
+
}, N = ({
|
|
22
29
|
option: e,
|
|
23
|
-
setSelectedOptions:
|
|
24
|
-
selectedOptions:
|
|
25
|
-
disabledOptions:
|
|
30
|
+
setSelectedOptions: s,
|
|
31
|
+
selectedOptions: l,
|
|
32
|
+
disabledOptions: u,
|
|
26
33
|
onChange: c
|
|
27
34
|
}) => {
|
|
28
35
|
if (Array.isArray(e)) {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
);
|
|
34
|
-
y(r), c && c(r);
|
|
36
|
+
const y = e.filter((f) => !(u != null && u.includes(f)));
|
|
37
|
+
if (y.every((f) => l.map((i) => i).includes(f))) {
|
|
38
|
+
const f = l.filter((i) => !e.includes(i));
|
|
39
|
+
s(f), c && c(f);
|
|
35
40
|
} else {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
), i = [...f, ...r];
|
|
39
|
-
y(i), c && c(i);
|
|
41
|
+
const f = y.filter((r) => !l.includes(r)), i = [...l, ...f];
|
|
42
|
+
s(i), c && c(i);
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
};
|
|
43
46
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
N as handleClickModeCategory,
|
|
48
|
+
J as handleClickModeOption
|
|
46
49
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as m, Fragment as w, jsx as
|
|
1
|
+
import { jsxs as m, Fragment as w, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useState as L, useRef as W, useEffect as j } from "react";
|
|
3
3
|
import { c as K } from "../../../index-rKuIKazb.js";
|
|
4
4
|
import { s as e, O as Q } from "../../../Option-BVIm7wOW.js";
|
|
@@ -9,7 +9,7 @@ const a = K.bind(e), te = ({
|
|
|
9
9
|
options: t,
|
|
10
10
|
placeholder: B = "Выберите опции",
|
|
11
11
|
error: D,
|
|
12
|
-
disabled:
|
|
12
|
+
disabled: p,
|
|
13
13
|
disabledOptions: f = [],
|
|
14
14
|
additionalClass: M = "",
|
|
15
15
|
additionalClassOption: F,
|
|
@@ -22,7 +22,7 @@ const a = K.bind(e), te = ({
|
|
|
22
22
|
clickableOptions: v,
|
|
23
23
|
isListRight: q = !1,
|
|
24
24
|
sizeIcon: d,
|
|
25
|
-
mode:
|
|
25
|
+
mode: s = "options",
|
|
26
26
|
onClickItem: C,
|
|
27
27
|
onCLickSelect: S,
|
|
28
28
|
size_s: N = "large",
|
|
@@ -32,7 +32,7 @@ const a = K.bind(e), te = ({
|
|
|
32
32
|
isLast: G
|
|
33
33
|
}) => {
|
|
34
34
|
t = Array.isArray(t) ? [.../* @__PURE__ */ new Set([...t])] : [];
|
|
35
|
-
const [l, A] = L(c), [o,
|
|
35
|
+
const [l, A] = L(c), [o, g] = L(!1), h = W(null), E = (r) => {
|
|
36
36
|
C && C(r);
|
|
37
37
|
const n = {
|
|
38
38
|
option: r,
|
|
@@ -40,7 +40,7 @@ const a = K.bind(e), te = ({
|
|
|
40
40
|
disabledOptions: f,
|
|
41
41
|
setSelectedOptions: A,
|
|
42
42
|
onChange: _,
|
|
43
|
-
mode:
|
|
43
|
+
mode: s,
|
|
44
44
|
optionsParentArr: t
|
|
45
45
|
};
|
|
46
46
|
Array.isArray(r) ? X(n) : U(n);
|
|
@@ -50,10 +50,10 @@ const a = K.bind(e), te = ({
|
|
|
50
50
|
j(() => {
|
|
51
51
|
const r = (n) => {
|
|
52
52
|
const J = n.target;
|
|
53
|
-
if (
|
|
53
|
+
if (h.current && !h.current.contains(n.target)) {
|
|
54
54
|
if (J.closest("svg"))
|
|
55
55
|
return;
|
|
56
|
-
|
|
56
|
+
g(!1);
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
return document.addEventListener("click", r), () => {
|
|
@@ -66,14 +66,14 @@ const a = K.bind(e), te = ({
|
|
|
66
66
|
}, [c]), /* @__PURE__ */ m(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
|
-
ref:
|
|
69
|
+
ref: h,
|
|
70
70
|
className: a(e.multiSelectWrapper, { [e.multiSelectWrapperError]: D }, M),
|
|
71
71
|
tabIndex: 0,
|
|
72
72
|
onBlur: H,
|
|
73
73
|
children: [
|
|
74
74
|
/* @__PURE__ */ m("div", { className: a(e.inputWrapper), children: [
|
|
75
75
|
!O && /* @__PURE__ */ m(w, { children: [
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ i(
|
|
77
77
|
"div",
|
|
78
78
|
{
|
|
79
79
|
className: a(
|
|
@@ -82,13 +82,13 @@ const a = K.bind(e), te = ({
|
|
|
82
82
|
e[`${$}-size_m`],
|
|
83
83
|
e[`${k}-size)_l`],
|
|
84
84
|
{ [e.selectedOptionsNotEmpty]: l.length > 0 },
|
|
85
|
-
{ [e.selectOptionsDisabled]:
|
|
85
|
+
{ [e.selectOptionsDisabled]: p }
|
|
86
86
|
),
|
|
87
|
-
onClick: () =>
|
|
87
|
+
onClick: () => g(!o),
|
|
88
88
|
children: l.length === 0 ? B : "Выбрано " + l.length
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ i(
|
|
92
92
|
z,
|
|
93
93
|
{
|
|
94
94
|
name: "arrowShort",
|
|
@@ -99,7 +99,7 @@ const a = K.bind(e), te = ({
|
|
|
99
99
|
)
|
|
100
100
|
] }),
|
|
101
101
|
O && /* @__PURE__ */ m(w, { children: [
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ i(
|
|
103
103
|
"button",
|
|
104
104
|
{
|
|
105
105
|
className: a(
|
|
@@ -108,16 +108,16 @@ const a = K.bind(e), te = ({
|
|
|
108
108
|
e[`${$}-size_m`],
|
|
109
109
|
e[`${k}-size_l`],
|
|
110
110
|
e.selectedOptionsBtn,
|
|
111
|
-
{ [e.selectOptionsDisabled]:
|
|
111
|
+
{ [e.selectOptionsDisabled]: p },
|
|
112
112
|
P
|
|
113
113
|
),
|
|
114
114
|
onClick: () => {
|
|
115
|
-
S && S(),
|
|
115
|
+
S && S(), g(!o);
|
|
116
116
|
},
|
|
117
117
|
children: y
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ i(
|
|
121
121
|
z,
|
|
122
122
|
{
|
|
123
123
|
name: "filter",
|
|
@@ -138,7 +138,7 @@ const a = K.bind(e), te = ({
|
|
|
138
138
|
F
|
|
139
139
|
),
|
|
140
140
|
children: [
|
|
141
|
-
|
|
141
|
+
(s === "options" || s === "single") && (t == null ? void 0 : t.map((r, n) => /* @__PURE__ */ i(
|
|
142
142
|
Q,
|
|
143
143
|
{
|
|
144
144
|
disabledOptions: f,
|
|
@@ -151,7 +151,7 @@ const a = K.bind(e), te = ({
|
|
|
151
151
|
},
|
|
152
152
|
n
|
|
153
153
|
))),
|
|
154
|
-
(
|
|
154
|
+
(s === "category" || s === "double") && (t == null ? void 0 : t.map((r, n) => "options" in r ? /* @__PURE__ */ i(
|
|
155
155
|
T,
|
|
156
156
|
{
|
|
157
157
|
disabledOptions: f,
|
|
@@ -159,7 +159,7 @@ const a = K.bind(e), te = ({
|
|
|
159
159
|
selectedOptions: l,
|
|
160
160
|
sizeIcon: d,
|
|
161
161
|
category: r,
|
|
162
|
-
mode:
|
|
162
|
+
mode: s,
|
|
163
163
|
selectedValues: c,
|
|
164
164
|
handleOptionClick: E,
|
|
165
165
|
isDisabledNotClickable: x
|
|
@@ -9,7 +9,7 @@ export type TCategory = {
|
|
|
9
9
|
label: string;
|
|
10
10
|
options: TOption[];
|
|
11
11
|
};
|
|
12
|
-
export type TModeSelect = 'options' | 'category' | 'double';
|
|
12
|
+
export type TModeSelect = 'options' | 'category' | 'double' | 'single';
|
|
13
13
|
type SelectSizes = 'medium' | 'small' | 'large';
|
|
14
14
|
export interface MultiSelectProps {
|
|
15
15
|
options: TOption[] | TCategory[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as s, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { NewIcon as d } from "../../NewIcon/ui/NewIcon.js";
|
|
3
3
|
import { Select as O } from "../../Select/ui/Select.js";
|
|
4
|
-
const N = "_root_156r8_1",
|
|
4
|
+
const N = "_root_156r8_1", f = "_nameWrapper_156r8_8", p = "_clearBtn_156r8_18", S = "_summaryList_156r8_33", V = "_summaryOption_156r8_40", B = "_categoryOption_156r8_62", b = "_summaryCategory_156r8_71", k = "_headerCategory_156r8_81", T = "_categoryTitle_156r8_87", W = "_categoryOptions_156r8_95", t = {
|
|
5
5
|
root: N,
|
|
6
|
-
nameWrapper:
|
|
7
|
-
clearBtn:
|
|
6
|
+
nameWrapper: f,
|
|
7
|
+
clearBtn: p,
|
|
8
8
|
summaryList: S,
|
|
9
9
|
summaryOption: V,
|
|
10
10
|
categoryOption: B,
|
|
@@ -28,7 +28,11 @@ const N = "_root_156r8_1", p = "_nameWrapper_156r8_8", f = "_clearBtn_156r8_18",
|
|
|
28
28
|
c([]);
|
|
29
29
|
}, v = (e) => {
|
|
30
30
|
var o;
|
|
31
|
-
c(
|
|
31
|
+
c(
|
|
32
|
+
((o = a.selectedValues) == null ? void 0 : o.filter((r) => r.value !== e.value).filter(
|
|
33
|
+
(r) => !e.options.some((n) => n.value === r.value)
|
|
34
|
+
)) ?? []
|
|
35
|
+
);
|
|
32
36
|
}, m = (y = a.selectedValues) == null ? void 0 : y.filter((e) => "options" in e);
|
|
33
37
|
return /* @__PURE__ */ s("div", { className: t.root, children: [
|
|
34
38
|
/* @__PURE__ */ s("div", { className: t.nameWrapper, children: [
|
|
@@ -49,7 +53,7 @@ const N = "_root_156r8_1", p = "_nameWrapper_156r8_8", f = "_clearBtn_156r8_18",
|
|
|
49
53
|
onChange: c
|
|
50
54
|
}
|
|
51
55
|
),
|
|
52
|
-
a.mode === "options" && a.selectedValues && a.selectedValues.length > 0 && /* @__PURE__ */ l("div", { className: t.summaryList, children: a.selectedValues.map((e) => /* @__PURE__ */ s(
|
|
56
|
+
(a.mode === "options" || a.mode === "single") && a.selectedValues && a.selectedValues.length > 0 && /* @__PURE__ */ l("div", { className: t.summaryList, children: a.selectedValues.map((e) => /* @__PURE__ */ s(
|
|
53
57
|
"div",
|
|
54
58
|
{
|
|
55
59
|
onClick: () => u(e.value.toString()),
|
|
@@ -69,39 +73,53 @@ const N = "_root_156r8_1", p = "_nameWrapper_156r8_8", f = "_clearBtn_156r8_18",
|
|
|
69
73
|
)) }),
|
|
70
74
|
a.mode === "double" && (m == null ? void 0 : m.map((e, o) => {
|
|
71
75
|
const r = e;
|
|
72
|
-
return /* @__PURE__ */ s(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
size: "16"
|
|
80
|
-
}
|
|
81
|
-
) })
|
|
82
|
-
] }),
|
|
83
|
-
/* @__PURE__ */ l("div", { className: t.categoryOptions, children: r.options.filter((n) => {
|
|
84
|
-
var i;
|
|
85
|
-
return (i = a.selectedValues) == null ? void 0 : i.some((C) => n.value === C.value);
|
|
86
|
-
}).map((n, i) => /* @__PURE__ */ s(
|
|
87
|
-
"div",
|
|
88
|
-
{
|
|
89
|
-
onClick: () => u(n.value.toString()),
|
|
90
|
-
className: `${t.summaryOption} ${t.categoryOption}`,
|
|
91
|
-
children: [
|
|
92
|
-
n.label,
|
|
76
|
+
return /* @__PURE__ */ s(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: t.summaryCategory,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ s("div", { className: t.headerCategory, children: [
|
|
82
|
+
/* @__PURE__ */ l("div", { className: t.categoryTitle, children: r.label }),
|
|
93
83
|
/* @__PURE__ */ l(
|
|
94
|
-
|
|
84
|
+
"div",
|
|
95
85
|
{
|
|
96
|
-
|
|
97
|
-
|
|
86
|
+
onClick: () => v(e),
|
|
87
|
+
className: t.clearBtn,
|
|
88
|
+
children: /* @__PURE__ */ l(
|
|
89
|
+
d,
|
|
90
|
+
{
|
|
91
|
+
name: "close",
|
|
92
|
+
size: "16"
|
|
93
|
+
}
|
|
94
|
+
)
|
|
98
95
|
}
|
|
99
96
|
)
|
|
100
|
-
]
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ l("div", { className: t.categoryOptions, children: r.options.filter((n) => {
|
|
99
|
+
var i;
|
|
100
|
+
return (i = a.selectedValues) == null ? void 0 : i.some((C) => n.value === C.value);
|
|
101
|
+
}).map((n, i) => /* @__PURE__ */ s(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
onClick: () => u(n.value.toString()),
|
|
105
|
+
className: `${t.summaryOption} ${t.categoryOption}`,
|
|
106
|
+
children: [
|
|
107
|
+
n.label,
|
|
108
|
+
/* @__PURE__ */ l(
|
|
109
|
+
d,
|
|
110
|
+
{
|
|
111
|
+
name: "close",
|
|
112
|
+
size: "16"
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
i
|
|
118
|
+
)) })
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
o
|
|
122
|
+
);
|
|
105
123
|
}))
|
|
106
124
|
] });
|
|
107
125
|
};
|