@quidgest/ui 0.29.0 → 0.30.0

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 (245) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +2 -20
  3. package/dist/json/api.json +1059 -803
  4. package/dist/ui.css +77 -29
  5. package/dist/ui.esm.js +1093 -994
  6. package/dist/ui.min.css +1 -1
  7. package/dist/ui.scss +75 -24
  8. package/esm/components/QAccordion/QAccordion.d.ts.map +1 -1
  9. package/esm/components/QAccordion/QAccordion.vue.js +2 -0
  10. package/esm/components/QAccordion/QAccordionItem.d.ts.map +1 -1
  11. package/esm/components/QAccordion/QAccordionItem.vue.js +3 -0
  12. package/esm/components/QAccordion/index.d.ts +3 -0
  13. package/esm/components/QAccordion/index.d.ts.map +1 -1
  14. package/esm/components/QAccordion/types.d.ts +8 -0
  15. package/esm/components/QAccordion/types.d.ts.map +1 -1
  16. package/esm/components/QAlert/QAlert.d.ts +1 -1
  17. package/esm/components/QAlert/index.d.ts +3 -3
  18. package/esm/components/QAvatar/QAvatar.d.ts +1 -1
  19. package/esm/components/QAvatar/index.d.ts +3 -3
  20. package/esm/components/QBadgeIndicator/QBadgeIndicator.d.ts.map +1 -1
  21. package/esm/components/QBadgeIndicator/QBadgeIndicator.vue.js +23 -13
  22. package/esm/components/QBadgeIndicator/types.d.ts +13 -0
  23. package/esm/components/QBadgeIndicator/types.d.ts.map +1 -1
  24. package/esm/components/QBreadcrumbs/QBreadcrumbs.d.ts.map +1 -1
  25. package/esm/components/QBreadcrumbs/QBreadcrumbs.vue.js +31 -31
  26. package/esm/components/QButton/QButton.d.ts.map +1 -1
  27. package/esm/components/QButton/QButton.vue.js +54 -48
  28. package/esm/components/QButtonGroup/QButtonGroup.d.ts.map +1 -1
  29. package/esm/components/QCard/QCard.d.ts.map +1 -1
  30. package/esm/components/QCard/QCard.vue.js +48 -32
  31. package/esm/components/QCard/types.d.ts +9 -0
  32. package/esm/components/QCard/types.d.ts.map +1 -1
  33. package/esm/components/QCarousel/QCarousel.d.ts +1 -0
  34. package/esm/components/QCarousel/QCarousel.d.ts.map +1 -1
  35. package/esm/components/QCarousel/QCarousel.vue.js +84 -80
  36. package/esm/components/QCarousel/index.d.ts +6 -0
  37. package/esm/components/QCarousel/index.d.ts.map +1 -1
  38. package/esm/components/QCarousel/types.d.ts +9 -1
  39. package/esm/components/QCarousel/types.d.ts.map +1 -1
  40. package/esm/components/QCheckbox/QCheckbox.d.ts.map +1 -1
  41. package/esm/components/QCheckbox/QCheckbox.vue.js +9 -1
  42. package/esm/components/QCheckbox/index.d.ts +3 -0
  43. package/esm/components/QCheckbox/index.d.ts.map +1 -1
  44. package/esm/components/QCheckbox/types.d.ts +8 -0
  45. package/esm/components/QCheckbox/types.d.ts.map +1 -1
  46. package/esm/components/QCollapsible/QCollapsible.d.ts +1 -0
  47. package/esm/components/QCollapsible/QCollapsible.d.ts.map +1 -1
  48. package/esm/components/QCollapsible/QCollapsible.vue.js +55 -47
  49. package/esm/components/QCollapsible/index.d.ts +6 -0
  50. package/esm/components/QCollapsible/index.d.ts.map +1 -1
  51. package/esm/components/QCollapsible/types.d.ts +9 -0
  52. package/esm/components/QCollapsible/types.d.ts.map +1 -1
  53. package/esm/components/QColorPicker/QColorPicker.d.ts.map +1 -1
  54. package/esm/components/QColorPicker/QColorPicker.vue.js +4 -1
  55. package/esm/components/QColorPicker/index.d.ts +3 -0
  56. package/esm/components/QColorPicker/index.d.ts.map +1 -1
  57. package/esm/components/QColorPicker/types.d.ts +7 -0
  58. package/esm/components/QColorPicker/types.d.ts.map +1 -1
  59. package/esm/components/QCombobox/QCombobox.d.ts +7 -0
  60. package/esm/components/QCombobox/QCombobox.d.ts.map +1 -1
  61. package/esm/components/QCombobox/QCombobox.vue.js +258 -235
  62. package/esm/components/QCombobox/constants.d.ts +1 -0
  63. package/esm/components/QCombobox/constants.d.ts.map +1 -1
  64. package/esm/components/QCombobox/constants.js +1 -0
  65. package/esm/components/QCombobox/index.d.ts +11 -0
  66. package/esm/components/QCombobox/index.d.ts.map +1 -1
  67. package/esm/components/QDateTimePicker/QDateTimePicker.d.ts +180 -0
  68. package/esm/components/QDateTimePicker/QDateTimePicker.d.ts.map +1 -1
  69. package/esm/components/QDateTimePicker/QDateTimePicker.vue.js +637 -542
  70. package/esm/components/QDateTimePicker/index.d.ts +90 -0
  71. package/esm/components/QDateTimePicker/index.d.ts.map +1 -1
  72. package/esm/components/QDialog/QDialog.d.ts.map +1 -1
  73. package/esm/components/QDialog/QDialog.vue.js +2 -0
  74. package/esm/components/QDialog/types.d.ts +3 -1
  75. package/esm/components/QDialog/types.d.ts.map +1 -1
  76. package/esm/components/QDropdownMenu/QDropdownMenu.d.ts +3 -1
  77. package/esm/components/QDropdownMenu/QDropdownMenu.d.ts.map +1 -1
  78. package/esm/components/QDropdownMenu/QDropdownMenu.vue.js +84 -27
  79. package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts +9 -2
  80. package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts.map +1 -1
  81. package/esm/components/QDropdownMenu/QDropdownMenuContent.vue.js +168 -135
  82. package/esm/components/QDropdownMenu/ids.d.ts +8 -0
  83. package/esm/components/QDropdownMenu/ids.d.ts.map +1 -0
  84. package/esm/components/QDropdownMenu/ids.js +6 -0
  85. package/esm/components/QDropdownMenu/index.d.ts +9 -3
  86. package/esm/components/QDropdownMenu/index.d.ts.map +1 -1
  87. package/esm/components/QDropdownMenu/types.d.ts +3 -1
  88. package/esm/components/QDropdownMenu/types.d.ts.map +1 -1
  89. package/esm/components/QField/QField.d.ts +2 -0
  90. package/esm/components/QField/QField.d.ts.map +1 -1
  91. package/esm/components/QField/QField.vue.js +68 -61
  92. package/esm/components/QField/ids.d.ts +15 -0
  93. package/esm/components/QField/ids.d.ts.map +1 -0
  94. package/esm/components/QField/ids.js +10 -0
  95. package/esm/components/QField/index.d.ts +2 -0
  96. package/esm/components/QField/index.d.ts.map +1 -1
  97. package/esm/components/QFileUpload/QFileUpload.d.ts +355 -0
  98. package/esm/components/QFileUpload/QFileUpload.d.ts.map +1 -1
  99. package/esm/components/QFileUpload/QFileUpload.vue.js +118 -88
  100. package/esm/components/QFileUpload/constants.d.ts +2 -0
  101. package/esm/components/QFileUpload/constants.d.ts.map +1 -1
  102. package/esm/components/QFileUpload/constants.js +3 -1
  103. package/esm/components/QFileUpload/index.d.ts +182 -0
  104. package/esm/components/QFileUpload/index.d.ts.map +1 -1
  105. package/esm/components/QIcon/QIconFont.d.ts.map +1 -1
  106. package/esm/components/QIcon/QIconFont.vue.js +2 -1
  107. package/esm/components/QIcon/QIconImg.d.ts.map +1 -1
  108. package/esm/components/QIcon/QIconImg.vue.js +1 -0
  109. package/esm/components/QIcon/QIconSvg.d.ts.map +1 -1
  110. package/esm/components/QInputGroup/QInputGroup.d.ts +5 -0
  111. package/esm/components/QInputGroup/QInputGroup.d.ts.map +1 -1
  112. package/esm/components/QInputGroup/QInputGroup.vue.js +48 -41
  113. package/esm/components/QInputGroup/index.d.ts +3 -0
  114. package/esm/components/QInputGroup/index.d.ts.map +1 -1
  115. package/esm/components/QLabel/QLabel.d.ts.map +1 -1
  116. package/esm/components/QLabel/QLabel.vue.js +21 -19
  117. package/esm/components/QLabel/ids.d.ts +9 -0
  118. package/esm/components/QLabel/ids.d.ts.map +1 -0
  119. package/esm/components/QLabel/ids.js +6 -0
  120. package/esm/components/QLineLoader/QLineLoader.d.ts.map +1 -1
  121. package/esm/components/QLineLoader/QLineLoader.vue.js +15 -14
  122. package/esm/components/QList/QList.d.ts +3 -3
  123. package/esm/components/QList/QList.d.ts.map +1 -1
  124. package/esm/components/QList/QList.vue.js +135 -117
  125. package/esm/components/QList/QListItem.d.ts.map +1 -1
  126. package/esm/components/QList/QListItem.vue.js +54 -50
  127. package/esm/components/QList/context.d.ts +8 -0
  128. package/esm/components/QList/context.d.ts.map +1 -0
  129. package/esm/components/QList/context.js +4 -0
  130. package/esm/components/QMeter/QMeter.d.ts.map +1 -1
  131. package/esm/components/QMeter/QMeter.vue.js +38 -19
  132. package/esm/components/QMeter/index.d.ts +2 -10
  133. package/esm/components/QMeter/index.d.ts.map +1 -1
  134. package/esm/components/QMeter/types.d.ts +9 -1
  135. package/esm/components/QMeter/types.d.ts.map +1 -1
  136. package/esm/components/QObfuscation/QObfuscation.d.ts.map +1 -1
  137. package/esm/components/QObfuscation/QObfuscation.vue.js +42 -26
  138. package/esm/components/QObfuscation/index.d.ts.map +1 -1
  139. package/esm/components/QOverflow/QOverflow.d.ts.map +1 -1
  140. package/esm/components/QOverflow/QOverflow.vue.js +94 -73
  141. package/esm/components/QOverlay/QOverlay.d.ts.map +1 -1
  142. package/esm/components/QOverlay/QOverlay.vue.js +162 -132
  143. package/esm/components/QPasswordField/QPasswordField.d.ts +4 -0
  144. package/esm/components/QPasswordField/QPasswordField.d.ts.map +1 -1
  145. package/esm/components/QPasswordField/QPasswordField.vue.js +72 -66
  146. package/esm/components/QPasswordField/QPasswordFieldMeterOverlay.d.ts.map +1 -1
  147. package/esm/components/QPasswordField/QPasswordFieldMeterOverlay.vue.js +4 -2
  148. package/esm/components/QPasswordField/index.d.ts +2 -0
  149. package/esm/components/QPasswordField/index.d.ts.map +1 -1
  150. package/esm/components/QPasswordField/types.d.ts +4 -0
  151. package/esm/components/QPasswordField/types.d.ts.map +1 -1
  152. package/esm/components/QPhoneField/QPhoneField.d.ts +34 -3
  153. package/esm/components/QPhoneField/QPhoneField.d.ts.map +1 -1
  154. package/esm/components/QPhoneField/QPhoneField.vue.js +98 -102
  155. package/esm/components/QPhoneField/constants.d.ts +2 -1
  156. package/esm/components/QPhoneField/constants.d.ts.map +1 -1
  157. package/esm/components/QPhoneField/constants.js +1 -1
  158. package/esm/components/QPhoneField/index.d.ts +26 -8
  159. package/esm/components/QPhoneField/index.d.ts.map +1 -1
  160. package/esm/components/QPhoneField/types.d.ts +5 -2
  161. package/esm/components/QPhoneField/types.d.ts.map +1 -1
  162. package/esm/components/QPopover/QPopover.d.ts +1 -1
  163. package/esm/components/QPopover/index.d.ts +3 -3
  164. package/esm/components/QProgress/QProgress.d.ts.map +1 -1
  165. package/esm/components/QProgress/QProgress.vue.js +1 -1
  166. package/esm/components/QPropertyList/QPropertyList.vue.js +1 -1
  167. package/esm/components/QPropertyList/QPropertyListRow.d.ts.map +1 -1
  168. package/esm/components/QPropertyList/index.d.ts.map +1 -1
  169. package/esm/components/QRadioGroup/QRadioButton.d.ts.map +1 -1
  170. package/esm/components/QRadioGroup/QRadioButton.vue.js +1 -1
  171. package/esm/components/QRadioGroup/QRadioGroup.d.ts.map +1 -1
  172. package/esm/components/QRadioGroup/QRadioGroup.vue.js +53 -41
  173. package/esm/components/QRemoveScrollBar/utils/gap.d.ts.map +1 -1
  174. package/esm/components/QSection/QSection.d.ts.map +1 -1
  175. package/esm/components/QSection/QSection.vue.js +3 -2
  176. package/esm/components/QSection/types.d.ts +3 -4
  177. package/esm/components/QSection/types.d.ts.map +1 -1
  178. package/esm/components/QSelect/QSelect.d.ts +6 -0
  179. package/esm/components/QSelect/QSelect.d.ts.map +1 -1
  180. package/esm/components/QSelect/QSelect.vue.js +405 -355
  181. package/esm/components/QSelect/constants.d.ts +2 -0
  182. package/esm/components/QSelect/constants.d.ts.map +1 -1
  183. package/esm/components/QSelect/constants.js +3 -1
  184. package/esm/components/QSelect/index.d.ts +8 -0
  185. package/esm/components/QSelect/index.d.ts.map +1 -1
  186. package/esm/components/QSidebar/QSidebarItem.d.ts +1 -0
  187. package/esm/components/QSidebar/QSidebarItem.d.ts.map +1 -1
  188. package/esm/components/QSidebar/QSidebarItem.vue.js +3 -0
  189. package/esm/components/QSidebar/QSidebarPanel.d.ts.map +1 -1
  190. package/esm/components/QSidebar/QSidebarPanel.vue.js +93 -32
  191. package/esm/components/QSidebar/index.d.ts +3 -0
  192. package/esm/components/QSidebar/index.d.ts.map +1 -1
  193. package/esm/components/QSidebar/types.d.ts +20 -1
  194. package/esm/components/QSidebar/types.d.ts.map +1 -1
  195. package/esm/components/QSkeletonLoader/QSkeletonLoader.d.ts.map +1 -1
  196. package/esm/components/QSkeletonLoader/QSkeletonLoader.vue.js +16 -15
  197. package/esm/components/QSpinnerLoader/QSpinnerLoader.d.ts.map +1 -1
  198. package/esm/components/QSpinnerLoader/QSpinnerLoader.vue.js +11 -10
  199. package/esm/components/QSteps/QSteps.d.ts +3 -2
  200. package/esm/components/QSteps/QSteps.d.ts.map +1 -1
  201. package/esm/components/QSteps/QSteps.vue.js +171 -152
  202. package/esm/components/QSteps/QStepsNav.d.ts +7 -0
  203. package/esm/components/QSteps/QStepsNav.d.ts.map +1 -1
  204. package/esm/components/QSteps/QStepsNav.vue.js +29 -15
  205. package/esm/components/QSteps/constants.d.ts +4 -2
  206. package/esm/components/QSteps/constants.d.ts.map +1 -1
  207. package/esm/components/QSteps/constants.js +2 -0
  208. package/esm/components/QSwitch/QSwitch.d.ts +2 -0
  209. package/esm/components/QSwitch/QSwitch.d.ts.map +1 -1
  210. package/esm/components/QSwitch/QSwitch.vue.js +12 -2
  211. package/esm/components/QSwitch/index.d.ts +4 -0
  212. package/esm/components/QSwitch/index.d.ts.map +1 -1
  213. package/esm/components/QSwitch/types.d.ts +8 -0
  214. package/esm/components/QSwitch/types.d.ts.map +1 -1
  215. package/esm/components/QTabs/QTab.d.ts.map +1 -1
  216. package/esm/components/QTabs/QTab.vue.js +1 -0
  217. package/esm/components/QTextArea/QTextArea.d.ts.map +1 -1
  218. package/esm/components/QTextArea/QTextArea.vue.js +6 -2
  219. package/esm/components/QTextField/QTextField.d.ts +4 -0
  220. package/esm/components/QTextField/QTextField.d.ts.map +1 -1
  221. package/esm/components/QTextField/QTextField.vue.js +5 -3
  222. package/esm/components/QTextField/index.d.ts +2 -0
  223. package/esm/components/QTextField/index.d.ts.map +1 -1
  224. package/esm/components/QThemeProvider/QThemeProvider.d.ts.map +1 -1
  225. package/esm/components/QToast/QToast.d.ts +1 -0
  226. package/esm/components/QToast/QToast.d.ts.map +1 -1
  227. package/esm/components/QToast/QToast.vue.js +89 -85
  228. package/esm/components/QToast/index.d.ts +6 -0
  229. package/esm/components/QToast/index.d.ts.map +1 -1
  230. package/esm/components/QToast/types.d.ts +8 -0
  231. package/esm/components/QToast/types.d.ts.map +1 -1
  232. package/esm/components/QTooltip/QTooltip.d.ts.map +1 -1
  233. package/esm/components/QTooltip/QTooltip.vue.js +19 -11
  234. package/esm/components/__internal__/QClearButton/QClearButton.d.ts.map +1 -1
  235. package/esm/components/__internal__/QHelpPopover/QHelpPopover.d.ts.map +1 -1
  236. package/esm/index.d.ts.map +1 -1
  237. package/esm/utils/focus.d.ts +10 -0
  238. package/esm/utils/focus.d.ts.map +1 -1
  239. package/esm/utils/focus.js +5 -2
  240. package/esm/utils/loader.d.ts +19 -0
  241. package/esm/utils/loader.d.ts.map +1 -0
  242. package/esm/utils/loader.js +6 -0
  243. package/package.json +24 -23
  244. package/dist/ui.js +0 -1846
  245. package/dist/ui.min.js +0 -1846
@@ -3,16 +3,18 @@ import { useGroup as t } from "../../composables/useGroup/index.js";
3
3
  import { useId as n } from "../../composables/useId/index.js";
4
4
  import { useColor as r } from "../../composables/useColor/index.js";
5
5
  import { DEFAULT_ICONS as i } from "./constants.js";
6
- import { groupListItems as a } from "./groupListItems.js";
7
- import { QListItem as o, QListItemGroup as s } from "./index.js";
8
- import { Fragment as c, computed as l, createBlock as u, createElementBlock as d, defineComponent as f, normalizeClass as p, normalizeStyle as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toRef as y, unref as b, watch as x, withCtx as S } from "vue";
6
+ import { ListItemRoleSymbol as a } from "./context.js";
7
+ import { groupListItems as ee } from "./groupListItems.js";
8
+ import { QListItem as te, QListItemGroup as ne } from "./index.js";
9
+ import { Fragment as o, computed as s, createBlock as c, createElementBlock as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, provide as re, ref as m, renderList as h, renderSlot as g, toRef as _, unref as v, useAttrs as ie, watch as ae, withCtx as y } from "vue";
9
10
  //#region src/components/QList/QList.vue?vue&type=script&setup=true&lang.ts
10
- var ee = [
11
+ var oe = [
11
12
  "id",
13
+ "role",
12
14
  "aria-label",
13
15
  "aria-multiselectable",
14
16
  "tabindex"
15
- ], C = /*@__PURE__*/ f({
17
+ ], b = /*@__PURE__*/ u({
16
18
  __name: "QList",
17
19
  props: {
18
20
  id: {},
@@ -40,111 +42,122 @@ var ee = [
40
42
  "click",
41
43
  "mouseenter:item"
42
44
  ],
43
- setup(i, { expose: f, emit: C }) {
44
- let w = i, T = C, E = n(y(w, "id")), { style: D } = r("primary"), O = l(() => ({
45
+ setup(i, { expose: u, emit: b }) {
46
+ let x = i, S = b, se = n(_(x, "id")), C = ie().role === "menu", w = C ? "menu" : "listbox", T = C ? "menuitem" : "option";
47
+ re(a, T);
48
+ function E(e) {
49
+ return C && e.items?.length > 0;
50
+ }
51
+ let { style: D } = r("primary"), ce = s(() => ({
45
52
  "--q-list-tint-color": D.value?.tintColor,
46
53
  "--q-list-tint-color-rgb": D.value?.tintColorRgb
47
54
  }));
48
- e({ QListItem: { icons: y(w, "icons") } });
49
- let k = g(!1), A = l(() => a(w.items, w.groups)), j = l(() => A.value.flatMap((e) => e.items)), { active: M } = t({
50
- active: y(w, "modelValue"),
51
- required: y(w, "required"),
52
- multiple: y(w, "multiple")
53
- }), N = g(null), P = g(null), F = l(() => new Map(P.value?.map((e) => [e.$props.value, e.$el])));
54
- function I(e) {
55
- T("click", e);
56
- }
57
- function L(e) {
58
- T("mouseenter:item", e);
59
- }
60
- function R() {
61
- k.value = !0;
62
- }
63
- function z() {
64
- k.value = !1;
65
- }
66
- function B(e) {
67
- if (!w.items || N.value?.contains(e.relatedTarget)) return;
55
+ e({ QListItem: { icons: _(x, "icons") } });
56
+ let O = m(!1), k = m(!1), A = s(() => x.disabled || k.value ? -1 : 0);
57
+ function j(e) {
58
+ k.value = e, F.value?.setAttribute("tabindex", String(A.value));
59
+ }
60
+ let M = s(() => ee(x.items, x.groups)), N = s(() => M.value.flatMap((e) => e.items)), { active: P } = t({
61
+ active: _(x, "modelValue"),
62
+ required: _(x, "required"),
63
+ multiple: _(x, "multiple")
64
+ }), F = m(null), I = m(null), L = s(() => new Map(I.value?.map((e) => [e.$props.value, e.$el])));
65
+ function R(e) {
66
+ S("click", e);
67
+ }
68
+ function z(e) {
69
+ S("mouseenter:item", e);
70
+ }
71
+ function B() {
72
+ O.value = !0;
73
+ }
74
+ function V() {
75
+ O.value = !1;
76
+ }
77
+ function H(e) {
78
+ if (!x.items || F.value?.contains(e.relatedTarget)) return;
68
79
  let t = -1;
69
- w.multiple ? M.value?.length > 0 && (t = j.value.findIndex((e) => M.value.includes(e[w.itemValue]))) : M.value && (t = j.value.findIndex((e) => e[w.itemValue] === M.value)), t === -1 && (t = Y());
70
- let n = k.value;
71
- G(t, n);
72
- }
73
- let V = g(""), H;
74
- function U(e) {
75
- switch (window.clearTimeout(H), [
76
- "ArrowDown",
77
- "ArrowUp",
78
- "Home",
79
- "End"
80
- ].includes(e.key) && e.preventDefault(), e.key) {
81
- case "ArrowDown":
82
- W("next");
83
- break;
84
- case "ArrowUp":
85
- W("prev");
86
- break;
87
- case "Home":
88
- W("first");
89
- break;
90
- case "End":
91
- W("last");
92
- break;
93
- default: break;
94
- }
95
- if (/^[a-z]$/i.test(e.key)) {
96
- V.value += e.key.toLowerCase();
97
- let t = j.value.findIndex((e) => e[w.itemLabel].toLowerCase().startsWith(V.value));
98
- t !== -1 && G(t), e.preventDefault(), e.stopPropagation();
80
+ x.multiple ? P.value?.length > 0 && (t = N.value.findIndex((e) => P.value.includes(e[x.itemValue]))) : P.value && (t = N.value.findIndex((e) => e[x.itemValue] === P.value)), t === -1 && (t = Y());
81
+ let n = O.value;
82
+ K(t, n);
83
+ }
84
+ let U = m(""), W;
85
+ function le(e) {
86
+ if (!(e.altKey || e.ctrlKey || e.metaKey)) {
87
+ switch (window.clearTimeout(W), e.key === "Tab" && e.shiftKey && j(!0), [
88
+ "ArrowDown",
89
+ "ArrowUp",
90
+ "Home",
91
+ "End"
92
+ ].includes(e.key) && e.preventDefault(), e.key) {
93
+ case "ArrowDown":
94
+ G("next");
95
+ break;
96
+ case "ArrowUp":
97
+ G("prev");
98
+ break;
99
+ case "Home":
100
+ G("first");
101
+ break;
102
+ case "End":
103
+ G("last");
104
+ break;
105
+ default: break;
106
+ }
107
+ if (/^[a-z]$/i.test(e.key)) {
108
+ U.value += e.key.toLowerCase();
109
+ let t = N.value.findIndex((e) => e[x.itemLabel].toLowerCase().startsWith(U.value));
110
+ t !== -1 && K(t), e.preventDefault(), e.stopPropagation();
111
+ }
112
+ W = window.setTimeout(function() {
113
+ U.value = "";
114
+ }, 500);
99
115
  }
100
- H = window.setTimeout(function() {
101
- V.value = "";
102
- }, 500);
103
116
  }
104
- function W(e) {
117
+ function G(e) {
105
118
  switch (e) {
106
119
  case "next":
107
120
  case "prev":
108
- G(te(e));
121
+ K(de(e));
109
122
  break;
110
123
  case "first":
111
- G(Y());
124
+ K(Y());
112
125
  break;
113
126
  case "last":
114
- G(X());
127
+ K(X());
115
128
  break;
116
129
  default: break;
117
130
  }
118
131
  }
119
- function G(e, t = !1) {
120
- K()[e]?.focus({ preventScroll: t });
132
+ function K(e, t = !1) {
133
+ q()[e]?.focus({ preventScroll: t });
121
134
  }
122
- function K() {
123
- let e = N.value;
124
- return e ? Array.from(e.querySelectorAll("[role=\"option\"]")).filter((t) => t.closest("[role=\"listbox\"]") === e) : [];
135
+ function q() {
136
+ let e = F.value;
137
+ return e ? Array.from(e.querySelectorAll(`[role="${T}"]`)).filter((t) => t.closest(`[role="${w}"]`) === e) : [];
125
138
  }
126
- function q(e) {
127
- return K()[e];
139
+ function ue(e) {
140
+ return q()[e];
128
141
  }
129
142
  function J() {
130
- return K().indexOf(document.activeElement);
143
+ return q().indexOf(document.activeElement);
131
144
  }
132
145
  function Y() {
133
- let e = K(), t = e.find((e) => $(e));
146
+ let e = q(), t = e.find((e) => $(e));
134
147
  return t ? e.indexOf(t) : -1;
135
148
  }
136
149
  function X() {
137
- let e = K(), t = [...e].reverse().find((e) => $(e));
150
+ let e = q(), t = [...e].reverse().find((e) => $(e));
138
151
  return t ? e.indexOf(t) : -1;
139
152
  }
140
153
  function Z(e, t, n) {
141
154
  return t === "prev" && e <= 0 || t === "next" && e === n.length - 1;
142
155
  }
143
- function te(e) {
156
+ function de(e) {
144
157
  return Q(J(), e);
145
158
  }
146
159
  function Q(e, t) {
147
- let n = K();
160
+ let n = q();
148
161
  if (Z(e, t, n)) return e;
149
162
  let r = e + (t === "next" ? 1 : -1);
150
163
  for (; !$(n[r]);) {
@@ -156,63 +169,66 @@ var ee = [
156
169
  function $(e) {
157
170
  return e.getAttribute("tabindex") === "-1";
158
171
  }
159
- return x(M, (e) => {
160
- e !== w.modelValue && T("update:modelValue", e);
161
- }), f({
162
- getItem: q,
172
+ return ae(P, (e) => {
173
+ e !== x.modelValue && S("update:modelValue", e);
174
+ }), u({
175
+ getItem: ue,
163
176
  getActiveItemIndex: J,
164
177
  getAdjacentItemIndex: Q,
165
178
  getFirstFocusableItemIndex: Y,
166
179
  getLastFocusableItemIndex: X
167
- }), (e, t) => (h(), d("div", {
168
- id: b(E),
180
+ }), (e, t) => (p(), l("div", {
181
+ id: v(se),
169
182
  ref_key: "listRef",
170
- ref: N,
171
- class: p([
183
+ ref: F,
184
+ class: d([
172
185
  "q-list",
173
- { "q-list--disabled": w.disabled },
174
- w.class
186
+ { "q-list--disabled": x.disabled },
187
+ x.class
175
188
  ]),
176
- style: m(O.value),
177
- role: "listbox",
178
- "aria-label": w.label,
179
- "aria-multiselectable": w.multiple || void 0,
180
- tabindex: w.disabled ? -1 : 0,
181
- onFocus: B,
182
- onMousedown: R,
183
- onMouseup: z,
184
- onKeydown: U
185
- }, [v(e.$slots, "default", {}, () => [(h(!0), d(c, null, _(A.value, ({ group: t, items: n }) => (h(), u(b(s), {
189
+ style: f(ce.value),
190
+ role: v(w),
191
+ "aria-label": x.label,
192
+ "aria-multiselectable": !C && x.multiple || void 0,
193
+ tabindex: A.value,
194
+ onFocus: H,
195
+ onFocusout: t[0] ||= (e) => j(!1),
196
+ onMousedown: B,
197
+ onMouseup: V,
198
+ onKeydown: le
199
+ }, [g(e.$slots, "default", {}, () => [(p(!0), l(o, null, h(M.value, ({ group: t, items: n }) => (p(), c(v(ne), {
186
200
  id: t.id,
187
201
  key: t.id,
188
- title: A.value.length === 1 ? void 0 : t.title
202
+ title: M.value.length === 1 ? void 0 : t.title
189
203
  }, {
190
- default: S(() => [(h(!0), d(c, null, _(n, (n) => (h(), u(b(o), {
191
- key: n[w.itemValue],
204
+ default: y(() => [(p(!0), l(o, null, h(n, (n) => (p(), c(v(te), {
205
+ key: n[x.itemValue],
192
206
  ref_for: !0,
193
207
  ref_key: "listItemsRef",
194
- ref: P,
195
- value: n[w.itemValue],
196
- label: n[w.itemLabel],
197
- "overflow-title": w.itemTitle,
208
+ ref: I,
209
+ value: n[x.itemValue],
210
+ label: n[x.itemLabel],
211
+ "overflow-title": x.itemTitle,
198
212
  description: n.description,
199
213
  icon: n.icon,
200
- disabled: w.disabled || t.disabled || n.disabled,
201
- highlighted: w.highlighted === n[w.itemValue],
202
- selectable: w.selectable || w.multiple || n.selectable,
203
- checkboxless: !w.multiple,
204
- "select-on-tab": w.selectOnTab,
205
- icons: w.icons,
206
- onClick: () => I(n[w.itemValue]),
207
- onMouseenter: () => L(n[w.itemValue])
214
+ disabled: x.disabled || t.disabled || n.disabled,
215
+ highlighted: x.highlighted === n[x.itemValue],
216
+ selectable: x.selectable || x.multiple || n.selectable,
217
+ checkboxless: !x.multiple,
218
+ "select-on-tab": x.selectOnTab,
219
+ icons: x.icons,
220
+ "aria-haspopup": E(n) ? "menu" : void 0,
221
+ "aria-expanded": E(n) ? x.highlighted === n[x.itemValue] : void 0,
222
+ onClick: () => R(n[x.itemValue]),
223
+ onMouseenter: () => z(n[x.itemValue])
208
224
  }, {
209
- append: S(() => [v(e.$slots, "item.append", {
225
+ append: y(() => [g(e.$slots, "item.append", {
210
226
  item: n,
211
- element: F.value.get(n[w.itemValue])
227
+ element: L.value.get(n[x.itemValue])
212
228
  })]),
213
- default: S(() => [v(e.$slots, "item", {
229
+ default: y(() => [g(e.$slots, "item", {
214
230
  item: n,
215
- element: F.value.get(n[w.itemValue])
231
+ element: L.value.get(n[x.itemValue])
216
232
  })]),
217
233
  _: 2
218
234
  }, 1032, [
@@ -227,12 +243,14 @@ var ee = [
227
243
  "checkboxless",
228
244
  "select-on-tab",
229
245
  "icons",
246
+ "aria-haspopup",
247
+ "aria-expanded",
230
248
  "onClick",
231
249
  "onMouseenter"
232
250
  ]))), 128))]),
233
251
  _: 2
234
- }, 1032, ["id", "title"]))), 128))])], 46, ee));
252
+ }, 1032, ["id", "title"]))), 128))])], 46, oe));
235
253
  }
236
254
  });
237
255
  //#endregion
238
- export { C as default };
256
+ export { b as default };
@@ -1 +1 @@
1
- {"version":3,"file":"QListItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QList/QListItem.vue"],"names":[],"mappings":"AAwEA;AAoKC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAU3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,GAAG,CAAA;AAKvC,KAAK,WAAW,GAAG,cAAc,CAAC;AAgFnC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAyIT,OAAO,IAA6B;;yBAbrB,GAAG;yBACH,GAAG;wBACH,GAAG;;;;;;EAgB/B;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;iBAUnB,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":"AAyEA;AA+KC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAU3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,GAAG,CAAA;AAMvC,KAAK,WAAW,GAAG,cAAc,CAAC;AAyFnC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WA2IT,OAAO,IAA6B;;yBAbrB,GAAG;yBACH,GAAG;wBACH,GAAG;;;;;;EAgB/B;AAmBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;iBAUnB,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"}
@@ -2,25 +2,28 @@ import { useGroupItem as e } from "../../composables/useGroup/index.js";
2
2
  import { useId as t } from "../../composables/useId/index.js";
3
3
  import { QIcon as n } from "../QIcon/index.js";
4
4
  import { DEFAULT_ICONS as r } from "./constants.js";
5
- import { createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeModels as d, mergeProps as f, normalizeClass as p, normalizeProps as m, openBlock as h, ref as g, renderSlot as _, toDisplayString as v, unref as y, useModel as b, useTemplateRef as x, watch as S, withModifiers as C } from "vue";
5
+ import { ListItemRoleSymbol as i } from "./context.js";
6
+ import { computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, inject as p, mergeModels as m, mergeProps as h, normalizeClass as g, normalizeProps as _, openBlock as v, ref as y, renderSlot as b, toDisplayString as x, unref as S, useModel as C, useTemplateRef as w, watch as T, withModifiers as E } from "vue";
6
7
  //#region src/components/QList/QListItem.vue?vue&type=script&setup=true&lang.ts
7
- var w = [
8
+ var D = [
8
9
  "id",
9
10
  "data-key",
11
+ "role",
10
12
  "tabindex",
11
13
  "title",
12
14
  "aria-label",
15
+ "aria-describedby",
13
16
  "aria-disabled",
14
17
  "aria-selected"
15
- ], T = { class: "q-list-item__container" }, E = { class: "q-list-item__content" }, D = {
18
+ ], O = { class: "q-list-item__container" }, k = { class: "q-list-item__content" }, A = {
16
19
  key: 0,
17
20
  class: "q-list-item__description"
18
- }, O = {
21
+ }, j = ["id"], M = {
19
22
  key: 0,
20
23
  class: "q-list-item__check-container"
21
- }, k = { class: "q-checkbox__input" }, A = /*@__PURE__*/ l({
24
+ }, N = { class: "q-checkbox__input" }, P = /*@__PURE__*/ d({
22
25
  __name: "QListItem",
23
- props: /*@__PURE__*/ d({
26
+ props: /*@__PURE__*/ m({
24
27
  value: {},
25
28
  label: {},
26
29
  overflowTitle: { type: Boolean },
@@ -39,62 +42,63 @@ var w = [
39
42
  modelValue: { type: Boolean },
40
43
  modelModifiers: {}
41
44
  }),
42
- emits: /*@__PURE__*/ d(["click"], ["update:modelValue"]),
43
- setup(r, { emit: l }) {
44
- let d = r, A = l, j = b(r, "modelValue"), M = t(), N = e(d.value);
45
- if (!N) throw Error("QListItem: Failed to retrieve group item. Ensure the component is used within a QList context.");
46
- let P = x("label"), F = g(!1);
47
- function I() {
48
- if (!d.overflowTitle) return;
49
- let e = P.value;
50
- F.value = !!e && e.scrollWidth > e.clientWidth;
45
+ emits: /*@__PURE__*/ m(["click"], ["update:modelValue"]),
46
+ setup(r, { emit: d }) {
47
+ let m = r, P = d, F = C(r, "modelValue"), I = p(i, "option"), L = t(), R = a(() => `${L.value}_description`), z = e(m.value);
48
+ if (!z) throw Error("QListItem: Failed to retrieve group item. Ensure the component is used within a QList context.");
49
+ let B = w("label"), V = y(!1);
50
+ function H() {
51
+ if (!m.overflowTitle) return;
52
+ let e = B.value;
53
+ V.value = !!e && e.scrollWidth > e.clientWidth;
51
54
  }
52
- function L() {
53
- d.disabled || (A("click"), d.selectable && N?.toggle());
55
+ function U() {
56
+ m.disabled || (P("click"), m.selectable && z?.toggle());
54
57
  }
55
- function R(e) {
56
- e.key === "Tab" && d.selectOnTab && L(), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), L());
58
+ function W(e) {
59
+ e.key === "Tab" && !e.shiftKey && m.selectOnTab && !z?.isActive.value && U(), (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), U());
57
60
  }
58
- return S(N.isActive, (e) => {
59
- j.value = e;
60
- }, { immediate: !0 }), (e, t) => (h(), o("li", {
61
- id: y(M),
62
- "data-key": d.value,
63
- role: "option",
64
- tabindex: d.disabled ? void 0 : -1,
65
- class: p(["q-list-item", {
66
- "q-list-item--selected": j.value,
67
- "q-list-item--selectable": d.selectable,
68
- "q-list-item--disabled": d.disabled,
69
- "q-list-item--highlighted": d.highlighted
61
+ return T(z.isActive, (e) => {
62
+ F.value = e;
63
+ }, { immediate: !0 }), (e, t) => (v(), c("li", {
64
+ id: S(L),
65
+ "data-key": m.value,
66
+ role: S(I),
67
+ tabindex: m.disabled ? void 0 : -1,
68
+ class: g(["q-list-item", {
69
+ "q-list-item--selected": F.value,
70
+ "q-list-item--selectable": m.selectable,
71
+ "q-list-item--disabled": m.disabled,
72
+ "q-list-item--highlighted": m.highlighted
70
73
  }]),
71
- title: d.overflowTitle && F.value ? d.label : void 0,
72
- "aria-label": d.label,
73
- "aria-disabled": d.disabled || void 0,
74
- "aria-selected": d.disabled ? void 0 : j.value,
75
- onKeydown: R,
76
- onMouseenter: I,
77
- onClick: C(L, ["stop", "prevent"])
74
+ title: m.overflowTitle && V.value ? m.label : void 0,
75
+ "aria-label": m.label,
76
+ "aria-describedby": m.description ? R.value : void 0,
77
+ "aria-disabled": m.disabled || void 0,
78
+ "aria-selected": S(I) === "option" && !m.disabled ? F.value : void 0,
79
+ onKeydown: W,
80
+ onMouseenter: H,
81
+ onClick: E(U, ["stop", "prevent"])
78
82
  }, [
79
- _(e.$slots, "prepend"),
80
- s("div", T, [s("div", E, [_(e.$slots, "default", {}, () => [d.icon ? (h(), i(y(n), m(f({ key: 0 }, d.icon)), null, 16)) : a("v-if", !0), s("span", {
83
+ b(e.$slots, "prepend"),
84
+ l("div", O, [l("div", k, [b(e.$slots, "default", {}, () => [m.icon ? (v(), o(S(n), _(h({ key: 0 }, m.icon)), null, 16)) : s("v-if", !0), l("span", {
81
85
  ref: "label",
82
86
  class: "q-list-item__label"
83
- }, v(d.label), 513)])]), d.description ? (h(), o("div", D, [c(y(n), m(u(d.icons.description)), null, 16), s("span", null, v(d.description), 1)])) : a("v-if", !0)]),
84
- _(e.$slots, "append"),
85
- d.selectable ? (h(), o("div", O, [d.checkboxless && j.value ? (h(), i(y(n), f({ key: 0 }, d.icons.check, {
87
+ }, x(m.label), 513)])]), m.description ? (v(), c("div", A, [u(S(n), _(f(m.icons.description)), null, 16), l("span", { id: R.value }, x(m.description), 9, j)])) : s("v-if", !0)]),
88
+ b(e.$slots, "append"),
89
+ m.selectable ? (v(), c("div", M, [m.checkboxless && F.value ? (v(), o(S(n), h({ key: 0 }, m.icons.check, {
86
90
  class: "q-list-item__check",
87
91
  "aria-hidden": "true"
88
- }), null, 16)) : d.checkboxless ? a("v-if", !0) : (h(), o("span", {
92
+ }), null, 16)) : m.checkboxless ? s("v-if", !0) : (v(), c("span", {
89
93
  key: 1,
90
94
  "aria-hidden": "true",
91
- class: p(["q-checkbox q-checkbox--small", {
92
- "q-checkbox--checked": j.value,
93
- "q-checkbox--disabled": d.disabled
95
+ class: g(["q-checkbox q-checkbox--small", {
96
+ "q-checkbox--checked": F.value,
97
+ "q-checkbox--disabled": m.disabled
94
98
  }])
95
- }, [s("span", k, [j.value ? (h(), i(y(n), f({ key: 0 }, d.icons.check, { class: "q-checkbox__input-icon" }), null, 16)) : a("v-if", !0)])], 2))])) : a("v-if", !0)
96
- ], 42, w));
99
+ }, [l("span", N, [F.value ? (v(), o(S(n), h({ key: 0 }, m.icons.check, { class: "q-checkbox__input-icon" }), null, 16)) : s("v-if", !0)])], 2))])) : s("v-if", !0)
100
+ ], 42, D));
97
101
  }
98
102
  });
99
103
  //#endregion
100
- export { A as default };
104
+ export { P as default };
@@ -0,0 +1,8 @@
1
+ import { InjectionKey } from 'vue';
2
+ /**
3
+ * The role a `QList` gives its items: `option` in a listbox, whose items are values to choose,
4
+ * or `menuitem` in a menu, whose items are actions. The list's own lookups find its items by it.
5
+ */
6
+ export type QListItemRole = 'option' | 'menuitem';
7
+ export declare const ListItemRoleSymbol: InjectionKey<QListItemRole>;
8
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/QList/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAA;AAEvC;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAA;AAEjD,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,aAAa,CAA2B,CAAA"}
@@ -0,0 +1,4 @@
1
+ //#region src/components/QList/context.ts
2
+ var e = Symbol("QListItemRole");
3
+ //#endregion
4
+ export { e as ListItemRoleSymbol };
@@ -1 +1 @@
1
- {"version":3,"file":"QMeter.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QMeter/QMeter.vue"],"names":[],"mappings":"AAiBA;AAwEC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,CAAA;AAKpC,KAAK,WAAW,GAAG,WAAW,CAAC;AAsChC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,CAAC;;;;;;;;AA6EhB,wBASG"}
1
+ {"version":3,"file":"QMeter.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QMeter/QMeter.vue"],"names":[],"mappings":"AA2BA;AA6FC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,CAAA;AAMpC,KAAK,WAAW,GAAG,WAAW,CAAC;AAgDhC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,CAAC;;;;;;;;AAyFhB,wBASG"}
@@ -1,17 +1,27 @@
1
1
  import { useId as e } from "../../composables/useId/index.js";
2
2
  import { useColor as t } from "../../composables/useColor/index.js";
3
- import { QLabel as n } from "../QLabel/index.js";
4
- import { computed as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeModels as c, normalizeClass as l, normalizeStyle as u, openBlock as d, toRef as f, unref as p, useModel as m } from "vue";
3
+ import { labelTextId as n } from "../QLabel/ids.js";
4
+ import { QLabel as r } from "../QLabel/index.js";
5
+ import { computed as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, normalizeStyle as d, openBlock as f, toRef as p, unref as m, useModel as h } from "vue";
5
6
  //#region src/components/QMeter/QMeter.vue?vue&type=script&setup=true&lang.ts
6
- var h = ["id"], g = { class: "q-meter__labels" }, _ = { class: "q-meter__track" }, v = /*@__PURE__*/ s({
7
+ var g = [
8
+ "id",
9
+ "aria-labelledby",
10
+ "aria-valuemax",
11
+ "aria-valuenow",
12
+ "aria-valuetext"
13
+ ], _ = {
14
+ class: "q-meter__labels",
15
+ "aria-hidden": "true"
16
+ }, v = { class: "q-meter__track" }, y = /*@__PURE__*/ c({
7
17
  __name: "QMeter",
8
- props: /*@__PURE__*/ c({
18
+ props: /*@__PURE__*/ l({
9
19
  id: {},
10
20
  class: {},
11
- label: {},
12
21
  required: { type: Boolean },
13
22
  for: {},
14
23
  labelPosition: {},
24
+ label: {},
15
25
  valueLabel: {},
16
26
  color: {},
17
27
  max: { default: 100 }
@@ -20,22 +30,31 @@ var h = ["id"], g = { class: "q-meter__labels" }, _ = { class: "q-meter__track"
20
30
  modelModifiers: {}
21
31
  }),
22
32
  emits: ["update:modelValue"],
23
- setup(s) {
24
- let c = s, v = m(s, "modelValue"), y = e(f(c, "id")), b = r(() => v.value / c.max * 100), { style: x } = t(f(c, "color")), S = r(() => ({
25
- width: `${Math.max(0, Math.min(b.value, 100))}%`,
26
- backgroundColor: x.value?.mainColor
27
- })), C = r(() => typeof c.valueLabel == "string" ? c.valueLabel : c.valueLabel?.(v.value, c.max));
28
- return (e, t) => (d(), i("div", {
29
- id: p(y),
30
- class: l(["q-meter", c.class])
31
- }, [a("div", g, [o(p(n), { label: c.label }, null, 8, ["label"]), o(p(n), {
32
- label: C.value,
33
+ setup(c) {
34
+ let l = c, y = h(c, "modelValue"), b = e(p(l, "id")), x = i(() => y.value / l.max * 100), { style: S } = t(p(l, "color")), C = i(() => ({
35
+ width: `${Math.max(0, Math.min(x.value, 100))}%`,
36
+ backgroundColor: S.value?.mainColor
37
+ })), w = i(() => `${b.value}_label`), T = i(() => Math.max(0, Math.min(y.value, l.max))), E = i(() => typeof l.valueLabel == "string" ? l.valueLabel : l.valueLabel?.(y.value, l.max));
38
+ return (e, t) => (f(), a("div", {
39
+ id: m(b),
40
+ class: u(["q-meter", l.class]),
41
+ role: "meter",
42
+ "aria-labelledby": l.label ? m(n)(w.value) : void 0,
43
+ "aria-valuemin": "0",
44
+ "aria-valuemax": l.max,
45
+ "aria-valuenow": T.value,
46
+ "aria-valuetext": E.value
47
+ }, [o("div", _, [s(m(r), {
48
+ id: w.value,
49
+ label: l.label
50
+ }, null, 8, ["id", "label"]), s(m(r), {
51
+ label: E.value,
33
52
  class: "q-meter__value-label"
34
- }, null, 8, ["label"])]), a("div", _, [a("div", {
53
+ }, null, 8, ["label"])]), o("div", v, [o("div", {
35
54
  class: "q-meter__fill",
36
- style: u(S.value)
37
- }, null, 4)])], 10, h));
55
+ style: d(C.value)
56
+ }, null, 4)])], 10, g));
38
57
  }
39
58
  });
40
59
  //#endregion
41
- export { v as default };
60
+ export { y as default };
@@ -1,11 +1,7 @@
1
1
  declare const QMeter: import('vue').DefineComponent<{
2
2
  modelValue?: number;
3
- } & import('../..').QBaseComponentProps & {
3
+ } & Omit<import('..').QLabelProps, "label"> & {
4
4
  label?: string;
5
- required?: boolean;
6
- for?: string;
7
- labelPosition?: import('..').QLabelPosition;
8
- } & {
9
5
  valueLabel?: string | ((value: number, max: number) => string);
10
6
  color?: string;
11
7
  max?: number;
@@ -13,12 +9,8 @@ declare const QMeter: import('vue').DefineComponent<{
13
9
  "update:modelValue": (value: number) => any;
14
10
  }, string, import('vue').PublicProps, Readonly<{
15
11
  modelValue?: number;
16
- } & import('../..').QBaseComponentProps & {
12
+ } & Omit<import('..').QLabelProps, "label"> & {
17
13
  label?: string;
18
- required?: boolean;
19
- for?: string;
20
- labelPosition?: import('..').QLabelPosition;
21
- } & {
22
14
  valueLabel?: string | ((value: number, max: number) => string);
23
15
  color?: string;
24
16
  max?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QMeter/index.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;wFAA2B,CAAA;AAGvC,OAAO,EAAE,MAAM,EAAE,CAAA;AAGjB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QMeter/index.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;wFAA2B,CAAA;AAGvC,OAAO,EAAE,MAAM,EAAE,CAAA;AAGjB,cAAc,SAAS,CAAA"}