stone-kit 0.0.89 → 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/main.d.ts +1 -0
- package/dist/main.js +16 -14
- 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
|
}
|
package/dist/main.d.ts
CHANGED
package/dist/main.js
CHANGED
|
@@ -3,13 +3,13 @@ import { MobileButton as p } from "./components/mobileButton/ui/MobileButton.js"
|
|
|
3
3
|
import { NewIcon as f } from "./components/NewIcon/ui/NewIcon.js";
|
|
4
4
|
import { DestinationTab as n } from "./components/DestinationTab/ui/DestinationTab.js";
|
|
5
5
|
import { RoundButton as i } from "./components/RoundButton/ui/RoundButton.js";
|
|
6
|
-
import { Tag as
|
|
7
|
-
import { Switcher as
|
|
8
|
-
import { Text as
|
|
9
|
-
import { Flex as
|
|
10
|
-
import { Input as
|
|
11
|
-
import { Modal as
|
|
12
|
-
import { FieldInput as
|
|
6
|
+
import { Tag as l } from "./components/Tag/ui/Tag.js";
|
|
7
|
+
import { Switcher as c } from "./components/Switcher/ui/Switcher.js";
|
|
8
|
+
import { Text as T } from "./components/Text/ui/Text.js";
|
|
9
|
+
import { Flex as b } from "./components/Flex/ui/Flex.js";
|
|
10
|
+
import { Input as h } from "./components/Input/ui/Input.js";
|
|
11
|
+
import { Modal as w } from "./components/Modal/ui/Modal.js";
|
|
12
|
+
import { FieldInput as M } from "./components/FieldInput/ui/FieldInput.js";
|
|
13
13
|
import { TabSwitcher as F } from "./components/TabSwitcher/ui/TabSwitcher.js";
|
|
14
14
|
import { GroupedInputs as D } from "./components/GroupedInput/ui/GroupedInputs.js";
|
|
15
15
|
import { Logo as N } from "./components/Logo/ui/Logo.js";
|
|
@@ -17,24 +17,26 @@ import { MetroTag as W } from "./components/MetroTag/ui/MetroTag.js";
|
|
|
17
17
|
import { LotCard as k } from "./components/LotCard/ui/LotCard.js";
|
|
18
18
|
import { Select as v } from "./components/Select/ui/Select.js";
|
|
19
19
|
import { useClientWidth as z } from "./shared/useClientWidth.js";
|
|
20
|
+
import { SortSelect as E } from "./components/SortSelect/ui/SortSelect.js";
|
|
20
21
|
export {
|
|
21
22
|
t as Button,
|
|
22
23
|
n as DestinationTab,
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
M as FieldInput,
|
|
25
|
+
b as Flex,
|
|
25
26
|
D as GroupedInputs,
|
|
26
|
-
|
|
27
|
+
h as Input,
|
|
27
28
|
N as Logo,
|
|
28
29
|
k as LotCard,
|
|
29
30
|
W as MetroTag,
|
|
30
31
|
p as MobileButton,
|
|
31
|
-
|
|
32
|
+
w as Modal,
|
|
32
33
|
f as NewIcon,
|
|
33
34
|
i as RoundButton,
|
|
34
35
|
v as Select,
|
|
35
|
-
|
|
36
|
+
E as SortSelect,
|
|
37
|
+
c as Switcher,
|
|
36
38
|
F as TabSwitcher,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
l as Tag,
|
|
40
|
+
T as Text,
|
|
39
41
|
z as useClientWidth
|
|
40
42
|
};
|
|
@@ -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
|
-
};
|