quasar 2.14.6 → 2.15.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 (171) hide show
  1. package/dist/api/Intersection.json +1 -1
  2. package/dist/api/QDialog.json +1 -1
  3. package/dist/api/QImg.json +1 -1
  4. package/dist/api/QSelect.json +1 -1
  5. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  6. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  7. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  8. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  9. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
  10. package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
  11. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  12. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  13. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  14. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  15. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  16. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  17. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  18. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  19. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  20. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  21. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  22. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  23. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  24. package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
  25. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  34. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  35. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  36. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
  38. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
  39. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
  40. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  41. package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
  42. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  43. package/dist/icon-set/themify.umd.prod.js +1 -1
  44. package/dist/lang/ar-TN.umd.prod.js +1 -1
  45. package/dist/lang/ar.umd.prod.js +1 -1
  46. package/dist/lang/az-Latn.umd.prod.js +1 -1
  47. package/dist/lang/bg.umd.prod.js +1 -1
  48. package/dist/lang/bn.umd.prod.js +1 -1
  49. package/dist/lang/ca.umd.prod.js +1 -1
  50. package/dist/lang/cs.umd.prod.js +1 -1
  51. package/dist/lang/da.umd.prod.js +1 -1
  52. package/dist/lang/de-CH.umd.prod.js +1 -1
  53. package/dist/lang/de-DE.umd.prod.js +1 -1
  54. package/dist/lang/de.umd.prod.js +1 -1
  55. package/dist/lang/el.umd.prod.js +1 -1
  56. package/dist/lang/en-GB.umd.prod.js +1 -1
  57. package/dist/lang/en-US.umd.prod.js +1 -1
  58. package/dist/lang/eo.umd.prod.js +1 -1
  59. package/dist/lang/es.umd.prod.js +1 -1
  60. package/dist/lang/et.umd.prod.js +1 -1
  61. package/dist/lang/eu.umd.prod.js +1 -1
  62. package/dist/lang/fa-IR.umd.prod.js +1 -1
  63. package/dist/lang/fa.umd.prod.js +1 -1
  64. package/dist/lang/fi.umd.prod.js +1 -1
  65. package/dist/lang/fr.umd.prod.js +1 -1
  66. package/dist/lang/gn.umd.prod.js +1 -1
  67. package/dist/lang/he.umd.prod.js +1 -1
  68. package/dist/lang/hi.umd.prod.js +1 -1
  69. package/dist/lang/hr.umd.prod.js +1 -1
  70. package/dist/lang/hu.umd.prod.js +1 -1
  71. package/dist/lang/id.umd.prod.js +1 -1
  72. package/dist/lang/is.umd.prod.js +1 -1
  73. package/dist/lang/it.umd.prod.js +1 -1
  74. package/dist/lang/ja.umd.prod.js +1 -1
  75. package/dist/lang/kk.umd.prod.js +1 -1
  76. package/dist/lang/km.umd.prod.js +1 -1
  77. package/dist/lang/ko-KR.umd.prod.js +1 -1
  78. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  79. package/dist/lang/lt.umd.prod.js +1 -1
  80. package/dist/lang/lu.umd.prod.js +1 -1
  81. package/dist/lang/lv.umd.prod.js +1 -1
  82. package/dist/lang/mk.umd.prod.js +1 -1
  83. package/dist/lang/ml.umd.prod.js +1 -1
  84. package/dist/lang/mm.umd.prod.js +1 -1
  85. package/dist/lang/ms-MY.umd.prod.js +7 -0
  86. package/dist/lang/ms.umd.prod.js +1 -1
  87. package/dist/lang/my.umd.prod.js +1 -1
  88. package/dist/lang/nb-NO.umd.prod.js +1 -1
  89. package/dist/lang/nl.umd.prod.js +1 -1
  90. package/dist/lang/pl.umd.prod.js +1 -1
  91. package/dist/lang/pt-BR.umd.prod.js +1 -1
  92. package/dist/lang/pt.umd.prod.js +1 -1
  93. package/dist/lang/ro.umd.prod.js +1 -1
  94. package/dist/lang/ru.umd.prod.js +1 -1
  95. package/dist/lang/sk.umd.prod.js +1 -1
  96. package/dist/lang/sl.umd.prod.js +1 -1
  97. package/dist/lang/sm.umd.prod.js +1 -1
  98. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  99. package/dist/lang/sr.umd.prod.js +1 -1
  100. package/dist/lang/sv.umd.prod.js +1 -1
  101. package/dist/lang/ta.umd.prod.js +1 -1
  102. package/dist/lang/th.umd.prod.js +1 -1
  103. package/dist/lang/tl.umd.prod.js +1 -1
  104. package/dist/lang/tr.umd.prod.js +1 -1
  105. package/dist/lang/ug.umd.prod.js +1 -1
  106. package/dist/lang/uk.umd.prod.js +1 -1
  107. package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
  108. package/dist/lang/uz-Latn.umd.prod.js +1 -1
  109. package/dist/lang/vi.umd.prod.js +1 -1
  110. package/dist/lang/zh-CN.umd.prod.js +1 -1
  111. package/dist/lang/zh-TW.umd.prod.js +1 -1
  112. package/dist/quasar.cjs.prod.js +59 -59
  113. package/dist/quasar.css +5 -2
  114. package/dist/quasar.esm.js +959 -930
  115. package/dist/quasar.esm.prod.js +53 -53
  116. package/dist/quasar.rtl.css +5 -2
  117. package/dist/quasar.sass +9 -7
  118. package/dist/quasar.umd.js +146 -117
  119. package/dist/quasar.umd.prod.js +55 -55
  120. package/dist/transforms/import-map.json +1 -1
  121. package/dist/transforms/loader-asset-urls.json +1 -1
  122. package/dist/types/composables.d.ts +33 -0
  123. package/dist/types/index.d.ts +15 -130
  124. package/dist/vetur/quasar-attributes.json +1 -1
  125. package/dist/vetur/quasar-tags.json +1 -1
  126. package/dist/web-types/web-types.json +1 -1
  127. package/lang/index.json +1 -1
  128. package/lang/ms-MY.js +101 -0
  129. package/lang/ms-MY.mjs +96 -0
  130. package/lang/tl.js +1 -1
  131. package/lang/tl.mjs +1 -1
  132. package/package.json +5 -5
  133. package/src/components/btn-dropdown/QBtnDropdown.js +1 -1
  134. package/src/components/color/QColor.js +19 -13
  135. package/src/components/color/QColor.sass +1 -1
  136. package/src/components/date/QDate.js +2 -2
  137. package/src/components/dialog/QDialog.js +15 -3
  138. package/src/components/dialog/QDialog.json +19 -0
  139. package/src/components/drawer/QDrawer.js +1 -1
  140. package/src/components/editor/QEditor.js +4 -4
  141. package/src/components/expansion-item/QExpansionItem.js +1 -1
  142. package/src/components/fab/QFab.js +1 -1
  143. package/src/components/field/QField.sass +2 -1
  144. package/src/components/img/QImg.js +76 -56
  145. package/src/components/img/QImg.json +20 -6
  146. package/src/components/menu/QMenu.js +2 -2
  147. package/src/components/no-ssr/QNoSsr.js +3 -3
  148. package/src/components/resize-observer/QResizeObserver.js +3 -3
  149. package/src/components/select/QSelect.js +3 -0
  150. package/src/components/select/QSelect.json +7 -0
  151. package/src/components/slide-item/QSlideItem.js +3 -3
  152. package/src/components/stepper/QStep.js +3 -3
  153. package/src/components/table/QTable.sass +2 -2
  154. package/src/components/tabs/QTabs.js +2 -2
  155. package/src/components/tooltip/QTooltip.js +2 -2
  156. package/src/composables/private/use-field.js +9 -12
  157. package/src/composables/private/use-panel.js +3 -3
  158. package/src/composables/use-hydration.js +16 -0
  159. package/src/composables/use-id.js +50 -0
  160. package/src/composables/use-render-cache.js +40 -0
  161. package/src/composables/{private/use-split-attrs.js → use-split-attrs.js} +4 -2
  162. package/src/composables/{private/use-tick.js → use-tick.js} +1 -1
  163. package/src/composables/{private/use-timeout.js → use-timeout.js} +1 -1
  164. package/src/composables.js +15 -1
  165. package/src/css/core/colors.sass +0 -2
  166. package/src/css/core/visibility.sass +2 -1
  167. package/src/css/normalize.sass +1 -1
  168. package/src/directives/Intersection.json +13 -0
  169. package/src/composables/private/use-cache.js +0 -21
  170. package/src/composables/private/use-can-render.js +0 -16
  171. package/src/composables/private/use-id.js +0 -34
@@ -2,14 +2,15 @@ import { h, ref, computed, watch, onMounted, Transition, getCurrentInstance } fr
2
2
 
3
3
  import QSpinner from '../spinner/QSpinner.js'
4
4
 
5
+ import { isRuntimeSsrPreHydration } from '../../plugins/Platform.js'
5
6
  import useRatio, { useRatioProps } from '../../composables/private/use-ratio.js'
6
7
 
7
8
  import { createComponent } from '../../utils/private/create.js'
8
9
  import { hSlot } from '../../utils/private/render.js'
9
10
  import { vmIsDestroyed } from '../../utils/private/vm.js'
10
- import useTimeout from '../../composables/private/use-timeout.js'
11
+ import useTimeout from '../../composables/use-timeout.js'
11
12
 
12
- const defaultRatio = 16 / 9
13
+ const defaultRatio = 1.7778 /* 16/9 */
13
14
 
14
15
  export default createComponent({
15
16
  name: 'QImg',
@@ -49,6 +50,7 @@ export default createComponent({
49
50
  },
50
51
 
51
52
  placeholderSrc: String,
53
+ errorSrc: String,
52
54
 
53
55
  fit: {
54
56
  type: String,
@@ -80,9 +82,21 @@ export default createComponent({
80
82
  const { registerTimeout: registerLoadTimeout, removeTimeout: removeLoadTimeout } = useTimeout()
81
83
  const { registerTimeout: registerLoadShowTimeout, removeTimeout: removeLoadShowTimeout } = useTimeout()
82
84
 
85
+ const placeholderImg = computed(() => (
86
+ props.placeholderSrc !== void 0
87
+ ? { src: props.placeholderSrc }
88
+ : null
89
+ ))
90
+
91
+ const errorImg = computed(() => (
92
+ props.errorSrc !== void 0
93
+ ? { src: props.errorSrc, __qerror: true }
94
+ : null
95
+ ))
96
+
83
97
  const images = [
84
98
  ref(null),
85
- ref(getPlaceholderSrc())
99
+ ref(placeholderImg.value)
86
100
  ]
87
101
 
88
102
  const position = ref(0)
@@ -102,6 +116,7 @@ export default createComponent({
102
116
  const imgClass = computed(() =>
103
117
  `q-img__image ${ props.imgClass !== void 0 ? props.imgClass + ' ' : '' }`
104
118
  + `q-img__image--with${ props.noTransition === true ? 'out' : '' }-transition`
119
+ + ' q-img__image--'
105
120
  )
106
121
 
107
122
  const imgStyle = computed(() => ({
@@ -110,8 +125,6 @@ export default createComponent({
110
125
  objectPosition: props.position
111
126
  }))
112
127
 
113
- watch(() => getCurrentSrc(), addImage)
114
-
115
128
  function setLoading () {
116
129
  removeLoadShowTimeout()
117
130
 
@@ -130,37 +143,6 @@ export default createComponent({
130
143
  isLoading.value = false
131
144
  }
132
145
 
133
- function getCurrentSrc () {
134
- return props.src || props.srcset || props.sizes
135
- ? {
136
- src: props.src,
137
- srcset: props.srcset,
138
- sizes: props.sizes
139
- }
140
- : null
141
- }
142
-
143
- function getPlaceholderSrc () {
144
- return props.placeholderSrc !== void 0
145
- ? { src: props.placeholderSrc }
146
- : null
147
- }
148
-
149
- function addImage (imgProps) {
150
- removeLoadTimeout()
151
- hasError.value = false
152
-
153
- if (imgProps === null) {
154
- clearLoading()
155
- images[ position.value ^ 1 ].value = getPlaceholderSrc()
156
- }
157
- else {
158
- setLoading()
159
- }
160
-
161
- images[ position.value ].value = imgProps
162
- }
163
-
164
146
  function onLoad ({ target }) {
165
147
  if (vmIsDestroyed(vm) === false) {
166
148
  removeLoadTimeout()
@@ -187,14 +169,19 @@ export default createComponent({
187
169
  }
188
170
  }
189
171
 
190
- function onReady (img) {
172
+ function onReady (target) {
191
173
  if (vmIsDestroyed(vm) === true) return
192
174
 
193
175
  position.value = position.value ^ 1
194
176
  images[ position.value ].value = null
177
+
195
178
  clearLoading()
196
- hasError.value = false
197
- emit('load', img.currentSrc || img.src)
179
+
180
+ if (target.getAttribute('__qerror') !== 'true') {
181
+ hasError.value = false
182
+ }
183
+
184
+ emit('load', target.currentSrc || target.src)
198
185
  }
199
186
 
200
187
  function onError (err) {
@@ -202,8 +189,8 @@ export default createComponent({
202
189
  clearLoading()
203
190
 
204
191
  hasError.value = true
205
- images[ position.value ].value = null
206
- images[ position.value ^ 1 ].value = getPlaceholderSrc()
192
+ images[ position.value ].value = errorImg.value
193
+ images[ position.value ^ 1 ].value = placeholderImg.value
207
194
 
208
195
  emit('error', err)
209
196
  }
@@ -229,11 +216,14 @@ export default createComponent({
229
216
  }
230
217
 
231
218
  if (position.value === index) {
232
- data.class += ' q-img__image--waiting'
233
- Object.assign(data, { onLoad, onError })
219
+ Object.assign(data, {
220
+ class: data.class + 'current',
221
+ onLoad,
222
+ onError
223
+ })
234
224
  }
235
225
  else {
236
- data.class += ' q-img__image--loaded'
226
+ data.class += 'loaded'
237
227
  }
238
228
 
239
229
  return h(
@@ -271,13 +261,40 @@ export default createComponent({
271
261
  }
272
262
 
273
263
  if (__QUASAR_SSR_SERVER__ !== true) {
274
- if (__QUASAR_SSR_CLIENT__) {
275
- onMounted(() => {
276
- addImage(getCurrentSrc())
277
- })
264
+ function watchSrc () {
265
+ watch(
266
+ () => (
267
+ props.src || props.srcset || props.sizes
268
+ ? {
269
+ src: props.src,
270
+ srcset: props.srcset,
271
+ sizes: props.sizes
272
+ }
273
+ : null
274
+ ),
275
+ imgProps => {
276
+ removeLoadTimeout()
277
+ hasError.value = false
278
+
279
+ if (imgProps === null) {
280
+ clearLoading()
281
+ images[ position.value ^ 1 ].value = placeholderImg.value
282
+ }
283
+ else {
284
+ setLoading()
285
+ }
286
+
287
+ images[ position.value ].value = imgProps
288
+ },
289
+ { immediate: true }
290
+ )
291
+ }
292
+
293
+ if (isRuntimeSsrPreHydration.value === true) {
294
+ onMounted(watchSrc)
278
295
  }
279
296
  else {
280
- addImage(getCurrentSrc())
297
+ watchSrc()
281
298
  }
282
299
  }
283
300
 
@@ -290,14 +307,16 @@ export default createComponent({
290
307
  )
291
308
  }
292
309
 
293
- if (hasError.value !== true) {
294
- if (images[ 0 ].value !== null) {
295
- content.push(getImage(0))
296
- }
310
+ if (images[ 0 ].value !== null) {
311
+ content.push(
312
+ getImage(0)
313
+ )
314
+ }
297
315
 
298
- if (images[ 1 ].value !== null) {
299
- content.push(getImage(1))
300
- }
316
+ if (images[ 1 ].value !== null) {
317
+ content.push(
318
+ getImage(1)
319
+ )
301
320
  }
302
321
 
303
322
  content.push(
@@ -305,6 +324,7 @@ export default createComponent({
305
324
  )
306
325
 
307
326
  return h('div', {
327
+ key: 'main',
308
328
  class: classes.value,
309
329
  style: style.value,
310
330
  role: 'img',
@@ -44,14 +44,28 @@
44
44
  "desc": "While waiting for your image to load, you can use a placeholder image",
45
45
  "transformAssetUrls": true,
46
46
  "examples": [
47
- "(public folder) src=\"img/some-placeholder.png\"",
48
- "(assets folder) src=\"~assets/my-placeholder.gif\"",
49
- "(relative path format) :src=\"require('./placeholder.jpg')\"",
50
- "(URL) src=\"https://picsum.photos/500/300\""
47
+ "(public folder) placeholder-src=\"img/some-placeholder.png\"",
48
+ "(assets folder) placeholder-src=\"~assets/my-placeholder.gif\"",
49
+ "(relative path format) :placeholder-src=\"require('./placeholder.jpg')\"",
50
+ "(URL) placeholder-src=\"https://picsum.photos/500/300\""
51
51
  ],
52
52
  "category": "model"
53
53
  },
54
54
 
55
+ "error-src": {
56
+ "type": "String",
57
+ "desc": "In case your image fails to load, you can use an error image",
58
+ "transformAssetUrls": true,
59
+ "examples": [
60
+ "(public folder) error-src=\"img/some-placeholder.png\"",
61
+ "(assets folder) error-src=\"~assets/my-placeholder.gif\"",
62
+ "(relative path format) :error-src=\"require('./placeholder.jpg')\"",
63
+ "(URL) error-src=\"https://picsum.photos/500/300\""
64
+ ],
65
+ "category": "model",
66
+ "addedIn": "v2.15"
67
+ },
68
+
55
69
  "ratio": {
56
70
  "desc": "Force the component to maintain an aspect ratio",
57
71
  "examples": [
@@ -167,13 +181,13 @@
167
181
  "type": "String",
168
182
  "desc": "Specifies an alternate text for the image, if the image cannot be displayed",
169
183
  "examples": [ "Two cats" ],
170
- "category": "content"
184
+ "category": "miscellaneous"
171
185
  },
172
186
 
173
187
  "draggable": {
174
188
  "type": "Boolean",
175
189
  "desc": "Adds the native 'draggable' attribute",
176
- "category": "behavior"
190
+ "category": "miscellaneous"
177
191
  },
178
192
 
179
193
  "img-class": {
@@ -6,8 +6,8 @@ import useModelToggle, { useModelToggleProps, useModelToggleEmits } from '../../
6
6
  import useDark, { useDarkProps } from '../../composables/private/use-dark.js'
7
7
  import usePortal from '../../composables/private/use-portal.js'
8
8
  import useTransition, { useTransitionProps } from '../../composables/private/use-transition.js'
9
- import useTick from '../../composables/private/use-tick.js'
10
- import useTimeout from '../../composables/private/use-timeout.js'
9
+ import useTick from '../../composables/use-tick.js'
10
+ import useTimeout from '../../composables/use-timeout.js'
11
11
 
12
12
  import { createComponent } from '../../utils/private/create.js'
13
13
  import { closePortalMenus } from '../../utils/private/portal.js'
@@ -1,6 +1,6 @@
1
1
  import { h } from 'vue'
2
2
 
3
- import useCanRender from '../../composables/private/use-can-render.js'
3
+ import useHydration from '../../composables/use-hydration.js'
4
4
 
5
5
  import { createComponent } from '../../utils/private/create.js'
6
6
  import { hSlot } from '../../utils/private/render.js'
@@ -18,10 +18,10 @@ export default createComponent({
18
18
  },
19
19
 
20
20
  setup (props, { slots }) {
21
- const canRender = useCanRender()
21
+ const { isHydrated } = useHydration()
22
22
 
23
23
  return () => {
24
- if (canRender.value === true) {
24
+ if (isHydrated.value === true) {
25
25
  const node = hSlot(slots.default)
26
26
  return node === void 0
27
27
  ? node
@@ -1,6 +1,6 @@
1
1
  import { h, onMounted, onBeforeUnmount, getCurrentInstance, nextTick } from 'vue'
2
2
 
3
- import useCanRender from '../../composables/private/use-can-render.js'
3
+ import useHydration from '../../composables/use-hydration.js'
4
4
 
5
5
  import { createComponent } from '../../utils/private/create.js'
6
6
  import { listenOpts, noop } from '../../utils/event.js'
@@ -95,7 +95,7 @@ export default createComponent({
95
95
  return noop
96
96
  }
97
97
  else { // no observer, so fallback to old iframe method
98
- const canRender = useCanRender()
98
+ const { isHydrated } = useHydration()
99
99
 
100
100
  let curDocView
101
101
 
@@ -134,7 +134,7 @@ export default createComponent({
134
134
  onBeforeUnmount(cleanup)
135
135
 
136
136
  return () => {
137
- if (canRender.value === true) {
137
+ if (isHydrated.value === true) {
138
138
  return h('object', {
139
139
  class: 'q--avoid-card-border',
140
140
  style: resizeProps.style,
@@ -79,6 +79,7 @@ export default createComponent({
79
79
 
80
80
  popupContentClass: String,
81
81
  popupContentStyle: [ String, Array, Object ],
82
+ popupNoRouteDismiss: Boolean,
82
83
 
83
84
  useInput: Boolean,
84
85
  useChips: Boolean,
@@ -1186,6 +1187,7 @@ export default createComponent({
1186
1187
  noParentEvent: true,
1187
1188
  noRefocus: true,
1188
1189
  noFocus: true,
1190
+ noRouteDismiss: props.popupNoRouteDismiss,
1189
1191
  square: squaredMenu.value,
1190
1192
  transitionShow: props.transitionShow,
1191
1193
  transitionHide: props.transitionHide,
@@ -1263,6 +1265,7 @@ export default createComponent({
1263
1265
  transitionShow: transitionShowComputed,
1264
1266
  transitionHide: props.transitionHide,
1265
1267
  transitionDuration: props.transitionDuration,
1268
+ noRouteDismiss: props.popupNoRouteDismiss,
1266
1269
  onBeforeShow: onControlPopupShow,
1267
1270
  onBeforeHide: onDialogBeforeHide,
1268
1271
  onHide: onDialogHide,
@@ -232,6 +232,13 @@
232
232
  "category": "style"
233
233
  },
234
234
 
235
+ "popup-no-route-dismiss": {
236
+ "type": "Boolean",
237
+ "desc": "Changing route app won't dismiss the popup (menu or dialog)",
238
+ "category": "behavior",
239
+ "addedIn": "v2.15"
240
+ },
241
+
235
242
  "use-input": {
236
243
  "type": "Boolean",
237
244
  "desc": "Use an input tag where users can type",
@@ -3,7 +3,7 @@ import { h, ref, computed, withDirectives, onBeforeUnmount, onBeforeUpdate, getC
3
3
  import TouchPan from '../../directives/TouchPan.js'
4
4
 
5
5
  import useDark, { useDarkProps } from '../../composables/private/use-dark.js'
6
- import useCache from '../../composables/private/use-cache.js'
6
+ import useRenderCache from '../../composables/use-render-cache.js'
7
7
 
8
8
  import { createComponent } from '../../utils/private/create.js'
9
9
  import { hSlot } from '../../utils/private/render.js'
@@ -36,7 +36,7 @@ export default createComponent({
36
36
  const { $q } = proxy
37
37
 
38
38
  const isDark = useDark(props, $q)
39
- const { getCacheWithFn } = useCache()
39
+ const { getCache } = useRenderCache()
40
40
 
41
41
  const contentRef = ref(null)
42
42
 
@@ -209,7 +209,7 @@ export default createComponent({
209
209
  }
210
210
  else {
211
211
  content.push(
212
- withDirectives(node, getCacheWithFn('dir#' + dirs.join(''), () => {
212
+ withDirectives(node, getCache('dir#' + dirs.join(''), () => {
213
213
  const modifiers = {
214
214
  prevent: true,
215
215
  stop: true,
@@ -4,7 +4,7 @@ import QSlideTransition from '../slide-transition/QSlideTransition.js'
4
4
  import StepHeader from './StepHeader.js'
5
5
 
6
6
  import { usePanelChildProps } from '../../composables/private/use-panel.js'
7
- import useCache from '../../composables/private/use-cache.js'
7
+ import useRenderCache from '../../composables/use-render-cache.js'
8
8
 
9
9
  import { createComponent } from '../../utils/private/create.js'
10
10
  import { stepperKey, emptyRenderFn } from '../../utils/private/symbols.js'
@@ -67,7 +67,7 @@ export default createComponent({
67
67
  return emptyRenderFn
68
68
  }
69
69
 
70
- const { getCacheWithFn } = useCache()
70
+ const { getCache } = useRenderCache()
71
71
 
72
72
  const rootRef = ref(null)
73
73
 
@@ -106,7 +106,7 @@ export default createComponent({
106
106
  ? [
107
107
  h(
108
108
  $stepper.value.needsUniqueKeepAliveWrapper.value === true
109
- ? getCacheWithFn(contentKey.value, () => ({ ...PanelWrapper, name: contentKey.value }))
109
+ ? getCache(contentKey.value, () => ({ ...PanelWrapper, name: contentKey.value }))
110
110
  : PanelWrapper,
111
111
  { key: contentKey.value },
112
112
  slots.default
@@ -241,10 +241,10 @@
241
241
  /*
242
242
  * On light background
243
243
  */
244
- .q-table__bottom // @stylint ignore
244
+ .q-table__bottom
245
245
  border-top: 1px solid $table-border-color
246
246
 
247
- .q-table // @stylint ignore
247
+ .q-table
248
248
  thead, tr, th, td
249
249
  border-color: $table-border-color
250
250
 
@@ -3,8 +3,8 @@ import { h, ref, computed, watch, onBeforeUnmount, onActivated, onDeactivated, g
3
3
  import QIcon from '../icon/QIcon.js'
4
4
  import QResizeObserver from '../resize-observer/QResizeObserver.js'
5
5
 
6
- import useTick from '../../composables/private/use-tick.js'
7
- import useTimeout from '../../composables/private/use-timeout.js'
6
+ import useTick from '../../composables/use-tick.js'
7
+ import useTimeout from '../../composables/use-timeout.js'
8
8
 
9
9
  import { createComponent } from '../../utils/private/create.js'
10
10
  import { hSlot } from '../../utils/private/render.js'
@@ -5,8 +5,8 @@ import useScrollTarget from '../../composables/private/use-scroll-target.js'
5
5
  import useModelToggle, { useModelToggleProps, useModelToggleEmits } from '../../composables/private/use-model-toggle.js'
6
6
  import usePortal from '../../composables/private/use-portal.js'
7
7
  import useTransition, { useTransitionProps } from '../../composables/private/use-transition.js'
8
- import useTick from '../../composables/private/use-tick.js'
9
- import useTimeout from '../../composables/private/use-timeout.js'
8
+ import useTick from '../../composables/use-tick.js'
9
+ import useTimeout from '../../composables/use-timeout.js'
10
10
 
11
11
  import { createComponent } from '../../utils/private/create.js'
12
12
  import { getScrollTarget } from '../../utils/scroll.js'
@@ -1,12 +1,12 @@
1
- import { h, ref, computed, watch, Transition, nextTick, onActivated, onDeactivated, onBeforeUnmount, onMounted, getCurrentInstance } from 'vue'
1
+ import { h, ref, computed, Transition, nextTick, onActivated, onDeactivated, onBeforeUnmount, onMounted, getCurrentInstance } from 'vue'
2
2
 
3
3
  import QIcon from '../../components/icon/QIcon.js'
4
4
  import QSpinner from '../../components/spinner/QSpinner.js'
5
5
 
6
6
  import useDark, { useDarkProps } from '../../composables/private/use-dark.js'
7
- import useId, { getId } from './use-id.js'
7
+ import useId from '../use-id.js'
8
8
  import useValidate, { useValidateProps } from './use-validate.js'
9
- import useSplitAttrs from './use-split-attrs.js'
9
+ import useSplitAttrs from '../use-split-attrs.js'
10
10
 
11
11
  import { hSlot } from '../../utils/private/render.js'
12
12
  import { prevent, stopAndPrevent } from '../../utils/event.js'
@@ -69,10 +69,13 @@ export const useFieldProps = {
69
69
  export const useFieldEmits = [ 'update:modelValue', 'clear', 'focus', 'blur', 'popupShow', 'popupHide' ]
70
70
 
71
71
  export function useFieldState ({ requiredForAttr = true, tagProp } = {}) {
72
- const { props, attrs, proxy, vnode } = getCurrentInstance()
72
+ const { props, proxy } = getCurrentInstance()
73
73
 
74
74
  const isDark = useDark(props, proxy.$q)
75
- const targetUid = useId(props.for, requiredForAttr)
75
+ const targetUid = useId({
76
+ required: requiredForAttr,
77
+ getValue: () => props.for
78
+ })
76
79
 
77
80
  return {
78
81
  requiredForAttr,
@@ -90,7 +93,7 @@ export function useFieldState ({ requiredForAttr = true, tagProp } = {}) {
90
93
  focused: ref(false),
91
94
  hasPopupOpen: false,
92
95
 
93
- splitAttrs: useSplitAttrs(attrs, vnode),
96
+ splitAttrs: useSplitAttrs(),
94
97
  targetUid,
95
98
 
96
99
  rootRef: ref(null),
@@ -256,12 +259,6 @@ export default function (state) {
256
259
  return acc
257
260
  })
258
261
 
259
- watch(() => props.for, val => {
260
- // don't transform targetUid into a computed
261
- // prop as it will break SSR
262
- state.targetUid.value = getId(val, state.requiredForAttr)
263
- })
264
-
265
262
  function focusHandler () {
266
263
  const el = document.activeElement
267
264
  let target = state.targetRef !== void 0 && state.targetRef.value
@@ -2,7 +2,7 @@ import { h, ref, computed, watch, nextTick, getCurrentInstance, Transition, Keep
2
2
 
3
3
  import TouchSwipe from '../../directives/TouchSwipe.js'
4
4
 
5
- import useCache from '../../composables/private/use-cache.js'
5
+ import useRenderCache from '../../composables/use-render-cache.js'
6
6
 
7
7
  import { hSlot } from '../../utils/private/render.js'
8
8
  import { getNormalizedVNodes } from '../../utils/private/vm.js'
@@ -48,7 +48,7 @@ export const usePanelEmits = [ 'update:modelValue', 'beforeTransition', 'transit
48
48
 
49
49
  export default function () {
50
50
  const { props, emit, proxy } = getCurrentInstance()
51
- const { getCacheWithFn } = useCache()
51
+ const { getCache } = useRenderCache()
52
52
 
53
53
  let panels, forcedPanelTransition
54
54
 
@@ -207,7 +207,7 @@ export default function () {
207
207
  h(KeepAlive, keepAliveProps.value, [
208
208
  h(
209
209
  needsUniqueKeepAliveWrapper.value === true
210
- ? getCacheWithFn(contentKey.value, () => ({ ...PanelWrapper, name: contentKey.value }))
210
+ ? getCache(contentKey.value, () => ({ ...PanelWrapper, name: contentKey.value }))
211
211
  : PanelWrapper,
212
212
  { key: contentKey.value, style: transitionStyle.value },
213
213
  () => panel
@@ -0,0 +1,16 @@
1
+ import { ref, onMounted } from 'vue'
2
+
3
+ // using it to manage SSR rendering with best performance
4
+ import { isRuntimeSsrPreHydration } from '../plugins/Platform.js'
5
+
6
+ export default function () {
7
+ const isHydrated = ref(!isRuntimeSsrPreHydration.value)
8
+
9
+ if (isHydrated.value === false) {
10
+ onMounted(() => {
11
+ isHydrated.value = true
12
+ })
13
+ }
14
+
15
+ return { isHydrated }
16
+ }
@@ -0,0 +1,50 @@
1
+ import { ref, computed, watch, onMounted } from 'vue'
2
+
3
+ import uid from '../utils/uid.js'
4
+
5
+ import { isRuntimeSsrPreHydration } from '../plugins/Platform.js'
6
+
7
+ function parseValue (val) {
8
+ return val === void 0 || val === null
9
+ ? null
10
+ : val
11
+ }
12
+
13
+ function getId (val, required) {
14
+ return val === void 0 || val === null
15
+ ? (required === true ? `f_${ uid() }` : null)
16
+ : val
17
+ }
18
+
19
+ /**
20
+ * Returns an "id" which is a ref() that can be used as
21
+ * a unique identifier to apply to a DOM node attribute.
22
+ *
23
+ * On SSR, it takes care of generating the id on the client side (only) to
24
+ * avoid hydration errors.
25
+ */
26
+ export default function ({ getValue, required = true } = {}) {
27
+ if (isRuntimeSsrPreHydration.value === true) {
28
+ const id = getValue !== void 0
29
+ ? ref(parseValue(getValue()))
30
+ : ref(null)
31
+
32
+ if (required === true && id.value === null) {
33
+ onMounted(() => {
34
+ id.value = `f_${ uid() }` // getId(null, true)
35
+ })
36
+ }
37
+
38
+ if (getValue !== void 0) {
39
+ watch(getValue, newId => {
40
+ id.value = getId(newId, required)
41
+ })
42
+ }
43
+
44
+ return id
45
+ }
46
+
47
+ return getValue !== void 0
48
+ ? computed(() => getId(getValue(), required))
49
+ : ref(`f_${ uid() }`) // getId(null, true)
50
+ }
@@ -0,0 +1,40 @@
1
+ export default function () {
2
+ let cache = Object.create(null)
3
+
4
+ return {
5
+ getCache: __QUASAR_SSR_SERVER__
6
+ ? (_, defaultValue) => (
7
+ typeof defaultValue === 'function'
8
+ ? defaultValue()
9
+ : defaultValue
10
+ )
11
+ : (key, defaultValue) => (
12
+ cache[ key ] === void 0
13
+ ? (
14
+ cache[ key ] = (
15
+ typeof defaultValue === 'function'
16
+ ? defaultValue()
17
+ : defaultValue
18
+ )
19
+ )
20
+ : cache[ key ]
21
+ ),
22
+
23
+ setCache (key, obj) {
24
+ cache[ key ] = obj
25
+ },
26
+
27
+ hasCache (key) {
28
+ return cache.hasOwnProperty(key)
29
+ },
30
+
31
+ clearCache (key) {
32
+ if (key !== void 0) {
33
+ delete cache[ key ]
34
+ }
35
+ else {
36
+ cache = {}
37
+ }
38
+ }
39
+ }
40
+ }
@@ -1,8 +1,10 @@
1
- import { ref, onBeforeUpdate } from 'vue'
1
+ import { ref, onBeforeUpdate, getCurrentInstance } from 'vue'
2
2
 
3
3
  const listenerRE = /^on[A-Z]/
4
4
 
5
- export default function (attrs, vnode) {
5
+ export default function () {
6
+ const { attrs, vnode } = getCurrentInstance()
7
+
6
8
  const acc = {
7
9
  listeners: ref({}),
8
10
  attributes: ref({})