@quidgest/ui 0.31.0 → 0.31.2
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/CHANGELOG.md +18 -0
- package/dist/json/api.json +18 -9
- package/dist/ui.css +88 -12
- package/dist/ui.esm.js +547 -539
- package/dist/ui.min.css +1 -1
- package/dist/ui.scss +91 -10
- package/lib/components/QCombobox/QCombobox.d.ts.map +1 -1
- package/lib/components/QCombobox/QCombobox.vue.js +165 -165
- package/lib/components/QList/QListItem.d.ts.map +1 -1
- package/lib/components/QList/QListItem.vue.js +52 -33
- package/lib/components/QSelect/QSelect.d.ts.map +1 -1
- package/lib/components/QSelect/QSelect.vue.js +55 -55
- package/lib/templates/theme.d.ts.map +1 -1
- package/lib/templates/theme.js +23 -11
- package/lib/types/component.d.ts +3 -1
- package/lib/types/component.d.ts.map +1 -1
- package/lib/utils/color/merge.d.ts.map +1 -1
- package/lib/utils/color/merge.js +1 -0
- package/lib/utils/color/theme-colors.d.ts +1 -1
- package/lib/utils/color/theme-colors.d.ts.map +1 -1
- package/lib/utils/color/theme-colors.js +1 -0
- package/lib/utils/color/types.d.ts +3 -0
- package/lib/utils/color/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4,25 +4,25 @@ import { QSpinnerLoader as n } from "../QSpinnerLoader/index.js";
|
|
|
4
4
|
import { QButton as r } from "../QButton/index.js";
|
|
5
5
|
import { QChevron as i } from "../__internal__/QChevron/index.js";
|
|
6
6
|
import { getRenderedListItems as a } from "../QList/groupListItems.js";
|
|
7
|
-
import { QList as
|
|
8
|
-
import { QClearButton as
|
|
9
|
-
import { QTextField as
|
|
10
|
-
import { DEFAULT_ICONS as
|
|
11
|
-
import { Fragment as
|
|
7
|
+
import { QList as ee } from "../QList/index.js";
|
|
8
|
+
import { QClearButton as te } from "../__internal__/QClearButton/index.js";
|
|
9
|
+
import { QTextField as ne } from "../QTextField/index.js";
|
|
10
|
+
import { DEFAULT_ICONS as o, DEFAULT_TEXTS as s } from "./constants.js";
|
|
11
|
+
import { Fragment as re, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as ie, createVNode as p, defineComponent as m, mergeModels as h, mergeProps as ae, nextTick as g, normalizeClass as oe, onMounted as se, openBlock as _, ref as v, renderSlot as y, toDisplayString as b, toRef as ce, unref as x, useModel as S, useTemplateRef as C, watch as w, withCtx as T, withModifiers as le } from "vue";
|
|
12
12
|
//#region src/components/QCombobox/QCombobox.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var
|
|
13
|
+
var ue = {
|
|
14
14
|
class: "q-sr-only",
|
|
15
15
|
role: "status"
|
|
16
|
-
},
|
|
16
|
+
}, de = ["data-key"], fe = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "q-select__loader"
|
|
19
|
-
},
|
|
19
|
+
}, E = {
|
|
20
20
|
key: 2,
|
|
21
21
|
class: "q-select__loader"
|
|
22
|
-
},
|
|
22
|
+
}, D = /*@__PURE__*/ m({
|
|
23
23
|
inheritAttrs: !1,
|
|
24
24
|
__name: "QCombobox",
|
|
25
|
-
props: /*@__PURE__*/
|
|
25
|
+
props: /*@__PURE__*/ h({
|
|
26
26
|
id: {},
|
|
27
27
|
class: {},
|
|
28
28
|
label: {},
|
|
@@ -31,8 +31,8 @@ var le = {
|
|
|
31
31
|
labelPosition: {},
|
|
32
32
|
help: {},
|
|
33
33
|
helpDisplay: {},
|
|
34
|
-
icons: { default: () =>
|
|
35
|
-
texts: { default: () =>
|
|
34
|
+
icons: { default: () => o },
|
|
35
|
+
texts: { default: () => s },
|
|
36
36
|
size: {},
|
|
37
37
|
readonly: { type: Boolean },
|
|
38
38
|
disabled: { type: Boolean },
|
|
@@ -58,7 +58,7 @@ var le = {
|
|
|
58
58
|
search: { default: "" },
|
|
59
59
|
searchModifiers: {}
|
|
60
60
|
}),
|
|
61
|
-
emits: /*@__PURE__*/
|
|
61
|
+
emits: /*@__PURE__*/ h([
|
|
62
62
|
"before-show",
|
|
63
63
|
"before-hide",
|
|
64
64
|
"show",
|
|
@@ -68,194 +68,194 @@ var le = {
|
|
|
68
68
|
"update:open",
|
|
69
69
|
"update:search"
|
|
70
70
|
]),
|
|
71
|
-
setup(
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
let
|
|
75
|
-
let e =
|
|
76
|
-
if (e !== void 0 &&
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
setup(o, { expose: s, emit: m }) {
|
|
72
|
+
let h = o, D = m, O = S(o, "modelValue"), k = S(o, "open"), A = S(o, "search"), j = e(ce(h, "id")), M = c(() => `${j.value}_listbox`), pe = c(() => h.overflow === "fit-content" ? "auto" : "anchor"), me = c(() => h.overflow === "truncate" || h.overflow === "wrap-on-focus" || h.overflow === "scroll-on-focus"), N = v(void 0), P = C("trigger"), F = C("list"), he = C("toggleButton"), ge = C("clearButton"), _e = C("content");
|
|
73
|
+
se(G);
|
|
74
|
+
let I = c(() => h.clearable && !h.readonly && !h.disabled), L = c(() => h.filterMode === "manual" || !ve.value ? h.items ?? [] : h.items?.filter((e) => e[h.itemLabel].toLowerCase().startsWith(A.value.toLowerCase())) ?? []), R = c(() => a(L.value, h.groups)), z = c(() => h.items?.find((e) => e[h.itemValue] === O.value)), B = c(() => z.value === void 0), V = c(() => {
|
|
75
|
+
let e = N.value;
|
|
76
|
+
if (e !== void 0 && R.value[e]) return R.value[e];
|
|
77
|
+
}), ve = c(() => A.value.length > 0 && A.value !== z.value?.[h.itemLabel]), H = c(() => !!(k.value && !h.loading && L.value.length)), ye = c(() => !k.value || H.value ? "" : h.loading ? h.texts.loading : h.texts.noData), U = v();
|
|
78
|
+
w([
|
|
79
|
+
N,
|
|
80
|
+
R,
|
|
81
|
+
H
|
|
82
82
|
], ([e]) => {
|
|
83
|
-
|
|
83
|
+
U.value = e === void 0 ? void 0 : F.value?.getItem(e)?.id;
|
|
84
84
|
}, { flush: "post" });
|
|
85
|
-
function
|
|
86
|
-
|
|
85
|
+
function W(e) {
|
|
86
|
+
O.value = e, q();
|
|
87
|
+
}
|
|
88
|
+
function G() {
|
|
89
|
+
let e = z.value?.[h.itemLabel] || "";
|
|
90
|
+
A.value !== e && (A.value = e);
|
|
87
91
|
}
|
|
88
92
|
function K() {
|
|
89
|
-
|
|
90
|
-
j.value !== e && (j.value = e);
|
|
93
|
+
k.value || h.readonly || h.disabled || (D("before-show"), k.value = !0, Q());
|
|
91
94
|
}
|
|
92
95
|
function q() {
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
function J() {
|
|
96
|
-
A.value &&= (O("before-hide"), !1);
|
|
96
|
+
k.value &&= (D("before-hide"), !1);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
|
|
98
|
+
function be() {
|
|
99
|
+
k.value ? q() : J();
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
101
|
+
function xe() {
|
|
102
|
+
I.value && (O.value = h.emptyValue, N.value = void 0, Q());
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
if (
|
|
106
|
-
let e =
|
|
107
|
-
e !== -1 &&
|
|
104
|
+
function J() {
|
|
105
|
+
if (K(), z.value !== void 0) {
|
|
106
|
+
let e = R.value.indexOf(z.value);
|
|
107
|
+
e !== -1 && g(() => $(e));
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (!e.key ||
|
|
112
|
-
let t = e.altKey && e.key === "ArrowDown" && !
|
|
110
|
+
function Se(e) {
|
|
111
|
+
if (!e.key || h.readonly || h.disabled) return;
|
|
112
|
+
let t = e.altKey && e.key === "ArrowDown" && !k.value;
|
|
113
113
|
if (!((e.altKey || e.ctrlKey || e.metaKey) && !t)) {
|
|
114
|
-
if ((
|
|
114
|
+
if ((H.value ? [
|
|
115
115
|
"ArrowDown",
|
|
116
116
|
"ArrowUp",
|
|
117
117
|
"Home",
|
|
118
118
|
"End"
|
|
119
|
-
] : ["ArrowDown", "ArrowUp"]).includes(e.key) && (e.preventDefault(), e.stopPropagation()), e.key === "Escape")
|
|
120
|
-
else if (["ArrowDown", "ArrowUp"].includes(e.key))
|
|
121
|
-
if (
|
|
119
|
+
] : ["ArrowDown", "ArrowUp"]).includes(e.key) && (e.preventDefault(), e.stopPropagation()), e.key === "Escape") G(), k.value && (e.preventDefault(), e.stopPropagation(), q());
|
|
120
|
+
else if (["ArrowDown", "ArrowUp"].includes(e.key)) k.value ? g(() => {
|
|
121
|
+
if (N.value === void 0) Y();
|
|
122
122
|
else {
|
|
123
123
|
let t = e.key === "ArrowDown" ? "next" : "prev";
|
|
124
|
-
|
|
124
|
+
Ce(N.value, t);
|
|
125
125
|
}
|
|
126
|
-
}) : (
|
|
127
|
-
e.key === "ArrowDown" ?
|
|
126
|
+
}) : (K(), g(() => {
|
|
127
|
+
e.key === "ArrowDown" ? Y() : X();
|
|
128
128
|
}));
|
|
129
129
|
else if (e.key === "Enter") {
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
} else if (e.key === "Home")
|
|
133
|
-
else if (e.key === "End")
|
|
130
|
+
if (V.value === void 0) return;
|
|
131
|
+
W(V.value[h.itemValue]);
|
|
132
|
+
} else if (e.key === "Home") N.value = F.value?.getFirstFocusableItemIndex();
|
|
133
|
+
else if (e.key === "End") N.value = F.value?.getLastFocusableItemIndex();
|
|
134
134
|
else if (e.key === "Tab") {
|
|
135
|
-
if (
|
|
136
|
-
|
|
135
|
+
if (V.value === void 0) return;
|
|
136
|
+
W(V.value[h.itemValue]);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
if (
|
|
140
|
+
function Y() {
|
|
141
|
+
if (B.value) N.value = F.value?.getFirstFocusableItemIndex();
|
|
142
142
|
else {
|
|
143
|
-
let e =
|
|
144
|
-
e === -1 ?
|
|
143
|
+
let e = R.value.findIndex((e) => e[h.itemValue] === O.value);
|
|
144
|
+
e === -1 ? N.value = F.value?.getFirstFocusableItemIndex() : N.value = e;
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
147
|
+
function X() {
|
|
148
|
+
N.value = F.value?.getLastFocusableItemIndex();
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
150
|
+
function Ce(e, t) {
|
|
151
|
+
N.value = F.value?.getAdjacentItemIndex(e, t);
|
|
152
152
|
}
|
|
153
153
|
function Z(e) {
|
|
154
|
-
let t =
|
|
154
|
+
let t = he?.value?.$el === e.relatedTarget, n = ge?.value?.$el === e.relatedTarget, r = P?.value?.$el?.contains(e.relatedTarget), i = _e?.value?.contains(e.relatedTarget);
|
|
155
155
|
if (t || n || i || r) {
|
|
156
156
|
e.preventDefault(), e.stopPropagation();
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
q(), I.value && !A.value && (O.value = h.emptyValue), G();
|
|
160
160
|
}
|
|
161
161
|
function Q() {
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
function Ce() {
|
|
165
|
-
Q();
|
|
162
|
+
P.value?.inputRef?.focus();
|
|
166
163
|
}
|
|
167
164
|
function we() {
|
|
168
|
-
|
|
165
|
+
Q();
|
|
169
166
|
}
|
|
170
167
|
function Te() {
|
|
171
|
-
|
|
168
|
+
D("show");
|
|
169
|
+
}
|
|
170
|
+
function Ee() {
|
|
171
|
+
D("hide");
|
|
172
172
|
}
|
|
173
173
|
function $(e) {
|
|
174
|
-
let t =
|
|
175
|
-
if (
|
|
176
|
-
let e =
|
|
174
|
+
let t = F.value?.getItem(e);
|
|
175
|
+
if (F.value && t) {
|
|
176
|
+
let e = F.value.$el, n = t.offsetTop + t.offsetHeight;
|
|
177
177
|
t.offsetTop < e.scrollTop ? e.scrollTop = t.offsetTop : n > e.scrollTop + e.clientHeight && (e.scrollTop = n - e.clientHeight);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
return
|
|
181
|
-
e || (
|
|
182
|
-
}),
|
|
183
|
-
if (!
|
|
184
|
-
let e = t?.find((e) => e[
|
|
185
|
-
|
|
180
|
+
return w(k, (e) => {
|
|
181
|
+
e || (N.value = void 0);
|
|
182
|
+
}), w(O, G), w(() => h.items, (e, t) => {
|
|
183
|
+
if (!B.value) {
|
|
184
|
+
let e = t?.find((e) => e[h.itemValue] === O.value);
|
|
185
|
+
A.value === e?.[h.itemLabel] && G();
|
|
186
186
|
}
|
|
187
|
-
}, { deep: !0 }),
|
|
187
|
+
}, { deep: !0 }), w(N, (e) => {
|
|
188
188
|
e !== void 0 && $(e);
|
|
189
|
-
}),
|
|
190
|
-
e &&
|
|
191
|
-
}),
|
|
192
|
-
!e &&
|
|
193
|
-
}),
|
|
194
|
-
|
|
195
|
-
id:
|
|
189
|
+
}), w(A, (e) => {
|
|
190
|
+
e && k.value && h.selectionMode === "automatic" && g(Y);
|
|
191
|
+
}), w(() => h.loading, (e) => {
|
|
192
|
+
!e && k.value && g(Y);
|
|
193
|
+
}), s({ triggerEl: P }), (e, a) => (_(), d(re, null, [
|
|
194
|
+
p(x(ne), ae({
|
|
195
|
+
id: x(j),
|
|
196
196
|
ref: "trigger",
|
|
197
|
-
modelValue:
|
|
198
|
-
"onUpdate:modelValue": a[0] ||= (e) =>
|
|
199
|
-
label:
|
|
200
|
-
"label-position":
|
|
201
|
-
required:
|
|
202
|
-
help:
|
|
203
|
-
"help-display":
|
|
204
|
-
icons:
|
|
205
|
-
texts:
|
|
197
|
+
modelValue: A.value,
|
|
198
|
+
"onUpdate:modelValue": a[0] ||= (e) => A.value = e,
|
|
199
|
+
label: h.label,
|
|
200
|
+
"label-position": h.labelPosition,
|
|
201
|
+
required: h.required,
|
|
202
|
+
help: h.help,
|
|
203
|
+
"help-display": h.helpDisplay,
|
|
204
|
+
icons: h.icons,
|
|
205
|
+
texts: h.texts,
|
|
206
206
|
role: "combobox",
|
|
207
|
-
placeholder:
|
|
207
|
+
placeholder: h.placeholder,
|
|
208
208
|
class: [
|
|
209
209
|
"q-combobox",
|
|
210
210
|
{
|
|
211
|
-
"q-combobox--readonly":
|
|
212
|
-
"q-combobox--disabled":
|
|
211
|
+
"q-combobox--readonly": h.readonly,
|
|
212
|
+
"q-combobox--disabled": h.disabled
|
|
213
213
|
},
|
|
214
|
-
|
|
214
|
+
h.class
|
|
215
215
|
],
|
|
216
|
-
readonly:
|
|
217
|
-
disabled:
|
|
218
|
-
invalid:
|
|
219
|
-
"data-loading":
|
|
216
|
+
readonly: h.readonly,
|
|
217
|
+
disabled: h.disabled,
|
|
218
|
+
invalid: h.invalid,
|
|
219
|
+
"data-loading": h.loading,
|
|
220
220
|
autocomplete: "off",
|
|
221
|
-
"aria-expanded":
|
|
222
|
-
"aria-controls":
|
|
221
|
+
"aria-expanded": H.value,
|
|
222
|
+
"aria-controls": H.value ? M.value : void 0,
|
|
223
223
|
"aria-haspopup": "listbox",
|
|
224
224
|
"aria-autocomplete": "list",
|
|
225
|
-
"aria-activedescendant":
|
|
226
|
-
size:
|
|
225
|
+
"aria-activedescendant": U.value,
|
|
226
|
+
size: h.size
|
|
227
227
|
}, e.$attrs, {
|
|
228
|
-
onClick:
|
|
228
|
+
onClick: J,
|
|
229
229
|
onFocusout: Z,
|
|
230
|
-
onInput:
|
|
231
|
-
onKeydown:
|
|
232
|
-
}),
|
|
233
|
-
"label.prepend":
|
|
234
|
-
"label.append":
|
|
235
|
-
append:
|
|
236
|
-
|
|
237
|
-
|
|
230
|
+
onInput: K,
|
|
231
|
+
onKeydown: Se
|
|
232
|
+
}), ie({
|
|
233
|
+
"label.prepend": T(() => [y(e.$slots, "label.prepend")]),
|
|
234
|
+
"label.append": T(() => [y(e.$slots, "label.append")]),
|
|
235
|
+
append: T(() => [
|
|
236
|
+
y(e.$slots, "append"),
|
|
237
|
+
I.value && A.value ? (_(), l(x(te), {
|
|
238
238
|
key: 0,
|
|
239
239
|
ref: "clearButton",
|
|
240
|
-
icons:
|
|
241
|
-
texts:
|
|
242
|
-
onClick:
|
|
243
|
-
}, null, 8, ["icons", "texts"])) :
|
|
244
|
-
|
|
240
|
+
icons: h.icons,
|
|
241
|
+
texts: h.texts,
|
|
242
|
+
onClick: xe
|
|
243
|
+
}, null, 8, ["icons", "texts"])) : u("v-if", !0),
|
|
244
|
+
h.readonly ? u("v-if", !0) : (_(), l(x(r), {
|
|
245
245
|
key: 1,
|
|
246
246
|
ref: "toggleButton",
|
|
247
247
|
class: "q-combobox__chevron",
|
|
248
|
-
"aria-label":
|
|
248
|
+
"aria-label": h.texts.showOptions,
|
|
249
249
|
variant: "ghost",
|
|
250
250
|
color: "neutral",
|
|
251
251
|
borderless: "",
|
|
252
252
|
tabindex: -1,
|
|
253
|
-
disabled:
|
|
254
|
-
onMousedown:
|
|
253
|
+
disabled: h.disabled,
|
|
254
|
+
onMousedown: le(be, ["stop", "prevent"])
|
|
255
255
|
}, {
|
|
256
|
-
default:
|
|
257
|
-
"model-value":
|
|
258
|
-
icons:
|
|
256
|
+
default: T(() => [p(x(i), {
|
|
257
|
+
"model-value": k.value,
|
|
258
|
+
icons: h.icons
|
|
259
259
|
}, null, 8, ["model-value", "icons"])]),
|
|
260
260
|
_: 1
|
|
261
261
|
}, 8, ["aria-label", "disabled"]))
|
|
@@ -264,17 +264,17 @@ var le = {
|
|
|
264
264
|
}, [
|
|
265
265
|
e.$slots.prepend ? {
|
|
266
266
|
name: "prepend",
|
|
267
|
-
fn:
|
|
267
|
+
fn: T(() => [y(e.$slots, "prepend")]),
|
|
268
268
|
key: "0"
|
|
269
269
|
} : void 0,
|
|
270
270
|
e.$slots.errors ? {
|
|
271
271
|
name: "errors",
|
|
272
|
-
fn:
|
|
272
|
+
fn: T(() => [y(e.$slots, "errors")]),
|
|
273
273
|
key: "1"
|
|
274
274
|
} : void 0,
|
|
275
275
|
e.$slots.extras ? {
|
|
276
276
|
name: "extras",
|
|
277
|
-
fn:
|
|
277
|
+
fn: T(() => [y(e.$slots, "extras")]),
|
|
278
278
|
key: "2"
|
|
279
279
|
} : void 0
|
|
280
280
|
]), 1040, [
|
|
@@ -298,49 +298,49 @@ var le = {
|
|
|
298
298
|
"aria-activedescendant",
|
|
299
299
|
"size"
|
|
300
300
|
]),
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
"model-value":
|
|
301
|
+
f("span", ue, b(ye.value), 1),
|
|
302
|
+
p(x(t), {
|
|
303
|
+
"model-value": k.value,
|
|
304
304
|
spy: "",
|
|
305
305
|
"non-modal": "",
|
|
306
306
|
trigger: "manual",
|
|
307
307
|
placement: "bottom-start",
|
|
308
|
-
width:
|
|
308
|
+
width: pe.value,
|
|
309
309
|
offset: 4,
|
|
310
|
-
inline:
|
|
311
|
-
anchor:
|
|
312
|
-
"onUpdate:modelValue":
|
|
313
|
-
onEnter:
|
|
314
|
-
onLeave:
|
|
310
|
+
inline: h.inline,
|
|
311
|
+
anchor: P.value?.$el,
|
|
312
|
+
"onUpdate:modelValue": q,
|
|
313
|
+
onEnter: Te,
|
|
314
|
+
onLeave: Ee
|
|
315
315
|
}, {
|
|
316
|
-
default:
|
|
316
|
+
default: T(() => [f("div", {
|
|
317
317
|
ref: "content",
|
|
318
318
|
class: "q-select__body",
|
|
319
319
|
"data-testid": "combobox-dropdown",
|
|
320
|
-
"data-key":
|
|
320
|
+
"data-key": x(j),
|
|
321
321
|
onFocusout: Z
|
|
322
322
|
}, [
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
y(e.$slots, "body.prepend"),
|
|
324
|
+
h.loading ? (_(), d("div", fe, [p(x(n), { size: 24 })])) : L.value.length ? (_(), l(x(ee), {
|
|
325
325
|
key: 1,
|
|
326
|
-
id:
|
|
326
|
+
id: M.value,
|
|
327
327
|
ref: "list",
|
|
328
|
-
label:
|
|
329
|
-
"model-value":
|
|
330
|
-
class:
|
|
328
|
+
label: h.label,
|
|
329
|
+
"model-value": O.value,
|
|
330
|
+
class: oe(["q-select__items", `q-select__items--${h.overflow}`]),
|
|
331
331
|
selectable: "",
|
|
332
332
|
required: "",
|
|
333
|
-
icons:
|
|
334
|
-
highlighted:
|
|
335
|
-
items:
|
|
336
|
-
groups:
|
|
337
|
-
"item-label":
|
|
338
|
-
"item-value":
|
|
339
|
-
"item-title":
|
|
340
|
-
onMouseup:
|
|
341
|
-
"onUpdate:modelValue":
|
|
333
|
+
icons: h.icons,
|
|
334
|
+
highlighted: V.value?.[h.itemValue],
|
|
335
|
+
items: L.value,
|
|
336
|
+
groups: o.groups,
|
|
337
|
+
"item-label": h.itemLabel,
|
|
338
|
+
"item-value": h.itemValue,
|
|
339
|
+
"item-title": me.value,
|
|
340
|
+
onMouseup: we,
|
|
341
|
+
"onUpdate:modelValue": W
|
|
342
342
|
}, {
|
|
343
|
-
item:
|
|
343
|
+
item: T(({ item: t }) => [y(e.$slots, "item", { item: t })]),
|
|
344
344
|
_: 3
|
|
345
345
|
}, 8, [
|
|
346
346
|
"id",
|
|
@@ -354,9 +354,9 @@ var le = {
|
|
|
354
354
|
"item-label",
|
|
355
355
|
"item-value",
|
|
356
356
|
"item-title"
|
|
357
|
-
])) : (
|
|
358
|
-
|
|
359
|
-
], 40,
|
|
357
|
+
])) : (_(), d("div", E, b(h.texts.noData), 1)),
|
|
358
|
+
y(e.$slots, "body.append")
|
|
359
|
+
], 40, de)]),
|
|
360
360
|
_: 3
|
|
361
361
|
}, 8, [
|
|
362
362
|
"model-value",
|
|
@@ -368,4 +368,4 @@ var le = {
|
|
|
368
368
|
}
|
|
369
369
|
});
|
|
370
370
|
//#endregion
|
|
371
|
-
export {
|
|
371
|
+
export { D as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QListItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QList/QListItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QListItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QList/QListItem.vue"],"names":[],"mappings":"AA4EA;AAgPC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAU3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,GAAG,CAAA;AAMvC,KAAK,WAAW,GAAG,cAAc,CAAC;AAuJnC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAkJT,OAAO,IAA6B;;yBAbrB,GAAG;yBACH,GAAG;wBACH,GAAG;;;;;;EAgB/B;AAqBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;iBAUnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -16,12 +16,15 @@ var O = [
|
|
|
16
16
|
"aria-disabled",
|
|
17
17
|
"aria-selected"
|
|
18
18
|
], k = { class: "q-list-item__container" }, A = { class: "q-list-item__content" }, j = {
|
|
19
|
+
ref: "label",
|
|
20
|
+
class: "q-list-item__label"
|
|
21
|
+
}, M = { class: "q-list-item__label-text" }, N = {
|
|
19
22
|
key: 0,
|
|
20
23
|
class: "q-list-item__description"
|
|
21
|
-
},
|
|
24
|
+
}, P = ["id"], F = {
|
|
22
25
|
key: 0,
|
|
23
26
|
class: "q-list-item__check-container"
|
|
24
|
-
},
|
|
27
|
+
}, I = { class: "q-checkbox__input" }, L = /*@__PURE__*/ d({
|
|
25
28
|
__name: "QListItem",
|
|
26
29
|
props: /*@__PURE__*/ m({
|
|
27
30
|
value: {},
|
|
@@ -45,66 +48,82 @@ var O = [
|
|
|
45
48
|
}),
|
|
46
49
|
emits: /*@__PURE__*/ m(["click"], ["update:modelValue"]),
|
|
47
50
|
setup(r, { emit: d }) {
|
|
48
|
-
let m = r,
|
|
49
|
-
if (!
|
|
50
|
-
let
|
|
51
|
+
let m = r, L = d, R = w(r, "modelValue"), z = p(i, "option"), B = t(), V = a(() => `${B.value}_description`), H = e(m.value);
|
|
52
|
+
if (!H) throw Error("QListItem: Failed to retrieve group item. Ensure the component is used within a QList context.");
|
|
53
|
+
let U = a(() => {
|
|
51
54
|
if (!m.width) return;
|
|
52
55
|
let e = /^(\d*\.?\d+)%$/.exec(m.width.trim());
|
|
53
56
|
return { "--q-list-item-width": e ? `calc(${e[1]}% - var(--q-list-grid-gap) * ${(100 - Number(e[1])) / 100})` : m.width };
|
|
54
|
-
}),
|
|
55
|
-
|
|
57
|
+
}), W = b(0), G = a(() => {
|
|
58
|
+
let e = W.value > 0 ? { "--q-option-label-overflow": `${W.value}px` } : void 0;
|
|
59
|
+
if (!(!U.value && !e)) return {
|
|
60
|
+
...U.value,
|
|
61
|
+
...e
|
|
62
|
+
};
|
|
63
|
+
}), K = T("label");
|
|
64
|
+
function q() {
|
|
65
|
+
let e = K.value;
|
|
66
|
+
if (!e) return;
|
|
67
|
+
let t = e.scrollWidth - e.clientWidth;
|
|
68
|
+
W.value = t > 0 ? t : 0;
|
|
69
|
+
let n = e.closest(".q-list-item");
|
|
70
|
+
n && (W.value > 0 ? n.style.setProperty("--q-option-label-overflow", `${W.value}px`) : n.style.removeProperty("--q-option-label-overflow"));
|
|
71
|
+
}
|
|
72
|
+
E(() => m.highlighted, (e) => {
|
|
73
|
+
e && q();
|
|
74
|
+
}, { flush: "post" });
|
|
75
|
+
let J = b(!1);
|
|
76
|
+
function Y() {
|
|
56
77
|
if (!m.overflowTitle) return;
|
|
57
|
-
let e =
|
|
58
|
-
|
|
78
|
+
let e = K.value;
|
|
79
|
+
J.value = !!e && e.scrollWidth > e.clientWidth;
|
|
59
80
|
}
|
|
60
|
-
function
|
|
61
|
-
m.disabled || (
|
|
81
|
+
function X() {
|
|
82
|
+
m.disabled || (L("click"), m.selectable && H?.toggle());
|
|
62
83
|
}
|
|
63
|
-
function
|
|
64
|
-
e.key === "Tab" && !e.shiftKey && m.selectOnTab && !
|
|
84
|
+
function Z(e) {
|
|
85
|
+
e.key === "Tab" && !e.shiftKey && m.selectOnTab && !H?.isActive.value && X(), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), X());
|
|
65
86
|
}
|
|
66
|
-
return E(
|
|
67
|
-
|
|
87
|
+
return E(H.isActive, (e) => {
|
|
88
|
+
R.value = e;
|
|
68
89
|
}, { immediate: !0 }), (e, t) => (y(), c("li", {
|
|
69
|
-
id: C(
|
|
90
|
+
id: C(B),
|
|
70
91
|
"data-key": m.value,
|
|
71
|
-
role: C(
|
|
92
|
+
role: C(z),
|
|
72
93
|
tabindex: m.disabled ? void 0 : -1,
|
|
73
94
|
class: g(["q-list-item", {
|
|
74
|
-
"q-list-item--selected":
|
|
95
|
+
"q-list-item--selected": R.value,
|
|
75
96
|
"q-list-item--selectable": m.selectable,
|
|
76
97
|
"q-list-item--disabled": m.disabled,
|
|
77
98
|
"q-list-item--highlighted": m.highlighted
|
|
78
99
|
}]),
|
|
79
|
-
style: v(
|
|
80
|
-
title: m.overflowTitle &&
|
|
100
|
+
style: v(G.value),
|
|
101
|
+
title: m.overflowTitle && J.value ? m.label : void 0,
|
|
81
102
|
"aria-label": m.label,
|
|
82
|
-
"aria-describedby": m.description ?
|
|
103
|
+
"aria-describedby": m.description ? V.value : void 0,
|
|
83
104
|
"aria-disabled": m.disabled || void 0,
|
|
84
|
-
"aria-selected": C(
|
|
85
|
-
onKeydown:
|
|
86
|
-
|
|
87
|
-
|
|
105
|
+
"aria-selected": C(z) === "option" && !m.disabled ? R.value : void 0,
|
|
106
|
+
onKeydown: Z,
|
|
107
|
+
onFocus: q,
|
|
108
|
+
onMouseenter: Y,
|
|
109
|
+
onClick: D(X, ["stop", "prevent"])
|
|
88
110
|
}, [
|
|
89
111
|
x(e.$slots, "prepend"),
|
|
90
|
-
l("div", k, [l("div", A, [x(e.$slots, "default", {}, () => [m.icon ? (y(), o(C(n), h({ key: 0 }, m.icon, { class: "q-list-item__icon" }), null, 16)) : s("v-if", !0), l("span", {
|
|
91
|
-
ref: "label",
|
|
92
|
-
class: "q-list-item__label"
|
|
93
|
-
}, S(m.label), 513)])]), m.description ? (y(), c("div", j, [u(C(n), _(f(m.icons.description)), null, 16), l("span", { id: z.value }, S(m.description), 9, M)])) : s("v-if", !0)]),
|
|
112
|
+
l("div", k, [l("div", A, [x(e.$slots, "default", {}, () => [m.icon ? (y(), o(C(n), h({ key: 0 }, m.icon, { class: "q-list-item__icon" }), null, 16)) : s("v-if", !0), l("span", j, [l("span", M, S(m.label), 1)], 512)])]), m.description ? (y(), c("div", N, [u(C(n), _(f(m.icons.description)), null, 16), l("span", { id: V.value }, S(m.description), 9, P)])) : s("v-if", !0)]),
|
|
94
113
|
x(e.$slots, "append"),
|
|
95
|
-
m.selectable ? (y(), c("div",
|
|
114
|
+
m.selectable ? (y(), c("div", F, [m.checkboxless && R.value ? (y(), o(C(n), h({ key: 0 }, m.icons.check, {
|
|
96
115
|
class: "q-list-item__check",
|
|
97
116
|
"aria-hidden": "true"
|
|
98
117
|
}), null, 16)) : m.checkboxless ? s("v-if", !0) : (y(), c("span", {
|
|
99
118
|
key: 1,
|
|
100
119
|
"aria-hidden": "true",
|
|
101
120
|
class: g(["q-checkbox q-checkbox--small", {
|
|
102
|
-
"q-checkbox--checked":
|
|
121
|
+
"q-checkbox--checked": R.value,
|
|
103
122
|
"q-checkbox--disabled": m.disabled
|
|
104
123
|
}])
|
|
105
|
-
}, [l("span",
|
|
124
|
+
}, [l("span", I, [R.value ? (y(), o(C(n), h({ key: 0 }, m.icons.check, { class: "q-checkbox__input-icon" }), null, 16)) : s("v-if", !0)])], 2))])) : s("v-if", !0)
|
|
106
125
|
], 46, O));
|
|
107
126
|
}
|
|
108
127
|
});
|
|
109
128
|
//#endregion
|
|
110
|
-
export {
|
|
129
|
+
export { L as default };
|