quasar 2.3.2 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/dist/api/AppFullscreen.json +15 -8
  2. package/dist/api/BottomSheet.json +6 -0
  3. package/dist/api/Cookies.json +4 -3
  4. package/dist/api/Dialog.json +24 -10
  5. package/dist/api/Loading.json +0 -2
  6. package/dist/api/LoadingBar.json +8 -3
  7. package/dist/api/Morph.json +14 -7
  8. package/dist/api/Mutation.json +1 -1
  9. package/dist/api/Notify.json +41 -27
  10. package/dist/api/QAjaxBar.json +6 -3
  11. package/dist/api/QBreadcrumbs.json +8 -4
  12. package/dist/api/QBreadcrumbsEl.json +35 -12
  13. package/dist/api/QBtn.json +36 -17
  14. package/dist/api/QBtnDropdown.json +41 -20
  15. package/dist/api/QBtnToggle.json +7 -2
  16. package/dist/api/QCard.json +2 -1
  17. package/dist/api/QCardActions.json +2 -1
  18. package/dist/api/QCardSection.json +2 -1
  19. package/dist/api/QCarousel.json +10 -5
  20. package/dist/api/QCarouselControl.json +4 -2
  21. package/dist/api/QChatMessage.json +0 -4
  22. package/dist/api/QCheckbox.json +8 -4
  23. package/dist/api/QChip.json +2 -1
  24. package/dist/api/QCircularProgress.json +14 -7
  25. package/dist/api/QColor.json +6 -3
  26. package/dist/api/QDate.json +33 -5
  27. package/dist/api/QDialog.json +8 -4
  28. package/dist/api/QDrawer.json +10 -5
  29. package/dist/api/QEditor.json +10 -5
  30. package/dist/api/QExpansionItem.json +36 -13
  31. package/dist/api/QFab.json +41 -6
  32. package/dist/api/QFabAction.json +12 -2
  33. package/dist/api/QField.json +3 -1
  34. package/dist/api/QFile.json +8 -2
  35. package/dist/api/QFooter.json +2 -1
  36. package/dist/api/QForm.json +1 -1
  37. package/dist/api/QHeader.json +4 -2
  38. package/dist/api/QIcon.json +2 -1
  39. package/dist/api/QImg.json +8 -4
  40. package/dist/api/QInfiniteScroll.json +6 -3
  41. package/dist/api/QInnerLoading.json +8 -4
  42. package/dist/api/QInput.json +3 -1
  43. package/dist/api/QIntersection.json +4 -2
  44. package/dist/api/QItem.json +33 -11
  45. package/dist/api/QKnob.json +8 -4
  46. package/dist/api/QLayout.json +9 -1
  47. package/dist/api/QLinearProgress.json +4 -2
  48. package/dist/api/QMarkupTable.json +2 -1
  49. package/dist/api/QMenu.json +8 -4
  50. package/dist/api/QNoSsr.json +2 -1
  51. package/dist/api/QOptionGroup.json +76 -5
  52. package/dist/api/QPage.json +2 -1
  53. package/dist/api/QPageScroller.json +8 -4
  54. package/dist/api/QPageSticky.json +2 -1
  55. package/dist/api/QPagination.json +10 -6
  56. package/dist/api/QParallax.json +2 -1
  57. package/dist/api/QPopupEdit.json +5 -2
  58. package/dist/api/QPopupProxy.json +7 -4
  59. package/dist/api/QRange.json +600 -111
  60. package/dist/api/QRating.json +5 -2
  61. package/dist/api/QResizeObserver.json +4 -1
  62. package/dist/api/QRouteTab.json +35 -13
  63. package/dist/api/QScrollArea.json +29 -6
  64. package/dist/api/QScrollObserver.json +13 -1
  65. package/dist/api/QSelect.json +76 -47
  66. package/dist/api/QSeparator.json +2 -1
  67. package/dist/api/QSkeleton.json +8 -4
  68. package/dist/api/QSlideItem.json +9 -0
  69. package/dist/api/QSlideTransition.json +2 -1
  70. package/dist/api/QSlider.json +512 -43
  71. package/dist/api/QSpinner.json +2 -1
  72. package/dist/api/QSplitter.json +4 -2
  73. package/dist/api/QStep.json +2 -1
  74. package/dist/api/QStepper.json +6 -3
  75. package/dist/api/QTab.json +4 -2
  76. package/dist/api/QTabPanels.json +6 -3
  77. package/dist/api/QTable.json +154 -88
  78. package/dist/api/QTabs.json +4 -2
  79. package/dist/api/QTime.json +16 -4
  80. package/dist/api/QTimeline.json +4 -2
  81. package/dist/api/QTimelineEntry.json +4 -2
  82. package/dist/api/QToggle.json +8 -4
  83. package/dist/api/QTooltip.json +18 -9
  84. package/dist/api/QTree.json +34 -19
  85. package/dist/api/QUploader.json +28 -6
  86. package/dist/api/QVirtualScroll.json +26 -11
  87. package/dist/api/ScrollFire.json +1 -1
  88. package/dist/api/TouchHold.json +2 -1
  89. package/dist/api/TouchRepeat.json +2 -1
  90. package/dist/api/TouchSwipe.json +2 -1
  91. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  92. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  93. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  94. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  95. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  96. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  97. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  98. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  99. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  100. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  101. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  102. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  103. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  104. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  105. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  106. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  107. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  108. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  109. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  110. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  111. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  112. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  113. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  114. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  115. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  116. package/dist/icon-set/svg-mdi-v4.umd.prod.js +1 -1
  117. package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
  118. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  119. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  120. package/dist/icon-set/themify.umd.prod.js +1 -1
  121. package/dist/lang/ar.umd.prod.js +1 -1
  122. package/dist/lang/az-Latn.umd.prod.js +1 -1
  123. package/dist/lang/bg.umd.prod.js +1 -1
  124. package/dist/lang/bn.umd.prod.js +1 -1
  125. package/dist/lang/ca.umd.prod.js +1 -1
  126. package/dist/lang/cs.umd.prod.js +1 -1
  127. package/dist/lang/da.umd.prod.js +1 -1
  128. package/dist/lang/de.umd.prod.js +1 -1
  129. package/dist/lang/el.umd.prod.js +1 -1
  130. package/dist/lang/en-GB.umd.prod.js +1 -1
  131. package/dist/lang/en-US.umd.prod.js +1 -1
  132. package/dist/lang/eo.umd.prod.js +1 -1
  133. package/dist/lang/es.umd.prod.js +1 -1
  134. package/dist/lang/et.umd.prod.js +1 -1
  135. package/dist/lang/fa-IR.umd.prod.js +1 -1
  136. package/dist/lang/fa.umd.prod.js +1 -1
  137. package/dist/lang/fi.umd.prod.js +1 -1
  138. package/dist/lang/fr.umd.prod.js +1 -1
  139. package/dist/lang/gn.umd.prod.js +1 -1
  140. package/dist/lang/he.umd.prod.js +1 -1
  141. package/dist/lang/hr.umd.prod.js +1 -1
  142. package/dist/lang/hu.umd.prod.js +1 -1
  143. package/dist/lang/id.umd.prod.js +1 -1
  144. package/dist/lang/is.umd.prod.js +1 -1
  145. package/dist/lang/it.umd.prod.js +1 -1
  146. package/dist/lang/ja.umd.prod.js +1 -1
  147. package/dist/lang/km.umd.prod.js +1 -1
  148. package/dist/lang/ko-KR.umd.prod.js +1 -1
  149. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  150. package/dist/lang/lt.umd.prod.js +1 -1
  151. package/dist/lang/lu.umd.prod.js +1 -1
  152. package/dist/lang/lv.umd.prod.js +1 -1
  153. package/dist/lang/ml.umd.prod.js +1 -1
  154. package/dist/lang/ms.umd.prod.js +1 -1
  155. package/dist/lang/nb-NO.umd.prod.js +1 -1
  156. package/dist/lang/nl.umd.prod.js +1 -1
  157. package/dist/lang/pl.umd.prod.js +1 -1
  158. package/dist/lang/pt-BR.umd.prod.js +1 -1
  159. package/dist/lang/pt.umd.prod.js +1 -1
  160. package/dist/lang/ro.umd.prod.js +1 -1
  161. package/dist/lang/ru.umd.prod.js +1 -1
  162. package/dist/lang/sk.umd.prod.js +1 -1
  163. package/dist/lang/sl.umd.prod.js +1 -1
  164. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  165. package/dist/lang/sr.umd.prod.js +1 -1
  166. package/dist/lang/sv.umd.prod.js +1 -1
  167. package/dist/lang/ta.umd.prod.js +1 -1
  168. package/dist/lang/th.umd.prod.js +1 -1
  169. package/dist/lang/tr.umd.prod.js +1 -1
  170. package/dist/lang/ug.umd.prod.js +1 -1
  171. package/dist/lang/uk.umd.prod.js +1 -1
  172. package/dist/lang/vi.umd.prod.js +1 -1
  173. package/dist/lang/zh-CN.umd.prod.js +1 -1
  174. package/dist/lang/zh-TW.umd.prod.js +1 -1
  175. package/dist/quasar.cjs.prod.js +2 -2
  176. package/dist/quasar.css +268 -184
  177. package/dist/quasar.esm.prod.js +2 -2
  178. package/dist/quasar.prod.css +1 -1
  179. package/dist/quasar.rtl.css +340 -263
  180. package/dist/quasar.rtl.prod.css +1 -1
  181. package/dist/quasar.sass +272 -212
  182. package/dist/quasar.umd.js +16522 -16213
  183. package/dist/quasar.umd.prod.js +2 -2
  184. package/dist/ssr-directives/Morph.js +1 -1
  185. package/dist/transforms/loader-asset-urls.json +20 -0
  186. package/dist/types/api/cookies.d.ts +1 -1
  187. package/dist/types/api/slider.d.ts +46 -0
  188. package/dist/types/api/validation.d.ts +4 -0
  189. package/dist/types/api.d.ts +2 -0
  190. package/dist/types/composables.d.ts +3 -3
  191. package/dist/types/index.d.ts +759 -177
  192. package/dist/vetur/quasar-attributes.json +251 -83
  193. package/dist/vetur/quasar-tags.json +59 -17
  194. package/dist/web-types/web-types.json +587 -155
  195. package/package.json +1 -1
  196. package/src/api.extends.json +0 -1
  197. package/src/components/breadcrumbs/QBreadcrumbs.js +7 -2
  198. package/src/components/breadcrumbs/QBreadcrumbs.sass +0 -3
  199. package/src/components/breadcrumbs/QBreadcrumbsEl.js +14 -8
  200. package/src/components/btn/QBtn.js +6 -5
  201. package/src/components/btn/use-btn.js +21 -21
  202. package/src/components/btn/use-btn.json +22 -13
  203. package/src/components/btn-dropdown/QBtnDropdown.json +1 -0
  204. package/src/components/btn-toggle/QBtnToggle.json +3 -0
  205. package/src/components/checkbox/use-checkbox.js +1 -1
  206. package/src/components/chip/QChip.json +1 -2
  207. package/src/components/color/QColor.js +32 -26
  208. package/src/components/color/QColor.sass +10 -23
  209. package/src/components/date/QDate.json +25 -1
  210. package/src/components/date/QDate.sass +2 -0
  211. package/src/components/drawer/QDrawer.js +18 -15
  212. package/src/components/editor/QEditor.js +1 -1
  213. package/src/components/editor/QEditor.sass +10 -1
  214. package/src/components/expansion-item/QExpansionItem.js +4 -1
  215. package/src/components/expansion-item/QExpansionItem.json +2 -1
  216. package/src/components/fab/QFab.js +18 -12
  217. package/src/components/fab/QFab.json +36 -1
  218. package/src/components/fab/QFab.sass +1 -1
  219. package/src/components/fab/QFabAction.js +14 -7
  220. package/src/components/fab/QFabAction.json +10 -0
  221. package/src/components/field/QField.json +3 -3
  222. package/src/components/file/QFile.js +12 -5
  223. package/src/components/file/QFile.json +9 -6
  224. package/src/components/file/QFile.sass +4 -2
  225. package/src/components/footer/QFooter.js +1 -1
  226. package/src/components/form/QForm.json +2 -3
  227. package/src/components/header/QHeader.js +1 -1
  228. package/src/components/icon/QIcon.js +2 -2
  229. package/src/components/infinite-scroll/QInfiniteScroll.js +4 -5
  230. package/src/components/item/QItem.js +2 -3
  231. package/src/components/layout/QLayout.json +8 -1
  232. package/src/components/linear-progress/QLinearProgress.js +3 -2
  233. package/src/components/linear-progress/QLinearProgress.sass +1 -1
  234. package/src/components/option-group/QOptionGroup.js +3 -0
  235. package/src/components/option-group/QOptionGroup.json +48 -2
  236. package/src/components/pagination/QPagination.json +0 -1
  237. package/src/components/parallax/QParallax.js +4 -2
  238. package/src/components/popup-edit/QPopupEdit.js +2 -5
  239. package/src/components/popup-edit/QPopupEdit.json +1 -0
  240. package/src/components/popup-proxy/QPopupProxy.json +2 -1
  241. package/src/components/radio/QRadio.js +2 -7
  242. package/src/components/range/QRange.js +103 -222
  243. package/src/components/range/QRange.json +11 -121
  244. package/src/components/rating/QRating.json +1 -1
  245. package/src/components/resize-observer/QResizeObserver.json +2 -0
  246. package/src/components/scroll-area/QScrollArea.js +10 -13
  247. package/src/components/scroll-area/QScrollArea.json +29 -9
  248. package/src/components/scroll-observer/QScrollObserver.json +11 -0
  249. package/src/components/select/QSelect.json +41 -15
  250. package/src/components/slide-item/QSlideItem.json +9 -0
  251. package/src/components/slider/QSlider.js +46 -132
  252. package/src/components/slider/QSlider.json +1 -121
  253. package/src/components/slider/QSlider.sass +198 -132
  254. package/src/components/slider/use-slider.js +453 -109
  255. package/src/components/slider/use-slider.json +546 -0
  256. package/src/components/stepper/QStepper.js +3 -3
  257. package/src/components/stepper/QStepper.sass +24 -26
  258. package/src/components/table/QTable.js +27 -47
  259. package/src/components/table/QTable.json +104 -55
  260. package/src/components/table/table-pagination.js +4 -0
  261. package/src/components/tabs/QRouteTab.js +1 -2
  262. package/src/components/tabs/QRouteTab.json +0 -7
  263. package/src/components/tabs/QTabs.js +71 -20
  264. package/src/components/tabs/use-tab.js +26 -13
  265. package/src/components/time/QTime.json +8 -0
  266. package/src/components/tree/QTree.js +14 -12
  267. package/src/components/tree/QTree.json +26 -21
  268. package/src/components/tree/QTree.sass +45 -41
  269. package/src/components/uploader/QUploader.json +14 -2
  270. package/src/components/uploader/uploader-core.js +16 -9
  271. package/src/components/uploader/xhr-uploader-plugin.json +8 -3
  272. package/src/components/virtual-scroll/QVirtualScroll.json +15 -0
  273. package/src/components/virtual-scroll/QVirtualScroll.sass +1 -0
  274. package/src/components/virtual-scroll/use-virtual-scroll.js +30 -17
  275. package/src/components/virtual-scroll/use-virtual-scroll.json +7 -5
  276. package/src/composables/private/use-field.js +5 -5
  277. package/src/composables/private/use-file.js +20 -5
  278. package/src/composables/private/use-form.js +2 -3
  279. package/src/composables/private/use-fullscreen.js +15 -4
  280. package/src/composables/private/use-router-link.js +44 -23
  281. package/src/composables/private/use-router-link.json +26 -10
  282. package/src/composables/private/use-split-attrs.js +7 -10
  283. package/src/composables/private/use-validate.js +21 -15
  284. package/src/composables/private/use-validate.json +1 -0
  285. package/src/css/core/helpers.sass +3 -0
  286. package/src/css/core/positioning.sass +5 -0
  287. package/src/directives/Mutation.json +2 -3
  288. package/src/directives/ScrollFire.js +1 -0
  289. package/src/directives/ScrollFire.json +2 -3
  290. package/src/icon-set.js +2 -4
  291. package/src/plugins/AppFullscreen.js +70 -53
  292. package/src/plugins/AppFullscreen.json +8 -8
  293. package/src/plugins/AppVisibility.js +2 -3
  294. package/src/plugins/BottomSheet.js +3 -5
  295. package/src/plugins/Cookies.json +2 -2
  296. package/src/plugins/Dialog.js +3 -5
  297. package/src/plugins/Dialog.json +6 -5
  298. package/src/plugins/LoadingBar.js +17 -18
  299. package/src/plugins/LoadingBar.json +4 -3
  300. package/src/plugins/Notify.js +296 -295
  301. package/src/plugins/Notify.json +13 -19
  302. package/src/plugins/Platform.js +14 -14
  303. package/src/utils/date.js +4 -4
  304. package/src/utils/dom.js +2 -2
  305. package/src/utils/open-url.js +2 -2
  306. package/src/utils/patterns.js +1 -0
  307. package/src/utils/private/define-reactive-plugin.js +10 -8
  308. package/src/utils/private/global-dialog.js +6 -8
  309. package/src/utils/private/global-dialog.json +6 -0
  310. package/src/utils/private/inject-obj-prop.js +13 -0
  311. package/src/utils/private/is.js +2 -2
@@ -8,7 +8,7 @@
8
8
  "props": {
9
9
  "model-value": {
10
10
  "extends": "model-value",
11
- "type": [ "Number", "String", "Array", "null", "undefined" ],
11
+ "type": "Any",
12
12
  "desc": "Model of the component; Must be Array if using 'multiple' prop; Either use this property (along with a listener for 'update:modelValue' event) OR use v-model directive",
13
13
  "examples": [ "v-model=\"myModel\"" ]
14
14
  },
@@ -393,6 +393,7 @@
393
393
  "params": {
394
394
  "index": {
395
395
  "type": "Number",
396
+ "required": true,
396
397
  "desc": "Index at which to remove selection",
397
398
  "examples": [ 0 ]
398
399
  }
@@ -405,6 +406,7 @@
405
406
  "params": {
406
407
  "opt": {
407
408
  "type": "Any",
409
+ "required": true,
408
410
  "desc": "Option to add to model",
409
411
  "__exemption": [ "examples" ]
410
412
  }
@@ -446,6 +448,7 @@
446
448
  "params": {
447
449
  "opt": {
448
450
  "type": "Any",
451
+ "required": true,
449
452
  "desc": "Option to add to model",
450
453
  "__exemption": [ "examples" ]
451
454
  }
@@ -458,6 +461,7 @@
458
461
  "params": {
459
462
  "index": {
460
463
  "type": "Number",
464
+ "required": true,
461
465
  "desc": "Index of option from menu",
462
466
  "examples": [ 10 ]
463
467
  }
@@ -484,7 +488,6 @@
484
488
  "value": {
485
489
  "type": "String",
486
490
  "desc": "New text value",
487
- "required": true,
488
491
  "__exemption": [ "examples" ]
489
492
  }
490
493
  }
@@ -499,11 +502,13 @@
499
502
  "definition": {
500
503
  "index": {
501
504
  "type": "Number",
505
+ "required": true,
502
506
  "desc": "Model index at which removal took place",
503
507
  "examples": [ 2 ]
504
508
  },
505
509
  "value": {
506
510
  "type": "Any",
511
+ "required": true,
507
512
  "desc": "The actual value that was removed",
508
513
  "__exemption": [ "examples" ]
509
514
  }
@@ -521,11 +526,13 @@
521
526
  "definition": {
522
527
  "index": {
523
528
  "type": "Number",
529
+ "required": true,
524
530
  "desc": "Model index at which addition took place",
525
531
  "examples": [ 2 ]
526
532
  },
527
533
  "value": {
528
534
  "type": "Any",
535
+ "required": true,
529
536
  "desc": "The actual value that was added",
530
537
  "__exemption": [ "examples" ]
531
538
  }
@@ -548,11 +555,13 @@
548
555
  "params": {
549
556
  "item": {
550
557
  "type": "Any",
558
+ "required": false,
551
559
  "desc": "Item to add",
552
560
  "__exemption": [ "examples" ]
553
561
  },
554
562
  "mode": {
555
563
  "type": "String",
564
+ "required": false,
556
565
  "desc": "Override 'new-value-mode' (prop) behavior should you wish to",
557
566
  "values": [ "add", "add-unique", "toggle" ],
558
567
  "default": "add"
@@ -577,18 +586,21 @@
577
586
  "params": {
578
587
  "callbackFn": {
579
588
  "type": "Function",
589
+ "required": true,
580
590
  "desc": "Callback to call to make the actual updates",
581
591
  "params": null,
582
592
  "returns": null
583
593
  },
584
594
  "afterFn": {
585
595
  "type": "Function",
596
+ "required": false,
586
597
  "desc": "Callback to call at the end after the update has been fully processed by QSelect",
587
598
  "params": {
588
599
  "ref": {
589
- "type": "Object",
590
- "desc": "Vue reference to the QSelect which triggered the filtering",
591
- "__exemption": [ "examples" ]
600
+ "type": "Component",
601
+ "tsType": "QSelect",
602
+ "required": true,
603
+ "desc": "Vue reference to the QSelect which triggered the filtering"
592
604
  }
593
605
  },
594
606
  "returns": null
@@ -629,6 +641,19 @@
629
641
  "__exemption": [ "examples" ]
630
642
  }
631
643
  }
644
+ },
645
+
646
+ "virtual-scroll": {
647
+ "params": {
648
+ "details": {
649
+ "definition": {
650
+ "ref": {
651
+ "tsType": "QSelect",
652
+ "desc": "Vue reference to the QSelect"
653
+ }
654
+ }
655
+ }
656
+ }
632
657
  }
633
658
  },
634
659
 
@@ -650,8 +675,8 @@
650
675
  "params": {
651
676
  "index": {
652
677
  "type": "Number",
653
- "desc": "Index at which to remove selection",
654
678
  "required": true,
679
+ "desc": "Index at which to remove selection",
655
680
  "examples": [ 0 ]
656
681
  }
657
682
  }
@@ -662,8 +687,8 @@
662
687
  "params": {
663
688
  "opt": {
664
689
  "type": "Any",
665
- "desc": "Option to add to model",
666
690
  "required": true,
691
+ "desc": "Option to add to model",
667
692
  "__exemption": [ "examples" ]
668
693
  },
669
694
  "unique": {
@@ -679,8 +704,8 @@
679
704
  "params": {
680
705
  "opt": {
681
706
  "type": "Any",
682
- "desc": "Option to add to model",
683
707
  "required": true,
708
+ "desc": "Option to add to model",
684
709
  "__exemption": [ "examples" ]
685
710
  },
686
711
  "keepOpen": {
@@ -695,8 +720,8 @@
695
720
  "params": {
696
721
  "index": {
697
722
  "type": "Number",
698
- "desc": "Index of option from menu",
699
723
  "required": true,
724
+ "desc": "Index of option from menu",
700
725
  "examples": [ 10 ]
701
726
  }
702
727
  }
@@ -723,8 +748,8 @@
723
748
  "params": {
724
749
  "value": {
725
750
  "type": "String",
726
- "desc": "String to filter with",
727
751
  "required": true,
752
+ "desc": "String to filter with",
728
753
  "examples": [ "car" ]
729
754
  }
730
755
  }
@@ -739,6 +764,7 @@
739
764
  "params": {
740
765
  "value": {
741
766
  "type": "String",
767
+ "required": true,
742
768
  "desc": "String to set the input value to",
743
769
  "examples": [ "hotel" ]
744
770
  },
@@ -754,8 +780,8 @@
754
780
  "params": {
755
781
  "opt": {
756
782
  "type": "Any",
757
- "desc": "Option entry",
758
783
  "required": true,
784
+ "desc": "Option entry",
759
785
  "__exemption": [ "examples" ]
760
786
  }
761
787
  },
@@ -770,8 +796,8 @@
770
796
  "params": {
771
797
  "opt": {
772
798
  "type": "Any",
773
- "desc": "Option entry",
774
799
  "required": true,
800
+ "desc": "Option entry",
775
801
  "__exemption": [ "examples" ]
776
802
  }
777
803
  },
@@ -787,8 +813,8 @@
787
813
  "params": {
788
814
  "opt": {
789
815
  "type": "Any",
790
- "desc": "Option entry",
791
816
  "required": true,
817
+ "desc": "Option entry",
792
818
  "__exemption": [ "examples" ]
793
819
  }
794
820
  },
@@ -804,8 +830,8 @@
804
830
  "params": {
805
831
  "opt": {
806
832
  "type": "Any",
807
- "desc": "Option entry",
808
833
  "required": true,
834
+ "desc": "Option entry",
809
835
  "__exemption": [ "examples" ]
810
836
  }
811
837
  },
@@ -821,8 +847,8 @@
821
847
  "params": {
822
848
  "opt": {
823
849
  "type": "Any",
824
- "desc": "Option entry",
825
850
  "required": true,
851
+ "desc": "Option entry",
826
852
  "__exemption": [ "examples" ]
827
853
  }
828
854
  },
@@ -65,6 +65,7 @@
65
65
  "definition": {
66
66
  "reset": {
67
67
  "type": "Function",
68
+ "required": true,
68
69
  "desc": "When called, it resets the component to its initial non-slided state",
69
70
  "params": null,
70
71
  "returns": null
@@ -83,6 +84,7 @@
83
84
  "definition": {
84
85
  "reset": {
85
86
  "type": "Function",
87
+ "required": true,
86
88
  "desc": "When called, it resets the component to its initial non-slided state",
87
89
  "params": null,
88
90
  "returns": null
@@ -101,6 +103,7 @@
101
103
  "definition": {
102
104
  "reset": {
103
105
  "type": "Function",
106
+ "required": true,
104
107
  "desc": "When called, it resets the component to its initial non-slided state",
105
108
  "params": null,
106
109
  "returns": null
@@ -119,6 +122,7 @@
119
122
  "definition": {
120
123
  "reset": {
121
124
  "type": "Function",
125
+ "required": true,
122
126
  "desc": "When called, it resets the component to its initial non-slided state",
123
127
  "params": null,
124
128
  "returns": null
@@ -137,16 +141,19 @@
137
141
  "definition": {
138
142
  "side": {
139
143
  "type": "String",
144
+ "required": true,
140
145
  "desc": "Side to which sliding is taking effect",
141
146
  "values": [ "left", "right", "top", "bottom" ]
142
147
  },
143
148
  "ratio": {
144
149
  "type": "Number",
150
+ "required": true,
145
151
  "desc": "Ratio of how much of the required slide was performed (0..1)",
146
152
  "examples": [ 0, 0.5, 1 ]
147
153
  },
148
154
  "isReset": {
149
155
  "type": "Boolean",
156
+ "required": true,
150
157
  "desc": "Ratio has been reset"
151
158
  }
152
159
  }
@@ -163,11 +170,13 @@
163
170
  "definition": {
164
171
  "side": {
165
172
  "type": "String",
173
+ "required": true,
166
174
  "desc": "Side to which sliding has taken effect",
167
175
  "values": [ "left", "right", "top", "bottom" ]
168
176
  },
169
177
  "reset": {
170
178
  "type": "Function",
179
+ "required": true,
171
180
  "desc": "When called, it resets the component to its initial non-slided state",
172
181
  "params": null,
173
182
  "returns": null
@@ -1,26 +1,22 @@
1
1
  import { h, ref, computed, watch, getCurrentInstance } from 'vue'
2
2
 
3
- import { useFormInject, useFormProps, useFormAttrs } from '../../composables/private/use-form.js'
3
+ import { useFormAttrs } from '../../composables/private/use-form.js'
4
4
 
5
5
  import useSlider, {
6
6
  useSliderProps,
7
7
  useSliderEmits,
8
- getRatio,
9
- getModel,
10
8
  keyCodes
11
9
  } from './use-slider.js'
12
10
 
13
11
  import { createComponent } from '../../utils/private/create.js'
14
12
  import { between } from '../../utils/format.js'
15
13
  import { stopAndPrevent } from '../../utils/event.js'
16
- import { hDir } from '../../utils/private/render.js'
17
14
 
18
15
  export default createComponent({
19
16
  name: 'QSlider',
20
17
 
21
18
  props: {
22
19
  ...useSliderProps,
23
- ...useFormProps,
24
20
 
25
21
  modelValue: {
26
22
  required: true,
@@ -36,47 +32,42 @@ export default createComponent({
36
32
  setup (props, { emit }) {
37
33
  const { proxy: { $q } } = getCurrentInstance()
38
34
 
39
- const formAttrs = useFormAttrs(props)
40
- const injectFormInput = useFormInject(formAttrs)
35
+ const { state, methods } = useSlider({
36
+ updateValue, updatePosition, getDragging,
37
+ formAttrs: useFormAttrs(props)
38
+ })
41
39
 
42
40
  const rootRef = ref(null)
43
- const model = ref(props.modelValue === null ? props.min : props.modelValue)
44
41
  const curRatio = ref(0)
45
42
 
46
- const { state, methods } = useSlider({
47
- updateValue, updatePosition, getDragging
48
- })
43
+ const model = ref(props.modelValue === null ? state.innerMin.value : props.modelValue)
49
44
 
50
- const modelRatio = computed(() => (
51
- state.minMaxDiff.value === 0 ? 0 : (model.value - props.min) / state.minMaxDiff.value
52
- ))
45
+ const modelRatio = computed(() => methods.convertModelToRatio(model.value))
53
46
  const ratio = computed(() => (state.active.value === true ? curRatio.value : modelRatio.value))
54
47
 
55
- const trackStyle = computed(() => ({
56
- [ state.positionProp.value ]: 0,
57
- [ state.sizeProp.value ]: `${ 100 * ratio.value }%`
58
- }))
59
-
60
- const thumbStyle = computed(() => ({
61
- [ state.positionProp.value ]: `${ 100 * ratio.value }%`
62
- }))
63
-
64
- const thumbClass = computed(() => (
65
- state.preventFocus.value === false && state.focus.value === true
66
- ? ' q-slider--focus'
67
- : ''
68
- ))
69
-
70
- const pinClass = computed(() => (
71
- props.labelColor !== void 0
72
- ? `text-${ props.labelColor }`
73
- : ''
74
- ))
48
+ const selectionBarStyle = computed(() => {
49
+ const acc = {
50
+ [ state.positionProp.value ]: `${ 100 * state.innerMinRatio.value }%`,
51
+ [ state.sizeProp.value ]: `${ 100 * (ratio.value - state.innerMinRatio.value) }%`
52
+ }
53
+ if (props.selectionImg !== void 0) {
54
+ acc.backgroundImage = `url(${ props.selectionImg }) !important`
55
+ }
56
+ return acc
57
+ })
75
58
 
76
- const pinTextClass = computed(() =>
77
- 'q-slider__pin-value-marker-text'
78
- + (props.labelTextColor !== void 0 ? ` text-${ props.labelTextColor }` : '')
79
- )
59
+ const getThumb = methods.getThumbRenderFn({
60
+ focusValue: true,
61
+ ratio,
62
+ label: computed(() => (
63
+ props.labelValue !== void 0
64
+ ? props.labelValue
65
+ : model.value
66
+ )),
67
+ thumbColor: computed(() => props.thumbColor || props.color),
68
+ labelColor: computed(() => props.labelColor),
69
+ labelTextColor: computed(() => props.labelTextColor)
70
+ })
80
71
 
81
72
  const events = computed(() => {
82
73
  if (state.editable.value !== true) {
@@ -94,25 +85,10 @@ export default createComponent({
94
85
  }
95
86
  })
96
87
 
97
- const label = computed(() => (
98
- props.labelValue !== void 0
99
- ? props.labelValue
100
- : model.value
101
- ))
102
-
103
- const pinStyle = computed(() => {
104
- const percent = (props.reverse === true ? -ratio.value : ratio.value - 1)
105
- return methods.getPinStyle(percent, ratio.value)
106
- })
107
-
108
- watch(() => props.modelValue, v => {
109
- model.value = v === null
110
- ? 0
111
- : between(v, props.min, props.max)
112
- })
113
-
114
- watch(() => props.min + props.max, () => {
115
- model.value = between(model.value, props.min, props.max)
88
+ watch(() => props.modelValue + state.innerMin.value + state.innerMax.value, () => {
89
+ model.value = props.modelValue === null
90
+ ? state.innerMin.value
91
+ : between(props.modelValue, state.innerMin.value, state.innerMax.value)
116
92
  })
117
93
 
118
94
  function updateValue (change) {
@@ -127,19 +103,13 @@ export default createComponent({
127
103
  }
128
104
 
129
105
  function updatePosition (event, dragging = state.dragging.value) {
130
- const ratio = getRatio(
131
- event,
132
- dragging,
133
- state.isReversed.value,
134
- props.vertical
135
- )
106
+ const ratio = methods.getDraggingRatio(event, dragging)
107
+
108
+ model.value = methods.convertRatioToModel(ratio)
136
109
 
137
- model.value = getModel(ratio, props.min, props.max, props.step, state.decimals.value)
138
110
  curRatio.value = props.snap !== true || props.step === 0
139
111
  ? ratio
140
- : (
141
- state.minMaxDiff.value === 0 ? 0 : (model.value - props.min) / state.minMaxDiff.value
142
- )
112
+ : methods.convertModelToRatio(model.value)
143
113
  }
144
114
 
145
115
  function onFocus () {
@@ -159,82 +129,26 @@ export default createComponent({
159
129
 
160
130
  model.value = between(
161
131
  parseFloat((model.value + offset).toFixed(state.decimals.value)),
162
- props.min,
163
- props.max
132
+ state.innerMin.value,
133
+ state.innerMax.value
164
134
  )
165
135
 
166
136
  updateValue()
167
137
  }
168
138
 
169
139
  return () => {
170
- const child = [
171
- methods.getThumbSvg(),
172
- h('div', { class: 'q-slider__focus-ring' })
173
- ]
174
-
175
- if (props.label === true || props.labelAlways === true) {
176
- child.push(
177
- h('div', {
178
- class: `q-slider__pin q-slider__pin${ state.axis.value } absolute ` + pinClass.value,
179
- style: pinStyle.value.pin
180
- }, [
181
- h('div', {
182
- class: `q-slider__pin-text-container q-slider__pin-text-container${ state.axis.value }`,
183
- style: pinStyle.value.pinTextContainer
184
- }, [
185
- h('span', {
186
- class: 'q-slider__pin-text ' + pinTextClass.value
187
- }, [
188
- label.value
189
- ])
190
- ])
191
- ]),
192
-
193
- h('div', {
194
- class: `q-slider__arrow q-slider__arrow${ state.axis.value } ${ pinClass.value }`
195
- })
196
- )
197
- }
198
-
199
- if (props.name !== void 0 && props.disable !== true) {
200
- injectFormInput(child, 'push')
201
- }
202
-
203
- const track = [
204
- h('div', {
205
- class: `q-slider__track q-slider__track${ state.axis.value } absolute`,
206
- style: trackStyle.value
207
- })
208
- ]
209
-
210
- props.markers !== false && track.push(
211
- h('div', {
212
- class: `q-slider__track-markers q-slider__track-markers${ state.axis.value } absolute-full fit`,
213
- style: state.markerStyle.value
214
- })
140
+ const content = methods.getContent(
141
+ selectionBarStyle,
142
+ events,
143
+ node => { node.push(getThumb()) }
215
144
  )
216
145
 
217
- const content = [
218
- h('div', {
219
- class: `q-slider__track-container q-slider__track-container${ state.axis.value } absolute`
220
- }, track),
221
-
222
- h('div', {
223
- class: `q-slider__thumb-container q-slider__thumb-container${ state.axis.value } absolute non-selectable` + thumbClass.value,
224
- style: thumbStyle.value
225
- }, child)
226
- ]
227
-
228
- const data = {
146
+ return h('div', {
229
147
  ref: rootRef,
230
148
  class: state.classes.value + (props.modelValue === null ? ' q-slider--no-value' : ''),
231
149
  ...state.attributes.value,
232
- 'aria-valuenow': props.modelValue,
233
- tabindex: state.tabindex.value,
234
- ...events.value
235
- }
236
-
237
- return hDir('div', data, content, 'slide', state.editable.value, () => state.panDirective.value)
150
+ 'aria-valuenow': props.modelValue
151
+ }, content)
238
152
  }
239
153
  }
240
154
  })
@@ -1,5 +1,5 @@
1
1
  {
2
- "mixins": [ "composables/private/use-form" ],
2
+ "mixins": [ "components/slider/use-slider" ],
3
3
 
4
4
  "meta": {
5
5
  "docsUrl": "https://v2.quasar.dev/vue-components/slider"
@@ -13,60 +13,6 @@
13
13
  "examples": [ "v-model=\"positionModel\"" ]
14
14
  },
15
15
 
16
- "min": {
17
- "type": "Number",
18
- "desc": "Minimum value of the model",
19
- "default": 0,
20
- "examples": [ ":min=\"0\"" ],
21
- "category": "model"
22
- },
23
-
24
- "max": {
25
- "type": "Number",
26
- "desc": "Maximum value of the model",
27
- "default": 100,
28
- "examples": [ ":max=\"100\"" ],
29
- "category": "model"
30
- },
31
-
32
- "step": {
33
- "type": "Number",
34
- "desc": "Specify step amount between valid values (> 0.0); When step equals to 0 it defines infinite granularity",
35
- "default": 1,
36
- "examples": [ ":step=\"1\"" ],
37
- "category": "model"
38
- },
39
-
40
- "reverse": {
41
- "type": "Boolean",
42
- "desc": "Work in reverse (changes direction)",
43
- "category": "behavior"
44
- },
45
-
46
- "vertical": {
47
- "type": "Boolean",
48
- "desc": "Display in vertical direction",
49
- "category": "behavior"
50
- },
51
-
52
- "color": {
53
- "extends": "color"
54
- },
55
-
56
- "label": {
57
- "type": "Boolean",
58
- "desc": "Popup a label when user clicks/taps on the slider thumb and moves it",
59
- "category": "content"
60
- },
61
-
62
- "label-color": {
63
- "extends": "color"
64
- },
65
-
66
- "label-text-color": {
67
- "extends": "color"
68
- },
69
-
70
16
  "label-value": {
71
17
  "type": [ "String", "Number" ],
72
18
  "desc": "Override default label value",
@@ -74,56 +20,6 @@
74
20
  ":label-value=\"model + 'px'\""
75
21
  ],
76
22
  "category": "content"
77
- },
78
-
79
- "label-always": {
80
- "type": "Boolean",
81
- "desc": "Always display the label",
82
- "category": "behavior|content"
83
- },
84
-
85
- "markers": {
86
- "type": [ "Boolean", "Number" ],
87
- "desc": "Display markers on the track, one for each possible value for the model or using a custom step (when specifying a Number)",
88
- "category": "content",
89
- "examples": [
90
- "markers",
91
- ":markers=\"5\""
92
- ]
93
- },
94
-
95
- "snap": {
96
- "type": "Boolean",
97
- "desc": "Snap on valid values, rather than sliding freely; Suggestion: use with 'step' prop",
98
- "category": "behavior"
99
- },
100
-
101
- "thumb-path": {
102
- "type": "String",
103
- "desc": "Set custom thumb svg path",
104
- "default": "M 4, 10 a 6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0",
105
- "examples": [ "M5 5 h10 v10 h-10 v-10" ],
106
- "category": "style"
107
- },
108
-
109
- "dark": {
110
- "extends": "dark"
111
- },
112
-
113
- "dense": {
114
- "extends": "dense"
115
- },
116
-
117
- "disable": {
118
- "extends": "disable"
119
- },
120
-
121
- "readonly": {
122
- "extends": "readonly"
123
- },
124
-
125
- "tabindex": {
126
- "extends": "tabindex"
127
23
  }
128
24
  },
129
25
 
@@ -135,22 +31,6 @@
135
31
  "type": [ "Number", "null" ]
136
32
  }
137
33
  }
138
- },
139
-
140
- "change": {
141
- "extends": "update:model-value",
142
- "desc": "Emitted on lazy model value change (after user slides then releases the thumb)"
143
- },
144
-
145
- "pan": {
146
- "desc": "Triggered when user starts panning on the component",
147
- "params": {
148
- "phase": {
149
- "type": "String",
150
- "desc": "Phase of panning",
151
- "values": [ "start", "end" ]
152
- }
153
- }
154
34
  }
155
35
  }
156
36
  }