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