@wikicasa-dev/components 2.2.8-alpha.10 → 2.2.8-alpha.11

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