@progress/kendo-vue-upload 3.7.4-dev.202212020747 → 3.7.4-dev.202301091431
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 +10 -4
- package/dist/es/UploadAddButton.d.ts +0 -2
- package/dist/es/UploadAddButton.js +29 -18
- package/dist/es/UploadDropZone.js +3 -2
- package/dist/es/UploadInput.d.ts +4 -0
- package/dist/es/UploadInput.js +41 -4
- package/dist/es/UploadListActionButton.d.ts +1 -0
- package/dist/es/UploadListActionButton.js +40 -27
- package/dist/es/UploadListGroup.js +9 -1
- package/dist/es/UploadListMultiItem.js +25 -21
- package/dist/es/UploadListSingleItem.js +82 -33
- package/dist/es/UploadStatus.js +12 -6
- package/dist/es/UploadUI.js +1 -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/esm/ExternalDropZone.js +10 -4
- package/dist/esm/UploadAddButton.d.ts +0 -2
- package/dist/esm/UploadAddButton.js +29 -18
- package/dist/esm/UploadDropZone.js +3 -2
- package/dist/esm/UploadInput.d.ts +4 -0
- package/dist/esm/UploadInput.js +41 -4
- package/dist/esm/UploadListActionButton.d.ts +1 -0
- package/dist/esm/UploadListActionButton.js +40 -27
- package/dist/esm/UploadListGroup.js +9 -1
- package/dist/esm/UploadListMultiItem.js +25 -21
- package/dist/esm/UploadListSingleItem.js +82 -33
- package/dist/esm/UploadStatus.js +12 -6
- package/dist/esm/UploadUI.js +1 -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/npm/ExternalDropZone.js +9 -3
- package/dist/npm/UploadAddButton.d.ts +0 -2
- package/dist/npm/UploadAddButton.js +28 -17
- package/dist/npm/UploadDropZone.js +3 -2
- package/dist/npm/UploadInput.d.ts +4 -0
- package/dist/npm/UploadInput.js +41 -4
- package/dist/npm/UploadListActionButton.d.ts +1 -0
- package/dist/npm/UploadListActionButton.js +40 -27
- package/dist/npm/UploadListGroup.js +9 -1
- package/dist/npm/UploadListMultiItem.js +24 -20
- package/dist/npm/UploadListSingleItem.js +81 -32
- package/dist/npm/UploadStatus.js +11 -5
- package/dist/npm/UploadUI.js +1 -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/package.json +9 -6
|
@@ -5,11 +5,13 @@ 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 } from '@progress/kendo-vue-common';
|
|
8
|
+
import { classNames, Icon } from '@progress/kendo-vue-common';
|
|
9
9
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
10
|
+
import { ProgressBar } from '@progress/kendo-vue-progressbars';
|
|
10
11
|
import { messages, statusUploaded, statusUploadFailed } from './messages/main';
|
|
11
12
|
import utils from './utils/utils';
|
|
12
13
|
import { UploadListActionButton } from './UploadListActionButton';
|
|
14
|
+
import { fileAudioIcon, fileConfigIcon, fileDataIcon, fileIcon, fileImageIcon, filePdfIcon, filePresentationIcon, fileProgrammingIcon, fileTxtIcon, fileVideoIcon, fileZipIcon } from '@progress/kendo-svg-icons';
|
|
13
15
|
/**
|
|
14
16
|
* @hidden
|
|
15
17
|
*/
|
|
@@ -55,7 +57,7 @@ var UploadListSingleItemVue2 = {
|
|
|
55
57
|
}
|
|
56
58
|
return validationMessage;
|
|
57
59
|
},
|
|
58
|
-
|
|
60
|
+
getFileExtensionName: function getFileExtensionName(file) {
|
|
59
61
|
switch (file.extension) {
|
|
60
62
|
case '.png':
|
|
61
63
|
case '.jpg':
|
|
@@ -63,41 +65,86 @@ var UploadListSingleItemVue2 = {
|
|
|
63
65
|
case '.tiff':
|
|
64
66
|
case '.bmp':
|
|
65
67
|
case '.gif':
|
|
66
|
-
return '
|
|
68
|
+
return 'file-image';
|
|
67
69
|
case '.mp3':
|
|
68
70
|
case '.mp4':
|
|
69
71
|
case '.wav':
|
|
70
|
-
return '
|
|
72
|
+
return 'file-audio';
|
|
71
73
|
case '.mkv':
|
|
72
74
|
case '.webm':
|
|
73
75
|
case '.flv':
|
|
74
76
|
case '.gifv':
|
|
75
77
|
case '.avi':
|
|
76
78
|
case '.wmv':
|
|
77
|
-
return '
|
|
79
|
+
return 'file-video';
|
|
78
80
|
case '.txt':
|
|
79
|
-
return '
|
|
81
|
+
return 'file-txt';
|
|
80
82
|
case '.pdf':
|
|
81
|
-
return '
|
|
83
|
+
return 'file-pdf';
|
|
82
84
|
case '.ppt':
|
|
83
85
|
case '.pptx':
|
|
84
|
-
return '
|
|
86
|
+
return 'file-presentation';
|
|
85
87
|
case '.csv':
|
|
86
88
|
case '.xls':
|
|
87
89
|
case '.xlsx':
|
|
88
|
-
return '
|
|
90
|
+
return 'file-data';
|
|
89
91
|
case '.html':
|
|
90
92
|
case '.css':
|
|
91
93
|
case '.js':
|
|
92
94
|
case '.ts':
|
|
93
|
-
return '
|
|
95
|
+
return 'file-programming';
|
|
94
96
|
case '.exe':
|
|
95
|
-
return '
|
|
97
|
+
return 'file-config';
|
|
96
98
|
case '.zip':
|
|
97
99
|
case '.rar':
|
|
98
|
-
return '
|
|
100
|
+
return 'file-zip';
|
|
99
101
|
default:
|
|
100
|
-
return '
|
|
102
|
+
return 'file';
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
getFileExtensionSVG: function getFileExtensionSVG(file) {
|
|
106
|
+
switch (file.extension) {
|
|
107
|
+
case '.png':
|
|
108
|
+
case '.jpg':
|
|
109
|
+
case '.jpeg':
|
|
110
|
+
case '.tiff':
|
|
111
|
+
case '.bmp':
|
|
112
|
+
case '.gif':
|
|
113
|
+
return fileImageIcon;
|
|
114
|
+
case '.mp3':
|
|
115
|
+
case '.mp4':
|
|
116
|
+
case '.wav':
|
|
117
|
+
return fileAudioIcon;
|
|
118
|
+
case '.mkv':
|
|
119
|
+
case '.webm':
|
|
120
|
+
case '.flv':
|
|
121
|
+
case '.gifv':
|
|
122
|
+
case '.avi':
|
|
123
|
+
case '.wmv':
|
|
124
|
+
return fileVideoIcon;
|
|
125
|
+
case '.txt':
|
|
126
|
+
return fileTxtIcon;
|
|
127
|
+
case '.pdf':
|
|
128
|
+
return filePdfIcon;
|
|
129
|
+
case '.ppt':
|
|
130
|
+
case '.pptx':
|
|
131
|
+
return filePresentationIcon;
|
|
132
|
+
case '.csv':
|
|
133
|
+
case '.xls':
|
|
134
|
+
case '.xlsx':
|
|
135
|
+
return fileDataIcon;
|
|
136
|
+
case '.html':
|
|
137
|
+
case '.css':
|
|
138
|
+
case '.js':
|
|
139
|
+
case '.ts':
|
|
140
|
+
return fileProgrammingIcon;
|
|
141
|
+
case '.exe':
|
|
142
|
+
return fileConfigIcon;
|
|
143
|
+
case '.zip':
|
|
144
|
+
case '.rar':
|
|
145
|
+
return fileZipIcon;
|
|
146
|
+
default:
|
|
147
|
+
return fileIcon;
|
|
101
148
|
}
|
|
102
149
|
}
|
|
103
150
|
},
|
|
@@ -125,23 +172,23 @@ var UploadListSingleItemVue2 = {
|
|
|
125
172
|
var showProgressBar = !isUploadValidationFailed && !isUploaded && !isUploadFailed;
|
|
126
173
|
var renderValidationError = function renderValidationError(currentFile, isCurrentUploadFailed) {
|
|
127
174
|
return h("span", {
|
|
128
|
-
"class": 'k-file-
|
|
175
|
+
"class": 'k-file-info',
|
|
129
176
|
key: '2'
|
|
130
177
|
}, [h("span", {
|
|
131
|
-
"class": 'k-file-name
|
|
178
|
+
"class": 'k-file-name',
|
|
132
179
|
title: currentFile.name,
|
|
133
180
|
attrs: this.v3 ? undefined : {
|
|
134
181
|
title: currentFile.name
|
|
135
182
|
}
|
|
136
183
|
}, [currentFile.name]), h("span", {
|
|
137
|
-
"class": 'k-file-validation-message
|
|
184
|
+
"class": 'k-file-validation-message'
|
|
138
185
|
}, [this.getFileValidationMessage(currentFile, isCurrentUploadFailed)])]);
|
|
139
186
|
};
|
|
140
187
|
var renderFileDetails = function renderFileDetails(currentFile) {
|
|
141
188
|
var localizationService = provideLocalizationService(this);
|
|
142
189
|
var successMessage = localizationService.toLanguageString(statusUploaded, messages[statusUploaded]);
|
|
143
190
|
return h("span", {
|
|
144
|
-
"class": 'k-file-
|
|
191
|
+
"class": 'k-file-info',
|
|
145
192
|
key: '2'
|
|
146
193
|
}, [h("span", {
|
|
147
194
|
"class": 'k-file-name',
|
|
@@ -152,27 +199,29 @@ var UploadListSingleItemVue2 = {
|
|
|
152
199
|
}, [currentFile.name]), currentFile.progress !== 100 ? h("span", {
|
|
153
200
|
"class": 'k-file-size'
|
|
154
201
|
}, [utils.getTotalFilesSizeMessage([currentFile])]) : h("span", {
|
|
155
|
-
"class": 'k-file-validation-message
|
|
202
|
+
"class": 'k-file-validation-message'
|
|
156
203
|
}, [successMessage])]);
|
|
157
204
|
};
|
|
158
205
|
return h("div", {
|
|
159
206
|
"class": itemClassName
|
|
160
|
-
}, [h(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
width: (file.progress || 0) + '%'
|
|
170
|
-
}
|
|
171
|
-
})]), h("span", {
|
|
172
|
-
"class": 'k-file-group-wrapper',
|
|
207
|
+
}, [showProgressBar && h(ProgressBar, {
|
|
208
|
+
value: file.progress || 0,
|
|
209
|
+
attrs: this.v3 ? undefined : {
|
|
210
|
+
value: file.progress || 0,
|
|
211
|
+
labelVisible: false
|
|
212
|
+
},
|
|
213
|
+
labelVisible: false
|
|
214
|
+
}), h("span", {
|
|
215
|
+
"class": 'k-file-icon-wrapper',
|
|
173
216
|
key: '1'
|
|
174
|
-
}, [h(
|
|
175
|
-
|
|
217
|
+
}, [h(Icon, {
|
|
218
|
+
name: this.getFileExtensionName(file),
|
|
219
|
+
attrs: this.v3 ? undefined : {
|
|
220
|
+
name: this.getFileExtensionName(file),
|
|
221
|
+
icon: this.getFileExtensionSVG(file)
|
|
222
|
+
},
|
|
223
|
+
icon: this.getFileExtensionSVG(file),
|
|
224
|
+
"class": 'k-file-icon'
|
|
176
225
|
}), h("span", {
|
|
177
226
|
"class": 'k-file-state'
|
|
178
227
|
})]), isUploadValidationFailed || isUploadFailed ? renderValidationError.call(this, file, isUploadFailed) : renderFileDetails.call(this, file),
|
package/dist/es/UploadStatus.js
CHANGED
|
@@ -3,11 +3,11 @@ import * as Vue from 'vue';
|
|
|
3
3
|
var allVue = Vue;
|
|
4
4
|
var gh = allVue.h;
|
|
5
5
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
-
var ref = allVue.ref;
|
|
7
6
|
var inject = allVue.inject;
|
|
8
|
-
import { classNames } from '@progress/kendo-vue-common';
|
|
7
|
+
import { classNames, Icon } from '@progress/kendo-vue-common';
|
|
9
8
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
10
9
|
import { messages, headerStatusUploading, headerStatusUploaded } from './messages/main';
|
|
10
|
+
import { checkIcon, exclamationCircleIcon } from '@progress/kendo-svg-icons';
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
@@ -37,7 +37,6 @@ var UploadStatusVue2 = {
|
|
|
37
37
|
isUploading = _a.isUploading,
|
|
38
38
|
isUploaded = _a.isUploaded,
|
|
39
39
|
isUploadFailed = _a.isUploadFailed;
|
|
40
|
-
var statusClassName = classNames(!isUploading && !isUploadFailed && isUploaded ? 'k-i-checkmark' : '', !isUploading && isUploadFailed ? 'k-i-exception' : '', isUploading ? 'k-i-loading' : '', 'k-icon');
|
|
41
40
|
var statusText = '';
|
|
42
41
|
var localizationService = provideLocalizationService(this);
|
|
43
42
|
if (isUploading) {
|
|
@@ -46,9 +45,16 @@ var UploadStatusVue2 = {
|
|
|
46
45
|
statusText = localizationService.toLanguageString(headerStatusUploaded, messages[headerStatusUploaded]);
|
|
47
46
|
}
|
|
48
47
|
return h("div", {
|
|
49
|
-
"class": classNames('k-upload-status'
|
|
50
|
-
}, [h("span", {
|
|
51
|
-
"class":
|
|
48
|
+
"class": classNames('k-upload-status')
|
|
49
|
+
}, [isUploading ? h("span", {
|
|
50
|
+
"class": 'k-icon k-i-loading'
|
|
51
|
+
}) : h(Icon, {
|
|
52
|
+
name: isUploadFailed ? 'exclamation-circle' : isUploaded ? 'check' : '',
|
|
53
|
+
attrs: this.v3 ? undefined : {
|
|
54
|
+
name: isUploadFailed ? 'exclamation-circle' : isUploaded ? 'check' : '',
|
|
55
|
+
icon: isUploadFailed ? exclamationCircleIcon : isUploaded ? checkIcon : undefined
|
|
56
|
+
},
|
|
57
|
+
icon: isUploadFailed ? exclamationCircleIcon : isUploaded ? checkIcon : undefined
|
|
52
58
|
}), statusText]);
|
|
53
59
|
}
|
|
54
60
|
};
|
package/dist/es/UploadUI.js
CHANGED
|
@@ -157,7 +157,7 @@ var UploadUIVue2 = {
|
|
|
157
157
|
ariaLabelledBy = _a.ariaLabelledBy,
|
|
158
158
|
ariaDescribedBy = _a.ariaDescribedBy,
|
|
159
159
|
async = _a.async;
|
|
160
|
-
var className = classNames('k-
|
|
160
|
+
var className = classNames('k-upload', 'k-upload-async', this.$props.className, disabled ? 'k-disabled' : '');
|
|
161
161
|
return h("div", {
|
|
162
162
|
ref: setRef(this, 'container'),
|
|
163
163
|
"class": className,
|
|
@@ -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: 1673274481,
|
|
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
|
};
|
|
@@ -5,8 +5,9 @@ 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
|
+
import { uploadIcon } from '@progress/kendo-svg-icons';
|
|
10
11
|
import { packageMetadata } from './package-metadata.js';
|
|
11
12
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
12
13
|
/**
|
|
@@ -144,14 +145,19 @@ var ExternalDropZoneVue2 = {
|
|
|
144
145
|
}, [h("div", {
|
|
145
146
|
style: this.$props.innerStyle,
|
|
146
147
|
"class": 'k-dropzone-inner'
|
|
147
|
-
}, [h(
|
|
148
|
-
|
|
148
|
+
}, [h(Icon, {
|
|
149
|
+
name: 'upload',
|
|
150
|
+
attrs: this.v3 ? undefined : {
|
|
151
|
+
name: 'upload',
|
|
152
|
+
icon: uploadIcon
|
|
153
|
+
},
|
|
154
|
+
icon: uploadIcon
|
|
149
155
|
}), h("span", {
|
|
150
156
|
"class": 'k-dropzone-hint'
|
|
151
157
|
}, [hintElement]), h("span", {
|
|
152
158
|
"class": 'k-dropzone-note'
|
|
153
159
|
}, [noteElement])]), h("div", {
|
|
154
|
-
"class": 'k-
|
|
160
|
+
"class": 'k-upload'
|
|
155
161
|
})]);
|
|
156
162
|
}
|
|
157
163
|
};
|
|
@@ -5,10 +5,11 @@ 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, setRef } from '@progress/kendo-vue-common';
|
|
8
|
+
import { classNames, guid, setRef } from '@progress/kendo-vue-common';
|
|
9
9
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
10
10
|
import { messages, select } from './messages/main.js';
|
|
11
11
|
import { UploadInput } from './UploadInput.js';
|
|
12
|
+
import { Button } from '@progress/kendo-vue-buttons';
|
|
12
13
|
/**
|
|
13
14
|
* @hidden
|
|
14
15
|
*/
|
|
@@ -23,9 +24,7 @@ var UploadAddButtonVue2 = {
|
|
|
23
24
|
multiple: Boolean,
|
|
24
25
|
disabled: Boolean,
|
|
25
26
|
accept: String,
|
|
26
|
-
id: String
|
|
27
|
-
ariaLabelledBy: String,
|
|
28
|
-
ariaDescribedBy: String
|
|
27
|
+
id: String
|
|
29
28
|
},
|
|
30
29
|
inject: {
|
|
31
30
|
kendoLocalizationService: {
|
|
@@ -50,6 +49,9 @@ var UploadAddButtonVue2 = {
|
|
|
50
49
|
kendoLocalizationService: kendoLocalizationService
|
|
51
50
|
};
|
|
52
51
|
},
|
|
52
|
+
created: function created() {
|
|
53
|
+
this.uploadInputId = guid();
|
|
54
|
+
},
|
|
53
55
|
mounted: function mounted() {
|
|
54
56
|
this.element = this.v3 ? this.elementRef : this.$refs.element;
|
|
55
57
|
this.uploadInput = this.v3 ? this.uploadInputRef : this.$refs.uploadInput;
|
|
@@ -100,46 +102,55 @@ var UploadAddButtonVue2 = {
|
|
|
100
102
|
addButtonIndex = _a.addButtonIndex,
|
|
101
103
|
tabIndex = _a.tabIndex,
|
|
102
104
|
id = _a.id,
|
|
103
|
-
ariaLabelledBy = _a.ariaLabelledBy,
|
|
104
|
-
ariaDescribedBy = _a.ariaDescribedBy,
|
|
105
105
|
async = _a.async,
|
|
106
106
|
multiple = _a.multiple,
|
|
107
107
|
disabled = _a.disabled,
|
|
108
108
|
accept = _a.accept;
|
|
109
109
|
var localizationService = provideLocalizationService(this);
|
|
110
110
|
var selectMessage = localizationService.toLanguageString(select, messages[select]);
|
|
111
|
-
var buttonClassName = classNames('k-
|
|
111
|
+
var buttonClassName = classNames('k-upload-button', navigationIndex === addButtonIndex ? 'k-focus' : '');
|
|
112
112
|
return h("div", {
|
|
113
|
+
"class": "k-upload-button-wrap"
|
|
114
|
+
}, [h("label", {
|
|
115
|
+
"for": this.uploadInputId,
|
|
116
|
+
attrs: this.v3 ? undefined : {
|
|
117
|
+
"for": this.uploadInputId
|
|
118
|
+
}
|
|
119
|
+
}, [
|
|
120
|
+
// @ts-ignore function children
|
|
121
|
+
h(Button, {
|
|
113
122
|
id: id,
|
|
114
123
|
attrs: this.v3 ? undefined : {
|
|
115
124
|
id: id,
|
|
116
|
-
role:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"aria-describedby": ariaDescribedBy,
|
|
125
|
+
role: 'button',
|
|
126
|
+
disabled: disabled,
|
|
127
|
+
ariaLabel: selectMessage,
|
|
120
128
|
tabindex: tabIndex
|
|
121
129
|
},
|
|
122
130
|
ref: setRef(this, 'element'),
|
|
123
|
-
role:
|
|
131
|
+
role: 'button',
|
|
132
|
+
disabled: disabled,
|
|
133
|
+
ariaLabel: selectMessage,
|
|
124
134
|
"class": buttonClassName,
|
|
125
|
-
"aria-label": selectMessage,
|
|
126
|
-
"aria-labelledby": ariaLabelledBy,
|
|
127
|
-
"aria-describedby": ariaDescribedBy,
|
|
128
135
|
tabindex: tabIndex,
|
|
129
136
|
onClick: this.onClick,
|
|
130
137
|
on: this.v3 ? undefined : {
|
|
131
138
|
"click": this.onClick
|
|
132
139
|
}
|
|
133
|
-
},
|
|
140
|
+
}, this.v3 ? function () {
|
|
141
|
+
return [selectMessage];
|
|
142
|
+
} : [selectMessage])]),
|
|
134
143
|
// @ts-ignore function children
|
|
135
144
|
h(UploadInput, {
|
|
136
|
-
|
|
145
|
+
id: this.uploadInputId,
|
|
137
146
|
attrs: this.v3 ? undefined : {
|
|
147
|
+
id: this.uploadInputId,
|
|
138
148
|
async: async,
|
|
139
149
|
multiple: multiple,
|
|
140
150
|
disabled: disabled,
|
|
141
151
|
accept: accept
|
|
142
152
|
},
|
|
153
|
+
async: async,
|
|
143
154
|
multiple: multiple,
|
|
144
155
|
disabled: disabled,
|
|
145
156
|
accept: accept,
|
|
@@ -152,7 +163,7 @@ var UploadAddButtonVue2 = {
|
|
|
152
163
|
ref: this.v3 ? function (el) {
|
|
153
164
|
_this.uploadInputRef = el;
|
|
154
165
|
} : 'uploadInput'
|
|
155
|
-
})
|
|
166
|
+
})]);
|
|
156
167
|
}
|
|
157
168
|
};
|
|
158
169
|
/**
|
|
@@ -103,8 +103,9 @@ var UploadDropZoneVue2 = {
|
|
|
103
103
|
dropZoneClasses: function dropZoneClasses() {
|
|
104
104
|
return {
|
|
105
105
|
'k-dropzone': true,
|
|
106
|
-
'k-dropzone
|
|
107
|
-
'k-
|
|
106
|
+
'k-upload-dropzone': true,
|
|
107
|
+
'k-active': this.currentDocumentActive,
|
|
108
|
+
'k-hover': this.currentElementActive
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
111
|
},
|
|
@@ -8,10 +8,14 @@ import { UploadAsyncProps } from './interfaces/UploadAsyncProps';
|
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
10
|
export interface UploadInputProps {
|
|
11
|
+
id: String;
|
|
11
12
|
async: UploadAsyncProps;
|
|
12
13
|
multiple?: boolean;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
accept?: string;
|
|
16
|
+
hasFiles?: boolean;
|
|
17
|
+
ariaLabelledBy?: string;
|
|
18
|
+
ariaDescribedBy?: string;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* @hidden
|
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
|
/**
|
|
@@ -14,6 +16,7 @@ var UploadInputVue2 = {
|
|
|
14
16
|
name: 'KendoVueUploadInput',
|
|
15
17
|
props: {
|
|
16
18
|
async: Object,
|
|
19
|
+
id: String,
|
|
17
20
|
multiple: {
|
|
18
21
|
type: Boolean,
|
|
19
22
|
default: undefined
|
|
@@ -25,6 +28,18 @@ var UploadInputVue2 = {
|
|
|
25
28
|
accept: {
|
|
26
29
|
type: String,
|
|
27
30
|
default: undefined
|
|
31
|
+
},
|
|
32
|
+
hasFiles: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
ariaLabelledBy: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: undefined
|
|
39
|
+
},
|
|
40
|
+
ariaDescribedBy: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: undefined
|
|
28
43
|
}
|
|
29
44
|
},
|
|
30
45
|
// @ts-ignore
|
|
@@ -32,6 +47,11 @@ var UploadInputVue2 = {
|
|
|
32
47
|
'mousedown': null,
|
|
33
48
|
'add': null
|
|
34
49
|
},
|
|
50
|
+
inject: {
|
|
51
|
+
kendoLocalizationService: {
|
|
52
|
+
default: null
|
|
53
|
+
}
|
|
54
|
+
},
|
|
35
55
|
mounted: function mounted() {
|
|
36
56
|
this._input = this.v3 ? this.inputRef : this.$refs.input;
|
|
37
57
|
},
|
|
@@ -76,19 +96,32 @@ var UploadInputVue2 = {
|
|
|
76
96
|
multiple = _a.multiple,
|
|
77
97
|
async = _a.async,
|
|
78
98
|
disabled = _a.disabled,
|
|
79
|
-
accept = _a.accept
|
|
99
|
+
accept = _a.accept,
|
|
100
|
+
hasFiles = _a.hasFiles,
|
|
101
|
+
ariaLabelledBy = _a.ariaLabelledBy,
|
|
102
|
+
ariaDescribedBy = _a.ariaDescribedBy;
|
|
103
|
+
var localizationService = provideLocalizationService(this);
|
|
104
|
+
var message = hasFiles ? selectTitle : selectNoFilesTitle;
|
|
105
|
+
var selectMessage = localizationService.toLanguageString(message, messages[message]);
|
|
106
|
+
var selectLabel = localizationService.toLanguageString(select, messages[select]);
|
|
80
107
|
return h("input", {
|
|
81
108
|
ref: setRef(this, 'input'),
|
|
82
|
-
|
|
109
|
+
id: this.id,
|
|
83
110
|
attrs: this.v3 ? undefined : {
|
|
111
|
+
id: this.id,
|
|
84
112
|
autocomplete: 'off',
|
|
85
113
|
name: async.saveField,
|
|
86
114
|
accept: accept,
|
|
87
115
|
type: 'file',
|
|
88
116
|
tabindex: -1,
|
|
89
117
|
multiple: multiple,
|
|
90
|
-
disabled: disabled
|
|
118
|
+
disabled: disabled,
|
|
119
|
+
title: selectMessage,
|
|
120
|
+
"aria-label": ariaLabelledBy !== undefined ? undefined : selectLabel,
|
|
121
|
+
"aria-labelledby": ariaLabelledBy,
|
|
122
|
+
"aria-describedby": ariaDescribedBy
|
|
91
123
|
},
|
|
124
|
+
autocomplete: 'off',
|
|
92
125
|
name: async.saveField,
|
|
93
126
|
accept: accept,
|
|
94
127
|
type: 'file',
|
|
@@ -100,7 +133,11 @@ var UploadInputVue2 = {
|
|
|
100
133
|
"change": this.onAdd,
|
|
101
134
|
"mousedown": this.onMouseDown
|
|
102
135
|
},
|
|
103
|
-
onMousedown: this.onMouseDown
|
|
136
|
+
onMousedown: this.onMouseDown,
|
|
137
|
+
title: selectMessage,
|
|
138
|
+
"aria-label": ariaLabelledBy !== undefined ? undefined : selectLabel,
|
|
139
|
+
"aria-labelledby": ariaLabelledBy,
|
|
140
|
+
"aria-describedby": ariaDescribedBy
|
|
104
141
|
});
|
|
105
142
|
}
|
|
106
143
|
};
|