@progress/kendo-angular-upload 13.4.0-develop.9 → 13.4.1-develop.1
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
|
@@ -1334,11 +1334,10 @@ class NavigationService {
|
|
|
1334
1334
|
constructor(uploadService, zone) {
|
|
1335
1335
|
this.uploadService = uploadService;
|
|
1336
1336
|
this.zone = zone;
|
|
1337
|
-
this.onActionButtonAction = new EventEmitter();
|
|
1338
1337
|
this.onActionButtonFocus = new EventEmitter();
|
|
1339
1338
|
this.onFileAction = new EventEmitter();
|
|
1340
1339
|
this.onFileFocus = new EventEmitter();
|
|
1341
|
-
this.
|
|
1340
|
+
this.onTabOut = new EventEmitter();
|
|
1342
1341
|
this.onWrapperFocus = new EventEmitter();
|
|
1343
1342
|
this.onSelectButtonFocus = new EventEmitter();
|
|
1344
1343
|
this.actionButtonsVisible = false;
|
|
@@ -1349,99 +1348,75 @@ class NavigationService {
|
|
|
1349
1348
|
const key = event.keyCode;
|
|
1350
1349
|
return this.keyBindings[key];
|
|
1351
1350
|
}
|
|
1352
|
-
process(event) {
|
|
1351
|
+
process(event, component) {
|
|
1353
1352
|
const handler = this.action(event);
|
|
1354
1353
|
if (handler) {
|
|
1355
|
-
handler(event);
|
|
1354
|
+
handler(event, component);
|
|
1356
1355
|
}
|
|
1357
1356
|
}
|
|
1358
|
-
computeKeys(
|
|
1357
|
+
computeKeys() {
|
|
1359
1358
|
this.keyBindings = {
|
|
1360
1359
|
[Keys.Space]: () => this.handleSpace(),
|
|
1361
|
-
[Keys.Enter]: (
|
|
1360
|
+
[Keys.Enter]: () => this.handleEnter(),
|
|
1362
1361
|
[Keys.Escape]: () => this.handleEscape(),
|
|
1363
1362
|
[Keys.Delete]: () => this.handleDelete(),
|
|
1364
|
-
[Keys.Tab]: (event) => this.handleTab(event.shiftKey),
|
|
1363
|
+
[Keys.Tab]: (event, component) => this.handleTab(event.shiftKey, component),
|
|
1365
1364
|
[Keys.ArrowUp]: (event) => this.handleUp(event),
|
|
1366
|
-
[Keys.ArrowDown]: (event) => this.handleDown(event)
|
|
1367
|
-
[this.invertKeys(direction, Keys.ArrowLeft, Keys.ArrowRight)]: () => this.handleLeft(),
|
|
1368
|
-
[this.invertKeys(direction, Keys.ArrowRight, Keys.ArrowLeft)]: () => this.handleRight()
|
|
1365
|
+
[Keys.ArrowDown]: (event) => this.handleDown(event)
|
|
1369
1366
|
};
|
|
1370
1367
|
}
|
|
1371
|
-
invertKeys(direction, original, inverted) {
|
|
1372
|
-
return direction === 'rtl' ? inverted : original;
|
|
1373
|
-
}
|
|
1374
1368
|
focusSelectButton() {
|
|
1375
1369
|
this.focused = true;
|
|
1376
1370
|
this._focusedIndex = -1;
|
|
1377
1371
|
this.onSelectButtonFocus.emit();
|
|
1378
1372
|
}
|
|
1379
|
-
handleEnter(
|
|
1380
|
-
if (this.lastIndex >= 0) {
|
|
1381
|
-
this.zone.run(() =>
|
|
1382
|
-
if (this.focusedIndex <= this.lastFileIndex) {
|
|
1383
|
-
this.onFileAction.emit(Keys.Enter);
|
|
1384
|
-
return;
|
|
1385
|
-
}
|
|
1386
|
-
if (this.actionButtonsVisible && this.focusedIndex <= this.lastIndex) {
|
|
1387
|
-
event.preventDefault();
|
|
1388
|
-
this.onActionButtonAction.emit(this.focusedIndex < this.lastIndex ? "clear" : "upload");
|
|
1389
|
-
}
|
|
1390
|
-
});
|
|
1373
|
+
handleEnter() {
|
|
1374
|
+
if (this.lastIndex >= 0 && this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
1375
|
+
this.zone.run(() => this.onFileAction.emit(Keys.Enter));
|
|
1391
1376
|
}
|
|
1392
1377
|
}
|
|
1393
1378
|
handleSpace() {
|
|
1394
|
-
if (this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
1379
|
+
if (this.lastIndex >= 0 && this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
1395
1380
|
this.zone.run(() => this.onFileAction.emit(Keys.Space));
|
|
1396
1381
|
}
|
|
1397
1382
|
}
|
|
1398
1383
|
handleDelete() {
|
|
1399
1384
|
if (this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
1400
|
-
this.zone.run(() =>
|
|
1401
|
-
this.onFileAction.emit(Keys.Delete);
|
|
1402
|
-
});
|
|
1385
|
+
this.zone.run(() => this.onFileAction.emit(Keys.Delete));
|
|
1403
1386
|
}
|
|
1404
1387
|
}
|
|
1405
1388
|
handleEscape() {
|
|
1406
1389
|
if (this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
1407
|
-
this.onFileAction.emit(Keys.Escape);
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
handleLeft() {
|
|
1411
|
-
if (this.actionButtonsVisible && this.focusedIndex === this.lastIndex) {
|
|
1412
|
-
this.focusedIndex -= 1;
|
|
1413
|
-
this.zone.run(() => {
|
|
1414
|
-
this.onActionButtonFocus.emit("clear");
|
|
1415
|
-
});
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
handleRight() {
|
|
1419
|
-
if (this.actionButtonsVisible && this.focusedIndex === this.lastIndex - 1) {
|
|
1420
|
-
this.focusedIndex += 1;
|
|
1421
|
-
this.zone.run(() => {
|
|
1422
|
-
this.onActionButtonFocus.emit("upload");
|
|
1423
|
-
});
|
|
1390
|
+
this.zone.run(() => this.onFileAction.emit(Keys.Escape));
|
|
1424
1391
|
}
|
|
1425
1392
|
}
|
|
1426
|
-
handleTab(shifted) {
|
|
1427
|
-
|
|
1393
|
+
handleTab(shifted, component) {
|
|
1394
|
+
/* Select Files button is focused */
|
|
1395
|
+
if (this.focusedIndex === -1 && this.actionButtonsVisible && !shifted) {
|
|
1428
1396
|
this.focusedIndex = this.lastFileIndex + 1;
|
|
1429
|
-
this.zone.run(() => this.onActionButtonFocus.emit("clear"));
|
|
1430
1397
|
return;
|
|
1431
1398
|
}
|
|
1399
|
+
/* File in the list is focused */
|
|
1400
|
+
if (this.focusedIndex > -1 && this.focusedIndex <= this.lastFileIndex) {
|
|
1401
|
+
if (shifted) {
|
|
1402
|
+
this.focusedIndex = -1;
|
|
1403
|
+
}
|
|
1404
|
+
else if (component !== 'fileselect' && this.actionButtonsVisible) {
|
|
1405
|
+
this.focusedIndex = this.lastFileIndex + 1;
|
|
1406
|
+
return;
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
/* Clear button is focused */
|
|
1432
1410
|
if (this.focusedIndex === this.lastFileIndex + 1) {
|
|
1433
|
-
this.focusedIndex
|
|
1434
|
-
this.zone.run(() => this.onActionButtonFocus.emit("upload"));
|
|
1411
|
+
this.focusedIndex = shifted ? -1 : this.lastIndex;
|
|
1435
1412
|
return;
|
|
1436
1413
|
}
|
|
1437
|
-
|
|
1414
|
+
/* Upload button is focused */
|
|
1415
|
+
if (this.focusedIndex === this.lastIndex && this.actionButtonsVisible && shifted) {
|
|
1438
1416
|
this.focusedIndex -= 1;
|
|
1439
1417
|
return;
|
|
1440
1418
|
}
|
|
1441
|
-
|
|
1442
|
-
this.focusedIndex = -1;
|
|
1443
|
-
this.zone.run(() => this.onSelectButtonFocus.emit());
|
|
1444
|
-
}
|
|
1419
|
+
this.onTabOut.emit();
|
|
1445
1420
|
}
|
|
1446
1421
|
handleDown(event) {
|
|
1447
1422
|
if (this.lastIndex >= 0 && this.focusedIndex < this.lastIndex) {
|
|
@@ -1452,10 +1427,6 @@ class NavigationService {
|
|
|
1452
1427
|
this.onFileFocus.emit(this.focusedIndex);
|
|
1453
1428
|
return;
|
|
1454
1429
|
}
|
|
1455
|
-
if (this.actionButtonsVisible && this.focusedIndex === this.lastFileIndex) {
|
|
1456
|
-
this.focusedIndex += 1;
|
|
1457
|
-
this.onActionButtonFocus.emit("clear");
|
|
1458
|
-
}
|
|
1459
1430
|
});
|
|
1460
1431
|
}
|
|
1461
1432
|
}
|
|
@@ -1539,8 +1510,8 @@ const packageMetadata = {
|
|
|
1539
1510
|
name: '@progress/kendo-angular-upload',
|
|
1540
1511
|
productName: 'Kendo UI for Angular',
|
|
1541
1512
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
1542
|
-
publishDate:
|
|
1543
|
-
version: '13.4.
|
|
1513
|
+
publishDate: 1693335675,
|
|
1514
|
+
version: '13.4.1-develop.1',
|
|
1544
1515
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
1545
1516
|
};
|
|
1546
1517
|
|
|
@@ -2737,6 +2708,8 @@ class FileSelectDirective {
|
|
|
2737
2708
|
this.type = "file";
|
|
2738
2709
|
this.autocomplete = "off";
|
|
2739
2710
|
this.tabIndex = -1;
|
|
2711
|
+
this.ariaHidden = true;
|
|
2712
|
+
this.classNames = true;
|
|
2740
2713
|
this.element = el;
|
|
2741
2714
|
}
|
|
2742
2715
|
get nameAttribute() {
|
|
@@ -2751,6 +2724,9 @@ class FileSelectDirective {
|
|
|
2751
2724
|
get disabledAttribute() {
|
|
2752
2725
|
return this.disabled ? "true" : null;
|
|
2753
2726
|
}
|
|
2727
|
+
get acceptAttribute() {
|
|
2728
|
+
return this.accept ? this.accept : null;
|
|
2729
|
+
}
|
|
2754
2730
|
onInputChange(event) {
|
|
2755
2731
|
const ua = navigator.userAgent;
|
|
2756
2732
|
const webkit = /(webkit)[ \/]([\w.]+)/i;
|
|
@@ -2778,7 +2754,7 @@ class FileSelectDirective {
|
|
|
2778
2754
|
}
|
|
2779
2755
|
}
|
|
2780
2756
|
FileSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FileSelectDirective, deps: [{ token: UploadService }, { token: NavigationService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2781
|
-
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 });
|
|
2757
|
+
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 });
|
|
2782
2758
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FileSelectDirective, decorators: [{
|
|
2783
2759
|
type: Directive,
|
|
2784
2760
|
args: [{
|
|
@@ -2792,6 +2768,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
2792
2768
|
type: Input
|
|
2793
2769
|
}], restrictions: [{
|
|
2794
2770
|
type: Input
|
|
2771
|
+
}], accept: [{
|
|
2772
|
+
type: Input
|
|
2795
2773
|
}], type: [{
|
|
2796
2774
|
type: HostBinding,
|
|
2797
2775
|
args: ["attr.type"]
|
|
@@ -2801,6 +2779,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
2801
2779
|
}], tabIndex: [{
|
|
2802
2780
|
type: HostBinding,
|
|
2803
2781
|
args: ["attr.tabindex"]
|
|
2782
|
+
}], ariaHidden: [{
|
|
2783
|
+
type: HostBinding,
|
|
2784
|
+
args: ["attr.aria-hidden"]
|
|
2785
|
+
}], classNames: [{
|
|
2786
|
+
type: HostBinding,
|
|
2787
|
+
args: ["class.k-hidden"]
|
|
2804
2788
|
}], nameAttribute: [{
|
|
2805
2789
|
type: HostBinding,
|
|
2806
2790
|
args: ["attr.name"]
|
|
@@ -2813,6 +2797,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
2813
2797
|
}], disabledAttribute: [{
|
|
2814
2798
|
type: HostBinding,
|
|
2815
2799
|
args: ["attr.disabled"]
|
|
2800
|
+
}], acceptAttribute: [{
|
|
2801
|
+
type: HostBinding,
|
|
2802
|
+
args: ["attr.accept"]
|
|
2816
2803
|
}], onInputChange: [{
|
|
2817
2804
|
type: HostListener,
|
|
2818
2805
|
args: ["change", ["$event"]]
|
|
@@ -2893,11 +2880,10 @@ class FileSelectComponent {
|
|
|
2893
2880
|
validatePackage(packageMetadata);
|
|
2894
2881
|
this.wrapper = wrapper.nativeElement;
|
|
2895
2882
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
2896
|
-
this.navigation.computeKeys(
|
|
2883
|
+
this.navigation.computeKeys();
|
|
2897
2884
|
this.fileList = this.uploadService.files;
|
|
2898
2885
|
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
2899
2886
|
this.direction = rtl ? 'rtl' : 'ltr';
|
|
2900
|
-
this.navigation.computeKeys(this.direction);
|
|
2901
2887
|
});
|
|
2902
2888
|
this.subscribeBlur();
|
|
2903
2889
|
this.subscribeFocus();
|
|
@@ -3021,6 +3007,14 @@ class FileSelectComponent {
|
|
|
3021
3007
|
setDisabledState(isDisabled) {
|
|
3022
3008
|
this.disabled = isDisabled;
|
|
3023
3009
|
}
|
|
3010
|
+
/**
|
|
3011
|
+
* @hidden
|
|
3012
|
+
*/
|
|
3013
|
+
onFileSelectButtonFocus() {
|
|
3014
|
+
if (!this.navigation.focused) {
|
|
3015
|
+
this.navigation.focusedIndex = -1;
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3024
3018
|
/**
|
|
3025
3019
|
* Removes specific file from the file list.
|
|
3026
3020
|
*/
|
|
@@ -3063,21 +3057,6 @@ class FileSelectComponent {
|
|
|
3063
3057
|
return { buttonId, inputId };
|
|
3064
3058
|
}
|
|
3065
3059
|
;
|
|
3066
|
-
/**
|
|
3067
|
-
* @hidden
|
|
3068
|
-
*/
|
|
3069
|
-
onFileSelectButtonFocus(_event) {
|
|
3070
|
-
this.renderer.addClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
3071
|
-
if (!this.navigation.focused) {
|
|
3072
|
-
this.navigation.focusedIndex = -1;
|
|
3073
|
-
}
|
|
3074
|
-
}
|
|
3075
|
-
/**
|
|
3076
|
-
* @hidden
|
|
3077
|
-
*/
|
|
3078
|
-
onFileSelectButtonBlur(_event) {
|
|
3079
|
-
this.renderer.removeClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
3080
|
-
}
|
|
3081
3060
|
subscribeBlur() {
|
|
3082
3061
|
if (!isDocumentAvailable()) {
|
|
3083
3062
|
return;
|
|
@@ -3086,7 +3065,7 @@ class FileSelectComponent {
|
|
|
3086
3065
|
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
3087
3066
|
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
3088
3067
|
}));
|
|
3089
|
-
this.blurSubscription = merge(this.documentClick, this.navigation.
|
|
3068
|
+
this.blurSubscription = merge(this.documentClick, this.navigation.onTabOut).subscribe(() => {
|
|
3090
3069
|
if (this.navigation.focused) {
|
|
3091
3070
|
this.ngZone.run(() => {
|
|
3092
3071
|
this.navigation.focused = false;
|
|
@@ -3109,15 +3088,14 @@ class FileSelectComponent {
|
|
|
3109
3088
|
if (this.disabled) {
|
|
3110
3089
|
return;
|
|
3111
3090
|
}
|
|
3112
|
-
if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space)
|
|
3113
|
-
event.target === this.fileSelectButton.nativeElement) {
|
|
3091
|
+
if (event.target === this.fileSelectButton.nativeElement && (event.keyCode === Keys.Enter || event.keyCode === Keys.Space)) {
|
|
3114
3092
|
event.preventDefault();
|
|
3115
3093
|
this.fileSelectInput.nativeElement.click();
|
|
3116
3094
|
return;
|
|
3117
3095
|
}
|
|
3118
3096
|
if (hasClasses(event.target, UPLOAD_CLASSES) ||
|
|
3119
3097
|
(!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
|
|
3120
|
-
this.navigation.process(event);
|
|
3098
|
+
this.navigation.process(event, 'fileselect');
|
|
3121
3099
|
}
|
|
3122
3100
|
}
|
|
3123
3101
|
attachEventHandlers() {
|
|
@@ -3199,6 +3177,7 @@ FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
3199
3177
|
type="button"
|
|
3200
3178
|
role="button"
|
|
3201
3179
|
(click)="fileSelectInput.click()"
|
|
3180
|
+
(focus)="onFileSelectButtonFocus()"
|
|
3202
3181
|
[id]="focusableId"
|
|
3203
3182
|
[attr.aria-label]="textFor('select')"
|
|
3204
3183
|
[attr.tabindex]="tabindex"
|
|
@@ -3206,14 +3185,10 @@ FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
3206
3185
|
>
|
|
3207
3186
|
{{textFor('select')}}
|
|
3208
3187
|
</button>
|
|
3209
|
-
<input
|
|
3210
|
-
#fileSelectInput
|
|
3211
|
-
kendoFileSelect
|
|
3212
|
-
class="k-hidden"
|
|
3188
|
+
<input kendoFileSelect #fileSelectInput
|
|
3213
3189
|
[id]="inputElementId"
|
|
3214
|
-
[attr.accept]="accept ? accept : null"
|
|
3215
|
-
[attr.aria-hidden]="true"
|
|
3216
3190
|
[dir]="direction"
|
|
3191
|
+
[accept]="accept"
|
|
3217
3192
|
[restrictions]="restrictions"
|
|
3218
3193
|
[multiple]="multiple"
|
|
3219
3194
|
[disabled]="disabled"
|
|
@@ -3229,7 +3204,7 @@ FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
3229
3204
|
[fileTemplate]="fileTemplate"
|
|
3230
3205
|
[fileInfoTemplate]="fileInfoTemplate">
|
|
3231
3206
|
</ul>
|
|
3232
|
-
`, 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: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }], directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3207
|
+
`, 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: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }], directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions", "accept"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3233
3208
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FileSelectComponent, decorators: [{
|
|
3234
3209
|
type: Component,
|
|
3235
3210
|
args: [{
|
|
@@ -3283,6 +3258,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3283
3258
|
type="button"
|
|
3284
3259
|
role="button"
|
|
3285
3260
|
(click)="fileSelectInput.click()"
|
|
3261
|
+
(focus)="onFileSelectButtonFocus()"
|
|
3286
3262
|
[id]="focusableId"
|
|
3287
3263
|
[attr.aria-label]="textFor('select')"
|
|
3288
3264
|
[attr.tabindex]="tabindex"
|
|
@@ -3290,14 +3266,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3290
3266
|
>
|
|
3291
3267
|
{{textFor('select')}}
|
|
3292
3268
|
</button>
|
|
3293
|
-
<input
|
|
3294
|
-
#fileSelectInput
|
|
3295
|
-
kendoFileSelect
|
|
3296
|
-
class="k-hidden"
|
|
3269
|
+
<input kendoFileSelect #fileSelectInput
|
|
3297
3270
|
[id]="inputElementId"
|
|
3298
|
-
[attr.accept]="accept ? accept : null"
|
|
3299
|
-
[attr.aria-hidden]="true"
|
|
3300
3271
|
[dir]="direction"
|
|
3272
|
+
[accept]="accept"
|
|
3301
3273
|
[restrictions]="restrictions"
|
|
3302
3274
|
[multiple]="multiple"
|
|
3303
3275
|
[disabled]="disabled"
|
|
@@ -3502,8 +3474,6 @@ class UploadActionButtonsComponent {
|
|
|
3502
3474
|
this.localization = localization;
|
|
3503
3475
|
this.navigation = navigation;
|
|
3504
3476
|
this.hostDefaultClass = true;
|
|
3505
|
-
this.onAction();
|
|
3506
|
-
this.onFocus();
|
|
3507
3477
|
}
|
|
3508
3478
|
get actionButtonsEndClassName() {
|
|
3509
3479
|
return this.actionsLayout === 'end';
|
|
@@ -3517,28 +3487,10 @@ class UploadActionButtonsComponent {
|
|
|
3517
3487
|
get actionButtonsCenterClassName() {
|
|
3518
3488
|
return this.actionsLayout === 'center';
|
|
3519
3489
|
}
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
}
|
|
3525
|
-
else {
|
|
3526
|
-
this.performUpload();
|
|
3527
|
-
}
|
|
3528
|
-
});
|
|
3529
|
-
}
|
|
3530
|
-
onFocus() {
|
|
3531
|
-
this.focusSubscription = this.navigation.onActionButtonFocus.subscribe((button) => {
|
|
3532
|
-
this.focusButton(button);
|
|
3533
|
-
});
|
|
3534
|
-
}
|
|
3535
|
-
focusButton(button) {
|
|
3536
|
-
const el = (button === "clear") ? this.clearButton : this.uploadButton;
|
|
3537
|
-
el.nativeElement.focus();
|
|
3538
|
-
}
|
|
3539
|
-
ngOnDestroy() {
|
|
3540
|
-
this.actionSubscription.unsubscribe();
|
|
3541
|
-
this.focusSubscription.unsubscribe();
|
|
3490
|
+
onUploadButtonFocus() {
|
|
3491
|
+
if (!this.navigation.focused) {
|
|
3492
|
+
this.navigation.focusedIndex = this.navigation.lastIndex;
|
|
3493
|
+
}
|
|
3542
3494
|
}
|
|
3543
3495
|
onUploadButtonClick(event) {
|
|
3544
3496
|
event.stopImmediatePropagation();
|
|
@@ -3571,6 +3523,7 @@ UploadActionButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12
|
|
|
3571
3523
|
{{textFor('clearSelectedFiles')}}
|
|
3572
3524
|
</button>
|
|
3573
3525
|
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
3526
|
+
(focus)="onUploadButtonFocus()"
|
|
3574
3527
|
(click)="onUploadButtonClick($event)">
|
|
3575
3528
|
{{textFor('uploadSelectedFiles')}}
|
|
3576
3529
|
</button>
|
|
@@ -3585,6 +3538,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3585
3538
|
{{textFor('clearSelectedFiles')}}
|
|
3586
3539
|
</button>
|
|
3587
3540
|
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
3541
|
+
(focus)="onUploadButtonFocus()"
|
|
3588
3542
|
(click)="onUploadButtonClick($event)">
|
|
3589
3543
|
{{textFor('uploadSelectedFiles')}}
|
|
3590
3544
|
</button>
|
|
@@ -3743,10 +3697,9 @@ class UploadComponent {
|
|
|
3743
3697
|
this.fileList = this.uploadService.files;
|
|
3744
3698
|
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
3745
3699
|
this.direction = rtl ? 'rtl' : 'ltr';
|
|
3746
|
-
this.navigation.computeKeys(this.direction);
|
|
3747
3700
|
});
|
|
3748
3701
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
3749
|
-
this.navigation.computeKeys(
|
|
3702
|
+
this.navigation.computeKeys();
|
|
3750
3703
|
this.wrapper = wrapper.nativeElement;
|
|
3751
3704
|
this.subscribeBlur();
|
|
3752
3705
|
this.subscribeFocus();
|
|
@@ -3996,6 +3949,14 @@ class UploadComponent {
|
|
|
3996
3949
|
setDisabledState(isDisabled) {
|
|
3997
3950
|
this.disabled = isDisabled;
|
|
3998
3951
|
}
|
|
3952
|
+
/**
|
|
3953
|
+
* @hidden
|
|
3954
|
+
*/
|
|
3955
|
+
onFileSelectButtonFocus() {
|
|
3956
|
+
if (!this.navigation.focused) {
|
|
3957
|
+
this.navigation.focusedIndex = -1;
|
|
3958
|
+
}
|
|
3959
|
+
}
|
|
3999
3960
|
/**
|
|
4000
3961
|
* @hidden
|
|
4001
3962
|
*/
|
|
@@ -4161,7 +4122,7 @@ class UploadComponent {
|
|
|
4161
4122
|
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
4162
4123
|
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
4163
4124
|
}));
|
|
4164
|
-
this.blurSubscription = merge(this.documentClick, this.navigation.
|
|
4125
|
+
this.blurSubscription = merge(this.documentClick, this.navigation.onTabOut).subscribe(() => {
|
|
4165
4126
|
if (this.navigation.focused) {
|
|
4166
4127
|
this.zone.run(() => {
|
|
4167
4128
|
this.navigation.focused = false;
|
|
@@ -4176,8 +4137,7 @@ class UploadComponent {
|
|
|
4176
4137
|
if (this.disabled) {
|
|
4177
4138
|
return;
|
|
4178
4139
|
}
|
|
4179
|
-
if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space)
|
|
4180
|
-
event.target === this.fileSelectButton.nativeElement) {
|
|
4140
|
+
if (event.target === this.fileSelectButton.nativeElement && (event.keyCode === Keys.Enter || event.keyCode === Keys.Space)) {
|
|
4181
4141
|
event.preventDefault();
|
|
4182
4142
|
this.fileSelectInput.nativeElement.click();
|
|
4183
4143
|
return;
|
|
@@ -4326,23 +4286,19 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
|
|
|
4326
4286
|
type="button"
|
|
4327
4287
|
role="button"
|
|
4328
4288
|
(click)="fileSelectInput.click()"
|
|
4289
|
+
(focus)="onFileSelectButtonFocus()"
|
|
4329
4290
|
[id]="focusableId"
|
|
4330
4291
|
[attr.aria-label]="textFor('select')"
|
|
4331
4292
|
[attr.tabindex]="tabindex"
|
|
4332
4293
|
>
|
|
4333
4294
|
{{textFor('select')}}
|
|
4334
4295
|
</button>
|
|
4335
|
-
<input
|
|
4336
|
-
#fileSelectInput
|
|
4337
|
-
kendoFileSelect
|
|
4338
|
-
class="k-hidden"
|
|
4339
|
-
[attr.accept]="accept ? accept : null"
|
|
4340
|
-
[attr.aria-hidden]="true"
|
|
4296
|
+
<input kendoFileSelect #fileSelectInput
|
|
4341
4297
|
[dir]="direction"
|
|
4298
|
+
[accept]="accept"
|
|
4342
4299
|
[restrictions]="restrictions"
|
|
4343
4300
|
[multiple]="multiple"
|
|
4344
|
-
[disabled]="disabled"
|
|
4345
|
-
/>
|
|
4301
|
+
[disabled]="disabled" />
|
|
4346
4302
|
</div>
|
|
4347
4303
|
<kendo-upload-status-total *ngIf="showTotalStatus"
|
|
4348
4304
|
class="k-upload-status"
|
|
@@ -4362,7 +4318,7 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
|
|
|
4362
4318
|
[disabled]="disabled"
|
|
4363
4319
|
[actionsLayout]="actionsLayout">
|
|
4364
4320
|
</kendo-upload-action-buttons>
|
|
4365
|
-
`, 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: UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: ["fileList"] }, { type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { type: UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: ["disabled", "actionsLayout"] }], directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4321
|
+
`, 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: UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: ["fileList"] }, { type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { type: UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: ["disabled", "actionsLayout"] }], directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions", "accept"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4366
4322
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UploadComponent, decorators: [{
|
|
4367
4323
|
type: Component,
|
|
4368
4324
|
args: [{
|
|
@@ -4459,23 +4415,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4459
4415
|
type="button"
|
|
4460
4416
|
role="button"
|
|
4461
4417
|
(click)="fileSelectInput.click()"
|
|
4418
|
+
(focus)="onFileSelectButtonFocus()"
|
|
4462
4419
|
[id]="focusableId"
|
|
4463
4420
|
[attr.aria-label]="textFor('select')"
|
|
4464
4421
|
[attr.tabindex]="tabindex"
|
|
4465
4422
|
>
|
|
4466
4423
|
{{textFor('select')}}
|
|
4467
4424
|
</button>
|
|
4468
|
-
<input
|
|
4469
|
-
#fileSelectInput
|
|
4470
|
-
kendoFileSelect
|
|
4471
|
-
class="k-hidden"
|
|
4472
|
-
[attr.accept]="accept ? accept : null"
|
|
4473
|
-
[attr.aria-hidden]="true"
|
|
4425
|
+
<input kendoFileSelect #fileSelectInput
|
|
4474
4426
|
[dir]="direction"
|
|
4427
|
+
[accept]="accept"
|
|
4475
4428
|
[restrictions]="restrictions"
|
|
4476
4429
|
[multiple]="multiple"
|
|
4477
|
-
[disabled]="disabled"
|
|
4478
|
-
/>
|
|
4430
|
+
[disabled]="disabled" />
|
|
4479
4431
|
</div>
|
|
4480
4432
|
<kendo-upload-status-total *ngIf="showTotalStatus"
|
|
4481
4433
|
class="k-upload-status"
|
|
@@ -18,16 +18,20 @@ export declare class FileSelectDirective {
|
|
|
18
18
|
disabled: boolean;
|
|
19
19
|
multiple: boolean;
|
|
20
20
|
restrictions: FileRestrictions;
|
|
21
|
+
accept: string;
|
|
21
22
|
type: string;
|
|
22
23
|
autocomplete: string;
|
|
23
24
|
tabIndex: number;
|
|
25
|
+
ariaHidden: boolean;
|
|
24
26
|
element: ElementRef;
|
|
25
27
|
constructor(uploadService: UploadService, navigation: NavigationService, el: ElementRef);
|
|
28
|
+
classNames: boolean;
|
|
26
29
|
get nameAttribute(): string;
|
|
27
30
|
get multipleAttribute(): string;
|
|
28
31
|
get dirAttribute(): string;
|
|
29
32
|
get disabledAttribute(): string;
|
|
33
|
+
get acceptAttribute(): string;
|
|
30
34
|
onInputChange(event: any): void;
|
|
31
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileSelectDirective, never>;
|
|
32
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<FileSelectDirective, "[kendoFileSelect]", never, { "dir": "dir"; "disabled": "disabled"; "multiple": "multiple"; "restrictions": "restrictions"; }, {}, never>;
|
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FileSelectDirective, "[kendoFileSelect]", never, { "dir": "dir"; "disabled": "disabled"; "multiple": "multiple"; "restrictions": "restrictions"; "accept": "accept"; }, {}, never>;
|
|
33
37
|
}
|
|
@@ -138,6 +138,10 @@ export declare class FileSelectComponent implements OnInit, OnDestroy {
|
|
|
138
138
|
* @hidden
|
|
139
139
|
*/
|
|
140
140
|
setDisabledState(isDisabled: boolean): void;
|
|
141
|
+
/**
|
|
142
|
+
* @hidden
|
|
143
|
+
*/
|
|
144
|
+
onFileSelectButtonFocus(): void;
|
|
141
145
|
/**
|
|
142
146
|
* Removes specific file from the file list.
|
|
143
147
|
*/
|
|
@@ -167,14 +171,6 @@ export declare class FileSelectComponent implements OnInit, OnDestroy {
|
|
|
167
171
|
buttonId: string;
|
|
168
172
|
inputId: string;
|
|
169
173
|
};
|
|
170
|
-
/**
|
|
171
|
-
* @hidden
|
|
172
|
-
*/
|
|
173
|
-
onFileSelectButtonFocus(_event?: any): void;
|
|
174
|
-
/**
|
|
175
|
-
* @hidden
|
|
176
|
-
*/
|
|
177
|
-
onFileSelectButtonBlur(_event?: any): void;
|
|
178
174
|
private subscribeBlur;
|
|
179
175
|
private subscribeFocus;
|
|
180
176
|
private handleKeydown;
|
package/navigation.service.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { EventEmitter, NgZone } from '@angular/core';
|
|
6
6
|
import { UploadService } from './upload.service';
|
|
7
|
-
import { Direction } from './types/direction';
|
|
8
7
|
import * as i0 from "@angular/core";
|
|
9
8
|
/**
|
|
10
9
|
* @hidden
|
|
@@ -12,11 +11,10 @@ import * as i0 from "@angular/core";
|
|
|
12
11
|
export declare class NavigationService {
|
|
13
12
|
private uploadService;
|
|
14
13
|
private zone;
|
|
15
|
-
onActionButtonAction: EventEmitter<string>;
|
|
16
14
|
onActionButtonFocus: EventEmitter<string>;
|
|
17
15
|
onFileAction: EventEmitter<number>;
|
|
18
16
|
onFileFocus: EventEmitter<number>;
|
|
19
|
-
|
|
17
|
+
onTabOut: EventEmitter<any>;
|
|
20
18
|
onWrapperFocus: EventEmitter<any>;
|
|
21
19
|
onSelectButtonFocus: EventEmitter<any>;
|
|
22
20
|
actionButtonsVisible: boolean;
|
|
@@ -25,17 +23,14 @@ export declare class NavigationService {
|
|
|
25
23
|
private _focusedIndex;
|
|
26
24
|
constructor(uploadService: UploadService, zone: NgZone);
|
|
27
25
|
action(event: any): Function;
|
|
28
|
-
process(event: KeyboardEvent): void;
|
|
29
|
-
computeKeys(
|
|
30
|
-
invertKeys(direction: Direction, original: any, inverted: any): any;
|
|
26
|
+
process(event: KeyboardEvent, component?: string): void;
|
|
27
|
+
computeKeys(): void;
|
|
31
28
|
focusSelectButton(): void;
|
|
32
|
-
handleEnter(
|
|
29
|
+
handleEnter(): void;
|
|
33
30
|
handleSpace(): void;
|
|
34
31
|
handleDelete(): void;
|
|
35
32
|
handleEscape(): void;
|
|
36
|
-
|
|
37
|
-
handleRight(): void;
|
|
38
|
-
handleTab(shifted: boolean): void;
|
|
33
|
+
handleTab(shifted: any, component: any): void;
|
|
39
34
|
handleDown(event: any): void;
|
|
40
35
|
handleUp(event: any): void;
|
|
41
36
|
get focusedIndex(): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-upload",
|
|
3
|
-
"version": "13.4.
|
|
3
|
+
"version": "13.4.1-develop.1",
|
|
4
4
|
"description": "Kendo UI Angular Upload Component",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"@angular/core": "13 - 16",
|
|
24
24
|
"@angular/platform-browser": "13 - 16",
|
|
25
25
|
"@progress/kendo-licensing": "^1.0.2",
|
|
26
|
-
"@progress/kendo-angular-common": "13.4.
|
|
27
|
-
"@progress/kendo-angular-l10n": "13.4.
|
|
28
|
-
"@progress/kendo-angular-icons": "13.4.
|
|
29
|
-
"@progress/kendo-angular-buttons": "13.4.
|
|
30
|
-
"@progress/kendo-angular-progressbar": "13.4.
|
|
26
|
+
"@progress/kendo-angular-common": "13.4.1-develop.1",
|
|
27
|
+
"@progress/kendo-angular-l10n": "13.4.1-develop.1",
|
|
28
|
+
"@progress/kendo-angular-icons": "13.4.1-develop.1",
|
|
29
|
+
"@progress/kendo-angular-buttons": "13.4.1-develop.1",
|
|
30
|
+
"@progress/kendo-angular-progressbar": "13.4.1-develop.1",
|
|
31
31
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"tslib": "^2.3.1",
|
|
35
|
-
"@progress/kendo-angular-schematics": "13.4.
|
|
35
|
+
"@progress/kendo-angular-schematics": "13.4.1-develop.1"
|
|
36
36
|
},
|
|
37
37
|
"schematics": "./schematics/collection.json",
|
|
38
38
|
"module": "fesm2015/progress-kendo-angular-upload.mjs",
|