@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
|
@@ -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: 1693387424,
|
|
1514
|
+
version: '13.4.1-develop.2',
|
|
1544
1515
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
1545
1516
|
};
|
|
1546
1517
|
|
|
@@ -2739,6 +2710,8 @@ class FileSelectDirective {
|
|
|
2739
2710
|
this.type = "file";
|
|
2740
2711
|
this.autocomplete = "off";
|
|
2741
2712
|
this.tabIndex = -1;
|
|
2713
|
+
this.ariaHidden = true;
|
|
2714
|
+
this.classNames = true;
|
|
2742
2715
|
this.element = el;
|
|
2743
2716
|
}
|
|
2744
2717
|
get nameAttribute() {
|
|
@@ -2753,6 +2726,9 @@ class FileSelectDirective {
|
|
|
2753
2726
|
get disabledAttribute() {
|
|
2754
2727
|
return this.disabled ? "true" : null;
|
|
2755
2728
|
}
|
|
2729
|
+
get acceptAttribute() {
|
|
2730
|
+
return this.accept ? this.accept : null;
|
|
2731
|
+
}
|
|
2756
2732
|
onInputChange(event) {
|
|
2757
2733
|
const ua = navigator.userAgent;
|
|
2758
2734
|
const webkit = /(webkit)[ \/]([\w.]+)/i;
|
|
@@ -2780,7 +2756,7 @@ class FileSelectDirective {
|
|
|
2780
2756
|
}
|
|
2781
2757
|
}
|
|
2782
2758
|
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 });
|
|
2783
|
-
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 });
|
|
2759
|
+
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 });
|
|
2784
2760
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FileSelectDirective, decorators: [{
|
|
2785
2761
|
type: Directive,
|
|
2786
2762
|
args: [{
|
|
@@ -2794,6 +2770,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
2794
2770
|
type: Input
|
|
2795
2771
|
}], restrictions: [{
|
|
2796
2772
|
type: Input
|
|
2773
|
+
}], accept: [{
|
|
2774
|
+
type: Input
|
|
2797
2775
|
}], type: [{
|
|
2798
2776
|
type: HostBinding,
|
|
2799
2777
|
args: ["attr.type"]
|
|
@@ -2803,6 +2781,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
2803
2781
|
}], tabIndex: [{
|
|
2804
2782
|
type: HostBinding,
|
|
2805
2783
|
args: ["attr.tabindex"]
|
|
2784
|
+
}], ariaHidden: [{
|
|
2785
|
+
type: HostBinding,
|
|
2786
|
+
args: ["attr.aria-hidden"]
|
|
2787
|
+
}], classNames: [{
|
|
2788
|
+
type: HostBinding,
|
|
2789
|
+
args: ["class.k-hidden"]
|
|
2806
2790
|
}], nameAttribute: [{
|
|
2807
2791
|
type: HostBinding,
|
|
2808
2792
|
args: ["attr.name"]
|
|
@@ -2815,6 +2799,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
2815
2799
|
}], disabledAttribute: [{
|
|
2816
2800
|
type: HostBinding,
|
|
2817
2801
|
args: ["attr.disabled"]
|
|
2802
|
+
}], acceptAttribute: [{
|
|
2803
|
+
type: HostBinding,
|
|
2804
|
+
args: ["attr.accept"]
|
|
2818
2805
|
}], onInputChange: [{
|
|
2819
2806
|
type: HostListener,
|
|
2820
2807
|
args: ["change", ["$event"]]
|
|
@@ -2895,11 +2882,10 @@ class FileSelectComponent {
|
|
|
2895
2882
|
validatePackage(packageMetadata);
|
|
2896
2883
|
this.wrapper = wrapper.nativeElement;
|
|
2897
2884
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
2898
|
-
this.navigation.computeKeys(
|
|
2885
|
+
this.navigation.computeKeys();
|
|
2899
2886
|
this.fileList = this.uploadService.files;
|
|
2900
2887
|
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
2901
2888
|
this.direction = rtl ? 'rtl' : 'ltr';
|
|
2902
|
-
this.navigation.computeKeys(this.direction);
|
|
2903
2889
|
});
|
|
2904
2890
|
this.subscribeBlur();
|
|
2905
2891
|
this.subscribeFocus();
|
|
@@ -3023,6 +3009,14 @@ class FileSelectComponent {
|
|
|
3023
3009
|
setDisabledState(isDisabled) {
|
|
3024
3010
|
this.disabled = isDisabled;
|
|
3025
3011
|
}
|
|
3012
|
+
/**
|
|
3013
|
+
* @hidden
|
|
3014
|
+
*/
|
|
3015
|
+
onFileSelectButtonFocus() {
|
|
3016
|
+
if (!this.navigation.focused) {
|
|
3017
|
+
this.navigation.focusedIndex = -1;
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
3026
3020
|
/**
|
|
3027
3021
|
* Removes specific file from the file list.
|
|
3028
3022
|
*/
|
|
@@ -3065,21 +3059,6 @@ class FileSelectComponent {
|
|
|
3065
3059
|
return { buttonId, inputId };
|
|
3066
3060
|
}
|
|
3067
3061
|
;
|
|
3068
|
-
/**
|
|
3069
|
-
* @hidden
|
|
3070
|
-
*/
|
|
3071
|
-
onFileSelectButtonFocus(_event) {
|
|
3072
|
-
this.renderer.addClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
3073
|
-
if (!this.navigation.focused) {
|
|
3074
|
-
this.navigation.focusedIndex = -1;
|
|
3075
|
-
}
|
|
3076
|
-
}
|
|
3077
|
-
/**
|
|
3078
|
-
* @hidden
|
|
3079
|
-
*/
|
|
3080
|
-
onFileSelectButtonBlur(_event) {
|
|
3081
|
-
this.renderer.removeClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
3082
|
-
}
|
|
3083
3062
|
subscribeBlur() {
|
|
3084
3063
|
if (!isDocumentAvailable()) {
|
|
3085
3064
|
return;
|
|
@@ -3088,7 +3067,7 @@ class FileSelectComponent {
|
|
|
3088
3067
|
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
3089
3068
|
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
3090
3069
|
}));
|
|
3091
|
-
this.blurSubscription = merge(this.documentClick, this.navigation.
|
|
3070
|
+
this.blurSubscription = merge(this.documentClick, this.navigation.onTabOut).subscribe(() => {
|
|
3092
3071
|
if (this.navigation.focused) {
|
|
3093
3072
|
this.ngZone.run(() => {
|
|
3094
3073
|
this.navigation.focused = false;
|
|
@@ -3111,15 +3090,14 @@ class FileSelectComponent {
|
|
|
3111
3090
|
if (this.disabled) {
|
|
3112
3091
|
return;
|
|
3113
3092
|
}
|
|
3114
|
-
if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space)
|
|
3115
|
-
event.target === this.fileSelectButton.nativeElement) {
|
|
3093
|
+
if (event.target === this.fileSelectButton.nativeElement && (event.keyCode === Keys.Enter || event.keyCode === Keys.Space)) {
|
|
3116
3094
|
event.preventDefault();
|
|
3117
3095
|
this.fileSelectInput.nativeElement.click();
|
|
3118
3096
|
return;
|
|
3119
3097
|
}
|
|
3120
3098
|
if (hasClasses(event.target, UPLOAD_CLASSES) ||
|
|
3121
3099
|
(!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
|
|
3122
|
-
this.navigation.process(event);
|
|
3100
|
+
this.navigation.process(event, 'fileselect');
|
|
3123
3101
|
}
|
|
3124
3102
|
}
|
|
3125
3103
|
attachEventHandlers() {
|
|
@@ -3201,6 +3179,7 @@ FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
3201
3179
|
type="button"
|
|
3202
3180
|
role="button"
|
|
3203
3181
|
(click)="fileSelectInput.click()"
|
|
3182
|
+
(focus)="onFileSelectButtonFocus()"
|
|
3204
3183
|
[id]="focusableId"
|
|
3205
3184
|
[attr.aria-label]="textFor('select')"
|
|
3206
3185
|
[attr.tabindex]="tabindex"
|
|
@@ -3208,14 +3187,10 @@ FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
3208
3187
|
>
|
|
3209
3188
|
{{textFor('select')}}
|
|
3210
3189
|
</button>
|
|
3211
|
-
<input
|
|
3212
|
-
#fileSelectInput
|
|
3213
|
-
kendoFileSelect
|
|
3214
|
-
class="k-hidden"
|
|
3190
|
+
<input kendoFileSelect #fileSelectInput
|
|
3215
3191
|
[id]="inputElementId"
|
|
3216
|
-
[attr.accept]="accept ? accept : null"
|
|
3217
|
-
[attr.aria-hidden]="true"
|
|
3218
3192
|
[dir]="direction"
|
|
3193
|
+
[accept]="accept"
|
|
3219
3194
|
[restrictions]="restrictions"
|
|
3220
3195
|
[multiple]="multiple"
|
|
3221
3196
|
[disabled]="disabled"
|
|
@@ -3231,7 +3206,7 @@ FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
3231
3206
|
[fileTemplate]="fileTemplate"
|
|
3232
3207
|
[fileInfoTemplate]="fileInfoTemplate">
|
|
3233
3208
|
</ul>
|
|
3234
|
-
`, 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"] }] });
|
|
3209
|
+
`, 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"] }] });
|
|
3235
3210
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FileSelectComponent, decorators: [{
|
|
3236
3211
|
type: Component,
|
|
3237
3212
|
args: [{
|
|
@@ -3285,6 +3260,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3285
3260
|
type="button"
|
|
3286
3261
|
role="button"
|
|
3287
3262
|
(click)="fileSelectInput.click()"
|
|
3263
|
+
(focus)="onFileSelectButtonFocus()"
|
|
3288
3264
|
[id]="focusableId"
|
|
3289
3265
|
[attr.aria-label]="textFor('select')"
|
|
3290
3266
|
[attr.tabindex]="tabindex"
|
|
@@ -3292,14 +3268,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3292
3268
|
>
|
|
3293
3269
|
{{textFor('select')}}
|
|
3294
3270
|
</button>
|
|
3295
|
-
<input
|
|
3296
|
-
#fileSelectInput
|
|
3297
|
-
kendoFileSelect
|
|
3298
|
-
class="k-hidden"
|
|
3271
|
+
<input kendoFileSelect #fileSelectInput
|
|
3299
3272
|
[id]="inputElementId"
|
|
3300
|
-
[attr.accept]="accept ? accept : null"
|
|
3301
|
-
[attr.aria-hidden]="true"
|
|
3302
3273
|
[dir]="direction"
|
|
3274
|
+
[accept]="accept"
|
|
3303
3275
|
[restrictions]="restrictions"
|
|
3304
3276
|
[multiple]="multiple"
|
|
3305
3277
|
[disabled]="disabled"
|
|
@@ -3504,8 +3476,6 @@ class UploadActionButtonsComponent {
|
|
|
3504
3476
|
this.localization = localization;
|
|
3505
3477
|
this.navigation = navigation;
|
|
3506
3478
|
this.hostDefaultClass = true;
|
|
3507
|
-
this.onAction();
|
|
3508
|
-
this.onFocus();
|
|
3509
3479
|
}
|
|
3510
3480
|
get actionButtonsEndClassName() {
|
|
3511
3481
|
return this.actionsLayout === 'end';
|
|
@@ -3519,28 +3489,10 @@ class UploadActionButtonsComponent {
|
|
|
3519
3489
|
get actionButtonsCenterClassName() {
|
|
3520
3490
|
return this.actionsLayout === 'center';
|
|
3521
3491
|
}
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
}
|
|
3527
|
-
else {
|
|
3528
|
-
this.performUpload();
|
|
3529
|
-
}
|
|
3530
|
-
});
|
|
3531
|
-
}
|
|
3532
|
-
onFocus() {
|
|
3533
|
-
this.focusSubscription = this.navigation.onActionButtonFocus.subscribe((button) => {
|
|
3534
|
-
this.focusButton(button);
|
|
3535
|
-
});
|
|
3536
|
-
}
|
|
3537
|
-
focusButton(button) {
|
|
3538
|
-
const el = (button === "clear") ? this.clearButton : this.uploadButton;
|
|
3539
|
-
el.nativeElement.focus();
|
|
3540
|
-
}
|
|
3541
|
-
ngOnDestroy() {
|
|
3542
|
-
this.actionSubscription.unsubscribe();
|
|
3543
|
-
this.focusSubscription.unsubscribe();
|
|
3492
|
+
onUploadButtonFocus() {
|
|
3493
|
+
if (!this.navigation.focused) {
|
|
3494
|
+
this.navigation.focusedIndex = this.navigation.lastIndex;
|
|
3495
|
+
}
|
|
3544
3496
|
}
|
|
3545
3497
|
onUploadButtonClick(event) {
|
|
3546
3498
|
event.stopImmediatePropagation();
|
|
@@ -3573,6 +3525,7 @@ UploadActionButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12
|
|
|
3573
3525
|
{{textFor('clearSelectedFiles')}}
|
|
3574
3526
|
</button>
|
|
3575
3527
|
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
3528
|
+
(focus)="onUploadButtonFocus()"
|
|
3576
3529
|
(click)="onUploadButtonClick($event)">
|
|
3577
3530
|
{{textFor('uploadSelectedFiles')}}
|
|
3578
3531
|
</button>
|
|
@@ -3587,6 +3540,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3587
3540
|
{{textFor('clearSelectedFiles')}}
|
|
3588
3541
|
</button>
|
|
3589
3542
|
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
3543
|
+
(focus)="onUploadButtonFocus()"
|
|
3590
3544
|
(click)="onUploadButtonClick($event)">
|
|
3591
3545
|
{{textFor('uploadSelectedFiles')}}
|
|
3592
3546
|
</button>
|
|
@@ -3744,10 +3698,9 @@ class UploadComponent {
|
|
|
3744
3698
|
this.fileList = this.uploadService.files;
|
|
3745
3699
|
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
3746
3700
|
this.direction = rtl ? 'rtl' : 'ltr';
|
|
3747
|
-
this.navigation.computeKeys(this.direction);
|
|
3748
3701
|
});
|
|
3749
3702
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
3750
|
-
this.navigation.computeKeys(
|
|
3703
|
+
this.navigation.computeKeys();
|
|
3751
3704
|
this.wrapper = wrapper.nativeElement;
|
|
3752
3705
|
this.subscribeBlur();
|
|
3753
3706
|
this.subscribeFocus();
|
|
@@ -3997,6 +3950,14 @@ class UploadComponent {
|
|
|
3997
3950
|
setDisabledState(isDisabled) {
|
|
3998
3951
|
this.disabled = isDisabled;
|
|
3999
3952
|
}
|
|
3953
|
+
/**
|
|
3954
|
+
* @hidden
|
|
3955
|
+
*/
|
|
3956
|
+
onFileSelectButtonFocus() {
|
|
3957
|
+
if (!this.navigation.focused) {
|
|
3958
|
+
this.navigation.focusedIndex = -1;
|
|
3959
|
+
}
|
|
3960
|
+
}
|
|
4000
3961
|
/**
|
|
4001
3962
|
* @hidden
|
|
4002
3963
|
*/
|
|
@@ -4162,7 +4123,7 @@ class UploadComponent {
|
|
|
4162
4123
|
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
4163
4124
|
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
4164
4125
|
}));
|
|
4165
|
-
this.blurSubscription = merge(this.documentClick, this.navigation.
|
|
4126
|
+
this.blurSubscription = merge(this.documentClick, this.navigation.onTabOut).subscribe(() => {
|
|
4166
4127
|
if (this.navigation.focused) {
|
|
4167
4128
|
this.zone.run(() => {
|
|
4168
4129
|
this.navigation.focused = false;
|
|
@@ -4177,8 +4138,7 @@ class UploadComponent {
|
|
|
4177
4138
|
if (this.disabled) {
|
|
4178
4139
|
return;
|
|
4179
4140
|
}
|
|
4180
|
-
if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space)
|
|
4181
|
-
event.target === this.fileSelectButton.nativeElement) {
|
|
4141
|
+
if (event.target === this.fileSelectButton.nativeElement && (event.keyCode === Keys.Enter || event.keyCode === Keys.Space)) {
|
|
4182
4142
|
event.preventDefault();
|
|
4183
4143
|
this.fileSelectInput.nativeElement.click();
|
|
4184
4144
|
return;
|
|
@@ -4327,23 +4287,19 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
|
|
|
4327
4287
|
type="button"
|
|
4328
4288
|
role="button"
|
|
4329
4289
|
(click)="fileSelectInput.click()"
|
|
4290
|
+
(focus)="onFileSelectButtonFocus()"
|
|
4330
4291
|
[id]="focusableId"
|
|
4331
4292
|
[attr.aria-label]="textFor('select')"
|
|
4332
4293
|
[attr.tabindex]="tabindex"
|
|
4333
4294
|
>
|
|
4334
4295
|
{{textFor('select')}}
|
|
4335
4296
|
</button>
|
|
4336
|
-
<input
|
|
4337
|
-
#fileSelectInput
|
|
4338
|
-
kendoFileSelect
|
|
4339
|
-
class="k-hidden"
|
|
4340
|
-
[attr.accept]="accept ? accept : null"
|
|
4341
|
-
[attr.aria-hidden]="true"
|
|
4297
|
+
<input kendoFileSelect #fileSelectInput
|
|
4342
4298
|
[dir]="direction"
|
|
4299
|
+
[accept]="accept"
|
|
4343
4300
|
[restrictions]="restrictions"
|
|
4344
4301
|
[multiple]="multiple"
|
|
4345
|
-
[disabled]="disabled"
|
|
4346
|
-
/>
|
|
4302
|
+
[disabled]="disabled" />
|
|
4347
4303
|
</div>
|
|
4348
4304
|
<kendo-upload-status-total *ngIf="showTotalStatus"
|
|
4349
4305
|
class="k-upload-status"
|
|
@@ -4363,7 +4319,7 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
|
|
|
4363
4319
|
[disabled]="disabled"
|
|
4364
4320
|
[actionsLayout]="actionsLayout">
|
|
4365
4321
|
</kendo-upload-action-buttons>
|
|
4366
|
-
`, 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"] }] });
|
|
4322
|
+
`, 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"] }] });
|
|
4367
4323
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UploadComponent, decorators: [{
|
|
4368
4324
|
type: Component,
|
|
4369
4325
|
args: [{
|
|
@@ -4460,23 +4416,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4460
4416
|
type="button"
|
|
4461
4417
|
role="button"
|
|
4462
4418
|
(click)="fileSelectInput.click()"
|
|
4419
|
+
(focus)="onFileSelectButtonFocus()"
|
|
4463
4420
|
[id]="focusableId"
|
|
4464
4421
|
[attr.aria-label]="textFor('select')"
|
|
4465
4422
|
[attr.tabindex]="tabindex"
|
|
4466
4423
|
>
|
|
4467
4424
|
{{textFor('select')}}
|
|
4468
4425
|
</button>
|
|
4469
|
-
<input
|
|
4470
|
-
#fileSelectInput
|
|
4471
|
-
kendoFileSelect
|
|
4472
|
-
class="k-hidden"
|
|
4473
|
-
[attr.accept]="accept ? accept : null"
|
|
4474
|
-
[attr.aria-hidden]="true"
|
|
4426
|
+
<input kendoFileSelect #fileSelectInput
|
|
4475
4427
|
[dir]="direction"
|
|
4428
|
+
[accept]="accept"
|
|
4476
4429
|
[restrictions]="restrictions"
|
|
4477
4430
|
[multiple]="multiple"
|
|
4478
|
-
[disabled]="disabled"
|
|
4479
|
-
/>
|
|
4431
|
+
[disabled]="disabled" />
|
|
4480
4432
|
</div>
|
|
4481
4433
|
<kendo-upload-status-total *ngIf="showTotalStatus"
|
|
4482
4434
|
class="k-upload-status"
|