@wikicasa-dev/components 1.6.11 → 1.6.12
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/BaseInput.js +27 -27
- package/dist/assets/BaseInput.css +1 -1
- package/package.json +1 -1
package/dist/BaseInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './assets/BaseInput.css';
|
|
2
|
-
import { defineComponent as N, mergeModels as L, useModel as O, ref as f, watch as
|
|
2
|
+
import { defineComponent as N, mergeModels as L, useModel as O, ref as f, watch as $, useAttrs as j, openBlock as n, createElementBlock as u, normalizeClass as b, unref as s, renderSlot as p, createElementVNode as m, withModifiers as g, withKeys as D, createBlock as G, createCommentVNode as c, Fragment as I, renderList as M } from "vue";
|
|
3
3
|
import J from "./BaseFloatingLabel.js";
|
|
4
4
|
import { useFloatingLabel as Q } from "./useFloatingLabel.js";
|
|
5
5
|
import { _ as R } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
@@ -21,14 +21,14 @@ const U = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
21
21
|
modelModifiers: {}
|
|
22
22
|
}),
|
|
23
23
|
emits: /* @__PURE__ */ L(["click", "keydownEnterPressed", "focusin", "focusout", "keydown"], ["update:modelValue"]),
|
|
24
|
-
setup(
|
|
25
|
-
const t =
|
|
24
|
+
setup(w, { expose: C, emit: B }) {
|
|
25
|
+
const t = w, o = O(w, "modelValue"), v = f(""), k = B, {
|
|
26
26
|
labelState: r,
|
|
27
|
-
handleFocusIn:
|
|
28
|
-
handleFocusOut:
|
|
29
|
-
setInlineLabel:
|
|
30
|
-
setFloatingLabel:
|
|
31
|
-
} = Q(k), l = f("text"), d = f({}),
|
|
27
|
+
handleFocusIn: E,
|
|
28
|
+
handleFocusOut: y,
|
|
29
|
+
setInlineLabel: V,
|
|
30
|
+
setFloatingLabel: F
|
|
31
|
+
} = Q(k), l = f("text"), d = f({}), T = f(null), H = () => {
|
|
32
32
|
t.feedback && (d.value = t.feedback, t.feedback.valid && typeof t.feedback.valid == "string" && (d.value.valid = [t.feedback.valid]), t.feedback.invalid && typeof t.feedback.invalid == "string" && (d.value.invalid = [t.feedback.invalid]));
|
|
33
33
|
}, P = (e) => {
|
|
34
34
|
if (!t.formatter || !t.formatter.formatFn)
|
|
@@ -44,11 +44,11 @@ const U = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
44
44
|
const i = e;
|
|
45
45
|
q(i.value) || (o.value = i.value);
|
|
46
46
|
}, S = () => {
|
|
47
|
-
o.value = "",
|
|
47
|
+
o.value = "", V();
|
|
48
48
|
}, A = () => {
|
|
49
49
|
l.value === "password" ? l.value = "text" : l.value === "text" && (l.value = "password");
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
$(
|
|
52
52
|
() => t.feedback,
|
|
53
53
|
() => {
|
|
54
54
|
H();
|
|
@@ -56,24 +56,24 @@ const U = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
56
56
|
{
|
|
57
57
|
immediate: !0
|
|
58
58
|
}
|
|
59
|
-
),
|
|
59
|
+
), $(
|
|
60
60
|
o,
|
|
61
61
|
(e) => {
|
|
62
|
-
P(`${e}`) || (v.value = `${e}`), e != null && `${e}`.length > 0 && r.value !== "floating-label" ?
|
|
62
|
+
P(`${e}`) || (v.value = `${e}`), e != null && `${e}`.length > 0 && r.value !== "floating-label" ? F() : `${e}`.length || V();
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
immediate: !0
|
|
66
66
|
}
|
|
67
|
-
),
|
|
67
|
+
), $(
|
|
68
68
|
() => t.keepFloatingLabel,
|
|
69
69
|
(e) => {
|
|
70
|
-
e ?
|
|
70
|
+
e ? F() : y(o.value);
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
const K = j();
|
|
74
|
-
return l.value = K.type || "text",
|
|
74
|
+
return l.value = K.type || "text", C({
|
|
75
75
|
select: () => {
|
|
76
|
-
|
|
76
|
+
T.value?.select();
|
|
77
77
|
}
|
|
78
78
|
}), (e, i) => (n(), u("div", {
|
|
79
79
|
class: b(["input-wrapper uikit-relative uikit-inline-block uikit-w-full [&.has-right-icon.is-invalid_.text-input-icon]:uikit-mr-25px [&.has-right-icon.is-valid_.text-input-icon]:uikit-mr-25px", [
|
|
@@ -99,7 +99,7 @@ const U = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
99
99
|
m("input", {
|
|
100
100
|
id: e.$attrs.id,
|
|
101
101
|
ref_key: "baseInputEl",
|
|
102
|
-
ref:
|
|
102
|
+
ref: T,
|
|
103
103
|
"data-cy": e.$attrs["data-cy"],
|
|
104
104
|
name: e.$attrs.name,
|
|
105
105
|
class: b(["input-element uikit-peer uikit-relative uikit-z-10 uikit-box-border uikit-block uikit-h-12 uikit-w-full uikit-appearance-none uikit-truncate uikit-rounded-xs !uikit-border-none uikit-bg-transparent uikit-bg-no-repeat uikit-px-4 uikit-pt-5px uikit-outline-0 focus:uikit-shadow-none focus:uikit-outline-none", [
|
|
@@ -128,8 +128,8 @@ const U = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
128
128
|
inputmode: e.$attrs.inputmode,
|
|
129
129
|
placeholder: e.$attrs.placeholder,
|
|
130
130
|
onClick: i[0] || (i[0] = (a) => k("click", a)),
|
|
131
|
-
onFocusin: i[1] || (i[1] = g(() => e.labelText && s(
|
|
132
|
-
onFocusout: i[2] || (i[2] = g((a) => e.labelText && !e.keepFloatingLabel && s(
|
|
131
|
+
onFocusin: i[1] || (i[1] = g(() => e.labelText && s(E)(), ["stop"])),
|
|
132
|
+
onFocusout: i[2] || (i[2] = g((a) => e.labelText && !e.keepFloatingLabel && s(y)(o.value), ["stop"])),
|
|
133
133
|
onInput: g(z, ["stop"]),
|
|
134
134
|
value: v.value,
|
|
135
135
|
onKeydown: [
|
|
@@ -176,24 +176,24 @@ const U = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
176
176
|
s(r) === "floating-label" ? "!-uikit-top-1" : "!uikit-top-4",
|
|
177
177
|
e.$attrs["label-classes"]
|
|
178
178
|
]
|
|
179
|
-
}, null, 8, ["for", "label-text", "label-state", "is-valid", "required", "disabled", "label-classes"])) :
|
|
179
|
+
}, null, 8, ["for", "label-text", "label-state", "is-valid", "required", "disabled", "label-classes"])) : c("", !0),
|
|
180
180
|
p(e.$slots, "feedback", {}, () => [
|
|
181
|
-
e.isValid === !1 ? (n(!0), u(I, { key: 0 }, M(d.value.invalid, (a,
|
|
182
|
-
key: `${e.$attrs.id}_invalid_${
|
|
181
|
+
e.isValid === !1 ? (n(!0), u(I, { key: 0 }, M(d.value.invalid, (a, h) => (n(), u("div", {
|
|
182
|
+
key: `${e.$attrs.id}_invalid_${h}`,
|
|
183
183
|
class: "uikit-mt-1 uikit-text-12 uikit-text-w-danger",
|
|
184
184
|
innerHTML: a
|
|
185
|
-
}, null, 8, Y))), 128)) : e.isValid === !0 ? (n(!0), u(I, { key: 1 }, M(d.value.valid, (a,
|
|
186
|
-
key: `${e.$attrs.id}_valid_${
|
|
185
|
+
}, null, 8, Y))), 128)) : e.isValid === !0 ? (n(!0), u(I, { key: 1 }, M(d.value.valid, (a, h) => (n(), u("div", {
|
|
186
|
+
key: `${e.$attrs.id}_valid_${h}`,
|
|
187
187
|
class: "uikit-mt-1 uikit-text-12 uikit-text-w-primary",
|
|
188
188
|
innerHTML: a
|
|
189
|
-
}, null, 8, Z))), 128)) :
|
|
189
|
+
}, null, 8, Z))), 128)) : c("", !0)
|
|
190
190
|
], !0),
|
|
191
191
|
e.$slots["under-label"] ? (n(), u("div", x, [
|
|
192
192
|
p(e.$slots, "under-label", {}, void 0, !0)
|
|
193
|
-
])) :
|
|
193
|
+
])) : c("", !0)
|
|
194
194
|
], 2));
|
|
195
195
|
}
|
|
196
|
-
}), ne = /* @__PURE__ */ R(_, [["__scopeId", "data-v-
|
|
196
|
+
}), ne = /* @__PURE__ */ R(_, [["__scopeId", "data-v-aab92742"]]);
|
|
197
197
|
export {
|
|
198
198
|
ne as default
|
|
199
199
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.input-wrapper[data-v-
|
|
1
|
+
.input-wrapper[data-v-aab92742]{--icon-default-size: 44px}.invalid-bg[data-v-aab92742]{--invalid-img: url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMicgaGVpZ2h0PScxMicgZmlsbD0nbm9uZScgc3Ryb2tlPScjRkE0RjY0Jz48Y2lyY2xlIGN4PSc2JyBjeT0nNicgcj0nNC41Jy8+PHBhdGggc3Ryb2tlLWxpbmVqb2luPSdyb3VuZCcgZD0nTTUuOCAzLjZoLjRMNiA2LjV6Jy8+PGNpcmNsZSBjeD0nNicgY3k9JzguMicgcj0nLjYnIGZpbGw9JyNGQTRGNjQnIHN0cm9rZT0nbm9uZScvPjwvc3ZnPg==);background-image:var(--invalid-img)}.valid-bg[data-v-aab92742]{--valid-img: url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA4IDgnPjxwYXRoIGZpbGw9JyMyQjVERkYnIGQ9J00yLjMgNi43My42IDQuNTNjLS40LTEuMDQuNDYtMS40IDEuMS0uOGwxLjEgMS40IDMuNC0zLjhjLjYtLjYzIDEuNi0uMjcgMS4yLjdsLTQgNC42Yy0uNDMuNS0uOC40LTEuMS4xeicvPjwvc3ZnPg==);background-image:var(--valid-img)}.invalid-bg[data-v-aab92742],.valid-bg[data-v-aab92742]{background-position:top 17px right 12px;background-size:20px}.has-right-icon[data-v-aab92742]>label.inline-label{right:var(--icon-default-size)}.has-left-icon[data-v-aab92742]>label.inline-label{left:var(--icon-default-size)}[data-v-aab92742] .text-input-icon{position:absolute;z-index:20;box-sizing:border-box;--icon-size-sm: 16px;--icon-size-md: 20px;--icon-size-lg: 25px}[data-v-aab92742] .text-input-icon.left{left:5px}[data-v-aab92742] .text-input-icon.right{right:5px}[data-v-aab92742] .text-input-icon{--icon-top: 5px;--icon-size: var(--icon-size-sm);width:var(--icon-default-size);height:var(--icon-default-size);padding:calc((var(--icon-default-size) - var(--icon-size)) / 2);top:var(--icon-top)}[data-v-aab92742] .text-input-icon.md{--icon-size: var(--icon-size-md)}[data-v-aab92742] .text-input-icon.lg{--icon-top: 0;--icon-size: var(--icon-size-lg)}.under-label[data-v-aab92742]{left:4px;font-style:italic}
|