@quidgest/ui 0.9.2 → 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 +55 -56
- package/dist/ui.esm.js.map +1 -1
- package/dist/ui.js +1 -1
- package/dist/ui.js.map +1 -1
- package/dist/ui.min.js +3 -2
- package/dist/ui.min.js.map +1 -1
- package/dist/ui.scss +1 -1
- package/package.json +1 -1
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
|
|
653
|
-
o.value ?
|
|
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(
|
|
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,
|
|
687
|
+
function z(f, y = !1) {
|
|
688
688
|
var l;
|
|
689
|
-
(l = L()[f]) == null || l.focus({ preventScroll:
|
|
689
|
+
(l = L()[f]) == null || l.focus({ preventScroll: y });
|
|
690
690
|
}
|
|
691
691
|
function L() {
|
|
692
|
-
var
|
|
693
|
-
const f = (
|
|
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(),
|
|
704
|
-
return
|
|
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(),
|
|
708
|
-
return
|
|
707
|
+
const f = L(), y = [...f].reverse().find(($) => Z($));
|
|
708
|
+
return y ? f.indexOf(y) : -1;
|
|
709
709
|
}
|
|
710
|
-
function M(f,
|
|
711
|
-
return
|
|
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
|
|
715
|
-
return R(
|
|
714
|
+
const y = le();
|
|
715
|
+
return R(y, f);
|
|
716
716
|
}
|
|
717
|
-
function R(f,
|
|
717
|
+
function R(f, y) {
|
|
718
718
|
const $ = L();
|
|
719
|
-
if (M(f,
|
|
719
|
+
if (M(f, y, $))
|
|
720
720
|
return f;
|
|
721
|
-
let l = f + (
|
|
721
|
+
let l = f + (y === "next" ? 1 : -1);
|
|
722
722
|
for (; !Z($[l]); ) {
|
|
723
|
-
if (M(l,
|
|
723
|
+
if (M(l, y, $))
|
|
724
724
|
return f;
|
|
725
|
-
l +=
|
|
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((
|
|
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,
|
|
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
|
|
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 ?
|
|
1096
|
+
l ? y() : $();
|
|
1097
1097
|
},
|
|
1098
1098
|
{ immediate: !0 }
|
|
1099
1099
|
), (l, h) => (u(), V(Ge, {
|
|
@@ -1347,26 +1347,24 @@ const Ot = ["role"], Ut = {
|
|
|
1347
1347
|
emits: /* @__PURE__ */ H(["before-show", "before-hide", "show", "hide"], ["update:modelValue", "update:open", "update:search"]),
|
|
1348
1348
|
setup(t, { expose: n, emit: e }) {
|
|
1349
1349
|
const o = t, a = e, r = X(t, "modelValue"), d = X(t, "open"), i = X(t, "search"), c = T(void 0), q = T(null), k = T(null), g = T(null);
|
|
1350
|
-
Ae(
|
|
1351
|
-
z.value && M();
|
|
1352
|
-
});
|
|
1350
|
+
Ae(M);
|
|
1353
1351
|
const F = w(() => o.clearable && !o.readonly && !o.disabled), D = w(() => {
|
|
1354
1352
|
var s;
|
|
1355
1353
|
return o.filterMode === "manual" || !G.value ? o.items : (s = o.items) == null ? void 0 : s.filter(
|
|
1356
|
-
(
|
|
1354
|
+
(b) => b[o.itemLabel].toLowerCase().startsWith(i.value.toLowerCase())
|
|
1357
1355
|
);
|
|
1358
1356
|
}), z = w(() => {
|
|
1359
1357
|
var s;
|
|
1360
|
-
return (s = o.items) == null ? void 0 : s.find((
|
|
1358
|
+
return (s = o.items) == null ? void 0 : s.find((b) => b[o.itemValue] === r.value);
|
|
1361
1359
|
}), L = w(() => z.value === void 0), K = w(() => {
|
|
1362
1360
|
const s = c.value;
|
|
1363
1361
|
if (s !== void 0 && D.value[s])
|
|
1364
1362
|
return D.value[s];
|
|
1365
1363
|
}), le = w(() => {
|
|
1366
|
-
var
|
|
1364
|
+
var b;
|
|
1367
1365
|
if (c.value === void 0)
|
|
1368
1366
|
return;
|
|
1369
|
-
const s = (
|
|
1367
|
+
const s = (b = k.value) == null ? void 0 : b.getItem(c.value);
|
|
1370
1368
|
return s == null ? void 0 : s.id;
|
|
1371
1369
|
}), G = w(() => {
|
|
1372
1370
|
var s;
|
|
@@ -1376,8 +1374,9 @@ const Ot = ["role"], Ut = {
|
|
|
1376
1374
|
r.value = s, R();
|
|
1377
1375
|
}
|
|
1378
1376
|
function M() {
|
|
1379
|
-
var
|
|
1380
|
-
|
|
1377
|
+
var b;
|
|
1378
|
+
const s = ((b = z.value) == null ? void 0 : b[o.itemLabel]) || "";
|
|
1379
|
+
i.value !== s && (i.value = s);
|
|
1381
1380
|
}
|
|
1382
1381
|
function W() {
|
|
1383
1382
|
d.value || o.readonly || o.disabled || (a("before-show"), d.value = !0, ee());
|
|
@@ -1397,8 +1396,8 @@ const Ot = ["role"], Ut = {
|
|
|
1397
1396
|
s !== -1 && U(() => Ie(s));
|
|
1398
1397
|
}
|
|
1399
1398
|
}
|
|
1400
|
-
function
|
|
1401
|
-
var
|
|
1399
|
+
function y(s) {
|
|
1400
|
+
var b, x;
|
|
1402
1401
|
if (!(!s.key || o.readonly || o.disabled))
|
|
1403
1402
|
if (["ArrowDown", "ArrowUp", "Home", "End"].includes(s.key) && (s.preventDefault(), s.stopPropagation()), s.key === "Escape")
|
|
1404
1403
|
M(), d.value && R();
|
|
@@ -1418,12 +1417,12 @@ const Ot = ["role"], Ut = {
|
|
|
1418
1417
|
return;
|
|
1419
1418
|
C(K.value[o.itemValue]);
|
|
1420
1419
|
} else
|
|
1421
|
-
s.key === "Home" ? c.value = (
|
|
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();
|
|
1422
1421
|
}
|
|
1423
1422
|
function $() {
|
|
1424
|
-
var s,
|
|
1423
|
+
var s, b;
|
|
1425
1424
|
if (L.value)
|
|
1426
|
-
c.value = (
|
|
1425
|
+
c.value = (b = k.value) == null ? void 0 : b.getFirstFocusableItemIndex();
|
|
1427
1426
|
else {
|
|
1428
1427
|
const x = D.value.findIndex(
|
|
1429
1428
|
(Q) => Q[o.itemValue] === r.value
|
|
@@ -1435,17 +1434,17 @@ const Ot = ["role"], Ut = {
|
|
|
1435
1434
|
var s;
|
|
1436
1435
|
c.value = (s = k.value) == null ? void 0 : s.getLastFocusableItemIndex();
|
|
1437
1436
|
}
|
|
1438
|
-
function h(s,
|
|
1437
|
+
function h(s, b) {
|
|
1439
1438
|
var x;
|
|
1440
|
-
c.value = (x = k.value) == null ? void 0 : x.getAdjacentItemIndex(s,
|
|
1439
|
+
c.value = (x = k.value) == null ? void 0 : x.getAdjacentItemIndex(s, b);
|
|
1441
1440
|
}
|
|
1442
1441
|
function O(s) {
|
|
1443
|
-
var
|
|
1444
|
-
!((
|
|
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());
|
|
1445
1444
|
}
|
|
1446
1445
|
function ee() {
|
|
1447
|
-
var s,
|
|
1448
|
-
(
|
|
1446
|
+
var s, b;
|
|
1447
|
+
(b = (s = q.value) == null ? void 0 : s.inputRef) == null || b.focus();
|
|
1449
1448
|
}
|
|
1450
1449
|
function j() {
|
|
1451
1450
|
ee();
|
|
@@ -1458,14 +1457,14 @@ const Ot = ["role"], Ut = {
|
|
|
1458
1457
|
}
|
|
1459
1458
|
function Ie(s) {
|
|
1460
1459
|
var x;
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1460
|
+
const b = (x = k.value) == null ? void 0 : x.getItem(s);
|
|
1461
|
+
b == null || b.scrollIntoView({ block: "nearest", inline: "start" });
|
|
1463
1462
|
}
|
|
1464
1463
|
return P(r, M), P(
|
|
1465
1464
|
() => o.items,
|
|
1466
|
-
(s,
|
|
1465
|
+
(s, b) => {
|
|
1467
1466
|
if (!L.value) {
|
|
1468
|
-
const x =
|
|
1467
|
+
const x = b.find((Q) => Q[o.itemValue] === r.value);
|
|
1469
1468
|
i.value === (x == null ? void 0 : x[o.itemLabel]) && M();
|
|
1470
1469
|
}
|
|
1471
1470
|
},
|
|
@@ -1481,12 +1480,12 @@ const Ot = ["role"], Ut = {
|
|
|
1481
1480
|
}
|
|
1482
1481
|
), n({
|
|
1483
1482
|
triggerEl: q
|
|
1484
|
-
}), (s,
|
|
1483
|
+
}), (s, b) => {
|
|
1485
1484
|
var x;
|
|
1486
1485
|
return u(), p(ne, null, [
|
|
1487
1486
|
A(v(Jt), {
|
|
1488
1487
|
modelValue: i.value,
|
|
1489
|
-
"onUpdate:modelValue":
|
|
1488
|
+
"onUpdate:modelValue": b[0] || (b[0] = (Q) => i.value = Q),
|
|
1490
1489
|
id: o.id,
|
|
1491
1490
|
label: o.label,
|
|
1492
1491
|
required: o.required,
|
|
@@ -1513,7 +1512,7 @@ const Ot = ["role"], Ut = {
|
|
|
1513
1512
|
size: o.size,
|
|
1514
1513
|
onClick: f,
|
|
1515
1514
|
onFocusout: O,
|
|
1516
|
-
onKeydown: de(
|
|
1515
|
+
onKeydown: de(y, ["stop"])
|
|
1517
1516
|
}, _e({
|
|
1518
1517
|
"label.prepend": _(() => [
|
|
1519
1518
|
m(s.$slots, "label.prepend")
|
|
@@ -1570,7 +1569,7 @@ const Ot = ["role"], Ut = {
|
|
|
1570
1569
|
]), 1032, ["modelValue", "id", "label", "required", "placeholder", "class", "readonly", "disabled", "aria-expanded", "aria-activedescendant", "size"]),
|
|
1571
1570
|
A(v(he), {
|
|
1572
1571
|
modelValue: d.value,
|
|
1573
|
-
"onUpdate:modelValue":
|
|
1572
|
+
"onUpdate:modelValue": b[2] || (b[2] = (Q) => d.value = Q),
|
|
1574
1573
|
spy: "",
|
|
1575
1574
|
trigger: "manual",
|
|
1576
1575
|
placement: "bottom",
|
|
@@ -1599,7 +1598,7 @@ const Ot = ["role"], Ut = {
|
|
|
1599
1598
|
class: "q-select__items",
|
|
1600
1599
|
modelValue: r.value,
|
|
1601
1600
|
"onUpdate:modelValue": [
|
|
1602
|
-
|
|
1601
|
+
b[1] || (b[1] = (be) => r.value = be),
|
|
1603
1602
|
C
|
|
1604
1603
|
],
|
|
1605
1604
|
highlighted: (Q = K.value) == null ? void 0 : Q[o.itemValue],
|
|
@@ -1828,7 +1827,7 @@ const Ot = ["role"], Ut = {
|
|
|
1828
1827
|
}
|
|
1829
1828
|
function Z() {
|
|
1830
1829
|
var l;
|
|
1831
|
-
e.loading ? (l = q.value) == null || l.focus() :
|
|
1830
|
+
e.loading ? (l = q.value) == null || l.focus() : y(), o("show");
|
|
1832
1831
|
}
|
|
1833
1832
|
function J() {
|
|
1834
1833
|
f(), o("hide");
|
|
@@ -1837,7 +1836,7 @@ const Ot = ["role"], Ut = {
|
|
|
1837
1836
|
var l, h;
|
|
1838
1837
|
(h = (l = i.value) == null ? void 0 : l.fieldRef) == null || h.focus();
|
|
1839
1838
|
}
|
|
1840
|
-
function
|
|
1839
|
+
function y() {
|
|
1841
1840
|
var l;
|
|
1842
1841
|
(l = c.value) == null || l.$el.focus();
|
|
1843
1842
|
}
|
|
@@ -1848,7 +1847,7 @@ const Ot = ["role"], Ut = {
|
|
|
1848
1847
|
return P(
|
|
1849
1848
|
() => e.loading,
|
|
1850
1849
|
(l) => {
|
|
1851
|
-
!l && r.value && U(
|
|
1850
|
+
!l && r.value && U(y);
|
|
1852
1851
|
}
|
|
1853
1852
|
), (l, h) => {
|
|
1854
1853
|
var O, ee;
|