@wikicasa-dev/components 2.2.8-alpha.26 → 2.2.8-alpha.27

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-controller.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-controller.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-controller.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-controller.css';/* empty css */
2
+ import '../assets/swiper-autoplay.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -31,6 +31,7 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
31
31
  } & ClearableAutocompleteProps<TID, TPayload>) & Partial<{}>> & import('vue').PublicProps;
32
32
  expose(exposed: import('vue').ShallowUnwrapRef<{
33
33
  select: () => void;
34
+ getRootElement: () => HTMLDivElement | null | undefined;
34
35
  }>): void;
35
36
  attrs: any;
36
37
  slots: {
@@ -50,6 +50,7 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
50
50
  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
+ getRootElement: () => HTMLDivElement | null;
53
54
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
54
55
  click: () => any;
55
56
  "update:toggleDropdown": (value: Optional<boolean>) => any;
@@ -1,11 +1,11 @@
1
- import { defineComponent as K, mergeModels as T, useModel as B, useTemplateRef as b, shallowRef as s, onBeforeMount as L, watch as y, nextTick as N, createBlock as V, openBlock as c, withCtx as C, createElementBlock as M, Fragment as W, renderList as I, renderSlot as f, createElementVNode as d, normalizeClass as v, withDirectives as A, createCommentVNode as H, vModelText as G, toDisplayString as P, normalizeStyle as X, createTextVNode as j } from "vue";
1
+ import { defineComponent as K, mergeModels as B, useModel as V, useTemplateRef as b, shallowRef as s, onBeforeMount as L, watch as y, nextTick as N, createBlock as M, openBlock as c, withCtx as C, createElementBlock as F, Fragment as W, renderList as I, renderSlot as f, createElementVNode as d, normalizeClass as v, withDirectives as A, createCommentVNode as H, vModelText as G, toDisplayString as P, normalizeStyle as X, createTextVNode as j } from "vue";
2
2
  import q from "../BaseDropDown.vue.js";
3
3
  import '../../../../../assets/BaseDropDown.css';/* empty css */
4
4
  import J from "../BaseSelect/SelectItem.vue.js";
5
5
  import { debounce as Q } from "@wikicasa-dev/utilities";
6
6
  const Y = ["readonly", "placeholder"], Z = ["innerHTML"], ae = /* @__PURE__ */ K({
7
7
  __name: "ClearableAutocomplete",
8
- props: /* @__PURE__ */ T({
8
+ props: /* @__PURE__ */ B({
9
9
  dataCy: {},
10
10
  placeholder: {},
11
11
  enableKeyboardController: { type: Boolean, default: !0 },
@@ -23,20 +23,20 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], ae = /* @__PURE__ */ K
23
23
  modelValue: { default: null },
24
24
  modelModifiers: {}
25
25
  }),
26
- emits: /* @__PURE__ */ T(["click", "update:inputValue", "keydown"], ["update:open", "update:modelValue"]),
27
- setup(l, { expose: F, emit: $ }) {
28
- const u = B(l, "open"), a = B(l, "modelValue"), p = $, O = b("inputRef"), o = s(a.value?.label || ""), k = s(0), m = s(!1), w = s(null), i = s([]), U = b("dropdownRef"), h = b("hiddenSpan"), x = () => {
26
+ emits: /* @__PURE__ */ B(["click", "update:inputValue", "keydown"], ["update:open", "update:modelValue"]),
27
+ setup(l, { expose: $, emit: E }) {
28
+ const u = V(l, "open"), a = V(l, "modelValue"), p = E, O = b("inputRef"), o = s(a.value?.label || ""), k = s(0), m = s(!1), w = s(null), i = s([]), g = b("dropdownRef"), h = b("hiddenSpan"), R = () => {
29
29
  o.value = "", a.value = null, p("update:inputValue", "");
30
- }, E = async (t) => {
30
+ }, U = async (t) => {
31
31
  if (p("update:inputValue", t), !t) {
32
32
  i.value = [], u.value = !1;
33
33
  return;
34
34
  }
35
35
  i.value = await w.value?.(t) || [], m.value = !0, u.value = !!i.value.length;
36
- }, g = (t = -1) => {
36
+ }, S = (t = -1) => {
37
37
  const e = i.value[t];
38
38
  !e || e.id === a.value?.id || (l.onOptionSelectedCb?.(e), o.value = e.label, u.value = !1, a.value = e, i.value = []);
39
- }, R = () => {
39
+ }, x = () => {
40
40
  O.value?.select();
41
41
  };
42
42
  return L(() => {
@@ -54,10 +54,10 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], ae = /* @__PURE__ */ K
54
54
  },
55
55
  { immediate: !0 }
56
56
  ), y(
57
- () => U.value?.selectedIdx,
57
+ () => g.value?.selectedIdx,
58
58
  (t) => {
59
59
  const e = t ?? -1;
60
- e !== -1 && g(e);
60
+ e !== -1 && S(e);
61
61
  }
62
62
  ), y(
63
63
  a,
@@ -65,9 +65,10 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], ae = /* @__PURE__ */ K
65
65
  t === e || t?.label === o.value || (o.value = t?.label || "");
66
66
  },
67
67
  { immediate: !0 }
68
- ), F({
69
- select: R
70
- }), (t, e) => (c(), V(q, {
68
+ ), $({
69
+ select: x,
70
+ getRootElement: () => g.value?.getRootElement()
71
+ }), (t, e) => (c(), M(q, {
71
72
  ref: "dropdownRef",
72
73
  class: "uikit-clearable-autocomplete",
73
74
  "data-cy": l.dataCy,
@@ -93,7 +94,7 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], ae = /* @__PURE__ */ K
93
94
  ref: "inputRef",
94
95
  "onUpdate:modelValue": [
95
96
  e[0] || (e[0] = (n) => o.value = n),
96
- E
97
+ U
97
98
  ],
98
99
  readonly: !!a.value?.label,
99
100
  class: v(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", l.inputClasses]),
@@ -115,7 +116,7 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], ae = /* @__PURE__ */ K
115
116
  fontSize: "inherit"
116
117
  }
117
118
  }, P(o.value), 513),
118
- a.value?.label ? (c(), M("button", {
119
+ a.value?.label ? (c(), F("button", {
119
120
  key: 0,
120
121
  type: "button",
121
122
  class: v(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButton?.classes]),
@@ -123,7 +124,7 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], ae = /* @__PURE__ */ K
123
124
  style: X({
124
125
  left: `${k.value + (l.clearButton?.offset || 10)}px`
125
126
  }),
126
- onClick: x
127
+ onClick: R
127
128
  }, [
128
129
  f(t.$slots, "clear-icon", {}, () => [
129
130
  e[5] || (e[5] = j("X", -1))
@@ -134,20 +135,20 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], ae = /* @__PURE__ */ K
134
135
  ], 2)
135
136
  ]),
136
137
  default: C(({ activeIdx: n, setActiveIdx: z }) => [
137
- (c(!0), M(W, null, I(i.value, (S, r) => (c(), V(J, {
138
+ (c(!0), F(W, null, I(i.value, (T, r) => (c(), M(J, {
138
139
  key: r,
139
140
  active: n === r,
140
141
  class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
141
- onClick: (D) => g(r),
142
+ onClick: (D) => S(r),
142
143
  onMouseover: (D) => z(r)
143
144
  }, {
144
145
  default: C(() => [
145
146
  f(t.$slots, "option-content", {
146
- option: S,
147
+ option: T,
147
148
  idx: r
148
149
  }, () => [
149
150
  d("span", {
150
- innerHTML: S.label
151
+ innerHTML: T.label
151
152
  }, null, 8, Z)
152
153
  ])
153
154
  ]),
@@ -1,11 +1,11 @@
1
- import { defineComponent as T, mergeModels as D, useId as H, useModel as E, shallowRef as x, computed as N, useTemplateRef as B, onMounted as V, onUnmounted as z, watch as l, nextTick as R, createElementBlock as U, openBlock as c, normalizeClass as a, renderSlot as I, createBlock as L, createVNode as q, unref as r, withCtx as S, createElementVNode as G, createCommentVNode as j, resolveDynamicComponent as F } from "vue";
1
+ import { defineComponent as T, mergeModels as E, useId as H, useModel as D, shallowRef as x, computed as N, useTemplateRef as B, onMounted as R, onUnmounted as V, watch as l, nextTick as z, createElementBlock as U, openBlock as f, normalizeClass as i, renderSlot as I, createBlock as L, createVNode as q, unref as r, withCtx as S, createElementVNode as G, createCommentVNode as j, resolveDynamicComponent as F } from "vue";
2
2
  import J from "./BaseButton.vue.js";
3
3
  import { ArrowIcon as P } from "@wikicasa-dev/svg-icons";
4
4
  import { useKeyboardController as Q } from "@wikicasa-dev/vue-composables";
5
5
  const X = ["innerHTML"], oe = /* @__PURE__ */ T({
6
6
  inheritAttrs: !1,
7
7
  __name: "BaseDropDown",
8
- props: /* @__PURE__ */ D({
8
+ props: /* @__PURE__ */ E({
9
9
  dropdownClasses: { default: "" },
10
10
  btnClasses: { default: "" },
11
11
  withArrowIcon: { type: Boolean, default: !1 },
@@ -27,38 +27,38 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ T({
27
27
  resetKeyboardController: { type: Boolean, default: !1 },
28
28
  resetKeyboardControllerModifiers: {}
29
29
  }),
30
- emits: /* @__PURE__ */ D(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController"]),
30
+ emits: /* @__PURE__ */ E(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController"]),
31
31
  setup(o, { expose: K, emit: A }) {
32
- const n = o, f = H(), k = A, v = E(o, "toggleDropdown"), w = E(
32
+ const n = o, k = H(), v = A, m = D(o, "toggleDropdown"), w = D(
33
33
  o,
34
34
  "resetKeyboardController"
35
35
  );
36
- let m = !1;
37
- const t = x(!1), u = x([]), M = N(() => u.value.length), p = B("container"), y = B("dropdown"), { activeIdx: d, selectedIdx: i } = Q({
36
+ let p = !1;
37
+ const t = x(!1), u = x([]), M = N(() => u.value.length), s = B("container"), y = B("dropdown"), { activeIdx: d, selectedIdx: a } = Q({
38
38
  optionsLength: M,
39
39
  isDropdownOpen: t,
40
40
  activate: n.activateKeyboardController
41
41
  }), O = () => {
42
42
  t.value = !1;
43
43
  }, b = ({ target: e }) => {
44
- p.value?.contains(e) || O();
44
+ s.value?.contains(e) || O();
45
45
  }, C = (e) => {
46
- t.value && p.value?.contains(document.activeElement) && (console.log("DEBUG:closing dropdown", document.activeElement), e.key === "Tab" && (t.value = !1));
47
- }, s = () => {
46
+ t.value && s.value?.contains(document.activeElement) && (console.log("DEBUG:closing dropdown", document.activeElement), e.key === "Tab" && (t.value = !1));
47
+ }, c = () => {
48
48
  n.keepState === "closed" && !t.value || n.keepState === "opened" && t.value || (t.value = !t.value);
49
49
  }, W = (e) => {
50
50
  e != null && (d.value = e);
51
51
  }, $ = (e) => {
52
- e != null && (i.value = e);
52
+ e != null && (a.value = e);
53
53
  }, h = () => {
54
54
  y.value && (u.value = Array.from(y.value.children));
55
55
  };
56
- return V(() => {
56
+ return R(() => {
57
57
  h();
58
- }), z(() => {
58
+ }), V(() => {
59
59
  n.closeWhenClickedOutside && (document.removeEventListener("click", b), document.removeEventListener("keydown", C));
60
60
  }), l(w, (e) => {
61
- e && (d.value = -1, i.value = -1, R(() => {
61
+ e && (d.value = -1, a.value = -1, z(() => {
62
62
  h(), w.value = !1;
63
63
  }));
64
64
  }), l(
@@ -70,46 +70,47 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ T({
70
70
  immediate: !0
71
71
  }
72
72
  ), l(t, (e) => {
73
- k("update:dropdownState", e);
73
+ v("update:dropdownState", e);
74
74
  }), l(t, (e) => {
75
- !e || m || !n.closeWhenClickedOutside || (document.addEventListener("click", b), document.addEventListener("keydown", C), m = !0);
76
- }), l(v, (e) => {
77
- e && (t.value = !t.value, v.value = !1);
78
- }), l(i, (e) => {
75
+ !e || p || !n.closeWhenClickedOutside || (document.addEventListener("click", b), document.addEventListener("keydown", C), p = !0);
76
+ }), l(m, (e) => {
77
+ e && (t.value = !t.value, m.value = !1);
78
+ }), l(a, (e) => {
79
79
  e !== -1 && u.value[e].querySelector("a")?.click();
80
80
  }), K({
81
81
  activeIdx: d,
82
- selectedIdx: i
83
- }), (e, g) => (c(), U("div", {
82
+ selectedIdx: a,
83
+ getRootElement: () => s.value
84
+ }), (e, g) => (f(), U("div", {
84
85
  ref: "container",
85
- class: a(["uikit-relative uikit-block", e.$attrs.class])
86
+ class: i(["uikit-relative uikit-block", e.$attrs.class])
86
87
  }, [
87
88
  I(e.$slots, "btn_slot", {
88
- toggleDropdown: s,
89
+ toggleDropdown: c,
89
90
  isOpen: t.value
90
91
  }, () => [
91
92
  q(J, {
92
- id: r(f),
93
+ id: r(k),
93
94
  type: "button",
94
95
  "data-cy": o.dataCy,
95
- class: a([
96
+ class: i([
96
97
  "!uikit-flex uikit-w-full uikit-items-center uikit-truncate",
97
98
  o.btnClasses
98
99
  ]),
99
100
  "aria-expanded": t.value,
100
101
  "btn-class": "uikit-btn-single-selection",
101
102
  onClick: g[0] || (g[0] = (Y) => {
102
- k("click"), s();
103
+ v("click"), c();
103
104
  })
104
105
  }, {
105
106
  default: S(() => [
106
107
  G("span", {
107
- class: a(["uikit-mr-5px", o.labelClasses]),
108
+ class: i(["uikit-mr-5px", o.labelClasses]),
108
109
  innerHTML: o.btnLabel
109
110
  }, null, 10, X),
110
- o.withArrowIcon ? (c(), L(r(P), {
111
+ o.withArrowIcon ? (f(), L(r(P), {
111
112
  key: 0,
112
- class: a(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
113
+ class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
113
114
  width: o.arrowWidth,
114
115
  height: o.arrowWidth,
115
116
  "stroke-color": o.arrowStrokeColor
@@ -118,11 +119,11 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ T({
118
119
  _: 1
119
120
  }, 8, ["id", "data-cy", "class", "aria-expanded"])
120
121
  ]),
121
- (c(), L(F(o.dropdownElement), {
122
- id: "dropdown_" + r(f),
122
+ (f(), L(F(o.dropdownElement), {
123
+ id: "dropdown_" + r(k),
123
124
  ref: "dropdown",
124
125
  "data-cy": o.dataCy && `${o.dataCy}_dropdown`,
125
- class: a(["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", [
126
+ 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", [
126
127
  o.dropdownClasses,
127
128
  t.value ? "uikit-flex" : "uikit-hidden",
128
129
  { "uikit-bottom-[55px] uikit-rounded-xs": o.direction === "up" },
@@ -134,9 +135,9 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ T({
134
135
  default: S(() => [
135
136
  I(e.$slots, "default", {
136
137
  isOpen: t.value,
137
- toggleDropdown: s,
138
+ toggleDropdown: c,
138
139
  activeIdx: r(d),
139
- selectedIdx: r(i),
140
+ selectedIdx: r(a),
140
141
  setActiveIdx: W,
141
142
  setSelectedIdx: $
142
143
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.8-alpha.26",
3
+ "version": "2.2.8-alpha.27",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",