@quidgest/ui 0.5.5 → 0.5.7

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/index.d.ts CHANGED
@@ -93,9 +93,9 @@ declare interface HTMLElementWithClickOutsideEvent extends HTMLElement {
93
93
 
94
94
  export declare type Icon = {
95
95
  /**
96
- * The name of the icon.
96
+ * The identifier of the icon.
97
97
  */
98
- name: string;
98
+ icon: string;
99
99
  /**
100
100
  * The type of resource.
101
101
  */
@@ -663,7 +663,7 @@ export declare const QIcon: DefineComponent<{
663
663
  type: PropType<"img" | "svg" | "font">;
664
664
  default: string;
665
665
  };
666
- name: {
666
+ icon: {
667
667
  type: PropType<string>;
668
668
  required: true;
669
669
  };
@@ -676,7 +676,7 @@ export declare const QIcon: DefineComponent<{
676
676
  type: PropType<"img" | "svg" | "font">;
677
677
  default: string;
678
678
  };
679
- name: {
679
+ icon: {
680
680
  type: PropType<string>;
681
681
  required: true;
682
682
  };
package/dist/ui.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getCurrentInstance as pe, computed as y, ref as I, provide as Se, inject as me, watch as Q, defineComponent as _, openBlock as r, createElementBlock as f, normalizeStyle as W, createElementVNode as X, normalizeClass as C, withModifiers as R, createVNode as H, unref as g, createCommentVNode as b, Fragment as A, createTextVNode as N, toDisplayString as V, renderSlot as q, toRef as J, createBlock as w, withCtx as E, renderList as ee, resolveDynamicComponent as he, h as se, mergeProps as K, normalizeProps as ye, reactive as Be, onBeforeUnmount as Le, onMounted as xe, Teleport as qe, Transition as De, nextTick as le, createSlots as Ie, guardReactiveProps as Ee, withDirectives as Te } from "vue";
1
+ import { getCurrentInstance as pe, computed as y, ref as I, provide as Se, inject as me, watch as Q, defineComponent as _, openBlock as r, createElementBlock as f, normalizeStyle as W, createElementVNode as X, normalizeClass as T, withModifiers as R, createVNode as H, unref as g, createCommentVNode as b, Fragment as A, createTextVNode as N, toDisplayString as V, renderSlot as q, toRef as J, createBlock as w, withCtx as E, renderList as ee, resolveDynamicComponent as he, h as se, mergeProps as K, normalizeProps as ye, reactive as Be, onBeforeUnmount as Le, onMounted as xe, Teleport as qe, Transition as De, nextTick as le, createSlots as Ie, guardReactiveProps as Ee, withDirectives as Ce } from "vue";
2
2
  function te(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
  }
@@ -23,7 +23,7 @@ function ve(t = {}, n = {}) {
23
23
  return e;
24
24
  }
25
25
  const ne = "q-defaults";
26
- function Ce() {
26
+ function Te() {
27
27
  const t = pe();
28
28
  if (!t)
29
29
  throw new Error("[Quidgest UI] useDefaults must be called from inside a setup function");
@@ -265,7 +265,7 @@ function Zt(t = {}) {
265
265
  for (const l in a)
266
266
  e.directive(l, a[l]);
267
267
  const s = t.defaults || {};
268
- e.provide(ne, s), Oe(e, t.themes);
268
+ e.provide(ne, I(s)), Oe(e, t.themes);
269
269
  } };
270
270
  }
271
271
  const Re = /* @__PURE__ */ X("svg", { viewBox: "25 25 50 50" }, [
@@ -303,7 +303,7 @@ function Ne(t, n) {
303
303
  function k(t) {
304
304
  const n = t.setup;
305
305
  return n && (t.setup = (e, o) => {
306
- const a = Ce();
306
+ const a = Te();
307
307
  if (te(a.value))
308
308
  return n(e, o);
309
309
  const s = pe();
@@ -359,7 +359,7 @@ const we = k(Ue), Ke = ["disabled", "onClick"], We = {
359
359
  });
360
360
  return (l, c) => (r(), f("button", {
361
361
  type: "button",
362
- class: C(s.value),
362
+ class: T(s.value),
363
363
  disabled: o.value,
364
364
  onClick: R(a, ["stop", "prevent"])
365
365
  }, [
@@ -402,7 +402,7 @@ const we = k(Ue), Ke = ["disabled", "onClick"], We = {
402
402
  }
403
403
  ]);
404
404
  return (o, a) => (r(), f("div", {
405
- class: C(e.value)
405
+ class: T(e.value)
406
406
  }, [
407
407
  q(o.$slots, "default")
408
408
  ], 2));
@@ -461,7 +461,7 @@ const we = k(Ue), Ke = ["disabled", "onClick"], We = {
461
461
  }), jt = k(Je), Pe = /* @__PURE__ */ _({
462
462
  __name: "QIcon",
463
463
  props: {
464
- name: {},
464
+ icon: {},
465
465
  type: { default: "svg" },
466
466
  size: { default: void 0 }
467
467
  },
@@ -478,27 +478,28 @@ const we = k(Ue), Ke = ["disabled", "onClick"], We = {
478
478
  return;
479
479
  }
480
480
  });
481
- return (o, a) => (r(), w(he(e.value), {
482
- icon: n.name,
481
+ return (o, a) => n.icon ? (r(), w(he(e.value), {
482
+ key: 0,
483
+ icon: n.icon,
483
484
  size: n.size
484
- }, null, 8, ["icon", "size"]));
485
+ }, null, 8, ["icon", "size"])) : b("", !0);
485
486
  }
486
487
  }), et = /* @__PURE__ */ _({
487
488
  __name: "QIconFont",
488
489
  props: {
489
490
  icon: {},
490
- library: { default: "glyphicons" },
491
+ library: { default: "" },
491
492
  variant: { default: "" },
492
493
  size: { default: void 0 }
493
494
  },
494
495
  setup(t) {
495
- const n = t, e = y(() => n.variant ? `${n.library}-${n.variant}` : n.library), o = y(() => ({
496
+ const n = t, e = y(() => n.variant ? `${n.library}-${n.variant}` : n.library), o = y(() => n.library && n.icon ? `${n.library}-${n.icon}` : n.icon), a = y(() => ({
496
497
  "font-size": n.size !== void 0 ? `${n.size}px` : void 0
497
498
  }));
498
- return (a, s) => n.icon ? (r(), f("i", {
499
+ return (s, l) => o.value ? (r(), f("i", {
499
500
  key: 0,
500
- class: C(["q-icon", "q-icon__font", e.value, `${n.library}-${n.icon}`]),
501
- style: W(o.value)
501
+ class: T(["q-icon", "q-icon__font", e.value, o.value]),
502
+ style: W(a.value)
502
503
  }, null, 6)) : b("", !0);
503
504
  }
504
505
  }), tt = ["src"], nt = /* @__PURE__ */ _({
@@ -669,7 +670,7 @@ const lt = /* @__PURE__ */ _({
669
670
  setup(t) {
670
671
  const n = t;
671
672
  return (e, o) => (r(), f("div", {
672
- class: C([
673
+ class: T([
673
674
  "q-input",
674
675
  `q-input--${n.size}`,
675
676
  { "q-input--readonly": n.readonly, "q-input--disabled": n.disabled }
@@ -745,9 +746,9 @@ const gt = /* @__PURE__ */ mt(ht, [["render", vt]]), Jt = k(gt), bt = /* @__PURE
745
746
  }
746
747
  function x(d) {
747
748
  var v;
748
- (v = T().at(d)) == null || v.focus();
749
+ (v = C().at(d)) == null || v.focus();
749
750
  }
750
- function T() {
751
+ function C() {
751
752
  var v;
752
753
  const d = (v = c.value) == null ? void 0 : v.querySelectorAll("li");
753
754
  return d ? Array.from(d).filter((D) => D.tabIndex !== -1) : [];
@@ -756,7 +757,7 @@ const gt = /* @__PURE__ */ mt(ht, [["render", vt]]), Jt = k(gt), bt = /* @__PURE
756
757
  return d.indexOf(document.activeElement);
757
758
  }
758
759
  function F(d) {
759
- const S = T(), v = O(S);
760
+ const S = C(), v = O(S);
760
761
  return d === "next" ? v === S.length - 1 ? v : v + 1 : v === 0 ? 0 : v - 1;
761
762
  }
762
763
  function z(d) {
@@ -770,7 +771,7 @@ const gt = /* @__PURE__ */ mt(ht, [["render", vt]]), Jt = k(gt), bt = /* @__PURE
770
771
  ), n({ focusItem: x }), (d, S) => (r(), w(he(s.value), {
771
772
  ref_key: "listRef",
772
773
  ref: c,
773
- class: C(["q-list", { "q-list--disabled": o.disabled }]),
774
+ class: T(["q-list", { "q-list--disabled": o.disabled }]),
774
775
  role: "listbox",
775
776
  tabindex: o.disabled ? -1 : 0,
776
777
  onFocus: p,
@@ -799,7 +800,7 @@ const gt = /* @__PURE__ */ mt(ht, [["render", vt]]), Jt = k(gt), bt = /* @__PURE
799
800
  }
800
801
  }), _t = ["tabindex", "aria-label", "aria-selected", "onClick"], kt = {
801
802
  check: {
802
- name: "check"
803
+ icon: "check"
803
804
  }
804
805
  }, wt = /* @__PURE__ */ _({
805
806
  __name: "QListItem",
@@ -824,7 +825,7 @@ const gt = /* @__PURE__ */ mt(ht, [["render", vt]]), Jt = k(gt), bt = /* @__PURE
824
825
  return (s, l) => (r(), f("li", {
825
826
  role: "option",
826
827
  tabindex: e.disabled ? void 0 : -2,
827
- class: C([
828
+ class: T([
828
829
  "q-list-item",
829
830
  {
830
831
  "q-list-item--disabled": e.disabled,
@@ -875,7 +876,7 @@ const Bt = ["aria-labelledby"], Lt = ["id"], xt = /* @__PURE__ */ _({
875
876
  function Et(t, n, e = "right", o) {
876
877
  const a = t.getBoundingClientRect(), s = a.x + window.scrollX, l = a.y + window.scrollY, c = n == null ? void 0 : n.getBoundingClientRect(), i = (c == null ? void 0 : c.width) ?? 0, p = (c == null ? void 0 : c.height) ?? 0;
877
878
  let $ = e;
878
- c && !$e(a, c, $) && ($ = Tt(a, c, $));
879
+ c && !$e(a, c, $) && ($ = Ct(a, c, $));
879
880
  const m = { x: 0, y: 0, placement: $ };
880
881
  switch ($) {
881
882
  case "top":
@@ -917,7 +918,7 @@ function de(t, n) {
917
918
  function fe(t, n) {
918
919
  return window.innerWidth - t.left - t.width / 2 > n.width / 2 && t.left + t.width / 2 > n.width / 2;
919
920
  }
920
- function Tt(t, n, e) {
921
+ function Ct(t, n, e) {
921
922
  const o = {
922
923
  top: ["bottom", "left", "right"],
923
924
  bottom: ["top", "left", "right"],
@@ -932,7 +933,7 @@ function Tt(t, n, e) {
932
933
  function Y(t) {
933
934
  return typeof t == "string" ? document.querySelector(t) : t && "$el" in t ? t.$el : t;
934
935
  }
935
- const Ct = {
936
+ const Tt = {
936
937
  key: 0,
937
938
  class: "q-overlay__arrow"
938
939
  }, Vt = /* @__PURE__ */ _({
@@ -1012,7 +1013,7 @@ const Ct = {
1012
1013
  function x() {
1013
1014
  s.value ? m() : $();
1014
1015
  }
1015
- let T;
1016
+ let C;
1016
1017
  function O() {
1017
1018
  le(() => {
1018
1019
  const h = Y(e.anchor);
@@ -1030,7 +1031,7 @@ const Ct = {
1030
1031
  function F() {
1031
1032
  le(() => {
1032
1033
  const h = Y(e.anchor);
1033
- h && (window.addEventListener("scroll", i), window.addEventListener("resize", i), T = new MutationObserver(i), T.observe(h, {
1034
+ h && (window.addEventListener("scroll", i), window.addEventListener("resize", i), C = new MutationObserver(i), C.observe(h, {
1034
1035
  attributes: !1,
1035
1036
  childList: !0,
1036
1037
  characterData: !0,
@@ -1039,7 +1040,7 @@ const Ct = {
1039
1040
  });
1040
1041
  }
1041
1042
  function z() {
1042
- window.removeEventListener("scroll", i), window.removeEventListener("resize", i), T == null || T.disconnect();
1043
+ window.removeEventListener("scroll", i), window.removeEventListener("resize", i), C == null || C.disconnect();
1043
1044
  }
1044
1045
  let d;
1045
1046
  function S() {
@@ -1077,15 +1078,15 @@ const Ct = {
1077
1078
  default: E(() => [
1078
1079
  s.value ? (r(), f("div", {
1079
1080
  key: 0,
1080
- class: C(o.value),
1081
+ class: T(o.value),
1081
1082
  style: W(l.value)
1082
1083
  }, [
1083
1084
  X("div", {
1084
- class: C(["q-overlay__content"]),
1085
+ class: T(["q-overlay__content"]),
1085
1086
  ref_key: "overlay",
1086
1087
  ref: c
1087
1088
  }, [
1088
- e.arrow ? (r(), f("div", Ct)) : b("", !0),
1089
+ e.arrow ? (r(), f("div", Tt)) : b("", !0),
1089
1090
  q(h.$slots, "default")
1090
1091
  ], 512)
1091
1092
  ], 6)) : b("", !0)
@@ -1161,10 +1162,10 @@ const Ct = {
1161
1162
  placeholder: "Choose..."
1162
1163
  }, Ut = {
1163
1164
  chevron: {
1164
- name: "chevron-down"
1165
+ icon: "chevron-down"
1165
1166
  },
1166
1167
  clear: {
1167
- name: "close"
1168
+ icon: "close"
1168
1169
  }
1169
1170
  }, Nt = /* @__PURE__ */ _({
1170
1171
  __name: "QSelect",
@@ -1197,7 +1198,7 @@ const Ct = {
1197
1198
  function x() {
1198
1199
  m.value && (o.value = void 0, n("update:modelValue", o.value), z());
1199
1200
  }
1200
- function T() {
1201
+ function C() {
1201
1202
  e.readonly || e.disabled || (a.value ? z() : F());
1202
1203
  }
1203
1204
  function O(u) {
@@ -1254,7 +1255,7 @@ const Ct = {
1254
1255
  ref: l,
1255
1256
  role: "combobox",
1256
1257
  tabindex: "0",
1257
- class: C([
1258
+ class: T([
1258
1259
  "q-select",
1259
1260
  {
1260
1261
  "q-select--readonly": e.readonly,
@@ -1267,7 +1268,7 @@ const Ct = {
1267
1268
  "aria-expanded": a.value,
1268
1269
  "aria-haspopup": "listbox",
1269
1270
  size: e.size,
1270
- onClick: T,
1271
+ onClick: C,
1271
1272
  onKeydown: R(S, ["stop"])
1272
1273
  }, Ie({
1273
1274
  append: E(() => [
@@ -1307,7 +1308,7 @@ const Ct = {
1307
1308
  onLeave: D
1308
1309
  }, {
1309
1310
  default: E(() => [
1310
- Te((r(), f("div", {
1311
+ Ce((r(), f("div", {
1311
1312
  ref_key: "contentRef",
1312
1313
  ref: i,
1313
1314
  class: "q-select__body"