quasar 2.14.1 → 2.14.3

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 (144) hide show
  1. package/dist/api/Notify.json +2 -2
  2. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  3. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  4. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  5. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  6. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
  7. package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
  8. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  9. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  10. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  11. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  12. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  13. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  14. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  15. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  16. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  17. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  18. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  19. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  20. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  21. package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
  22. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +2 -2
  23. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  24. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  25. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  34. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
  35. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
  36. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  38. package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
  39. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  40. package/dist/icon-set/themify.umd.prod.js +1 -1
  41. package/dist/lang/ar-TN.umd.prod.js +1 -1
  42. package/dist/lang/ar.umd.prod.js +1 -1
  43. package/dist/lang/az-Latn.umd.prod.js +1 -1
  44. package/dist/lang/bg.umd.prod.js +1 -1
  45. package/dist/lang/bn.umd.prod.js +1 -1
  46. package/dist/lang/ca.umd.prod.js +1 -1
  47. package/dist/lang/cs.umd.prod.js +1 -1
  48. package/dist/lang/da.umd.prod.js +1 -1
  49. package/dist/lang/de-CH.umd.prod.js +1 -1
  50. package/dist/lang/de-DE.umd.prod.js +1 -1
  51. package/dist/lang/de.umd.prod.js +1 -1
  52. package/dist/lang/el.umd.prod.js +1 -1
  53. package/dist/lang/en-GB.umd.prod.js +1 -1
  54. package/dist/lang/en-US.umd.prod.js +1 -1
  55. package/dist/lang/eo.umd.prod.js +1 -1
  56. package/dist/lang/es.umd.prod.js +1 -1
  57. package/dist/lang/et.umd.prod.js +1 -1
  58. package/dist/lang/eu.umd.prod.js +1 -1
  59. package/dist/lang/fa-IR.umd.prod.js +1 -1
  60. package/dist/lang/fa.umd.prod.js +1 -1
  61. package/dist/lang/fi.umd.prod.js +1 -1
  62. package/dist/lang/fr.umd.prod.js +1 -1
  63. package/dist/lang/gn.umd.prod.js +1 -1
  64. package/dist/lang/he.umd.prod.js +1 -1
  65. package/dist/lang/hi.umd.prod.js +1 -1
  66. package/dist/lang/hr.umd.prod.js +1 -1
  67. package/dist/lang/hu.umd.prod.js +1 -1
  68. package/dist/lang/id.umd.prod.js +1 -1
  69. package/dist/lang/is.umd.prod.js +1 -1
  70. package/dist/lang/it.umd.prod.js +1 -1
  71. package/dist/lang/ja.umd.prod.js +1 -1
  72. package/dist/lang/kk.umd.prod.js +1 -1
  73. package/dist/lang/km.umd.prod.js +1 -1
  74. package/dist/lang/ko-KR.umd.prod.js +1 -1
  75. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  76. package/dist/lang/lt.umd.prod.js +1 -1
  77. package/dist/lang/lu.umd.prod.js +1 -1
  78. package/dist/lang/lv.umd.prod.js +1 -1
  79. package/dist/lang/mk.umd.prod.js +1 -1
  80. package/dist/lang/ml.umd.prod.js +1 -1
  81. package/dist/lang/mm.umd.prod.js +1 -1
  82. package/dist/lang/ms.umd.prod.js +1 -1
  83. package/dist/lang/my.umd.prod.js +1 -1
  84. package/dist/lang/nb-NO.umd.prod.js +1 -1
  85. package/dist/lang/nl.umd.prod.js +1 -1
  86. package/dist/lang/pl.umd.prod.js +1 -1
  87. package/dist/lang/pt-BR.umd.prod.js +1 -1
  88. package/dist/lang/pt.umd.prod.js +1 -1
  89. package/dist/lang/ro.umd.prod.js +1 -1
  90. package/dist/lang/ru.umd.prod.js +1 -1
  91. package/dist/lang/sk.umd.prod.js +1 -1
  92. package/dist/lang/sl.umd.prod.js +1 -1
  93. package/dist/lang/sm.umd.prod.js +1 -1
  94. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  95. package/dist/lang/sr.umd.prod.js +1 -1
  96. package/dist/lang/sv.umd.prod.js +1 -1
  97. package/dist/lang/ta.umd.prod.js +1 -1
  98. package/dist/lang/th.umd.prod.js +1 -1
  99. package/dist/lang/tr.umd.prod.js +1 -1
  100. package/dist/lang/ug.umd.prod.js +1 -1
  101. package/dist/lang/uk.umd.prod.js +1 -1
  102. package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
  103. package/dist/lang/uz-Latn.umd.prod.js +1 -1
  104. package/dist/lang/vi.umd.prod.js +1 -1
  105. package/dist/lang/zh-CN.umd.prod.js +1 -1
  106. package/dist/lang/zh-TW.umd.prod.js +1 -1
  107. package/dist/quasar.cjs.prod.js +2 -2
  108. package/dist/quasar.esm.js +153 -146
  109. package/dist/quasar.esm.prod.js +2 -2
  110. package/dist/quasar.sass +1 -1
  111. package/dist/quasar.umd.js +153 -146
  112. package/dist/quasar.umd.prod.js +2 -2
  113. package/dist/types/index.d.ts +2 -2
  114. package/dist/web-types/web-types.json +1 -1
  115. package/package.json +2 -2
  116. package/src/components/ajax-bar/QAjaxBar.js +12 -2
  117. package/src/components/btn-dropdown/QBtnDropdown.js +4 -4
  118. package/src/components/color/QColor.js +5 -9
  119. package/src/components/date/QDate.js +1 -1
  120. package/src/components/editor/QEditor.js +1 -1
  121. package/src/components/expansion-item/QExpansionItem.js +4 -3
  122. package/src/components/fab/QFab.js +4 -4
  123. package/src/components/icon/QIcon.js +3 -3
  124. package/src/components/infinite-scroll/QInfiniteScroll.js +1 -1
  125. package/src/components/menu/__tests__/QMenu.cy.js +24 -0
  126. package/src/components/range/QRange.js +8 -8
  127. package/src/components/resize-observer/QResizeObserver.js +3 -3
  128. package/src/components/slider/QSlider.js +2 -2
  129. package/src/components/slider/use-slider.js +14 -8
  130. package/src/components/tabs/use-tab.js +1 -1
  131. package/src/composables/private/use-field.js +13 -33
  132. package/src/composables/private/use-id.js +34 -0
  133. package/src/composables/private/use-validate.js +41 -35
  134. package/src/plugins/Dark.js +3 -27
  135. package/src/plugins/Notify.js +4 -3
  136. package/src/plugins/Notify.json +2 -2
  137. package/src/utils/copy-to-clipboard.js +0 -1
  138. package/src/utils/get-css-var.js +0 -1
  139. package/src/utils/is.js +0 -1
  140. package/src/utils/private/define-reactive-plugin.js +0 -1
  141. package/src/utils/private/global-config.js +0 -1
  142. package/src/utils/private/touch.js +0 -1
  143. package/src/utils/private/vm.js +0 -1
  144. package/src/utils/run-sequential-promises.js +0 -1
@@ -21,6 +21,7 @@ export const useValidateProps = {
21
21
  reactiveRules: Boolean,
22
22
  lazyRules: {
23
23
  type: [ Boolean, String ],
24
+ default: false, // statement unneeded but avoids future vue implementation changes
24
25
  validator: v => lazyRulesValues.includes(v)
25
26
  }
26
27
  }
@@ -30,7 +31,7 @@ export default function (focused, innerLoading) {
30
31
 
31
32
  const innerError = ref(false)
32
33
  const innerErrorMessage = ref(null)
33
- const isDirtyModel = ref(null)
34
+ const isDirtyModel = ref(false)
34
35
 
35
36
  useFormChild({ validate, resetValidation })
36
37
 
@@ -42,10 +43,14 @@ export default function (focused, innerLoading) {
42
43
  && props.rules.length !== 0
43
44
  )
44
45
 
45
- const hasActiveRules = computed(() =>
46
+ const canDebounceValidate = computed(() => (
46
47
  props.disable !== true
47
48
  && hasRules.value === true
48
- )
49
+ // Should not have a validation in progress already;
50
+ // It might mean that focus switched to submit btn and
51
+ // QForm's submit() has been called already (ENTER key)
52
+ && innerLoading.value === false
53
+ ))
49
54
 
50
55
  const hasError = computed(() =>
51
56
  props.error === true || innerError.value === true
@@ -58,15 +63,31 @@ export default function (focused, innerLoading) {
58
63
  ))
59
64
 
60
65
  watch(() => props.modelValue, () => {
61
- validateIfNeeded()
66
+ isDirtyModel.value = true
67
+
68
+ if (
69
+ canDebounceValidate.value === true
70
+ // trigger validation if not using any kind of lazy-rules
71
+ && props.lazyRules === false
72
+ ) {
73
+ debouncedValidate()
74
+ }
62
75
  })
63
76
 
77
+ function onRulesChange () {
78
+ if (
79
+ props.lazyRules !== 'ondemand'
80
+ && canDebounceValidate.value === true
81
+ && isDirtyModel.value === true
82
+ ) {
83
+ debouncedValidate()
84
+ }
85
+ }
86
+
64
87
  watch(() => props.reactiveRules, val => {
65
88
  if (val === true) {
66
89
  if (unwatchRules === void 0) {
67
- unwatchRules = watch(() => props.rules, () => {
68
- validateIfNeeded(true)
69
- })
90
+ unwatchRules = watch(() => props.rules, onRulesChange, { immediate: true, deep: true })
70
91
  }
71
92
  }
72
93
  else if (unwatchRules !== void 0) {
@@ -75,32 +96,24 @@ export default function (focused, innerLoading) {
75
96
  }
76
97
  }, { immediate: true })
77
98
 
99
+ watch(() => props.lazyRules, onRulesChange)
100
+
78
101
  watch(focused, val => {
79
102
  if (val === true) {
80
- if (isDirtyModel.value === null) {
81
- isDirtyModel.value = false
82
- }
83
- }
84
- else if (isDirtyModel.value === false) {
85
103
  isDirtyModel.value = true
86
-
87
- if (
88
- hasActiveRules.value === true
89
- && props.lazyRules !== 'ondemand'
90
- // Don't re-trigger if it's already in progress;
91
- // It might mean that focus switched to submit btn and
92
- // QForm's submit() has been called already (ENTER key)
93
- && innerLoading.value === false
94
- ) {
95
- debouncedValidate()
96
- }
104
+ }
105
+ else if (
106
+ canDebounceValidate.value === true
107
+ && props.lazyRules !== 'ondemand'
108
+ ) {
109
+ debouncedValidate()
97
110
  }
98
111
  })
99
112
 
100
113
  function resetValidation () {
101
114
  validateIndex++
102
115
  innerLoading.value = false
103
- isDirtyModel.value = null
116
+ isDirtyModel.value = false
104
117
  innerError.value = false
105
118
  innerErrorMessage.value = null
106
119
  debouncedValidate.cancel()
@@ -113,7 +126,10 @@ export default function (focused, innerLoading) {
113
126
  * - Promise (pending async validation)
114
127
  */
115
128
  function validate (val = props.modelValue) {
116
- if (hasActiveRules.value !== true) {
129
+ if (
130
+ props.disable === true
131
+ || hasRules.value === false
132
+ ) {
117
133
  return true
118
134
  }
119
135
 
@@ -182,16 +198,6 @@ export default function (focused, innerLoading) {
182
198
  )
183
199
  }
184
200
 
185
- function validateIfNeeded (changedRules) {
186
- if (
187
- hasActiveRules.value === true
188
- && props.lazyRules !== 'ondemand'
189
- && (isDirtyModel.value === true || (props.lazyRules !== true && changedRules !== true))
190
- ) {
191
- debouncedValidate()
192
- }
193
- }
194
-
195
201
  const debouncedValidate = debounce(validate, 0)
196
202
 
197
203
  onBeforeUnmount(() => {
@@ -1,5 +1,4 @@
1
1
  import defineReactivePlugin from '../utils/private/define-reactive-plugin.js'
2
- import { isRuntimeSsrPreHydration } from './Platform.js'
3
2
 
4
3
  const Plugin = defineReactivePlugin({
5
4
  isActive: false,
@@ -38,7 +37,7 @@ const Plugin = defineReactivePlugin({
38
37
  }
39
38
  },
40
39
 
41
- install ({ $q, onSSRHydrated, ssrContext }) {
40
+ install ({ $q, ssrContext }) {
42
41
  const { dark } = $q.config
43
42
 
44
43
  if (__QUASAR_SSR_SERVER__) {
@@ -66,31 +65,8 @@ const Plugin = defineReactivePlugin({
66
65
 
67
66
  $q.dark = this
68
67
 
69
- if (this.__installed === true && dark === void 0) {
70
- return
71
- }
72
-
73
- this.isActive = dark === true
74
-
75
- const initialVal = dark !== void 0 ? dark : false
76
-
77
- if (isRuntimeSsrPreHydration.value === true) {
78
- const ssrSet = val => {
79
- this.__fromSSR = val
80
- }
81
-
82
- const originalSet = this.set
83
-
84
- this.set = ssrSet
85
- ssrSet(initialVal)
86
-
87
- onSSRHydrated.push(() => {
88
- this.set = originalSet
89
- this.set(this.__fromSSR)
90
- })
91
- }
92
- else {
93
- this.set(initialVal)
68
+ if (this.__installed !== true) {
69
+ this.set(dark !== void 0 ? dark : false)
94
70
  }
95
71
  }
96
72
  })
@@ -19,6 +19,7 @@ const notificationsList = {}
19
19
  const positionClass = {}
20
20
  const emptyRE = /^\s*$/
21
21
  const notifRefs = []
22
+ const invalidTimeoutValues = [ void 0, null, true, false, '' ]
22
23
 
23
24
  const positionList = [
24
25
  'top-left', 'top-right',
@@ -112,15 +113,15 @@ function addNotification (config, $q, originalApi) {
112
113
  notif.position = 'bottom'
113
114
  }
114
115
 
115
- if (notif.timeout === void 0) {
116
+ if (invalidTimeoutValues.includes(notif.timeout) === true) {
116
117
  notif.timeout = 5000
117
118
  }
118
119
  else {
119
- const t = parseInt(notif.timeout, 10)
120
+ const t = Number(notif.timeout) // we catch exponential notation too with Number() casting
120
121
  if (isNaN(t) || t < 0) {
121
122
  return logError('wrong timeout', config)
122
123
  }
123
- notif.timeout = t
124
+ notif.timeout = Number.isFinite(t) ? t : 0
124
125
  }
125
126
 
126
127
  if (notif.timeout === 0) {
@@ -166,7 +166,7 @@
166
166
 
167
167
  "timeout": {
168
168
  "type": "Number",
169
- "desc": "Amount of time to display (in milliseconds)",
169
+ "desc": "Amount of time to display (in milliseconds). Set to 0 to never dismiss automatically.",
170
170
  "default": 5000
171
171
  },
172
172
 
@@ -392,7 +392,7 @@
392
392
 
393
393
  "timeout": {
394
394
  "type": "Number",
395
- "desc": "Amount of time to display (in milliseconds)",
395
+ "desc": "Amount of time to display (in milliseconds). Set to 0 to never dismiss automatically.",
396
396
  "default": 5000,
397
397
  "examples": [ 2500 ]
398
398
  },
@@ -1,4 +1,3 @@
1
-
2
1
  import { addFocusout, removeFocusout } from './private/focusout.js'
3
2
 
4
3
  function fallback (text) {
@@ -1,4 +1,3 @@
1
-
2
1
  export default function getCssVar (propName, element = document.body) {
3
2
  if (typeof propName !== 'string') {
4
3
  throw new TypeError('Expected a string as propName')
package/src/utils/is.js CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  export function isDeepEqual (a, b) {
3
2
  if (a === b) {
4
3
  return true
@@ -1,4 +1,3 @@
1
-
2
1
  import { reactive } from 'vue'
3
2
  import { injectProp } from './inject-obj-prop.js'
4
3
 
@@ -1,4 +1,3 @@
1
-
2
1
  export const globalConfig = {}
3
2
  export let globalConfigIsFrozen = false
4
3
 
@@ -1,4 +1,3 @@
1
-
2
1
  const modifiersAll = {
3
2
  left: true,
4
3
  right: true,
@@ -1,4 +1,3 @@
1
-
2
1
  // copied to docs too
3
2
  export function getParentProxy (proxy) {
4
3
  if (Object(proxy.$parent) === proxy.$parent) {
@@ -1,4 +1,3 @@
1
-
2
1
  function parsePromises (sequentialPromises) {
3
2
  const isList = Array.isArray(sequentialPromises)
4
3