@wikicasa-dev/components 2.0.29 → 2.0.30

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,4 +1,4 @@
1
- import { _ as f } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.C1NwpE7V.js";
1
+ import { _ as f } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.Cf8YnCGf.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -57,8 +57,8 @@ declare const __VLS_component: import('vue').DefineComponent<{
57
57
  onClick?: (() => any) | undefined;
58
58
  "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
59
59
  }>, {
60
- arrowWidth: number;
61
60
  dataCy: string;
61
+ arrowWidth: number;
62
62
  btnClasses: string;
63
63
  labelClasses: ClassType;
64
64
  dropdownClasses: ClassType;
@@ -31,6 +31,7 @@ export type CheckboxButtonType<T = string | number, T1 = string | number, T2 = u
31
31
  checked?: boolean;
32
32
  reset?: boolean;
33
33
  payload?: T2;
34
+ dataCy?: string;
34
35
  };
35
36
  export type CheckboxButtonTypeObj = Omit<CheckboxButtonType, "checked"> & {
36
37
  checked: boolean;
@@ -21,12 +21,12 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
21
21
  dataCy: { default: "" }
22
22
  },
23
23
  emits: ["resetted", "update:modelValue", "checkedGroup"],
24
- setup(a, { emit: g }) {
25
- const o = a, s = g, l = x(/* @__PURE__ */ new Map()), r = i(() => {
26
- for (const e of o.checkboxData)
24
+ setup(a, { emit: C }) {
25
+ const c = a, s = C, l = x(/* @__PURE__ */ new Map()), r = i(() => {
26
+ for (const e of c.checkboxData)
27
27
  if (e.reset) return e;
28
28
  return null;
29
- }), C = i(() => o.checkboxData.length), f = i(() => {
29
+ }), g = i(() => c.checkboxData.length), f = i(() => {
30
30
  let e = 0;
31
31
  return l.value.forEach((t) => {
32
32
  t.checked && e++;
@@ -34,7 +34,7 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
34
34
  });
35
35
  (() => {
36
36
  const e = [];
37
- for (const t of o.checkboxData)
37
+ for (const t of c.checkboxData)
38
38
  t.checked = !!t.checked, l.value.set(
39
39
  `${t.id}`,
40
40
  t
@@ -42,13 +42,13 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
42
42
  s("update:modelValue", e);
43
43
  })();
44
44
  const u = (e, t) => {
45
- const c = l.value.get(e);
46
- if (c) {
45
+ const o = l.value.get(e);
46
+ if (o) {
47
47
  if (t) {
48
- l.value.set(e, { ...c, ...t });
48
+ l.value.set(e, { ...o, ...t });
49
49
  return;
50
50
  }
51
- l.value.set(e, { ...c, checked: !c.checked });
51
+ l.value.set(e, { ...o, checked: !o.checked });
52
52
  }
53
53
  }, k = () => {
54
54
  l.value.forEach((e) => {
@@ -56,19 +56,19 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
56
56
  });
57
57
  }, p = () => {
58
58
  k(), s("update:modelValue", []), s("resetted");
59
- }, d = (e) => l.value.get(o.getKey(e))?.checked ?? !1, h = (e) => {
60
- if (w(o.checkboxData)) return;
59
+ }, d = (e) => l.value.get(c.getKey(e))?.checked ?? !1, h = (e) => {
60
+ if (w(c.checkboxData)) return;
61
61
  const t = l.value.get(e.id);
62
- t?.reset && e.checked ? k() : r.value && !t?.reset && u(o.getKey(r.value), { checked: !1 }), u(`${e.id}`), o.autoCheckResetAll && r.value && f.value === C.value - 1 && l.value.forEach((n) => {
62
+ t?.reset && e.checked ? k() : r.value && !t?.reset && u(c.getKey(r.value), { checked: !1 }), u(`${e.id}`), c.autoCheckResetAll && r.value && f.value === g.value - 1 && l.value.forEach((n) => {
63
63
  n.checked = !!n.reset;
64
- }), o.autoCheckResetEmpty && r.value && !f.value && (!o.manualToggleResetButton || !t?.reset) && u(o.getKey(r.value), { checked: !0 });
65
- const c = [];
64
+ }), c.autoCheckResetEmpty && r.value && !f.value && (!c.manualToggleResetButton || !t?.reset) && u(c.getKey(r.value), { checked: !0 });
65
+ const o = [];
66
66
  l.value.forEach((n) => {
67
- n.checked && c.push(n);
68
- }), s("update:modelValue", c), s("checkedGroup", o.groupId);
67
+ n.checked && o.push(n);
68
+ }), s("update:modelValue", o), s("checkedGroup", c.groupId);
69
69
  };
70
70
  return D(
71
- () => o.reset,
71
+ () => c.reset,
72
72
  (e) => {
73
73
  e && p();
74
74
  }
@@ -88,13 +88,13 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
88
88
  checkboxesData: e.checkboxData,
89
89
  reset: p
90
90
  }, () => [
91
- e.checkboxData ? (b(!0), B(I, { key: 0 }, R(e.checkboxData, (c, n, y) => (b(), A(V, {
92
- id: e.getKey(c),
91
+ e.checkboxData ? (b(!0), B(I, { key: 0 }, R(e.checkboxData, (o, n, y) => (b(), A(V, {
92
+ id: e.getKey(o),
93
93
  key: y,
94
- "data-cy": `checkbox_${K(G)(`${c.label}`)}`,
95
- label: c.label,
94
+ "data-cy": o.dataCy ?? `checkbox_${K(G)(`${o.label}`)}`,
95
+ label: o.label,
96
96
  inline: e.formCheckInline,
97
- "model-value": d(c),
97
+ "model-value": d(o),
98
98
  "container-class": [
99
99
  e.formCheckInline ? "uikit-mr-10px" : "uikit-mb-10px",
100
100
  e.checkboxContainerClasses
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { _ as f } from "./chunks/BaseAccordionContent.vue_vue_type_script_setup_
4
4
  import { _ as m } from "./chunks/BaseAccordionItem.vue_vue_type_script_setup_true_lang.Caagpb9M.js";
5
5
  import { _ as l } from "./chunks/SelectItem.vue_vue_type_script_setup_true_lang.GPFf7fjA.js";
6
6
  import { default as d } from "./CheckboxBtn.js";
7
- import { _ as u } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.C1NwpE7V.js";
7
+ import { _ as u } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.Cf8YnCGf.js";
8
8
  import { _ } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.Cu67jd8K.js";
9
9
  import { _ as S } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.DjAQCt5a.js";
10
10
  import { _ as g } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.CiJAhkRj.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.0.29",
3
+ "version": "2.0.30",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",