@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
|
@@ -15,6 +15,7 @@ var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
|
15
15
|
var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
|
|
16
16
|
var main_1 = require("./messages/main");
|
|
17
17
|
var UploadInput_1 = require("./UploadInput");
|
|
18
|
+
var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
|
|
18
19
|
/**
|
|
19
20
|
* @hidden
|
|
20
21
|
*/
|
|
@@ -29,9 +30,7 @@ var UploadAddButtonVue2 = {
|
|
|
29
30
|
multiple: Boolean,
|
|
30
31
|
disabled: Boolean,
|
|
31
32
|
accept: String,
|
|
32
|
-
id: String
|
|
33
|
-
ariaLabelledBy: String,
|
|
34
|
-
ariaDescribedBy: String
|
|
33
|
+
id: String
|
|
35
34
|
},
|
|
36
35
|
inject: {
|
|
37
36
|
kendoLocalizationService: {
|
|
@@ -56,6 +55,9 @@ var UploadAddButtonVue2 = {
|
|
|
56
55
|
kendoLocalizationService: kendoLocalizationService
|
|
57
56
|
};
|
|
58
57
|
},
|
|
58
|
+
created: function created() {
|
|
59
|
+
this.uploadInputId = (0, kendo_vue_common_1.guid)();
|
|
60
|
+
},
|
|
59
61
|
mounted: function mounted() {
|
|
60
62
|
this.element = this.v3 ? this.elementRef : this.$refs.element;
|
|
61
63
|
this.uploadInput = this.v3 ? this.uploadInputRef : this.$refs.uploadInput;
|
|
@@ -106,46 +108,55 @@ var UploadAddButtonVue2 = {
|
|
|
106
108
|
addButtonIndex = _a.addButtonIndex,
|
|
107
109
|
tabIndex = _a.tabIndex,
|
|
108
110
|
id = _a.id,
|
|
109
|
-
ariaLabelledBy = _a.ariaLabelledBy,
|
|
110
|
-
ariaDescribedBy = _a.ariaDescribedBy,
|
|
111
111
|
async = _a.async,
|
|
112
112
|
multiple = _a.multiple,
|
|
113
113
|
disabled = _a.disabled,
|
|
114
114
|
accept = _a.accept;
|
|
115
115
|
var localizationService = (0, kendo_vue_intl_1.provideLocalizationService)(this);
|
|
116
116
|
var selectMessage = localizationService.toLanguageString(main_1.select, main_1.messages[main_1.select]);
|
|
117
|
-
var buttonClassName = (0, kendo_vue_common_1.classNames)('k-
|
|
117
|
+
var buttonClassName = (0, kendo_vue_common_1.classNames)('k-upload-button', navigationIndex === addButtonIndex ? 'k-focus' : '');
|
|
118
118
|
return h("div", {
|
|
119
|
+
"class": "k-upload-button-wrap"
|
|
120
|
+
}, [h("label", {
|
|
121
|
+
"for": this.uploadInputId,
|
|
122
|
+
attrs: this.v3 ? undefined : {
|
|
123
|
+
"for": this.uploadInputId
|
|
124
|
+
}
|
|
125
|
+
}, [
|
|
126
|
+
// @ts-ignore function children
|
|
127
|
+
h(kendo_vue_buttons_1.Button, {
|
|
119
128
|
id: id,
|
|
120
129
|
attrs: this.v3 ? undefined : {
|
|
121
130
|
id: id,
|
|
122
|
-
role:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"aria-describedby": ariaDescribedBy,
|
|
131
|
+
role: 'button',
|
|
132
|
+
disabled: disabled,
|
|
133
|
+
ariaLabel: selectMessage,
|
|
126
134
|
tabindex: tabIndex
|
|
127
135
|
},
|
|
128
136
|
ref: (0, kendo_vue_common_1.setRef)(this, 'element'),
|
|
129
|
-
role:
|
|
137
|
+
role: 'button',
|
|
138
|
+
disabled: disabled,
|
|
139
|
+
ariaLabel: selectMessage,
|
|
130
140
|
"class": buttonClassName,
|
|
131
|
-
"aria-label": selectMessage,
|
|
132
|
-
"aria-labelledby": ariaLabelledBy,
|
|
133
|
-
"aria-describedby": ariaDescribedBy,
|
|
134
141
|
tabindex: tabIndex,
|
|
135
142
|
onClick: this.onClick,
|
|
136
143
|
on: this.v3 ? undefined : {
|
|
137
144
|
"click": this.onClick
|
|
138
145
|
}
|
|
139
|
-
},
|
|
146
|
+
}, this.v3 ? function () {
|
|
147
|
+
return [selectMessage];
|
|
148
|
+
} : [selectMessage])]),
|
|
140
149
|
// @ts-ignore function children
|
|
141
150
|
h(UploadInput_1.UploadInput, {
|
|
142
|
-
|
|
151
|
+
id: this.uploadInputId,
|
|
143
152
|
attrs: this.v3 ? undefined : {
|
|
153
|
+
id: this.uploadInputId,
|
|
144
154
|
async: async,
|
|
145
155
|
multiple: multiple,
|
|
146
156
|
disabled: disabled,
|
|
147
157
|
accept: accept
|
|
148
158
|
},
|
|
159
|
+
async: async,
|
|
149
160
|
multiple: multiple,
|
|
150
161
|
disabled: disabled,
|
|
151
162
|
accept: accept,
|
|
@@ -158,7 +169,7 @@ var UploadAddButtonVue2 = {
|
|
|
158
169
|
ref: this.v3 ? function (el) {
|
|
159
170
|
_this.uploadInputRef = el;
|
|
160
171
|
} : 'uploadInput'
|
|
161
|
-
})
|
|
172
|
+
})]);
|
|
162
173
|
}
|
|
163
174
|
};
|
|
164
175
|
exports.UploadAddButtonVue2 = UploadAddButtonVue2;
|
|
@@ -109,8 +109,9 @@ var UploadDropZoneVue2 = {
|
|
|
109
109
|
dropZoneClasses: function dropZoneClasses() {
|
|
110
110
|
return {
|
|
111
111
|
'k-dropzone': true,
|
|
112
|
-
'k-dropzone
|
|
113
|
-
'k-
|
|
112
|
+
'k-upload-dropzone': true,
|
|
113
|
+
'k-active': this.currentDocumentActive,
|
|
114
|
+
'k-hover': this.currentElementActive
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
117
|
},
|
|
@@ -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/npm/UploadInput.js
CHANGED
|
@@ -6,11 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.UploadInputVue2 = exports.UploadInput = void 0;
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
9
|
+
var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
|
|
9
10
|
var Vue = require("vue");
|
|
10
11
|
var allVue = Vue;
|
|
11
12
|
var gh = allVue.h;
|
|
12
13
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
13
14
|
var ref = allVue.ref;
|
|
15
|
+
var main_1 = require("./messages/main");
|
|
14
16
|
var CHROME_REGEX = /(chrome)[ \/]([\w.]+)/i;
|
|
15
17
|
var SAFARI_REGEX = /(webkit)[ \/]([\w.]+)/i;
|
|
16
18
|
/**
|
|
@@ -20,6 +22,7 @@ var UploadInputVue2 = {
|
|
|
20
22
|
name: 'KendoVueUploadInput',
|
|
21
23
|
props: {
|
|
22
24
|
async: Object,
|
|
25
|
+
id: String,
|
|
23
26
|
multiple: {
|
|
24
27
|
type: Boolean,
|
|
25
28
|
default: undefined
|
|
@@ -31,6 +34,18 @@ var UploadInputVue2 = {
|
|
|
31
34
|
accept: {
|
|
32
35
|
type: String,
|
|
33
36
|
default: undefined
|
|
37
|
+
},
|
|
38
|
+
hasFiles: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
ariaLabelledBy: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: undefined
|
|
45
|
+
},
|
|
46
|
+
ariaDescribedBy: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: undefined
|
|
34
49
|
}
|
|
35
50
|
},
|
|
36
51
|
// @ts-ignore
|
|
@@ -38,6 +53,11 @@ var UploadInputVue2 = {
|
|
|
38
53
|
'mousedown': null,
|
|
39
54
|
'add': null
|
|
40
55
|
},
|
|
56
|
+
inject: {
|
|
57
|
+
kendoLocalizationService: {
|
|
58
|
+
default: null
|
|
59
|
+
}
|
|
60
|
+
},
|
|
41
61
|
mounted: function mounted() {
|
|
42
62
|
this._input = this.v3 ? this.inputRef : this.$refs.input;
|
|
43
63
|
},
|
|
@@ -82,19 +102,32 @@ var UploadInputVue2 = {
|
|
|
82
102
|
multiple = _a.multiple,
|
|
83
103
|
async = _a.async,
|
|
84
104
|
disabled = _a.disabled,
|
|
85
|
-
accept = _a.accept
|
|
105
|
+
accept = _a.accept,
|
|
106
|
+
hasFiles = _a.hasFiles,
|
|
107
|
+
ariaLabelledBy = _a.ariaLabelledBy,
|
|
108
|
+
ariaDescribedBy = _a.ariaDescribedBy;
|
|
109
|
+
var localizationService = (0, kendo_vue_intl_1.provideLocalizationService)(this);
|
|
110
|
+
var message = hasFiles ? main_1.selectTitle : main_1.selectNoFilesTitle;
|
|
111
|
+
var selectMessage = localizationService.toLanguageString(message, main_1.messages[message]);
|
|
112
|
+
var selectLabel = localizationService.toLanguageString(main_1.select, main_1.messages[main_1.select]);
|
|
86
113
|
return h("input", {
|
|
87
114
|
ref: (0, kendo_vue_common_1.setRef)(this, 'input'),
|
|
88
|
-
|
|
115
|
+
id: this.id,
|
|
89
116
|
attrs: this.v3 ? undefined : {
|
|
117
|
+
id: this.id,
|
|
90
118
|
autocomplete: 'off',
|
|
91
119
|
name: async.saveField,
|
|
92
120
|
accept: accept,
|
|
93
121
|
type: 'file',
|
|
94
122
|
tabindex: -1,
|
|
95
123
|
multiple: multiple,
|
|
96
|
-
disabled: disabled
|
|
124
|
+
disabled: disabled,
|
|
125
|
+
title: selectMessage,
|
|
126
|
+
"aria-label": ariaLabelledBy !== undefined ? undefined : selectLabel,
|
|
127
|
+
"aria-labelledby": ariaLabelledBy,
|
|
128
|
+
"aria-describedby": ariaDescribedBy
|
|
97
129
|
},
|
|
130
|
+
autocomplete: 'off',
|
|
98
131
|
name: async.saveField,
|
|
99
132
|
accept: accept,
|
|
100
133
|
type: 'file',
|
|
@@ -106,7 +139,11 @@ var UploadInputVue2 = {
|
|
|
106
139
|
"change": this.onAdd,
|
|
107
140
|
"mousedown": this.onMouseDown
|
|
108
141
|
},
|
|
109
|
-
onMousedown: this.onMouseDown
|
|
142
|
+
onMousedown: this.onMouseDown,
|
|
143
|
+
title: selectMessage,
|
|
144
|
+
"aria-label": ariaLabelledBy !== undefined ? undefined : selectLabel,
|
|
145
|
+
"aria-labelledby": ariaLabelledBy,
|
|
146
|
+
"aria-describedby": ariaDescribedBy
|
|
110
147
|
});
|
|
111
148
|
}
|
|
112
149
|
};
|
|
@@ -12,6 +12,7 @@ var isV3 = allVue.version && allVue.version[0] === '3';
|
|
|
12
12
|
var ref = allVue.ref;
|
|
13
13
|
var inject = allVue.inject;
|
|
14
14
|
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
15
|
+
var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
|
|
15
16
|
var UploadFileStatus_1 = require("./interfaces/UploadFileStatus");
|
|
16
17
|
var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
|
|
17
18
|
var main_1 = require("./messages/main");
|
|
@@ -25,7 +26,8 @@ var UploadListActionButtonVue2 = {
|
|
|
25
26
|
uid: String,
|
|
26
27
|
status: Number,
|
|
27
28
|
async: Object,
|
|
28
|
-
disabled: Boolean
|
|
29
|
+
disabled: Boolean,
|
|
30
|
+
files: Array
|
|
29
31
|
},
|
|
30
32
|
// @ts-ignore
|
|
31
33
|
emits: {
|
|
@@ -55,7 +57,7 @@ var UploadListActionButtonVue2 = {
|
|
|
55
57
|
return localizationService.toLanguageString(main_1.retry, main_1.messages[main_1.retry]);
|
|
56
58
|
},
|
|
57
59
|
buttonClassNames: function buttonClassNames(type) {
|
|
58
|
-
return (0, kendo_vue_common_1.classNames)(
|
|
60
|
+
return (0, kendo_vue_common_1.classNames)(this.actionFocused && type === 'action' || this.retryFocused && type === 'retry' ? 'k-focus' : '');
|
|
59
61
|
},
|
|
60
62
|
onRetryFocus: function onRetryFocus() {
|
|
61
63
|
this.retryFocused = true;
|
|
@@ -107,24 +109,37 @@ var UploadListActionButtonVue2 = {
|
|
|
107
109
|
var _a = this.$props,
|
|
108
110
|
status = _a.status,
|
|
109
111
|
progress = _a.progress;
|
|
110
|
-
var actionButtonClassNames = (0, kendo_vue_common_1.classNames)('k-icon', status === UploadFileStatus_1.UploadFileStatus.Uploading ? 'k-cancel k-i-deny' : '', status !== UploadFileStatus_1.UploadFileStatus.Uploading ? 'k-delete k-i-x' : '');
|
|
111
112
|
var isRetryVisible = status === UploadFileStatus_1.UploadFileStatus.UploadFailed;
|
|
112
113
|
var isProgressVisible = status === UploadFileStatus_1.UploadFileStatus.Uploading;
|
|
113
114
|
var isActionHidden = (status === UploadFileStatus_1.UploadFileStatus.Uploaded || status === UploadFileStatus_1.UploadFileStatus.Initial) && !this.$props.async.removeUrl;
|
|
114
115
|
var localizationService = (0, kendo_vue_intl_1.provideLocalizationService)(this);
|
|
115
116
|
var percent = '%';
|
|
116
|
-
return h("
|
|
117
|
-
"class": 'k-upload-
|
|
117
|
+
return h("div", {
|
|
118
|
+
"class": 'k-upload-actions'
|
|
118
119
|
}, [isProgressVisible ? h("span", {
|
|
119
120
|
"class": 'k-upload-pct'
|
|
120
|
-
}, [progress, percent]) : undefined, isRetryVisible ?
|
|
121
|
+
}, [progress, percent]) : undefined, isRetryVisible ?
|
|
122
|
+
// @ts-ignore
|
|
123
|
+
h(kendo_vue_buttons_1.Button, {
|
|
121
124
|
type: "button",
|
|
122
125
|
attrs: this.v3 ? undefined : {
|
|
123
126
|
type: "button",
|
|
124
|
-
tabindex: -1
|
|
127
|
+
tabindex: -1,
|
|
128
|
+
disabled: this.disabled,
|
|
129
|
+
icon: 'arrow-rotate-cw-small'
|
|
130
|
+
// svgIcon={isProgressVisible ? denyIcon : xIcon}
|
|
131
|
+
,
|
|
132
|
+
iconClass: 'k-retry',
|
|
133
|
+
ariaLabel: this.retryButtonTitle(localizationService),
|
|
134
|
+
title: this.retryButtonTitle(localizationService)
|
|
125
135
|
},
|
|
126
136
|
tabindex: -1,
|
|
137
|
+
disabled: this.disabled,
|
|
127
138
|
"class": this.buttonClassNames('retry'),
|
|
139
|
+
icon: 'arrow-rotate-cw-small',
|
|
140
|
+
iconClass: 'k-retry',
|
|
141
|
+
ariaLabel: this.retryButtonTitle(localizationService),
|
|
142
|
+
title: this.retryButtonTitle(localizationService),
|
|
128
143
|
onFocus: this.onRetryFocus,
|
|
129
144
|
on: this.v3 ? undefined : {
|
|
130
145
|
"focus": this.onRetryFocus,
|
|
@@ -133,21 +148,24 @@ var UploadListActionButtonVue2 = {
|
|
|
133
148
|
},
|
|
134
149
|
onBlur: this.onRetryBlur,
|
|
135
150
|
onClick: this.onRetryClick
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"aria-label": this.retryButtonTitle(localizationService),
|
|
140
|
-
title: this.retryButtonTitle(localizationService)
|
|
141
|
-
},
|
|
142
|
-
title: this.retryButtonTitle(localizationService),
|
|
143
|
-
"class": 'k-icon k-retry k-i-arrow-rotate-cw-small'
|
|
144
|
-
})]) : undefined, !isActionHidden ? h("button", {
|
|
151
|
+
}) : undefined, !isActionHidden ?
|
|
152
|
+
// @ts-ignore
|
|
153
|
+
h(kendo_vue_buttons_1.Button, {
|
|
145
154
|
type: "button",
|
|
146
155
|
attrs: this.v3 ? undefined : {
|
|
147
156
|
type: "button",
|
|
148
|
-
|
|
157
|
+
fillMode: 'flat',
|
|
158
|
+
tabindex: -1,
|
|
159
|
+
disabled: this.disabled,
|
|
160
|
+
icon: isProgressVisible ? 'deny' : 'x'
|
|
161
|
+
// svgIcon={isProgressVisible ? denyIcon : xIcon}
|
|
162
|
+
,
|
|
163
|
+
ariaLabel: this.actionButtonTitle(status, localizationService),
|
|
164
|
+
title: this.actionButtonTitle(status, localizationService)
|
|
149
165
|
},
|
|
166
|
+
fillMode: 'flat',
|
|
150
167
|
tabindex: -1,
|
|
168
|
+
disabled: this.disabled,
|
|
151
169
|
"class": this.buttonClassNames('action'),
|
|
152
170
|
onFocus: this.onActionFocus,
|
|
153
171
|
on: this.v3 ? undefined : {
|
|
@@ -156,16 +174,11 @@ var UploadListActionButtonVue2 = {
|
|
|
156
174
|
"click": this.onActionClick
|
|
157
175
|
},
|
|
158
176
|
onBlur: this.onActionBlur,
|
|
159
|
-
onClick: this.onActionClick
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
title: this.actionButtonTitle(status, localizationService)
|
|
165
|
-
},
|
|
166
|
-
title: this.actionButtonTitle(status, localizationService),
|
|
167
|
-
"class": actionButtonClassNames
|
|
168
|
-
})]) : undefined]);
|
|
177
|
+
onClick: this.onActionClick,
|
|
178
|
+
icon: isProgressVisible ? 'deny' : 'x',
|
|
179
|
+
ariaLabel: this.actionButtonTitle(status, localizationService),
|
|
180
|
+
title: this.actionButtonTitle(status, localizationService)
|
|
181
|
+
}) : undefined]);
|
|
169
182
|
}
|
|
170
183
|
};
|
|
171
184
|
exports.UploadListActionButtonVue2 = UploadListActionButtonVue2;
|
|
@@ -80,7 +80,15 @@ var UploadListGroupVue2 = {
|
|
|
80
80
|
list = _a.list;
|
|
81
81
|
var firstFile = files[0];
|
|
82
82
|
var isFileSuccess = firstFile.status === UploadFileStatus_1.UploadFileStatus.Uploaded || firstFile.status === UploadFileStatus_1.UploadFileStatus.Initial;
|
|
83
|
-
var
|
|
83
|
+
var validationErrors = utils_1.default.filesHaveValidationErrors(files);
|
|
84
|
+
var actionFailed = firstFile.status === UploadFileStatus_1.UploadFileStatus.UploadFailed || firstFile.status === UploadFileStatus_1.UploadFileStatus.RemoveFailed;
|
|
85
|
+
var liClassName = (0, kendo_vue_common_1.classNames)('k-file', {
|
|
86
|
+
'k-file-invalid': validationErrors,
|
|
87
|
+
'k-file-error': actionFailed,
|
|
88
|
+
'k-file-progress': firstFile.status === UploadFileStatus_1.UploadFileStatus.Uploading,
|
|
89
|
+
'k-file-success': isFileSuccess,
|
|
90
|
+
'k-focus': navigationIndex === index
|
|
91
|
+
});
|
|
84
92
|
var itemComponent;
|
|
85
93
|
var defaultItemRendering = files.length === 1 ?
|
|
86
94
|
// @ts-ignore
|
|
@@ -16,6 +16,8 @@ var utils_1 = require("./utils/utils");
|
|
|
16
16
|
var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
|
|
17
17
|
var main_1 = require("./messages/main");
|
|
18
18
|
var UploadListActionButton_1 = require("./UploadListActionButton");
|
|
19
|
+
var kendo_vue_progressbars_1 = require("@progress/kendo-vue-progressbars");
|
|
20
|
+
var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
19
21
|
/**
|
|
20
22
|
* @hidden
|
|
21
23
|
*/
|
|
@@ -96,7 +98,7 @@ var UploadListMultiItemVue2 = {
|
|
|
96
98
|
return files.map(function (file) {
|
|
97
99
|
return h("span", {
|
|
98
100
|
key: file.name,
|
|
99
|
-
"class": 'k-file-
|
|
101
|
+
"class": 'k-file-info'
|
|
100
102
|
}, [h("span", {
|
|
101
103
|
"class": 'k-file-name',
|
|
102
104
|
title: file.name,
|
|
@@ -104,7 +106,7 @@ var UploadListMultiItemVue2 = {
|
|
|
104
106
|
title: file.name
|
|
105
107
|
}
|
|
106
108
|
}, [file.name]), utils_1.default.fileHasValidationErrors(file) ? h("span", {
|
|
107
|
-
"class": 'k-file-validation-message
|
|
109
|
+
"class": 'k-file-validation-message'
|
|
108
110
|
}, [this.getFileValidationMessage(file)]) : h("span", {
|
|
109
111
|
key: "".concat(file.name, "-size"),
|
|
110
112
|
"class": 'k-file-size'
|
|
@@ -113,29 +115,31 @@ var UploadListMultiItemVue2 = {
|
|
|
113
115
|
};
|
|
114
116
|
return h("div", {
|
|
115
117
|
"class": itemClassName
|
|
116
|
-
}, [h(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
118
|
+
}, [showProgressBar && h(kendo_vue_progressbars_1.ProgressBar, {
|
|
119
|
+
value: progress || 0,
|
|
120
|
+
attrs: this.v3 ? undefined : {
|
|
121
|
+
value: progress || 0,
|
|
122
|
+
labelVisible: false
|
|
123
|
+
},
|
|
124
|
+
labelVisible: false
|
|
125
|
+
}), h("span", {
|
|
126
|
+
"class": 'k-file-icon-wrapper'
|
|
127
|
+
}, [h(kendo_vue_common_1.Icon, {
|
|
128
|
+
name: 'copy',
|
|
129
|
+
attrs: this.v3 ? undefined : {
|
|
130
|
+
name: 'copy',
|
|
131
|
+
icon: kendo_svg_icons_1.copyIcon
|
|
132
|
+
},
|
|
133
|
+
icon: kendo_svg_icons_1.copyIcon,
|
|
134
|
+
"class": 'k-file-icon'
|
|
131
135
|
})]), h("span", {
|
|
132
136
|
"class": "k-multiple-files-wrapper"
|
|
133
137
|
}, [mapFiles.call(this), !isUploadFailed ? progress !== 100 ? h("span", {
|
|
134
|
-
"class": 'k-file-
|
|
138
|
+
"class": 'k-file-summary'
|
|
135
139
|
}, ["".concat(totalMessage, ": ").concat(files.length, " ").concat(filesMessage, ", ").concat(utils_1.default.getTotalFilesSizeMessage(files))]) : h("span", {
|
|
136
|
-
"class": 'k-file-
|
|
140
|
+
"class": 'k-file-summary k-text-success'
|
|
137
141
|
}, ["".concat(files.length, " ").concat(successMessage)]) : h("span", {
|
|
138
|
-
"class": 'k-file-validation-message
|
|
142
|
+
"class": 'k-file-validation-message'
|
|
139
143
|
}, ["".concat(files.length, " ").concat(uploadFailedMessage)])]),
|
|
140
144
|
// @ts-ignore function children
|
|
141
145
|
h(UploadListActionButton_1.UploadListActionButton, {
|
|
@@ -13,9 +13,11 @@ var ref = allVue.ref;
|
|
|
13
13
|
var inject = allVue.inject;
|
|
14
14
|
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
15
15
|
var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
|
|
16
|
+
var kendo_vue_progressbars_1 = require("@progress/kendo-vue-progressbars");
|
|
16
17
|
var main_1 = require("./messages/main");
|
|
17
18
|
var utils_1 = require("./utils/utils");
|
|
18
19
|
var UploadListActionButton_1 = require("./UploadListActionButton");
|
|
20
|
+
var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
19
21
|
/**
|
|
20
22
|
* @hidden
|
|
21
23
|
*/
|
|
@@ -61,7 +63,7 @@ var UploadListSingleItemVue2 = {
|
|
|
61
63
|
}
|
|
62
64
|
return validationMessage;
|
|
63
65
|
},
|
|
64
|
-
|
|
66
|
+
getFileExtensionName: function getFileExtensionName(file) {
|
|
65
67
|
switch (file.extension) {
|
|
66
68
|
case '.png':
|
|
67
69
|
case '.jpg':
|
|
@@ -69,41 +71,86 @@ var UploadListSingleItemVue2 = {
|
|
|
69
71
|
case '.tiff':
|
|
70
72
|
case '.bmp':
|
|
71
73
|
case '.gif':
|
|
72
|
-
return '
|
|
74
|
+
return 'file-image';
|
|
73
75
|
case '.mp3':
|
|
74
76
|
case '.mp4':
|
|
75
77
|
case '.wav':
|
|
76
|
-
return '
|
|
78
|
+
return 'file-audio';
|
|
77
79
|
case '.mkv':
|
|
78
80
|
case '.webm':
|
|
79
81
|
case '.flv':
|
|
80
82
|
case '.gifv':
|
|
81
83
|
case '.avi':
|
|
82
84
|
case '.wmv':
|
|
83
|
-
return '
|
|
85
|
+
return 'file-video';
|
|
84
86
|
case '.txt':
|
|
85
|
-
return '
|
|
87
|
+
return 'file-txt';
|
|
86
88
|
case '.pdf':
|
|
87
|
-
return '
|
|
89
|
+
return 'file-pdf';
|
|
88
90
|
case '.ppt':
|
|
89
91
|
case '.pptx':
|
|
90
|
-
return '
|
|
92
|
+
return 'file-presentation';
|
|
91
93
|
case '.csv':
|
|
92
94
|
case '.xls':
|
|
93
95
|
case '.xlsx':
|
|
94
|
-
return '
|
|
96
|
+
return 'file-data';
|
|
95
97
|
case '.html':
|
|
96
98
|
case '.css':
|
|
97
99
|
case '.js':
|
|
98
100
|
case '.ts':
|
|
99
|
-
return '
|
|
101
|
+
return 'file-programming';
|
|
100
102
|
case '.exe':
|
|
101
|
-
return '
|
|
103
|
+
return 'file-config';
|
|
102
104
|
case '.zip':
|
|
103
105
|
case '.rar':
|
|
104
|
-
return '
|
|
106
|
+
return 'file-zip';
|
|
105
107
|
default:
|
|
106
|
-
return '
|
|
108
|
+
return 'file';
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
getFileExtensionSVG: function getFileExtensionSVG(file) {
|
|
112
|
+
switch (file.extension) {
|
|
113
|
+
case '.png':
|
|
114
|
+
case '.jpg':
|
|
115
|
+
case '.jpeg':
|
|
116
|
+
case '.tiff':
|
|
117
|
+
case '.bmp':
|
|
118
|
+
case '.gif':
|
|
119
|
+
return kendo_svg_icons_1.fileImageIcon;
|
|
120
|
+
case '.mp3':
|
|
121
|
+
case '.mp4':
|
|
122
|
+
case '.wav':
|
|
123
|
+
return kendo_svg_icons_1.fileAudioIcon;
|
|
124
|
+
case '.mkv':
|
|
125
|
+
case '.webm':
|
|
126
|
+
case '.flv':
|
|
127
|
+
case '.gifv':
|
|
128
|
+
case '.avi':
|
|
129
|
+
case '.wmv':
|
|
130
|
+
return kendo_svg_icons_1.fileVideoIcon;
|
|
131
|
+
case '.txt':
|
|
132
|
+
return kendo_svg_icons_1.fileTxtIcon;
|
|
133
|
+
case '.pdf':
|
|
134
|
+
return kendo_svg_icons_1.filePdfIcon;
|
|
135
|
+
case '.ppt':
|
|
136
|
+
case '.pptx':
|
|
137
|
+
return kendo_svg_icons_1.filePresentationIcon;
|
|
138
|
+
case '.csv':
|
|
139
|
+
case '.xls':
|
|
140
|
+
case '.xlsx':
|
|
141
|
+
return kendo_svg_icons_1.fileDataIcon;
|
|
142
|
+
case '.html':
|
|
143
|
+
case '.css':
|
|
144
|
+
case '.js':
|
|
145
|
+
case '.ts':
|
|
146
|
+
return kendo_svg_icons_1.fileProgrammingIcon;
|
|
147
|
+
case '.exe':
|
|
148
|
+
return kendo_svg_icons_1.fileConfigIcon;
|
|
149
|
+
case '.zip':
|
|
150
|
+
case '.rar':
|
|
151
|
+
return kendo_svg_icons_1.fileZipIcon;
|
|
152
|
+
default:
|
|
153
|
+
return kendo_svg_icons_1.fileIcon;
|
|
107
154
|
}
|
|
108
155
|
}
|
|
109
156
|
},
|
|
@@ -131,23 +178,23 @@ var UploadListSingleItemVue2 = {
|
|
|
131
178
|
var showProgressBar = !isUploadValidationFailed && !isUploaded && !isUploadFailed;
|
|
132
179
|
var renderValidationError = function renderValidationError(currentFile, isCurrentUploadFailed) {
|
|
133
180
|
return h("span", {
|
|
134
|
-
"class": 'k-file-
|
|
181
|
+
"class": 'k-file-info',
|
|
135
182
|
key: '2'
|
|
136
183
|
}, [h("span", {
|
|
137
|
-
"class": 'k-file-name
|
|
184
|
+
"class": 'k-file-name',
|
|
138
185
|
title: currentFile.name,
|
|
139
186
|
attrs: this.v3 ? undefined : {
|
|
140
187
|
title: currentFile.name
|
|
141
188
|
}
|
|
142
189
|
}, [currentFile.name]), h("span", {
|
|
143
|
-
"class": 'k-file-validation-message
|
|
190
|
+
"class": 'k-file-validation-message'
|
|
144
191
|
}, [this.getFileValidationMessage(currentFile, isCurrentUploadFailed)])]);
|
|
145
192
|
};
|
|
146
193
|
var renderFileDetails = function renderFileDetails(currentFile) {
|
|
147
194
|
var localizationService = (0, kendo_vue_intl_1.provideLocalizationService)(this);
|
|
148
195
|
var successMessage = localizationService.toLanguageString(main_1.statusUploaded, main_1.messages[main_1.statusUploaded]);
|
|
149
196
|
return h("span", {
|
|
150
|
-
"class": 'k-file-
|
|
197
|
+
"class": 'k-file-info',
|
|
151
198
|
key: '2'
|
|
152
199
|
}, [h("span", {
|
|
153
200
|
"class": 'k-file-name',
|
|
@@ -158,27 +205,29 @@ var UploadListSingleItemVue2 = {
|
|
|
158
205
|
}, [currentFile.name]), currentFile.progress !== 100 ? h("span", {
|
|
159
206
|
"class": 'k-file-size'
|
|
160
207
|
}, [utils_1.default.getTotalFilesSizeMessage([currentFile])]) : h("span", {
|
|
161
|
-
"class": 'k-file-validation-message
|
|
208
|
+
"class": 'k-file-validation-message'
|
|
162
209
|
}, [successMessage])]);
|
|
163
210
|
};
|
|
164
211
|
return h("div", {
|
|
165
212
|
"class": itemClassName
|
|
166
|
-
}, [h(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
width: (file.progress || 0) + '%'
|
|
176
|
-
}
|
|
177
|
-
})]), h("span", {
|
|
178
|
-
"class": 'k-file-group-wrapper',
|
|
213
|
+
}, [showProgressBar && h(kendo_vue_progressbars_1.ProgressBar, {
|
|
214
|
+
value: file.progress || 0,
|
|
215
|
+
attrs: this.v3 ? undefined : {
|
|
216
|
+
value: file.progress || 0,
|
|
217
|
+
labelVisible: false
|
|
218
|
+
},
|
|
219
|
+
labelVisible: false
|
|
220
|
+
}), h("span", {
|
|
221
|
+
"class": 'k-file-icon-wrapper',
|
|
179
222
|
key: '1'
|
|
180
|
-
}, [h(
|
|
181
|
-
|
|
223
|
+
}, [h(kendo_vue_common_1.Icon, {
|
|
224
|
+
name: this.getFileExtensionName(file),
|
|
225
|
+
attrs: this.v3 ? undefined : {
|
|
226
|
+
name: this.getFileExtensionName(file),
|
|
227
|
+
icon: this.getFileExtensionSVG(file)
|
|
228
|
+
},
|
|
229
|
+
icon: this.getFileExtensionSVG(file),
|
|
230
|
+
"class": 'k-file-icon'
|
|
182
231
|
}), h("span", {
|
|
183
232
|
"class": 'k-file-state'
|
|
184
233
|
})]), isUploadValidationFailed || isUploadFailed ? renderValidationError.call(this, file, isUploadFailed) : renderFileDetails.call(this, file),
|