@wikicasa-dev/components 2.2.9-alpha.66 → 2.2.9-alpha.8
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/Swiper/autoplay.js +1 -1
- package/dist/Swiper/controller.js +1 -1
- package/dist/Swiper/keyboard.js +1 -1
- package/dist/Swiper/thumbs.js +1 -1
- package/dist/UIKit/AccessibleSelect.d.ts +4 -5
- package/dist/UIKit/AccessibleSelect.js +2 -3
- package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +2 -7
- package/dist/UIKit/BaseAutocomplete.d.ts +4 -4
- package/dist/UIKit/BaseButton.d.ts +8 -14
- package/dist/UIKit/BaseCard.js +3 -1
- package/dist/UIKit/BaseDropDown.d.ts +11 -17
- package/dist/UIKit/BaseFloatingLabel.js +4 -4
- package/dist/UIKit/BaseInput.d.ts +2 -3
- package/dist/UIKit/BaseInput.js +1 -1
- package/dist/UIKit/BaseSnackbar.d.ts +2 -2
- package/dist/UIKit/BaseTextarea.d.ts +2 -2
- package/dist/UIKit/Checkbox/CheckboxBtn.d.ts +7 -14
- package/dist/UIKit/Checkbox/CheckboxGroup.d.ts +2 -5
- package/dist/UIKit/Radio/RadioButton.d.ts +23 -28
- package/dist/UIKit/Radio/RadioGroup.d.ts +50 -49
- package/dist/assets/BaseCard.css +1 -1
- package/dist/assets/BaseDropDown.css +1 -1
- package/dist/assets/BaseFloatingLabel.css +1 -1
- package/dist/assets/BaseInput.css +1 -1
- package/dist/assets/tailwind.css +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +83 -92
- package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +160 -158
- package/dist/packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js +6 -4
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +106 -112
- package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +36 -36
- package/dist/packages/components/lib/UIKit/BaseButton.vue.js +24 -28
- package/dist/packages/components/lib/UIKit/BaseCard.vue.js +13 -13
- package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +105 -102
- package/dist/packages/components/lib/UIKit/BaseFloatingLabel.vue.js +8 -8
- package/dist/packages/components/lib/UIKit/BaseInput.vue.js +64 -65
- package/dist/packages/components/lib/UIKit/BaseModal.vue.js +36 -42
- package/dist/packages/components/lib/UIKit/BaseSelect/SelectItem.vue.js +17 -18
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js +37 -50
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js +55 -60
- package/dist/packages/components/lib/UIKit/Radio/RadioButton.vue.js +14 -16
- package/dist/packages/components/lib/UIKit/Radio/RadioGroup.vue.js +33 -37
- package/dist/types/index.d.ts +0 -3
- package/package.json +7 -8
- package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.d.ts +0 -40
- package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.js +0 -4
- package/dist/UIKit/Radio/v2/RadioButtonGroup.d.ts +0 -29
- package/dist/UIKit/Radio/v2/RadioButtonGroup.js +0 -4
- package/dist/UIKit/Radio/v2/RadioButtonItem.d.ts +0 -16
- package/dist/UIKit/Radio/v2/RadioButtonItem.js +0 -5
- package/dist/assets/AccessibleSelect.css +0 -1
- package/dist/assets/RadioButtonItem.css +0 -1
- package/dist/composables/mock.d.ts +0 -25
- package/dist/composables/mock.js +0 -49
- package/dist/packages/components/lib/UIKit/Checkbox/v2/CheckboxButtonGroup.vue.js +0 -78
- package/dist/packages/components/lib/UIKit/Radio/v2/RadioButtonGroup.vue.js +0 -49
- package/dist/packages/components/lib/UIKit/Radio/v2/RadioButtonItem.vue.js +0 -45
- /package/dist/assets/{swiper-controller.css → swiper-thumbs.css} +0 -0
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { ArrowIcon as
|
|
4
|
-
import { useKeyboardController as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as N, mergeModels as D, useId as R, useModel as E, shallowRef as x, computed as V, useTemplateRef as I, onMounted as z, onUnmounted as q, watch as l, nextTick as U, createElementBlock as j, openBlock as f, normalizeClass as i, renderSlot as K, createBlock as B, createVNode as F, unref as r, withCtx as L, createElementVNode as G, createCommentVNode as J, resolveDynamicComponent as P } from "vue";
|
|
2
|
+
import Q from "./BaseButton.vue.js";
|
|
3
|
+
import { ArrowIcon as X } from "@wikicasa-dev/svg-icons";
|
|
4
|
+
import { useKeyboardController as Y } from "@wikicasa-dev/vue-composables";
|
|
5
|
+
const Z = ["innerHTML"], le = /* @__PURE__ */ N({
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "BaseDropDown",
|
|
8
|
-
props: /* @__PURE__ */
|
|
9
|
-
dropdownAttrs: {},
|
|
8
|
+
props: /* @__PURE__ */ D({
|
|
10
9
|
dropdownClasses: { default: "" },
|
|
11
10
|
btnClasses: { default: "" },
|
|
12
11
|
withArrowIcon: { type: Boolean, default: !1 },
|
|
@@ -16,134 +15,138 @@ const _ = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
|
16
15
|
arrowWidth: { default: 12 },
|
|
17
16
|
arrowStrokeColor: { default: void 0 },
|
|
18
17
|
isAbsolute: { type: Boolean, default: !0 },
|
|
18
|
+
openDropdown: { type: Boolean, default: !1 },
|
|
19
19
|
closeWhenClickedOutside: { type: Boolean, default: !0 },
|
|
20
20
|
dropdownElement: { default: "div" },
|
|
21
21
|
keepState: { default: "" },
|
|
22
22
|
activateKeyboardController: { type: Boolean, default: !0 },
|
|
23
|
-
closeKeys: { type: [Boolean, Array], default: () => ["Escape", "Enter"] },
|
|
24
23
|
dataCy: { default: "" }
|
|
25
24
|
}, {
|
|
25
|
+
toggleDropdown: { type: Boolean, default: void 0 },
|
|
26
|
+
toggleDropdownModifiers: {},
|
|
26
27
|
resetKeyboardController: { type: Boolean, default: !1 },
|
|
27
|
-
resetKeyboardControllerModifiers: {}
|
|
28
|
-
open: { type: Boolean, default: !1 },
|
|
29
|
-
openModifiers: {}
|
|
28
|
+
resetKeyboardControllerModifiers: {}
|
|
30
29
|
}),
|
|
31
|
-
emits: /* @__PURE__ */
|
|
32
|
-
setup(
|
|
33
|
-
const n =
|
|
34
|
-
|
|
30
|
+
emits: /* @__PURE__ */ D(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController"]),
|
|
31
|
+
setup(o, { expose: S, emit: A }) {
|
|
32
|
+
const n = o, k = R(), v = A, w = E(o, "toggleDropdown"), m = E(
|
|
33
|
+
o,
|
|
35
34
|
"resetKeyboardController"
|
|
36
|
-
)
|
|
37
|
-
let
|
|
38
|
-
const
|
|
39
|
-
optionsLength:
|
|
40
|
-
isDropdownOpen:
|
|
41
|
-
global: !1
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
);
|
|
36
|
+
let p = !1;
|
|
37
|
+
const t = x(!1), u = x([]), M = V(() => u.value.length), s = I("container"), y = I("dropdown"), { activeIdx: d, selectedIdx: a, onKeyDownHandler: O } = Y({
|
|
38
|
+
optionsLength: M,
|
|
39
|
+
isDropdownOpen: t,
|
|
40
|
+
global: !1
|
|
41
|
+
}), W = () => {
|
|
42
|
+
t.value = !1;
|
|
43
|
+
}, b = ({ target: e }) => {
|
|
44
|
+
s.value?.contains(e) || W();
|
|
45
|
+
}, h = (e) => {
|
|
46
|
+
t.value && s.value?.contains(document.activeElement) && e.key === "Tab" && (t.value = !1);
|
|
47
|
+
}, $ = (e) => {
|
|
48
|
+
n.activateKeyboardController && O(e);
|
|
49
|
+
}, c = () => {
|
|
50
|
+
n.keepState === "closed" && !t.value || n.keepState === "opened" && t.value || (t.value = !t.value);
|
|
51
|
+
}, T = (e) => {
|
|
52
|
+
e != null && (d.value = e);
|
|
49
53
|
}, H = (e) => {
|
|
50
|
-
n.activateKeyboardController && $(e);
|
|
51
|
-
}, f = () => {
|
|
52
|
-
n.keepState === "closed" && !o.value || n.keepState === "opened" && o.value || (o.value = !o.value);
|
|
53
|
-
}, g = (e) => {
|
|
54
54
|
e != null && (a.value = e);
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
}, E = () => {
|
|
58
|
-
c.value && (s.value = Array.from(c.value.children));
|
|
55
|
+
}, C = () => {
|
|
56
|
+
y.value && (u.value = Array.from(y.value.children));
|
|
59
57
|
};
|
|
60
58
|
return z(() => {
|
|
61
|
-
|
|
62
|
-
}),
|
|
63
|
-
n.closeWhenClickedOutside && (document.removeEventListener("click",
|
|
64
|
-
}),
|
|
65
|
-
e && (
|
|
66
|
-
|
|
59
|
+
C();
|
|
60
|
+
}), q(() => {
|
|
61
|
+
n.closeWhenClickedOutside && (document.removeEventListener("click", b), document.removeEventListener("keydown", h));
|
|
62
|
+
}), l(m, (e) => {
|
|
63
|
+
e && (d.value = -1, a.value = -1, U(() => {
|
|
64
|
+
C(), m.value = !1;
|
|
67
65
|
}));
|
|
68
|
-
}),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
}), l(
|
|
67
|
+
() => n.openDropdown,
|
|
68
|
+
(e) => {
|
|
69
|
+
t.value = e;
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
immediate: !0
|
|
73
|
+
}
|
|
74
|
+
), l(t, (e) => {
|
|
75
|
+
v("update:dropdownState", e);
|
|
76
|
+
}), l(t, (e) => {
|
|
77
|
+
!e || p || !n.closeWhenClickedOutside || (document.addEventListener("click", b), document.addEventListener("keydown", h), p = !0);
|
|
78
|
+
}), l(w, (e) => {
|
|
79
|
+
e && (t.value = !t.value, w.value = !1);
|
|
80
|
+
}), l(a, (e) => {
|
|
81
|
+
e !== -1 && u.value[e].querySelector("a")?.click();
|
|
72
82
|
}), S({
|
|
73
|
-
activeIdx:
|
|
74
|
-
selectedIdx:
|
|
75
|
-
getRootElement: () =>
|
|
76
|
-
|
|
77
|
-
}), (e, r) => (m(), F("div", {
|
|
83
|
+
activeIdx: d,
|
|
84
|
+
selectedIdx: a,
|
|
85
|
+
getRootElement: () => s.value
|
|
86
|
+
}), (e, g) => (f(), j("div", {
|
|
78
87
|
ref: "container",
|
|
79
|
-
class:
|
|
80
|
-
onKeydown:
|
|
88
|
+
class: i(["uikit-relative uikit-block", e.$attrs.class]),
|
|
89
|
+
onKeydown: $
|
|
81
90
|
}, [
|
|
82
|
-
|
|
83
|
-
toggleDropdown:
|
|
84
|
-
isOpen:
|
|
85
|
-
activeIdx: l(a),
|
|
86
|
-
setActiveIdx: g,
|
|
87
|
-
setSelectedIdx: K
|
|
91
|
+
K(e.$slots, "btn_slot", {
|
|
92
|
+
toggleDropdown: c,
|
|
93
|
+
isOpen: t.value
|
|
88
94
|
}, () => [
|
|
89
|
-
|
|
90
|
-
id:
|
|
95
|
+
F(Q, {
|
|
96
|
+
id: r(k),
|
|
91
97
|
type: "button",
|
|
92
|
-
"data-cy":
|
|
93
|
-
class:
|
|
98
|
+
"data-cy": o.dataCy,
|
|
99
|
+
class: i([
|
|
94
100
|
"!uikit-flex uikit-w-full uikit-items-center uikit-truncate",
|
|
95
|
-
|
|
101
|
+
o.btnClasses
|
|
96
102
|
]),
|
|
97
|
-
"aria-expanded":
|
|
103
|
+
"aria-expanded": t.value,
|
|
98
104
|
"btn-class": "uikit-btn-single-selection",
|
|
99
|
-
onClick:
|
|
100
|
-
|
|
101
|
-
}),
|
|
102
|
-
onKeydown: r[1] || (r[1] = (k) => {
|
|
103
|
-
Array.isArray(t.closeKeys) && !t.closeKeys.includes(k.key) || k.stopPropagation();
|
|
105
|
+
onClick: g[0] || (g[0] = (_) => {
|
|
106
|
+
v("click"), c();
|
|
104
107
|
})
|
|
105
108
|
}, {
|
|
106
|
-
default:
|
|
107
|
-
|
|
108
|
-
class:
|
|
109
|
-
innerHTML:
|
|
110
|
-
}, null, 10,
|
|
111
|
-
|
|
109
|
+
default: L(() => [
|
|
110
|
+
G("span", {
|
|
111
|
+
class: i(["uikit-mr-5px", o.labelClasses]),
|
|
112
|
+
innerHTML: o.btnLabel
|
|
113
|
+
}, null, 10, Z),
|
|
114
|
+
o.withArrowIcon ? (f(), B(r(X), {
|
|
112
115
|
key: 0,
|
|
113
|
-
class:
|
|
114
|
-
width:
|
|
115
|
-
height:
|
|
116
|
-
"stroke-color":
|
|
117
|
-
}, null, 8, ["class", "width", "height", "stroke-color"])) :
|
|
116
|
+
class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
|
|
117
|
+
width: o.arrowWidth,
|
|
118
|
+
height: o.arrowWidth,
|
|
119
|
+
"stroke-color": o.arrowStrokeColor
|
|
120
|
+
}, null, 8, ["class", "width", "height", "stroke-color"])) : J("", !0)
|
|
118
121
|
]),
|
|
119
122
|
_: 1
|
|
120
123
|
}, 8, ["id", "data-cy", "class", "aria-expanded"])
|
|
121
124
|
]),
|
|
122
|
-
(
|
|
123
|
-
id: "dropdown_" +
|
|
125
|
+
(f(), B(P(o.dropdownElement), {
|
|
126
|
+
id: "dropdown_" + r(k),
|
|
124
127
|
ref: "dropdown",
|
|
125
|
-
"data-cy":
|
|
126
|
-
class: ["uikit-dropdown-content uikit-w-full uikit-flex-col uikit-overflow-y-auto uikit-border-solid uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
{ "uikit-bottom-[55px]":
|
|
130
|
-
{ "uikit-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"
|
|
134
|
-
},
|
|
135
|
-
default:
|
|
136
|
-
|
|
137
|
-
isOpen:
|
|
138
|
-
toggleDropdown:
|
|
139
|
-
activeIdx:
|
|
140
|
-
selectedIdx:
|
|
141
|
-
setActiveIdx:
|
|
142
|
-
setSelectedIdx:
|
|
128
|
+
"data-cy": o.dataCy && `${o.dataCy}_dropdown`,
|
|
129
|
+
class: i(["uikit-dropdown-content uikit-w-full uikit-flex-col uikit-overflow-y-auto uikit-border uikit-border-solid uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
|
|
130
|
+
o.dropdownClasses,
|
|
131
|
+
t.value ? "uikit-flex" : "uikit-hidden",
|
|
132
|
+
{ "uikit-bottom-[55px] uikit-rounded-xs": o.direction === "up" },
|
|
133
|
+
{ "uikit-rounded-b uikit-border-t-0": o.direction === "down" },
|
|
134
|
+
{ "uikit-absolute": o.isAbsolute }
|
|
135
|
+
]]),
|
|
136
|
+
"aria-hidden": !t.value
|
|
137
|
+
}, {
|
|
138
|
+
default: L(() => [
|
|
139
|
+
K(e.$slots, "default", {
|
|
140
|
+
isOpen: t.value,
|
|
141
|
+
toggleDropdown: c,
|
|
142
|
+
activeIdx: r(d),
|
|
143
|
+
selectedIdx: r(a),
|
|
144
|
+
setActiveIdx: T,
|
|
145
|
+
setSelectedIdx: H
|
|
143
146
|
})
|
|
144
147
|
]),
|
|
145
148
|
_: 3
|
|
146
|
-
},
|
|
149
|
+
}, 8, ["id", "data-cy", "class", "aria-hidden"]))
|
|
147
150
|
], 34));
|
|
148
151
|
}
|
|
149
152
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as d, createElementBlock as a, openBlock as s, withModifiers as u, normalizeClass as t, createElementVNode as r, createCommentVNode as k } from "vue";
|
|
2
|
+
const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
|
|
3
3
|
__name: "BaseFloatingLabel",
|
|
4
4
|
props: {
|
|
5
5
|
labelState: { default: "inline-label" },
|
|
@@ -10,12 +10,12 @@ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ u({
|
|
|
10
10
|
labelTextClasses: {}
|
|
11
11
|
},
|
|
12
12
|
emits: ["click"],
|
|
13
|
-
setup(e, { emit:
|
|
14
|
-
const o =
|
|
15
|
-
return (i, l) => (
|
|
13
|
+
setup(e, { emit: n }) {
|
|
14
|
+
const o = n;
|
|
15
|
+
return (i, l) => (s(), a("label", {
|
|
16
16
|
for: i.$attrs.for,
|
|
17
17
|
class: t(["uikit-pointer-events-none uikit-absolute uikit-left-15px uikit-h-5", [e.labelState, { "uikit-text-w-secondary": e.disabled }, e.labelClasses]]),
|
|
18
|
-
onClick: l[0] || (l[0] =
|
|
18
|
+
onClick: l[0] || (l[0] = u((f) => o("click"), ["stop"]))
|
|
19
19
|
}, [
|
|
20
20
|
r("span", {
|
|
21
21
|
class: t(["uikit-font-medium [font-size:inherit]", [
|
|
@@ -24,9 +24,9 @@ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ u({
|
|
|
24
24
|
]]),
|
|
25
25
|
innerHTML: e.labelText
|
|
26
26
|
}, null, 10, c),
|
|
27
|
-
i.$attrs.required ? (
|
|
27
|
+
i.$attrs.required ? (s(), a("sup", {
|
|
28
28
|
key: 0,
|
|
29
|
-
class: t(["uikit-absolute -uikit-top-[0.
|
|
29
|
+
class: t(["uikit-absolute -uikit-top-[0.3rem] [font-size:inherit]", [
|
|
30
30
|
{ "uikit-text-w-secondary": e.disabled },
|
|
31
31
|
{ "uikit-text-w-danger": e.isValid === !1 },
|
|
32
32
|
{ "uikit-text-w-primary": (e.isValid || e.isValid === null) && !e.disabled }
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useFloatingLabel as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as z, mergeModels as C, useModel as A, ref as m, watch as w, useAttrs as N, createElementBlock as r, openBlock as u, normalizeClass as v, unref as s, renderSlot as c, createElementVNode as h, createBlock as O, createCommentVNode as y, withKeys as j, withModifiers as $, Fragment as T, renderList as B } from "vue";
|
|
2
|
+
import D from "../../../../UIKit/BaseFloatingLabel.js";
|
|
3
|
+
import { useFloatingLabel as G } from "../../../../composables/useFloatingLabel.js";
|
|
4
|
+
const J = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby", "readonly", "type", "pattern", "min", "max", "maxlength", "inputmode", "placeholder", "value"], Q = { class: "uikit-invisible uikit-float-none uikit-mb-2 uikit-ml-2 uikit-block uikit-h-3 uikit-w-auto uikit-max-w-full uikit-overflow-hidden uikit-whitespace-nowrap uikit-p-0 uikit-text uikit-transition-[max-width] uikit-duration-[50ms] uikit-ease-out" }, W = ["innerHTML"], X = ["innerHTML"], Y = ["innerHTML"], Z = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "under-label uikit-absolute uikit-text-12"
|
|
7
|
-
},
|
|
7
|
+
}, te = /* @__PURE__ */ z({
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "BaseInput",
|
|
10
10
|
props: /* @__PURE__ */ C({
|
|
11
|
-
id: {},
|
|
12
11
|
inputClass: {},
|
|
13
12
|
labelText: { default: "" },
|
|
14
13
|
feedback: {},
|
|
@@ -29,14 +28,14 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
29
28
|
}),
|
|
30
29
|
emits: /* @__PURE__ */ C(["click", "keydownEnterPressed", "focusin", "focusout", "keydown", "keyup"], ["update:modelValue"]),
|
|
31
30
|
setup(e, { expose: M, emit: E }) {
|
|
32
|
-
const
|
|
33
|
-
labelState:
|
|
31
|
+
const d = A(e, "modelValue"), a = m(""), k = E, {
|
|
32
|
+
labelState: o,
|
|
34
33
|
handleFocusIn: H,
|
|
35
|
-
handleFocusOut:
|
|
36
|
-
setInlineLabel:
|
|
37
|
-
setFloatingLabel:
|
|
38
|
-
} =
|
|
39
|
-
e.feedback && (
|
|
34
|
+
handleFocusOut: x,
|
|
35
|
+
setInlineLabel: V,
|
|
36
|
+
setFloatingLabel: I
|
|
37
|
+
} = G(k), n = m("text"), f = m({}), b = m(null), R = () => {
|
|
38
|
+
e.feedback && (f.value = e.feedback, e.feedback.valid && typeof e.feedback.valid == "string" && (f.value.valid = [e.feedback.valid]), e.feedback.invalid && typeof e.feedback.invalid == "string" && (f.value.invalid = [e.feedback.invalid]));
|
|
40
39
|
}, L = (t, i) => {
|
|
41
40
|
if (!e.formatter || !e.formatter.formatFn)
|
|
42
41
|
return a.value = t, "";
|
|
@@ -44,56 +43,56 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
44
43
|
return i && (i.value = l), a.value = l, l;
|
|
45
44
|
}, F = (t, i = !0) => {
|
|
46
45
|
if (i && (!e.formatter || !e.formatter.unFormatFn))
|
|
47
|
-
return
|
|
46
|
+
return d.value = t, t;
|
|
48
47
|
if (!i || !e.formatter || !e.formatter.unFormatFn) return;
|
|
49
48
|
const l = e.formatter.unFormatFn(t);
|
|
50
|
-
return
|
|
51
|
-
},
|
|
49
|
+
return d.value = l ?? "", l;
|
|
50
|
+
}, P = ({ target: t }) => {
|
|
52
51
|
const i = t, l = F(i.value);
|
|
53
52
|
L(
|
|
54
53
|
`${l}`,
|
|
55
|
-
l ===
|
|
54
|
+
l === d.value ? i : void 0
|
|
56
55
|
);
|
|
56
|
+
}, q = () => {
|
|
57
|
+
d.value = "", V();
|
|
57
58
|
}, K = () => {
|
|
58
|
-
o.value = "", I();
|
|
59
|
-
}, S = () => {
|
|
60
59
|
n.value === "password" ? n.value = "text" : n.value === "text" && (n.value = "password");
|
|
61
60
|
};
|
|
62
|
-
|
|
61
|
+
w(
|
|
63
62
|
() => e.feedback,
|
|
64
63
|
() => {
|
|
65
|
-
|
|
64
|
+
R();
|
|
66
65
|
},
|
|
67
66
|
{
|
|
68
67
|
immediate: !0
|
|
69
68
|
}
|
|
70
|
-
),
|
|
71
|
-
|
|
69
|
+
), w(
|
|
70
|
+
d,
|
|
72
71
|
(t) => {
|
|
73
72
|
L(
|
|
74
73
|
`${t}`,
|
|
75
|
-
F(`${t}`, !1) === t ?
|
|
76
|
-
), a.value != null && a.value.length > 0 &&
|
|
74
|
+
F(`${t}`, !1) === t ? b.value : void 0
|
|
75
|
+
), a.value != null && a.value.length > 0 && o.value !== "floating-label" ? I() : !a.value && document && document.activeElement !== b.value && V();
|
|
77
76
|
},
|
|
78
77
|
{
|
|
79
78
|
immediate: !0
|
|
80
79
|
}
|
|
81
|
-
),
|
|
80
|
+
), w(
|
|
82
81
|
() => e.keepFloatingLabel,
|
|
83
82
|
(t) => {
|
|
84
|
-
t ?
|
|
83
|
+
t ? I() : x(d.value);
|
|
85
84
|
}
|
|
86
85
|
);
|
|
87
|
-
const
|
|
88
|
-
return n.value =
|
|
86
|
+
const S = N();
|
|
87
|
+
return n.value = S.type || "text", M({
|
|
89
88
|
select: () => {
|
|
90
|
-
|
|
89
|
+
b.value?.select();
|
|
91
90
|
}
|
|
92
91
|
}), (t, i) => (u(), r("div", {
|
|
93
92
|
class: v(["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", [
|
|
94
93
|
t.$attrs.class,
|
|
95
94
|
{ "floating-label": e.labelText },
|
|
96
|
-
|
|
95
|
+
s(o) === "floating-label" ? "floating-state" : "inline-state",
|
|
97
96
|
{
|
|
98
97
|
"has-right-icon": e.withRightIcon !== void 0 ? e.withRightIcon : !!t.$slots.righticon
|
|
99
98
|
},
|
|
@@ -103,16 +102,16 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
103
102
|
{ "is-invalid": e.isValid === !1, "is-valid": e.isValid }
|
|
104
103
|
]])
|
|
105
104
|
}, [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
handleClean:
|
|
109
|
-
handleShowPasswd:
|
|
105
|
+
c(t.$slots, "leftIcon", {}, void 0, !0),
|
|
106
|
+
c(t.$slots, "righticon", {
|
|
107
|
+
handleClean: q,
|
|
108
|
+
handleShowPasswd: K,
|
|
110
109
|
curType: n.value
|
|
111
110
|
}, void 0, !0),
|
|
112
|
-
|
|
113
|
-
id:
|
|
111
|
+
h("input", {
|
|
112
|
+
id: t.$attrs.id,
|
|
114
113
|
ref_key: "baseInputEl",
|
|
115
|
-
ref:
|
|
114
|
+
ref: b,
|
|
116
115
|
"data-cy": e.dataCy,
|
|
117
116
|
name: t.$attrs.name,
|
|
118
117
|
class: v(["input-element uikit-peer uikit-relative uikit-ml-[1px] uikit-mt-[6px] uikit-box-border uikit-block uikit-h-[42px] uikit-w-[calc(100%-2px)] uikit-appearance-none uikit-truncate uikit-rounded-[11px] !uikit-border-none uikit-bg-white uikit-bg-no-repeat uikit-px-4 uikit-outline-0 focus:uikit-shadow-none focus:uikit-outline-none disabled:uikit-bg-w-cultured disabled:uikit-text-w-secondary", [
|
|
@@ -130,7 +129,7 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
130
129
|
]]),
|
|
131
130
|
autocomplete: t.$attrs.autocomplete === "on" ? "on" : "off",
|
|
132
131
|
disabled: t.$attrs.disabled,
|
|
133
|
-
"aria-labelledby":
|
|
132
|
+
"aria-labelledby": t.$attrs.id,
|
|
134
133
|
readonly: t.$attrs.readonly,
|
|
135
134
|
type: n.value,
|
|
136
135
|
pattern: t.$attrs.pattern,
|
|
@@ -141,16 +140,16 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
141
140
|
placeholder: t.$attrs.placeholder,
|
|
142
141
|
value: a.value,
|
|
143
142
|
onClick: i[0] || (i[0] = (l) => k("click", l)),
|
|
144
|
-
onFocusin: i[1] || (i[1] = () => e.labelText &&
|
|
145
|
-
onFocusout: i[2] || (i[2] = (l) => e.labelText && !e.keepFloatingLabel &&
|
|
146
|
-
onInput:
|
|
143
|
+
onFocusin: i[1] || (i[1] = $(() => e.labelText && s(H)(), ["stop"])),
|
|
144
|
+
onFocusout: i[2] || (i[2] = $((l) => e.labelText && !e.keepFloatingLabel && s(x)(a.value), ["stop"])),
|
|
145
|
+
onInput: $(P, ["stop"]),
|
|
147
146
|
onKeydown: [
|
|
148
|
-
i[3] || (i[3] =
|
|
147
|
+
i[3] || (i[3] = j(() => k("keydownEnterPressed"), ["enter"])),
|
|
149
148
|
i[4] || (i[4] = (l) => k("keydown", l))
|
|
150
149
|
],
|
|
151
150
|
onKeyup: i[5] || (i[5] = (l) => k("keyup", l))
|
|
152
|
-
}, null, 42,
|
|
153
|
-
|
|
151
|
+
}, null, 42, J),
|
|
152
|
+
h("fieldset", {
|
|
154
153
|
class: v(["uikit-pointer-events-none uikit-absolute uikit-bottom-0 uikit-left-0 uikit-right-0 uikit-top-0 uikit-m-0 uikit-box-border uikit-h-12 uikit-overflow-hidden uikit-rounded-xs uikit-border uikit-border-solid uikit-px-2 uikit-py-0 uikit-text-left uikit-transition-[border] uikit-duration-100 uikit-ease-out peer-focus:uikit-border-2 peer-focus:uikit-border-w-primary peer-focus:[&.is-invalid]:uikit-border-w-danger", [
|
|
155
154
|
{
|
|
156
155
|
"is-invalid uikit-border-w-danger": e.isValid === !1,
|
|
@@ -161,52 +160,52 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
|
|
|
161
160
|
e.fieldsetClasses
|
|
162
161
|
]])
|
|
163
162
|
}, [
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
h("legend", Q, [
|
|
164
|
+
h("span", {
|
|
166
165
|
class: v(["visible-label uikit-opacity-0", [
|
|
167
166
|
{ "uikit-mx-5px": e.labelText },
|
|
168
167
|
{
|
|
169
|
-
"uikit-visible uikit-inline-block":
|
|
168
|
+
"uikit-visible uikit-inline-block": s(o) === "floating-label"
|
|
170
169
|
},
|
|
171
170
|
{
|
|
172
|
-
"uikit-invisible uikit-hidden":
|
|
171
|
+
"uikit-invisible uikit-hidden": s(o) === "inline-label"
|
|
173
172
|
}
|
|
174
173
|
]]),
|
|
175
174
|
innerHTML: e.labelText
|
|
176
|
-
}, null, 10,
|
|
175
|
+
}, null, 10, W)
|
|
177
176
|
])
|
|
178
177
|
], 2),
|
|
179
|
-
e.labelText ? (u(),
|
|
178
|
+
e.labelText ? (u(), O(D, {
|
|
180
179
|
key: 0,
|
|
181
|
-
for:
|
|
180
|
+
for: t.$attrs.id,
|
|
182
181
|
"label-text": e.labelText,
|
|
183
|
-
"label-state":
|
|
182
|
+
"label-state": s(o),
|
|
184
183
|
"is-valid": e.isValid,
|
|
185
184
|
required: t.$attrs.required,
|
|
186
185
|
disabled: t.$attrs.disabled,
|
|
187
186
|
"label-classes": [
|
|
188
|
-
|
|
187
|
+
s(o) === "floating-label" ? "!-uikit-top-1" : "!uikit-top-4",
|
|
189
188
|
e.labelClasses
|
|
190
189
|
],
|
|
191
190
|
"label-text-classes": e.labelTextClasses
|
|
192
|
-
}, null, 8, ["for", "label-text", "label-state", "is-valid", "required", "disabled", "label-classes", "label-text-classes"])) :
|
|
193
|
-
|
|
194
|
-
e.isValid === !1 ? (u(!0), r(T, { key: 0 }, B(
|
|
195
|
-
key: `${
|
|
191
|
+
}, null, 8, ["for", "label-text", "label-state", "is-valid", "required", "disabled", "label-classes", "label-text-classes"])) : y("", !0),
|
|
192
|
+
c(t.$slots, "feedback", {}, () => [
|
|
193
|
+
e.isValid === !1 ? (u(!0), r(T, { key: 0 }, B(f.value.invalid, (l, g) => (u(), r("div", {
|
|
194
|
+
key: `${t.$attrs.id}_invalid_${g}`,
|
|
196
195
|
class: "uikit-mt-1 uikit-text-12 uikit-text-w-danger",
|
|
197
196
|
innerHTML: l
|
|
198
|
-
}, null, 8,
|
|
199
|
-
key: `${
|
|
197
|
+
}, null, 8, X))), 128)) : e.isValid === !0 ? (u(!0), r(T, { key: 1 }, B(f.value.valid, (l, g) => (u(), r("div", {
|
|
198
|
+
key: `${t.$attrs.id}_valid_${g}`,
|
|
200
199
|
class: "uikit-mt-1 uikit-text-12 uikit-text-w-primary",
|
|
201
200
|
innerHTML: l
|
|
202
|
-
}, null, 8,
|
|
201
|
+
}, null, 8, Y))), 128)) : y("", !0)
|
|
203
202
|
], !0),
|
|
204
|
-
t.$slots["under-label"] ? (u(), r("div",
|
|
205
|
-
|
|
206
|
-
])) :
|
|
203
|
+
t.$slots["under-label"] ? (u(), r("div", Z, [
|
|
204
|
+
c(t.$slots, "under-label", {}, void 0, !0)
|
|
205
|
+
])) : y("", !0)
|
|
207
206
|
], 2));
|
|
208
207
|
}
|
|
209
208
|
});
|
|
210
209
|
export {
|
|
211
|
-
|
|
210
|
+
te as default
|
|
212
211
|
};
|