@wikicasa-dev/components 2.2.9-alpha.21 → 2.2.9-alpha.22

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-keyboard.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-keyboard.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-keyboard.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-keyboard.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 X, mergeModels as O, useModel as B, useId as j, useTemplateRef as d, shallowRef as c, onBeforeMount as q, watch as g, nextTick as G, createBlock as V, openBlock as T, withCtx as S, createElementBlock as J, Fragment as Q, renderList as Y, renderSlot as m, createElementVNode as s, normalizeClass as f, normalizeStyle as W, withDirectives as U, unref as Z, vModelText as _, toDisplayString as ee, withModifiers as te, createTextVNode as le, vShow as ne } from "vue";
1
+ import { defineComponent as G, mergeModels as V, useModel as g, useId as X, useTemplateRef as d, shallowRef as c, onBeforeMount as j, watch as T, nextTick as q, createBlock as W, openBlock as S, withCtx as x, createElementBlock as J, Fragment as Q, renderList as Y, renderSlot as m, createElementVNode as s, normalizeClass as f, normalizeStyle as U, withDirectives as E, unref as Z, vModelText as _, toDisplayString as ee, withModifiers as te, createTextVNode as le, vShow as ne } from "vue";
2
2
  import oe from "../BaseDropDown.vue.js";
3
3
  import '../../../../../assets/BaseDropDown.css';/* empty css */
4
4
  import ae from "../BaseSelect/SelectItem.vue.js";
5
5
  import { debounce as ie } from "@wikicasa-dev/utilities";
6
- const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE__ */ X({
6
+ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE__ */ G({
7
7
  __name: "ClearableAutocomplete",
8
- props: /* @__PURE__ */ O({
8
+ props: /* @__PURE__ */ V({
9
9
  dataCy: {},
10
10
  placeholder: {},
11
11
  enableKeyboardController: { type: Boolean, default: !0 },
@@ -29,55 +29,58 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
29
29
  },
30
30
  inputValueModifiers: {}
31
31
  }),
32
- emits: /* @__PURE__ */ O(["input", "click", "inputClick", "keydown"], ["update:open", "update:modelValue", "update:inputValue"]),
33
- setup(t, { expose: E, emit: I }) {
34
- const r = B(t, "open"), u = B(t, "modelValue"), o = B(t, "inputValue");
32
+ emits: /* @__PURE__ */ V(["input", "click", "inputClick", "keydown"], ["update:open", "update:modelValue", "update:inputValue"]),
33
+ setup(t, { expose: I, emit: D }) {
34
+ const r = g(t, "open"), u = g(t, "modelValue"), o = g(t, "inputValue");
35
35
  o.value = o.value ?? u.value?.label ?? "";
36
- const p = I, L = j(), C = d("inputRef"), v = c(0), b = c(!1), h = c(!!u.value?.label), x = c(null), a = c([]), M = d("dropdownRef"), R = d("hiddenSpan"), z = d("inputWrapperRef"), D = d("clearButtonRef"), K = () => {
36
+ const p = D, L = X(), C = d("inputRef"), v = c(0), b = c(!1), h = c(!!u.value?.label), M = c(null), a = c([]), R = d("dropdownRef"), $ = d("hiddenSpan"), z = d("inputWrapperRef"), K = d("clearButtonRef"), N = () => {
37
37
  o.value = "", u.value = null;
38
- }, N = async (l) => {
38
+ }, A = async (l) => {
39
39
  if (!l) {
40
40
  a.value = [], r.value = !1;
41
41
  return;
42
42
  }
43
- t.disableCb || (a.value = await x.value?.(l) || [], b.value = !0, r.value = !!a.value.length);
44
- }, $ = (l = -1) => {
43
+ t.disableCb || (a.value = await M.value?.(l) || [], b.value = !0, r.value = !!a.value.length);
44
+ }, F = (l = -1) => {
45
45
  const e = a.value[l];
46
46
  !e || e.id === u.value?.id || (t.onOptionSelectedCb?.(e), o.value = e.label, r.value = !1, u.value = e, h.value = !0, a.value = []);
47
- }, A = () => {
48
- C.value?.select();
49
47
  }, H = () => {
48
+ C.value?.select();
49
+ }, P = () => {
50
50
  C.value?.focus();
51
51
  };
52
- return q(() => {
53
- x.value = ie({ delay: 300 }, t.onInputChangeCb);
54
- }), g(
55
- [o, R, z, D],
52
+ return j(() => {
53
+ M.value = ie({ delay: 300 }, t.onInputChangeCb);
54
+ }), T(
55
+ [o, $, z, K],
56
56
  ([, l, e, n]) => {
57
- !l || !e || G(() => {
57
+ !l || !e || q(() => {
58
58
  if (!l || !e) return;
59
- const y = l.offsetWidth, k = e.offsetWidth, i = t.clearButton?.offset || 0, w = t.clearButton?.width || n?.offsetWidth || 0, P = k - i - w, F = Math.min(y, P);
60
- F !== v.value && (v.value = F);
59
+ const y = l.offsetWidth, k = e.offsetWidth, i = t.clearButton?.offset || 0, w = t.clearButton?.width || n?.offsetWidth || 0, O = k - i - w, B = Math.min(y, O);
60
+ console.log("DEBUG:", {
61
+ maxPosition: O,
62
+ newOffset: B
63
+ }), B !== v.value && (v.value = B);
61
64
  });
62
65
  },
63
66
  { immediate: !0 }
64
- ), g(
65
- () => M.value?.selectedIdx,
67
+ ), T(
68
+ () => R.value?.selectedIdx,
66
69
  (l) => {
67
70
  const e = l ?? -1;
68
- e !== -1 && $(e);
71
+ e !== -1 && F(e);
69
72
  }
70
- ), g(
73
+ ), T(
71
74
  u,
72
75
  (l, e) => {
73
76
  l === e || l?.label === o.value || (o.value = l?.label || "");
74
77
  },
75
78
  { immediate: !0 }
76
- ), E({
77
- getRootElement: () => M.value?.getRootElement(),
78
- select: A,
79
- focus: H
80
- }), (l, e) => (T(), V(oe, {
79
+ ), I({
80
+ getRootElement: () => R.value?.getRootElement(),
81
+ select: H,
82
+ focus: P
83
+ }), (l, e) => (S(), W(oe, {
81
84
  ref: "dropdownRef",
82
85
  class: "uikit-clearable-autocomplete",
83
86
  "data-cy": t.dataCy,
@@ -90,7 +93,7 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
90
93
  "onUpdate:resetKeyboardController": e[5] || (e[5] = (n) => b.value = n),
91
94
  "onUpdate:dropdownState": e[6] || (e[6] = (n) => r.value = n)
92
95
  }, {
93
- btn_slot: S(() => [
96
+ btn_slot: x(() => [
94
97
  s("div", {
95
98
  class: f(["uikit-text-16", t.triggerWrapperClasses]),
96
99
  onClick: e[4] || (e[4] = (n) => p("click", n))
@@ -99,17 +102,17 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
99
102
  s("div", {
100
103
  ref: "inputWrapperRef",
101
104
  class: f(["uikit-relative", t.inputWrapperClasses]),
102
- style: W(
105
+ style: U(
103
106
  t.clearButton?.width ? {
104
107
  paddingRight: `${t.clearButton.width}px`
105
108
  } : {}
106
109
  )
107
110
  }, [
108
- U(s("input", {
111
+ E(s("input", {
109
112
  ref: "inputRef",
110
113
  "onUpdate:modelValue": [
111
114
  e[0] || (e[0] = (n) => o.value = n),
112
- N
115
+ A
113
116
  ],
114
117
  id: Z(L),
115
118
  "data-cy": t.dataCy ? `ac_input_${t.dataCy}` : "",
@@ -133,24 +136,24 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
133
136
  ]),
134
137
  s("span", {
135
138
  ref_key: "hiddenSpan",
136
- ref: R,
139
+ ref: $,
137
140
  class: f(["uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre", t.hiddenTextClasses]),
138
141
  style: {
139
142
  font: "inherit",
140
143
  fontSize: "inherit"
141
144
  }
142
145
  }, ee(o.value), 3),
143
- U(s("button", {
146
+ E(s("button", {
144
147
  ref: "clearButtonRef",
145
148
  type: "button",
146
149
  class: f(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", t.clearButton?.classes]),
147
150
  "aria-label": "Clear input",
148
- style: W({
151
+ style: U({
149
152
  left: `${v.value + (t.clearButton?.offset || 0)}px`,
150
153
  width: t.clearButton?.width ? `${t.clearButton.width}px` : "auto",
151
154
  height: t.clearButton?.height ? `${t.clearButton.height}px` : "auto"
152
155
  }),
153
- onClick: te(K, ["stop"])
156
+ onClick: te(N, ["stop"])
154
157
  }, [
155
158
  m(l.$slots, "clear-icon", {}, () => [
156
159
  e[7] || (e[7] = le("X", -1))
@@ -162,15 +165,15 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
162
165
  m(l.$slots, "right-icon")
163
166
  ], 2)
164
167
  ]),
165
- default: S(({ activeIdx: n, setActiveIdx: y }) => [
166
- (T(!0), J(Q, null, Y(a.value, (k, i) => (T(), V(ae, {
168
+ default: x(({ activeIdx: n, setActiveIdx: y }) => [
169
+ (S(!0), J(Q, null, Y(a.value, (k, i) => (S(), W(ae, {
167
170
  key: i,
168
171
  active: n === i,
169
172
  class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
170
- onClick: (w) => $(i),
173
+ onClick: (w) => F(i),
171
174
  onMouseover: (w) => y(i)
172
175
  }, {
173
- default: S(() => [
176
+ default: x(() => [
174
177
  m(l.$slots, "option-content", {
175
178
  option: k,
176
179
  idx: i
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.9-alpha.21",
3
+ "version": "2.2.9-alpha.22",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",