@quidgest/ui 0.6.1 → 0.6.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/dist/ui.esm.js +56 -57
- 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 +1 -1
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurrentInstance as be, computed as
|
|
1
|
+
import { getCurrentInstance as be, computed as v, ref as B, provide as De, inject as ge, watch as I, defineComponent as w, openBlock as r, createElementBlock as f, normalizeStyle as Y, createElementVNode as V, normalizeClass as Q, withModifiers as K, createVNode as J, unref as b, createCommentVNode as g, Fragment as F, createTextVNode as P, toDisplayString as C, renderSlot as q, toRef as oe, createBlock as k, withCtx as D, renderList as le, mergeProps as G, resolveDynamicComponent as _e, h as ue, normalizeProps as ke, reactive as Ee, onBeforeUnmount as Ie, onMounted as Ve, Teleport as Ce, Transition as ze, nextTick as se, useAttrs as Ae, createSlots as Qe, guardReactiveProps as Fe, withDirectives as Oe, vModelText as Re } from "vue";
|
|
2
2
|
function re(t) {
|
|
3
3
|
return t == null ? !0 : typeof t == "string" || Array.isArray(t) ? t.length === 0 : typeof t == "object" ? Object.keys(t).length === 0 : !1;
|
|
4
4
|
}
|
|
@@ -31,7 +31,7 @@ function Me() {
|
|
|
31
31
|
if (!n)
|
|
32
32
|
throw new Error("[Quidgest UI] Could not determine component name");
|
|
33
33
|
const e = $e();
|
|
34
|
-
return
|
|
34
|
+
return v(() => {
|
|
35
35
|
var o;
|
|
36
36
|
return (o = e.value) == null ? void 0 : o[n];
|
|
37
37
|
});
|
|
@@ -39,7 +39,7 @@ function Me() {
|
|
|
39
39
|
function He(t) {
|
|
40
40
|
if (re(t))
|
|
41
41
|
return;
|
|
42
|
-
const n = $e(), e = B(t), o =
|
|
42
|
+
const n = $e(), e = B(t), o = v(() => re(e.value) ? n.value : we(n.value, e.value));
|
|
43
43
|
De(ie, o);
|
|
44
44
|
}
|
|
45
45
|
function $e() {
|
|
@@ -287,7 +287,7 @@ const Xe = /* @__PURE__ */ V("svg", { viewBox: "25 25 50 50" }, [
|
|
|
287
287
|
size: { default: 48 }
|
|
288
288
|
},
|
|
289
289
|
setup(t) {
|
|
290
|
-
const n = t, e =
|
|
290
|
+
const n = t, e = v(() => ({
|
|
291
291
|
"font-size": n.size !== 48 ? `${n.size}px` : void 0
|
|
292
292
|
}));
|
|
293
293
|
return (o, a) => (r(), f("div", {
|
|
@@ -338,12 +338,12 @@ const Be = $(je), Pe = ["disabled", "onClick"], et = {
|
|
|
338
338
|
},
|
|
339
339
|
emits: ["click"],
|
|
340
340
|
setup(t, { emit: n }) {
|
|
341
|
-
const e = t, o =
|
|
341
|
+
const e = t, o = v(() => e.disabled || e.loading);
|
|
342
342
|
function a(s) {
|
|
343
343
|
o.value || n("click", s);
|
|
344
344
|
}
|
|
345
|
-
const l =
|
|
346
|
-
const s =
|
|
345
|
+
const l = v(() => {
|
|
346
|
+
const s = v(() => e.bStyle ? `q-btn--${e.bStyle}` : void 0), d = v(() => e.size !== "regular" ? `q-btn--${e.size}` : void 0);
|
|
347
347
|
return [
|
|
348
348
|
"q-btn",
|
|
349
349
|
s.value,
|
|
@@ -395,7 +395,7 @@ const Be = $(je), Pe = ["disabled", "onClick"], et = {
|
|
|
395
395
|
elevated: !1
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
|
-
const e =
|
|
398
|
+
const e = v(() => [
|
|
399
399
|
"q-btn-group",
|
|
400
400
|
{
|
|
401
401
|
"q-btn-group--elevated": n.elevated
|
|
@@ -424,7 +424,7 @@ const Be = $(je), Pe = ["disabled", "onClick"], et = {
|
|
|
424
424
|
() => e.modelValue,
|
|
425
425
|
(s) => o.value = s
|
|
426
426
|
);
|
|
427
|
-
const a =
|
|
427
|
+
const a = v({
|
|
428
428
|
get() {
|
|
429
429
|
return o.value;
|
|
430
430
|
},
|
|
@@ -483,7 +483,7 @@ const it = ["for", "data-val-required"], dt = ["id"], ct = { class: "q-field__co
|
|
|
483
483
|
required: { type: Boolean, default: !1 }
|
|
484
484
|
},
|
|
485
485
|
setup(t, { expose: n }) {
|
|
486
|
-
const e = t, o = B(null), a =
|
|
486
|
+
const e = t, o = B(null), a = v(() => e.required && !e.readonly && !e.disabled);
|
|
487
487
|
return n({
|
|
488
488
|
fieldRef: o
|
|
489
489
|
}), (l, s) => (r(), f(F, null, [
|
|
@@ -527,7 +527,7 @@ const it = ["for", "data-val-required"], dt = ["id"], ct = { class: "q-field__co
|
|
|
527
527
|
size: { default: void 0 }
|
|
528
528
|
},
|
|
529
529
|
setup(t) {
|
|
530
|
-
const n = t, e =
|
|
530
|
+
const n = t, e = v(() => {
|
|
531
531
|
switch (n.type) {
|
|
532
532
|
case "svg":
|
|
533
533
|
return qt;
|
|
@@ -545,7 +545,7 @@ const it = ["for", "data-val-required"], dt = ["id"], ct = { class: "q-field__co
|
|
|
545
545
|
size: n.size
|
|
546
546
|
}, null, 8, ["icon", "size"])) : g("", !0);
|
|
547
547
|
}
|
|
548
|
-
}),
|
|
548
|
+
}), vt = /* @__PURE__ */ w({
|
|
549
549
|
__name: "QIconFont",
|
|
550
550
|
props: {
|
|
551
551
|
icon: {},
|
|
@@ -554,7 +554,7 @@ const it = ["for", "data-val-required"], dt = ["id"], ct = { class: "q-field__co
|
|
|
554
554
|
size: { default: void 0 }
|
|
555
555
|
},
|
|
556
556
|
setup(t) {
|
|
557
|
-
const n = t, e =
|
|
557
|
+
const n = t, e = v(() => n.variant ? `${n.library}-${n.variant}` : n.library), o = v(() => n.library && n.icon ? `${n.library}-${n.icon}` : n.icon), a = v(() => ({
|
|
558
558
|
"font-size": n.size !== void 0 ? `${n.size}px` : void 0
|
|
559
559
|
}));
|
|
560
560
|
return (l, s) => o.value ? (r(), f("i", {
|
|
@@ -563,14 +563,14 @@ const it = ["for", "data-val-required"], dt = ["id"], ct = { class: "q-field__co
|
|
|
563
563
|
style: Y(a.value)
|
|
564
564
|
}, null, 6)) : g("", !0);
|
|
565
565
|
}
|
|
566
|
-
}),
|
|
566
|
+
}), yt = ["src"], bt = /* @__PURE__ */ w({
|
|
567
567
|
__name: "QIconImg",
|
|
568
568
|
props: {
|
|
569
569
|
icon: {},
|
|
570
570
|
size: {}
|
|
571
571
|
},
|
|
572
572
|
setup(t) {
|
|
573
|
-
const n = t, e =
|
|
573
|
+
const n = t, e = v(() => ({
|
|
574
574
|
"font-size": n.size !== void 0 ? `${n.size}px` : void 0
|
|
575
575
|
}));
|
|
576
576
|
return (o, a) => n.icon ? (r(), f("img", {
|
|
@@ -578,7 +578,7 @@ const it = ["for", "data-val-required"], dt = ["id"], ct = { class: "q-field__co
|
|
|
578
578
|
src: n.icon,
|
|
579
579
|
class: "q-icon q-icon__img",
|
|
580
580
|
style: Y(e.value)
|
|
581
|
-
}, null, 12,
|
|
581
|
+
}, null, 12, yt)) : g("", !0);
|
|
582
582
|
}
|
|
583
583
|
}), N = {}, gt = w({
|
|
584
584
|
name: "InlineSvg",
|
|
@@ -702,7 +702,7 @@ const wt = /* @__PURE__ */ w({
|
|
|
702
702
|
},
|
|
703
703
|
emits: ["loaded", "unloaded"],
|
|
704
704
|
setup(t, { emit: n }) {
|
|
705
|
-
const e = t, o =
|
|
705
|
+
const e = t, o = v(() => ({
|
|
706
706
|
"font-size": e.size !== void 0 ? `${e.size}px` : void 0
|
|
707
707
|
}));
|
|
708
708
|
return (a, l) => e.icon ? (r(), k(b(gt), {
|
|
@@ -715,7 +715,7 @@ const wt = /* @__PURE__ */ w({
|
|
|
715
715
|
onUnloaded: l[1] || (l[1] = (s) => n("unloaded", s))
|
|
716
716
|
}, null, 8, ["src", "symbol", "style"])) : g("", !0);
|
|
717
717
|
}
|
|
718
|
-
}), W = $(ht), $t = $(
|
|
718
|
+
}), W = $(ht), $t = $(vt), St = $(bt), qt = $(wt), xt = (t, n) => {
|
|
719
719
|
const e = t.__vccOpts || t;
|
|
720
720
|
for (const [o, a] of n)
|
|
721
721
|
e[o] = a;
|
|
@@ -736,7 +736,7 @@ const Dt = /* @__PURE__ */ xt(Bt, [["render", Tt]]), mn = $(Dt), Et = /* @__PURE
|
|
|
736
736
|
},
|
|
737
737
|
emits: ["update:modelValue"],
|
|
738
738
|
setup(t, { expose: n, emit: e }) {
|
|
739
|
-
const o = t, a = B(o.modelValue), l =
|
|
739
|
+
const o = t, a = B(o.modelValue), l = v(() => s.value.length > 1 ? "div" : "ul"), s = v(() => o.groups.length ? o.groups : [{ title: "" }]), d = B(null);
|
|
740
740
|
function i(u) {
|
|
741
741
|
a.value = u, e("update:modelValue", u);
|
|
742
742
|
}
|
|
@@ -775,20 +775,20 @@ const Dt = /* @__PURE__ */ xt(Bt, [["render", Tt]]), mn = $(Dt), Et = /* @__PURE
|
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
function E(u) {
|
|
778
|
-
var
|
|
779
|
-
(
|
|
778
|
+
var y;
|
|
779
|
+
(y = A().at(u)) == null || y.focus();
|
|
780
780
|
}
|
|
781
781
|
function A() {
|
|
782
|
-
var
|
|
783
|
-
const u = (
|
|
782
|
+
var y;
|
|
783
|
+
const u = (y = d.value) == null ? void 0 : y.querySelectorAll("li");
|
|
784
784
|
return u ? Array.from(u).filter((L) => L.tabIndex !== -1) : [];
|
|
785
785
|
}
|
|
786
786
|
function O(u) {
|
|
787
787
|
return u.indexOf(document.activeElement);
|
|
788
788
|
}
|
|
789
789
|
function z(u) {
|
|
790
|
-
const x = A(),
|
|
791
|
-
return u === "next" ?
|
|
790
|
+
const x = A(), y = O(x);
|
|
791
|
+
return u === "next" ? y === x.length - 1 ? y : y + 1 : y === 0 ? 0 : y - 1;
|
|
792
792
|
}
|
|
793
793
|
function M(u) {
|
|
794
794
|
return u ? o.items.filter((x) => x.group === u) : o.items;
|
|
@@ -808,13 +808,13 @@ const Dt = /* @__PURE__ */ xt(Bt, [["render", Tt]]), mn = $(Dt), Et = /* @__PURE
|
|
|
808
808
|
onKeydown: S
|
|
809
809
|
}, {
|
|
810
810
|
default: D(() => [
|
|
811
|
-
(r(!0), f(F, null, le(s.value, (
|
|
812
|
-
key:
|
|
813
|
-
title:
|
|
814
|
-
disabled:
|
|
811
|
+
(r(!0), f(F, null, le(s.value, (y) => (r(), k(b(Mt), {
|
|
812
|
+
key: y.id,
|
|
813
|
+
title: y.title,
|
|
814
|
+
disabled: y.disabled
|
|
815
815
|
}, {
|
|
816
816
|
default: D(() => [
|
|
817
|
-
(r(!0), f(F, null, le(M(
|
|
817
|
+
(r(!0), f(F, null, le(M(y.id), (L) => (r(), k(b(Rt), {
|
|
818
818
|
key: L[o.itemValue],
|
|
819
819
|
value: L[o.itemValue],
|
|
820
820
|
label: L[o.itemLabel],
|
|
@@ -885,11 +885,10 @@ const Dt = /* @__PURE__ */ xt(Bt, [["render", Tt]]), mn = $(Dt), Et = /* @__PURE
|
|
|
885
885
|
},
|
|
886
886
|
setup(t) {
|
|
887
887
|
const n = t, e = te();
|
|
888
|
-
return (o, a) =>
|
|
889
|
-
key: 1,
|
|
888
|
+
return (o, a) => (r(), f("ul", {
|
|
890
889
|
class: "q-list-item-group",
|
|
891
890
|
role: "group",
|
|
892
|
-
"aria-labelledby": b(e)
|
|
891
|
+
"aria-labelledby": n.title ? b(e) : void 0
|
|
893
892
|
}, [
|
|
894
893
|
n.title ? (r(), f("li", {
|
|
895
894
|
key: 0,
|
|
@@ -898,7 +897,7 @@ const Dt = /* @__PURE__ */ xt(Bt, [["render", Tt]]), mn = $(Dt), Et = /* @__PURE
|
|
|
898
897
|
role: "presentation"
|
|
899
898
|
}, C(n.title), 9, Qt)) : g("", !0),
|
|
900
899
|
q(o.$slots, "default")
|
|
901
|
-
], 8, At))
|
|
900
|
+
], 8, At));
|
|
902
901
|
}
|
|
903
902
|
}), Ot = $(Et), Rt = $(zt), Mt = $(Ft);
|
|
904
903
|
function Ht(t, n, e = "right", o) {
|
|
@@ -926,24 +925,24 @@ function Te(t, n, e) {
|
|
|
926
925
|
let o = !1, a = !1;
|
|
927
926
|
switch (e) {
|
|
928
927
|
case "top":
|
|
929
|
-
o =
|
|
928
|
+
o = ye(t, n), a = t.top > n.height;
|
|
930
929
|
break;
|
|
931
930
|
case "bottom":
|
|
932
|
-
o =
|
|
931
|
+
o = ye(t, n), a = window.innerHeight - t.top - t.height > n.height;
|
|
933
932
|
break;
|
|
934
933
|
case "left":
|
|
935
|
-
o = t.left > n.width, a =
|
|
934
|
+
o = t.left > n.width, a = ve(t, n);
|
|
936
935
|
break;
|
|
937
936
|
case "right":
|
|
938
|
-
o = window.innerWidth - t.left - t.width > n.width, a =
|
|
937
|
+
o = window.innerWidth - t.left - t.width > n.width, a = ve(t, n);
|
|
939
938
|
break;
|
|
940
939
|
}
|
|
941
940
|
return o && a;
|
|
942
941
|
}
|
|
943
|
-
function
|
|
942
|
+
function ve(t, n) {
|
|
944
943
|
return window.innerHeight - t.top - t.height / 2 > n.height / 2 && t.top + t.height / 2 > n.height / 2;
|
|
945
944
|
}
|
|
946
|
-
function
|
|
945
|
+
function ye(t, n) {
|
|
947
946
|
return window.innerWidth - t.left - t.width / 2 > n.width / 2 && t.left + t.width / 2 > n.width / 2;
|
|
948
947
|
}
|
|
949
948
|
function Ut(t, n, e) {
|
|
@@ -985,7 +984,7 @@ const Nt = {
|
|
|
985
984
|
},
|
|
986
985
|
emits: ["enter", "leave"],
|
|
987
986
|
setup(t, { emit: n }) {
|
|
988
|
-
const e = t, o =
|
|
987
|
+
const e = t, o = v(() => [
|
|
989
988
|
"q-overlay",
|
|
990
989
|
`q-overlay--${a.placement}`,
|
|
991
990
|
{ "q-overlay--inverted": e.appearance === "inverted" },
|
|
@@ -997,7 +996,7 @@ const Nt = {
|
|
|
997
996
|
left: 0,
|
|
998
997
|
width: 0,
|
|
999
998
|
placement: e.placement
|
|
1000
|
-
}), l =
|
|
999
|
+
}), l = v(() => a.visible && !e.disabled);
|
|
1001
1000
|
I(
|
|
1002
1001
|
() => e.modelValue,
|
|
1003
1002
|
() => a.visible = e.modelValue
|
|
@@ -1005,7 +1004,7 @@ const Nt = {
|
|
|
1005
1004
|
() => a.visible,
|
|
1006
1005
|
() => a.animating = !0
|
|
1007
1006
|
);
|
|
1008
|
-
const s =
|
|
1007
|
+
const s = v(() => {
|
|
1009
1008
|
let h = 0, T = 0;
|
|
1010
1009
|
switch (a.placement) {
|
|
1011
1010
|
case "top":
|
|
@@ -1079,15 +1078,15 @@ const Nt = {
|
|
|
1079
1078
|
function x() {
|
|
1080
1079
|
window.removeEventListener("scroll", i), window.removeEventListener("resize", i), z == null || z.disconnect();
|
|
1081
1080
|
}
|
|
1082
|
-
let
|
|
1081
|
+
let y;
|
|
1083
1082
|
function L() {
|
|
1084
|
-
j(e.anchor) ? (i(),
|
|
1083
|
+
j(e.anchor) ? (i(), y = window.setTimeout(L, 100)) : m();
|
|
1085
1084
|
}
|
|
1086
1085
|
function ne() {
|
|
1087
1086
|
u(), e.spy && L();
|
|
1088
1087
|
}
|
|
1089
1088
|
function X() {
|
|
1090
|
-
x(), e.spy && (clearTimeout(
|
|
1089
|
+
x(), e.spy && (clearTimeout(y), y = void 0);
|
|
1091
1090
|
}
|
|
1092
1091
|
return Ie(X), Ve(i), I(
|
|
1093
1092
|
() => e.disabled,
|
|
@@ -1227,14 +1226,14 @@ const Jt = {
|
|
|
1227
1226
|
},
|
|
1228
1227
|
emits: ["update:modelValue", "before-show", "before-hide", "show", "hide"],
|
|
1229
1228
|
setup(t, { emit: n }) {
|
|
1230
|
-
const e = t, o = jt(), a = B(e.modelValue), l = B(!1), s = B(""), d = B(null), i = B(null), p = B(null), S =
|
|
1229
|
+
const e = t, o = jt(), a = B(e.modelValue), l = B(!1), s = B(""), d = B(null), i = B(null), p = B(null), S = v(
|
|
1231
1230
|
() => {
|
|
1232
1231
|
var c;
|
|
1233
1232
|
return (c = e.items) == null ? void 0 : c.find((_) => _[e.itemValue] === a.value);
|
|
1234
1233
|
}
|
|
1235
|
-
), m =
|
|
1234
|
+
), m = v(
|
|
1236
1235
|
() => S.value ? S.value[e.itemLabel] : ""
|
|
1237
|
-
), E =
|
|
1236
|
+
), E = v(
|
|
1238
1237
|
() => e.clearable && !e.readonly && !e.disabled && !e.loading
|
|
1239
1238
|
);
|
|
1240
1239
|
function A(c) {
|
|
@@ -1256,10 +1255,10 @@ const Jt = {
|
|
|
1256
1255
|
function x() {
|
|
1257
1256
|
l.value && (n("before-hide"), l.value = !1);
|
|
1258
1257
|
}
|
|
1259
|
-
let
|
|
1258
|
+
let y;
|
|
1260
1259
|
function L(c) {
|
|
1261
1260
|
if (!(!c.key || e.readonly || e.disabled)) {
|
|
1262
|
-
if (window.clearTimeout(
|
|
1261
|
+
if (window.clearTimeout(y), ["Enter", " ", "ArrowDown", "ArrowUp", "Home", "End"].includes(c.key) && (c.preventDefault(), c.stopPropagation()), ["Enter", " "].includes(c.key) && (l.value = !0), ["Escape", "Tab"].includes(c.key) && (l.value ? l.value = !1 : e.clearable && c.key === "Escape" && O()), c.key === "Delete" && e.clearable && O(), /^[a-z]$/i.test(c.key)) {
|
|
1263
1262
|
s.value += c.key.toLowerCase();
|
|
1264
1263
|
for (let _ = 0; _ < e.items.length; _++)
|
|
1265
1264
|
if (e.items[_][e.itemLabel].toLowerCase().startsWith(s.value)) {
|
|
@@ -1267,7 +1266,7 @@ const Jt = {
|
|
|
1267
1266
|
break;
|
|
1268
1267
|
}
|
|
1269
1268
|
}
|
|
1270
|
-
|
|
1269
|
+
y = window.setTimeout(function() {
|
|
1271
1270
|
s.value = "";
|
|
1272
1271
|
}, 500);
|
|
1273
1272
|
}
|
|
@@ -1401,7 +1400,7 @@ const Jt = {
|
|
|
1401
1400
|
], 64);
|
|
1402
1401
|
};
|
|
1403
1402
|
}
|
|
1404
|
-
}),
|
|
1403
|
+
}), vn = $(on), an = ["required", "placeholder", "readonly", "disabled", "maxlength"], ln = /* @__PURE__ */ w({
|
|
1405
1404
|
__name: "QTextField",
|
|
1406
1405
|
props: {
|
|
1407
1406
|
modelValue: { default: "" },
|
|
@@ -1416,7 +1415,7 @@ const Jt = {
|
|
|
1416
1415
|
},
|
|
1417
1416
|
emits: ["update:modelValue"],
|
|
1418
1417
|
setup(t, { emit: n }) {
|
|
1419
|
-
const e = t, o = B(e.modelValue), a =
|
|
1418
|
+
const e = t, o = B(e.modelValue), a = v({
|
|
1420
1419
|
get() {
|
|
1421
1420
|
return o.value;
|
|
1422
1421
|
},
|
|
@@ -1458,7 +1457,7 @@ const Jt = {
|
|
|
1458
1457
|
_: 1
|
|
1459
1458
|
}, 8, ["id", "label", "size", "readonly", "disabled", "required"]));
|
|
1460
1459
|
}
|
|
1461
|
-
}),
|
|
1460
|
+
}), yn = $(ln), sn = ["innerHTML"], rn = { key: 1 }, dn = /* @__PURE__ */ w({
|
|
1462
1461
|
inheritAttrs: !1,
|
|
1463
1462
|
__name: "QTooltip",
|
|
1464
1463
|
props: {
|
|
@@ -1523,9 +1522,9 @@ export {
|
|
|
1523
1522
|
Mt as QListItemGroup,
|
|
1524
1523
|
de as QOverlay,
|
|
1525
1524
|
hn as QPopover,
|
|
1526
|
-
|
|
1525
|
+
vn as QSelect,
|
|
1527
1526
|
Be as QSpinnerLoader,
|
|
1528
|
-
|
|
1527
|
+
yn as QTextField,
|
|
1529
1528
|
bn as QTooltip,
|
|
1530
1529
|
gn as clickOutside,
|
|
1531
1530
|
fn as createFramework,
|