@wikicasa-dev/components 2.2.9-alpha.28 → 2.2.9-alpha.3

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,7 +1,7 @@
1
- import { defineComponent as m, useId as s, watch as f, createElementBlock as h, openBlock as d, createVNode as o, renderSlot as b, unref as l, normalizeClass as C, withCtx as u, createBlock as x, createCommentVNode as y, createTextVNode as V, toDisplayString as g } from "vue";
2
- import { CheckIcon as B } from "@wikicasa-dev/svg-icons";
3
- import { CheckboxRoot as p, CheckboxIndicator as w } from "reka-ui";
4
- const z = /* @__PURE__ */ m({
1
+ import { defineComponent as m, useId as f, computed as h, watch as b, createElementBlock as C, openBlock as u, createVNode as c, renderSlot as x, unref as i, normalizeClass as y, withCtx as n, createBlock as V, createCommentVNode as g, createTextVNode as B, toDisplayString as w } from "vue";
2
+ import { CheckIcon as p } from "@wikicasa-dev/svg-icons";
3
+ import { CheckboxRoot as I, CheckboxIndicator as v } from "reka-ui";
4
+ const N = ["for"], j = /* @__PURE__ */ m({
5
5
  __name: "CheckboxBtn",
6
6
  props: {
7
7
  id: {},
@@ -15,59 +15,61 @@ const z = /* @__PURE__ */ m({
15
15
  modelValue: { type: Boolean, default: !1 }
16
16
  },
17
17
  emits: ["click", "update:modelValue", "change"],
18
- setup(e, { emit: c }) {
19
- const n = s(), a = c;
20
- f(
18
+ setup(e, { emit: r }) {
19
+ const l = f(), d = h(() => `${e.id ?? l}`), a = r;
20
+ b(
21
21
  () => e.checked,
22
22
  (t) => {
23
23
  t !== void 0 && a("update:modelValue", t);
24
24
  }
25
25
  );
26
- const r = (t) => {
26
+ const k = (t) => {
27
27
  t !== "indeterminate" && (a("change", {
28
- id: e.id ?? n,
28
+ id: e.id ?? l,
29
29
  label: e.label,
30
30
  checked: t
31
31
  }), a("update:modelValue", t));
32
32
  };
33
- return (t, i) => (d(), h("label", {
33
+ return (t, o) => (u(), C("label", {
34
34
  class: "uikit-checkbox-btn uikit-flex uikit-items-center uikit-gap-[12px]",
35
- onClick: i[0] || (i[0] = (k) => a("click", k))
35
+ for: d.value,
36
+ onClick: o[0] || (o[0] = (s) => a("click", s))
36
37
  }, [
37
- o(l(p), {
38
+ c(i(I), {
39
+ id: d.value,
38
40
  "model-value": e.modelValue,
39
41
  "data-cy": e.dataCy,
40
42
  disabled: e.disabled,
41
- class: C(["uikit-inline-flex uikit-size-[20px] uikit-items-center uikit-justify-center uikit-rounded-[4px] uikit-p-0 data-[state='unchecked']:uikit-border data-[state='unchecked']:uikit-border-solid data-[state='unchecked']:uikit-border-w-lightgray", [
43
+ class: y(["uikit-inline-flex uikit-size-[20px] uikit-items-center uikit-justify-center uikit-rounded-[4px] uikit-p-0 data-[state='unchecked']:uikit-border data-[state='unchecked']:uikit-border-solid data-[state='unchecked']:uikit-border-w-lightgray", [
42
44
  {
43
45
  "uikit-bg-white": !e.modelValue,
44
46
  "uikit-bg-w-primary": e.modelValue
45
47
  },
46
48
  e.inputClass
47
49
  ]]),
48
- "onUpdate:modelValue": r
50
+ "onUpdate:modelValue": k
49
51
  }, {
50
- default: u(() => [
51
- o(l(w), { class: "uikit-flex" }, {
52
- default: u(() => [
53
- e.modelValue === !0 ? (d(), x(l(B), {
52
+ default: n(() => [
53
+ c(i(v), { class: "uikit-flex" }, {
54
+ default: n(() => [
55
+ e.modelValue === !0 ? (u(), V(i(p), {
54
56
  key: 0,
55
57
  "fill-color": "#fff",
56
58
  width: 12,
57
59
  height: 14
58
- })) : y("", !0)
60
+ })) : g("", !0)
59
61
  ]),
60
62
  _: 1
61
63
  })
62
64
  ]),
63
65
  _: 1
64
- }, 8, ["model-value", "data-cy", "disabled", "class"]),
65
- b(t.$slots, "label", {}, () => [
66
- V(g(e.label), 1)
66
+ }, 8, ["id", "model-value", "data-cy", "disabled", "class"]),
67
+ x(t.$slots, "label", {}, () => [
68
+ B(w(e.label), 1)
67
69
  ])
68
- ]));
70
+ ], 8, N));
69
71
  }
70
72
  });
71
73
  export {
72
- z as default
74
+ j as default
73
75
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as v, ref as D, computed as h, watch as E, renderSlot as b, createElementVNode as $, normalizeClass as g, createElementBlock as B, createCommentVNode as A, openBlock as C, Fragment as I, renderList as R, createBlock as K, unref as V } from "vue";
1
+ import { defineComponent as p, ref as v, computed as h, watch as D, renderSlot as b, createElementVNode as E, normalizeClass as $, createElementBlock as B, createCommentVNode as A, openBlock as g, Fragment as I, renderList as R, createBlock as K, unref as V } from "vue";
2
2
  import { stringToHyphened as L, isArrNullOrEmpty as G } from "@wikicasa-dev/utilities";
3
3
  import N from "./CheckboxBtn.vue.js";
4
4
  import '../../../../../assets/CheckboxBtn.css';/* empty css */
5
- const T = ["id", "data-cy"], j = /* @__PURE__ */ v({
5
+ const T = ["id", "data-cy"], j = /* @__PURE__ */ p({
6
6
  inheritAttrs: !1,
7
7
  __name: "CheckboxGroup",
8
8
  props: {
@@ -20,14 +20,14 @@ const T = ["id", "data-cy"], j = /* @__PURE__ */ v({
20
20
  dataCy: { default: "" }
21
21
  },
22
22
  emits: ["resetted", "update:modelValue", "checkedGroup"],
23
- setup(a, { emit: y }) {
24
- const o = a, s = y, l = D(
23
+ setup(a, { emit: C }) {
24
+ const o = a, s = C, l = v(
25
25
  /* @__PURE__ */ new Map()
26
26
  ), r = h(() => {
27
27
  for (const e of o.checkboxData)
28
28
  if (e.reset) return e;
29
29
  return null;
30
- }), x = h(() => o.checkboxData.length), f = h(() => {
30
+ }), y = h(() => o.checkboxData.length), f = h(() => {
31
31
  let e = 0;
32
32
  return l.value.forEach((t) => {
33
33
  t.checked && e++;
@@ -60,7 +60,7 @@ const T = ["id", "data-cy"], j = /* @__PURE__ */ v({
60
60
  }, d = (e) => l.value.get(o.getKey(e))?.checked ?? !1, i = (e) => {
61
61
  if (G(o.checkboxData)) return;
62
62
  const t = l.value.get(e.id);
63
- 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 === x.value - 1 && l.value.forEach((n) => {
63
+ 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 === y.value - 1 && l.value.forEach((n) => {
64
64
  n.checked = !!n.reset;
65
65
  }), o.autoCheckResetEmpty && r.value && !f.value && (!o.manualToggleResetButton || !t?.reset) && u(o.getKey(r.value), { checked: !0 });
66
66
  const c = [];
@@ -68,7 +68,7 @@ const T = ["id", "data-cy"], j = /* @__PURE__ */ v({
68
68
  n.checked && c.push(n);
69
69
  }), s("update:modelValue", c), s("checkedGroup", o.groupId);
70
70
  };
71
- return E(
71
+ return D(
72
72
  () => o.reset,
73
73
  (e) => {
74
74
  e && m();
@@ -78,9 +78,9 @@ const T = ["id", "data-cy"], j = /* @__PURE__ */ v({
78
78
  handleChange: i,
79
79
  checkboxesData: a.checkboxData
80
80
  }, () => [
81
- $("div", {
81
+ E("div", {
82
82
  id: a.groupId,
83
- class: g(["checkbox-group-container", e.$attrs.class || ""]),
83
+ class: $(["checkbox-group-container", e.$attrs.class || ""]),
84
84
  "data-cy": a.dataCy
85
85
  }, [
86
86
  b(e.$slots, "checkbox_elements", {
@@ -89,19 +89,19 @@ const T = ["id", "data-cy"], j = /* @__PURE__ */ v({
89
89
  checkboxesData: a.checkboxData,
90
90
  reset: m
91
91
  }, () => [
92
- a.checkboxData ? (C(!0), B(I, { key: 0 }, R(a.checkboxData, (c, n) => (C(), K(N, {
92
+ a.checkboxData ? (g(!0), B(I, { key: 0 }, R(a.checkboxData, (c, n) => (g(), K(N, {
93
93
  id: a.getKey(c),
94
94
  key: n,
95
95
  "data-cy": c.dataCy ?? `checkbox_${V(L)(`${c.label}`)}`,
96
96
  label: c.label,
97
97
  inline: a.formCheckInline,
98
98
  "model-value": d(c),
99
- class: g([
99
+ "container-class": [
100
100
  a.formCheckInline ? "uikit-mr-10px" : "uikit-mb-10px",
101
101
  a.checkboxContainerClasses
102
- ]),
103
- onChange: t[0] || (t[0] = (p) => i(p))
104
- }, null, 8, ["id", "data-cy", "label", "inline", "model-value", "class"]))), 128)) : A("", !0)
102
+ ],
103
+ onChange: t[0] || (t[0] = (x) => i(x))
104
+ }, null, 8, ["id", "data-cy", "label", "inline", "model-value", "container-class"]))), 128)) : A("", !0)
105
105
  ])
106
106
  ], 10, T)
107
107
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.9-alpha.28",
3
+ "version": "2.2.9-alpha.3",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,8 +43,8 @@
43
43
  "peerDependencies": {
44
44
  "vue": "^3.5.0",
45
45
  "date-fns": "^4.0.0",
46
- "@wikicasa-dev/svg-icons": "^1.2.28-alpha.1",
47
- "@wikicasa-dev/vue-composables": "^0.0.32",
46
+ "@wikicasa-dev/svg-icons": "^1.2.24",
47
+ "@wikicasa-dev/vue-composables": "^0.0.29",
48
48
  "@wikicasa-dev/types": "^2.4.0",
49
49
  "@wikicasa-dev/utilities": "^1.2.0"
50
50
  },
@@ -63,8 +63,8 @@
63
63
  "@vitejs/plugin-vue": "^6.0.2",
64
64
  "@vue/eslint-config-prettier": "^10.2.0",
65
65
  "@vue/eslint-config-typescript": "^14.6.0",
66
- "@wikicasa-dev/svg-icons": "1.2.28-alpha.1",
67
- "@wikicasa-dev/vue-composables": "0.0.32",
66
+ "@wikicasa-dev/svg-icons": "1.2.24",
67
+ "@wikicasa-dev/vue-composables": "0.0.29",
68
68
  "@wikicasa-dev/tailwind-plugins": "^0.0.3",
69
69
  "@wikicasa-dev/types": "2.4.6",
70
70
  "@wikicasa-dev/utilities": "1.2.0",
@@ -1 +0,0 @@
1
- .uikit-select-dropdown.uikit-dropdown-content{--dropdown-border-color: #B4C2F0;--dropdown-max-height: 225px;--dropdown-min-width: unset}.uikit-select-dropdown.uikit-dropdown-content[data-side=down]{--dropdown-border-top-width: 1px;--dropdown-border-top-left-radius: 12px;--dropdown-border-top-right-radius: 12px;--dropdown-border-bottom-left-radius: 12px;--dropdown-border-bottom-right-radius: 12px}