@wikicasa-dev/components 2.4.1-alpha.7 → 2.4.1-alpha.9

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