stone-kit 0.0.653 → 0.0.654

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.
@@ -1,12 +1,12 @@
1
- import { jsxs as m, Fragment as w, jsx as i } from "react/jsx-runtime";
2
- import { useState as A, useRef as D, useEffect as W } from "react";
1
+ import { jsxs as m, Fragment as R, jsx as i } from "react/jsx-runtime";
2
+ import { useState as w, useRef as D, useEffect as W } from "react";
3
3
  import { c as G } from "../../../index-rKuIKazb.js";
4
4
  import { s as e, O as H } from "../../../Option-a48eBPyn.js";
5
5
  import { NewIcon as j } from "../../NewIcon/ui/NewIcon.js";
6
6
  import { Category as J } from "./Category.js";
7
7
  import { handleClickModeOption as K, handleClickModeCategory as Q } from "../model/selectMode.js";
8
- const s = G.bind(e), ee = ({
9
- options: r,
8
+ const a = G.bind(e), ee = ({
9
+ options: t,
10
10
  placeholder: z = "Выберите опции",
11
11
  error: B,
12
12
  disabled: g,
@@ -18,63 +18,63 @@ const s = G.bind(e), ee = ({
18
18
  onBlur: u,
19
19
  selectedValues: c = [],
20
20
  isBtn: O = !1,
21
- btnName: C,
22
- clickableOptions: v,
21
+ btnName: y,
22
+ clickableOptions: C,
23
23
  isListRight: P = !1,
24
24
  sizeIcon: d,
25
- mode: a = "options",
26
- onClickItem: y,
25
+ mode: s = "options",
26
+ onClickItem: v,
27
27
  onCLickSelect: N,
28
28
  size_s: S = "large",
29
29
  size_m: k,
30
30
  size_l: $
31
31
  }) => {
32
- r = [.../* @__PURE__ */ new Set([...r])];
33
- const [l, x] = A(c), [o, p] = A(!1), h = D(null), E = (t) => {
34
- y && y(t);
32
+ t = Array.isArray(t) ? [.../* @__PURE__ */ new Set([...t])] : [];
33
+ const [l, x] = w(c), [o, h] = w(!1), p = D(null), A = (r) => {
34
+ v && v(r);
35
35
  const n = {
36
- option: t,
36
+ option: r,
37
37
  selectedOptions: l,
38
38
  disabledOptions: f,
39
39
  setSelectedOptions: x,
40
40
  onChange: F,
41
- mode: a,
42
- optionsParentArr: r
41
+ mode: s,
42
+ optionsParentArr: t
43
43
  };
44
- Array.isArray(t) ? Q(n) : K(n);
44
+ Array.isArray(r) ? Q(n) : K(n);
45
45
  }, _ = () => {
46
46
  u && u(l);
47
47
  };
48
48
  W(() => {
49
- const t = (n) => {
49
+ const r = (n) => {
50
50
  const q = n.target;
51
- if (h.current && !h.current.contains(n.target)) {
51
+ if (p.current && !p.current.contains(n.target)) {
52
52
  if (q.closest("svg"))
53
53
  return;
54
- p(!1);
54
+ h(!1);
55
55
  }
56
56
  };
57
- return document.addEventListener("click", t), () => {
58
- document.removeEventListener("click", t);
57
+ return document.addEventListener("click", r), () => {
58
+ document.removeEventListener("click", r);
59
59
  };
60
60
  }, []);
61
- const R = D(c);
61
+ const E = D(c);
62
62
  return W(() => {
63
- c.length !== R.current.length && (x(c), R.current = c);
63
+ c.length !== E.current.length && (x(c), E.current = c);
64
64
  }, [c]), /* @__PURE__ */ m(
65
65
  "div",
66
66
  {
67
- ref: h,
68
- className: s(e.multiSelectWrapper, { [e.multiSelectWrapperError]: B }, L),
67
+ ref: p,
68
+ className: a(e.multiSelectWrapper, { [e.multiSelectWrapperError]: B }, L),
69
69
  tabIndex: 0,
70
70
  onBlur: _,
71
71
  children: [
72
- /* @__PURE__ */ m("div", { className: s(e.inputWrapper), children: [
73
- !O && /* @__PURE__ */ m(w, { children: [
72
+ /* @__PURE__ */ m("div", { className: a(e.inputWrapper), children: [
73
+ !O && /* @__PURE__ */ m(R, { children: [
74
74
  /* @__PURE__ */ i(
75
75
  "div",
76
76
  {
77
- className: s(
77
+ className: a(
78
78
  e.selectedOptions,
79
79
  e[`${S}-size`],
80
80
  e[`${k}-size_m`],
@@ -82,7 +82,7 @@ const s = G.bind(e), ee = ({
82
82
  { [e.selectedOptionsNotEmpty]: l.length > 0 },
83
83
  { [e.selectOptionsDisabled]: g }
84
84
  ),
85
- onClick: () => p(!o),
85
+ onClick: () => h(!o),
86
86
  children: l.length === 0 ? z : "Выбрано " + l.length
87
87
  }
88
88
  ),
@@ -96,11 +96,11 @@ const s = G.bind(e), ee = ({
96
96
  }
97
97
  )
98
98
  ] }),
99
- O && /* @__PURE__ */ m(w, { children: [
99
+ O && /* @__PURE__ */ m(R, { children: [
100
100
  /* @__PURE__ */ i(
101
101
  "button",
102
102
  {
103
- className: s(
103
+ className: a(
104
104
  e.selectedOptions,
105
105
  e[`${S}-size`],
106
106
  e[`${k}-size_m`],
@@ -110,9 +110,9 @@ const s = G.bind(e), ee = ({
110
110
  b
111
111
  ),
112
112
  onClick: () => {
113
- N && N(), p(!o);
113
+ N && N(), h(!o);
114
114
  },
115
- children: C
115
+ children: y
116
116
  }
117
117
  ),
118
118
  /* @__PURE__ */ i(
@@ -121,36 +121,36 @@ const s = G.bind(e), ee = ({
121
121
  name: "filter",
122
122
  deg: o ? "180" : "0",
123
123
  size: d ?? "24",
124
- additionalClass: s(e.icon, { [e.iconBtn]: !C })
124
+ additionalClass: a(e.icon, { [e.iconBtn]: !y })
125
125
  }
126
126
  )
127
127
  ] })
128
128
  ] }),
129
- o && /* @__PURE__ */ m("div", { className: s(e.optionsList, { [e.listRight]: P }, M), children: [
130
- a === "options" && (r == null ? void 0 : r.map((t, n) => /* @__PURE__ */ i(
129
+ o && /* @__PURE__ */ m("div", { className: a(e.optionsList, { [e.listRight]: P }, M), children: [
130
+ s === "options" && (t == null ? void 0 : t.map((r, n) => /* @__PURE__ */ i(
131
131
  H,
132
132
  {
133
133
  disabledOptions: f,
134
- clickableOptions: v,
134
+ clickableOptions: C,
135
135
  selectedOptions: l,
136
136
  sizeIcon: d,
137
- option: t,
138
- handleOptionClick: E
137
+ option: r,
138
+ handleOptionClick: A
139
139
  },
140
140
  n
141
141
  ))),
142
- (a === "category" || a === "double") && (r == null ? void 0 : r.map(
143
- (t, n) => "options" in t ? /* @__PURE__ */ i(
142
+ (s === "category" || s === "double") && (t == null ? void 0 : t.map(
143
+ (r, n) => "options" in r ? /* @__PURE__ */ i(
144
144
  J,
145
145
  {
146
146
  disabledOptions: f,
147
- clickableOptions: v,
147
+ clickableOptions: C,
148
148
  selectedOptions: l,
149
149
  sizeIcon: d,
150
- category: t,
151
- mode: a,
150
+ category: r,
151
+ mode: s,
152
152
  selectedValues: c,
153
- handleOptionClick: E
153
+ handleOptionClick: A
154
154
  },
155
155
  n
156
156
  ) : null
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.653",
5
+ "version": "0.0.654",
6
6
  "author": "Mollycodd1e",
7
7
  "license": "ISC",
8
8
  "type": "module",