quasar 2.8.2 → 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.
- package/dist/api/Loading.json +0 -1
- package/dist/api/QField.json +2 -1
- package/dist/api/QFile.json +2 -1
- package/dist/api/QInput.json +2 -1
- package/dist/api/QSelect.json +2 -1
- package/dist/api/QUploader.json +4 -0
- package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/material-icons.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-themify.umd.prod.js +1 -1
- package/dist/icon-set/themify.umd.prod.js +1 -1
- package/dist/lang/ar-TN.umd.prod.js +1 -1
- package/dist/lang/ar.umd.prod.js +1 -1
- package/dist/lang/az-Latn.umd.prod.js +1 -1
- package/dist/lang/bg.umd.prod.js +1 -1
- package/dist/lang/bn.umd.prod.js +1 -1
- package/dist/lang/ca.umd.prod.js +1 -1
- package/dist/lang/cs.umd.prod.js +1 -1
- package/dist/lang/da.umd.prod.js +1 -1
- package/dist/lang/de.umd.prod.js +1 -1
- package/dist/lang/el.umd.prod.js +1 -1
- package/dist/lang/en-GB.umd.prod.js +1 -1
- package/dist/lang/en-US.umd.prod.js +1 -1
- package/dist/lang/eo.umd.prod.js +1 -1
- package/dist/lang/es.umd.prod.js +1 -1
- package/dist/lang/et.umd.prod.js +1 -1
- package/dist/lang/eu.umd.prod.js +1 -1
- package/dist/lang/fa-IR.umd.prod.js +1 -1
- package/dist/lang/fa.umd.prod.js +1 -1
- package/dist/lang/fi.umd.prod.js +1 -1
- package/dist/lang/fr.umd.prod.js +1 -1
- package/dist/lang/gn.umd.prod.js +1 -1
- package/dist/lang/he.umd.prod.js +1 -1
- package/dist/lang/hr.umd.prod.js +1 -1
- package/dist/lang/hu.umd.prod.js +1 -1
- package/dist/lang/id.umd.prod.js +1 -1
- package/dist/lang/is.umd.prod.js +1 -1
- package/dist/lang/it.umd.prod.js +1 -1
- package/dist/lang/ja.umd.prod.js +1 -1
- package/dist/lang/km.umd.prod.js +1 -1
- package/dist/lang/ko-KR.umd.prod.js +1 -1
- package/dist/lang/kur-CKB.umd.prod.js +1 -1
- package/dist/lang/kz.umd.prod.js +1 -1
- package/dist/lang/lt.umd.prod.js +1 -1
- package/dist/lang/lu.umd.prod.js +1 -1
- package/dist/lang/lv.umd.prod.js +1 -1
- package/dist/lang/ml.umd.prod.js +1 -1
- package/dist/lang/mm.umd.prod.js +1 -1
- package/dist/lang/ms.umd.prod.js +1 -1
- package/dist/lang/my.umd.prod.js +1 -1
- package/dist/lang/nb-NO.umd.prod.js +1 -1
- package/dist/lang/nl.umd.prod.js +1 -1
- package/dist/lang/pl.umd.prod.js +1 -1
- package/dist/lang/pt-BR.umd.prod.js +1 -1
- package/dist/lang/pt.umd.prod.js +1 -1
- package/dist/lang/ro.umd.prod.js +1 -1
- package/dist/lang/ru.umd.prod.js +1 -1
- package/dist/lang/sk.umd.prod.js +1 -1
- package/dist/lang/sl.umd.prod.js +1 -1
- package/dist/lang/sm.umd.prod.js +1 -1
- package/dist/lang/sr-CYR.umd.prod.js +1 -1
- package/dist/lang/sr.umd.prod.js +1 -1
- package/dist/lang/sv.umd.prod.js +1 -1
- package/dist/lang/ta.umd.prod.js +1 -1
- package/dist/lang/th.umd.prod.js +1 -1
- package/dist/lang/tr.umd.prod.js +1 -1
- package/dist/lang/ug.umd.prod.js +1 -1
- package/dist/lang/uk.umd.prod.js +1 -1
- package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
- package/dist/lang/uz-Latn.umd.prod.js +1 -1
- package/dist/lang/vi.umd.prod.js +1 -1
- package/dist/lang/zh-CN.umd.prod.js +1 -1
- package/dist/lang/zh-TW.umd.prod.js +1 -1
- package/dist/quasar.cjs.prod.js +2 -2
- package/dist/quasar.esm.js +33 -26
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.sass +1 -1
- package/dist/quasar.umd.js +33 -26
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/types/api/validation.d.ts +22 -2
- package/dist/types/index.d.ts +5 -8
- package/dist/web-types/web-types.json +5 -5
- package/package.json +1 -1
- package/src/components/input/QInput.js +22 -17
- package/src/components/uploader/QUploader.json +5 -0
- package/src/composables/private/use-file.js +7 -5
- package/src/composables/private/use-validate.js +1 -1
- package/src/composables/private/use-validate.json +2 -1
- 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 =
|
|
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
|
-
|
|
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>);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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.
|
|
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
|
@@ -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
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
},
|