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