@wikicasa-dev/components 1.5.18 → 1.6.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,22 +1,22 @@
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
- import j from "../BaseInput.js";
3
- import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.XCCbfFor.js";
1
+ import { defineComponent as P, mergeModels as S, useModel as z, ref as s, computed as k, onBeforeMount as A, watch as f, openBlock as y, createBlock as V, normalizeClass as E, withCtx as c, createVNode as K, renderSlot as B, createElementBlock as N, Fragment as U, renderList as F, unref as W, createElementVNode as j } from "vue";
2
+ import q from "../BaseInput.js";
3
+ import { _ as G } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.XCCbfFor.js";
4
4
  import "./js.cookie.BQua9eWh.js";
5
- import { _ as G } from "./SelectItem.vue_vue_type_script_setup_true_lang.Colhxc7n.js";
5
+ import { _ as J } from "./SelectItem.vue_vue_type_script_setup_true_lang.Colhxc7n.js";
6
6
  import { useKeyboardController as Q } from "../useKeyboardController.js";
7
7
  function R(d, v) {
8
- return (...m) => new Promise((t, n) => {
8
+ return (...m) => new Promise((l, i) => {
9
9
  d.id && clearTimeout(d.id), d.id = setTimeout(() => {
10
10
  try {
11
- const i = v(...m);
12
- t(i);
13
- } catch (i) {
14
- n(i);
11
+ const r = v(...m);
12
+ l(r);
13
+ } catch (r) {
14
+ i(r);
15
15
  }
16
16
  }, d.delay);
17
17
  });
18
18
  }
19
- const X = ["innerHTML"], oe = /* @__PURE__ */ H({
19
+ const X = ["innerHTML"], oe = /* @__PURE__ */ P({
20
20
  __name: "BaseAutocomplete",
21
21
  props: /* @__PURE__ */ S({
22
22
  border: { type: Boolean, default: !0 },
@@ -40,80 +40,80 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
40
40
  }),
41
41
  emits: /* @__PURE__ */ S(["update:dropdownState", "changedValue", "click", "keydown"], ["update:modelValue"]),
42
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
- z(() => {
45
- u.value = n.value?.label || "", h.value = R({ delay: 300 }, t.onInputChangeCb);
43
+ const l = d, i = z(d, "modelValue"), r = m, u = s(""), n = s([]), h = s(null), p = s(!1), o = s(!1), g = s(null), O = k(() => n.value.length);
44
+ A(() => {
45
+ u.value = i.value?.label || "", h.value = R({ delay: 300 }, l.onInputChangeCb);
46
46
  });
47
47
  const { activeIdx: w, selectedIdx: C } = Q({
48
48
  optionsLength: O,
49
- isDropdownOpen: l,
49
+ isDropdownOpen: o,
50
50
  disableSpaceHandler: !0
51
- }), M = f(() => {
52
- switch (t.theme) {
51
+ }), M = k(() => {
52
+ switch (l.theme) {
53
53
  case "bordered":
54
54
  return "";
55
55
  case "all-bordered":
56
- return "uikit-rounded " + (l.value && "uikit-rounded-b-none");
56
+ return "!uikit-rounded " + (o.value && "!uikit-rounded-b-none");
57
57
  case "all-bordered-thick":
58
- return "uikit-rounded-xl !uikit-h-[60px] " + (l.value && "uikit-rounded-b-none");
58
+ return "!uikit-rounded-xl !uikit-h-[60px] " + (o.value && "!uikit-rounded-b-none");
59
59
  default:
60
60
  return "";
61
61
  }
62
- }), I = f(() => {
63
- switch (t.theme) {
62
+ }), I = k(() => {
63
+ switch (l.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 " + (l.value ? "uikit-border-b-0 uikit-rounded-b-none" : "");
67
+ return "uikit-border uikit-border-w-lavender uikit-border-solid !uikit-rounded !uikit-border-w-lavender !uikit-border " + (o.value ? "!uikit-border-b-0 !uikit-rounded-b-none" : "");
68
68
  case "all-bordered-thick":
69
- return "uikit-rounded-xl !uikit-h-[60px] " + (l.value ? "uikit-rounded-b-none" : "");
69
+ return "!uikit-rounded-xl !uikit-h-[60px] !uikit-border-w-lavender !uikit-border-none " + (o.value ? "!uikit-rounded-b-none" : "");
70
70
  default:
71
71
  return "";
72
72
  }
73
- }), D = f(() => {
73
+ }), D = k(() => {
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 (t.theme) {
75
+ switch (l.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":
79
79
  return e;
80
80
  case "all-bordered-thick":
81
- return e;
81
+ return e + " !uikit-border-0";
82
82
  default:
83
83
  return "";
84
84
  }
85
85
  }), T = async (e) => {
86
- if (u.value !== e && (i("changedValue", e), u.value = e, !!t.onInputChangeCb)) {
86
+ if (u.value !== e && (r("changedValue", e), u.value = e, !!l.onInputChangeCb)) {
87
87
  if (!e || p.value) {
88
- o.value = [], p.value = !1, C.value = -1, w.value = -1, n.value && (n.value.label = ""), l.value = !1, await h.value(null);
88
+ n.value = [], p.value = !1, C.value = -1, w.value = -1, i.value && (i.value.label = ""), o.value = !1, await h.value(null);
89
89
  return;
90
90
  }
91
- t.disableCb || (o.value = await h.value(e), console.log({ options: JSON.parse(JSON.stringify(o.value)) }), l.value = !!o.value.length);
91
+ l.disableCb || (n.value = await h.value(e), o.value = !!n.value.length);
92
92
  }
93
- }, $ = (e, 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;
93
+ }, $ = (e, t) => {
94
+ l.onOptionSelectedCb && l.onOptionSelectedCb(e), l.cleanupOnClose && (n.value = []), p.value = !0, u.value = e.label, i.value = e, o.value = !1, C.value = t;
95
95
  }, L = () => {
96
- o.value.length && t.keepState !== "closed" && (l.value = !0);
96
+ n.value.length && l.keepState !== "closed" && (o.value = !0);
97
97
  };
98
- return k(n, (e, a) => {
99
- e !== a && (u.value = e?.label || "");
100
- }), k(C, (e) => {
101
- if (e === -1 || !o.value.length)
98
+ return f(i, (e, t) => {
99
+ console.log("baseAutocomplete", { cur: e, prev: t }), e !== t && (u.value = e?.label || "");
100
+ }), f(C, (e) => {
101
+ if (e === -1 || !n.value.length)
102
102
  return;
103
- const a = o.value[e];
104
- p.value && a.label === n.value?.label || $(a, e);
105
- }), k(
106
- () => t.keepState,
103
+ const t = n.value[e];
104
+ p.value && t.label === i.value?.label || $(t, e);
105
+ }), f(
106
+ () => l.keepState,
107
107
  (e) => {
108
- e === "closed" ? (l.value = !1, t.cleanupOnClose && (o.value = [])) : e === "open" && o.value.length && (l.value = !0);
108
+ e === "closed" ? (o.value = !1, l.cleanupOnClose && (n.value = [])) : e === "open" && n.value.length && (o.value = !0);
109
109
  }
110
- ), k(l, (e) => {
111
- i("update:dropdownState", e);
110
+ ), f(o, (e) => {
111
+ r("update:dropdownState", e);
112
112
  }), v({
113
113
  select: () => {
114
- y.value?.select();
114
+ g.value?.select();
115
115
  }
116
- }), (e, a) => (g(), V(q, {
116
+ }), (e, t) => (y(), V(G, {
117
117
  class: E(e.$attrs["root-classes"]),
118
118
  "data-cy": `ac_${e.$attrs.id}`,
119
119
  "dropdown-element": "ul",
@@ -125,58 +125,55 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
125
125
  "uikit-mt-10px !uikit-border !uikit-border-w-secondary !uikit-rounded-xs": !e.theme
126
126
  },
127
127
  D.value,
128
- "!uikit-max-h-[210px] uikit-z-10",
128
+ "!uikit-max-h-[210px] uikit-z-30",
129
129
  e.dropdownClasses
130
130
  ],
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),
134
- onClick: a[2] || (a[2] = (r) => {
135
- i("click"), L();
131
+ "open-dropdown": o.value,
132
+ "keep-state": !n.value.length || l.keepState === "closed" ? "closed" : "opened",
133
+ "onUpdate:dropdownState": t[2] || (t[2] = (a) => o.value = a),
134
+ onClick: t[3] || (t[3] = (a) => {
135
+ r("click"), L();
136
136
  }),
137
137
  "close-when-clicked-outside": e.closeDropdownOnBodyPressed
138
138
  }, {
139
139
  btn_slot: c(() => [
140
- J(j, {
140
+ K(q, {
141
141
  id: `ac_input_${e.$attrs.id}`,
142
142
  ref_key: "baseInput",
143
- ref: y,
143
+ ref: g,
144
144
  "data-cy": `ac_input_${e.$attrs.id}`,
145
145
  "label-text": e.label,
146
- "model-value": n.value?.label || "",
146
+ "model-value": u.value,
147
147
  "is-valid": e.isValid,
148
148
  disabled: e.$attrs.disabled,
149
149
  placeholder: e.$attrs.placeholder,
150
150
  "with-left-icon": !!e.$slots.lefticon,
151
151
  "with-right-icon": !!e.$slots.righticon,
152
- border: !e.theme,
153
- radius: !e.theme || e.theme === "bordered",
154
152
  "input-class": [M.value, e.$attrs["input-classes"]],
155
153
  "fieldset-classes": [I.value, e.$attrs["fieldset-classes"]],
156
- "keep-floating-label": !!u.value,
157
- "onUpdate:modelValue": T,
158
- onKeydown: a[0] || (a[0] = (r) => i("keydown", r))
154
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => T(a === void 0 ? "" : `${a}`)),
155
+ onKeydown: t[1] || (t[1] = (a) => r("keydown", a))
159
156
  }, {
160
157
  leftIcon: c(() => [
161
158
  B(e.$slots, "lefticon")
162
159
  ]),
163
- righticon: c(({ handleClean: r }) => [
164
- B(e.$slots, "righticon", { handleClean: r })
160
+ righticon: c(({ handleClean: a }) => [
161
+ B(e.$slots, "righticon", { handleClean: a })
165
162
  ]),
166
163
  _: 3
167
- }, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "border", "radius", "input-class", "fieldset-classes", "keep-floating-label"])
164
+ }, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "input-class", "fieldset-classes"])
168
165
  ]),
169
166
  default: c(() => [
170
- (g(!0), K(U, null, A(o.value, (r, b) => (g(), V(G, {
167
+ (y(!0), N(U, null, F(n.value, (a, b) => (y(), V(J, {
171
168
  key: b,
172
- active: F(w) === b,
169
+ active: W(w) === b,
173
170
  class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
174
- onClick: (N) => $(r, b),
175
- onMouseover: (N) => w.value = b
171
+ onClick: (H) => $(a, b),
172
+ onMouseover: (H) => w.value = b
176
173
  }, {
177
174
  default: c(() => [
178
- W("span", {
179
- innerHTML: r.label
175
+ j("span", {
176
+ innerHTML: a.label
180
177
  }, null, 8, X)
181
178
  ]),
182
179
  _: 2
package/dist/index.js CHANGED
@@ -8,9 +8,9 @@ import { default as d } from "./CheckboxBtn.js";
8
8
  import { _ as n } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.DDtN9_Bg.js";
9
9
  import { _ as i } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.DR6a7QAi.js";
10
10
  import { _ as b } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.C-jm5z4e.js";
11
- import { _ as A } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.BE4EKjlJ.js";
12
- import { _ as S } from "./chunks/BaseAlert.vue_vue_type_style_index_0_lang.CunhU74n.js";
13
- import { _ as T } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.BoNJQPjL.js";
11
+ import { _ as A } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.5pqk7vlZ.js";
12
+ import { _ as S } from "./chunks/BaseAlert.vue_vue_type_style_index_0_lang.BtqP_iYL.js";
13
+ import { _ as T } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.CFikyojk.js";
14
14
  import { _ as v } from "./chunks/BaseBadge.vue_vue_type_style_index_0_lang.BOA1gBKu.js";
15
15
  import { _ as h } 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";
@@ -1,33 +1,33 @@
1
- import { ref as b } from "vue";
2
- function r(n) {
3
- const e = b("inline-label");
4
- function i(l) {
5
- l != null && `${l}`.length > 0 && (e.value = "floating-label");
1
+ import { ref as s } from "vue";
2
+ function f(e) {
3
+ const n = s("inline-label");
4
+ function a(l) {
5
+ l != null && `${l}`.length > 0 && (n.value = "floating-label");
6
6
  }
7
- const o = (l = !0) => {
8
- e.value !== "floating-label" && l && (e.value = "floating-label"), n("focusin");
7
+ const i = (l = !0) => {
8
+ n.value !== "floating-label" && l && (n.value = "floating-label"), e("focusin");
9
9
  };
10
- function u(l, f = !1, s = !0) {
11
- if (l != null && `${l}`.trim().length > 0 || !f && !s) {
12
- a(), n("focusout");
10
+ function u(l) {
11
+ if (console.log("handleFocusOut", { value: l }), l != null && `${l}`.trim().length > 0) {
12
+ o(), e("focusout");
13
13
  return;
14
14
  }
15
- t();
15
+ console.log("setting inline label"), t();
16
16
  }
17
17
  const t = () => {
18
- e.value = "inline-label";
19
- }, a = () => {
20
- e.value = "floating-label";
18
+ n.value = "inline-label";
19
+ }, o = () => {
20
+ n.value = "floating-label";
21
21
  };
22
22
  return {
23
- labelState: e,
24
- setInitialLabelState: i,
25
- handleFocusIn: o,
23
+ labelState: n,
24
+ setInitialLabelState: a,
25
+ handleFocusIn: i,
26
26
  handleFocusOut: u,
27
27
  setInlineLabel: t,
28
- setFloatingLabel: a
28
+ setFloatingLabel: o
29
29
  };
30
30
  }
31
31
  export {
32
- r as useFloatingLabel
32
+ f as useFloatingLabel
33
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "1.5.18",
3
+ "version": "1.6.0",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,23 +0,0 @@
1
- import '../assets/BaseAlert.css';
2
- import { defineComponent as t, openBlock as r, createElementBlock as a, normalizeClass as s, renderSlot as l, createTextVNode as o, toDisplayString as n } from "vue";
3
- const i = ["id"], m = /* @__PURE__ */ t({
4
- __name: "BaseAlert",
5
- props: {
6
- text: { default: "" },
7
- alertClass: { default: "" }
8
- },
9
- setup(d) {
10
- return (e, p) => (r(), a("div", {
11
- id: e.$attrs.id,
12
- class: s(["uikit-alert", e.alertClass]),
13
- role: "alert"
14
- }, [
15
- l(e.$slots, "default", {}, () => [
16
- o(n(e.text), 1)
17
- ])
18
- ], 10, i));
19
- }
20
- });
21
- export {
22
- m as _
23
- };