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

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-keyboard.css';/* empty css */
2
+ import '../assets/swiper-controller.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-keyboard.css';/* empty css */
2
+ import '../assets/swiper-controller.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-keyboard.css';/* empty css */
2
+ import '../assets/swiper-controller.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-keyboard.css';/* empty css */
2
+ import '../assets/swiper-controller.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -12,7 +12,6 @@ type __VLS_Props = {
12
12
  classes?: ClassTypeProp;
13
13
  }>;
14
14
  withCloseIcon?: boolean;
15
- showModal?: boolean;
16
15
  headerTitle?: string;
17
16
  autoClose?: number;
18
17
  fullHeight?: boolean;
@@ -26,6 +25,9 @@ type __VLS_Props = {
26
25
  titleClasses?: ClassTypeProp;
27
26
  appear?: boolean;
28
27
  };
28
+ type __VLS_PublicProps = {
29
+ "showModal"?: boolean;
30
+ } & __VLS_Props;
29
31
  declare function __VLS_template(): {
30
32
  attrs: Partial<{}>;
31
33
  slots: {
@@ -47,14 +49,16 @@ declare function __VLS_template(): {
47
49
  rootEl: any;
48
50
  };
49
51
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
50
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
52
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
51
53
  opened: () => any;
52
54
  closed: () => any;
53
55
  dialogClick: (args_0: MouseEvent) => any;
54
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
56
+ "update:showModal": (value: boolean) => any;
57
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
55
58
  onOpened?: (() => any) | undefined;
56
59
  onClosed?: (() => any) | undefined;
57
60
  onDialogClick?: ((args_0: MouseEvent) => any) | undefined;
61
+ "onUpdate:showModal"?: ((value: boolean) => any) | undefined;
58
62
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
59
63
  backdrop: HTMLDivElement;
60
64
  modalDialog: HTMLDialogElement;
@@ -1,8 +1,8 @@
1
- import { defineComponent as T, shallowRef as v, useTemplateRef as h, onUnmounted as D, watch as $, createBlock as H, openBlock as c, Teleport as O, createVNode as y, Transition as F, withCtx as K, withDirectives as N, createElementVNode as l, normalizeClass as i, createElementBlock as C, createCommentVNode as w, renderSlot as d, withModifiers as S, unref as U, vShow as V } from "vue";
2
- import { CloseIcon as A } from "@wikicasa-dev/svg-icons";
3
- const P = ["id", "data-cy"], R = ["innerHTML"], q = /* @__PURE__ */ T({
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({
4
4
  __name: "BaseModal",
5
- props: {
5
+ props: /* @__PURE__ */ h({
6
6
  id: { default: "base-bt-modal" },
7
7
  size: { default: "modal-md" },
8
8
  customBackdropClasses: {},
@@ -12,7 +12,6 @@ const P = ["id", "data-cy"], R = ["innerHTML"], q = /* @__PURE__ */ T({
12
12
  customModalFooterClasses: {},
13
13
  closeIcon: {},
14
14
  withCloseIcon: { type: Boolean, default: !0 },
15
- showModal: { type: Boolean, default: !0 },
16
15
  headerTitle: { default: "" },
17
16
  autoClose: {},
18
17
  fullHeight: { type: Boolean, default: !1 },
@@ -22,33 +21,36 @@ const P = ["id", "data-cy"], R = ["innerHTML"], q = /* @__PURE__ */ T({
22
21
  closeIconBtnClasses: {},
23
22
  titleClasses: {},
24
23
  appear: { type: Boolean, default: !0 }
25
- },
26
- emits: ["closed", "opened", "dialogClick"],
27
- setup(e, { emit: x }) {
28
- const r = x, o = v(!1), k = h("backdrop"), s = h("modalDialog"), u = v(!1), m = ({ key: t }) => {
29
- t === "Escape" && a();
30
- }, p = () => {
24
+ }, {
25
+ showModal: { type: Boolean, default: !0 },
26
+ showModalModifiers: {}
27
+ }),
28
+ emits: /* @__PURE__ */ h(["closed", "opened", "dialogClick"], ["update:showModal"]),
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();
32
+ }, x = () => {
31
33
  document?.body.addEventListener("keydown", m);
32
34
  }, f = () => {
33
35
  document?.body.removeEventListener("keydown", m);
34
36
  }, g = () => {
35
- console.log("DEBUG:onBeforeEnter called"), p(), document?.body.classList.add(
37
+ console.log("DEBUG:onBeforeEnter called"), x(), document?.body.classList.add(
36
38
  "sm:uikit-pr-15px",
37
39
  "sm:uikit-mr-0",
38
40
  "uikit-overflow-hidden"
39
41
  );
40
- }, B = () => {
42
+ }, M = () => {
41
43
  r("opened"), e.autoClose !== void 0 && setTimeout(() => {
42
- a();
44
+ o();
43
45
  }, e.autoClose);
44
- }, M = () => {
46
+ }, B = () => {
45
47
  f(), document?.body.classList.remove(
46
48
  "sm:uikit-pr-15px",
47
49
  "sm:uikit-mr-0",
48
50
  "uikit-overflow-hidden"
49
51
  ), r("closed");
50
- }, a = () => {
51
- o.value = !1;
52
+ }, o = () => {
53
+ a.value = !1;
52
54
  }, E = (t) => {
53
55
  s.value && s.value.contains(t.target) && (u.value = !0);
54
56
  }, I = (t) => {
@@ -59,43 +61,37 @@ const P = ["id", "data-cy"], R = ["innerHTML"], q = /* @__PURE__ */ T({
59
61
  u.value = !1;
60
62
  return;
61
63
  }
62
- a();
64
+ o();
63
65
  }
64
66
  };
65
- D(() => {
67
+ H(() => {
66
68
  f(), document?.body.classList.remove(
67
69
  "sm:uikit-pr-15px",
68
70
  "sm:uikit-mr-0",
69
71
  "uikit-overflow-hidden"
70
72
  );
71
- }), $(
72
- () => e.showModal,
73
- async (t) => {
74
- o.value = t;
75
- },
76
- { immediate: !0 }
77
- );
73
+ });
78
74
  const z = (t) => {
79
75
  s.value === t.target && t.stopPropagation();
80
76
  };
81
- return (t, n) => (c(), H(O, { to: "body" }, [
82
- y(F, {
77
+ return (t, n) => (c(), O(F, { to: "body" }, [
78
+ y(K, {
83
79
  appear: e.appear,
84
80
  name: "modal-transition",
85
81
  duration: { enter: 500, leave: 250 },
86
82
  onBeforeEnter: g,
87
- onAfterEnter: B,
88
- onAfterLeave: M
83
+ onAfterEnter: M,
84
+ onAfterLeave: B
89
85
  }, {
90
- default: K(() => [
91
- N(l("div", {
86
+ default: N(() => [
87
+ S(l("div", {
92
88
  ref: "backdrop",
93
89
  class: i(["bbt-backdrop uikit-fixed uikit-left-0 uikit-top-0 uikit-z-50 uikit-h-full uikit-w-full", [
94
90
  e.customBackdropClasses,
95
91
  {
96
- "uikit-bg-w-secondary/70": o.value
92
+ "uikit-bg-w-secondary/70": a.value
97
93
  },
98
- { "uikit-bg-transparent": !o.value },
94
+ { "uikit-bg-transparent": !a.value },
99
95
  { "sm:uikit-pt-[30px]": !e.centered }
100
96
  ]]),
101
97
  onClick: L,
@@ -129,36 +125,36 @@ const P = ["id", "data-cy"], R = ["innerHTML"], q = /* @__PURE__ */ T({
129
125
  class: i(["uikit-absolute uikit-right-15px uikit-top-15px uikit-z-10 uikit-bg-transparent uikit-p-5px", e.closeIconBtnClasses]),
130
126
  type: "button",
131
127
  "aria-label": "Close",
132
- onClick: n[0] || (n[0] = S((b) => o.value = !1, ["prevent", "stop"]))
128
+ onClick: n[0] || (n[0] = U((b) => a.value = !1, ["prevent", "stop"]))
133
129
  }, [
134
- y(U(A), {
130
+ y(V(P), {
135
131
  class: i(["bbt-close-icon uikit-box-border", e.closeIcon?.classes]),
136
132
  width: e.closeIcon?.size || 20,
137
133
  height: e.closeIcon?.size || 20
138
134
  }, null, 8, ["class", "width", "height"])
139
135
  ], 2)) : w("", !0),
140
- d(t.$slots, "header", { closeModal: a }, () => [
136
+ d(t.$slots, "header", { closeModal: o }, () => [
141
137
  l("span", {
142
138
  class: i(["uikit-w-auto uikit-text-18 uikit-font-semibold sm:uikit-text-22", e.titleClasses]),
143
139
  innerHTML: e.headerTitle
144
- }, null, 10, R)
140
+ }, null, 10, G)
145
141
  ])
146
142
  ], 2),
147
143
  l("div", {
148
144
  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]])
149
145
  }, [
150
- d(t.$slots, "body", { closeModal: a })
146
+ d(t.$slots, "body", { closeModal: o })
151
147
  ], 2),
152
148
  t.$slots.footer ? (c(), C("div", {
153
149
  key: 0,
154
150
  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])
155
151
  }, [
156
- d(t.$slots, "footer", { closeModal: a })
152
+ d(t.$slots, "footer", { closeModal: o })
157
153
  ], 2)) : w("", !0),
158
154
  d(t.$slots, "fixed-bottom")
159
- ], 42, P)
155
+ ], 42, R)
160
156
  ], 34), [
161
- [V, o.value]
157
+ [A, a.value]
162
158
  ])
163
159
  ]),
164
160
  _: 3
@@ -167,5 +163,5 @@ const P = ["id", "data-cy"], R = ["innerHTML"], q = /* @__PURE__ */ T({
167
163
  }
168
164
  });
169
165
  export {
170
- q as default
166
+ J as default
171
167
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.4.1-alpha.3",
3
+ "version": "2.4.1-alpha.5",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",