@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.
- package/dist/AccessibleSelect.js +1 -1
- package/dist/BaseAlert.js +1 -1
- package/dist/BaseAutocomplete.js +1 -1
- package/dist/BaseInput.js +189 -270
- package/dist/BaseSlider.js +8 -8
- package/dist/BaseToggle.js +37 -38
- package/dist/UIKit/BaseAlert.vue.d.ts +0 -5
- package/dist/UIKit/BaseAutocomplete.vue.d.ts +10 -10
- package/dist/UIKit/BaseButton.vue.d.ts +1 -1
- package/dist/UIKit/BaseInput.vue.d.ts +63 -110
- package/dist/UIKit/BaseTextarea.vue.d.ts +1 -1
- package/dist/UIKit/BaseToggle.vue.d.ts +19 -22
- package/dist/assets/BaseInput.css +1 -1
- package/dist/assets/BaseSlider.css +1 -1
- package/dist/assets/BaseToggle.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/chunks/{AccessibleSelect.vue_vue_type_script_setup_true_lang.BE4EKjlJ.js → AccessibleSelect.vue_vue_type_script_setup_true_lang.5pqk7vlZ.js} +1 -1
- package/dist/chunks/BaseAlert.vue_vue_type_style_index_0_lang.BtqP_iYL.js +20 -0
- package/dist/chunks/{BaseAutocomplete.vue_vue_type_script_setup_true_lang.BoNJQPjL.js → BaseAutocomplete.vue_vue_type_script_setup_true_lang.CFikyojk.js} +64 -67
- package/dist/index.js +3 -3
- package/dist/useFloatingLabel.js +19 -19
- package/package.json +1 -1
- package/dist/chunks/BaseAlert.vue_vue_type_style_index_0_lang.CunhU74n.js +0 -23
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
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
|
|
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((
|
|
8
|
+
return (...m) => new Promise((l, i) => {
|
|
9
9
|
d.id && clearTimeout(d.id), d.id = setTimeout(() => {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
} catch (
|
|
14
|
-
|
|
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__ */
|
|
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
|
|
44
|
-
|
|
45
|
-
u.value =
|
|
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:
|
|
49
|
+
isDropdownOpen: o,
|
|
50
50
|
disableSpaceHandler: !0
|
|
51
|
-
}), M =
|
|
52
|
-
switch (
|
|
51
|
+
}), M = k(() => {
|
|
52
|
+
switch (l.theme) {
|
|
53
53
|
case "bordered":
|
|
54
54
|
return "";
|
|
55
55
|
case "all-bordered":
|
|
56
|
-
return "uikit-rounded " + (
|
|
56
|
+
return "!uikit-rounded " + (o.value && "!uikit-rounded-b-none");
|
|
57
57
|
case "all-bordered-thick":
|
|
58
|
-
return "uikit-rounded-xl !uikit-h-[60px] " + (
|
|
58
|
+
return "!uikit-rounded-xl !uikit-h-[60px] " + (o.value && "!uikit-rounded-b-none");
|
|
59
59
|
default:
|
|
60
60
|
return "";
|
|
61
61
|
}
|
|
62
|
-
}), I =
|
|
63
|
-
switch (
|
|
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 " + (
|
|
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] " + (
|
|
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 =
|
|
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 (
|
|
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 && (
|
|
86
|
+
if (u.value !== e && (r("changedValue", e), u.value = e, !!l.onInputChangeCb)) {
|
|
87
87
|
if (!e || p.value) {
|
|
88
|
-
|
|
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
|
-
|
|
91
|
+
l.disableCb || (n.value = await h.value(e), o.value = !!n.value.length);
|
|
92
92
|
}
|
|
93
|
-
}, $ = (e,
|
|
94
|
-
|
|
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
|
-
|
|
96
|
+
n.value.length && l.keepState !== "closed" && (o.value = !0);
|
|
97
97
|
};
|
|
98
|
-
return
|
|
99
|
-
e !==
|
|
100
|
-
}),
|
|
101
|
-
if (e === -1 || !
|
|
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
|
|
104
|
-
p.value &&
|
|
105
|
-
}),
|
|
106
|
-
() =>
|
|
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" ? (
|
|
108
|
+
e === "closed" ? (o.value = !1, l.cleanupOnClose && (n.value = [])) : e === "open" && n.value.length && (o.value = !0);
|
|
109
109
|
}
|
|
110
|
-
),
|
|
111
|
-
|
|
110
|
+
), f(o, (e) => {
|
|
111
|
+
r("update:dropdownState", e);
|
|
112
112
|
}), v({
|
|
113
113
|
select: () => {
|
|
114
|
-
|
|
114
|
+
g.value?.select();
|
|
115
115
|
}
|
|
116
|
-
}), (e,
|
|
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-
|
|
128
|
+
"!uikit-max-h-[210px] uikit-z-30",
|
|
129
129
|
e.dropdownClasses
|
|
130
130
|
],
|
|
131
|
-
"open-dropdown":
|
|
132
|
-
"keep-state": !
|
|
133
|
-
"onUpdate:dropdownState":
|
|
134
|
-
onClick:
|
|
135
|
-
|
|
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
|
-
|
|
140
|
+
K(q, {
|
|
141
141
|
id: `ac_input_${e.$attrs.id}`,
|
|
142
142
|
ref_key: "baseInput",
|
|
143
|
-
ref:
|
|
143
|
+
ref: g,
|
|
144
144
|
"data-cy": `ac_input_${e.$attrs.id}`,
|
|
145
145
|
"label-text": e.label,
|
|
146
|
-
"model-value":
|
|
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
|
-
"
|
|
157
|
-
|
|
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:
|
|
164
|
-
B(e.$slots, "righticon", { handleClean:
|
|
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", "
|
|
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
|
-
(
|
|
167
|
+
(y(!0), N(U, null, F(n.value, (a, b) => (y(), V(J, {
|
|
171
168
|
key: b,
|
|
172
|
-
active:
|
|
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: (
|
|
175
|
-
onMouseover: (
|
|
171
|
+
onClick: (H) => $(a, b),
|
|
172
|
+
onMouseover: (H) => w.value = b
|
|
176
173
|
}, {
|
|
177
174
|
default: c(() => [
|
|
178
|
-
|
|
179
|
-
innerHTML:
|
|
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.
|
|
12
|
-
import { _ as S } from "./chunks/BaseAlert.vue_vue_type_style_index_0_lang.
|
|
13
|
-
import { _ as T } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.
|
|
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";
|
package/dist/useFloatingLabel.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
l != null && `${l}`.length > 0 && (
|
|
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
|
|
8
|
-
|
|
7
|
+
const i = (l = !0) => {
|
|
8
|
+
n.value !== "floating-label" && l && (n.value = "floating-label"), e("focusin");
|
|
9
9
|
};
|
|
10
|
-
function u(l
|
|
11
|
-
if (l != null && `${l}`.trim().length > 0
|
|
12
|
-
|
|
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
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
18
|
+
n.value = "inline-label";
|
|
19
|
+
}, o = () => {
|
|
20
|
+
n.value = "floating-label";
|
|
21
21
|
};
|
|
22
22
|
return {
|
|
23
|
-
labelState:
|
|
24
|
-
setInitialLabelState:
|
|
25
|
-
handleFocusIn:
|
|
23
|
+
labelState: n,
|
|
24
|
+
setInitialLabelState: a,
|
|
25
|
+
handleFocusIn: i,
|
|
26
26
|
handleFocusOut: u,
|
|
27
27
|
setInlineLabel: t,
|
|
28
|
-
setFloatingLabel:
|
|
28
|
+
setFloatingLabel: o
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
f as useFloatingLabel
|
|
33
33
|
};
|
package/package.json
CHANGED
|
@@ -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
|
-
};
|