stone-kit 0.0.143 → 0.0.144
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,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { c as
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useRef as I, useEffect as L } from "react";
|
|
3
|
+
import { c as W } from "../../../index-DIxK0V-G.js";
|
|
4
4
|
import { s as e, u as E } from "../../../useSortSelect-Dy4WKDDY.js";
|
|
5
5
|
import { NewIcon as f } from "../../NewIcon/ui/NewIcon.js";
|
|
6
6
|
import "../../Button/ui/Button.js";
|
|
@@ -18,55 +18,55 @@ import "../../GroupedInput/ui/GroupedInputs.js";
|
|
|
18
18
|
import "../../MetroTag/ui/MetroTag.js";
|
|
19
19
|
import "../../Select/ui/Select.js";
|
|
20
20
|
import { useClientWidth as w } from "../../../shared/useClientWidth.js";
|
|
21
|
-
const
|
|
21
|
+
const l = W.bind(e), D = ({
|
|
22
22
|
options: r,
|
|
23
23
|
selectedOption: S,
|
|
24
24
|
placeholder: O = "",
|
|
25
25
|
error: h,
|
|
26
26
|
disabled: v,
|
|
27
27
|
additionalClass: N = "",
|
|
28
|
-
onChange:
|
|
28
|
+
onChange: c,
|
|
29
29
|
onBlur: b,
|
|
30
|
-
mini:
|
|
30
|
+
mini: k,
|
|
31
31
|
openOnTop: m = !1
|
|
32
32
|
}) => {
|
|
33
|
-
const [i, o] =
|
|
33
|
+
const [i, o] = C(!1), n = I(null), { isMobile: d, isDesktop: x } = w(), { handleBlur: y, getInputValue: B, getOption: p, handleDocumentClick: u } = E({
|
|
34
34
|
selectedOption: S,
|
|
35
|
-
setSelectedOption:
|
|
35
|
+
setSelectedOption: c,
|
|
36
36
|
setIsOpen: o,
|
|
37
37
|
containerRef: n,
|
|
38
38
|
isOpen: i,
|
|
39
|
-
isDesktop:
|
|
39
|
+
isDesktop: x,
|
|
40
40
|
placeholder: O,
|
|
41
|
-
onChange:
|
|
41
|
+
onChange: c,
|
|
42
42
|
onBlur: b
|
|
43
43
|
});
|
|
44
|
-
return
|
|
44
|
+
return L(() => (document.addEventListener("click", u), () => {
|
|
45
45
|
document.removeEventListener("click", u);
|
|
46
|
-
}), []), /* @__PURE__ */
|
|
46
|
+
}), []), /* @__PURE__ */ s(
|
|
47
47
|
"div",
|
|
48
48
|
{
|
|
49
49
|
ref: n,
|
|
50
|
-
className:
|
|
50
|
+
className: l(
|
|
51
51
|
e.sortSelectWrapper,
|
|
52
52
|
{ [e.sortSelectWrapperError]: h },
|
|
53
53
|
{ [e.sortSelectWrapperTop]: m },
|
|
54
54
|
N
|
|
55
55
|
),
|
|
56
56
|
tabIndex: 0,
|
|
57
|
-
onBlur:
|
|
57
|
+
onBlur: y,
|
|
58
58
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ s("div", { className: l(e.inputWrapper), children: [
|
|
60
60
|
/* @__PURE__ */ t(
|
|
61
61
|
"input",
|
|
62
62
|
{
|
|
63
63
|
type: "text",
|
|
64
64
|
readOnly: !0,
|
|
65
|
-
value:
|
|
66
|
-
className:
|
|
65
|
+
value: B(),
|
|
66
|
+
className: l(
|
|
67
67
|
e.selectedOptions,
|
|
68
68
|
{ [e.selectOptionsDisabled]: v },
|
|
69
|
-
{ [e.selectionOptionMini]:
|
|
69
|
+
{ [e.selectionOptionMini]: k }
|
|
70
70
|
),
|
|
71
71
|
onClick: () => o(!i)
|
|
72
72
|
}
|
|
@@ -80,15 +80,16 @@ const s = B.bind(e), D = ({
|
|
|
80
80
|
}
|
|
81
81
|
)
|
|
82
82
|
] }),
|
|
83
|
-
i && d && /* @__PURE__ */
|
|
83
|
+
i && d && /* @__PURE__ */ s(
|
|
84
84
|
j,
|
|
85
85
|
{
|
|
86
86
|
isOpen: i,
|
|
87
87
|
emitIsOpen: o,
|
|
88
88
|
additionalClassModalBody: e.modalAddBody,
|
|
89
89
|
createPortalObj: { domNode: document.querySelector("body") },
|
|
90
|
+
isTransparentBack: !0,
|
|
90
91
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ s("div", { className: e.mobileSortHeader, children: [
|
|
92
93
|
/* @__PURE__ */ t(M, { children: "Сортировка" }),
|
|
93
94
|
/* @__PURE__ */ t("div", { onClick: () => o(!1), children: /* @__PURE__ */ t(
|
|
94
95
|
f,
|
|
@@ -98,11 +99,11 @@ const s = B.bind(e), D = ({
|
|
|
98
99
|
}
|
|
99
100
|
) })
|
|
100
101
|
] }),
|
|
101
|
-
/* @__PURE__ */ t("div", { className: e.mobileOptionList, children: r == null ? void 0 : r.map((
|
|
102
|
+
/* @__PURE__ */ t("div", { className: e.mobileOptionList, children: r == null ? void 0 : r.map((a) => p(a)) })
|
|
102
103
|
]
|
|
103
104
|
}
|
|
104
105
|
),
|
|
105
|
-
i && !d && /* @__PURE__ */ t("div", { className:
|
|
106
|
+
i && !d && /* @__PURE__ */ t("div", { className: l(e.optionsList, { [e.optionListOnTop]: m }), children: r == null ? void 0 : r.map((a) => p(a)) })
|
|
106
107
|
]
|
|
107
108
|
}
|
|
108
109
|
);
|