stone-kit 0.0.615 → 0.0.616

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