@progress/kendo-angular-upload 13.4.0 → 13.4.1-develop.2
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/esm2020/file-select.directive.mjs +17 -1
- package/esm2020/fileselect.component.mjs +19 -34
- package/esm2020/navigation.service.mjs +31 -60
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/rendering/upload-action-buttons.component.mjs +6 -24
- package/esm2020/upload.component.mjs +20 -22
- package/fesm2015/progress-kendo-angular-upload.mjs +95 -143
- package/fesm2020/progress-kendo-angular-upload.mjs +95 -143
- package/file-select.directive.d.ts +5 -1
- package/fileselect.component.d.ts +4 -8
- package/navigation.service.d.ts +5 -10
- package/package.json +7 -7
- package/rendering/upload-action-buttons.component.d.ts +3 -8
- package/schematics/ngAdd/index.js +3 -3
- package/upload.component.d.ts +4 -0
|
@@ -20,6 +20,8 @@ export class FileSelectDirective {
|
|
|
20
20
|
this.type = "file";
|
|
21
21
|
this.autocomplete = "off";
|
|
22
22
|
this.tabIndex = -1;
|
|
23
|
+
this.ariaHidden = true;
|
|
24
|
+
this.classNames = true;
|
|
23
25
|
this.element = el;
|
|
24
26
|
}
|
|
25
27
|
get nameAttribute() {
|
|
@@ -34,6 +36,9 @@ export class FileSelectDirective {
|
|
|
34
36
|
get disabledAttribute() {
|
|
35
37
|
return this.disabled ? "true" : null;
|
|
36
38
|
}
|
|
39
|
+
get acceptAttribute() {
|
|
40
|
+
return this.accept ? this.accept : null;
|
|
41
|
+
}
|
|
37
42
|
onInputChange(event) {
|
|
38
43
|
const ua = navigator.userAgent;
|
|
39
44
|
const webkit = /(webkit)[ \/]([\w.]+)/i;
|
|
@@ -61,7 +66,7 @@ export class FileSelectDirective {
|
|
|
61
66
|
}
|
|
62
67
|
}
|
|
63
68
|
FileSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FileSelectDirective, deps: [{ token: i1.UploadService }, { token: i2.NavigationService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
64
|
-
FileSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: { dir: "dir", disabled: "disabled", multiple: "multiple", restrictions: "restrictions" }, host: { listeners: { "change": "onInputChange($event)" }, properties: { "attr.type": "this.type", "attr.autocomplete": "this.autocomplete", "attr.tabindex": "this.tabIndex", "attr.name": "this.nameAttribute", "attr.multiple": "this.multipleAttribute", "attr.dir": "this.dirAttribute", "attr.disabled": "this.disabledAttribute" } }, ngImport: i0 });
|
|
69
|
+
FileSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: { dir: "dir", disabled: "disabled", multiple: "multiple", restrictions: "restrictions", accept: "accept" }, host: { listeners: { "change": "onInputChange($event)" }, properties: { "attr.type": "this.type", "attr.autocomplete": "this.autocomplete", "attr.tabindex": "this.tabIndex", "attr.aria-hidden": "this.ariaHidden", "class.k-hidden": "this.classNames", "attr.name": "this.nameAttribute", "attr.multiple": "this.multipleAttribute", "attr.dir": "this.dirAttribute", "attr.disabled": "this.disabledAttribute", "attr.accept": "this.acceptAttribute" } }, ngImport: i0 });
|
|
65
70
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FileSelectDirective, decorators: [{
|
|
66
71
|
type: Directive,
|
|
67
72
|
args: [{
|
|
@@ -75,6 +80,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
75
80
|
type: Input
|
|
76
81
|
}], restrictions: [{
|
|
77
82
|
type: Input
|
|
83
|
+
}], accept: [{
|
|
84
|
+
type: Input
|
|
78
85
|
}], type: [{
|
|
79
86
|
type: HostBinding,
|
|
80
87
|
args: ["attr.type"]
|
|
@@ -84,6 +91,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
84
91
|
}], tabIndex: [{
|
|
85
92
|
type: HostBinding,
|
|
86
93
|
args: ["attr.tabindex"]
|
|
94
|
+
}], ariaHidden: [{
|
|
95
|
+
type: HostBinding,
|
|
96
|
+
args: ["attr.aria-hidden"]
|
|
97
|
+
}], classNames: [{
|
|
98
|
+
type: HostBinding,
|
|
99
|
+
args: ["class.k-hidden"]
|
|
87
100
|
}], nameAttribute: [{
|
|
88
101
|
type: HostBinding,
|
|
89
102
|
args: ["attr.name"]
|
|
@@ -96,6 +109,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
96
109
|
}], disabledAttribute: [{
|
|
97
110
|
type: HostBinding,
|
|
98
111
|
args: ["attr.disabled"]
|
|
112
|
+
}], acceptAttribute: [{
|
|
113
|
+
type: HostBinding,
|
|
114
|
+
args: ["attr.accept"]
|
|
99
115
|
}], onInputChange: [{
|
|
100
116
|
type: HostListener,
|
|
101
117
|
args: ["change", ["$event"]]
|
|
@@ -103,11 +103,10 @@ export class FileSelectComponent {
|
|
|
103
103
|
validatePackage(packageMetadata);
|
|
104
104
|
this.wrapper = wrapper.nativeElement;
|
|
105
105
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
106
|
-
this.navigation.computeKeys(
|
|
106
|
+
this.navigation.computeKeys();
|
|
107
107
|
this.fileList = this.uploadService.files;
|
|
108
108
|
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
109
109
|
this.direction = rtl ? 'rtl' : 'ltr';
|
|
110
|
-
this.navigation.computeKeys(this.direction);
|
|
111
110
|
});
|
|
112
111
|
this.subscribeBlur();
|
|
113
112
|
this.subscribeFocus();
|
|
@@ -231,6 +230,14 @@ export class FileSelectComponent {
|
|
|
231
230
|
setDisabledState(isDisabled) {
|
|
232
231
|
this.disabled = isDisabled;
|
|
233
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* @hidden
|
|
235
|
+
*/
|
|
236
|
+
onFileSelectButtonFocus() {
|
|
237
|
+
if (!this.navigation.focused) {
|
|
238
|
+
this.navigation.focusedIndex = -1;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
234
241
|
/**
|
|
235
242
|
* Removes specific file from the file list.
|
|
236
243
|
*/
|
|
@@ -273,21 +280,6 @@ export class FileSelectComponent {
|
|
|
273
280
|
return { buttonId, inputId };
|
|
274
281
|
}
|
|
275
282
|
;
|
|
276
|
-
/**
|
|
277
|
-
* @hidden
|
|
278
|
-
*/
|
|
279
|
-
onFileSelectButtonFocus(_event) {
|
|
280
|
-
this.renderer.addClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
281
|
-
if (!this.navigation.focused) {
|
|
282
|
-
this.navigation.focusedIndex = -1;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* @hidden
|
|
287
|
-
*/
|
|
288
|
-
onFileSelectButtonBlur(_event) {
|
|
289
|
-
this.renderer.removeClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
290
|
-
}
|
|
291
283
|
subscribeBlur() {
|
|
292
284
|
if (!isDocumentAvailable()) {
|
|
293
285
|
return;
|
|
@@ -296,7 +288,7 @@ export class FileSelectComponent {
|
|
|
296
288
|
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
297
289
|
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
298
290
|
}));
|
|
299
|
-
this.blurSubscription = merge(this.documentClick, this.navigation.
|
|
291
|
+
this.blurSubscription = merge(this.documentClick, this.navigation.onTabOut).subscribe(() => {
|
|
300
292
|
if (this.navigation.focused) {
|
|
301
293
|
this.ngZone.run(() => {
|
|
302
294
|
this.navigation.focused = false;
|
|
@@ -319,15 +311,14 @@ export class FileSelectComponent {
|
|
|
319
311
|
if (this.disabled) {
|
|
320
312
|
return;
|
|
321
313
|
}
|
|
322
|
-
if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space)
|
|
323
|
-
event.target === this.fileSelectButton.nativeElement) {
|
|
314
|
+
if (event.target === this.fileSelectButton.nativeElement && (event.keyCode === Keys.Enter || event.keyCode === Keys.Space)) {
|
|
324
315
|
event.preventDefault();
|
|
325
316
|
this.fileSelectInput.nativeElement.click();
|
|
326
317
|
return;
|
|
327
318
|
}
|
|
328
319
|
if (hasClasses(event.target, UPLOAD_CLASSES) ||
|
|
329
320
|
(!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
|
|
330
|
-
this.navigation.process(event);
|
|
321
|
+
this.navigation.process(event, 'fileselect');
|
|
331
322
|
}
|
|
332
323
|
}
|
|
333
324
|
attachEventHandlers() {
|
|
@@ -409,6 +400,7 @@ FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
409
400
|
type="button"
|
|
410
401
|
role="button"
|
|
411
402
|
(click)="fileSelectInput.click()"
|
|
403
|
+
(focus)="onFileSelectButtonFocus()"
|
|
412
404
|
[id]="focusableId"
|
|
413
405
|
[attr.aria-label]="textFor('select')"
|
|
414
406
|
[attr.tabindex]="tabindex"
|
|
@@ -416,14 +408,10 @@ FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
416
408
|
>
|
|
417
409
|
{{textFor('select')}}
|
|
418
410
|
</button>
|
|
419
|
-
<input
|
|
420
|
-
#fileSelectInput
|
|
421
|
-
kendoFileSelect
|
|
422
|
-
class="k-hidden"
|
|
411
|
+
<input kendoFileSelect #fileSelectInput
|
|
423
412
|
[id]="inputElementId"
|
|
424
|
-
[attr.accept]="accept ? accept : null"
|
|
425
|
-
[attr.aria-hidden]="true"
|
|
426
413
|
[dir]="direction"
|
|
414
|
+
[accept]="accept"
|
|
427
415
|
[restrictions]="restrictions"
|
|
428
416
|
[multiple]="multiple"
|
|
429
417
|
[disabled]="disabled"
|
|
@@ -439,7 +427,7 @@ FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
439
427
|
[fileTemplate]="fileTemplate"
|
|
440
428
|
[fileInfoTemplate]="fileInfoTemplate">
|
|
441
429
|
</ul>
|
|
442
|
-
`, isInline: true, components: [{ type: i5.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i6.FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }], directives: [{ type: i7.LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: i8.DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: i9.FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
430
|
+
`, isInline: true, components: [{ type: i5.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i6.FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }], directives: [{ type: i7.LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: i8.DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: i9.FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions", "accept"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
443
431
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FileSelectComponent, decorators: [{
|
|
444
432
|
type: Component,
|
|
445
433
|
args: [{
|
|
@@ -493,6 +481,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
493
481
|
type="button"
|
|
494
482
|
role="button"
|
|
495
483
|
(click)="fileSelectInput.click()"
|
|
484
|
+
(focus)="onFileSelectButtonFocus()"
|
|
496
485
|
[id]="focusableId"
|
|
497
486
|
[attr.aria-label]="textFor('select')"
|
|
498
487
|
[attr.tabindex]="tabindex"
|
|
@@ -500,14 +489,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
500
489
|
>
|
|
501
490
|
{{textFor('select')}}
|
|
502
491
|
</button>
|
|
503
|
-
<input
|
|
504
|
-
#fileSelectInput
|
|
505
|
-
kendoFileSelect
|
|
506
|
-
class="k-hidden"
|
|
492
|
+
<input kendoFileSelect #fileSelectInput
|
|
507
493
|
[id]="inputElementId"
|
|
508
|
-
[attr.accept]="accept ? accept : null"
|
|
509
|
-
[attr.aria-hidden]="true"
|
|
510
494
|
[dir]="direction"
|
|
495
|
+
[accept]="accept"
|
|
511
496
|
[restrictions]="restrictions"
|
|
512
497
|
[multiple]="multiple"
|
|
513
498
|
[disabled]="disabled"
|
|
@@ -14,11 +14,10 @@ export class NavigationService {
|
|
|
14
14
|
constructor(uploadService, zone) {
|
|
15
15
|
this.uploadService = uploadService;
|
|
16
16
|
this.zone = zone;
|
|
17
|
-
this.onActionButtonAction = new EventEmitter();
|
|
18
17
|
this.onActionButtonFocus = new EventEmitter();
|
|
19
18
|
this.onFileAction = new EventEmitter();
|
|
20
19
|
this.onFileFocus = new EventEmitter();
|
|
21
|
-
this.
|
|
20
|
+
this.onTabOut = new EventEmitter();
|
|
22
21
|
this.onWrapperFocus = new EventEmitter();
|
|
23
22
|
this.onSelectButtonFocus = new EventEmitter();
|
|
24
23
|
this.actionButtonsVisible = false;
|
|
@@ -29,99 +28,75 @@ export class NavigationService {
|
|
|
29
28
|
const key = event.keyCode;
|
|
30
29
|
return this.keyBindings[key];
|
|
31
30
|
}
|
|
32
|
-
process(event) {
|
|
31
|
+
process(event, component) {
|
|
33
32
|
const handler = this.action(event);
|
|
34
33
|
if (handler) {
|
|
35
|
-
handler(event);
|
|
34
|
+
handler(event, component);
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
computeKeys(
|
|
37
|
+
computeKeys() {
|
|
39
38
|
this.keyBindings = {
|
|
40
39
|
[Keys.Space]: () => this.handleSpace(),
|
|
41
|
-
[Keys.Enter]: (
|
|
40
|
+
[Keys.Enter]: () => this.handleEnter(),
|
|
42
41
|
[Keys.Escape]: () => this.handleEscape(),
|
|
43
42
|
[Keys.Delete]: () => this.handleDelete(),
|
|
44
|
-
[Keys.Tab]: (event) => this.handleTab(event.shiftKey),
|
|
43
|
+
[Keys.Tab]: (event, component) => this.handleTab(event.shiftKey, component),
|
|
45
44
|
[Keys.ArrowUp]: (event) => this.handleUp(event),
|
|
46
|
-
[Keys.ArrowDown]: (event) => this.handleDown(event)
|
|
47
|
-
[this.invertKeys(direction, Keys.ArrowLeft, Keys.ArrowRight)]: () => this.handleLeft(),
|
|
48
|
-
[this.invertKeys(direction, Keys.ArrowRight, Keys.ArrowLeft)]: () => this.handleRight()
|
|
45
|
+
[Keys.ArrowDown]: (event) => this.handleDown(event)
|
|
49
46
|
};
|
|
50
47
|
}
|
|
51
|
-
invertKeys(direction, original, inverted) {
|
|
52
|
-
return direction === 'rtl' ? inverted : original;
|
|
53
|
-
}
|
|
54
48
|
focusSelectButton() {
|
|
55
49
|
this.focused = true;
|
|
56
50
|
this._focusedIndex = -1;
|
|
57
51
|
this.onSelectButtonFocus.emit();
|
|
58
52
|
}
|
|
59
|
-
handleEnter(
|
|
60
|
-
if (this.lastIndex >= 0) {
|
|
61
|
-
this.zone.run(() =>
|
|
62
|
-
if (this.focusedIndex <= this.lastFileIndex) {
|
|
63
|
-
this.onFileAction.emit(Keys.Enter);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (this.actionButtonsVisible && this.focusedIndex <= this.lastIndex) {
|
|
67
|
-
event.preventDefault();
|
|
68
|
-
this.onActionButtonAction.emit(this.focusedIndex < this.lastIndex ? "clear" : "upload");
|
|
69
|
-
}
|
|
70
|
-
});
|
|
53
|
+
handleEnter() {
|
|
54
|
+
if (this.lastIndex >= 0 && this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
55
|
+
this.zone.run(() => this.onFileAction.emit(Keys.Enter));
|
|
71
56
|
}
|
|
72
57
|
}
|
|
73
58
|
handleSpace() {
|
|
74
|
-
if (this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
59
|
+
if (this.lastIndex >= 0 && this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
75
60
|
this.zone.run(() => this.onFileAction.emit(Keys.Space));
|
|
76
61
|
}
|
|
77
62
|
}
|
|
78
63
|
handleDelete() {
|
|
79
64
|
if (this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
80
|
-
this.zone.run(() =>
|
|
81
|
-
this.onFileAction.emit(Keys.Delete);
|
|
82
|
-
});
|
|
65
|
+
this.zone.run(() => this.onFileAction.emit(Keys.Delete));
|
|
83
66
|
}
|
|
84
67
|
}
|
|
85
68
|
handleEscape() {
|
|
86
69
|
if (this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
87
|
-
this.onFileAction.emit(Keys.Escape);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
handleLeft() {
|
|
91
|
-
if (this.actionButtonsVisible && this.focusedIndex === this.lastIndex) {
|
|
92
|
-
this.focusedIndex -= 1;
|
|
93
|
-
this.zone.run(() => {
|
|
94
|
-
this.onActionButtonFocus.emit("clear");
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
handleRight() {
|
|
99
|
-
if (this.actionButtonsVisible && this.focusedIndex === this.lastIndex - 1) {
|
|
100
|
-
this.focusedIndex += 1;
|
|
101
|
-
this.zone.run(() => {
|
|
102
|
-
this.onActionButtonFocus.emit("upload");
|
|
103
|
-
});
|
|
70
|
+
this.zone.run(() => this.onFileAction.emit(Keys.Escape));
|
|
104
71
|
}
|
|
105
72
|
}
|
|
106
|
-
handleTab(shifted) {
|
|
107
|
-
|
|
73
|
+
handleTab(shifted, component) {
|
|
74
|
+
/* Select Files button is focused */
|
|
75
|
+
if (this.focusedIndex === -1 && this.actionButtonsVisible && !shifted) {
|
|
108
76
|
this.focusedIndex = this.lastFileIndex + 1;
|
|
109
|
-
this.zone.run(() => this.onActionButtonFocus.emit("clear"));
|
|
110
77
|
return;
|
|
111
78
|
}
|
|
79
|
+
/* File in the list is focused */
|
|
80
|
+
if (this.focusedIndex > -1 && this.focusedIndex <= this.lastFileIndex) {
|
|
81
|
+
if (shifted) {
|
|
82
|
+
this.focusedIndex = -1;
|
|
83
|
+
}
|
|
84
|
+
else if (component !== 'fileselect' && this.actionButtonsVisible) {
|
|
85
|
+
this.focusedIndex = this.lastFileIndex + 1;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/* Clear button is focused */
|
|
112
90
|
if (this.focusedIndex === this.lastFileIndex + 1) {
|
|
113
|
-
this.focusedIndex
|
|
114
|
-
this.zone.run(() => this.onActionButtonFocus.emit("upload"));
|
|
91
|
+
this.focusedIndex = shifted ? -1 : this.lastIndex;
|
|
115
92
|
return;
|
|
116
93
|
}
|
|
117
|
-
|
|
94
|
+
/* Upload button is focused */
|
|
95
|
+
if (this.focusedIndex === this.lastIndex && this.actionButtonsVisible && shifted) {
|
|
118
96
|
this.focusedIndex -= 1;
|
|
119
97
|
return;
|
|
120
98
|
}
|
|
121
|
-
|
|
122
|
-
this.focusedIndex = -1;
|
|
123
|
-
this.zone.run(() => this.onSelectButtonFocus.emit());
|
|
124
|
-
}
|
|
99
|
+
this.onTabOut.emit();
|
|
125
100
|
}
|
|
126
101
|
handleDown(event) {
|
|
127
102
|
if (this.lastIndex >= 0 && this.focusedIndex < this.lastIndex) {
|
|
@@ -132,10 +107,6 @@ export class NavigationService {
|
|
|
132
107
|
this.onFileFocus.emit(this.focusedIndex);
|
|
133
108
|
return;
|
|
134
109
|
}
|
|
135
|
-
if (this.actionButtonsVisible && this.focusedIndex === this.lastFileIndex) {
|
|
136
|
-
this.focusedIndex += 1;
|
|
137
|
-
this.onActionButtonFocus.emit("clear");
|
|
138
|
-
}
|
|
139
110
|
});
|
|
140
111
|
}
|
|
141
112
|
}
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-upload',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
13
|
-
version: '13.4.
|
|
12
|
+
publishDate: 1693387424,
|
|
13
|
+
version: '13.4.1-develop.2',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|
|
@@ -20,8 +20,6 @@ export class UploadActionButtonsComponent {
|
|
|
20
20
|
this.localization = localization;
|
|
21
21
|
this.navigation = navigation;
|
|
22
22
|
this.hostDefaultClass = true;
|
|
23
|
-
this.onAction();
|
|
24
|
-
this.onFocus();
|
|
25
23
|
}
|
|
26
24
|
get actionButtonsEndClassName() {
|
|
27
25
|
return this.actionsLayout === 'end';
|
|
@@ -35,28 +33,10 @@ export class UploadActionButtonsComponent {
|
|
|
35
33
|
get actionButtonsCenterClassName() {
|
|
36
34
|
return this.actionsLayout === 'center';
|
|
37
35
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
this.performUpload();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
onFocus() {
|
|
49
|
-
this.focusSubscription = this.navigation.onActionButtonFocus.subscribe((button) => {
|
|
50
|
-
this.focusButton(button);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
focusButton(button) {
|
|
54
|
-
const el = (button === "clear") ? this.clearButton : this.uploadButton;
|
|
55
|
-
el.nativeElement.focus();
|
|
56
|
-
}
|
|
57
|
-
ngOnDestroy() {
|
|
58
|
-
this.actionSubscription.unsubscribe();
|
|
59
|
-
this.focusSubscription.unsubscribe();
|
|
36
|
+
onUploadButtonFocus() {
|
|
37
|
+
if (!this.navigation.focused) {
|
|
38
|
+
this.navigation.focusedIndex = this.navigation.lastIndex;
|
|
39
|
+
}
|
|
60
40
|
}
|
|
61
41
|
onUploadButtonClick(event) {
|
|
62
42
|
event.stopImmediatePropagation();
|
|
@@ -89,6 +69,7 @@ UploadActionButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12
|
|
|
89
69
|
{{textFor('clearSelectedFiles')}}
|
|
90
70
|
</button>
|
|
91
71
|
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
72
|
+
(focus)="onUploadButtonFocus()"
|
|
92
73
|
(click)="onUploadButtonClick($event)">
|
|
93
74
|
{{textFor('uploadSelectedFiles')}}
|
|
94
75
|
</button>
|
|
@@ -103,6 +84,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
103
84
|
{{textFor('clearSelectedFiles')}}
|
|
104
85
|
</button>
|
|
105
86
|
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
87
|
+
(focus)="onUploadButtonFocus()"
|
|
106
88
|
(click)="onUploadButtonClick($event)">
|
|
107
89
|
{{textFor('uploadSelectedFiles')}}
|
|
108
90
|
</button>
|
|
@@ -158,10 +158,9 @@ export class UploadComponent {
|
|
|
158
158
|
this.fileList = this.uploadService.files;
|
|
159
159
|
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
160
160
|
this.direction = rtl ? 'rtl' : 'ltr';
|
|
161
|
-
this.navigation.computeKeys(this.direction);
|
|
162
161
|
});
|
|
163
162
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
164
|
-
this.navigation.computeKeys(
|
|
163
|
+
this.navigation.computeKeys();
|
|
165
164
|
this.wrapper = wrapper.nativeElement;
|
|
166
165
|
this.subscribeBlur();
|
|
167
166
|
this.subscribeFocus();
|
|
@@ -411,6 +410,14 @@ export class UploadComponent {
|
|
|
411
410
|
setDisabledState(isDisabled) {
|
|
412
411
|
this.disabled = isDisabled;
|
|
413
412
|
}
|
|
413
|
+
/**
|
|
414
|
+
* @hidden
|
|
415
|
+
*/
|
|
416
|
+
onFileSelectButtonFocus() {
|
|
417
|
+
if (!this.navigation.focused) {
|
|
418
|
+
this.navigation.focusedIndex = -1;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
414
421
|
/**
|
|
415
422
|
* @hidden
|
|
416
423
|
*/
|
|
@@ -576,7 +583,7 @@ export class UploadComponent {
|
|
|
576
583
|
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
577
584
|
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
578
585
|
}));
|
|
579
|
-
this.blurSubscription = merge(this.documentClick, this.navigation.
|
|
586
|
+
this.blurSubscription = merge(this.documentClick, this.navigation.onTabOut).subscribe(() => {
|
|
580
587
|
if (this.navigation.focused) {
|
|
581
588
|
this.zone.run(() => {
|
|
582
589
|
this.navigation.focused = false;
|
|
@@ -591,8 +598,7 @@ export class UploadComponent {
|
|
|
591
598
|
if (this.disabled) {
|
|
592
599
|
return;
|
|
593
600
|
}
|
|
594
|
-
if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space)
|
|
595
|
-
event.target === this.fileSelectButton.nativeElement) {
|
|
601
|
+
if (event.target === this.fileSelectButton.nativeElement && (event.keyCode === Keys.Enter || event.keyCode === Keys.Space)) {
|
|
596
602
|
event.preventDefault();
|
|
597
603
|
this.fileSelectInput.nativeElement.click();
|
|
598
604
|
return;
|
|
@@ -741,23 +747,19 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
|
|
|
741
747
|
type="button"
|
|
742
748
|
role="button"
|
|
743
749
|
(click)="fileSelectInput.click()"
|
|
750
|
+
(focus)="onFileSelectButtonFocus()"
|
|
744
751
|
[id]="focusableId"
|
|
745
752
|
[attr.aria-label]="textFor('select')"
|
|
746
753
|
[attr.tabindex]="tabindex"
|
|
747
754
|
>
|
|
748
755
|
{{textFor('select')}}
|
|
749
756
|
</button>
|
|
750
|
-
<input
|
|
751
|
-
#fileSelectInput
|
|
752
|
-
kendoFileSelect
|
|
753
|
-
class="k-hidden"
|
|
754
|
-
[attr.accept]="accept ? accept : null"
|
|
755
|
-
[attr.aria-hidden]="true"
|
|
757
|
+
<input kendoFileSelect #fileSelectInput
|
|
756
758
|
[dir]="direction"
|
|
759
|
+
[accept]="accept"
|
|
757
760
|
[restrictions]="restrictions"
|
|
758
761
|
[multiple]="multiple"
|
|
759
|
-
[disabled]="disabled"
|
|
760
|
-
/>
|
|
762
|
+
[disabled]="disabled" />
|
|
761
763
|
</div>
|
|
762
764
|
<kendo-upload-status-total *ngIf="showTotalStatus"
|
|
763
765
|
class="k-upload-status"
|
|
@@ -777,7 +779,7 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
|
|
|
777
779
|
[disabled]="disabled"
|
|
778
780
|
[actionsLayout]="actionsLayout">
|
|
779
781
|
</kendo-upload-action-buttons>
|
|
780
|
-
`, isInline: true, components: [{ type: i5.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i6.UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: ["fileList"] }, { type: i7.FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { type: i8.UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: ["disabled", "actionsLayout"] }], directives: [{ type: i9.LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: i10.DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: i11.FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions"] }, { type: i12.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
782
|
+
`, isInline: true, components: [{ type: i5.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i6.UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: ["fileList"] }, { type: i7.FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { type: i8.UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: ["disabled", "actionsLayout"] }], directives: [{ type: i9.LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: i10.DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: i11.FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions", "accept"] }, { type: i12.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
781
783
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UploadComponent, decorators: [{
|
|
782
784
|
type: Component,
|
|
783
785
|
args: [{
|
|
@@ -874,23 +876,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
874
876
|
type="button"
|
|
875
877
|
role="button"
|
|
876
878
|
(click)="fileSelectInput.click()"
|
|
879
|
+
(focus)="onFileSelectButtonFocus()"
|
|
877
880
|
[id]="focusableId"
|
|
878
881
|
[attr.aria-label]="textFor('select')"
|
|
879
882
|
[attr.tabindex]="tabindex"
|
|
880
883
|
>
|
|
881
884
|
{{textFor('select')}}
|
|
882
885
|
</button>
|
|
883
|
-
<input
|
|
884
|
-
#fileSelectInput
|
|
885
|
-
kendoFileSelect
|
|
886
|
-
class="k-hidden"
|
|
887
|
-
[attr.accept]="accept ? accept : null"
|
|
888
|
-
[attr.aria-hidden]="true"
|
|
886
|
+
<input kendoFileSelect #fileSelectInput
|
|
889
887
|
[dir]="direction"
|
|
888
|
+
[accept]="accept"
|
|
890
889
|
[restrictions]="restrictions"
|
|
891
890
|
[multiple]="multiple"
|
|
892
|
-
[disabled]="disabled"
|
|
893
|
-
/>
|
|
891
|
+
[disabled]="disabled" />
|
|
894
892
|
</div>
|
|
895
893
|
<kendo-upload-status-total *ngIf="showTotalStatus"
|
|
896
894
|
class="k-upload-status"
|