stone-kit 0.0.603 → 0.0.604

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,411 @@
1
+ import { jsxs as y, jsx as e, Fragment as F } from "react/jsx-runtime";
2
+ import { forwardRef as Z, useState as B, useRef as J, useEffect as D } from "react";
3
+ import { NewIcon as R } from "./components/NewIcon/ui/NewIcon.js";
4
+ import { M as q } from "./Modal-BZv6nlLe.js";
5
+ import { Text as H } from "./components/Text/ui/Text.js";
6
+ import { c as V, g as tt } from "./index-rKuIKazb.js";
7
+ import { Button as P } from "./components/Button/ui/Button.js";
8
+ import "./components/mobileButton/ui/MobileButton.js";
9
+ import "./components/DestinationTab/ui/DestinationTab.js";
10
+ import "./components/RoundButton/ui/RoundButton.js";
11
+ import "./components/Tag/ui/Tag.js";
12
+ import "./components/Switcher/ui/Switcher.js";
13
+ import "./components/Flex/ui/Flex.js";
14
+ import "./components/Input/ui/Input.js";
15
+ import "./components/GroupedInput/ui/GroupedInputs.js";
16
+ import "./components/MetroTag/ui/MetroTag.js";
17
+ import "./components/LotCard/ui/LotCard.js";
18
+ import "./components/Select/ui/Select.js";
19
+ import { useClientWidth as E } from "./shared/useClientWidth.js";
20
+ import { s as c, u as et } from "./useSortSelect-CjZXLFOG.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
+ import { O as it } from "./Option-CyYM1iBJ.js";
26
+ const rt = "_root_2bilg_1", nt = "_text_2bilg_18", st = "_textMini_2bilg_26", ot = "_rootCol_2bilg_32", at = "_item_2bilg_38", lt = "_whiteRow_2bilg_57", ct = "_firstItem_2bilg_68", dt = "_lastItem_2bilg_72", pt = "_apart_2bilg_103", mt = "_isLong_2bilg_103", _t = "_autoWidth_2bilg_128", ut = "_mini_2bilg_132", ht = "_isDisabled_2bilg_140", ft = "_grayRow_2bilg_164", p = {
27
+ root: rt,
28
+ text: nt,
29
+ textMini: st,
30
+ rootCol: ot,
31
+ item: at,
32
+ whiteRow: lt,
33
+ firstItem: ct,
34
+ lastItem: dt,
35
+ apart: pt,
36
+ isLong: mt,
37
+ autoWidth: _t,
38
+ mini: ut,
39
+ isDisabled: ht,
40
+ grayRow: ft
41
+ }, I = V.bind(p), vt = ({
42
+ children: o,
43
+ variant: s = "whiteRow",
44
+ isApart: a = !1,
45
+ addClassName: _ = "",
46
+ col: u = !1
47
+ }) => /* @__PURE__ */ e("div", { className: I(p.root, p[s], _, { [p.rootCol]: u, [p.apart]: a }), children: o }), G = Z((o, s) => {
48
+ const { isTablet: a, isDesktop: _ } = E(), {
49
+ index: u,
50
+ children: t,
51
+ addItemClassName: i,
52
+ addTextClass: d,
53
+ disabled: g = !1,
54
+ itemsLength: C = 0,
55
+ isLongOn: O = !0,
56
+ width: h,
57
+ width_m: l,
58
+ width_l: m,
59
+ mini: S = !1,
60
+ ...k
61
+ } = o, x = (t != null && t.toString().length ? (t == null ? void 0 : t.toString().length) > 2 : !1) && O, N = (v, W) => v && l ? l : W && m ? m : h, f = !h && !l && !m && x;
62
+ return /* @__PURE__ */ y("label", { className: I({ [p.isLong]: x }), children: [
63
+ /* @__PURE__ */ e(
64
+ "input",
65
+ {
66
+ ref: s,
67
+ type: "checkbox",
68
+ ...k,
69
+ disabled: g
70
+ }
71
+ ),
72
+ /* @__PURE__ */ e(
73
+ "div",
74
+ {
75
+ style: { width: N(a, _) },
76
+ className: I(
77
+ I(
78
+ p.item,
79
+ { [p.firstItem]: u === 0 },
80
+ { [p.lastItem]: u === C - 1 },
81
+ { [p.isDisabled]: g },
82
+ { [p.autoWidth]: f },
83
+ { [p.mini]: S }
84
+ ),
85
+ i
86
+ ),
87
+ children: /* @__PURE__ */ e(H, { className: I(p.text, { [p.textMini]: S }, d), children: t })
88
+ }
89
+ )
90
+ ] });
91
+ });
92
+ G.displayName = "TabSwitcherItem";
93
+ const T = Object.assign(vt, { Item: G }), L = V.bind(c), wt = ({
94
+ options: o,
95
+ selectedOption: s,
96
+ placeholder: a = "",
97
+ error: _,
98
+ disabled: u,
99
+ additionalClass: t = "",
100
+ onChange: i,
101
+ onBlur: d,
102
+ mini: g,
103
+ openOnTop: C = !1,
104
+ onClickItem: O,
105
+ onCLickSelect: h
106
+ }) => {
107
+ const [l, m] = B(!1), S = J(null), { isMobile: k } = E(), { handleBlur: x, getInputValue: N, getOption: f, handleDocumentClick: v } = et(
108
+ {
109
+ selectedOption: s,
110
+ onClickOption: O,
111
+ setSelectedOption: i,
112
+ setIsOpen: m,
113
+ containerRef: S,
114
+ isOpen: l,
115
+ isMobile: k,
116
+ placeholder: a,
117
+ onChange: i,
118
+ onBlur: d
119
+ }
120
+ );
121
+ return D(() => (document.addEventListener("click", v), () => {
122
+ document.removeEventListener("click", v);
123
+ }), []), /* @__PURE__ */ y(
124
+ "div",
125
+ {
126
+ ref: S,
127
+ className: L(
128
+ c.sortSelectWrapper,
129
+ { [c.sortSelectWrapperError]: _ },
130
+ { [c.sortSelectWrapperTop]: C },
131
+ t
132
+ ),
133
+ tabIndex: 0,
134
+ onBlur: x,
135
+ onClick: () => {
136
+ h && h();
137
+ },
138
+ children: [
139
+ /* @__PURE__ */ y("div", { className: L(c.inputWrapper), children: [
140
+ /* @__PURE__ */ e(
141
+ "input",
142
+ {
143
+ type: "text",
144
+ readOnly: !0,
145
+ value: N(),
146
+ className: L(
147
+ c.selectedOptions,
148
+ { [c.selectOptionsDisabled]: u },
149
+ { [c.selectionOptionMini]: g }
150
+ ),
151
+ onClick: () => m(!l)
152
+ }
153
+ ),
154
+ /* @__PURE__ */ e(
155
+ R,
156
+ {
157
+ name: "twoArrows",
158
+ size: "24",
159
+ additionalClass: c.icon
160
+ }
161
+ )
162
+ ] }),
163
+ l && k && /* @__PURE__ */ y(
164
+ q,
165
+ {
166
+ isOpen: l,
167
+ emitIsOpen: m,
168
+ additionalClassModalBody: c.modalAddBody,
169
+ additionalClass: c.selectModal,
170
+ createPortalObj: { domNode: document.querySelector("body") },
171
+ isTransparentBack: !0,
172
+ children: [
173
+ /* @__PURE__ */ y("div", { className: c.mobileSortHeader, children: [
174
+ /* @__PURE__ */ e(H, { children: "Сортировка" }),
175
+ /* @__PURE__ */ e("div", { onClick: () => m(!1), children: /* @__PURE__ */ e(
176
+ R,
177
+ {
178
+ name: "close",
179
+ size: "20"
180
+ }
181
+ ) })
182
+ ] }),
183
+ /* @__PURE__ */ e("div", { className: c.mobileOptionList, children: o == null ? void 0 : o.map((W) => f(W)) })
184
+ ]
185
+ }
186
+ ),
187
+ l && !k && /* @__PURE__ */ e("div", { className: L(c.optionsList, { [c.optionListOnTop]: C }), children: o == null ? void 0 : o.map((W) => f(W)) })
188
+ ]
189
+ }
190
+ );
191
+ };
192
+ wt.displayName = "SortSelect";
193
+ const yt = "_root_1wv7y_1", Wt = "_filterWithSaveModal_1wv7y_15", Nt = "_modalAddBody_1wv7y_20", bt = "_closeBtn_1wv7y_29", gt = "_btnName_1wv7y_35", Ot = "_modalTitle_1wv7y_39", St = "_tabSWitcherWrapper_1wv7y_48", kt = "_switcherTitle_1wv7y_56", Ct = "_switcherScroll_1wv7y_63", xt = "_tabs_1wv7y_67", Bt = "_selectWrapper_1wv7y_72", It = "_filterOption_1wv7y_76", Mt = "_btnWrapper_1wv7y_83", Lt = "_resetBtn_1wv7y_89", Rt = "_saveBtn_1wv7y_90", At = "_desktopWrapper_1wv7y_94", Dt = "_desktopWrapperOpen_1wv7y_117", n = {
194
+ root: yt,
195
+ filterWithSaveModal: Wt,
196
+ modalAddBody: Nt,
197
+ closeBtn: bt,
198
+ btnName: gt,
199
+ modalTitle: Ot,
200
+ tabSWitcherWrapper: St,
201
+ switcherTitle: kt,
202
+ switcherScroll: Ct,
203
+ tabs: xt,
204
+ selectWrapper: Bt,
205
+ filterOption: It,
206
+ btnWrapper: Mt,
207
+ resetBtn: Lt,
208
+ saveBtn: Rt,
209
+ desktopWrapper: At,
210
+ desktopWrapperOpen: Dt
211
+ };
212
+ var K = { exports: {} };
213
+ /*!
214
+ Copyright (c) 2018 Jed Watson.
215
+ Licensed under the MIT License (MIT), see
216
+ http://jedwatson.github.io/classnames
217
+ */
218
+ (function(o) {
219
+ (function() {
220
+ var s = {}.hasOwnProperty;
221
+ function a() {
222
+ for (var t = "", i = 0; i < arguments.length; i++) {
223
+ var d = arguments[i];
224
+ d && (t = u(t, _.call(this, d)));
225
+ }
226
+ return t;
227
+ }
228
+ function _(t) {
229
+ if (typeof t == "string" || typeof t == "number")
230
+ return this && this[t] || t;
231
+ if (typeof t != "object")
232
+ return "";
233
+ if (Array.isArray(t))
234
+ return a.apply(this, t);
235
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
236
+ return t.toString();
237
+ var i = "";
238
+ for (var d in t)
239
+ s.call(t, d) && t[d] && (i = u(i, this && this[d] || d));
240
+ return i;
241
+ }
242
+ function u(t, i) {
243
+ return i ? t ? t + " " + i : t + i : t;
244
+ }
245
+ o.exports ? (a.default = a, o.exports = a) : window.classNames = a;
246
+ })();
247
+ })(K);
248
+ var Et = K.exports;
249
+ const jt = /* @__PURE__ */ tt(Et), $t = jt.bind(n), de = ({
250
+ disabledOptions: o = [],
251
+ tabs: s = [],
252
+ selectOptions: a = [],
253
+ onChange: _,
254
+ selectedValues: u = [],
255
+ setSelectedTabs: t,
256
+ selectedTabs: i = [],
257
+ onClickItem: d,
258
+ onCLickSelect: g,
259
+ btnName: C = "Фильтр"
260
+ }) => {
261
+ const { isMobile: O } = E(), [h, l] = B(!1), m = J(null), [S, k] = B(i), [x] = B(u), [N, f] = B(S), [v, W] = B(x), Q = (r) => {
262
+ if (d && d(r), o.some((w) => w.value === r.value))
263
+ return;
264
+ const b = v.some((w) => w.value === r.value) ? v.filter((w) => w.value !== r.value) : [...v, r];
265
+ W(b);
266
+ }, U = () => {
267
+ k(s), f(s), W([]), _ && (_([]), t == null || t(s));
268
+ }, X = () => {
269
+ W(u), f(i);
270
+ }, j = () => {
271
+ X(), l(!1);
272
+ }, Y = (r) => {
273
+ r.stopPropagation(), _ && (t == null || t(N), _(v)), l(!1);
274
+ };
275
+ D(() => {
276
+ h || f((r) => JSON.stringify(r) !== JSON.stringify(i) ? i : r);
277
+ }, [h, i]), D(() => {
278
+ const r = (b) => {
279
+ m.current && (m.current && !m.current.contains(b.target) || j());
280
+ };
281
+ return h ? document.addEventListener("click", r, { capture: !0 }) : document.removeEventListener("click", r, { capture: !0 }), () => {
282
+ document.removeEventListener("click", r, { capture: !0 });
283
+ };
284
+ }, [h]);
285
+ const $ = () => /* @__PURE__ */ y(F, { children: [
286
+ /* @__PURE__ */ e(
287
+ "div",
288
+ {
289
+ className: n.closeBtn,
290
+ onClick: () => {
291
+ j();
292
+ },
293
+ children: /* @__PURE__ */ e(
294
+ R,
295
+ {
296
+ name: "close",
297
+ size: "24"
298
+ }
299
+ )
300
+ }
301
+ ),
302
+ /* @__PURE__ */ e("div", { className: n.modalTitle, children: "Фильтры" }),
303
+ /* @__PURE__ */ y("div", { className: n.tabSWitcherWrapper, children: [
304
+ /* @__PURE__ */ e("div", { className: n.switcherTitle, children: "Готовность" }),
305
+ /* @__PURE__ */ e("div", { className: n.switcherScroll, children: /* @__PURE__ */ e(
306
+ T,
307
+ {
308
+ variant: "grayRow",
309
+ addClassName: n.tabs,
310
+ isApart: !0,
311
+ children: s == null ? void 0 : s.map((r, b) => {
312
+ var z;
313
+ const w = r.value;
314
+ return /* @__PURE__ */ e(
315
+ T.Item,
316
+ {
317
+ itemsLength: s == null ? void 0 : s.length,
318
+ mini: !0,
319
+ value: w,
320
+ onClick: () => {
321
+ },
322
+ checked: ((z = N == null ? void 0 : N.find((A) => A.value === w)) == null ? void 0 : z.state) ?? !1,
323
+ onChange: () => {
324
+ f == null || f(
325
+ (A) => A.map((M) => M.value === w ? { ...M, state: !M.state } : M)
326
+ );
327
+ },
328
+ index: b,
329
+ addItemClassName: n.tabSwitcher,
330
+ children: w
331
+ },
332
+ b
333
+ );
334
+ })
335
+ }
336
+ ) })
337
+ ] }),
338
+ /* @__PURE__ */ e("div", { className: n.selectWrapper, children: a == null ? void 0 : a.map((r, b) => /* @__PURE__ */ e(
339
+ it,
340
+ {
341
+ addClassName: n.filterOption,
342
+ disabledOptions: [],
343
+ clickableOptions: [],
344
+ selectedOptions: v,
345
+ option: r,
346
+ handleOptionClick: Q
347
+ },
348
+ b
349
+ )) }),
350
+ /* @__PURE__ */ y("div", { className: n.btnWrapper, children: [
351
+ /* @__PURE__ */ e(
352
+ P,
353
+ {
354
+ as: "button",
355
+ variant: "gray",
356
+ additionalClass: n.resetBtn,
357
+ onClick: U,
358
+ children: "Сбросить"
359
+ }
360
+ ),
361
+ /* @__PURE__ */ e(
362
+ P,
363
+ {
364
+ as: "button",
365
+ additionalClass: n.saveBtn,
366
+ onClick: Y,
367
+ children: "Сохранить"
368
+ }
369
+ )
370
+ ] })
371
+ ] });
372
+ return /* @__PURE__ */ y(F, { children: [
373
+ /* @__PURE__ */ y(
374
+ "div",
375
+ {
376
+ ref: m,
377
+ className: n.root,
378
+ onClick: () => {
379
+ g && g(), l(O ? (r) => !r : !0);
380
+ },
381
+ children: [
382
+ /* @__PURE__ */ e("div", { className: n.btnName, children: C }),
383
+ /* @__PURE__ */ e(
384
+ R,
385
+ {
386
+ name: "filter",
387
+ size: "16"
388
+ }
389
+ ),
390
+ !O && /* @__PURE__ */ e("div", { className: $t(n.desktopWrapper, { [n.desktopWrapperOpen]: h }), children: /* @__PURE__ */ e($, {}) })
391
+ ]
392
+ }
393
+ ),
394
+ O && /* @__PURE__ */ e(
395
+ q,
396
+ {
397
+ isOpen: h,
398
+ emitIsOpen: l,
399
+ isTransparentBack: !0,
400
+ additionalClassModalBody: n.modalAddBody,
401
+ additionalClass: n.filterWithSaveModal,
402
+ children: /* @__PURE__ */ e($, {})
403
+ }
404
+ )
405
+ ] });
406
+ };
407
+ export {
408
+ de as F,
409
+ T as S,
410
+ wt as a
411
+ };
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../NewIcon/ui/NewIcon.js";
4
- import { F as w } from "../../../FilterWithSave-Cajvt9Y7.js";
4
+ import { F as w } from "../../../FilterWithSave-BxcOK4VO.js";
5
5
  import "../../../Modal-BZv6nlLe.js";
6
6
  import "../../../Option-CyYM1iBJ.js";
7
7
  import "../../Button/ui/Button.js";
@@ -1,4 +1,4 @@
1
- import { a as r } from "../../FilterWithSave-Cajvt9Y7.js";
1
+ import { a as r } from "../../FilterWithSave-BxcOK4VO.js";
2
2
  export {
3
3
  r as SortSelect
4
4
  };
@@ -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 "../../../FilterWithSave-Cajvt9Y7.js";
16
+ import { a as z } from "../../../FilterWithSave-BxcOK4VO.js";
17
17
  import "../../GroupedInput/ui/GroupedInputs.js";
18
18
  import "../../MetroTag/ui/MetroTag.js";
19
19
  import "../../LotCard/ui/LotCard.js";
@@ -1,4 +1,4 @@
1
- import { S as e } from "../../FilterWithSave-Cajvt9Y7.js";
1
+ import { S as e } from "../../FilterWithSave-BxcOK4VO.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 "../../../FilterWithSave-Cajvt9Y7.js";
3
+ import { S as v } from "../../../FilterWithSave-BxcOK4VO.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 "../../../FilterWithSave-Cajvt9Y7.js";
14
+ import "../../../FilterWithSave-BxcOK4VO.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 F } from "./components/Input/ui/Input.js";
11
11
  import { M as g } from "./Modal-BZv6nlLe.js";
12
12
  import { FieldInput as I } from "./components/FieldInput/ui/FieldInput.js";
13
- import { F as B, a as L, S as k } from "./FilterWithSave-Cajvt9Y7.js";
13
+ import { F as B, a as L, S as k } from "./FilterWithSave-BxcOK4VO.js";
14
14
  import { GroupedInputs as N } from "./components/GroupedInput/ui/GroupedInputs.js";
15
15
  import { Logo as j } from "./components/Logo/ui/Logo.js";
16
16
  import { MetroTag as D } from "./components/MetroTag/ui/MetroTag.js";
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.603",
5
+ "version": "0.0.604",
6
6
  "author": "Mollycodd1e",
7
7
  "license": "ISC",
8
8
  "type": "module",
@@ -1,420 +0,0 @@
1
- import { jsxs as v, jsx as e, Fragment as P } from "react/jsx-runtime";
2
- import { forwardRef as et, useState as S, useRef as q, useEffect as j } from "react";
3
- import { NewIcon as D } from "./components/NewIcon/ui/NewIcon.js";
4
- import { M as H } from "./Modal-BZv6nlLe.js";
5
- import { Text as V } from "./components/Text/ui/Text.js";
6
- import { c as G, g as it } from "./index-rKuIKazb.js";
7
- import { Button as T } from "./components/Button/ui/Button.js";
8
- import "./components/mobileButton/ui/MobileButton.js";
9
- import "./components/DestinationTab/ui/DestinationTab.js";
10
- import "./components/RoundButton/ui/RoundButton.js";
11
- import "./components/Tag/ui/Tag.js";
12
- import "./components/Switcher/ui/Switcher.js";
13
- import "./components/Flex/ui/Flex.js";
14
- import "./components/Input/ui/Input.js";
15
- import "./components/GroupedInput/ui/GroupedInputs.js";
16
- import "./components/MetroTag/ui/MetroTag.js";
17
- import "./components/LotCard/ui/LotCard.js";
18
- import "./components/Select/ui/Select.js";
19
- import { useClientWidth as $ } from "./shared/useClientWidth.js";
20
- import { s as l, u as rt } from "./useSortSelect-CjZXLFOG.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
- import { O as st } from "./Option-CyYM1iBJ.js";
26
- const nt = "_root_2bilg_1", ot = "_text_2bilg_18", at = "_textMini_2bilg_26", lt = "_rootCol_2bilg_32", ct = "_item_2bilg_38", dt = "_whiteRow_2bilg_57", pt = "_firstItem_2bilg_68", mt = "_lastItem_2bilg_72", _t = "_apart_2bilg_103", ut = "_isLong_2bilg_103", ft = "_autoWidth_2bilg_128", ht = "_mini_2bilg_132", vt = "_isDisabled_2bilg_140", wt = "_grayRow_2bilg_164", p = {
27
- root: nt,
28
- text: ot,
29
- textMini: at,
30
- rootCol: lt,
31
- item: ct,
32
- whiteRow: dt,
33
- firstItem: pt,
34
- lastItem: mt,
35
- apart: _t,
36
- isLong: ut,
37
- autoWidth: ft,
38
- mini: ht,
39
- isDisabled: vt,
40
- grayRow: wt
41
- }, M = G.bind(p), yt = ({
42
- children: o,
43
- variant: n = "whiteRow",
44
- isApart: a = !1,
45
- addClassName: m = "",
46
- col: _ = !1
47
- }) => /* @__PURE__ */ e("div", { className: M(p.root, p[n], m, { [p.rootCol]: _, [p.apart]: a }), children: o }), K = et((o, n) => {
48
- const { isTablet: a, isDesktop: m } = $(), {
49
- index: _,
50
- children: t,
51
- addItemClassName: i,
52
- addTextClass: c,
53
- disabled: g = !1,
54
- itemsLength: k = 0,
55
- isLongOn: N = !0,
56
- width: y,
57
- width_m: d,
58
- width_l: u,
59
- mini: O = !1,
60
- ...h
61
- } = o, C = (t != null && t.toString().length ? (t == null ? void 0 : t.toString().length) > 2 : !1) && N, B = (W, f) => W && d ? d : f && u ? u : y, x = !y && !d && !u && C;
62
- return /* @__PURE__ */ v("label", { className: M({ [p.isLong]: C }), children: [
63
- /* @__PURE__ */ e(
64
- "input",
65
- {
66
- ref: n,
67
- type: "checkbox",
68
- ...h,
69
- disabled: g
70
- }
71
- ),
72
- /* @__PURE__ */ e(
73
- "div",
74
- {
75
- style: { width: B(a, m) },
76
- className: M(
77
- M(
78
- p.item,
79
- { [p.firstItem]: _ === 0 },
80
- { [p.lastItem]: _ === k - 1 },
81
- { [p.isDisabled]: g },
82
- { [p.autoWidth]: x },
83
- { [p.mini]: O }
84
- ),
85
- i
86
- ),
87
- children: /* @__PURE__ */ e(V, { className: M(p.text, { [p.textMini]: O }, c), children: t })
88
- }
89
- )
90
- ] });
91
- });
92
- K.displayName = "TabSwitcherItem";
93
- const J = Object.assign(yt, { Item: K }), R = G.bind(l), Wt = ({
94
- options: o,
95
- selectedOption: n,
96
- placeholder: a = "",
97
- error: m,
98
- disabled: _,
99
- additionalClass: t = "",
100
- onChange: i,
101
- onBlur: c,
102
- mini: g,
103
- openOnTop: k = !1,
104
- onClickItem: N,
105
- onCLickSelect: y
106
- }) => {
107
- const [d, u] = S(!1), O = q(null), { isMobile: h } = $(), { handleBlur: C, getInputValue: B, getOption: x, handleDocumentClick: W } = rt(
108
- {
109
- selectedOption: n,
110
- onClickOption: N,
111
- setSelectedOption: i,
112
- setIsOpen: u,
113
- containerRef: O,
114
- isOpen: d,
115
- isMobile: h,
116
- placeholder: a,
117
- onChange: i,
118
- onBlur: c
119
- }
120
- );
121
- return j(() => (document.addEventListener("click", W), () => {
122
- document.removeEventListener("click", W);
123
- }), []), /* @__PURE__ */ v(
124
- "div",
125
- {
126
- ref: O,
127
- className: R(
128
- l.sortSelectWrapper,
129
- { [l.sortSelectWrapperError]: m },
130
- { [l.sortSelectWrapperTop]: k },
131
- t
132
- ),
133
- tabIndex: 0,
134
- onBlur: C,
135
- onClick: () => {
136
- y && y();
137
- },
138
- children: [
139
- /* @__PURE__ */ v("div", { className: R(l.inputWrapper), children: [
140
- /* @__PURE__ */ e(
141
- "input",
142
- {
143
- type: "text",
144
- readOnly: !0,
145
- value: B(),
146
- className: R(
147
- l.selectedOptions,
148
- { [l.selectOptionsDisabled]: _ },
149
- { [l.selectionOptionMini]: g }
150
- ),
151
- onClick: () => u(!d)
152
- }
153
- ),
154
- /* @__PURE__ */ e(
155
- D,
156
- {
157
- name: "twoArrows",
158
- size: "24",
159
- additionalClass: l.icon
160
- }
161
- )
162
- ] }),
163
- d && h && /* @__PURE__ */ v(
164
- H,
165
- {
166
- isOpen: d,
167
- emitIsOpen: u,
168
- additionalClassModalBody: l.modalAddBody,
169
- additionalClass: l.selectModal,
170
- createPortalObj: { domNode: document.querySelector("body") },
171
- isTransparentBack: !0,
172
- children: [
173
- /* @__PURE__ */ v("div", { className: l.mobileSortHeader, children: [
174
- /* @__PURE__ */ e(V, { children: "Сортировка" }),
175
- /* @__PURE__ */ e("div", { onClick: () => u(!1), children: /* @__PURE__ */ e(
176
- D,
177
- {
178
- name: "close",
179
- size: "20"
180
- }
181
- ) })
182
- ] }),
183
- /* @__PURE__ */ e("div", { className: l.mobileOptionList, children: o == null ? void 0 : o.map((f) => x(f)) })
184
- ]
185
- }
186
- ),
187
- d && !h && /* @__PURE__ */ e("div", { className: R(l.optionsList, { [l.optionListOnTop]: k }), children: o == null ? void 0 : o.map((f) => x(f)) })
188
- ]
189
- }
190
- );
191
- };
192
- Wt.displayName = "SortSelect";
193
- const Nt = "_root_1wv7y_1", Ot = "_filterWithSaveModal_1wv7y_15", bt = "_modalAddBody_1wv7y_20", gt = "_closeBtn_1wv7y_29", St = "_btnName_1wv7y_35", kt = "_modalTitle_1wv7y_39", Ct = "_tabSWitcherWrapper_1wv7y_48", xt = "_switcherTitle_1wv7y_56", Bt = "_switcherScroll_1wv7y_63", It = "_tabs_1wv7y_67", Mt = "_selectWrapper_1wv7y_72", Lt = "_filterOption_1wv7y_76", Rt = "_btnWrapper_1wv7y_83", Dt = "_resetBtn_1wv7y_89", At = "_saveBtn_1wv7y_90", Et = "_desktopWrapper_1wv7y_94", jt = "_desktopWrapperOpen_1wv7y_117", s = {
194
- root: Nt,
195
- filterWithSaveModal: Ot,
196
- modalAddBody: bt,
197
- closeBtn: gt,
198
- btnName: St,
199
- modalTitle: kt,
200
- tabSWitcherWrapper: Ct,
201
- switcherTitle: xt,
202
- switcherScroll: Bt,
203
- tabs: It,
204
- selectWrapper: Mt,
205
- filterOption: Lt,
206
- btnWrapper: Rt,
207
- resetBtn: Dt,
208
- saveBtn: At,
209
- desktopWrapper: Et,
210
- desktopWrapperOpen: jt
211
- };
212
- var Q = { exports: {} };
213
- /*!
214
- Copyright (c) 2018 Jed Watson.
215
- Licensed under the MIT License (MIT), see
216
- http://jedwatson.github.io/classnames
217
- */
218
- (function(o) {
219
- (function() {
220
- var n = {}.hasOwnProperty;
221
- function a() {
222
- for (var t = "", i = 0; i < arguments.length; i++) {
223
- var c = arguments[i];
224
- c && (t = _(t, m.call(this, c)));
225
- }
226
- return t;
227
- }
228
- function m(t) {
229
- if (typeof t == "string" || typeof t == "number")
230
- return this && this[t] || t;
231
- if (typeof t != "object")
232
- return "";
233
- if (Array.isArray(t))
234
- return a.apply(this, t);
235
- if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
236
- return t.toString();
237
- var i = "";
238
- for (var c in t)
239
- n.call(t, c) && t[c] && (i = _(i, this && this[c] || c));
240
- return i;
241
- }
242
- function _(t, i) {
243
- return i ? t ? t + " " + i : t + i : t;
244
- }
245
- o.exports ? (a.default = a, o.exports = a) : window.classNames = a;
246
- })();
247
- })(Q);
248
- var $t = Q.exports;
249
- const zt = /* @__PURE__ */ it($t), Ft = zt.bind(s), me = ({
250
- disabledOptions: o = [],
251
- tabs: n = [],
252
- selectOptions: a = [],
253
- onChange: m,
254
- selectedValues: _ = [],
255
- setSelectedTabs: t,
256
- selectedTabs: i = [],
257
- onClickItem: c,
258
- onCLickSelect: g,
259
- btnName: k = "Фильтр"
260
- }) => {
261
- const { isMobile: N } = $(), [y, d] = S(!1), [u, O] = S(!1), h = q(null), [C, B] = S(i), [x] = S(_), [W, f] = S(C), [I, A] = S(x), U = (r) => {
262
- if (c && c(r), o.some((w) => w.value === r.value))
263
- return;
264
- const b = I.some((w) => w.value === r.value) ? I.filter((w) => w.value !== r.value) : [...I, r];
265
- A(b);
266
- }, X = () => {
267
- B(n), f(n), A([]), m && (m([]), t == null || t(n));
268
- }, Y = () => {
269
- A(_), f(i);
270
- }, Z = () => {
271
- Y(), d(!1);
272
- }, tt = (r) => {
273
- r.stopPropagation(), m && (t == null || t(W), m(I)), d(!1);
274
- };
275
- j(() => {
276
- y || f((r) => JSON.stringify(r) !== JSON.stringify(i) ? i : r);
277
- }, [y, i]), j(() => {
278
- const r = (b) => {
279
- h.current && (h.current && !h.current.contains(b.target) || O(!1));
280
- };
281
- return u ? document.addEventListener("click", r, { capture: !0 }) : document.removeEventListener("click", r, { capture: !0 }), () => {
282
- document.removeEventListener("click", r, { capture: !0 });
283
- };
284
- }, [u]);
285
- const z = () => /* @__PURE__ */ v(P, { children: [
286
- /* @__PURE__ */ e(
287
- "div",
288
- {
289
- className: s.closeBtn,
290
- onClick: () => {
291
- Z();
292
- },
293
- children: /* @__PURE__ */ e(
294
- D,
295
- {
296
- name: "close",
297
- size: "24"
298
- }
299
- )
300
- }
301
- ),
302
- /* @__PURE__ */ e("div", { className: s.modalTitle, children: "Фильтры" }),
303
- /* @__PURE__ */ v("div", { className: s.tabSWitcherWrapper, children: [
304
- /* @__PURE__ */ e("div", { className: s.switcherTitle, children: "Готовность" }),
305
- /* @__PURE__ */ e("div", { className: s.switcherScroll, children: /* @__PURE__ */ e(
306
- J,
307
- {
308
- variant: "grayRow",
309
- addClassName: s.tabs,
310
- isApart: !0,
311
- children: n == null ? void 0 : n.map((r, b) => {
312
- var F;
313
- const w = r.value;
314
- return /* @__PURE__ */ e(
315
- J.Item,
316
- {
317
- itemsLength: n == null ? void 0 : n.length,
318
- mini: !0,
319
- value: w,
320
- onClick: () => {
321
- },
322
- checked: ((F = W == null ? void 0 : W.find((E) => E.value === w)) == null ? void 0 : F.state) ?? !1,
323
- onChange: () => {
324
- f == null || f(
325
- (E) => E.map((L) => L.value === w ? { ...L, state: !L.state } : L)
326
- );
327
- },
328
- index: b,
329
- addItemClassName: s.tabSwitcher,
330
- children: w
331
- },
332
- b
333
- );
334
- })
335
- }
336
- ) })
337
- ] }),
338
- /* @__PURE__ */ e("div", { className: s.selectWrapper, children: a == null ? void 0 : a.map((r, b) => /* @__PURE__ */ e(
339
- st,
340
- {
341
- addClassName: s.filterOption,
342
- disabledOptions: [],
343
- clickableOptions: [],
344
- selectedOptions: I,
345
- option: r,
346
- handleOptionClick: U
347
- },
348
- b
349
- )) }),
350
- /* @__PURE__ */ v("div", { className: s.btnWrapper, children: [
351
- /* @__PURE__ */ e(
352
- T,
353
- {
354
- as: "button",
355
- variant: "gray",
356
- additionalClass: s.resetBtn,
357
- onClick: X,
358
- children: "Сбросить"
359
- }
360
- ),
361
- /* @__PURE__ */ e(
362
- T,
363
- {
364
- as: "button",
365
- additionalClass: s.saveBtn,
366
- onClick: tt,
367
- children: "Сохранить"
368
- }
369
- )
370
- ] })
371
- ] });
372
- return /* @__PURE__ */ v(P, { children: [
373
- /* @__PURE__ */ v("div", { style: { position: N ? "unset" : "relative" }, children: [
374
- /* @__PURE__ */ v(
375
- "div",
376
- {
377
- ref: h,
378
- className: s.root,
379
- onClick: () => {
380
- g && g(), N ? d((r) => !r) : O((r) => !r);
381
- },
382
- children: [
383
- /* @__PURE__ */ e("div", { className: s.btnName, children: k }),
384
- /* @__PURE__ */ e(
385
- D,
386
- {
387
- name: "filter",
388
- size: "16"
389
- }
390
- )
391
- ]
392
- }
393
- ),
394
- !N && /* @__PURE__ */ e(
395
- "div",
396
- {
397
- ref: h,
398
- className: Ft(s.desktopWrapper, { [s.desktopWrapperOpen]: u }),
399
- children: /* @__PURE__ */ e(z, {})
400
- }
401
- )
402
- ] }),
403
- N && /* @__PURE__ */ e(
404
- H,
405
- {
406
- isOpen: y,
407
- emitIsOpen: d,
408
- isTransparentBack: !0,
409
- additionalClassModalBody: s.modalAddBody,
410
- additionalClass: s.filterWithSaveModal,
411
- children: /* @__PURE__ */ e(z, {})
412
- }
413
- )
414
- ] });
415
- };
416
- export {
417
- me as F,
418
- J as S,
419
- Wt as a
420
- };