@wikicasa-dev/components 2.0.8 → 2.0.9
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/BaseAutocomplete.js +1 -1
- package/dist/BaseFloatingLabel.js +21 -19
- package/dist/BaseInput.js +107 -101
- package/dist/BasePagination.js +1 -1
- package/dist/BaseTextarea.js +13 -12
- package/dist/UIKit/AccessibleSelect.vue.d.ts +22 -74
- package/dist/UIKit/BaseAutocomplete.vue.d.ts +29 -39
- package/dist/UIKit/BaseBadge.vue.d.ts +3 -3
- package/dist/UIKit/BaseFloatingLabel.vue.d.ts +6 -5
- package/dist/UIKit/BaseInput.vue.d.ts +11 -14
- package/dist/UIKit/BaseSlider.vue.d.ts +25 -34
- package/dist/UIKit/BaseTextarea.vue.d.ts +3 -6
- package/dist/UIKit/types.d.ts +3 -1
- package/dist/assets/BaseBadge.css +1 -1
- package/dist/assets/BaseFloatingLabel.css +1 -1
- package/dist/assets/BaseInput.css +1 -1
- package/dist/assets/BaseTextarea.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.CfwgKf93.js +233 -0
- package/dist/chunks/{BaseAutocomplete.vue_vue_type_script_setup_true_lang.m5rScY4N.js → BaseAutocomplete.vue_vue_type_script_setup_true_lang.i1drmEOH.js} +83 -82
- package/dist/chunks/{BasePagination.vue_vue_type_script_setup_true_lang.DxPb8OYe.js → BasePagination.vue_vue_type_script_setup_true_lang.C_KW3jtP.js} +2 -2
- package/dist/index.js +3 -3
- package/package.json +3 -2
- package/dist/chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.YIp2u7gd.js +0 -231
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
1
|
+
import { defineComponent as T, mergeModels as $, useModel as L, ref as r, computed as k, onBeforeMount as F, watch as f, openBlock as C, createBlock as S, normalizeClass as H, withCtx as s, createVNode as z, renderSlot as V, createElementBlock as A, Fragment as K, renderList as N, unref as U, createElementVNode as W } from "vue";
|
|
2
|
+
import j from "../BaseInput.js";
|
|
3
|
+
import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.BscSQ5bW.js";
|
|
4
4
|
import "./types-B0dZ7OiV.D29wNgoj.js";
|
|
5
|
-
import { _ as
|
|
6
|
-
import { A as
|
|
7
|
-
function
|
|
8
|
-
return (...
|
|
9
|
-
|
|
5
|
+
import { _ as G } from "./SelectItem.vue_vue_type_script_setup_true_lang.GPFf7fjA.js";
|
|
6
|
+
import { A as J } from "./useKeyboardController.CutKeclN.js";
|
|
7
|
+
function Q(t, p) {
|
|
8
|
+
return (...v) => new Promise((d, u) => {
|
|
9
|
+
t.id && clearTimeout(t.id), t.id = setTimeout(() => {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
} catch (
|
|
14
|
-
|
|
11
|
+
const a = p(...v);
|
|
12
|
+
d(a);
|
|
13
|
+
} catch (a) {
|
|
14
|
+
u(a);
|
|
15
15
|
}
|
|
16
|
-
},
|
|
16
|
+
}, t.delay);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const R = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
20
20
|
__name: "BaseAutocomplete",
|
|
21
|
-
props: /* @__PURE__ */
|
|
22
|
-
border: { type: Boolean, default: !0 },
|
|
21
|
+
props: /* @__PURE__ */ $({
|
|
23
22
|
isValid: { default: null },
|
|
24
23
|
theme: { default: "" },
|
|
25
24
|
label: { default: "" },
|
|
26
25
|
disableCb: { type: Boolean, default: !1 },
|
|
27
|
-
onInputChangeCb: {},
|
|
26
|
+
onInputChangeCb: { type: Function },
|
|
28
27
|
onOptionSelectedCb: { default: null },
|
|
29
28
|
keepState: { default: null },
|
|
30
29
|
cleanupOnClose: { type: Boolean, default: !0 },
|
|
31
30
|
dropdownClasses: { default: "" },
|
|
32
|
-
closeDropdownOnBodyPressed: { type: Boolean, default: !0 }
|
|
31
|
+
closeDropdownOnBodyPressed: { type: Boolean, default: !0 },
|
|
32
|
+
inputClasses: {},
|
|
33
|
+
fieldsetClasses: {}
|
|
33
34
|
}, {
|
|
34
35
|
modelValue: {
|
|
35
36
|
default() {
|
|
@@ -38,18 +39,18 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
38
39
|
},
|
|
39
40
|
modelModifiers: {}
|
|
40
41
|
}),
|
|
41
|
-
emits: /* @__PURE__ */
|
|
42
|
-
setup(
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
emits: /* @__PURE__ */ $(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
|
|
43
|
+
setup(t, { expose: p, emit: v }) {
|
|
44
|
+
const d = L(t, "modelValue"), u = v, a = r(""), n = r([]), m = r(null), c = r(!1), o = r(!1), y = r(null), B = k(() => n.value.length);
|
|
45
|
+
F(() => {
|
|
46
|
+
m.value = Q({ delay: 300 }, t.onInputChangeCb);
|
|
46
47
|
});
|
|
47
|
-
const { activeIdx:
|
|
48
|
-
optionsLength:
|
|
48
|
+
const { activeIdx: h, selectedIdx: w } = J({
|
|
49
|
+
optionsLength: B,
|
|
49
50
|
isDropdownOpen: o,
|
|
50
51
|
disableSpaceHandler: !0
|
|
51
|
-
}),
|
|
52
|
-
switch (
|
|
52
|
+
}), O = k(() => {
|
|
53
|
+
switch (t.theme) {
|
|
53
54
|
case "bordered":
|
|
54
55
|
return "";
|
|
55
56
|
case "all-bordered":
|
|
@@ -60,7 +61,7 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
60
61
|
return "";
|
|
61
62
|
}
|
|
62
63
|
}), I = k(() => {
|
|
63
|
-
switch (
|
|
64
|
+
switch (t.theme) {
|
|
64
65
|
case "bordered":
|
|
65
66
|
return "";
|
|
66
67
|
case "all-bordered":
|
|
@@ -70,9 +71,9 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
70
71
|
default:
|
|
71
72
|
return "";
|
|
72
73
|
}
|
|
73
|
-
}),
|
|
74
|
+
}), M = k(() => {
|
|
74
75
|
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 (
|
|
76
|
+
switch (t.theme) {
|
|
76
77
|
case "bordered":
|
|
77
78
|
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
79
|
case "all-bordered":
|
|
@@ -82,42 +83,42 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
82
83
|
default:
|
|
83
84
|
return "";
|
|
84
85
|
}
|
|
85
|
-
}),
|
|
86
|
-
if (
|
|
87
|
-
if (!e ||
|
|
88
|
-
n.value = [],
|
|
86
|
+
}), P = async (e) => {
|
|
87
|
+
if (a.value !== e && (u("changedValue", e), a.value = e, !!t.onInputChangeCb)) {
|
|
88
|
+
if (!e || c.value) {
|
|
89
|
+
n.value = [], c.value = !1, w.value = -1, h.value = -1, d.value && (d.value.label = ""), o.value = !1, await m.value(null);
|
|
89
90
|
return;
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
+
t.disableCb || (n.value = await m.value(e), o.value = !!n.value.length);
|
|
92
93
|
}
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
n.value.length &&
|
|
94
|
+
}, g = (e, l) => {
|
|
95
|
+
t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (n.value = []), c.value = !0, a.value = e.label, d.value = e, o.value = !1, w.value = l;
|
|
96
|
+
}, D = () => {
|
|
97
|
+
n.value.length && t.keepState !== "closed" && (o.value = !0);
|
|
97
98
|
};
|
|
98
99
|
return f(
|
|
99
100
|
d,
|
|
100
|
-
(e,
|
|
101
|
-
e ===
|
|
101
|
+
(e, l) => {
|
|
102
|
+
e === l || e?.label === a.value || (a.value = e?.label || "");
|
|
102
103
|
},
|
|
103
104
|
{ immediate: !0 }
|
|
104
|
-
), f(
|
|
105
|
+
), f(w, (e) => {
|
|
105
106
|
if (e === -1 || !n.value.length) return;
|
|
106
|
-
const
|
|
107
|
-
|
|
107
|
+
const l = n.value[e];
|
|
108
|
+
c.value && l.label === d.value?.label || g(l, e);
|
|
108
109
|
}), f(
|
|
109
|
-
() =>
|
|
110
|
+
() => t.keepState,
|
|
110
111
|
(e) => {
|
|
111
|
-
e === "closed" ? (o.value = !1,
|
|
112
|
+
e === "closed" ? (o.value = !1, t.cleanupOnClose && (n.value = [])) : e === "open" && n.value.length && (o.value = !0);
|
|
112
113
|
}
|
|
113
114
|
), f(o, (e) => {
|
|
114
|
-
|
|
115
|
-
}),
|
|
115
|
+
u("update:dropdownState", e);
|
|
116
|
+
}), p({
|
|
116
117
|
select: () => {
|
|
117
|
-
|
|
118
|
+
y.value?.select();
|
|
118
119
|
}
|
|
119
|
-
}), (e,
|
|
120
|
-
class:
|
|
120
|
+
}), (e, l) => (C(), S(q, {
|
|
121
|
+
class: H(e.$attrs["root-classes"]),
|
|
121
122
|
"data-cy": `ac_${e.$attrs.id}`,
|
|
122
123
|
"dropdown-element": "ul",
|
|
123
124
|
"dropdown-classes": [
|
|
@@ -127,63 +128,63 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
127
128
|
{
|
|
128
129
|
"uikit-mt-10px !uikit-border !uikit-border-w-secondary !uikit-rounded-xs": !e.theme
|
|
129
130
|
},
|
|
130
|
-
|
|
131
|
+
M.value,
|
|
131
132
|
"!uikit-max-h-[210px] uikit-z-30",
|
|
132
133
|
e.dropdownClasses
|
|
133
134
|
],
|
|
134
135
|
"open-dropdown": o.value,
|
|
135
|
-
"keep-state": !n.value.length ||
|
|
136
|
-
"onUpdate:dropdownState": t[3] || (t[3] = (a) => o.value = a),
|
|
137
|
-
onClick: t[4] || (t[4] = (a) => {
|
|
138
|
-
i("click"), E();
|
|
139
|
-
}),
|
|
136
|
+
"keep-state": !n.value.length || e.keepState === "closed" ? "closed" : "opened",
|
|
140
137
|
"close-when-clicked-outside": e.closeDropdownOnBodyPressed,
|
|
141
|
-
"activate-keyboard-controller": !1
|
|
138
|
+
"activate-keyboard-controller": !1,
|
|
139
|
+
"onUpdate:dropdownState": l[3] || (l[3] = (i) => o.value = i),
|
|
140
|
+
onClick: l[4] || (l[4] = (i) => {
|
|
141
|
+
u("click"), D();
|
|
142
|
+
})
|
|
142
143
|
}, {
|
|
143
|
-
btn_slot:
|
|
144
|
-
|
|
144
|
+
btn_slot: s(() => [
|
|
145
|
+
z(j, {
|
|
145
146
|
id: `ac_input_${e.$attrs.id}`,
|
|
146
147
|
ref_key: "baseInput",
|
|
147
|
-
ref:
|
|
148
|
+
ref: y,
|
|
148
149
|
"data-cy": `ac_input_${e.$attrs.id}`,
|
|
149
150
|
"label-text": e.label,
|
|
150
|
-
"model-value":
|
|
151
|
+
"model-value": a.value,
|
|
151
152
|
"is-valid": e.isValid,
|
|
152
153
|
disabled: e.$attrs.disabled,
|
|
153
154
|
placeholder: e.$attrs.placeholder,
|
|
154
155
|
"with-left-icon": !!e.$slots.lefticon,
|
|
155
156
|
"with-right-icon": !!e.$slots.righticon,
|
|
156
157
|
"input-class": [
|
|
157
|
-
|
|
158
|
-
e
|
|
158
|
+
O.value,
|
|
159
|
+
e.inputClasses,
|
|
159
160
|
"!uikit-ml-0 !uikit-w-full"
|
|
160
161
|
],
|
|
161
|
-
"fieldset-classes": [I.value, e
|
|
162
|
-
"onUpdate:modelValue":
|
|
163
|
-
onKeydown:
|
|
164
|
-
onKeydownEnterPressed:
|
|
162
|
+
"fieldset-classes": [I.value, e.fieldsetClasses],
|
|
163
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => P(i === void 0 ? "" : `${i}`)),
|
|
164
|
+
onKeydown: l[1] || (l[1] = (i) => u("keydown", i)),
|
|
165
|
+
onKeydownEnterPressed: l[2] || (l[2] = () => u("keydownEnterPressed"))
|
|
165
166
|
}, {
|
|
166
|
-
leftIcon:
|
|
167
|
-
|
|
167
|
+
leftIcon: s(() => [
|
|
168
|
+
V(e.$slots, "lefticon")
|
|
168
169
|
]),
|
|
169
|
-
righticon:
|
|
170
|
-
|
|
170
|
+
righticon: s(({ handleClean: i }) => [
|
|
171
|
+
V(e.$slots, "righticon", { handleClean: i })
|
|
171
172
|
]),
|
|
172
173
|
_: 3
|
|
173
174
|
}, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "input-class", "fieldset-classes"])
|
|
174
175
|
]),
|
|
175
|
-
default:
|
|
176
|
-
(
|
|
176
|
+
default: s(() => [
|
|
177
|
+
(C(!0), A(K, null, N(n.value, (i, b) => (C(), S(G, {
|
|
177
178
|
key: b,
|
|
178
|
-
active:
|
|
179
|
+
active: U(h) === b,
|
|
179
180
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
180
|
-
onClick: (
|
|
181
|
-
onMouseover: (
|
|
181
|
+
onClick: (E) => g(i, b),
|
|
182
|
+
onMouseover: (E) => h.value = b
|
|
182
183
|
}, {
|
|
183
|
-
default:
|
|
184
|
-
|
|
185
|
-
innerHTML:
|
|
186
|
-
}, null, 8,
|
|
184
|
+
default: s(() => [
|
|
185
|
+
W("span", {
|
|
186
|
+
innerHTML: i.label
|
|
187
|
+
}, null, 8, R)
|
|
187
188
|
]),
|
|
188
189
|
_: 2
|
|
189
190
|
}, 1032, ["active", "onClick", "onMouseover"]))), 128))
|
|
@@ -193,5 +194,5 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
193
194
|
}
|
|
194
195
|
});
|
|
195
196
|
export {
|
|
196
|
-
|
|
197
|
+
le as _
|
|
197
198
|
};
|
|
@@ -94,7 +94,7 @@ const F = {
|
|
|
94
94
|
h("li", {
|
|
95
95
|
class: g(["arrow-button prev-page uikit-h-30x uikit-flex uikit-min-w-[30px] uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px", {
|
|
96
96
|
"uikit-cursor-pointer hover:uikit-bg-w-primary [&_>_svg]:hover:uikit-brightness-0 [&_>_svg]:hover:uikit-invert": u.value !== 1,
|
|
97
|
-
"
|
|
97
|
+
"hover:uikit-text-white": e.small && u.value !== 1,
|
|
98
98
|
"uikit-rounded-xs": e.small && e.prevLabel
|
|
99
99
|
}]),
|
|
100
100
|
onClick: i[0] || (i[0] = (t) => c((u.value || 0) - 1))
|
|
@@ -141,7 +141,7 @@ const F = {
|
|
|
141
141
|
h("li", {
|
|
142
142
|
class: g(["arrow-button next-page uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px", {
|
|
143
143
|
"uikit-cursor-pointer hover:uikit-bg-w-primary [&_>_svg]:hover:uikit-brightness-0 [&_>_svg]:hover:uikit-invert": (u.value || 0) < o.value,
|
|
144
|
-
"
|
|
144
|
+
"hover:uikit-text-white": e.small && (u.value || 0) < o.value,
|
|
145
145
|
"uikit-rounded-xs": e.small && e.nextLabel
|
|
146
146
|
}]),
|
|
147
147
|
onClick: i[3] || (i[3] = (t) => c((u.value || 0) + 1))
|
package/dist/index.js
CHANGED
|
@@ -9,9 +9,9 @@ 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.Ar2KNVYH.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.CfwgKf93.js";
|
|
13
13
|
import { _ as w } from "./chunks/BaseAlert.vue_vue_type_style_index_0_lang.BtqP_iYL.js";
|
|
14
|
-
import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.
|
|
14
|
+
import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.i1drmEOH.js";
|
|
15
15
|
import { _ as v } from "./chunks/BaseBadge.vue_vue_type_style_index_0_lang.BOA1gBKu.js";
|
|
16
16
|
import { _ as G } from "./chunks/BaseButton.vue_vue_type_script_setup_true_lang.BWZPE2Gf.js";
|
|
17
17
|
import { default as O } from "./BaseCard.js";
|
|
@@ -20,7 +20,7 @@ import { _ as V } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lan
|
|
|
20
20
|
import { default as q } from "./BaseFloatingLabel.js";
|
|
21
21
|
import { default as z } from "./BaseIcon.js";
|
|
22
22
|
import { default as H } from "./BaseInput.js";
|
|
23
|
-
import { _ as K } from "./chunks/BasePagination.vue_vue_type_script_setup_true_lang.
|
|
23
|
+
import { _ as K } from "./chunks/BasePagination.vue_vue_type_script_setup_true_lang.C_KW3jtP.js";
|
|
24
24
|
import { default as Q } from "./BasePaper.js";
|
|
25
25
|
import { default as X } from "./BaseSlider.js";
|
|
26
26
|
import { default as Z } from "./BaseTextarea.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wikicasa-dev/components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "Wikicasa frontend components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,10 +45,11 @@
|
|
|
45
45
|
"@vue/eslint-config-prettier": "^10.1.0",
|
|
46
46
|
"@vue/eslint-config-typescript": "^14.1.3",
|
|
47
47
|
"@wikicasa-dev/svg-icons": "^1.0.2",
|
|
48
|
-
"@wikicasa-dev/tailwind-plugins": "^0.0.
|
|
48
|
+
"@wikicasa-dev/tailwind-plugins": "^0.0.3",
|
|
49
49
|
"@wikicasa-dev/types": "^1.8.0",
|
|
50
50
|
"@wikicasa-dev/utilities": "^1.0.22",
|
|
51
51
|
"@wikicasa-dev/vue-composables": "0.0.13",
|
|
52
|
+
"ajv": "^8.17.1",
|
|
52
53
|
"autoprefixer": "^10.4.20",
|
|
53
54
|
"eslint": "^9.15",
|
|
54
55
|
"eslint-plugin-vue": "^9.31.0",
|
|
@@ -1,231 +0,0 @@
|
|
|
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
|
-
import { a as O } from "./ArrowIcon.CCFMdsq6.js";
|
|
4
|
-
import { e as q } from "./PharmacyIcon.56ql_DYl.js";
|
|
5
|
-
const N = (n, { attrs: f }) => {
|
|
6
|
-
n = { ...q(), ...n };
|
|
7
|
-
const { width: t, height: e } = n;
|
|
8
|
-
return m(
|
|
9
|
-
"svg",
|
|
10
|
-
{
|
|
11
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
-
viewBox: "0 0 11.175 13.409",
|
|
13
|
-
width: `${t}`,
|
|
14
|
-
height: `${e}`,
|
|
15
|
-
class: n.class ?? "",
|
|
16
|
-
"aria-hidden": f["aria-hidden"] ?? "true",
|
|
17
|
-
fill: "none",
|
|
18
|
-
stroke: n["stroke-color"] ?? "#FA4F64"
|
|
19
|
-
},
|
|
20
|
-
[
|
|
21
|
-
m("circle", {
|
|
22
|
-
cx: 6,
|
|
23
|
-
cy: 6,
|
|
24
|
-
r: 4.5
|
|
25
|
-
}),
|
|
26
|
-
m("path", {
|
|
27
|
-
"stroke-linejoin": "round",
|
|
28
|
-
d: "M5.8 3.6h.4L6 6.5z"
|
|
29
|
-
}),
|
|
30
|
-
m("circle", {
|
|
31
|
-
cx: 6,
|
|
32
|
-
cy: 8.2,
|
|
33
|
-
r: 0.6,
|
|
34
|
-
fill: n["stroke-color"] ?? "#FA4F64",
|
|
35
|
-
stroke: "none"
|
|
36
|
-
})
|
|
37
|
-
]
|
|
38
|
-
);
|
|
39
|
-
}, j = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" }, D = ["id", "innerHTML"], S = ["id", "data-cy", "aria-required", "aria-controls", "aria-labelledby", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby"], U = ["innerHTML"], G = { class: "uikit-pointer-events-none uikit-mt-1 uikit-inline-flex" }, J = ["innerHTML"], K = ["data-cy"], Q = ["id", "aria-selected", "onClick", "onMouseover"], R = { class: "uikit-inline-block uikit-cursor-pointer uikit-text-sm" }, W = ["name", "checked", "onInput"], X = ["innerHTML"], Y = ["id", "arial-live", "innerHTML"], Z = ["id", "arial-live", "innerHTML"], ti = /* @__PURE__ */ M({
|
|
40
|
-
inheritAttrs: !1,
|
|
41
|
-
__name: "AccessibleSelect",
|
|
42
|
-
props: {
|
|
43
|
-
label: { default: "" },
|
|
44
|
-
dropdownPosition: { default: "bottom" },
|
|
45
|
-
namespace: {},
|
|
46
|
-
options: {},
|
|
47
|
-
modelValue: { default: () => ({
|
|
48
|
-
id: "",
|
|
49
|
-
label: ""
|
|
50
|
-
}) },
|
|
51
|
-
isValid: { type: [Boolean, null], default: null },
|
|
52
|
-
feedback: { default: void 0 },
|
|
53
|
-
closeOnBodyPressed: { type: Boolean, default: !0 },
|
|
54
|
-
border: { type: Boolean, default: !0 },
|
|
55
|
-
fieldsetClasses: { default: "" },
|
|
56
|
-
legendClasses: { default: "" },
|
|
57
|
-
dropdownClasses: { default: "" },
|
|
58
|
-
labelClasses: { default: "" },
|
|
59
|
-
btnClasses: { default: "" },
|
|
60
|
-
dropdownItemClasses: { default: "" },
|
|
61
|
-
btnTextClasses: { default: "" },
|
|
62
|
-
arrowIcon: { default: void 0 },
|
|
63
|
-
dataCy: { default: "" }
|
|
64
|
-
},
|
|
65
|
-
emits: ["update:modelValue"],
|
|
66
|
-
setup(n, { emit: f }) {
|
|
67
|
-
const t = n, e = g(!1), $ = g(null), v = T(() => !!t.modelValue.label), V = f, { activeIdx: b, selectedIdx: L } = P({
|
|
68
|
-
optionsLength: t.options.length,
|
|
69
|
-
isDropdownOpen: e
|
|
70
|
-
}), h = (i) => {
|
|
71
|
-
e.value = !1, V("update:modelValue", i);
|
|
72
|
-
};
|
|
73
|
-
B(L, (i) => {
|
|
74
|
-
h(t.options[i]), e.value = !1;
|
|
75
|
-
});
|
|
76
|
-
const w = ({ target: i }) => {
|
|
77
|
-
`${t.namespace}_btn` !== i.id && (e.value = !1);
|
|
78
|
-
};
|
|
79
|
-
return H(() => {
|
|
80
|
-
t.closeOnBodyPressed && document.addEventListener("click", w);
|
|
81
|
-
}), F(() => {
|
|
82
|
-
t.closeOnBodyPressed && document.removeEventListener("click", w);
|
|
83
|
-
}), (i, r) => (l(), s("div", {
|
|
84
|
-
class: a([i.$attrs.class])
|
|
85
|
-
}, [
|
|
86
|
-
o("div", j, [
|
|
87
|
-
i.label ? (l(), s("label", {
|
|
88
|
-
key: 0,
|
|
89
|
-
id: `${i.namespace}_label`,
|
|
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", [
|
|
91
|
-
v.value ? "as-floating -uikit-top-1 uikit-left-[22px] uikit-text-w-black" : "as-inline uikit-top-4 uikit-text-w-gray",
|
|
92
|
-
i.labelClasses,
|
|
93
|
-
{ "uikit-left-9": i.$slots.lefticon && !v.value },
|
|
94
|
-
{ "uikit-left-4": !i.$slots.lefticon && !v.value }
|
|
95
|
-
]]),
|
|
96
|
-
innerHTML: i.label
|
|
97
|
-
}, null, 10, D)) : d("", !0),
|
|
98
|
-
i.$slots.lefticon ? (l(), s("span", {
|
|
99
|
-
key: 1,
|
|
100
|
-
class: "uikit-z-20 uikit-mt-2 uikit-pl-2",
|
|
101
|
-
onClick: r[0] || (r[0] = k((u) => e.value = !e.value, ["stop"]))
|
|
102
|
-
}, [
|
|
103
|
-
I(i.$slots, "lefticon")
|
|
104
|
-
])) : d("", !0),
|
|
105
|
-
o("button", {
|
|
106
|
-
id: `${i.namespace}_btn`,
|
|
107
|
-
ref_key: "btnEl",
|
|
108
|
-
ref: $,
|
|
109
|
-
type: "button",
|
|
110
|
-
"data-cy": i.dataCy,
|
|
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]]),
|
|
112
|
-
"aria-required": !!i.$attrs.required,
|
|
113
|
-
role: "combobox",
|
|
114
|
-
"aria-haspopup": "listbox",
|
|
115
|
-
"aria-controls": `${i.namespace}_dropdown`,
|
|
116
|
-
"aria-labelledby": `${i.namespace}_label ${i.namespace}_btn`,
|
|
117
|
-
"aria-expanded": e.value,
|
|
118
|
-
"aria-activedescendant": p(b) >= 0 && e.value ? `${i.namespace}_element_${i.options[p(b)].label}` : "",
|
|
119
|
-
"aria-invalid": t.isValid === !1,
|
|
120
|
-
"aria-describedby": t.isValid === !1 ? `${i.namespace}_invalid_msg` : void 0,
|
|
121
|
-
onClick: r[1] || (r[1] = (u) => e.value = !e.value)
|
|
122
|
-
}, [
|
|
123
|
-
o("span", {
|
|
124
|
-
class: a(["uikit-pointer-events-none uikit-mt-1", i.btnTextClasses]),
|
|
125
|
-
innerHTML: i.modelValue.visibleLabel || i.modelValue.label
|
|
126
|
-
}, null, 10, U),
|
|
127
|
-
o("span", G, [
|
|
128
|
-
t.isValid == !1 ? (l(), z(p(N), {
|
|
129
|
-
key: 0,
|
|
130
|
-
class: "uikit-mr-1",
|
|
131
|
-
width: 20,
|
|
132
|
-
height: 20
|
|
133
|
-
})) : d("", !0),
|
|
134
|
-
A(p(O), {
|
|
135
|
-
class: a(["uikit-transition-transform motion-reduce:uikit-transition-none", [
|
|
136
|
-
e.value ? "uikit-rotate-180" : "",
|
|
137
|
-
i.arrowIcon?.classes
|
|
138
|
-
]]),
|
|
139
|
-
width: i.arrowIcon?.width ?? 18,
|
|
140
|
-
height: i.arrowIcon?.height ?? 18,
|
|
141
|
-
"stroke-color": i.isValid ? "#2B5DFF" : i.isValid === !1 ? "#FA4F64" : i.arrowIcon?.strokeColor ?? "#222"
|
|
142
|
-
}, null, 8, ["class", "width", "height", "stroke-color"])
|
|
143
|
-
])
|
|
144
|
-
], 10, S),
|
|
145
|
-
o("fieldset", {
|
|
146
|
-
"aria-hidden": "true",
|
|
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", [
|
|
148
|
-
i.fieldsetClasses,
|
|
149
|
-
i.isValid ? "uikit-border-w-primary" : i.isValid === !1 ? "uikit-border-w-danger" : "uikit-border-w-secondary",
|
|
150
|
-
{
|
|
151
|
-
"uikit-border uikit-border-solid peer-focus:uikit-border-w-primary peer-focus-visible:uikit-border-2 peer-focus-visible:uikit-border-w-primary peer-aria-invalid:uikit-border-w-danger": i.border
|
|
152
|
-
},
|
|
153
|
-
{ "uikit-border-0 peer-focus:uikit-border-0": !i.border }
|
|
154
|
-
]])
|
|
155
|
-
}, [
|
|
156
|
-
o("legend", {
|
|
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"])
|
|
158
|
-
}, [
|
|
159
|
-
i.label ? (l(), s("span", {
|
|
160
|
-
key: 0,
|
|
161
|
-
class: a(["uikit-mx-5px", [i.modelValue.label ? "uikit-invisible" : "uikit-hidden"]]),
|
|
162
|
-
innerHTML: i.label
|
|
163
|
-
}, null, 10, J)) : d("", !0)
|
|
164
|
-
], 2)
|
|
165
|
-
], 2),
|
|
166
|
-
o("ul", {
|
|
167
|
-
"data-cy": i.dataCy && `${i.dataCy}_dropdown`,
|
|
168
|
-
role: "listbox",
|
|
169
|
-
tabindex: -1,
|
|
170
|
-
"aria-multiselectable": !1,
|
|
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", [
|
|
172
|
-
{ "uikit-h-0 uikit-w-0 uikit-overflow-hidden": !e.value },
|
|
173
|
-
{
|
|
174
|
-
"uikit-rounded-xs uikit-border uikit-border-solid uikit-border-w-secondary uikit-bg-white": e.value
|
|
175
|
-
},
|
|
176
|
-
{ "uikit-bottom-[55px]": i.dropdownPosition === "top" },
|
|
177
|
-
{ "uikit-top-[55px]": i.dropdownPosition === "bottom" },
|
|
178
|
-
i.dropdownClasses
|
|
179
|
-
]]),
|
|
180
|
-
onClick: r[3] || (r[3] = k(() => {
|
|
181
|
-
}, ["stop"]))
|
|
182
|
-
}, [
|
|
183
|
-
(l(!0), s(C, null, E(i.options, (u, c) => (l(), s("li", {
|
|
184
|
-
id: `${i.namespace}_element_${i.options[c].label}`,
|
|
185
|
-
key: `${u.label}_${c}`,
|
|
186
|
-
role: "option",
|
|
187
|
-
"aria-selected": p(b) === c,
|
|
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]),
|
|
189
|
-
onClick: k((y) => h(u), ["stop"]),
|
|
190
|
-
onMouseover: k((y) => b.value = c, ["stop"]),
|
|
191
|
-
onBlur: r[2] || (r[2] = k(() => {
|
|
192
|
-
}, ["stop"]))
|
|
193
|
-
}, [
|
|
194
|
-
o("label", R, [
|
|
195
|
-
o("input", {
|
|
196
|
-
tabindex: "-1",
|
|
197
|
-
class: "uikit-m-0 uikit-appearance-none",
|
|
198
|
-
name: `${i.namespace}_radio`,
|
|
199
|
-
type: "radio",
|
|
200
|
-
checked: u.label === i.modelValue.label,
|
|
201
|
-
onInput: k((y) => h(u), ["stop"])
|
|
202
|
-
}, null, 40, W),
|
|
203
|
-
o("span", {
|
|
204
|
-
innerHTML: u.label
|
|
205
|
-
}, null, 8, X)
|
|
206
|
-
])
|
|
207
|
-
], 42, Q))), 128))
|
|
208
|
-
], 10, K)
|
|
209
|
-
]),
|
|
210
|
-
i.feedback ? (l(), s(C, { key: 0 }, [
|
|
211
|
-
i.feedback.valid ? (l(), s("span", {
|
|
212
|
-
key: 0,
|
|
213
|
-
id: `${i.namespace}_valid_msg`,
|
|
214
|
-
"arial-live": i.$attrs["aria-live"],
|
|
215
|
-
class: "uikit-mt-1 uikit-inline-block uikit-text-12",
|
|
216
|
-
innerHTML: i.isValid ? i.feedback.valid : ""
|
|
217
|
-
}, null, 8, Y)) : d("", !0),
|
|
218
|
-
i.feedback.invalid ? (l(), s("span", {
|
|
219
|
-
key: 1,
|
|
220
|
-
id: `${i.namespace}_invalid_msg`,
|
|
221
|
-
"arial-live": i.$attrs["aria-live"],
|
|
222
|
-
class: "uikit-mt-1 uikit-inline-block uikit-text-12 uikit-text-w-danger",
|
|
223
|
-
innerHTML: i.isValid === !1 ? i.feedback.invalid : ""
|
|
224
|
-
}, null, 8, Z)) : d("", !0)
|
|
225
|
-
], 64)) : d("", !0)
|
|
226
|
-
], 2));
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
export {
|
|
230
|
-
ti as _
|
|
231
|
-
};
|