stone-kit 0.0.502 → 0.0.504

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.
@@ -0,0 +1,188 @@
1
+ import { jsxs as _, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as T, useState as D, useRef as M, useEffect as B } from "react";
3
+ import { c as L } from "./index-rKuIKazb.js";
4
+ import { s as t, u as j } from "./useSortSelect-CjZXLFOG.js";
5
+ import { NewIcon as v } from "./components/NewIcon/ui/NewIcon.js";
6
+ import "./components/Button/ui/Button.js";
7
+ import "./components/mobileButton/ui/MobileButton.js";
8
+ import "./components/DestinationTab/ui/DestinationTab.js";
9
+ import "./components/RoundButton/ui/RoundButton.js";
10
+ import "./components/Tag/ui/Tag.js";
11
+ import "./components/Switcher/ui/Switcher.js";
12
+ import { Text as W } from "./components/Text/ui/Text.js";
13
+ import "./components/Flex/ui/Flex.js";
14
+ import "./components/Input/ui/Input.js";
15
+ import { M as E } from "./Modal-BZv6nlLe.js";
16
+ import "./components/GroupedInput/ui/GroupedInputs.js";
17
+ import "./components/MetroTag/ui/MetroTag.js";
18
+ import "./components/LotCard/ui/LotCard.js";
19
+ import "./components/Select/ui/Select.js";
20
+ import { useClientWidth as R } from "./shared/useClientWidth.js";
21
+ import "./components/SliderNavigation/ui/SliderNavigation.js";
22
+ import "./components/LotCardSkeleton/ui/LotCardSkeleton.js";
23
+ import "./components/TabSelect/ui/TabSelect.js";
24
+ import "./components/FormModal/ui/ModalForm.js";
25
+ const A = "_root_1ol37_1", z = "_text_1ol37_18", $ = "_rootCol_1ol37_26", q = "_item_1ol37_32", H = "_whiteRow_1ol37_51", P = "_firstItem_1ol37_62", V = "_lastItem_1ol37_66", F = "_apart_1ol37_97", G = "_isLong_1ol37_97", J = "_autoWidth_1ol37_122", K = "_isDisabled_1ol37_129", Q = "_grayRow_1ol37_153", e = {
26
+ root: A,
27
+ text: z,
28
+ rootCol: $,
29
+ item: q,
30
+ whiteRow: H,
31
+ firstItem: P,
32
+ lastItem: V,
33
+ apart: F,
34
+ isLong: G,
35
+ autoWidth: J,
36
+ isDisabled: K,
37
+ grayRow: Q
38
+ }, u = L.bind(e), U = ({
39
+ children: s,
40
+ variant: c = "whiteRow",
41
+ isApart: m = !1,
42
+ addClassName: d = "",
43
+ col: l = !1
44
+ }) => /* @__PURE__ */ o("div", { className: u(e.root, e[c], d, { [e.rootCol]: l, [e.apart]: m }), children: s }), k = T((s, c) => {
45
+ const { isTablet: m, isDesktop: d } = R(), {
46
+ index: l,
47
+ children: i,
48
+ addItemClassName: h,
49
+ addTextClass: N,
50
+ disabled: f = !1,
51
+ itemsLength: w = 0,
52
+ isLongOn: x = !0,
53
+ width: p,
54
+ width_m: r,
55
+ width_l: a,
56
+ ...b
57
+ } = s, n = (i != null && i.toString().length ? (i == null ? void 0 : i.toString().length) > 2 : !1) && x, O = (S, g) => S && r ? r : g && a ? a : p, y = !p && !r && !a && n;
58
+ return /* @__PURE__ */ _("label", { className: u({ [e.isLong]: n }), children: [
59
+ /* @__PURE__ */ o(
60
+ "input",
61
+ {
62
+ ref: c,
63
+ type: "checkbox",
64
+ ...b,
65
+ disabled: f
66
+ }
67
+ ),
68
+ /* @__PURE__ */ o(
69
+ "div",
70
+ {
71
+ style: { width: O(m, d) },
72
+ className: u(u(
73
+ e.item,
74
+ { [e.firstItem]: l === 0 },
75
+ { [e.lastItem]: l === w - 1 },
76
+ { [e.isDisabled]: f },
77
+ { [e.autoWidth]: y }
78
+ ), h),
79
+ children: /* @__PURE__ */ o(W, { className: u(e.text, N), children: i })
80
+ }
81
+ )
82
+ ] });
83
+ });
84
+ k.displayName = "TabSwitcherItem";
85
+ const Nt = Object.assign(U, { Item: k }), I = L.bind(t), X = ({
86
+ options: s,
87
+ selectedOption: c,
88
+ placeholder: m = "",
89
+ error: d,
90
+ disabled: l,
91
+ additionalClass: i = "",
92
+ onChange: h,
93
+ onBlur: N,
94
+ mini: f,
95
+ openOnTop: w = !1,
96
+ onClickItem: x,
97
+ onCLickSelect: p
98
+ }) => {
99
+ const [r, a] = D(!1), b = M(null), { isMobile: n } = R(), { handleBlur: O, getInputValue: y, getOption: S, handleDocumentClick: g } = j(
100
+ {
101
+ selectedOption: c,
102
+ onClickOption: x,
103
+ setSelectedOption: h,
104
+ setIsOpen: a,
105
+ containerRef: b,
106
+ isOpen: r,
107
+ isMobile: n,
108
+ placeholder: m,
109
+ onChange: h,
110
+ onBlur: N
111
+ }
112
+ );
113
+ return B(() => (document.addEventListener("click", g), () => {
114
+ document.removeEventListener("click", g);
115
+ }), []), /* @__PURE__ */ _(
116
+ "div",
117
+ {
118
+ ref: b,
119
+ className: I(
120
+ t.sortSelectWrapper,
121
+ { [t.sortSelectWrapperError]: d },
122
+ { [t.sortSelectWrapperTop]: w },
123
+ i
124
+ ),
125
+ tabIndex: 0,
126
+ onBlur: O,
127
+ onClick: () => {
128
+ p && p();
129
+ },
130
+ children: [
131
+ /* @__PURE__ */ _("div", { className: I(t.inputWrapper), children: [
132
+ /* @__PURE__ */ o(
133
+ "input",
134
+ {
135
+ type: "text",
136
+ readOnly: !0,
137
+ value: y(),
138
+ className: I(
139
+ t.selectedOptions,
140
+ { [t.selectOptionsDisabled]: l },
141
+ { [t.selectionOptionMini]: f }
142
+ ),
143
+ onClick: () => a(!r)
144
+ }
145
+ ),
146
+ /* @__PURE__ */ o(
147
+ v,
148
+ {
149
+ name: "twoArrows",
150
+ size: "24",
151
+ additionalClass: t.icon
152
+ }
153
+ )
154
+ ] }),
155
+ r && n && /* @__PURE__ */ _(
156
+ E,
157
+ {
158
+ isOpen: r,
159
+ emitIsOpen: a,
160
+ additionalClassModalBody: t.modalAddBody,
161
+ additionalClass: t.selectModal,
162
+ createPortalObj: { domNode: document.querySelector("body") },
163
+ isTransparentBack: !0,
164
+ children: [
165
+ /* @__PURE__ */ _("div", { className: t.mobileSortHeader, children: [
166
+ /* @__PURE__ */ o(W, { children: "Сортировка" }),
167
+ /* @__PURE__ */ o("div", { onClick: () => a(!1), children: /* @__PURE__ */ o(
168
+ v,
169
+ {
170
+ name: "close",
171
+ size: "20"
172
+ }
173
+ ) })
174
+ ] }),
175
+ /* @__PURE__ */ o("div", { className: t.mobileOptionList, children: s == null ? void 0 : s.map((C) => S(C)) })
176
+ ]
177
+ }
178
+ ),
179
+ r && !n && /* @__PURE__ */ o("div", { className: I(t.optionsList, { [t.optionListOnTop]: w }), children: s == null ? void 0 : s.map((C) => S(C)) })
180
+ ]
181
+ }
182
+ );
183
+ };
184
+ X.displayName = "SortSelect";
185
+ export {
186
+ Nt as S,
187
+ X as a
188
+ };
@@ -86,7 +86,7 @@ const d = ({
86
86
  title: t,
87
87
  titleId: l,
88
88
  ...r
89
- }, a) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: a, "aria-labelledby": l, ...r }, t ? /* @__PURE__ */ e.createElement("title", { id: l }, t) : null, /* @__PURE__ */ e.createElement("path", { d: "M8 9V7C8 4.79086 9.79086 3 12 3C14.2091 3 16 4.79086 16 7V9M8.2 21H15.8C16.9201 21 17.4802 21 17.908 20.782C18.2843 20.5903 18.5903 20.2843 18.782 19.908C19 19.4802 19 18.9201 19 17.8V12.2C19 11.0799 19 10.5198 18.782 10.092C18.5903 9.71569 18.2843 9.40973 17.908 9.21799C17.4802 9 16.9201 9 15.8 9H8.2C7.0799 9 6.51984 9 6.09202 9.21799C5.71569 9.40973 5.40973 9.71569 5.21799 10.092C5 10.5198 5 11.0799 5 12.2V17.8C5 18.9201 5 19.4802 5.21799 19.908C5.40973 20.2843 5.71569 20.5903 6.09202 20.782C6.51984 21 7.07989 21 8.2 21Z", stroke: "#141416", strokeLinecap: "round" })), I = o(Y), e1 = ({
89
+ }, a) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: a, "aria-labelledby": l, ...r }, t ? /* @__PURE__ */ e.createElement("title", { id: l }, t) : null, /* @__PURE__ */ e.createElement("path", { d: "M8 9V7C8 4.79086 9.79086 3 12 3C14.2091 3 16 4.79086 16 7V9M8.2 21H15.8C16.9201 21 17.4802 21 17.908 20.782C18.2843 20.5903 18.5903 20.2843 18.782 19.908C19 19.4802 19 18.9201 19 17.8V12.2C19 11.0799 19 10.5198 18.782 10.092C18.5903 9.71569 18.2843 9.40973 17.908 9.21799C17.4802 9 16.9201 9 15.8 9H8.2C7.0799 9 6.51984 9 6.09202 9.21799C5.71569 9.40973 5.40973 9.71569 5.21799 10.092C5 10.5198 5 11.0799 5 12.2V17.8C5 18.9201 5 19.4802 5.21799 19.908C5.40973 20.2843 5.71569 20.5903 6.09202 20.782C6.51984 21 7.07989 21 8.2 21Z", stroke: "currentColor", strokeLinecap: "round" })), I = o(Y), e1 = ({
90
90
  title: t,
91
91
  titleId: l,
92
92
  ...r
@@ -1,5 +1,6 @@
1
1
  import { MouseEvent } from 'react';
2
2
  import { Option } from '../ui/SortSelect.types';
3
+ import { TOption } from '../../Select/ui/Select.types.ts';
3
4
 
4
5
  interface IUseSortSelect {
5
6
  selectedOption: Option | null;
@@ -13,12 +14,13 @@ interface IUseSortSelect {
13
14
  label: string;
14
15
  value: string;
15
16
  }) => void;
17
+ onClickOption?: (option: TOption | TOption[]) => void;
16
18
  onBlur?: (event: {
17
19
  label: string;
18
20
  value: string;
19
21
  }) => void;
20
22
  }
21
- export declare const useSortSelect: ({ selectedOption, setSelectedOption, setIsOpen, containerRef, onBlur, onChange, isMobile, placeholder, }: IUseSortSelect) => {
23
+ export declare const useSortSelect: ({ selectedOption, setSelectedOption, setIsOpen, containerRef, onBlur, onChange, onClickOption, isMobile, placeholder, }: IUseSortSelect) => {
22
24
  handleDocumentClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
23
25
  handleBlur: (event: React.FocusEvent<HTMLDivElement>) => void;
24
26
  getInputValue: () => string;
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { u as m } from "../../../useSortSelect-D7K1wk0E.js";
2
+ import { u as m } from "../../../useSortSelect-CjZXLFOG.js";
3
3
  import "../../../index-rKuIKazb.js";
4
4
  export {
5
5
  m as useSortSelect
@@ -1,4 +1,4 @@
1
- import { a as r } from "../../SortSelect-jks4qMel.js";
1
+ import { a as r } from "../../SortSelect-DT1o6Lco.js";
2
2
  export {
3
3
  r as SortSelect
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../../index-rKuIKazb.js";
4
- import "../../../useSortSelect-D7K1wk0E.js";
4
+ import "../../../useSortSelect-CjZXLFOG.js";
5
5
  import "../../NewIcon/ui/NewIcon.js";
6
6
  import "../../Button/ui/Button.js";
7
7
  import "../../mobileButton/ui/MobileButton.js";
@@ -13,7 +13,7 @@ import "../../Text/ui/Text.js";
13
13
  import "../../Flex/ui/Flex.js";
14
14
  import "../../Input/ui/Input.js";
15
15
  import "../../../Modal-BZv6nlLe.js";
16
- import { a as z } from "../../../SortSelect-jks4qMel.js";
16
+ import { a as z } from "../../../SortSelect-DT1o6Lco.js";
17
17
  import "../../GroupedInput/ui/GroupedInputs.js";
18
18
  import "../../MetroTag/ui/MetroTag.js";
19
19
  import "../../LotCard/ui/LotCard.js";
@@ -1,3 +1,5 @@
1
+ import { TOption } from '../../Select/ui/Select.types.ts';
2
+
1
3
  export interface Option {
2
4
  value: string | number;
3
5
  label: string;
@@ -13,4 +15,6 @@ export interface SortSelectProps {
13
15
  additionalClass?: string;
14
16
  mini?: boolean;
15
17
  openOnTop?: boolean;
18
+ onClickItem?: (option: TOption | TOption[]) => void;
19
+ onCLickSelect?: () => void;
16
20
  }
@@ -1,4 +1,4 @@
1
- import { S as e } from "../../SortSelect-jks4qMel.js";
1
+ import { S as e } from "../../SortSelect-DT1o6Lco.js";
2
2
  export {
3
3
  e as TabSwitcher
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { S as v } from "../../../SortSelect-jks4qMel.js";
3
+ import { S as v } from "../../../SortSelect-DT1o6Lco.js";
4
4
  import "../../Text/ui/Text.js";
5
5
  import "../../../index-rKuIKazb.js";
6
6
  import "../../Button/ui/Button.js";
@@ -11,7 +11,7 @@ import "../../Flex/ui/Flex.js";
11
11
  import "../../Input/ui/Input.js";
12
12
  import "react";
13
13
  import "../../../Modal-BZv6nlLe.js";
14
- import "../../../SortSelect-jks4qMel.js";
14
+ import "../../../SortSelect-DT1o6Lco.js";
15
15
  import "../../GroupedInput/ui/GroupedInputs.js";
16
16
  import "../../../index-rKuIKazb.js";
17
17
  import "../../MetroTag/ui/MetroTag.js";
package/dist/main.js CHANGED
@@ -10,7 +10,7 @@ import { Flex as T } from "./components/Flex/ui/Flex.js";
10
10
  import { Input as b } from "./components/Input/ui/Input.js";
11
11
  import { M as I } from "./Modal-BZv6nlLe.js";
12
12
  import { FieldInput as w } from "./components/FieldInput/ui/FieldInput.js";
13
- import { a as F, S as L } from "./SortSelect-jks4qMel.js";
13
+ import { a as F, S as L } from "./SortSelect-DT1o6Lco.js";
14
14
  import { GroupedInputs as N } from "./components/GroupedInput/ui/GroupedInputs.js";
15
15
  import { Logo as v } from "./components/Logo/ui/Logo.js";
16
16
  import { MetroTag as D } from "./components/MetroTag/ui/MetroTag.js";
@@ -0,0 +1,80 @@
1
+ import { jsxs as h, jsx as s } from "react/jsx-runtime";
2
+ import { c as m } from "./index-rKuIKazb.js";
3
+ const j = "_sortSelectWrapper_gj2vk_1", b = "_selectedOptions_gj2vk_11", x = "_selectModal_gj2vk_34", B = "_selectionOptionMini_gj2vk_38", S = "_selectedOptionsOpened_gj2vk_42", C = "_selectOptionsDisabled_gj2vk_46", L = "_optionsList_gj2vk_53", W = "_mobileOptionList_gj2vk_68", f = "_mobileSortHeader_gj2vk_76", M = "_modalAddBody_gj2vk_90", T = "_inputWrapper_gj2vk_96", D = "_option_gj2vk_53", N = "_icon_gj2vk_124", y = "_checkBox_gj2vk_131", A = "_checkBoxChecked_gj2vk_138", H = "_innerCheck_gj2vk_145", E = "_sortSelectWrapperTop_gj2vk_176", I = "_optionListOnTop_gj2vk_179", t = {
4
+ sortSelectWrapper: j,
5
+ selectedOptions: b,
6
+ selectModal: x,
7
+ selectionOptionMini: B,
8
+ selectedOptionsOpened: S,
9
+ selectOptionsDisabled: C,
10
+ optionsList: L,
11
+ mobileOptionList: W,
12
+ mobileSortHeader: f,
13
+ modalAddBody: M,
14
+ inputWrapper: T,
15
+ option: D,
16
+ icon: N,
17
+ checkBox: y,
18
+ checkBoxChecked: A,
19
+ innerCheck: H,
20
+ sortSelectWrapperTop: E,
21
+ optionListOnTop: I
22
+ }, k = m.bind(t), F = ({
23
+ selectedOption: e,
24
+ setSelectedOption: r,
25
+ setIsOpen: p,
26
+ containerRef: a,
27
+ onBlur: i,
28
+ onChange: _,
29
+ onClickOption: l,
30
+ isMobile: u,
31
+ placeholder: v
32
+ }) => {
33
+ const d = (o) => (c) => {
34
+ c.stopPropagation(), l && l(o);
35
+ const n = (e == null ? void 0 : e.value) === o.value ? null : o;
36
+ if (n && (r && r(n), _)) {
37
+ const g = {
38
+ ...c,
39
+ target: { value: n }
40
+ };
41
+ _(g);
42
+ }
43
+ };
44
+ return { handleDocumentClick: (o) => {
45
+ a.current && !a.current.contains(o.target) && p(!1);
46
+ }, handleBlur: (o) => {
47
+ if (i) {
48
+ const c = {
49
+ ...o,
50
+ target: { value: e }
51
+ };
52
+ i(c);
53
+ }
54
+ }, getInputValue: () => u ? "" : e ? e.label : v, getOption: (o) => /* @__PURE__ */ h(
55
+ "div",
56
+ {
57
+ className: k(t.option, {
58
+ [t.selected]: (e == null ? void 0 : e.value) === o.value
59
+ }),
60
+ onClick: d(o),
61
+ children: [
62
+ /* @__PURE__ */ s("div", { children: o.label }),
63
+ /* @__PURE__ */ s(
64
+ "div",
65
+ {
66
+ className: k(t.checkBox, {
67
+ [t.checkBoxChecked]: (e == null ? void 0 : e.value) === o.value
68
+ }),
69
+ children: (e == null ? void 0 : e.value) === o.value && /* @__PURE__ */ s("div", { className: t.innerCheck })
70
+ }
71
+ )
72
+ ]
73
+ },
74
+ o.value
75
+ ) };
76
+ };
77
+ export {
78
+ t as s,
79
+ F as u
80
+ };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "stone-kit",
3
3
  "description": "uikit for redesign",
4
4
  "private": false,
5
- "version": "0.0.502",
5
+ "version": "0.0.504",
6
6
  "author": "Mollycodd1e",
7
7
  "license": "ISC",
8
8
  "type": "module",
@@ -1,180 +0,0 @@
1
- import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as k, useState as T, useRef as D, useEffect as M } from "react";
3
- import { c as v } from "./index-rKuIKazb.js";
4
- import { s as t, u as B } from "./useSortSelect-D7K1wk0E.js";
5
- import { NewIcon as O } from "./components/NewIcon/ui/NewIcon.js";
6
- import "./components/Button/ui/Button.js";
7
- import "./components/mobileButton/ui/MobileButton.js";
8
- import "./components/DestinationTab/ui/DestinationTab.js";
9
- import "./components/RoundButton/ui/RoundButton.js";
10
- import "./components/Tag/ui/Tag.js";
11
- import "./components/Switcher/ui/Switcher.js";
12
- import { Text as C } from "./components/Text/ui/Text.js";
13
- import "./components/Flex/ui/Flex.js";
14
- import "./components/Input/ui/Input.js";
15
- import { M as j } from "./Modal-BZv6nlLe.js";
16
- import "./components/GroupedInput/ui/GroupedInputs.js";
17
- import "./components/MetroTag/ui/MetroTag.js";
18
- import "./components/LotCard/ui/LotCard.js";
19
- import "./components/Select/ui/Select.js";
20
- import { useClientWidth as L } from "./shared/useClientWidth.js";
21
- import "./components/SliderNavigation/ui/SliderNavigation.js";
22
- import "./components/LotCardSkeleton/ui/LotCardSkeleton.js";
23
- import "./components/TabSelect/ui/TabSelect.js";
24
- import "./components/FormModal/ui/ModalForm.js";
25
- const E = "_root_1ol37_1", A = "_text_1ol37_18", z = "_rootCol_1ol37_26", $ = "_item_1ol37_32", q = "_whiteRow_1ol37_51", H = "_firstItem_1ol37_62", P = "_lastItem_1ol37_66", V = "_apart_1ol37_97", F = "_isLong_1ol37_97", G = "_autoWidth_1ol37_122", J = "_isDisabled_1ol37_129", K = "_grayRow_1ol37_153", e = {
26
- root: E,
27
- text: A,
28
- rootCol: z,
29
- item: $,
30
- whiteRow: q,
31
- firstItem: H,
32
- lastItem: P,
33
- apart: V,
34
- isLong: F,
35
- autoWidth: G,
36
- isDisabled: J,
37
- grayRow: K
38
- }, h = v.bind(e), Q = ({
39
- children: s,
40
- variant: m = "whiteRow",
41
- isApart: d = !1,
42
- addClassName: p = "",
43
- col: n = !1
44
- }) => /* @__PURE__ */ o("div", { className: h(e.root, e[m], p, { [e.rootCol]: n, [e.apart]: d }), children: s }), W = k((s, m) => {
45
- const { isTablet: d, isDesktop: p } = L(), {
46
- index: n,
47
- children: i,
48
- addItemClassName: f,
49
- addTextClass: x,
50
- disabled: w = !1,
51
- itemsLength: b = 0,
52
- isLongOn: r = !0,
53
- width: a,
54
- width_m: c,
55
- width_l: l,
56
- ...y
57
- } = s, S = (i != null && i.toString().length ? (i == null ? void 0 : i.toString().length) > 2 : !1) && r, g = (_, R) => _ && c ? c : R && l ? l : a, I = !a && !c && !l && S;
58
- return /* @__PURE__ */ u("label", { className: h({ [e.isLong]: S }), children: [
59
- /* @__PURE__ */ o(
60
- "input",
61
- {
62
- ref: m,
63
- type: "checkbox",
64
- ...y,
65
- disabled: w
66
- }
67
- ),
68
- /* @__PURE__ */ o(
69
- "div",
70
- {
71
- style: { width: g(d, p) },
72
- className: h(h(
73
- e.item,
74
- { [e.firstItem]: n === 0 },
75
- { [e.lastItem]: n === b - 1 },
76
- { [e.isDisabled]: w },
77
- { [e.autoWidth]: I }
78
- ), f),
79
- children: /* @__PURE__ */ o(C, { className: h(e.text, x), children: i })
80
- }
81
- )
82
- ] });
83
- });
84
- W.displayName = "TabSwitcherItem";
85
- const It = Object.assign(Q, { Item: W }), N = v.bind(t), U = ({
86
- options: s,
87
- selectedOption: m,
88
- placeholder: d = "",
89
- error: p,
90
- disabled: n,
91
- additionalClass: i = "",
92
- onChange: f,
93
- onBlur: x,
94
- mini: w,
95
- openOnTop: b = !1
96
- }) => {
97
- const [r, a] = T(!1), c = D(null), { isMobile: l } = L(), { handleBlur: y, getInputValue: S, getOption: g, handleDocumentClick: I } = B({
98
- selectedOption: m,
99
- setSelectedOption: f,
100
- setIsOpen: a,
101
- containerRef: c,
102
- isOpen: r,
103
- isMobile: l,
104
- placeholder: d,
105
- onChange: f,
106
- onBlur: x
107
- });
108
- return M(() => (document.addEventListener("click", I), () => {
109
- document.removeEventListener("click", I);
110
- }), []), /* @__PURE__ */ u(
111
- "div",
112
- {
113
- ref: c,
114
- className: N(
115
- t.sortSelectWrapper,
116
- { [t.sortSelectWrapperError]: p },
117
- { [t.sortSelectWrapperTop]: b },
118
- i
119
- ),
120
- tabIndex: 0,
121
- onBlur: y,
122
- children: [
123
- /* @__PURE__ */ u("div", { className: N(t.inputWrapper), children: [
124
- /* @__PURE__ */ o(
125
- "input",
126
- {
127
- type: "text",
128
- readOnly: !0,
129
- value: S(),
130
- className: N(
131
- t.selectedOptions,
132
- { [t.selectOptionsDisabled]: n },
133
- { [t.selectionOptionMini]: w }
134
- ),
135
- onClick: () => a(!r)
136
- }
137
- ),
138
- /* @__PURE__ */ o(
139
- O,
140
- {
141
- name: "twoArrows",
142
- size: "24",
143
- additionalClass: t.icon
144
- }
145
- )
146
- ] }),
147
- r && l && /* @__PURE__ */ u(
148
- j,
149
- {
150
- isOpen: r,
151
- emitIsOpen: a,
152
- additionalClassModalBody: t.modalAddBody,
153
- additionalClass: t.selectModal,
154
- createPortalObj: { domNode: document.querySelector("body") },
155
- isTransparentBack: !0,
156
- children: [
157
- /* @__PURE__ */ u("div", { className: t.mobileSortHeader, children: [
158
- /* @__PURE__ */ o(C, { children: "Сортировка" }),
159
- /* @__PURE__ */ o("div", { onClick: () => a(!1), children: /* @__PURE__ */ o(
160
- O,
161
- {
162
- name: "close",
163
- size: "20"
164
- }
165
- ) })
166
- ] }),
167
- /* @__PURE__ */ o("div", { className: t.mobileOptionList, children: s == null ? void 0 : s.map((_) => g(_)) })
168
- ]
169
- }
170
- ),
171
- r && !l && /* @__PURE__ */ o("div", { className: N(t.optionsList, { [t.optionListOnTop]: b }), children: s == null ? void 0 : s.map((_) => g(_)) })
172
- ]
173
- }
174
- );
175
- };
176
- U.displayName = "SortSelect";
177
- export {
178
- It as S,
179
- U as a
180
- };
@@ -1,79 +0,0 @@
1
- import { jsxs as g, jsx as s } from "react/jsx-runtime";
2
- import { c as h } from "./index-rKuIKazb.js";
3
- const m = "_sortSelectWrapper_gj2vk_1", j = "_selectedOptions_gj2vk_11", b = "_selectModal_gj2vk_34", x = "_selectionOptionMini_gj2vk_38", B = "_selectedOptionsOpened_gj2vk_42", C = "_selectOptionsDisabled_gj2vk_46", S = "_optionsList_gj2vk_53", L = "_mobileOptionList_gj2vk_68", W = "_mobileSortHeader_gj2vk_76", f = "_modalAddBody_gj2vk_90", M = "_inputWrapper_gj2vk_96", T = "_option_gj2vk_53", D = "_icon_gj2vk_124", N = "_checkBox_gj2vk_131", y = "_checkBoxChecked_gj2vk_138", A = "_innerCheck_gj2vk_145", H = "_sortSelectWrapperTop_gj2vk_176", E = "_optionListOnTop_gj2vk_179", t = {
4
- sortSelectWrapper: m,
5
- selectedOptions: j,
6
- selectModal: b,
7
- selectionOptionMini: x,
8
- selectedOptionsOpened: B,
9
- selectOptionsDisabled: C,
10
- optionsList: S,
11
- mobileOptionList: L,
12
- mobileSortHeader: W,
13
- modalAddBody: f,
14
- inputWrapper: M,
15
- option: T,
16
- icon: D,
17
- checkBox: N,
18
- checkBoxChecked: y,
19
- innerCheck: A,
20
- sortSelectWrapperTop: H,
21
- optionListOnTop: E
22
- }, l = h.bind(t), z = ({
23
- selectedOption: o,
24
- setSelectedOption: r,
25
- setIsOpen: k,
26
- containerRef: i,
27
- onBlur: a,
28
- onChange: _,
29
- isMobile: p,
30
- placeholder: u
31
- }) => {
32
- const v = (e) => (n) => {
33
- n.stopPropagation();
34
- const c = (o == null ? void 0 : o.value) === e.value ? null : e;
35
- if (c && (r && r(c), _)) {
36
- const d = {
37
- ...n,
38
- target: { value: c }
39
- };
40
- _(d);
41
- }
42
- };
43
- return { handleDocumentClick: (e) => {
44
- i.current && !i.current.contains(e.target) && k(!1);
45
- }, handleBlur: (e) => {
46
- if (a) {
47
- const n = {
48
- ...e,
49
- target: { value: o }
50
- };
51
- a(n);
52
- }
53
- }, getInputValue: () => p ? "" : o ? o.label : u, getOption: (e) => /* @__PURE__ */ g(
54
- "div",
55
- {
56
- className: l(t.option, {
57
- [t.selected]: (o == null ? void 0 : o.value) === e.value
58
- }),
59
- onClick: v(e),
60
- children: [
61
- /* @__PURE__ */ s("div", { children: e.label }),
62
- /* @__PURE__ */ s(
63
- "div",
64
- {
65
- className: l(t.checkBox, {
66
- [t.checkBoxChecked]: (o == null ? void 0 : o.value) === e.value
67
- }),
68
- children: (o == null ? void 0 : o.value) === e.value && /* @__PURE__ */ s("div", { className: t.innerCheck })
69
- }
70
- )
71
- ]
72
- },
73
- e.value
74
- ) };
75
- };
76
- export {
77
- t as s,
78
- z as u
79
- };