stone-kit 0.0.664 → 0.0.666
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,42 +1,42 @@
|
|
|
1
1
|
const d = ({
|
|
2
2
|
option: e,
|
|
3
3
|
setSelectedOptions: y,
|
|
4
|
-
selectedOptions:
|
|
5
|
-
disabledOptions:
|
|
4
|
+
selectedOptions: f,
|
|
5
|
+
disabledOptions: s,
|
|
6
6
|
onChange: c,
|
|
7
7
|
mode: S,
|
|
8
|
-
optionsParentArr:
|
|
8
|
+
optionsParentArr: r
|
|
9
9
|
}) => {
|
|
10
10
|
if (!Array.isArray(e)) {
|
|
11
|
-
if (
|
|
11
|
+
if (s.includes(e))
|
|
12
12
|
return;
|
|
13
|
-
let
|
|
13
|
+
let i = f.some((l) => l.value === e.value) ? f.filter((l) => l.value !== e.value) : [...f, e];
|
|
14
14
|
if (S === "double") {
|
|
15
|
-
"options" in e &&
|
|
16
|
-
const
|
|
17
|
-
!(
|
|
15
|
+
"options" in e && (f.map((t) => JSON.stringify(t)).includes(JSON.stringify(e)) ? i = i.filter((t) => !e.options.map((a) => JSON.stringify(a)).includes(JSON.stringify(t))) : Array.isArray(e.options) && (i = [...i, ...e.options]));
|
|
16
|
+
const l = r == null ? void 0 : r.filter((u) => "options" in u && u.options.includes(e))[0];
|
|
17
|
+
!(l && f.map((u) => JSON.stringify(u)).includes(JSON.stringify(l))) && l && i.push(l);
|
|
18
18
|
}
|
|
19
|
-
y(
|
|
19
|
+
y(i), c && c(i);
|
|
20
20
|
}
|
|
21
21
|
}, m = ({
|
|
22
22
|
option: e,
|
|
23
23
|
setSelectedOptions: y,
|
|
24
|
-
selectedOptions:
|
|
25
|
-
disabledOptions:
|
|
24
|
+
selectedOptions: f,
|
|
25
|
+
disabledOptions: s,
|
|
26
26
|
onChange: c
|
|
27
27
|
}) => {
|
|
28
28
|
if (Array.isArray(e)) {
|
|
29
|
-
const S = e.filter((
|
|
30
|
-
if (S.every((
|
|
31
|
-
const
|
|
32
|
-
(
|
|
29
|
+
const S = e.filter((r) => !(s != null && s.includes(r)));
|
|
30
|
+
if (S.every((r) => f.map((i) => i).includes(r))) {
|
|
31
|
+
const r = f.filter(
|
|
32
|
+
(i) => !e.includes(i)
|
|
33
33
|
);
|
|
34
|
-
y(
|
|
34
|
+
y(r), c && c(r);
|
|
35
35
|
} else {
|
|
36
|
-
const
|
|
37
|
-
(
|
|
38
|
-
),
|
|
39
|
-
y(
|
|
36
|
+
const r = S.filter(
|
|
37
|
+
(l) => !f.includes(l)
|
|
38
|
+
), i = [...f, ...r];
|
|
39
|
+
y(i), c && c(i);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as c, Fragment as N, jsx as
|
|
1
|
+
import { jsxs as c, Fragment as N, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { s as t, O as S } from "../../../Option-C4HGcCtY.js";
|
|
3
3
|
import { NewIcon as h } from "../../NewIcon/ui/NewIcon.js";
|
|
4
4
|
import { c as b } from "../../../index-rKuIKazb.js";
|
|
5
5
|
import { useState as w } from "react";
|
|
6
6
|
const O = b.bind(t), D = ({
|
|
7
7
|
category: o,
|
|
8
|
-
selectedOptions:
|
|
8
|
+
selectedOptions: s,
|
|
9
9
|
disabledOptions: m,
|
|
10
10
|
clickableOptions: g,
|
|
11
11
|
handleOptionClick: u,
|
|
12
|
-
sizeIcon:
|
|
12
|
+
sizeIcon: n,
|
|
13
13
|
mode: p
|
|
14
14
|
}) => {
|
|
15
|
-
const [
|
|
15
|
+
const [r, d] = w(!0), v = s.map((e) => JSON.stringify(e)), l = p === "category", f = p === "double", C = l && o.options.every((e) => v.includes(JSON.stringify(e))), k = l ? C ? "minusCheck" : "selectUnchecked" : f && s.some((e) => e.value === o.value) ? "minusCheck" : "selectUnchecked";
|
|
16
16
|
return /* @__PURE__ */ c(N, { children: [
|
|
17
17
|
/* @__PURE__ */ c(
|
|
18
18
|
"div",
|
|
@@ -22,47 +22,47 @@ const O = b.bind(t), D = ({
|
|
|
22
22
|
t.category,
|
|
23
23
|
t.optionClickable,
|
|
24
24
|
{
|
|
25
|
-
[t.selected]:
|
|
25
|
+
[t.selected]: s.some((e) => e.value === o.value),
|
|
26
26
|
[t.optionDisabled]: m.some(
|
|
27
27
|
(e) => e.value === o.value
|
|
28
28
|
)
|
|
29
29
|
}
|
|
30
30
|
),
|
|
31
31
|
onClick: () => {
|
|
32
|
-
f && !
|
|
32
|
+
f && !r && d(!0), u(l ? o.options : o);
|
|
33
33
|
},
|
|
34
34
|
children: [
|
|
35
35
|
/* @__PURE__ */ c("div", { className: t.leftSide, children: [
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ i(
|
|
37
37
|
h,
|
|
38
38
|
{
|
|
39
|
-
size:
|
|
39
|
+
size: n ?? "20",
|
|
40
40
|
name: k
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ i("div", { children: o.label })
|
|
44
44
|
] }),
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ i("div", { className: t.iconArrow, onClick: (e) => {
|
|
46
46
|
e.stopPropagation(), d((a) => !a);
|
|
47
|
-
}, children: /* @__PURE__ */
|
|
47
|
+
}, children: /* @__PURE__ */ i(
|
|
48
48
|
h,
|
|
49
49
|
{
|
|
50
50
|
name: "arrowShort",
|
|
51
|
-
deg:
|
|
52
|
-
size:
|
|
51
|
+
deg: r ? "180" : "0",
|
|
52
|
+
size: n ?? "24"
|
|
53
53
|
}
|
|
54
54
|
) })
|
|
55
55
|
]
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
|
|
58
|
+
r && o.options.map((e, a) => /* @__PURE__ */ i(
|
|
59
59
|
S,
|
|
60
60
|
{
|
|
61
61
|
option: e,
|
|
62
62
|
disabledOptions: m,
|
|
63
|
-
selectedOptions:
|
|
63
|
+
selectedOptions: s,
|
|
64
64
|
handleOptionClick: () => u(e),
|
|
65
|
-
sizeIcon:
|
|
65
|
+
sizeIcon: n,
|
|
66
66
|
clickableOptions: g,
|
|
67
67
|
isOptionCategory: !0
|
|
68
68
|
},
|