@wikicasa-dev/components 2.2.8-alpha.12 → 2.2.8-alpha.13

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.
@@ -7,6 +7,10 @@ type __VLS_Props = {
7
7
  customModalHeaderClasses?: ClassTypeProp;
8
8
  customModalBodyClasses?: ClassTypeProp;
9
9
  customModalFooterClasses?: ClassTypeProp;
10
+ closeIcon?: Partial<{
11
+ size?: number;
12
+ classes?: ClassTypeProp;
13
+ }>;
10
14
  withCloseIcon?: boolean;
11
15
  showModal?: boolean;
12
16
  headerTitle?: string;
@@ -1,7 +1,7 @@
1
- import { defineComponent as T, ref as n, useTemplateRef as z, onUnmounted as H, watch as I, createBlock as O, openBlock as r, Teleport as $, createElementVNode as l, normalizeClass as s, withModifiers as y, createElementBlock as h, createCommentVNode as w, renderSlot as d, createVNode as D, unref as K, nextTick as N } from "vue";
1
+ import { defineComponent as I, ref as n, useTemplateRef as T, onUnmounted as z, watch as H, createBlock as O, openBlock as r, Teleport as $, createElementVNode as l, normalizeClass as s, withModifiers as y, createElementBlock as h, createCommentVNode as w, renderSlot as d, createVNode as D, unref as K, nextTick as N } from "vue";
2
2
  import { isWindows as C, awaitableSetTimeout as S } from "@wikicasa-dev/utilities";
3
3
  import { CloseIcon as V } from "@wikicasa-dev/svg-icons";
4
- const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
4
+ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ I({
5
5
  __name: "BaseModal",
6
6
  props: {
7
7
  id: { default: "base-bt-modal" },
@@ -11,6 +11,7 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
11
11
  customModalHeaderClasses: {},
12
12
  customModalBodyClasses: {},
13
13
  customModalFooterClasses: {},
14
+ closeIcon: {},
14
15
  withCloseIcon: { type: Boolean, default: !0 },
15
16
  showModal: { type: Boolean, default: !0 },
16
17
  headerTitle: { default: "" },
@@ -24,7 +25,7 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
24
25
  },
25
26
  emits: ["closed", "opened", "dialogClick"],
26
27
  setup(e, { emit: g }) {
27
- const c = g, i = n(!1), m = n(null), a = z("modalDialog"), k = n(!1), u = n(!1), f = ({ key: t }) => {
28
+ const c = g, i = n(!1), m = n(null), a = T("modalDialog"), k = n(!1), u = n(!1), f = ({ key: t }) => {
28
29
  t === "Escape" && o();
29
30
  }, x = () => {
30
31
  document?.body.addEventListener("keydown", f);
@@ -53,9 +54,9 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
53
54
  m.value?.classList.add("uikit-hidden"), c("closed");
54
55
  }, 250);
55
56
  };
56
- return H(() => {
57
+ return z(() => {
57
58
  b(), document?.documentElement.classList.remove("uikit-no-scrolling"), C() ? document?.body.classList.remove("uikit-no-scrolling", "sm:uikit-pr-15px") : document?.body.classList.remove("uikit-no-scrolling");
58
- }), I(
59
+ }), H(
59
60
  () => e.showModal,
60
61
  async (t) => {
61
62
  !t && !i.value ? k.value = !0 : k.value = !1, t && !i.value && await p(), !t && i.value && await o(), i.value = t;
@@ -102,16 +103,16 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
102
103
  key: 0,
103
104
  id: "close-icon-btn",
104
105
  "data-cy": "bbt-default-close-icon-btn",
105
- class: s(["uikit-absolute uikit-right-15px uikit-top-15px uikit-z-10 uikit-bg-transparent", e.closeIconBtnClasses]),
106
+ class: s(["uikit-absolute uikit-right-15px uikit-top-15px uikit-z-10 uikit-bg-transparent uikit-p-5px", e.closeIconBtnClasses]),
106
107
  type: "button",
107
108
  "aria-label": "Close",
108
109
  onClick: y(o, ["prevent", "stop"])
109
110
  }, [
110
111
  D(K(V), {
111
- class: "bbt-close-icon uikit-box-border uikit-p-5px",
112
- width: 30,
113
- height: 30
114
- })
112
+ class: s(["bbt-close-icon uikit-box-border", e.closeIcon?.classes]),
113
+ width: e.closeIcon?.size || 30,
114
+ height: e.closeIcon?.size || 30
115
+ }, null, 8, ["class", "width", "height"])
115
116
  ], 2)) : w("", !0),
116
117
  d(t.$slots, "header", { closeModal: o }, () => [
117
118
  l("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.8-alpha.12",
3
+ "version": "2.2.8-alpha.13",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",