stone-kit 0.0.664 → 0.0.666

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,42 +1,42 @@
1
1
  const d = ({
2
2
  option: e,
3
3
  setSelectedOptions: y,
4
- selectedOptions: l,
5
- disabledOptions: u,
4
+ selectedOptions: f,
5
+ disabledOptions: s,
6
6
  onChange: c,
7
7
  mode: S,
8
- optionsParentArr: i
8
+ optionsParentArr: r
9
9
  }) => {
10
10
  if (!Array.isArray(e)) {
11
- if (u.includes(e))
11
+ if (s.includes(e))
12
12
  return;
13
- let f = l.some((r) => r.value === e.value) ? l.filter((r) => r.value !== e.value) : [...l, e];
13
+ let i = f.some((l) => l.value === e.value) ? f.filter((l) => l.value !== e.value) : [...f, e];
14
14
  if (S === "double") {
15
- "options" in e && l.map((t) => JSON.stringify(t)).includes(JSON.stringify(e)) && (f = f.filter((t) => !e.options.map((n) => JSON.stringify(n)).includes(JSON.stringify(t))));
16
- const r = i == null ? void 0 : i.filter((s) => "options" in s && s.options.includes(e))[0];
17
- !(r && l.map((s) => JSON.stringify(s)).includes(JSON.stringify(r))) && r && f.push(r);
15
+ "options" in e && (f.map((t) => JSON.stringify(t)).includes(JSON.stringify(e)) ? i = i.filter((t) => !e.options.map((a) => JSON.stringify(a)).includes(JSON.stringify(t))) : Array.isArray(e.options) && (i = [...i, ...e.options]));
16
+ const l = r == null ? void 0 : r.filter((u) => "options" in u && u.options.includes(e))[0];
17
+ !(l && f.map((u) => JSON.stringify(u)).includes(JSON.stringify(l))) && l && i.push(l);
18
18
  }
19
- y(f), c && c(f);
19
+ y(i), c && c(i);
20
20
  }
21
21
  }, m = ({
22
22
  option: e,
23
23
  setSelectedOptions: y,
24
- selectedOptions: l,
25
- disabledOptions: u,
24
+ selectedOptions: f,
25
+ disabledOptions: s,
26
26
  onChange: c
27
27
  }) => {
28
28
  if (Array.isArray(e)) {
29
- const S = e.filter((i) => !(u != null && u.includes(i)));
30
- if (S.every((i) => l.map((f) => f).includes(i))) {
31
- const i = l.filter(
32
- (f) => !e.includes(f)
29
+ const S = e.filter((r) => !(s != null && s.includes(r)));
30
+ if (S.every((r) => f.map((i) => i).includes(r))) {
31
+ const r = f.filter(
32
+ (i) => !e.includes(i)
33
33
  );
34
- y(i), c && c(i);
34
+ y(r), c && c(r);
35
35
  } else {
36
- const i = S.filter(
37
- (r) => !l.includes(r)
38
- ), f = [...l, ...i];
39
- y(f), c && c(f);
36
+ const r = S.filter(
37
+ (l) => !f.includes(l)
38
+ ), i = [...f, ...r];
39
+ y(i), c && c(i);
40
40
  }
41
41
  }
42
42
  };
@@ -1,18 +1,18 @@
1
- import { jsxs as c, Fragment as N, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as c, Fragment as N, jsx as i } from "react/jsx-runtime";
2
2
  import { s as t, O as S } from "../../../Option-C4HGcCtY.js";
3
3
  import { NewIcon as h } from "../../NewIcon/ui/NewIcon.js";
4
4
  import { c as b } from "../../../index-rKuIKazb.js";
5
5
  import { useState as w } from "react";
6
6
  const O = b.bind(t), D = ({
7
7
  category: o,
8
- selectedOptions: i,
8
+ selectedOptions: s,
9
9
  disabledOptions: m,
10
10
  clickableOptions: g,
11
11
  handleOptionClick: u,
12
- sizeIcon: r,
12
+ sizeIcon: n,
13
13
  mode: p
14
14
  }) => {
15
- const [n, d] = w(!0), v = i.map((e) => JSON.stringify(e)), l = p === "category", f = p === "double", C = l && o.options.every((e) => v.includes(JSON.stringify(e))), k = l ? C ? "minusCheck" : "selectUnchecked" : f && i.some((e) => e.value === o.value) ? "selectChecked" : "selectUnchecked";
15
+ const [r, d] = w(!0), v = s.map((e) => JSON.stringify(e)), l = p === "category", f = p === "double", C = l && o.options.every((e) => v.includes(JSON.stringify(e))), k = l ? C ? "minusCheck" : "selectUnchecked" : f && s.some((e) => e.value === o.value) ? "minusCheck" : "selectUnchecked";
16
16
  return /* @__PURE__ */ c(N, { children: [
17
17
  /* @__PURE__ */ c(
18
18
  "div",
@@ -22,47 +22,47 @@ const O = b.bind(t), D = ({
22
22
  t.category,
23
23
  t.optionClickable,
24
24
  {
25
- [t.selected]: i.some((e) => e.value === o.value),
25
+ [t.selected]: s.some((e) => e.value === o.value),
26
26
  [t.optionDisabled]: m.some(
27
27
  (e) => e.value === o.value
28
28
  )
29
29
  }
30
30
  ),
31
31
  onClick: () => {
32
- f && !n && d(!0), u(l ? o.options : o);
32
+ f && !r && d(!0), u(l ? o.options : o);
33
33
  },
34
34
  children: [
35
35
  /* @__PURE__ */ c("div", { className: t.leftSide, children: [
36
- /* @__PURE__ */ s(
36
+ /* @__PURE__ */ i(
37
37
  h,
38
38
  {
39
- size: r ?? "20",
39
+ size: n ?? "20",
40
40
  name: k
41
41
  }
42
42
  ),
43
- /* @__PURE__ */ s("div", { children: o.label })
43
+ /* @__PURE__ */ i("div", { children: o.label })
44
44
  ] }),
45
- /* @__PURE__ */ s("div", { className: t.iconArrow, onClick: (e) => {
45
+ /* @__PURE__ */ i("div", { className: t.iconArrow, onClick: (e) => {
46
46
  e.stopPropagation(), d((a) => !a);
47
- }, children: /* @__PURE__ */ s(
47
+ }, children: /* @__PURE__ */ i(
48
48
  h,
49
49
  {
50
50
  name: "arrowShort",
51
- deg: n ? "180" : "0",
52
- size: r ?? "24"
51
+ deg: r ? "180" : "0",
52
+ size: n ?? "24"
53
53
  }
54
54
  ) })
55
55
  ]
56
56
  }
57
57
  ),
58
- n && o.options.map((e, a) => /* @__PURE__ */ s(
58
+ r && o.options.map((e, a) => /* @__PURE__ */ i(
59
59
  S,
60
60
  {
61
61
  option: e,
62
62
  disabledOptions: m,
63
- selectedOptions: i,
63
+ selectedOptions: s,
64
64
  handleOptionClick: () => u(e),
65
- sizeIcon: r,
65
+ sizeIcon: n,
66
66
  clickableOptions: g,
67
67
  isOptionCategory: !0
68
68
  },
@@ -2,6 +2,7 @@ export type TOption = {
2
2
  value: string | number;
3
3
  label: string;
4
4
  parent?: string;
5
+ id?: number;
5
6
  };
6
7
  export type TCategory = {
7
8
  value: string | number;
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.664",
5
+ "version": "0.0.666",
6
6
  "author": "Mollycodd1e",
7
7
  "license": "ISC",
8
8
  "type": "module",