stone-kit 0.0.537 → 0.0.539

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