@wikicasa-dev/components 1.3.6 → 1.4.0

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
  };
@@ -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,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.0",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",