@wikicasa-dev/components 1.3.3 → 1.3.4
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.
- package/dist/BaseAutocomplete.js +1 -1
- package/dist/CheckboxBtn.js +20 -24
- package/dist/assets/CheckboxBtn.css +1 -1
- package/dist/chunks/{BaseAutocomplete.vue_vue_type_script_setup_true_lang.CZDTP9DW.js → BaseAutocomplete.vue_vue_type_script_setup_true_lang.CnyHYNUi.js} +37 -37
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/BaseAutocomplete.js
CHANGED
package/dist/CheckboxBtn.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './assets/CheckboxBtn.css';
|
|
2
|
-
import { defineComponent as f, openBlock as o, createElementBlock as
|
|
2
|
+
import { defineComponent as f, openBlock as o, createElementBlock as s, normalizeClass as l, withModifiers as r, createElementVNode as d, renderSlot as b, toDisplayString as m, createCommentVNode as h } from "vue";
|
|
3
3
|
import { _ as g } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
4
|
-
const C = ["id"],
|
|
4
|
+
const C = ["id"], y = ["id", "data-cy", "checked", "disabled"], V = ["for"], v = /* @__PURE__ */ f({
|
|
5
5
|
__name: "CheckboxBtn",
|
|
6
6
|
props: {
|
|
7
7
|
id: {},
|
|
@@ -16,35 +16,31 @@ const C = ["id"], V = ["id", "data-cy", "checked", "disabled"], y = ["for"], v =
|
|
|
16
16
|
handleLabelClick: { type: Boolean, default: !0 }
|
|
17
17
|
},
|
|
18
18
|
emits: ["click", "change", "update:modelValue"],
|
|
19
|
-
setup(
|
|
20
|
-
const i =
|
|
19
|
+
setup(u, { emit: k }) {
|
|
20
|
+
const i = u, t = k, n = () => {
|
|
21
21
|
t("change", {
|
|
22
22
|
id: i.id,
|
|
23
23
|
label: i.label,
|
|
24
24
|
checked: !i.modelValue
|
|
25
25
|
}), t("update:modelValue", !i.modelValue);
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
id: i.id,
|
|
29
|
-
label: i.label,
|
|
30
|
-
checked: !i.modelValue
|
|
31
|
-
}), t("update:modelValue", !i.modelValue));
|
|
26
|
+
}, p = () => {
|
|
27
|
+
n(), i.handleLabelClick && t("click");
|
|
32
28
|
};
|
|
33
|
-
return (e,
|
|
29
|
+
return (e, a) => (o(), s("div", {
|
|
34
30
|
id: e.containerId,
|
|
35
|
-
class:
|
|
31
|
+
class: l(["uikit-group uikit-relative uikit-block uikit-pl-25px hover:uikit-cursor-pointer", [
|
|
36
32
|
{ "uikit-mr-4 uikit-inline-flex uikit-items-center": e.inline },
|
|
37
33
|
{ "uikit-py-10px": !e.inline && !e.$attrs["wrapper-margin-y"] },
|
|
38
34
|
e.$attrs["wrapper-margin-y"],
|
|
39
35
|
e.containerClass
|
|
40
36
|
]]),
|
|
41
|
-
onClick:
|
|
37
|
+
onClick: r(p, ["stop", "prevent"])
|
|
42
38
|
}, [
|
|
43
|
-
|
|
39
|
+
d("input", {
|
|
44
40
|
id: `${e.id}`,
|
|
45
41
|
ref: "checkbox",
|
|
46
42
|
"data-cy": e.$attrs["data-cy"],
|
|
47
|
-
class:
|
|
43
|
+
class: l(["uikit-absolute uikit-left-0 uikit-h-4 uikit-w-4 uikit-appearance-none uikit-rounded-3xs uikit-border uikit-border-solid uikit-border-w-secondary uikit-bg-white checked:uikit-bg-center checked:uikit-bg-no-repeat group-hover:uikit-cursor-pointer", [
|
|
48
44
|
{ "!uikit-border-w-danger": e.isValid === !1 },
|
|
49
45
|
e.inputClass,
|
|
50
46
|
e.isValid === !1 ? "checked-bg-invalid" : "checked-bg"
|
|
@@ -52,24 +48,24 @@ const C = ["id"], V = ["id", "data-cy", "checked", "disabled"], y = ["for"], v =
|
|
|
52
48
|
type: "checkbox",
|
|
53
49
|
checked: e.$attrs.checked || e.modelValue,
|
|
54
50
|
disabled: e.$attrs.disabled,
|
|
55
|
-
onChange:
|
|
56
|
-
onClick:
|
|
57
|
-
}, null, 42,
|
|
51
|
+
onChange: a[0] || (a[0] = r((c) => n(), ["stop", "prevent"])),
|
|
52
|
+
onClick: a[1] || (a[1] = r((c) => t("click"), ["stop"]))
|
|
53
|
+
}, null, 42, y),
|
|
58
54
|
b(e.$slots, "label", {}, () => [
|
|
59
|
-
|
|
60
|
-
class:
|
|
55
|
+
d("label", {
|
|
56
|
+
class: l(["uikit-pl-10px uikit-text-sm group-hover:uikit-cursor-pointer", [e.labelClass, { "uikit-text-w-danger": e.isValid === !1 }]]),
|
|
61
57
|
for: `${e.id}`
|
|
62
|
-
}, m(e.label), 11,
|
|
63
|
-
e.$attrs.required ? (o(),
|
|
58
|
+
}, m(e.label), 11, V),
|
|
59
|
+
e.$attrs.required ? (o(), s("span", {
|
|
64
60
|
key: 0,
|
|
65
|
-
class:
|
|
61
|
+
class: l(["required after:uikit-content-['*']", [
|
|
66
62
|
e.isValid !== !1 ? "after:uikit-text-w-primary" : "after:uikit-text-w-danger"
|
|
67
63
|
]])
|
|
68
64
|
}, null, 2)) : h("", !0)
|
|
69
65
|
], !0)
|
|
70
66
|
], 10, C));
|
|
71
67
|
}
|
|
72
|
-
}), B = /* @__PURE__ */ g(v, [["__scopeId", "data-v-
|
|
68
|
+
}), B = /* @__PURE__ */ g(v, [["__scopeId", "data-v-13281133"]]);
|
|
73
69
|
export {
|
|
74
70
|
B as default
|
|
75
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.checked-bg[data-v-
|
|
1
|
+
.checked-bg[data-v-13281133]:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg transform='translate(-307 -2432)'%3E%3Crect width='16' height='16' fill='%232b5dff' data-name='Rettangolo 2689' rx='3' transform='translate(307 2432)'/%3E%3Cpath fill='none' stroke='%23f4f7ff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m319.499 2437.499-6 6Zm-9 3 3 3Z' data-name='Unione 5'/%3E%3C/g%3E%3C/svg%3E")}.checked-bg-invalid[data-v-13281133]:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cg transform='translate(-307 -2432)'%3E%3Crect width='16' height='16' fill='%23FA4F64' data-name='Rettangolo 2689' rx='3' transform='translate(307 2432)'/%3E%3Cpath fill='none' stroke='%23f4f7ff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m319.499 2437.499-6 6Zm-9 3 3 3Z' data-name='Unione 5'/%3E%3C/g%3E%3C/svg%3E")}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as H, mergeModels as S, useModel as z, ref as s, computed as f, onBeforeMount as E, watch as C, openBlock as g, createBlock as V, normalizeClass as J, withCtx as c, createVNode as K, renderSlot as
|
|
1
|
+
import { defineComponent as H, mergeModels as S, useModel as z, ref as s, computed as f, onBeforeMount as E, watch as C, openBlock as g, createBlock as V, normalizeClass as J, withCtx as c, createVNode as K, renderSlot as O, createElementBlock as U, Fragment as A, renderList as F, unref as P, 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
7
|
function R(u, k) {
|
|
8
|
-
return (...v) => new Promise((
|
|
8
|
+
return (...v) => new Promise((l, n) => {
|
|
9
9
|
u.id && clearTimeout(u.id), u.id = setTimeout(() => {
|
|
10
10
|
try {
|
|
11
11
|
const i = k(...v);
|
|
12
|
-
|
|
12
|
+
l(i);
|
|
13
13
|
} catch (i) {
|
|
14
14
|
n(i);
|
|
15
15
|
}
|
|
@@ -39,39 +39,39 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
39
39
|
}),
|
|
40
40
|
emits: /* @__PURE__ */ S(["dropdownClosed", "changedValue", "click", "keydown"], ["update:modelValue"]),
|
|
41
41
|
setup(u, { expose: k, emit: v }) {
|
|
42
|
-
const
|
|
42
|
+
const l = u, n = z(u, "modelValue"), i = v, d = s(""), o = s([]), m = s(null), p = s(!1), t = s(!1), y = s(null), B = f(() => o.value.length);
|
|
43
43
|
E(() => {
|
|
44
|
-
d.value = n.value?.label || "", m.value = R({ delay: 300 },
|
|
44
|
+
d.value = n.value?.label || "", m.value = R({ delay: 300 }, l.onInputChangeCb);
|
|
45
45
|
});
|
|
46
46
|
const { activeIdx: h, selectedIdx: w } = Q({
|
|
47
|
-
optionsLength:
|
|
48
|
-
isDropdownOpen:
|
|
47
|
+
optionsLength: B,
|
|
48
|
+
isDropdownOpen: t,
|
|
49
49
|
disableSpaceHandler: !0
|
|
50
50
|
}), M = f(() => {
|
|
51
|
-
switch (
|
|
51
|
+
switch (l.theme) {
|
|
52
52
|
case "bordered":
|
|
53
53
|
return "";
|
|
54
54
|
case "all-bordered":
|
|
55
|
-
return "uikit-rounded " + (
|
|
55
|
+
return "uikit-rounded " + (t.value && "uikit-rounded-b-none");
|
|
56
56
|
case "all-bordered-thick":
|
|
57
|
-
return "uikit-rounded-xl !uikit-h-[60px] " + (
|
|
57
|
+
return "uikit-rounded-xl !uikit-h-[60px] " + (t.value && "uikit-rounded-b-none");
|
|
58
58
|
default:
|
|
59
59
|
return "";
|
|
60
60
|
}
|
|
61
61
|
}), I = f(() => {
|
|
62
|
-
switch (
|
|
62
|
+
switch (l.theme) {
|
|
63
63
|
case "bordered":
|
|
64
64
|
return "";
|
|
65
65
|
case "all-bordered":
|
|
66
|
-
return "uikit-border uikit-border-w-lavender uikit-border-solid uikit-rounded " + (
|
|
66
|
+
return "uikit-border uikit-border-w-lavender uikit-border-solid uikit-rounded " + (t.value ? "uikit-border-b-0 uikit-rounded-b-none" : "");
|
|
67
67
|
case "all-bordered-thick":
|
|
68
|
-
return "uikit-rounded-xl !uikit-h-[60px]" + (
|
|
68
|
+
return "uikit-rounded-xl !uikit-h-[60px]" + (t.value && "uikit-rounded-b-none");
|
|
69
69
|
default:
|
|
70
70
|
return "";
|
|
71
71
|
}
|
|
72
72
|
}), T = f(() => {
|
|
73
73
|
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";
|
|
74
|
-
switch (
|
|
74
|
+
switch (l.theme) {
|
|
75
75
|
case "bordered":
|
|
76
76
|
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";
|
|
77
77
|
case "all-bordered":
|
|
@@ -82,35 +82,35 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
82
82
|
return "";
|
|
83
83
|
}
|
|
84
84
|
}), L = async (e) => {
|
|
85
|
-
if (d.value !== e && (i("changedValue", e), d.value = e, !!
|
|
86
|
-
if (n.value && !e && (n.value.label = "",
|
|
87
|
-
|
|
85
|
+
if (d.value !== e && (i("changedValue", e), d.value = e, !!l.onInputChangeCb)) {
|
|
86
|
+
if (n.value && !e && (n.value.label = "", t.value = !1), !e || p.value) {
|
|
87
|
+
o.value = [], p.value = !1, w.value = -1, h.value = -1, await m.value(null);
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
l.disableCb || (o.value = await m.value(e), console.log({ options: JSON.parse(JSON.stringify(o.value)) }), o.value.length && (t.value = !0));
|
|
91
91
|
}
|
|
92
|
-
}, $ = (e,
|
|
93
|
-
|
|
92
|
+
}, $ = (e, a) => {
|
|
93
|
+
l.onOptionSelectedCb && l.onOptionSelectedCb(e), l.cleanupOnClose && (o.value = []), p.value = !0, d.value = e.label, n.value = e, t.value = !1, w.value = a;
|
|
94
94
|
}, N = () => {
|
|
95
|
-
|
|
95
|
+
o.value.length && l.keepState !== "closed" && (t.value = !0);
|
|
96
96
|
};
|
|
97
|
-
return C(n, (e,
|
|
98
|
-
e !==
|
|
97
|
+
return C(n, (e, a) => {
|
|
98
|
+
e !== a && (d.value = e?.label || "");
|
|
99
99
|
}), C(w, (e) => {
|
|
100
|
-
if (e === -1)
|
|
100
|
+
if (e === -1 || !o.value.length)
|
|
101
101
|
return;
|
|
102
|
-
const
|
|
103
|
-
p.value &&
|
|
102
|
+
const a = o.value[e];
|
|
103
|
+
p.value && a.label === n.value?.label || $(a, e);
|
|
104
104
|
}), C(
|
|
105
|
-
() =>
|
|
105
|
+
() => l.keepState,
|
|
106
106
|
(e) => {
|
|
107
|
-
e === "closed" ?
|
|
107
|
+
e === "closed" ? (t.value = !1, l.cleanupOnClose && (o.value = [])) : e === "open" && o.value.length && (t.value = !0), i("dropdownClosed", t.value);
|
|
108
108
|
}
|
|
109
109
|
), k({
|
|
110
110
|
select: () => {
|
|
111
111
|
y.value?.select();
|
|
112
112
|
}
|
|
113
|
-
}), (e,
|
|
113
|
+
}), (e, a) => (g(), V(q, {
|
|
114
114
|
class: J(e.$attrs["root-classes"]),
|
|
115
115
|
"data-cy": `ac_${e.$attrs.id}`,
|
|
116
116
|
"dropdown-element": "ul",
|
|
@@ -125,10 +125,10 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
125
125
|
"!uikit-max-h-[210px] uikit-z-10",
|
|
126
126
|
e.dropdownClasses
|
|
127
127
|
],
|
|
128
|
-
"open-dropdown":
|
|
129
|
-
"keep-state": !
|
|
130
|
-
"onUpdate:dropdownState":
|
|
131
|
-
onClick:
|
|
128
|
+
"open-dropdown": t.value,
|
|
129
|
+
"keep-state": !o.value.length || l.keepState === "closed" ? "closed" : "opened",
|
|
130
|
+
"onUpdate:dropdownState": a[1] || (a[1] = (r) => t.value = r),
|
|
131
|
+
onClick: a[2] || (a[2] = (r) => {
|
|
132
132
|
i("click"), N();
|
|
133
133
|
})
|
|
134
134
|
}, {
|
|
@@ -151,19 +151,19 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
151
151
|
"fieldset-classes": [I.value, e.$attrs["fieldset-classes"]],
|
|
152
152
|
"keep-floating-label": !!d.value,
|
|
153
153
|
"onUpdate:modelValue": L,
|
|
154
|
-
onKeydown:
|
|
154
|
+
onKeydown: a[0] || (a[0] = (r) => i("keydown", r))
|
|
155
155
|
}, {
|
|
156
156
|
leftIcon: c(() => [
|
|
157
|
-
|
|
157
|
+
O(e.$slots, "lefticon")
|
|
158
158
|
]),
|
|
159
159
|
righticon: c(({ handleClean: r }) => [
|
|
160
|
-
|
|
160
|
+
O(e.$slots, "righticon", { handleClean: r })
|
|
161
161
|
]),
|
|
162
162
|
_: 3
|
|
163
163
|
}, 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
164
|
]),
|
|
165
165
|
default: c(() => [
|
|
166
|
-
(g(!0), U(A, null, F(
|
|
166
|
+
(g(!0), U(A, null, F(o.value, (r, b) => (g(), V(G, {
|
|
167
167
|
key: b,
|
|
168
168
|
active: P(h) === b,
|
|
169
169
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
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.lyHlWiC5.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.
|
|
13
|
+
import { _ as T } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.CnyHYNUi.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";
|