quasar 2.8.3 → 2.9.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 (314) hide show
  1. package/dist/api/QBreadcrumbsEl.json +52 -0
  2. package/dist/api/QBtn.json +41 -6
  3. package/dist/api/QBtnDropdown.json +9 -0
  4. package/dist/api/QChip.json +9 -0
  5. package/dist/api/QCircularProgress.json +6 -0
  6. package/dist/api/QEditor.json +7 -0
  7. package/dist/api/QExpansionItem.json +59 -0
  8. package/dist/api/QItem.json +52 -0
  9. package/dist/api/QRating.json +13 -0
  10. package/dist/api/QRouteTab.json +42 -6
  11. package/dist/api/QTable.json +2 -2
  12. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  13. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  14. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  15. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  16. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
  17. package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
  18. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  19. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  20. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  21. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  22. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  23. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  24. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  25. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  26. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  27. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  28. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  29. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  30. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  34. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
  35. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  36. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  38. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  39. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  40. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  41. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  42. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  43. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
  44. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
  45. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
  46. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  47. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  48. package/dist/icon-set/themify.umd.prod.js +1 -1
  49. package/dist/lang/ar-TN.umd.prod.js +2 -2
  50. package/dist/lang/ar.umd.prod.js +2 -2
  51. package/dist/lang/az-Latn.umd.prod.js +2 -2
  52. package/dist/lang/bg.umd.prod.js +2 -2
  53. package/dist/lang/bn.umd.prod.js +2 -2
  54. package/dist/lang/ca.umd.prod.js +2 -2
  55. package/dist/lang/cs.umd.prod.js +2 -2
  56. package/dist/lang/da.umd.prod.js +2 -2
  57. package/dist/lang/de.umd.prod.js +2 -2
  58. package/dist/lang/el.umd.prod.js +2 -2
  59. package/dist/lang/en-GB.umd.prod.js +2 -2
  60. package/dist/lang/en-US.umd.prod.js +2 -2
  61. package/dist/lang/eo.umd.prod.js +2 -2
  62. package/dist/lang/es.umd.prod.js +2 -2
  63. package/dist/lang/et.umd.prod.js +2 -2
  64. package/dist/lang/eu.umd.prod.js +2 -2
  65. package/dist/lang/fa-IR.umd.prod.js +2 -2
  66. package/dist/lang/fa.umd.prod.js +2 -2
  67. package/dist/lang/fi.umd.prod.js +2 -2
  68. package/dist/lang/fr.umd.prod.js +2 -2
  69. package/dist/lang/gn.umd.prod.js +2 -2
  70. package/dist/lang/he.umd.prod.js +2 -2
  71. package/dist/lang/hr.umd.prod.js +2 -2
  72. package/dist/lang/hu.umd.prod.js +2 -2
  73. package/dist/lang/id.umd.prod.js +2 -2
  74. package/dist/lang/is.umd.prod.js +2 -2
  75. package/dist/lang/it.umd.prod.js +2 -2
  76. package/dist/lang/ja.umd.prod.js +2 -2
  77. package/dist/lang/km.umd.prod.js +2 -2
  78. package/dist/lang/ko-KR.umd.prod.js +2 -2
  79. package/dist/lang/kur-CKB.umd.prod.js +2 -2
  80. package/dist/lang/kz.umd.prod.js +2 -2
  81. package/dist/lang/lt.umd.prod.js +2 -2
  82. package/dist/lang/lu.umd.prod.js +2 -2
  83. package/dist/lang/lv.umd.prod.js +2 -2
  84. package/dist/lang/ml.umd.prod.js +2 -2
  85. package/dist/lang/mm.umd.prod.js +2 -2
  86. package/dist/lang/ms.umd.prod.js +2 -2
  87. package/dist/lang/my.umd.prod.js +2 -2
  88. package/dist/lang/nb-NO.umd.prod.js +2 -2
  89. package/dist/lang/nl.umd.prod.js +2 -2
  90. package/dist/lang/pl.umd.prod.js +2 -2
  91. package/dist/lang/pt-BR.umd.prod.js +2 -2
  92. package/dist/lang/pt.umd.prod.js +2 -2
  93. package/dist/lang/ro.umd.prod.js +2 -2
  94. package/dist/lang/ru.umd.prod.js +2 -2
  95. package/dist/lang/sk.umd.prod.js +2 -2
  96. package/dist/lang/sl.umd.prod.js +2 -2
  97. package/dist/lang/sm.umd.prod.js +2 -2
  98. package/dist/lang/sr-CYR.umd.prod.js +2 -2
  99. package/dist/lang/sr.umd.prod.js +2 -2
  100. package/dist/lang/sv.umd.prod.js +2 -2
  101. package/dist/lang/ta.umd.prod.js +2 -2
  102. package/dist/lang/th.umd.prod.js +2 -2
  103. package/dist/lang/tr.umd.prod.js +2 -2
  104. package/dist/lang/ug.umd.prod.js +2 -2
  105. package/dist/lang/uk.umd.prod.js +2 -2
  106. package/dist/lang/uz-Cyrl.umd.prod.js +2 -2
  107. package/dist/lang/uz-Latn.umd.prod.js +2 -2
  108. package/dist/lang/vi.umd.prod.js +2 -2
  109. package/dist/lang/zh-CN.umd.prod.js +2 -2
  110. package/dist/lang/zh-TW.umd.prod.js +2 -2
  111. package/dist/quasar.cjs.prod.js +2 -2
  112. package/dist/quasar.esm.js +16157 -15723
  113. package/dist/quasar.esm.prod.js +2 -2
  114. package/dist/quasar.sass +1 -1
  115. package/dist/quasar.umd.js +16290 -15854
  116. package/dist/quasar.umd.prod.js +2 -2
  117. package/dist/transforms/import-map.json +2 -0
  118. package/dist/types/api/qeditor.d.ts +17 -0
  119. package/dist/types/api/qloading.d.ts +5 -0
  120. package/dist/types/api.d.ts +2 -0
  121. package/dist/types/index.d.ts +133 -9
  122. package/dist/types/utils/is.d.ts +67 -0
  123. package/dist/types/utils/run-sequential-promises.d.ts +119 -0
  124. package/dist/types/utils.d.ts +9 -0
  125. package/dist/vetur/quasar-attributes.json +25 -1
  126. package/dist/vetur/quasar-tags.json +7 -1
  127. package/dist/web-types/web-types.json +108 -10
  128. package/lang/ar-TN.js +3 -1
  129. package/lang/ar-TN.mjs +3 -1
  130. package/lang/ar.js +3 -1
  131. package/lang/ar.mjs +3 -1
  132. package/lang/az-Latn.js +3 -1
  133. package/lang/az-Latn.mjs +3 -1
  134. package/lang/bg.js +3 -1
  135. package/lang/bg.mjs +3 -1
  136. package/lang/bn.js +3 -1
  137. package/lang/bn.mjs +3 -1
  138. package/lang/ca.js +3 -1
  139. package/lang/ca.mjs +3 -1
  140. package/lang/cs.js +3 -1
  141. package/lang/cs.mjs +3 -1
  142. package/lang/da.js +3 -1
  143. package/lang/da.mjs +3 -1
  144. package/lang/de.js +3 -1
  145. package/lang/de.mjs +3 -1
  146. package/lang/el.js +3 -1
  147. package/lang/el.mjs +3 -1
  148. package/lang/en-GB.js +3 -1
  149. package/lang/en-GB.mjs +3 -1
  150. package/lang/en-US.js +3 -1
  151. package/lang/en-US.mjs +3 -1
  152. package/lang/eo.js +3 -1
  153. package/lang/eo.mjs +3 -1
  154. package/lang/es.js +3 -1
  155. package/lang/es.mjs +3 -1
  156. package/lang/et.js +3 -1
  157. package/lang/et.mjs +3 -1
  158. package/lang/eu.js +3 -1
  159. package/lang/eu.mjs +3 -1
  160. package/lang/fa-IR.js +5 -3
  161. package/lang/fa-IR.mjs +5 -3
  162. package/lang/fa.js +5 -3
  163. package/lang/fa.mjs +5 -3
  164. package/lang/fi.js +3 -1
  165. package/lang/fi.mjs +3 -1
  166. package/lang/fr.js +3 -1
  167. package/lang/fr.mjs +3 -1
  168. package/lang/gn.js +3 -1
  169. package/lang/gn.mjs +3 -1
  170. package/lang/he.js +3 -1
  171. package/lang/he.mjs +3 -1
  172. package/lang/hr.js +3 -1
  173. package/lang/hr.mjs +3 -1
  174. package/lang/hu.js +3 -1
  175. package/lang/hu.mjs +3 -1
  176. package/lang/id.js +3 -1
  177. package/lang/id.mjs +3 -1
  178. package/lang/is.js +3 -1
  179. package/lang/is.mjs +3 -1
  180. package/lang/it.js +3 -1
  181. package/lang/it.mjs +3 -1
  182. package/lang/ja.js +3 -1
  183. package/lang/ja.mjs +3 -1
  184. package/lang/km.js +3 -1
  185. package/lang/km.mjs +3 -1
  186. package/lang/ko-KR.js +3 -1
  187. package/lang/ko-KR.mjs +3 -1
  188. package/lang/kur-CKB.js +3 -1
  189. package/lang/kur-CKB.mjs +3 -1
  190. package/lang/kz.js +3 -1
  191. package/lang/kz.mjs +3 -1
  192. package/lang/lt.js +3 -1
  193. package/lang/lt.mjs +3 -1
  194. package/lang/lu.js +3 -1
  195. package/lang/lu.mjs +3 -1
  196. package/lang/lv.js +3 -1
  197. package/lang/lv.mjs +3 -1
  198. package/lang/ml.js +3 -1
  199. package/lang/ml.mjs +3 -1
  200. package/lang/mm.js +4 -1
  201. package/lang/mm.mjs +4 -1
  202. package/lang/ms.js +3 -1
  203. package/lang/ms.mjs +3 -1
  204. package/lang/my.js +3 -1
  205. package/lang/my.mjs +3 -1
  206. package/lang/nb-NO.js +3 -1
  207. package/lang/nb-NO.mjs +3 -1
  208. package/lang/nl.js +3 -1
  209. package/lang/nl.mjs +3 -1
  210. package/lang/pl.js +3 -1
  211. package/lang/pl.mjs +3 -1
  212. package/lang/pt-BR.js +3 -1
  213. package/lang/pt-BR.mjs +3 -1
  214. package/lang/pt.js +3 -1
  215. package/lang/pt.mjs +3 -1
  216. package/lang/ro.js +3 -1
  217. package/lang/ro.mjs +3 -1
  218. package/lang/ru.js +3 -1
  219. package/lang/ru.mjs +3 -1
  220. package/lang/sk.js +3 -1
  221. package/lang/sk.mjs +3 -1
  222. package/lang/sl.js +3 -1
  223. package/lang/sl.mjs +3 -1
  224. package/lang/sm.js +3 -1
  225. package/lang/sm.mjs +3 -1
  226. package/lang/sr-CYR.js +3 -1
  227. package/lang/sr-CYR.mjs +3 -1
  228. package/lang/sr.js +3 -1
  229. package/lang/sr.mjs +3 -1
  230. package/lang/sv.js +3 -1
  231. package/lang/sv.mjs +3 -1
  232. package/lang/ta.js +3 -1
  233. package/lang/ta.mjs +3 -1
  234. package/lang/th.js +3 -1
  235. package/lang/th.mjs +3 -1
  236. package/lang/tr.js +3 -1
  237. package/lang/tr.mjs +3 -1
  238. package/lang/ug.js +5 -3
  239. package/lang/ug.mjs +5 -3
  240. package/lang/uk.js +3 -1
  241. package/lang/uk.mjs +3 -1
  242. package/lang/uz-Cyrl.js +3 -1
  243. package/lang/uz-Cyrl.mjs +3 -1
  244. package/lang/uz-Latn.js +3 -1
  245. package/lang/uz-Latn.mjs +3 -1
  246. package/lang/vi.js +3 -1
  247. package/lang/vi.mjs +3 -1
  248. package/lang/zh-CN.js +3 -1
  249. package/lang/zh-CN.mjs +3 -1
  250. package/lang/zh-TW.js +3 -1
  251. package/lang/zh-TW.mjs +3 -1
  252. package/package.json +6 -5
  253. package/src/components/breadcrumbs/QBreadcrumbsEl.js +6 -7
  254. package/src/components/breadcrumbs/QBreadcrumbsEl.json +53 -0
  255. package/src/components/btn/QBtn.js +19 -19
  256. package/src/components/btn/QBtn.json +41 -6
  257. package/src/components/btn/use-btn.js +6 -4
  258. package/src/components/btn-dropdown/QBtnDropdown.js +10 -2
  259. package/src/components/btn-dropdown/QBtnDropdown.json +8 -0
  260. package/src/components/checkbox/QCheckbox.js +1 -2
  261. package/src/components/checkbox/use-checkbox.js +2 -1
  262. package/src/components/chip/QChip.js +9 -2
  263. package/src/components/chip/QChip.json +8 -0
  264. package/src/components/chip/__tests__/QChip.spec.js +359 -46
  265. package/src/components/circular-progress/QCircularProgress.js +4 -2
  266. package/src/components/circular-progress/QCircularProgress.json +7 -0
  267. package/src/components/circular-progress/use-circular-progress.js +1 -0
  268. package/src/components/dialog/QDialog.js +7 -4
  269. package/src/components/drawer/QDrawer.js +7 -4
  270. package/src/components/editor/QEditor.json +9 -0
  271. package/src/components/expansion-item/QExpansionItem.js +37 -8
  272. package/src/components/expansion-item/QExpansionItem.json +67 -0
  273. package/src/components/fab/QFab.js +20 -1
  274. package/src/components/form/QForm.js +35 -40
  275. package/src/components/form/QFormChildMixin.js +3 -1
  276. package/src/components/item/QItem.js +4 -5
  277. package/src/components/item/QItem.json +53 -0
  278. package/src/components/menu/QMenu.js +5 -5
  279. package/src/components/menu/__tests__/QMenu.spec.js +7 -0
  280. package/src/components/page/QPage.js +1 -1
  281. package/src/components/popup-edit/QPopupEdit.js +2 -5
  282. package/src/components/radio/QRadio.js +3 -3
  283. package/src/components/rating/QRating.js +48 -10
  284. package/src/components/rating/QRating.json +11 -0
  285. package/src/components/select/QSelect.js +1 -4
  286. package/src/components/stepper/QStep.js +5 -3
  287. package/src/components/table/QTable.js +4 -6
  288. package/src/components/table/QTable.json +2 -2
  289. package/src/components/tabs/QRouteTab.js +6 -4
  290. package/src/components/tabs/QRouteTab.json +42 -6
  291. package/src/components/tabs/QTabs.js +188 -107
  292. package/src/components/tabs/use-tab.js +62 -38
  293. package/src/components/time/QTime.js +2 -2
  294. package/src/components/tooltip/QTooltip.js +7 -13
  295. package/src/components/tree/QTree.js +1 -1
  296. package/src/components/uploader/uploader-core.js +2 -3
  297. package/src/composables/private/__tests__/use-model-toggle.spec.js +2 -0
  298. package/src/composables/private/__tests__/use-transition.spec.js +4 -0
  299. package/src/composables/private/use-file.js +1 -1
  300. package/src/composables/private/use-router-link.js +80 -43
  301. package/src/composables/private/use-tick.js +15 -9
  302. package/src/composables/private/use-timeout.js +20 -7
  303. package/src/composables/private/use-validate.js +7 -13
  304. package/src/composables/use-form-child.js +6 -4
  305. package/src/directives/TouchPan.js +1 -1
  306. package/src/directives/TouchRepeat.js +1 -1
  307. package/src/directives/TouchSwipe.js +1 -1
  308. package/src/utils/EventBus.js +64 -0
  309. package/src/utils/extend.js +19 -19
  310. package/src/utils/private/inject-obj-prop.js +2 -0
  311. package/src/utils/private/rtl.js +10 -7
  312. package/src/utils/private/vm.js +4 -0
  313. package/src/utils/run-sequential-promises.js +115 -0
  314. package/src/utils.js +4 -0
@@ -1,125 +1,349 @@
1
+ import { mount } from '@cypress/vue'
2
+ import QChip, { defaultSizes } from '../QChip.js'
3
+
4
+ const defaultOptions = {
5
+ label: 'simple chip'
6
+ }
7
+
8
+ const chipSizeValues = Object.keys(defaultSizes)
9
+
10
+ function mountQChip (options = {}) {
11
+ options.props = {
12
+ ...defaultOptions,
13
+ ...options.props
14
+ }
15
+
16
+ return mount(QChip, options)
17
+ }
18
+
1
19
  describe('Chip API', () => {
2
20
  describe('Props', () => {
3
21
  describe('Category: content', () => {
4
22
  describe('(prop): icon', () => {
5
- it.skip(' ', () => {
6
- //
23
+ it('should render an icon on the left', () => {
24
+ const icon = 'add'
25
+
26
+ mountQChip({
27
+ props: {
28
+ icon
29
+ }
30
+ })
31
+
32
+ cy.get('.q-chip')
33
+ .get('.q-icon.q-chip__icon--left')
34
+ .should('have.text', `${ icon }`)
7
35
  })
8
36
  })
9
37
 
10
38
  describe('(prop): icon-right', () => {
11
- it.skip(' ', () => {
12
- //
39
+ it('should render an icon on the right', () => {
40
+ const icon = 'add'
41
+
42
+ mountQChip({
43
+ props: {
44
+ iconRight: icon
45
+ }
46
+ })
47
+
48
+ cy.get('.q-chip')
49
+ .get('.q-icon.q-chip__icon--right')
50
+ .should('have.text', `${ icon }`)
13
51
  })
14
52
  })
15
53
 
16
54
  describe('(prop): icon-remove', () => {
17
- it.skip(' ', () => {
18
- //
55
+ it('should render a custom remove icon', () => {
56
+ const icon = 'delete'
57
+
58
+ mountQChip({
59
+ props: {
60
+ removable: true,
61
+ iconRemove: icon
62
+ }
63
+ })
64
+
65
+ cy.get('.q-chip')
66
+ .get('.q-icon.q-chip__icon--remove')
67
+ .should('have.text', `${ icon }`)
19
68
  })
20
69
  })
21
70
 
22
71
  describe('(prop): icon-selected', () => {
23
- it.skip(' ', () => {
24
- //
72
+ it('should render a custom selected icon when one provided', () => {
73
+ const icon = 'done'
74
+
75
+ mountQChip({
76
+ props: {
77
+ selected: true,
78
+ iconSelected: icon
79
+ }
80
+ })
81
+
82
+ cy.get('.q-chip.q-chip--selected')
83
+ .get('.q-icon')
84
+ .should('have.text', `${ icon }`)
25
85
  })
26
86
  })
27
87
 
28
88
  describe('(prop): label', () => {
29
- it.skip(' ', () => {
30
- //
89
+ it('should render a label inside the chip', () => {
90
+ const label = 'Chip label'
91
+
92
+ mountQChip({
93
+ props: {
94
+ label
95
+ }
96
+ })
97
+
98
+ cy.get('.q-chip').get('.q-chip__content').should('have.text', label)
31
99
  })
32
100
  })
33
101
  })
34
102
 
35
103
  describe('Category: general', () => {
36
104
  describe('(prop): tabindex', () => {
37
- it.skip(' ', () => {
38
- //
105
+ it('should set the tabindex', () => {
106
+ const tabindex = 1
107
+
108
+ mountQChip({
109
+ props: {
110
+ clickable: true,
111
+ tabindex
112
+ }
113
+ })
114
+
115
+ cy.get('.q-chip').should('have.attr', 'tabindex', `${ tabindex }`)
39
116
  })
40
117
  })
41
118
  })
42
119
 
43
120
  describe('Category: model', () => {
44
121
  describe('(prop): model-value', () => {
45
- it.skip(' ', () => {
46
- //
122
+ it('should render when "modelValue" prop is true', () => {
123
+ mountQChip({
124
+ props: {
125
+ modelValue: true
126
+ }
127
+ })
128
+
129
+ cy.get('.q-chip').should('exist')
130
+ })
131
+
132
+ it('should not render when "modelValue" prop is false', () => {
133
+ mountQChip({
134
+ props: {
135
+ modelValue: false
136
+ }
137
+ })
138
+
139
+ cy.get('.q-chip').should('not.exist')
47
140
  })
48
141
  })
49
142
 
50
143
  describe('(prop): selected', () => {
51
- it.skip(' ', () => {
52
- //
144
+ it('should be selected when "selected" prop is true', () => {
145
+ mountQChip({
146
+ props: {
147
+ selected: true
148
+ }
149
+ })
150
+
151
+ cy.get('.q-chip.q-chip--selected').should('exist')
152
+ })
153
+
154
+ it('should not be selected when "selected" prop is false', () => {
155
+ mountQChip({
156
+ props: {
157
+ selected: false
158
+ }
159
+ })
160
+
161
+ cy.get('.q-chip').should('not.have.class', 'q-chip--selected')
53
162
  })
54
163
  })
55
164
  })
56
165
 
57
166
  describe('Category: state', () => {
58
167
  describe('(prop): clickable', () => {
59
- it.skip(' ', () => {
60
- //
168
+ it('should have hover effects and emit "click" event when "clickable" prop is true', () => {
169
+ const fn = cy.stub()
170
+
171
+ mountQChip({
172
+ props: {
173
+ clickable: true,
174
+ onClick: fn
175
+ }
176
+ })
177
+
178
+ cy.get('.q-chip')
179
+ .should('have.css', 'cursor', 'pointer')
180
+ .click()
181
+ .then(() => expect(fn).to.be.calledOnce)
61
182
  })
62
183
  })
63
184
 
64
185
  describe('(prop): removable', () => {
65
- it.skip(' ', () => {
66
- //
186
+ it('should display a remove icon emitting a "remove" event when clicked', () => {
187
+ const fn = cy.stub()
188
+
189
+ mountQChip({
190
+ props: {
191
+ removable: true,
192
+ onRemove: fn
193
+ }
194
+ })
195
+
196
+ cy.get('.q-chip')
197
+ .get('.q-icon.q-chip__icon--remove')
198
+ .click()
199
+ .then(() => expect(fn).to.be.calledOnce)
67
200
  })
68
201
  })
69
202
 
70
203
  describe('(prop): disable', () => {
71
- it.skip(' ', () => {
72
- //
204
+ it('should not have hover effect and not emit "click" event when "disable" prop is true', () => {
205
+ const fn = cy.stub()
206
+
207
+ mountQChip({
208
+ props: {
209
+ disable: true,
210
+ onClick: fn
211
+ }
212
+ })
213
+
214
+ cy.get('.q-chip')
215
+ .should('not.have.css', 'cursor', 'pointer')
216
+ .click()
217
+ .then(() => expect(fn).to.not.be.called)
73
218
  })
74
219
  })
75
220
  })
76
221
 
77
222
  describe('Category: style', () => {
78
223
  describe('(prop): dense', () => {
79
- it.skip(' ', () => {
80
- //
224
+ it('should have a dense style when "dense" prop is true', () => {
225
+ mountQChip({
226
+ props: {
227
+ dense: true
228
+ }
229
+ })
230
+
231
+ cy.get('.q-chip.q-chip--dense').should('exist')
81
232
  })
82
233
  })
83
234
 
84
235
  describe('(prop): size', () => {
85
- it.skip(' ', () => {
86
- //
236
+ it('should change QChip size based on a CSS unit value', () => {
237
+ const size = '50px'
238
+
239
+ mountQChip({
240
+ props: {
241
+ size
242
+ }
243
+ })
244
+
245
+ cy.get('.q-chip').should('have.css', 'font-size', size)
246
+ })
247
+
248
+ it(`should change QChip size based defined values: ${ chipSizeValues.join(', ') }`, () => {
249
+ mountQChip()
250
+
251
+ // loop over chipSizeValues
252
+ for (const key of chipSizeValues) {
253
+ cy.get('.q-chip')
254
+ .then(() => Cypress.vueWrapper.setProps({ size: key }))
255
+ .should('have.css', 'font-size', `${ defaultSizes[ key ] }px`)
256
+ }
87
257
  })
88
258
  })
89
259
 
90
260
  describe('(prop): dark', () => {
91
- it.skip(' ', () => {
92
- //
261
+ it('should have a dark style when "dark" prop is true', () => {
262
+ mountQChip({
263
+ props: {
264
+ dark: true
265
+ }
266
+ })
267
+
268
+ cy.get('.q-chip')
269
+ .should('have.class', 'q-dark')
270
+ .and('have.class', 'q-chip--dark')
93
271
  })
94
272
  })
95
273
 
96
274
  describe('(prop): color', () => {
97
- it.skip(' ', () => {
98
- //
275
+ it('should change color based on Quasar Color Palette', () => {
276
+ const color = 'red'
277
+
278
+ mountQChip({
279
+ props: {
280
+ color
281
+ }
282
+ })
283
+
284
+ cy.get('.q-chip').should('have.class', `bg-${ color }`)
99
285
  })
100
286
  })
101
287
 
102
288
  describe('(prop): text-color', () => {
103
- it.skip(' ', () => {
104
- //
289
+ it('should change text color based on Quasar Color Palette', () => {
290
+ const textColor = 'red'
291
+
292
+ mountQChip({
293
+ props: {
294
+ textColor
295
+ }
296
+ })
297
+
298
+ cy.get('.q-chip')
299
+ .should('have.class', 'q-chip--colored')
300
+ .and('have.class', `text-${ textColor }`)
105
301
  })
106
302
  })
107
303
 
108
304
  describe('(prop): square', () => {
109
- it.skip(' ', () => {
110
- //
305
+ it('should have a square style when "square" prop is true', () => {
306
+ mountQChip({
307
+ props: {
308
+ square: true
309
+ }
310
+ })
311
+
312
+ cy.get('.q-chip').should('have.class', 'q-chip--square')
111
313
  })
112
314
  })
113
315
 
114
316
  describe('(prop): outline', () => {
115
- it.skip(' ', () => {
116
- //
317
+ it('should have a outline style when "outline" prop is true', () => {
318
+ mountQChip({
319
+ props: {
320
+ outline: true
321
+ }
322
+ })
323
+
324
+ cy.get('.q-chip').should('have.class', 'q-chip--outline')
117
325
  })
118
326
  })
119
327
 
120
328
  describe('(prop): ripple', () => {
121
- it.skip(' ', () => {
122
- //
329
+ it('should have a ripple effect when "ripple" prop is true', () => {
330
+ mountQChip({
331
+ props: {
332
+ ripple: true
333
+ }
334
+ })
335
+
336
+ cy.get('.q-chip').click().get('.q-ripple').should('exist')
337
+ })
338
+
339
+ it('should not have a ripple effect when "ripple" prop is false', () => {
340
+ mountQChip({
341
+ props: {
342
+ ripple: false
343
+ }
344
+ })
345
+
346
+ cy.get('.q-chip').click().get('.q-ripple').should('not.exist')
123
347
  })
124
348
  })
125
349
  })
@@ -127,28 +351,117 @@ describe('Chip API', () => {
127
351
 
128
352
  describe('Slots', () => {
129
353
  describe('(slot): default', () => {
130
- it.skip(' ', () => {
131
- //
354
+ it('should display the default slot content', () => {
355
+ mountQChip({
356
+ props: {
357
+ label: undefined
358
+ },
359
+
360
+ slots: {
361
+ default: 'Default Slot Content'
362
+ }
363
+ })
364
+
365
+ cy.get('.q-chip').should('have.text', 'Default Slot Content')
132
366
  })
133
367
  })
134
368
  })
135
369
 
136
370
  describe('Events', () => {
137
371
  describe('(event): click', () => {
138
- it.skip(' ', () => {
139
- //
372
+ it('should emit "click" event when clicked and "clickable" prop is true', () => {
373
+ const fn = cy.stub()
374
+
375
+ mountQChip({
376
+ props: {
377
+ clickable: true,
378
+ onClick: fn
379
+ }
380
+ })
381
+
382
+ cy.get('.q-chip')
383
+ .click()
384
+ .then(() => expect(fn).to.be.calledOnce)
385
+ })
386
+
387
+ it('should not emit "click" event when "clickable" prop is false', () => {
388
+ const fn = cy.stub()
389
+
390
+ mountQChip({
391
+ props: {
392
+ clickable: false,
393
+ onClick: fn
394
+ }
395
+ })
396
+
397
+ cy.get('.q-chip')
398
+ .click()
399
+ .then(() => expect(fn).to.not.be.called)
140
400
  })
141
401
  })
142
402
 
143
403
  describe('(event): update:selected', () => {
144
- it.skip(' ', () => {
145
- //
404
+ it('should update selected value when called', () => {
405
+ const fn = cy.stub()
406
+
407
+ mountQChip({
408
+ props: {
409
+ selected: false,
410
+ 'onUpdate:selected': fn
411
+ }
412
+ })
413
+
414
+ cy.get('.q-chip')
415
+ .click()
416
+ .then(() => expect(fn).to.be.calledOnce)
417
+ })
418
+
419
+ it('should not emit update:selected event when "selected" prop is not set', () => {
420
+ const fn = cy.stub()
421
+
422
+ mountQChip({
423
+ props: {
424
+ selected: undefined,
425
+ 'onUpdate:selected': fn
426
+ }
427
+ })
428
+
429
+ cy.get('.q-chip')
430
+ .click()
431
+ .then(() => expect(fn).to.not.be.called)
146
432
  })
147
433
  })
148
434
 
149
435
  describe('(event): remove', () => {
150
- it.skip(' ', () => {
151
- //
436
+ it('should emit remove event when clicked and "removable" prop is true', () => {
437
+ const fn = cy.stub()
438
+
439
+ mountQChip({
440
+ props: {
441
+ removable: true,
442
+ onRemove: fn
443
+ }
444
+ })
445
+
446
+ cy.get('.q-chip')
447
+ .get('.q-icon.q-chip__icon--remove')
448
+ .click()
449
+ .then(() => expect(fn).to.be.calledOnce)
450
+ })
451
+
452
+ it('should not emit remove event when "removable" prop is false', () => {
453
+ const fn = cy.stub()
454
+
455
+ mountQChip({
456
+ props: {
457
+ removable: false,
458
+ onRemove: fn
459
+ }
460
+ })
461
+
462
+ cy.get('.q-chip')
463
+ .click()
464
+ .then(() => expect(fn).to.not.be.called)
152
465
  })
153
466
  })
154
467
  })
@@ -66,7 +66,7 @@ export default createComponent({
66
66
 
67
67
  const strokeWidth = computed(() => props.thickness / 2 * viewBox.value)
68
68
 
69
- function getCircle ({ thickness, offset, color, cls }) {
69
+ function getCircle ({ thickness, offset, color, cls, rounded }) {
70
70
  return h('circle', {
71
71
  class: 'q-circular-progress__' + cls + (color !== void 0 ? ` text-${ color }` : ''),
72
72
  style: circleStyle.value,
@@ -75,6 +75,7 @@ export default createComponent({
75
75
  'stroke-width': thickness,
76
76
  'stroke-dasharray': strokeDashArray,
77
77
  'stroke-dashoffset': offset,
78
+ 'stroke-linecap': rounded,
78
79
  cx: viewBox.value,
79
80
  cy: viewBox.value,
80
81
  r: radius
@@ -108,7 +109,8 @@ export default createComponent({
108
109
  cls: 'circle',
109
110
  thickness: strokeWidth.value,
110
111
  offset: strokeDashOffset.value,
111
- color: props.color
112
+ color: props.color,
113
+ rounded: props.rounded === true ? 'round' : void 0
112
114
  })
113
115
  )
114
116
 
@@ -53,6 +53,13 @@
53
53
  "category": "style"
54
54
  },
55
55
 
56
+ "rounded": {
57
+ "type": "Boolean",
58
+ "desc": "Rounding the arc of progress",
59
+ "category": "style",
60
+ "addedIn": "v2.8.4"
61
+ },
62
+
56
63
  "thickness": {
57
64
  "type": "Number",
58
65
  "default": 0.2,
@@ -18,6 +18,7 @@ export const useCircularCommonProps = {
18
18
  trackColor: String,
19
19
 
20
20
  fontSize: String,
21
+ rounded: Boolean,
21
22
 
22
23
  // ratio
23
24
  thickness: {
@@ -94,7 +94,7 @@ export default createComponent({
94
94
  )
95
95
 
96
96
  const { preventBodyScroll } = usePreventScroll()
97
- const { registerTimeout, removeTimeout } = useTimeout()
97
+ const { registerTimeout } = useTimeout()
98
98
  const { registerTick, removeTick } = useTick()
99
99
 
100
100
  const { showPortal, hidePortal, portalIsAccessible, renderPortal } = usePortal(
@@ -179,8 +179,6 @@ export default createComponent({
179
179
  })
180
180
 
181
181
  function handleShow (evt) {
182
- removeTimeout()
183
- removeTick()
184
182
  addToHistory()
185
183
 
186
184
  refocusTarget = props.noRefocus === false && document.activeElement !== null
@@ -195,7 +193,11 @@ export default createComponent({
195
193
  document.activeElement !== null && document.activeElement.blur()
196
194
  registerTick(focus)
197
195
  }
196
+ else {
197
+ removeTick()
198
+ }
198
199
 
200
+ // should removeTimeout() if this gets removed
199
201
  registerTimeout(() => {
200
202
  if (vm.proxy.$q.platform.is.ios === true) {
201
203
  if (props.seamless !== true && document.activeElement) {
@@ -231,7 +233,6 @@ export default createComponent({
231
233
  }
232
234
 
233
235
  function handleHide (evt) {
234
- removeTimeout()
235
236
  removeTick()
236
237
  removeFromHistory()
237
238
  cleanup(true)
@@ -243,6 +244,7 @@ export default createComponent({
243
244
  refocusTarget = null
244
245
  }
245
246
 
247
+ // should removeTimeout() if this gets removed
246
248
  registerTimeout(() => {
247
249
  hidePortal(true) // done hiding, now destroy
248
250
  animating.value = false
@@ -374,6 +376,7 @@ export default createComponent({
374
376
 
375
377
  function renderPortalContent () {
376
378
  return h('div', {
379
+ 'aria-modal': 'true',
377
380
  ...attrs,
378
381
  class: rootClasses.value
379
382
  }, [
@@ -75,7 +75,7 @@ export default createComponent({
75
75
 
76
76
  const isDark = useDark(props, $q)
77
77
  const { preventBodyScroll } = usePreventScroll()
78
- const { registerTimeout } = useTimeout()
78
+ const { registerTimeout, removeTimeout } = useTimeout()
79
79
 
80
80
  const $layout = inject(layoutKey, () => {
81
81
  console.error('QDrawer needs to be child of QLayout')
@@ -145,9 +145,12 @@ export default createComponent({
145
145
 
146
146
  cleanup()
147
147
 
148
- noEvent !== true && registerTimeout(() => {
149
- emit('hide', evt)
150
- }, duration)
148
+ if (noEvent !== true) {
149
+ registerTimeout(() => { emit('hide', evt) }, duration)
150
+ }
151
+ else {
152
+ removeTimeout()
153
+ }
151
154
  }
152
155
 
153
156
  const { show, hide } = useModelToggle({
@@ -312,5 +312,14 @@
312
312
  "__exemption": [ "examples" ]
313
313
  }
314
314
  }
315
+ },
316
+
317
+ "computedProps": {
318
+ "caret": {
319
+ "type": "Object",
320
+ "tsType": "QEditorCaret",
321
+ "desc": "The current caret state",
322
+ "__exemption": [ "examples" ]
323
+ }
315
324
  }
316
325
  }