@wikicasa-dev/components 2.0.23 → 2.0.25

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/BaseAutocomplete.vue_vue_type_script_setup_true_lang.CCR6X0si.js";
1
+ import { _ as f } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.D21vozEO.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.JlHKkjHJ.js";
1
+ import { _ as f } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.C1NwpE7V.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.BalzO73O.js";
1
+ import { _ as f } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.DdmSUyxZ.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -26,6 +26,7 @@ declare const _default: <T, LabelID extends string | number | undefined>(__VLS_p
26
26
  closeDropdownOnBodyPressed?: boolean;
27
27
  inputClasses?: ClassTypeProp;
28
28
  fieldsetClasses?: ClassTypeProp;
29
+ dataCy?: string;
29
30
  })> & import('vue').PublicProps;
30
31
  expose(exposed: import('vue').ShallowUnwrapRef<{
31
32
  select: () => void;
@@ -8,10 +8,10 @@ function Q(t, p) {
8
8
  return (...v) => new Promise((d, u) => {
9
9
  t.id && clearTimeout(t.id), t.id = setTimeout(() => {
10
10
  try {
11
- const a = p(...v);
12
- d(a);
13
- } catch (a) {
14
- u(a);
11
+ const i = p(...v);
12
+ d(i);
13
+ } catch (i) {
14
+ u(i);
15
15
  }
16
16
  }, t.delay);
17
17
  });
@@ -30,7 +30,8 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
30
30
  dropdownClasses: { default: "" },
31
31
  closeDropdownOnBodyPressed: { type: Boolean, default: !0 },
32
32
  inputClasses: {},
33
- fieldsetClasses: {}
33
+ fieldsetClasses: {},
34
+ dataCy: { default: "" }
34
35
  }, {
35
36
  modelValue: {
36
37
  default() {
@@ -44,7 +45,7 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
44
45
  const d = L(
45
46
  t,
46
47
  "modelValue"
47
- ), u = v, a = r(""), n = r([]), m = r(null), c = r(!1), o = r(!1), y = r(null), B = k(() => n.value.length);
48
+ ), u = v, i = r(""), n = r([]), m = r(null), c = r(!1), o = r(!1), y = r(null), B = k(() => n.value.length);
48
49
  F(() => {
49
50
  m.value = Q({ delay: 300 }, t.onInputChangeCb);
50
51
  });
@@ -87,7 +88,7 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
87
88
  return "";
88
89
  }
89
90
  }), P = async (e) => {
90
- if (a.value !== e && (u("changedValue", e), a.value = e, !!t.onInputChangeCb)) {
91
+ if (i.value !== e && (u("changedValue", e), i.value = e, !!t.onInputChangeCb)) {
91
92
  if (!e || c.value) {
92
93
  n.value = [], c.value = !1, w.value = -1, h.value = -1, d.value && (d.value.label = ""), o.value = !1, await m.value(null);
93
94
  return;
@@ -95,14 +96,14 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
95
96
  t.disableCb || (n.value = await m.value(e), o.value = !!n.value.length);
96
97
  }
97
98
  }, g = (e, l) => {
98
- t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (n.value = []), c.value = !0, a.value = e.label, d.value = e, o.value = !1, w.value = l;
99
+ t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (n.value = []), c.value = !0, i.value = e.label, d.value = e, o.value = !1, w.value = l;
99
100
  }, D = () => {
100
101
  n.value.length && t.keepState !== "closed" && (o.value = !0);
101
102
  };
102
103
  return f(
103
104
  d,
104
105
  (e, l) => {
105
- e === l || e?.label === a.value || (a.value = e?.label || "");
106
+ e === l || e?.label === i.value || (i.value = e?.label || "");
106
107
  },
107
108
  { immediate: !0 }
108
109
  ), f(w, (e) => {
@@ -122,7 +123,7 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
122
123
  }
123
124
  }), (e, l) => (C(), S(q, {
124
125
  class: H(e.$attrs["root-classes"]),
125
- "data-cy": `ac_${e.$attrs.id}`,
126
+ "data-cy": e.dataCy ? e.dataCy : `ac_${e.$attrs.id}`,
126
127
  "dropdown-element": "ul",
127
128
  "dropdown-classes": [
128
129
  { "bordered-dropdown": e.theme === "bordered" },
@@ -139,8 +140,8 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
139
140
  "keep-state": !n.value.length || e.keepState === "closed" ? "closed" : "opened",
140
141
  "close-when-clicked-outside": e.closeDropdownOnBodyPressed,
141
142
  "activate-keyboard-controller": !1,
142
- "onUpdate:dropdownState": l[3] || (l[3] = (i) => o.value = i),
143
- onClick: l[4] || (l[4] = (i) => {
143
+ "onUpdate:dropdownState": l[3] || (l[3] = (a) => o.value = a),
144
+ onClick: l[4] || (l[4] = (a) => {
144
145
  u("click"), D();
145
146
  })
146
147
  }, {
@@ -151,7 +152,7 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
151
152
  ref: y,
152
153
  "data-cy": `ac_input_${e.$attrs.id}`,
153
154
  "label-text": e.label,
154
- "model-value": a.value,
155
+ "model-value": i.value,
155
156
  "is-valid": e.isValid,
156
157
  disabled: e.$attrs.disabled,
157
158
  placeholder: e.$attrs.placeholder,
@@ -163,30 +164,30 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
163
164
  "!uikit-ml-0 !uikit-w-full"
164
165
  ],
165
166
  "fieldset-classes": [I.value, e.fieldsetClasses],
166
- "onUpdate:modelValue": l[0] || (l[0] = (i) => P(i === void 0 ? "" : `${i}`)),
167
- onKeydown: l[1] || (l[1] = (i) => u("keydown", i)),
167
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => P(a === void 0 ? "" : `${a}`)),
168
+ onKeydown: l[1] || (l[1] = (a) => u("keydown", a)),
168
169
  onKeydownEnterPressed: l[2] || (l[2] = () => u("keydownEnterPressed"))
169
170
  }, {
170
171
  leftIcon: s(() => [
171
172
  V(e.$slots, "lefticon")
172
173
  ]),
173
- righticon: s(({ handleClean: i }) => [
174
- V(e.$slots, "righticon", { handleClean: i })
174
+ righticon: s(({ handleClean: a }) => [
175
+ V(e.$slots, "righticon", { handleClean: a })
175
176
  ]),
176
177
  _: 3
177
178
  }, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "input-class", "fieldset-classes"])
178
179
  ]),
179
180
  default: s(() => [
180
- (C(!0), A(K, null, N(n.value, (i, b) => (C(), S(G, {
181
+ (C(!0), A(K, null, N(n.value, (a, b) => (C(), S(G, {
181
182
  key: b,
182
183
  active: U(h) === b,
183
184
  class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
184
- onClick: (E) => g(i, b),
185
+ onClick: (E) => g(a, b),
185
186
  onMouseover: (E) => h.value = b
186
187
  }, {
187
188
  default: s(() => [
188
189
  W("span", {
189
- innerHTML: i.label
190
+ innerHTML: a.label
190
191
  }, null, 8, R)
191
192
  ]),
192
193
  _: 2
@@ -1,7 +1,7 @@
1
- import { defineComponent as v, ref as x, computed as h, watch as D, renderSlot as m, createElementVNode as E, normalizeClass as $, openBlock as b, createElementBlock as B, Fragment as I, renderList as R, createBlock as A, unref as K, createCommentVNode as L } from "vue";
1
+ import { defineComponent as v, ref as x, computed as i, watch as D, renderSlot as m, createElementVNode as E, normalizeClass as $, openBlock as b, createElementBlock as B, Fragment as I, renderList as R, createBlock as A, unref as K, createCommentVNode as L } from "vue";
2
2
  import "./types-B0dZ7OiV.D29wNgoj.js";
3
3
  import V from "../CheckboxBtn.js";
4
- const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(), a.replace(" ", "-").toLowerCase()), S = ["id", "data-cy"], z = /* @__PURE__ */ v({
4
+ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(), a.replace(" ", "-").toLowerCase()), M = ["id", "data-cy"], z = /* @__PURE__ */ v({
5
5
  inheritAttrs: !1,
6
6
  __name: "CheckboxGroup",
7
7
  props: {
@@ -22,11 +22,11 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
22
22
  },
23
23
  emits: ["resetted", "update:modelValue", "checkedGroup"],
24
24
  setup(a, { emit: g }) {
25
- const o = a, s = g, l = x(/* @__PURE__ */ new Map()), r = h(() => {
25
+ const o = a, s = g, l = x(/* @__PURE__ */ new Map()), r = i(() => {
26
26
  for (const e of o.checkboxData)
27
27
  if (e.reset) return e;
28
28
  return null;
29
- }), C = h(() => o.checkboxData.length), f = h(() => {
29
+ }), C = i(() => o.checkboxData.length), f = i(() => {
30
30
  let e = 0;
31
31
  return l.value.forEach((t) => {
32
32
  t.checked && e++;
@@ -39,7 +39,7 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
39
39
  `${t.id}`,
40
40
  t
41
41
  ), t.checked && e.push(t);
42
- console.log("initialSelected", e), s("update:modelValue", e);
42
+ s("update:modelValue", e);
43
43
  })();
44
44
  const u = (e, t) => {
45
45
  const c = l.value.get(e);
@@ -56,7 +56,7 @@ 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, i = (e) => {
59
+ }, d = (e) => l.value.get(o.getKey(e))?.checked ?? !1, h = (e) => {
60
60
  if (w(o.checkboxData)) return;
61
61
  const t = l.value.get(e.id);
62
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) => {
@@ -74,7 +74,7 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
74
74
  }
75
75
  ), (e, t) => m(e.$slots, "default", {
76
76
  isActive: d,
77
- handleChange: i,
77
+ handleChange: h,
78
78
  checkboxesData: e.checkboxData
79
79
  }, () => [
80
80
  E("div", {
@@ -84,7 +84,7 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
84
84
  }, [
85
85
  m(e.$slots, "checkbox_elements", {
86
86
  isActive: d,
87
- handleChange: i,
87
+ handleChange: h,
88
88
  checkboxesData: e.checkboxData,
89
89
  reset: p
90
90
  }, () => [
@@ -99,10 +99,10 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
99
99
  e.formCheckInline ? "uikit-mr-10px" : "uikit-mb-10px",
100
100
  e.checkboxContainerClasses
101
101
  ],
102
- onChange: i
102
+ onChange: h
103
103
  }, null, 8, ["id", "data-cy", "label", "inline", "model-value", "container-class"]))), 128)) : L("", !0)
104
104
  ])
105
- ], 10, S)
105
+ ], 10, M)
106
106
  ]);
107
107
  }
108
108
  });
@@ -1,6 +1,6 @@
1
- import { defineComponent as p, mergeModels as d, useModel as C, ref as h, watch as $, renderSlot as u, createElementVNode as V, normalizeClass as c, openBlock as m, createElementBlock as R, Fragment as g, renderList as k, createBlock as y } from "vue";
1
+ import { defineComponent as p, mergeModels as d, useModel as C, ref as h, watch as $, renderSlot as u, createElementVNode as V, normalizeClass as c, openBlock as m, createElementBlock as k, Fragment as R, renderList as g, createBlock as y } from "vue";
2
2
  import { _ } from "./RadioButton.vue_vue_type_script_setup_true_lang.CiJAhkRj.js";
3
- const b = ["data-cy"], E = /* @__PURE__ */ p({
3
+ const b = ["data-cy"], w = /* @__PURE__ */ p({
4
4
  inheritAttrs: !1,
5
5
  __name: "RadioGroup",
6
6
  props: /* @__PURE__ */ d({
@@ -27,7 +27,7 @@ const b = ["data-cy"], E = /* @__PURE__ */ p({
27
27
  return;
28
28
  }
29
29
  })(), $(n, (e) => {
30
- console.log("watch:resetRadio", e), e && t();
30
+ e && t();
31
31
  }), (e, M) => u(e.$slots, "default", {
32
32
  handleClick: l,
33
33
  activeValue: a.value,
@@ -44,7 +44,7 @@ const b = ["data-cy"], E = /* @__PURE__ */ p({
44
44
  reset: t,
45
45
  isActive: r
46
46
  }, () => [
47
- (m(!0), R(g, null, k(e.radioValues, (s, v) => (m(), y(_, {
47
+ (m(!0), k(R, null, g(e.radioValues, (s, v) => (m(), y(_, {
48
48
  id: s.id,
49
49
  key: v,
50
50
  class: c(e.radioContainerClasses),
@@ -58,5 +58,5 @@ const b = ["data-cy"], E = /* @__PURE__ */ p({
58
58
  }
59
59
  });
60
60
  export {
61
- E as _
61
+ w as _
62
62
  };
package/dist/index.js CHANGED
@@ -4,14 +4,14 @@ 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.JlHKkjHJ.js";
7
+ import { _ as u } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.C1NwpE7V.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.Ar2KNVYH.js";
10
10
  import { _ as g } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.CiJAhkRj.js";
11
- import { _ as h } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.BalzO73O.js";
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";
13
13
  import { _ as w } from "./chunks/BaseAlert.vue_vue_type_style_index_0_lang.BtqP_iYL.js";
14
- import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.CCR6X0si.js";
14
+ import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.D21vozEO.js";
15
15
  import { _ as v } from "./chunks/BaseBadge.vue_vue_type_style_index_0_lang.BOA1gBKu.js";
16
16
  import { _ as G } from "./chunks/BaseButton.vue_vue_type_script_setup_true_lang.BWZPE2Gf.js";
17
17
  import { default as O } from "./BaseCard.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.0.23",
3
+ "version": "2.0.25",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",