@wikicasa-dev/components 2.0.2 → 2.0.3
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/UIKit/AccessibleSelect.vue.d.ts +12 -0
- package/dist/chunks/{AccessibleSelect.vue_vue_type_script_setup_true_lang.MhVm5k0I.js → AccessibleSelect.vue_vue_type_script_setup_true_lang.YIp2u7gd.js} +34 -33
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/AccessibleSelect.js
CHANGED
|
@@ -29,6 +29,10 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
|
29
29
|
fieldsetClasses?: ClassType;
|
|
30
30
|
legendClasses?: ClassType;
|
|
31
31
|
dropdownClasses?: ClassType;
|
|
32
|
+
labelClasses?: ClassType;
|
|
33
|
+
btnClasses?: ClassType;
|
|
34
|
+
dropdownItemClasses?: ClassType;
|
|
35
|
+
btnTextClasses?: ClassType;
|
|
32
36
|
arrowIcon?: Partial<{
|
|
33
37
|
width: number;
|
|
34
38
|
height: number;
|
|
@@ -57,6 +61,10 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
|
57
61
|
fieldsetClasses?: ClassType;
|
|
58
62
|
legendClasses?: ClassType;
|
|
59
63
|
dropdownClasses?: ClassType;
|
|
64
|
+
labelClasses?: ClassType;
|
|
65
|
+
btnClasses?: ClassType;
|
|
66
|
+
dropdownItemClasses?: ClassType;
|
|
67
|
+
btnTextClasses?: ClassType;
|
|
60
68
|
arrowIcon?: Partial<{
|
|
61
69
|
width: number;
|
|
62
70
|
height: number;
|
|
@@ -75,8 +83,10 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
|
75
83
|
classes: ClassType;
|
|
76
84
|
}>;
|
|
77
85
|
dataCy: string;
|
|
86
|
+
btnClasses: ClassType;
|
|
78
87
|
isValid: boolean | null;
|
|
79
88
|
modelValue: AccessibleSelectOptions;
|
|
89
|
+
labelClasses: ClassType;
|
|
80
90
|
dropdownPosition: "top" | "bottom";
|
|
81
91
|
feedback: Partial<{
|
|
82
92
|
valid: string;
|
|
@@ -87,6 +97,8 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
|
87
97
|
fieldsetClasses: ClassType;
|
|
88
98
|
legendClasses: ClassType;
|
|
89
99
|
dropdownClasses: ClassType;
|
|
100
|
+
dropdownItemClasses: ClassType;
|
|
101
|
+
btnTextClasses: ClassType;
|
|
90
102
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
91
103
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
92
104
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as m, defineComponent as M, ref as
|
|
2
|
-
import { A as
|
|
1
|
+
import { h as m, defineComponent as M, ref as g, computed as T, watch as B, onMounted as H, onUnmounted as F, openBlock as l, createElementBlock as s, normalizeClass as a, createElementVNode as o, createCommentVNode as d, withModifiers as k, renderSlot as I, unref as p, createBlock as z, createVNode as A, Fragment as C, renderList as E } from "vue";
|
|
2
|
+
import { A as P } from "./useKeyboardController.CutKeclN.js";
|
|
3
3
|
import { a as O } from "./ArrowIcon.CCFMdsq6.js";
|
|
4
4
|
import { e as q } from "./PharmacyIcon.56ql_DYl.js";
|
|
5
5
|
const N = (n, { attrs: f }) => {
|
|
@@ -55,59 +55,60 @@ const N = (n, { attrs: f }) => {
|
|
|
55
55
|
fieldsetClasses: { default: "" },
|
|
56
56
|
legendClasses: { default: "" },
|
|
57
57
|
dropdownClasses: { default: "" },
|
|
58
|
+
labelClasses: { default: "" },
|
|
59
|
+
btnClasses: { default: "" },
|
|
60
|
+
dropdownItemClasses: { default: "" },
|
|
61
|
+
btnTextClasses: { default: "" },
|
|
58
62
|
arrowIcon: { default: void 0 },
|
|
59
63
|
dataCy: { default: "" }
|
|
60
64
|
},
|
|
61
65
|
emits: ["update:modelValue"],
|
|
62
66
|
setup(n, { emit: f }) {
|
|
63
|
-
const t = n, e =
|
|
67
|
+
const t = n, e = g(!1), $ = g(null), v = T(() => !!t.modelValue.label), V = f, { activeIdx: b, selectedIdx: L } = P({
|
|
64
68
|
optionsLength: t.options.length,
|
|
65
69
|
isDropdownOpen: e
|
|
66
70
|
}), h = (i) => {
|
|
67
|
-
e.value = !1,
|
|
71
|
+
e.value = !1, V("update:modelValue", i);
|
|
68
72
|
};
|
|
69
|
-
|
|
73
|
+
B(L, (i) => {
|
|
70
74
|
h(t.options[i]), e.value = !1;
|
|
71
75
|
});
|
|
72
76
|
const w = ({ target: i }) => {
|
|
73
77
|
`${t.namespace}_btn` !== i.id && (e.value = !1);
|
|
74
78
|
};
|
|
75
|
-
return
|
|
79
|
+
return H(() => {
|
|
76
80
|
t.closeOnBodyPressed && document.addEventListener("click", w);
|
|
77
81
|
}), F(() => {
|
|
78
82
|
t.closeOnBodyPressed && document.removeEventListener("click", w);
|
|
79
|
-
}), (i, r) => (
|
|
80
|
-
class:
|
|
83
|
+
}), (i, r) => (l(), s("div", {
|
|
84
|
+
class: a([i.$attrs.class])
|
|
81
85
|
}, [
|
|
82
86
|
o("div", j, [
|
|
83
|
-
i.label ? (
|
|
87
|
+
i.label ? (l(), s("label", {
|
|
84
88
|
key: 0,
|
|
85
89
|
id: `${i.namespace}_label`,
|
|
86
|
-
class:
|
|
90
|
+
class: a(["uikit-pointer-events-none uikit-absolute uikit-z-10 uikit-text-sm uikit-font-medium uikit-transition-all uikit-ease-in-out", [
|
|
87
91
|
v.value ? "as-floating -uikit-top-1 uikit-left-[22px] uikit-text-w-black" : "as-inline uikit-top-4 uikit-text-w-gray",
|
|
88
|
-
i
|
|
92
|
+
i.labelClasses,
|
|
89
93
|
{ "uikit-left-9": i.$slots.lefticon && !v.value },
|
|
90
94
|
{ "uikit-left-4": !i.$slots.lefticon && !v.value }
|
|
91
95
|
]]),
|
|
92
96
|
innerHTML: i.label
|
|
93
97
|
}, null, 10, D)) : d("", !0),
|
|
94
|
-
i.$slots.lefticon ? (
|
|
98
|
+
i.$slots.lefticon ? (l(), s("span", {
|
|
95
99
|
key: 1,
|
|
96
100
|
class: "uikit-z-20 uikit-mt-2 uikit-pl-2",
|
|
97
101
|
onClick: r[0] || (r[0] = k((u) => e.value = !e.value, ["stop"]))
|
|
98
102
|
}, [
|
|
99
|
-
|
|
103
|
+
I(i.$slots, "lefticon")
|
|
100
104
|
])) : d("", !0),
|
|
101
105
|
o("button", {
|
|
102
106
|
id: `${i.namespace}_btn`,
|
|
103
107
|
ref_key: "btnEl",
|
|
104
|
-
ref:
|
|
108
|
+
ref: $,
|
|
105
109
|
type: "button",
|
|
106
110
|
"data-cy": i.dataCy,
|
|
107
|
-
class:
|
|
108
|
-
i.$slots.lefticon ? "uikit-pl-2" : "uikit-pl-4",
|
|
109
|
-
i.$attrs["btn-classes"]
|
|
110
|
-
]]),
|
|
111
|
+
class: a(["uikit-peer uikit-relative uikit-z-10 uikit-flex uikit-h-full uikit-w-full uikit-items-center uikit-justify-between uikit-truncate uikit-border-0 uikit-bg-transparent uikit-pr-4 uikit-text-left focus-visible:uikit-outline-0", [i.$slots.lefticon ? "uikit-pl-2" : "uikit-pl-4", i.btnClasses]]),
|
|
111
112
|
"aria-required": !!i.$attrs.required,
|
|
112
113
|
role: "combobox",
|
|
113
114
|
"aria-haspopup": "listbox",
|
|
@@ -120,18 +121,18 @@ const N = (n, { attrs: f }) => {
|
|
|
120
121
|
onClick: r[1] || (r[1] = (u) => e.value = !e.value)
|
|
121
122
|
}, [
|
|
122
123
|
o("span", {
|
|
123
|
-
class:
|
|
124
|
+
class: a(["uikit-pointer-events-none uikit-mt-1", i.btnTextClasses]),
|
|
124
125
|
innerHTML: i.modelValue.visibleLabel || i.modelValue.label
|
|
125
126
|
}, null, 10, U),
|
|
126
127
|
o("span", G, [
|
|
127
|
-
t.isValid == !1 ? (
|
|
128
|
+
t.isValid == !1 ? (l(), z(p(N), {
|
|
128
129
|
key: 0,
|
|
129
130
|
class: "uikit-mr-1",
|
|
130
131
|
width: 20,
|
|
131
132
|
height: 20
|
|
132
133
|
})) : d("", !0),
|
|
133
|
-
|
|
134
|
-
class:
|
|
134
|
+
A(p(O), {
|
|
135
|
+
class: a(["uikit-transition-transform motion-reduce:uikit-transition-none", [
|
|
135
136
|
e.value ? "uikit-rotate-180" : "",
|
|
136
137
|
i.arrowIcon?.classes
|
|
137
138
|
]]),
|
|
@@ -143,7 +144,7 @@ const N = (n, { attrs: f }) => {
|
|
|
143
144
|
], 10, S),
|
|
144
145
|
o("fieldset", {
|
|
145
146
|
"aria-hidden": "true",
|
|
146
|
-
class:
|
|
147
|
+
class: a(["uikit-pointer-events-none uikit-absolute uikit-bottom-0 uikit-left-0 uikit-right-0 uikit-m-0 uikit-box-border uikit-h-12 uikit-cursor-pointer uikit-rounded-xs uikit-bg-white uikit-px-2 uikit-py-0 peer-focus:uikit-border-2", [
|
|
147
148
|
i.fieldsetClasses,
|
|
148
149
|
i.isValid ? "uikit-border-w-primary" : i.isValid === !1 ? "uikit-border-w-danger" : "uikit-border-w-secondary",
|
|
149
150
|
{
|
|
@@ -153,21 +154,21 @@ const N = (n, { attrs: f }) => {
|
|
|
153
154
|
]])
|
|
154
155
|
}, [
|
|
155
156
|
o("legend", {
|
|
156
|
-
class:
|
|
157
|
+
class: a([[i.legendClasses, { "uikit-m-0 uikit-w-0": !i.label }], "uikit-ml-2 uikit-h-3 uikit-px-0 uikit-text-sm"])
|
|
157
158
|
}, [
|
|
158
|
-
i.label ? (
|
|
159
|
+
i.label ? (l(), s("span", {
|
|
159
160
|
key: 0,
|
|
160
|
-
class:
|
|
161
|
+
class: a(["uikit-mx-5px", [i.modelValue.label ? "uikit-invisible" : "uikit-hidden"]]),
|
|
161
162
|
innerHTML: i.label
|
|
162
163
|
}, null, 10, J)) : d("", !0)
|
|
163
164
|
], 2)
|
|
164
165
|
], 2),
|
|
165
166
|
o("ul", {
|
|
166
|
-
"data-cy": i
|
|
167
|
+
"data-cy": i.dataCy && `${i.dataCy}_dropdown`,
|
|
167
168
|
role: "listbox",
|
|
168
169
|
tabindex: -1,
|
|
169
170
|
"aria-multiselectable": !1,
|
|
170
|
-
class:
|
|
171
|
+
class: a(["uikit-absolute uikit-z-30 uikit-m-0 uikit-max-h-[225px] uikit-w-full uikit-min-w-full uikit-list-none uikit-overflow-y-auto uikit-p-0 uikit-no-scrollbar", [
|
|
171
172
|
{ "uikit-h-0 uikit-w-0 uikit-overflow-hidden": !e.value },
|
|
172
173
|
{
|
|
173
174
|
"uikit-rounded-xs uikit-border uikit-border-solid uikit-border-w-secondary uikit-bg-white": e.value
|
|
@@ -179,12 +180,12 @@ const N = (n, { attrs: f }) => {
|
|
|
179
180
|
onClick: r[3] || (r[3] = k(() => {
|
|
180
181
|
}, ["stop"]))
|
|
181
182
|
}, [
|
|
182
|
-
(
|
|
183
|
+
(l(!0), s(C, null, E(i.options, (u, c) => (l(), s("li", {
|
|
183
184
|
id: `${i.namespace}_element_${i.options[c].label}`,
|
|
184
185
|
key: `${u.label}_${c}`,
|
|
185
186
|
role: "option",
|
|
186
187
|
"aria-selected": p(b) === c,
|
|
187
|
-
class:
|
|
188
|
+
class: a(["uikit-m-1 uikit-cursor-pointer uikit-px-20px uikit-py-10px uikit-text aria-selected:uikit-rounded-xs aria-selected:uikit-bg-w-cultured", i.dropdownItemClasses]),
|
|
188
189
|
onClick: k((y) => h(u), ["stop"]),
|
|
189
190
|
onMouseover: k((y) => b.value = c, ["stop"]),
|
|
190
191
|
onBlur: r[2] || (r[2] = k(() => {
|
|
@@ -206,15 +207,15 @@ const N = (n, { attrs: f }) => {
|
|
|
206
207
|
], 42, Q))), 128))
|
|
207
208
|
], 10, K)
|
|
208
209
|
]),
|
|
209
|
-
i.feedback ? (
|
|
210
|
-
i.feedback.valid ? (
|
|
210
|
+
i.feedback ? (l(), s(C, { key: 0 }, [
|
|
211
|
+
i.feedback.valid ? (l(), s("span", {
|
|
211
212
|
key: 0,
|
|
212
213
|
id: `${i.namespace}_valid_msg`,
|
|
213
214
|
"arial-live": i.$attrs["aria-live"],
|
|
214
215
|
class: "uikit-mt-1 uikit-inline-block uikit-text-12",
|
|
215
216
|
innerHTML: i.isValid ? i.feedback.valid : ""
|
|
216
217
|
}, null, 8, Y)) : d("", !0),
|
|
217
|
-
i.feedback.invalid ? (
|
|
218
|
+
i.feedback.invalid ? (l(), s("span", {
|
|
218
219
|
key: 1,
|
|
219
220
|
id: `${i.namespace}_invalid_msg`,
|
|
220
221
|
"arial-live": i.$attrs["aria-live"],
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { _ } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.Cu67jd8K
|
|
|
9
9
|
import { _ as S } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.DGeL_YSc.js";
|
|
10
10
|
import { _ as g } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.CiJAhkRj.js";
|
|
11
11
|
import { _ as h } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.BalzO73O.js";
|
|
12
|
-
import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.
|
|
12
|
+
import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.YIp2u7gd.js";
|
|
13
13
|
import { _ as w } from "./chunks/BaseAlert.vue_vue_type_style_index_0_lang.BtqP_iYL.js";
|
|
14
14
|
import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.CwGssIPe.js";
|
|
15
15
|
import { _ as v } from "./chunks/BaseBadge.vue_vue_type_style_index_0_lang.BOA1gBKu.js";
|