@wikicasa-dev/components 2.2.9-alpha.15 → 2.2.9-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-controller.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-controller.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-controller.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-controller.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -51,6 +51,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
51
51
  activeIdx: import('vue').Ref<number, number>;
52
52
  selectedIdx: import('vue').Ref<number, number>;
53
53
  getRootElement: () => HTMLDivElement | null;
54
+ getContentElement: () => HTMLElement | null;
54
55
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
55
56
  click: () => any;
56
57
  "update:toggleDropdown": (value: Optional<boolean>) => any;
@@ -1,11 +1,11 @@
1
- import { defineComponent as W, mergeModels as V, useModel as C, useId as D, useTemplateRef as b, shallowRef as c, onBeforeMount as N, watch as y, nextTick as A, createBlock as $, openBlock as w, withCtx as h, createElementBlock as H, Fragment as P, renderList as X, renderSlot as f, createElementVNode as u, normalizeClass as v, withDirectives as F, unref as j, vModelText as q, toDisplayString as G, withModifiers as J, normalizeStyle as Q, createTextVNode as Y, vShow as Z } from "vue";
2
- import _ from "../BaseDropDown.vue.js";
1
+ import { defineComponent as D, mergeModels as $, useModel as b, useId as N, useTemplateRef as y, shallowRef as d, onBeforeMount as A, watch as w, nextTick as H, createBlock as F, openBlock as h, withCtx as g, createElementBlock as P, Fragment as X, renderList as j, renderSlot as f, createElementVNode as u, normalizeClass as v, withDirectives as O, unref as q, vModelText as G, toDisplayString as J, withModifiers as Q, normalizeStyle as Y, createTextVNode as Z, vShow as _ } from "vue";
2
+ import ee from "../BaseDropDown.vue.js";
3
3
  import '../../../../../assets/BaseDropDown.css';/* empty css */
4
- import ee from "../BaseSelect/SelectItem.vue.js";
5
- import { debounce as te } from "@wikicasa-dev/utilities";
6
- const le = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], de = /* @__PURE__ */ W({
4
+ import te from "../BaseSelect/SelectItem.vue.js";
5
+ import { debounce as le } from "@wikicasa-dev/utilities";
6
+ const ne = ["id", "data-cy", "placeholder"], oe = ["innerHTML"], pe = /* @__PURE__ */ D({
7
7
  __name: "ClearableAutocomplete",
8
- props: /* @__PURE__ */ V({
8
+ props: /* @__PURE__ */ $({
9
9
  dataCy: {},
10
10
  placeholder: {},
11
11
  enableKeyboardController: { type: Boolean, default: !0 },
@@ -28,55 +28,55 @@ const le = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], de = /* @__PURE
28
28
  },
29
29
  inputValueModifiers: {}
30
30
  }),
31
- emits: /* @__PURE__ */ V(["input", "click", "inputClick", "keydown"], ["update:open", "update:modelValue", "update:inputValue"]),
32
- setup(l, { expose: O, emit: R }) {
33
- const s = C(l, "open"), i = C(l, "modelValue"), o = C(l, "inputValue");
31
+ emits: /* @__PURE__ */ $(["input", "click", "inputClick", "keydown"], ["update:open", "update:modelValue", "update:inputValue"]),
32
+ setup(l, { expose: R, emit: x }) {
33
+ const s = b(l, "open"), i = b(l, "modelValue"), o = b(l, "inputValue");
34
34
  o.value = o.value ?? i.value?.label ?? "";
35
- const d = R, x = D(), k = b("inputRef"), p = c(0), m = c(!1), g = c(null), a = c([]), S = b("dropdownRef"), T = b("hiddenSpan"), E = () => {
35
+ const p = x, E = N(), k = y("inputRef"), c = d(0), m = d(!1), C = d(!!i.value?.label), S = d(null), a = d([]), T = y("dropdownRef"), B = y("hiddenSpan"), I = () => {
36
36
  o.value = "", i.value = null;
37
- }, I = async (t) => {
37
+ }, U = async (t) => {
38
38
  if (!t) {
39
39
  a.value = [], s.value = !1;
40
40
  return;
41
41
  }
42
- l.disableCb || (a.value = await g.value?.(t) || [], m.value = !0, s.value = !!a.value.length);
43
- }, B = (t = -1) => {
42
+ l.disableCb || (a.value = await S.value?.(t) || [], m.value = !0, s.value = !!a.value.length);
43
+ }, M = (t = -1) => {
44
44
  const e = a.value[t];
45
- !e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e), o.value = e.label, s.value = !1, i.value = e, a.value = []);
46
- }, U = () => {
47
- k.value?.select();
45
+ !e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e), o.value = e.label, s.value = !1, i.value = e, C.value = !0, a.value = []);
48
46
  }, z = () => {
47
+ k.value?.select();
48
+ }, K = () => {
49
49
  k.value?.focus();
50
50
  };
51
- return N(() => {
52
- g.value = te({ delay: 300 }, l.onInputChangeCb);
53
- }), y(
54
- [o, () => T.value],
51
+ return A(() => {
52
+ S.value = le({ delay: 300 }, l.onInputChangeCb);
53
+ }), w(
54
+ [o, () => B.value],
55
55
  ([, t]) => {
56
- t && A(() => {
56
+ t && H(() => {
57
57
  if (!t) return;
58
58
  const e = t.offsetWidth;
59
- e !== p.value && (p.value = e);
59
+ e !== c.value && (c.value = e);
60
60
  });
61
61
  },
62
62
  { immediate: !0 }
63
- ), y(
64
- () => S.value?.selectedIdx,
63
+ ), w(
64
+ () => T.value?.selectedIdx,
65
65
  (t) => {
66
66
  const e = t ?? -1;
67
- e !== -1 && B(e);
67
+ e !== -1 && M(e);
68
68
  }
69
- ), y(
69
+ ), w(
70
70
  i,
71
71
  (t, e) => {
72
72
  t === e || t?.label === o.value || (o.value = t?.label || "");
73
73
  },
74
74
  { immediate: !0 }
75
- ), O({
76
- getRootElement: () => S.value?.getRootElement(),
77
- select: U,
78
- focus: z
79
- }), (t, e) => (w(), $(_, {
75
+ ), R({
76
+ getRootElement: () => T.value?.getRootElement(),
77
+ select: z,
78
+ focus: K
79
+ }), (t, e) => (h(), F(ee, {
80
80
  ref: "dropdownRef",
81
81
  class: "uikit-clearable-autocomplete",
82
82
  "data-cy": l.dataCy,
@@ -89,22 +89,22 @@ const le = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], de = /* @__PURE
89
89
  "onUpdate:resetKeyboardController": e[5] || (e[5] = (n) => m.value = n),
90
90
  "onUpdate:dropdownState": e[6] || (e[6] = (n) => s.value = n)
91
91
  }, {
92
- btn_slot: h(() => [
92
+ btn_slot: g(() => [
93
93
  u("div", {
94
94
  class: v(["uikit-text-16", l.triggerWrapperClasses]),
95
- onClick: e[4] || (e[4] = (n) => d("click", n))
95
+ onClick: e[4] || (e[4] = (n) => p("click", n))
96
96
  }, [
97
97
  f(t.$slots, "left-icon"),
98
98
  u("div", {
99
99
  class: v(["uikit-relative", l.inputWrapperClasses])
100
100
  }, [
101
- F(u("input", {
101
+ O(u("input", {
102
102
  ref: "inputRef",
103
103
  "onUpdate:modelValue": [
104
104
  e[0] || (e[0] = (n) => o.value = n),
105
- I
105
+ U
106
106
  ],
107
- id: j(x),
107
+ id: q(E),
108
108
  "data-cy": l.dataCy ? `ac_input_${l.dataCy}` : "",
109
109
  type: "text",
110
110
  autocomplete: "off",
@@ -114,58 +114,60 @@ const le = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], de = /* @__PURE
114
114
  fontSize: "inherit"
115
115
  },
116
116
  placeholder: l.placeholder,
117
- onKeydown: e[1] || (e[1] = (n) => d("keydown", n)),
118
- onInput: e[2] || (e[2] = (n) => d("input", n)),
117
+ onKeydown: e[1] || (e[1] = (n) => p("keydown", n)),
118
+ onInput: e[2] || (e[2] = (n) => {
119
+ p("input", n), C.value = !1;
120
+ }),
119
121
  onClick: e[3] || (e[3] = (n) => {
120
- d("inputClick", n), k.value?.select();
122
+ p("inputClick", n), k.value?.select();
121
123
  })
122
- }, null, 42, le), [
123
- [q, o.value]
124
+ }, null, 42, ne), [
125
+ [G, o.value]
124
126
  ]),
125
127
  u("span", {
126
128
  ref_key: "hiddenSpan",
127
- ref: T,
129
+ ref: B,
128
130
  class: "uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre",
129
131
  style: {
130
132
  font: "inherit",
131
133
  fontSize: "inherit"
132
134
  }
133
- }, G(o.value), 513),
134
- F(u("button", {
135
+ }, J(o.value), 513),
136
+ O(u("button", {
135
137
  type: "button",
136
138
  class: v(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButton?.classes]),
137
139
  "aria-label": "Clear input",
138
- style: Q({
139
- left: `${p.value + (l.clearButton?.offset || 10)}px`
140
+ style: Y({
141
+ left: `${c.value + (l.clearButton?.offset || 10)}px`
140
142
  }),
141
- onClick: J(E, ["stop"])
143
+ onClick: Q(I, ["stop"])
142
144
  }, [
143
145
  f(t.$slots, "clear-icon", {}, () => [
144
- e[7] || (e[7] = Y("X", -1))
146
+ e[7] || (e[7] = Z("X", -1))
145
147
  ])
146
148
  ], 6), [
147
- [Z, i.value?.label && p.value]
149
+ [_, C.value && c.value]
148
150
  ])
149
151
  ], 2),
150
152
  f(t.$slots, "right-icon")
151
153
  ], 2)
152
154
  ]),
153
- default: h(({ activeIdx: n, setActiveIdx: K }) => [
154
- (w(!0), H(P, null, X(a.value, (M, r) => (w(), $(ee, {
155
+ default: g(({ activeIdx: n, setActiveIdx: L }) => [
156
+ (h(!0), P(X, null, j(a.value, (V, r) => (h(), F(te, {
155
157
  key: r,
156
158
  active: n === r,
157
159
  class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
158
- onClick: (L) => B(r),
159
- onMouseover: (L) => K(r)
160
+ onClick: (W) => M(r),
161
+ onMouseover: (W) => L(r)
160
162
  }, {
161
- default: h(() => [
163
+ default: g(() => [
162
164
  f(t.$slots, "option-content", {
163
- option: M,
165
+ option: V,
164
166
  idx: r
165
167
  }, () => [
166
168
  u("span", {
167
- innerHTML: M.label
168
- }, null, 8, ne)
169
+ innerHTML: V.label
170
+ }, null, 8, oe)
169
171
  ])
170
172
  ]),
171
173
  _: 2
@@ -176,5 +178,5 @@ const le = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], de = /* @__PURE
176
178
  }
177
179
  });
178
180
  export {
179
- de as default
181
+ pe as default
180
182
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as N, mergeModels as D, useId as R, useModel as E, shallowRef as x, computed as V, useTemplateRef as I, onMounted as z, onUnmounted as q, watch as l, nextTick as U, createElementBlock as j, openBlock as f, normalizeClass as i, renderSlot as K, createBlock as B, createVNode as F, unref as r, withCtx as L, createElementVNode as G, createCommentVNode as J, resolveDynamicComponent as P } from "vue";
1
+ import { defineComponent as N, mergeModels as D, useId as R, useModel as E, shallowRef as x, computed as V, useTemplateRef as I, onMounted as z, onUnmounted as q, watch as l, nextTick as U, createElementBlock as j, openBlock as k, normalizeClass as i, renderSlot as K, createBlock as B, createVNode as F, unref as r, withCtx as L, createElementVNode as G, createCommentVNode as J, resolveDynamicComponent as P } from "vue";
2
2
  import Q from "./BaseButton.vue.js";
3
3
  import { ArrowIcon as X } from "@wikicasa-dev/svg-icons";
4
4
  import { useKeyboardController as Y } from "@wikicasa-dev/vue-composables";
@@ -29,12 +29,12 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
29
29
  }),
30
30
  emits: /* @__PURE__ */ D(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController"]),
31
31
  setup(o, { expose: S, emit: A }) {
32
- const n = o, k = R(), v = A, w = E(o, "toggleDropdown"), m = E(
32
+ const n = o, v = R(), w = A, m = E(o, "toggleDropdown"), p = E(
33
33
  o,
34
34
  "resetKeyboardController"
35
35
  );
36
- let p = !1;
37
- const t = x(!1), u = x([]), M = V(() => u.value.length), s = I("container"), y = I("dropdown"), { activeIdx: d, selectedIdx: a, onKeyDownHandler: O } = Y({
36
+ let y = !1;
37
+ const t = x(!1), u = x([]), M = V(() => u.value.length), s = I("container"), c = I("dropdown"), { activeIdx: d, selectedIdx: a, onKeyDownHandler: O } = Y({
38
38
  optionsLength: M,
39
39
  isDropdownOpen: t,
40
40
  global: !1
@@ -42,26 +42,26 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
42
42
  t.value = !1;
43
43
  }, b = ({ target: e }) => {
44
44
  s.value?.contains(e) || W();
45
- }, h = (e) => {
45
+ }, C = (e) => {
46
46
  t.value && s.value?.contains(document.activeElement) && e.key === "Tab" && (t.value = !1);
47
47
  }, $ = (e) => {
48
48
  n.activateKeyboardController && O(e);
49
- }, c = () => {
49
+ }, f = () => {
50
50
  n.keepState === "closed" && !t.value || n.keepState === "opened" && t.value || (t.value = !t.value);
51
51
  }, T = (e) => {
52
52
  e != null && (d.value = e);
53
53
  }, H = (e) => {
54
54
  e != null && (a.value = e);
55
- }, C = () => {
56
- y.value && (u.value = Array.from(y.value.children));
55
+ }, h = () => {
56
+ c.value && (u.value = Array.from(c.value.children));
57
57
  };
58
58
  return z(() => {
59
- C();
59
+ h();
60
60
  }), q(() => {
61
- n.closeWhenClickedOutside && (document.removeEventListener("click", b), document.removeEventListener("keydown", h));
62
- }), l(m, (e) => {
61
+ n.closeWhenClickedOutside && (document.removeEventListener("click", b), document.removeEventListener("keydown", C));
62
+ }), l(p, (e) => {
63
63
  e && (d.value = -1, a.value = -1, U(() => {
64
- C(), m.value = !1;
64
+ h(), p.value = !1;
65
65
  }));
66
66
  }), l(
67
67
  () => n.openDropdown,
@@ -72,28 +72,29 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
72
72
  immediate: !0
73
73
  }
74
74
  ), l(t, (e) => {
75
- v("update:dropdownState", e);
75
+ w("update:dropdownState", e);
76
76
  }), l(t, (e) => {
77
- !e || p || !n.closeWhenClickedOutside || (document.addEventListener("click", b), document.addEventListener("keydown", h), p = !0);
78
- }), l(w, (e) => {
79
- e && (t.value = !t.value, w.value = !1);
77
+ !e || y || !n.closeWhenClickedOutside || (document.addEventListener("click", b), document.addEventListener("keydown", C), y = !0);
78
+ }), l(m, (e) => {
79
+ e && (t.value = !t.value, m.value = !1);
80
80
  }), l(a, (e) => {
81
81
  e !== -1 && u.value[e].querySelector("a")?.click();
82
82
  }), S({
83
83
  activeIdx: d,
84
84
  selectedIdx: a,
85
- getRootElement: () => s.value
86
- }), (e, g) => (f(), j("div", {
85
+ getRootElement: () => s.value,
86
+ getContentElement: () => c.value
87
+ }), (e, g) => (k(), j("div", {
87
88
  ref: "container",
88
89
  class: i(["uikit-relative uikit-block", e.$attrs.class]),
89
90
  onKeydown: $
90
91
  }, [
91
92
  K(e.$slots, "btn_slot", {
92
- toggleDropdown: c,
93
+ toggleDropdown: f,
93
94
  isOpen: t.value
94
95
  }, () => [
95
96
  F(Q, {
96
- id: r(k),
97
+ id: r(v),
97
98
  type: "button",
98
99
  "data-cy": o.dataCy,
99
100
  class: i([
@@ -103,7 +104,7 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
103
104
  "aria-expanded": t.value,
104
105
  "btn-class": "uikit-btn-single-selection",
105
106
  onClick: g[0] || (g[0] = (_) => {
106
- v("click"), c();
107
+ w("click"), f();
107
108
  })
108
109
  }, {
109
110
  default: L(() => [
@@ -111,7 +112,7 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
111
112
  class: i(["uikit-mr-5px", o.labelClasses]),
112
113
  innerHTML: o.btnLabel
113
114
  }, null, 10, Z),
114
- o.withArrowIcon ? (f(), B(r(X), {
115
+ o.withArrowIcon ? (k(), B(r(X), {
115
116
  key: 0,
116
117
  class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
117
118
  width: o.arrowWidth,
@@ -122,8 +123,8 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
122
123
  _: 1
123
124
  }, 8, ["id", "data-cy", "class", "aria-expanded"])
124
125
  ]),
125
- (f(), B(P(o.dropdownElement), {
126
- id: "dropdown_" + r(k),
126
+ (k(), B(P(o.dropdownElement), {
127
+ id: "dropdown_" + r(v),
127
128
  ref: "dropdown",
128
129
  "data-cy": o.dataCy && `${o.dataCy}_dropdown`,
129
130
  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", [
@@ -138,7 +139,7 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
138
139
  default: L(() => [
139
140
  K(e.$slots, "default", {
140
141
  isOpen: t.value,
141
- toggleDropdown: c,
142
+ toggleDropdown: f,
142
143
  activeIdx: r(d),
143
144
  selectedIdx: r(a),
144
145
  setActiveIdx: T,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.9-alpha.15",
3
+ "version": "2.2.9-alpha.17",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",