@progress/kendo-vue-upload 3.5.0 → 3.5.1-dev.202208100944

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/cdn/js/kendo-vue-upload.js +1 -1
  2. package/dist/es/UploadListMultiItem.js +5 -5
  3. package/dist/es/UploadListSingleItem.js +1 -1
  4. package/dist/es/interfaces/BaseUploadEvent.js +1 -0
  5. package/dist/es/interfaces/FileGroup.js +1 -0
  6. package/dist/es/interfaces/UploadActionsLayout.js +1 -0
  7. package/dist/es/interfaces/UploadAdditionalData.js +1 -0
  8. package/dist/es/interfaces/UploadAsyncProps.js +1 -0
  9. package/dist/es/interfaces/UploadFileInfo.js +1 -0
  10. package/dist/es/interfaces/UploadFileRestrictions.js +1 -0
  11. package/dist/es/interfaces/UploadHttpHeaders.js +1 -0
  12. package/dist/es/interfaces/UploadListItemProps.js +1 -0
  13. package/dist/es/interfaces/UploadOnAddEvent.js +1 -0
  14. package/dist/es/interfaces/UploadOnBeforeRemoveEvent.js +1 -0
  15. package/dist/es/interfaces/UploadOnBeforeUploadEvent.js +1 -0
  16. package/dist/es/interfaces/UploadOnCancelEvent.js +1 -0
  17. package/dist/es/interfaces/UploadOnProgressEvent.js +1 -0
  18. package/dist/es/interfaces/UploadOnRemoveEvent.js +1 -0
  19. package/dist/es/interfaces/UploadOnStatusChangeEvent.js +1 -0
  20. package/dist/es/interfaces/UploadProps.js +1 -0
  21. package/dist/es/interfaces/UploadResponse.js +1 -0
  22. package/dist/es/package-metadata.js +1 -1
  23. package/dist/es/utils/connectionUtils.d.ts +3 -3
  24. package/dist/es/utils/stateUtils.d.ts +3 -3
  25. package/dist/es/utils/utils.d.ts +3 -3
  26. package/dist/es/utils/validationUtils.d.ts +3 -3
  27. package/dist/esm/ExternalDropZone.d.ts +121 -0
  28. package/dist/esm/ExternalDropZone.js +169 -0
  29. package/dist/esm/Upload.d.ts +50 -0
  30. package/dist/esm/Upload.js +787 -0
  31. package/dist/esm/UploadActionButtons.d.ts +59 -0
  32. package/dist/esm/UploadActionButtons.js +165 -0
  33. package/dist/esm/UploadAddButton.d.ts +67 -0
  34. package/dist/esm/UploadAddButton.js +165 -0
  35. package/dist/esm/UploadDropZone.d.ts +61 -0
  36. package/dist/esm/UploadDropZone.js +288 -0
  37. package/dist/esm/UploadInput.d.ts +56 -0
  38. package/dist/esm/UploadInput.js +116 -0
  39. package/dist/esm/UploadList.d.ts +58 -0
  40. package/dist/esm/UploadList.js +103 -0
  41. package/dist/esm/UploadListActionButton.d.ts +56 -0
  42. package/dist/esm/UploadListActionButton.js +176 -0
  43. package/dist/esm/UploadListGroup.d.ts +56 -0
  44. package/dist/esm/UploadListGroup.js +150 -0
  45. package/dist/esm/UploadListMultiItem.d.ts +44 -0
  46. package/dist/esm/UploadListMultiItem.js +172 -0
  47. package/dist/esm/UploadListSingleItem.d.ts +44 -0
  48. package/dist/esm/UploadListSingleItem.js +228 -0
  49. package/dist/esm/UploadNavigation.d.ts +46 -0
  50. package/dist/esm/UploadNavigation.js +348 -0
  51. package/dist/esm/UploadStatus.d.ts +53 -0
  52. package/dist/esm/UploadStatus.js +63 -0
  53. package/dist/esm/UploadUI.d.ts +81 -0
  54. package/dist/esm/UploadUI.js +265 -0
  55. package/dist/esm/additionalTypes.ts +21 -0
  56. package/dist/esm/interfaces/BaseUploadEvent.d.ts +9 -0
  57. package/dist/esm/interfaces/BaseUploadEvent.js +1 -0
  58. package/dist/esm/interfaces/FileGroup.d.ts +7 -0
  59. package/dist/esm/interfaces/FileGroup.js +1 -0
  60. package/dist/esm/interfaces/UploadActionsLayout.d.ts +4 -0
  61. package/dist/esm/interfaces/UploadActionsLayout.js +1 -0
  62. package/dist/esm/interfaces/UploadAdditionalData.d.ts +6 -0
  63. package/dist/esm/interfaces/UploadAdditionalData.js +1 -0
  64. package/dist/esm/interfaces/UploadAsyncProps.d.ts +82 -0
  65. package/dist/esm/interfaces/UploadAsyncProps.js +1 -0
  66. package/dist/esm/interfaces/UploadFileInfo.d.ts +41 -0
  67. package/dist/esm/interfaces/UploadFileInfo.js +1 -0
  68. package/dist/esm/interfaces/UploadFileRestrictions.d.ts +19 -0
  69. package/dist/esm/interfaces/UploadFileRestrictions.js +1 -0
  70. package/dist/esm/interfaces/UploadFileStatus.d.ts +33 -0
  71. package/dist/esm/interfaces/UploadFileStatus.js +34 -0
  72. package/dist/esm/interfaces/UploadHttpHeaders.d.ts +6 -0
  73. package/dist/esm/interfaces/UploadHttpHeaders.js +1 -0
  74. package/dist/esm/interfaces/UploadListItemProps.d.ts +19 -0
  75. package/dist/esm/interfaces/UploadListItemProps.js +1 -0
  76. package/dist/esm/interfaces/UploadOnAddEvent.d.ts +15 -0
  77. package/dist/esm/interfaces/UploadOnAddEvent.js +1 -0
  78. package/dist/esm/interfaces/UploadOnBeforeRemoveEvent.d.ts +21 -0
  79. package/dist/esm/interfaces/UploadOnBeforeRemoveEvent.js +1 -0
  80. package/dist/esm/interfaces/UploadOnBeforeUploadEvent.d.ts +21 -0
  81. package/dist/esm/interfaces/UploadOnBeforeUploadEvent.js +1 -0
  82. package/dist/esm/interfaces/UploadOnCancelEvent.d.ts +10 -0
  83. package/dist/esm/interfaces/UploadOnCancelEvent.js +1 -0
  84. package/dist/esm/interfaces/UploadOnProgressEvent.d.ts +15 -0
  85. package/dist/esm/interfaces/UploadOnProgressEvent.js +1 -0
  86. package/dist/esm/interfaces/UploadOnRemoveEvent.d.ts +20 -0
  87. package/dist/esm/interfaces/UploadOnRemoveEvent.js +1 -0
  88. package/dist/esm/interfaces/UploadOnStatusChangeEvent.d.ts +20 -0
  89. package/dist/esm/interfaces/UploadOnStatusChangeEvent.js +1 -0
  90. package/dist/esm/interfaces/UploadProps.d.ts +114 -0
  91. package/dist/esm/interfaces/UploadProps.js +1 -0
  92. package/dist/esm/interfaces/UploadResponse.d.ts +25 -0
  93. package/dist/esm/interfaces/UploadResponse.js +1 -0
  94. package/dist/esm/main.d.ts +25 -0
  95. package/dist/esm/main.js +9 -0
  96. package/dist/esm/messages/index.d.ts +100 -0
  97. package/dist/esm/messages/index.js +101 -0
  98. package/dist/esm/package-metadata.d.ts +5 -0
  99. package/dist/esm/package-metadata.js +11 -0
  100. package/dist/esm/package.json +3 -0
  101. package/dist/esm/utils/connectionUtils.d.ts +17 -0
  102. package/dist/esm/utils/connectionUtils.js +78 -0
  103. package/dist/esm/utils/stateUtils.d.ts +26 -0
  104. package/dist/esm/utils/stateUtils.js +83 -0
  105. package/dist/esm/utils/utils.d.ts +17 -0
  106. package/dist/esm/utils/utils.js +128 -0
  107. package/dist/esm/utils/validationUtils.d.ts +7 -0
  108. package/dist/esm/utils/validationUtils.js +50 -0
  109. package/dist/npm/ExternalDropZone.js +6 -6
  110. package/dist/npm/Upload.js +5 -5
  111. package/dist/npm/UploadActionButtons.js +4 -4
  112. package/dist/npm/UploadAddButton.js +3 -3
  113. package/dist/npm/UploadDropZone.js +2 -2
  114. package/dist/npm/UploadInput.js +1 -1
  115. package/dist/npm/UploadList.js +1 -1
  116. package/dist/npm/UploadListActionButton.js +3 -3
  117. package/dist/npm/UploadListGroup.js +2 -2
  118. package/dist/npm/UploadListMultiItem.js +8 -8
  119. package/dist/npm/UploadListSingleItem.js +4 -4
  120. package/dist/npm/UploadStatus.js +3 -3
  121. package/dist/npm/UploadUI.js +2 -2
  122. package/dist/npm/package-metadata.js +1 -1
  123. package/dist/npm/utils/connectionUtils.d.ts +3 -3
  124. package/dist/npm/utils/stateUtils.d.ts +3 -3
  125. package/dist/npm/utils/utils.d.ts +3 -3
  126. package/dist/npm/utils/utils.js +2 -2
  127. package/dist/npm/utils/validationUtils.d.ts +3 -3
  128. package/package.json +4 -4
@@ -0,0 +1,288 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ var isV3 = allVue.version && allVue.version[0] === '3';
6
+ var ref = allVue.ref;
7
+ var inject = allVue.inject;
8
+ import { classNames } from '@progress/kendo-vue-common';
9
+ import { UploadAddButton } from './UploadAddButton.js';
10
+ import { provideLocalizationService } from '@progress/kendo-vue-intl';
11
+ import { messages, dropFilesHere } from './messages.js';
12
+ import utils from './utils/utils.js';
13
+ import { UploadStatus } from './UploadStatus.js';
14
+ /**
15
+ * @hidden
16
+ */
17
+
18
+ var TIME_TO_CHECK_DRAG = 100;
19
+ /**
20
+ * @hidden
21
+ */
22
+
23
+ var UploadDropZoneVue2 = {
24
+ name: 'KendoVueUploadDropZone',
25
+ props: {
26
+ addButtonIndex: Number,
27
+ async: Object,
28
+ multiple: {
29
+ type: Boolean,
30
+ default: true
31
+ },
32
+ disabled: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ showFileList: Boolean,
37
+ showActionButtons: Boolean,
38
+ actionsLayout: {
39
+ type: String,
40
+ default: function _default() {
41
+ return 'end';
42
+ }
43
+ },
44
+ tabIndex: Number,
45
+ accept: String,
46
+ groupedFiles: {
47
+ type: Object,
48
+ default: function _default() {
49
+ return {};
50
+ }
51
+ },
52
+ navigationIndex: Number,
53
+ notFocusedIndex: Number,
54
+ list: [String, Function, Object],
55
+ id: String,
56
+ ariaLabelledBy: String,
57
+ ariaDescribedBy: String,
58
+ fileGroup: Object
59
+ },
60
+ // @ts-ignore
61
+ emits: {
62
+ 'add': null,
63
+ 'click': null
64
+ },
65
+ inject: {
66
+ kendoLocalizationService: {
67
+ default: null
68
+ }
69
+ },
70
+ data: function data() {
71
+ return {
72
+ currentDocumentActive: false,
73
+ currentElementActive: false
74
+ };
75
+ },
76
+ created: function created() {
77
+ this.currentElementActive = false;
78
+ },
79
+ mounted: function mounted() {
80
+ this.uploadAddButton = this.v3 ? this.uploadAddButtonRef : this.$refs.uploadAddButton;
81
+ document.addEventListener('dragenter', this.onDocumentDragEnter);
82
+ document.addEventListener('dragover', this.onDocumentDragOver);
83
+ },
84
+ destroyed: !!isV3 ? undefined : function () {
85
+ document.removeEventListener('dragenter', this.onDocumentDragEnter);
86
+ document.removeEventListener('dragover', this.onDocumentDragOver);
87
+ },
88
+ // @ts-ignore
89
+ unmounted: function unmounted() {
90
+ document.removeEventListener('dragenter', this.onDocumentDragEnter);
91
+ document.removeEventListener('dragover', this.onDocumentDragOver);
92
+ },
93
+ // @ts-ignore
94
+ setup: !isV3 ? undefined : function () {
95
+ var v3 = !!isV3;
96
+ var uploadAddButtonRef = ref(null);
97
+ var kendoLocalizationService = inject('kendoLocalizationService', {});
98
+ return {
99
+ v3: v3,
100
+ uploadAddButtonRef: uploadAddButtonRef,
101
+ kendoLocalizationService: kendoLocalizationService
102
+ };
103
+ },
104
+ computed: {
105
+ dropZoneClasses: function dropZoneClasses() {
106
+ return {
107
+ 'k-dropzone': true,
108
+ 'k-dropzone-active': this.currentDocumentActive,
109
+ 'k-dropzone-hovered': this.currentElementActive
110
+ };
111
+ }
112
+ },
113
+ methods: {
114
+ actionElement: function actionElement() {
115
+ if (this.uploadAddButton) {
116
+ return this.uploadAddButton.uploadInput;
117
+ }
118
+ },
119
+ focus: function focus() {
120
+ if (this.uploadAddButton) {
121
+ return this.uploadAddButton.focus();
122
+ }
123
+ },
124
+ onDocumentDragEnter: function onDocumentDragEnter() {
125
+ var _this = this;
126
+
127
+ if (!this.currentDocumentActive) {
128
+ this.currentDocumentActive = true;
129
+
130
+ var documentInterval = function documentInterval() {
131
+ if (_this.isDragOver(_this._lastDocumentDragOver)) {
132
+ _this.currentDocumentActive = false;
133
+ clearInterval(_this._documentInterval);
134
+ _this._documentInterval = null;
135
+ _this._lastDocumentDragOver = null;
136
+ }
137
+ };
138
+
139
+ this._documentInterval = setInterval(documentInterval, TIME_TO_CHECK_DRAG);
140
+ }
141
+ },
142
+ onDocumentDragOver: function onDocumentDragOver() {
143
+ this._lastDocumentDragOver = new Date();
144
+ },
145
+ onElementDragEnter: function onElementDragEnter() {
146
+ var _this = this;
147
+
148
+ if (!this.currentElementActive) {
149
+ this.currentElementActive = true;
150
+
151
+ var elementInterval = function elementInterval() {
152
+ if (_this.isDragOver(_this._lastElementDragOver)) {
153
+ _this.currentElementActive = false;
154
+ clearInterval(_this._elementInterval);
155
+ _this._elementInterval = null;
156
+ _this._lastElementDragOver = null;
157
+ }
158
+ };
159
+
160
+ this._elementInterval = setInterval(elementInterval, TIME_TO_CHECK_DRAG);
161
+ }
162
+ },
163
+ onElementDragOver: function onElementDragOver(event) {
164
+ event.preventDefault();
165
+ this._lastElementDragOver = new Date();
166
+ },
167
+ onDrop: function onDrop(event) {
168
+ event.preventDefault();
169
+ var droppedFiles = event.dataTransfer.files;
170
+
171
+ if (droppedFiles.length > 0 && !this.$props.disabled) {
172
+ this.$emit('add', droppedFiles);
173
+ }
174
+ },
175
+ isDragOver: function isDragOver(prevDate) {
176
+ return new Date().getTime() - (prevDate || new Date()).getTime() > TIME_TO_CHECK_DRAG;
177
+ },
178
+ onClick: function onClick(eventIndex) {
179
+ this.$emit('click', eventIndex);
180
+ },
181
+ onAdd: function onAdd(files) {
182
+ this.$emit('add', files);
183
+ }
184
+ },
185
+ render: function render(createElement) {
186
+ var h = gh || createElement;
187
+ var _a = this.$props,
188
+ multiple = _a.multiple,
189
+ disabled = _a.disabled,
190
+ tabIndex = _a.tabIndex,
191
+ fileGroup = _a.fileGroup,
192
+ accept = _a.accept,
193
+ showFileList = _a.showFileList,
194
+ groupedFiles = _a.groupedFiles,
195
+ navigationIndex = _a.navigationIndex,
196
+ showActionButtons = _a.showActionButtons,
197
+ actionsLayout = _a.actionsLayout,
198
+ notFocusedIndex = _a.notFocusedIndex,
199
+ list = _a.list,
200
+ id = _a.id,
201
+ ariaLabelledBy = _a.ariaLabelledBy,
202
+ ariaDescribedBy = _a.ariaDescribedBy;
203
+ var localizationService = provideLocalizationService(this);
204
+ var dropFilesMessage = localizationService.toLanguageString(dropFilesHere, messages[dropFilesHere]);
205
+
206
+ var _b = utils.getFileStatus(fileGroup),
207
+ isUploading = _b[0],
208
+ isUploaded = _b[1],
209
+ isUploadFailed = _b[2],
210
+ isUploadValidationFailed = _b[3];
211
+
212
+ var dropZoneClassName = classNames('k-dropzone-hint', {// Unsure about that, since it hides the "Drop Files Message" when we remove all uploaded components.
213
+ // 'k-hidden': this.isDragged && !this.elementActive
214
+ });
215
+
216
+ var addButtonComponent = function addButtonComponent() {
217
+ var _this = this;
218
+
219
+ return (// @ts-ignore function children
220
+ h(UploadAddButton, {
221
+ id: id,
222
+ attrs: this.v3 ? undefined : {
223
+ id: id,
224
+ ariaLabelledBy: ariaLabelledBy,
225
+ ariaDescribedBy: ariaDescribedBy,
226
+ accept: accept,
227
+ async: this.async,
228
+ addButtonIndex: this.addButtonIndex,
229
+ navigationIndex: navigationIndex,
230
+ notFocusedIndex: notFocusedIndex,
231
+ tabIndex: tabIndex,
232
+ multiple: multiple,
233
+ disabled: disabled
234
+ },
235
+ ariaLabelledBy: ariaLabelledBy,
236
+ ariaDescribedBy: ariaDescribedBy,
237
+ ref: this.v3 ? function (el) {
238
+ _this.uploadAddButtonRef = el;
239
+ } : 'uploadAddButton',
240
+ accept: accept,
241
+ async: this.async,
242
+ addButtonIndex: this.addButtonIndex,
243
+ navigationIndex: navigationIndex,
244
+ notFocusedIndex: notFocusedIndex,
245
+ tabIndex: tabIndex,
246
+ multiple: multiple,
247
+ disabled: disabled,
248
+ onClick: this.onClick,
249
+ on: this.v3 ? undefined : {
250
+ "click": this.onClick,
251
+ "add": this.onAdd
252
+ },
253
+ onAdd: this.onAdd
254
+ })
255
+ );
256
+ };
257
+
258
+ return h("div", {
259
+ "class": this.dropZoneClasses,
260
+ onDrop: this.onDrop,
261
+ on: this.v3 ? undefined : {
262
+ "drop": this.onDrop,
263
+ "dragenter": this.onElementDragEnter,
264
+ "dragover": this.onElementDragOver
265
+ },
266
+ onDragenter: this.onElementDragEnter,
267
+ onDragover: this.onElementDragOver
268
+ }, [addButtonComponent.call(this), isUploading || isUploaded || isUploadFailed || isUploadValidationFailed ? // @ts-ignore function children
269
+ h(UploadStatus, {
270
+ isUploading: isUploading,
271
+ attrs: this.v3 ? undefined : {
272
+ isUploading: isUploading,
273
+ isUploaded: isUploaded,
274
+ isUploadFailed: isUploadFailed
275
+ },
276
+ isUploaded: isUploaded,
277
+ isUploadFailed: isUploadFailed
278
+ }) : h("div", {
279
+ "class": dropZoneClassName
280
+ }, [dropFilesMessage])]);
281
+ }
282
+ };
283
+ /**
284
+ * @hidden
285
+ */
286
+
287
+ var UploadDropZone = UploadDropZoneVue2;
288
+ export { UploadDropZone, UploadDropZoneVue2 };
@@ -0,0 +1,56 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from './additionalTypes';
2
+ declare type DefaultData<V> = object | ((this: V) => UploadInputData);
3
+ declare type DefaultMethods<V> = {
4
+ [key: string]: (this: V, ...args: any[]) => any;
5
+ };
6
+ import { UploadAsyncProps } from './interfaces/UploadAsyncProps';
7
+ /**
8
+ * @hidden
9
+ */
10
+ export interface UploadInputProps {
11
+ async: UploadAsyncProps;
12
+ multiple?: boolean;
13
+ disabled?: boolean;
14
+ accept?: string;
15
+ }
16
+ /**
17
+ * @hidden
18
+ */
19
+ export interface UploadInputMethods {
20
+ [key: string]: any;
21
+ focus: () => any;
22
+ onClick: () => any;
23
+ actionElement: () => any;
24
+ }
25
+ /**
26
+ * @hidden
27
+ */
28
+ export interface UploadInputState {
29
+ v3: boolean;
30
+ _input: HTMLInputElement | null;
31
+ }
32
+ /**
33
+ * @hidden
34
+ */
35
+ export interface UploadInputData {
36
+ }
37
+ /**
38
+ * @hidden
39
+ */
40
+ export interface UploadInputComputed {
41
+ [key: string]: any;
42
+ }
43
+ /**
44
+ * @hidden
45
+ */
46
+ export interface UploadInputAll extends UploadInputMethods, UploadInputState, UploadInputData, UploadInputComputed, Vue2type {
47
+ }
48
+ /**
49
+ * @hidden
50
+ */
51
+ declare let UploadInputVue2: ComponentOptions<Vue2type, DefaultData<UploadInputData>, DefaultMethods<UploadInputAll>, UploadInputComputed, RecordPropsDefinition<UploadInputProps>>;
52
+ /**
53
+ * @hidden
54
+ */
55
+ declare const UploadInput: DefineComponent<UploadInputProps, any, UploadInputData, UploadInputComputed, UploadInputMethods, {}, {}, {}, string, UploadInputProps, UploadInputProps, {}>;
56
+ export { UploadInput, UploadInputVue2 };
@@ -0,0 +1,116 @@
1
+ // @ts-ignore
2
+ import { setRef } from '@progress/kendo-vue-common';
3
+ import * as Vue from 'vue';
4
+ var allVue = Vue;
5
+ var gh = allVue.h;
6
+ var isV3 = allVue.version && allVue.version[0] === '3';
7
+ var ref = allVue.ref;
8
+ var CHROME_REGEX = /(chrome)[ \/]([\w.]+)/i;
9
+ var SAFARI_REGEX = /(webkit)[ \/]([\w.]+)/i;
10
+ /**
11
+ * @hidden
12
+ */
13
+
14
+ var UploadInputVue2 = {
15
+ name: 'KendoVueUploadInput',
16
+ props: {
17
+ async: Object,
18
+ multiple: {
19
+ type: Boolean,
20
+ default: undefined
21
+ },
22
+ disabled: {
23
+ type: Boolean,
24
+ default: undefined
25
+ },
26
+ accept: {
27
+ type: String,
28
+ default: undefined
29
+ }
30
+ },
31
+ // @ts-ignore
32
+ emits: {
33
+ 'mousedown': null,
34
+ 'add': null
35
+ },
36
+ mounted: function mounted() {
37
+ this._input = this.v3 ? this.inputRef : this.$refs.input;
38
+ },
39
+ methods: {
40
+ onMouseDown: function onMouseDown(e) {
41
+ this.$emit('mousedown', e);
42
+ },
43
+ onAdd: function onAdd() {
44
+ var ua = navigator.userAgent;
45
+ var input = this._input;
46
+
47
+ if (input) {
48
+ if (input.files) {
49
+ this.$emit('add', input.files);
50
+ }
51
+ /*
52
+ Chrome and Internet Explorer do not trigger a `change` event
53
+ when a file with the same name is selected a number of consecutive times.
54
+ As a workaround, clear the input value after handling the file.
55
+ */
56
+
57
+
58
+ if (!(!ua.match(CHROME_REGEX) && ua.match(SAFARI_REGEX))) {
59
+ input.type = '';
60
+ input.type = 'file';
61
+ }
62
+ }
63
+ },
64
+ actionElement: function actionElement() {
65
+ return this._input;
66
+ }
67
+ },
68
+ // @ts-ignore
69
+ setup: !isV3 ? undefined : function () {
70
+ var v3 = !!isV3;
71
+ var inputRef = ref(null);
72
+ return {
73
+ v3: v3,
74
+ inputRef: inputRef
75
+ };
76
+ },
77
+ render: function render(createElement) {
78
+ var h = gh || createElement;
79
+ var _a = this.$props,
80
+ multiple = _a.multiple,
81
+ async = _a.async,
82
+ disabled = _a.disabled,
83
+ accept = _a.accept;
84
+ return h("input", {
85
+ ref: setRef(this, 'input'),
86
+ autocomplete: 'off',
87
+ attrs: this.v3 ? undefined : {
88
+ autocomplete: 'off',
89
+ name: async.saveField,
90
+ accept: accept,
91
+ type: 'file',
92
+ tabindex: -1,
93
+ multiple: multiple,
94
+ disabled: disabled
95
+ },
96
+ name: async.saveField,
97
+ accept: accept,
98
+ type: 'file',
99
+ tabindex: -1,
100
+ multiple: multiple,
101
+ disabled: disabled,
102
+ onChange: this.onAdd,
103
+ on: this.v3 ? undefined : {
104
+ "change": this.onAdd,
105
+ "mousedown": this.onMouseDown
106
+ },
107
+ onMousedown: this.onMouseDown
108
+ });
109
+ }
110
+ };
111
+ /**
112
+ * @hidden
113
+ */
114
+
115
+ var UploadInput = UploadInputVue2;
116
+ export { UploadInput, UploadInputVue2 };
@@ -0,0 +1,58 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from './additionalTypes';
2
+ declare type DefaultData<V> = object | ((this: V) => UploadListData);
3
+ declare type DefaultMethods<V> = {
4
+ [key: string]: (this: V, ...args: any[]) => any;
5
+ };
6
+ import { GroupedFiles } from './interfaces/FileGroup';
7
+ import { UploadAsyncProps } from './interfaces/UploadAsyncProps';
8
+ /**
9
+ * @hidden
10
+ */
11
+ export interface UploadListProps {
12
+ groupedFiles: GroupedFiles;
13
+ async: UploadAsyncProps;
14
+ disabled: boolean;
15
+ navigationIndex?: number;
16
+ list?: any;
17
+ }
18
+ /**
19
+ * @hidden
20
+ */
21
+ export interface UploadListMethods {
22
+ [key: string]: any;
23
+ onRetry: (uid: string) => void;
24
+ onRemove: (uid: string) => void;
25
+ onCancel: (uid: string) => void;
26
+ }
27
+ /**
28
+ * @hidden
29
+ */
30
+ export interface UploadListState {
31
+ v3: boolean;
32
+ _input: HTMLInputElement | null;
33
+ }
34
+ /**
35
+ * @hidden
36
+ */
37
+ export interface UploadListData {
38
+ }
39
+ /**
40
+ * @hidden
41
+ */
42
+ export interface UploadListComputed {
43
+ [key: string]: any;
44
+ }
45
+ /**
46
+ * @hidden
47
+ */
48
+ export interface UploadListAll extends UploadListMethods, UploadListState, UploadListData, UploadListComputed, Vue2type {
49
+ }
50
+ /**
51
+ * @hidden
52
+ */
53
+ declare let UploadListVue2: ComponentOptions<Vue2type, DefaultData<UploadListData>, DefaultMethods<UploadListAll>, UploadListComputed, RecordPropsDefinition<UploadListProps>>;
54
+ /**
55
+ * @hidden
56
+ */
57
+ declare const UploadList: DefineComponent<UploadListProps, any, UploadListData, UploadListComputed, UploadListMethods, {}, {}, {}, string, UploadListProps, UploadListProps, {}>;
58
+ export { UploadList, UploadListVue2 };
@@ -0,0 +1,103 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ var isV3 = allVue.version && allVue.version[0] === '3';
6
+ var ref = allVue.ref;
7
+ import { classNames } from '@progress/kendo-vue-common';
8
+ import { UploadListGroup } from './UploadListGroup.js';
9
+ /**
10
+ * @hidden
11
+ */
12
+
13
+ var UploadListVue2 = {
14
+ name: 'KendoVueUploadList',
15
+ props: {
16
+ groupedFiles: Object,
17
+ async: Object,
18
+ disabled: Boolean,
19
+ navigationIndex: {
20
+ type: Number,
21
+ default: undefined
22
+ },
23
+ list: [String, Function, Object]
24
+ },
25
+ // @ts-ignore
26
+ emits: {
27
+ 'cancel': null,
28
+ 'click': null,
29
+ 'retry': null,
30
+ 'remove': null
31
+ },
32
+ methods: {
33
+ onClick: function onClick(navIndex) {
34
+ this.$emit('click', navIndex);
35
+ },
36
+ onRetry: function onRetry(uid) {
37
+ this.$emit('retry', uid);
38
+ },
39
+ onRemove: function onRemove(uid) {
40
+ this.$emit('remove', uid);
41
+ },
42
+ onCancel: function onCancel(uid) {
43
+ this.$emit('cancel', uid);
44
+ }
45
+ },
46
+ // @ts-ignore
47
+ setup: !isV3 ? undefined : function () {
48
+ var v3 = !!isV3;
49
+ return {
50
+ v3: v3
51
+ };
52
+ },
53
+ render: function render(createElement) {
54
+ var h = gh || createElement;
55
+ var _a = this.$props,
56
+ groupedFiles = _a.groupedFiles,
57
+ navigationIndex = _a.navigationIndex,
58
+ async = _a.async,
59
+ disabled = _a.disabled,
60
+ list = _a.list;
61
+ var ulClassName = classNames('k-upload-files', 'k-reset');
62
+ return h("ul", {
63
+ "class": ulClassName
64
+ }, [Object.keys(groupedFiles).map(function (key, index) {
65
+ var files = groupedFiles[key];
66
+ return (// @ts-ignore function children
67
+ h(UploadListGroup, {
68
+ key: key,
69
+ files: files,
70
+ attrs: this.v3 ? undefined : {
71
+ files: files,
72
+ index: index,
73
+ navigationIndex: navigationIndex,
74
+ async: async,
75
+ disabled: disabled,
76
+ list: list
77
+ },
78
+ index: index,
79
+ navigationIndex: navigationIndex,
80
+ async: async,
81
+ disabled: disabled,
82
+ list: list,
83
+ onCancel: this.onCancel,
84
+ on: this.v3 ? undefined : {
85
+ "cancel": this.onCancel,
86
+ "click": this.onClick,
87
+ "remove": this.onRemove,
88
+ "retry": this.onRetry
89
+ },
90
+ onClick: this.onClick,
91
+ onRemove: this.onRemove,
92
+ onRetry: this.onRetry
93
+ })
94
+ );
95
+ }, this)]);
96
+ }
97
+ };
98
+ /**
99
+ * @hidden
100
+ */
101
+
102
+ var UploadList = UploadListVue2;
103
+ export { UploadList, UploadListVue2 };
@@ -0,0 +1,56 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from './additionalTypes';
2
+ declare type DefaultData<V> = object | ((this: V) => UploadListActionButtonData);
3
+ declare type DefaultMethods<V> = {
4
+ [key: string]: (this: V, ...args: any[]) => any;
5
+ };
6
+ import { UploadAsyncProps } from './interfaces/UploadAsyncProps';
7
+ import { UploadFileStatus } from './interfaces/UploadFileStatus';
8
+ /**
9
+ * @hidden
10
+ */
11
+ export interface UploadListActionButtonProps {
12
+ progress: number;
13
+ uid: string;
14
+ status: UploadFileStatus;
15
+ async: UploadAsyncProps;
16
+ disabled: boolean;
17
+ }
18
+ /**
19
+ * @hidden
20
+ */
21
+ export interface UploadListActionButtonMethods {
22
+ [key: string]: any;
23
+ }
24
+ /**
25
+ * @hidden
26
+ */
27
+ export interface UploadListActionButtonState {
28
+ v3: boolean;
29
+ }
30
+ /**
31
+ * @hidden
32
+ */
33
+ export interface UploadListActionButtonData {
34
+ retryFocused: boolean;
35
+ actionFocused: boolean;
36
+ }
37
+ /**
38
+ * @hidden
39
+ */
40
+ export interface UploadListActionButtonComputed {
41
+ [key: string]: any;
42
+ }
43
+ /**
44
+ * @hidden
45
+ */
46
+ export interface UploadListActionButtonAll extends UploadListActionButtonMethods, UploadListActionButtonState, UploadListActionButtonData, UploadListActionButtonComputed, Vue2type {
47
+ }
48
+ /**
49
+ * @hidden
50
+ */
51
+ declare let UploadListActionButtonVue2: ComponentOptions<Vue2type, DefaultData<UploadListActionButtonData>, DefaultMethods<UploadListActionButtonAll>, UploadListActionButtonComputed, RecordPropsDefinition<UploadListActionButtonProps>>;
52
+ /**
53
+ * @hidden
54
+ */
55
+ declare const UploadListActionButton: DefineComponent<UploadListActionButtonProps, any, UploadListActionButtonData, UploadListActionButtonComputed, UploadListActionButtonMethods, {}, {}, {}, string, UploadListActionButtonProps, UploadListActionButtonProps, {}>;
56
+ export { UploadListActionButton, UploadListActionButtonVue2 };