stone-kit 0.0.474 → 0.0.475

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,135 +1,136 @@
1
- import { jsxs as r, Fragment as C, jsx as n } from "react/jsx-runtime";
2
- import { memo as F, useState as D, useRef as W, useCallback as f, useEffect as E } from "react";
3
- import { c as U } from "../../../index-rKuIKazb.js";
4
- import { NewIcon as h } from "../../NewIcon/ui/NewIcon.js";
5
- const $ = "_multiSelectWrapper_11it8_1", q = "_selectedOptions_11it8_8", A = "_selectedOptionsBtn_11it8_27", G = "_selectedOptionsOpened_11it8_31", H = "_selectedOptionsNotEmpty_11it8_35", J = "_selectOptionsDisabled_11it8_40", K = "_optionsList_11it8_47", M = "_listRight_11it8_63", P = "_inputWrapper_11it8_67", Q = "_option_11it8_47", T = "_optionDisabled_11it8_88", X = "_optionClickable_11it8_92", Y = "_icon_11it8_96", e = {
6
- multiSelectWrapper: $,
7
- selectedOptions: q,
8
- selectedOptionsBtn: A,
9
- selectedOptionsOpened: G,
10
- selectedOptionsNotEmpty: H,
11
- selectOptionsDisabled: J,
12
- optionsList: K,
13
- listRight: M,
14
- inputWrapper: P,
15
- option: Q,
16
- optionDisabled: T,
17
- optionClickable: X,
18
- icon: Y
19
- }, c = U.bind(e), Z = ({
1
+ import { jsxs as r, Fragment as D, jsx as n } from "react/jsx-runtime";
2
+ import { memo as U, useState as W, useRef as E, useCallback as h, useEffect as R } from "react";
3
+ import { c as $ } from "../../../index-rKuIKazb.js";
4
+ import { NewIcon as b } from "../../NewIcon/ui/NewIcon.js";
5
+ const q = "_multiSelectWrapper_11it8_1", A = "_selectedOptions_11it8_8", G = "_selectedOptionsBtn_11it8_27", H = "_selectedOptionsOpened_11it8_31", J = "_selectedOptionsNotEmpty_11it8_35", K = "_selectOptionsDisabled_11it8_40", M = "_optionsList_11it8_47", P = "_listRight_11it8_63", Q = "_inputWrapper_11it8_67", T = "_option_11it8_47", X = "_optionDisabled_11it8_88", Y = "_optionClickable_11it8_92", Z = "_icon_11it8_96", e = {
6
+ multiSelectWrapper: q,
7
+ selectedOptions: A,
8
+ selectedOptionsBtn: G,
9
+ selectedOptionsOpened: H,
10
+ selectedOptionsNotEmpty: J,
11
+ selectOptionsDisabled: K,
12
+ optionsList: M,
13
+ listRight: P,
14
+ inputWrapper: Q,
15
+ option: T,
16
+ optionDisabled: X,
17
+ optionClickable: Y,
18
+ icon: Z
19
+ }, c = $.bind(e), V = ({
20
20
  options: p,
21
- placeholder: R = "Выберите опции",
22
- error: L,
23
- disabled: b,
24
- disabledOptions: g = [],
25
- additionalClass: x = "",
26
- additionalClassOption: y,
27
- additionalClassBtn: w,
21
+ placeholder: L = "Выберите опции",
22
+ error: x,
23
+ disabled: g,
24
+ disabledOptions: k = [],
25
+ additionalClass: y = "",
26
+ additionalClassOption: w,
27
+ additionalClassBtn: j,
28
28
  onChange: d,
29
29
  onBlur: m,
30
30
  selectedValues: l = [],
31
31
  isBtn: _ = !1,
32
- btnName: z,
33
- clickableOptions: k,
34
- isListRight: I = !1
32
+ btnName: B,
33
+ clickableOptions: N,
34
+ isListRight: z = !1,
35
+ sizeIcon: u
35
36
  }) => {
36
- const [s, N] = D(l), [o, u] = D(!1), O = W(null), j = f(
37
+ const [s, S] = W(l), [o, O] = W(!1), v = E(null), F = h(
37
38
  (t) => () => {
38
- if (g.some((a) => a.value === t.value))
39
+ if (k.some((a) => a.value === t.value))
39
40
  return;
40
41
  const i = s.some((a) => a.value === t.value) ? s.filter((a) => a.value !== t.value) : [...s, t];
41
- N(i), d && d(i);
42
+ S(i), d && d(i);
42
43
  },
43
44
  [s, d]
44
- ), v = f((t) => {
45
- if (O.current && !O.current.contains(t.target)) {
45
+ ), f = h((t) => {
46
+ if (v.current && !v.current.contains(t.target)) {
46
47
  if (t.target.closest("svg"))
47
48
  return;
48
- u(!1);
49
+ O(!1);
49
50
  }
50
- }, []), B = f(() => {
51
+ }, []), I = h(() => {
51
52
  m && m(s);
52
53
  }, [s, m]);
53
- E(() => (document.addEventListener("click", v), () => {
54
- document.removeEventListener("click", v);
55
- }), [v]);
56
- const S = W(l);
57
- return E(() => {
58
- l.length !== S.current.length && (N(l), S.current = l);
54
+ R(() => (document.addEventListener("click", f), () => {
55
+ document.removeEventListener("click", f);
56
+ }), [f]);
57
+ const C = E(l);
58
+ return R(() => {
59
+ l.length !== C.current.length && (S(l), C.current = l);
59
60
  }, [l]), /* @__PURE__ */ r(
60
61
  "div",
61
62
  {
62
- ref: O,
63
- className: c(e.multiSelectWrapper, { [e.multiSelectWrapperError]: L }, x),
63
+ ref: v,
64
+ className: c(e.multiSelectWrapper, { [e.multiSelectWrapperError]: x }, y),
64
65
  tabIndex: 0,
65
- onBlur: B,
66
+ onBlur: I,
66
67
  children: [
67
68
  /* @__PURE__ */ r("div", { className: c(e.inputWrapper), children: [
68
- !_ && /* @__PURE__ */ r(C, { children: [
69
+ !_ && /* @__PURE__ */ r(D, { children: [
69
70
  /* @__PURE__ */ n(
70
71
  "div",
71
72
  {
72
73
  className: c(
73
74
  e.selectedOptions,
74
75
  { [e.selectedOptionsNotEmpty]: s.length > 0 },
75
- { [e.selectOptionsDisabled]: b }
76
+ { [e.selectOptionsDisabled]: g }
76
77
  ),
77
- onClick: () => u(!o),
78
- children: s.length === 0 ? R : "Выбрано " + s.length
78
+ onClick: () => O(!o),
79
+ children: s.length === 0 ? L : "Выбрано " + s.length
79
80
  }
80
81
  ),
81
82
  /* @__PURE__ */ n(
82
- h,
83
+ b,
83
84
  {
84
85
  name: "arrowShort",
85
86
  deg: o ? "180" : "0",
86
- size: "24",
87
+ size: u ?? "24",
87
88
  additionalClass: e.icon
88
89
  }
89
90
  )
90
91
  ] }),
91
- _ && /* @__PURE__ */ r(C, { children: [
92
+ _ && /* @__PURE__ */ r(D, { children: [
92
93
  /* @__PURE__ */ n(
93
94
  "button",
94
95
  {
95
96
  className: c(
96
97
  e.selectedOptions,
97
98
  e.selectedOptionsBtn,
98
- { [e.selectOptionsDisabled]: b },
99
- w
99
+ { [e.selectOptionsDisabled]: g },
100
+ j
100
101
  ),
101
- onClick: () => u(!o),
102
- children: z
102
+ onClick: () => O(!o),
103
+ children: B
103
104
  }
104
105
  ),
105
106
  /* @__PURE__ */ n(
106
- h,
107
+ b,
107
108
  {
108
109
  name: "filter",
109
110
  deg: o ? "180" : "0",
110
- size: "24",
111
+ size: u ?? "24",
111
112
  additionalClass: e.icon
112
113
  }
113
114
  )
114
115
  ] })
115
116
  ] }),
116
- o && /* @__PURE__ */ n("div", { className: c(e.optionsList, { [e.listRight]: I }, y), children: p == null ? void 0 : p.map((t) => /* @__PURE__ */ r(
117
+ o && /* @__PURE__ */ n("div", { className: c(e.optionsList, { [e.listRight]: z }, w), children: p == null ? void 0 : p.map((t) => /* @__PURE__ */ r(
117
118
  "div",
118
119
  {
119
120
  className: c(e.option, {
120
121
  [e.selected]: s.some((i) => i.value === t.value),
121
- [e.optionDisabled]: g.some(
122
+ [e.optionDisabled]: k.some(
122
123
  (i) => i.value === t.value
123
124
  ),
124
- [e.optionClickable]: k && k.includes(`${t.value}`) || _
125
+ [e.optionClickable]: N && N.includes(`${t.value}`) || _
125
126
  }),
126
- onClick: j(t),
127
+ onClick: F(t),
127
128
  children: [
128
129
  /* @__PURE__ */ n("div", { children: t.label }),
129
130
  /* @__PURE__ */ n(
130
- h,
131
+ b,
131
132
  {
132
- size: "20",
133
+ size: u ?? "20",
133
134
  name: s.some((i) => i.value === t.value) ? "selectChecked" : "selectUnchecked"
134
135
  }
135
136
  )
@@ -140,8 +141,8 @@ const $ = "_multiSelectWrapper_11it8_1", q = "_selectedOptions_11it8_8", A = "_s
140
141
  ]
141
142
  }
142
143
  );
143
- }, V = F(Z);
144
- V.displayName = "Select";
144
+ }, ee = U(V);
145
+ ee.displayName = "Select";
145
146
  export {
146
- V as Select
147
+ ee as Select
147
148
  };
@@ -20,4 +20,5 @@ export interface MultiSelectProps {
20
20
  isListRight?: boolean;
21
21
  disabledOptions?: Option[];
22
22
  clickableOptions?: (string | undefined)[];
23
+ sizeIcon?: string;
23
24
  }
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.474",
5
+ "version": "0.0.475",
6
6
  "author": "Mollycodd1e",
7
7
  "license": "ISC",
8
8
  "type": "module",