stone-kit 0.0.536 → 0.0.538

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