@wikicasa-dev/components 2.0.28 → 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/BaseTabView.vue_vue_type_script_setup_true_lang.Ar2KNVYH.js";
1
+ import { _ as f } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.DjAQCt5a.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -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;
@@ -4,6 +4,7 @@ declare let __VLS_typeProps: {
4
4
  tabsPosition?: "top" | "bottom";
5
5
  tabViewDescription: string;
6
6
  tabListClasses?: ClassType;
7
+ dataCy?: string;
7
8
  };
8
9
  type __VLS_PublicProps = {
9
10
  "activeIdx"?: number | undefined;
@@ -20,8 +21,5 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
20
21
  tabElement: TabType;
21
22
  }) => any) | undefined;
22
23
  "onUpdate:activeIdx"?: ((activeIdx: number | undefined) => any) | undefined;
23
- }>, {
24
- tabListClasses: ClassType;
25
- tabsPosition: "top" | "bottom";
26
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
27
25
  export default _default;
@@ -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;
@@ -1,40 +1,41 @@
1
- import { defineComponent as E, mergeModels as y, useModel as M, ref as u, useId as N, useSlots as S, computed as z, provide as b, watch as k, openBlock as n, createElementBlock as C, normalizeClass as I, createElementVNode as j, unref as p, toDisplayString as q, createBlock as o, createCommentVNode as v, Fragment as G, renderList as H, withCtx as J, resolveDynamicComponent as K } from "vue";
1
+ import { defineComponent as E, mergeModels as T, useModel as M, ref as u, useId as N, useSlots as S, computed as z, provide as b, watch as C, openBlock as l, createElementBlock as k, normalizeClass as _, createElementVNode as j, unref as p, toDisplayString as q, createBlock as o, createCommentVNode as v, Fragment as G, renderList as H, withCtx as J, resolveDynamicComponent as K } from "vue";
2
2
  import { _ as O } from "./BaseTabPanel.vue_vue_type_script_setup_true_lang.DoZHWHt1.js";
3
- import { _ } from "./BaseTabList.vue_vue_type_script_setup_true_lang.CohlLou1.js";
4
- const Q = ["id"], Z = /* @__PURE__ */ E({
3
+ import { _ as I } from "./BaseTabList.vue_vue_type_script_setup_true_lang.CohlLou1.js";
4
+ const Q = ["data-cy"], R = ["id"], ee = /* @__PURE__ */ E({
5
5
  inheritAttrs: !1,
6
6
  __name: "BaseTabView",
7
- props: /* @__PURE__ */ y({
7
+ props: /* @__PURE__ */ T({
8
8
  tabsPosition: { default: "top" },
9
9
  tabViewDescription: {},
10
- tabListClasses: { default: "" }
10
+ tabListClasses: {},
11
+ dataCy: {}
11
12
  }, {
12
13
  activeIdx: { default: 0 },
13
14
  activeIdxModifiers: {}
14
15
  }),
15
- emits: /* @__PURE__ */ y(["tabClicked"], ["update:activeIdx"]),
16
+ emits: /* @__PURE__ */ T(["tabClicked"], ["update:activeIdx"]),
16
17
  setup(g, { emit: P }) {
17
- const B = P, r = M(g, "activeIdx"), $ = u(""), d = u(null), x = u(null), i = N(), f = S(), c = (e) => e.props ?? null, m = (e) => e.type.__name === "BaseTab", h = (e, a) => ({
18
+ const B = P, r = M(g, "activeIdx"), $ = u(""), d = u(null), A = u(null), i = N(), f = S(), c = (e) => e.props ?? null, m = (e) => e.type.__name === "BaseTab", h = (e, a) => ({
18
19
  renderFn: e,
19
- tabId: T(a),
20
+ tabId: y(a),
20
21
  "active-tab-panel-idx": c(e)?.["active-tab-panel-idx"] ?? a,
21
22
  "header-title": c(e)?.["header-title"] || "",
22
23
  class: c(e)?.class || "",
23
24
  "tab-panel-classes": c(e)?.["tab-panel-classes"] || "",
24
25
  "data-cy": c(e)?.["data-cy"] || ""
25
- }), l = z(() => f.default ? f.default().reduce((e, a) => (a.children && Array.isArray(a.children) ? a.children.forEach((t) => {
26
+ }), n = z(() => f.default ? f.default().reduce((e, a) => (a.children && Array.isArray(a.children) ? a.children.forEach((t) => {
26
27
  m(t) && e.push(h(t, e.length));
27
28
  }) : m(a) && e.push(h(a, e.length)), e), []) : []);
28
- b("tabs", l), b("isTabActive", (e) => r.value === e);
29
- const A = (e) => d.value === e, T = (e) => `base-tab-${e}-${i}`, F = (e) => `base-tab-panel-${e}-${i}`, V = (e) => l.value.find((a) => a["active-tab-panel-idx"] === e)?.tabId, w = (e) => {
30
- $.value = T(e);
29
+ b("tabs", n), b("isTabActive", (e) => r.value === e);
30
+ const x = (e) => d.value === e, y = (e) => `base-tab-${e}-${i}`, F = (e) => `base-tab-panel-${e}-${i}`, V = (e) => n.value.find((a) => a["active-tab-panel-idx"] === e)?.tabId, w = (e) => {
31
+ $.value = y(e);
31
32
  }, D = (e) => {
32
- const a = l.value.at(e ?? -1);
33
+ const a = n.value.at(e ?? -1);
33
34
  d.value = a?.["active-tab-panel-idx"] ?? null;
34
35
  };
35
36
  b("handleClick", (e, a) => {
36
37
  w(e), r.value = e, B("tabClicked", { tabIdx: e, tabElement: a });
37
- }), k(
38
+ }), C(
38
39
  r,
39
40
  (e) => {
40
41
  D(e ?? -1);
@@ -48,48 +49,49 @@ const Q = ["id"], Z = /* @__PURE__ */ E({
48
49
  if (e[t] !== a[t]) return t;
49
50
  return null;
50
51
  };
51
- return k(
52
- () => l.value.map((e) => e["active-tab-panel-idx"]),
52
+ return C(
53
+ () => n.value.map((e) => e["active-tab-panel-idx"]),
53
54
  (e, a) => {
54
55
  const t = L(e, a);
55
56
  if (t === null) return;
56
- const s = l.value[t]["active-tab-panel-idx"];
57
+ const s = n.value[t]["active-tab-panel-idx"];
57
58
  r.value !== t || s === void 0 || (d.value = s);
58
59
  }
59
- ), (e, a) => (n(), C("div", {
60
+ ), (e, a) => (l(), k("div", {
60
61
  ref_key: "root",
61
- ref: x,
62
- class: I(e.$attrs.class)
62
+ ref: A,
63
+ class: _(e.$attrs.class),
64
+ "data-cy": e.dataCy
63
65
  }, [
64
66
  j("span", {
65
67
  id: `tablist-${p(i)}`,
66
68
  class: "uikit-sr-only"
67
- }, q(e.tabViewDescription), 9, Q),
68
- e.tabsPosition === "top" ? (n(), o(_, {
69
+ }, q(e.tabViewDescription), 9, R),
70
+ e.tabsPosition === "top" ? (l(), o(I, {
69
71
  key: 0,
70
72
  uid: p(i),
71
73
  "tab-list-classes": e.tabListClasses
72
74
  }, null, 8, ["uid", "tab-list-classes"])) : v("", !0),
73
- (n(!0), C(G, null, H(l.value, (t, s) => (n(), o(O, {
75
+ (l(!0), k(G, null, H(n.value, (t, s) => (l(), o(O, {
74
76
  id: F(s),
75
77
  key: s,
76
78
  "labelled-by": V(s) || "",
77
- active: A(s),
78
- class: I(t["tab-panel-classes"])
79
+ active: x(s),
80
+ class: _(t["tab-panel-classes"])
79
81
  }, {
80
82
  default: J(() => [
81
- t.renderFn.children && t.renderFn.children.default ? (n(), o(K(t.renderFn.children.default), { key: 0 })) : v("", !0)
83
+ t.renderFn.children && t.renderFn.children.default ? (l(), o(K(t.renderFn.children.default), { key: 0 })) : v("", !0)
82
84
  ]),
83
85
  _: 2
84
86
  }, 1032, ["id", "labelled-by", "active", "class"]))), 128)),
85
- e.tabsPosition === "bottom" ? (n(), o(_, {
87
+ e.tabsPosition === "bottom" ? (l(), o(I, {
86
88
  key: 1,
87
89
  uid: p(i),
88
90
  "tab-list-classes": e.tabListClasses
89
91
  }, null, 8, ["uid", "tab-list-classes"])) : v("", !0)
90
- ], 2));
92
+ ], 10, Q));
91
93
  }
92
94
  });
93
95
  export {
94
- Z as _
96
+ ee as _
95
97
  };
@@ -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,9 +4,9 @@ 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
- import { _ as S } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.Ar2KNVYH.js";
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";
11
11
  import { _ as h } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.DdmSUyxZ.js";
12
12
  import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.ClV6kObA.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.0.28",
3
+ "version": "2.0.30",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",