quasar 2.17.7 → 2.18.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 (289) hide show
  1. package/dist/api/QBtnDropdown.json +1 -1
  2. package/dist/api/QDialog.json +1 -1
  3. package/dist/api/QMenu.json +1 -1
  4. package/dist/api/QSelect.json +1 -1
  5. package/dist/api/QTable.json +1 -1
  6. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  7. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  8. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  9. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  10. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
  11. package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
  12. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  13. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  14. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  15. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  16. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  17. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  18. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  19. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  20. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  21. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  22. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  23. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  24. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  25. package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  34. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  35. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  36. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  38. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
  39. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
  40. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
  41. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  42. package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
  43. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  44. package/dist/icon-set/themify.umd.prod.js +1 -1
  45. package/dist/lang/ar-TN.umd.prod.js +2 -2
  46. package/dist/lang/ar.umd.prod.js +2 -2
  47. package/dist/lang/az-Latn.umd.prod.js +2 -2
  48. package/dist/lang/bg.umd.prod.js +2 -2
  49. package/dist/lang/bn.umd.prod.js +2 -2
  50. package/dist/lang/bs-BA.umd.prod.js +2 -2
  51. package/dist/lang/ca.umd.prod.js +2 -2
  52. package/dist/lang/cs.umd.prod.js +2 -2
  53. package/dist/lang/da.umd.prod.js +2 -2
  54. package/dist/lang/de-CH.umd.prod.js +2 -2
  55. package/dist/lang/de-DE.umd.prod.js +2 -2
  56. package/dist/lang/de.umd.prod.js +2 -2
  57. package/dist/lang/el.umd.prod.js +2 -2
  58. package/dist/lang/en-GB.umd.prod.js +2 -2
  59. package/dist/lang/en-US.umd.prod.js +2 -2
  60. package/dist/lang/eo.umd.prod.js +2 -2
  61. package/dist/lang/es.umd.prod.js +2 -2
  62. package/dist/lang/et.umd.prod.js +2 -2
  63. package/dist/lang/eu.umd.prod.js +2 -2
  64. package/dist/lang/fa-IR.umd.prod.js +2 -2
  65. package/dist/lang/fa.umd.prod.js +2 -2
  66. package/dist/lang/fi.umd.prod.js +2 -2
  67. package/dist/lang/fr.umd.prod.js +2 -2
  68. package/dist/lang/gn.umd.prod.js +2 -2
  69. package/dist/lang/he.umd.prod.js +2 -2
  70. package/dist/lang/hi.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/kk.umd.prod.js +2 -2
  78. package/dist/lang/km.umd.prod.js +2 -2
  79. package/dist/lang/ko-KR.umd.prod.js +2 -2
  80. package/dist/lang/kur-CKB.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/mk.umd.prod.js +2 -2
  85. package/dist/lang/ml.umd.prod.js +2 -2
  86. package/dist/lang/mm.umd.prod.js +2 -2
  87. package/dist/lang/ms-MY.umd.prod.js +2 -2
  88. package/dist/lang/ms.umd.prod.js +2 -2
  89. package/dist/lang/my.umd.prod.js +2 -2
  90. package/dist/lang/nb-NO.umd.prod.js +2 -2
  91. package/dist/lang/nl.umd.prod.js +2 -2
  92. package/dist/lang/pl.umd.prod.js +2 -2
  93. package/dist/lang/pt-BR.umd.prod.js +2 -2
  94. package/dist/lang/pt.umd.prod.js +2 -2
  95. package/dist/lang/ro.umd.prod.js +2 -2
  96. package/dist/lang/ru.umd.prod.js +2 -2
  97. package/dist/lang/sk.umd.prod.js +2 -2
  98. package/dist/lang/sl.umd.prod.js +2 -2
  99. package/dist/lang/sm.umd.prod.js +2 -2
  100. package/dist/lang/sr-CYR.umd.prod.js +2 -2
  101. package/dist/lang/sr.umd.prod.js +2 -2
  102. package/dist/lang/sv.umd.prod.js +2 -2
  103. package/dist/lang/ta.umd.prod.js +2 -2
  104. package/dist/lang/th.umd.prod.js +2 -2
  105. package/dist/lang/tl.umd.prod.js +2 -2
  106. package/dist/lang/tr.umd.prod.js +2 -2
  107. package/dist/lang/ug.umd.prod.js +1 -1
  108. package/dist/lang/uk.umd.prod.js +2 -2
  109. package/dist/lang/ur-PK.umd.prod.js +7 -0
  110. package/dist/lang/uz-Cyrl.umd.prod.js +2 -2
  111. package/dist/lang/uz-Latn.umd.prod.js +2 -2
  112. package/dist/lang/vi.umd.prod.js +2 -2
  113. package/dist/lang/zh-CN.umd.prod.js +2 -2
  114. package/dist/lang/zh-TW.umd.prod.js +2 -2
  115. package/dist/quasar.client.js +237 -174
  116. package/dist/quasar.css +1 -1
  117. package/dist/quasar.prod.css +1 -1
  118. package/dist/quasar.rtl.css +1 -1
  119. package/dist/quasar.rtl.prod.css +1 -1
  120. package/dist/quasar.sass +2 -2
  121. package/dist/quasar.server.prod.cjs +15 -15
  122. package/dist/quasar.server.prod.js +8 -8
  123. package/dist/quasar.umd.js +237 -174
  124. package/dist/quasar.umd.prod.js +15 -15
  125. package/dist/types/index.d.ts +52 -3
  126. package/dist/vetur/quasar-attributes.json +1 -1
  127. package/dist/vetur/quasar-tags.json +1 -1
  128. package/dist/web-types/web-types.json +1 -1
  129. package/lang/ar-TN.js +6 -0
  130. package/lang/ar.js +6 -0
  131. package/lang/az-Latn.js +6 -0
  132. package/lang/bg.js +6 -0
  133. package/lang/bn.js +6 -0
  134. package/lang/bs-BA.js +6 -0
  135. package/lang/ca.js +6 -0
  136. package/lang/cs.js +6 -0
  137. package/lang/da.js +6 -0
  138. package/lang/de-CH.js +6 -0
  139. package/lang/de-DE.js +6 -0
  140. package/lang/de.js +6 -0
  141. package/lang/el.js +6 -0
  142. package/lang/en-GB.js +6 -0
  143. package/lang/en-US.js +6 -0
  144. package/lang/eo.js +6 -0
  145. package/lang/es.js +6 -0
  146. package/lang/et.js +6 -0
  147. package/lang/eu.js +6 -0
  148. package/lang/fa-IR.js +6 -0
  149. package/lang/fa.js +6 -0
  150. package/lang/fi.js +6 -0
  151. package/lang/fr.js +6 -0
  152. package/lang/gn.js +6 -0
  153. package/lang/he.js +6 -0
  154. package/lang/hi.js +6 -0
  155. package/lang/hr.js +6 -0
  156. package/lang/hu.js +6 -0
  157. package/lang/id.js +6 -0
  158. package/lang/index.json +1 -1
  159. package/lang/is.js +6 -0
  160. package/lang/it.js +6 -0
  161. package/lang/ja.js +6 -0
  162. package/lang/kk.js +6 -0
  163. package/lang/km.js +6 -0
  164. package/lang/ko-KR.js +6 -0
  165. package/lang/kur-CKB.js +6 -0
  166. package/lang/lt.js +6 -0
  167. package/lang/lu.js +6 -0
  168. package/lang/lv.js +6 -0
  169. package/lang/mk.js +6 -0
  170. package/lang/ml.js +6 -0
  171. package/lang/mm.js +6 -0
  172. package/lang/ms-MY.js +6 -0
  173. package/lang/ms.js +6 -0
  174. package/lang/my.js +6 -0
  175. package/lang/nb-NO.js +6 -0
  176. package/lang/nl.js +6 -0
  177. package/lang/pl.js +6 -0
  178. package/lang/pt-BR.js +6 -0
  179. package/lang/pt.js +6 -0
  180. package/lang/ro.js +6 -0
  181. package/lang/ru.js +6 -0
  182. package/lang/sk.js +6 -0
  183. package/lang/sl.js +6 -0
  184. package/lang/sm.js +6 -0
  185. package/lang/sr-CYR.js +6 -0
  186. package/lang/sr.js +6 -0
  187. package/lang/sv.js +6 -0
  188. package/lang/ta.js +6 -0
  189. package/lang/th.js +6 -0
  190. package/lang/tl.js +6 -0
  191. package/lang/tr.js +6 -0
  192. package/lang/uk.js +6 -0
  193. package/lang/ur-PK.js +111 -0
  194. package/lang/uz-Cyrl.js +6 -0
  195. package/lang/uz-Latn.js +6 -0
  196. package/lang/vi.js +6 -0
  197. package/lang/zh-CN.js +6 -0
  198. package/lang/zh-TW.js +6 -0
  199. package/package.json +3 -3
  200. package/src/components/breadcrumbs/QBreadcrumbs.js +2 -2
  201. package/src/components/btn/QBtn.js +7 -8
  202. package/src/components/btn-dropdown/QBtnDropdown.js +10 -4
  203. package/src/components/btn-dropdown/QBtnDropdown.json +21 -0
  204. package/src/components/color/QColor.js +1 -1
  205. package/src/components/date/QDate.js +1 -1
  206. package/src/components/dialog/QDialog.js +2 -2
  207. package/src/components/dialog/QDialog.json +1 -1
  208. package/src/components/drawer/QDrawer.js +3 -5
  209. package/src/components/editor/QEditor.js +1 -1
  210. package/src/components/editor/editor-caret.js +1 -1
  211. package/src/components/editor/editor-utils.js +2 -2
  212. package/src/components/expansion-item/QExpansionItem.js +6 -3
  213. package/src/components/fab/QFab.js +2 -2
  214. package/src/components/form/QForm.js +2 -2
  215. package/src/components/form/QFormChildMixin.js +6 -4
  216. package/src/components/icon/QIcon.js +2 -2
  217. package/src/components/infinite-scroll/QInfiniteScroll.js +2 -4
  218. package/src/components/input/QInput.js +3 -3
  219. package/src/components/item/QItem.js +1 -1
  220. package/src/components/menu/QMenu.js +8 -5
  221. package/src/components/menu/QMenu.json +8 -1
  222. package/src/components/pagination/QPagination.js +8 -4
  223. package/src/components/parallax/QParallax.js +1 -1
  224. package/src/components/popup-edit/QPopupEdit.js +2 -2
  225. package/src/components/pull-to-refresh/QPullToRefresh.js +1 -1
  226. package/src/components/rating/QRating.sass +1 -1
  227. package/src/components/resize-observer/QResizeObserver.js +1 -1
  228. package/src/components/scroll-observer/QScrollObserver.js +2 -2
  229. package/src/components/select/QSelect.js +8 -6
  230. package/src/components/select/QSelect.json +1 -1
  231. package/src/components/slide-transition/QSlideTransition.js +2 -2
  232. package/src/components/stepper/StepHeader.js +1 -1
  233. package/src/components/table/QTable.js +77 -36
  234. package/src/components/table/QTable.json +98 -0
  235. package/src/components/table/QTr.js +4 -1
  236. package/src/components/table/table-sort.js +1 -1
  237. package/src/components/tabs/QTabs.js +2 -2
  238. package/src/components/tabs/use-tab.js +4 -4
  239. package/src/components/time/QTime.js +1 -1
  240. package/src/components/tree/QTree.js +2 -3
  241. package/src/components/virtual-scroll/use-virtual-scroll.js +3 -3
  242. package/src/composables/private.use-field/use-field.js +5 -5
  243. package/src/composables/private.use-file/use-file.js +6 -3
  244. package/src/composables/private.use-model-toggle/use-model-toggle.js +2 -2
  245. package/src/composables/private.use-refocus-target/use-refocus-target.js +6 -5
  246. package/src/composables/private.use-validate/use-validate.js +1 -1
  247. package/src/directives/intersection/Intersection.js +2 -2
  248. package/src/directives/morph/Morph.js +2 -2
  249. package/src/directives/mutation/Mutation.js +2 -2
  250. package/src/directives/touch-hold/TouchHold.js +2 -2
  251. package/src/directives/touch-pan/TouchPan.js +2 -2
  252. package/src/directives/touch-repeat/TouchRepeat.js +3 -3
  253. package/src/directives/touch-swipe/TouchSwipe.js +3 -3
  254. package/src/plugins/lang/Lang.test.js +12 -0
  255. package/src/plugins/loading/Loading.js +1 -1
  256. package/src/plugins/notify/Notify.js +1 -1
  257. package/src/plugins/private.body/Body.js +1 -1
  258. package/src/plugins/private.history/History.js +1 -1
  259. package/src/plugins/screen/Screen.js +1 -1
  260. package/src/utils/morph/morph.js +13 -10
  261. package/src/utils/open-url/open-url.js +3 -3
  262. package/src/utils/private.dialog/create-dialog.js +2 -2
  263. package/src/utils/private.portal/portal.js +1 -1
  264. package/src/components/date/__tests__/QDate.cy.js +0 -189
  265. package/src/components/date/__tests__/use-datetime.cy.js +0 -83
  266. package/src/components/editor/__tests__/QEditor.cy.js +0 -195
  267. package/src/components/field/__tests__/QField.cy.js +0 -156
  268. package/src/components/input/__tests__/QInput.cy.js +0 -786
  269. package/src/components/input/__tests__/use-mask.cy.js +0 -124
  270. package/src/components/menu/__tests__/QMenu.cy.js +0 -634
  271. package/src/components/menu/__tests__/WrapperOne.vue +0 -51
  272. package/src/components/menu/__tests__/WrapperTwo.vue +0 -38
  273. package/src/components/select/__tests__/QSelect.cy.js +0 -2018
  274. package/src/components/table/__tests__/QTable.cy.js +0 -635
  275. package/src/components/table/__tests__/QTd.cy.js +0 -35
  276. package/src/components/table/__tests__/QTh.cy.js +0 -27
  277. package/src/components/table/__tests__/QTr.cy.js +0 -27
  278. package/src/components/tabs/__tests__/QTab.cy.js +0 -79
  279. package/src/components/tabs/__tests__/QTabs.cy.js +0 -147
  280. package/src/components/uploader/__tests__/QUploader.cy.js +0 -191
  281. package/src/composables/__tests__/FieldWrapper.vue +0 -54
  282. package/src/composables/__tests__/use-anchor.cy.js +0 -98
  283. package/src/composables/__tests__/use-field.cy.js +0 -547
  284. package/src/composables/__tests__/use-file.cy.js +0 -69
  285. package/src/composables/__tests__/use-fullscreen.cy.js +0 -37
  286. package/src/composables/__tests__/use-model-toggle.cy.js +0 -350
  287. package/src/composables/__tests__/use-portal.cy.js +0 -4
  288. package/src/composables/__tests__/use-router-link.cy.js +0 -55
  289. package/src/composables/__tests__/use-validate.cy.js +0 -257
@@ -1,547 +0,0 @@
1
- import FieldWrapper from './FieldWrapper.vue'
2
- import { ref } from 'vue'
3
- import { vModelAdapter } from '@quasar/quasar-app-extension-testing-e2e-cypress'
4
- import Icons from '../../../../icon-set/material-icons.mjs'
5
-
6
- function mountQFieldWrapper (options) {
7
- return cy.mount(FieldWrapper, options)
8
- }
9
-
10
- function getHostElement () {
11
- return cy.get('.select-root')
12
- }
13
-
14
- const selectOptions = [ 'Option 1', 'Option 2' ]
15
-
16
- describe('use-field API', () => {
17
- describe('Props', () => {
18
- describe('Category: behavior', () => {
19
- describe('(prop): autofocus', () => {
20
- it('should autofocus on component', () => {
21
- mountQFieldWrapper({
22
- props: {
23
- autofocus: true
24
- }
25
- })
26
-
27
- getHostElement()
28
- .get('.q-field--focused')
29
- .should('exist')
30
- .get('input')
31
- .should('have.focus')
32
- })
33
- })
34
-
35
- describe('(prop): for', () => {
36
- it('should set the for attribute for the value and the id of the control', () => {
37
- const forProp = 'hello-there'
38
-
39
- mountQFieldWrapper({
40
- props: {
41
- for: forProp
42
- }
43
- })
44
-
45
- getHostElement().should('have.attr', 'for', forProp)
46
- getHostElement().get('input').should('have.id', forProp)
47
- })
48
- })
49
-
50
- describe('(prop): name', () => {
51
- it('should use the value of the for prop as control name if name is not set', () => {
52
- const forProp = 'hello-there'
53
- const model = ref(selectOptions[ 0 ])
54
-
55
- mountQFieldWrapper({
56
- props: {
57
- ...vModelAdapter(model),
58
- options: selectOptions,
59
- for: forProp
60
- }
61
- })
62
-
63
- getHostElement().get('select').should('have.attr', 'name', forProp)
64
- })
65
-
66
- it('should set the name of the control', () => {
67
- const name = 'hello-there'
68
- const model = ref(selectOptions[ 0 ])
69
-
70
- mountQFieldWrapper({
71
- props: {
72
- ...vModelAdapter(model),
73
- options: selectOptions,
74
- name
75
- }
76
- })
77
-
78
- getHostElement().get('select').should('have.attr', 'name', name)
79
- })
80
- })
81
- })
82
-
83
- describe('Category: behavior|content', () => {
84
- describe('(prop): loading', () => {
85
- it('should set the component into a loading state', () => {
86
- mountQFieldWrapper({
87
- props: {
88
- loading: true
89
- }
90
- })
91
-
92
- getHostElement().get('.q-spinner').should('exist')
93
- })
94
- })
95
-
96
- describe('(prop): clearable', () => {
97
- it('should append a clear icon', () => {
98
- const model = ref(selectOptions[ 0 ])
99
-
100
- mountQFieldWrapper({
101
- props: {
102
- ...vModelAdapter(model),
103
- clearable: true,
104
- options: selectOptions
105
- }
106
- })
107
-
108
- getHostElement().find('input').should('exist').should('have.value', model.value)
109
- getHostElement().get('button[type="button"]').contains(Icons.field.clear).click()
110
- getHostElement().get('input').should('have.value', '')
111
- })
112
- })
113
- })
114
-
115
- describe('Category: content', () => {
116
- describe('(prop): label', () => {
117
- it('should show the label when supplied', () => {
118
- const label = 'Select something'
119
- cy.mount(FieldWrapper, {
120
- props: {
121
- label
122
- }
123
- })
124
- cy.get('.select-root')
125
- .should('contain.text', label)
126
- })
127
-
128
- it('should show the label centered when not focused', () => {
129
- const label = 'Select something'
130
- cy.mount(FieldWrapper, {
131
- props: {
132
- label
133
- }
134
- })
135
- cy.get('.select-root')
136
- .get(`div:contains(${ label })`)
137
- .should('exist')
138
- .should('not.have.class', 'q-field--float')
139
- })
140
-
141
- it('should show the label stacked when focused', () => {
142
- const label = 'Select something'
143
- cy.mount(FieldWrapper, {
144
- props: {
145
- label
146
- }
147
- })
148
- cy.get('.select-root [tabindex="0"]')
149
- .focus()
150
- cy.get(`.select-root:contains(${ label })`)
151
- .should('exist')
152
- .should('have.class', 'q-field--float')
153
- })
154
- })
155
-
156
- describe('(prop): stack-label', () => {
157
- it('should show the label stacked', () => {
158
- const label = 'Select something'
159
- cy.mount(FieldWrapper, {
160
- props: {
161
- label,
162
- stackLabel: true
163
- }
164
- })
165
- cy.get(`.select-root:contains(${ label })`)
166
- .should('exist')
167
- .should('have.class', 'q-field--float')
168
- })
169
- })
170
-
171
- describe('(prop): hint', () => {
172
- it('should show a hint text', () => {
173
- const hint = 'Select something'
174
- cy.mount(FieldWrapper, {
175
- props: {
176
- hint
177
- }
178
- })
179
- cy.get(`.select-root:contains(${ hint })`)
180
- .should('exist')
181
- })
182
- })
183
-
184
- describe('(prop): hide-hint', () => {
185
- it('should not show a hint text when not focused', () => {
186
- const hint = 'Select something'
187
- cy.mount(FieldWrapper, {
188
- props: {
189
- hint,
190
- hideHint: true
191
- }
192
- })
193
- cy.get(`.select-root:contains(${ hint })`)
194
- .should('not.exist')
195
- })
196
- it('should show a hint text when focused', () => {
197
- const hint = 'Select something'
198
- cy.mount(FieldWrapper, {
199
- props: {
200
- hint,
201
- hideHint: true
202
- }
203
- })
204
- cy.get('.select-root [tabindex="0"]')
205
- .focus()
206
- cy.get(`.select-root:contains(${ hint })`)
207
- .should('exist')
208
- })
209
- })
210
-
211
- describe('(prop): prefix', () => {
212
- it('should display a prefix', () => {
213
- const prefix = 'Hello there!'
214
- mountQFieldWrapper({
215
- props: {
216
- prefix
217
- }
218
- })
219
-
220
- getHostElement().get('.q-field__prefix').should('exist').should('contain', prefix)
221
- })
222
- })
223
-
224
- describe('(prop): suffix', () => {
225
- it('should display a suffix', () => {
226
- const suffix = 'Hello there!'
227
- mountQFieldWrapper({
228
- props: {
229
- suffix
230
- }
231
- })
232
-
233
- getHostElement().get('.q-field__suffix').should('exist').should('contain', suffix)
234
- })
235
- })
236
-
237
- describe('(prop): clear-icon', () => {
238
- it('should display custom clear-icon when one is set', () => {
239
- const model = ref(selectOptions[ 0 ])
240
- const clearIcon = 'custom-clear-icon'
241
- mountQFieldWrapper({
242
- props: {
243
- ...vModelAdapter(model),
244
- options: selectOptions,
245
- clearable: true,
246
- clearIcon
247
- }
248
- })
249
-
250
- getHostElement().get('.q-field__append').get('button').should('contain', clearIcon)
251
- })
252
- })
253
-
254
- describe('(prop): label-slot', () => {
255
- it('should force the use of the label slot even when a label prop is set', () => {
256
- const model = ref(selectOptions[ 0 ])
257
- const labelSlot = 'Hello world'
258
-
259
- mountQFieldWrapper({
260
- props: {
261
- ...vModelAdapter(model),
262
- options: selectOptions,
263
- labelSlot: true,
264
- label: 'Hello there'
265
- },
266
- slots: {
267
- label: () => labelSlot
268
- }
269
- })
270
-
271
- getHostElement().find('.q-field__label').should('contain.text', labelSlot)
272
- })
273
- })
274
-
275
- describe('(prop): bottom-slots', () => {
276
- it('should use a bottom error slot', () => {
277
- const model = ref(selectOptions[ 0 ])
278
- const bottomSlot = 'Hello there'
279
-
280
- mountQFieldWrapper({
281
- props: {
282
- ...vModelAdapter(model),
283
- options: selectOptions,
284
- bottomSlotSlots: true,
285
- error: true
286
- },
287
- slots: {
288
- error: () => bottomSlot
289
- }
290
- })
291
-
292
- getHostElement().find('.q-field__bottom')
293
- .should('contain.text', bottomSlot)
294
- })
295
-
296
- it('should use a bottom hint slot', () => {
297
- const model = ref(selectOptions[ 0 ])
298
- const bottomSlot = 'Hello there'
299
-
300
- mountQFieldWrapper({
301
- props: {
302
- ...vModelAdapter(model),
303
- options: selectOptions,
304
- bottomSlots: true
305
- },
306
- slots: {
307
- hint: () => bottomSlot
308
- }
309
- })
310
-
311
- getHostElement().find('.q-field__bottom').should('contain.text', bottomSlot)
312
- })
313
-
314
- it('should use a bottom counter slot', () => {
315
- const model = ref(selectOptions[ 0 ])
316
-
317
- mountQFieldWrapper({
318
- props: {
319
- ...vModelAdapter(model),
320
- options: selectOptions,
321
- counter: true
322
- }
323
- })
324
-
325
- getHostElement().find('.q-field__bottom').should('contain.text', model.value.length)
326
- })
327
- })
328
-
329
- describe('(prop): counter', () => {
330
- it('should show an automatic counter on bottom right', () => {
331
- const model = ref(selectOptions[ 0 ])
332
- mountQFieldWrapper({
333
- props: {
334
- ...vModelAdapter(model),
335
- options: selectOptions,
336
- counter: true
337
- }
338
- })
339
-
340
- getHostElement().get('.q-field__counter').should('contain', model.value.length)
341
- })
342
- })
343
- })
344
-
345
- describe('Category: state', () => {
346
- describe('(prop): disable', () => {
347
- it('should put the component on disable state', () => {
348
- mountQFieldWrapper({
349
- props: {
350
- disable: true
351
- }
352
- })
353
-
354
- getHostElement().should('have.class', 'q-field--disabled')
355
- })
356
- })
357
-
358
- describe('(prop): readonly', () => {
359
- it('should put the component on readonly state', () => {
360
- mountQFieldWrapper({
361
- props: {
362
- readonly: true
363
- }
364
- })
365
-
366
- getHostElement().should('have.class', 'q-field--readonly')
367
- })
368
- })
369
- })
370
-
371
- describe('Category: style', () => {
372
- describe('(prop): label-color', () => {
373
- it('should display a label color', () => {
374
- const label = 'Hello there!'
375
- mountQFieldWrapper({
376
- props: {
377
- label,
378
- labelColor: 'red'
379
- }
380
- })
381
-
382
- getHostElement().get('.q-field__label.text-red').should('contain', label)
383
- })
384
- })
385
-
386
- describe('(prop): color', () => {
387
- it('should set a color on the component', () => {
388
- mountQFieldWrapper()
389
- getHostElement().get('.q-field__control.text-red').should('not.exist')
390
-
391
- getHostElement().get('input').then(() => {
392
- Cypress.vueWrapper.setProps({ color: 'red' })
393
-
394
- getHostElement().get('.q-field__control.text-red').should('exist')
395
- })
396
- })
397
- })
398
-
399
- describe('(prop): bg-color', () => {
400
- it('should display a background color', () => {
401
- mountQFieldWrapper({
402
- props: {
403
- bgColor: 'red'
404
- }
405
- })
406
-
407
- getHostElement().get('.q-field__control.bg-red').should('exist')
408
- })
409
- })
410
-
411
- describe('(prop): hide-bottom-space', () => {
412
- it.skip(' ', () => {
413
- //
414
- })
415
- })
416
-
417
- const fieldLooks = [ 'item-aligned', 'dark', 'filled', 'outlined', 'borderless', 'standout', 'rounded', 'square', 'dense' ]
418
- for (const style of fieldLooks) {
419
- describe(`(prop): ${ style }`, () => {
420
- it(`should apply ${ style } design style`, () => {
421
- mountQFieldWrapper({
422
- props: {
423
- [ style ]: true
424
- }
425
- })
426
-
427
- getHostElement().get(`.q-field--${ style }`).should('exist')
428
- })
429
- })
430
- }
431
- })
432
- })
433
-
434
- describe('Slots', () => {
435
- const slots = [ 'prepend', 'append', 'before', 'after', 'label' ]
436
-
437
- describe('(slot): default', () => {
438
- it('should use the default slot', () => {
439
- const model = ref(selectOptions[ 0 ])
440
- const labelSlot = 'Hello world'
441
-
442
- mountQFieldWrapper({
443
- props: {
444
- ...vModelAdapter(model),
445
- options: selectOptions,
446
- labelSlot: true
447
- },
448
- slots: {
449
- default: () => labelSlot
450
- }
451
- })
452
-
453
- getHostElement().should('contain.text', labelSlot)
454
- })
455
- })
456
-
457
- for (const slot of slots) {
458
- describe(`(slot): ${ slot }`, () => {
459
- it(`should append a '${ slot }' slot`, () => {
460
- const model = ref(selectOptions[ 0 ])
461
- const labelSlot = 'Hello world'
462
-
463
- mountQFieldWrapper({
464
- props: {
465
- ...vModelAdapter(model),
466
- options: selectOptions,
467
- labelSlot: true
468
- },
469
- slots: {
470
- [ slot ]: () => labelSlot
471
- }
472
- })
473
-
474
- getHostElement().get(`.q-field__${ slot }`).should('contain.text', labelSlot)
475
- })
476
- })
477
- }
478
- })
479
-
480
- describe('Events', () => {
481
- describe('(event): clear', () => {
482
- it('should emit the clear event when the clear button is clicked', () => {
483
- const model = ref(selectOptions[ 0 ])
484
- const fn = cy.stub()
485
-
486
- mountQFieldWrapper({
487
- props: {
488
- ...vModelAdapter(model),
489
- clearable: true,
490
- options: selectOptions,
491
- onClear: fn
492
- }
493
- })
494
-
495
- getHostElement().get('button[type="button"]')
496
- .contains(Icons.field.clear).click()
497
- .then(() => {
498
- expect(fn).to.be.calledWith()
499
- })
500
- })
501
- })
502
- })
503
-
504
- describe('Methods', () => {
505
- describe('(method): focus', () => {
506
- it('should focus the component', () => {
507
- mountQFieldWrapper()
508
-
509
- getHostElement()
510
- .get('input')
511
- .should('not.have.focus')
512
- getHostElement()
513
- .then(() => {
514
- Cypress.vueWrapper.vm.focusMethod()
515
- })
516
- getHostElement()
517
- .get('input')
518
- .should('have.focus')
519
- })
520
- })
521
-
522
- describe('(method): blur', () => {
523
- it('should blur the component', () => {
524
- mountQFieldWrapper()
525
-
526
- getHostElement()
527
- .get('input').focus()
528
- getHostElement()
529
- .get('.q-field--focused')
530
- .as('focused-element')
531
- .should('exist')
532
-
533
- cy.get('@focused-element')
534
- .get('input')
535
- .should('have.focus')
536
-
537
- getHostElement()
538
- .then(() => {
539
- Cypress.vueWrapper.vm.blur()
540
- })
541
-
542
- cy.get('@focused-element').should('not.exist')
543
- getHostElement().get('input').should('not.have.focus')
544
- })
545
- })
546
- })
547
- })
@@ -1,69 +0,0 @@
1
- describe('use-file API', () => {
2
- describe('Props', () => {
3
- describe('Category: behavior', () => {
4
- describe('(prop): multiple', () => {
5
- it.skip(' ', () => {
6
- //
7
- })
8
- })
9
-
10
- describe('(prop): accept', () => {
11
- it.skip(' ', () => {
12
- //
13
- })
14
- })
15
-
16
- describe('(prop): capture', () => {
17
- it.skip(' ', () => {
18
- //
19
- })
20
- })
21
-
22
- describe('(prop): max-file-size', () => {
23
- it.skip(' ', () => {
24
- //
25
- })
26
- })
27
-
28
- describe('(prop): max-total-size', () => {
29
- it.skip(' ', () => {
30
- //
31
- })
32
- })
33
-
34
- describe('(prop): max-files', () => {
35
- it.skip(' ', () => {
36
- //
37
- })
38
- })
39
-
40
- describe('(prop): filter', () => {
41
- it.skip(' ', () => {
42
- //
43
- })
44
- })
45
- })
46
- })
47
-
48
- describe('Events', () => {
49
- describe('(event): rejected', () => {
50
- it.skip(' ', () => {
51
- //
52
- })
53
- })
54
- })
55
-
56
- describe('Methods', () => {
57
- describe('(method): pickFiles', () => {
58
- it.skip(' ', () => {
59
- //
60
- })
61
- })
62
-
63
- describe('(method): addFiles', () => {
64
- it.skip(' ', () => {
65
- //
66
- })
67
- })
68
- })
69
- })
@@ -1,37 +0,0 @@
1
- describe('use-fullscreen API', () => {
2
- describe('Props', () => {
3
- describe('Category: behavior', () => {
4
- describe('(prop): fullscreen', () => {
5
- it.skip(' ', () => {
6
- //
7
- })
8
- })
9
-
10
- describe('(prop): no-route-fullscreen-exit', () => {
11
- it.skip(' ', () => {
12
- //
13
- })
14
- })
15
- })
16
- })
17
-
18
- describe('Methods', () => {
19
- describe('(method): toggleFullscreen', () => {
20
- it.skip(' ', () => {
21
- //
22
- })
23
- })
24
-
25
- describe('(method): setFullscreen', () => {
26
- it.skip(' ', () => {
27
- //
28
- })
29
- })
30
-
31
- describe('(method): exitFullscreen', () => {
32
- it.skip(' ', () => {
33
- //
34
- })
35
- })
36
- })
37
- })