quasar 2.8.1 → 2.8.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 (125) hide show
  1. package/dist/api/Loading.json +0 -1
  2. package/dist/api/QField.json +2 -1
  3. package/dist/api/QFile.json +2 -1
  4. package/dist/api/QInput.json +2 -1
  5. package/dist/api/QSelect.json +2 -1
  6. package/dist/api/QUploader.json +4 -0
  7. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  8. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  9. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  10. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  11. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
  12. package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
  13. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  14. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  15. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  16. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  17. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  18. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  19. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  20. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  21. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  22. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  23. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  24. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  25. package/dist/icon-set/mdi-v6.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-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.umd.prod.js +1 -1
  53. package/dist/lang/el.umd.prod.js +1 -1
  54. package/dist/lang/en-GB.umd.prod.js +1 -1
  55. package/dist/lang/en-US.umd.prod.js +1 -1
  56. package/dist/lang/eo.umd.prod.js +1 -1
  57. package/dist/lang/es.umd.prod.js +1 -1
  58. package/dist/lang/et.umd.prod.js +1 -1
  59. package/dist/lang/eu.umd.prod.js +1 -1
  60. package/dist/lang/fa-IR.umd.prod.js +1 -1
  61. package/dist/lang/fa.umd.prod.js +1 -1
  62. package/dist/lang/fi.umd.prod.js +1 -1
  63. package/dist/lang/fr.umd.prod.js +1 -1
  64. package/dist/lang/gn.umd.prod.js +1 -1
  65. package/dist/lang/he.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/km.umd.prod.js +1 -1
  73. package/dist/lang/ko-KR.umd.prod.js +1 -1
  74. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  75. package/dist/lang/kz.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/ml.umd.prod.js +1 -1
  80. package/dist/lang/mm.umd.prod.js +1 -1
  81. package/dist/lang/ms.umd.prod.js +1 -1
  82. package/dist/lang/my.umd.prod.js +1 -1
  83. package/dist/lang/nb-NO.umd.prod.js +1 -1
  84. package/dist/lang/nl.umd.prod.js +1 -1
  85. package/dist/lang/pl.umd.prod.js +1 -1
  86. package/dist/lang/pt-BR.umd.prod.js +1 -1
  87. package/dist/lang/pt.umd.prod.js +1 -1
  88. package/dist/lang/ro.umd.prod.js +1 -1
  89. package/dist/lang/ru.umd.prod.js +1 -1
  90. package/dist/lang/sk.umd.prod.js +1 -1
  91. package/dist/lang/sl.umd.prod.js +1 -1
  92. package/dist/lang/sm.umd.prod.js +1 -1
  93. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  94. package/dist/lang/sr.umd.prod.js +1 -1
  95. package/dist/lang/sv.umd.prod.js +1 -1
  96. package/dist/lang/ta.umd.prod.js +1 -1
  97. package/dist/lang/th.umd.prod.js +1 -1
  98. package/dist/lang/tr.umd.prod.js +1 -1
  99. package/dist/lang/ug.umd.prod.js +1 -1
  100. package/dist/lang/uk.umd.prod.js +1 -1
  101. package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
  102. package/dist/lang/uz-Latn.umd.prod.js +1 -1
  103. package/dist/lang/vi.umd.prod.js +1 -1
  104. package/dist/lang/zh-CN.umd.prod.js +1 -1
  105. package/dist/lang/zh-TW.umd.prod.js +1 -1
  106. package/dist/quasar.cjs.prod.js +2 -2
  107. package/dist/quasar.esm.js +37 -26
  108. package/dist/quasar.esm.prod.js +2 -2
  109. package/dist/quasar.sass +1 -1
  110. package/dist/quasar.umd.js +37 -26
  111. package/dist/quasar.umd.prod.js +2 -2
  112. package/dist/types/api/validation.d.ts +22 -2
  113. package/dist/types/index.d.ts +5 -8
  114. package/dist/web-types/web-types.json +5 -5
  115. package/package.json +1 -1
  116. package/src/components/input/QInput.js +22 -17
  117. package/src/components/uploader/QUploader.json +5 -0
  118. package/src/composables/private/use-file.js +7 -5
  119. package/src/composables/private/use-validate.js +1 -1
  120. package/src/composables/private/use-validate.json +2 -1
  121. package/src/index.dev.js +4 -0
  122. package/src/index.prod.js +30 -0
  123. package/src/index.ssr.js +4 -0
  124. package/src/index.umd.js +4 -0
  125. package/src/plugins/Loading.json +0 -1
@@ -1,4 +1,24 @@
1
1
  // Keep in sync with ui/src/utils/patterns.js
2
- export type EmbeddedValidationRule = "date" | "time" | "fulltime" | "timeOrFulltime" | "email" | "hexColor" | "hexaColor" | "hexOrHexaColor" | "rgbColor" | "rgbaColor" | "rgbOrRgbaColor" | "hexOrRgbColor" | "hexaOrRgbaColor" | "anyColor";
2
+ export type EmbeddedValidationRule =
3
+ | "date"
4
+ | "time"
5
+ | "fulltime"
6
+ | "timeOrFulltime"
7
+ | "email"
8
+ | "hexColor"
9
+ | "hexaColor"
10
+ | "hexOrHexaColor"
11
+ | "rgbColor"
12
+ | "rgbaColor"
13
+ | "rgbOrRgbaColor"
14
+ | "hexOrRgbColor"
15
+ | "hexaOrRgbaColor"
16
+ | "anyColor";
3
17
 
4
- export type ValidationRule<T = any> = EmbeddedValidationRule | ((value: T) => boolean | string | Promise<boolean | string>);
18
+ type EmbeddedValidationRuleFn<T = any> = (value: T) => boolean;
19
+ export type ValidationRule<T = any> =
20
+ | EmbeddedValidationRule
21
+ | ((
22
+ value: T,
23
+ rules: Record<EmbeddedValidationRule, EmbeddedValidationRuleFn<T>>
24
+ ) => boolean | string | Promise<boolean | string>);
@@ -12858,6 +12858,10 @@ export interface QUploader extends ComponentPublicInstance<QUploaderProps> {
12858
12858
  * The component state is set as busy; User should not be able to interact with the component
12859
12859
  */
12860
12860
  readonly isBusy: boolean;
12861
+ /**
12862
+ * The component is uploading files
12863
+ */
12864
+ readonly isUploading: boolean;
12861
12865
  }
12862
12866
 
12863
12867
  export interface QUploaderAddTriggerProps {}
@@ -13662,14 +13666,7 @@ declare module "./globals" {
13662
13666
  * @returns Chainable Object
13663
13667
  */
13664
13668
  dialog: (opts: QDialogOptions) => DialogChainObject;
13665
- /**
13666
- * Activate and show
13667
- * @param opts All props are optional
13668
- * @returns Calling this function with no parameters hides the group; When called with one Object parameter then it updates the Loading group (specified properties are shallow merged with the group ones; note that group cannot be changed while updating and it is ignored)
13669
- */
13670
- loading: (
13671
- opts?: QLoadingShowOptions
13672
- ) => (props?: QLoadingUpdateOptions) => void;
13669
+ loading: Loading;
13673
13670
  loadingBar: LoadingBar;
13674
13671
  localStorage: LocalStorage;
13675
13672
  /**
@@ -2,7 +2,7 @@
2
2
  "$schema": "",
3
3
  "framework": "vue",
4
4
  "name": "quasar",
5
- "version": "2.8.1",
5
+ "version": "2.8.3",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
@@ -5783,7 +5783,7 @@
5783
5783
  "kind": "expression",
5784
5784
  "type": "any[]"
5785
5785
  },
5786
- "description": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules\n\nExamples:\n:rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"\n:rules=\"[ 'fulltime' ]\"",
5786
+ "description": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules\n\nExamples:\n:rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"\n:rules=\"[ 'fulltime' ]\"\n:rules=\"[ (val, rules) => rules.email(val) || 'Please enter a valid email address' ]\"",
5787
5787
  "doc-url": "https://v2.quasar.dev/vue-components/field"
5788
5788
  },
5789
5789
  {
@@ -6347,7 +6347,7 @@
6347
6347
  "kind": "expression",
6348
6348
  "type": "any[]"
6349
6349
  },
6350
- "description": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules\n\nExamples:\n:rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"\n:rules=\"[ 'fulltime' ]\"",
6350
+ "description": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules\n\nExamples:\n:rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"\n:rules=\"[ 'fulltime' ]\"\n:rules=\"[ (val, rules) => rules.email(val) || 'Please enter a valid email address' ]\"",
6351
6351
  "doc-url": "https://v2.quasar.dev/vue-components/file"
6352
6352
  },
6353
6353
  {
@@ -7777,7 +7777,7 @@
7777
7777
  "kind": "expression",
7778
7778
  "type": "any[]"
7779
7779
  },
7780
- "description": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules\n\nExamples:\n:rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"\n:rules=\"[ 'fulltime' ]\"",
7780
+ "description": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules\n\nExamples:\n:rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"\n:rules=\"[ 'fulltime' ]\"\n:rules=\"[ (val, rules) => rules.email(val) || 'Please enter a valid email address' ]\"",
7781
7781
  "doc-url": "https://v2.quasar.dev/vue-components/input"
7782
7782
  },
7783
7783
  {
@@ -12169,7 +12169,7 @@
12169
12169
  "kind": "expression",
12170
12170
  "type": "any[]"
12171
12171
  },
12172
- "description": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules\n\nExamples:\n:rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"\n:rules=\"[ 'fulltime' ]\"",
12172
+ "description": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules\n\nExamples:\n:rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"\n:rules=\"[ 'fulltime' ]\"\n:rules=\"[ (val, rules) => rules.email(val) || 'Please enter a valid email address' ]\"",
12173
12173
  "doc-url": "https://v2.quasar.dev/vue-components/select"
12174
12174
  },
12175
12175
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "description": "Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time",
5
5
  "main": "dist/quasar.cjs.prod.js",
6
6
  "module": "dist/quasar.esm.prod.js",
@@ -43,6 +43,9 @@ export default createComponent({
43
43
  ],
44
44
 
45
45
  setup (props, { emit, attrs }) {
46
+ const { proxy } = getCurrentInstance()
47
+ const { $q } = proxy
48
+
46
49
  const temp = {}
47
50
  let emitCachedValue = NaN, typedNumber, stopValueWatcher, emitTimer, emitValueFn
48
51
 
@@ -289,21 +292,24 @@ export default createComponent({
289
292
 
290
293
  // textarea only
291
294
  function adjustHeight () {
292
- const inp = inputRef.value
293
- if (inp !== null) {
294
- const parentStyle = inp.parentNode.style
295
- const { overflow } = inp.style
296
-
297
- // reset height of textarea to a small size to detect the real height
298
- // but keep the total control size the same
299
- parentStyle.marginBottom = (inp.scrollHeight - 1) + 'px'
300
- inp.style.height = '1px'
301
- inp.style.overflow = 'hidden'
302
-
303
- inp.style.height = inp.scrollHeight + 'px'
304
- inp.style.overflow = overflow
305
- parentStyle.marginBottom = ''
306
- }
295
+ requestAnimationFrame(() => {
296
+ const inp = inputRef.value
297
+ if (inp !== null) {
298
+ const parentStyle = inp.parentNode.style
299
+ const { overflow } = inp.style
300
+
301
+ // reset height of textarea to a small size to detect the real height
302
+ // but keep the total control size the same
303
+ // Firefox rulez #14263, #14344
304
+ $q.platform.is.firefox !== true && (inp.style.overflow = 'hidden')
305
+ inp.style.height = '1px'
306
+ parentStyle.marginBottom = (inp.scrollHeight - 1) + 'px'
307
+
308
+ inp.style.height = inp.scrollHeight + 'px'
309
+ inp.style.overflow = overflow
310
+ parentStyle.marginBottom = ''
311
+ }
312
+ })
307
313
  }
308
314
 
309
315
  function onChange (e) {
@@ -406,8 +412,7 @@ export default createComponent({
406
412
  const renderFn = useField(state)
407
413
 
408
414
  // expose public methods
409
- const vm = getCurrentInstance()
410
- Object.assign(vm.proxy, {
415
+ Object.assign(proxy, {
411
416
  focus,
412
417
  select,
413
418
  getNativeElement: () => inputRef.value
@@ -258,6 +258,11 @@
258
258
  "isBusy": {
259
259
  "type": "Boolean",
260
260
  "desc": "The component state is set as busy; User should not be able to interact with the component"
261
+ },
262
+
263
+ "isUploading": {
264
+ "type": "Boolean",
265
+ "desc": "The component is uploading files"
261
266
  }
262
267
  }
263
268
  }
@@ -129,11 +129,13 @@ export default function ({
129
129
  file.__key = file.webkitRelativePath + file.lastModified + file.name + file.size
130
130
  })
131
131
 
132
- // Avoid duplicate files
133
- const filenameMap = currentFileList.map(entry => entry.__key)
134
- files = filterFiles(files, rejectedFiles, 'duplicate', file => {
135
- return filenameMap.includes(file.__key) === false
136
- })
132
+ if (append !== true) {
133
+ // Avoid duplicate files
134
+ const filenameMap = currentFileList.map(entry => entry.__key)
135
+ files = filterFiles(files, rejectedFiles, 'duplicate', file => {
136
+ return filenameMap.includes(file.__key) === false
137
+ })
138
+ }
137
139
 
138
140
  if (files.length === 0) { return done() }
139
141
 
@@ -144,7 +144,7 @@ export default function (focused, innerLoading) {
144
144
  let res
145
145
 
146
146
  if (typeof rule === 'function') {
147
- res = rule(val)
147
+ res = rule(val, testPattern)
148
148
  }
149
149
  else if (typeof rule === 'string' && testPattern[ rule ] !== void 0) {
150
150
  res = testPattern[ rule ](val)
@@ -32,7 +32,8 @@
32
32
  "desc": "Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules",
33
33
  "examples": [
34
34
  ":rules=\"[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"",
35
- ":rules=\"[ 'fulltime' ]\""
35
+ ":rules=\"[ 'fulltime' ]\"",
36
+ ":rules=\"[ (val, rules) => rules.email(val) || 'Please enter a valid email address' ]\""
36
37
  ],
37
38
  "category": "behavior"
38
39
  },
package/src/index.dev.js CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * client entry-point used by @quasar/vite-plugin for DEV only
3
+ */
4
+
1
5
  import installQuasar from './install-quasar.js'
2
6
  import lang from './lang.js'
3
7
  import iconSet from './icon-set.js'
@@ -0,0 +1,30 @@
1
+ /**
2
+ * client prod entry-point that is not used by Quasar CLI,
3
+ * but pointed to in package.json > module
4
+ */
5
+
6
+ import installQuasar from './install-quasar.js'
7
+ import lang from './lang.js'
8
+ import iconSet from './icon-set.js'
9
+
10
+ import * as components from './components.js'
11
+ import * as directives from './directives.js'
12
+
13
+ export * from './components.js'
14
+ export * from './directives.js'
15
+ export * from './plugins.js'
16
+ export * from './composables.js'
17
+ export * from './utils.js'
18
+
19
+ export const Quasar = {
20
+ version: __QUASAR_VERSION__,
21
+ install (app, opts, ssrContext) {
22
+ installQuasar(
23
+ app,
24
+ { components, directives, ...opts },
25
+ ssrContext
26
+ )
27
+ },
28
+ lang,
29
+ iconSet
30
+ }
package/src/index.ssr.js CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * SSR server prod entry-point
3
+ */
4
+
1
5
  import installQuasar from './install-quasar.js'
2
6
  import lang from './lang.js'
3
7
  import iconSet from './icon-set.js'
package/src/index.umd.js CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * UMD entry-point
3
+ */
4
+
1
5
  import installQuasar from './install-quasar.js'
2
6
  import lang from './lang.js'
3
7
  import iconSet from './icon-set.js'
@@ -74,7 +74,6 @@
74
74
 
75
75
  "methods": {
76
76
  "show": {
77
- "tsInjectionPoint": true,
78
77
  "desc": "Activate and show",
79
78
  "params": {
80
79
  "opts": {