@wikicasa-dev/components 2.4.1-alpha.6 → 2.4.1-alpha.8

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-keyboard.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-keyboard.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-keyboard.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-keyboard.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as z, mergeModels as h, useModel as T, useTemplateRef as v, shallowRef as $, onUnmounted as H, createBlock as O, openBlock as c, Teleport as F, createVNode as w, Transition as U, withCtx as K, withDirectives as N, createElementVNode as l, normalizeClass as i, createElementBlock as y, createCommentVNode as C, renderSlot as d, withModifiers as S, unref as V, vShow as A } from "vue";
2
- import { CloseIcon as G } from "@wikicasa-dev/svg-icons";
3
- const P = ["id", "data-cy"], R = ["innerHTML"], J = /* @__PURE__ */ z({
1
+ import { defineComponent as $, mergeModels as w, useModel as H, useTemplateRef as C, shallowRef as p, onUnmounted as O, createBlock as F, openBlock as n, Teleport as A, createVNode as x, Transition as K, withCtx as N, createElementBlock as m, createCommentVNode as f, normalizeClass as i, createElementVNode as d, renderSlot as r, withModifiers as U, unref as V } from "vue";
2
+ import { CloseIcon as P } from "@wikicasa-dev/svg-icons";
3
+ const R = ["id", "data-cy"], S = ["innerHTML"], q = /* @__PURE__ */ $({
4
4
  __name: "BaseModal",
5
- props: /* @__PURE__ */ h({
5
+ props: /* @__PURE__ */ w({
6
6
  id: { default: "base-bt-modal" },
7
7
  size: { default: "modal-md" },
8
8
  customBackdropClasses: {},
@@ -25,75 +25,71 @@ const P = ["id", "data-cy"], R = ["innerHTML"], J = /* @__PURE__ */ z({
25
25
  showModal: { type: Boolean, default: !0 },
26
26
  showModalModifiers: {}
27
27
  }),
28
- emits: /* @__PURE__ */ h(["closed", "opened", "dialogClick"], ["update:showModal"]),
29
- setup(e, { emit: p }) {
30
- const r = p, o = T(e, "showModal"), k = v("backdrop"), s = v("modalDialog"), u = $(!1), m = ({ key: t }) => {
28
+ emits: /* @__PURE__ */ w(["closed", "opened", "dialogClick"], ["update:showModal"]),
29
+ setup(e, { emit: g }) {
30
+ const c = g, o = H(e, "showModal"), b = C("backdrop"), s = C("modalDialog"), l = p(!1), k = p(!1), v = ({ key: t }) => {
31
31
  t === "Escape" && a();
32
- }, x = () => {
33
- document?.body.addEventListener("keydown", m);
34
- }, f = () => {
35
- document?.body.removeEventListener("keydown", m);
36
- };
37
- console.log("DEBUG: BaseModal setup called", {
38
- showModal: o.value,
39
- timestamp: Date.now()
40
- });
41
- const g = () => {
42
- console.log("DEBUG:onBeforeEnter called", {
32
+ }, M = () => {
33
+ document?.body.addEventListener("keydown", v);
34
+ }, h = () => {
35
+ document?.body.removeEventListener("keydown", v);
36
+ }, B = () => {
37
+ k.value || (console.log("DEBUG:onBeforeEnter called", {
43
38
  timestamp: Date.now(),
44
39
  showModal: o.value,
45
40
  stack: new Error().stack
46
- }), x(), document?.body.classList.add(
41
+ }), M(), document?.body.classList.add(
47
42
  "sm:uikit-pr-15px",
48
43
  "sm:uikit-mr-0",
49
44
  "uikit-overflow-hidden"
50
- );
51
- }, M = () => {
52
- r("opened"), e.autoClose !== void 0 && setTimeout(() => {
45
+ ), k.value = !0);
46
+ }, E = () => {
47
+ c("opened"), e.autoClose !== void 0 && setTimeout(() => {
53
48
  a();
54
49
  }, e.autoClose);
55
- }, B = () => {
56
- f(), document?.body.classList.remove(
50
+ }, I = () => {
51
+ h(), document?.body.classList.remove(
57
52
  "sm:uikit-pr-15px",
58
53
  "sm:uikit-mr-0",
59
54
  "uikit-overflow-hidden"
60
- ), r("closed");
55
+ ), k.value = !1, c("closed");
61
56
  }, a = () => {
62
57
  o.value = !1;
63
- }, E = (t) => {
64
- s.value && s.value.contains(t.target) && (u.value = !0);
65
- }, I = (t) => {
66
- s.value && s.value.contains(t.target) && (u.value = !1);
67
- }, D = async (t) => {
68
- if (!(t.target !== k.value && k.value?.contains(t.target)) && e.closeOnClickOut) {
69
- if (u.value) {
70
- u.value = !1;
58
+ }, L = (t) => {
59
+ s.value && s.value.contains(t.target) && (l.value = !0);
60
+ }, z = (t) => {
61
+ s.value && s.value.contains(t.target) && (l.value = !1);
62
+ }, T = async (t) => {
63
+ if (!(t.target !== b.value && b.value?.contains(t.target)) && e.closeOnClickOut) {
64
+ if (l.value) {
65
+ l.value = !1;
71
66
  return;
72
67
  }
73
68
  a();
74
69
  }
75
70
  };
76
- H(() => {
77
- f(), document?.body.classList.remove(
71
+ O(() => {
72
+ h(), document?.body.classList.remove(
78
73
  "sm:uikit-pr-15px",
79
74
  "sm:uikit-mr-0",
80
75
  "uikit-overflow-hidden"
81
76
  );
82
77
  });
83
- const L = (t) => {
78
+ const D = (t) => {
84
79
  s.value === t.target && t.stopPropagation();
85
80
  };
86
- return (t, n) => (c(), O(F, { to: "body" }, [
87
- w(U, {
81
+ return (t, u) => (n(), F(A, { to: "body" }, [
82
+ x(K, {
88
83
  appear: e.appear,
89
84
  name: "modal-transition",
90
85
  duration: { enter: 500, leave: 250 },
91
- onBeforeEnter: g,
92
- onAfterEnter: M,
93
- onAfterLeave: B
86
+ onBeforeEnter: B,
87
+ onAfterEnter: E,
88
+ onAfterLeave: I
94
89
  }, {
95
- default: K(() => [
96
- N(l("div", {
90
+ default: N(() => [
91
+ o.value ? (n(), m("div", {
92
+ key: 0,
97
93
  ref: "backdrop",
98
94
  class: i(["bbt-backdrop uikit-fixed uikit-left-0 uikit-top-0 uikit-z-50 uikit-h-full uikit-w-full", [
99
95
  e.customBackdropClasses,
@@ -103,11 +99,11 @@ const P = ["id", "data-cy"], R = ["innerHTML"], J = /* @__PURE__ */ z({
103
99
  { "uikit-bg-transparent": !o.value },
104
100
  { "sm:uikit-pt-[30px]": !e.centered }
105
101
  ]]),
106
- onClick: D,
107
- onMousedown: E,
108
- onMouseup: I
102
+ onClick: T,
103
+ onMousedown: L,
104
+ onMouseup: z
109
105
  }, [
110
- l("dialog", {
106
+ d("dialog", {
111
107
  id: e.id,
112
108
  ref: "modalDialog",
113
109
  "data-cy": e.dataCy,
@@ -121,50 +117,48 @@ const P = ["id", "data-cy"], R = ["innerHTML"], J = /* @__PURE__ */ z({
121
117
  e.fullHeight ? "uikit-h-[95%]" : "uikit-h-auto"
122
118
  ]]),
123
119
  tabindex: "-1",
124
- onClick: n[1] || (n[1] = (b) => r("dialogClick", b)),
125
- onFocusin: L
120
+ onClick: u[1] || (u[1] = (y) => c("dialogClick", y)),
121
+ onFocusin: D
126
122
  }, [
127
- l("div", {
123
+ d("div", {
128
124
  class: i(["default-header uikit-sticky uikit-top-0 uikit-z-10 uikit-rounded-t uikit-border-0 uikit-bg-white uikit-px-4 uikit-pb-10px uikit-pt-20px sm:uikit-px-6", [e.customModalHeaderClasses]])
129
125
  }, [
130
- e.withCloseIcon ? (c(), y("button", {
126
+ e.withCloseIcon ? (n(), m("button", {
131
127
  key: 0,
132
128
  id: "close-icon-btn",
133
129
  "data-cy": "bbt-default-close-icon-btn",
134
130
  class: i(["uikit-absolute uikit-right-15px uikit-top-15px uikit-z-10 uikit-bg-transparent uikit-p-5px", e.closeIconBtnClasses]),
135
131
  type: "button",
136
132
  "aria-label": "Close",
137
- onClick: n[0] || (n[0] = S((b) => o.value = !1, ["prevent", "stop"]))
133
+ onClick: u[0] || (u[0] = U((y) => o.value = !1, ["prevent", "stop"]))
138
134
  }, [
139
- w(V(G), {
135
+ x(V(P), {
140
136
  class: i(["bbt-close-icon uikit-box-border", e.closeIcon?.classes]),
141
137
  width: e.closeIcon?.size || 20,
142
138
  height: e.closeIcon?.size || 20
143
139
  }, null, 8, ["class", "width", "height"])
144
- ], 2)) : C("", !0),
145
- d(t.$slots, "header", { closeModal: a }, () => [
146
- l("span", {
140
+ ], 2)) : f("", !0),
141
+ r(t.$slots, "header", { closeModal: a }, () => [
142
+ d("span", {
147
143
  class: i(["uikit-w-auto uikit-text-18 uikit-font-semibold sm:uikit-text-22", e.titleClasses]),
148
144
  innerHTML: e.headerTitle
149
- }, null, 10, R)
145
+ }, null, 10, S)
150
146
  ])
151
147
  ], 2),
152
- l("div", {
148
+ d("div", {
153
149
  class: i(["uikit-bbt-body uikit-flex-auto uikit-overflow-y-auto uikit-overflow-x-hidden uikit-px-4 uikit-pb-0 uikit-no-scrollbar sm:uikit-px-6 sm:uikit-pb-25px", [e.customModalBodyClasses]])
154
150
  }, [
155
- d(t.$slots, "body", { closeModal: a })
151
+ r(t.$slots, "body", { closeModal: a })
156
152
  ], 2),
157
- t.$slots.footer ? (c(), y("div", {
153
+ t.$slots.footer ? (n(), m("div", {
158
154
  key: 0,
159
155
  class: i(["uikit-bbt-footer uikit-sticky uikit-bottom-0 uikit-border-0 uikit-bg-white uikit-px-4 uikit-py-15px sm:uikit-px-6", e.customModalFooterClasses])
160
156
  }, [
161
- d(t.$slots, "footer", { closeModal: a })
162
- ], 2)) : C("", !0),
163
- d(t.$slots, "fixed-bottom")
164
- ], 42, P)
165
- ], 34), [
166
- [A, o.value]
167
- ])
157
+ r(t.$slots, "footer", { closeModal: a })
158
+ ], 2)) : f("", !0),
159
+ r(t.$slots, "fixed-bottom")
160
+ ], 42, R)
161
+ ], 34)) : f("", !0)
168
162
  ]),
169
163
  _: 3
170
164
  }, 8, ["appear"])
@@ -172,5 +166,5 @@ const P = ["id", "data-cy"], R = ["innerHTML"], J = /* @__PURE__ */ z({
172
166
  }
173
167
  });
174
168
  export {
175
- J as default
169
+ q as default
176
170
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.4.1-alpha.6",
3
+ "version": "2.4.1-alpha.8",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",