quasar 2.18.6 → 2.19.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 (858) hide show
  1. package/README.md +2 -0
  2. package/dist/api/BottomSheet.json +1 -1
  3. package/dist/api/Dialog.json +1 -1
  4. package/dist/api/Intersection.json +1 -1
  5. package/dist/api/Lang.json +1 -1
  6. package/dist/api/LocalStorage.json +1 -1
  7. package/dist/api/Notify.json +1 -1
  8. package/dist/api/QBtnDropdown.json +1 -1
  9. package/dist/api/QBtnToggle.json +1 -1
  10. package/dist/api/QCarousel.json +1 -1
  11. package/dist/api/QCarouselControl.json +1 -1
  12. package/dist/api/QChatMessage.json +1 -1
  13. package/dist/api/QCheckbox.json +1 -1
  14. package/dist/api/QColor.json +1 -1
  15. package/dist/api/QDate.json +1 -1
  16. package/dist/api/QEditor.json +1 -1
  17. package/dist/api/QField.json +1 -1
  18. package/dist/api/QFile.json +1 -1
  19. package/dist/api/QInput.json +1 -1
  20. package/dist/api/QIntersection.json +1 -1
  21. package/dist/api/QMenu.json +1 -1
  22. package/dist/api/QOptionGroup.json +1 -1
  23. package/dist/api/QPageScroller.json +1 -1
  24. package/dist/api/QPageSticky.json +1 -1
  25. package/dist/api/QPopupEdit.json +1 -1
  26. package/dist/api/QRange.json +1 -1
  27. package/dist/api/QRating.json +1 -1
  28. package/dist/api/QScrollArea.json +1 -1
  29. package/dist/api/QSelect.json +1 -1
  30. package/dist/api/QSlider.json +1 -1
  31. package/dist/api/QSplitter.json +1 -1
  32. package/dist/api/QStepper.json +1 -1
  33. package/dist/api/QTabPanels.json +1 -1
  34. package/dist/api/QTable.json +1 -1
  35. package/dist/api/QTime.json +1 -1
  36. package/dist/api/QToggle.json +1 -1
  37. package/dist/api/QTooltip.json +1 -1
  38. package/dist/api/QTree.json +1 -1
  39. package/dist/api/QUploader.json +1 -1
  40. package/dist/api/QVirtualScroll.json +1 -1
  41. package/dist/api/Ripple.json +1 -1
  42. package/dist/api/SessionStorage.json +1 -1
  43. package/dist/icon-set/bootstrap-icons.umd.prod.js +5 -6
  44. package/dist/icon-set/eva-icons.umd.prod.js +5 -6
  45. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +5 -6
  46. package/dist/icon-set/fontawesome-v5.umd.prod.js +5 -6
  47. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +5 -6
  48. package/dist/icon-set/fontawesome-v6.umd.prod.js +5 -6
  49. package/dist/icon-set/ionicons-v4.umd.prod.js +5 -6
  50. package/dist/icon-set/line-awesome.umd.prod.js +5 -6
  51. package/dist/icon-set/material-icons-outlined.umd.prod.js +5 -6
  52. package/dist/icon-set/material-icons-round.umd.prod.js +5 -6
  53. package/dist/icon-set/material-icons-sharp.umd.prod.js +5 -6
  54. package/dist/icon-set/material-icons.umd.prod.js +5 -6
  55. package/dist/icon-set/material-symbols-outlined.umd.prod.js +5 -6
  56. package/dist/icon-set/material-symbols-rounded.umd.prod.js +5 -6
  57. package/dist/icon-set/material-symbols-sharp.umd.prod.js +5 -6
  58. package/dist/icon-set/mdi-v3.umd.prod.js +5 -6
  59. package/dist/icon-set/mdi-v4.umd.prod.js +5 -6
  60. package/dist/icon-set/mdi-v5.umd.prod.js +5 -6
  61. package/dist/icon-set/mdi-v6.umd.prod.js +5 -6
  62. package/dist/icon-set/mdi-v7.umd.prod.js +5 -6
  63. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +5 -6
  64. package/dist/icon-set/svg-eva-icons.umd.prod.js +5 -6
  65. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +5 -6
  66. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +5 -6
  67. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +5 -6
  68. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +5 -6
  69. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +5 -6
  70. package/dist/icon-set/svg-line-awesome.umd.prod.js +5 -6
  71. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +5 -6
  72. package/dist/icon-set/svg-material-icons-round.umd.prod.js +5 -6
  73. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +5 -6
  74. package/dist/icon-set/svg-material-icons.umd.prod.js +5 -6
  75. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +5 -6
  76. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +5 -6
  77. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +5 -6
  78. package/dist/icon-set/svg-mdi-v6.umd.prod.js +5 -6
  79. package/dist/icon-set/svg-mdi-v7.umd.prod.js +5 -6
  80. package/dist/icon-set/svg-themify.umd.prod.js +5 -6
  81. package/dist/icon-set/themify.umd.prod.js +5 -6
  82. package/dist/lang/ar-TN.umd.prod.js +5 -6
  83. package/dist/lang/ar.umd.prod.js +5 -6
  84. package/dist/lang/az-Latn.umd.prod.js +5 -6
  85. package/dist/lang/bg.umd.prod.js +5 -6
  86. package/dist/lang/bn.umd.prod.js +5 -6
  87. package/dist/lang/bs-BA.umd.prod.js +5 -6
  88. package/dist/lang/ca.umd.prod.js +5 -6
  89. package/dist/lang/cs.umd.prod.js +5 -6
  90. package/dist/lang/da.umd.prod.js +5 -6
  91. package/dist/lang/de-CH.umd.prod.js +5 -6
  92. package/dist/lang/de-DE.umd.prod.js +5 -6
  93. package/dist/lang/de.umd.prod.js +5 -6
  94. package/dist/lang/el.umd.prod.js +5 -6
  95. package/dist/lang/en-GB.umd.prod.js +5 -6
  96. package/dist/lang/en-US.umd.prod.js +5 -6
  97. package/dist/lang/eo.umd.prod.js +5 -6
  98. package/dist/lang/es.umd.prod.js +5 -6
  99. package/dist/lang/et.umd.prod.js +5 -6
  100. package/dist/lang/eu.umd.prod.js +5 -6
  101. package/dist/lang/fa-IR.umd.prod.js +5 -6
  102. package/dist/lang/fa.umd.prod.js +5 -6
  103. package/dist/lang/fi.umd.prod.js +5 -6
  104. package/dist/lang/fr.umd.prod.js +5 -6
  105. package/dist/lang/gn.umd.prod.js +5 -6
  106. package/dist/lang/he.umd.prod.js +5 -6
  107. package/dist/lang/hi.umd.prod.js +5 -6
  108. package/dist/lang/hr.umd.prod.js +5 -6
  109. package/dist/lang/hu.umd.prod.js +5 -6
  110. package/dist/lang/id.umd.prod.js +5 -6
  111. package/dist/lang/is.umd.prod.js +5 -6
  112. package/dist/lang/it.umd.prod.js +5 -6
  113. package/dist/lang/ja.umd.prod.js +5 -6
  114. package/dist/lang/kk.umd.prod.js +5 -6
  115. package/dist/lang/km.umd.prod.js +5 -6
  116. package/dist/lang/ko-KR.umd.prod.js +5 -6
  117. package/dist/lang/kur-CKB.umd.prod.js +5 -6
  118. package/dist/lang/lt.umd.prod.js +5 -6
  119. package/dist/lang/lu.umd.prod.js +5 -6
  120. package/dist/lang/lv.umd.prod.js +5 -6
  121. package/dist/lang/mk.umd.prod.js +5 -6
  122. package/dist/lang/ml.umd.prod.js +5 -6
  123. package/dist/lang/mm.umd.prod.js +5 -6
  124. package/dist/lang/ms-MY.umd.prod.js +5 -6
  125. package/dist/lang/ms.umd.prod.js +5 -6
  126. package/dist/lang/my.umd.prod.js +5 -6
  127. package/dist/lang/nb-NO.umd.prod.js +5 -6
  128. package/dist/lang/nl.umd.prod.js +5 -6
  129. package/dist/lang/pl.umd.prod.js +5 -6
  130. package/dist/lang/pt-BR.umd.prod.js +5 -6
  131. package/dist/lang/pt.umd.prod.js +5 -6
  132. package/dist/lang/ro.umd.prod.js +5 -6
  133. package/dist/lang/ru.umd.prod.js +5 -6
  134. package/dist/lang/sk.umd.prod.js +5 -6
  135. package/dist/lang/sl.umd.prod.js +5 -6
  136. package/dist/lang/sm.umd.prod.js +5 -6
  137. package/dist/lang/sq.umd.prod.js +5 -6
  138. package/dist/lang/sr-CYR.umd.prod.js +5 -6
  139. package/dist/lang/sr.umd.prod.js +5 -6
  140. package/dist/lang/sv.umd.prod.js +5 -6
  141. package/dist/lang/ta.umd.prod.js +5 -6
  142. package/dist/lang/th.umd.prod.js +5 -6
  143. package/dist/lang/tl.umd.prod.js +5 -6
  144. package/dist/lang/tr.umd.prod.js +5 -6
  145. package/dist/lang/ug.umd.prod.js +5 -6
  146. package/dist/lang/uk.umd.prod.js +5 -6
  147. package/dist/lang/ur-PK.umd.prod.js +5 -6
  148. package/dist/lang/uz-Cyrl.umd.prod.js +5 -6
  149. package/dist/lang/uz-Latn.umd.prod.js +5 -6
  150. package/dist/lang/vi.umd.prod.js +5 -6
  151. package/dist/lang/zh-CN.umd.prod.js +5 -6
  152. package/dist/lang/zh-TW.umd.prod.js +5 -6
  153. package/dist/quasar.addon.prod.css +1 -1
  154. package/dist/quasar.addon.rtl.prod.css +1 -1
  155. package/dist/quasar.client.js +24830 -29218
  156. package/dist/quasar.css +24 -30
  157. package/dist/quasar.prod.css +1 -1
  158. package/dist/quasar.rtl.css +25 -30
  159. package/dist/quasar.rtl.prod.css +1 -1
  160. package/dist/quasar.sass +7 -16
  161. package/dist/quasar.server.prod.cjs +78 -79
  162. package/dist/quasar.server.prod.js +78 -79
  163. package/dist/quasar.umd.js +25876 -29789
  164. package/dist/quasar.umd.prod.js +78 -79
  165. package/dist/types/api/dialog.d.ts +1 -1
  166. package/dist/types/api/qinput.d.ts +1 -1
  167. package/dist/types/api/qtable.d.ts +1 -1
  168. package/dist/types/api/qtree.d.ts +1 -1
  169. package/dist/types/api/quploader.d.ts +1 -1
  170. package/dist/types/api/slider.d.ts +2 -4
  171. package/dist/types/api/validation.d.ts +1 -1
  172. package/dist/types/api/web-storage.d.ts +6 -6
  173. package/dist/types/feature-flag.d.ts +1 -1
  174. package/dist/types/globals.d.ts +7 -4
  175. package/dist/types/index.d.ts +127 -415
  176. package/dist/types/lang.d.ts +3 -3
  177. package/dist/types/ts-helpers.d.ts +4 -9
  178. package/dist/types/utils/colors.d.ts +1 -1
  179. package/dist/types/utils/date.d.ts +8 -8
  180. package/dist/types/utils/dom.d.ts +1 -1
  181. package/dist/types/utils/run-sequential-promises.d.ts +12 -12
  182. package/dist/types/utils/scroll.d.ts +5 -5
  183. package/dist/types/utils.d.ts +16 -19
  184. package/dist/vetur/quasar-attributes.json +1 -1
  185. package/dist/web-types/web-types.json +1 -1
  186. package/icon-set/bootstrap-icons.js +1 -4
  187. package/icon-set/svg-bootstrap-icons.js +1 -4
  188. package/icon-set/svg-fontawesome-v5.js +0 -1
  189. package/icon-set/svg-ionicons-v5.js +2 -2
  190. package/lang/ar-TN.js +10 -8
  191. package/lang/ar.js +10 -8
  192. package/lang/az-Latn.js +13 -9
  193. package/lang/bg.js +10 -8
  194. package/lang/bn.js +14 -9
  195. package/lang/bs-BA.js +13 -9
  196. package/lang/ca.js +18 -14
  197. package/lang/cs.js +9 -7
  198. package/lang/da.js +10 -8
  199. package/lang/de-CH.js +13 -9
  200. package/lang/de-DE.js +13 -9
  201. package/lang/de.js +13 -9
  202. package/lang/el.js +10 -8
  203. package/lang/en-GB.js +10 -8
  204. package/lang/en-US.js +10 -8
  205. package/lang/eo.js +14 -9
  206. package/lang/es.js +10 -8
  207. package/lang/et.js +15 -12
  208. package/lang/eu.js +15 -12
  209. package/lang/fa-IR.js +16 -8
  210. package/lang/fa.js +16 -8
  211. package/lang/fi.js +17 -8
  212. package/lang/fr.js +21 -13
  213. package/lang/gn.js +14 -12
  214. package/lang/he.js +15 -10
  215. package/lang/hi.js +8 -8
  216. package/lang/hr.js +13 -9
  217. package/lang/hu.js +10 -8
  218. package/lang/id.js +11 -9
  219. package/lang/is.js +13 -9
  220. package/lang/it.js +14 -9
  221. package/lang/ja.js +13 -8
  222. package/lang/kk.js +22 -11
  223. package/lang/km.js +9 -8
  224. package/lang/ko-KR.js +9 -10
  225. package/lang/kur-CKB.js +16 -17
  226. package/lang/lt.js +26 -19
  227. package/lang/lu.js +13 -9
  228. package/lang/lv.js +13 -9
  229. package/lang/mk.js +10 -8
  230. package/lang/ml.js +15 -14
  231. package/lang/mm.js +16 -13
  232. package/lang/ms-MY.js +16 -11
  233. package/lang/ms.js +10 -8
  234. package/lang/my.js +15 -8
  235. package/lang/nb-NO.js +10 -8
  236. package/lang/nl.js +13 -9
  237. package/lang/pl.js +13 -9
  238. package/lang/pt-BR.js +17 -10
  239. package/lang/pt.js +17 -10
  240. package/lang/ro.js +10 -8
  241. package/lang/ru.js +25 -12
  242. package/lang/sk.js +18 -9
  243. package/lang/sl.js +12 -8
  244. package/lang/sm.js +51 -47
  245. package/lang/sq.js +13 -9
  246. package/lang/sr-CYR.js +10 -8
  247. package/lang/sr.js +10 -8
  248. package/lang/sv.js +10 -8
  249. package/lang/ta.js +10 -8
  250. package/lang/th.js +12 -11
  251. package/lang/tl.js +10 -8
  252. package/lang/tr.js +8 -5
  253. package/lang/ug.js +16 -8
  254. package/lang/uk.js +22 -11
  255. package/lang/ur-PK.js +13 -11
  256. package/lang/uz-Cyrl.js +5 -5
  257. package/lang/uz-Latn.js +24 -24
  258. package/lang/vi.js +13 -9
  259. package/lang/zh-CN.js +18 -9
  260. package/lang/zh-TW.js +20 -10
  261. package/package.json +52 -66
  262. package/src/api.extends.json +15 -12
  263. package/src/components/ajax-bar/QAjaxBar.js +91 -65
  264. package/src/components/ajax-bar/QAjaxBar.json +2 -2
  265. package/src/components/ajax-bar/index.js +1 -3
  266. package/src/components/avatar/QAvatar.js +36 -28
  267. package/src/components/avatar/QAvatar.json +2 -2
  268. package/src/components/avatar/QAvatar.test.js +29 -78
  269. package/src/components/avatar/index.js +1 -3
  270. package/src/components/badge/QBadge.js +33 -26
  271. package/src/components/badge/QBadge.json +3 -3
  272. package/src/components/badge/QBadge.test.js +40 -95
  273. package/src/components/badge/index.js +1 -3
  274. package/src/components/banner/QBanner.js +46 -25
  275. package/src/components/banner/QBanner.test.js +14 -35
  276. package/src/components/banner/index.js +1 -3
  277. package/src/components/bar/QBar.js +21 -11
  278. package/src/components/bar/QBar.test.js +6 -17
  279. package/src/components/bar/index.js +1 -3
  280. package/src/components/breadcrumbs/QBreadcrumbs.js +44 -32
  281. package/src/components/breadcrumbs/QBreadcrumbs.json +10 -3
  282. package/src/components/breadcrumbs/QBreadcrumbs.test.js +56 -69
  283. package/src/components/breadcrumbs/QBreadcrumbsEl.js +28 -22
  284. package/src/components/breadcrumbs/QBreadcrumbsEl.json +5 -8
  285. package/src/components/breadcrumbs/QBreadcrumbsEl.test.js +60 -134
  286. package/src/components/breadcrumbs/index.js +1 -4
  287. package/src/components/btn/QBtn.js +159 -103
  288. package/src/components/btn/QBtn.json +3 -6
  289. package/src/components/btn/QBtn.test.js +269 -496
  290. package/src/components/btn/index.js +1 -3
  291. package/src/components/btn/use-btn.js +82 -70
  292. package/src/components/btn/use-btn.json +33 -16
  293. package/src/components/btn/use-btn.test.js +30 -47
  294. package/src/components/btn-dropdown/QBtnDropdown.js +143 -104
  295. package/src/components/btn-dropdown/QBtnDropdown.json +42 -17
  296. package/src/components/btn-dropdown/index.js +1 -3
  297. package/src/components/btn-group/QBtnGroup.js +18 -6
  298. package/src/components/btn-group/index.js +1 -3
  299. package/src/components/btn-toggle/QBtnToggle.js +80 -61
  300. package/src/components/btn-toggle/QBtnToggle.json +16 -9
  301. package/src/components/btn-toggle/index.js +1 -3
  302. package/src/components/card/QCard.js +14 -9
  303. package/src/components/card/QCard.json +1 -1
  304. package/src/components/card/QCardActions.js +8 -5
  305. package/src/components/card/QCardActions.json +9 -1
  306. package/src/components/card/QCardSection.js +5 -4
  307. package/src/components/card/QCardSection.json +1 -1
  308. package/src/components/card/index.js +1 -5
  309. package/src/components/carousel/QCarousel.js +194 -125
  310. package/src/components/carousel/QCarousel.json +10 -11
  311. package/src/components/carousel/QCarouselControl.js +26 -13
  312. package/src/components/carousel/QCarouselControl.json +10 -5
  313. package/src/components/carousel/QCarouselSlide.js +13 -10
  314. package/src/components/carousel/QCarouselSlide.json +1 -1
  315. package/src/components/carousel/index.js +1 -5
  316. package/src/components/chat/QChatMessage.js +62 -57
  317. package/src/components/chat/QChatMessage.json +8 -5
  318. package/src/components/chat/index.js +1 -3
  319. package/src/components/checkbox/QCheckbox.js +56 -41
  320. package/src/components/checkbox/QCheckbox.json +1 -1
  321. package/src/components/checkbox/index.js +1 -3
  322. package/src/components/checkbox/use-checkbox.js +112 -83
  323. package/src/components/checkbox/use-checkbox.json +15 -12
  324. package/src/components/chip/QChip.js +101 -73
  325. package/src/components/chip/QChip.json +6 -6
  326. package/src/components/chip/QChip.test.js +72 -180
  327. package/src/components/chip/index.js +1 -3
  328. package/src/components/circular-progress/QCircularProgress.js +92 -57
  329. package/src/components/circular-progress/QCircularProgress.json +2 -2
  330. package/src/components/circular-progress/index.js +1 -3
  331. package/src/components/color/QColor.js +550 -367
  332. package/src/components/color/QColor.json +8 -8
  333. package/src/components/color/index.js +1 -3
  334. package/src/components/date/QDate.js +902 -607
  335. package/src/components/date/QDate.json +32 -23
  336. package/src/components/date/index.js +1 -3
  337. package/src/components/date/use-datetime.js +12 -14
  338. package/src/components/date/use-datetime.json +7 -7
  339. package/src/components/dialog/QDialog.js +178 -139
  340. package/src/components/dialog/QDialog.json +8 -4
  341. package/src/components/dialog/QDialog.test.js +123 -228
  342. package/src/components/dialog/index.js +1 -3
  343. package/src/components/drawer/QDrawer.js +306 -242
  344. package/src/components/drawer/QDrawer.json +4 -4
  345. package/src/components/drawer/index.js +1 -3
  346. package/src/components/editor/QEditor.js +409 -190
  347. package/src/components/editor/QEditor.json +33 -32
  348. package/src/components/editor/editor-caret.js +78 -83
  349. package/src/components/editor/editor-utils.js +176 -130
  350. package/src/components/editor/index.js +1 -3
  351. package/src/components/expansion-item/QExpansionItem.js +149 -103
  352. package/src/components/expansion-item/QExpansionItem.json +21 -24
  353. package/src/components/expansion-item/index.js +1 -3
  354. package/src/components/fab/QFab.js +86 -54
  355. package/src/components/fab/QFab.json +6 -3
  356. package/src/components/fab/QFabAction.js +34 -29
  357. package/src/components/fab/QFabAction.json +4 -7
  358. package/src/components/fab/index.js +1 -4
  359. package/src/components/fab/use-fab.js +20 -20
  360. package/src/components/fab/use-fab.json +10 -13
  361. package/src/components/field/QField.js +7 -5
  362. package/src/components/field/QField.json +6 -6
  363. package/src/components/field/QField.sass +5 -6
  364. package/src/components/field/index.js +1 -3
  365. package/src/components/file/QFile.js +95 -74
  366. package/src/components/file/QFile.json +17 -14
  367. package/src/components/file/index.js +1 -3
  368. package/src/components/footer/QFooter.js +110 -67
  369. package/src/components/footer/QFooter.json +2 -2
  370. package/src/components/footer/index.js +1 -3
  371. package/src/components/form/QForm.js +93 -58
  372. package/src/components/form/QForm.json +2 -2
  373. package/src/components/form/QFormChildMixin.js +10 -11
  374. package/src/components/form/QFormChildMixin.json +2 -2
  375. package/src/components/form/index.js +1 -4
  376. package/src/components/header/QHeader.js +93 -56
  377. package/src/components/header/QHeader.json +2 -2
  378. package/src/components/header/index.js +1 -3
  379. package/src/components/icon/QIcon.js +70 -57
  380. package/src/components/icon/QIcon.json +2 -2
  381. package/src/components/icon/index.js +1 -3
  382. package/src/components/img/QImg.js +104 -98
  383. package/src/components/img/QImg.json +20 -18
  384. package/src/components/img/index.js +1 -3
  385. package/src/components/infinite-scroll/QInfiniteScroll.js +123 -64
  386. package/src/components/infinite-scroll/QInfiniteScroll.json +1 -1
  387. package/src/components/infinite-scroll/index.js +1 -3
  388. package/src/components/inner-loading/QInnerLoading.js +31 -23
  389. package/src/components/inner-loading/QInnerLoading.json +9 -9
  390. package/src/components/inner-loading/index.js +1 -3
  391. package/src/components/input/QInput.js +179 -137
  392. package/src/components/input/QInput.json +25 -15
  393. package/src/components/input/index.js +1 -3
  394. package/src/components/input/use-mask.js +328 -243
  395. package/src/components/input/use-mask.json +16 -8
  396. package/src/components/intersection/QIntersection.js +45 -28
  397. package/src/components/intersection/QIntersection.json +7 -10
  398. package/src/components/intersection/index.js +1 -3
  399. package/src/components/item/QItem.js +60 -52
  400. package/src/components/item/QItem.json +6 -9
  401. package/src/components/item/QItemLabel.js +23 -15
  402. package/src/components/item/QItemLabel.json +1 -1
  403. package/src/components/item/QItemSection.js +11 -8
  404. package/src/components/item/QList.js +21 -13
  405. package/src/components/item/QList.json +1 -1
  406. package/src/components/item/QList.test.js +7 -11
  407. package/src/components/item/index.js +1 -7
  408. package/src/components/knob/QKnob.js +86 -76
  409. package/src/components/knob/QKnob.json +6 -3
  410. package/src/components/knob/index.js +1 -3
  411. package/src/components/layout/QLayout.js +98 -69
  412. package/src/components/layout/QLayout.json +2 -2
  413. package/src/components/layout/index.js +1 -3
  414. package/src/components/linear-progress/QLinearProgress.js +78 -47
  415. package/src/components/linear-progress/QLinearProgress.json +3 -3
  416. package/src/components/linear-progress/index.js +1 -3
  417. package/src/components/markup-table/QMarkupTable.js +25 -17
  418. package/src/components/markup-table/QMarkupTable.json +2 -2
  419. package/src/components/markup-table/index.js +1 -3
  420. package/src/components/menu/QMenu.js +144 -100
  421. package/src/components/menu/QMenu.json +39 -10
  422. package/src/components/menu/index.js +1 -3
  423. package/src/components/no-ssr/QNoSsr.js +5 -5
  424. package/src/components/no-ssr/QNoSsr.json +2 -2
  425. package/src/components/no-ssr/index.js +1 -3
  426. package/src/components/option-group/QOptionGroup.js +84 -66
  427. package/src/components/option-group/QOptionGroup.json +35 -21
  428. package/src/components/option-group/index.js +1 -3
  429. package/src/components/page/QPage.js +35 -22
  430. package/src/components/page/QPage.json +1 -1
  431. package/src/components/page/QPageContainer.js +24 -11
  432. package/src/components/page/index.js +1 -4
  433. package/src/components/page-scroller/QPageScroller.js +49 -32
  434. package/src/components/page-scroller/QPageScroller.json +2 -2
  435. package/src/components/page-scroller/index.js +1 -3
  436. package/src/components/page-sticky/QPageSticky.js +1 -1
  437. package/src/components/page-sticky/QPageSticky.json +9 -4
  438. package/src/components/page-sticky/index.js +1 -3
  439. package/src/components/page-sticky/use-page-sticky.js +47 -36
  440. package/src/components/pagination/QPagination.js +210 -146
  441. package/src/components/pagination/QPagination.json +35 -21
  442. package/src/components/pagination/index.js +1 -3
  443. package/src/components/parallax/QParallax.js +81 -56
  444. package/src/components/parallax/index.js +1 -3
  445. package/src/components/popup-edit/QPopupEdit.js +88 -59
  446. package/src/components/popup-edit/QPopupEdit.json +40 -16
  447. package/src/components/popup-edit/index.js +1 -3
  448. package/src/components/popup-proxy/QPopupProxy.js +30 -19
  449. package/src/components/popup-proxy/QPopupProxy.json +3 -3
  450. package/src/components/popup-proxy/index.js +1 -3
  451. package/src/components/pull-to-refresh/QPullToRefresh.js +71 -49
  452. package/src/components/pull-to-refresh/index.js +1 -3
  453. package/src/components/radio/QRadio.js +133 -95
  454. package/src/components/radio/QRadio.json +11 -8
  455. package/src/components/radio/index.js +1 -3
  456. package/src/components/range/QRange.js +151 -104
  457. package/src/components/range/QRange.json +9 -9
  458. package/src/components/range/index.js +1 -3
  459. package/src/components/rating/QRating.js +171 -112
  460. package/src/components/rating/QRating.json +19 -12
  461. package/src/components/rating/index.js +1 -3
  462. package/src/components/resize-observer/QResizeObserver.js +52 -30
  463. package/src/components/resize-observer/QResizeObserver.json +2 -2
  464. package/src/components/resize-observer/index.js +1 -3
  465. package/src/components/responsive/QResponsive.js +27 -14
  466. package/src/components/responsive/QResponsive.json +1 -1
  467. package/src/components/responsive/index.js +1 -3
  468. package/src/components/scroll-area/QScrollArea.js +279 -192
  469. package/src/components/scroll-area/QScrollArea.json +31 -21
  470. package/src/components/scroll-area/ScrollAreaControls.js +6 -11
  471. package/src/components/scroll-area/index.js +1 -3
  472. package/src/components/scroll-observer/QScrollObserver.js +46 -26
  473. package/src/components/scroll-observer/QScrollObserver.json +4 -4
  474. package/src/components/scroll-observer/index.js +1 -3
  475. package/src/components/select/QSelect.js +710 -519
  476. package/src/components/select/QSelect.json +70 -45
  477. package/src/components/select/index.js +1 -3
  478. package/src/components/separator/QSeparator.js +34 -30
  479. package/src/components/separator/QSeparator.json +4 -4
  480. package/src/components/separator/index.js +1 -3
  481. package/src/components/skeleton/QSkeleton.js +49 -23
  482. package/src/components/skeleton/QSkeleton.json +26 -9
  483. package/src/components/skeleton/index.js +1 -3
  484. package/src/components/slide-item/QSlideItem.js +121 -94
  485. package/src/components/slide-item/QSlideItem.json +2 -2
  486. package/src/components/slide-item/index.js +1 -3
  487. package/src/components/slide-transition/QSlideTransition.js +34 -26
  488. package/src/components/slide-transition/index.js +1 -3
  489. package/src/components/slider/QSlider.js +64 -43
  490. package/src/components/slider/QSlider.json +6 -6
  491. package/src/components/slider/index.js +1 -3
  492. package/src/components/slider/use-slider.js +327 -220
  493. package/src/components/slider/use-slider.json +32 -32
  494. package/src/components/space/QSpace.js +1 -1
  495. package/src/components/space/QSpace.test.js +1 -4
  496. package/src/components/space/index.js +1 -3
  497. package/src/components/spinner/QSpinner.js +23 -18
  498. package/src/components/spinner/QSpinner.json +1 -1
  499. package/src/components/spinner/QSpinner.test.js +11 -27
  500. package/src/components/spinner/QSpinnerAudio.js +13 -11
  501. package/src/components/spinner/QSpinnerAudio.json +1 -1
  502. package/src/components/spinner/QSpinnerAudio.test.js +9 -21
  503. package/src/components/spinner/QSpinnerBall.js +13 -11
  504. package/src/components/spinner/QSpinnerBall.json +1 -1
  505. package/src/components/spinner/QSpinnerBall.test.js +9 -21
  506. package/src/components/spinner/QSpinnerBars.js +13 -11
  507. package/src/components/spinner/QSpinnerBars.json +1 -1
  508. package/src/components/spinner/QSpinnerBars.test.js +9 -21
  509. package/src/components/spinner/QSpinnerBox.js +13 -11
  510. package/src/components/spinner/QSpinnerBox.json +1 -1
  511. package/src/components/spinner/QSpinnerBox.test.js +9 -21
  512. package/src/components/spinner/QSpinnerClock.js +13 -11
  513. package/src/components/spinner/QSpinnerClock.json +1 -1
  514. package/src/components/spinner/QSpinnerClock.test.js +9 -21
  515. package/src/components/spinner/QSpinnerComment.js +13 -11
  516. package/src/components/spinner/QSpinnerComment.json +1 -1
  517. package/src/components/spinner/QSpinnerComment.test.js +9 -21
  518. package/src/components/spinner/QSpinnerCube.js +13 -11
  519. package/src/components/spinner/QSpinnerCube.json +1 -1
  520. package/src/components/spinner/QSpinnerCube.test.js +9 -21
  521. package/src/components/spinner/QSpinnerDots.js +13 -11
  522. package/src/components/spinner/QSpinnerDots.json +1 -1
  523. package/src/components/spinner/QSpinnerDots.test.js +9 -21
  524. package/src/components/spinner/QSpinnerFacebook.js +13 -11
  525. package/src/components/spinner/QSpinnerFacebook.json +1 -1
  526. package/src/components/spinner/QSpinnerFacebook.test.js +9 -21
  527. package/src/components/spinner/QSpinnerGears.js +13 -11
  528. package/src/components/spinner/QSpinnerGears.json +1 -1
  529. package/src/components/spinner/QSpinnerGears.test.js +9 -21
  530. package/src/components/spinner/QSpinnerGrid.js +13 -11
  531. package/src/components/spinner/QSpinnerGrid.json +1 -1
  532. package/src/components/spinner/QSpinnerGrid.test.js +9 -21
  533. package/src/components/spinner/QSpinnerHearts.js +13 -11
  534. package/src/components/spinner/QSpinnerHearts.json +1 -1
  535. package/src/components/spinner/QSpinnerHearts.test.js +9 -21
  536. package/src/components/spinner/QSpinnerHourglass.js +13 -11
  537. package/src/components/spinner/QSpinnerHourglass.json +1 -1
  538. package/src/components/spinner/QSpinnerHourglass.test.js +9 -21
  539. package/src/components/spinner/QSpinnerInfinity.js +12 -10
  540. package/src/components/spinner/QSpinnerInfinity.json +1 -1
  541. package/src/components/spinner/QSpinnerInfinity.test.js +9 -21
  542. package/src/components/spinner/QSpinnerIos.js +13 -11
  543. package/src/components/spinner/QSpinnerIos.json +1 -1
  544. package/src/components/spinner/QSpinnerIos.test.js +9 -21
  545. package/src/components/spinner/QSpinnerOrbit.js +13 -11
  546. package/src/components/spinner/QSpinnerOrbit.json +1 -1
  547. package/src/components/spinner/QSpinnerOrbit.test.js +9 -21
  548. package/src/components/spinner/QSpinnerOval.js +13 -11
  549. package/src/components/spinner/QSpinnerOval.json +1 -1
  550. package/src/components/spinner/QSpinnerOval.test.js +9 -21
  551. package/src/components/spinner/QSpinnerPie.js +13 -11
  552. package/src/components/spinner/QSpinnerPie.json +1 -1
  553. package/src/components/spinner/QSpinnerPie.test.js +9 -21
  554. package/src/components/spinner/QSpinnerPuff.js +13 -11
  555. package/src/components/spinner/QSpinnerPuff.json +1 -1
  556. package/src/components/spinner/QSpinnerPuff.test.js +9 -21
  557. package/src/components/spinner/QSpinnerRadio.js +13 -11
  558. package/src/components/spinner/QSpinnerRadio.json +1 -1
  559. package/src/components/spinner/QSpinnerRadio.test.js +9 -21
  560. package/src/components/spinner/QSpinnerRings.js +13 -11
  561. package/src/components/spinner/QSpinnerRings.json +1 -1
  562. package/src/components/spinner/QSpinnerRings.test.js +9 -21
  563. package/src/components/spinner/QSpinnerTail.js +12 -10
  564. package/src/components/spinner/QSpinnerTail.json +1 -1
  565. package/src/components/spinner/QSpinnerTail.test.js +9 -21
  566. package/src/components/spinner/index.js +0 -1
  567. package/src/components/spinner/spinner.json +2 -2
  568. package/src/components/spinner/use-spinner.js +7 -7
  569. package/src/components/spinner/use-spinner.test.js +1 -1
  570. package/src/components/splitter/QSplitter.js +133 -94
  571. package/src/components/splitter/QSplitter.json +10 -19
  572. package/src/components/splitter/index.js +1 -3
  573. package/src/components/stepper/QStep.js +65 -42
  574. package/src/components/stepper/QStep.json +5 -5
  575. package/src/components/stepper/QStepper.js +62 -39
  576. package/src/components/stepper/QStepper.json +2 -2
  577. package/src/components/stepper/QStepperNavigation.js +1 -1
  578. package/src/components/stepper/StepHeader.js +87 -67
  579. package/src/components/stepper/index.js +1 -5
  580. package/src/components/tab-panels/QTabPanel.js +3 -2
  581. package/src/components/tab-panels/QTabPanel.json +1 -1
  582. package/src/components/tab-panels/QTabPanels.js +12 -6
  583. package/src/components/tab-panels/QTabPanels.json +1 -1
  584. package/src/components/tab-panels/index.js +1 -4
  585. package/src/components/table/QTable.js +544 -426
  586. package/src/components/table/QTable.json +168 -165
  587. package/src/components/table/QTd.js +18 -13
  588. package/src/components/table/QTd.json +1 -1
  589. package/src/components/table/QTh.js +25 -20
  590. package/src/components/table/QTh.json +1 -1
  591. package/src/components/table/QTr.js +17 -9
  592. package/src/components/table/QTr.json +1 -1
  593. package/src/components/table/get-table-middle.js +2 -4
  594. package/src/components/table/index.js +1 -6
  595. package/src/components/table/table-column-selection.js +45 -35
  596. package/src/components/table/table-filter.js +9 -8
  597. package/src/components/table/table-pagination.js +75 -52
  598. package/src/components/table/table-row-expand.js +15 -16
  599. package/src/components/table/table-row-selection.js +31 -31
  600. package/src/components/table/table-sort.js +26 -29
  601. package/src/components/tabs/QRouteTab.js +10 -12
  602. package/src/components/tabs/QRouteTab.json +6 -6
  603. package/src/components/tabs/QTab.js +1 -1
  604. package/src/components/tabs/QTab.json +1 -1
  605. package/src/components/tabs/QTabs.js +283 -205
  606. package/src/components/tabs/QTabs.json +9 -9
  607. package/src/components/tabs/index.js +1 -5
  608. package/src/components/tabs/use-tab.js +127 -103
  609. package/src/components/tabs/use-tab.json +8 -8
  610. package/src/components/time/QTime.js +502 -383
  611. package/src/components/time/QTime.json +19 -15
  612. package/src/components/time/index.js +1 -3
  613. package/src/components/timeline/QTimeline.js +10 -7
  614. package/src/components/timeline/QTimeline.json +2 -2
  615. package/src/components/timeline/QTimelineEntry.js +44 -27
  616. package/src/components/timeline/QTimelineEntry.json +7 -5
  617. package/src/components/timeline/index.js +1 -4
  618. package/src/components/toggle/QToggle.js +29 -19
  619. package/src/components/toggle/QToggle.json +1 -1
  620. package/src/components/toggle/index.js +1 -3
  621. package/src/components/toolbar/QToolbar.js +7 -5
  622. package/src/components/toolbar/QToolbar.test.js +2 -6
  623. package/src/components/toolbar/QToolbarTitle.js +5 -4
  624. package/src/components/toolbar/QToolbarTitle.test.js +2 -6
  625. package/src/components/toolbar/index.js +1 -4
  626. package/src/components/tooltip/QTooltip.js +125 -72
  627. package/src/components/tooltip/QTooltip.json +34 -10
  628. package/src/components/tooltip/index.js +1 -3
  629. package/src/components/tree/QTree.js +417 -297
  630. package/src/components/tree/QTree.json +27 -25
  631. package/src/components/tree/index.js +1 -3
  632. package/src/components/uploader/QUploader.json +9 -6
  633. package/src/components/uploader/QUploaderAddTrigger.js +5 -2
  634. package/src/components/uploader/index.js +1 -4
  635. package/src/components/uploader/uploader-core.js +262 -178
  636. package/src/components/uploader/xhr-uploader-plugin.js +96 -89
  637. package/src/components/uploader/xhr-uploader-plugin.json +29 -29
  638. package/src/components/video/QVideo.js +25 -19
  639. package/src/components/video/QVideo.json +5 -5
  640. package/src/components/video/QVideo.test.js +55 -85
  641. package/src/components/video/index.js +1 -3
  642. package/src/components/virtual-scroll/QVirtualScroll.js +89 -37
  643. package/src/components/virtual-scroll/QVirtualScroll.json +6 -6
  644. package/src/components/virtual-scroll/index.js +1 -3
  645. package/src/components/virtual-scroll/use-virtual-scroll.js +421 -240
  646. package/src/components/virtual-scroll/use-virtual-scroll.json +20 -13
  647. package/src/composables/private.use-align/use-align.js +8 -5
  648. package/src/composables/private.use-align/use-align.test.js +9 -17
  649. package/src/composables/private.use-anchor/use-anchor-static.json +2 -7
  650. package/src/composables/private.use-anchor/use-anchor.js +79 -62
  651. package/src/composables/private.use-anchor/use-anchor.json +1 -1
  652. package/src/composables/private.use-dark/use-dark.js +2 -6
  653. package/src/composables/private.use-dark/use-dark.test.js +7 -21
  654. package/src/composables/private.use-field/use-field.js +384 -251
  655. package/src/composables/private.use-field/use-field.json +10 -10
  656. package/src/composables/private.use-file/use-file-dom-props.js +11 -15
  657. package/src/composables/private.use-file/use-file.js +86 -67
  658. package/src/composables/private.use-file/use-file.json +8 -8
  659. package/src/composables/private.use-fullscreen/use-fullscreen.js +35 -17
  660. package/src/composables/private.use-fullscreen/use-fullscreen.json +1 -1
  661. package/src/composables/private.use-history/use-history.js +4 -4
  662. package/src/composables/private.use-history/use-history.test.js +9 -21
  663. package/src/composables/private.use-key-composition/use-key-composition.js +16 -12
  664. package/src/composables/private.use-model-toggle/use-model-toggle.js +44 -35
  665. package/src/composables/private.use-model-toggle/use-model-toggle.json +2 -2
  666. package/src/composables/private.use-panel/use-panel.child.json +1 -1
  667. package/src/composables/private.use-panel/use-panel.js +131 -91
  668. package/src/composables/private.use-panel/use-panel.json +18 -18
  669. package/src/composables/private.use-portal/use-portal.js +20 -15
  670. package/src/composables/private.use-prevent-scroll/use-prevent-scroll.js +4 -4
  671. package/src/composables/private.use-ratio/use-ratio.js +3 -3
  672. package/src/composables/private.use-ratio/use-ratio.json +2 -7
  673. package/src/composables/private.use-refocus-target/use-refocus-target.js +7 -8
  674. package/src/composables/private.use-router-link/use-router-link.js +111 -110
  675. package/src/composables/private.use-router-link/use-router-link.json +6 -9
  676. package/src/composables/private.use-scroll-target/use-scroll-target.js +14 -11
  677. package/src/composables/private.use-size/use-size.js +6 -4
  678. package/src/composables/private.use-size/use-size.json +1 -1
  679. package/src/composables/private.use-size/use-size.test.js +1 -1
  680. package/src/composables/private.use-transition/use-transition.js +17 -11
  681. package/src/composables/private.use-transition/use-transition.json +1 -1
  682. package/src/composables/private.use-transition/use-transition.test.js +7 -21
  683. package/src/composables/private.use-validate/use-validate.js +78 -67
  684. package/src/composables/private.use-validate/use-validate.json +9 -12
  685. package/src/composables/use-dialog-plugin-component/use-dialog-plugin-component.js +12 -6
  686. package/src/composables/use-form/private.use-form.js +4 -4
  687. package/src/composables/use-form/private.use-form.json +1 -1
  688. package/src/composables/use-form/private.use-form.test.js +17 -15
  689. package/src/composables/use-form/use-form-child.js +25 -14
  690. package/src/composables/use-hydration/use-hydration.js +1 -1
  691. package/src/composables/use-hydration/use-hydration.test.js +2 -4
  692. package/src/composables/use-id/use-id.js +10 -12
  693. package/src/composables/use-id/use-id.test.js +1 -1
  694. package/src/composables/use-interval/use-interval.js +3 -3
  695. package/src/composables/use-interval/use-interval.test.js +6 -9
  696. package/src/composables/use-meta/use-meta.js +13 -10
  697. package/src/composables/use-quasar/use-quasar.js +1 -1
  698. package/src/composables/use-quasar/use-quasar.test.js +4 -10
  699. package/src/composables/use-render-cache/use-render-cache.js +16 -24
  700. package/src/composables/use-split-attrs/use-split-attrs.js +9 -5
  701. package/src/composables/use-split-attrs/use-split-attrs.test.js +17 -15
  702. package/src/composables/use-tick/use-tick.js +10 -5
  703. package/src/composables/use-tick/use-tick.test.js +5 -8
  704. package/src/composables/use-timeout/use-timeout.js +3 -3
  705. package/src/composables/use-timeout/use-timeout.test.js +6 -9
  706. package/src/composables.js +0 -1
  707. package/src/css/core/helpers.sass +4 -9
  708. package/src/directives/close-popup/ClosePopup.js +41 -35
  709. package/src/directives/close-popup/ClosePopup.json +1 -1
  710. package/src/directives/intersection/Intersection.js +25 -28
  711. package/src/directives/intersection/Intersection.json +6 -6
  712. package/src/directives/morph/Morph.js +87 -87
  713. package/src/directives/morph/Morph.json +15 -13
  714. package/src/directives/mutation/Mutation.js +23 -24
  715. package/src/directives/mutation/Mutation.json +11 -11
  716. package/src/directives/ripple/Ripple.js +88 -79
  717. package/src/directives/ripple/Ripple.json +10 -10
  718. package/src/directives/ripple/Ripple.test.js +31 -87
  719. package/src/directives/scroll/Scroll.js +43 -30
  720. package/src/directives/scroll/Scroll.json +4 -2
  721. package/src/directives/scroll-fire/ScrollFire.js +43 -38
  722. package/src/directives/scroll-fire/ScrollFire.json +1 -1
  723. package/src/directives/touch-hold/TouchHold.js +155 -139
  724. package/src/directives/touch-hold/TouchHold.json +2 -2
  725. package/src/directives/touch-pan/TouchPan.js +311 -278
  726. package/src/directives/touch-pan/TouchPan.json +6 -4
  727. package/src/directives/touch-repeat/TouchRepeat.js +222 -188
  728. package/src/directives/touch-repeat/TouchRepeat.json +5 -3
  729. package/src/directives/touch-swipe/TouchSwipe.js +235 -214
  730. package/src/directives/touch-swipe/TouchSwipe.json +5 -3
  731. package/src/flags.dev.js +10 -17
  732. package/src/index.dev.js +2 -0
  733. package/src/index.ssr.js +2 -6
  734. package/src/index.umd.js +4 -2
  735. package/src/install-quasar.js +92 -76
  736. package/src/plugins/addressbar/AddressbarColor.js +28 -25
  737. package/src/plugins/addressbar/AddressbarColor.json +1 -1
  738. package/src/plugins/addressbar/AddressbarColor.test.js +10 -9
  739. package/src/plugins/app-fullscreen/AppFullscreen.js +50 -51
  740. package/src/plugins/app-fullscreen/AppFullscreen.json +6 -10
  741. package/src/plugins/app-fullscreen/AppFullscreen.test.js +11 -26
  742. package/src/plugins/app-fullscreen/test/mock-fullscreen.js +7 -5
  743. package/src/plugins/app-visibility/AppVisibility.js +21 -17
  744. package/src/plugins/app-visibility/AppVisibility.test.js +3 -1
  745. package/src/plugins/bottom-sheet/BottomSheet.js +1 -1
  746. package/src/plugins/bottom-sheet/BottomSheet.json +9 -9
  747. package/src/plugins/bottom-sheet/component/BottomSheetComponent.js +132 -95
  748. package/src/plugins/cookies/Cookies.js +50 -58
  749. package/src/plugins/cookies/Cookies.json +24 -16
  750. package/src/plugins/dark/Dark.js +61 -55
  751. package/src/plugins/dark/Dark.json +6 -6
  752. package/src/plugins/dark/Dark.test.js +26 -44
  753. package/src/plugins/dialog/Dialog.js +1 -1
  754. package/src/plugins/dialog/Dialog.json +29 -21
  755. package/src/plugins/dialog/component/DialogPluginComponent.js +122 -121
  756. package/src/plugins/icon-set/IconSet.js +63 -56
  757. package/src/plugins/icon-set/IconSet.json +421 -419
  758. package/src/plugins/icon-set/IconSet.test.js +8 -7
  759. package/src/plugins/lang/Lang.js +115 -96
  760. package/src/plugins/lang/Lang.json +201 -175
  761. package/src/plugins/lang/Lang.test.js +52 -20
  762. package/src/plugins/loading/Loading.js +175 -143
  763. package/src/plugins/loading/Loading.json +15 -15
  764. package/src/plugins/loading-bar/LoadingBar.js +61 -56
  765. package/src/plugins/loading-bar/LoadingBar.json +2 -2
  766. package/src/plugins/meta/Meta.js +91 -81
  767. package/src/plugins/notify/Notify.js +275 -221
  768. package/src/plugins/notify/Notify.json +79 -71
  769. package/src/plugins/platform/Platform.js +105 -112
  770. package/src/plugins/platform/Platform.json +12 -8
  771. package/src/plugins/platform/Platform.test.js +4 -7
  772. package/src/plugins/private.body/Body.js +19 -23
  773. package/src/plugins/private.body/Body.test.js +4 -6
  774. package/src/plugins/private.history/History.js +27 -30
  775. package/src/plugins/screen/Screen.js +160 -147
  776. package/src/plugins/screen/Screen.json +6 -6
  777. package/src/plugins/screen/Screen.test.js +6 -12
  778. package/src/plugins/storage/LocalStorage.js +5 -4
  779. package/src/plugins/storage/LocalStorage.json +1 -1
  780. package/src/plugins/storage/LocalStorage.test.js +56 -62
  781. package/src/plugins/storage/SessionStorage.js +5 -4
  782. package/src/plugins/storage/SessionStorage.json +1 -1
  783. package/src/plugins/storage/SessionStorage.test.js +56 -62
  784. package/src/plugins/storage/engine/web-storage.js +24 -26
  785. package/src/plugins/storage/engine/web-storage.json +45 -15
  786. package/src/utils/EventBus/EventBus.js +12 -13
  787. package/src/utils/clone/clone.js +27 -28
  788. package/src/utils/clone/clone.test.js +27 -52
  789. package/src/utils/colors/colors.js +69 -63
  790. package/src/utils/colors/colors.test.js +360 -270
  791. package/src/utils/copy-to-clipboard/copy-to-clipboard.js +9 -10
  792. package/src/utils/create-meta-mixin/create-meta-mixin.js +17 -19
  793. package/src/utils/create-uploader-component/create-uploader-component.js +20 -14
  794. package/src/utils/css-var/get-css-var.js +4 -2
  795. package/src/utils/css-var/get-css-var.test.js +4 -11
  796. package/src/utils/css-var/set-css-var.js +2 -2
  797. package/src/utils/css-var/set-css-var.test.js +6 -12
  798. package/src/utils/date/date.js +251 -243
  799. package/src/utils/date/private.persian.js +54 -44
  800. package/src/utils/debounce/debounce.js +5 -5
  801. package/src/utils/debounce/debounce.test.js +3 -10
  802. package/src/utils/dom/dom.js +21 -22
  803. package/src/utils/dom/dom.test.js +19 -39
  804. package/src/utils/event/event.js +53 -49
  805. package/src/utils/export-file/export-file.js +11 -12
  806. package/src/utils/extend/extend.js +30 -26
  807. package/src/utils/extend/extend.test.js +36 -42
  808. package/src/utils/format/format.js +11 -13
  809. package/src/utils/format/format.test.js +50 -61
  810. package/src/utils/frame-debounce/frame-debounce.js +5 -3
  811. package/src/utils/frame-debounce/frame-debounce.test.js +3 -10
  812. package/src/utils/is/is.js +27 -23
  813. package/src/utils/is/is.test.js +100 -84
  814. package/src/utils/morph/morph.js +470 -377
  815. package/src/utils/open-url/open-url.js +18 -21
  816. package/src/utils/patterns/patterns.js +11 -7
  817. package/src/utils/patterns/patterns.test.js +2 -0
  818. package/src/utils/private.click-outside/click-outside.js +28 -26
  819. package/src/utils/private.config/instance-config.js +1 -1
  820. package/src/utils/private.config/instance-config.test.js +11 -7
  821. package/src/utils/private.config/nodes.js +14 -14
  822. package/src/utils/private.config/nodes.test.js +32 -38
  823. package/src/utils/private.create/create.js +10 -4
  824. package/src/utils/private.create/create.test.js +11 -7
  825. package/src/utils/private.dialog/create-dialog.js +70 -59
  826. package/src/utils/private.dialog/create-dialog.json +13 -6
  827. package/src/utils/private.focus/focus-manager.js +7 -8
  828. package/src/utils/private.focus/focus-manager.test.js +13 -18
  829. package/src/utils/private.focus/focusout.js +4 -4
  830. package/src/utils/private.focus/focusout.test.js +10 -22
  831. package/src/utils/private.get-emits-object/get-emits-object.js +2 -2
  832. package/src/utils/private.get-emits-object/get-emits-object.test.js +4 -10
  833. package/src/utils/private.inject-obj-prop/inject-obj-prop.js +3 -3
  834. package/src/utils/private.inject-obj-prop/inject-obj-prop.test.js +20 -49
  835. package/src/utils/private.keyboard/escape-key.js +10 -10
  836. package/src/utils/private.keyboard/escape-key.test.js +10 -22
  837. package/src/utils/private.keyboard/key-composition.js +9 -7
  838. package/src/utils/private.portal/portal.js +7 -10
  839. package/src/utils/private.position-engine/position-engine.js +127 -75
  840. package/src/utils/private.render/render.js +9 -24
  841. package/src/utils/private.render/render.test.js +40 -55
  842. package/src/utils/private.rtl/rtl.js +1 -3
  843. package/src/utils/private.selection/selection.js +6 -6
  844. package/src/utils/private.selection/selection.test.js +7 -13
  845. package/src/utils/private.sort/sort.js +4 -6
  846. package/src/utils/private.symbols/symbols.js +1 -1
  847. package/src/utils/private.touch/touch.js +16 -16
  848. package/src/utils/private.touch/touch.test.js +56 -16
  849. package/src/utils/private.vm/vm.js +6 -7
  850. package/src/utils/private.vm/vm.test.js +32 -32
  851. package/src/utils/run-sequential-promises/run-sequential-promises.js +57 -51
  852. package/src/utils/scroll/prevent-scroll.js +75 -47
  853. package/src/utils/scroll/scroll.js +51 -44
  854. package/src/utils/throttle/throttle.js +7 -4
  855. package/src/utils/throttle/throttle.test.js +2 -7
  856. package/src/utils/uid/uid.js +34 -22
  857. package/wrappers/index.cjs +17 -15
  858. package/wrappers/index.js +15 -15
@@ -1,4 +1,14 @@
1
- import { h, ref, computed, watch, onBeforeUpdate, onUpdated, onBeforeUnmount, nextTick, getCurrentInstance } from 'vue'
1
+ import {
2
+ h,
3
+ ref,
4
+ computed,
5
+ watch,
6
+ onBeforeUpdate,
7
+ onUpdated,
8
+ onBeforeUnmount,
9
+ nextTick,
10
+ getCurrentInstance
11
+ } from 'vue'
2
12
 
3
13
  import QField from '../field/QField.js'
4
14
  import QIcon from '../icon/QIcon.js'
@@ -11,30 +21,45 @@ import QItemLabel from '../item/QItemLabel.js'
11
21
  import QMenu from '../menu/QMenu.js'
12
22
  import QDialog from '../dialog/QDialog.js'
13
23
 
14
- import useField, { useFieldState, useFieldProps, useFieldEmits, fieldValueIsFilled } from '../../composables/private.use-field/use-field.js'
15
- import { useVirtualScroll, useVirtualScrollProps } from '../virtual-scroll/use-virtual-scroll.js'
16
- import { useFormProps, useFormInputNameAttr } from '../../composables/use-form/private.use-form.js'
24
+ import useField, {
25
+ useFieldState,
26
+ useFieldProps,
27
+ useFieldEmits,
28
+ fieldValueIsFilled
29
+ } from '../../composables/private.use-field/use-field.js'
30
+ import {
31
+ useVirtualScroll,
32
+ useVirtualScrollProps
33
+ } from '../virtual-scroll/use-virtual-scroll.js'
34
+ import {
35
+ useFormProps,
36
+ useFormInputNameAttr
37
+ } from '../../composables/use-form/private.use-form.js'
17
38
  import useKeyComposition from '../../composables/private.use-key-composition/use-key-composition.js'
18
39
 
19
40
  import { createComponent } from '../../utils/private.create/create.js'
20
41
  import { isDeepEqual } from '../../utils/is/is.js'
21
42
  import { stop, prevent, stopAndPrevent } from '../../utils/event/event.js'
22
43
  import { normalizeToInterval } from '../../utils/format/format.js'
23
- import { shouldIgnoreKey, isKeyCode } from '../../utils/private.keyboard/key-composition.js'
44
+ import {
45
+ shouldIgnoreKey,
46
+ isKeyCode
47
+ } from '../../utils/private.keyboard/key-composition.js'
24
48
  import { hMergeSlot } from '../../utils/private.render/render.js'
25
49
 
26
- const validateNewValueMode = v => [ 'add', 'add-unique', 'toggle' ].includes(v)
50
+ const validateNewValueMode = v => ['add', 'add-unique', 'toggle'].includes(v)
27
51
  const reEscapeList = '.*+?^${}()|[]\\'
28
52
  const fieldPropsList = Object.keys(useFieldProps)
29
53
 
30
- function getPropValueFn (userPropName, defaultPropName) {
54
+ function getPropValueFn(userPropName, defaultPropName) {
31
55
  if (typeof userPropName === 'function') return userPropName
32
56
 
33
- const propName = userPropName !== void 0
34
- ? userPropName
35
- : defaultPropName
57
+ const propName = userPropName !== void 0 ? userPropName : defaultPropName
36
58
 
37
- return opt => ((opt !== null && typeof opt === 'object' && propName in opt) ? opt[ propName ] : opt)
59
+ return opt =>
60
+ opt !== null && typeof opt === 'object' && propName in opt
61
+ ? opt[propName]
62
+ : opt
38
63
  }
39
64
 
40
65
  export default createComponent({
@@ -54,7 +79,7 @@ export default createComponent({
54
79
 
55
80
  multiple: Boolean,
56
81
 
57
- displayValue: [ String, Number ],
82
+ displayValue: [String, Number],
58
83
  displayValueHtml: Boolean,
59
84
  dropdownIcon: String,
60
85
 
@@ -63,15 +88,15 @@ export default createComponent({
63
88
  default: () => []
64
89
  },
65
90
 
66
- optionValue: [ Function, String ],
67
- optionLabel: [ Function, String ],
68
- optionDisable: [ Function, String ],
91
+ optionValue: [Function, String],
92
+ optionLabel: [Function, String],
93
+ optionDisable: [Function, String],
69
94
 
70
95
  hideSelected: Boolean,
71
96
  hideDropdownIcon: Boolean,
72
97
  fillInput: Boolean,
73
98
 
74
- maxValues: [ Number, String ],
99
+ maxValues: [Number, String],
75
100
 
76
101
  optionsDense: Boolean,
77
102
  optionsDark: {
@@ -89,7 +114,7 @@ export default createComponent({
89
114
  menuOffset: Array,
90
115
 
91
116
  popupContentClass: String,
92
- popupContentStyle: [ String, Array, Object ],
117
+ popupContentStyle: [String, Array, Object],
93
118
  popupNoRouteDismiss: Boolean,
94
119
 
95
120
  useInput: Boolean,
@@ -106,15 +131,15 @@ export default createComponent({
106
131
  disableTabSelection: Boolean,
107
132
 
108
133
  inputDebounce: {
109
- type: [ Number, String ],
134
+ type: [Number, String],
110
135
  default: 500
111
136
  },
112
137
 
113
- inputClass: [ Array, String, Object ],
114
- inputStyle: [ Array, String, Object ],
138
+ inputClass: [Array, String, Object],
139
+ inputStyle: [Array, String, Object],
115
140
 
116
141
  tabindex: {
117
- type: [ String, Number ],
142
+ type: [String, Number],
118
143
  default: 0
119
144
  },
120
145
 
@@ -126,7 +151,7 @@ export default createComponent({
126
151
 
127
152
  behavior: {
128
153
  type: String,
129
- validator: v => [ 'default', 'menu', 'dialog' ].includes(v),
154
+ validator: v => ['default', 'menu', 'dialog'].includes(v),
130
155
  default: 'default'
131
156
  },
132
157
 
@@ -139,13 +164,18 @@ export default createComponent({
139
164
 
140
165
  emits: [
141
166
  ...useFieldEmits,
142
- 'add', 'remove', 'inputValue',
143
- 'keyup', 'keypress', 'keydown',
144
- 'popupShow', 'popupHide',
167
+ 'add',
168
+ 'remove',
169
+ 'inputValue',
170
+ 'keyup',
171
+ 'keypress',
172
+ 'keydown',
173
+ 'popupShow',
174
+ 'popupHide',
145
175
  'filterAbort'
146
176
  ],
147
177
 
148
- setup (props, { slots, emit }) {
178
+ setup(props, { slots, emit }) {
149
179
  const { proxy } = getCurrentInstance()
150
180
  const { $q } = proxy
151
181
 
@@ -156,10 +186,16 @@ export default createComponent({
156
186
  const dialogFieldFocused = ref(false)
157
187
  const innerLoadingIndicator = ref(false)
158
188
 
159
- let filterTimer = null, inputValueTimer = null,
189
+ let filterTimer = null,
190
+ inputValueTimer = null,
160
191
  innerValueCache,
161
- hasDialog, userInputValue, filterId = null, defaultInputValue,
162
- transitionShowComputed, searchBuffer, searchBufferExp
192
+ hasDialog,
193
+ userInputValue,
194
+ filterId = null,
195
+ defaultInputValue,
196
+ transitionShowComputed,
197
+ searchBuffer,
198
+ searchBufferExp
163
199
 
164
200
  const inputRef = ref(null)
165
201
  const targetRef = ref(null)
@@ -171,17 +207,17 @@ export default createComponent({
171
207
 
172
208
  const onComposition = useKeyComposition(onInput)
173
209
 
174
- const virtualScrollLength = computed(() => (
175
- Array.isArray(props.options)
176
- ? props.options.length
177
- : 0
178
- ))
210
+ const virtualScrollLength = computed(() =>
211
+ Array.isArray(props.options) ? props.options.length : 0
212
+ )
179
213
 
180
- const virtualScrollItemSizeComputed = computed(() => (
214
+ const virtualScrollItemSizeComputed = computed(() =>
181
215
  props.virtualScrollItemSize === void 0
182
- ? (props.optionsDense === true ? 24 : 48)
216
+ ? props.optionsDense === true
217
+ ? 24
218
+ : 48
183
219
  : props.virtualScrollItemSize
184
- ))
220
+ )
185
221
 
186
222
  const {
187
223
  virtualScrollSliceRange,
@@ -192,23 +228,29 @@ export default createComponent({
192
228
  scrollTo,
193
229
  setVirtualScrollSize
194
230
  } = useVirtualScroll({
195
- virtualScrollLength, getVirtualScrollTarget, getVirtualScrollEl,
231
+ virtualScrollLength,
232
+ getVirtualScrollTarget,
233
+ getVirtualScrollEl,
196
234
  virtualScrollItemSizeComputed
197
235
  })
198
236
 
199
237
  const state = useFieldState()
200
238
 
201
239
  const innerValue = computed(() => {
202
- const
203
- mapNull = props.mapOptions === true && props.multiple !== true,
204
- val = props.modelValue !== void 0 && (props.modelValue !== null || mapNull === true)
205
- ? (props.multiple === true && Array.isArray(props.modelValue) ? props.modelValue : [ props.modelValue ])
206
- : []
240
+ const mapNull = props.mapOptions === true && props.multiple !== true,
241
+ val =
242
+ props.modelValue !== void 0 &&
243
+ (props.modelValue !== null || mapNull === true)
244
+ ? props.multiple === true && Array.isArray(props.modelValue)
245
+ ? props.modelValue
246
+ : [props.modelValue]
247
+ : []
207
248
 
208
249
  if (props.mapOptions === true && Array.isArray(props.options) === true) {
209
- const cache = props.mapOptions === true && innerValueCache !== void 0
210
- ? innerValueCache
211
- : []
250
+ const cache =
251
+ props.mapOptions === true && innerValueCache !== void 0
252
+ ? innerValueCache
253
+ : []
212
254
  const values = val.map(v => getOption(v, cache))
213
255
 
214
256
  return props.modelValue === null && mapNull === true
@@ -222,19 +264,17 @@ export default createComponent({
222
264
  const innerFieldProps = computed(() => {
223
265
  const acc = {}
224
266
  fieldPropsList.forEach(key => {
225
- const val = props[ key ]
267
+ const val = props[key]
226
268
  if (val !== void 0) {
227
- acc[ key ] = val
269
+ acc[key] = val
228
270
  }
229
271
  })
230
272
  return acc
231
273
  })
232
274
 
233
- const isOptionsDark = computed(() => (
234
- props.optionsDark === null
235
- ? state.isDark.value
236
- : props.optionsDark
237
- ))
275
+ const isOptionsDark = computed(() =>
276
+ props.optionsDark === null ? state.isDark.value : props.optionsDark
277
+ )
238
278
 
239
279
  const hasValue = computed(() => fieldValueIsFilled(innerValue.value))
240
280
 
@@ -242,50 +282,46 @@ export default createComponent({
242
282
  let cls = 'q-field__input q-placeholder col'
243
283
 
244
284
  if (props.hideSelected === true || innerValue.value.length === 0) {
245
- return [ cls, props.inputClass ]
285
+ return [cls, props.inputClass]
246
286
  }
247
287
 
248
288
  cls += ' q-field__input--padding'
249
289
 
250
- return props.inputClass === void 0
251
- ? cls
252
- : [ cls, props.inputClass ]
290
+ return props.inputClass === void 0 ? cls : [cls, props.inputClass]
253
291
  })
254
292
 
255
- const menuContentClass = computed(() =>
256
- (props.virtualScrollHorizontal === true ? 'q-virtual-scroll--horizontal' : '')
257
- + (props.popupContentClass ? ' ' + props.popupContentClass : '')
293
+ const menuContentClass = computed(
294
+ () =>
295
+ (props.virtualScrollHorizontal === true
296
+ ? 'q-virtual-scroll--horizontal'
297
+ : '') + (props.popupContentClass ? ' ' + props.popupContentClass : '')
258
298
  )
259
299
 
260
300
  const noOptions = computed(() => virtualScrollLength.value === 0)
261
301
 
262
302
  const selectedString = computed(() =>
263
- innerValue.value
264
- .map(opt => getOptionLabel.value(opt))
265
- .join(', ')
303
+ innerValue.value.map(opt => getOptionLabel.value(opt)).join(', ')
266
304
  )
267
305
 
268
- const ariaCurrentValue = computed(() => (props.displayValue !== void 0
269
- ? props.displayValue
270
- : selectedString.value
271
- ))
272
-
273
- const needsHtmlFn = computed(() => (
274
- props.optionsHtml === true
275
- ? () => true
276
- : opt => opt?.html === true
277
- ))
278
-
279
- const valueAsHtml = computed(() => (
280
- props.displayValueHtml === true || (
281
- props.displayValue === void 0 && (
282
- props.optionsHtml === true
283
- || innerValue.value.some(needsHtmlFn.value)
284
- )
285
- )
286
- ))
306
+ const ariaCurrentValue = computed(() =>
307
+ props.displayValue !== void 0 ? props.displayValue : selectedString.value
308
+ )
309
+
310
+ const needsHtmlFn = computed(() =>
311
+ props.optionsHtml === true ? () => true : opt => opt?.html === true
312
+ )
313
+
314
+ const valueAsHtml = computed(
315
+ () =>
316
+ props.displayValueHtml === true ||
317
+ (props.displayValue === void 0 &&
318
+ (props.optionsHtml === true ||
319
+ innerValue.value.some(needsHtmlFn.value)))
320
+ )
287
321
 
288
- const tabindex = computed(() => (state.focused.value === true ? props.tabindex : -1))
322
+ const tabindex = computed(() =>
323
+ state.focused.value === true ? props.tabindex : -1
324
+ )
289
325
 
290
326
  const comboboxAttrs = computed(() => {
291
327
  const attrs = {
@@ -295,24 +331,25 @@ export default createComponent({
295
331
  'aria-readonly': props.readonly === true ? 'true' : 'false',
296
332
  'aria-autocomplete': props.useInput === true ? 'list' : 'none',
297
333
  'aria-expanded': menu.value === true ? 'true' : 'false',
298
- 'aria-controls': `${ state.targetUid.value }_lb`
334
+ 'aria-controls': `${state.targetUid.value}_lb`
299
335
  }
300
336
 
301
337
  if (optionIndex.value >= 0) {
302
- attrs[ 'aria-activedescendant' ] = `${ state.targetUid.value }_${ optionIndex.value }`
338
+ attrs['aria-activedescendant'] =
339
+ `${state.targetUid.value}_${optionIndex.value}`
303
340
  }
304
341
 
305
342
  return attrs
306
343
  })
307
344
 
308
345
  const listboxAttrs = computed(() => ({
309
- id: `${ state.targetUid.value }_lb`,
346
+ id: `${state.targetUid.value}_lb`,
310
347
  role: 'listbox',
311
348
  'aria-multiselectable': props.multiple === true ? 'true' : 'false'
312
349
  }))
313
350
 
314
- const selectedScope = computed(() => {
315
- return innerValue.value.map((opt, i) => ({
351
+ const selectedScope = computed(() =>
352
+ innerValue.value.map((opt, i) => ({
316
353
  index: i,
317
354
  opt,
318
355
  html: needsHtmlFn.value(opt),
@@ -321,7 +358,7 @@ export default createComponent({
321
358
  toggleOption,
322
359
  tabindex: tabindex.value
323
360
  }))
324
- })
361
+ )
325
362
 
326
363
  const optionScope = computed(() => {
327
364
  if (virtualScrollLength.value === 0) {
@@ -347,15 +384,19 @@ export default createComponent({
347
384
  dark: isOptionsDark.value,
348
385
  role: 'option',
349
386
  'aria-selected': active === true ? 'true' : 'false',
350
- id: `${ state.targetUid.value }_${ index }`,
351
- onClick: () => { toggleOption(opt) }
387
+ id: `${state.targetUid.value}_${index}`,
388
+ onClick: () => {
389
+ toggleOption(opt)
390
+ }
352
391
  }
353
392
 
354
393
  if (disable !== true) {
355
- optionIndex.value === index && (itemProps.focused = true)
394
+ if (optionIndex.value === index) itemProps.focused = true
356
395
 
357
396
  if ($q.platform.is.desktop === true) {
358
- itemProps.onMousemove = () => { menu.value === true && setOptionIndex(index) }
397
+ itemProps.onMousemove = () => {
398
+ if (menu.value === true) setOptionIndex(index)
399
+ }
359
400
  }
360
401
  }
361
402
 
@@ -373,39 +414,50 @@ export default createComponent({
373
414
  })
374
415
  })
375
416
 
376
- const dropdownArrowIcon = computed(() => (
417
+ const dropdownArrowIcon = computed(() =>
377
418
  props.dropdownIcon !== void 0
378
419
  ? props.dropdownIcon
379
420
  : $q.iconSet.arrow.dropdown
380
- ))
381
-
382
- const squaredMenu = computed(() =>
383
- props.optionsCover === false
384
- && props.outlined !== true
385
- && props.standout !== true
386
- && props.borderless !== true
387
- && props.rounded !== true
388
421
  )
389
422
 
390
- const computedOptionsSelectedClass = computed(() => (
423
+ const squaredMenu = computed(
424
+ () =>
425
+ props.optionsCover === false &&
426
+ props.outlined !== true &&
427
+ props.standout !== true &&
428
+ props.borderless !== true &&
429
+ props.rounded !== true
430
+ )
431
+
432
+ const computedOptionsSelectedClass = computed(() =>
391
433
  props.optionsSelectedClass !== void 0
392
434
  ? props.optionsSelectedClass
393
- : (props.color !== void 0 ? `text-${ props.color }` : '')
394
- ))
435
+ : props.color !== void 0
436
+ ? `text-${props.color}`
437
+ : ''
438
+ )
395
439
 
396
440
  // returns method to get value of an option;
397
441
  // takes into account 'option-value' prop
398
- const getOptionValue = computed(() => getPropValueFn(props.optionValue, 'value'))
442
+ const getOptionValue = computed(() =>
443
+ getPropValueFn(props.optionValue, 'value')
444
+ )
399
445
 
400
446
  // returns method to get label of an option;
401
447
  // takes into account 'option-label' prop
402
- const getOptionLabel = computed(() => getPropValueFn(props.optionLabel, 'label'))
448
+ const getOptionLabel = computed(() =>
449
+ getPropValueFn(props.optionLabel, 'label')
450
+ )
403
451
 
404
452
  // returns method to tell if an option is disabled;
405
453
  // takes into account 'option-disable' prop
406
- const isOptionDisabled = computed(() => getPropValueFn(props.optionDisable, 'disable'))
454
+ const isOptionDisabled = computed(() =>
455
+ getPropValueFn(props.optionDisable, 'disable')
456
+ )
407
457
 
408
- const innerOptionsValue = computed(() => innerValue.value.map(getOptionValue.value))
458
+ const innerOptionsValue = computed(() =>
459
+ innerValue.value.map(getOptionValue.value)
460
+ )
409
461
 
410
462
  const inputControlEvents = computed(() => {
411
463
  const evt = {
@@ -419,32 +471,42 @@ export default createComponent({
419
471
  onKeyup: onTargetAutocomplete,
420
472
  onKeypress: onTargetKeypress,
421
473
  onFocus: selectInputText,
422
- onClick (e) { hasDialog === true && stop(e) }
474
+ onClick(e) {
475
+ if (hasDialog === true) stop(e)
476
+ }
423
477
  }
424
478
 
425
- evt.onCompositionstart = evt.onCompositionupdate = evt.onCompositionend = onComposition
479
+ evt.onCompositionstart =
480
+ evt.onCompositionupdate =
481
+ evt.onCompositionend =
482
+ onComposition
426
483
 
427
484
  return evt
428
485
  })
429
486
 
430
- watch(innerValue, val => {
431
- innerValueCache = val
487
+ watch(
488
+ innerValue,
489
+ val => {
490
+ innerValueCache = val
432
491
 
433
- if (
434
- props.useInput === true
435
- && props.fillInput === true
436
- && props.multiple !== true
437
- // Prevent re-entering in filter while filtering
438
- // Also prevent clearing inputValue while filtering
439
- && state.innerLoading.value !== true
440
- && ((dialog.value !== true && menu.value !== true) || hasValue.value !== true)
441
- ) {
442
- userInputValue !== true && resetInputValue()
443
- if (dialog.value === true || menu.value === true) {
444
- filter('')
492
+ if (
493
+ props.useInput === true &&
494
+ props.fillInput === true &&
495
+ props.multiple !== true &&
496
+ // Prevent re-entering in filter while filtering
497
+ // Also prevent clearing inputValue while filtering
498
+ state.innerLoading.value !== true &&
499
+ ((dialog.value !== true && menu.value !== true) ||
500
+ hasValue.value !== true)
501
+ ) {
502
+ if (userInputValue !== true) resetInputValue()
503
+ if (dialog.value === true || menu.value === true) {
504
+ filter('')
505
+ }
445
506
  }
446
- }
447
- }, { immediate: true })
507
+ },
508
+ { immediate: true }
509
+ )
448
510
 
449
511
  watch(() => props.fillInput, resetInputValue)
450
512
 
@@ -452,39 +514,34 @@ export default createComponent({
452
514
 
453
515
  watch(virtualScrollLength, rerenderMenu)
454
516
 
455
- function getEmittingOptionValue (opt) {
456
- return props.emitValue === true
457
- ? getOptionValue.value(opt)
458
- : opt
517
+ function getEmittingOptionValue(opt) {
518
+ return props.emitValue === true ? getOptionValue.value(opt) : opt
459
519
  }
460
520
 
461
- function removeAtIndex (index) {
521
+ function removeAtIndex(index) {
462
522
  if (index !== -1 && index < innerValue.value.length) {
463
523
  if (props.multiple === true) {
464
524
  const model = props.modelValue.slice()
465
- emit('remove', { index, value: model.splice(index, 1)[ 0 ] })
525
+ emit('remove', { index, value: model.splice(index, 1)[0] })
466
526
  emit('update:modelValue', model)
467
- }
468
- else {
527
+ } else {
469
528
  emit('update:modelValue', null)
470
529
  }
471
530
  }
472
531
  }
473
532
 
474
- function removeAtIndexAndFocus (index) {
533
+ function removeAtIndexAndFocus(index) {
475
534
  removeAtIndex(index)
476
535
  state.focus()
477
536
  }
478
537
 
479
- function add (opt, unique) {
538
+ function add(opt, unique) {
480
539
  const val = getEmittingOptionValue(opt)
481
540
 
482
541
  if (props.multiple !== true) {
483
- props.fillInput === true && updateInputValue(
484
- getOptionLabel.value(opt),
485
- true,
486
- true
487
- )
542
+ if (props.fillInput === true) {
543
+ updateInputValue(getOptionLabel.value(opt), true, true)
544
+ }
488
545
 
489
546
  emit('update:modelValue', val)
490
547
  return
@@ -492,19 +549,18 @@ export default createComponent({
492
549
 
493
550
  if (innerValue.value.length === 0) {
494
551
  emit('add', { index: 0, value: val })
495
- emit('update:modelValue', props.multiple === true ? [ val ] : val)
552
+ emit('update:modelValue', props.multiple === true ? [val] : val)
496
553
  return
497
554
  }
498
555
 
499
- if (
500
- unique === true
501
- && isOptionSelected(opt) === true
502
- ) return
556
+ if (unique === true && isOptionSelected(opt) === true) return
503
557
 
504
558
  if (
505
- props.maxValues !== void 0
506
- && props.modelValue.length >= props.maxValues
507
- ) return
559
+ props.maxValues !== void 0 &&
560
+ props.modelValue.length >= props.maxValues
561
+ ) {
562
+ return
563
+ }
508
564
 
509
565
  const model = props.modelValue.slice()
510
566
 
@@ -513,12 +569,14 @@ export default createComponent({
513
569
  emit('update:modelValue', model)
514
570
  }
515
571
 
516
- function toggleOption (opt, keepOpen) {
572
+ function toggleOption(opt, keepOpen) {
517
573
  if (
518
- state.editable.value !== true
519
- || opt === void 0
520
- || isOptionDisabled.value(opt) === true
521
- ) return
574
+ state.editable.value !== true ||
575
+ opt === void 0 ||
576
+ isOptionDisabled.value(opt) === true
577
+ ) {
578
+ return
579
+ }
522
580
 
523
581
  const optValue = getOptionValue.value(opt)
524
582
 
@@ -536,8 +594,9 @@ export default createComponent({
536
594
  targetRef.value?.focus()
537
595
 
538
596
  if (
539
- innerValue.value.length === 0
540
- || isDeepEqual(getOptionValue.value(innerValue.value[ 0 ]), optValue) !== true
597
+ innerValue.value.length === 0 ||
598
+ isDeepEqual(getOptionValue.value(innerValue.value[0]), optValue) !==
599
+ true
541
600
  ) {
542
601
  emit('update:modelValue', props.emitValue === true ? optValue : opt)
543
602
  }
@@ -554,22 +613,19 @@ export default createComponent({
554
613
  if (innerValue.value.length === 0) {
555
614
  const val = props.emitValue === true ? optValue : opt
556
615
  emit('add', { index: 0, value: val })
557
- emit('update:modelValue', props.multiple === true ? [ val ] : val)
616
+ emit('update:modelValue', props.multiple === true ? [val] : val)
558
617
  return
559
618
  }
560
619
 
561
- const
562
- model = props.modelValue.slice(),
620
+ const model = props.modelValue.slice(),
563
621
  index = innerOptionsValue.value.findIndex(v => isDeepEqual(v, optValue))
564
622
 
565
623
  if (index !== -1) {
566
- emit('remove', { index, value: model.splice(index, 1)[ 0 ] })
567
- }
568
- else {
569
- if (
570
- props.maxValues !== void 0
571
- && model.length >= props.maxValues
572
- ) return
624
+ emit('remove', { index, value: model.splice(index, 1)[0] })
625
+ } else {
626
+ if (props.maxValues !== void 0 && model.length >= props.maxValues) {
627
+ return
628
+ }
573
629
 
574
630
  const val = props.emitValue === true ? optValue : opt
575
631
 
@@ -580,38 +636,44 @@ export default createComponent({
580
636
  emit('update:modelValue', model)
581
637
  }
582
638
 
583
- function setOptionIndex (index) {
639
+ function setOptionIndex(index) {
584
640
  if ($q.platform.is.desktop !== true) return
585
641
 
586
- const val = index !== -1 && index < virtualScrollLength.value
587
- ? index
588
- : -1
642
+ const val = index !== -1 && index < virtualScrollLength.value ? index : -1
589
643
 
590
644
  if (optionIndex.value !== val) {
591
645
  optionIndex.value = val
592
646
  }
593
647
  }
594
648
 
595
- function moveOptionSelection (offset = 1, skipInputValue) {
649
+ // oxlint-disable-next-line default-param-last
650
+ function moveOptionSelection(localOffset = 1, skipInputValue) {
596
651
  if (menu.value === true) {
597
652
  let index = optionIndex.value
598
653
  do {
599
654
  index = normalizeToInterval(
600
- index + offset,
655
+ index + localOffset,
601
656
  -1,
602
657
  virtualScrollLength.value - 1
603
658
  )
604
- }
605
- while (index !== -1 && index !== optionIndex.value && isOptionDisabled.value(props.options[ index ]) === true)
659
+ } while (
660
+ index !== -1 &&
661
+ index !== optionIndex.value &&
662
+ isOptionDisabled.value(props.options[index]) === true
663
+ )
606
664
 
607
665
  if (optionIndex.value !== index) {
608
666
  setOptionIndex(index)
609
667
  scrollTo(index)
610
668
 
611
- if (skipInputValue !== true && props.useInput === true && props.fillInput === true) {
669
+ if (
670
+ skipInputValue !== true &&
671
+ props.useInput === true &&
672
+ props.fillInput === true
673
+ ) {
612
674
  setInputValue(
613
675
  index >= 0
614
- ? getOptionLabel.value(props.options[ index ])
676
+ ? getOptionLabel.value(props.options[index])
615
677
  : defaultInputValue,
616
678
  true
617
679
  )
@@ -620,27 +682,29 @@ export default createComponent({
620
682
  }
621
683
  }
622
684
 
623
- function getOption (value, valueCache) {
685
+ function getOption(value, valueCache) {
624
686
  const fn = opt => isDeepEqual(getOptionValue.value(opt), value)
625
687
  return props.options.find(fn) || valueCache.find(fn) || value
626
688
  }
627
689
 
628
- function isOptionSelected (opt) {
690
+ function isOptionSelected(opt) {
629
691
  const val = getOptionValue.value(opt)
630
692
  return innerOptionsValue.value.find(v => isDeepEqual(v, val)) !== void 0
631
693
  }
632
694
 
633
- function selectInputText (e) {
695
+ function selectInputText(e) {
634
696
  if (
635
- props.useInput === true
636
- && targetRef.value !== null
637
- && (e === void 0 || (targetRef.value === e.target && e.target.value === selectedString.value))
697
+ props.useInput === true &&
698
+ targetRef.value !== null &&
699
+ (e === void 0 ||
700
+ (targetRef.value === e.target &&
701
+ e.target.value === selectedString.value))
638
702
  ) {
639
703
  targetRef.value.select()
640
704
  }
641
705
  }
642
706
 
643
- function onTargetKeyup (e) {
707
+ function onTargetKeyup(e) {
644
708
  // if ESC and we have an opened menu
645
709
  // then stop propagation (might be caught by a QDialog
646
710
  // and so it will also close the QDialog, which is wrong)
@@ -654,7 +718,7 @@ export default createComponent({
654
718
  emit('keyup', e)
655
719
  }
656
720
 
657
- function onTargetAutocomplete (e) {
721
+ function onTargetAutocomplete(e) {
658
722
  const { value } = e.target
659
723
 
660
724
  if (e.keyCode !== void 0) {
@@ -678,14 +742,15 @@ export default createComponent({
678
742
  if (typeof value === 'string' && value.length !== 0) {
679
743
  const needle = value.toLocaleLowerCase()
680
744
  const findFn = extractFn => {
681
- const option = props.options.find(opt => String(extractFn.value(opt)).toLocaleLowerCase() === needle)
745
+ const option = props.options.find(
746
+ opt => String(extractFn.value(opt)).toLocaleLowerCase() === needle
747
+ )
682
748
 
683
749
  if (option === void 0) return false
684
750
 
685
751
  if (innerValue.value.indexOf(option) === -1) {
686
752
  toggleOption(option)
687
- }
688
- else {
753
+ } else {
689
754
  hidePopup()
690
755
  }
691
756
 
@@ -693,37 +758,38 @@ export default createComponent({
693
758
  }
694
759
  const fillFn = afterFilter => {
695
760
  if (
696
- findFn(getOptionValue) !== true
697
- && afterFilter !== true
698
- && findFn(getOptionLabel) !== true
761
+ findFn(getOptionValue) !== true &&
762
+ afterFilter !== true &&
763
+ findFn(getOptionLabel) !== true
699
764
  ) {
700
765
  filter(value, true, () => fillFn(true))
701
766
  }
702
767
  }
703
768
 
704
769
  fillFn()
705
- }
706
- else {
770
+ } else {
707
771
  state.clearValue(e)
708
772
  }
709
773
  }
710
774
 
711
- function onTargetKeypress (e) {
775
+ function onTargetKeypress(e) {
712
776
  emit('keypress', e)
713
777
  }
714
778
 
715
- function onTargetKeydown (e) {
779
+ function onTargetKeydown(e) {
716
780
  emit('keydown', e)
717
781
 
718
782
  if (shouldIgnoreKey(e) === true) return
719
783
 
720
- const newValueModeValid = inputValue.value.length !== 0
721
- && (props.newValueMode !== void 0 || props.onNewValue !== void 0)
784
+ const newValueModeValid =
785
+ inputValue.value.length !== 0 &&
786
+ (props.newValueMode !== void 0 || props.onNewValue !== void 0)
722
787
 
723
- const tabShouldSelect = e.shiftKey !== true
724
- && props.disableTabSelection !== true
725
- && props.multiple !== true
726
- && (optionIndex.value !== -1 || newValueModeValid === true)
788
+ const tabShouldSelect =
789
+ e.shiftKey !== true &&
790
+ props.disableTabSelection !== true &&
791
+ props.multiple !== true &&
792
+ (optionIndex.value !== -1 || newValueModeValid === true)
727
793
 
728
794
  // escape
729
795
  if (e.keyCode === 27) {
@@ -738,16 +804,18 @@ export default createComponent({
738
804
  }
739
805
 
740
806
  if (
741
- e.target === void 0
742
- || e.target.id !== state.targetUid.value
743
- || state.editable.value !== true
744
- ) return
807
+ e.target === void 0 ||
808
+ e.target.id !== state.targetUid.value ||
809
+ state.editable.value !== true
810
+ ) {
811
+ return
812
+ }
745
813
 
746
814
  // down
747
815
  if (
748
- e.keyCode === 40
749
- && state.innerLoading.value !== true
750
- && menu.value === false
816
+ e.keyCode === 40 &&
817
+ state.innerLoading.value !== true &&
818
+ menu.value === false
751
819
  ) {
752
820
  stopAndPrevent(e)
753
821
  showPopup()
@@ -756,18 +824,17 @@ export default createComponent({
756
824
 
757
825
  // backspace
758
826
  if (
759
- e.keyCode === 8
760
- && (
761
- props.useChips === true
762
- || props.clearable === true
763
- )
764
- && props.hideSelected !== true
765
- && inputValue.value.length === 0
827
+ e.keyCode === 8 &&
828
+ (props.useChips === true || props.clearable === true) &&
829
+ props.hideSelected !== true &&
830
+ inputValue.value.length === 0
766
831
  ) {
767
- if (props.multiple === true && Array.isArray(props.modelValue) === true) {
832
+ if (
833
+ props.multiple === true &&
834
+ Array.isArray(props.modelValue) === true
835
+ ) {
768
836
  removeAtIndex(props.modelValue.length - 1)
769
- }
770
- else if (props.multiple !== true && props.modelValue !== null) {
837
+ } else if (props.multiple !== true && props.modelValue !== null) {
771
838
  emit('update:modelValue', null)
772
839
  }
773
840
 
@@ -776,8 +843,8 @@ export default createComponent({
776
843
 
777
844
  // home, end - 36, 35
778
845
  if (
779
- (e.keyCode === 35 || e.keyCode === 36)
780
- && (typeof inputValue.value !== 'string' || inputValue.value.length === 0)
846
+ (e.keyCode === 35 || e.keyCode === 36) &&
847
+ (typeof inputValue.value !== 'string' || inputValue.value.length === 0)
781
848
  ) {
782
849
  stopAndPrevent(e)
783
850
  optionIndex.value = -1
@@ -786,15 +853,17 @@ export default createComponent({
786
853
 
787
854
  // pg up, pg down - 33, 34
788
855
  if (
789
- (e.keyCode === 33 || e.keyCode === 34)
790
- && virtualScrollSliceSizeComputed.value !== void 0
856
+ (e.keyCode === 33 || e.keyCode === 34) &&
857
+ virtualScrollSliceSizeComputed.value !== void 0
791
858
  ) {
792
859
  stopAndPrevent(e)
793
860
  optionIndex.value = Math.max(
794
861
  -1,
795
862
  Math.min(
796
863
  virtualScrollLength.value,
797
- optionIndex.value + (e.keyCode === 33 ? -1 : 1) * virtualScrollSliceSizeComputed.value.view
864
+ optionIndex.value +
865
+ (e.keyCode === 33 ? -1 : 1) *
866
+ virtualScrollSliceSizeComputed.value.view
798
867
  )
799
868
  )
800
869
  moveOptionSelection(e.keyCode === 33 ? 1 : -1, props.multiple)
@@ -815,20 +884,19 @@ export default createComponent({
815
884
 
816
885
  // keyboard search when not having use-input
817
886
  if (
818
- optionsLength > 0
819
- && props.useInput !== true
820
- && e.key !== void 0
821
- && e.key.length === 1 // printable char
822
- && e.altKey === false // not kbd shortcut
823
- && e.ctrlKey === false // not kbd shortcut
824
- && e.metaKey === false // not kbd shortcut, especially on macOS with Command key
825
- && (e.keyCode !== 32 || searchBuffer.length !== 0) // space in middle of search
887
+ optionsLength > 0 &&
888
+ props.useInput !== true &&
889
+ e.key !== void 0 &&
890
+ e.key.length === 1 && // printable char
891
+ e.altKey === false && // not kbd shortcut
892
+ e.ctrlKey === false && // not kbd shortcut
893
+ e.metaKey === false && // not kbd shortcut, especially on macOS with Command key
894
+ (e.keyCode !== 32 || searchBuffer.length !== 0) // space in middle of search
826
895
  ) {
827
- menu.value !== true && showPopup(e)
896
+ if (menu.value !== true) showPopup(e)
828
897
 
829
- const
830
- char = e.key.toLocaleLowerCase(),
831
- keyRepeat = searchBuffer.length === 1 && searchBuffer[ 0 ] === char
898
+ const char = e.key.toLocaleLowerCase(),
899
+ keyRepeat = searchBuffer.length === 1 && searchBuffer[0] === char
832
900
 
833
901
  searchBufferExp = Date.now() + 1500
834
902
  if (keyRepeat === false) {
@@ -836,18 +904,30 @@ export default createComponent({
836
904
  searchBuffer += char
837
905
  }
838
906
 
839
- const searchRe = new RegExp('^' + searchBuffer.split('').map(l => (reEscapeList.indexOf(l) !== -1 ? '\\' + l : l)).join('.*'), 'i')
907
+ const searchRe = new RegExp(
908
+ '^' +
909
+ searchBuffer
910
+ .split('')
911
+ .map(l => (reEscapeList.indexOf(l) !== -1 ? '\\' + l : l))
912
+ .join('.*'),
913
+ 'i'
914
+ )
840
915
 
841
916
  let index = optionIndex.value
842
917
 
843
- if (keyRepeat === true || index < 0 || searchRe.test(getOptionLabel.value(props.options[ index ])) !== true) {
918
+ if (
919
+ keyRepeat === true ||
920
+ index < 0 ||
921
+ searchRe.test(getOptionLabel.value(props.options[index])) !== true
922
+ ) {
844
923
  do {
845
924
  index = normalizeToInterval(index + 1, -1, optionsLength - 1)
846
- }
847
- while (index !== optionIndex.value && (
848
- isOptionDisabled.value(props.options[ index ]) === true
849
- || searchRe.test(getOptionLabel.value(props.options[ index ])) !== true
850
- ))
925
+ } while (
926
+ index !== optionIndex.value &&
927
+ (isOptionDisabled.value(props.options[index]) === true ||
928
+ searchRe.test(getOptionLabel.value(props.options[index])) !==
929
+ true)
930
+ )
851
931
  }
852
932
 
853
933
  if (optionIndex.value !== index) {
@@ -855,8 +935,12 @@ export default createComponent({
855
935
  setOptionIndex(index)
856
936
  scrollTo(index)
857
937
 
858
- if (index >= 0 && props.useInput === true && props.fillInput === true) {
859
- setInputValue(getOptionLabel.value(props.options[ index ]), true)
938
+ if (
939
+ index >= 0 &&
940
+ props.useInput === true &&
941
+ props.fillInput === true
942
+ ) {
943
+ setInputValue(getOptionLabel.value(props.options[index]), true)
860
944
  }
861
945
  })
862
946
  }
@@ -867,15 +951,17 @@ export default createComponent({
867
951
  // enter, space (when not using use-input and not in search), or tab (when not using multiple and option selected)
868
952
  // same target is checked above
869
953
  if (
870
- e.keyCode !== 13
871
- && (e.keyCode !== 32 || props.useInput === true || searchBuffer !== '')
872
- && (e.keyCode !== 9 || tabShouldSelect === false)
873
- ) return
954
+ e.keyCode !== 13 &&
955
+ (e.keyCode !== 32 || props.useInput === true || searchBuffer !== '') &&
956
+ (e.keyCode !== 9 || tabShouldSelect === false)
957
+ ) {
958
+ return
959
+ }
874
960
 
875
- e.keyCode !== 9 && stopAndPrevent(e)
961
+ if (e.keyCode !== 9) stopAndPrevent(e)
876
962
 
877
963
  if (optionIndex.value !== -1 && optionIndex.value < optionsLength) {
878
- toggleOption(props.options[ optionIndex.value ])
964
+ toggleOption(props.options[optionIndex.value])
879
965
  return
880
966
  }
881
967
 
@@ -883,8 +969,7 @@ export default createComponent({
883
969
  const done = (val, mode) => {
884
970
  if (mode) {
885
971
  if (validateNewValueMode(mode) !== true) return
886
- }
887
- else {
972
+ } else {
888
973
  mode = props.newValueMode
889
974
  }
890
975
 
@@ -903,8 +988,7 @@ export default createComponent({
903
988
 
904
989
  if (props.onNewValue !== void 0) {
905
990
  emit('newValue', inputValue.value, done)
906
- }
907
- else {
991
+ } else {
908
992
  done(inputValue.value)
909
993
  }
910
994
 
@@ -913,33 +997,32 @@ export default createComponent({
913
997
 
914
998
  if (menu.value === true) {
915
999
  closeMenu()
916
- }
917
- else if (state.innerLoading.value !== true) {
1000
+ } else if (state.innerLoading.value !== true) {
918
1001
  showPopup()
919
1002
  }
920
1003
  }
921
1004
 
922
- function getVirtualScrollEl () {
1005
+ function getVirtualScrollEl() {
923
1006
  return hasDialog === true
924
1007
  ? menuContentRef.value
925
- : (
926
- menuRef.value !== null && menuRef.value.contentEl !== null
927
- ? menuRef.value.contentEl
928
- : void 0
929
- )
1008
+ : menuRef.value !== null && menuRef.value.contentEl !== null
1009
+ ? menuRef.value.contentEl
1010
+ : void 0
930
1011
  }
931
1012
 
932
- function getVirtualScrollTarget () {
1013
+ function getVirtualScrollTarget() {
933
1014
  return getVirtualScrollEl()
934
1015
  }
935
1016
 
936
- function getSelection () {
1017
+ function getSelection() {
937
1018
  if (props.hideSelected === true) {
938
1019
  return []
939
1020
  }
940
1021
 
941
- if (slots[ 'selected-item' ] !== void 0) {
942
- return selectedScope.value.map(scope => slots[ 'selected-item' ](scope)).slice()
1022
+ if (slots['selected-item'] !== void 0) {
1023
+ return selectedScope.value
1024
+ .map(scope => slots['selected-item'](scope))
1025
+ .slice()
943
1026
  }
944
1027
 
945
1028
  if (slots.selected !== void 0) {
@@ -947,64 +1030,82 @@ export default createComponent({
947
1030
  }
948
1031
 
949
1032
  if (props.useChips === true) {
950
- return selectedScope.value.map((scope, i) => h(QChip, {
951
- key: 'option-' + i,
952
- removable: state.editable.value === true && isOptionDisabled.value(scope.opt) !== true,
953
- dense: true,
954
- textColor: props.color,
955
- tabindex: tabindex.value,
956
- onRemove () { scope.removeAtIndex(i) }
957
- }, () => h('span', {
958
- class: 'ellipsis',
959
- [ scope.html === true ? 'innerHTML' : 'textContent' ]: getOptionLabel.value(scope.opt)
960
- })))
1033
+ return selectedScope.value.map((scope, i) =>
1034
+ h(
1035
+ QChip,
1036
+ {
1037
+ key: 'option-' + i,
1038
+ removable:
1039
+ state.editable.value === true &&
1040
+ isOptionDisabled.value(scope.opt) !== true,
1041
+ dense: true,
1042
+ textColor: props.color,
1043
+ tabindex: tabindex.value,
1044
+ onRemove() {
1045
+ scope.removeAtIndex(i)
1046
+ }
1047
+ },
1048
+ () =>
1049
+ h('span', {
1050
+ class: 'ellipsis',
1051
+ [scope.html === true ? 'innerHTML' : 'textContent']:
1052
+ getOptionLabel.value(scope.opt)
1053
+ })
1054
+ )
1055
+ )
961
1056
  }
962
1057
 
963
1058
  return [
964
1059
  h('span', {
965
1060
  class: 'ellipsis',
966
- [ valueAsHtml.value === true ? 'innerHTML' : 'textContent' ]: ariaCurrentValue.value
1061
+ [valueAsHtml.value === true ? 'innerHTML' : 'textContent']:
1062
+ ariaCurrentValue.value
967
1063
  })
968
1064
  ]
969
1065
  }
970
1066
 
971
- function getAllOptions () {
1067
+ function getAllOptions() {
972
1068
  if (noOptions.value === true) {
973
- return slots[ 'no-option' ] !== void 0
974
- ? slots[ 'no-option' ]({ inputValue: inputValue.value })
1069
+ return slots['no-option'] !== void 0
1070
+ ? slots['no-option']({ inputValue: inputValue.value })
975
1071
  : void 0
976
1072
  }
977
1073
 
978
- const fn = slots.option !== void 0
979
- ? slots.option
980
- : scope => {
981
- return h(QItem, {
982
- key: scope.index,
983
- ...scope.itemProps
984
- }, () => {
985
- return h(
986
- QItemSection,
987
- () => h(
988
- QItemLabel,
989
- () => h('span', {
990
- [ scope.html === true ? 'innerHTML' : 'textContent' ]: scope.label
991
- })
1074
+ const fn =
1075
+ slots.option !== void 0
1076
+ ? slots.option
1077
+ : scope =>
1078
+ h(
1079
+ QItem,
1080
+ {
1081
+ key: scope.index,
1082
+ ...scope.itemProps
1083
+ },
1084
+ () =>
1085
+ h(QItemSection, () =>
1086
+ h(QItemLabel, () =>
1087
+ h('span', {
1088
+ [scope.html === true ? 'innerHTML' : 'textContent']:
1089
+ scope.label
1090
+ })
1091
+ )
1092
+ )
992
1093
  )
993
- )
994
- })
995
- }
996
1094
 
997
1095
  let options = padVirtualScroll('div', optionScope.value.map(fn))
998
1096
 
999
- if (slots[ 'before-options' ] !== void 0) {
1000
- options = slots[ 'before-options' ]().concat(options)
1097
+ if (slots['before-options'] !== void 0) {
1098
+ options = slots['before-options']().concat(options)
1001
1099
  }
1002
1100
 
1003
- return hMergeSlot(slots[ 'after-options' ], options)
1101
+ return hMergeSlot(slots['after-options'], options)
1004
1102
  }
1005
1103
 
1006
- function getInput (fromDialog, isTarget) {
1007
- const attrs = isTarget === true ? { ...comboboxAttrs.value, ...state.splitAttrs.attributes.value } : void 0
1104
+ function getInput(fromDialog, isTarget) {
1105
+ const attrs =
1106
+ isTarget === true
1107
+ ? { ...comboboxAttrs.value, ...state.splitAttrs.attributes.value }
1108
+ : void 0
1008
1109
 
1009
1110
  const data = {
1010
1111
  ref: isTarget === true ? targetRef : void 0,
@@ -1018,7 +1119,8 @@ export default createComponent({
1018
1119
  id: isTarget === true ? state.targetUid.value : void 0,
1019
1120
  maxlength: props.maxlength,
1020
1121
  autocomplete: props.autocomplete,
1021
- 'data-autofocus': fromDialog === true || props.autofocus === true || void 0,
1122
+ 'data-autofocus':
1123
+ fromDialog === true || props.autofocus === true || void 0,
1022
1124
  disabled: props.disable === true,
1023
1125
  readonly: props.readonly === true,
1024
1126
  ...inputControlEvents.value
@@ -1026,9 +1128,8 @@ export default createComponent({
1026
1128
 
1027
1129
  if (fromDialog !== true && hasDialog === true) {
1028
1130
  if (Array.isArray(data.class) === true) {
1029
- data.class = [ ...data.class, 'no-pointer-events' ]
1030
- }
1031
- else {
1131
+ data.class = [...data.class, 'no-pointer-events']
1132
+ } else {
1032
1133
  data.class += ' no-pointer-events'
1033
1134
  }
1034
1135
  }
@@ -1036,7 +1137,7 @@ export default createComponent({
1036
1137
  return h('input', data)
1037
1138
  }
1038
1139
 
1039
- function onInput (e) {
1140
+ function onInput(e) {
1040
1141
  if (filterTimer !== null) {
1041
1142
  clearTimeout(filterTimer)
1042
1143
  filterTimer = null
@@ -1046,11 +1147,7 @@ export default createComponent({
1046
1147
  inputValueTimer = null
1047
1148
  }
1048
1149
 
1049
- if (
1050
- e
1051
- && e.target
1052
- && e.target.qComposing === true
1053
- ) return
1150
+ if (e && e.target && e.target.qComposing === true) return
1054
1151
 
1055
1152
  setInputValue(e.target.value || '')
1056
1153
  // mark it here as user input so that if updateInputValue is called
@@ -1059,8 +1156,8 @@ export default createComponent({
1059
1156
  defaultInputValue = inputValue.value
1060
1157
 
1061
1158
  if (
1062
- state.focused.value !== true
1063
- && (hasDialog !== true || dialogFieldFocused.value === true)
1159
+ state.focused.value !== true &&
1160
+ (hasDialog !== true || dialogFieldFocused.value === true)
1064
1161
  ) {
1065
1162
  state.focus()
1066
1163
  }
@@ -1073,14 +1170,17 @@ export default createComponent({
1073
1170
  }
1074
1171
  }
1075
1172
 
1076
- function setInputValue (val, emitImmediately) {
1173
+ function setInputValue(val, emitImmediately) {
1077
1174
  if (inputValue.value !== val) {
1078
1175
  inputValue.value = val
1079
1176
 
1080
- if (emitImmediately === true || props.inputDebounce === 0 || props.inputDebounce === '0') {
1177
+ if (
1178
+ emitImmediately === true ||
1179
+ props.inputDebounce === 0 ||
1180
+ props.inputDebounce === '0'
1181
+ ) {
1081
1182
  emit('inputValue', val)
1082
- }
1083
- else {
1183
+ } else {
1084
1184
  inputValueTimer = setTimeout(() => {
1085
1185
  inputValueTimer = null
1086
1186
  emit('inputValue', val)
@@ -1089,7 +1189,7 @@ export default createComponent({
1089
1189
  }
1090
1190
  }
1091
1191
 
1092
- function updateInputValue (val, noFiltering, internal) {
1192
+ function updateInputValue(val, noFiltering, internal) {
1093
1193
  userInputValue = internal !== true
1094
1194
 
1095
1195
  if (props.useInput === true) {
@@ -1099,49 +1199,53 @@ export default createComponent({
1099
1199
  defaultInputValue = val
1100
1200
  }
1101
1201
 
1102
- noFiltering !== true && filter(val)
1202
+ if (noFiltering !== true) filter(val)
1103
1203
  }
1104
1204
  }
1105
1205
 
1106
- function filter (val, keepClosed, afterUpdateFn) {
1206
+ function filter(val, keepClosed, afterUpdateFn) {
1107
1207
  if (
1108
- props.onFilter === void 0
1109
- || (keepClosed !== true && state.focused.value !== true)
1110
- ) return
1208
+ props.onFilter === void 0 ||
1209
+ (keepClosed !== true && state.focused.value !== true)
1210
+ ) {
1211
+ return
1212
+ }
1111
1213
 
1112
1214
  if (state.innerLoading.value === true) {
1113
1215
  emit('filterAbort')
1114
- }
1115
- else {
1216
+ } else {
1116
1217
  state.innerLoading.value = true
1117
1218
  innerLoadingIndicator.value = true
1118
1219
  }
1119
1220
 
1120
1221
  if (
1121
- val !== ''
1122
- && props.multiple !== true
1123
- && innerValue.value.length !== 0
1124
- && userInputValue !== true
1125
- && val === getOptionLabel.value(innerValue.value[ 0 ])
1222
+ val !== '' &&
1223
+ props.multiple !== true &&
1224
+ innerValue.value.length !== 0 &&
1225
+ userInputValue !== true &&
1226
+ val === getOptionLabel.value(innerValue.value[0])
1126
1227
  ) {
1127
1228
  val = ''
1128
1229
  }
1129
1230
 
1130
1231
  const localFilterId = setTimeout(() => {
1131
- menu.value === true && (menu.value = false)
1232
+ if (menu.value === true) menu.value = false
1132
1233
  }, 10)
1133
1234
 
1134
- filterId !== null && clearTimeout(filterId)
1235
+ if (filterId !== null) clearTimeout(filterId)
1135
1236
  filterId = localFilterId
1136
1237
 
1137
1238
  emit(
1138
1239
  'filter',
1139
1240
  val,
1140
1241
  (fn, afterFn) => {
1141
- if ((keepClosed === true || state.focused.value === true) && filterId === localFilterId) {
1242
+ if (
1243
+ (keepClosed === true || state.focused.value === true) &&
1244
+ filterId === localFilterId
1245
+ ) {
1142
1246
  clearTimeout(filterId)
1143
1247
 
1144
- typeof fn === 'function' && fn()
1248
+ if (typeof fn === 'function') fn()
1145
1249
 
1146
1250
  // hide indicator to allow arrow to animate
1147
1251
  innerLoadingIndicator.value = false
@@ -1151,18 +1255,25 @@ export default createComponent({
1151
1255
 
1152
1256
  if (state.editable.value === true) {
1153
1257
  if (keepClosed === true) {
1154
- menu.value === true && hidePopup()
1155
- }
1156
- else if (menu.value === true) {
1258
+ if (menu.value === true) hidePopup()
1259
+ } else if (menu.value === true) {
1157
1260
  updateMenu(true)
1158
- }
1159
- else {
1261
+ } else {
1160
1262
  menu.value = true
1161
1263
  }
1162
1264
  }
1163
1265
 
1164
- typeof afterFn === 'function' && nextTick(() => { afterFn(proxy) })
1165
- typeof afterUpdateFn === 'function' && nextTick(() => { afterUpdateFn(proxy) })
1266
+ if (typeof afterFn === 'function') {
1267
+ nextTick(() => {
1268
+ afterFn(proxy)
1269
+ })
1270
+ }
1271
+
1272
+ if (typeof afterUpdateFn === 'function') {
1273
+ nextTick(() => {
1274
+ afterUpdateFn(proxy)
1275
+ })
1276
+ }
1166
1277
  })
1167
1278
  }
1168
1279
  },
@@ -1172,140 +1283,177 @@ export default createComponent({
1172
1283
  state.innerLoading.value = false
1173
1284
  innerLoadingIndicator.value = false
1174
1285
  }
1175
- menu.value === true && (menu.value = false)
1286
+
1287
+ if (menu.value === true) menu.value = false
1176
1288
  }
1177
1289
  )
1178
1290
  }
1179
1291
 
1180
- function getMenu () {
1181
- return h(QMenu, {
1182
- ref: menuRef,
1183
- class: menuContentClass.value,
1184
- style: props.popupContentStyle,
1185
- modelValue: menu.value,
1186
- fit: props.menuShrink !== true,
1187
- cover: props.optionsCover === true && noOptions.value !== true && props.useInput !== true,
1188
- anchor: props.menuAnchor,
1189
- self: props.menuSelf,
1190
- offset: props.menuOffset,
1191
- dark: isOptionsDark.value,
1192
- noParentEvent: true,
1193
- noRefocus: true,
1194
- noFocus: true,
1195
- noRouteDismiss: props.popupNoRouteDismiss,
1196
- square: squaredMenu.value,
1197
- transitionShow: props.transitionShow,
1198
- transitionHide: props.transitionHide,
1199
- transitionDuration: props.transitionDuration,
1200
- separateClosePopup: true,
1201
- ...listboxAttrs.value,
1202
- onScrollPassive: onVirtualScrollEvt,
1203
- onBeforeShow: onControlPopupShow,
1204
- onBeforeHide: onMenuBeforeHide,
1205
- onShow: onMenuShow
1206
- }, getAllOptions)
1292
+ function getMenu() {
1293
+ return h(
1294
+ QMenu,
1295
+ {
1296
+ ref: menuRef,
1297
+ class: menuContentClass.value,
1298
+ style: props.popupContentStyle,
1299
+ modelValue: menu.value,
1300
+ fit: props.menuShrink !== true,
1301
+ cover:
1302
+ props.optionsCover === true &&
1303
+ noOptions.value !== true &&
1304
+ props.useInput !== true,
1305
+ anchor: props.menuAnchor,
1306
+ self: props.menuSelf,
1307
+ offset: props.menuOffset,
1308
+ dark: isOptionsDark.value,
1309
+ noParentEvent: true,
1310
+ noRefocus: true,
1311
+ noFocus: true,
1312
+ noRouteDismiss: props.popupNoRouteDismiss,
1313
+ square: squaredMenu.value,
1314
+ transitionShow: props.transitionShow,
1315
+ transitionHide: props.transitionHide,
1316
+ transitionDuration: props.transitionDuration,
1317
+ separateClosePopup: true,
1318
+ ...listboxAttrs.value,
1319
+ onScrollPassive: onVirtualScrollEvt,
1320
+ onBeforeShow: onControlPopupShow,
1321
+ onBeforeHide: onMenuBeforeHide,
1322
+ onShow: onMenuShow
1323
+ },
1324
+ getAllOptions
1325
+ )
1207
1326
  }
1208
1327
 
1209
- function onMenuBeforeHide (e) {
1328
+ function onMenuBeforeHide(e) {
1210
1329
  onControlPopupHide(e)
1211
1330
  closeMenu()
1212
1331
  }
1213
1332
 
1214
- function onMenuShow () {
1333
+ function onMenuShow() {
1215
1334
  setVirtualScrollSize()
1216
1335
  }
1217
1336
 
1218
- function onDialogFieldFocus (e) {
1337
+ function onDialogFieldFocus(e) {
1219
1338
  stop(e)
1220
1339
  targetRef.value?.focus()
1221
1340
  dialogFieldFocused.value = true
1222
- window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0)
1341
+ window.scrollTo(
1342
+ window.pageXOffset || window.scrollX || document.body.scrollLeft || 0,
1343
+ 0
1344
+ )
1223
1345
  }
1224
1346
 
1225
- function onDialogFieldBlur (e) {
1347
+ function onDialogFieldBlur(e) {
1226
1348
  stop(e)
1227
1349
  nextTick(() => {
1228
1350
  dialogFieldFocused.value = false
1229
1351
  })
1230
1352
  }
1231
1353
 
1232
- function getDialog () {
1354
+ function getDialog() {
1233
1355
  const content = [
1234
- h(QField, {
1235
- class: `col-auto ${ state.fieldClass.value }`,
1236
- ...innerFieldProps.value,
1237
- for: state.targetUid.value,
1238
- dark: isOptionsDark.value,
1239
- square: true,
1240
- loading: innerLoadingIndicator.value,
1241
- itemAligned: false,
1242
- filled: true,
1243
- stackLabel: inputValue.value.length !== 0,
1244
- ...state.splitAttrs.listeners.value,
1245
- onFocus: onDialogFieldFocus,
1246
- onBlur: onDialogFieldBlur
1247
- }, {
1248
- ...slots,
1249
- rawControl: () => state.getControl(true),
1250
- before: void 0,
1251
- after: void 0
1252
- })
1356
+ h(
1357
+ QField,
1358
+ {
1359
+ class: `col-auto ${state.fieldClass.value}`,
1360
+ ...innerFieldProps.value,
1361
+ for: state.targetUid.value,
1362
+ dark: isOptionsDark.value,
1363
+ square: true,
1364
+ loading: innerLoadingIndicator.value,
1365
+ itemAligned: false,
1366
+ filled: true,
1367
+ stackLabel: inputValue.value.length !== 0,
1368
+ ...state.splitAttrs.listeners.value,
1369
+ onFocus: onDialogFieldFocus,
1370
+ onBlur: onDialogFieldBlur
1371
+ },
1372
+ {
1373
+ ...slots,
1374
+ rawControl: () => state.getControl(true),
1375
+ before: void 0,
1376
+ after: void 0
1377
+ }
1378
+ )
1253
1379
  ]
1254
1380
 
1255
- menu.value === true && content.push(
1256
- h('div', {
1257
- ref: menuContentRef,
1258
- class: menuContentClass.value + ' scroll',
1259
- style: props.popupContentStyle,
1260
- ...listboxAttrs.value,
1261
- onClick: prevent,
1262
- onScrollPassive: onVirtualScrollEvt
1263
- }, getAllOptions())
1264
- )
1381
+ if (menu.value === true) {
1382
+ content.push(
1383
+ h(
1384
+ 'div',
1385
+ {
1386
+ ref: menuContentRef,
1387
+ class: menuContentClass.value + ' scroll',
1388
+ style: props.popupContentStyle,
1389
+ ...listboxAttrs.value,
1390
+ onClick: prevent,
1391
+ onScrollPassive: onVirtualScrollEvt
1392
+ },
1393
+ getAllOptions()
1394
+ )
1395
+ )
1396
+ }
1265
1397
 
1266
- return h(QDialog, {
1267
- ref: dialogRef,
1268
- modelValue: dialog.value,
1269
- position: props.useInput === true ? 'top' : void 0,
1270
- transitionShow: transitionShowComputed,
1271
- transitionHide: props.transitionHide,
1272
- transitionDuration: props.transitionDuration,
1273
- noRouteDismiss: props.popupNoRouteDismiss,
1274
- onBeforeShow: onControlPopupShow,
1275
- onBeforeHide: onDialogBeforeHide,
1276
- onHide: onDialogHide,
1277
- onShow: onDialogShow
1278
- }, () => h('div', {
1279
- class: 'q-select__dialog'
1280
- + (isOptionsDark.value === true ? ' q-select__dialog--dark q-dark' : '')
1281
- + (dialogFieldFocused.value === true ? ' q-select__dialog--focused' : '')
1282
- }, content))
1398
+ return h(
1399
+ QDialog,
1400
+ {
1401
+ ref: dialogRef,
1402
+ modelValue: dialog.value,
1403
+ position: props.useInput === true ? 'top' : void 0,
1404
+ transitionShow: transitionShowComputed,
1405
+ transitionHide: props.transitionHide,
1406
+ transitionDuration: props.transitionDuration,
1407
+ noRouteDismiss: props.popupNoRouteDismiss,
1408
+ onBeforeShow: onControlPopupShow,
1409
+ onBeforeHide: onDialogBeforeHide,
1410
+ onHide: onDialogHide,
1411
+ onShow: onDialogShow
1412
+ },
1413
+ () =>
1414
+ h(
1415
+ 'div',
1416
+ {
1417
+ class:
1418
+ 'q-select__dialog' +
1419
+ (isOptionsDark.value === true
1420
+ ? ' q-select__dialog--dark q-dark'
1421
+ : '') +
1422
+ (dialogFieldFocused.value === true
1423
+ ? ' q-select__dialog--focused'
1424
+ : '')
1425
+ },
1426
+ content
1427
+ )
1428
+ )
1283
1429
  }
1284
1430
 
1285
- function onDialogBeforeHide (e) {
1431
+ function onDialogBeforeHide(e) {
1286
1432
  onControlPopupHide(e)
1287
1433
 
1288
1434
  if (dialogRef.value !== null) {
1289
1435
  dialogRef.value.__updateRefocusTarget(
1290
- state.rootRef.value.querySelector('.q-field__native > [tabindex]:last-child')
1436
+ state.rootRef.value.querySelector(
1437
+ '.q-field__native > [tabindex]:last-child'
1438
+ )
1291
1439
  )
1292
1440
  }
1293
1441
 
1294
1442
  state.focused.value = false
1295
1443
  }
1296
1444
 
1297
- function onDialogHide (e) {
1445
+ function onDialogHide(e) {
1298
1446
  hidePopup()
1299
- state.focused.value === false && emit('blur', e)
1447
+ if (state.focused.value === false) emit('blur', e)
1300
1448
  resetInputValue()
1301
1449
  }
1302
1450
 
1303
- function onDialogShow () {
1451
+ function onDialogShow() {
1304
1452
  const el = document.activeElement
1305
1453
  if (
1306
- (el === null || el.id !== state.targetUid.value)
1307
- && targetRef.value !== null
1308
- && targetRef.value !== el
1454
+ (el === null || el.id !== state.targetUid.value) &&
1455
+ targetRef.value !== null &&
1456
+ targetRef.value !== el
1309
1457
  ) {
1310
1458
  targetRef.value.focus()
1311
1459
  }
@@ -1313,7 +1461,7 @@ export default createComponent({
1313
1461
  setVirtualScrollSize()
1314
1462
  }
1315
1463
 
1316
- function closeMenu () {
1464
+ function closeMenu() {
1317
1465
  if (dialog.value === true) return
1318
1466
 
1319
1467
  optionIndex.value = -1
@@ -1336,7 +1484,7 @@ export default createComponent({
1336
1484
  }
1337
1485
  }
1338
1486
 
1339
- function showPopup (e) {
1487
+ function showPopup(e) {
1340
1488
  if (state.editable.value !== true) return
1341
1489
 
1342
1490
  if (hasDialog === true) {
@@ -1345,50 +1493,54 @@ export default createComponent({
1345
1493
  nextTick(() => {
1346
1494
  state.focus()
1347
1495
  })
1348
- }
1349
- else {
1496
+ } else {
1350
1497
  state.focus()
1351
1498
  }
1352
1499
 
1353
1500
  if (props.onFilter !== void 0) {
1354
1501
  filter(inputValue.value)
1355
- }
1356
- else if (noOptions.value !== true || slots[ 'no-option' ] !== void 0) {
1502
+ } else if (noOptions.value !== true || slots['no-option'] !== void 0) {
1357
1503
  menu.value = true
1358
1504
  }
1359
1505
  }
1360
1506
 
1361
- function hidePopup () {
1507
+ function hidePopup() {
1362
1508
  dialog.value = false
1363
1509
  closeMenu()
1364
1510
  }
1365
1511
 
1366
- function resetInputValue () {
1367
- props.useInput === true && updateInputValue(
1368
- props.multiple !== true && props.fillInput === true && innerValue.value.length !== 0
1369
- ? getOptionLabel.value(innerValue.value[ 0 ]) || ''
1370
- : '',
1371
- true,
1372
- true
1373
- )
1512
+ function resetInputValue() {
1513
+ if (props.useInput === true) {
1514
+ updateInputValue(
1515
+ props.multiple !== true &&
1516
+ props.fillInput === true &&
1517
+ innerValue.value.length !== 0
1518
+ ? getOptionLabel.value(innerValue.value[0]) || ''
1519
+ : '',
1520
+ true,
1521
+ true
1522
+ )
1523
+ }
1374
1524
  }
1375
1525
 
1376
- function updateMenu (show) {
1377
- let optionIndex = -1
1526
+ function updateMenu(show) {
1527
+ let localOptionIndex = -1
1378
1528
 
1379
1529
  if (show === true) {
1380
1530
  if (innerValue.value.length !== 0) {
1381
- const val = getOptionValue.value(innerValue.value[ 0 ])
1382
- optionIndex = props.options.findIndex(v => isDeepEqual(getOptionValue.value(v), val))
1531
+ const val = getOptionValue.value(innerValue.value[0])
1532
+ localOptionIndex = props.options.findIndex(v =>
1533
+ isDeepEqual(getOptionValue.value(v), val)
1534
+ )
1383
1535
  }
1384
1536
 
1385
- localResetVirtualScroll(optionIndex)
1537
+ localResetVirtualScroll(localOptionIndex)
1386
1538
  }
1387
1539
 
1388
- setOptionIndex(optionIndex)
1540
+ setOptionIndex(localOptionIndex)
1389
1541
  }
1390
1542
 
1391
- function rerenderMenu (newLength, oldLength) {
1543
+ function rerenderMenu(newLength, oldLength) {
1392
1544
  if (menu.value === true && state.innerLoading.value === false) {
1393
1545
  localResetVirtualScroll(-1, true)
1394
1546
 
@@ -1396,8 +1548,7 @@ export default createComponent({
1396
1548
  if (menu.value === true && state.innerLoading.value === false) {
1397
1549
  if (newLength > oldLength) {
1398
1550
  localResetVirtualScroll()
1399
- }
1400
- else {
1551
+ } else {
1401
1552
  updateMenu(true)
1402
1553
  }
1403
1554
  }
@@ -1405,38 +1556,43 @@ export default createComponent({
1405
1556
  }
1406
1557
  }
1407
1558
 
1408
- function updateMenuPosition () {
1559
+ function updateMenuPosition() {
1409
1560
  if (dialog.value === false && menuRef.value !== null) {
1410
1561
  menuRef.value.updatePosition()
1411
1562
  }
1412
1563
  }
1413
1564
 
1414
- function onControlPopupShow (e) {
1415
- e !== void 0 && stop(e)
1565
+ function onControlPopupShow(e) {
1566
+ if (e !== void 0) stop(e)
1416
1567
  emit('popupShow', e)
1417
1568
  state.hasPopupOpen = true
1418
1569
  state.onControlFocusin(e)
1419
1570
  }
1420
1571
 
1421
- function onControlPopupHide (e) {
1422
- e !== void 0 && stop(e)
1572
+ function onControlPopupHide(e) {
1573
+ if (e !== void 0) stop(e)
1423
1574
  emit('popupHide', e)
1424
1575
  state.hasPopupOpen = false
1425
1576
  state.onControlFocusout(e)
1426
1577
  }
1427
1578
 
1428
- function updatePreState () {
1429
- hasDialog = $q.platform.is.mobile !== true && props.behavior !== 'dialog'
1430
- ? false
1431
- : props.behavior !== 'menu' && (
1432
- props.useInput === true
1433
- ? slots[ 'no-option' ] !== void 0 || props.onFilter !== void 0 || noOptions.value === false
1434
- : true
1435
- )
1436
-
1437
- transitionShowComputed = $q.platform.is.ios === true && hasDialog === true && props.useInput === true
1438
- ? 'fade'
1439
- : props.transitionShow
1579
+ function updatePreState() {
1580
+ hasDialog =
1581
+ $q.platform.is.mobile !== true && props.behavior !== 'dialog'
1582
+ ? false
1583
+ : props.behavior !== 'menu' &&
1584
+ (props.useInput === true
1585
+ ? slots['no-option'] !== void 0 ||
1586
+ props.onFilter !== void 0 ||
1587
+ noOptions.value === false
1588
+ : true)
1589
+
1590
+ transitionShowComputed =
1591
+ $q.platform.is.ios === true &&
1592
+ hasDialog === true &&
1593
+ props.useInput === true
1594
+ ? 'fade'
1595
+ : props.transitionShow
1440
1596
  }
1441
1597
 
1442
1598
  onBeforeUpdate(updatePreState)
@@ -1445,20 +1601,27 @@ export default createComponent({
1445
1601
  updatePreState()
1446
1602
 
1447
1603
  onBeforeUnmount(() => {
1448
- filterTimer !== null && clearTimeout(filterTimer)
1449
- inputValueTimer !== null && clearTimeout(inputValueTimer)
1604
+ if (filterTimer !== null) clearTimeout(filterTimer)
1605
+ if (inputValueTimer !== null) clearTimeout(inputValueTimer)
1450
1606
  })
1451
1607
 
1452
1608
  // expose public methods
1453
1609
  Object.assign(proxy, {
1454
- showPopup, hidePopup,
1455
- removeAtIndex, add, toggleOption,
1610
+ showPopup,
1611
+ hidePopup,
1612
+ removeAtIndex,
1613
+ add,
1614
+ toggleOption,
1456
1615
  getOptionIndex: () => optionIndex.value,
1457
- setOptionIndex, moveOptionSelection,
1458
- filter, updateMenuPosition, updateInputValue,
1616
+ setOptionIndex,
1617
+ moveOptionSelection,
1618
+ filter,
1619
+ updateMenuPosition,
1620
+ updateInputValue,
1459
1621
  isOptionSelected,
1460
1622
  getEmittingOptionValue,
1461
- isOptionDisabled: (...args) => isOptionDisabled.value.apply(null, args) === true,
1623
+ isOptionDisabled: (...args) =>
1624
+ isOptionDisabled.value.apply(null, args) === true,
1462
1625
  getOptionValue: (...args) => getOptionValue.value.apply(null, args),
1463
1626
  getOptionLabel: (...args) => getOptionLabel.value.apply(null, args)
1464
1627
  })
@@ -1466,10 +1629,11 @@ export default createComponent({
1466
1629
  Object.assign(state, {
1467
1630
  innerValue,
1468
1631
 
1469
- fieldClass: computed(() =>
1470
- `q-select q-field--auto-height q-select--with${ props.useInput !== true ? 'out' : '' }-input`
1471
- + ` q-select--with${ props.useChips !== true ? 'out' : '' }-chips`
1472
- + ` q-select--${ props.multiple === true ? 'multiple' : 'single' }`
1632
+ fieldClass: computed(
1633
+ () =>
1634
+ `q-select q-field--auto-height q-select--with${props.useInput !== true ? 'out' : ''}-input` +
1635
+ ` q-select--with${props.useChips !== true ? 'out' : ''}-chips` +
1636
+ ` q-select--${props.multiple === true ? 'multiple' : 'single'}`
1473
1637
  ),
1474
1638
 
1475
1639
  inputRef,
@@ -1477,38 +1641,39 @@ export default createComponent({
1477
1641
  hasValue,
1478
1642
  showPopup,
1479
1643
 
1480
- floatingLabel: computed(() =>
1481
- (props.hideSelected !== true && hasValue.value === true)
1482
- || typeof inputValue.value === 'number'
1483
- || inputValue.value.length !== 0
1484
- || fieldValueIsFilled(props.displayValue)
1644
+ floatingLabel: computed(
1645
+ () =>
1646
+ (props.hideSelected !== true && hasValue.value === true) ||
1647
+ typeof inputValue.value === 'number' ||
1648
+ inputValue.value.length !== 0 ||
1649
+ fieldValueIsFilled(props.displayValue)
1485
1650
  ),
1486
1651
 
1487
1652
  getControlChild: () => {
1488
1653
  if (
1489
- state.editable.value !== false && (
1490
- dialog.value === true // dialog always has menu displayed, so need to render it
1491
- || noOptions.value !== true
1492
- || slots[ 'no-option' ] !== void 0
1493
- )
1654
+ state.editable.value !== false &&
1655
+ (dialog.value === true || // dialog always has menu displayed, so need to render it
1656
+ noOptions.value !== true ||
1657
+ slots['no-option'] !== void 0)
1494
1658
  ) {
1495
1659
  return hasDialog === true ? getDialog() : getMenu()
1496
- }
1497
- else if (state.hasPopupOpen === true) {
1660
+ } else if (state.hasPopupOpen === true) {
1498
1661
  // explicitly set it otherwise TAB will not blur component
1499
1662
  state.hasPopupOpen = false
1500
1663
  }
1501
1664
  },
1502
1665
 
1503
1666
  controlEvents: {
1504
- onFocusin (e) { state.onControlFocusin(e) },
1505
- onFocusout (e) {
1667
+ onFocusin(e) {
1668
+ state.onControlFocusin(e)
1669
+ },
1670
+ onFocusout(e) {
1506
1671
  state.onControlFocusout(e, () => {
1507
1672
  resetInputValue()
1508
1673
  closeMenu()
1509
1674
  })
1510
1675
  },
1511
- onClick (e) {
1676
+ onClick(e) {
1512
1677
  // label from QField will propagate click on the input
1513
1678
  prevent(e)
1514
1679
 
@@ -1524,7 +1689,8 @@ export default createComponent({
1524
1689
 
1525
1690
  getControl: fromDialog => {
1526
1691
  const child = getSelection()
1527
- const isTarget = fromDialog === true || dialog.value !== true || hasDialog !== true
1692
+ const isTarget =
1693
+ fromDialog === true || dialog.value !== true || hasDialog !== true
1528
1694
 
1529
1695
  if (props.useInput === true) {
1530
1696
  child.push(getInput(fromDialog, isTarget))
@@ -1541,7 +1707,8 @@ export default createComponent({
1541
1707
  id: isTarget === true ? state.targetUid.value : void 0,
1542
1708
  value: ariaCurrentValue.value,
1543
1709
  readonly: true,
1544
- 'data-autofocus': fromDialog === true || props.autofocus === true || void 0,
1710
+ 'data-autofocus':
1711
+ fromDialog === true || props.autofocus === true || void 0,
1545
1712
  ...attrs,
1546
1713
  onKeydown: onTargetKeydown,
1547
1714
  onKeyup: onTargetKeyup,
@@ -1549,7 +1716,11 @@ export default createComponent({
1549
1716
  })
1550
1717
  )
1551
1718
 
1552
- if (isTarget === true && typeof props.autocomplete === 'string' && props.autocomplete.length !== 0) {
1719
+ if (
1720
+ isTarget === true &&
1721
+ typeof props.autocomplete === 'string' &&
1722
+ props.autocomplete.length !== 0
1723
+ ) {
1553
1724
  child.push(
1554
1725
  h('input', {
1555
1726
  class: 'q-select__autocomplete-input',
@@ -1561,37 +1732,57 @@ export default createComponent({
1561
1732
  }
1562
1733
  }
1563
1734
 
1564
- if (nameProp.value !== void 0 && props.disable !== true && innerOptionsValue.value.length !== 0) {
1565
- const opts = innerOptionsValue.value.map(value => h('option', { value, selected: true }))
1735
+ if (
1736
+ nameProp.value !== void 0 &&
1737
+ props.disable !== true &&
1738
+ innerOptionsValue.value.length !== 0
1739
+ ) {
1740
+ const opts = innerOptionsValue.value.map(value =>
1741
+ h('option', { value, selected: true })
1742
+ )
1566
1743
 
1567
1744
  child.push(
1568
- h('select', {
1569
- class: 'hidden',
1570
- name: nameProp.value,
1571
- multiple: props.multiple
1572
- }, opts)
1745
+ h(
1746
+ 'select',
1747
+ {
1748
+ class: 'hidden',
1749
+ name: nameProp.value,
1750
+ multiple: props.multiple
1751
+ },
1752
+ opts
1753
+ )
1573
1754
  )
1574
1755
  }
1575
1756
 
1576
- const attrs = props.useInput === true || isTarget !== true ? void 0 : state.splitAttrs.attributes.value
1577
-
1578
- return h('div', {
1579
- class: 'q-field__native row items-center',
1580
- ...attrs,
1581
- ...state.splitAttrs.listeners.value
1582
- }, child)
1757
+ const attrs =
1758
+ props.useInput === true || isTarget !== true
1759
+ ? void 0
1760
+ : state.splitAttrs.attributes.value
1761
+
1762
+ return h(
1763
+ 'div',
1764
+ {
1765
+ class: 'q-field__native row items-center',
1766
+ ...attrs,
1767
+ ...state.splitAttrs.listeners.value
1768
+ },
1769
+ child
1770
+ )
1583
1771
  },
1584
1772
 
1585
- getInnerAppend: () => (
1586
- props.loading !== true && innerLoadingIndicator.value !== true && props.hideDropdownIcon !== true
1773
+ getInnerAppend: () =>
1774
+ props.loading !== true &&
1775
+ innerLoadingIndicator.value !== true &&
1776
+ props.hideDropdownIcon !== true
1587
1777
  ? [
1588
1778
  h(QIcon, {
1589
- class: 'q-select__dropdown-icon' + (menu.value === true ? ' rotate-180' : ''),
1779
+ class:
1780
+ 'q-select__dropdown-icon' +
1781
+ (menu.value === true ? ' rotate-180' : ''),
1590
1782
  name: dropdownArrowIcon.value
1591
1783
  })
1592
1784
  ]
1593
1785
  : null
1594
- )
1595
1786
  })
1596
1787
 
1597
1788
  return useField(state)