@wikicasa-dev/components 2.2.8-alpha.21 → 2.2.8-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-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-keyboard.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-keyboard.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-keyboard.css';/* empty css */
2
+ import '../assets/swiper-thumbs.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as L, mergeModels as C, useId as E, useModel as h, shallowRef as g, computed as O, useTemplateRef as W, watch as a, onBeforeMount as $, onMounted as T, onUnmounted as H, nextTick as N, createElementBlock as V, openBlock as f, normalizeClass as n, renderSlot as D, createBlock as x, createVNode as R, unref as d, withCtx as B, createElementVNode as q, createCommentVNode as z, resolveDynamicComponent as U, withModifiers as j } from "vue";
1
+ import { defineComponent as O, mergeModels as h, useId as W, useModel as g, shallowRef as D, computed as $, useTemplateRef as T, onMounted as H, onUnmounted as N, watch as i, nextTick as V, createElementBlock as z, openBlock as f, normalizeClass as n, renderSlot as x, createBlock as I, createVNode as R, withModifiers as B, unref as r, withCtx as S, createElementVNode as q, createCommentVNode as U, resolveDynamicComponent as j } from "vue";
2
2
  import F from "./BaseButton.vue.js";
3
3
  import { ArrowIcon as G } from "@wikicasa-dev/svg-icons";
4
4
  import { useKeyboardController as J } from "@wikicasa-dev/vue-composables";
5
- const P = ["innerHTML"], ee = /* @__PURE__ */ L({
5
+ const P = ["innerHTML"], ee = /* @__PURE__ */ O({
6
6
  inheritAttrs: !1,
7
7
  __name: "BaseDropDown",
8
- props: /* @__PURE__ */ C({
8
+ props: /* @__PURE__ */ h({
9
9
  dropdownClasses: { default: "" },
10
10
  btnClasses: { default: "" },
11
11
  withArrowIcon: { type: Boolean, default: !1 },
@@ -27,17 +27,37 @@ const P = ["innerHTML"], ee = /* @__PURE__ */ L({
27
27
  resetKeyboardController: { type: Boolean, default: !1 },
28
28
  resetKeyboardControllerModifiers: {}
29
29
  }),
30
- emits: /* @__PURE__ */ C(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController"]),
31
- setup(t, { expose: I, emit: S }) {
32
- const l = t, k = E(), w = S, v = h(t, "toggleDropdown"), m = h(
30
+ emits: /* @__PURE__ */ h(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController"]),
31
+ setup(t, { expose: A, emit: E }) {
32
+ const l = t, k = W(), w = E, v = g(t, "toggleDropdown"), m = g(
33
33
  t,
34
34
  "resetKeyboardController"
35
- ), o = g(!1), s = g([]), M = O(() => s.value.length), p = W("dropdown"), { activeIdx: r, selectedIdx: i } = J({
36
- optionsLength: M,
35
+ );
36
+ let p = !1;
37
+ const o = D(!1), s = D([]), K = $(() => s.value.length), b = T("dropdown"), { activeIdx: d, selectedIdx: a } = J({
38
+ optionsLength: K,
37
39
  isDropdownOpen: o,
38
40
  activate: l.activateKeyboardController
39
- });
40
- a(
41
+ }), C = () => {
42
+ o.value = !1;
43
+ }, c = () => {
44
+ l.keepState === "closed" && !o.value || l.keepState === "opened" && o.value || (o.value = !o.value);
45
+ }, L = (e) => {
46
+ e != null && (d.value = e);
47
+ }, M = (e) => {
48
+ e != null && (a.value = e);
49
+ }, y = () => {
50
+ b.value && (s.value = Array.from(b.value.children));
51
+ };
52
+ return H(() => {
53
+ y();
54
+ }), N(() => {
55
+ l.closeWhenClickedOutside && document.removeEventListener("click", C);
56
+ }), i(m, (e) => {
57
+ e && (d.value = -1, a.value = -1, V(() => {
58
+ y(), m.value = !1;
59
+ }));
60
+ }), i(
41
61
  () => l.openDropdown,
42
62
  (e) => {
43
63
  o.value = e;
@@ -45,48 +65,26 @@ const P = ["innerHTML"], ee = /* @__PURE__ */ L({
45
65
  {
46
66
  immediate: !0
47
67
  }
48
- ), a(o, (e) => {
68
+ ), i(o, (e) => {
49
69
  w("update:dropdownState", e);
50
- }), a(v, (e) => {
70
+ }), i(o, (e) => {
71
+ !e || p || !l.closeWhenClickedOutside || (document.addEventListener("click", C), p = !0);
72
+ }), i(v, (e) => {
51
73
  e && (o.value = !o.value, v.value = !1);
52
- }), a(i, (e) => {
74
+ }), i(a, (e) => {
53
75
  e !== -1 && s.value[e].querySelector("a")?.click();
54
- });
55
- const b = () => {
56
- o.value = !1;
57
- }, c = () => {
58
- l.keepState === "closed" && !o.value || l.keepState === "opened" && o.value || (o.value = !o.value);
59
- }, A = (e) => {
60
- e != null && (r.value = e);
61
- }, K = (e) => {
62
- e != null && (i.value = e);
63
- };
64
- $(() => {
65
- l.closeWhenClickedOutside && document.addEventListener("click", b);
66
- });
67
- const y = () => {
68
- p.value && (s.value = Array.from(p.value.children));
69
- };
70
- return T(() => {
71
- y();
72
- }), H(() => {
73
- l.closeWhenClickedOutside && document.removeEventListener("click", b);
74
- }), a(m, (e) => {
75
- e && (r.value = -1, i.value = -1, N(() => {
76
- y(), m.value = !1;
77
- }));
78
- }), I({
79
- activeIdx: r,
80
- selectedIdx: i
81
- }), (e, u) => (f(), V("div", {
76
+ }), A({
77
+ activeIdx: d,
78
+ selectedIdx: a
79
+ }), (e, u) => (f(), z("div", {
82
80
  class: n(["uikit-relative uikit-block", e.$attrs.class])
83
81
  }, [
84
- D(e.$slots, "btn_slot", {
82
+ x(e.$slots, "btn_slot", {
85
83
  toggleDropdown: c,
86
84
  isOpen: o.value
87
85
  }, () => [
88
86
  R(F, {
89
- id: d(k),
87
+ id: r(k),
90
88
  type: "button",
91
89
  "data-cy": t.dataCy,
92
90
  class: n([
@@ -95,28 +93,28 @@ const P = ["innerHTML"], ee = /* @__PURE__ */ L({
95
93
  ]),
96
94
  "aria-expanded": o.value,
97
95
  "btn-class": "uikit-btn-single-selection",
98
- onClick: u[0] || (u[0] = (Q) => {
96
+ onClick: u[0] || (u[0] = B((Q) => {
99
97
  w("click"), c();
100
- })
98
+ }, ["stop"]))
101
99
  }, {
102
- default: B(() => [
100
+ default: S(() => [
103
101
  q("span", {
104
102
  class: n(["uikit-mr-5px", t.labelClasses]),
105
103
  innerHTML: t.btnLabel
106
104
  }, null, 10, P),
107
- t.withArrowIcon ? (f(), x(d(G), {
105
+ t.withArrowIcon ? (f(), I(r(G), {
108
106
  key: 0,
109
107
  class: n(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", o.value ? "uikit-rotate-180" : ""]),
110
108
  width: t.arrowWidth,
111
109
  height: t.arrowWidth,
112
110
  "stroke-color": t.arrowStrokeColor
113
- }, null, 8, ["class", "width", "height", "stroke-color"])) : z("", !0)
111
+ }, null, 8, ["class", "width", "height", "stroke-color"])) : U("", !0)
114
112
  ]),
115
113
  _: 1
116
114
  }, 8, ["id", "data-cy", "class", "aria-expanded"])
117
115
  ]),
118
- (f(), x(U(t.dropdownElement), {
119
- id: "dropdown_" + d(k),
116
+ (f(), I(j(t.dropdownElement), {
117
+ id: "dropdown_" + r(k),
120
118
  ref: "dropdown",
121
119
  "data-cy": t.dataCy && `${t.dataCy}_dropdown`,
122
120
  class: n(["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", [
@@ -127,17 +125,17 @@ const P = ["innerHTML"], ee = /* @__PURE__ */ L({
127
125
  { "uikit-absolute": t.isAbsolute }
128
126
  ]]),
129
127
  "aria-hidden": !o.value,
130
- onClick: u[1] || (u[1] = j(() => {
128
+ onClick: u[1] || (u[1] = B(() => {
131
129
  }, ["stop"]))
132
130
  }, {
133
- default: B(() => [
134
- D(e.$slots, "default", {
131
+ default: S(() => [
132
+ x(e.$slots, "default", {
135
133
  isOpen: o.value,
136
134
  toggleDropdown: c,
137
- activeIdx: d(r),
138
- selectedIdx: d(i),
139
- setActiveIdx: A,
140
- setSelectedIdx: K
135
+ activeIdx: r(d),
136
+ selectedIdx: r(a),
137
+ setActiveIdx: L,
138
+ setSelectedIdx: M
141
139
  })
142
140
  ]),
143
141
  _: 3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.8-alpha.21",
3
+ "version": "2.2.8-alpha.22",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",