@wikicasa-dev/components 2.2.9-alpha.46 → 2.2.9-alpha.48

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