@progress/kendo-vue-upload 3.7.4-dev.202211301436 → 3.7.4-dev.202212300853
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/README.md +1 -1
- package/dist/cdn/js/kendo-vue-upload.js +1 -1
- package/dist/es/ExternalDropZone.js +6 -3
- package/dist/es/Upload.js +2 -1
- package/dist/es/UploadAddButton.d.ts +0 -2
- package/dist/es/UploadAddButton.js +1 -13
- package/dist/es/UploadInput.d.ts +3 -0
- package/dist/es/UploadInput.js +37 -3
- package/dist/es/interfaces/UploadProps.d.ts +4 -0
- package/dist/es/main.d.ts +2 -1
- package/dist/es/main.js +2 -1
- package/dist/es/messages/main.d.ts +10 -0
- package/dist/es/messages/main.js +10 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/utils/validationUtils.js +4 -1
- package/dist/esm/ExternalDropZone.js +6 -3
- package/dist/esm/Upload.js +2 -1
- package/dist/esm/UploadAddButton.d.ts +0 -2
- package/dist/esm/UploadAddButton.js +1 -13
- package/dist/esm/UploadInput.d.ts +3 -0
- package/dist/esm/UploadInput.js +37 -3
- package/dist/esm/interfaces/UploadProps.d.ts +4 -0
- package/dist/esm/main.d.ts +2 -1
- package/dist/esm/main.js +2 -1
- package/dist/esm/messages/main.d.ts +10 -0
- package/dist/esm/messages/main.js +10 -0
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/utils/validationUtils.js +4 -1
- package/dist/npm/ExternalDropZone.js +5 -2
- package/dist/npm/Upload.js +2 -1
- package/dist/npm/UploadAddButton.d.ts +0 -2
- package/dist/npm/UploadAddButton.js +1 -13
- package/dist/npm/UploadInput.d.ts +3 -0
- package/dist/npm/UploadInput.js +37 -3
- package/dist/npm/interfaces/UploadProps.d.ts +4 -0
- package/dist/npm/main.d.ts +2 -1
- package/dist/npm/main.js +3 -1
- package/dist/npm/messages/main.d.ts +10 -0
- package/dist/npm/messages/main.js +11 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/utils/validationUtils.js +4 -1
- package/package.json +5 -5
|
@@ -5,7 +5,7 @@ var gh = allVue.h;
|
|
|
5
5
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
6
|
var ref = allVue.ref;
|
|
7
7
|
var inject = allVue.inject;
|
|
8
|
-
import { classNames, getListeners, getTabIndex, getTemplate, setRef, templateRendering, validatePackage } from '@progress/kendo-vue-common';
|
|
8
|
+
import { classNames, getListeners, getTabIndex, getTemplate, Icon, setRef, templateRendering, validatePackage } from '@progress/kendo-vue-common';
|
|
9
9
|
import { dropZoneHint, dropZoneNote, messages } from './messages/main';
|
|
10
10
|
import { packageMetadata } from './package-metadata';
|
|
11
11
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
@@ -144,8 +144,11 @@ var ExternalDropZoneVue2 = {
|
|
|
144
144
|
}, [h("div", {
|
|
145
145
|
style: this.$props.innerStyle,
|
|
146
146
|
"class": 'k-dropzone-inner'
|
|
147
|
-
}, [h(
|
|
148
|
-
|
|
147
|
+
}, [h(Icon, {
|
|
148
|
+
name: 'upload',
|
|
149
|
+
attrs: this.v3 ? undefined : {
|
|
150
|
+
name: 'upload'
|
|
151
|
+
}
|
|
149
152
|
}), h("span", {
|
|
150
153
|
"class": 'k-dropzone-hint'
|
|
151
154
|
}, [hintElement]), h("span", {
|
package/dist/es/Upload.js
CHANGED
|
@@ -132,6 +132,7 @@ var UploadVue2 = {
|
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
|
+
validateFile: Function,
|
|
135
136
|
files: Array,
|
|
136
137
|
defaultFiles: Array
|
|
137
138
|
},
|
|
@@ -331,7 +332,7 @@ var UploadVue2 = {
|
|
|
331
332
|
var selectedFiles = utils.getAllFileInfo(files);
|
|
332
333
|
var newState;
|
|
333
334
|
selectedFiles = utils.assignGuidToFiles(selectedFiles, this.computedAsync.batch);
|
|
334
|
-
validationUtils.validateFiles(selectedFiles, this.$props.restrictions);
|
|
335
|
+
validationUtils.validateFiles(selectedFiles, this.$props.restrictions, this.validateFile);
|
|
335
336
|
if (!this.$props.multiple) {
|
|
336
337
|
newState = [];
|
|
337
338
|
} else {
|
|
@@ -23,9 +23,7 @@ var UploadAddButtonVue2 = {
|
|
|
23
23
|
multiple: Boolean,
|
|
24
24
|
disabled: Boolean,
|
|
25
25
|
accept: String,
|
|
26
|
-
id: String
|
|
27
|
-
ariaLabelledBy: String,
|
|
28
|
-
ariaDescribedBy: String
|
|
26
|
+
id: String
|
|
29
27
|
},
|
|
30
28
|
inject: {
|
|
31
29
|
kendoLocalizationService: {
|
|
@@ -100,8 +98,6 @@ var UploadAddButtonVue2 = {
|
|
|
100
98
|
addButtonIndex = _a.addButtonIndex,
|
|
101
99
|
tabIndex = _a.tabIndex,
|
|
102
100
|
id = _a.id,
|
|
103
|
-
ariaLabelledBy = _a.ariaLabelledBy,
|
|
104
|
-
ariaDescribedBy = _a.ariaDescribedBy,
|
|
105
101
|
async = _a.async,
|
|
106
102
|
multiple = _a.multiple,
|
|
107
103
|
disabled = _a.disabled,
|
|
@@ -113,18 +109,10 @@ var UploadAddButtonVue2 = {
|
|
|
113
109
|
id: id,
|
|
114
110
|
attrs: this.v3 ? undefined : {
|
|
115
111
|
id: id,
|
|
116
|
-
role: "button",
|
|
117
|
-
"aria-label": selectMessage,
|
|
118
|
-
"aria-labelledby": ariaLabelledBy,
|
|
119
|
-
"aria-describedby": ariaDescribedBy,
|
|
120
112
|
tabindex: tabIndex
|
|
121
113
|
},
|
|
122
114
|
ref: setRef(this, 'element'),
|
|
123
|
-
role: "button",
|
|
124
115
|
"class": buttonClassName,
|
|
125
|
-
"aria-label": selectMessage,
|
|
126
|
-
"aria-labelledby": ariaLabelledBy,
|
|
127
|
-
"aria-describedby": ariaDescribedBy,
|
|
128
116
|
tabindex: tabIndex,
|
|
129
117
|
onClick: this.onClick,
|
|
130
118
|
on: this.v3 ? undefined : {
|
package/dist/es/UploadInput.d.ts
CHANGED
package/dist/es/UploadInput.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import { setRef } from '@progress/kendo-vue-common';
|
|
3
|
+
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
3
4
|
import * as Vue from 'vue';
|
|
4
5
|
var allVue = Vue;
|
|
5
6
|
var gh = allVue.h;
|
|
6
7
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
7
8
|
var ref = allVue.ref;
|
|
9
|
+
import { selectTitle, selectNoFilesTitle, select, messages } from './messages/main';
|
|
8
10
|
var CHROME_REGEX = /(chrome)[ \/]([\w.]+)/i;
|
|
9
11
|
var SAFARI_REGEX = /(webkit)[ \/]([\w.]+)/i;
|
|
10
12
|
/**
|
|
@@ -25,6 +27,18 @@ var UploadInputVue2 = {
|
|
|
25
27
|
accept: {
|
|
26
28
|
type: String,
|
|
27
29
|
default: undefined
|
|
30
|
+
},
|
|
31
|
+
hasFiles: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
ariaLabelledBy: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: undefined
|
|
38
|
+
},
|
|
39
|
+
ariaDescribedBy: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: undefined
|
|
28
42
|
}
|
|
29
43
|
},
|
|
30
44
|
// @ts-ignore
|
|
@@ -32,6 +46,11 @@ var UploadInputVue2 = {
|
|
|
32
46
|
'mousedown': null,
|
|
33
47
|
'add': null
|
|
34
48
|
},
|
|
49
|
+
inject: {
|
|
50
|
+
kendoLocalizationService: {
|
|
51
|
+
default: null
|
|
52
|
+
}
|
|
53
|
+
},
|
|
35
54
|
mounted: function mounted() {
|
|
36
55
|
this._input = this.v3 ? this.inputRef : this.$refs.input;
|
|
37
56
|
},
|
|
@@ -76,7 +95,14 @@ var UploadInputVue2 = {
|
|
|
76
95
|
multiple = _a.multiple,
|
|
77
96
|
async = _a.async,
|
|
78
97
|
disabled = _a.disabled,
|
|
79
|
-
accept = _a.accept
|
|
98
|
+
accept = _a.accept,
|
|
99
|
+
hasFiles = _a.hasFiles,
|
|
100
|
+
ariaLabelledBy = _a.ariaLabelledBy,
|
|
101
|
+
ariaDescribedBy = _a.ariaDescribedBy;
|
|
102
|
+
var localizationService = provideLocalizationService(this);
|
|
103
|
+
var message = hasFiles ? selectTitle : selectNoFilesTitle;
|
|
104
|
+
var selectMessage = localizationService.toLanguageString(message, messages[message]);
|
|
105
|
+
var selectLabel = localizationService.toLanguageString(select, messages[select]);
|
|
80
106
|
return h("input", {
|
|
81
107
|
ref: setRef(this, 'input'),
|
|
82
108
|
autocomplete: 'off',
|
|
@@ -87,7 +113,11 @@ var UploadInputVue2 = {
|
|
|
87
113
|
type: 'file',
|
|
88
114
|
tabindex: -1,
|
|
89
115
|
multiple: multiple,
|
|
90
|
-
disabled: disabled
|
|
116
|
+
disabled: disabled,
|
|
117
|
+
title: selectMessage,
|
|
118
|
+
"aria-label": ariaLabelledBy !== undefined ? undefined : selectLabel,
|
|
119
|
+
"aria-labelledby": ariaLabelledBy,
|
|
120
|
+
"aria-describedby": ariaDescribedBy
|
|
91
121
|
},
|
|
92
122
|
name: async.saveField,
|
|
93
123
|
accept: accept,
|
|
@@ -100,7 +130,11 @@ var UploadInputVue2 = {
|
|
|
100
130
|
"change": this.onAdd,
|
|
101
131
|
"mousedown": this.onMouseDown
|
|
102
132
|
},
|
|
103
|
-
onMousedown: this.onMouseDown
|
|
133
|
+
onMousedown: this.onMouseDown,
|
|
134
|
+
title: selectMessage,
|
|
135
|
+
"aria-label": ariaLabelledBy !== undefined ? undefined : selectLabel,
|
|
136
|
+
"aria-labelledby": ariaLabelledBy,
|
|
137
|
+
"aria-describedby": ariaDescribedBy
|
|
104
138
|
});
|
|
105
139
|
}
|
|
106
140
|
};
|
|
@@ -68,6 +68,10 @@ export interface UploadProps extends UploadAsyncProps {
|
|
|
68
68
|
* Sets the restrictions for the selected files ([see example]({% slug filerestrictions_upload %})).
|
|
69
69
|
*/
|
|
70
70
|
restrictions?: UploadFileRestrictions;
|
|
71
|
+
/**
|
|
72
|
+
* Sets the custom restrictions for the selected files ([see example]({% slug filerestrictions_upload %})).
|
|
73
|
+
*/
|
|
74
|
+
validateFile?: (file: UploadFileInfo) => void;
|
|
71
75
|
/**
|
|
72
76
|
* The list of files which are displayed when the Upload is in controlled mode
|
|
73
77
|
* ([see example]({% slug controleduncontroled_upload %})).
|
package/dist/es/main.d.ts
CHANGED
|
@@ -21,5 +21,6 @@ import { UploadListItemProps } from './interfaces/UploadListItemProps';
|
|
|
21
21
|
import { UploadProps } from './interfaces/UploadProps';
|
|
22
22
|
import { UploadOnCancelEvent } from './interfaces/UploadOnCancelEvent';
|
|
23
23
|
import { UploadActionsLayout } from './interfaces/UploadActionsLayout';
|
|
24
|
+
import { messages } from './messages/main';
|
|
24
25
|
import { ExternalDropZone, ExternalDropZoneVue2 } from './ExternalDropZone';
|
|
25
|
-
export { UploadUI, UploadUIVue2, UploadUIProps, UploadFileRestrictions, Upload, UploadVue2, UploadProps, UploadOnAddEvent, UploadOnBeforeRemoveEvent, UploadOnBeforeUploadEvent, UploadOnProgressEvent, UploadOnRemoveEvent, UploadOnStatusChangeEvent, UploadOnCancelEvent, UploadResponse, UploadFileStatus, UploadAdditionalData, UploadAsyncProps, UploadFileInfo, UploadHttpHeaders, UploadListItemProps, UploadActionsLayout, ExternalDropZone, ExternalDropZoneVue2, UploadListSingleItem, UploadListSingleItemVue2, UploadListMultiItem, UploadListMultiItemVue2, UploadListActionButton, UploadListActionButtonVue2, utils };
|
|
26
|
+
export { UploadUI, UploadUIVue2, UploadUIProps, UploadFileRestrictions, Upload, UploadVue2, UploadProps, UploadOnAddEvent, UploadOnBeforeRemoveEvent, UploadOnBeforeUploadEvent, UploadOnProgressEvent, UploadOnRemoveEvent, UploadOnStatusChangeEvent, UploadOnCancelEvent, UploadResponse, UploadFileStatus, UploadAdditionalData, UploadAsyncProps, UploadFileInfo, UploadHttpHeaders, UploadListItemProps, UploadActionsLayout, ExternalDropZone, ExternalDropZoneVue2, UploadListSingleItem, UploadListSingleItemVue2, UploadListMultiItem, UploadListMultiItemVue2, UploadListActionButton, UploadListActionButtonVue2, utils, messages };
|
package/dist/es/main.js
CHANGED
|
@@ -5,5 +5,6 @@ import { UploadListMultiItem, UploadListMultiItemVue2 } from './UploadListMultiI
|
|
|
5
5
|
import utils from './utils/utils';
|
|
6
6
|
import { UploadListActionButton, UploadListActionButtonVue2 } from './UploadListActionButton';
|
|
7
7
|
import { UploadFileStatus } from './interfaces/UploadFileStatus';
|
|
8
|
+
import { messages } from './messages/main';
|
|
8
9
|
import { ExternalDropZone, ExternalDropZoneVue2 } from './ExternalDropZone';
|
|
9
|
-
export { UploadUI, UploadUIVue2, Upload, UploadVue2, UploadFileStatus, ExternalDropZone, ExternalDropZoneVue2, UploadListSingleItem, UploadListSingleItemVue2, UploadListMultiItem, UploadListMultiItemVue2, UploadListActionButton, UploadListActionButtonVue2, utils };
|
|
10
|
+
export { UploadUI, UploadUIVue2, Upload, UploadVue2, UploadFileStatus, ExternalDropZone, ExternalDropZoneVue2, UploadListSingleItem, UploadListSingleItemVue2, UploadListMultiItem, UploadListMultiItemVue2, UploadListActionButton, UploadListActionButtonVue2, utils, messages };
|
|
@@ -46,6 +46,14 @@ export declare const retry = "upload.retry";
|
|
|
46
46
|
* @hidden
|
|
47
47
|
*/
|
|
48
48
|
export declare const select = "upload.select";
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export declare const selectTitle = "upload.selectTitle";
|
|
53
|
+
/**
|
|
54
|
+
* @hidden
|
|
55
|
+
*/
|
|
56
|
+
export declare const selectNoFilesTitle = "upload.selectNoFilesTitle";
|
|
49
57
|
/**
|
|
50
58
|
* @hidden
|
|
51
59
|
*/
|
|
@@ -90,6 +98,8 @@ export declare const messages: {
|
|
|
90
98
|
"upload.remove": string;
|
|
91
99
|
"upload.retry": string;
|
|
92
100
|
"upload.select": string;
|
|
101
|
+
"upload.selectTitle": string;
|
|
102
|
+
"upload.selectNoFilesTitle": string;
|
|
93
103
|
"upload.uploadSelectedFiles": string;
|
|
94
104
|
"upload.total": string;
|
|
95
105
|
"upload.files": string;
|
package/dist/es/messages/main.js
CHANGED
|
@@ -47,6 +47,14 @@ export var retry = 'upload.retry';
|
|
|
47
47
|
* @hidden
|
|
48
48
|
*/
|
|
49
49
|
export var select = 'upload.select';
|
|
50
|
+
/**
|
|
51
|
+
* @hidden
|
|
52
|
+
*/
|
|
53
|
+
export var selectTitle = 'upload.selectTitle';
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
export var selectNoFilesTitle = 'upload.selectNoFilesTitle';
|
|
50
58
|
/**
|
|
51
59
|
* @hidden
|
|
52
60
|
*/
|
|
@@ -91,6 +99,8 @@ export var messages = (_a = {},
|
|
|
91
99
|
_a[remove] = 'Remove',
|
|
92
100
|
_a[retry] = 'Retry',
|
|
93
101
|
_a[select] = 'Select files...',
|
|
102
|
+
_a[selectTitle] = 'Press to select more files',
|
|
103
|
+
_a[selectNoFilesTitle] = 'No files selected',
|
|
94
104
|
_a[uploadSelectedFiles] = 'Upload',
|
|
95
105
|
_a[total] = 'Total',
|
|
96
106
|
_a[files] = 'files',
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-upload',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1672390325,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -32,7 +32,7 @@ var parseAllowedExtensions = function (extensions) {
|
|
|
32
32
|
});
|
|
33
33
|
return allowedExtensions;
|
|
34
34
|
};
|
|
35
|
-
var validateFiles = function (files, restrictionInfo) {
|
|
35
|
+
var validateFiles = function (files, restrictionInfo, validateFile) {
|
|
36
36
|
var allowedExtensions = parseAllowedExtensions(restrictionInfo.allowedExtensions || []);
|
|
37
37
|
var maxFileSize = restrictionInfo.maxFileSize || 0;
|
|
38
38
|
var minFileSize = restrictionInfo.minFileSize || 0;
|
|
@@ -40,6 +40,9 @@ var validateFiles = function (files, restrictionInfo) {
|
|
|
40
40
|
for (i = 0; i < files.length; i++) {
|
|
41
41
|
validateFileExtension(files[i], allowedExtensions);
|
|
42
42
|
validateFileSize(files[i], minFileSize, maxFileSize);
|
|
43
|
+
if (validateFile) {
|
|
44
|
+
validateFile(files[i]);
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
/**
|
|
@@ -5,7 +5,7 @@ var gh = allVue.h;
|
|
|
5
5
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
6
|
var ref = allVue.ref;
|
|
7
7
|
var inject = allVue.inject;
|
|
8
|
-
import { classNames, getListeners, getTabIndex, getTemplate, setRef, templateRendering, validatePackage } from '@progress/kendo-vue-common';
|
|
8
|
+
import { classNames, getListeners, getTabIndex, getTemplate, Icon, setRef, templateRendering, validatePackage } from '@progress/kendo-vue-common';
|
|
9
9
|
import { dropZoneHint, dropZoneNote, messages } from './messages/main.js';
|
|
10
10
|
import { packageMetadata } from './package-metadata.js';
|
|
11
11
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
@@ -144,8 +144,11 @@ var ExternalDropZoneVue2 = {
|
|
|
144
144
|
}, [h("div", {
|
|
145
145
|
style: this.$props.innerStyle,
|
|
146
146
|
"class": 'k-dropzone-inner'
|
|
147
|
-
}, [h(
|
|
148
|
-
|
|
147
|
+
}, [h(Icon, {
|
|
148
|
+
name: 'upload',
|
|
149
|
+
attrs: this.v3 ? undefined : {
|
|
150
|
+
name: 'upload'
|
|
151
|
+
}
|
|
149
152
|
}), h("span", {
|
|
150
153
|
"class": 'k-dropzone-hint'
|
|
151
154
|
}, [hintElement]), h("span", {
|
package/dist/esm/Upload.js
CHANGED
|
@@ -132,6 +132,7 @@ var UploadVue2 = {
|
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
|
+
validateFile: Function,
|
|
135
136
|
files: Array,
|
|
136
137
|
defaultFiles: Array
|
|
137
138
|
},
|
|
@@ -331,7 +332,7 @@ var UploadVue2 = {
|
|
|
331
332
|
var selectedFiles = utils.getAllFileInfo(files);
|
|
332
333
|
var newState;
|
|
333
334
|
selectedFiles = utils.assignGuidToFiles(selectedFiles, this.computedAsync.batch);
|
|
334
|
-
validationUtils.validateFiles(selectedFiles, this.$props.restrictions);
|
|
335
|
+
validationUtils.validateFiles(selectedFiles, this.$props.restrictions, this.validateFile);
|
|
335
336
|
if (!this.$props.multiple) {
|
|
336
337
|
newState = [];
|
|
337
338
|
} else {
|
|
@@ -23,9 +23,7 @@ var UploadAddButtonVue2 = {
|
|
|
23
23
|
multiple: Boolean,
|
|
24
24
|
disabled: Boolean,
|
|
25
25
|
accept: String,
|
|
26
|
-
id: String
|
|
27
|
-
ariaLabelledBy: String,
|
|
28
|
-
ariaDescribedBy: String
|
|
26
|
+
id: String
|
|
29
27
|
},
|
|
30
28
|
inject: {
|
|
31
29
|
kendoLocalizationService: {
|
|
@@ -100,8 +98,6 @@ var UploadAddButtonVue2 = {
|
|
|
100
98
|
addButtonIndex = _a.addButtonIndex,
|
|
101
99
|
tabIndex = _a.tabIndex,
|
|
102
100
|
id = _a.id,
|
|
103
|
-
ariaLabelledBy = _a.ariaLabelledBy,
|
|
104
|
-
ariaDescribedBy = _a.ariaDescribedBy,
|
|
105
101
|
async = _a.async,
|
|
106
102
|
multiple = _a.multiple,
|
|
107
103
|
disabled = _a.disabled,
|
|
@@ -113,18 +109,10 @@ var UploadAddButtonVue2 = {
|
|
|
113
109
|
id: id,
|
|
114
110
|
attrs: this.v3 ? undefined : {
|
|
115
111
|
id: id,
|
|
116
|
-
role: "button",
|
|
117
|
-
"aria-label": selectMessage,
|
|
118
|
-
"aria-labelledby": ariaLabelledBy,
|
|
119
|
-
"aria-describedby": ariaDescribedBy,
|
|
120
112
|
tabindex: tabIndex
|
|
121
113
|
},
|
|
122
114
|
ref: setRef(this, 'element'),
|
|
123
|
-
role: "button",
|
|
124
115
|
"class": buttonClassName,
|
|
125
|
-
"aria-label": selectMessage,
|
|
126
|
-
"aria-labelledby": ariaLabelledBy,
|
|
127
|
-
"aria-describedby": ariaDescribedBy,
|
|
128
116
|
tabindex: tabIndex,
|
|
129
117
|
onClick: this.onClick,
|
|
130
118
|
on: this.v3 ? undefined : {
|
package/dist/esm/UploadInput.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import { setRef } from '@progress/kendo-vue-common';
|
|
3
|
+
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
3
4
|
import * as Vue from 'vue';
|
|
4
5
|
var allVue = Vue;
|
|
5
6
|
var gh = allVue.h;
|
|
6
7
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
7
8
|
var ref = allVue.ref;
|
|
9
|
+
import { selectTitle, selectNoFilesTitle, select, messages } from './messages/main.js';
|
|
8
10
|
var CHROME_REGEX = /(chrome)[ \/]([\w.]+)/i;
|
|
9
11
|
var SAFARI_REGEX = /(webkit)[ \/]([\w.]+)/i;
|
|
10
12
|
/**
|
|
@@ -25,6 +27,18 @@ var UploadInputVue2 = {
|
|
|
25
27
|
accept: {
|
|
26
28
|
type: String,
|
|
27
29
|
default: undefined
|
|
30
|
+
},
|
|
31
|
+
hasFiles: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
ariaLabelledBy: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: undefined
|
|
38
|
+
},
|
|
39
|
+
ariaDescribedBy: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: undefined
|
|
28
42
|
}
|
|
29
43
|
},
|
|
30
44
|
// @ts-ignore
|
|
@@ -32,6 +46,11 @@ var UploadInputVue2 = {
|
|
|
32
46
|
'mousedown': null,
|
|
33
47
|
'add': null
|
|
34
48
|
},
|
|
49
|
+
inject: {
|
|
50
|
+
kendoLocalizationService: {
|
|
51
|
+
default: null
|
|
52
|
+
}
|
|
53
|
+
},
|
|
35
54
|
mounted: function mounted() {
|
|
36
55
|
this._input = this.v3 ? this.inputRef : this.$refs.input;
|
|
37
56
|
},
|
|
@@ -76,7 +95,14 @@ var UploadInputVue2 = {
|
|
|
76
95
|
multiple = _a.multiple,
|
|
77
96
|
async = _a.async,
|
|
78
97
|
disabled = _a.disabled,
|
|
79
|
-
accept = _a.accept
|
|
98
|
+
accept = _a.accept,
|
|
99
|
+
hasFiles = _a.hasFiles,
|
|
100
|
+
ariaLabelledBy = _a.ariaLabelledBy,
|
|
101
|
+
ariaDescribedBy = _a.ariaDescribedBy;
|
|
102
|
+
var localizationService = provideLocalizationService(this);
|
|
103
|
+
var message = hasFiles ? selectTitle : selectNoFilesTitle;
|
|
104
|
+
var selectMessage = localizationService.toLanguageString(message, messages[message]);
|
|
105
|
+
var selectLabel = localizationService.toLanguageString(select, messages[select]);
|
|
80
106
|
return h("input", {
|
|
81
107
|
ref: setRef(this, 'input'),
|
|
82
108
|
autocomplete: 'off',
|
|
@@ -87,7 +113,11 @@ var UploadInputVue2 = {
|
|
|
87
113
|
type: 'file',
|
|
88
114
|
tabindex: -1,
|
|
89
115
|
multiple: multiple,
|
|
90
|
-
disabled: disabled
|
|
116
|
+
disabled: disabled,
|
|
117
|
+
title: selectMessage,
|
|
118
|
+
"aria-label": ariaLabelledBy !== undefined ? undefined : selectLabel,
|
|
119
|
+
"aria-labelledby": ariaLabelledBy,
|
|
120
|
+
"aria-describedby": ariaDescribedBy
|
|
91
121
|
},
|
|
92
122
|
name: async.saveField,
|
|
93
123
|
accept: accept,
|
|
@@ -100,7 +130,11 @@ var UploadInputVue2 = {
|
|
|
100
130
|
"change": this.onAdd,
|
|
101
131
|
"mousedown": this.onMouseDown
|
|
102
132
|
},
|
|
103
|
-
onMousedown: this.onMouseDown
|
|
133
|
+
onMousedown: this.onMouseDown,
|
|
134
|
+
title: selectMessage,
|
|
135
|
+
"aria-label": ariaLabelledBy !== undefined ? undefined : selectLabel,
|
|
136
|
+
"aria-labelledby": ariaLabelledBy,
|
|
137
|
+
"aria-describedby": ariaDescribedBy
|
|
104
138
|
});
|
|
105
139
|
}
|
|
106
140
|
};
|
|
@@ -68,6 +68,10 @@ export interface UploadProps extends UploadAsyncProps {
|
|
|
68
68
|
* Sets the restrictions for the selected files ([see example]({% slug filerestrictions_upload %})).
|
|
69
69
|
*/
|
|
70
70
|
restrictions?: UploadFileRestrictions;
|
|
71
|
+
/**
|
|
72
|
+
* Sets the custom restrictions for the selected files ([see example]({% slug filerestrictions_upload %})).
|
|
73
|
+
*/
|
|
74
|
+
validateFile?: (file: UploadFileInfo) => void;
|
|
71
75
|
/**
|
|
72
76
|
* The list of files which are displayed when the Upload is in controlled mode
|
|
73
77
|
* ([see example]({% slug controleduncontroled_upload %})).
|
package/dist/esm/main.d.ts
CHANGED
|
@@ -21,5 +21,6 @@ import { UploadListItemProps } from './interfaces/UploadListItemProps';
|
|
|
21
21
|
import { UploadProps } from './interfaces/UploadProps';
|
|
22
22
|
import { UploadOnCancelEvent } from './interfaces/UploadOnCancelEvent';
|
|
23
23
|
import { UploadActionsLayout } from './interfaces/UploadActionsLayout';
|
|
24
|
+
import { messages } from './messages/main';
|
|
24
25
|
import { ExternalDropZone, ExternalDropZoneVue2 } from './ExternalDropZone';
|
|
25
|
-
export { UploadUI, UploadUIVue2, UploadUIProps, UploadFileRestrictions, Upload, UploadVue2, UploadProps, UploadOnAddEvent, UploadOnBeforeRemoveEvent, UploadOnBeforeUploadEvent, UploadOnProgressEvent, UploadOnRemoveEvent, UploadOnStatusChangeEvent, UploadOnCancelEvent, UploadResponse, UploadFileStatus, UploadAdditionalData, UploadAsyncProps, UploadFileInfo, UploadHttpHeaders, UploadListItemProps, UploadActionsLayout, ExternalDropZone, ExternalDropZoneVue2, UploadListSingleItem, UploadListSingleItemVue2, UploadListMultiItem, UploadListMultiItemVue2, UploadListActionButton, UploadListActionButtonVue2, utils };
|
|
26
|
+
export { UploadUI, UploadUIVue2, UploadUIProps, UploadFileRestrictions, Upload, UploadVue2, UploadProps, UploadOnAddEvent, UploadOnBeforeRemoveEvent, UploadOnBeforeUploadEvent, UploadOnProgressEvent, UploadOnRemoveEvent, UploadOnStatusChangeEvent, UploadOnCancelEvent, UploadResponse, UploadFileStatus, UploadAdditionalData, UploadAsyncProps, UploadFileInfo, UploadHttpHeaders, UploadListItemProps, UploadActionsLayout, ExternalDropZone, ExternalDropZoneVue2, UploadListSingleItem, UploadListSingleItemVue2, UploadListMultiItem, UploadListMultiItemVue2, UploadListActionButton, UploadListActionButtonVue2, utils, messages };
|
package/dist/esm/main.js
CHANGED
|
@@ -5,5 +5,6 @@ import { UploadListMultiItem, UploadListMultiItemVue2 } from './UploadListMultiI
|
|
|
5
5
|
import utils from './utils/utils.js';
|
|
6
6
|
import { UploadListActionButton, UploadListActionButtonVue2 } from './UploadListActionButton.js';
|
|
7
7
|
import { UploadFileStatus } from './interfaces/UploadFileStatus.js';
|
|
8
|
+
import { messages } from './messages/main.js';
|
|
8
9
|
import { ExternalDropZone, ExternalDropZoneVue2 } from './ExternalDropZone.js';
|
|
9
|
-
export { UploadUI, UploadUIVue2, Upload, UploadVue2, UploadFileStatus, ExternalDropZone, ExternalDropZoneVue2, UploadListSingleItem, UploadListSingleItemVue2, UploadListMultiItem, UploadListMultiItemVue2, UploadListActionButton, UploadListActionButtonVue2, utils };
|
|
10
|
+
export { UploadUI, UploadUIVue2, Upload, UploadVue2, UploadFileStatus, ExternalDropZone, ExternalDropZoneVue2, UploadListSingleItem, UploadListSingleItemVue2, UploadListMultiItem, UploadListMultiItemVue2, UploadListActionButton, UploadListActionButtonVue2, utils, messages };
|
|
@@ -46,6 +46,14 @@ export declare const retry = "upload.retry";
|
|
|
46
46
|
* @hidden
|
|
47
47
|
*/
|
|
48
48
|
export declare const select = "upload.select";
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export declare const selectTitle = "upload.selectTitle";
|
|
53
|
+
/**
|
|
54
|
+
* @hidden
|
|
55
|
+
*/
|
|
56
|
+
export declare const selectNoFilesTitle = "upload.selectNoFilesTitle";
|
|
49
57
|
/**
|
|
50
58
|
* @hidden
|
|
51
59
|
*/
|
|
@@ -90,6 +98,8 @@ export declare const messages: {
|
|
|
90
98
|
"upload.remove": string;
|
|
91
99
|
"upload.retry": string;
|
|
92
100
|
"upload.select": string;
|
|
101
|
+
"upload.selectTitle": string;
|
|
102
|
+
"upload.selectNoFilesTitle": string;
|
|
93
103
|
"upload.uploadSelectedFiles": string;
|
|
94
104
|
"upload.total": string;
|
|
95
105
|
"upload.files": string;
|
|
@@ -47,6 +47,14 @@ export var retry = 'upload.retry';
|
|
|
47
47
|
* @hidden
|
|
48
48
|
*/
|
|
49
49
|
export var select = 'upload.select';
|
|
50
|
+
/**
|
|
51
|
+
* @hidden
|
|
52
|
+
*/
|
|
53
|
+
export var selectTitle = 'upload.selectTitle';
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
export var selectNoFilesTitle = 'upload.selectNoFilesTitle';
|
|
50
58
|
/**
|
|
51
59
|
* @hidden
|
|
52
60
|
*/
|
|
@@ -91,6 +99,8 @@ export var messages = (_a = {},
|
|
|
91
99
|
_a[remove] = 'Remove',
|
|
92
100
|
_a[retry] = 'Retry',
|
|
93
101
|
_a[select] = 'Select files...',
|
|
102
|
+
_a[selectTitle] = 'Press to select more files',
|
|
103
|
+
_a[selectNoFilesTitle] = 'No files selected',
|
|
94
104
|
_a[uploadSelectedFiles] = 'Upload',
|
|
95
105
|
_a[total] = 'Total',
|
|
96
106
|
_a[files] = 'files',
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-upload',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1672390325,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -32,7 +32,7 @@ var parseAllowedExtensions = function (extensions) {
|
|
|
32
32
|
});
|
|
33
33
|
return allowedExtensions;
|
|
34
34
|
};
|
|
35
|
-
var validateFiles = function (files, restrictionInfo) {
|
|
35
|
+
var validateFiles = function (files, restrictionInfo, validateFile) {
|
|
36
36
|
var allowedExtensions = parseAllowedExtensions(restrictionInfo.allowedExtensions || []);
|
|
37
37
|
var maxFileSize = restrictionInfo.maxFileSize || 0;
|
|
38
38
|
var minFileSize = restrictionInfo.minFileSize || 0;
|
|
@@ -40,6 +40,9 @@ var validateFiles = function (files, restrictionInfo) {
|
|
|
40
40
|
for (i = 0; i < files.length; i++) {
|
|
41
41
|
validateFileExtension(files[i], allowedExtensions);
|
|
42
42
|
validateFileSize(files[i], minFileSize, maxFileSize);
|
|
43
|
+
if (validateFile) {
|
|
44
|
+
validateFile(files[i]);
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
/**
|
|
@@ -150,8 +150,11 @@ var ExternalDropZoneVue2 = {
|
|
|
150
150
|
}, [h("div", {
|
|
151
151
|
style: this.$props.innerStyle,
|
|
152
152
|
"class": 'k-dropzone-inner'
|
|
153
|
-
}, [h(
|
|
154
|
-
|
|
153
|
+
}, [h(kendo_vue_common_1.Icon, {
|
|
154
|
+
name: 'upload',
|
|
155
|
+
attrs: this.v3 ? undefined : {
|
|
156
|
+
name: 'upload'
|
|
157
|
+
}
|
|
155
158
|
}), h("span", {
|
|
156
159
|
"class": 'k-dropzone-hint'
|
|
157
160
|
}, [hintElement]), h("span", {
|
package/dist/npm/Upload.js
CHANGED
|
@@ -138,6 +138,7 @@ var UploadVue2 = {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
|
+
validateFile: Function,
|
|
141
142
|
files: Array,
|
|
142
143
|
defaultFiles: Array
|
|
143
144
|
},
|
|
@@ -337,7 +338,7 @@ var UploadVue2 = {
|
|
|
337
338
|
var selectedFiles = utils_1.default.getAllFileInfo(files);
|
|
338
339
|
var newState;
|
|
339
340
|
selectedFiles = utils_1.default.assignGuidToFiles(selectedFiles, this.computedAsync.batch);
|
|
340
|
-
validationUtils_1.default.validateFiles(selectedFiles, this.$props.restrictions);
|
|
341
|
+
validationUtils_1.default.validateFiles(selectedFiles, this.$props.restrictions, this.validateFile);
|
|
341
342
|
if (!this.$props.multiple) {
|
|
342
343
|
newState = [];
|
|
343
344
|
} else {
|