stone-kit 0.0.90 → 0.0.91
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 +8 -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 -3
- package/dist/useSortSelect-C2p64lX1.js +76 -0
- package/package.json +1 -1
- package/dist/useSortSelect-BWM68TJ3.js +0 -76
|
@@ -9,8 +9,14 @@ interface IUseSortSelect {
|
|
|
9
9
|
isOpen: boolean;
|
|
10
10
|
isMobile: boolean;
|
|
11
11
|
placeholder: string;
|
|
12
|
-
onChange?: (event:
|
|
13
|
-
|
|
12
|
+
onChange?: (event: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
onBlur?: (event: {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}) => void;
|
|
14
20
|
}
|
|
15
21
|
export declare const useSortSelect: ({ selectedOption, setSelectedOption, setIsOpen, containerRef, onBlur, onChange, isMobile, placeholder, }: IUseSortSelect) => {
|
|
16
22
|
handleDocumentClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as d, useRef as y, useEffect as I } from "react";
|
|
3
3
|
import { c as B } from "../../../index-DIxK0V-G.js";
|
|
4
|
-
import { s as e, u as E } from "../../../useSortSelect-
|
|
4
|
+
import { s as e, u as E } from "../../../useSortSelect-C2p64lX1.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";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface Option {
|
|
3
2
|
value: string | number;
|
|
4
3
|
label: string;
|
|
@@ -8,7 +7,7 @@ export interface SortSelectProps {
|
|
|
8
7
|
placeholder?: string;
|
|
9
8
|
error?: boolean;
|
|
10
9
|
disabled?: boolean;
|
|
11
|
-
onChange?: (event:
|
|
12
|
-
onBlur?: (event:
|
|
10
|
+
onChange?: (event: Option) => void;
|
|
11
|
+
onBlur?: (event: Option) => void;
|
|
13
12
|
additionalClass?: string;
|
|
14
13
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsxs as v, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as y } from "./index-DIxK0V-G.js";
|
|
3
|
+
const p = "_sortSelectWrapper_636hy_1", b = "_selectedOptions_636hy_8", x = "_selectedOptionsOpened_636hy_32", B = "_selectOptionsDisabled_636hy_36", C = "_optionsList_636hy_43", S = "_mobileOptionList_636hy_58", f = "_mobileSortHeader_636hy_65", g = "_modalAddBody_636hy_79", L = "_inputWrapper_636hy_85", W = "_option_636hy_43", D = "_icon_636hy_110", N = "_checkBox_636hy_117", A = "_checkBoxChecked_636hy_124", H = "_innerCheck_636hy_131", e = {
|
|
4
|
+
sortSelectWrapper: p,
|
|
5
|
+
selectedOptions: b,
|
|
6
|
+
selectedOptionsOpened: x,
|
|
7
|
+
selectOptionsDisabled: B,
|
|
8
|
+
optionsList: C,
|
|
9
|
+
mobileOptionList: S,
|
|
10
|
+
mobileSortHeader: f,
|
|
11
|
+
modalAddBody: g,
|
|
12
|
+
inputWrapper: L,
|
|
13
|
+
option: W,
|
|
14
|
+
icon: D,
|
|
15
|
+
checkBox: N,
|
|
16
|
+
checkBoxChecked: A,
|
|
17
|
+
innerCheck: H
|
|
18
|
+
}, h = y.bind(e), q = ({
|
|
19
|
+
selectedOption: c,
|
|
20
|
+
setSelectedOption: i,
|
|
21
|
+
setIsOpen: a,
|
|
22
|
+
containerRef: r,
|
|
23
|
+
onBlur: t,
|
|
24
|
+
onChange: _,
|
|
25
|
+
isMobile: u,
|
|
26
|
+
placeholder: m
|
|
27
|
+
}) => {
|
|
28
|
+
const d = (o) => (n) => {
|
|
29
|
+
n.stopPropagation();
|
|
30
|
+
const l = (c == null ? void 0 : c.value) === o.value ? null : o;
|
|
31
|
+
if (i(l), _) {
|
|
32
|
+
const k = {
|
|
33
|
+
...n,
|
|
34
|
+
target: { value: l }
|
|
35
|
+
};
|
|
36
|
+
_(k);
|
|
37
|
+
}
|
|
38
|
+
a(!1);
|
|
39
|
+
};
|
|
40
|
+
return { handleDocumentClick: (o) => {
|
|
41
|
+
r.current && !r.current.contains(o.target) && a(!1);
|
|
42
|
+
}, handleBlur: (o) => {
|
|
43
|
+
if (t) {
|
|
44
|
+
const n = {
|
|
45
|
+
...o,
|
|
46
|
+
target: { value: c == null ? void 0 : c.value }
|
|
47
|
+
};
|
|
48
|
+
t(n);
|
|
49
|
+
}
|
|
50
|
+
}, getInputValue: () => u ? "" : c ? c.label : m, getOption: (o) => /* @__PURE__ */ v(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: h(e.option, {
|
|
54
|
+
[e.selected]: (c == null ? void 0 : c.value) === o.value
|
|
55
|
+
}),
|
|
56
|
+
onClick: d(o),
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ s("div", { children: o.label }),
|
|
59
|
+
/* @__PURE__ */ s(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: h(e.checkBox, {
|
|
63
|
+
[e.checkBoxChecked]: (c == null ? void 0 : c.value) === o.value
|
|
64
|
+
}),
|
|
65
|
+
children: (c == null ? void 0 : c.value) === o.value && /* @__PURE__ */ s("div", { className: e.innerCheck })
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
o.value
|
|
71
|
+
) };
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
e as s,
|
|
75
|
+
q as u
|
|
76
|
+
};
|
package/package.json
CHANGED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { jsxs as p, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { c as y } from "./index-DIxK0V-G.js";
|
|
3
|
-
const v = "_sortSelectWrapper_636hy_1", b = "_selectedOptions_636hy_8", x = "_selectedOptionsOpened_636hy_32", B = "_selectOptionsDisabled_636hy_36", C = "_optionsList_636hy_43", S = "_mobileOptionList_636hy_58", f = "_mobileSortHeader_636hy_65", g = "_modalAddBody_636hy_79", L = "_inputWrapper_636hy_85", W = "_option_636hy_43", D = "_icon_636hy_110", N = "_checkBox_636hy_117", A = "_checkBoxChecked_636hy_124", H = "_innerCheck_636hy_131", o = {
|
|
4
|
-
sortSelectWrapper: v,
|
|
5
|
-
selectedOptions: b,
|
|
6
|
-
selectedOptionsOpened: x,
|
|
7
|
-
selectOptionsDisabled: B,
|
|
8
|
-
optionsList: C,
|
|
9
|
-
mobileOptionList: S,
|
|
10
|
-
mobileSortHeader: f,
|
|
11
|
-
modalAddBody: g,
|
|
12
|
-
inputWrapper: L,
|
|
13
|
-
option: W,
|
|
14
|
-
icon: D,
|
|
15
|
-
checkBox: N,
|
|
16
|
-
checkBoxChecked: A,
|
|
17
|
-
innerCheck: H
|
|
18
|
-
}, i = y.bind(o), q = ({
|
|
19
|
-
selectedOption: e,
|
|
20
|
-
setSelectedOption: h,
|
|
21
|
-
setIsOpen: t,
|
|
22
|
-
containerRef: r,
|
|
23
|
-
onBlur: a,
|
|
24
|
-
onChange: l,
|
|
25
|
-
isMobile: u,
|
|
26
|
-
placeholder: d
|
|
27
|
-
}) => {
|
|
28
|
-
const m = (c) => (n) => {
|
|
29
|
-
n.stopPropagation();
|
|
30
|
-
const _ = (e == null ? void 0 : e.value) === c.value ? null : c;
|
|
31
|
-
if (h(_), l) {
|
|
32
|
-
const k = {
|
|
33
|
-
...n,
|
|
34
|
-
target: { value: _ }
|
|
35
|
-
};
|
|
36
|
-
l(k);
|
|
37
|
-
}
|
|
38
|
-
t(!1);
|
|
39
|
-
};
|
|
40
|
-
return { handleDocumentClick: (c) => {
|
|
41
|
-
r.current && !r.current.contains(c.target) && t(!1);
|
|
42
|
-
}, handleBlur: (c) => {
|
|
43
|
-
if (a) {
|
|
44
|
-
const n = {
|
|
45
|
-
...c,
|
|
46
|
-
target: { value: e }
|
|
47
|
-
};
|
|
48
|
-
a(n);
|
|
49
|
-
}
|
|
50
|
-
}, getInputValue: () => u ? "" : e ? e.label : d, getOption: (c) => /* @__PURE__ */ p(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
className: i(o.option, {
|
|
54
|
-
[o.selected]: (e == null ? void 0 : e.value) === c.value
|
|
55
|
-
}),
|
|
56
|
-
onClick: m(c),
|
|
57
|
-
children: [
|
|
58
|
-
/* @__PURE__ */ s("div", { children: c.label }),
|
|
59
|
-
/* @__PURE__ */ s(
|
|
60
|
-
"div",
|
|
61
|
-
{
|
|
62
|
-
className: i(o.checkBox, {
|
|
63
|
-
[o.checkBoxChecked]: (e == null ? void 0 : e.value) === c.value
|
|
64
|
-
}),
|
|
65
|
-
children: (e == null ? void 0 : e.value) === c.value && /* @__PURE__ */ s("div", { className: o.innerCheck })
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
c.value
|
|
71
|
-
) };
|
|
72
|
-
};
|
|
73
|
-
export {
|
|
74
|
-
o as s,
|
|
75
|
-
q as u
|
|
76
|
-
};
|