@wikicasa-dev/components 1.3.6 → 1.4.1

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,4 +1,4 @@
1
- import { _ as f } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.D5NYtmuS.js";
1
+ import { _ as f } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.DbIX6YbP.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/dist/BaseModal.js CHANGED
@@ -5,7 +5,7 @@ import { _ as M } from "./chunks/BaseButton.vue_vue_type_script_setup_true_lang.
5
5
  import { l as v } from "./chunks/CloseIcon.DiRdm5zi.js";
6
6
  import { useBreakpoints as g } from "./useBreakpoints.js";
7
7
  import { _ as x } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
8
- const B = (t, i) => new Promise((s, l) => {
8
+ const $ = (t, i) => new Promise((s, l) => {
9
9
  setTimeout(() => {
10
10
  try {
11
11
  t && t(), s();
@@ -13,14 +13,14 @@ const B = (t, i) => new Promise((s, l) => {
13
13
  l();
14
14
  }
15
15
  }, i);
16
- }), E = [
16
+ }), B = [
17
17
  "modal-sm",
18
18
  "modal-md",
19
19
  "modal-lg",
20
20
  "modal-xl",
21
21
  "modal-xxl",
22
22
  "modal-desktop"
23
- ], $ = b({
23
+ ], E = b({
24
24
  components: { BaseButton: M, CloseIcon: v },
25
25
  props: {
26
26
  id: { type: String, default: "base-bt-modal" },
@@ -87,8 +87,8 @@ const B = (t, i) => new Promise((s, l) => {
87
87
  t?.classList.add("uikit-flex", "colored-backdrop");
88
88
  let s = this.customModalDialogClasses || "";
89
89
  s += ` ${this.size}`;
90
- const l = s.split(" ").find((u) => E.includes(u));
91
- i?.classList.add("show", `base-${l}`), this.autoClose !== void 0 && setTimeout(() => {
90
+ const l = s.split(" ").find((u) => B.includes(u));
91
+ i?.classList.add("show", `base-${l}`), this.$emit("opened"), this.autoClose !== void 0 && setTimeout(() => {
92
92
  this.closeModal();
93
93
  }, this.autoClose);
94
94
  },
@@ -98,7 +98,7 @@ const B = (t, i) => new Promise((s, l) => {
98
98
  },
99
99
  /** Closes the modal with a transition */
100
100
  async closeModal() {
101
- this.backdropEl.classList.remove("colored-backdrop"), this.backdropEl.classList.add("uikit-flex", "uikit-bg-transparent"), this.modalEl.classList.remove("show"), this.modalEl.classList.add("closed", "uikit-overflow-hidden"), document && document.body.classList.remove("no-scrolling"), await B(() => {
101
+ this.backdropEl.classList.remove("colored-backdrop"), this.backdropEl.classList.add("uikit-flex", "uikit-bg-transparent"), this.modalEl.classList.remove("show"), this.modalEl.classList.add("closed", "uikit-overflow-hidden"), document && document.body.classList.remove("no-scrolling"), await $(() => {
102
102
  this.$emit("closed");
103
103
  }, 250);
104
104
  },
@@ -182,7 +182,7 @@ function O(t, i, s, l, u, H) {
182
182
  ], 2)
183
183
  ]);
184
184
  }
185
- const V = /* @__PURE__ */ x($, [["render", O], ["__scopeId", "data-v-68392dc5"]]);
185
+ const V = /* @__PURE__ */ x(E, [["render", O], ["__scopeId", "data-v-3f7206dc"]]);
186
186
  export {
187
187
  V as default
188
188
  };
@@ -51,7 +51,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
51
51
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
52
52
  click: () => void;
53
53
  keydown: (args_0: KeyboardEvent) => void;
54
- dropdownClosed: (args_0: boolean) => void;
54
+ "update:dropdownState": (args_0: boolean) => void;
55
55
  changedValue: (args_0: string) => void;
56
56
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
57
57
  modelValue: import("vue").PropType<ModelValueType<unknown> | undefined>;
@@ -102,7 +102,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
102
102
  }>> & {
103
103
  onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
104
104
  onClick?: (() => any) | undefined;
105
- onDropdownClosed?: ((args_0: boolean) => any) | undefined;
105
+ "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
106
106
  onChangedValue?: ((args_0: string) => any) | undefined;
107
107
  }, {
108
108
  label: string;
@@ -1 +1 @@
1
- .custom-modal[data-v-68392dc5]{--modal-max-height: 690px;--modal-width-sm: 496px;--modal-width-md: 592px;--modal-width-lg: 670px;--modal-max-width: var(--modal-width-sm);max-width:var(--modal-max-width)}.base-modal-md[data-v-68392dc5]{--modal-max-width: var(--modal-width-md)}.base-modal-lg[data-v-68392dc5]{--modal-max-width: var(--modal-width-lg)}.base-modal-sm[data-v-68392dc5],.base-modal-md[data-v-68392dc5],.base-modal-lg[data-v-68392dc5]{max-height:var(--modal-max-height)}@media not all and (min-width: 576px){.base-modal-sm[data-v-68392dc5],.base-modal-md[data-v-68392dc5],.base-modal-lg[data-v-68392dc5]{max-height:none;max-width:none}}@media screen and (max-width: 576px){.base-modal-sm[data-v-68392dc5],.base-modal-md[data-v-68392dc5],.base-modal-lg[data-v-68392dc5]{width:100%!important}}.base-modal-xxl[data-v-68392dc5]{max-width:1500px}.base-modal-full[data-v-68392dc5]{width:100%}.default-header[data-v-68392dc5]{justify-content:space-between;padding-top:25px}.colored-backdrop[data-v-68392dc5]{animation:backdrop-opacity-68392dc5 .3s ease-out 0s backwards;background-color:#b4c2f0b3}.custom-modal[data-v-68392dc5]{will-change:transform}@media (min-width: 576px){.custom-modal.show.transition-y[data-v-68392dc5]{animation:slide-down-68392dc5 .5s ease-out 0s backwards}}@media not all and (min-width: 576px){.custom-modal.show .uikit-modal-content.transition-y[data-v-68392dc5]{animation:slide-up-68392dc5 .5s ease-out 0s backwards}}.custom-modal.closed[data-v-68392dc5]{overflow-y:hidden!important}@media (min-width: 576px){.custom-modal.closed.transition-y[data-v-68392dc5]{animation:slide-down-back-68392dc5 .25s both}}@media not all and (min-width: 576px){.custom-modal.closed .uikit-modal-content.transition-y[data-v-68392dc5]{animation:slide-up-back-68392dc5 .25s both}}[data-v-68392dc5] #close-icon-btn{position:absolute;right:15px;top:15px}@media not all and (min-width: 576px){.full-height-mobile[data-v-68392dc5]{height:95%;max-height:none}}@keyframes slide-up-68392dc5{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slide-up-back-68392dc5{0%{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slide-down-68392dc5{0%{transform:translateY(-110%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes slide-down-back-68392dc5{0%{transform:translateY(0)}to{transform:translateY(-110%)}}@keyframes backdrop-opacity-68392dc5{0%{opacity:0}to{opacity:1}}
1
+ .custom-modal[data-v-3f7206dc]{--modal-max-height: 690px;--modal-width-sm: 496px;--modal-width-md: 592px;--modal-width-lg: 670px;--modal-max-width: var(--modal-width-sm);max-width:var(--modal-max-width)}.base-modal-md[data-v-3f7206dc]{--modal-max-width: var(--modal-width-md)}.base-modal-lg[data-v-3f7206dc]{--modal-max-width: var(--modal-width-lg)}.base-modal-sm[data-v-3f7206dc],.base-modal-md[data-v-3f7206dc],.base-modal-lg[data-v-3f7206dc]{max-height:var(--modal-max-height)}@media not all and (min-width: 576px){.base-modal-sm[data-v-3f7206dc],.base-modal-md[data-v-3f7206dc],.base-modal-lg[data-v-3f7206dc]{max-height:none;max-width:none}}@media screen and (max-width: 576px){.base-modal-sm[data-v-3f7206dc],.base-modal-md[data-v-3f7206dc],.base-modal-lg[data-v-3f7206dc]{width:100%!important}}.base-modal-xxl[data-v-3f7206dc]{max-width:1500px}.base-modal-full[data-v-3f7206dc]{width:100%}.default-header[data-v-3f7206dc]{justify-content:space-between;padding-top:25px}.colored-backdrop[data-v-3f7206dc]{animation:backdrop-opacity-3f7206dc .3s ease-out 0s backwards;background-color:#b4c2f0b3}.custom-modal[data-v-3f7206dc]{will-change:transform}@media (min-width: 576px){.custom-modal.show.transition-y[data-v-3f7206dc]{animation:slide-down-3f7206dc .5s ease-out 0s backwards}}@media not all and (min-width: 576px){.custom-modal.show .uikit-modal-content.transition-y[data-v-3f7206dc]{animation:slide-up-3f7206dc .5s ease-out 0s backwards}}.custom-modal.closed[data-v-3f7206dc]{overflow-y:hidden!important}@media (min-width: 576px){.custom-modal.closed.transition-y[data-v-3f7206dc]{animation:slide-down-back-3f7206dc .25s both}}@media not all and (min-width: 576px){.custom-modal.closed .uikit-modal-content.transition-y[data-v-3f7206dc]{animation:slide-up-back-3f7206dc .25s both}}[data-v-3f7206dc] #close-icon-btn{position:absolute;right:15px;top:15px}@media not all and (min-width: 576px){.full-height-mobile[data-v-3f7206dc]{height:95%;max-height:none}}@keyframes slide-up-3f7206dc{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slide-up-back-3f7206dc{0%{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slide-down-3f7206dc{0%{transform:translateY(-110%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes slide-down-back-3f7206dc{0%{transform:translateY(0)}to{transform:translateY(-110%)}}@keyframes backdrop-opacity-3f7206dc{0%{opacity:0}to{opacity:1}}
@@ -1,15 +1,15 @@
1
- import { defineComponent as H, mergeModels as S, useModel as P, ref as s, computed as f, onBeforeMount as z, watch as C, openBlock as g, createBlock as V, normalizeClass as E, withCtx as c, createVNode as J, renderSlot as B, createElementBlock as K, Fragment as U, renderList as A, unref as F, createElementVNode as W } from "vue";
1
+ import { defineComponent as H, mergeModels as S, useModel as P, ref as s, computed as f, onBeforeMount as z, watch as k, openBlock as g, createBlock as V, normalizeClass as E, withCtx as c, createVNode as J, renderSlot as B, createElementBlock as K, Fragment as U, renderList as A, unref as F, createElementVNode as W } from "vue";
2
2
  import j from "../BaseInput.js";
3
3
  import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.BTIpnAy4.js";
4
4
  import "./js.cookie.BQua9eWh.js";
5
5
  import { _ as G } from "./SelectItem.vue_vue_type_script_setup_true_lang.Colhxc7n.js";
6
6
  import { useKeyboardController as Q } from "../useKeyboardController.js";
7
- function R(d, k) {
8
- return (...v) => new Promise((l, n) => {
7
+ function R(d, v) {
8
+ return (...m) => new Promise((t, n) => {
9
9
  d.id && clearTimeout(d.id), d.id = setTimeout(() => {
10
10
  try {
11
- const i = k(...v);
12
- l(i);
11
+ const i = v(...m);
12
+ t(i);
13
13
  } catch (i) {
14
14
  n(i);
15
15
  }
@@ -38,41 +38,41 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
38
38
  },
39
39
  modelModifiers: {}
40
40
  }),
41
- emits: /* @__PURE__ */ S(["dropdownClosed", "changedValue", "click", "keydown"], ["update:modelValue"]),
42
- setup(d, { expose: k, emit: v }) {
43
- const l = d, n = P(d, "modelValue"), i = v, u = s(""), o = s([]), m = s(null), p = s(!1), t = s(!1), y = s(null), O = f(() => o.value.length);
41
+ emits: /* @__PURE__ */ S(["update:dropdownState", "changedValue", "click", "keydown"], ["update:modelValue"]),
42
+ setup(d, { expose: v, emit: m }) {
43
+ const t = d, n = P(d, "modelValue"), i = m, u = s(""), o = s([]), h = s(null), p = s(!1), l = s(!1), y = s(null), O = f(() => o.value.length);
44
44
  z(() => {
45
- u.value = n.value?.label || "", m.value = R({ delay: 300 }, l.onInputChangeCb);
45
+ u.value = n.value?.label || "", h.value = R({ delay: 300 }, t.onInputChangeCb);
46
46
  });
47
- const { activeIdx: h, selectedIdx: w } = Q({
47
+ const { activeIdx: w, selectedIdx: C } = Q({
48
48
  optionsLength: O,
49
- isDropdownOpen: t,
49
+ isDropdownOpen: l,
50
50
  disableSpaceHandler: !0
51
51
  }), M = f(() => {
52
- switch (l.theme) {
52
+ switch (t.theme) {
53
53
  case "bordered":
54
54
  return "";
55
55
  case "all-bordered":
56
- return "uikit-rounded " + (t.value && "uikit-rounded-b-none");
56
+ return "uikit-rounded " + (l.value && "uikit-rounded-b-none");
57
57
  case "all-bordered-thick":
58
- return "uikit-rounded-xl !uikit-h-[60px] " + (t.value && "uikit-rounded-b-none");
58
+ return "uikit-rounded-xl !uikit-h-[60px] " + (l.value && "uikit-rounded-b-none");
59
59
  default:
60
60
  return "";
61
61
  }
62
62
  }), I = f(() => {
63
- switch (l.theme) {
63
+ switch (t.theme) {
64
64
  case "bordered":
65
65
  return "";
66
66
  case "all-bordered":
67
- return "uikit-border uikit-border-w-lavender uikit-border-solid uikit-rounded " + (t.value ? "uikit-border-b-0 uikit-rounded-b-none" : "");
67
+ return "uikit-border uikit-border-w-lavender uikit-border-solid uikit-rounded " + (l.value ? "uikit-border-b-0 uikit-rounded-b-none" : "");
68
68
  case "all-bordered-thick":
69
- return "uikit-rounded-xl !uikit-h-[60px]" + (t.value && "uikit-rounded-b-none");
69
+ return "uikit-rounded-xl !uikit-h-[60px]" + (l.value && "uikit-rounded-b-none");
70
70
  default:
71
71
  return "";
72
72
  }
73
73
  }), D = f(() => {
74
74
  const e = "uikit-rounded-b-xl uikit-shadow uikit-rounded-t-none uikit-mb-0 !uikit-mt-0 uikit-text-w-black !uikit-rounded-b-xl !uikit-rounded-t-none";
75
- switch (l.theme) {
75
+ switch (t.theme) {
76
76
  case "bordered":
77
77
  return "before:uikit-content-[''] before:uikit-absolute before:uikit-w-1/2 before:uikit-border-b before:uikit-border-b-w-lavender before:[border-bottom-style:solid] before:uikit-right-1/4 uikit-rounded-b-xl uikit-shadow uikit-rounded-t-none uikit-mt-5px uikit-mb-0";
78
78
  case "all-bordered":
@@ -83,31 +83,33 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
83
83
  return "";
84
84
  }
85
85
  }), T = async (e) => {
86
- if (u.value !== e && (i("changedValue", e), u.value = e, !!l.onInputChangeCb)) {
86
+ if (u.value !== e && (i("changedValue", e), u.value = e, !!t.onInputChangeCb)) {
87
87
  if (!e || p.value) {
88
- o.value = [], p.value = !1, w.value = -1, h.value = -1, n.value && (n.value.label = ""), t.value = !1, await m.value(null);
88
+ o.value = [], p.value = !1, C.value = -1, w.value = -1, n.value && (n.value.label = ""), l.value = !1, await h.value(null);
89
89
  return;
90
90
  }
91
- l.disableCb || (o.value = await m.value(e), console.log({ options: JSON.parse(JSON.stringify(o.value)) }), t.value = !!o.value.length);
91
+ t.disableCb || (o.value = await h.value(e), console.log({ options: JSON.parse(JSON.stringify(o.value)) }), l.value = !!o.value.length);
92
92
  }
93
93
  }, $ = (e, a) => {
94
- l.onOptionSelectedCb && l.onOptionSelectedCb(e), l.cleanupOnClose && (o.value = []), p.value = !0, u.value = e.label, n.value = e, t.value = !1, w.value = a;
94
+ t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (o.value = []), p.value = !0, u.value = e.label, n.value = e, l.value = !1, C.value = a;
95
95
  }, L = () => {
96
- o.value.length && l.keepState !== "closed" && (t.value = !0);
96
+ o.value.length && t.keepState !== "closed" && (l.value = !0);
97
97
  };
98
- return C(n, (e, a) => {
98
+ return k(n, (e, a) => {
99
99
  e !== a && (u.value = e?.label || "");
100
- }), C(w, (e) => {
100
+ }), k(C, (e) => {
101
101
  if (e === -1 || !o.value.length)
102
102
  return;
103
103
  const a = o.value[e];
104
104
  p.value && a.label === n.value?.label || $(a, e);
105
- }), C(
106
- () => l.keepState,
105
+ }), k(
106
+ () => t.keepState,
107
107
  (e) => {
108
- e === "closed" ? (t.value = !1, l.cleanupOnClose && (o.value = [])) : e === "open" && o.value.length && (t.value = !0), i("dropdownClosed", t.value);
108
+ e === "closed" ? (l.value = !1, t.cleanupOnClose && (o.value = [])) : e === "open" && o.value.length && (l.value = !0);
109
109
  }
110
- ), k({
110
+ ), k(l, (e) => {
111
+ i("update:dropdownState", e);
112
+ }), v({
111
113
  select: () => {
112
114
  y.value?.select();
113
115
  }
@@ -126,9 +128,9 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
126
128
  "!uikit-max-h-[210px] uikit-z-10",
127
129
  e.dropdownClasses
128
130
  ],
129
- "open-dropdown": t.value,
130
- "keep-state": !o.value.length || l.keepState === "closed" ? "closed" : "opened",
131
- "onUpdate:dropdownState": a[1] || (a[1] = (r) => t.value = r),
131
+ "open-dropdown": l.value,
132
+ "keep-state": !o.value.length || t.keepState === "closed" ? "closed" : "opened",
133
+ "onUpdate:dropdownState": a[1] || (a[1] = (r) => l.value = r),
132
134
  onClick: a[2] || (a[2] = (r) => {
133
135
  i("click"), L();
134
136
  }),
@@ -167,10 +169,10 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
167
169
  default: c(() => [
168
170
  (g(!0), K(U, null, A(o.value, (r, b) => (g(), V(G, {
169
171
  key: b,
170
- active: F(h) === b,
172
+ active: F(w) === b,
171
173
  class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
172
174
  onClick: (N) => $(r, b),
173
- onMouseover: (N) => h.value = b
175
+ onMouseover: (N) => w.value = b
174
176
  }, {
175
177
  default: c(() => [
176
178
  W("span", {
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import { _ as c } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang
10
10
  import { _ as b } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.C-jm5z4e.js";
11
11
  import { _ as A } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.DB7G0w8N.js";
12
12
  import { _ as C } from "./chunks/BaseAlert.vue_vue_type_script_setup_true_lang.HqYdk4yE.js";
13
- import { _ as T } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.D5NYtmuS.js";
13
+ import { _ as T } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.DbIX6YbP.js";
14
14
  import { _ as w } from "./chunks/BaseBadge.vue_vue_type_style_index_0_lang.BOA1gBKu.js";
15
15
  import { _ as k } from "./chunks/BaseButton.vue_vue_type_script_setup_true_lang.BrJbAMJ8.js";
16
16
  import { _ as F } from "./chunks/BaseCard.vue_vue_type_style_index_0_lang.w5aEohzG.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "1.3.6",
3
+ "version": "1.4.1",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",