quasar 2.18.7 → 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 (857) 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 -29220
  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 -29791
  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 +126 -414
  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/web-types/web-types.json +1 -1
  185. package/icon-set/bootstrap-icons.js +1 -4
  186. package/icon-set/svg-bootstrap-icons.js +1 -4
  187. package/icon-set/svg-fontawesome-v5.js +0 -1
  188. package/icon-set/svg-ionicons-v5.js +2 -2
  189. package/lang/ar-TN.js +10 -8
  190. package/lang/ar.js +10 -8
  191. package/lang/az-Latn.js +13 -9
  192. package/lang/bg.js +10 -8
  193. package/lang/bn.js +14 -9
  194. package/lang/bs-BA.js +13 -9
  195. package/lang/ca.js +18 -14
  196. package/lang/cs.js +9 -7
  197. package/lang/da.js +10 -8
  198. package/lang/de-CH.js +13 -9
  199. package/lang/de-DE.js +13 -9
  200. package/lang/de.js +13 -9
  201. package/lang/el.js +10 -8
  202. package/lang/en-GB.js +10 -8
  203. package/lang/en-US.js +10 -8
  204. package/lang/eo.js +14 -9
  205. package/lang/es.js +10 -8
  206. package/lang/et.js +15 -12
  207. package/lang/eu.js +15 -12
  208. package/lang/fa-IR.js +16 -8
  209. package/lang/fa.js +16 -8
  210. package/lang/fi.js +17 -8
  211. package/lang/fr.js +21 -13
  212. package/lang/gn.js +14 -12
  213. package/lang/he.js +15 -10
  214. package/lang/hi.js +8 -8
  215. package/lang/hr.js +13 -9
  216. package/lang/hu.js +10 -8
  217. package/lang/id.js +11 -9
  218. package/lang/is.js +13 -9
  219. package/lang/it.js +14 -9
  220. package/lang/ja.js +13 -8
  221. package/lang/kk.js +22 -11
  222. package/lang/km.js +9 -8
  223. package/lang/ko-KR.js +9 -10
  224. package/lang/kur-CKB.js +16 -17
  225. package/lang/lt.js +26 -19
  226. package/lang/lu.js +13 -9
  227. package/lang/lv.js +13 -9
  228. package/lang/mk.js +10 -8
  229. package/lang/ml.js +15 -14
  230. package/lang/mm.js +16 -13
  231. package/lang/ms-MY.js +16 -11
  232. package/lang/ms.js +10 -8
  233. package/lang/my.js +15 -8
  234. package/lang/nb-NO.js +10 -8
  235. package/lang/nl.js +13 -9
  236. package/lang/pl.js +13 -9
  237. package/lang/pt-BR.js +17 -10
  238. package/lang/pt.js +17 -10
  239. package/lang/ro.js +10 -8
  240. package/lang/ru.js +25 -12
  241. package/lang/sk.js +18 -9
  242. package/lang/sl.js +12 -8
  243. package/lang/sm.js +51 -47
  244. package/lang/sq.js +13 -9
  245. package/lang/sr-CYR.js +10 -8
  246. package/lang/sr.js +10 -8
  247. package/lang/sv.js +10 -8
  248. package/lang/ta.js +10 -8
  249. package/lang/th.js +12 -11
  250. package/lang/tl.js +10 -8
  251. package/lang/tr.js +8 -5
  252. package/lang/ug.js +16 -8
  253. package/lang/uk.js +22 -11
  254. package/lang/ur-PK.js +13 -11
  255. package/lang/uz-Cyrl.js +5 -5
  256. package/lang/uz-Latn.js +24 -24
  257. package/lang/vi.js +13 -9
  258. package/lang/zh-CN.js +18 -9
  259. package/lang/zh-TW.js +20 -10
  260. package/package.json +50 -64
  261. package/src/api.extends.json +15 -12
  262. package/src/components/ajax-bar/QAjaxBar.js +91 -65
  263. package/src/components/ajax-bar/QAjaxBar.json +2 -2
  264. package/src/components/ajax-bar/index.js +1 -3
  265. package/src/components/avatar/QAvatar.js +36 -28
  266. package/src/components/avatar/QAvatar.json +2 -2
  267. package/src/components/avatar/QAvatar.test.js +29 -78
  268. package/src/components/avatar/index.js +1 -3
  269. package/src/components/badge/QBadge.js +33 -26
  270. package/src/components/badge/QBadge.json +3 -3
  271. package/src/components/badge/QBadge.test.js +40 -95
  272. package/src/components/badge/index.js +1 -3
  273. package/src/components/banner/QBanner.js +46 -25
  274. package/src/components/banner/QBanner.test.js +14 -35
  275. package/src/components/banner/index.js +1 -3
  276. package/src/components/bar/QBar.js +21 -11
  277. package/src/components/bar/QBar.test.js +6 -17
  278. package/src/components/bar/index.js +1 -3
  279. package/src/components/breadcrumbs/QBreadcrumbs.js +44 -32
  280. package/src/components/breadcrumbs/QBreadcrumbs.json +10 -3
  281. package/src/components/breadcrumbs/QBreadcrumbs.test.js +56 -69
  282. package/src/components/breadcrumbs/QBreadcrumbsEl.js +28 -22
  283. package/src/components/breadcrumbs/QBreadcrumbsEl.json +5 -8
  284. package/src/components/breadcrumbs/QBreadcrumbsEl.test.js +60 -134
  285. package/src/components/breadcrumbs/index.js +1 -4
  286. package/src/components/btn/QBtn.js +159 -103
  287. package/src/components/btn/QBtn.json +3 -6
  288. package/src/components/btn/QBtn.test.js +269 -496
  289. package/src/components/btn/index.js +1 -3
  290. package/src/components/btn/use-btn.js +82 -70
  291. package/src/components/btn/use-btn.json +33 -16
  292. package/src/components/btn/use-btn.test.js +30 -47
  293. package/src/components/btn-dropdown/QBtnDropdown.js +143 -104
  294. package/src/components/btn-dropdown/QBtnDropdown.json +41 -16
  295. package/src/components/btn-dropdown/index.js +1 -3
  296. package/src/components/btn-group/QBtnGroup.js +18 -6
  297. package/src/components/btn-group/index.js +1 -3
  298. package/src/components/btn-toggle/QBtnToggle.js +80 -61
  299. package/src/components/btn-toggle/QBtnToggle.json +16 -9
  300. package/src/components/btn-toggle/index.js +1 -3
  301. package/src/components/card/QCard.js +14 -9
  302. package/src/components/card/QCard.json +1 -1
  303. package/src/components/card/QCardActions.js +8 -5
  304. package/src/components/card/QCardActions.json +9 -1
  305. package/src/components/card/QCardSection.js +5 -4
  306. package/src/components/card/QCardSection.json +1 -1
  307. package/src/components/card/index.js +1 -5
  308. package/src/components/carousel/QCarousel.js +194 -125
  309. package/src/components/carousel/QCarousel.json +10 -11
  310. package/src/components/carousel/QCarouselControl.js +26 -13
  311. package/src/components/carousel/QCarouselControl.json +10 -5
  312. package/src/components/carousel/QCarouselSlide.js +13 -10
  313. package/src/components/carousel/QCarouselSlide.json +1 -1
  314. package/src/components/carousel/index.js +1 -5
  315. package/src/components/chat/QChatMessage.js +62 -57
  316. package/src/components/chat/QChatMessage.json +8 -5
  317. package/src/components/chat/index.js +1 -3
  318. package/src/components/checkbox/QCheckbox.js +56 -41
  319. package/src/components/checkbox/QCheckbox.json +1 -1
  320. package/src/components/checkbox/index.js +1 -3
  321. package/src/components/checkbox/use-checkbox.js +112 -83
  322. package/src/components/checkbox/use-checkbox.json +15 -12
  323. package/src/components/chip/QChip.js +101 -73
  324. package/src/components/chip/QChip.json +6 -6
  325. package/src/components/chip/QChip.test.js +72 -180
  326. package/src/components/chip/index.js +1 -3
  327. package/src/components/circular-progress/QCircularProgress.js +92 -57
  328. package/src/components/circular-progress/QCircularProgress.json +2 -2
  329. package/src/components/circular-progress/index.js +1 -3
  330. package/src/components/color/QColor.js +550 -367
  331. package/src/components/color/QColor.json +8 -8
  332. package/src/components/color/index.js +1 -3
  333. package/src/components/date/QDate.js +902 -607
  334. package/src/components/date/QDate.json +32 -23
  335. package/src/components/date/index.js +1 -3
  336. package/src/components/date/use-datetime.js +12 -14
  337. package/src/components/date/use-datetime.json +7 -7
  338. package/src/components/dialog/QDialog.js +178 -139
  339. package/src/components/dialog/QDialog.json +8 -4
  340. package/src/components/dialog/QDialog.test.js +123 -228
  341. package/src/components/dialog/index.js +1 -3
  342. package/src/components/drawer/QDrawer.js +306 -242
  343. package/src/components/drawer/QDrawer.json +4 -4
  344. package/src/components/drawer/index.js +1 -3
  345. package/src/components/editor/QEditor.js +409 -190
  346. package/src/components/editor/QEditor.json +33 -32
  347. package/src/components/editor/editor-caret.js +78 -83
  348. package/src/components/editor/editor-utils.js +176 -130
  349. package/src/components/editor/index.js +1 -3
  350. package/src/components/expansion-item/QExpansionItem.js +149 -103
  351. package/src/components/expansion-item/QExpansionItem.json +21 -24
  352. package/src/components/expansion-item/index.js +1 -3
  353. package/src/components/fab/QFab.js +86 -54
  354. package/src/components/fab/QFab.json +6 -3
  355. package/src/components/fab/QFabAction.js +34 -29
  356. package/src/components/fab/QFabAction.json +4 -7
  357. package/src/components/fab/index.js +1 -4
  358. package/src/components/fab/use-fab.js +20 -20
  359. package/src/components/fab/use-fab.json +10 -13
  360. package/src/components/field/QField.js +7 -5
  361. package/src/components/field/QField.json +6 -6
  362. package/src/components/field/QField.sass +5 -6
  363. package/src/components/field/index.js +1 -3
  364. package/src/components/file/QFile.js +95 -74
  365. package/src/components/file/QFile.json +17 -14
  366. package/src/components/file/index.js +1 -3
  367. package/src/components/footer/QFooter.js +110 -67
  368. package/src/components/footer/QFooter.json +2 -2
  369. package/src/components/footer/index.js +1 -3
  370. package/src/components/form/QForm.js +93 -58
  371. package/src/components/form/QForm.json +2 -2
  372. package/src/components/form/QFormChildMixin.js +10 -11
  373. package/src/components/form/QFormChildMixin.json +2 -2
  374. package/src/components/form/index.js +1 -4
  375. package/src/components/header/QHeader.js +93 -56
  376. package/src/components/header/QHeader.json +2 -2
  377. package/src/components/header/index.js +1 -3
  378. package/src/components/icon/QIcon.js +70 -57
  379. package/src/components/icon/QIcon.json +2 -2
  380. package/src/components/icon/index.js +1 -3
  381. package/src/components/img/QImg.js +104 -98
  382. package/src/components/img/QImg.json +20 -18
  383. package/src/components/img/index.js +1 -3
  384. package/src/components/infinite-scroll/QInfiniteScroll.js +123 -64
  385. package/src/components/infinite-scroll/QInfiniteScroll.json +1 -1
  386. package/src/components/infinite-scroll/index.js +1 -3
  387. package/src/components/inner-loading/QInnerLoading.js +31 -23
  388. package/src/components/inner-loading/QInnerLoading.json +9 -9
  389. package/src/components/inner-loading/index.js +1 -3
  390. package/src/components/input/QInput.js +179 -137
  391. package/src/components/input/QInput.json +25 -15
  392. package/src/components/input/index.js +1 -3
  393. package/src/components/input/use-mask.js +328 -243
  394. package/src/components/input/use-mask.json +16 -8
  395. package/src/components/intersection/QIntersection.js +45 -28
  396. package/src/components/intersection/QIntersection.json +7 -10
  397. package/src/components/intersection/index.js +1 -3
  398. package/src/components/item/QItem.js +60 -52
  399. package/src/components/item/QItem.json +6 -9
  400. package/src/components/item/QItemLabel.js +23 -15
  401. package/src/components/item/QItemLabel.json +1 -1
  402. package/src/components/item/QItemSection.js +11 -8
  403. package/src/components/item/QList.js +21 -13
  404. package/src/components/item/QList.json +1 -1
  405. package/src/components/item/QList.test.js +7 -11
  406. package/src/components/item/index.js +1 -7
  407. package/src/components/knob/QKnob.js +86 -76
  408. package/src/components/knob/QKnob.json +6 -3
  409. package/src/components/knob/index.js +1 -3
  410. package/src/components/layout/QLayout.js +98 -69
  411. package/src/components/layout/QLayout.json +2 -2
  412. package/src/components/layout/index.js +1 -3
  413. package/src/components/linear-progress/QLinearProgress.js +78 -47
  414. package/src/components/linear-progress/QLinearProgress.json +3 -3
  415. package/src/components/linear-progress/index.js +1 -3
  416. package/src/components/markup-table/QMarkupTable.js +25 -17
  417. package/src/components/markup-table/QMarkupTable.json +2 -2
  418. package/src/components/markup-table/index.js +1 -3
  419. package/src/components/menu/QMenu.js +144 -100
  420. package/src/components/menu/QMenu.json +39 -10
  421. package/src/components/menu/index.js +1 -3
  422. package/src/components/no-ssr/QNoSsr.js +5 -5
  423. package/src/components/no-ssr/QNoSsr.json +2 -2
  424. package/src/components/no-ssr/index.js +1 -3
  425. package/src/components/option-group/QOptionGroup.js +84 -66
  426. package/src/components/option-group/QOptionGroup.json +35 -21
  427. package/src/components/option-group/index.js +1 -3
  428. package/src/components/page/QPage.js +35 -22
  429. package/src/components/page/QPage.json +1 -1
  430. package/src/components/page/QPageContainer.js +24 -11
  431. package/src/components/page/index.js +1 -4
  432. package/src/components/page-scroller/QPageScroller.js +49 -32
  433. package/src/components/page-scroller/QPageScroller.json +2 -2
  434. package/src/components/page-scroller/index.js +1 -3
  435. package/src/components/page-sticky/QPageSticky.js +1 -1
  436. package/src/components/page-sticky/QPageSticky.json +9 -4
  437. package/src/components/page-sticky/index.js +1 -3
  438. package/src/components/page-sticky/use-page-sticky.js +47 -36
  439. package/src/components/pagination/QPagination.js +210 -146
  440. package/src/components/pagination/QPagination.json +35 -21
  441. package/src/components/pagination/index.js +1 -3
  442. package/src/components/parallax/QParallax.js +81 -56
  443. package/src/components/parallax/index.js +1 -3
  444. package/src/components/popup-edit/QPopupEdit.js +88 -59
  445. package/src/components/popup-edit/QPopupEdit.json +40 -16
  446. package/src/components/popup-edit/index.js +1 -3
  447. package/src/components/popup-proxy/QPopupProxy.js +30 -19
  448. package/src/components/popup-proxy/QPopupProxy.json +3 -3
  449. package/src/components/popup-proxy/index.js +1 -3
  450. package/src/components/pull-to-refresh/QPullToRefresh.js +71 -49
  451. package/src/components/pull-to-refresh/index.js +1 -3
  452. package/src/components/radio/QRadio.js +133 -95
  453. package/src/components/radio/QRadio.json +11 -8
  454. package/src/components/radio/index.js +1 -3
  455. package/src/components/range/QRange.js +151 -104
  456. package/src/components/range/QRange.json +9 -9
  457. package/src/components/range/index.js +1 -3
  458. package/src/components/rating/QRating.js +171 -112
  459. package/src/components/rating/QRating.json +19 -12
  460. package/src/components/rating/index.js +1 -3
  461. package/src/components/resize-observer/QResizeObserver.js +52 -30
  462. package/src/components/resize-observer/QResizeObserver.json +2 -2
  463. package/src/components/resize-observer/index.js +1 -3
  464. package/src/components/responsive/QResponsive.js +27 -14
  465. package/src/components/responsive/QResponsive.json +1 -1
  466. package/src/components/responsive/index.js +1 -3
  467. package/src/components/scroll-area/QScrollArea.js +279 -192
  468. package/src/components/scroll-area/QScrollArea.json +31 -21
  469. package/src/components/scroll-area/ScrollAreaControls.js +6 -11
  470. package/src/components/scroll-area/index.js +1 -3
  471. package/src/components/scroll-observer/QScrollObserver.js +46 -26
  472. package/src/components/scroll-observer/QScrollObserver.json +4 -4
  473. package/src/components/scroll-observer/index.js +1 -3
  474. package/src/components/select/QSelect.js +710 -519
  475. package/src/components/select/QSelect.json +70 -45
  476. package/src/components/select/index.js +1 -3
  477. package/src/components/separator/QSeparator.js +34 -30
  478. package/src/components/separator/QSeparator.json +4 -4
  479. package/src/components/separator/index.js +1 -3
  480. package/src/components/skeleton/QSkeleton.js +49 -23
  481. package/src/components/skeleton/QSkeleton.json +26 -9
  482. package/src/components/skeleton/index.js +1 -3
  483. package/src/components/slide-item/QSlideItem.js +121 -94
  484. package/src/components/slide-item/QSlideItem.json +2 -2
  485. package/src/components/slide-item/index.js +1 -3
  486. package/src/components/slide-transition/QSlideTransition.js +34 -26
  487. package/src/components/slide-transition/index.js +1 -3
  488. package/src/components/slider/QSlider.js +64 -43
  489. package/src/components/slider/QSlider.json +6 -6
  490. package/src/components/slider/index.js +1 -3
  491. package/src/components/slider/use-slider.js +327 -220
  492. package/src/components/slider/use-slider.json +32 -32
  493. package/src/components/space/QSpace.js +1 -1
  494. package/src/components/space/QSpace.test.js +1 -4
  495. package/src/components/space/index.js +1 -3
  496. package/src/components/spinner/QSpinner.js +23 -18
  497. package/src/components/spinner/QSpinner.json +1 -1
  498. package/src/components/spinner/QSpinner.test.js +11 -27
  499. package/src/components/spinner/QSpinnerAudio.js +13 -11
  500. package/src/components/spinner/QSpinnerAudio.json +1 -1
  501. package/src/components/spinner/QSpinnerAudio.test.js +9 -21
  502. package/src/components/spinner/QSpinnerBall.js +13 -11
  503. package/src/components/spinner/QSpinnerBall.json +1 -1
  504. package/src/components/spinner/QSpinnerBall.test.js +9 -21
  505. package/src/components/spinner/QSpinnerBars.js +13 -11
  506. package/src/components/spinner/QSpinnerBars.json +1 -1
  507. package/src/components/spinner/QSpinnerBars.test.js +9 -21
  508. package/src/components/spinner/QSpinnerBox.js +13 -11
  509. package/src/components/spinner/QSpinnerBox.json +1 -1
  510. package/src/components/spinner/QSpinnerBox.test.js +9 -21
  511. package/src/components/spinner/QSpinnerClock.js +13 -11
  512. package/src/components/spinner/QSpinnerClock.json +1 -1
  513. package/src/components/spinner/QSpinnerClock.test.js +9 -21
  514. package/src/components/spinner/QSpinnerComment.js +13 -11
  515. package/src/components/spinner/QSpinnerComment.json +1 -1
  516. package/src/components/spinner/QSpinnerComment.test.js +9 -21
  517. package/src/components/spinner/QSpinnerCube.js +13 -11
  518. package/src/components/spinner/QSpinnerCube.json +1 -1
  519. package/src/components/spinner/QSpinnerCube.test.js +9 -21
  520. package/src/components/spinner/QSpinnerDots.js +13 -11
  521. package/src/components/spinner/QSpinnerDots.json +1 -1
  522. package/src/components/spinner/QSpinnerDots.test.js +9 -21
  523. package/src/components/spinner/QSpinnerFacebook.js +13 -11
  524. package/src/components/spinner/QSpinnerFacebook.json +1 -1
  525. package/src/components/spinner/QSpinnerFacebook.test.js +9 -21
  526. package/src/components/spinner/QSpinnerGears.js +13 -11
  527. package/src/components/spinner/QSpinnerGears.json +1 -1
  528. package/src/components/spinner/QSpinnerGears.test.js +9 -21
  529. package/src/components/spinner/QSpinnerGrid.js +13 -11
  530. package/src/components/spinner/QSpinnerGrid.json +1 -1
  531. package/src/components/spinner/QSpinnerGrid.test.js +9 -21
  532. package/src/components/spinner/QSpinnerHearts.js +13 -11
  533. package/src/components/spinner/QSpinnerHearts.json +1 -1
  534. package/src/components/spinner/QSpinnerHearts.test.js +9 -21
  535. package/src/components/spinner/QSpinnerHourglass.js +13 -11
  536. package/src/components/spinner/QSpinnerHourglass.json +1 -1
  537. package/src/components/spinner/QSpinnerHourglass.test.js +9 -21
  538. package/src/components/spinner/QSpinnerInfinity.js +12 -10
  539. package/src/components/spinner/QSpinnerInfinity.json +1 -1
  540. package/src/components/spinner/QSpinnerInfinity.test.js +9 -21
  541. package/src/components/spinner/QSpinnerIos.js +13 -11
  542. package/src/components/spinner/QSpinnerIos.json +1 -1
  543. package/src/components/spinner/QSpinnerIos.test.js +9 -21
  544. package/src/components/spinner/QSpinnerOrbit.js +13 -11
  545. package/src/components/spinner/QSpinnerOrbit.json +1 -1
  546. package/src/components/spinner/QSpinnerOrbit.test.js +9 -21
  547. package/src/components/spinner/QSpinnerOval.js +13 -11
  548. package/src/components/spinner/QSpinnerOval.json +1 -1
  549. package/src/components/spinner/QSpinnerOval.test.js +9 -21
  550. package/src/components/spinner/QSpinnerPie.js +13 -11
  551. package/src/components/spinner/QSpinnerPie.json +1 -1
  552. package/src/components/spinner/QSpinnerPie.test.js +9 -21
  553. package/src/components/spinner/QSpinnerPuff.js +13 -11
  554. package/src/components/spinner/QSpinnerPuff.json +1 -1
  555. package/src/components/spinner/QSpinnerPuff.test.js +9 -21
  556. package/src/components/spinner/QSpinnerRadio.js +13 -11
  557. package/src/components/spinner/QSpinnerRadio.json +1 -1
  558. package/src/components/spinner/QSpinnerRadio.test.js +9 -21
  559. package/src/components/spinner/QSpinnerRings.js +13 -11
  560. package/src/components/spinner/QSpinnerRings.json +1 -1
  561. package/src/components/spinner/QSpinnerRings.test.js +9 -21
  562. package/src/components/spinner/QSpinnerTail.js +12 -10
  563. package/src/components/spinner/QSpinnerTail.json +1 -1
  564. package/src/components/spinner/QSpinnerTail.test.js +9 -21
  565. package/src/components/spinner/index.js +0 -1
  566. package/src/components/spinner/spinner.json +2 -2
  567. package/src/components/spinner/use-spinner.js +7 -7
  568. package/src/components/spinner/use-spinner.test.js +1 -1
  569. package/src/components/splitter/QSplitter.js +133 -94
  570. package/src/components/splitter/QSplitter.json +10 -19
  571. package/src/components/splitter/index.js +1 -3
  572. package/src/components/stepper/QStep.js +65 -42
  573. package/src/components/stepper/QStep.json +5 -5
  574. package/src/components/stepper/QStepper.js +62 -39
  575. package/src/components/stepper/QStepper.json +2 -2
  576. package/src/components/stepper/QStepperNavigation.js +1 -1
  577. package/src/components/stepper/StepHeader.js +87 -67
  578. package/src/components/stepper/index.js +1 -5
  579. package/src/components/tab-panels/QTabPanel.js +3 -2
  580. package/src/components/tab-panels/QTabPanel.json +1 -1
  581. package/src/components/tab-panels/QTabPanels.js +12 -6
  582. package/src/components/tab-panels/QTabPanels.json +1 -1
  583. package/src/components/tab-panels/index.js +1 -4
  584. package/src/components/table/QTable.js +544 -426
  585. package/src/components/table/QTable.json +168 -165
  586. package/src/components/table/QTd.js +18 -13
  587. package/src/components/table/QTd.json +1 -1
  588. package/src/components/table/QTh.js +25 -20
  589. package/src/components/table/QTh.json +1 -1
  590. package/src/components/table/QTr.js +17 -9
  591. package/src/components/table/QTr.json +1 -1
  592. package/src/components/table/get-table-middle.js +2 -4
  593. package/src/components/table/index.js +1 -6
  594. package/src/components/table/table-column-selection.js +45 -35
  595. package/src/components/table/table-filter.js +9 -8
  596. package/src/components/table/table-pagination.js +75 -52
  597. package/src/components/table/table-row-expand.js +15 -16
  598. package/src/components/table/table-row-selection.js +31 -31
  599. package/src/components/table/table-sort.js +26 -29
  600. package/src/components/tabs/QRouteTab.js +10 -12
  601. package/src/components/tabs/QRouteTab.json +6 -6
  602. package/src/components/tabs/QTab.js +1 -1
  603. package/src/components/tabs/QTab.json +1 -1
  604. package/src/components/tabs/QTabs.js +283 -205
  605. package/src/components/tabs/QTabs.json +9 -9
  606. package/src/components/tabs/index.js +1 -5
  607. package/src/components/tabs/use-tab.js +127 -103
  608. package/src/components/tabs/use-tab.json +8 -8
  609. package/src/components/time/QTime.js +502 -383
  610. package/src/components/time/QTime.json +19 -15
  611. package/src/components/time/index.js +1 -3
  612. package/src/components/timeline/QTimeline.js +10 -7
  613. package/src/components/timeline/QTimeline.json +2 -2
  614. package/src/components/timeline/QTimelineEntry.js +44 -27
  615. package/src/components/timeline/QTimelineEntry.json +7 -5
  616. package/src/components/timeline/index.js +1 -4
  617. package/src/components/toggle/QToggle.js +29 -19
  618. package/src/components/toggle/QToggle.json +1 -1
  619. package/src/components/toggle/index.js +1 -3
  620. package/src/components/toolbar/QToolbar.js +7 -5
  621. package/src/components/toolbar/QToolbar.test.js +2 -6
  622. package/src/components/toolbar/QToolbarTitle.js +5 -4
  623. package/src/components/toolbar/QToolbarTitle.test.js +2 -6
  624. package/src/components/toolbar/index.js +1 -4
  625. package/src/components/tooltip/QTooltip.js +125 -72
  626. package/src/components/tooltip/QTooltip.json +34 -10
  627. package/src/components/tooltip/index.js +1 -3
  628. package/src/components/tree/QTree.js +417 -297
  629. package/src/components/tree/QTree.json +27 -25
  630. package/src/components/tree/index.js +1 -3
  631. package/src/components/uploader/QUploader.json +9 -6
  632. package/src/components/uploader/QUploaderAddTrigger.js +5 -2
  633. package/src/components/uploader/index.js +1 -4
  634. package/src/components/uploader/uploader-core.js +262 -178
  635. package/src/components/uploader/xhr-uploader-plugin.js +96 -89
  636. package/src/components/uploader/xhr-uploader-plugin.json +29 -29
  637. package/src/components/video/QVideo.js +25 -19
  638. package/src/components/video/QVideo.json +5 -5
  639. package/src/components/video/QVideo.test.js +55 -85
  640. package/src/components/video/index.js +1 -3
  641. package/src/components/virtual-scroll/QVirtualScroll.js +89 -37
  642. package/src/components/virtual-scroll/QVirtualScroll.json +6 -6
  643. package/src/components/virtual-scroll/index.js +1 -3
  644. package/src/components/virtual-scroll/use-virtual-scroll.js +421 -240
  645. package/src/components/virtual-scroll/use-virtual-scroll.json +20 -13
  646. package/src/composables/private.use-align/use-align.js +8 -5
  647. package/src/composables/private.use-align/use-align.test.js +9 -17
  648. package/src/composables/private.use-anchor/use-anchor-static.json +2 -7
  649. package/src/composables/private.use-anchor/use-anchor.js +79 -62
  650. package/src/composables/private.use-anchor/use-anchor.json +1 -1
  651. package/src/composables/private.use-dark/use-dark.js +2 -6
  652. package/src/composables/private.use-dark/use-dark.test.js +7 -21
  653. package/src/composables/private.use-field/use-field.js +384 -251
  654. package/src/composables/private.use-field/use-field.json +10 -10
  655. package/src/composables/private.use-file/use-file-dom-props.js +11 -15
  656. package/src/composables/private.use-file/use-file.js +86 -67
  657. package/src/composables/private.use-file/use-file.json +8 -8
  658. package/src/composables/private.use-fullscreen/use-fullscreen.js +35 -17
  659. package/src/composables/private.use-fullscreen/use-fullscreen.json +1 -1
  660. package/src/composables/private.use-history/use-history.js +4 -4
  661. package/src/composables/private.use-history/use-history.test.js +9 -21
  662. package/src/composables/private.use-key-composition/use-key-composition.js +16 -12
  663. package/src/composables/private.use-model-toggle/use-model-toggle.js +44 -35
  664. package/src/composables/private.use-model-toggle/use-model-toggle.json +2 -2
  665. package/src/composables/private.use-panel/use-panel.child.json +1 -1
  666. package/src/composables/private.use-panel/use-panel.js +131 -91
  667. package/src/composables/private.use-panel/use-panel.json +18 -18
  668. package/src/composables/private.use-portal/use-portal.js +20 -15
  669. package/src/composables/private.use-prevent-scroll/use-prevent-scroll.js +4 -4
  670. package/src/composables/private.use-ratio/use-ratio.js +3 -3
  671. package/src/composables/private.use-ratio/use-ratio.json +2 -7
  672. package/src/composables/private.use-refocus-target/use-refocus-target.js +7 -8
  673. package/src/composables/private.use-router-link/use-router-link.js +111 -110
  674. package/src/composables/private.use-router-link/use-router-link.json +6 -9
  675. package/src/composables/private.use-scroll-target/use-scroll-target.js +14 -11
  676. package/src/composables/private.use-size/use-size.js +6 -4
  677. package/src/composables/private.use-size/use-size.json +1 -1
  678. package/src/composables/private.use-size/use-size.test.js +1 -1
  679. package/src/composables/private.use-transition/use-transition.js +17 -11
  680. package/src/composables/private.use-transition/use-transition.json +1 -1
  681. package/src/composables/private.use-transition/use-transition.test.js +7 -21
  682. package/src/composables/private.use-validate/use-validate.js +78 -67
  683. package/src/composables/private.use-validate/use-validate.json +9 -12
  684. package/src/composables/use-dialog-plugin-component/use-dialog-plugin-component.js +12 -6
  685. package/src/composables/use-form/private.use-form.js +4 -4
  686. package/src/composables/use-form/private.use-form.json +1 -1
  687. package/src/composables/use-form/private.use-form.test.js +17 -15
  688. package/src/composables/use-form/use-form-child.js +25 -14
  689. package/src/composables/use-hydration/use-hydration.js +1 -1
  690. package/src/composables/use-hydration/use-hydration.test.js +2 -4
  691. package/src/composables/use-id/use-id.js +10 -12
  692. package/src/composables/use-id/use-id.test.js +1 -1
  693. package/src/composables/use-interval/use-interval.js +3 -3
  694. package/src/composables/use-interval/use-interval.test.js +6 -9
  695. package/src/composables/use-meta/use-meta.js +13 -10
  696. package/src/composables/use-quasar/use-quasar.js +1 -1
  697. package/src/composables/use-quasar/use-quasar.test.js +4 -10
  698. package/src/composables/use-render-cache/use-render-cache.js +16 -24
  699. package/src/composables/use-split-attrs/use-split-attrs.js +9 -5
  700. package/src/composables/use-split-attrs/use-split-attrs.test.js +17 -15
  701. package/src/composables/use-tick/use-tick.js +10 -5
  702. package/src/composables/use-tick/use-tick.test.js +5 -8
  703. package/src/composables/use-timeout/use-timeout.js +3 -3
  704. package/src/composables/use-timeout/use-timeout.test.js +6 -9
  705. package/src/composables.js +0 -1
  706. package/src/css/core/helpers.sass +4 -9
  707. package/src/directives/close-popup/ClosePopup.js +41 -35
  708. package/src/directives/close-popup/ClosePopup.json +1 -1
  709. package/src/directives/intersection/Intersection.js +25 -28
  710. package/src/directives/intersection/Intersection.json +6 -6
  711. package/src/directives/morph/Morph.js +87 -87
  712. package/src/directives/morph/Morph.json +15 -13
  713. package/src/directives/mutation/Mutation.js +23 -24
  714. package/src/directives/mutation/Mutation.json +11 -11
  715. package/src/directives/ripple/Ripple.js +88 -79
  716. package/src/directives/ripple/Ripple.json +10 -10
  717. package/src/directives/ripple/Ripple.test.js +31 -87
  718. package/src/directives/scroll/Scroll.js +43 -30
  719. package/src/directives/scroll/Scroll.json +4 -2
  720. package/src/directives/scroll-fire/ScrollFire.js +43 -38
  721. package/src/directives/scroll-fire/ScrollFire.json +1 -1
  722. package/src/directives/touch-hold/TouchHold.js +155 -139
  723. package/src/directives/touch-hold/TouchHold.json +2 -2
  724. package/src/directives/touch-pan/TouchPan.js +311 -278
  725. package/src/directives/touch-pan/TouchPan.json +6 -4
  726. package/src/directives/touch-repeat/TouchRepeat.js +222 -188
  727. package/src/directives/touch-repeat/TouchRepeat.json +5 -3
  728. package/src/directives/touch-swipe/TouchSwipe.js +235 -214
  729. package/src/directives/touch-swipe/TouchSwipe.json +5 -3
  730. package/src/flags.dev.js +10 -17
  731. package/src/index.dev.js +2 -0
  732. package/src/index.ssr.js +2 -6
  733. package/src/index.umd.js +4 -2
  734. package/src/install-quasar.js +92 -76
  735. package/src/plugins/addressbar/AddressbarColor.js +28 -25
  736. package/src/plugins/addressbar/AddressbarColor.json +1 -1
  737. package/src/plugins/addressbar/AddressbarColor.test.js +10 -9
  738. package/src/plugins/app-fullscreen/AppFullscreen.js +50 -51
  739. package/src/plugins/app-fullscreen/AppFullscreen.json +6 -10
  740. package/src/plugins/app-fullscreen/AppFullscreen.test.js +11 -26
  741. package/src/plugins/app-fullscreen/test/mock-fullscreen.js +7 -5
  742. package/src/plugins/app-visibility/AppVisibility.js +21 -17
  743. package/src/plugins/app-visibility/AppVisibility.test.js +3 -1
  744. package/src/plugins/bottom-sheet/BottomSheet.js +1 -1
  745. package/src/plugins/bottom-sheet/BottomSheet.json +9 -9
  746. package/src/plugins/bottom-sheet/component/BottomSheetComponent.js +132 -95
  747. package/src/plugins/cookies/Cookies.js +50 -58
  748. package/src/plugins/cookies/Cookies.json +24 -16
  749. package/src/plugins/dark/Dark.js +61 -55
  750. package/src/plugins/dark/Dark.json +6 -6
  751. package/src/plugins/dark/Dark.test.js +26 -44
  752. package/src/plugins/dialog/Dialog.js +1 -1
  753. package/src/plugins/dialog/Dialog.json +29 -21
  754. package/src/plugins/dialog/component/DialogPluginComponent.js +122 -121
  755. package/src/plugins/icon-set/IconSet.js +63 -56
  756. package/src/plugins/icon-set/IconSet.json +421 -419
  757. package/src/plugins/icon-set/IconSet.test.js +8 -7
  758. package/src/plugins/lang/Lang.js +115 -96
  759. package/src/plugins/lang/Lang.json +201 -175
  760. package/src/plugins/lang/Lang.test.js +52 -20
  761. package/src/plugins/loading/Loading.js +175 -143
  762. package/src/plugins/loading/Loading.json +15 -15
  763. package/src/plugins/loading-bar/LoadingBar.js +61 -56
  764. package/src/plugins/loading-bar/LoadingBar.json +2 -2
  765. package/src/plugins/meta/Meta.js +91 -81
  766. package/src/plugins/notify/Notify.js +275 -221
  767. package/src/plugins/notify/Notify.json +79 -71
  768. package/src/plugins/platform/Platform.js +105 -112
  769. package/src/plugins/platform/Platform.json +12 -8
  770. package/src/plugins/platform/Platform.test.js +4 -7
  771. package/src/plugins/private.body/Body.js +19 -23
  772. package/src/plugins/private.body/Body.test.js +4 -6
  773. package/src/plugins/private.history/History.js +27 -30
  774. package/src/plugins/screen/Screen.js +160 -147
  775. package/src/plugins/screen/Screen.json +6 -6
  776. package/src/plugins/screen/Screen.test.js +6 -12
  777. package/src/plugins/storage/LocalStorage.js +5 -4
  778. package/src/plugins/storage/LocalStorage.json +1 -1
  779. package/src/plugins/storage/LocalStorage.test.js +56 -62
  780. package/src/plugins/storage/SessionStorage.js +5 -4
  781. package/src/plugins/storage/SessionStorage.json +1 -1
  782. package/src/plugins/storage/SessionStorage.test.js +56 -62
  783. package/src/plugins/storage/engine/web-storage.js +24 -26
  784. package/src/plugins/storage/engine/web-storage.json +45 -15
  785. package/src/utils/EventBus/EventBus.js +12 -13
  786. package/src/utils/clone/clone.js +27 -28
  787. package/src/utils/clone/clone.test.js +27 -52
  788. package/src/utils/colors/colors.js +69 -63
  789. package/src/utils/colors/colors.test.js +360 -270
  790. package/src/utils/copy-to-clipboard/copy-to-clipboard.js +9 -10
  791. package/src/utils/create-meta-mixin/create-meta-mixin.js +17 -19
  792. package/src/utils/create-uploader-component/create-uploader-component.js +20 -14
  793. package/src/utils/css-var/get-css-var.js +4 -2
  794. package/src/utils/css-var/get-css-var.test.js +4 -11
  795. package/src/utils/css-var/set-css-var.js +2 -2
  796. package/src/utils/css-var/set-css-var.test.js +6 -12
  797. package/src/utils/date/date.js +251 -243
  798. package/src/utils/date/private.persian.js +54 -44
  799. package/src/utils/debounce/debounce.js +5 -5
  800. package/src/utils/debounce/debounce.test.js +3 -10
  801. package/src/utils/dom/dom.js +21 -22
  802. package/src/utils/dom/dom.test.js +19 -39
  803. package/src/utils/event/event.js +53 -49
  804. package/src/utils/export-file/export-file.js +11 -12
  805. package/src/utils/extend/extend.js +30 -26
  806. package/src/utils/extend/extend.test.js +36 -42
  807. package/src/utils/format/format.js +11 -13
  808. package/src/utils/format/format.test.js +50 -61
  809. package/src/utils/frame-debounce/frame-debounce.js +5 -3
  810. package/src/utils/frame-debounce/frame-debounce.test.js +3 -10
  811. package/src/utils/is/is.js +27 -23
  812. package/src/utils/is/is.test.js +100 -84
  813. package/src/utils/morph/morph.js +470 -377
  814. package/src/utils/open-url/open-url.js +10 -21
  815. package/src/utils/patterns/patterns.js +11 -7
  816. package/src/utils/patterns/patterns.test.js +2 -0
  817. package/src/utils/private.click-outside/click-outside.js +28 -26
  818. package/src/utils/private.config/instance-config.js +1 -1
  819. package/src/utils/private.config/instance-config.test.js +11 -7
  820. package/src/utils/private.config/nodes.js +14 -14
  821. package/src/utils/private.config/nodes.test.js +32 -38
  822. package/src/utils/private.create/create.js +10 -4
  823. package/src/utils/private.create/create.test.js +11 -7
  824. package/src/utils/private.dialog/create-dialog.js +70 -59
  825. package/src/utils/private.dialog/create-dialog.json +13 -6
  826. package/src/utils/private.focus/focus-manager.js +7 -8
  827. package/src/utils/private.focus/focus-manager.test.js +13 -18
  828. package/src/utils/private.focus/focusout.js +4 -4
  829. package/src/utils/private.focus/focusout.test.js +10 -22
  830. package/src/utils/private.get-emits-object/get-emits-object.js +2 -2
  831. package/src/utils/private.get-emits-object/get-emits-object.test.js +4 -10
  832. package/src/utils/private.inject-obj-prop/inject-obj-prop.js +3 -3
  833. package/src/utils/private.inject-obj-prop/inject-obj-prop.test.js +20 -49
  834. package/src/utils/private.keyboard/escape-key.js +10 -10
  835. package/src/utils/private.keyboard/escape-key.test.js +10 -22
  836. package/src/utils/private.keyboard/key-composition.js +9 -7
  837. package/src/utils/private.portal/portal.js +7 -10
  838. package/src/utils/private.position-engine/position-engine.js +127 -75
  839. package/src/utils/private.render/render.js +9 -24
  840. package/src/utils/private.render/render.test.js +40 -55
  841. package/src/utils/private.rtl/rtl.js +1 -3
  842. package/src/utils/private.selection/selection.js +6 -6
  843. package/src/utils/private.selection/selection.test.js +7 -13
  844. package/src/utils/private.sort/sort.js +4 -6
  845. package/src/utils/private.symbols/symbols.js +1 -1
  846. package/src/utils/private.touch/touch.js +16 -16
  847. package/src/utils/private.touch/touch.test.js +56 -16
  848. package/src/utils/private.vm/vm.js +6 -7
  849. package/src/utils/private.vm/vm.test.js +32 -32
  850. package/src/utils/run-sequential-promises/run-sequential-promises.js +56 -50
  851. package/src/utils/scroll/prevent-scroll.js +75 -47
  852. package/src/utils/scroll/scroll.js +51 -44
  853. package/src/utils/throttle/throttle.js +7 -4
  854. package/src/utils/throttle/throttle.test.js +2 -7
  855. package/src/utils/uid/uid.js +34 -22
  856. package/wrappers/index.cjs +17 -15
  857. package/wrappers/index.js +15 -15
@@ -1,26 +1,47 @@
1
- import { h, ref, computed, watch, Transition, nextTick, getCurrentInstance } from 'vue'
1
+ import {
2
+ h,
3
+ ref,
4
+ computed,
5
+ watch,
6
+ Transition,
7
+ nextTick,
8
+ getCurrentInstance
9
+ } from 'vue'
2
10
 
3
11
  import QBtn from '../btn/QBtn.js'
4
12
 
5
- import useDark, { useDarkProps } from '../../composables/private.use-dark/use-dark.js'
13
+ import useDark, {
14
+ useDarkProps
15
+ } from '../../composables/private.use-dark/use-dark.js'
6
16
  import useRenderCache from '../../composables/use-render-cache/use-render-cache.js'
7
- import { useFormProps, useFormAttrs, useFormInject } from '../../composables/use-form/private.use-form.js'
8
- import useDatetime, { useDatetimeProps, useDatetimeEmits, getDayHash } from './use-datetime.js'
17
+ import {
18
+ useFormProps,
19
+ useFormAttrs,
20
+ useFormInject
21
+ } from '../../composables/use-form/private.use-form.js'
22
+ import useDatetime, {
23
+ useDatetimeProps,
24
+ useDatetimeEmits,
25
+ getDayHash
26
+ } from './use-datetime.js'
9
27
 
10
28
  import { createComponent } from '../../utils/private.create/create.js'
11
29
  import { hSlot } from '../../utils/private.render/render.js'
12
30
  import { formatDate, __splitDate, getDateDiff } from '../../utils/date/date.js'
13
31
  import { pad } from '../../utils/format/format.js'
14
- import { jalaaliMonthLength, toGregorian } from '../../utils/date/private.persian.js'
32
+ import {
33
+ jalaaliMonthLength,
34
+ toGregorian
35
+ } from '../../utils/date/private.persian.js'
15
36
  import { isObject } from '../../utils/is/is.js'
16
37
 
17
38
  const yearsInterval = 20
18
- const views = [ 'Calendar', 'Years', 'Months' ]
39
+ const views = ['Calendar', 'Years', 'Months']
19
40
  const viewIsValid = v => views.includes(v)
20
41
  const yearMonthValidator = v => /^-?[\d]+\/[0-1]\d$/.test(v)
21
42
  const lineStr = ' \u2014 '
22
43
 
23
- function getMonthHash (date) {
44
+ function getMonthHash(date) {
24
45
  return date.year + '/' + pad(date.month)
25
46
  }
26
47
 
@@ -34,7 +55,11 @@ export default createComponent({
34
55
 
35
56
  modelValue: {
36
57
  required: true,
37
- validator: val => (typeof val === 'string' || Array.isArray(val) === true || Object(val) === val || val === null)
58
+ validator: val =>
59
+ typeof val === 'string' ||
60
+ Array.isArray(val) === true ||
61
+ Object(val) === val ||
62
+ val === null
38
63
  },
39
64
 
40
65
  multiple: Boolean,
@@ -57,12 +82,12 @@ export default createComponent({
57
82
 
58
83
  yearsInMonthView: Boolean,
59
84
 
60
- events: [ Array, Function ],
61
- eventColor: [ String, Function ],
85
+ events: [Array, Function],
86
+ eventColor: [String, Function],
62
87
 
63
88
  emitImmediately: Boolean,
64
89
 
65
- options: [ Array, Function ],
90
+ options: [Array, Function],
66
91
 
67
92
  navigationMinYearMonth: {
68
93
  type: String,
@@ -76,7 +101,7 @@ export default createComponent({
76
101
 
77
102
  noUnset: Boolean,
78
103
 
79
- firstDayOfWeek: [ String, Number ],
104
+ firstDayOfWeek: [String, Number],
80
105
  todayBtn: Boolean,
81
106
  minimal: Boolean,
82
107
  defaultView: {
@@ -86,18 +111,18 @@ export default createComponent({
86
111
  }
87
112
  },
88
113
 
89
- emits: [
90
- ...useDatetimeEmits,
91
- 'rangeStart', 'rangeEnd', 'navigation'
92
- ],
114
+ emits: [...useDatetimeEmits, 'rangeStart', 'rangeEnd', 'navigation'],
93
115
 
94
- setup (props, { slots, emit }) {
116
+ setup(props, { slots, emit }) {
95
117
  const { proxy } = getCurrentInstance()
96
118
  const { $q } = proxy
97
119
 
98
120
  const isDark = useDark(props, $q)
99
121
  const { getCache } = useRenderCache()
100
- const { tabindex, headerClass, getLocale, getCurrentDate } = useDatetime(props, $q)
122
+ const { tabindex, headerClass, getLocale, getCurrentDate } = useDatetime(
123
+ props,
124
+ $q
125
+ )
101
126
 
102
127
  let lastEmitValue
103
128
 
@@ -122,101 +147,131 @@ export default createComponent({
122
147
  const monthDirection = ref(direction.value)
123
148
  const yearDirection = ref(direction.value)
124
149
 
125
- const year = viewModel.value.year
126
- const startYear = ref(year - (year % yearsInterval) - (year < 0 ? yearsInterval : 0))
150
+ const localYear = viewModel.value.year
151
+ const startYear = ref(
152
+ localYear -
153
+ (localYear % yearsInterval) -
154
+ (localYear < 0 ? yearsInterval : 0)
155
+ )
127
156
  const editRange = ref(null)
128
157
 
129
158
  const classes = computed(() => {
130
159
  const type = props.landscape === true ? 'landscape' : 'portrait'
131
- return `q-date q-date--${ type } q-date--${ type }-${ props.minimal === true ? 'minimal' : 'standard' }`
132
- + (isDark.value === true ? ' q-date--dark q-dark' : '')
133
- + (props.bordered === true ? ' q-date--bordered' : '')
134
- + (props.square === true ? ' q-date--square no-border-radius' : '')
135
- + (props.flat === true ? ' q-date--flat no-shadow' : '')
136
- + (props.disable === true ? ' disabled' : (props.readonly === true ? ' q-date--readonly' : ''))
160
+ return (
161
+ `q-date q-date--${type} q-date--${type}-${props.minimal === true ? 'minimal' : 'standard'}` +
162
+ (isDark.value === true ? ' q-date--dark q-dark' : '') +
163
+ (props.bordered === true ? ' q-date--bordered' : '') +
164
+ (props.square === true ? ' q-date--square no-border-radius' : '') +
165
+ (props.flat === true ? ' q-date--flat no-shadow' : '') +
166
+ (props.disable === true
167
+ ? ' disabled'
168
+ : props.readonly === true
169
+ ? ' q-date--readonly'
170
+ : '')
171
+ )
137
172
  })
138
173
 
139
- const computedColor = computed(() => {
140
- return props.color || 'primary'
141
- })
174
+ const computedColor = computed(() => props.color || 'primary')
142
175
 
143
- const computedTextColor = computed(() => {
144
- return props.textColor || 'white'
145
- })
176
+ const computedTextColor = computed(() => props.textColor || 'white')
146
177
 
147
- const isImmediate = computed(() =>
148
- props.emitImmediately === true
149
- && props.multiple !== true
150
- && props.range !== true
178
+ const isImmediate = computed(
179
+ () =>
180
+ props.emitImmediately === true &&
181
+ props.multiple !== true &&
182
+ props.range !== true
151
183
  )
152
184
 
153
- const normalizedModel = computed(() => (
185
+ const normalizedModel = computed(() =>
154
186
  Array.isArray(props.modelValue) === true
155
187
  ? props.modelValue
156
- : (props.modelValue !== null && props.modelValue !== void 0 ? [ props.modelValue ] : [])
157
- ))
188
+ : props.modelValue !== null && props.modelValue !== void 0
189
+ ? [props.modelValue]
190
+ : []
191
+ )
158
192
 
159
193
  const daysModel = computed(() =>
160
194
  normalizedModel.value
161
195
  .filter(date => typeof date === 'string')
162
196
  .map(date => decodeString(date, innerMask.value, innerLocale.value))
163
- .filter(date =>
164
- date.dateHash !== null
165
- && date.day !== null
166
- && date.month !== null
167
- && date.year !== null
197
+ .filter(
198
+ date =>
199
+ date.dateHash !== null &&
200
+ date.day !== null &&
201
+ date.month !== null &&
202
+ date.year !== null
168
203
  )
169
204
  )
170
205
 
171
206
  const rangeModel = computed(() => {
172
207
  const fn = date => decodeString(date, innerMask.value, innerLocale.value)
173
208
  return normalizedModel.value
174
- .filter(date => isObject(date) === true && date.from !== void 0 && date.to !== void 0)
209
+ .filter(
210
+ date =>
211
+ isObject(date) === true &&
212
+ date.from !== void 0 &&
213
+ date.to !== void 0
214
+ )
175
215
  .map(range => ({ from: fn(range.from), to: fn(range.to) }))
176
- .filter(range => range.from.dateHash !== null && range.to.dateHash !== null && range.from.dateHash < range.to.dateHash)
216
+ .filter(
217
+ range =>
218
+ range.from.dateHash !== null &&
219
+ range.to.dateHash !== null &&
220
+ range.from.dateHash < range.to.dateHash
221
+ )
177
222
  })
178
223
 
179
- const getNativeDateFn = computed(() => (
224
+ const getNativeDateFn = computed(() =>
180
225
  props.calendar !== 'persian'
181
226
  ? model => new Date(model.year, model.month - 1, model.day)
182
227
  : model => {
183
- const gDate = toGregorian(model.year, model.month, model.day)
184
- return new Date(gDate.gy, gDate.gm - 1, gDate.gd)
185
- }
186
- ))
228
+ const gDate = toGregorian(model.year, model.month, model.day)
229
+ return new Date(gDate.gy, gDate.gm - 1, gDate.gd)
230
+ }
231
+ )
187
232
 
188
- const encodeObjectFn = computed(() => (
233
+ const encodeObjectFn = computed(() =>
189
234
  props.calendar === 'persian'
190
235
  ? getDayHash
191
- : (date, mask, locale) => formatDate(
192
- new Date(
236
+ : (date, dateMask, dateLocale) =>
237
+ formatDate(
238
+ new Date(
239
+ date.year,
240
+ date.month - 1,
241
+ date.day,
242
+ date.hour,
243
+ date.minute,
244
+ date.second,
245
+ date.millisecond
246
+ ),
247
+ dateMask === void 0 ? innerMask.value : dateMask,
248
+ dateLocale === void 0 ? innerLocale.value : dateLocale,
193
249
  date.year,
194
- date.month - 1,
195
- date.day,
196
- date.hour,
197
- date.minute,
198
- date.second,
199
- date.millisecond
200
- ),
201
- mask === void 0 ? innerMask.value : mask,
202
- locale === void 0 ? innerLocale.value : locale,
203
- date.year,
204
- date.timezoneOffset
205
- )
206
- ))
250
+ date.timezoneOffset
251
+ )
252
+ )
207
253
 
208
- const daysInModel = computed(() =>
209
- daysModel.value.length + rangeModel.value.reduce(
210
- (acc, range) => acc + 1 + getDateDiff(
211
- getNativeDateFn.value(range.to),
212
- getNativeDateFn.value(range.from)
213
- ),
214
- 0
215
- )
254
+ const daysInModel = computed(
255
+ () =>
256
+ daysModel.value.length +
257
+ rangeModel.value.reduce(
258
+ (acc, range) =>
259
+ acc +
260
+ 1 +
261
+ getDateDiff(
262
+ getNativeDateFn.value(range.to),
263
+ getNativeDateFn.value(range.from)
264
+ ),
265
+ 0
266
+ )
216
267
  )
217
268
 
218
269
  const headerTitle = computed(() => {
219
- if (props.title !== void 0 && props.title !== null && props.title.length !== 0) {
270
+ if (
271
+ props.title !== void 0 &&
272
+ props.title !== null &&
273
+ props.title.length !== 0
274
+ ) {
220
275
  return props.title
221
276
  }
222
277
 
@@ -224,9 +279,15 @@ export default createComponent({
224
279
  const model = editRange.value.init
225
280
  const date = getNativeDateFn.value(model)
226
281
 
227
- return innerLocale.value.daysShort[ date.getDay() ] + ', '
228
- + innerLocale.value.monthsShort[ model.month - 1 ] + ' '
229
- + model.day + lineStr + '?'
282
+ return (
283
+ innerLocale.value.daysShort[date.getDay()] +
284
+ ', ' +
285
+ innerLocale.value.monthsShort[model.month - 1] +
286
+ ' ' +
287
+ model.day +
288
+ lineStr +
289
+ '?'
290
+ )
230
291
  }
231
292
 
232
293
  if (daysInModel.value === 0) {
@@ -234,10 +295,10 @@ export default createComponent({
234
295
  }
235
296
 
236
297
  if (daysInModel.value > 1) {
237
- return `${ daysInModel.value } ${ innerLocale.value.pluralDay }`
298
+ return `${daysInModel.value} ${innerLocale.value.pluralDay}`
238
299
  }
239
300
 
240
- const model = daysModel.value[ 0 ]
301
+ const model = daysModel.value[0]
241
302
  const date = getNativeDateFn.value(model)
242
303
 
243
304
  if (isNaN(date.valueOf()) === true) {
@@ -248,27 +309,37 @@ export default createComponent({
248
309
  return innerLocale.value.headerTitle(date, model)
249
310
  }
250
311
 
251
- return innerLocale.value.daysShort[ date.getDay() ] + ', '
252
- + innerLocale.value.monthsShort[ model.month - 1 ] + ' '
253
- + model.day
312
+ return (
313
+ innerLocale.value.daysShort[date.getDay()] +
314
+ ', ' +
315
+ innerLocale.value.monthsShort[model.month - 1] +
316
+ ' ' +
317
+ model.day
318
+ )
254
319
  })
255
320
 
256
321
  const minSelectedModel = computed(() => {
257
- const model = daysModel.value.concat(rangeModel.value.map(range => range.from))
322
+ const model = daysModel.value
323
+ .concat(rangeModel.value.map(range => range.from))
258
324
  .sort((a, b) => a.year - b.year || a.month - b.month)
259
325
 
260
- return model[ 0 ]
326
+ return model[0]
261
327
  })
262
328
 
263
329
  const maxSelectedModel = computed(() => {
264
- const model = daysModel.value.concat(rangeModel.value.map(range => range.to))
330
+ const model = daysModel.value
331
+ .concat(rangeModel.value.map(range => range.to))
265
332
  .sort((a, b) => b.year - a.year || b.month - a.month)
266
333
 
267
- return model[ 0 ]
334
+ return model[0]
268
335
  })
269
336
 
270
337
  const headerSubtitle = computed(() => {
271
- if (props.subtitle !== void 0 && props.subtitle !== null && props.subtitle.length !== 0) {
338
+ if (
339
+ props.subtitle !== void 0 &&
340
+ props.subtitle !== null &&
341
+ props.subtitle.length !== 0
342
+ ) {
272
343
  return props.subtitle
273
344
  }
274
345
 
@@ -281,34 +352,37 @@ export default createComponent({
281
352
  const to = maxSelectedModel.value
282
353
  const month = innerLocale.value.monthsShort
283
354
 
284
- return month[ from.month - 1 ] + (
285
- from.year !== to.year
286
- ? ' ' + from.year + lineStr + month[ to.month - 1 ] + ' '
287
- : (
288
- from.month !== to.month
289
- ? lineStr + month[ to.month - 1 ]
290
- : ''
291
- )
292
- ) + ' ' + to.year
355
+ return (
356
+ month[from.month - 1] +
357
+ (from.year !== to.year
358
+ ? ' ' + from.year + lineStr + month[to.month - 1] + ' '
359
+ : from.month !== to.month
360
+ ? lineStr + month[to.month - 1]
361
+ : '') +
362
+ ' ' +
363
+ to.year
364
+ )
293
365
  }
294
366
 
295
- return daysModel.value[ 0 ].year
367
+ return daysModel.value[0].year
296
368
  })
297
369
 
298
370
  const dateArrow = computed(() => {
299
- const val = [ $q.iconSet.datetime.arrowLeft, $q.iconSet.datetime.arrowRight ]
371
+ const val = [
372
+ $q.iconSet.datetime.arrowLeft,
373
+ $q.iconSet.datetime.arrowRight
374
+ ]
300
375
  return $q.lang.rtl === true ? val.reverse() : val
301
376
  })
302
377
 
303
- const computedFirstDayOfWeek = computed(() => (
378
+ const computedFirstDayOfWeek = computed(() =>
304
379
  props.firstDayOfWeek !== void 0
305
380
  ? Number(props.firstDayOfWeek)
306
381
  : innerLocale.value.firstDayOfWeek
307
- ))
382
+ )
308
383
 
309
384
  const daysOfWeek = computed(() => {
310
- const
311
- days = innerLocale.value.daysShort,
385
+ const days = innerLocale.value.daysShort,
312
386
  first = computedFirstDayOfWeek.value
313
387
 
314
388
  return first > 0
@@ -319,15 +393,15 @@ export default createComponent({
319
393
  const daysInMonth = computed(() => {
320
394
  const date = viewModel.value
321
395
  return props.calendar !== 'persian'
322
- ? (new Date(date.year, date.month, 0)).getDate()
396
+ ? new Date(date.year, date.month, 0).getDate()
323
397
  : jalaaliMonthLength(date.year, date.month)
324
398
  })
325
399
 
326
- const evtColor = computed(() => (
400
+ const evtColor = computed(() =>
327
401
  typeof props.eventColor === 'function'
328
402
  ? props.eventColor
329
403
  : () => props.eventColor
330
- ))
404
+ )
331
405
 
332
406
  const minNav = computed(() => {
333
407
  if (props.navigationMinYearMonth === void 0) {
@@ -335,7 +409,7 @@ export default createComponent({
335
409
  }
336
410
 
337
411
  const data = props.navigationMinYearMonth.split('/')
338
- return { year: parseInt(data[ 0 ], 10), month: parseInt(data[ 1 ], 10) }
412
+ return { year: parseInt(data[0], 10), month: parseInt(data[1], 10) }
339
413
  })
340
414
 
341
415
  const maxNav = computed(() => {
@@ -344,7 +418,7 @@ export default createComponent({
344
418
  }
345
419
 
346
420
  const data = props.navigationMaxYearMonth.split('/')
347
- return { year: parseInt(data[ 0 ], 10), month: parseInt(data[ 1 ], 10) }
421
+ return { year: parseInt(data[0], 10), month: parseInt(data[1], 10) }
348
422
  })
349
423
 
350
424
  const navBoundaries = computed(() => {
@@ -355,14 +429,20 @@ export default createComponent({
355
429
 
356
430
  if (minNav.value !== null && minNav.value.year >= viewModel.value.year) {
357
431
  data.year.prev = false
358
- if (minNav.value.year === viewModel.value.year && minNav.value.month >= viewModel.value.month) {
432
+ if (
433
+ minNav.value.year === viewModel.value.year &&
434
+ minNav.value.month >= viewModel.value.month
435
+ ) {
359
436
  data.month.prev = false
360
437
  }
361
438
  }
362
439
 
363
440
  if (maxNav.value !== null && maxNav.value.year <= viewModel.value.year) {
364
441
  data.year.next = false
365
- if (maxNav.value.year === viewModel.value.year && maxNav.value.month <= viewModel.value.month) {
442
+ if (
443
+ maxNav.value.year === viewModel.value.year &&
444
+ maxNav.value.month <= viewModel.value.month
445
+ ) {
366
446
  data.month.next = false
367
447
  }
368
448
  }
@@ -376,11 +456,11 @@ export default createComponent({
376
456
  daysModel.value.forEach(entry => {
377
457
  const hash = getMonthHash(entry)
378
458
 
379
- if (map[ hash ] === void 0) {
380
- map[ hash ] = []
459
+ if (map[hash] === void 0) {
460
+ map[hash] = []
381
461
  }
382
462
 
383
- map[ hash ].push(entry.day)
463
+ map[hash].push(entry.day)
384
464
  })
385
465
 
386
466
  return map
@@ -393,11 +473,11 @@ export default createComponent({
393
473
  const hashFrom = getMonthHash(entry.from)
394
474
  const hashTo = getMonthHash(entry.to)
395
475
 
396
- if (map[ hashFrom ] === void 0) {
397
- map[ hashFrom ] = []
476
+ if (map[hashFrom] === void 0) {
477
+ map[hashFrom] = []
398
478
  }
399
479
 
400
- map[ hashFrom ].push({
480
+ map[hashFrom].push({
401
481
  from: entry.from.day,
402
482
  to: hashFrom === hashTo ? entry.to.day : void 0,
403
483
  range: entry
@@ -406,16 +486,17 @@ export default createComponent({
406
486
  if (hashFrom < hashTo) {
407
487
  let hash
408
488
  const { year, month } = entry.from
409
- const cur = month < 12
410
- ? { year, month: month + 1 }
411
- : { year: year + 1, month: 1 }
489
+ const cur =
490
+ month < 12
491
+ ? { year, month: month + 1 }
492
+ : { year: year + 1, month: 1 }
412
493
 
413
494
  while ((hash = getMonthHash(cur)) <= hashTo) {
414
- if (map[ hash ] === void 0) {
415
- map[ hash ] = []
495
+ if (map[hash] === void 0) {
496
+ map[hash] = []
416
497
  }
417
498
 
418
- map[ hash ].push({
499
+ map[hash].push({
419
500
  from: void 0,
420
501
  to: hash === hashTo ? entry.to.day : void 0,
421
502
  range: entry
@@ -438,37 +519,32 @@ export default createComponent({
438
519
 
439
520
  const { init, initHash, final, finalHash } = editRange.value
440
521
 
441
- const [ from, to ] = initHash <= finalHash
442
- ? [ init, final ]
443
- : [ final, init ]
522
+ const [from, to] = initHash <= finalHash ? [init, final] : [final, init]
444
523
 
445
524
  const fromHash = getMonthHash(from)
446
525
  const toHash = getMonthHash(to)
447
526
 
448
- if (
449
- fromHash !== viewMonthHash.value
450
- && toHash !== viewMonthHash.value
451
- ) return
527
+ if (fromHash !== viewMonthHash.value && toHash !== viewMonthHash.value) {
528
+ return
529
+ }
452
530
 
453
- const view = {}
531
+ const localView = {}
454
532
 
455
533
  if (fromHash === viewMonthHash.value) {
456
- view.from = from.day
457
- view.includeFrom = true
458
- }
459
- else {
460
- view.from = 1
534
+ localView.from = from.day
535
+ localView.includeFrom = true
536
+ } else {
537
+ localView.from = 1
461
538
  }
462
539
 
463
540
  if (toHash === viewMonthHash.value) {
464
- view.to = to.day
465
- view.includeTo = true
466
- }
467
- else {
468
- view.to = daysInMonth.value
541
+ localView.to = to.day
542
+ localView.includeTo = true
543
+ } else {
544
+ localView.to = daysInMonth.value
469
545
  }
470
546
 
471
- return view
547
+ return localView
472
548
  })
473
549
 
474
550
  const viewMonthHash = computed(() => getMonthHash(viewModel.value))
@@ -478,19 +554,20 @@ export default createComponent({
478
554
 
479
555
  if (props.options === void 0) {
480
556
  for (let i = 1; i <= daysInMonth.value; i++) {
481
- map[ i ] = true
557
+ map[i] = true
482
558
  }
483
559
 
484
560
  return map
485
561
  }
486
562
 
487
- const fn = typeof props.options === 'function'
488
- ? props.options
489
- : date => props.options.includes(date)
563
+ const fn =
564
+ typeof props.options === 'function'
565
+ ? props.options
566
+ : date => props.options.includes(date)
490
567
 
491
568
  for (let i = 1; i <= daysInMonth.value; i++) {
492
569
  const dayHash = viewMonthHash.value + '/' + pad(i)
493
- map[ i ] = fn(dayHash)
570
+ map[i] = fn(dayHash)
494
571
  }
495
572
 
496
573
  return map
@@ -501,17 +578,17 @@ export default createComponent({
501
578
 
502
579
  if (props.events === void 0) {
503
580
  for (let i = 1; i <= daysInMonth.value; i++) {
504
- map[ i ] = false
581
+ map[i] = false
505
582
  }
506
- }
507
- else {
508
- const fn = typeof props.events === 'function'
509
- ? props.events
510
- : date => props.events.includes(date)
583
+ } else {
584
+ const fn =
585
+ typeof props.events === 'function'
586
+ ? props.events
587
+ : date => props.events.includes(date)
511
588
 
512
589
  for (let i = 1; i <= daysInMonth.value; i++) {
513
590
  const dayHash = viewMonthHash.value + '/' + pad(i)
514
- map[ i ] = fn(dayHash) === true && evtColor.value(dayHash)
591
+ map[i] = fn(dayHash) === true && evtColor.value(dayHash)
515
592
  }
516
593
  }
517
594
 
@@ -524,9 +601,8 @@ export default createComponent({
524
601
 
525
602
  if (props.calendar !== 'persian') {
526
603
  date = new Date(year, month - 1, 1)
527
- endDay = (new Date(year, month - 1, 0)).getDate()
528
- }
529
- else {
604
+ endDay = new Date(year, month - 1, 0).getDate()
605
+ } else {
530
606
  const gDate = toGregorian(year, month, 1)
531
607
  date = new Date(gDate.gy, gDate.gm - 1, gDate.gd)
532
608
  let prevJM = month - 1
@@ -546,9 +622,9 @@ export default createComponent({
546
622
 
547
623
  const days = computed(() => {
548
624
  const res = []
549
- const { days, endDay } = viewDays.value
625
+ const { days: localDays, endDay } = viewDays.value
550
626
 
551
- const len = days < 0 ? days + 7 : days
627
+ const len = localDays < 0 ? localDays + 7 : localDays
552
628
  if (len < 6) {
553
629
  for (let i = endDay - len; i <= endDay; i++) {
554
630
  res.push({ i, fill: true })
@@ -558,9 +634,9 @@ export default createComponent({
558
634
  const index = res.length
559
635
 
560
636
  for (let i = 1; i <= daysInMonth.value; i++) {
561
- const day = { i, event: eventDaysMap.value[ i ], classes: [] }
637
+ const day = { i, event: eventDaysMap.value[i], classes: [] }
562
638
 
563
- if (selectionDaysMap.value[ i ] === true) {
639
+ if (selectionDaysMap.value[i] === true) {
564
640
  day.in = true
565
641
  day.flat = true
566
642
  }
@@ -569,10 +645,10 @@ export default createComponent({
569
645
  }
570
646
 
571
647
  // if current view has days in model
572
- if (daysMap.value[ viewMonthHash.value ] !== void 0) {
573
- daysMap.value[ viewMonthHash.value ].forEach(day => {
648
+ if (daysMap.value[viewMonthHash.value] !== void 0) {
649
+ daysMap.value[viewMonthHash.value].forEach(day => {
574
650
  const i = index + day - 1
575
- Object.assign(res[ i ], {
651
+ Object.assign(res[i], {
576
652
  selected: true,
577
653
  unelevated: true,
578
654
  flat: false,
@@ -583,14 +659,14 @@ export default createComponent({
583
659
  }
584
660
 
585
661
  // if current view has ranges in model
586
- if (rangeMap.value[ viewMonthHash.value ] !== void 0) {
587
- rangeMap.value[ viewMonthHash.value ].forEach(entry => {
662
+ if (rangeMap.value[viewMonthHash.value] !== void 0) {
663
+ rangeMap.value[viewMonthHash.value].forEach(entry => {
588
664
  if (entry.from !== void 0) {
589
665
  const from = index + entry.from - 1
590
666
  const to = index + (entry.to || daysInMonth.value) - 1
591
667
 
592
668
  for (let day = from; day <= to; day++) {
593
- Object.assign(res[ day ], {
669
+ Object.assign(res[day], {
594
670
  range: entry.range,
595
671
  unelevated: true,
596
672
  color: computedColor.value,
@@ -598,21 +674,22 @@ export default createComponent({
598
674
  })
599
675
  }
600
676
 
601
- Object.assign(res[ from ], {
677
+ Object.assign(res[from], {
602
678
  rangeFrom: true,
603
679
  flat: false
604
680
  })
605
681
 
606
- entry.to !== void 0 && Object.assign(res[ to ], {
607
- rangeTo: true,
608
- flat: false
609
- })
610
- }
611
- else if (entry.to !== void 0) {
682
+ if (entry.to !== void 0) {
683
+ Object.assign(res[to], {
684
+ rangeTo: true,
685
+ flat: false
686
+ })
687
+ }
688
+ } else if (entry.to !== void 0) {
612
689
  const to = index + entry.to - 1
613
690
 
614
691
  for (let day = index; day <= to; day++) {
615
- Object.assign(res[ day ], {
692
+ Object.assign(res[day], {
616
693
  range: entry.range,
617
694
  unelevated: true,
618
695
  color: computedColor.value,
@@ -620,15 +697,14 @@ export default createComponent({
620
697
  })
621
698
  }
622
699
 
623
- Object.assign(res[ to ], {
700
+ Object.assign(res[to], {
624
701
  flat: false,
625
702
  rangeTo: true
626
703
  })
627
- }
628
- else {
704
+ } else {
629
705
  const to = index + daysInMonth.value - 1
630
706
  for (let day = index; day <= to; day++) {
631
- Object.assign(res[ day ], {
707
+ Object.assign(res[day], {
632
708
  range: entry.range,
633
709
  unelevated: true,
634
710
  color: computedColor.value,
@@ -644,20 +720,23 @@ export default createComponent({
644
720
  const to = index + rangeView.value.to - 1
645
721
 
646
722
  for (let day = from; day <= to; day++) {
647
- res[ day ].color = computedColor.value
648
- res[ day ].editRange = true
723
+ res[day].color = computedColor.value
724
+ res[day].editRange = true
649
725
  }
650
726
 
651
727
  if (rangeView.value.includeFrom === true) {
652
- res[ from ].editRangeFrom = true
728
+ res[from].editRangeFrom = true
653
729
  }
654
730
  if (rangeView.value.includeTo === true) {
655
- res[ to ].editRangeTo = true
731
+ res[to].editRangeTo = true
656
732
  }
657
733
  }
658
734
 
659
- if (viewModel.value.year === today.value.year && viewModel.value.month === today.value.month) {
660
- res[ index + today.value.day - 1 ].today = true
735
+ if (
736
+ viewModel.value.year === today.value.year &&
737
+ viewModel.value.month === today.value.month
738
+ ) {
739
+ res[index + today.value.day - 1].today = true
661
740
  }
662
741
 
663
742
  const left = res.length % 7
@@ -673,20 +752,19 @@ export default createComponent({
673
752
 
674
753
  if (day.fill === true) {
675
754
  cls += 'q-date__calendar-item--fill'
676
- }
677
- else {
678
- cls += `q-date__calendar-item--${ day.in === true ? 'in' : 'out' }`
755
+ } else {
756
+ cls += `q-date__calendar-item--${day.in === true ? 'in' : 'out'}`
679
757
 
680
758
  if (day.range !== void 0) {
681
- cls += ` q-date__range${ day.rangeTo === true ? '-to' : (day.rangeFrom === true ? '-from' : '') }`
759
+ cls += ` q-date__range${day.rangeTo === true ? '-to' : day.rangeFrom === true ? '-from' : ''}`
682
760
  }
683
761
 
684
762
  if (day.editRange === true) {
685
- cls += ` q-date__edit-range${ day.editRangeFrom === true ? '-from' : '' }${ day.editRangeTo === true ? '-to' : '' }`
763
+ cls += ` q-date__edit-range${day.editRangeFrom === true ? '-from' : ''}${day.editRangeTo === true ? '-to' : ''}`
686
764
  }
687
765
 
688
766
  if (day.range !== void 0 || day.editRange === true) {
689
- cls += ` text-${ day.color }`
767
+ cls += ` text-${day.color}`
690
768
  }
691
769
  }
692
770
 
@@ -696,31 +774,40 @@ export default createComponent({
696
774
  return res
697
775
  })
698
776
 
699
- const attributes = computed(() => (
700
- props.disable === true
701
- ? { 'aria-disabled': 'true' }
702
- : {}
703
- ))
777
+ const attributes = computed(() =>
778
+ props.disable === true ? { 'aria-disabled': 'true' } : {}
779
+ )
704
780
 
705
- watch(() => props.modelValue, v => {
706
- if (lastEmitValue === JSON.stringify(v)) {
707
- lastEmitValue = 0
708
- }
709
- else {
710
- const model = getViewModel(innerMask.value, innerLocale.value)
711
- updateViewModel(model.year, model.month, model)
781
+ watch(
782
+ () => props.modelValue,
783
+ v => {
784
+ if (lastEmitValue === JSON.stringify(v)) {
785
+ lastEmitValue = 0
786
+ } else {
787
+ const model = getViewModel(innerMask.value, innerLocale.value)
788
+ updateViewModel(model.year, model.month, model)
789
+ }
712
790
  }
713
- })
791
+ )
714
792
 
715
793
  watch(view, () => {
716
- if (blurTargetRef.value !== null && proxy.$el.contains(document.activeElement) === true) {
794
+ if (
795
+ blurTargetRef.value !== null &&
796
+ proxy.$el.contains(document.activeElement) === true
797
+ ) {
717
798
  blurTargetRef.value.focus()
718
799
  }
719
800
  })
720
801
 
721
- watch(() => viewModel.value.year + '|' + viewModel.value.month, () => {
722
- emit('navigation', { year: viewModel.value.year, month: viewModel.value.month })
723
- })
802
+ watch(
803
+ () => viewModel.value.year + '|' + viewModel.value.month,
804
+ () => {
805
+ emit('navigation', {
806
+ year: viewModel.value.year,
807
+ month: viewModel.value.month
808
+ })
809
+ }
810
+ )
724
811
 
725
812
  watch(mask, val => {
726
813
  updateValue(val, innerLocale.value, 'mask')
@@ -732,11 +819,11 @@ export default createComponent({
732
819
  innerLocale.value = val
733
820
  })
734
821
 
735
- function setLastValue (v) {
822
+ function setLastValue(v) {
736
823
  lastEmitValue = JSON.stringify(v)
737
824
  }
738
825
 
739
- function setToday () {
826
+ function setToday() {
740
827
  const { year, month, day } = today.value
741
828
 
742
829
  const date = {
@@ -750,7 +837,7 @@ export default createComponent({
750
837
  day
751
838
  }
752
839
 
753
- const monthMap = daysMap.value[ getMonthHash(date) ]
840
+ const monthMap = daysMap.value[getMonthHash(date)]
754
841
 
755
842
  if (monthMap === void 0 || monthMap.includes(date.day) === false) {
756
843
  addToModel(date)
@@ -759,34 +846,33 @@ export default createComponent({
759
846
  setCalendarTo(date.year, date.month)
760
847
  }
761
848
 
762
- function setView (viewMode) {
849
+ function setView(viewMode) {
763
850
  if (viewIsValid(viewMode) === true) {
764
851
  view.value = viewMode
765
852
  }
766
853
  }
767
854
 
768
- function offsetCalendar (type, descending) {
769
- if ([ 'month', 'year' ].includes(type)) {
855
+ function offsetCalendar(type, descending) {
856
+ if (['month', 'year'].includes(type)) {
770
857
  const fn = type === 'month' ? goToMonth : goToYear
771
858
  fn(descending === true ? -1 : 1)
772
859
  }
773
860
  }
774
861
 
775
- function setCalendarTo (year, month) {
862
+ function setCalendarTo(year, month) {
776
863
  view.value = 'Calendar'
777
864
  updateViewModel(year, month)
778
865
  }
779
866
 
780
- function setEditingRange (from, to) {
867
+ function setEditingRange(from, to) {
781
868
  if (props.range === false || !from) {
782
869
  editRange.value = null
783
870
  return
784
871
  }
785
872
 
786
873
  const init = Object.assign({ ...viewModel.value }, from)
787
- const final = to !== void 0
788
- ? Object.assign({ ...viewModel.value }, to)
789
- : init
874
+ const final =
875
+ to !== void 0 ? Object.assign({ ...viewModel.value }, to) : init
790
876
 
791
877
  editRange.value = {
792
878
  init,
@@ -798,60 +884,52 @@ export default createComponent({
798
884
  setCalendarTo(init.year, init.month)
799
885
  }
800
886
 
801
- function getMask () {
887
+ function getMask() {
802
888
  return props.calendar === 'persian' ? 'YYYY/MM/DD' : props.mask
803
889
  }
804
890
 
805
- function decodeString (date, mask, locale) {
806
- return __splitDate(
807
- date,
808
- mask,
809
- locale,
810
- props.calendar,
811
- {
812
- hour: 0,
813
- minute: 0,
814
- second: 0,
815
- millisecond: 0
816
- }
817
- )
891
+ function decodeString(date, dateMask, dateLocale) {
892
+ return __splitDate(date, dateMask, dateLocale, props.calendar, {
893
+ hour: 0,
894
+ minute: 0,
895
+ second: 0,
896
+ millisecond: 0
897
+ })
818
898
  }
819
899
 
820
- function getViewModel (mask, locale) {
821
- const model = Array.isArray(props.modelValue) === true
822
- ? props.modelValue
823
- : (props.modelValue ? [ props.modelValue ] : [])
900
+ function getViewModel(dateMask, dateLocale) {
901
+ const model =
902
+ Array.isArray(props.modelValue) === true
903
+ ? props.modelValue
904
+ : props.modelValue
905
+ ? [props.modelValue]
906
+ : []
824
907
 
825
908
  if (model.length === 0) {
826
909
  return getDefaultViewModel()
827
910
  }
828
911
 
829
- const target = model[ model.length - 1 ]
912
+ const target = model[model.length - 1]
830
913
  const decoded = decodeString(
831
914
  target.from !== void 0 ? target.from : target,
832
- mask,
833
- locale
915
+ dateMask,
916
+ dateLocale
834
917
  )
835
918
 
836
- return decoded.dateHash === null
837
- ? getDefaultViewModel()
838
- : decoded
919
+ return decoded.dateHash === null ? getDefaultViewModel() : decoded
839
920
  }
840
921
 
841
- function getDefaultViewModel () {
922
+ function getDefaultViewModel() {
842
923
  let year, month
843
924
 
844
925
  if (props.defaultYearMonth !== void 0) {
845
926
  const d = props.defaultYearMonth.split('/')
846
- year = parseInt(d[ 0 ], 10)
847
- month = parseInt(d[ 1 ], 10)
848
- }
849
- else {
927
+ year = parseInt(d[0], 10)
928
+ month = parseInt(d[1], 10)
929
+ } else {
850
930
  // may come from data() where computed
851
931
  // props are not yet available
852
- const d = today.value !== void 0
853
- ? today.value
854
- : getCurrentDate()
932
+ const d = today.value !== void 0 ? today.value : getCurrentDate()
855
933
 
856
934
  year = d.year
857
935
  month = d.month
@@ -869,55 +947,53 @@ export default createComponent({
869
947
  }
870
948
  }
871
949
 
872
- function goToMonth (offset) {
950
+ function goToMonth(offset) {
873
951
  let year = viewModel.value.year
874
952
  let month = Number(viewModel.value.month) + offset
875
953
 
876
954
  if (month === 13) {
877
955
  month = 1
878
956
  year++
879
- }
880
- else if (month === 0) {
957
+ } else if (month === 0) {
881
958
  month = 12
882
959
  year--
883
960
  }
884
961
 
885
962
  updateViewModel(year, month)
886
- isImmediate.value === true && emitImmediately('month')
963
+ if (isImmediate.value === true) emitImmediately('month')
887
964
  }
888
965
 
889
- function goToYear (offset) {
966
+ function goToYear(offset) {
890
967
  const year = Number(viewModel.value.year) + offset
891
968
  updateViewModel(year, viewModel.value.month)
892
- isImmediate.value === true && emitImmediately('year')
969
+ if (isImmediate.value === true) emitImmediately('year')
893
970
  }
894
971
 
895
- function setYear (year) {
972
+ function setYear(year) {
896
973
  updateViewModel(year, viewModel.value.month)
897
974
  view.value = props.defaultView === 'Years' ? 'Months' : 'Calendar'
898
- isImmediate.value === true && emitImmediately('year')
975
+ if (isImmediate.value === true) emitImmediately('year')
899
976
  }
900
977
 
901
- function setMonth (month) {
978
+ function setMonth(month) {
902
979
  updateViewModel(viewModel.value.year, month)
903
980
  view.value = 'Calendar'
904
- isImmediate.value === true && emitImmediately('month')
981
+ if (isImmediate.value === true) emitImmediately('month')
905
982
  }
906
983
 
907
- function toggleDate (date, monthHash) {
908
- const month = daysMap.value[ monthHash ]
909
- const fn = month?.includes(date.day) === true
910
- ? removeFromModel
911
- : addToModel
984
+ function toggleDate(date, monthHash) {
985
+ const month = daysMap.value[monthHash]
986
+ const fn =
987
+ month?.includes(date.day) === true ? removeFromModel : addToModel
912
988
 
913
989
  fn(date)
914
990
  }
915
991
 
916
- function getShortDate (date) {
992
+ function getShortDate(date) {
917
993
  return { year: date.year, month: date.month, day: date.day }
918
994
  }
919
995
 
920
- function updateViewModel (year, month, time) {
996
+ function updateViewModel(year, month, time) {
921
997
  if (minNav.value !== null && year <= minNav.value.year) {
922
998
  if (month < minNav.value.month || year < minNav.value.year) {
923
999
  month = minNav.value.month
@@ -933,20 +1009,32 @@ export default createComponent({
933
1009
  }
934
1010
 
935
1011
  if (time !== void 0) {
936
- const { hour, minute, second, millisecond, timezoneOffset, timeHash } = time
937
- Object.assign(viewModel.value, { hour, minute, second, millisecond, timezoneOffset, timeHash })
1012
+ const { hour, minute, second, millisecond, timezoneOffset, timeHash } =
1013
+ time
1014
+ Object.assign(viewModel.value, {
1015
+ hour,
1016
+ minute,
1017
+ second,
1018
+ millisecond,
1019
+ timezoneOffset,
1020
+ timeHash
1021
+ })
938
1022
  }
939
1023
 
940
1024
  const newHash = year + '/' + pad(month) + '/01'
941
1025
 
942
1026
  if (newHash !== viewModel.value.dateHash) {
943
- monthDirection.value = (viewModel.value.dateHash < newHash) === ($q.lang.rtl !== true) ? 'left' : 'right'
1027
+ monthDirection.value =
1028
+ viewModel.value.dateHash < newHash === ($q.lang.rtl !== true)
1029
+ ? 'left'
1030
+ : 'right'
944
1031
  if (year !== viewModel.value.year) {
945
1032
  yearDirection.value = monthDirection.value
946
1033
  }
947
1034
 
948
1035
  nextTick(() => {
949
- startYear.value = year - year % yearsInterval - (year < 0 ? yearsInterval : 0)
1036
+ startYear.value =
1037
+ year - (year % yearsInterval) - (year < 0 ? yearsInterval : 0)
950
1038
  Object.assign(viewModel.value, {
951
1039
  year,
952
1040
  month,
@@ -957,10 +1045,11 @@ export default createComponent({
957
1045
  }
958
1046
  }
959
1047
 
960
- function emitValue (val, action, date) {
961
- const value = val !== null && val.length === 1 && props.multiple === false
962
- ? val[ 0 ]
963
- : val
1048
+ function emitValue(val, action, date) {
1049
+ const value =
1050
+ val !== null && val.length === 1 && props.multiple === false
1051
+ ? val[0]
1052
+ : val
964
1053
 
965
1054
  const { reason, details } = getEmitParams(action, date)
966
1055
 
@@ -968,19 +1057,21 @@ export default createComponent({
968
1057
  emit('update:modelValue', value, reason, details)
969
1058
  }
970
1059
 
971
- function emitImmediately (reason) {
972
- const date = daysModel.value[ 0 ] !== void 0 && daysModel.value[ 0 ].dateHash !== null
973
- ? { ...daysModel.value[ 0 ] }
974
- : { ...viewModel.value } // inherit day, hours, minutes, milliseconds...
1060
+ function emitImmediately(reason) {
1061
+ const date =
1062
+ daysModel.value[0] !== void 0 && daysModel.value[0].dateHash !== null
1063
+ ? { ...daysModel.value[0] }
1064
+ : { ...viewModel.value } // inherit day, hours, minutes, milliseconds...
975
1065
 
976
1066
  // nextTick required because of animation delay in viewModel
977
1067
  nextTick(() => {
978
1068
  date.year = viewModel.value.year
979
1069
  date.month = viewModel.value.month
980
1070
 
981
- const maxDay = props.calendar !== 'persian'
982
- ? (new Date(date.year, date.month, 0)).getDate()
983
- : jalaaliMonthLength(date.year, date.month)
1071
+ const maxDay =
1072
+ props.calendar !== 'persian'
1073
+ ? new Date(date.year, date.month, 0).getDate()
1074
+ : jalaaliMonthLength(date.year, date.month)
984
1075
 
985
1076
  date.day = Math.min(Math.max(1, date.day), maxDay)
986
1077
 
@@ -992,10 +1083,10 @@ export default createComponent({
992
1083
  })
993
1084
  }
994
1085
 
995
- function getEmitParams (action, date) {
1086
+ function getEmitParams(action, date) {
996
1087
  return date.from !== void 0
997
1088
  ? {
998
- reason: `${ action }-range`,
1089
+ reason: `${action}-range`,
999
1090
  details: {
1000
1091
  ...getShortDate(date.target),
1001
1092
  from: getShortDate(date.from),
@@ -1003,18 +1094,21 @@ export default createComponent({
1003
1094
  }
1004
1095
  }
1005
1096
  : {
1006
- reason: `${ action }-day`,
1097
+ reason: `${action}-day`,
1007
1098
  details: getShortDate(date)
1008
1099
  }
1009
1100
  }
1010
1101
 
1011
- function encodeEntry (date, mask, locale) {
1102
+ function encodeEntry(date, dateMask, dateLocale) {
1012
1103
  return date.from !== void 0
1013
- ? { from: encodeObjectFn.value(date.from, mask, locale), to: encodeObjectFn.value(date.to, mask, locale) }
1014
- : encodeObjectFn.value(date, mask, locale)
1104
+ ? {
1105
+ from: encodeObjectFn.value(date.from, dateMask, dateLocale),
1106
+ to: encodeObjectFn.value(date.to, dateMask, dateLocale)
1107
+ }
1108
+ : encodeObjectFn.value(date, dateMask, dateLocale)
1015
1109
  }
1016
1110
 
1017
- function addToModel (date) {
1111
+ function addToModel(date) {
1018
1112
  let value
1019
1113
 
1020
1114
  if (props.multiple === true) {
@@ -1024,28 +1118,31 @@ export default createComponent({
1024
1118
  const fromHash = getDayHash(date.from)
1025
1119
  const toHash = getDayHash(date.to)
1026
1120
 
1027
- const days = daysModel.value
1028
- .filter(day => day.dateHash < fromHash || day.dateHash > toHash)
1121
+ const localDays = daysModel.value.filter(
1122
+ day => day.dateHash < fromHash || day.dateHash > toHash
1123
+ )
1029
1124
 
1030
- const ranges = rangeModel.value
1031
- .filter(({ from, to }) => to.dateHash < fromHash || from.dateHash > toHash)
1125
+ const ranges = rangeModel.value.filter(
1126
+ ({ from, to }) => to.dateHash < fromHash || from.dateHash > toHash
1127
+ )
1032
1128
 
1033
- value = days.concat(ranges).concat(date).map(entry => encodeEntry(entry))
1034
- }
1035
- else {
1129
+ value = localDays
1130
+ .concat(ranges)
1131
+ .concat(date)
1132
+ .map(entry => encodeEntry(entry))
1133
+ } else {
1036
1134
  const model = normalizedModel.value.slice()
1037
1135
  model.push(encodeEntry(date))
1038
1136
  value = model
1039
1137
  }
1040
- }
1041
- else {
1138
+ } else {
1042
1139
  value = encodeEntry(date)
1043
1140
  }
1044
1141
 
1045
1142
  emitValue(value, 'add', date)
1046
1143
  }
1047
1144
 
1048
- function removeFromModel (date) {
1145
+ function removeFromModel(date) {
1049
1146
  if (props.noUnset === true) return
1050
1147
 
1051
1148
  let model = null
@@ -1054,16 +1151,13 @@ export default createComponent({
1054
1151
  const val = encodeEntry(date)
1055
1152
 
1056
1153
  if (date.from !== void 0) {
1057
- model = props.modelValue.filter(
1058
- date => (
1059
- date.from !== void 0
1060
- ? (date.from !== val.from && date.to !== val.to)
1061
- : true
1062
- )
1154
+ model = props.modelValue.filter(item =>
1155
+ item.from !== void 0
1156
+ ? item.from !== val.from && item.to !== val.to
1157
+ : true
1063
1158
  )
1064
- }
1065
- else {
1066
- model = props.modelValue.filter(date => date !== val)
1159
+ } else {
1160
+ model = props.modelValue.filter(item => item !== val)
1067
1161
  }
1068
1162
 
1069
1163
  if (model.length === 0) {
@@ -1074,324 +1168,500 @@ export default createComponent({
1074
1168
  emitValue(model, 'remove', date)
1075
1169
  }
1076
1170
 
1077
- function updateValue (mask, locale, reason) {
1171
+ function updateValue(dateMask, dateLocale, reason) {
1078
1172
  const model = daysModel.value
1079
1173
  .concat(rangeModel.value)
1080
- .map(entry => encodeEntry(entry, mask, locale))
1081
- .filter(entry => {
1082
- return entry.from !== void 0
1174
+ .map(entry => encodeEntry(entry, dateMask, dateLocale))
1175
+ .filter(entry =>
1176
+ entry.from !== void 0
1083
1177
  ? entry.from.dateHash !== null && entry.to.dateHash !== null
1084
1178
  : entry.dateHash !== null
1085
- })
1179
+ )
1086
1180
 
1087
- const value = (props.multiple === true ? model : model[ 0 ]) || null
1181
+ const value = (props.multiple === true ? model : model[0]) || null
1088
1182
 
1089
1183
  setLastValue(value)
1090
1184
  emit('update:modelValue', value, reason)
1091
1185
  }
1092
1186
 
1093
- function getHeader () {
1187
+ function getHeader() {
1094
1188
  if (props.minimal === true) return
1095
1189
 
1096
- return h('div', {
1097
- class: 'q-date__header ' + headerClass.value
1098
- }, [
1099
- h('div', {
1100
- class: 'relative-position'
1101
- }, [
1102
- h(Transition, {
1103
- name: 'q-transition--fade'
1104
- }, () => h('div', {
1105
- key: 'h-yr-' + headerSubtitle.value,
1106
- class: 'q-date__header-subtitle q-date__header-link '
1107
- + (view.value === 'Years' ? 'q-date__header-link--active' : 'cursor-pointer'),
1108
- tabindex: tabindex.value,
1109
- ...getCache('vY', {
1110
- onClick () { view.value = 'Years' },
1111
- onKeyup (e) { e.keyCode === 13 && (view.value = 'Years') }
1112
- })
1113
- }, [ headerSubtitle.value ]))
1114
- ]),
1115
-
1116
- h('div', {
1117
- class: 'q-date__header-title relative-position flex no-wrap'
1118
- }, [
1119
- h('div', {
1120
- class: 'relative-position col'
1121
- }, [
1122
- h(Transition, {
1123
- name: 'q-transition--fade'
1124
- }, () => h('div', {
1125
- key: 'h-sub' + headerTitle.value,
1126
- class: 'q-date__header-title-label q-date__header-link '
1127
- + (view.value === 'Calendar' ? 'q-date__header-link--active' : 'cursor-pointer'),
1128
- tabindex: tabindex.value,
1129
- ...getCache('vC', {
1130
- onClick () { view.value = 'Calendar' },
1131
- onKeyup (e) { e.keyCode === 13 && (view.value = 'Calendar') }
1132
- })
1133
- }, [ headerTitle.value ]))
1134
- ]),
1135
-
1136
- props.todayBtn === true ? h(QBtn, {
1137
- class: 'q-date__header-today self-start',
1138
- icon: $q.iconSet.datetime.today,
1139
- 'aria-label': $q.lang.date.today,
1140
- flat: true,
1141
- size: 'sm',
1142
- round: true,
1143
- tabindex: tabindex.value,
1144
- onClick: setToday
1145
- }) : null
1146
- ])
1147
- ])
1190
+ return h(
1191
+ 'div',
1192
+ {
1193
+ class: 'q-date__header ' + headerClass.value
1194
+ },
1195
+ [
1196
+ h(
1197
+ 'div',
1198
+ {
1199
+ class: 'relative-position'
1200
+ },
1201
+ [
1202
+ h(
1203
+ Transition,
1204
+ {
1205
+ name: 'q-transition--fade'
1206
+ },
1207
+ () =>
1208
+ h(
1209
+ 'div',
1210
+ {
1211
+ key: 'h-yr-' + headerSubtitle.value,
1212
+ class:
1213
+ 'q-date__header-subtitle q-date__header-link ' +
1214
+ (view.value === 'Years'
1215
+ ? 'q-date__header-link--active'
1216
+ : 'cursor-pointer'),
1217
+ tabindex: tabindex.value,
1218
+ ...getCache('vY', {
1219
+ onClick() {
1220
+ view.value = 'Years'
1221
+ },
1222
+ onKeyup(e) {
1223
+ if (e.keyCode === 13) {
1224
+ view.value = 'Years'
1225
+ }
1226
+ }
1227
+ })
1228
+ },
1229
+ [headerSubtitle.value]
1230
+ )
1231
+ )
1232
+ ]
1233
+ ),
1234
+
1235
+ h(
1236
+ 'div',
1237
+ {
1238
+ class: 'q-date__header-title relative-position flex no-wrap'
1239
+ },
1240
+ [
1241
+ h(
1242
+ 'div',
1243
+ {
1244
+ class: 'relative-position col'
1245
+ },
1246
+ [
1247
+ h(
1248
+ Transition,
1249
+ {
1250
+ name: 'q-transition--fade'
1251
+ },
1252
+ () =>
1253
+ h(
1254
+ 'div',
1255
+ {
1256
+ key: 'h-sub' + headerTitle.value,
1257
+ class:
1258
+ 'q-date__header-title-label q-date__header-link ' +
1259
+ (view.value === 'Calendar'
1260
+ ? 'q-date__header-link--active'
1261
+ : 'cursor-pointer'),
1262
+ tabindex: tabindex.value,
1263
+ ...getCache('vC', {
1264
+ onClick() {
1265
+ view.value = 'Calendar'
1266
+ },
1267
+ onKeyup(e) {
1268
+ if (e.keyCode === 13) {
1269
+ view.value = 'Calendar'
1270
+ }
1271
+ }
1272
+ })
1273
+ },
1274
+ [headerTitle.value]
1275
+ )
1276
+ )
1277
+ ]
1278
+ ),
1279
+
1280
+ props.todayBtn === true
1281
+ ? h(QBtn, {
1282
+ class: 'q-date__header-today self-start',
1283
+ icon: $q.iconSet.datetime.today,
1284
+ 'aria-label': $q.lang.date.today,
1285
+ flat: true,
1286
+ size: 'sm',
1287
+ round: true,
1288
+ tabindex: tabindex.value,
1289
+ onClick: setToday
1290
+ })
1291
+ : null
1292
+ ]
1293
+ )
1294
+ ]
1295
+ )
1148
1296
  }
1149
1297
 
1150
- function getNavigation ({ label, type, key, dir, goTo, boundaries, cls }) {
1298
+ function getNavigation({ label, type, key, dir, goTo, boundaries, cls }) {
1151
1299
  return [
1152
- h('div', {
1153
- class: 'row items-center q-date__arrow'
1154
- }, [
1155
- h(QBtn, {
1156
- round: true,
1157
- dense: true,
1158
- size: 'sm',
1159
- flat: true,
1160
- icon: dateArrow.value[ 0 ],
1161
- 'aria-label': type === 'Years' ? $q.lang.date.prevYear : $q.lang.date.prevMonth,
1162
- tabindex: tabindex.value,
1163
- disable: boundaries.prev === false,
1164
- ...getCache('go-#' + type, { onClick () { goTo(-1) } })
1165
- })
1166
- ]),
1167
-
1168
- h('div', {
1169
- class: 'relative-position overflow-hidden flex flex-center' + cls
1170
- }, [
1171
- h(Transition, {
1172
- name: 'q-transition--jump-' + dir
1173
- }, () => h('div', { key }, [
1300
+ h(
1301
+ 'div',
1302
+ {
1303
+ class: 'row items-center q-date__arrow'
1304
+ },
1305
+ [
1174
1306
  h(QBtn, {
1307
+ round: true,
1308
+ dense: true,
1309
+ size: 'sm',
1175
1310
  flat: true,
1311
+ icon: dateArrow.value[0],
1312
+ 'aria-label':
1313
+ type === 'Years'
1314
+ ? $q.lang.date.prevYear
1315
+ : $q.lang.date.prevMonth,
1316
+ tabindex: tabindex.value,
1317
+ disable: boundaries.prev === false,
1318
+ ...getCache('go-#' + type, {
1319
+ onClick() {
1320
+ goTo(-1)
1321
+ }
1322
+ })
1323
+ })
1324
+ ]
1325
+ ),
1326
+
1327
+ h(
1328
+ 'div',
1329
+ {
1330
+ class: 'relative-position overflow-hidden flex flex-center' + cls
1331
+ },
1332
+ [
1333
+ h(
1334
+ Transition,
1335
+ {
1336
+ name: 'q-transition--jump-' + dir
1337
+ },
1338
+ () =>
1339
+ h('div', { key }, [
1340
+ h(QBtn, {
1341
+ flat: true,
1342
+ dense: true,
1343
+ noCaps: true,
1344
+ label,
1345
+ tabindex: tabindex.value,
1346
+ ...getCache('view#' + type, {
1347
+ onClick: () => {
1348
+ view.value = type
1349
+ }
1350
+ })
1351
+ })
1352
+ ])
1353
+ )
1354
+ ]
1355
+ ),
1356
+
1357
+ h(
1358
+ 'div',
1359
+ {
1360
+ class: 'row items-center q-date__arrow'
1361
+ },
1362
+ [
1363
+ h(QBtn, {
1364
+ round: true,
1176
1365
  dense: true,
1177
- noCaps: true,
1178
- label,
1366
+ size: 'sm',
1367
+ flat: true,
1368
+ icon: dateArrow.value[1],
1369
+ 'aria-label':
1370
+ type === 'Years'
1371
+ ? $q.lang.date.nextYear
1372
+ : $q.lang.date.nextMonth,
1179
1373
  tabindex: tabindex.value,
1180
- ...getCache('view#' + type, { onClick: () => { view.value = type } })
1374
+ disable: boundaries.next === false,
1375
+ ...getCache('go+#' + type, {
1376
+ onClick() {
1377
+ goTo(1)
1378
+ }
1379
+ })
1181
1380
  })
1182
- ]))
1183
- ]),
1184
-
1185
- h('div', {
1186
- class: 'row items-center q-date__arrow'
1187
- }, [
1188
- h(QBtn, {
1189
- round: true,
1190
- dense: true,
1191
- size: 'sm',
1192
- flat: true,
1193
- icon: dateArrow.value[ 1 ],
1194
- 'aria-label': type === 'Years' ? $q.lang.date.nextYear : $q.lang.date.nextMonth,
1195
- tabindex: tabindex.value,
1196
- disable: boundaries.next === false,
1197
- ...getCache('go+#' + type, { onClick () { goTo(1) } })
1198
- })
1199
- ])
1381
+ ]
1382
+ )
1200
1383
  ]
1201
1384
  }
1202
1385
 
1203
1386
  const renderViews = {
1204
- Calendar: () => ([
1205
- h('div', {
1206
- key: 'calendar-view',
1207
- class: 'q-date__view q-date__calendar'
1208
- }, [
1209
- h('div', {
1210
- class: 'q-date__navigation row items-center no-wrap'
1211
- }, getNavigation({
1212
- label: innerLocale.value.months[ viewModel.value.month - 1 ],
1213
- type: 'Months',
1214
- key: viewModel.value.month,
1215
- dir: monthDirection.value,
1216
- goTo: goToMonth,
1217
- boundaries: navBoundaries.value.month,
1218
- cls: ' col'
1219
- }).concat(getNavigation({
1220
- label: viewModel.value.year,
1221
- type: 'Years',
1222
- key: viewModel.value.year,
1223
- dir: yearDirection.value,
1224
- goTo: goToYear,
1225
- boundaries: navBoundaries.value.year,
1226
- cls: ''
1227
- }))),
1228
-
1229
- h('div', {
1230
- class: 'q-date__calendar-weekdays row items-center no-wrap'
1231
- }, daysOfWeek.value.map(day => h('div', { class: 'q-date__calendar-item' }, [ h('div', day) ]))),
1232
-
1233
- h('div', {
1234
- class: 'q-date__calendar-days-container relative-position overflow-hidden'
1235
- }, [
1236
- h(Transition, {
1237
- name: 'q-transition--slide-' + monthDirection.value
1238
- }, () => h('div', {
1239
- key: viewMonthHash.value,
1240
- class: 'q-date__calendar-days fit'
1241
- }, days.value.map(day => h('div', { class: day.classes }, [
1242
- day.in === true
1243
- ? h(
1244
- QBtn, {
1245
- class: day.today === true ? 'q-date__today' : '',
1246
- dense: true,
1247
- flat: day.flat,
1248
- unelevated: day.unelevated,
1249
- color: day.color,
1250
- textColor: day.textColor,
1251
- label: day.i,
1252
- tabindex: tabindex.value,
1253
- ...getCache('day#' + day.i, {
1254
- onClick: () => { onDayClick(day.i) },
1255
- onMouseover: () => { onDayMouseover(day.i) }
1256
- })
1387
+ Calendar: () => [
1388
+ h(
1389
+ 'div',
1390
+ {
1391
+ key: 'calendar-view',
1392
+ class: 'q-date__view q-date__calendar'
1393
+ },
1394
+ [
1395
+ h(
1396
+ 'div',
1397
+ {
1398
+ class: 'q-date__navigation row items-center no-wrap'
1399
+ },
1400
+ getNavigation({
1401
+ label: innerLocale.value.months[viewModel.value.month - 1],
1402
+ type: 'Months',
1403
+ key: viewModel.value.month,
1404
+ dir: monthDirection.value,
1405
+ goTo: goToMonth,
1406
+ boundaries: navBoundaries.value.month,
1407
+ cls: ' col'
1408
+ }).concat(
1409
+ getNavigation({
1410
+ label: viewModel.value.year,
1411
+ type: 'Years',
1412
+ key: viewModel.value.year,
1413
+ dir: yearDirection.value,
1414
+ goTo: goToYear,
1415
+ boundaries: navBoundaries.value.year,
1416
+ cls: ''
1417
+ })
1418
+ )
1419
+ ),
1420
+
1421
+ h(
1422
+ 'div',
1423
+ {
1424
+ class: 'q-date__calendar-weekdays row items-center no-wrap'
1425
+ },
1426
+ daysOfWeek.value.map(day =>
1427
+ h('div', { class: 'q-date__calendar-item' }, [h('div', day)])
1428
+ )
1429
+ ),
1430
+
1431
+ h(
1432
+ 'div',
1433
+ {
1434
+ class:
1435
+ 'q-date__calendar-days-container relative-position overflow-hidden'
1436
+ },
1437
+ [
1438
+ h(
1439
+ Transition,
1440
+ {
1441
+ name: 'q-transition--slide-' + monthDirection.value
1257
1442
  },
1258
- day.event !== false
1259
- ? () => h('div', { class: 'q-date__event bg-' + day.event })
1260
- : null
1443
+ () =>
1444
+ h(
1445
+ 'div',
1446
+ {
1447
+ key: viewMonthHash.value,
1448
+ class: 'q-date__calendar-days fit'
1449
+ },
1450
+ days.value.map(day =>
1451
+ h('div', { class: day.classes }, [
1452
+ day.in === true
1453
+ ? h(
1454
+ QBtn,
1455
+ {
1456
+ class:
1457
+ day.today === true ? 'q-date__today' : '',
1458
+ dense: true,
1459
+ flat: day.flat,
1460
+ unelevated: day.unelevated,
1461
+ color: day.color,
1462
+ textColor: day.textColor,
1463
+ label: day.i,
1464
+ tabindex: tabindex.value,
1465
+ ...getCache('day#' + day.i, {
1466
+ onClick: () => {
1467
+ onDayClick(day.i)
1468
+ },
1469
+ onMouseover: () => {
1470
+ onDayMouseover(day.i)
1471
+ }
1472
+ })
1473
+ },
1474
+ day.event !== false
1475
+ ? () =>
1476
+ h('div', {
1477
+ class: 'q-date__event bg-' + day.event
1478
+ })
1479
+ : null
1480
+ )
1481
+ : h('div', String(day.i))
1482
+ ])
1483
+ )
1484
+ )
1261
1485
  )
1262
- : h('div', '' + day.i)
1263
- ]))))
1264
- ])
1265
- ])
1266
- ]),
1486
+ ]
1487
+ )
1488
+ ]
1489
+ )
1490
+ ],
1267
1491
 
1268
- Months () {
1492
+ Months() {
1269
1493
  const currentYear = viewModel.value.year === today.value.year
1270
- const isDisabled = month => {
1271
- return (
1272
- (minNav.value !== null && viewModel.value.year === minNav.value.year && minNav.value.month > month)
1273
- || (maxNav.value !== null && viewModel.value.year === maxNav.value.year && maxNav.value.month < month)
1274
- )
1275
- }
1494
+ const isDisabled = month =>
1495
+ (minNav.value !== null &&
1496
+ viewModel.value.year === minNav.value.year &&
1497
+ minNav.value.month > month) ||
1498
+ (maxNav.value !== null &&
1499
+ viewModel.value.year === maxNav.value.year &&
1500
+ maxNav.value.month < month)
1276
1501
 
1277
1502
  const content = innerLocale.value.monthsShort.map((month, i) => {
1278
1503
  const active = viewModel.value.month === i + 1
1279
1504
 
1280
- return h('div', {
1281
- class: 'q-date__months-item flex flex-center'
1282
- }, [
1283
- h(QBtn, {
1284
- class: currentYear === true && today.value.month === i + 1 ? 'q-date__today' : null,
1285
- flat: active !== true,
1286
- label: month,
1287
- unelevated: active,
1288
- color: active === true ? computedColor.value : null,
1289
- textColor: active === true ? computedTextColor.value : null,
1290
- tabindex: tabindex.value,
1291
- disable: isDisabled(i + 1),
1292
- ...getCache('month#' + i, { onClick: () => { setMonth(i + 1) } })
1293
- })
1294
- ])
1505
+ return h(
1506
+ 'div',
1507
+ {
1508
+ class: 'q-date__months-item flex flex-center'
1509
+ },
1510
+ [
1511
+ h(QBtn, {
1512
+ class:
1513
+ currentYear === true && today.value.month === i + 1
1514
+ ? 'q-date__today'
1515
+ : null,
1516
+ flat: active !== true,
1517
+ label: month,
1518
+ unelevated: active,
1519
+ color: active === true ? computedColor.value : null,
1520
+ textColor: active === true ? computedTextColor.value : null,
1521
+ tabindex: tabindex.value,
1522
+ disable: isDisabled(i + 1),
1523
+ ...getCache('month#' + i, {
1524
+ onClick: () => {
1525
+ setMonth(i + 1)
1526
+ }
1527
+ })
1528
+ })
1529
+ ]
1530
+ )
1295
1531
  })
1296
1532
 
1297
- props.yearsInMonthView === true && content.unshift(
1298
- h('div', { class: 'row no-wrap full-width' }, [
1299
- getNavigation({
1300
- label: viewModel.value.year,
1301
- type: 'Years',
1302
- key: viewModel.value.year,
1303
- dir: yearDirection.value,
1304
- goTo: goToYear,
1305
- boundaries: navBoundaries.value.year,
1306
- cls: ' col'
1307
- })
1308
- ])
1309
- )
1533
+ if (props.yearsInMonthView === true) {
1534
+ content.unshift(
1535
+ h('div', { class: 'row no-wrap full-width' }, [
1536
+ getNavigation({
1537
+ label: viewModel.value.year,
1538
+ type: 'Years',
1539
+ key: viewModel.value.year,
1540
+ dir: yearDirection.value,
1541
+ goTo: goToYear,
1542
+ boundaries: navBoundaries.value.year,
1543
+ cls: ' col'
1544
+ })
1545
+ ])
1546
+ )
1547
+ }
1310
1548
 
1311
- return h('div', {
1312
- key: 'months-view',
1313
- class: 'q-date__view q-date__months flex flex-center'
1314
- }, content)
1549
+ return h(
1550
+ 'div',
1551
+ {
1552
+ key: 'months-view',
1553
+ class: 'q-date__view q-date__months flex flex-center'
1554
+ },
1555
+ content
1556
+ )
1315
1557
  },
1316
1558
 
1317
- Years () {
1318
- const
1319
- start = startYear.value,
1559
+ Years() {
1560
+ const start = startYear.value,
1320
1561
  stop = start + yearsInterval,
1321
1562
  years = []
1322
1563
 
1323
- const isDisabled = year => {
1324
- return (
1325
- (minNav.value !== null && minNav.value.year > year)
1326
- || (maxNav.value !== null && maxNav.value.year < year)
1327
- )
1328
- }
1564
+ const isDisabled = year =>
1565
+ (minNav.value !== null && minNav.value.year > year) ||
1566
+ (maxNav.value !== null && maxNav.value.year < year)
1329
1567
 
1330
1568
  for (let i = start; i <= stop; i++) {
1331
1569
  const active = viewModel.value.year === i
1332
1570
 
1333
1571
  years.push(
1334
- h('div', {
1335
- class: 'q-date__years-item flex flex-center'
1336
- }, [
1337
- h(QBtn, {
1338
- key: 'yr' + i,
1339
- class: today.value.year === i ? 'q-date__today' : null,
1340
- flat: !active,
1341
- label: i,
1342
- dense: true,
1343
- unelevated: active,
1344
- color: active === true ? computedColor.value : null,
1345
- textColor: active === true ? computedTextColor.value : null,
1346
- tabindex: tabindex.value,
1347
- disable: isDisabled(i),
1348
- ...getCache('yr#' + i, { onClick: () => { setYear(i) } })
1349
- })
1350
- ])
1572
+ h(
1573
+ 'div',
1574
+ {
1575
+ class: 'q-date__years-item flex flex-center'
1576
+ },
1577
+ [
1578
+ h(QBtn, {
1579
+ key: 'yr' + i,
1580
+ class: today.value.year === i ? 'q-date__today' : null,
1581
+ flat: !active,
1582
+ label: i,
1583
+ dense: true,
1584
+ unelevated: active,
1585
+ color: active === true ? computedColor.value : null,
1586
+ textColor: active === true ? computedTextColor.value : null,
1587
+ tabindex: tabindex.value,
1588
+ disable: isDisabled(i),
1589
+ ...getCache('yr#' + i, {
1590
+ onClick: () => {
1591
+ setYear(i)
1592
+ }
1593
+ })
1594
+ })
1595
+ ]
1596
+ )
1351
1597
  )
1352
1598
  }
1353
1599
 
1354
- return h('div', {
1355
- class: 'q-date__view q-date__years flex flex-center'
1356
- }, [
1357
- h('div', {
1358
- class: 'col-auto'
1359
- }, [
1360
- h(QBtn, {
1361
- round: true,
1362
- dense: true,
1363
- flat: true,
1364
- icon: dateArrow.value[ 0 ],
1365
- 'aria-label': $q.lang.date.prevRangeYears(yearsInterval),
1366
- tabindex: tabindex.value,
1367
- disable: isDisabled(start),
1368
- ...getCache('y-', { onClick: () => { startYear.value -= yearsInterval } })
1369
- })
1370
- ]),
1600
+ return h(
1601
+ 'div',
1602
+ {
1603
+ class: 'q-date__view q-date__years flex flex-center'
1604
+ },
1605
+ [
1606
+ h(
1607
+ 'div',
1608
+ {
1609
+ class: 'col-auto'
1610
+ },
1611
+ [
1612
+ h(QBtn, {
1613
+ round: true,
1614
+ dense: true,
1615
+ flat: true,
1616
+ icon: dateArrow.value[0],
1617
+ 'aria-label': $q.lang.date.prevRangeYears(yearsInterval),
1618
+ tabindex: tabindex.value,
1619
+ disable: isDisabled(start),
1620
+ ...getCache('y-', {
1621
+ onClick: () => {
1622
+ startYear.value -= yearsInterval
1623
+ }
1624
+ })
1625
+ })
1626
+ ]
1627
+ ),
1371
1628
 
1372
- h('div', {
1373
- class: 'q-date__years-content col self-stretch row items-center'
1374
- }, years),
1629
+ h(
1630
+ 'div',
1631
+ {
1632
+ class: 'q-date__years-content col self-stretch row items-center'
1633
+ },
1634
+ years
1635
+ ),
1375
1636
 
1376
- h('div', {
1377
- class: 'col-auto'
1378
- }, [
1379
- h(QBtn, {
1380
- round: true,
1381
- dense: true,
1382
- flat: true,
1383
- icon: dateArrow.value[ 1 ],
1384
- 'aria-label': $q.lang.date.nextRangeYears(yearsInterval),
1385
- tabindex: tabindex.value,
1386
- disable: isDisabled(stop),
1387
- ...getCache('y+', { onClick: () => { startYear.value += yearsInterval } })
1388
- })
1389
- ])
1390
- ])
1637
+ h(
1638
+ 'div',
1639
+ {
1640
+ class: 'col-auto'
1641
+ },
1642
+ [
1643
+ h(QBtn, {
1644
+ round: true,
1645
+ dense: true,
1646
+ flat: true,
1647
+ icon: dateArrow.value[1],
1648
+ 'aria-label': $q.lang.date.nextRangeYears(yearsInterval),
1649
+ tabindex: tabindex.value,
1650
+ disable: isDisabled(stop),
1651
+ ...getCache('y+', {
1652
+ onClick: () => {
1653
+ startYear.value += yearsInterval
1654
+ }
1655
+ })
1656
+ })
1657
+ ]
1658
+ )
1659
+ ]
1660
+ )
1391
1661
  }
1392
1662
  }
1393
1663
 
1394
- function onDayClick (dayIndex) {
1664
+ function onDayClick(dayIndex) {
1395
1665
  const day = { ...viewModel.value, day: dayIndex }
1396
1666
 
1397
1667
  if (props.range === false) {
@@ -1400,10 +1670,16 @@ export default createComponent({
1400
1670
  }
1401
1671
 
1402
1672
  if (editRange.value === null) {
1403
- const dayProps = days.value.find(day => day.fill !== true && day.i === dayIndex)
1673
+ const dayProps = days.value.find(
1674
+ item => item.fill !== true && item.i === dayIndex
1675
+ )
1404
1676
 
1405
1677
  if (props.noUnset !== true && dayProps.range !== void 0) {
1406
- removeFromModel({ target: day, from: dayProps.range.from, to: dayProps.range.to })
1678
+ removeFromModel({
1679
+ target: day,
1680
+ from: dayProps.range.from,
1681
+ to: dayProps.range.to
1682
+ })
1407
1683
  return
1408
1684
  }
1409
1685
 
@@ -1422,14 +1698,13 @@ export default createComponent({
1422
1698
  }
1423
1699
 
1424
1700
  emit('rangeStart', getShortDate(day))
1425
- }
1426
- else {
1427
- const
1428
- initHash = editRange.value.initHash,
1701
+ } else {
1702
+ const initHash = editRange.value.initHash,
1429
1703
  finalHash = getDayHash(day),
1430
- payload = initHash <= finalHash
1431
- ? { from: editRange.value.init, to: day }
1432
- : { from: day, to: editRange.value.init }
1704
+ payload =
1705
+ initHash <= finalHash
1706
+ ? { from: editRange.value.init, to: day }
1707
+ : { from: day, to: editRange.value.init }
1433
1708
 
1434
1709
  editRange.value = null
1435
1710
  addToModel(initHash === finalHash ? day : { target: day, ...payload })
@@ -1441,7 +1716,7 @@ export default createComponent({
1441
1716
  }
1442
1717
  }
1443
1718
 
1444
- function onDayMouseover (dayIndex) {
1719
+ function onDayMouseover(dayIndex) {
1445
1720
  if (editRange.value !== null) {
1446
1721
  const final = { ...viewModel.value, day: dayIndex }
1447
1722
 
@@ -1454,41 +1729,61 @@ export default createComponent({
1454
1729
 
1455
1730
  // expose public methods
1456
1731
  Object.assign(proxy, {
1457
- setToday, setView, offsetCalendar, setCalendarTo, setEditingRange
1732
+ setToday,
1733
+ setView,
1734
+ offsetCalendar,
1735
+ setCalendarTo,
1736
+ setEditingRange
1458
1737
  })
1459
1738
 
1460
1739
  return () => {
1461
1740
  const content = [
1462
- h('div', {
1463
- class: 'q-date__content col relative-position'
1464
- }, [
1465
- h(Transition, {
1466
- name: 'q-transition--fade'
1467
- }, renderViews[ view.value ])
1468
- ])
1741
+ h(
1742
+ 'div',
1743
+ {
1744
+ class: 'q-date__content col relative-position'
1745
+ },
1746
+ [
1747
+ h(
1748
+ Transition,
1749
+ {
1750
+ name: 'q-transition--fade'
1751
+ },
1752
+ renderViews[view.value]
1753
+ )
1754
+ ]
1755
+ )
1469
1756
  ]
1470
1757
 
1471
1758
  const def = hSlot(slots.default)
1472
- def !== void 0 && content.push(
1473
- h('div', { class: 'q-date__actions' }, def)
1474
- )
1759
+ if (def !== void 0) {
1760
+ content.push(h('div', { class: 'q-date__actions' }, def))
1761
+ }
1475
1762
 
1476
1763
  if (props.name !== void 0 && props.disable !== true) {
1477
1764
  injectFormInput(content, 'push')
1478
1765
  }
1479
1766
 
1480
- return h('div', {
1481
- class: classes.value,
1482
- ...attributes.value
1483
- }, [
1484
- getHeader(),
1485
-
1486
- h('div', {
1487
- ref: blurTargetRef,
1488
- class: 'q-date__main col column',
1489
- tabindex: -1
1490
- }, content)
1491
- ])
1767
+ return h(
1768
+ 'div',
1769
+ {
1770
+ class: classes.value,
1771
+ ...attributes.value
1772
+ },
1773
+ [
1774
+ getHeader(),
1775
+
1776
+ h(
1777
+ 'div',
1778
+ {
1779
+ ref: blurTargetRef,
1780
+ class: 'q-date__main col column',
1781
+ tabindex: -1
1782
+ },
1783
+ content
1784
+ )
1785
+ ]
1786
+ )
1492
1787
  }
1493
1788
  }
1494
1789
  })