@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.
@@ -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 o } from "../QList/index.js";
8
- import { QClearButton as ee } from "../__internal__/QClearButton/index.js";
9
- import { QTextField as te } from "../QTextField/index.js";
10
- import { DEFAULT_ICONS as s, DEFAULT_TEXTS as c } from "./constants.js";
11
- import { Fragment as ne, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as re, createVNode as m, defineComponent as h, mergeModels as g, mergeProps as ie, nextTick as _, normalizeClass as ae, onMounted as oe, openBlock as v, ref as y, renderSlot as b, toDisplayString as x, toRef as se, unref as S, useModel as C, useTemplateRef as w, watch as T, withCtx as E, withModifiers as ce } from "vue";
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 le = {
13
+ var ue = {
14
14
  class: "q-sr-only",
15
15
  role: "status"
16
- }, ue = ["data-key"], de = {
16
+ }, de = ["data-key"], fe = {
17
17
  key: 0,
18
18
  class: "q-select__loader"
19
- }, D = {
19
+ }, E = {
20
20
  key: 2,
21
21
  class: "q-select__loader"
22
- }, O = /*@__PURE__*/ h({
22
+ }, D = /*@__PURE__*/ m({
23
23
  inheritAttrs: !1,
24
24
  __name: "QCombobox",
25
- props: /*@__PURE__*/ g({
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: () => s },
35
- texts: { default: () => c },
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__*/ g([
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(s, { expose: c, emit: h }) {
72
- let g = s, O = h, k = C(s, "modelValue"), A = C(s, "open"), j = C(s, "search"), M = e(se(g, "id")), N = l(() => `${M.value}_listbox`), fe = l(() => g.overflow === "fit-content" ? "auto" : "anchor"), P = y(void 0), F = w("trigger"), I = w("list"), pe = w("toggleButton"), me = w("clearButton"), he = w("content");
73
- oe(K);
74
- let L = l(() => g.clearable && !g.readonly && !g.disabled), R = l(() => g.filterMode === "manual" || !ge.value ? g.items ?? [] : g.items?.filter((e) => e[g.itemLabel].toLowerCase().startsWith(j.value.toLowerCase())) ?? []), z = l(() => a(R.value, g.groups)), B = l(() => g.items?.find((e) => e[g.itemValue] === k.value)), V = l(() => B.value === void 0), H = l(() => {
75
- let e = P.value;
76
- if (e !== void 0 && z.value[e]) return z.value[e];
77
- }), ge = l(() => j.value.length > 0 && j.value !== B.value?.[g.itemLabel]), U = l(() => !!(A.value && !g.loading && R.value.length)), _e = l(() => !A.value || U.value ? "" : g.loading ? g.texts.loading : g.texts.noData), W = y();
78
- T([
79
- P,
80
- z,
81
- U
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
- W.value = e === void 0 ? void 0 : I.value?.getItem(e)?.id;
83
+ U.value = e === void 0 ? void 0 : F.value?.getItem(e)?.id;
84
84
  }, { flush: "post" });
85
- function G(e) {
86
- k.value = e, J();
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
- let e = B.value?.[g.itemLabel] || "";
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
- A.value || g.readonly || g.disabled || (O("before-show"), A.value = !0, Q());
94
- }
95
- function J() {
96
- A.value &&= (O("before-hide"), !1);
96
+ k.value &&= (D("before-hide"), !1);
97
97
  }
98
- function ve() {
99
- A.value ? J() : Y();
98
+ function be() {
99
+ k.value ? q() : J();
100
100
  }
101
- function ye() {
102
- L.value && (k.value = g.emptyValue, P.value = void 0, Q());
101
+ function xe() {
102
+ I.value && (O.value = h.emptyValue, N.value = void 0, Q());
103
103
  }
104
- function Y() {
105
- if (q(), B.value !== void 0) {
106
- let e = z.value.indexOf(B.value);
107
- e !== -1 && _(() => $(e));
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 be(e) {
111
- if (!e.key || g.readonly || g.disabled) return;
112
- let t = e.altKey && e.key === "ArrowDown" && !A.value;
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 ((U.value ? [
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") K(), A.value && (e.preventDefault(), e.stopPropagation(), J());
120
- else if (["ArrowDown", "ArrowUp"].includes(e.key)) A.value ? _(() => {
121
- if (P.value === void 0) X();
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
- Se(P.value, t);
124
+ Ce(N.value, t);
125
125
  }
126
- }) : (q(), _(() => {
127
- e.key === "ArrowDown" ? X() : xe();
126
+ }) : (K(), g(() => {
127
+ e.key === "ArrowDown" ? Y() : X();
128
128
  }));
129
129
  else if (e.key === "Enter") {
130
- if (H.value === void 0) return;
131
- G(H.value[g.itemValue]);
132
- } else if (e.key === "Home") P.value = I.value?.getFirstFocusableItemIndex();
133
- else if (e.key === "End") P.value = I.value?.getLastFocusableItemIndex();
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 (H.value === void 0) return;
136
- G(H.value[g.itemValue]);
135
+ if (V.value === void 0) return;
136
+ W(V.value[h.itemValue]);
137
137
  }
138
138
  }
139
139
  }
140
- function X() {
141
- if (V.value) P.value = I.value?.getFirstFocusableItemIndex();
140
+ function Y() {
141
+ if (B.value) N.value = F.value?.getFirstFocusableItemIndex();
142
142
  else {
143
- let e = z.value.findIndex((e) => e[g.itemValue] === k.value);
144
- e === -1 ? P.value = I.value?.getFirstFocusableItemIndex() : P.value = e;
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 xe() {
148
- P.value = I.value?.getLastFocusableItemIndex();
147
+ function X() {
148
+ N.value = F.value?.getLastFocusableItemIndex();
149
149
  }
150
- function Se(e, t) {
151
- P.value = I.value?.getAdjacentItemIndex(e, t);
150
+ function Ce(e, t) {
151
+ N.value = F.value?.getAdjacentItemIndex(e, t);
152
152
  }
153
153
  function Z(e) {
154
- let t = pe?.value?.$el === e.relatedTarget, n = me?.value?.$el === e.relatedTarget, r = F?.value?.$el?.contains(e.relatedTarget), i = he?.value?.contains(e.relatedTarget);
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
- J(), L.value && !j.value && (k.value = g.emptyValue), K();
159
+ q(), I.value && !A.value && (O.value = h.emptyValue), G();
160
160
  }
161
161
  function Q() {
162
- F.value?.inputRef?.focus();
163
- }
164
- function Ce() {
165
- Q();
162
+ P.value?.inputRef?.focus();
166
163
  }
167
164
  function we() {
168
- O("show");
165
+ Q();
169
166
  }
170
167
  function Te() {
171
- O("hide");
168
+ D("show");
169
+ }
170
+ function Ee() {
171
+ D("hide");
172
172
  }
173
173
  function $(e) {
174
- let t = I.value?.getItem(e);
175
- if (I.value && t) {
176
- let e = I.value.$el, n = t.offsetTop + t.offsetHeight;
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 T(A, (e) => {
181
- e || (P.value = void 0);
182
- }), T(k, K), T(() => g.items, (e, t) => {
183
- if (!V.value) {
184
- let e = t?.find((e) => e[g.itemValue] === k.value);
185
- j.value === e?.[g.itemLabel] && K();
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 }), T(P, (e) => {
187
+ }, { deep: !0 }), w(N, (e) => {
188
188
  e !== void 0 && $(e);
189
- }), T(j, (e) => {
190
- e && A.value && g.selectionMode === "automatic" && _(X);
191
- }), T(() => g.loading, (e) => {
192
- !e && A.value && _(X);
193
- }), c({ triggerEl: F }), (e, a) => (v(), f(ne, null, [
194
- m(S(te), ie({
195
- id: S(M),
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: j.value,
198
- "onUpdate:modelValue": a[0] ||= (e) => j.value = e,
199
- label: g.label,
200
- "label-position": g.labelPosition,
201
- required: g.required,
202
- help: g.help,
203
- "help-display": g.helpDisplay,
204
- icons: g.icons,
205
- texts: g.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: g.placeholder,
207
+ placeholder: h.placeholder,
208
208
  class: [
209
209
  "q-combobox",
210
210
  {
211
- "q-combobox--readonly": g.readonly,
212
- "q-combobox--disabled": g.disabled
211
+ "q-combobox--readonly": h.readonly,
212
+ "q-combobox--disabled": h.disabled
213
213
  },
214
- g.class
214
+ h.class
215
215
  ],
216
- readonly: g.readonly,
217
- disabled: g.disabled,
218
- invalid: g.invalid,
219
- "data-loading": g.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": U.value,
222
- "aria-controls": U.value ? N.value : void 0,
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": W.value,
226
- size: g.size
225
+ "aria-activedescendant": U.value,
226
+ size: h.size
227
227
  }, e.$attrs, {
228
- onClick: Y,
228
+ onClick: J,
229
229
  onFocusout: Z,
230
- onInput: q,
231
- onKeydown: be
232
- }), re({
233
- "label.prepend": E(() => [b(e.$slots, "label.prepend")]),
234
- "label.append": E(() => [b(e.$slots, "label.append")]),
235
- append: E(() => [
236
- b(e.$slots, "append"),
237
- L.value && j.value ? (v(), u(S(ee), {
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: g.icons,
241
- texts: g.texts,
242
- onClick: ye
243
- }, null, 8, ["icons", "texts"])) : d("v-if", !0),
244
- g.readonly ? d("v-if", !0) : (v(), u(S(r), {
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": g.texts.showOptions,
248
+ "aria-label": h.texts.showOptions,
249
249
  variant: "ghost",
250
250
  color: "neutral",
251
251
  borderless: "",
252
252
  tabindex: -1,
253
- disabled: g.disabled,
254
- onMousedown: ce(ve, ["stop", "prevent"])
253
+ disabled: h.disabled,
254
+ onMousedown: le(be, ["stop", "prevent"])
255
255
  }, {
256
- default: E(() => [m(S(i), {
257
- "model-value": A.value,
258
- icons: g.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: E(() => [b(e.$slots, "prepend")]),
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: E(() => [b(e.$slots, "errors")]),
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: E(() => [b(e.$slots, "extras")]),
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
- p("span", le, x(_e.value), 1),
302
- m(S(t), {
303
- "model-value": A.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: fe.value,
308
+ width: pe.value,
309
309
  offset: 4,
310
- inline: g.inline,
311
- anchor: F.value?.$el,
312
- "onUpdate:modelValue": J,
313
- onEnter: we,
314
- onLeave: Te
310
+ inline: h.inline,
311
+ anchor: P.value?.$el,
312
+ "onUpdate:modelValue": q,
313
+ onEnter: Te,
314
+ onLeave: Ee
315
315
  }, {
316
- default: E(() => [p("div", {
316
+ default: T(() => [f("div", {
317
317
  ref: "content",
318
318
  class: "q-select__body",
319
319
  "data-testid": "combobox-dropdown",
320
- "data-key": S(M),
320
+ "data-key": x(j),
321
321
  onFocusout: Z
322
322
  }, [
323
- b(e.$slots, "body.prepend"),
324
- g.loading ? (v(), f("div", de, [m(S(n), { size: 24 })])) : R.value.length ? (v(), u(S(o), {
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: N.value,
326
+ id: M.value,
327
327
  ref: "list",
328
- label: g.label,
329
- "model-value": k.value,
330
- class: ae(["q-select__items", `q-select__items--${g.overflow}`]),
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: g.icons,
334
- highlighted: H.value?.[g.itemValue],
335
- items: R.value,
336
- groups: s.groups,
337
- "item-label": g.itemLabel,
338
- "item-value": g.itemValue,
339
- "item-title": g.overflow === "truncate",
340
- onMouseup: Ce,
341
- "onUpdate:modelValue": G
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: E(({ item: t }) => [b(e.$slots, "item", { item: t })]),
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
- ])) : (v(), f("div", D, x(g.texts.noData), 1)),
358
- b(e.$slots, "body.append")
359
- ], 40, ue)]),
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 { O as default };
371
+ export { D as default };
@@ -1 +1 @@
1
- {"version":3,"file":"QListItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QList/QListItem.vue"],"names":[],"mappings":"AA2EA;AAiMC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAU3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,GAAG,CAAA;AAMvC,KAAK,WAAW,GAAG,cAAc,CAAC;AAyGnC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WA8IT,OAAO,IAA6B;;yBAbrB,GAAG;yBACH,GAAG;wBACH,GAAG;;;;;;EAgB/B;AAoBD,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"}
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
- }, M = ["id"], N = {
24
+ }, P = ["id"], F = {
22
25
  key: 0,
23
26
  class: "q-list-item__check-container"
24
- }, P = { class: "q-checkbox__input" }, F = /*@__PURE__*/ d({
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, F = d, I = w(r, "modelValue"), L = p(i, "option"), R = t(), z = a(() => `${R.value}_description`), B = e(m.value);
49
- if (!B) throw Error("QListItem: Failed to retrieve group item. Ensure the component is used within a QList context.");
50
- let V = a(() => {
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
- }), H = T("label"), U = b(!1);
55
- function W() {
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 = H.value;
58
- U.value = !!e && e.scrollWidth > e.clientWidth;
78
+ let e = K.value;
79
+ J.value = !!e && e.scrollWidth > e.clientWidth;
59
80
  }
60
- function G() {
61
- m.disabled || (F("click"), m.selectable && B?.toggle());
81
+ function X() {
82
+ m.disabled || (L("click"), m.selectable && H?.toggle());
62
83
  }
63
- function K(e) {
64
- e.key === "Tab" && !e.shiftKey && m.selectOnTab && !B?.isActive.value && G(), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), G());
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(B.isActive, (e) => {
67
- I.value = e;
87
+ return E(H.isActive, (e) => {
88
+ R.value = e;
68
89
  }, { immediate: !0 }), (e, t) => (y(), c("li", {
69
- id: C(R),
90
+ id: C(B),
70
91
  "data-key": m.value,
71
- role: C(L),
92
+ role: C(z),
72
93
  tabindex: m.disabled ? void 0 : -1,
73
94
  class: g(["q-list-item", {
74
- "q-list-item--selected": I.value,
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(V.value),
80
- title: m.overflowTitle && U.value ? m.label : void 0,
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 ? z.value : void 0,
103
+ "aria-describedby": m.description ? V.value : void 0,
83
104
  "aria-disabled": m.disabled || void 0,
84
- "aria-selected": C(L) === "option" && !m.disabled ? I.value : void 0,
85
- onKeydown: K,
86
- onMouseenter: W,
87
- onClick: D(G, ["stop", "prevent"])
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", N, [m.checkboxless && I.value ? (y(), o(C(n), h({ key: 0 }, m.icons.check, {
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": I.value,
121
+ "q-checkbox--checked": R.value,
103
122
  "q-checkbox--disabled": m.disabled
104
123
  }])
105
- }, [l("span", P, [I.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)
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 { F as default };
129
+ export { L as default };