@quidgest/ui 0.8.5 → 0.8.6

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
@@ -1,4 +1,4 @@
1
- import { getCurrentInstance as xe, computed as _, ref as q, provide as Ve, inject as Ee, watch as F, defineComponent as L, openBlock as c, createElementBlock as v, normalizeClass as E, normalizeStyle as ce, createElementVNode as Y, withModifiers as ie, createVNode as z, unref as b, createCommentVNode as I, Fragment as ee, createTextVNode as re, toDisplayString as G, renderSlot as h, toRef as we, createBlock as V, withCtx as g, renderList as me, resolveDynamicComponent as De, h as $e, normalizeProps as te, mergeProps as ne, reactive as Ne, onBeforeUnmount as Me, onMounted as Te, nextTick as X, Teleport as He, Transition as Ke, withKeys as Ge, createSlots as he, withDirectives as We, vModelDynamic as je, guardReactiveProps as oe } from "vue";
1
+ import { getCurrentInstance as Be, computed as _, ref as q, provide as Ve, inject as Ee, watch as F, defineComponent as L, openBlock as c, createElementBlock as v, normalizeClass as E, normalizeStyle as ce, createElementVNode as Y, withModifiers as ie, createVNode as z, unref as b, createCommentVNode as I, Fragment as ee, createTextVNode as re, toDisplayString as G, renderSlot as h, toRef as we, createBlock as V, withCtx as g, renderList as me, resolveDynamicComponent as De, h as $e, normalizeProps as te, mergeProps as ne, reactive as Ne, onBeforeUnmount as Me, onMounted as Te, nextTick as X, Teleport as He, Transition as Ke, withKeys as Ge, createSlots as he, withDirectives as We, vModelDynamic as je, guardReactiveProps as oe } from "vue";
2
2
  function ve(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
  }
@@ -25,7 +25,7 @@ function be(t = {}, l = {}) {
25
25
  const ye = "q-defaults";
26
26
  function Pe() {
27
27
  var d, s;
28
- const t = xe();
28
+ const t = Be();
29
29
  if (!t)
30
30
  throw new Error("[Quidgest UI] useDefaults must be called from inside a setup function");
31
31
  const l = t.type.name ?? t.type.__name;
@@ -241,13 +241,13 @@ function it(t, l) {
241
241
  const o = Ae(l);
242
242
  return o ? typeof ((e = t.props) == null ? void 0 : e[o]) < "u" : !1;
243
243
  }
244
- function B(t) {
244
+ function x(t) {
245
245
  const l = t.setup;
246
246
  return l && (t.setup = (o, e) => {
247
247
  const n = Pe();
248
248
  if (ve(n.value))
249
249
  return l(o, e);
250
- const d = xe();
250
+ const d = Be();
251
251
  if (d === null)
252
252
  return l(o, e);
253
253
  const s = new Proxy(o, {
@@ -260,7 +260,7 @@ function B(t) {
260
260
  return l(s, e);
261
261
  }), t;
262
262
  }
263
- const ge = B(st), rt = ["disabled"], dt = {
263
+ const ge = x(st), rt = ["disabled"], dt = {
264
264
  key: 0,
265
265
  class: "q-btn__spinner"
266
266
  }, ut = { class: "q-btn__content" }, ct = /* @__PURE__ */ L({
@@ -320,7 +320,7 @@ const ge = B(st), rt = ["disabled"], dt = {
320
320
  ])
321
321
  ], 10, rt));
322
322
  }
323
- }), ue = B(ct), ft = /* @__PURE__ */ L({
323
+ }), ue = x(ct), ft = /* @__PURE__ */ L({
324
324
  __name: "QButtonGroup",
325
325
  props: {
326
326
  disabled: { type: Boolean },
@@ -349,7 +349,7 @@ const ge = B(st), rt = ["disabled"], dt = {
349
349
  h(o.$slots, "default")
350
350
  ], 2));
351
351
  }
352
- }), pt = B(ft), mt = /* @__PURE__ */ L({
352
+ }), pt = x(ft), mt = /* @__PURE__ */ L({
353
353
  __name: "QButtonToggle",
354
354
  props: {
355
355
  modelValue: {},
@@ -402,7 +402,7 @@ const ge = B(st), rt = ["disabled"], dt = {
402
402
  _: 3
403
403
  }, 8, ["class", "disabled", "borderless", "elevated"]));
404
404
  }
405
- }), Sl = B(mt), vt = /* @__PURE__ */ L({
405
+ }), Sl = x(mt), vt = /* @__PURE__ */ L({
406
406
  __name: "QIcon",
407
407
  props: {
408
408
  icon: {},
@@ -466,7 +466,11 @@ const ge = B(st), rt = ["disabled"], dt = {
466
466
  }
467
467
  }), se = {}, gt = L({
468
468
  name: "InlineSvg",
469
- emits: ["loaded", "unloaded", "error"],
469
+ emits: {
470
+ loaded: (t) => typeof t == "object",
471
+ unloaded: () => !0,
472
+ error: (t) => typeof t == "object"
473
+ },
470
474
  inheritAttrs: !1,
471
475
  render() {
472
476
  if (!this.svgElSource)
@@ -478,22 +482,39 @@ const ge = B(st), rt = ["disabled"], dt = {
478
482
  return this.copySvgAttrs(l, this.svgElSource), this.copySvgAttrs(l, t), this.copyComponentAttrs(l, this.$attrs), l.innerHTML = t.innerHTML, $e("svg", l);
479
483
  },
480
484
  props: {
485
+ /**
486
+ * The source URL of the SVG bundle.
487
+ */
481
488
  src: {
482
489
  type: String,
483
490
  required: !0
484
491
  },
492
+ /**
493
+ * The ID of the SVG symbol to be rendered.
494
+ */
485
495
  symbol: {
486
496
  type: String,
487
497
  default: ""
488
498
  },
499
+ /**
500
+ * The title to be associated with the SVG.
501
+ */
489
502
  title: {
490
503
  type: String,
491
504
  default: ""
492
505
  },
506
+ /**
507
+ * A function to transform the source SVG element before rendering.
508
+ * If not provided, no transformation will be applied.
509
+ */
493
510
  transformSource: {
494
511
  type: Function,
495
512
  default: void 0
496
513
  },
514
+ /**
515
+ * Determines whether to keep the existing SVG content visible during the loading of a new SVG.
516
+ * Set to `false` to hide content during loading.
517
+ */
497
518
  keepDuringLoading: {
498
519
  type: Boolean,
499
520
  default: !0
@@ -554,7 +575,8 @@ const ge = B(st), rt = ["disabled"], dt = {
554
575
  src(t) {
555
576
  this.getSource(t);
556
577
  }
557
- }
578
+ },
579
+ expose: []
558
580
  });
559
581
  function _t(t, l) {
560
582
  const o = t.getElementsByTagName("title");
@@ -605,7 +627,7 @@ const wt = /* @__PURE__ */ L({
605
627
  onUnloaded: s
606
628
  }, null, 8, ["class", "src", "symbol", "style"]));
607
629
  }
608
- }), J = B(vt), $t = B(ht), qt = B(yt), It = B(wt), Lt = /* @__PURE__ */ L({
630
+ }), J = x(vt), $t = x(ht), qt = x(yt), It = x(wt), Lt = /* @__PURE__ */ L({
609
631
  __name: "QList",
610
632
  props: {
611
633
  modelValue: { type: [String, Number, Boolean, Symbol], default: void 0 },
@@ -638,7 +660,7 @@ const wt = /* @__PURE__ */ L({
638
660
  const m = s.value;
639
661
  Q(a, m);
640
662
  }
641
- function x(i) {
663
+ function B(i) {
642
664
  switch (["ArrowDown", "ArrowUp", "Home", "End"].includes(i.key) && i.preventDefault(), i.key) {
643
665
  case "ArrowDown":
644
666
  A("next");
@@ -736,7 +758,7 @@ const wt = /* @__PURE__ */ L({
736
758
  onFocus: D,
737
759
  onMousedown: f,
738
760
  onMouseup: C,
739
- onKeydown: x
761
+ onKeydown: B
740
762
  }, {
741
763
  default: g(() => [
742
764
  (c(!0), v(ee, null, me(p.value, (m) => (c(), V(b(At), {
@@ -772,7 +794,7 @@ let St = 0;
772
794
  function fe(t) {
773
795
  return t || `uid-${++St}`;
774
796
  }
775
- const Bt = ["id", "tabindex", "aria-label", "aria-selected"], xt = { class: "q-list-item__check-container" }, Vt = {
797
+ const xt = ["id", "tabindex", "aria-label", "aria-selected"], Bt = { class: "q-list-item__check-container" }, Vt = {
776
798
  check: {
777
799
  icon: "check"
778
800
  }
@@ -817,10 +839,10 @@ const Bt = ["id", "tabindex", "aria-label", "aria-selected"], xt = { class: "q-l
817
839
  e.icon ? (c(), V(b(J), te(ne({ key: 0 }, e.icon)), null, 16)) : I("", !0),
818
840
  re(" " + G(e.label), 1)
819
841
  ]),
820
- Y("div", xt, [
842
+ Y("div", Bt, [
821
843
  e.selected ? (c(), V(b(J), ne({ key: 0 }, e.icons.check, { class: "q-list-item__check" }), null, 16)) : I("", !0)
822
844
  ])
823
- ], 42, Bt));
845
+ ], 42, xt));
824
846
  }
825
847
  }), Dt = ["aria-labelledby"], Tt = ["id"], Ct = /* @__PURE__ */ L({
826
848
  __name: "QListItemGroup",
@@ -844,7 +866,7 @@ const Bt = ["id", "tabindex", "aria-label", "aria-selected"], xt = { class: "q-l
844
866
  h(e.$slots, "default")
845
867
  ], 8, Dt));
846
868
  }
847
- }), Qe = B(Lt), zt = B(Et), At = B(Ct);
869
+ }), Qe = x(Lt), zt = x(Et), At = x(Ct);
848
870
  function Qt(t, l, o = "right", e) {
849
871
  const n = t.getBoundingClientRect(), d = n.x + window.scrollX, s = n.y + window.scrollY, u = l == null ? void 0 : l.getBoundingClientRect(), p = (u == null ? void 0 : u.width) ?? 0, y = (u == null ? void 0 : u.height) ?? 0;
850
872
  let w = o;
@@ -870,10 +892,10 @@ function Fe(t, l, o) {
870
892
  let e = !1, n = !1;
871
893
  switch (o) {
872
894
  case "top":
873
- e = Be(t, l), n = t.top > l.height;
895
+ e = xe(t, l), n = t.top > l.height;
874
896
  break;
875
897
  case "bottom":
876
- e = Be(t, l), n = window.innerHeight - t.top - t.height > l.height;
898
+ e = xe(t, l), n = window.innerHeight - t.top - t.height > l.height;
877
899
  break;
878
900
  case "left":
879
901
  e = t.left > l.width, n = Se(t, l);
@@ -887,7 +909,7 @@ function Fe(t, l, o) {
887
909
  function Se(t, l) {
888
910
  return window.innerHeight - t.top - t.height / 2 > l.height / 2 && t.top + t.height / 2 > l.height / 2;
889
911
  }
890
- function Be(t, l) {
912
+ function xe(t, l) {
891
913
  return window.innerWidth - t.left - t.width / 2 > l.width / 2 && t.left + t.width / 2 > l.width / 2;
892
914
  }
893
915
  function Ft(t, l, o) {
@@ -1004,7 +1026,7 @@ const Rt = ["role"], Ot = {
1004
1026
  });
1005
1027
  }, i));
1006
1028
  }
1007
- function x() {
1029
+ function B() {
1008
1030
  clearTimeout(w), w = void 0, s.visible = !1, X(() => {
1009
1031
  if (e.anchor && e.trigger === "click") {
1010
1032
  const i = le(e.anchor);
@@ -1031,7 +1053,7 @@ const Rt = ["role"], Ot = {
1031
1053
  i.addEventListener("click", f);
1032
1054
  break;
1033
1055
  case "hover":
1034
- i.addEventListener("mouseenter", C), i.addEventListener("mouseleave", x), i.addEventListener("focusin", f), i.addEventListener("focusout", x);
1056
+ i.addEventListener("mouseenter", C), i.addEventListener("mouseleave", B), i.addEventListener("focusin", f), i.addEventListener("focusout", B);
1035
1057
  break;
1036
1058
  }
1037
1059
  });
@@ -1059,7 +1081,7 @@ const Rt = ["role"], Ot = {
1059
1081
  i.removeEventListener("click", f);
1060
1082
  break;
1061
1083
  case "hover":
1062
- i.removeEventListener("mouseenter", C), i.removeEventListener("mouseleave", x), i.removeEventListener("focusin", f), i.removeEventListener("focusout", x);
1084
+ i.removeEventListener("mouseenter", C), i.removeEventListener("mouseleave", B), i.removeEventListener("focusin", f), i.removeEventListener("focusout", B);
1063
1085
  break;
1064
1086
  }
1065
1087
  }
@@ -1070,13 +1092,13 @@ const Rt = ["role"], Ot = {
1070
1092
  function Z() {
1071
1093
  if (!e.anchor)
1072
1094
  return;
1073
- le(e.anchor) ? (y(), N = window.setTimeout(Z, 100)) : x();
1095
+ le(e.anchor) ? (y(), N = window.setTimeout(Z, 100)) : B();
1074
1096
  }
1075
1097
  function K() {
1076
- W(), e.spy && Z(), e.anchor && document.addEventListener("scroll", x);
1098
+ W(), e.spy && Z(), e.anchor && document.addEventListener("scroll", B);
1077
1099
  }
1078
1100
  function j() {
1079
- H(), e.spy && (clearTimeout(N), N = void 0), document.removeEventListener("scroll", x);
1101
+ H(), e.spy && (clearTimeout(N), N = void 0), document.removeEventListener("scroll", B);
1080
1102
  }
1081
1103
  return Me(() => {
1082
1104
  U(), j();
@@ -1120,8 +1142,8 @@ const Rt = ["role"], Ot = {
1120
1142
  tabindex: "-1",
1121
1143
  role: d.value ? "dialog" : void 0
1122
1144
  }, i.$attrs, {
1123
- onKeydown: Ge(x, ["escape"]),
1124
- onBlur: x
1145
+ onKeydown: Ge(B, ["escape"]),
1146
+ onBlur: B
1125
1147
  }), [
1126
1148
  e.arrow ? (c(), v("div", Ot)) : I("", !0),
1127
1149
  h(i.$slots, "default")
@@ -1132,7 +1154,7 @@ const Rt = ["role"], Ot = {
1132
1154
  }, 8, ["name"])
1133
1155
  ], 8, ["disabled", "to"]));
1134
1156
  }
1135
- }), pe = B(Ut), Nt = ["id"], Mt = {
1157
+ }), pe = x(Ut), Nt = ["id"], Mt = {
1136
1158
  key: 0,
1137
1159
  class: "q-field__label"
1138
1160
  }, Ht = ["for"], Kt = {
@@ -1201,7 +1223,7 @@ const Rt = ["role"], Ot = {
1201
1223
  ])) : I("", !0)
1202
1224
  ], 10, Nt));
1203
1225
  }
1204
- }), _e = B(jt), Pt = ["id", "type", "role", "required", "placeholder", "readonly", "disabled", "maxlength"], Xt = /* @__PURE__ */ L({
1226
+ }), _e = x(jt), Pt = ["id", "type", "role", "required", "placeholder", "readonly", "disabled", "maxlength"], Xt = /* @__PURE__ */ L({
1205
1227
  inheritAttrs: !1,
1206
1228
  __name: "QTextField",
1207
1229
  props: {
@@ -1299,7 +1321,7 @@ const Rt = ["role"], Ot = {
1299
1321
  } : void 0
1300
1322
  ]), 1032, ["class", "for", "label", "size", "readonly", "disabled", "required"]));
1301
1323
  }
1302
- }), Yt = B(Xt), Zt = {
1324
+ }), Yt = x(Xt), Zt = {
1303
1325
  key: 0,
1304
1326
  class: "q-select__loader"
1305
1327
  }, Jt = {
@@ -1342,17 +1364,15 @@ const Rt = ["role"], Ot = {
1342
1364
  setup(t, { expose: l, emit: o }) {
1343
1365
  const e = o, n = t, d = q(n.modelValue), s = q(!1), u = q(""), p = q(void 0), y = q(null), w = q(null), f = q(null);
1344
1366
  Te(U);
1345
- const C = _(
1346
- () => n.clearable && !n.readonly && !n.disabled && !n.loading
1347
- ), D = _(() => {
1367
+ const C = _(() => n.clearable && !n.readonly && !n.disabled), D = _(() => {
1348
1368
  var r;
1349
1369
  return n.filterMode === "manual" || !O.value ? n.items : (r = n.items) == null ? void 0 : r.filter(
1350
1370
  (k) => k[n.itemLabel].toLowerCase().startsWith(u.value.toLowerCase())
1351
1371
  );
1352
- }), x = _(() => {
1372
+ }), B = _(() => {
1353
1373
  var r;
1354
1374
  return (r = n.items) == null ? void 0 : r.find((k) => k[n.itemValue] === d.value);
1355
- }), A = _(() => x.value === void 0), Q = _(() => {
1375
+ }), A = _(() => B.value === void 0), Q = _(() => {
1356
1376
  const r = p.value;
1357
1377
  if (r !== void 0 && D.value[r])
1358
1378
  return D.value[r];
@@ -1364,7 +1384,7 @@ const Rt = ["role"], Ot = {
1364
1384
  return r == null ? void 0 : r.id;
1365
1385
  }), O = _(() => {
1366
1386
  var r;
1367
- return u.value.length > 0 && u.value !== ((r = x.value) == null ? void 0 : r[n.itemLabel]);
1387
+ return u.value.length > 0 && u.value !== ((r = B.value) == null ? void 0 : r[n.itemLabel]);
1368
1388
  });
1369
1389
  function M(r) {
1370
1390
  d.value = r, U(), e("update:modelValue", r);
@@ -1374,7 +1394,7 @@ const Rt = ["role"], Ot = {
1374
1394
  }
1375
1395
  function U() {
1376
1396
  var r;
1377
- u.value = ((r = x.value) == null ? void 0 : r[n.itemLabel]) || "";
1397
+ u.value = ((r = B.value) == null ? void 0 : r[n.itemLabel]) || "";
1378
1398
  }
1379
1399
  function H() {
1380
1400
  s.value || n.readonly || n.disabled || (e("before-show"), s.value = !0, ae());
@@ -1389,8 +1409,8 @@ const Rt = ["role"], Ot = {
1389
1409
  C.value && (M(n.emptyValue), p.value = void 0);
1390
1410
  }
1391
1411
  function j() {
1392
- if (H(), x.value !== void 0) {
1393
- const r = D.value.indexOf(x.value);
1412
+ if (H(), B.value !== void 0) {
1413
+ const r = D.value.indexOf(B.value);
1394
1414
  r !== -1 && X(() => ke(r));
1395
1415
  }
1396
1416
  }
@@ -1608,7 +1628,7 @@ const Rt = ["role"], Ot = {
1608
1628
  }, 8, ["modelValue", "anchor"])
1609
1629
  ], 64));
1610
1630
  }
1611
- }), Bl = B(ll), nl = {
1631
+ }), xl = x(ll), nl = {
1612
1632
  key: 0,
1613
1633
  class: "q-input-group__prepend"
1614
1634
  }, ol = { key: 0 }, al = {
@@ -1656,7 +1676,7 @@ const Rt = ["role"], Ot = {
1656
1676
  _: 3
1657
1677
  }, 8, ["id", "class", "label", "required", "size"]));
1658
1678
  }
1659
- }), xl = B(il), rl = /* @__PURE__ */ L({
1679
+ }), Bl = x(il), rl = /* @__PURE__ */ L({
1660
1680
  __name: "QLineLoader",
1661
1681
  props: {
1662
1682
  class: { default: void 0 }
@@ -1667,7 +1687,7 @@ const Rt = ["role"], Ot = {
1667
1687
  class: E(["q-line-loader", l.class])
1668
1688
  }, null, 2));
1669
1689
  }
1670
- }), Vl = B(rl), dl = {
1690
+ }), Vl = x(rl), dl = {
1671
1691
  key: 0,
1672
1692
  class: "q-popover__header"
1673
1693
  }, ul = {
@@ -1715,7 +1735,7 @@ const Rt = ["role"], Ot = {
1715
1735
  _: 3
1716
1736
  }, 8, ["model-value", "anchor", "arrow", "attach", "disabled", "placement"]));
1717
1737
  }
1718
- }), El = B(pl), ml = {
1738
+ }), El = x(pl), ml = {
1719
1739
  key: 0,
1720
1740
  class: "q-select__value"
1721
1741
  }, vl = {
@@ -1766,11 +1786,11 @@ const Rt = ["role"], Ot = {
1766
1786
  ), D = _(
1767
1787
  () => e.clearable && !e.readonly && !e.disabled && !e.loading
1768
1788
  );
1769
- function x(a) {
1789
+ function B(a) {
1770
1790
  n.value = a, o("update:modelValue", a), M();
1771
1791
  }
1772
1792
  function A() {
1773
- D.value && x(e.emptyValue);
1793
+ D.value && B(e.emptyValue);
1774
1794
  }
1775
1795
  function Q() {
1776
1796
  e.readonly || e.disabled || (d.value ? M() : O());
@@ -1951,7 +1971,7 @@ const Rt = ["role"], Ot = {
1951
1971
  modelValue: n.value,
1952
1972
  "onUpdate:modelValue": [
1953
1973
  m[0] || (m[0] = (T) => n.value = T),
1954
- x
1974
+ B
1955
1975
  ],
1956
1976
  items: e.items,
1957
1977
  groups: a.groups,
@@ -1971,7 +1991,7 @@ const Rt = ["role"], Ot = {
1971
1991
  ], 64);
1972
1992
  };
1973
1993
  }
1974
- }), Dl = B(gl), _l = /* @__PURE__ */ L({
1994
+ }), Dl = x(gl), _l = /* @__PURE__ */ L({
1975
1995
  __name: "QThemeProvider",
1976
1996
  props: {
1977
1997
  theme: {}
@@ -1984,7 +2004,7 @@ const Rt = ["role"], Ot = {
1984
2004
  h(o.$slots, "default")
1985
2005
  ], 2));
1986
2006
  }
1987
- }), Tl = B(_l), kl = ["innerHTML"], wl = { key: 1 }, $l = /* @__PURE__ */ L({
2007
+ }), Tl = x(_l), kl = ["innerHTML"], wl = { key: 1 }, $l = /* @__PURE__ */ L({
1988
2008
  __name: "QTooltip",
1989
2009
  props: {
1990
2010
  modelValue: { type: Boolean },
@@ -2031,18 +2051,18 @@ const Rt = ["role"], Ot = {
2031
2051
  }, 8, ["model-value", "anchor", "id", "appearance", "arrow", "attach", "class", "delay", "disabled", "placement", "trigger"])
2032
2052
  ], 64));
2033
2053
  }
2034
- }), Cl = B($l);
2054
+ }), Cl = x($l);
2035
2055
  export {
2036
2056
  ue as QButton,
2037
2057
  pt as QButtonGroup,
2038
2058
  Sl as QButtonToggle,
2039
- Bl as QCombobox,
2059
+ xl as QCombobox,
2040
2060
  _e as QField,
2041
2061
  J as QIcon,
2042
2062
  $t as QIconFont,
2043
2063
  qt as QIconImg,
2044
2064
  It as QIconSvg,
2045
- xl as QInputGroup,
2065
+ Bl as QInputGroup,
2046
2066
  Vl as QLineLoader,
2047
2067
  Qe as QList,
2048
2068
  zt as QListItem,