@quidgest/ui 0.9.1 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui.esm.js CHANGED
@@ -649,10 +649,10 @@ const qt = /* @__PURE__ */ S({
649
649
  var l;
650
650
  if ((l = i.value) != null && l.contains(f.relatedTarget))
651
651
  return;
652
- let b;
653
- o.value ? b = e.items.findIndex((h) => h[e.itemValue] === o.value) : b = G();
652
+ let y;
653
+ o.value ? y = e.items.findIndex((h) => h[e.itemValue] === o.value) : y = G();
654
654
  const $ = a.value;
655
- z(b, $);
655
+ z(y, $);
656
656
  }
657
657
  function F(f) {
658
658
  switch (["ArrowDown", "ArrowUp", "Home", "End"].includes(f.key) && f.preventDefault(), f.key) {
@@ -684,13 +684,13 @@ const qt = /* @__PURE__ */ S({
684
684
  break;
685
685
  }
686
686
  }
687
- function z(f, b = !1) {
687
+ function z(f, y = !1) {
688
688
  var l;
689
- (l = L()[f]) == null || l.focus({ preventScroll: b });
689
+ (l = L()[f]) == null || l.focus({ preventScroll: y });
690
690
  }
691
691
  function L() {
692
- var b;
693
- const f = (b = i.value) == null ? void 0 : b.querySelectorAll("li");
692
+ var y;
693
+ const f = (y = i.value) == null ? void 0 : y.querySelectorAll("li");
694
694
  return f ? Array.from(f) : [];
695
695
  }
696
696
  function K(f) {
@@ -700,29 +700,29 @@ const qt = /* @__PURE__ */ S({
700
700
  return L().indexOf(document.activeElement);
701
701
  }
702
702
  function G() {
703
- const f = L(), b = f.find(($) => Z($));
704
- return b ? f.indexOf(b) : -1;
703
+ const f = L(), y = f.find(($) => Z($));
704
+ return y ? f.indexOf(y) : -1;
705
705
  }
706
706
  function C() {
707
- const f = L(), b = [...f].reverse().find(($) => Z($));
708
- return b ? f.indexOf(b) : -1;
707
+ const f = L(), y = [...f].reverse().find(($) => Z($));
708
+ return y ? f.indexOf(y) : -1;
709
709
  }
710
- function M(f, b, $) {
711
- return b === "prev" && f === 0 || b === "next" && f === $.length - 1;
710
+ function M(f, y, $) {
711
+ return y === "prev" && f === 0 || y === "next" && f === $.length - 1;
712
712
  }
713
713
  function W(f) {
714
- const b = le();
715
- return R(b, f);
714
+ const y = le();
715
+ return R(y, f);
716
716
  }
717
- function R(f, b) {
717
+ function R(f, y) {
718
718
  const $ = L();
719
- if (M(f, b, $))
719
+ if (M(f, y, $))
720
720
  return f;
721
- let l = f + (b === "next" ? 1 : -1);
721
+ let l = f + (y === "next" ? 1 : -1);
722
722
  for (; !Z($[l]); ) {
723
- if (M(l, b, $))
723
+ if (M(l, y, $))
724
724
  return f;
725
- l += b === "next" ? 1 : -1;
725
+ l += y === "next" ? 1 : -1;
726
726
  }
727
727
  return l;
728
728
  }
@@ -730,7 +730,7 @@ const qt = /* @__PURE__ */ S({
730
730
  return f.tabIndex === -2;
731
731
  }
732
732
  function J(f) {
733
- return f ? e.items.filter((b) => b.group === f) : e.items;
733
+ return f ? e.items.filter((y) => y.group === f) : e.items;
734
734
  }
735
735
  return n({
736
736
  focusItem: z,
@@ -738,7 +738,7 @@ const qt = /* @__PURE__ */ S({
738
738
  getAdjacentItemIndex: R,
739
739
  getFirstFocusableItemIndex: G,
740
740
  getLastFocusableItemIndex: C
741
- }), (f, b) => (u(), V(Qe(r.value), {
741
+ }), (f, y) => (u(), V(Qe(r.value), {
742
742
  ref_key: "listRef",
743
743
  ref: i,
744
744
  class: E(["q-list", { "q-list--disabled": e.disabled }, e.class]),
@@ -1078,7 +1078,7 @@ const Ot = ["role"], Ut = {
1078
1078
  return;
1079
1079
  ae(e.anchor) ? (k(), J = window.setTimeout(f, 100)) : L();
1080
1080
  }
1081
- function b() {
1081
+ function y() {
1082
1082
  W(), e.spy && f(), e.anchor && document.addEventListener("scroll", L);
1083
1083
  }
1084
1084
  function $() {
@@ -1093,7 +1093,7 @@ const Ot = ["role"], Ut = {
1093
1093
  }), P(
1094
1094
  a,
1095
1095
  (l) => {
1096
- l ? b() : $();
1096
+ l ? y() : $();
1097
1097
  },
1098
1098
  { immediate: !0 }
1099
1099
  ), (l, h) => (u(), V(Ge, {
@@ -1351,20 +1351,20 @@ const Ot = ["role"], Ut = {
1351
1351
  const F = w(() => o.clearable && !o.readonly && !o.disabled), D = w(() => {
1352
1352
  var s;
1353
1353
  return o.filterMode === "manual" || !G.value ? o.items : (s = o.items) == null ? void 0 : s.filter(
1354
- (y) => y[o.itemLabel].toLowerCase().startsWith(i.value.toLowerCase())
1354
+ (b) => b[o.itemLabel].toLowerCase().startsWith(i.value.toLowerCase())
1355
1355
  );
1356
1356
  }), z = w(() => {
1357
1357
  var s;
1358
- return (s = o.items) == null ? void 0 : s.find((y) => y[o.itemValue] === r.value);
1358
+ return (s = o.items) == null ? void 0 : s.find((b) => b[o.itemValue] === r.value);
1359
1359
  }), L = w(() => z.value === void 0), K = w(() => {
1360
1360
  const s = c.value;
1361
1361
  if (s !== void 0 && D.value[s])
1362
1362
  return D.value[s];
1363
1363
  }), le = w(() => {
1364
- var y;
1364
+ var b;
1365
1365
  if (c.value === void 0)
1366
1366
  return;
1367
- const s = (y = k.value) == null ? void 0 : y.getItem(c.value);
1367
+ const s = (b = k.value) == null ? void 0 : b.getItem(c.value);
1368
1368
  return s == null ? void 0 : s.id;
1369
1369
  }), G = w(() => {
1370
1370
  var s;
@@ -1374,8 +1374,9 @@ const Ot = ["role"], Ut = {
1374
1374
  r.value = s, R();
1375
1375
  }
1376
1376
  function M() {
1377
- var s;
1378
- i.value = ((s = z.value) == null ? void 0 : s[o.itemLabel]) || "";
1377
+ var b;
1378
+ const s = ((b = z.value) == null ? void 0 : b[o.itemLabel]) || "";
1379
+ i.value !== s && (i.value = s);
1379
1380
  }
1380
1381
  function W() {
1381
1382
  d.value || o.readonly || o.disabled || (a("before-show"), d.value = !0, ee());
@@ -1395,8 +1396,8 @@ const Ot = ["role"], Ut = {
1395
1396
  s !== -1 && U(() => Ie(s));
1396
1397
  }
1397
1398
  }
1398
- function b(s) {
1399
- var y, x;
1399
+ function y(s) {
1400
+ var b, x;
1400
1401
  if (!(!s.key || o.readonly || o.disabled))
1401
1402
  if (["ArrowDown", "ArrowUp", "Home", "End"].includes(s.key) && (s.preventDefault(), s.stopPropagation()), s.key === "Escape")
1402
1403
  M(), d.value && R();
@@ -1416,12 +1417,12 @@ const Ot = ["role"], Ut = {
1416
1417
  return;
1417
1418
  C(K.value[o.itemValue]);
1418
1419
  } else
1419
- s.key === "Home" ? c.value = (y = k.value) == null ? void 0 : y.getFirstFocusableItemIndex() : s.key === "End" ? c.value = (x = k.value) == null ? void 0 : x.getLastFocusableItemIndex() : (/^[a-z]$/i.test(s.key) || s.key === "Backspace") && W();
1420
+ s.key === "Home" ? c.value = (b = k.value) == null ? void 0 : b.getFirstFocusableItemIndex() : s.key === "End" ? c.value = (x = k.value) == null ? void 0 : x.getLastFocusableItemIndex() : (/^[a-z]$/i.test(s.key) || s.key === "Backspace") && W();
1420
1421
  }
1421
1422
  function $() {
1422
- var s, y;
1423
+ var s, b;
1423
1424
  if (L.value)
1424
- c.value = (y = k.value) == null ? void 0 : y.getFirstFocusableItemIndex();
1425
+ c.value = (b = k.value) == null ? void 0 : b.getFirstFocusableItemIndex();
1425
1426
  else {
1426
1427
  const x = D.value.findIndex(
1427
1428
  (Q) => Q[o.itemValue] === r.value
@@ -1433,17 +1434,17 @@ const Ot = ["role"], Ut = {
1433
1434
  var s;
1434
1435
  c.value = (s = k.value) == null ? void 0 : s.getLastFocusableItemIndex();
1435
1436
  }
1436
- function h(s, y) {
1437
+ function h(s, b) {
1437
1438
  var x;
1438
- c.value = (x = k.value) == null ? void 0 : x.getAdjacentItemIndex(s, y);
1439
+ c.value = (x = k.value) == null ? void 0 : x.getAdjacentItemIndex(s, b);
1439
1440
  }
1440
1441
  function O(s) {
1441
- var y, x, Q;
1442
- !((y = g.value) != null && y.contains(s.relatedTarget)) && !((Q = (x = q.value) == null ? void 0 : x.fieldRef) != null && Q.contains(s.relatedTarget)) ? (R(), F.value && !i.value && (r.value = o.emptyValue), M()) : (s.preventDefault(), s.stopPropagation());
1442
+ var b, x, Q;
1443
+ !((b = g.value) != null && b.contains(s.relatedTarget)) && !((Q = (x = q.value) == null ? void 0 : x.fieldRef) != null && Q.contains(s.relatedTarget)) ? (R(), F.value && !i.value && (r.value = o.emptyValue), M()) : (s.preventDefault(), s.stopPropagation());
1443
1444
  }
1444
1445
  function ee() {
1445
- var s, y;
1446
- (y = (s = q.value) == null ? void 0 : s.inputRef) == null || y.focus();
1446
+ var s, b;
1447
+ (b = (s = q.value) == null ? void 0 : s.inputRef) == null || b.focus();
1447
1448
  }
1448
1449
  function j() {
1449
1450
  ee();
@@ -1456,14 +1457,14 @@ const Ot = ["role"], Ut = {
1456
1457
  }
1457
1458
  function Ie(s) {
1458
1459
  var x;
1459
- const y = (x = k.value) == null ? void 0 : x.getItem(s);
1460
- y == null || y.scrollIntoView({ block: "nearest", inline: "start" });
1460
+ const b = (x = k.value) == null ? void 0 : x.getItem(s);
1461
+ b == null || b.scrollIntoView({ block: "nearest", inline: "start" });
1461
1462
  }
1462
1463
  return P(r, M), P(
1463
1464
  () => o.items,
1464
- (s, y) => {
1465
+ (s, b) => {
1465
1466
  if (!L.value) {
1466
- const x = y.find((Q) => Q[o.itemValue] === r.value);
1467
+ const x = b.find((Q) => Q[o.itemValue] === r.value);
1467
1468
  i.value === (x == null ? void 0 : x[o.itemLabel]) && M();
1468
1469
  }
1469
1470
  },
@@ -1479,12 +1480,12 @@ const Ot = ["role"], Ut = {
1479
1480
  }
1480
1481
  ), n({
1481
1482
  triggerEl: q
1482
- }), (s, y) => {
1483
+ }), (s, b) => {
1483
1484
  var x;
1484
1485
  return u(), p(ne, null, [
1485
1486
  A(v(Jt), {
1486
1487
  modelValue: i.value,
1487
- "onUpdate:modelValue": y[0] || (y[0] = (Q) => i.value = Q),
1488
+ "onUpdate:modelValue": b[0] || (b[0] = (Q) => i.value = Q),
1488
1489
  id: o.id,
1489
1490
  label: o.label,
1490
1491
  required: o.required,
@@ -1511,7 +1512,7 @@ const Ot = ["role"], Ut = {
1511
1512
  size: o.size,
1512
1513
  onClick: f,
1513
1514
  onFocusout: O,
1514
- onKeydown: de(b, ["stop"])
1515
+ onKeydown: de(y, ["stop"])
1515
1516
  }, _e({
1516
1517
  "label.prepend": _(() => [
1517
1518
  m(s.$slots, "label.prepend")
@@ -1568,7 +1569,7 @@ const Ot = ["role"], Ut = {
1568
1569
  ]), 1032, ["modelValue", "id", "label", "required", "placeholder", "class", "readonly", "disabled", "aria-expanded", "aria-activedescendant", "size"]),
1569
1570
  A(v(he), {
1570
1571
  modelValue: d.value,
1571
- "onUpdate:modelValue": y[2] || (y[2] = (Q) => d.value = Q),
1572
+ "onUpdate:modelValue": b[2] || (b[2] = (Q) => d.value = Q),
1572
1573
  spy: "",
1573
1574
  trigger: "manual",
1574
1575
  placement: "bottom",
@@ -1597,7 +1598,7 @@ const Ot = ["role"], Ut = {
1597
1598
  class: "q-select__items",
1598
1599
  modelValue: r.value,
1599
1600
  "onUpdate:modelValue": [
1600
- y[1] || (y[1] = (be) => r.value = be),
1601
+ b[1] || (b[1] = (be) => r.value = be),
1601
1602
  C
1602
1603
  ],
1603
1604
  highlighted: (Q = K.value) == null ? void 0 : Q[o.itemValue],
@@ -1826,7 +1827,7 @@ const Ot = ["role"], Ut = {
1826
1827
  }
1827
1828
  function Z() {
1828
1829
  var l;
1829
- e.loading ? (l = q.value) == null || l.focus() : b(), o("show");
1830
+ e.loading ? (l = q.value) == null || l.focus() : y(), o("show");
1830
1831
  }
1831
1832
  function J() {
1832
1833
  f(), o("hide");
@@ -1835,7 +1836,7 @@ const Ot = ["role"], Ut = {
1835
1836
  var l, h;
1836
1837
  (h = (l = i.value) == null ? void 0 : l.fieldRef) == null || h.focus();
1837
1838
  }
1838
- function b() {
1839
+ function y() {
1839
1840
  var l;
1840
1841
  (l = c.value) == null || l.$el.focus();
1841
1842
  }
@@ -1846,7 +1847,7 @@ const Ot = ["role"], Ut = {
1846
1847
  return P(
1847
1848
  () => e.loading,
1848
1849
  (l) => {
1849
- !l && r.value && U(b);
1850
+ !l && r.value && U(y);
1850
1851
  }
1851
1852
  ), (l, h) => {
1852
1853
  var O, ee;