stone-kit 0.0.132 → 0.0.136
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/SortSelect/hooks/useSortSelect.d.ts +2 -2
- package/dist/components/SortSelect/hooks/useSortSelect.js +1 -1
- package/dist/components/SortSelect/ui/SortSelect.js +1 -1
- package/dist/components/SortSelect/ui/SortSelect.types.d.ts +2 -2
- package/dist/{useSortSelect-Dfs-72R7.js → useSortSelect-BTrKnFKx.js} +24 -25
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import { MouseEvent } from 'react';
|
|
|
2
2
|
import { Option } from '../ui/SortSelect.types';
|
|
3
3
|
|
|
4
4
|
interface IUseSortSelect {
|
|
5
|
-
selectedOption
|
|
6
|
-
setSelectedOption?: (event: Option |
|
|
5
|
+
selectedOption: Option | null;
|
|
6
|
+
setSelectedOption?: (event: Option | null) => void;
|
|
7
7
|
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
8
8
|
containerRef: React.RefObject<HTMLDivElement>;
|
|
9
9
|
isOpen: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as C, useRef as I, useEffect as B } from "react";
|
|
3
3
|
import { c as E } from "../../../index-DIxK0V-G.js";
|
|
4
|
-
import { s as e, u as L } from "../../../useSortSelect-
|
|
4
|
+
import { s as e, u as L } from "../../../useSortSelect-BTrKnFKx.js";
|
|
5
5
|
import { NewIcon as u } from "../../NewIcon/ui/NewIcon.js";
|
|
6
6
|
import "../../Button/ui/Button.js";
|
|
7
7
|
import "../../mobileButton/ui/MobileButton.js";
|
|
@@ -4,11 +4,11 @@ export interface Option {
|
|
|
4
4
|
}
|
|
5
5
|
export interface SortSelectProps {
|
|
6
6
|
options: Option[];
|
|
7
|
-
selectedOption
|
|
7
|
+
selectedOption: Option | null;
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
error?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
-
onChange?: (event: Option |
|
|
11
|
+
onChange?: (event: Option | null) => void;
|
|
12
12
|
onBlur?: (event: Option) => void;
|
|
13
13
|
additionalClass?: string;
|
|
14
14
|
mini?: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as h, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { c as p } from "./index-DIxK0V-G.js";
|
|
3
|
-
const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_selectionOptionMini_vmknt_33", C = "_selectedOptionsOpened_vmknt_37",
|
|
3
|
+
const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_selectionOptionMini_vmknt_33", C = "_selectedOptionsOpened_vmknt_37", S = "_selectOptionsDisabled_vmknt_41", f = "_optionsList_vmknt_48", g = "_mobileOptionList_vmknt_63", L = "_mobileSortHeader_vmknt_70", W = "_modalAddBody_vmknt_84", D = "_inputWrapper_vmknt_90", N = "_option_vmknt_48", y = "_icon_vmknt_117", A = "_checkBox_vmknt_124", H = "_checkBoxChecked_vmknt_131", M = "_innerCheck_vmknt_138", e = {
|
|
4
4
|
sortSelectWrapper: b,
|
|
5
5
|
selectedOptions: x,
|
|
6
6
|
selectionOptionMini: B,
|
|
7
7
|
selectedOptionsOpened: C,
|
|
8
|
-
selectOptionsDisabled:
|
|
9
|
-
optionsList:
|
|
8
|
+
selectOptionsDisabled: S,
|
|
9
|
+
optionsList: f,
|
|
10
10
|
mobileOptionList: g,
|
|
11
11
|
mobileSortHeader: L,
|
|
12
12
|
modalAddBody: W,
|
|
@@ -16,43 +16,42 @@ const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_s
|
|
|
16
16
|
checkBox: A,
|
|
17
17
|
checkBoxChecked: H,
|
|
18
18
|
innerCheck: M
|
|
19
|
-
},
|
|
19
|
+
}, l = p.bind(e), q = ({
|
|
20
20
|
selectedOption: n,
|
|
21
21
|
setSelectedOption: s,
|
|
22
|
-
setIsOpen:
|
|
22
|
+
setIsOpen: m,
|
|
23
23
|
containerRef: r,
|
|
24
|
-
onBlur:
|
|
25
|
-
onChange:
|
|
24
|
+
onBlur: i,
|
|
25
|
+
onChange: a,
|
|
26
26
|
isDesktop: k,
|
|
27
27
|
placeholder: u
|
|
28
28
|
}) => {
|
|
29
|
-
const v = (t) => (
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
if (s && s(
|
|
29
|
+
const v = (t) => (o) => {
|
|
30
|
+
o.stopPropagation();
|
|
31
|
+
const _ = (n == null ? void 0 : n.value) === t.value ? null : t;
|
|
32
|
+
if (s && s(_), a) {
|
|
33
33
|
const d = {
|
|
34
|
-
...
|
|
35
|
-
target: { value:
|
|
34
|
+
...o,
|
|
35
|
+
target: { value: _ }
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
a(d);
|
|
38
38
|
}
|
|
39
|
-
i(!1);
|
|
40
39
|
};
|
|
41
40
|
return { handleDocumentClick: (t) => {
|
|
42
|
-
r.current && !r.current.contains(t.target) &&
|
|
41
|
+
r.current && !r.current.contains(t.target) && m(!1);
|
|
43
42
|
}, handleBlur: (t) => {
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
43
|
+
if (i) {
|
|
44
|
+
const o = {
|
|
46
45
|
...t,
|
|
47
46
|
target: { value: n }
|
|
48
47
|
};
|
|
49
|
-
|
|
48
|
+
i(o);
|
|
50
49
|
}
|
|
51
50
|
}, getInputValue: () => k ? n ? n.label : u : "", getOption: (t) => /* @__PURE__ */ h(
|
|
52
51
|
"div",
|
|
53
52
|
{
|
|
54
|
-
className:
|
|
55
|
-
[
|
|
53
|
+
className: l(e.option, {
|
|
54
|
+
[e.selected]: (n == null ? void 0 : n.value) === t.value
|
|
56
55
|
}),
|
|
57
56
|
onClick: v(t),
|
|
58
57
|
children: [
|
|
@@ -60,10 +59,10 @@ const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_s
|
|
|
60
59
|
/* @__PURE__ */ c(
|
|
61
60
|
"div",
|
|
62
61
|
{
|
|
63
|
-
className:
|
|
64
|
-
[
|
|
62
|
+
className: l(e.checkBox, {
|
|
63
|
+
[e.checkBoxChecked]: (n == null ? void 0 : n.value) === t.value
|
|
65
64
|
}),
|
|
66
|
-
children: (n == null ? void 0 : n.value) === t.value && /* @__PURE__ */ c("div", { className:
|
|
65
|
+
children: (n == null ? void 0 : n.value) === t.value && /* @__PURE__ */ c("div", { className: e.innerCheck })
|
|
67
66
|
}
|
|
68
67
|
)
|
|
69
68
|
]
|
|
@@ -72,6 +71,6 @@ const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_s
|
|
|
72
71
|
) };
|
|
73
72
|
};
|
|
74
73
|
export {
|
|
75
|
-
|
|
74
|
+
e as s,
|
|
76
75
|
q as u
|
|
77
76
|
};
|