@wikicasa-dev/components 2.2.8-alpha.3 → 2.2.8-alpha.31

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.
Files changed (32) hide show
  1. package/dist/Swiper/autoplay.js +1 -1
  2. package/dist/Swiper/controller.js +1 -1
  3. package/dist/Swiper/keyboard.js +1 -1
  4. package/dist/Swiper/thumbs.js +1 -1
  5. package/dist/UIKit/Accordion/BaseAccordionItem.d.ts +6 -1
  6. package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +53 -0
  7. package/dist/UIKit/Autocomplete/ClearableAutocomplete.js +5 -0
  8. package/dist/UIKit/BaseAutocomplete.d.ts +7 -7
  9. package/dist/UIKit/BaseDropDown.d.ts +10 -1
  10. package/dist/UIKit/BaseFloatingLabel.js +3 -3
  11. package/dist/UIKit/BaseModal.d.ts +4 -0
  12. package/dist/UIKit/Checkbox/CheckboxBtn.d.ts +34 -38
  13. package/dist/UIKit/Checkbox/CheckboxBtn.js +3 -2
  14. package/dist/UIKit/Checkbox/CheckboxGroup.d.ts +6 -9
  15. package/dist/assets/BaseFloatingLabel.css +1 -1
  16. package/dist/assets/CheckboxBtn.css +1 -0
  17. package/dist/assets/ClearableAutocomplete.css +1 -0
  18. package/dist/assets/tailwind.css +1 -1
  19. package/dist/components/carousel/SwiperCarousel.d.ts +8 -8
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.js +85 -81
  22. package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +30 -31
  23. package/dist/packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js +30 -24
  24. package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +165 -0
  25. package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +1 -4
  26. package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +104 -86
  27. package/dist/packages/components/lib/UIKit/BaseFloatingLabel.vue.js +9 -9
  28. package/dist/packages/components/lib/UIKit/BaseModal.vue.js +11 -10
  29. package/dist/packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js +3 -3
  30. package/dist/packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js +42 -39
  31. package/package.json +3 -3
  32. /package/dist/assets/{swiper-autoplay.css → swiper-thumbs.css} +0 -0
@@ -0,0 +1,165 @@
1
+ import { defineComponent as K, mergeModels as B, useModel as M, useTemplateRef as m, shallowRef as d, onBeforeMount as L, watch as b, nextTick as W, createBlock as V, openBlock as y, withCtx as C, createElementBlock as I, Fragment as N, renderList as A, renderSlot as c, createElementVNode as u, normalizeClass as f, withDirectives as F, vModelText as H, toDisplayString as G, withModifiers as P, normalizeStyle as X, createTextVNode as j, vShow as q } from "vue";
2
+ import J from "../BaseDropDown.vue.js";
3
+ import '../../../../../assets/BaseDropDown.css';/* empty css */
4
+ import Q from "../BaseSelect/SelectItem.vue.js";
5
+ import { debounce as Y } from "@wikicasa-dev/utilities";
6
+ const Z = ["readonly", "placeholder"], _ = ["innerHTML"], ie = /* @__PURE__ */ K({
7
+ __name: "ClearableAutocomplete",
8
+ props: /* @__PURE__ */ B({
9
+ dataCy: {},
10
+ placeholder: {},
11
+ enableKeyboardController: { type: Boolean, default: !0 },
12
+ triggerWrapperClasses: {},
13
+ inputWrapperClasses: {},
14
+ inputClasses: {},
15
+ dropdownClasses: {},
16
+ clearButton: {},
17
+ keepState: {},
18
+ onInputChangeCb: { type: Function },
19
+ onOptionSelectedCb: { type: [Function, null] }
20
+ }, {
21
+ open: { type: Boolean, default: !1 },
22
+ openModifiers: {},
23
+ modelValue: { default: null },
24
+ modelModifiers: {}
25
+ }),
26
+ emits: /* @__PURE__ */ B(["click", "update:inputValue", "keydown"], ["update:open", "update:modelValue"]),
27
+ setup(l, { expose: $, emit: E }) {
28
+ const r = M(l, "open"), a = M(l, "modelValue"), p = E, O = m("inputRef"), n = d(a.value?.label || ""), v = d(0), k = d(!1), w = d(null), i = d([]), h = m("dropdownRef"), g = m("hiddenSpan"), R = () => {
29
+ n.value = "", a.value = null, p("update:inputValue", "");
30
+ }, U = async (t) => {
31
+ if (p("update:inputValue", t), !t) {
32
+ i.value = [], r.value = !1;
33
+ return;
34
+ }
35
+ i.value = await w.value?.(t) || [], k.value = !0, r.value = !!i.value.length;
36
+ }, S = (t = -1) => {
37
+ const e = i.value[t];
38
+ !e || e.id === a.value?.id || (l.onOptionSelectedCb?.(e), n.value = e.label, r.value = !1, a.value = e, i.value = []);
39
+ }, x = () => {
40
+ O.value?.select();
41
+ };
42
+ return L(() => {
43
+ w.value = Y({ delay: 300 }, l.onInputChangeCb);
44
+ }), b(
45
+ [n, () => g.value],
46
+ ([t, e]) => {
47
+ e && W(() => {
48
+ if (!e) return;
49
+ const o = e.offsetWidth;
50
+ o !== v.value && (console.log("DEBUG:updating icon positioning", {
51
+ curInputValue: t
52
+ }), v.value = o);
53
+ });
54
+ },
55
+ { immediate: !0 }
56
+ ), b(
57
+ () => h.value?.selectedIdx,
58
+ (t) => {
59
+ const e = t ?? -1;
60
+ e !== -1 && S(e);
61
+ }
62
+ ), b(
63
+ a,
64
+ (t, e) => {
65
+ t === e || t?.label === n.value || (n.value = t?.label || "");
66
+ },
67
+ { immediate: !0 }
68
+ ), $({
69
+ select: x,
70
+ getRootElement: () => h.value?.getRootElement()
71
+ }), (t, e) => (y(), V(J, {
72
+ ref: "dropdownRef",
73
+ class: "uikit-clearable-autocomplete",
74
+ "data-cy": l.dataCy,
75
+ "dropdown-element": "ul",
76
+ "dropdown-classes": ["uikit-z-30", l.dropdownClasses],
77
+ "open-dropdown": r.value,
78
+ "keep-state": !i.value.length || l.keepState === "closed" ? "closed" : "opened",
79
+ "activate-keyboard-controller": l.enableKeyboardController,
80
+ "reset-keyboard-controller": k.value,
81
+ "onUpdate:resetKeyboardController": e[3] || (e[3] = (o) => k.value = o),
82
+ "onUpdate:dropdownState": e[4] || (e[4] = (o) => r.value = o)
83
+ }, {
84
+ btn_slot: C(() => [
85
+ u("div", {
86
+ class: f(["uikit-text-16", l.triggerWrapperClasses]),
87
+ onClick: e[2] || (e[2] = (o) => p("click", o))
88
+ }, [
89
+ c(t.$slots, "left-icon"),
90
+ u("div", {
91
+ class: f(["uikit-relative", l.inputWrapperClasses])
92
+ }, [
93
+ F(u("input", {
94
+ ref: "inputRef",
95
+ "onUpdate:modelValue": [
96
+ e[0] || (e[0] = (o) => n.value = o),
97
+ U
98
+ ],
99
+ readonly: !!a.value?.label,
100
+ class: f(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", l.inputClasses]),
101
+ style: {
102
+ font: "inherit",
103
+ fontSize: "inherit"
104
+ },
105
+ placeholder: l.placeholder,
106
+ onKeydown: e[1] || (e[1] = (o) => p("keydown", o))
107
+ }, null, 42, Z), [
108
+ [H, n.value]
109
+ ]),
110
+ u("span", {
111
+ ref_key: "hiddenSpan",
112
+ ref: g,
113
+ class: "uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre",
114
+ style: {
115
+ font: "inherit",
116
+ fontSize: "inherit"
117
+ }
118
+ }, G(n.value), 513),
119
+ F(u("button", {
120
+ type: "button",
121
+ class: f(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButton?.classes]),
122
+ "aria-label": "Clear input",
123
+ style: X({
124
+ left: `${v.value + (l.clearButton?.offset || 10)}px`
125
+ }),
126
+ onClick: P(R, ["stop"])
127
+ }, [
128
+ c(t.$slots, "clear-icon", {}, () => [
129
+ e[5] || (e[5] = j("X", -1))
130
+ ])
131
+ ], 6), [
132
+ [q, a.value?.label]
133
+ ])
134
+ ], 2),
135
+ c(t.$slots, "right-icon")
136
+ ], 2)
137
+ ]),
138
+ default: C(({ activeIdx: o, setActiveIdx: z }) => [
139
+ (y(!0), I(N, null, A(i.value, (T, s) => (y(), V(Q, {
140
+ key: s,
141
+ active: o === s,
142
+ class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
143
+ onClick: (D) => S(s),
144
+ onMouseover: (D) => z(s)
145
+ }, {
146
+ default: C(() => [
147
+ c(t.$slots, "option-content", {
148
+ option: T,
149
+ idx: s
150
+ }, () => [
151
+ u("span", {
152
+ innerHTML: T.label
153
+ }, null, 8, _)
154
+ ])
155
+ ]),
156
+ _: 2
157
+ }, 1032, ["active", "onClick", "onMouseover"]))), 128))
158
+ ]),
159
+ _: 3
160
+ }, 8, ["data-cy", "dropdown-classes", "open-dropdown", "keep-state", "activate-keyboard-controller", "reset-keyboard-controller"]));
161
+ }
162
+ });
163
+ export {
164
+ ie as default
165
+ };
@@ -31,10 +31,7 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
31
31
  }),
32
32
  emits: /* @__PURE__ */ $(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
33
33
  setup(t, { expose: S, emit: V }) {
34
- const u = F(
35
- t,
36
- "modelValue"
37
- ), r = V, i = d(""), a = d([]), v = d(null), b = d(!1), n = d(!1), C = d(null), B = k(() => a.value.length);
34
+ const u = F(t, "modelValue"), r = V, i = d(""), a = d([]), v = d(null), b = d(!1), n = d(!1), C = d(null), B = k(() => a.value.length);
38
35
  L(() => {
39
36
  v.value = q({ delay: 300 }, t.onInputChangeCb);
40
37
  });
@@ -1,11 +1,11 @@
1
- import { defineComponent as L, mergeModels as b, useId as M, useModel as A, ref as h, computed as E, useTemplateRef as O, watch as d, onBeforeMount as W, onMounted as $, onUnmounted as H, createElementBlock as K, openBlock as c, withModifiers as y, normalizeClass as l, renderSlot as C, createBlock as g, createVNode as N, unref as n, withCtx as D, createElementVNode as T, createCommentVNode as V, resolveDynamicComponent as q } from "vue";
2
- import z from "./BaseButton.vue.js";
3
- import { ArrowIcon as R } from "@wikicasa-dev/svg-icons";
4
- import { useKeyboardController as U } from "@wikicasa-dev/vue-composables";
5
- const j = ["innerHTML"], X = /* @__PURE__ */ L({
1
+ import { defineComponent as T, mergeModels as E, useId as H, useModel as D, shallowRef as x, computed as N, useTemplateRef as B, onMounted as R, onUnmounted as V, watch as l, nextTick as z, createElementBlock as U, openBlock as f, normalizeClass as i, renderSlot as I, createBlock as L, createVNode as q, unref as r, withCtx as S, createElementVNode as G, createCommentVNode as j, resolveDynamicComponent as F } from "vue";
2
+ import J from "./BaseButton.vue.js";
3
+ import { ArrowIcon as P } from "@wikicasa-dev/svg-icons";
4
+ import { useKeyboardController as Q } from "@wikicasa-dev/vue-composables";
5
+ const X = ["innerHTML"], oe = /* @__PURE__ */ T({
6
6
  inheritAttrs: !1,
7
7
  __name: "BaseDropDown",
8
- props: /* @__PURE__ */ b({
8
+ props: /* @__PURE__ */ E({
9
9
  dropdownClasses: { default: "" },
10
10
  btnClasses: { default: "" },
11
11
  withArrowIcon: { type: Boolean, default: !1 },
@@ -23,105 +23,123 @@ const j = ["innerHTML"], X = /* @__PURE__ */ L({
23
23
  dataCy: { default: "" }
24
24
  }, {
25
25
  toggleDropdown: { type: Boolean, default: void 0 },
26
- toggleDropdownModifiers: {}
26
+ toggleDropdownModifiers: {},
27
+ resetKeyboardController: { type: Boolean, default: !1 },
28
+ resetKeyboardControllerModifiers: {}
27
29
  }),
28
- emits: /* @__PURE__ */ b(["click", "update:dropdownState"], ["update:toggleDropdown"]),
29
- setup(t, { emit: B }) {
30
- const i = t, f = M(), k = B, w = A(t, "toggleDropdown"), o = h(!1), r = h([]), x = E(() => r.value.length), v = O("dropdown"), { activeIdx: m, selectedIdx: u } = U({
31
- optionsLength: x,
32
- isDropdownOpen: o,
33
- activate: i.activateKeyboardController
34
- });
35
- d(
36
- () => i.openDropdown,
30
+ emits: /* @__PURE__ */ E(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController"]),
31
+ setup(o, { expose: K, emit: A }) {
32
+ const n = o, k = H(), v = A, m = D(o, "toggleDropdown"), w = D(
33
+ o,
34
+ "resetKeyboardController"
35
+ );
36
+ let p = !1;
37
+ const t = x(!1), u = x([]), M = N(() => u.value.length), s = B("container"), y = B("dropdown"), { activeIdx: d, selectedIdx: a } = Q({
38
+ optionsLength: M,
39
+ isDropdownOpen: t,
40
+ activate: n.activateKeyboardController
41
+ }), O = () => {
42
+ t.value = !1;
43
+ }, b = ({ target: e }) => {
44
+ s.value?.contains(e) || O();
45
+ }, C = (e) => {
46
+ t.value && s.value?.contains(document.activeElement) && (console.log("DEBUG:closing dropdown", document.activeElement), e.key === "Tab" && (t.value = !1));
47
+ }, c = () => {
48
+ n.keepState === "closed" && !t.value || n.keepState === "opened" && t.value || (t.value = !t.value);
49
+ }, W = (e) => {
50
+ e != null && (d.value = e);
51
+ }, $ = (e) => {
52
+ e != null && (a.value = e);
53
+ }, h = () => {
54
+ y.value && (u.value = Array.from(y.value.children));
55
+ };
56
+ return R(() => {
57
+ h();
58
+ }), V(() => {
59
+ n.closeWhenClickedOutside && (document.removeEventListener("click", b), document.removeEventListener("keydown", C));
60
+ }), l(w, (e) => {
61
+ e && (d.value = -1, a.value = -1, z(() => {
62
+ h(), w.value = !1;
63
+ }));
64
+ }), l(
65
+ () => n.openDropdown,
37
66
  (e) => {
38
- o.value = e;
67
+ t.value = e;
39
68
  },
40
69
  {
41
70
  immediate: !0
42
71
  }
43
- ), d(o, (e) => {
44
- k("update:dropdownState", e);
45
- }), d(w, (e) => {
46
- e && (o.value = !o.value, w.value = !1);
47
- }), d(u, (e) => {
48
- e !== -1 && r.value[e].querySelector("a")?.click();
49
- });
50
- const p = () => {
51
- o.value = !1;
52
- }, s = () => {
53
- i.keepState === "closed" && !o.value || i.keepState === "opened" && o.value || (o.value = !o.value);
54
- }, I = (e) => {
55
- e != null && (m.value = e);
56
- }, S = (e) => {
57
- e != null && (u.value = e);
58
- };
59
- return W(() => {
60
- i.closeWhenClickedOutside && document.body.addEventListener("click", p);
61
- }), $(() => {
62
- v.value && (r.value = v.value.children || []);
63
- }), H(() => {
64
- i.closeWhenClickedOutside && document.body.removeEventListener("click", p);
65
- }), (e, a) => (c(), K("div", {
66
- class: l(["uikit-relative uikit-block", e.$attrs.class]),
67
- onClick: a[1] || (a[1] = y((F) => {
68
- k("click"), s();
69
- }, ["stop"]))
72
+ ), l(t, (e) => {
73
+ v("update:dropdownState", e);
74
+ }), l(t, (e) => {
75
+ !e || p || !n.closeWhenClickedOutside || (document.addEventListener("click", b), document.addEventListener("keydown", C), p = !0);
76
+ }), l(m, (e) => {
77
+ e && (t.value = !t.value, m.value = !1);
78
+ }), l(a, (e) => {
79
+ e !== -1 && u.value[e].querySelector("a")?.click();
80
+ }), K({
81
+ activeIdx: d,
82
+ selectedIdx: a,
83
+ getRootElement: () => s.value
84
+ }), (e, g) => (f(), U("div", {
85
+ ref: "container",
86
+ class: i(["uikit-relative uikit-block", e.$attrs.class])
70
87
  }, [
71
- C(e.$slots, "btn_slot", {
72
- toggleDropdown: s,
73
- isOpen: o.value
88
+ I(e.$slots, "btn_slot", {
89
+ toggleDropdown: c,
90
+ isOpen: t.value
74
91
  }, () => [
75
- N(z, {
76
- id: n(f),
92
+ q(J, {
93
+ id: r(k),
77
94
  type: "button",
78
- "data-cy": t.dataCy,
79
- class: l([
95
+ "data-cy": o.dataCy,
96
+ class: i([
80
97
  "!uikit-flex uikit-w-full uikit-items-center uikit-truncate",
81
- t.btnClasses
98
+ o.btnClasses
82
99
  ]),
83
- "aria-expanded": o.value,
84
- "btn-class": "uikit-btn-single-selection"
100
+ "aria-expanded": t.value,
101
+ "btn-class": "uikit-btn-single-selection",
102
+ onClick: g[0] || (g[0] = (Y) => {
103
+ v("click"), c();
104
+ })
85
105
  }, {
86
- default: D(() => [
87
- T("span", {
88
- class: l(["uikit-mr-5px", t.labelClasses]),
89
- innerHTML: t.btnLabel
90
- }, null, 10, j),
91
- t.withArrowIcon ? (c(), g(n(R), {
106
+ default: S(() => [
107
+ G("span", {
108
+ class: i(["uikit-mr-5px", o.labelClasses]),
109
+ innerHTML: o.btnLabel
110
+ }, null, 10, X),
111
+ o.withArrowIcon ? (f(), L(r(P), {
92
112
  key: 0,
93
- class: l(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", o.value ? "uikit-rotate-180" : ""]),
94
- width: t.arrowWidth,
95
- height: t.arrowWidth,
96
- "stroke-color": t.arrowStrokeColor
97
- }, null, 8, ["class", "width", "height", "stroke-color"])) : V("", !0)
113
+ class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
114
+ width: o.arrowWidth,
115
+ height: o.arrowWidth,
116
+ "stroke-color": o.arrowStrokeColor
117
+ }, null, 8, ["class", "width", "height", "stroke-color"])) : j("", !0)
98
118
  ]),
99
119
  _: 1
100
120
  }, 8, ["id", "data-cy", "class", "aria-expanded"])
101
121
  ]),
102
- (c(), g(q(t.dropdownElement), {
103
- id: "dropdown_" + n(f),
122
+ (f(), L(F(o.dropdownElement), {
123
+ id: "dropdown_" + r(k),
104
124
  ref: "dropdown",
105
- "data-cy": t.dataCy && `${t.dataCy}_dropdown`,
106
- class: l(["uikit-dropdown-content uikit-w-full uikit-flex-col uikit-overflow-y-auto uikit-border uikit-border-solid uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
107
- t.dropdownClasses,
108
- o.value ? "uikit-flex" : "uikit-hidden",
109
- { "uikit-bottom-[55px] uikit-rounded-xs": t.direction === "up" },
110
- { "uikit-rounded-b uikit-border-t-0": t.direction === "down" },
111
- { "uikit-absolute": t.isAbsolute }
125
+ "data-cy": o.dataCy && `${o.dataCy}_dropdown`,
126
+ class: i(["uikit-dropdown-content uikit-w-full uikit-flex-col uikit-overflow-y-auto uikit-border uikit-border-solid uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
127
+ o.dropdownClasses,
128
+ t.value ? "uikit-flex" : "uikit-hidden",
129
+ { "uikit-bottom-[55px] uikit-rounded-xs": o.direction === "up" },
130
+ { "uikit-rounded-b uikit-border-t-0": o.direction === "down" },
131
+ { "uikit-absolute": o.isAbsolute }
112
132
  ]]),
113
- "aria-hidden": !o.value,
114
- onClick: a[0] || (a[0] = y(() => {
115
- }, ["stop"]))
133
+ "aria-hidden": !t.value
116
134
  }, {
117
- default: D(() => [
118
- C(e.$slots, "default", {
119
- isOpen: o.value,
120
- toggleDropdown: s,
121
- activeIdx: n(m),
122
- selectedIdx: n(u),
123
- setActiveIdx: I,
124
- setSelectedIdx: S
135
+ default: S(() => [
136
+ I(e.$slots, "default", {
137
+ isOpen: t.value,
138
+ toggleDropdown: c,
139
+ activeIdx: r(d),
140
+ selectedIdx: r(a),
141
+ setActiveIdx: W,
142
+ setSelectedIdx: $
125
143
  })
126
144
  ]),
127
145
  _: 3
@@ -130,5 +148,5 @@ const j = ["innerHTML"], X = /* @__PURE__ */ L({
130
148
  }
131
149
  });
132
150
  export {
133
- X as default
151
+ oe as default
134
152
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as d, createElementBlock as a, openBlock as s, withModifiers as o, normalizeClass as t, createElementVNode as k, createCommentVNode as r } from "vue";
2
- const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
1
+ import { defineComponent as u, createElementBlock as a, openBlock as s, withModifiers as d, normalizeClass as t, createElementVNode as r, createCommentVNode as k } from "vue";
2
+ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ u({
3
3
  __name: "BaseFloatingLabel",
4
4
  props: {
5
5
  labelState: { default: "inline-label" },
@@ -11,14 +11,14 @@ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
11
11
  },
12
12
  emits: ["click"],
13
13
  setup(e, { emit: n }) {
14
- const u = n;
14
+ const o = n;
15
15
  return (i, l) => (s(), a("label", {
16
16
  for: i.$attrs.for,
17
- class: t(["uikit-pointer-events-none uikit-absolute uikit-left-15px uikit-h-5 uikit-text-sm", [e.labelState, { "uikit-text-w-secondary": e.disabled }, e.labelClasses]]),
18
- onClick: l[0] || (l[0] = o((m) => u("click"), ["stop"]))
17
+ class: t(["uikit-pointer-events-none uikit-absolute uikit-left-15px uikit-h-5 uikit-text", [e.labelState, { "uikit-text-w-secondary": e.disabled }, e.labelClasses]]),
18
+ onClick: l[0] || (l[0] = d((f) => o("click"), ["stop"]))
19
19
  }, [
20
- k("span", {
21
- class: t(["uikit-text uikit-font-medium", [
20
+ r("span", {
21
+ class: t(["uikit-font-medium [font-size:inherit]", [
22
22
  e.disabled ? "uikit-text-w-secondary" : "uikit-text-w-black",
23
23
  e.labelTextClasses
24
24
  ]]),
@@ -26,12 +26,12 @@ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
26
26
  }, null, 10, c),
27
27
  i.$attrs.required ? (s(), a("sup", {
28
28
  key: 0,
29
- class: t(["uikit-absolute -uikit-top-[0.3rem] uikit-text", [
29
+ class: t(["uikit-absolute -uikit-top-[0.3rem] [font-size:inherit]", [
30
30
  { "uikit-text-w-secondary": e.disabled },
31
31
  { "uikit-text-w-danger": e.isValid === !1 },
32
32
  { "uikit-text-w-primary": (e.isValid || e.isValid === null) && !e.disabled }
33
33
  ]])
34
- }, " *", 2)) : r("", !0)
34
+ }, " *", 2)) : k("", !0)
35
35
  ], 10, b));
36
36
  }
37
37
  });
@@ -1,7 +1,7 @@
1
- import { defineComponent as T, ref as n, useTemplateRef as z, onUnmounted as H, watch as I, createBlock as O, openBlock as r, Teleport as $, createElementVNode as l, normalizeClass as s, withModifiers as y, createElementBlock as h, createCommentVNode as w, renderSlot as d, createVNode as D, unref as K, nextTick as N } from "vue";
1
+ import { defineComponent as I, ref as n, useTemplateRef as T, onUnmounted as z, watch as H, createBlock as O, openBlock as r, Teleport as $, createElementVNode as l, normalizeClass as s, withModifiers as y, createElementBlock as h, createCommentVNode as w, renderSlot as d, createVNode as D, unref as K, nextTick as N } from "vue";
2
2
  import { isWindows as C, awaitableSetTimeout as S } from "@wikicasa-dev/utilities";
3
3
  import { CloseIcon as V } from "@wikicasa-dev/svg-icons";
4
- const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
4
+ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ I({
5
5
  __name: "BaseModal",
6
6
  props: {
7
7
  id: { default: "base-bt-modal" },
@@ -11,6 +11,7 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
11
11
  customModalHeaderClasses: {},
12
12
  customModalBodyClasses: {},
13
13
  customModalFooterClasses: {},
14
+ closeIcon: {},
14
15
  withCloseIcon: { type: Boolean, default: !0 },
15
16
  showModal: { type: Boolean, default: !0 },
16
17
  headerTitle: { default: "" },
@@ -24,7 +25,7 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
24
25
  },
25
26
  emits: ["closed", "opened", "dialogClick"],
26
27
  setup(e, { emit: g }) {
27
- const c = g, i = n(!1), m = n(null), a = z("modalDialog"), k = n(!1), u = n(!1), f = ({ key: t }) => {
28
+ const c = g, i = n(!1), m = n(null), a = T("modalDialog"), k = n(!1), u = n(!1), f = ({ key: t }) => {
28
29
  t === "Escape" && o();
29
30
  }, x = () => {
30
31
  document?.body.addEventListener("keydown", f);
@@ -53,9 +54,9 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
53
54
  m.value?.classList.add("uikit-hidden"), c("closed");
54
55
  }, 250);
55
56
  };
56
- return H(() => {
57
+ return z(() => {
57
58
  b(), document?.documentElement.classList.remove("uikit-no-scrolling"), C() ? document?.body.classList.remove("uikit-no-scrolling", "sm:uikit-pr-15px") : document?.body.classList.remove("uikit-no-scrolling");
58
- }), I(
59
+ }), H(
59
60
  () => e.showModal,
60
61
  async (t) => {
61
62
  !t && !i.value ? k.value = !0 : k.value = !1, t && !i.value && await p(), !t && i.value && await o(), i.value = t;
@@ -102,16 +103,16 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
102
103
  key: 0,
103
104
  id: "close-icon-btn",
104
105
  "data-cy": "bbt-default-close-icon-btn",
105
- class: s(["uikit-absolute uikit-right-15px uikit-top-15px uikit-z-10 uikit-bg-transparent", e.closeIconBtnClasses]),
106
+ class: s(["uikit-absolute uikit-right-15px uikit-top-15px uikit-z-10 uikit-bg-transparent uikit-p-5px", e.closeIconBtnClasses]),
106
107
  type: "button",
107
108
  "aria-label": "Close",
108
109
  onClick: y(o, ["prevent", "stop"])
109
110
  }, [
110
111
  D(K(V), {
111
- class: "bbt-close-icon uikit-box-border uikit-p-5px",
112
- width: 30,
113
- height: 30
114
- })
112
+ class: s(["bbt-close-icon uikit-box-border", e.closeIcon?.classes]),
113
+ width: e.closeIcon?.size || 30,
114
+ height: e.closeIcon?.size || 30
115
+ }, null, 8, ["class", "width", "height"])
115
116
  ], 2)) : w("", !0),
116
117
  d(t.$slots, "header", { closeModal: o }, () => [
117
118
  l("span", {
@@ -14,7 +14,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
14
14
  label: { default: "" },
15
15
  modelValue: { type: Boolean, default: !1 }
16
16
  },
17
- emits: ["click", "change", "update:modelValue"],
17
+ emits: ["click", "update:modelValue", "change"],
18
18
  setup(e, { emit: r }) {
19
19
  const l = f(), d = h(() => `${e.id ?? l}`), a = r;
20
20
  b(
@@ -31,7 +31,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
31
31
  }), a("update:modelValue", t));
32
32
  };
33
33
  return (t, o) => (u(), C("label", {
34
- class: "uikit-flex uikit-items-center uikit-gap-[12px] uikit-text-16",
34
+ class: "uikit-checkbox-btn uikit-flex uikit-items-center uikit-gap-[12px]",
35
35
  for: d.value,
36
36
  onClick: o[0] || (o[0] = (s) => a("click", s))
37
37
  }, [
@@ -40,7 +40,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
40
40
  "model-value": e.modelValue,
41
41
  "data-cy": e.dataCy,
42
42
  disabled: e.disabled,
43
- class: y(["data-[state='unchecked']:uikit-border-w-lightgray 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", [
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", [
44
44
  {
45
45
  "uikit-bg-white": !e.modelValue,
46
46
  "uikit-bg-w-primary": e.modelValue