@quidgest/ui 0.16.40 → 0.16.42

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent as ce, mergeModels as Z, useModel as fe, toRef as z, ref as ee, useTemplateRef as _, onMounted as me, computed as q, nextTick as O, watch as D, createElementBlock as c, openBlock as a, Fragment as b, createVNode as T, unref as o, normalizeClass as pe, createSlots as ve, withCtx as f, withDirectives as ye, createBlock as m, createCommentVNode as p, renderList as le, createTextVNode as w, mergeProps as B, toDisplayString as g, normalizeProps as te, createElementVNode as ae, vModelText as be, renderSlot as h, withModifiers as ge } from "vue";
1
+ import { defineComponent as ce, mergeModels as Z, useModel as fe, toRef as z, ref as ee, useTemplateRef as _, onMounted as me, computed as q, nextTick as O, watch as D, createElementBlock as c, openBlock as t, Fragment as y, createVNode as T, unref as o, normalizeClass as pe, createSlots as ve, withCtx as f, withDirectives as be, createBlock as m, createCommentVNode as p, renderList as le, createTextVNode as w, mergeProps as B, toDisplayString as g, normalizeProps as ae, createElementVNode as te, vModelText as ye, renderSlot as h, withModifiers as ge } from "vue";
2
2
  import { DEFAULT_TEXTS as he, DEFAULT_ICONS as ke } from "./constants.js";
3
3
  import { QBadge as M } from "../QBadge/index.js";
4
4
  import { QButton as _e } from "../QButton/index.js";
@@ -59,98 +59,98 @@ const De = {
59
59
  active: s,
60
60
  required: z(e, "required"),
61
61
  multiple: z(e, "multiple")
62
- }), d = ee(!1), V = ee(0), S = _("trigger"), ne = _("list"), U = _("content"), N = _("badgesContainer"), W = _("allBadges");
62
+ }), u = ee(!1), V = ee(0), S = _("trigger"), ie = _("list"), U = _("content"), N = _("badgesContainer"), W = _("allBadges");
63
63
  me($);
64
64
  const P = q(() => r.value.length === 0), r = q(() => {
65
- var t;
65
+ var a;
66
66
  if (e.multiple)
67
- return ((t = s.value) == null ? void 0 : t.map((u) => j(u))) ?? [];
67
+ return ((a = s.value) == null ? void 0 : a.map((d) => j(d))) ?? [];
68
68
  const l = typeof s.value < "u" ? j(s.value) : void 0;
69
69
  return l ? [l] : [];
70
70
  }), H = q(() => {
71
- var t;
71
+ var a;
72
72
  const l = /* @__PURE__ */ new Map();
73
- return (t = e.items) == null || t.forEach((u, n) => {
74
- l.set(u.key, n);
73
+ return (a = e.items) == null || a.forEach((d, i) => {
74
+ l.set(d.key, i);
75
75
  }), l;
76
76
  }), A = q(
77
77
  () => {
78
78
  var l;
79
- return (l = r.value) == null ? void 0 : l.map((t) => t[e.itemLabel]).join(", ");
79
+ return (l = r.value) == null ? void 0 : l.map((a) => a[e.itemLabel]).join(", ");
80
80
  }
81
- ), k = q(
81
+ ), L = q(
82
82
  () => e.clearable && !e.readonly && !e.disabled && !e.loading && !P.value
83
83
  );
84
84
  function j(l) {
85
- var t;
86
- return (t = e.items) == null ? void 0 : t.find((u) => u[e.itemValue] === l);
85
+ var a;
86
+ return (a = e.items) == null ? void 0 : a.find((d) => d[e.itemValue] === l);
87
87
  }
88
- function ie(l) {
89
- e.multiple && l < s.value.length && (!e.required || s.value.length > 1) ? K.value = s.value.toSpliced(l, 1) : L();
88
+ function ne(l) {
89
+ e.multiple && l < s.value.length && (!e.required || s.value.length > 1) ? K.value = s.value.toSpliced(l, 1) : k();
90
90
  }
91
91
  function I(l) {
92
- Array.isArray(l) ? (s.value = l.sort((t, u) => H.value.get(t) - H.value.get(u)), $()) : (s.value = l, E());
92
+ Array.isArray(l) ? (s.value = l.sort((a, d) => H.value.get(a) - H.value.get(d)), $()) : (s.value = l, E());
93
93
  }
94
- function L() {
95
- k.value && (I(e.emptyValue), J());
94
+ function k() {
95
+ I(e.emptyValue), J();
96
96
  }
97
97
  function re(l) {
98
- var t, u, n;
99
- !((t = U.value) != null && t.contains(l.relatedTarget)) && !((n = (u = S.value) == null ? void 0 : u.fieldRef) != null && n.contains(l.relatedTarget)) && E();
98
+ var a, d, i;
99
+ !((a = U.value) != null && a.contains(l.relatedTarget)) && !((i = (d = S.value) == null ? void 0 : d.fieldRef) != null && i.contains(l.relatedTarget)) && E();
100
100
  }
101
101
  function G() {
102
- d.value || (C("before-show"), d.value = !0);
102
+ u.value || (C("before-show"), u.value = !0);
103
103
  }
104
104
  function E() {
105
- d.value && (C("before-hide"), d.value = !1);
105
+ u.value && (C("before-hide"), u.value = !1);
106
106
  }
107
107
  function X() {
108
- e.readonly || e.disabled || (d.value ? E() : G());
108
+ e.readonly || e.disabled || (u.value ? E() : G());
109
109
  }
110
110
  function x(l) {
111
- !l.key || e.readonly || e.disabled || (["Enter", " ", "ArrowDown", "ArrowUp", "Home", "End", "Delete"].includes(l.key) && (l.preventDefault(), l.stopPropagation()), ["Enter", " ", "ArrowDown"].includes(l.key) && G(), ["Escape", "Tab"].includes(l.key) && (d.value ? E() : k.value && l.key === "Escape" && L()), k.value && l.key === "Delete" && L());
111
+ !l.key || e.readonly || e.disabled || (["Enter", " ", "ArrowDown", "ArrowUp", "Home", "End", "Delete"].includes(l.key) && (l.preventDefault(), l.stopPropagation()), ["Enter", " ", "ArrowDown"].includes(l.key) && G(), ["Escape", "Tab"].includes(l.key) && (u.value ? E() : L.value && l.key === "Escape" && k()), L.value && l.key === "Delete" && k());
112
112
  }
113
113
  function se(l) {
114
114
  l.key.length === 1 && l.preventDefault(), x(l);
115
115
  }
116
- function ue() {
116
+ function de() {
117
117
  var l;
118
118
  e.loading ? (l = U.value) == null || l.focus() : Y(), C("show");
119
119
  }
120
- function de() {
120
+ function ue() {
121
121
  J(), C("hide");
122
122
  }
123
123
  function J() {
124
- var l, t;
125
- (t = (l = S.value) == null ? void 0 : l.fieldRef) == null || t.focus();
124
+ var l, a;
125
+ (a = (l = S.value) == null ? void 0 : l.fieldRef) == null || a.focus();
126
126
  }
127
127
  function Y() {
128
128
  var l;
129
- (l = ne.value) == null || l.$el.focus();
129
+ (l = ie.value) == null || l.$el.focus();
130
130
  }
131
131
  async function $() {
132
- var i;
132
+ var n;
133
133
  if (await O(), !e.multiple || !e.badges || !N.value) return;
134
- let l = 0, t = 0;
134
+ let l = 0, a = 0;
135
135
  await O();
136
- const u = N.value.offsetWidth, n = 4;
137
- for (const y of W.value ?? []) {
138
- const v = y.$el.scrollWidth + n;
139
- if (l + v <= u)
140
- l += v, t++;
136
+ const d = N.value.offsetWidth, i = 4;
137
+ for (const b of W.value ?? []) {
138
+ const v = b.$el.scrollWidth + i;
139
+ if (l + v <= d)
140
+ l += v, a++;
141
141
  else break;
142
142
  }
143
- V.value = (((i = W.value) == null ? void 0 : i.length) ?? 0) - t;
143
+ V.value = (((n = W.value) == null ? void 0 : n.length) ?? 0) - a;
144
144
  }
145
145
  return D(
146
146
  () => e.loading,
147
147
  (l) => {
148
- !l && d.value && O(Y);
148
+ !l && u.value && O(Y);
149
149
  }
150
- ), D(() => e.badges, $), D(() => e.clearable, $), D(K, I), (l, t) => {
151
- var u;
152
- return a(), c(
153
- b,
150
+ ), D(() => e.badges, $), D(() => e.clearable, $), D(K, I), (l, a) => {
151
+ var d;
152
+ return t(), c(
153
+ y,
154
154
  null,
155
155
  [
156
156
  T(o(qe), {
@@ -170,7 +170,7 @@ const De = {
170
170
  readonly: e.readonly,
171
171
  disabled: e.disabled,
172
172
  "data-loading": e.loading,
173
- "aria-expanded": d.value,
173
+ "aria-expanded": u.value,
174
174
  "aria-haspopup": "listbox",
175
175
  size: e.size,
176
176
  invalid: e.invalid,
@@ -179,13 +179,13 @@ const De = {
179
179
  }, ve({
180
180
  append: f(() => [
181
181
  h(l.$slots, "append"),
182
- k.value ? (a(), m(o(Le), {
182
+ L.value ? (t(), m(o(Le), {
183
183
  key: 0,
184
184
  icons: e.icons,
185
185
  texts: e.texts,
186
- onClick: L
186
+ onClick: k
187
187
  }, null, 8, ["icons", "texts"])) : p("v-if", !0),
188
- e.readonly ? p("v-if", !0) : (a(), m(o(_e), {
188
+ e.readonly ? p("v-if", !0) : (t(), m(o(_e), {
189
189
  key: 1,
190
190
  class: "q-select__chevron",
191
191
  "aria-label": e.texts.showOptions,
@@ -198,7 +198,7 @@ const De = {
198
198
  }, {
199
199
  default: f(() => [
200
200
  T(o(Ve), {
201
- "model-value": d.value,
201
+ "model-value": u.value,
202
202
  icons: e.icons
203
203
  }, null, 8, ["model-value", "icons"])
204
204
  ]),
@@ -207,9 +207,9 @@ const De = {
207
207
  }, 8, ["aria-label", "disabled"]))
208
208
  ]),
209
209
  default: f(() => [
210
- P.value ? (a(), c("span", Me, [
211
- !e.readonly && !e.disabled ? (a(), c(
212
- b,
210
+ P.value ? (t(), c("span", Me, [
211
+ !e.readonly && !e.disabled ? (t(), c(
212
+ y,
213
213
  { key: 0 },
214
214
  [
215
215
  w(
@@ -221,46 +221,47 @@ const De = {
221
221
  64
222
222
  /* STABLE_FRAGMENT */
223
223
  )) : p("v-if", !0)
224
- ])) : (a(), c(
225
- b,
224
+ ])) : (t(), c(
225
+ y,
226
226
  { key: 0 },
227
227
  [
228
- e.badges ? (a(), c(
228
+ e.badges ? (t(), c(
229
229
  "span",
230
230
  De,
231
231
  [
232
- e.multiple ? (a(), c(
233
- b,
232
+ e.multiple ? (t(), c(
233
+ y,
234
234
  { key: 0 },
235
235
  [
236
- (a(!0), c(
237
- b,
236
+ (t(!0), c(
237
+ y,
238
238
  null,
239
- le(s.value, (n, i) => (a(), c(
240
- b,
241
- { key: i },
239
+ le(s.value, (i, n) => (t(), c(
240
+ y,
241
+ { key: n },
242
242
  [
243
- i < s.value.length - V.value ? (a(), m(o(M), {
243
+ n < s.value.length - V.value ? (t(), m(o(M), {
244
244
  key: 0,
245
245
  pill: "",
246
- removable: !e.readonly && !e.disabled && (!e.required || s.value.length > 1),
247
- "onClick:remove": () => ie(i)
246
+ disabled: e.readonly || e.disabled,
247
+ removable: !e.required || s.value.length > 1,
248
+ "onClick:remove": () => ne(n)
248
249
  }, {
249
250
  default: f(() => {
250
- var y, v;
251
+ var b, v;
251
252
  return [
252
- (y = r.value[i]) != null && y.icon ? (a(), m(
253
+ (b = r.value[n]) != null && b.icon ? (t(), m(
253
254
  o(Q),
254
255
  B({
255
256
  key: 0,
256
257
  ref_for: !0
257
- }, r.value[i].icon),
258
+ }, r.value[n].icon),
258
259
  null,
259
260
  16
260
261
  /* FULL_PROPS */
261
262
  )) : p("v-if", !0),
262
263
  w(
263
- " " + g((v = r.value[i]) == null ? void 0 : v[e.itemLabel]),
264
+ " " + g((v = r.value[n]) == null ? void 0 : v[e.itemLabel]),
264
265
  1
265
266
  /* TEXT */
266
267
  )
@@ -268,7 +269,7 @@ const De = {
268
269
  }),
269
270
  _: 2
270
271
  /* DYNAMIC */
271
- }, 1032, ["removable", "onClick:remove"])) : p("v-if", !0)
272
+ }, 1032, ["disabled", "removable", "onClick:remove"])) : p("v-if", !0)
272
273
  ],
273
274
  64
274
275
  /* STABLE_FRAGMENT */
@@ -276,10 +277,11 @@ const De = {
276
277
  128
277
278
  /* KEYED_FRAGMENT */
278
279
  )),
279
- V.value > 0 ? (a(), m(o(M), {
280
+ V.value > 0 ? (t(), m(o(M), {
280
281
  key: 0,
281
282
  pill: "",
282
- class: "q-select__badge-count"
283
+ class: "q-select__badge-count",
284
+ disabled: e.readonly || e.disabled
283
285
  }, {
284
286
  default: f(() => [
285
287
  w(
@@ -290,33 +292,34 @@ const De = {
290
292
  ]),
291
293
  _: 1
292
294
  /* STABLE */
293
- })) : p("v-if", !0),
294
- (a(!0), c(
295
- b,
295
+ }, 8, ["disabled"])) : p("v-if", !0),
296
+ (t(!0), c(
297
+ y,
296
298
  null,
297
- le(s.value, (n, i) => (a(), m(o(M), {
298
- key: i,
299
+ le(s.value, (i, n) => (t(), m(o(M), {
300
+ key: n,
299
301
  ref_for: !0,
300
302
  ref: "allBadges",
301
303
  pill: "",
304
+ disabled: "",
302
305
  class: "q-select__badge-hidden",
303
- removable: !e.readonly && !e.disabled && (!e.required || s.value.length > 1)
306
+ removable: !e.required || s.value.length > 1
304
307
  }, {
305
308
  default: f(() => {
306
- var y, v;
309
+ var b, v;
307
310
  return [
308
- (y = r.value[i]) != null && y.icon ? (a(), m(
311
+ (b = r.value[n]) != null && b.icon ? (t(), m(
309
312
  o(Q),
310
313
  B({
311
314
  key: 0,
312
315
  ref_for: !0
313
- }, r.value[i].icon),
316
+ }, r.value[n].icon),
314
317
  null,
315
318
  16
316
319
  /* FULL_PROPS */
317
320
  )) : p("v-if", !0),
318
321
  w(
319
- " " + g((v = r.value[i]) == null ? void 0 : v[e.itemLabel]),
322
+ " " + g((v = r.value[n]) == null ? void 0 : v[e.itemLabel]),
320
323
  1
321
324
  /* TEXT */
322
325
  )
@@ -331,22 +334,25 @@ const De = {
331
334
  ],
332
335
  64
333
336
  /* STABLE_FRAGMENT */
334
- )) : (a(), m(o(M), {
337
+ )) : (t(), m(o(M), {
335
338
  key: 1,
336
- pill: ""
339
+ pill: "",
340
+ disabled: e.readonly || e.disabled,
341
+ removable: !e.required,
342
+ "onClick:remove": k
337
343
  }, {
338
344
  default: f(() => {
339
- var n, i;
345
+ var i, n;
340
346
  return [
341
- (n = r.value[0]) != null && n.icon ? (a(), m(
347
+ (i = r.value[0]) != null && i.icon ? (t(), m(
342
348
  o(Q),
343
- te(B({ key: 0 }, r.value[0].icon)),
349
+ ae(B({ key: 0 }, r.value[0].icon)),
344
350
  null,
345
351
  16
346
352
  /* FULL_PROPS */
347
353
  )) : p("v-if", !0),
348
354
  w(
349
- " " + g((i = r.value[0]) == null ? void 0 : i[e.itemLabel]),
355
+ " " + g((n = r.value[0]) == null ? void 0 : n[e.itemLabel]),
350
356
  1
351
357
  /* TEXT */
352
358
  )
@@ -354,11 +360,11 @@ const De = {
354
360
  }),
355
361
  _: 1
356
362
  /* STABLE */
357
- }))
363
+ }, 8, ["disabled", "removable"]))
358
364
  ],
359
365
  512
360
366
  /* NEED_PATCH */
361
- )) : (a(), c(
367
+ )) : (t(), c(
362
368
  "span",
363
369
  Te,
364
370
  g(A.value),
@@ -369,19 +375,19 @@ const De = {
369
375
  64
370
376
  /* STABLE_FRAGMENT */
371
377
  )),
372
- ye(ae("input", B({
378
+ be(te("input", B({
373
379
  id: `${o(R)}_input`
374
380
  }, l.$attrs, {
375
- "onUpdate:modelValue": t[0] || (t[0] = (n) => A.value = n),
381
+ "onUpdate:modelValue": a[0] || (a[0] = (i) => A.value = i),
376
382
  class: "q-select__input",
377
383
  inputmode: "none",
378
384
  type: "text",
379
385
  autocomplete: "off",
380
386
  tabindex: e.disabled ? -1 : 0,
381
- "aria-keyshortcuts": k.value ? "Delete" : void 0,
387
+ "aria-keyshortcuts": L.value ? "Delete" : void 0,
382
388
  onKeydown: se
383
389
  }), null, 16, Qe), [
384
- [be, A.value]
390
+ [ye, A.value]
385
391
  ])
386
392
  ]),
387
393
  _: 2
@@ -391,9 +397,9 @@ const De = {
391
397
  name: "prepend",
392
398
  fn: f(() => [
393
399
  h(l.$slots, "prepend"),
394
- r.value.length === 1 && r.value[0].icon && !e.badges ? (a(), m(
400
+ r.value.length === 1 && r.value[0].icon && !e.badges ? (t(), m(
395
401
  o(Q),
396
- te(B({ key: 0 }, r.value[0].icon)),
402
+ ae(B({ key: 0 }, r.value[0].icon)),
397
403
  null,
398
404
  16
399
405
  /* FULL_PROPS */
@@ -410,21 +416,21 @@ const De = {
410
416
  } : void 0
411
417
  ]), 1032, ["id", "label", "required", "class", "readonly", "disabled", "data-loading", "aria-expanded", "size", "invalid"]),
412
418
  T(o(Be), {
413
- modelValue: d.value,
414
- "onUpdate:modelValue": t[1] || (t[1] = (n) => d.value = n),
419
+ modelValue: u.value,
420
+ "onUpdate:modelValue": a[1] || (a[1] = (i) => u.value = i),
415
421
  spy: "",
416
422
  trigger: "manual",
417
423
  placement: "bottom-start",
418
424
  width: "anchor",
419
425
  "scroll-lock": "",
420
426
  inline: e.inline,
421
- anchor: (u = o(S)) == null ? void 0 : u.fieldRef,
427
+ anchor: (d = o(S)) == null ? void 0 : d.fieldRef,
422
428
  offset: 2,
423
- onEnter: ue,
424
- onLeave: de
429
+ onEnter: de,
430
+ onLeave: ue
425
431
  }, {
426
432
  default: f(() => [
427
- ae("div", {
433
+ te("div", {
428
434
  ref: "content",
429
435
  "data-testid": "combobox-dropdown",
430
436
  "data-key": o(R),
@@ -434,9 +440,9 @@ const De = {
434
440
  onKeydown: ge(x, ["stop"])
435
441
  }, [
436
442
  h(l.$slots, "body.prepend"),
437
- e.loading ? (a(), c("div", Se, [
443
+ e.loading ? (t(), c("div", Se, [
438
444
  T(o(Ce), { size: 24 })
439
- ])) : (a(), m(o(we), {
445
+ ])) : (t(), m(o(we), {
440
446
  key: 1,
441
447
  ref: "list",
442
448
  class: "q-select__items",
@@ -450,8 +456,8 @@ const De = {
450
456
  "item-value": e.itemValue,
451
457
  "onUpdate:modelValue": I
452
458
  }, {
453
- item: f(({ item: n }) => [
454
- h(l.$slots, "item", { item: n })
459
+ item: f(({ item: i }) => [
460
+ h(l.$slots, "item", { item: i })
455
461
  ]),
456
462
  _: 3
457
463
  /* FORWARDED */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quidgest/ui",
3
3
  "description": "Quidgest's UI framework",
4
- "version": "0.16.40",
4
+ "version": "0.16.42",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",