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