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

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