@wikicasa-dev/components 2.2.8-alpha.15 → 2.2.8-alpha.17

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,5 +1,5 @@
1
1
  import { Autoplay as t } from "swiper/modules";
2
- import '../assets/swiper-thumbs.css';/* empty css */
2
+ import '../assets/swiper-autoplay.css';/* empty css */
3
3
  export {
4
4
  t as Autoplay
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { Controller as e } from "swiper/modules";
2
- import '../assets/swiper-thumbs.css';/* empty css */
2
+ import '../assets/swiper-autoplay.css';/* empty css */
3
3
  export {
4
4
  e as Controller
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { Keyboard as m } from "swiper/modules";
2
- import '../assets/swiper-thumbs.css';/* empty css */
2
+ import '../assets/swiper-autoplay.css';/* empty css */
3
3
  export {
4
4
  m as Keyboard
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { Thumbs as p } from "swiper/modules";
2
- import '../assets/swiper-thumbs.css';/* empty css */
2
+ import '../assets/swiper-autoplay.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as L, mergeModels as V, useModel as M, useTemplateRef as C, shallowRef as s, onBeforeMount as N, watch as b, nextTick as O, createBlock as $, openBlock as c, withCtx as y, createElementBlock as B, Fragment as U, renderList as D, renderSlot as v, createElementVNode as d, normalizeClass as f, withDirectives as H, createCommentVNode as A, vModelText as P, toDisplayString as X, normalizeStyle as j, createTextVNode as q } from "vue";
2
- import G from "../BaseDropDown.vue.js";
1
+ import { defineComponent as L, mergeModels as M, useModel as V, useTemplateRef as b, shallowRef as s, onBeforeMount as N, watch as C, nextTick as O, createBlock as $, openBlock as c, withCtx as y, createElementBlock as B, Fragment as U, renderList as D, renderSlot as v, createElementVNode as d, normalizeClass as f, withDirectives as H, createCommentVNode as A, vModelText as P, toDisplayString as X, withModifiers as j, normalizeStyle as q, createTextVNode as G } from "vue";
2
+ import J from "../BaseDropDown.vue.js";
3
3
  import '../../../../../assets/BaseDropDown.css';/* empty css */
4
- import J from "../BaseSelect/SelectItem.vue.js";
5
- import { debounce as Q } from "@wikicasa-dev/utilities";
6
- const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L({
4
+ import Q from "../BaseSelect/SelectItem.vue.js";
5
+ import { debounce as Y } from "@wikicasa-dev/utilities";
6
+ const Z = ["readonly", "placeholder"], _ = ["innerHTML"], ae = /* @__PURE__ */ L({
7
7
  __name: "ClearableAutocomplete",
8
- props: /* @__PURE__ */ V({
8
+ props: /* @__PURE__ */ M({
9
9
  dataCy: {},
10
10
  placeholder: {},
11
11
  enableKeyboardController: { type: Boolean, default: !0 },
@@ -23,50 +23,54 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
23
23
  modelValue: { default: null },
24
24
  modelModifiers: {}
25
25
  }),
26
- emits: /* @__PURE__ */ V(["click", "update:inputValue", "keydown"], ["update:open", "update:modelValue"]),
26
+ emits: /* @__PURE__ */ M(["click", "update:inputValue", "keydown"], ["update:open", "update:modelValue"]),
27
27
  setup(l, { expose: x, emit: R }) {
28
- const u = M(l, "open"), i = M(l, "modelValue"), p = R, T = C("inputRef"), o = s(""), w = s(0), k = s(!1), h = s(null), a = s([]), z = C("dropdownRef"), m = C("hiddenSpan"), K = () => {
29
- o.value = "", i.value = null, p("update:inputValue", "");
28
+ const u = V(l, "open"), a = V(l, "modelValue"), p = R, T = b("inputRef"), o = s(a.value?.label || ""), w = s(0), k = s(!1), h = s(null), i = s([]), z = b("dropdownRef"), m = b("hiddenSpan"), K = () => {
29
+ o.value = "", a.value = null, p("update:inputValue", "");
30
30
  }, W = async (t) => {
31
31
  if (p("update:inputValue", t), !t) {
32
- a.value = [], u.value = !1;
32
+ i.value = [], u.value = !1;
33
33
  return;
34
34
  }
35
- a.value = await h.value?.(t) || [], k.value = !0, u.value = !!a.value.length;
35
+ i.value = await h.value?.(t) || [], k.value = !0, u.value = !!i.value.length;
36
36
  }, S = (t = -1) => {
37
- const e = a.value[t];
38
- !e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e), o.value = e.label, u.value = !1, i.value = e, a.value = []);
37
+ const e = i.value[t];
38
+ !e || e.id === a.value?.id || (l.onOptionSelectedCb?.(e), o.value = e.label, u.value = !1, a.value = e, i.value = []);
39
39
  }, I = () => {
40
40
  T.value?.select();
41
41
  };
42
42
  return N(() => {
43
- h.value = Q({ delay: 300 }, l.onInputChangeCb);
44
- }), b(o, () => {
45
- O(() => {
46
- m.value && (w.value = m.value.offsetWidth);
47
- });
48
- }), b(
43
+ h.value = Y({ delay: 300 }, l.onInputChangeCb);
44
+ }), C(
45
+ o,
46
+ () => {
47
+ O(() => {
48
+ m.value && (w.value = m.value.offsetWidth);
49
+ });
50
+ },
51
+ { immediate: !0 }
52
+ ), C(
49
53
  () => z.value?.selectedIdx,
50
54
  (t) => {
51
55
  const e = t ?? -1;
52
56
  e !== -1 && S(e);
53
57
  }
54
- ), b(
55
- i,
58
+ ), C(
59
+ a,
56
60
  (t, e) => {
57
61
  t === e || t?.label === o.value || (o.value = t?.label || "");
58
62
  },
59
63
  { immediate: !0 }
60
64
  ), x({
61
65
  select: I
62
- }), (t, e) => (c(), $(G, {
66
+ }), (t, e) => (c(), $(J, {
63
67
  ref: "dropdownRef",
64
68
  class: "uikit-clearable-autocomplete",
65
69
  "data-cy": l.dataCy,
66
70
  "dropdown-element": "ul",
67
71
  "dropdown-classes": ["uikit-z-30", l.dropdownClasses],
68
72
  "open-dropdown": u.value,
69
- "keep-state": !a.value.length || l.keepState === "closed" ? "closed" : "opened",
73
+ "keep-state": !i.value.length || l.keepState === "closed" ? "closed" : "opened",
70
74
  "activate-keyboard-controller": l.enableKeyboardController,
71
75
  "reset-keyboard-controller": k.value,
72
76
  "onUpdate:resetKeyboardController": e[2] || (e[2] = (n) => k.value = n),
@@ -87,7 +91,7 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
87
91
  e[0] || (e[0] = (n) => o.value = n),
88
92
  W
89
93
  ],
90
- readonly: !!i.value?.label,
94
+ readonly: !!a.value?.label,
91
95
  class: f(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", l.inputClasses]),
92
96
  style: {
93
97
  font: "inherit",
@@ -95,7 +99,7 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
95
99
  },
96
100
  placeholder: l.placeholder,
97
101
  onKeydown: e[1] || (e[1] = (n) => p("keydown", n))
98
- }, null, 42, Y), [
102
+ }, null, 42, Z), [
99
103
  [P, o.value]
100
104
  ]),
101
105
  d("span", {
@@ -107,18 +111,18 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
107
111
  fontSize: "inherit"
108
112
  }
109
113
  }, X(o.value), 513),
110
- i.value?.label ? (c(), B("button", {
114
+ a.value?.label ? (c(), B("button", {
111
115
  key: 0,
112
116
  type: "button",
113
117
  class: f(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButtonClasses]),
114
118
  "aria-label": "Clear input",
115
- style: j({
119
+ style: q({
116
120
  left: `${w.value + 16}px`
117
121
  }),
118
- onClick: K
122
+ onClick: j(K, ["stop"])
119
123
  }, [
120
124
  v(t.$slots, "clear-icon", {}, () => [
121
- e[5] || (e[5] = q("X", -1))
125
+ e[5] || (e[5] = G("X", -1))
122
126
  ])
123
127
  ], 6)) : A("", !0)
124
128
  ], 2),
@@ -126,7 +130,7 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
126
130
  ], 2)
127
131
  ]),
128
132
  default: y(({ activeIdx: n, setActiveIdx: E }) => [
129
- (c(!0), B(U, null, D(a.value, (g, r) => (c(), $(J, {
133
+ (c(!0), B(U, null, D(i.value, (g, r) => (c(), $(Q, {
130
134
  key: r,
131
135
  active: n === r,
132
136
  class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
@@ -140,7 +144,7 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
140
144
  }, () => [
141
145
  d("span", {
142
146
  innerHTML: g.label
143
- }, null, 8, Z)
147
+ }, null, 8, _)
144
148
  ])
145
149
  ]),
146
150
  _: 2
@@ -151,5 +155,5 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
151
155
  }
152
156
  });
153
157
  export {
154
- oe as default
158
+ ae as default
155
159
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.8-alpha.15",
3
+ "version": "2.2.8-alpha.17",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",