@quidgest/ui 0.16.3 → 0.16.5

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.
Files changed (121) hide show
  1. package/dist/manifest/components.json +7 -0
  2. package/dist/ui.css +810 -32
  3. package/dist/ui.esm.js +5731 -5219
  4. package/dist/ui.js +18 -18
  5. package/dist/ui.min.css +2 -1
  6. package/dist/ui.min.js +1042 -1006
  7. package/dist/ui.scss +463 -40
  8. package/esm/_virtual/_plugin-vue_export-helper.js +9 -0
  9. package/esm/components/QCombobox/QCombobox.d.ts +14 -0
  10. package/esm/components/QCombobox/QCombobox.d.ts.map +1 -1
  11. package/esm/components/QCombobox/QCombobox.vue.js +9 -8
  12. package/esm/components/QCombobox/index.d.ts +7 -0
  13. package/esm/components/QCombobox/index.d.ts.map +1 -1
  14. package/esm/components/QDialog/QDialog.d.ts +9 -1
  15. package/esm/components/QDialog/QDialog.d.ts.map +1 -1
  16. package/esm/components/QDialog/QDialog.vue.js +125 -97
  17. package/esm/components/QDialog/QDialogProvider.d.ts +3 -0
  18. package/esm/components/QDialog/QDialogProvider.d.ts.map +1 -0
  19. package/esm/components/QDialog/QDialogProvider.vue.js +26 -0
  20. package/esm/components/QDialog/QDialogProvider.vue2.js +4 -0
  21. package/esm/components/QDialog/index.d.ts +26 -2
  22. package/esm/components/QDialog/index.d.ts.map +1 -1
  23. package/esm/components/QDialog/index.js +6 -4
  24. package/esm/components/QDialog/types.d.ts +9 -0
  25. package/esm/components/QDialog/types.d.ts.map +1 -1
  26. package/esm/components/QDismissibleLayer/QDismissibleLayer.d.ts.map +1 -1
  27. package/esm/components/QDismissibleLayer/QDismissibleLayer.vue.js +26 -24
  28. package/esm/components/QDivider/QDivider.d.ts +21 -0
  29. package/esm/components/QDivider/QDivider.d.ts.map +1 -0
  30. package/esm/components/QDivider/QDivider.vue.js +57 -0
  31. package/esm/components/QDivider/QDivider.vue2.js +4 -0
  32. package/esm/components/QDivider/index.d.ts +25 -0
  33. package/esm/components/QDivider/index.d.ts.map +1 -0
  34. package/esm/components/QDivider/index.js +6 -0
  35. package/esm/components/QDivider/types.d.ts +11 -0
  36. package/esm/components/QDivider/types.d.ts.map +1 -0
  37. package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts +14 -0
  38. package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts.map +1 -1
  39. package/esm/components/QGrid/QCol.d.ts +19 -0
  40. package/esm/components/QGrid/QCol.d.ts.map +1 -0
  41. package/esm/components/QGrid/QCol.vue.js +46 -0
  42. package/esm/components/QGrid/QCol.vue2.js +4 -0
  43. package/esm/components/QGrid/QContainer.d.ts +19 -0
  44. package/esm/components/QGrid/QContainer.d.ts.map +1 -0
  45. package/esm/components/QGrid/QContainer.vue.js +24 -0
  46. package/esm/components/QGrid/QContainer.vue2.js +4 -0
  47. package/esm/components/QGrid/QRow.d.ts +23 -0
  48. package/esm/components/QGrid/QRow.d.ts.map +1 -0
  49. package/esm/components/QGrid/QRow.vue.js +36 -0
  50. package/esm/components/QGrid/QRow.vue2.js +4 -0
  51. package/esm/components/QGrid/QSpacer.d.ts +3 -0
  52. package/esm/components/QGrid/QSpacer.d.ts.map +1 -0
  53. package/esm/components/QGrid/QSpacer.vue.js +10 -0
  54. package/esm/components/QGrid/index.d.ts +66 -0
  55. package/esm/components/QGrid/index.d.ts.map +1 -0
  56. package/esm/components/QGrid/index.js +12 -0
  57. package/esm/components/QGrid/types.d.ts +47 -0
  58. package/esm/components/QGrid/types.d.ts.map +1 -0
  59. package/esm/components/QList/QList.d.ts +1 -0
  60. package/esm/components/QList/QList.d.ts.map +1 -1
  61. package/esm/components/QList/QList.vue.js +130 -120
  62. package/esm/components/QList/QListItem.d.ts.map +1 -1
  63. package/esm/components/QList/QListItem.vue.js +57 -43
  64. package/esm/components/QList/index.d.ts +7 -0
  65. package/esm/components/QList/index.d.ts.map +1 -1
  66. package/esm/components/QList/types.d.ts +8 -0
  67. package/esm/components/QList/types.d.ts.map +1 -1
  68. package/esm/components/QOverlay/QOverlay.d.ts.map +1 -1
  69. package/esm/components/QOverlay/QOverlay.vue.js +29 -27
  70. package/esm/components/QOverlay/index.d.ts +3 -0
  71. package/esm/components/QOverlay/index.d.ts.map +1 -1
  72. package/esm/components/QOverlay/types.d.ts +4 -0
  73. package/esm/components/QOverlay/types.d.ts.map +1 -1
  74. package/esm/components/QPasswordField/QPasswordFieldMeterOverlay.vue.js +8 -7
  75. package/esm/components/QSelect/QSelect.d.ts +14 -0
  76. package/esm/components/QSelect/QSelect.d.ts.map +1 -1
  77. package/esm/components/QSelect/QSelect.vue.js +1 -0
  78. package/esm/components/QSelect/index.d.ts +7 -0
  79. package/esm/components/QSelect/index.d.ts.map +1 -1
  80. package/esm/components/QSidebar/QSidebar.d.ts +39 -0
  81. package/esm/components/QSidebar/QSidebar.d.ts.map +1 -0
  82. package/esm/components/QSidebar/QSidebar.vue.js +155 -0
  83. package/esm/components/QSidebar/QSidebar.vue2.js +4 -0
  84. package/esm/components/QSidebar/QSidebarAnchor.d.ts +219 -0
  85. package/esm/components/QSidebar/QSidebarAnchor.d.ts.map +1 -0
  86. package/esm/components/QSidebar/QSidebarAnchor.vue.js +110 -0
  87. package/esm/components/QSidebar/QSidebarAnchor.vue2.js +4 -0
  88. package/esm/components/QSidebar/QSidebarPanel.d.ts +41 -0
  89. package/esm/components/QSidebar/QSidebarPanel.d.ts.map +1 -0
  90. package/esm/components/QSidebar/QSidebarPanel.vue.js +90 -0
  91. package/esm/components/QSidebar/QSidebarPanel.vue2.js +4 -0
  92. package/esm/components/QSidebar/index.d.ts +72 -0
  93. package/esm/components/QSidebar/index.d.ts.map +1 -0
  94. package/esm/components/QSidebar/index.js +6 -0
  95. package/esm/components/QSidebar/types.d.ts +63 -0
  96. package/esm/components/QSidebar/types.d.ts.map +1 -0
  97. package/esm/components/QToggleGroup/types.d.ts +1 -1
  98. package/esm/components/QTooltip/QTooltip.d.ts.map +1 -1
  99. package/esm/components/QTooltip/QTooltip.vue.js +47 -46
  100. package/esm/components/index.d.ts +3 -0
  101. package/esm/components/index.d.ts.map +1 -1
  102. package/esm/components/index.js +78 -68
  103. package/esm/composables/index.d.ts +2 -1
  104. package/esm/composables/index.d.ts.map +1 -1
  105. package/esm/composables/theme.js +3 -3
  106. package/esm/composables/useDialog/index.d.ts +69 -0
  107. package/esm/composables/useDialog/index.d.ts.map +1 -0
  108. package/esm/composables/useDialog/index.js +21 -0
  109. package/esm/composables/useDialog/types.d.ts +25 -0
  110. package/esm/composables/useDialog/types.d.ts.map +1 -0
  111. package/esm/composables/useDismissibleLayerStack/index.d.ts +14 -0
  112. package/esm/composables/useDismissibleLayerStack/index.d.ts.map +1 -0
  113. package/esm/composables/useDismissibleLayerStack/index.js +32 -0
  114. package/esm/framework.d.ts.map +1 -1
  115. package/esm/framework.js +35 -31
  116. package/esm/index.d.ts +7 -0
  117. package/esm/index.js +4 -2
  118. package/esm/symbols/dismissibleLayer.d.ts +4 -0
  119. package/esm/symbols/dismissibleLayer.d.ts.map +1 -0
  120. package/esm/symbols/dismissibleLayer.js +4 -0
  121. package/package.json +1 -1
@@ -0,0 +1,47 @@
1
+ export type QContainerProps = {
2
+ /**
3
+ * If true, container spans full width, otherwise constrained by breakpoints.
4
+ */
5
+ fluid?: boolean;
6
+ };
7
+ export type QRowProps = {
8
+ /**
9
+ * Space between columns in pixels.
10
+ */
11
+ gutter?: number;
12
+ /**
13
+ * Horizontal alignment.
14
+ */
15
+ justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
16
+ /**
17
+ * Vertical alignment.
18
+ */
19
+ align?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
20
+ };
21
+ export type QColProps = {
22
+ /**
23
+ * Number of columns (1–12) or 'auto'.
24
+ */
25
+ cols?: number | 'auto';
26
+ /**
27
+ * Small breakpoint columns.
28
+ */
29
+ sm?: number | 'auto';
30
+ /**
31
+ * Medium breakpoint columns.
32
+ */
33
+ md?: number | 'auto';
34
+ /**
35
+ * Large breakpoint columns.
36
+ */
37
+ lg?: number | 'auto';
38
+ /**
39
+ * Extra-large breakpoint columns.
40
+ */
41
+ xl?: number | 'auto';
42
+ /**
43
+ * Extra-extra-large breakpoint columns.
44
+ */
45
+ xxl?: number | 'auto';
46
+ };
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QGrid/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAEtE;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAA;CAC3D,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEtB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEpB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEpB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEpB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEpB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACrB,CAAA"}
@@ -33,6 +33,7 @@ type __VLS_PublicProps = {
33
33
  declare function __VLS_template(): {
34
34
  attrs: Partial<{}>;
35
35
  slots: {
36
+ default?(_: {}): any;
36
37
  item?(_: {
37
38
  item: import('./types').Item;
38
39
  element: HTMLLIElement | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"QList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QList/QList.vue"],"names":[],"mappings":"AA6CA;AA6aC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAKhD,KAAK,WAAW,GAAG,UAAU,CAAC;AAyN9B,iBAAS,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAIrD;AAaD;;;;;;GAMG;AACH,iBAAS,0BAA0B,IAAI,MAAM,CAO5C;AAED;;;;;;GAMG;AACH,iBAAS,yBAAyB,IAAI,MAAM,CAO3C;AAmCD;;;;;;;;GAQG;AACH,iBAAS,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAuB7E;AAoDF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,GAAG,CAAC;CAChB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAwIT,OAAO,IAA6B;;;;;YAbvB,GAAG;;;;YACM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAxEL,GAAG,8CAE3B,GAAG,yBACH,GAAG,6DAEF,GAAG;;;;;;;;;;;;;;;;;EAoFb;AAwBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAlHa,GAAG,8CAE3B,GAAG,yBACH,GAAG,6DAEF,GAAG;;;;;;;;;;;;;;;OAwHZ,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"QList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QList/QList.vue"],"names":[],"mappings":"AA6CA;AAibC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAMhD,KAAK,WAAW,GAAG,UAAU,CAAC;AAoN9B,iBAAS,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAIrD;AAaD;;;;;;GAMG;AACH,iBAAS,0BAA0B,IAAI,MAAM,CAO5C;AAED;;;;;;GAMG;AACH,iBAAS,yBAAyB,IAAI,MAAM,CAO3C;AAmCD;;;;;;;;GAQG;AACH,iBAAS,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAuB7E;AA4DF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,GAAG,CAAC;CAChB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAsIT,OAAO,IAA6B;;yBAdpB,GAAG;;;;YACN,GAAG;;;;YACM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCApEb,GAAG,8CAE3B,GAAG,yBACH,GAAG,6DAEF,GAAG;;;;;;;;;;;;;;;;;EAgFL;AAsBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA5GK,GAAG,8CAE3B,GAAG,yBACH,GAAG,6DAEF,GAAG;;;;;;;;;;;;;;;OAkHJ,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,8 +1,9 @@
1
- import { defineComponent as N, mergeModels as _, useModel as X, ref as p, computed as D, createBlock as x, openBlock as d, resolveDynamicComponent as Y, normalizeClass as Z, withCtx as b, createElementBlock as M, Fragment as T, renderList as B, unref as E, renderSlot as U } from "vue";
2
- import { QListItemGroup as ee, QListItem as te } from "./index.js";
3
- const se = /* @__PURE__ */ N({
1
+ import { defineComponent as X, mergeModels as D, useModel as Y, ref as p, computed as M, toRef as _, watch as Z, createBlock as y, openBlock as d, resolveDynamicComponent as ee, normalizeClass as te, withCtx as b, renderSlot as x, createElementBlock as q, Fragment as T, renderList as $, unref as E } from "vue";
2
+ import { QListItemGroup as ne, QListItem as le } from "./index.js";
3
+ import { useGroup as ie } from "../../composables/useGroup/index.js";
4
+ const re = /* @__PURE__ */ X({
4
5
  __name: "QList",
5
- props: /* @__PURE__ */ _({
6
+ props: /* @__PURE__ */ D({
6
7
  id: {},
7
8
  class: {},
8
9
  highlighted: {},
@@ -11,24 +12,27 @@ const se = /* @__PURE__ */ N({
11
12
  itemValue: { default: "key" },
12
13
  itemLabel: { default: "label" },
13
14
  disabled: { type: Boolean },
14
- selectable: { type: Boolean }
15
+ selectable: { type: Boolean },
16
+ multiple: { type: Boolean },
17
+ required: { type: Boolean }
15
18
  }, {
16
19
  modelValue: {},
17
20
  modelModifiers: {}
18
21
  }),
19
- emits: /* @__PURE__ */ _(["click"], ["update:modelValue"]),
20
- setup(y, { expose: $, emit: R }) {
21
- const n = y, S = R, f = X(y, "modelValue"), v = p(!1), q = D(() => a.value.length > 1 ? "div" : "ul"), a = D(() => n.groups.length ? n.groups.filter(
22
+ emits: /* @__PURE__ */ D(["click"], ["update:modelValue"]),
23
+ setup(A, { expose: R, emit: G }) {
24
+ const n = A, O = G, f = Y(A, "modelValue"), v = p(!1), Q = M(() => a.value.length > 1 ? "div" : "ul"), a = M(() => n.groups.length ? n.groups.filter(
22
25
  (e) => {
23
26
  var t;
24
27
  return (t = n.items) == null ? void 0 : t.some((l) => l.group === e.id);
25
28
  }
26
- ) : [{ id: "", title: "" }]), g = p(null), h = p(null);
27
- function O(e) {
28
- S("click", e);
29
- }
30
- function Q(e) {
31
- f.value = e;
29
+ ) : [{ id: "", title: "" }]), { active: S } = ie({
30
+ active: f,
31
+ required: _(n, "required"),
32
+ multiple: _(n, "multiple")
33
+ }), g = p(null), h = p(null);
34
+ function U(e) {
35
+ O("click", e);
32
36
  }
33
37
  function j() {
34
38
  v.value = !0;
@@ -36,20 +40,20 @@ const se = /* @__PURE__ */ N({
36
40
  function z() {
37
41
  v.value = !1;
38
42
  }
39
- function G(e) {
40
- var s;
41
- if (!n.items || (s = g.value) != null && s.contains(e.relatedTarget))
43
+ function H(e) {
44
+ var i;
45
+ if (!n.items || (i = g.value) != null && i.contains(e.relatedTarget))
42
46
  return;
43
47
  let t;
44
- f.value ? t = n.items.findIndex((i) => i[n.itemValue] === f.value) : t = k();
48
+ f.value ? t = n.items.findIndex((s) => s[n.itemValue] === f.value) : t = I();
45
49
  const l = v.value;
46
- u(t, l);
50
+ r(t, l);
47
51
  }
48
- const I = p("");
49
- let V;
50
- function H(e) {
52
+ const k = p("");
53
+ let L;
54
+ function K(e) {
51
55
  var t;
52
- switch (window.clearTimeout(V), ["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key) && e.preventDefault(), e.key) {
56
+ switch (window.clearTimeout(L), ["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key) && e.preventDefault(), e.key) {
53
57
  case "ArrowDown":
54
58
  m("next");
55
59
  break;
@@ -64,159 +68,165 @@ const se = /* @__PURE__ */ N({
64
68
  break;
65
69
  }
66
70
  if (/^[a-z]$/i.test(e.key)) {
67
- I.value += e.key.toLowerCase();
71
+ k.value += e.key.toLowerCase();
68
72
  const l = ((t = n.items) == null ? void 0 : t.length) || 0;
69
- for (let s = 0; s < l; s++)
70
- if (n.items[s][n.itemLabel].toLowerCase().startsWith(I.value)) {
71
- u(s);
73
+ for (let i = 0; i < l; i++)
74
+ if (n.items[i][n.itemLabel].toLowerCase().startsWith(k.value)) {
75
+ r(i);
72
76
  break;
73
77
  }
74
78
  e.preventDefault(), e.stopPropagation();
75
79
  }
76
- V = window.setTimeout(function() {
77
- I.value = "";
80
+ L = window.setTimeout(function() {
81
+ k.value = "";
78
82
  }, 500);
79
83
  }
80
84
  function m(e) {
81
85
  switch (e) {
82
86
  case "next":
83
87
  case "prev":
84
- u(W(e));
88
+ r(J(e));
85
89
  break;
86
90
  case "first":
87
- u(k());
91
+ r(I());
88
92
  break;
89
93
  case "last":
90
- u(A());
94
+ r(C());
91
95
  break;
92
96
  }
93
97
  }
94
- function u(e, t = !1) {
95
- var s;
96
- (s = o()[e]) == null || s.focus({ preventScroll: t });
98
+ function r(e, t = !1) {
99
+ var i;
100
+ (i = o()[e]) == null || i.focus({ preventScroll: t });
97
101
  }
98
102
  function o() {
99
103
  var t;
100
104
  const e = (t = g.value) == null ? void 0 : t.querySelectorAll("li");
101
105
  return e ? Array.from(e) : [];
102
106
  }
103
- function K(e) {
107
+ function P(e) {
104
108
  return o()[e];
105
109
  }
106
- function P() {
110
+ function W() {
107
111
  return o().indexOf(document.activeElement);
108
112
  }
109
- function k() {
113
+ function I() {
110
114
  const e = o(), t = e.find((l) => w(l));
111
115
  return t ? e.indexOf(t) : -1;
112
116
  }
113
- function A() {
117
+ function C() {
114
118
  const e = o(), t = [...e].reverse().find((l) => w(l));
115
119
  return t ? e.indexOf(t) : -1;
116
120
  }
117
- function L(e, t, l) {
121
+ function V(e, t, l) {
118
122
  return t === "prev" && e <= 0 || t === "next" && e === l.length - 1;
119
123
  }
120
- function W(e) {
121
- const t = P();
122
- return C(t, e);
124
+ function J(e) {
125
+ const t = W();
126
+ return F(t, e);
123
127
  }
124
- function C(e, t) {
128
+ function F(e, t) {
125
129
  const l = o();
126
- if (L(e, t, l))
130
+ if (V(e, t, l))
127
131
  return e;
128
- let s = e + (t === "next" ? 1 : -1);
129
- for (; !w(l[s]); ) {
130
- if (L(s, t, l))
132
+ let i = e + (t === "next" ? 1 : -1);
133
+ for (; !w(l[i]); ) {
134
+ if (V(i, t, l))
131
135
  return e;
132
- s += t === "next" ? 1 : -1;
136
+ i += t === "next" ? 1 : -1;
133
137
  }
134
- return s;
138
+ return i;
135
139
  }
136
140
  function w(e) {
137
141
  return e.tabIndex === -2;
138
142
  }
139
- function J(e) {
143
+ function N(e) {
140
144
  var t;
141
145
  return e ? (t = n.items) == null ? void 0 : t.filter((l) => l.group === e) : n.items;
142
146
  }
143
- return $({
144
- getItem: K,
145
- getAdjacentItemIndex: C,
146
- getFirstFocusableItemIndex: k,
147
- getLastFocusableItemIndex: A
148
- }), (e, t) => (d(), x(Y(q.value), {
147
+ return Z(
148
+ S,
149
+ (e) => {
150
+ f.value = e;
151
+ },
152
+ { deep: !0 }
153
+ ), R({
154
+ getItem: P,
155
+ getAdjacentItemIndex: F,
156
+ getFirstFocusableItemIndex: I,
157
+ getLastFocusableItemIndex: C
158
+ }), (e, t) => (d(), y(ee(Q.value), {
149
159
  id: n.id,
150
160
  ref_key: "listRef",
151
161
  ref: g,
152
- class: Z(["q-list", { "q-list--disabled": n.disabled }, n.class]),
162
+ class: te(["q-list", { "q-list--disabled": n.disabled }, n.class]),
153
163
  role: "listbox",
154
164
  tabindex: n.disabled ? -1 : 0,
155
- onFocus: G,
165
+ onFocus: H,
156
166
  onMousedown: j,
157
167
  onMouseup: z,
158
- onKeydown: H
168
+ onKeydown: K
159
169
  }, {
160
170
  default: b(() => [
161
- (d(!0), M(
162
- T,
163
- null,
164
- B(a.value, (l, s) => (d(), x(E(ee), {
165
- id: l.id,
166
- key: l.id,
167
- title: a.value.length === 1 ? void 0 : l.title
168
- }, {
169
- default: b(() => [
170
- (d(!0), M(
171
- T,
172
- null,
173
- B(J(l.id), (i, F) => (d(), x(E(te), {
174
- key: i[n.itemValue],
175
- ref_for: !0,
176
- ref_key: "listItemsRef",
177
- ref: h,
178
- "model-value": n.selectable && f.value === i[n.itemValue],
179
- value: i[n.itemValue],
180
- label: i[n.itemLabel],
181
- description: i.description,
182
- icon: i.icon,
183
- disabled: n.disabled || l.disabled || i.disabled,
184
- highlighted: n.highlighted === i[n.itemValue],
185
- selectable: n.selectable,
186
- onClick: () => O(i[n.itemValue]),
187
- "onUpdate:modelValue": () => Q(i[n.itemValue])
188
- }, {
189
- append: b(() => {
190
- var r, c;
191
- return [
192
- U(e.$slots, "item.append", {
193
- item: i,
194
- element: (c = (r = h.value) == null ? void 0 : r[F + s * a.value.length]) == null ? void 0 : c.$el
195
- })
196
- ];
197
- }),
198
- default: b(() => {
199
- var r, c;
200
- return [
201
- U(e.$slots, "item", {
202
- item: i,
203
- element: (c = (r = h.value) == null ? void 0 : r[F + s * a.value.length]) == null ? void 0 : c.$el
204
- })
205
- ];
206
- }),
207
- _: 2
208
- /* DYNAMIC */
209
- }, 1032, ["model-value", "value", "label", "description", "icon", "disabled", "highlighted", "selectable", "onClick", "onUpdate:modelValue"]))),
210
- 128
211
- /* KEYED_FRAGMENT */
212
- ))
213
- ]),
214
- _: 2
215
- /* DYNAMIC */
216
- }, 1032, ["id", "title"]))),
217
- 128
218
- /* KEYED_FRAGMENT */
219
- ))
171
+ x(e.$slots, "default", {}, () => [
172
+ (d(!0), q(
173
+ T,
174
+ null,
175
+ $(a.value, (l, i) => (d(), y(E(ne), {
176
+ id: l.id,
177
+ key: l.id,
178
+ title: a.value.length === 1 ? void 0 : l.title
179
+ }, {
180
+ default: b(() => [
181
+ (d(!0), q(
182
+ T,
183
+ null,
184
+ $(N(l.id), (s, B) => (d(), y(E(le), {
185
+ key: s[n.itemValue],
186
+ ref_for: !0,
187
+ ref_key: "listItemsRef",
188
+ ref: h,
189
+ value: s[n.itemValue],
190
+ label: s[n.itemLabel],
191
+ description: s.description,
192
+ icon: s.icon,
193
+ disabled: n.disabled || l.disabled || s.disabled,
194
+ highlighted: n.highlighted === s[n.itemValue],
195
+ selectable: n.selectable || n.multiple || s.selectable,
196
+ onClick: () => U(s[n.itemValue])
197
+ }, {
198
+ append: b(() => {
199
+ var u, c;
200
+ return [
201
+ x(e.$slots, "item.append", {
202
+ item: s,
203
+ element: (c = (u = h.value) == null ? void 0 : u[B + i * a.value.length]) == null ? void 0 : c.$el
204
+ })
205
+ ];
206
+ }),
207
+ default: b(() => {
208
+ var u, c;
209
+ return [
210
+ x(e.$slots, "item", {
211
+ item: s,
212
+ element: (c = (u = h.value) == null ? void 0 : u[B + i * a.value.length]) == null ? void 0 : c.$el
213
+ })
214
+ ];
215
+ }),
216
+ _: 2
217
+ /* DYNAMIC */
218
+ }, 1032, ["value", "label", "description", "icon", "disabled", "highlighted", "selectable", "onClick"]))),
219
+ 128
220
+ /* KEYED_FRAGMENT */
221
+ ))
222
+ ]),
223
+ _: 2
224
+ /* DYNAMIC */
225
+ }, 1032, ["id", "title"]))),
226
+ 128
227
+ /* KEYED_FRAGMENT */
228
+ ))
229
+ ])
220
230
  ]),
221
231
  _: 3
222
232
  /* FORWARDED */
@@ -224,5 +234,5 @@ const se = /* @__PURE__ */ N({
224
234
  }
225
235
  });
226
236
  export {
227
- se as default
237
+ re as default
228
238
  };
@@ -1 +1 @@
1
- {"version":3,"file":"QListItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QList/QListItem.vue"],"names":[],"mappings":"AAgDA;AAqGC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAMvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,KAAK,WAAW,GAAG,cAAc,CAAC;AA4CnC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAkGT,OAAO,IAA6B;;yBAZrB,GAAG;yBACH,GAAG;wBACH,GAAG;;;;EAe/B;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;uFASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"QListItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QList/QListItem.vue"],"names":[],"mappings":"AAiDA;AAyHC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAMvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAO7C,KAAK,WAAW,GAAG,cAAc,CAAC;AA6DnC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAmGT,OAAO,IAA6B;;yBAZrB,GAAG;yBACH,GAAG;wBACH,GAAG;;;;EAe/B;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;uFASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,14 +1,15 @@
1
- import { defineComponent as g, mergeModels as p, useModel as q, createElementBlock as a, openBlock as i, withModifiers as B, normalizeClass as V, unref as o, renderSlot as d, createElementVNode as c, createCommentVNode as s, createBlock as u, createTextVNode as C, normalizeProps as f, mergeProps as _, toDisplayString as h, createVNode as N, guardReactiveProps as D } from "vue";
2
- import { DEFAULT_ICONS as E } from "./types.js";
3
- import { QIcon as r } from "../QIcon/index.js";
4
- import { useId as I } from "../../composables/uid.js";
5
- const M = ["id", "data-key", "tabindex", "aria-label", "aria-selected"], P = { class: "q-list-item__container" }, w = { class: "q-list-item__content" }, S = {
1
+ import { defineComponent as q, mergeModels as p, useModel as w, watch as B, createElementBlock as d, openBlock as o, withModifiers as V, normalizeClass as C, unref as s, renderSlot as c, createElementVNode as r, createCommentVNode as n, createBlock as f, createTextVNode as E, normalizeProps as h, mergeProps as _, toDisplayString as v, createVNode as I, guardReactiveProps as N } from "vue";
2
+ import { DEFAULT_ICONS as D } from "./types.js";
3
+ import { QIcon as m } from "../QIcon/index.js";
4
+ import { useId as L } from "../../composables/uid.js";
5
+ import { useGroupItem as M } from "../../composables/useGroup/index.js";
6
+ const P = ["id", "data-key", "tabindex", "aria-label", "aria-selected"], Q = { class: "q-list-item__container" }, x = { class: "q-list-item__content" }, S = {
6
7
  key: 0,
7
8
  class: "q-list-item__description"
8
9
  }, T = {
9
10
  key: 0,
10
11
  class: "q-list-item__check-container"
11
- }, Q = /* @__PURE__ */ g({
12
+ }, O = /* @__PURE__ */ q({
12
13
  __name: "QListItem",
13
14
  props: /* @__PURE__ */ p({
14
15
  value: {},
@@ -18,86 +19,99 @@ const M = ["id", "data-key", "tabindex", "aria-label", "aria-selected"], P = { c
18
19
  highlighted: { type: Boolean },
19
20
  disabled: { type: Boolean },
20
21
  description: {},
21
- icons: { default: () => E }
22
+ icons: { default: () => D }
22
23
  }, {
23
24
  modelValue: { type: Boolean },
24
25
  modelModifiers: {}
25
26
  }),
26
27
  emits: /* @__PURE__ */ p(["click"], ["update:modelValue"]),
27
- setup(m, { emit: k }) {
28
- const e = m, b = k, l = q(m, "modelValue"), v = I();
29
- function n() {
30
- e.disabled || (b("click"), e.selectable && (l.value = !0));
28
+ setup(u, { emit: b }) {
29
+ const e = u, k = b, l = w(u, "modelValue"), y = L(), i = M(e.value);
30
+ if (!i)
31
+ throw new Error(
32
+ "QListItem: Failed to retrieve group item. Ensure the component is used within a QList context."
33
+ );
34
+ function a() {
35
+ e.disabled || (k("click"), e.selectable && (i == null || i.toggle()));
31
36
  }
32
- function y(t) {
33
- t.key === "Tab" && n(), (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), n());
37
+ function g(t) {
38
+ t.key === "Tab" && a(), (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), a());
34
39
  }
35
- return (t, $) => (i(), a("li", {
36
- id: o(v),
40
+ return B(
41
+ i.isActive,
42
+ (t) => {
43
+ l.value = t;
44
+ },
45
+ {
46
+ immediate: !0
47
+ }
48
+ ), (t, $) => (o(), d("li", {
49
+ id: s(y),
37
50
  "data-key": e.value,
38
51
  role: "option",
39
52
  tabindex: e.disabled ? void 0 : -2,
40
- class: V([
53
+ class: C([
41
54
  "q-list-item",
42
55
  {
43
56
  "q-list-item--selected": l.value,
57
+ "q-list-item--selectable": e.selectable,
44
58
  "q-list-item--disabled": e.disabled,
45
59
  "q-list-item--highlighted": e.highlighted
46
60
  }
47
61
  ]),
48
62
  "aria-label": e.label,
49
63
  "aria-selected": e.disabled ? void 0 : l.value,
50
- onKeydown: y,
51
- onClick: B(n, ["stop", "prevent"])
64
+ onKeydown: g,
65
+ onClick: V(a, ["stop", "prevent"])
52
66
  }, [
53
- d(t.$slots, "prepend"),
54
- c("div", P, [
55
- c("div", w, [
56
- d(t.$slots, "default", {}, () => [
57
- e.icon ? (i(), u(
58
- o(r),
59
- f(_({ key: 0 }, e.icon)),
67
+ c(t.$slots, "prepend"),
68
+ r("div", Q, [
69
+ r("div", x, [
70
+ c(t.$slots, "default", {}, () => [
71
+ e.icon ? (o(), f(
72
+ s(m),
73
+ h(_({ key: 0 }, e.icon)),
60
74
  null,
61
75
  16
62
76
  /* FULL_PROPS */
63
- )) : s("v-if", !0),
64
- C(
65
- " " + h(e.label),
77
+ )) : n("v-if", !0),
78
+ E(
79
+ " " + v(e.label),
66
80
  1
67
81
  /* TEXT */
68
82
  )
69
83
  ])
70
84
  ]),
71
- e.description ? (i(), a("div", S, [
72
- N(
73
- o(r),
74
- f(D(e.icons.description)),
85
+ e.description ? (o(), d("div", S, [
86
+ I(
87
+ s(m),
88
+ h(N(e.icons.description)),
75
89
  null,
76
90
  16
77
91
  /* FULL_PROPS */
78
92
  ),
79
- c(
93
+ r(
80
94
  "span",
81
95
  null,
82
- h(e.description),
96
+ v(e.description),
83
97
  1
84
98
  /* TEXT */
85
99
  )
86
- ])) : s("v-if", !0)
100
+ ])) : n("v-if", !0)
87
101
  ]),
88
- d(t.$slots, "append"),
89
- e.selectable ? (i(), a("div", T, [
90
- l.value ? (i(), u(
91
- o(r),
102
+ c(t.$slots, "append"),
103
+ e.selectable ? (o(), d("div", T, [
104
+ l.value ? (o(), f(
105
+ s(m),
92
106
  _({ key: 0 }, e.icons.check, { class: "q-list-item__check" }),
93
107
  null,
94
108
  16
95
109
  /* FULL_PROPS */
96
- )) : s("v-if", !0)
97
- ])) : s("v-if", !0)
98
- ], 42, M));
110
+ )) : n("v-if", !0)
111
+ ])) : n("v-if", !0)
112
+ ], 42, P));
99
113
  }
100
114
  });
101
115
  export {
102
- Q as default
116
+ O as default
103
117
  };
@@ -10,6 +10,8 @@ declare const QList: {
10
10
  itemLabel?: string;
11
11
  disabled?: boolean;
12
12
  selectable?: boolean;
13
+ multiple?: boolean;
14
+ required?: boolean;
13
15
  }> & Readonly<{
14
16
  onClick?: ((key: any) => any) | undefined;
15
17
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -120,6 +122,8 @@ declare const QList: {
120
122
  itemLabel?: string;
121
123
  disabled?: boolean;
122
124
  selectable?: boolean;
125
+ multiple?: boolean;
126
+ required?: boolean;
123
127
  }> & Readonly<{
124
128
  onClick?: ((key: any) => any) | undefined;
125
129
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -146,6 +150,8 @@ declare const QList: {
146
150
  itemLabel?: string;
147
151
  disabled?: boolean;
148
152
  selectable?: boolean;
153
+ multiple?: boolean;
154
+ required?: boolean;
149
155
  }> & Readonly<{
150
156
  onClick?: ((key: any) => any) | undefined;
151
157
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -164,6 +170,7 @@ declare const QList: {
164
170
  itemLabel: string;
165
171
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
166
172
  $slots: {
173
+ default?(_: {}): any;
167
174
  item?(_: {
168
175
  item: import('./types').Item;
169
176
  element: HTMLLIElement | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QList/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAKlD,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCASg1yB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAT56yB,CAAA;AACrC,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA8B,CAAA;AAC7C,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;EAAmC,CAAA;AAGvD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA;AAG3C,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QList/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAKlD,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCASg1yB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAT56yB,CAAA;AACrC,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA8B,CAAA;AAC7C,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;EAAmC,CAAA;AAGvD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA;AAG3C,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAA"}
@@ -38,6 +38,14 @@ export type QListProps = QBaseComponentProps & {
38
38
  * Indicates whether the list items are selectable.
39
39
  */
40
40
  selectable?: boolean;
41
+ /**
42
+ * Indicates if options can be deselected.
43
+ */
44
+ multiple?: boolean;
45
+ /**
46
+ * Indicates if there should be at least one option selected.
47
+ */
48
+ required?: boolean;
41
49
  };
42
50
  export type QListItemProps = {
43
51
  /**