quasar 2.19.3 → 2.20.1

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 (550) hide show
  1. package/dist/api/Lang.json +1 -1
  2. package/dist/api/QCarouselSlide.json +1 -1
  3. package/dist/api/QChatMessage.json +1 -1
  4. package/dist/api/QImg.json +1 -1
  5. package/dist/api/QParallax.json +1 -1
  6. package/dist/api/QRange.json +1 -1
  7. package/dist/api/QSlider.json +1 -1
  8. package/dist/api/QTimelineEntry.json +1 -1
  9. package/dist/api/QTree.json +1 -1
  10. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  11. package/dist/icon-set/eva-icons.umd.prod.js +2 -2
  12. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +5 -5
  13. package/dist/icon-set/fontawesome-v5.umd.prod.js +5 -5
  14. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +5 -5
  15. package/dist/icon-set/fontawesome-v6.umd.prod.js +5 -5
  16. package/dist/icon-set/fontawesome-v7-pro.umd.prod.js +1 -1
  17. package/dist/icon-set/fontawesome-v7.umd.prod.js +1 -1
  18. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  19. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  20. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  21. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  22. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  23. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  24. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  25. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  26. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  27. package/dist/icon-set/mdi-v3.umd.prod.js +5 -5
  28. package/dist/icon-set/mdi-v4.umd.prod.js +5 -5
  29. package/dist/icon-set/mdi-v5.umd.prod.js +5 -5
  30. package/dist/icon-set/mdi-v6.umd.prod.js +5 -5
  31. package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-eva-icons.umd.prod.js +2 -2
  34. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +5 -5
  35. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +5 -5
  36. package/dist/icon-set/svg-fontawesome-v7.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  38. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +5 -5
  39. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +5 -5
  40. package/dist/icon-set/svg-ionicons-v7.umd.prod.js +5 -5
  41. package/dist/icon-set/svg-ionicons-v8.umd.prod.js +1 -1
  42. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  43. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  44. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  45. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  46. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  47. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
  48. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
  49. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
  50. package/dist/icon-set/svg-mdi-v6.umd.prod.js +5 -5
  51. package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
  52. package/dist/icon-set/svg-themify.umd.prod.js +2 -2
  53. package/dist/icon-set/themify.umd.prod.js +2 -2
  54. package/dist/lang/ar-TN.umd.prod.js +2 -2
  55. package/dist/lang/ar.umd.prod.js +2 -2
  56. package/dist/lang/az-Latn.umd.prod.js +2 -2
  57. package/dist/lang/bg.umd.prod.js +2 -2
  58. package/dist/lang/bn.umd.prod.js +2 -2
  59. package/dist/lang/bs-BA.umd.prod.js +2 -2
  60. package/dist/lang/ca.umd.prod.js +2 -2
  61. package/dist/lang/cs.umd.prod.js +2 -2
  62. package/dist/lang/da.umd.prod.js +2 -2
  63. package/dist/lang/de-CH.umd.prod.js +2 -2
  64. package/dist/lang/de-DE.umd.prod.js +2 -2
  65. package/dist/lang/de.umd.prod.js +2 -2
  66. package/dist/lang/el.umd.prod.js +2 -2
  67. package/dist/lang/en-GB.umd.prod.js +2 -2
  68. package/dist/lang/en-US.umd.prod.js +2 -2
  69. package/dist/lang/eo.umd.prod.js +2 -2
  70. package/dist/lang/es.umd.prod.js +2 -2
  71. package/dist/lang/et.umd.prod.js +2 -2
  72. package/dist/lang/eu.umd.prod.js +2 -2
  73. package/dist/lang/fa-IR.umd.prod.js +2 -2
  74. package/dist/lang/fa.umd.prod.js +2 -2
  75. package/dist/lang/fi.umd.prod.js +2 -2
  76. package/dist/lang/fr.umd.prod.js +2 -2
  77. package/dist/lang/gn.umd.prod.js +2 -2
  78. package/dist/lang/he.umd.prod.js +2 -2
  79. package/dist/lang/hi.umd.prod.js +2 -2
  80. package/dist/lang/hr.umd.prod.js +2 -2
  81. package/dist/lang/hu.umd.prod.js +2 -2
  82. package/dist/lang/id.umd.prod.js +2 -2
  83. package/dist/lang/is.umd.prod.js +2 -2
  84. package/dist/lang/it.umd.prod.js +2 -2
  85. package/dist/lang/ja.umd.prod.js +2 -2
  86. package/dist/lang/kk.umd.prod.js +2 -2
  87. package/dist/lang/km.umd.prod.js +2 -2
  88. package/dist/lang/ko-KR.umd.prod.js +1 -1
  89. package/dist/lang/kur-CKB.umd.prod.js +2 -2
  90. package/dist/lang/lt.umd.prod.js +2 -2
  91. package/dist/lang/lu.umd.prod.js +2 -2
  92. package/dist/lang/lv.umd.prod.js +2 -2
  93. package/dist/lang/mk.umd.prod.js +2 -2
  94. package/dist/lang/ml.umd.prod.js +2 -2
  95. package/dist/lang/mm.umd.prod.js +2 -2
  96. package/dist/lang/ms-MY.umd.prod.js +2 -2
  97. package/dist/lang/ms.umd.prod.js +2 -2
  98. package/dist/lang/my.umd.prod.js +2 -2
  99. package/dist/lang/nb-NO.umd.prod.js +2 -2
  100. package/dist/lang/nl.umd.prod.js +2 -2
  101. package/dist/lang/pl.umd.prod.js +2 -2
  102. package/dist/lang/pt-BR.umd.prod.js +2 -2
  103. package/dist/lang/pt.umd.prod.js +2 -2
  104. package/dist/lang/ro.umd.prod.js +2 -2
  105. package/dist/lang/ru.umd.prod.js +2 -2
  106. package/dist/lang/sk.umd.prod.js +2 -2
  107. package/dist/lang/sl.umd.prod.js +2 -2
  108. package/dist/lang/sm.umd.prod.js +2 -2
  109. package/dist/lang/sq.umd.prod.js +2 -2
  110. package/dist/lang/sr-CYR.umd.prod.js +2 -2
  111. package/dist/lang/sr.umd.prod.js +2 -2
  112. package/dist/lang/sv.umd.prod.js +2 -2
  113. package/dist/lang/ta.umd.prod.js +2 -2
  114. package/dist/lang/th.umd.prod.js +2 -2
  115. package/dist/lang/tl.umd.prod.js +2 -2
  116. package/dist/lang/tr.umd.prod.js +2 -2
  117. package/dist/lang/ug.umd.prod.js +2 -2
  118. package/dist/lang/uk.umd.prod.js +2 -2
  119. package/dist/lang/ur-PK.umd.prod.js +2 -2
  120. package/dist/lang/uz-Cyrl.umd.prod.js +2 -2
  121. package/dist/lang/uz-Latn.umd.prod.js +2 -2
  122. package/dist/lang/vi.umd.prod.js +2 -2
  123. package/dist/lang/zh-CN.umd.prod.js +2 -2
  124. package/dist/lang/zh-TW.umd.prod.js +2 -2
  125. package/dist/quasar.client.js +2621 -2604
  126. package/dist/quasar.sass +1 -1
  127. package/dist/quasar.server.prod.cjs +11 -11
  128. package/dist/quasar.server.prod.js +25 -25
  129. package/dist/quasar.umd.js +2616 -2599
  130. package/dist/quasar.umd.prod.js +23 -23
  131. package/dist/types/api/dialog.d.ts +1 -1
  132. package/dist/types/api/qnotify.d.ts +1 -1
  133. package/dist/types/api/qpopupproxy.d.ts +1 -1
  134. package/dist/types/feature-flag.d.ts +2 -2
  135. package/dist/types/globals.d.ts +2 -2
  136. package/dist/types/icon-set.d.ts +16 -16
  137. package/dist/types/shim-icon-set.d.ts +1 -2
  138. package/dist/types/shim-lang.d.ts +1 -2
  139. package/dist/types/ts-helpers.d.ts +3 -3
  140. package/dist/types/tsconfig.json +1 -1
  141. package/dist/types/utils/scroll.d.ts +1 -1
  142. package/dist/types/utils.d.ts +2 -2
  143. package/dist/web-types/web-types.json +1 -1
  144. package/icon-set/bootstrap-icons.js +1 -1
  145. package/icon-set/eva-icons.js +22 -22
  146. package/icon-set/ionicons-v4.js +16 -16
  147. package/icon-set/svg-bootstrap-icons.js +1 -1
  148. package/icon-set/svg-eva-icons.js +22 -22
  149. package/icon-set/svg-fontawesome-v5.js +1 -1
  150. package/icon-set/svg-ionicons-v4.js +16 -16
  151. package/icon-set/svg-themify.js +7 -7
  152. package/icon-set/themify.js +7 -7
  153. package/lang/ar-TN.js +1 -1
  154. package/lang/ar.js +1 -1
  155. package/lang/az-Latn.js +1 -1
  156. package/lang/bg.js +1 -1
  157. package/lang/bn.js +1 -1
  158. package/lang/bs-BA.js +1 -1
  159. package/lang/ca.js +1 -1
  160. package/lang/cs.js +11 -6
  161. package/lang/da.js +1 -1
  162. package/lang/de-CH.js +1 -1
  163. package/lang/de-DE.js +1 -1
  164. package/lang/de.js +1 -1
  165. package/lang/el.js +1 -1
  166. package/lang/en-GB.js +1 -1
  167. package/lang/en-US.js +1 -1
  168. package/lang/eo.js +1 -1
  169. package/lang/es.js +1 -1
  170. package/lang/et.js +1 -1
  171. package/lang/eu.js +1 -1
  172. package/lang/fa-IR.js +1 -1
  173. package/lang/fa.js +1 -1
  174. package/lang/fi.js +1 -1
  175. package/lang/fr.js +1 -1
  176. package/lang/gn.js +1 -1
  177. package/lang/he.js +1 -1
  178. package/lang/hi.js +1 -1
  179. package/lang/hr.js +1 -1
  180. package/lang/hu.js +1 -1
  181. package/lang/id.js +1 -1
  182. package/lang/is.js +1 -1
  183. package/lang/it.js +1 -1
  184. package/lang/ja.js +1 -1
  185. package/lang/kk.js +1 -1
  186. package/lang/km.js +1 -1
  187. package/lang/kur-CKB.js +1 -1
  188. package/lang/lt.js +2 -2
  189. package/lang/lu.js +1 -1
  190. package/lang/lv.js +1 -1
  191. package/lang/mk.js +1 -1
  192. package/lang/ml.js +1 -1
  193. package/lang/mm.js +1 -1
  194. package/lang/ms-MY.js +1 -1
  195. package/lang/ms.js +1 -1
  196. package/lang/my.js +1 -1
  197. package/lang/nb-NO.js +1 -1
  198. package/lang/nl.js +1 -1
  199. package/lang/pl.js +1 -1
  200. package/lang/pt-BR.js +1 -1
  201. package/lang/pt.js +1 -1
  202. package/lang/ro.js +1 -1
  203. package/lang/ru.js +1 -1
  204. package/lang/sk.js +1 -1
  205. package/lang/sl.js +1 -1
  206. package/lang/sm.js +1 -1
  207. package/lang/sq.js +1 -1
  208. package/lang/sr-CYR.js +1 -1
  209. package/lang/sr.js +1 -1
  210. package/lang/sv.js +1 -1
  211. package/lang/ta.js +1 -1
  212. package/lang/th.js +1 -1
  213. package/lang/tl.js +1 -1
  214. package/lang/tr.js +1 -1
  215. package/lang/ug.js +1 -1
  216. package/lang/uk.js +1 -1
  217. package/lang/ur-PK.js +1 -1
  218. package/lang/uz-Cyrl.js +1 -1
  219. package/lang/uz-Latn.js +1 -1
  220. package/lang/vi.js +1 -1
  221. package/lang/zh-CN.js +1 -1
  222. package/lang/zh-TW.js +1 -1
  223. package/package.json +13 -17
  224. package/src/components/ajax-bar/QAjaxBar.js +22 -25
  225. package/src/components/avatar/QAvatar.js +3 -3
  226. package/src/components/avatar/QAvatar.test.js +2 -2
  227. package/src/components/badge/QBadge.js +9 -10
  228. package/src/components/badge/QBadge.test.js +2 -2
  229. package/src/components/banner/QBanner.js +6 -6
  230. package/src/components/banner/QBanner.test.js +2 -2
  231. package/src/components/bar/QBar.js +3 -3
  232. package/src/components/bar/QBar.test.js +2 -2
  233. package/src/components/breadcrumbs/QBreadcrumbs.js +5 -4
  234. package/src/components/breadcrumbs/QBreadcrumbs.test.js +3 -3
  235. package/src/components/breadcrumbs/QBreadcrumbsEl.js +4 -4
  236. package/src/components/breadcrumbs/QBreadcrumbsEl.test.js +2 -2
  237. package/src/components/btn/QBtn.js +39 -44
  238. package/src/components/btn/QBtn.test.js +2 -2
  239. package/src/components/btn/use-btn.js +34 -47
  240. package/src/components/btn/use-btn.test.js +5 -5
  241. package/src/components/btn-dropdown/QBtnDropdown.js +15 -16
  242. package/src/components/btn-group/QBtnGroup.js +3 -3
  243. package/src/components/btn-toggle/QBtnToggle.js +5 -9
  244. package/src/components/card/QCard.js +5 -5
  245. package/src/components/card/QCardActions.js +2 -2
  246. package/src/components/card/QCardSection.js +2 -2
  247. package/src/components/carousel/QCarousel.js +32 -38
  248. package/src/components/carousel/QCarouselControl.js +1 -1
  249. package/src/components/carousel/QCarouselSlide.js +1 -1
  250. package/src/components/carousel/QCarouselSlide.json +1 -1
  251. package/src/components/chat/QChatMessage.js +13 -14
  252. package/src/components/chat/QChatMessage.json +1 -1
  253. package/src/components/checkbox/QCheckbox.js +5 -5
  254. package/src/components/checkbox/use-checkbox.js +38 -50
  255. package/src/components/chip/QChip.js +26 -34
  256. package/src/components/chip/QChip.test.js +2 -2
  257. package/src/components/circular-progress/QCircularProgress.js +8 -11
  258. package/src/components/circular-progress/circular-progress.test.js +1 -1
  259. package/src/components/color/QColor.js +75 -98
  260. package/src/components/date/QDate.js +128 -140
  261. package/src/components/date/use-datetime.js +3 -6
  262. package/src/components/dialog/QDialog.js +44 -51
  263. package/src/components/dialog/QDialog.test.js +7 -7
  264. package/src/components/drawer/QDrawer.js +110 -152
  265. package/src/components/editor/QEditor.js +44 -37
  266. package/src/components/editor/editor-caret.js +27 -31
  267. package/src/components/editor/editor-utils.js +9 -5
  268. package/src/components/expansion-item/QExpansionItem.js +36 -48
  269. package/src/components/fab/QFab.js +11 -11
  270. package/src/components/fab/QFabAction.js +2 -4
  271. package/src/components/fab/use-fab.js +6 -7
  272. package/src/components/field/QField.js +2 -2
  273. package/src/components/file/QFile.js +26 -33
  274. package/src/components/footer/QFooter.js +40 -53
  275. package/src/components/form/QForm.js +37 -43
  276. package/src/components/form/QFormChildMixin.js +3 -3
  277. package/src/components/header/QHeader.js +35 -47
  278. package/src/components/icon/QIcon.js +19 -19
  279. package/src/components/img/QImg.js +24 -24
  280. package/src/components/img/QImg.json +3 -3
  281. package/src/components/infinite-scroll/QInfiniteScroll.js +38 -52
  282. package/src/components/inner-loading/QInnerLoading.js +3 -3
  283. package/src/components/input/QInput.js +53 -52
  284. package/src/components/input/use-mask.js +56 -54
  285. package/src/components/intersection/QIntersection.js +6 -8
  286. package/src/components/item/QItem.js +20 -30
  287. package/src/components/item/QItemLabel.js +5 -7
  288. package/src/components/item/QItemSection.js +6 -6
  289. package/src/components/item/QList.js +6 -6
  290. package/src/components/item/QList.test.js +2 -2
  291. package/src/components/knob/QKnob.js +39 -44
  292. package/src/components/layout/QLayout.js +30 -34
  293. package/src/components/linear-progress/QLinearProgress.js +14 -23
  294. package/src/components/markup-table/QMarkupTable.js +7 -9
  295. package/src/components/menu/QMenu.js +36 -37
  296. package/src/components/no-ssr/QNoSsr.js +1 -1
  297. package/src/components/option-group/QOptionGroup.js +5 -5
  298. package/src/components/page/QPage.js +16 -18
  299. package/src/components/page/QPageContainer.js +9 -9
  300. package/src/components/page-scroller/QPageScroller.js +11 -13
  301. package/src/components/page-sticky/use-page-sticky.js +18 -18
  302. package/src/components/pagination/QPagination.js +24 -26
  303. package/src/components/parallax/QParallax.js +15 -9
  304. package/src/components/parallax/QParallax.json +1 -1
  305. package/src/components/popup-edit/QPopupEdit.js +10 -13
  306. package/src/components/popup-proxy/QPopupProxy.js +5 -7
  307. package/src/components/pull-to-refresh/QPullToRefresh.js +15 -17
  308. package/src/components/radio/QRadio.js +24 -29
  309. package/src/components/range/QRange.js +33 -37
  310. package/src/components/rating/QRating.js +59 -61
  311. package/src/components/resize-observer/QResizeObserver.js +55 -62
  312. package/src/components/scroll-area/QScrollArea.js +32 -36
  313. package/src/components/scroll-observer/QScrollObserver.js +3 -3
  314. package/src/components/select/QSelect.js +208 -269
  315. package/src/components/separator/QSeparator.js +7 -10
  316. package/src/components/skeleton/QSkeleton.js +4 -4
  317. package/src/components/slide-item/QSlideItem.js +7 -7
  318. package/src/components/slide-transition/QSlideTransition.js +4 -4
  319. package/src/components/slider/QSlider.js +13 -16
  320. package/src/components/slider/use-slider.js +53 -81
  321. package/src/components/slider/use-slider.json +3 -3
  322. package/src/components/space/QSpace.test.js +1 -1
  323. package/src/components/spinner/QSpinner.test.js +2 -2
  324. package/src/components/spinner/QSpinnerAudio.test.js +2 -2
  325. package/src/components/spinner/QSpinnerBall.test.js +2 -2
  326. package/src/components/spinner/QSpinnerBars.test.js +2 -2
  327. package/src/components/spinner/QSpinnerBox.test.js +2 -2
  328. package/src/components/spinner/QSpinnerClock.test.js +2 -2
  329. package/src/components/spinner/QSpinnerComment.test.js +2 -2
  330. package/src/components/spinner/QSpinnerCube.test.js +2 -2
  331. package/src/components/spinner/QSpinnerDots.test.js +2 -2
  332. package/src/components/spinner/QSpinnerFacebook.test.js +2 -2
  333. package/src/components/spinner/QSpinnerGears.test.js +2 -2
  334. package/src/components/spinner/QSpinnerGrid.test.js +2 -2
  335. package/src/components/spinner/QSpinnerHearts.test.js +2 -2
  336. package/src/components/spinner/QSpinnerHourglass.test.js +2 -2
  337. package/src/components/spinner/QSpinnerInfinity.test.js +2 -2
  338. package/src/components/spinner/QSpinnerIos.test.js +2 -2
  339. package/src/components/spinner/QSpinnerOrbit.test.js +2 -2
  340. package/src/components/spinner/QSpinnerOval.test.js +2 -2
  341. package/src/components/spinner/QSpinnerPie.test.js +2 -2
  342. package/src/components/spinner/QSpinnerPuff.test.js +2 -2
  343. package/src/components/spinner/QSpinnerRadio.test.js +2 -2
  344. package/src/components/spinner/QSpinnerRings.test.js +2 -2
  345. package/src/components/spinner/QSpinnerTail.test.js +2 -2
  346. package/src/components/spinner/use-spinner.test.js +1 -1
  347. package/src/components/splitter/QSplitter.js +19 -21
  348. package/src/components/stepper/QStep.js +12 -14
  349. package/src/components/stepper/QStepper.js +13 -14
  350. package/src/components/stepper/StepHeader.js +34 -35
  351. package/src/components/tab-panels/QTabPanels.js +3 -3
  352. package/src/components/table/QTable.js +82 -100
  353. package/src/components/table/QTd.js +3 -3
  354. package/src/components/table/QTh.js +5 -6
  355. package/src/components/table/QTr.js +3 -3
  356. package/src/components/table/table-column-selection.js +4 -6
  357. package/src/components/table/table-filter.js +2 -2
  358. package/src/components/table/table-pagination.js +14 -20
  359. package/src/components/table/table-row-expand.js +3 -3
  360. package/src/components/table/table-row-selection.js +10 -20
  361. package/src/components/table/table-sort.js +7 -7
  362. package/src/components/tabs/QRouteTab.js +1 -1
  363. package/src/components/tabs/QTab.js +1 -1
  364. package/src/components/tabs/QTabs.js +82 -109
  365. package/src/components/tabs/use-tab.js +36 -38
  366. package/src/components/time/QTime.js +109 -132
  367. package/src/components/timeline/QTimeline.js +7 -4
  368. package/src/components/timeline/QTimelineEntry.js +7 -6
  369. package/src/components/timeline/QTimelineEntry.json +1 -1
  370. package/src/components/toggle/QToggle.js +6 -8
  371. package/src/components/toolbar/QToolbar.js +2 -2
  372. package/src/components/toolbar/QToolbar.test.js +2 -2
  373. package/src/components/toolbar/QToolbarTitle.js +2 -4
  374. package/src/components/toolbar/QToolbarTitle.test.js +2 -2
  375. package/src/components/tooltip/QTooltip.js +27 -28
  376. package/src/components/tree/QTree.js +96 -114
  377. package/src/components/tree/QTree.json +1 -1
  378. package/src/components/uploader/QUploaderAddTrigger.js +2 -2
  379. package/src/components/uploader/uploader-core.js +44 -51
  380. package/src/components/uploader/xhr-uploader-plugin.js +13 -17
  381. package/src/components/video/QVideo.js +1 -1
  382. package/src/components/video/QVideo.test.js +2 -2
  383. package/src/components/virtual-scroll/QVirtualScroll.js +9 -10
  384. package/src/components/virtual-scroll/use-virtual-scroll.js +42 -50
  385. package/src/composables/private.use-align/use-align.js +2 -2
  386. package/src/composables/private.use-align/use-align.test.js +1 -1
  387. package/src/composables/private.use-anchor/use-anchor.js +23 -32
  388. package/src/composables/private.use-dark/use-dark.test.js +1 -1
  389. package/src/composables/private.use-field/use-field.js +79 -99
  390. package/src/composables/private.use-file/use-file-dom-props.js +2 -2
  391. package/src/composables/private.use-file/use-file.js +27 -27
  392. package/src/composables/private.use-fullscreen/use-fullscreen.js +15 -20
  393. package/src/composables/private.use-history/use-history.js +2 -2
  394. package/src/composables/private.use-history/use-history.test.js +1 -1
  395. package/src/composables/private.use-key-composition/use-key-composition.js +11 -12
  396. package/src/composables/private.use-model-toggle/use-model-toggle.js +16 -25
  397. package/src/composables/private.use-panel/use-panel.js +25 -27
  398. package/src/composables/private.use-portal/use-portal.js +11 -9
  399. package/src/composables/private.use-prevent-scroll/use-prevent-scroll.js +1 -4
  400. package/src/composables/private.use-ratio/use-ratio.js +6 -5
  401. package/src/composables/private.use-ratio/use-ratio.test.js +1 -1
  402. package/src/composables/private.use-refocus-target/use-refocus-target.js +2 -4
  403. package/src/composables/private.use-router-link/use-router-link.js +44 -55
  404. package/src/composables/private.use-scroll-target/use-scroll-target.js +1 -1
  405. package/src/composables/private.use-size/use-size.test.js +1 -1
  406. package/src/composables/private.use-transition/use-transition.test.js +1 -1
  407. package/src/composables/private.use-validate/use-validate.js +23 -36
  408. package/src/composables/use-dialog-plugin-component/use-dialog-plugin-component.js +1 -1
  409. package/src/composables/use-form/private.use-form.js +1 -1
  410. package/src/composables/use-form/private.use-form.test.js +3 -3
  411. package/src/composables/use-form/use-form-child.js +7 -7
  412. package/src/composables/use-hydration/use-hydration.js +2 -2
  413. package/src/composables/use-hydration/use-hydration.test.js +1 -1
  414. package/src/composables/use-id/use-id.js +4 -8
  415. package/src/composables/use-id/use-id.test.js +1 -1
  416. package/src/composables/use-interval/use-interval.js +2 -2
  417. package/src/composables/use-interval/use-interval.test.js +1 -1
  418. package/src/composables/use-meta/use-meta.js +3 -3
  419. package/src/composables/use-quasar/use-quasar.test.js +1 -1
  420. package/src/composables/use-render-cache/use-render-cache.js +1 -1
  421. package/src/composables/use-render-cache/use-render-cache.test.js +1 -1
  422. package/src/composables/use-split-attrs/use-split-attrs.js +3 -7
  423. package/src/composables/use-split-attrs/use-split-attrs.test.js +1 -1
  424. package/src/composables/use-tick/use-tick.js +3 -3
  425. package/src/composables/use-tick/use-tick.test.js +2 -2
  426. package/src/composables/use-timeout/use-timeout.js +2 -2
  427. package/src/composables/use-timeout/use-timeout.test.js +1 -1
  428. package/src/directives/close-popup/ClosePopup.js +4 -9
  429. package/src/directives/intersection/Intersection.js +5 -8
  430. package/src/directives/morph/Morph.js +12 -18
  431. package/src/directives/ripple/Ripple.js +19 -26
  432. package/src/directives/ripple/Ripple.test.js +2 -2
  433. package/src/directives/scroll/Scroll.js +2 -2
  434. package/src/directives/touch-hold/TouchHold.js +22 -28
  435. package/src/directives/touch-pan/TouchPan.js +68 -84
  436. package/src/directives/touch-repeat/TouchRepeat.js +28 -39
  437. package/src/directives/touch-swipe/TouchSwipe.js +30 -33
  438. package/src/index.ssr.js +2 -0
  439. package/src/index.umd.js +2 -0
  440. package/src/install-quasar.js +9 -9
  441. package/src/plugins/addressbar/AddressbarColor.js +9 -9
  442. package/src/plugins/addressbar/AddressbarColor.test.js +2 -2
  443. package/src/plugins/app-fullscreen/AppFullscreen.js +11 -10
  444. package/src/plugins/app-fullscreen/AppFullscreen.test.js +2 -2
  445. package/src/plugins/app-fullscreen/test/mock-fullscreen.js +2 -2
  446. package/src/plugins/app-visibility/AppVisibility.js +5 -5
  447. package/src/plugins/app-visibility/AppVisibility.test.js +2 -2
  448. package/src/plugins/bottom-sheet/BottomSheet.js +2 -2
  449. package/src/plugins/bottom-sheet/component/BottomSheetComponent.js +4 -4
  450. package/src/plugins/cookies/Cookies.js +50 -62
  451. package/src/plugins/dark/Dark.js +3 -5
  452. package/src/plugins/dark/Dark.test.js +1 -1
  453. package/src/plugins/dialog/Dialog.js +2 -2
  454. package/src/plugins/dialog/component/DialogPluginComponent.js +17 -20
  455. package/src/plugins/icon-set/IconSet.js +2 -4
  456. package/src/plugins/icon-set/IconSet.test.js +1 -1
  457. package/src/plugins/lang/Lang.js +7 -10
  458. package/src/plugins/lang/Lang.json +2 -2
  459. package/src/plugins/lang/Lang.test.js +2 -2
  460. package/src/plugins/loading/Loading.js +10 -12
  461. package/src/plugins/loading-bar/LoadingBar.js +4 -4
  462. package/src/plugins/meta/Meta.js +10 -11
  463. package/src/plugins/notify/Notify.js +67 -72
  464. package/src/plugins/platform/Platform.js +19 -21
  465. package/src/plugins/platform/Platform.test.js +1 -1
  466. package/src/plugins/private.body/Body.js +23 -29
  467. package/src/plugins/private.body/Body.test.js +1 -1
  468. package/src/plugins/private.history/History.js +17 -25
  469. package/src/plugins/private.history/History.test.js +1 -1
  470. package/src/plugins/screen/Screen.js +16 -16
  471. package/src/plugins/screen/Screen.test.js +1 -1
  472. package/src/plugins/storage/LocalStorage.js +3 -4
  473. package/src/plugins/storage/LocalStorage.test.js +2 -2
  474. package/src/plugins/storage/SessionStorage.js +3 -4
  475. package/src/plugins/storage/SessionStorage.test.js +2 -2
  476. package/src/plugins/storage/engine/web-storage.js +30 -23
  477. package/src/plugins/storage/engine/web-storage.test.js +1 -1
  478. package/src/utils/EventBus/EventBus.js +3 -4
  479. package/src/utils/EventBus/EventBus.test.js +1 -1
  480. package/src/utils/clone/clone.test.js +4 -8
  481. package/src/utils/colors/colors.js +38 -29
  482. package/src/utils/colors/colors.test.js +2 -2
  483. package/src/utils/copy-to-clipboard/copy-to-clipboard.js +6 -11
  484. package/src/utils/create-meta-mixin/create-meta-mixin.js +2 -2
  485. package/src/utils/create-uploader-component/create-uploader-component.js +12 -7
  486. package/src/utils/css-var/get-css-var.test.js +2 -2
  487. package/src/utils/css-var/set-css-var.test.js +2 -2
  488. package/src/utils/date/date.js +229 -172
  489. package/src/utils/date/private.persian.js +11 -11
  490. package/src/utils/debounce/debounce.js +3 -7
  491. package/src/utils/debounce/debounce.test.js +1 -1
  492. package/src/utils/dom/dom.js +2 -4
  493. package/src/utils/dom/dom.test.js +4 -4
  494. package/src/utils/event/event.js +21 -23
  495. package/src/utils/export-file/export-file.js +3 -3
  496. package/src/utils/extend/extend.js +15 -14
  497. package/src/utils/extend/extend.test.js +2 -2
  498. package/src/utils/format/format.js +4 -10
  499. package/src/utils/format/format.test.js +1 -1
  500. package/src/utils/frame-debounce/frame-debounce.js +23 -12
  501. package/src/utils/frame-debounce/frame-debounce.test.js +1 -1
  502. package/src/utils/is/is.js +15 -26
  503. package/src/utils/is/is.test.js +8 -7
  504. package/src/utils/morph/morph.js +57 -48
  505. package/src/utils/open-url/open-url.js +7 -7
  506. package/src/utils/patterns/patterns.js +26 -23
  507. package/src/utils/patterns/patterns.test.js +1 -1
  508. package/src/utils/private.click-outside/click-outside.js +5 -5
  509. package/src/utils/private.config/instance-config.js +2 -0
  510. package/src/utils/private.config/instance-config.test.js +4 -4
  511. package/src/utils/private.config/nodes.js +5 -5
  512. package/src/utils/private.config/nodes.test.js +4 -4
  513. package/src/utils/private.create/create.test.js +1 -1
  514. package/src/utils/private.dialog/create-dialog.js +9 -12
  515. package/src/utils/private.focus/focus-manager.js +5 -1
  516. package/src/utils/private.focus/focus-manager.test.js +4 -4
  517. package/src/utils/private.focus/focusout.js +2 -2
  518. package/src/utils/private.focus/focusout.test.js +1 -1
  519. package/src/utils/private.get-emits-object/get-emits-object.test.js +1 -1
  520. package/src/utils/private.inject-obj-prop/inject-obj-prop.test.js +2 -2
  521. package/src/utils/private.keyboard/escape-key.js +5 -5
  522. package/src/utils/private.keyboard/escape-key.test.js +1 -1
  523. package/src/utils/private.keyboard/key-composition.js +4 -6
  524. package/src/utils/private.noop-ssr-directive-transform/noop-ssr-directive-transform.js +3 -1
  525. package/src/utils/private.noop-ssr-directive-transform/noop-ssr-directive-transform.test.js +1 -1
  526. package/src/utils/private.portal/portal.js +5 -5
  527. package/src/utils/private.position-engine/position-engine.js +20 -22
  528. package/src/utils/private.render/render.js +5 -7
  529. package/src/utils/private.render/render.test.js +5 -5
  530. package/src/utils/private.rtl/rtl.js +3 -2
  531. package/src/utils/private.rtl/rtl.test.js +1 -1
  532. package/src/utils/private.selection/selection.js +1 -1
  533. package/src/utils/private.selection/selection.test.js +2 -2
  534. package/src/utils/private.sort/sort.test.js +2 -2
  535. package/src/utils/private.touch/touch.js +10 -14
  536. package/src/utils/private.touch/touch.test.js +1 -1
  537. package/src/utils/private.vm/vm.js +2 -2
  538. package/src/utils/private.vm/vm.test.js +4 -4
  539. package/src/utils/run-sequential-promises/run-sequential-promises.js +44 -54
  540. package/src/utils/run-sequential-promises/run-sequential-promises.test.js +183 -0
  541. package/src/utils/scroll/prevent-scroll.js +9 -9
  542. package/src/utils/scroll/scroll.js +11 -12
  543. package/src/utils/throttle/throttle.js +4 -3
  544. package/src/utils/throttle/throttle.test.js +1 -1
  545. package/src/utils/uid/uid.js +51 -77
  546. package/src/utils/uid/uid.test.js +3 -3
  547. package/wrappers/index.cjs +2 -2
  548. package/wrappers/index.js +2 -2
  549. package/dist/vetur/quasar-attributes.json +0 -1
  550. package/dist/vetur/quasar-tags.json +0 -1
@@ -0,0 +1,183 @@
1
+ import { describe, expect, test, vi } from 'vitest'
2
+ import runSequentialPromises from './run-sequential-promises.js'
3
+
4
+ // Helper to simulate asynchronous tasks
5
+ const delay = (ms, value, shouldReject = false) => {
6
+ const { promise, resolve, reject } = Promise.withResolvers()
7
+ setTimeout(() => {
8
+ if (shouldReject) reject(value)
9
+ else resolve(value)
10
+ }, ms)
11
+
12
+ return promise
13
+ }
14
+
15
+ describe('[runSequentialPromises API]', () => {
16
+ describe('[Functions]', () => {
17
+ describe('[(function)default]', () => {
18
+ test('resolves with an empty array if passed an empty array', async () => {
19
+ const result = await runSequentialPromises([])
20
+ expect(result).toEqual([])
21
+ })
22
+
23
+ test('resolves with an empty object if passed an empty object', async () => {
24
+ const result = await runSequentialPromises({})
25
+ expect(result).toEqual({})
26
+ })
27
+
28
+ describe('Array Inputs', () => {
29
+ test('runs an array of promises and returns fulfilled statuses', async () => {
30
+ const tasks = [() => delay(10, 'first'), () => delay(10, 'second')]
31
+ const result = await runSequentialPromises(tasks)
32
+
33
+ expect(result).toEqual([
34
+ { key: 0, status: 'fulfilled', value: 'first' },
35
+ { key: 1, status: 'fulfilled', value: 'second' }
36
+ ])
37
+ })
38
+
39
+ test('passes the resultAggregator down to subsequent promises', async () => {
40
+ const tasks = [
41
+ () => delay(10, 'first'),
42
+ agg => delay(10, agg[0].value + ' and second')
43
+ ]
44
+
45
+ const result = await runSequentialPromises(tasks)
46
+
47
+ expect(result[1].value).toBe('first and second')
48
+ })
49
+ })
50
+
51
+ describe('Object Inputs', () => {
52
+ test('runs an object of promises and returns fulfilled statuses', async () => {
53
+ const tasks = {
54
+ taskA: () => delay(10, 'alpha'),
55
+ taskB: () => delay(10, 'beta')
56
+ }
57
+
58
+ const result = await runSequentialPromises(tasks)
59
+
60
+ expect(result).toEqual({
61
+ taskA: { key: 'taskA', status: 'fulfilled', value: 'alpha' },
62
+ taskB: { key: 'taskB', status: 'fulfilled', value: 'beta' }
63
+ })
64
+ })
65
+
66
+ test('passes the resultAggregator correctly for objects', async () => {
67
+ const tasks = {
68
+ taskA: () => delay(10, 100),
69
+ taskB: agg => delay(10, agg.taskA.value + 50)
70
+ }
71
+
72
+ const result = await runSequentialPromises(tasks)
73
+
74
+ expect(result.taskB.value).toBe(150)
75
+ })
76
+ })
77
+
78
+ describe('Error Handling (abortOnFail)', () => {
79
+ test('rejects immediately on first error if abortOnFail is true (default)', async () => {
80
+ const mockTask3 = vi.fn(() => delay(10, 'third'))
81
+
82
+ const tasks = [
83
+ () => delay(10, 'first'),
84
+ () => delay(10, new Error('Task 2 Failed'), true), // Rejects
85
+ mockTask3 // Should not run
86
+ ]
87
+
88
+ await expect(runSequentialPromises(tasks)).rejects.toMatchObject({
89
+ key: 1,
90
+ status: 'rejected',
91
+ reason: new Error('Task 2 Failed'),
92
+ resultAggregator: [
93
+ { key: 0, status: 'fulfilled', value: 'first' },
94
+ {
95
+ key: 1,
96
+ status: 'rejected',
97
+ reason: new Error('Task 2 Failed')
98
+ },
99
+ null // Task 3 never ran
100
+ ]
101
+ })
102
+
103
+ // Ensure the next task was aborted
104
+ expect(mockTask3).not.toHaveBeenCalled()
105
+ })
106
+
107
+ test('continues execution if abortOnFail is false and resolves with mixed results', async () => {
108
+ const mockTask3 = vi.fn(() => delay(10, 'third'))
109
+
110
+ const tasks = {
111
+ task1: () => delay(10, 'first'),
112
+ task2: () => delay(10, new Error('Task 2 Failed'), true), // Rejects
113
+ task3: mockTask3 // Should run
114
+ }
115
+
116
+ const result = await runSequentialPromises(tasks, {
117
+ abortOnFail: false
118
+ })
119
+
120
+ expect(result).toMatchObject({
121
+ task1: { key: 'task1', status: 'fulfilled', value: 'first' },
122
+ task2: {
123
+ key: 'task2',
124
+ status: 'rejected',
125
+ reason: new Error('Task 2 Failed')
126
+ },
127
+ task3: { key: 'task3', status: 'fulfilled', value: 'third' }
128
+ })
129
+
130
+ expect(mockTask3).toHaveBeenCalled()
131
+ })
132
+ })
133
+
134
+ describe('Concurrency Limits (threadsNumber)', () => {
135
+ test('processes tasks concurrently when threadsNumber > 1', async () => {
136
+ let runningTasks = 0
137
+ let maxConcurrency = 0
138
+
139
+ const trackConcurrency = async () => {
140
+ runningTasks++
141
+ maxConcurrency = Math.max(maxConcurrency, runningTasks)
142
+ await delay(20, 'done')
143
+ runningTasks--
144
+ }
145
+
146
+ const tasks = [
147
+ trackConcurrency,
148
+ trackConcurrency,
149
+ trackConcurrency,
150
+ trackConcurrency,
151
+ trackConcurrency
152
+ ]
153
+
154
+ await runSequentialPromises(tasks, { threadsNumber: 3 })
155
+
156
+ // If they ran sequentially, maxConcurrency would be 1.
157
+ // If threading worked, it should hit exactly 3.
158
+ expect(maxConcurrency).toBe(3)
159
+ })
160
+ })
161
+
162
+ describe('Edge Cases', () => {
163
+ test('wraps synchronous functions safely without crashing', async () => {
164
+ const tasks = [
165
+ () => 'sync value 1',
166
+ () => {
167
+ throw new Error('sync error')
168
+ },
169
+ () => 'sync value 2'
170
+ ]
171
+
172
+ // Because of the Promise.resolve() wrap in the implementation,
173
+ // this should cleanly reject rather than synchronously crashing Vitest
174
+ await expect(runSequentialPromises(tasks)).rejects.toMatchObject({
175
+ key: 1,
176
+ status: 'rejected',
177
+ reason: new Error('sync error')
178
+ })
179
+ })
180
+ })
181
+ })
182
+ })
183
+ })
@@ -1,7 +1,7 @@
1
1
  import {
2
- hasScrollbar,
2
+ getHorizontalScrollPosition,
3
3
  getVerticalScrollPosition,
4
- getHorizontalScrollPosition
4
+ hasScrollbar
5
5
  } from './scroll.js'
6
6
  import { getEventPath, listenOpts, stopAndPrevent } from '../event/event.js'
7
7
  import { client } from '../../plugins/platform/Platform.js'
@@ -61,7 +61,7 @@ function onAppleScroll(e) {
61
61
  }
62
62
 
63
63
  function onAppleResize(evt) {
64
- if (vpPendingUpdate === true) return
64
+ if (vpPendingUpdate) return
65
65
 
66
66
  vpPendingUpdate = true
67
67
 
@@ -117,8 +117,8 @@ function apply(action) {
117
117
  body.classList.add('q-body--prevent-scroll')
118
118
  document.qScrollPrevented = true
119
119
 
120
- if (client.is.ios === true) {
121
- if (hasViewport === true) {
120
+ if (client.is.ios) {
121
+ if (hasViewport) {
122
122
  window.scrollTo(0, 0)
123
123
  window.visualViewport.addEventListener(
124
124
  'resize',
@@ -141,14 +141,14 @@ function apply(action) {
141
141
  }
142
142
  }
143
143
 
144
- if (client.is.desktop === true && client.is.mac === true) {
144
+ if (client.is.desktop && client.is.mac) {
145
145
  // ref. https://developers.google.com/web/updates/2017/01/scrolling-intervention
146
146
  window[`${action}EventListener`]('wheel', onWheel, listenOpts.notPassive)
147
147
  }
148
148
 
149
149
  if (action === 'remove') {
150
- if (client.is.ios === true) {
151
- if (hasViewport === true) {
150
+ if (client.is.ios) {
151
+ if (hasViewport) {
152
152
  window.visualViewport.removeEventListener(
153
153
  'resize',
154
154
  onAppleResize,
@@ -208,7 +208,7 @@ export default function preventScroll(state) {
208
208
 
209
209
  action = 'remove'
210
210
 
211
- if (client.is.ios === true && client.is.nativeMobile === true) {
211
+ if (client.is.ios && client.is.nativeMobile) {
212
212
  if (closeTimer !== null) clearTimeout(closeTimer)
213
213
  closeTimer = setTimeout(() => {
214
214
  apply(action)
@@ -48,8 +48,9 @@ export function getHorizontalScrollPosition(scrollTarget) {
48
48
  : scrollTarget.scrollLeft
49
49
  }
50
50
 
51
- export function animVerticalScrollTo(el, to, duration = 0 /* , prevTime */) {
52
- const prevTime = arguments[3] === void 0 ? performance.now() : arguments[3]
51
+ // oxlint-disable-next-line default-param-last
52
+ export function animVerticalScrollTo(el, to, duration = 0, rawPrevTime) {
53
+ const prevTime = rawPrevTime === void 0 ? performance.now() : rawPrevTime
53
54
  const pos = getVerticalScrollPosition(el)
54
55
 
55
56
  if (duration <= 0) {
@@ -70,8 +71,9 @@ export function animVerticalScrollTo(el, to, duration = 0 /* , prevTime */) {
70
71
  })
71
72
  }
72
73
 
73
- export function animHorizontalScrollTo(el, to, duration = 0 /* , prevTime */) {
74
- const prevTime = arguments[3] === void 0 ? performance.now() : arguments[3]
74
+ // oxlint-disable-next-line default-param-last
75
+ export function animHorizontalScrollTo(el, to, duration = 0, rawPrevTime) {
76
+ const prevTime = rawPrevTime === void 0 ? performance.now() : rawPrevTime
75
77
  const pos = getHorizontalScrollPosition(el)
76
78
 
77
79
  if (duration <= 0) {
@@ -151,9 +153,9 @@ export function getScrollbarWidth() {
151
153
  overflow: 'hidden'
152
154
  })
153
155
 
154
- outer.appendChild(inner)
156
+ outer.append(inner)
155
157
 
156
- document.body.appendChild(outer)
158
+ document.body.append(outer)
157
159
 
158
160
  const w1 = inner.offsetWidth
159
161
  outer.style.overflow = 'scroll'
@@ -169,6 +171,7 @@ export function getScrollbarWidth() {
169
171
  return size
170
172
  }
171
173
 
174
+ const autoAndScroll = ['auto', 'scroll']
172
175
  export function hasScrollbar(el, onY = true) {
173
176
  if (!el || el.nodeType !== Node.ELEMENT_NODE) {
174
177
  return false
@@ -178,15 +181,11 @@ export function hasScrollbar(el, onY = true) {
178
181
  ? el.scrollHeight > el.clientHeight &&
179
182
  (el.classList.contains('scroll') ||
180
183
  el.classList.contains('overflow-auto') ||
181
- ['auto', 'scroll'].includes(
182
- window.getComputedStyle(el)['overflow-y']
183
- ))
184
+ autoAndScroll.includes(window.getComputedStyle(el)['overflow-y']))
184
185
  : el.scrollWidth > el.clientWidth &&
185
186
  (el.classList.contains('scroll') ||
186
187
  el.classList.contains('overflow-auto') ||
187
- ['auto', 'scroll'].includes(
188
- window.getComputedStyle(el)['overflow-x']
189
- ))
188
+ autoAndScroll.includes(window.getComputedStyle(el)['overflow-x']))
190
189
  }
191
190
 
192
191
  export default {
@@ -2,13 +2,14 @@ export default function throttle(fn, limit = 250) {
2
2
  let wait = false,
3
3
  result
4
4
 
5
- return function runThrottle(/* ...args */) {
6
- if (wait === false) {
5
+ return function runThrottle(...args) {
6
+ if (!wait) {
7
7
  wait = true
8
8
  setTimeout(() => {
9
9
  wait = false
10
10
  }, limit)
11
- result = fn.apply(this, arguments)
11
+
12
+ result = fn.apply(this, args)
12
13
  }
13
14
 
14
15
  return result
@@ -1,4 +1,4 @@
1
- import { describe, test, expect, vi, beforeEach, afterEach } from 'vitest'
1
+ import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
2
2
 
3
3
  import throttle from './throttle.js'
4
4
 
@@ -1,84 +1,58 @@
1
- /**
2
- * Based on the work of https://github.com/jchook/uuid-random
3
- */
4
-
5
- let buf,
6
- bufIdx = 0
7
- const hexBytes = new Array(256)
8
-
9
- // Pre-calculate toString(16) for speed
10
- for (let i = 0; i < 256; i++) {
11
- hexBytes[i] = (i + 0x100).toString(16).substring(1)
12
- }
13
-
14
- // Use best available PRNG
15
- const randomBytes = (() => {
16
- // Node & Browser support
17
- const lib =
18
- typeof crypto !== 'undefined'
19
- ? crypto
20
- : typeof window !== 'undefined'
21
- ? window.crypto || window.msCrypto
22
- : void 0
23
-
24
- if (lib !== void 0) {
25
- if (lib.randomBytes !== void 0) {
26
- return lib.randomBytes
27
- }
28
- if (lib.getRandomValues !== void 0) {
29
- return n => {
30
- const bytes = new Uint8Array(n)
31
- lib.getRandomValues(bytes)
32
- return bytes
33
- }
1
+ function createUidFn() {
2
+ if (typeof crypto === 'undefined') {
3
+ return () => {
4
+ throw new Error(
5
+ '[Quasar uid()] Secure RNG not available. Cannot generate collision-resistant UUID.'
6
+ )
34
7
  }
35
8
  }
36
9
 
37
- return n => {
38
- const r = []
39
- for (let i = n; i > 0; i--) {
40
- r.push(Math.floor(Math.random() * 256))
41
- }
42
- return r
43
- }
44
- })()
10
+ // Fast Path: Native C++/Rust implementation (Node.js & HTTPS Browsers)
11
+ if (crypto.randomUUID) return () => crypto.randomUUID()
45
12
 
46
- // Buffer random numbers for speed
47
- // Reduce memory usage by decreasing this number (min 16)
48
- // or improve speed by increasing this number (try 16384)
49
- const BUFFER_SIZE = 4096
50
-
51
- export default function uid() {
52
- // Buffer some random bytes for speed
53
- if (buf === void 0 || bufIdx + 16 > BUFFER_SIZE) {
54
- bufIdx = 0
55
- buf = randomBytes(BUFFER_SIZE)
56
- }
13
+ // Pre-compute hex map for the HTTP fallback
14
+ const hex = Array.from({ length: 256 }, (_, i) =>
15
+ (i + 0x1_00).toString(16).slice(1)
16
+ )
17
+ let buf, bufIdx
57
18
 
58
- const b = Array.prototype.slice.call(buf, bufIdx, (bufIdx += 16))
59
- b[6] = (b[6] & 0x0f) | 0x40
60
- b[8] = (b[8] & 0x3f) | 0x80
19
+ return () => {
20
+ if (buf === void 0 || bufIdx + 16 > 4096) {
21
+ bufIdx = 0
22
+ buf = new Uint8Array(4096)
23
+ crypto.getRandomValues(buf)
24
+ }
61
25
 
62
- return (
63
- hexBytes[b[0]] +
64
- hexBytes[b[1]] +
65
- hexBytes[b[2]] +
66
- hexBytes[b[3]] +
67
- '-' +
68
- hexBytes[b[4]] +
69
- hexBytes[b[5]] +
70
- '-' +
71
- hexBytes[b[6]] +
72
- hexBytes[b[7]] +
73
- '-' +
74
- hexBytes[b[8]] +
75
- hexBytes[b[9]] +
76
- '-' +
77
- hexBytes[b[10]] +
78
- hexBytes[b[11]] +
79
- hexBytes[b[12]] +
80
- hexBytes[b[13]] +
81
- hexBytes[b[14]] +
82
- hexBytes[b[15]]
83
- )
26
+ const i = bufIdx
27
+ bufIdx += 16
28
+
29
+ // Set UUIDv4 version (4) and variant (8, 9, a, or b)
30
+ buf[i + 6] = (buf[i + 6] & 0x0f) | 0x40
31
+ buf[i + 8] = (buf[i + 8] & 0x3f) | 0x80
32
+
33
+ return (
34
+ hex[buf[i]] +
35
+ hex[buf[i + 1]] +
36
+ hex[buf[i + 2]] +
37
+ hex[buf[i + 3]] +
38
+ '-' +
39
+ hex[buf[i + 4]] +
40
+ hex[buf[i + 5]] +
41
+ '-' +
42
+ hex[buf[i + 6]] +
43
+ hex[buf[i + 7]] +
44
+ '-' +
45
+ hex[buf[i + 8]] +
46
+ hex[buf[i + 9]] +
47
+ '-' +
48
+ hex[buf[i + 10]] +
49
+ hex[buf[i + 11]] +
50
+ hex[buf[i + 12]] +
51
+ hex[buf[i + 13]] +
52
+ hex[buf[i + 14]] +
53
+ hex[buf[i + 15]]
54
+ )
55
+ }
84
56
  }
57
+
58
+ export default createUidFn()
@@ -1,10 +1,10 @@
1
- import { describe, test, expect } from 'vitest'
1
+ import { describe, test } from 'vitest'
2
2
 
3
3
  import uid from './uid.js'
4
4
 
5
5
  describe('[uid API]', () => {
6
- describe('[Functions]', () => {
7
- describe('[(function)default]', () => {
6
+ describe('[Variables]', () => {
7
+ describe('[(variable)default]', () => {
8
8
  test('has correct return value', () => {
9
9
  const result = uid()
10
10
  expect(result).toBeTypeOf('string')
@@ -4,7 +4,7 @@
4
4
  // parameters and return value when using Quasar with TypeScript
5
5
  // We need these in `ui` folder to make `quasar/wrapper` import work,
6
6
  // but they are useful only for Quasar CLI projects
7
- // They are typed via module augmentation by `@quasar/app-webpack` / `@quasar/app-vite`
7
+ // They are typed via module augmentation by `@quasar/app-vite` / `@quasar/app-webpack`
8
8
 
9
9
  /*******************************************************
10
10
  * Warning!
@@ -12,7 +12,7 @@
12
12
  * @quasar/app-vite v2
13
13
  * @quasar/app-webpack v4
14
14
  *
15
- * Use the new wrappers from #q-app/wrappers
15
+ * Use the new wrappers from #q-app instead
16
16
  *******************************************************/
17
17
 
18
18
  module.exports.boot = function boot(callback) {
package/wrappers/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  // parameters and return value when using Quasar with TypeScript
5
5
  // We need these in `ui` folder to make `quasar/wrapper` import work,
6
6
  // but they are useful only for Quasar CLI projects
7
- // They are typed via module augmentation by `@quasar/app-webpack` / `@quasar/app-vite`
7
+ // They are typed via module augmentation by `@quasar/app-vite` / `@quasar/app-webpack`
8
8
 
9
9
  /*******************************************************
10
10
  * Warning!
@@ -12,7 +12,7 @@
12
12
  * @quasar/app-vite v2
13
13
  * @quasar/app-webpack v4
14
14
  *
15
- * Use the new wrappers from #q-app/wrappers
15
+ * Use the new wrappers from #q-app instead
16
16
  *******************************************************/
17
17
 
18
18
  export function boot(callback) {