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
@@ -99,9 +99,32 @@
99
99
  "label": {
100
100
  "desc": "Generic slot for all labels",
101
101
  "scope": {
102
- "opt": {
102
+ "...self": {
103
103
  "type": "Object",
104
104
  "desc": "The corresponding option entry from the 'options' prop",
105
+ "definition": {
106
+ "label": {
107
+ "type": "String",
108
+ "desc": "Label to display along the component",
109
+ "required": true,
110
+ "examples": [ "Option 1", "Option 2", "Option 3" ]
111
+ },
112
+ "value": {
113
+ "type": "Any",
114
+ "desc": "Value of the option that will be used by the component model",
115
+ "required": true,
116
+ "examples": [ "op1", "op2", "op3" ]
117
+ },
118
+ "disable": {
119
+ "type": "Boolean",
120
+ "desc": "If true, the option will be disabled"
121
+ },
122
+ "...props": {
123
+ "type": "Any",
124
+ "desc": "Any other props from QToggle, QCheckbox, or QRadio",
125
+ "examples": [ "val=\"car\"", ":true-value=\"trueValue\"", "checked-icon=\"visibility\"" ]
126
+ }
127
+ },
105
128
  "__exemption": [ "examples" ]
106
129
  }
107
130
  },
@@ -111,9 +134,32 @@
111
134
  "label-[name]": {
112
135
  "desc": "Slot to define the specific label for the option at '[name]' where name is a 0-based index; Overrides the generic 'label' slot if used",
113
136
  "scope": {
114
- "...opt": {
137
+ "...self": {
115
138
  "type": "Object",
116
139
  "desc": "The corresponding option entry from the 'options' prop",
140
+ "definition": {
141
+ "label": {
142
+ "type": "String",
143
+ "desc": "Label to display along the component",
144
+ "required": true,
145
+ "examples": [ "Option 1", "Option 2", "Option 3" ]
146
+ },
147
+ "value": {
148
+ "type": "Any",
149
+ "desc": "Value of the option that will be used by the component model",
150
+ "required": true,
151
+ "examples": [ "op1", "op2", "op3" ]
152
+ },
153
+ "disable": {
154
+ "type": "Boolean",
155
+ "desc": "If true, the option will be disabled"
156
+ },
157
+ "...props": {
158
+ "type": "Any",
159
+ "desc": "Any other props from QToggle, QCheckbox, or QRadio",
160
+ "examples": [ "val=\"car\"", ":true-value=\"trueValue\"", "checked-icon=\"visibility\"" ]
161
+ }
162
+ },
117
163
  "__exemption": [ "examples" ]
118
164
  }
119
165
  },
@@ -22,7 +22,6 @@
22
22
  "max": {
23
23
  "type": "Number",
24
24
  "desc": "Number of last page (must be higher than 'min')",
25
- "default": 100,
26
25
  "required": true,
27
26
  "examples": [ 10 ],
28
27
  "category": "model"
@@ -60,8 +60,7 @@ export default createComponent({
60
60
 
61
61
  if (localScrollTarget === window) {
62
62
  containerTop = 0
63
- containerHeight = window.innerHeight
64
- containerBottom = containerHeight
63
+ containerBottom = containerHeight = window.innerHeight
65
64
  }
66
65
  else {
67
66
  containerTop = offset(localScrollTarget).top
@@ -103,6 +102,9 @@ export default createComponent({
103
102
  localScrollTarget.removeEventListener('scroll', updatePos, passive)
104
103
  window.removeEventListener('resize', resizeHandler, passive)
105
104
  localScrollTarget = void 0
105
+ setPos.cancel()
106
+ update.cancel()
107
+ resizeHandler.cancel()
106
108
  }
107
109
  }
108
110
 
@@ -6,6 +6,7 @@ import QBtn from '../btn/QBtn.js'
6
6
  import { createComponent } from '../../utils/private/create.js'
7
7
  import clone from '../../utils/clone.js'
8
8
  import { isDeepEqual } from '../../utils/private/is.js'
9
+ import { injectProp } from '../../utils/private/inject-obj-prop.js'
9
10
 
10
11
  export default createComponent({
11
12
  name: 'QPopupEdit',
@@ -65,11 +66,7 @@ export default createComponent({
65
66
  updatePosition
66
67
  }
67
68
 
68
- Object.defineProperty(acc, 'value', {
69
- get: () => currentModel.value,
70
- set: val => { currentModel.value = val }
71
- })
72
-
69
+ injectProp(acc, 'value', () => currentModel.value, val => { currentModel.value = val })
73
70
  return acc
74
71
  })
75
72
 
@@ -173,6 +173,7 @@
173
173
  "params": {
174
174
  "value": {
175
175
  "type": "Any",
176
+ "required": true,
176
177
  "desc": "Value to be checked",
177
178
  "examples": [ 0, "Changed text" ]
178
179
  }
@@ -7,9 +7,10 @@
7
7
 
8
8
  "props": {
9
9
  "model-value": {
10
+ "extends": "model-value",
10
11
  "type": "Boolean",
11
12
  "desc": "Defines the state of the component (shown/hidden); Either use this property (along with a listener for 'update:modelValue' event) OR use v-model directive",
12
- "category": "model"
13
+ "required": false
13
14
  },
14
15
 
15
16
  "breakpoint": {
@@ -92,6 +92,7 @@ export default createComponent({
92
92
  const prop = { type: 'radio' }
93
93
 
94
94
  props.name !== void 0 && Object.assign(prop, {
95
+ '^checked': isTrue.value === true ? 'checked' : void 0,
95
96
  name: props.name,
96
97
  value: props.val
97
98
  })
@@ -99,13 +100,7 @@ export default createComponent({
99
100
  return prop
100
101
  })
101
102
 
102
- const formDomProps = computed(() => (
103
- props.name !== void 0 && isTrue.value === true
104
- ? { checked: true }
105
- : {}
106
- ))
107
-
108
- const injectFormInput = useFormInject(formAttrs, formDomProps)
103
+ const injectFormInput = useFormInject(formAttrs)
109
104
 
110
105
  function onClick (e) {
111
106
  if (e !== void 0) {
@@ -1,19 +1,14 @@
1
1
  import { h, ref, computed, watch, getCurrentInstance } from 'vue'
2
2
 
3
- import { useFormInject, useFormProps } from '../../composables/private/use-form.js'
4
-
5
3
  import useSlider, {
6
4
  useSliderProps,
7
5
  useSliderEmits,
8
- getRatio,
9
- getModel,
10
6
  keyCodes
11
7
  } from '../slider/use-slider.js'
12
8
 
13
9
  import { createComponent } from '../../utils/private/create.js'
14
10
  import { stopAndPrevent } from '../../utils/event.js'
15
11
  import { between } from '../../utils/format.js'
16
- import { hDir } from '../../utils/private/render.js'
17
12
 
18
13
  const dragType = {
19
14
  MIN: 0,
@@ -25,7 +20,6 @@ export default createComponent({
25
20
  name: 'QRange',
26
21
 
27
22
  props: {
28
- ...useFormProps,
29
23
  ...useSliderProps,
30
24
 
31
25
  modelValue: {
@@ -39,8 +33,6 @@ export default createComponent({
39
33
  }
40
34
  },
41
35
 
42
- name: String,
43
-
44
36
  dragRange: Boolean,
45
37
  dragOnlyRange: Boolean,
46
38
 
@@ -50,7 +42,10 @@ export default createComponent({
50
42
  rightLabelTextColor: String,
51
43
 
52
44
  leftLabelValue: [ String, Number ],
53
- rightLabelValue: [ String, Number ]
45
+ rightLabelValue: [ String, Number ],
46
+
47
+ leftThumbColor: String,
48
+ rightThumbColor: String
54
49
  },
55
50
 
56
51
  emits: useSliderEmits,
@@ -58,51 +53,46 @@ export default createComponent({
58
53
  setup (props, { emit }) {
59
54
  const { proxy: { $q } } = getCurrentInstance()
60
55
 
61
- const formAttrs = computed(() => {
62
- return {
56
+ const { state, methods } = useSlider({
57
+ updateValue, updatePosition, getDragging,
58
+ formAttrs: computed(() => ({
63
59
  type: 'hidden',
64
60
  name: props.name,
65
61
  value: `${ props.modelValue.min }|${ props.modelValue.max }`
66
- }
62
+ }))
67
63
  })
68
64
 
69
- const injectFormInput = useFormInject(formAttrs)
70
-
71
65
  const rootRef = ref(null)
72
- const model = ref({
73
- min: props.modelValue.min === null ? props.min : props.modelValue.min,
74
- max: props.modelValue.max === null ? props.max : props.modelValue.max
75
- })
76
-
77
- const nextFocus = ref(null)
78
-
79
66
  const curMinRatio = ref(0)
80
67
  const curMaxRatio = ref(0)
81
68
 
82
- const { state, methods } = useSlider({
83
- updateValue, updatePosition, getDragging
69
+ const model = ref({
70
+ min: props.modelValue.min === null ? state.innerMin.value : props.modelValue.min,
71
+ max: props.modelValue.max === null ? state.innerMax.value : props.modelValue.max
84
72
  })
85
73
 
86
- const modelMinRatio = computed(() => (
87
- state.minMaxDiff.value === 0 ? 0 : (model.value.min - props.min) / state.minMaxDiff.value
88
- ))
74
+ const nextFocus = ref(null)
75
+
76
+ const modelMinRatio = computed(() => methods.convertModelToRatio(model.value.min))
77
+ const modelMaxRatio = computed(() => methods.convertModelToRatio(model.value.max))
89
78
 
90
79
  const ratioMin = computed(() => (
91
80
  state.active.value === true ? curMinRatio.value : modelMinRatio.value
92
81
  ))
93
-
94
- const modelMaxRatio = computed(() => (
95
- state.minMaxDiff.value === 0 ? 0 : (model.value.max - props.min) / state.minMaxDiff.value
96
- ))
97
-
98
82
  const ratioMax = computed(() => (
99
83
  state.active.value === true ? curMaxRatio.value : modelMaxRatio.value
100
84
  ))
101
85
 
102
- const trackStyle = computed(() => ({
103
- [ state.positionProp.value ]: `${ 100 * ratioMin.value }%`,
104
- [ state.sizeProp.value ]: `${ 100 * (ratioMax.value - ratioMin.value) }%`
105
- }))
86
+ const selectionBarStyle = computed(() => {
87
+ const acc = {
88
+ [ state.positionProp.value ]: `${ 100 * ratioMin.value }%`,
89
+ [ state.sizeProp.value ]: `${ 100 * (ratioMax.value - ratioMin.value) }%`
90
+ }
91
+ if (props.selectionImg !== void 0) {
92
+ acc.backgroundImage = `url(${ props.selectionImg }) !important`
93
+ }
94
+ return acc
95
+ })
106
96
 
107
97
  const events = computed(() => {
108
98
  if (state.editable.value !== true) {
@@ -125,128 +115,76 @@ export default createComponent({
125
115
  return evt
126
116
  })
127
117
 
128
- const minProps = {
129
- domRef: ref(null),
130
-
131
- events: computed(() => (
132
- state.editable.value === true && $q.platform.is.mobile !== true && props.dragOnlyRange !== true
133
- ? {
134
- onFocus: () => { onFocus('min') },
135
- onBlur: methods.onBlur,
136
- onKeydown,
137
- onKeyup: methods.onKeyup
138
- }
139
- : {}
140
- )),
141
-
142
- thumbStyle: computed(() => ({
143
- [ state.positionProp.value ]: `${ 100 * ratioMin.value }%`,
144
- 'z-index': nextFocus.value === 'min' ? 2 : void 0
145
- })),
146
-
147
- thumbClass: computed(() => (
148
- state.preventFocus.value === false && state.focus.value === 'min'
149
- ? ' q-slider--focus'
150
- : ''
151
- )),
152
-
153
- pinClass: computed(() => {
154
- const color = props.leftLabelColor || props.labelColor
155
- return color ? ` text-${ color }` : ''
156
- }),
157
-
158
- pinTextClass: computed(() => {
159
- const color = props.leftLabelTextColor || props.labelTextColor
160
- return color ? ` text-${ color }` : ''
161
- }),
162
-
163
- pinStyle: computed(() => {
164
- const percent = (props.reverse === true ? -ratioMin.value : ratioMin.value - 1)
165
- return methods.getPinStyle(percent, ratioMin.value)
118
+ const minThumbRef = ref(null)
119
+ const minEvents = computed(() => (
120
+ state.editable.value === true && $q.platform.is.mobile !== true && props.dragOnlyRange !== true
121
+ ? {
122
+ onFocus: () => { onFocus('min') },
123
+ onBlur: methods.onBlur,
124
+ onKeydown,
125
+ onKeyup: methods.onKeyup
126
+ }
127
+ : {}
128
+ ))
129
+ const getMinThumb = methods.getThumbRenderFn({
130
+ focusValue: 'min',
131
+ nextFocus,
132
+ getNodeData: () => ({
133
+ ref: minThumbRef,
134
+ ...minEvents.value,
135
+ tabindex: props.dragOnlyRange !== true ? state.tabindex.value : null
166
136
  }),
167
-
137
+ ratio: ratioMin,
168
138
  label: computed(() => (
169
139
  props.leftLabelValue !== void 0
170
140
  ? props.leftLabelValue
171
141
  : model.value.min
172
- ))
173
- }
174
-
175
- const maxProps = {
176
- domRef: ref(null),
177
-
178
- events: computed(() => (
179
- state.editable.value === true && $q.platform.is.mobile !== true && props.dragOnlyRange !== true
180
- ? {
181
- onFocus: () => { onFocus('max') },
182
- onBlur: methods.onBlur,
183
- onKeydown,
184
- onKeyup: methods.onKeyup
185
- }
186
- : {}
187
- )),
188
-
189
- thumbStyle: computed(() => ({
190
- [ state.positionProp.value ]: `${ 100 * ratioMax.value }%`
191
- })),
192
-
193
- thumbClass: computed(() => (
194
- state.preventFocus.value === false && state.focus.value === 'max'
195
- ? ' q-slider--focus'
196
- : ''
197
142
  )),
143
+ thumbColor: computed(() => props.leftThumbColor || props.thumbColor || props.color),
144
+ labelColor: computed(() => props.leftLabelColor || props.labelColor),
145
+ labelTextColor: computed(() => props.leftLabelTextColor || props.labelTextColor)
146
+ })
198
147
 
199
- pinClass: computed(() => {
200
- const color = props.rightLabelColor || props.labelColor
201
- return color ? ` text-${ color }` : ''
202
- }),
203
-
204
- pinTextClass: computed(() => {
205
- const color = props.rightLabelTextColor || props.labelTextColor
206
- return color ? ` text-${ color }` : ''
207
- }),
208
-
209
- pinStyle: computed(() => {
210
- const percent = (props.reverse === true ? -ratioMax.value : ratioMax.value - 1)
211
- return methods.getPinStyle(percent, ratioMax.value)
148
+ const maxEvents = computed(() => (
149
+ state.editable.value === true && $q.platform.is.mobile !== true && props.dragOnlyRange !== true
150
+ ? {
151
+ onFocus: () => { onFocus('max') },
152
+ onBlur: methods.onBlur,
153
+ onKeydown,
154
+ onKeyup: methods.onKeyup
155
+ }
156
+ : {}
157
+ ))
158
+ const getMaxThumb = methods.getThumbRenderFn({
159
+ focusValue: 'max',
160
+ nextFocus,
161
+ getNodeData: () => ({
162
+ ...maxEvents.value,
163
+ tabindex: props.dragOnlyRange !== true ? state.tabindex.value : null
212
164
  }),
213
-
165
+ ratio: ratioMax,
214
166
  label: computed(() => (
215
167
  props.rightLabelValue !== void 0
216
168
  ? props.rightLabelValue
217
169
  : model.value.max
218
- ))
219
- }
220
-
221
- watch(() => props.modelValue.min, val => {
222
- model.value.min = val === null
223
- ? props.min
224
- : val
170
+ )),
171
+ thumbColor: computed(() => props.rightThumbColor || props.thumbColor || props.color),
172
+ labelColor: computed(() => props.rightLabelColor || props.labelColor),
173
+ labelTextColor: computed(() => props.rightLabelTextColor || props.labelTextColor)
225
174
  })
226
175
 
227
- watch(() => props.modelValue.max, val => {
228
- model.value.max = val === null
229
- ? props.max
230
- : val
231
- })
176
+ watch(
177
+ () => props.modelValue.min + props.modelValue.max + state.innerMin.value + state.innerMax.value,
178
+ () => {
179
+ model.value.min = props.modelValue.min === null
180
+ ? state.innerMin.value
181
+ : between(props.modelValue.min, state.innerMin.value, state.innerMax.value)
232
182
 
233
- watch(() => props.min, value => {
234
- if (model.value.min < value) {
235
- model.value.min = value
236
- }
237
- if (model.value.max < value) {
238
- model.value.max = value
183
+ model.value.max = props.modelValue.max === null
184
+ ? state.innerMax.value
185
+ : between(props.modelValue.max, state.innerMin.value, state.innerMax.value)
239
186
  }
240
- })
241
-
242
- watch(() => props.max, value => {
243
- if (model.value.min > value) {
244
- model.value.min = value
245
- }
246
- if (model.value.max > value) {
247
- model.value.max = value
248
- }
249
- })
187
+ )
250
188
 
251
189
  function updateValue (change) {
252
190
  if (model.value.min !== props.modelValue.min || model.value.max !== props.modelValue.max) {
@@ -261,8 +199,8 @@ export default createComponent({
261
199
  sensitivity = props.dragOnlyRange === true
262
200
  ? 0
263
201
  : (props.vertical === true
264
- ? minProps.domRef.value.offsetHeight / (2 * height)
265
- : minProps.domRef.value.offsetWidth / (2 * width)
202
+ ? minThumbRef.value.offsetHeight / (2 * height)
203
+ : minThumbRef.value.offsetWidth / (2 * width)
266
204
  )
267
205
 
268
206
  const dragging = {
@@ -276,8 +214,8 @@ export default createComponent({
276
214
  ratioMax: modelMaxRatio.value
277
215
  }
278
216
 
279
- const ratio = getRatio(event, dragging, state.isReversed.value, props.vertical)
280
217
  let type
218
+ const ratio = methods.getDraggingRatio(event, dragging)
281
219
 
282
220
  if (props.dragOnlyRange !== true && ratio < dragging.ratioMin + sensitivity) {
283
221
  type = dragType.MIN
@@ -287,7 +225,7 @@ export default createComponent({
287
225
  type = dragType.RANGE
288
226
  Object.assign(dragging, {
289
227
  offsetRatio: ratio,
290
- offsetModel: getModel(ratio, props.min, props.max, props.step, state.decimals.value),
228
+ offsetModel: methods.convertRatioToModel(ratio),
291
229
  rangeValue: dragging.valueMax - dragging.valueMin,
292
230
  rangeRatio: dragging.ratioMax - dragging.ratioMin
293
231
  })
@@ -309,10 +247,9 @@ export default createComponent({
309
247
  }
310
248
 
311
249
  function updatePosition (event, dragging = state.dragging.value) {
312
- const
313
- ratio = getRatio(event, dragging, state.isReversed.value, props.vertical),
314
- localModel = getModel(ratio, props.min, props.max, props.step, state.decimals.value)
315
250
  let pos
251
+ const ratio = methods.getDraggingRatio(event, dragging)
252
+ const localModel = methods.convertRatioToModel(ratio)
316
253
 
317
254
  switch (dragging.type) {
318
255
  case dragType.MIN:
@@ -389,8 +326,8 @@ export default createComponent({
389
326
  curMaxRatio.value = pos.maxR
390
327
  }
391
328
  else {
392
- curMinRatio.value = state.minMaxDiff.value === 0 ? 0 : (model.value.min - props.min) / state.minMaxDiff.value
393
- curMaxRatio.value = state.minMaxDiff.value === 0 ? 0 : (model.value.max - props.min) / state.minMaxDiff.value
329
+ curMinRatio.value = state.trackLen.value === 0 ? 0 : (model.value.min - props.min) / state.trackLen.value
330
+ curMaxRatio.value = state.trackLen.value === 0 ? 0 : (model.value.max - props.min) / state.trackLen.value
394
331
  }
395
332
  }
396
333
 
@@ -416,8 +353,8 @@ export default createComponent({
416
353
 
417
354
  const min = between(
418
355
  parseFloat((model.value.min + offset).toFixed(state.decimals.value)),
419
- props.min,
420
- props.max - interval
356
+ state.innerMin.value,
357
+ state.innerMax.value - interval
421
358
  )
422
359
 
423
360
  model.value = {
@@ -435,8 +372,8 @@ export default createComponent({
435
372
  ...model.value,
436
373
  [ which ]: between(
437
374
  parseFloat((model.value[ which ] + offset).toFixed(state.decimals.value)),
438
- which === 'min' ? props.min : model.value.min,
439
- which === 'max' ? props.max : model.value.max
375
+ which === 'min' ? state.innerMin.value : model.value.min,
376
+ which === 'max' ? state.innerMax.value : model.value.max
440
377
  )
441
378
  }
442
379
  }
@@ -444,72 +381,19 @@ export default createComponent({
444
381
  updateValue()
445
382
  }
446
383
 
447
- function getThumb (sideProps) {
448
- const child = [
449
- methods.getThumbSvg(),
450
- h('div', { class: 'q-slider__focus-ring' })
451
- ]
452
-
453
- if (props.label === true || props.labelAlways === true) {
454
- child.push(
455
- h('div', {
456
- class: `q-slider__pin q-slider__pin${ state.axis.value } absolute` + sideProps.pinClass.value,
457
- style: sideProps.pinStyle.value.pin
458
- }, [
459
- h('div', {
460
- class: `q-slider__pin-text-container q-slider__pin-text-container${ state.axis.value }`,
461
- style: sideProps.pinStyle.value.pinTextContainer
462
- }, [
463
- h('span', {
464
- class: 'q-slider__pin-text' + sideProps.pinTextClass.value
465
- }, sideProps.label.value)
466
- ])
467
- ]),
468
-
469
- h('div', {
470
- class: `q-slider__arrow q-slider__arrow${ state.axis.value }` + sideProps.pinClass.value
471
- })
472
- )
473
- }
474
-
475
- return h('div', {
476
- ref: sideProps.domRef,
477
- class: `q-slider__thumb-container q-slider__thumb-container${ state.axis.value } absolute non-selectable` + sideProps.thumbClass.value,
478
- style: sideProps.thumbStyle.value,
479
- ...sideProps.events.value,
480
- tabindex: props.dragOnlyRange !== true ? state.tabindex.value : null
481
- }, child)
482
- }
483
-
484
384
  return () => {
485
- const track = [
486
- h('div', {
487
- class: `q-slider__track q-slider__track${ state.axis.value } absolute`,
488
- style: trackStyle.value
489
- })
490
- ]
491
-
492
- props.markers !== false && track.push(
493
- h('div', {
494
- class: `q-slider__track-markers q-slider__track-markers${ state.axis.value } absolute-full fit`,
495
- style: state.markerStyle.value
496
- })
385
+ const content = methods.getContent(
386
+ selectionBarStyle,
387
+ events,
388
+ node => {
389
+ node.push(
390
+ getMinThumb(),
391
+ getMaxThumb()
392
+ )
393
+ }
497
394
  )
498
395
 
499
- const child = [
500
- h('div', {
501
- class: `q-slider__track-container q-slider__track-container${ state.axis.value } absolute`
502
- }, track),
503
-
504
- getThumb(minProps),
505
- getThumb(maxProps)
506
- ]
507
-
508
- if (props.name !== void 0 && props.disable !== true) {
509
- injectFormInput(child, 'push')
510
- }
511
-
512
- const data = {
396
+ return h('div', {
513
397
  ref: rootRef,
514
398
  class: 'q-range ' + state.classes.value + (
515
399
  props.modelValue.min === null || props.modelValue.max === null
@@ -520,11 +404,8 @@ export default createComponent({
520
404
  'aria-valuenow': props.modelValue.min + '|' + props.modelValue.max,
521
405
  tabindex: props.dragOnlyRange === true && $q.platform.is.mobile !== true
522
406
  ? state.tabindex.value
523
- : null,
524
- ...events.value
525
- }
526
-
527
- return hDir('div', data, child, 'slide', state.editable.value, () => state.panDirective.value)
407
+ : null
408
+ }, content)
528
409
  }
529
410
  }
530
411
  })