@progress/kendo-angular-spreadsheet 14.0.0-develop.2 → 14.0.0-develop.3
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/action-bar/namebox.component.d.ts +4 -1
- package/esm2020/action-bar/namebox.component.mjs +13 -5
- package/esm2020/localization/messages.mjs +7 -1
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/sheets-bar/action-dialog.component.mjs +2 -2
- package/esm2020/sheets-bar/sheets-bar.component.mjs +158 -62
- package/esm2020/sheets-bar/spreadsheet-tabstrip.directive.mjs +59 -0
- package/esm2020/spreadsheet.component.mjs +24 -17
- package/esm2020/spreadsheet.module.mjs +3 -3
- package/esm2020/tools/shared/spreadsheet-command-base.mjs +0 -7
- package/fesm2015/progress-kendo-angular-spreadsheet.mjs +249 -113
- package/fesm2020/progress-kendo-angular-spreadsheet.mjs +249 -113
- package/localization/messages.d.ts +13 -1
- package/package.json +13 -13
- package/schematics/ngAdd/index.js +1 -1
- package/sheets-bar/sheets-bar.component.d.ts +20 -4
- package/sheets-bar/spreadsheet-tabstrip.directive.d.ts +22 -0
- package/spreadsheet.module.d.ts +2 -2
- package/esm2020/sheets-bar/remove.directive.mjs +0 -25
- package/sheets-bar/remove.directive.d.ts +0 -13
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { ElementRef, NgZone } from '@angular/core';
|
|
6
6
|
import { SpreadsheetWidget } from '@progress/kendo-spreadsheet-common';
|
|
7
7
|
import { Observable } from 'rxjs';
|
|
8
|
+
import { SpreadsheetLocalizationService } from '../localization/spreadsheet-localization.service';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* @hidden
|
|
@@ -12,14 +13,16 @@ import * as i0 from "@angular/core";
|
|
|
12
13
|
export declare class NameBoxComponent {
|
|
13
14
|
private ngZone;
|
|
14
15
|
private host;
|
|
16
|
+
protected localization: SpreadsheetLocalizationService;
|
|
15
17
|
hostClass: boolean;
|
|
16
18
|
keyDownHandler(): void;
|
|
17
19
|
private combobox;
|
|
18
20
|
data: any[];
|
|
19
21
|
spreadsheetWidget: SpreadsheetWidget;
|
|
20
|
-
constructor(ngZone: NgZone, host: ElementRef);
|
|
22
|
+
constructor(ngZone: NgZone, host: ElementRef, localization: SpreadsheetLocalizationService);
|
|
21
23
|
value: any;
|
|
22
24
|
get current(): any;
|
|
25
|
+
get title(): string;
|
|
23
26
|
onSelectionChange(value: any): void;
|
|
24
27
|
onOpen(): void;
|
|
25
28
|
valueNormalizer: (text: Observable<string>) => Observable<{
|
|
@@ -6,15 +6,18 @@ import { ComboBoxComponent } from '@progress/kendo-angular-dropdowns';
|
|
|
6
6
|
import { Component, ElementRef, HostBinding, HostListener, Input, NgZone, ViewChild } from '@angular/core';
|
|
7
7
|
import { SpreadsheetWidget } from '@progress/kendo-spreadsheet-common';
|
|
8
8
|
import { map } from 'rxjs/operators';
|
|
9
|
+
import { SpreadsheetLocalizationService } from '../localization/spreadsheet-localization.service';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
|
-
import * as i1 from "
|
|
11
|
+
import * as i1 from "../localization/spreadsheet-localization.service";
|
|
12
|
+
import * as i2 from "@progress/kendo-angular-dropdowns";
|
|
11
13
|
/**
|
|
12
14
|
* @hidden
|
|
13
15
|
*/
|
|
14
16
|
export class NameBoxComponent {
|
|
15
|
-
constructor(ngZone, host) {
|
|
17
|
+
constructor(ngZone, host, localization) {
|
|
16
18
|
this.ngZone = ngZone;
|
|
17
19
|
this.host = host;
|
|
20
|
+
this.localization = localization;
|
|
18
21
|
this.hostClass = true;
|
|
19
22
|
this.valueNormalizer = (text) => text.pipe(map((content) => ({ name: content })));
|
|
20
23
|
}
|
|
@@ -40,6 +43,9 @@ export class NameBoxComponent {
|
|
|
40
43
|
}
|
|
41
44
|
};
|
|
42
45
|
}
|
|
46
|
+
get title() {
|
|
47
|
+
return this.localization.get('nameBox');
|
|
48
|
+
}
|
|
43
49
|
onSelectionChange(value) {
|
|
44
50
|
const editor = this.spreadsheetWidget.view.nameEditor;
|
|
45
51
|
if (editor && value) {
|
|
@@ -58,7 +64,7 @@ export class NameBoxComponent {
|
|
|
58
64
|
}
|
|
59
65
|
;
|
|
60
66
|
}
|
|
61
|
-
NameBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: NameBoxComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
+
NameBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: NameBoxComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }, { token: i1.SpreadsheetLocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
62
68
|
NameBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: NameBoxComponent, selector: "[kendoSpreadsheetNameBox]", inputs: { data: "data", spreadsheetWidget: "spreadsheetWidget" }, host: { listeners: { "keydown.enter": "keyDownHandler()" }, properties: { "class.k-spreadsheet-name-editor": "this.hostClass" } }, viewQueries: [{ propertyName: "combobox", first: true, predicate: ["combobox"], descendants: true }], ngImport: i0, template: `
|
|
63
69
|
<kendo-combobox #combobox
|
|
64
70
|
[popupSettings]="{popupClass: 'k-spreadsheet-names-popup'}"
|
|
@@ -72,8 +78,9 @@ NameBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
72
78
|
[value]="value"
|
|
73
79
|
(open)="onOpen()"
|
|
74
80
|
[valueNormalizer]="valueNormalizer"
|
|
81
|
+
[attr.title]="title"
|
|
75
82
|
></kendo-combobox>
|
|
76
|
-
`, isInline: true, components: [{ type:
|
|
83
|
+
`, isInline: true, components: [{ type: i2.ComboBoxComponent, selector: "kendo-combobox", inputs: ["showStickyHeader", "focusableId", "allowCustom", "data", "value", "textField", "valueField", "valuePrimitive", "valueNormalizer", "placeholder", "adaptiveMode", "title", "subtitle", "popupSettings", "listHeight", "iconClass", "loading", "suggest", "clearButton", "disabled", "itemDisabled", "readonly", "tabindex", "tabIndex", "filterable", "virtual", "size", "rounded", "fillMode"], outputs: ["valueChange", "selectionChange", "filterChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoComboBox"] }] });
|
|
77
84
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: NameBoxComponent, decorators: [{
|
|
78
85
|
type: Component,
|
|
79
86
|
args: [{
|
|
@@ -91,10 +98,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
91
98
|
[value]="value"
|
|
92
99
|
(open)="onOpen()"
|
|
93
100
|
[valueNormalizer]="valueNormalizer"
|
|
101
|
+
[attr.title]="title"
|
|
94
102
|
></kendo-combobox>
|
|
95
103
|
`
|
|
96
104
|
}]
|
|
97
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { hostClass: [{
|
|
105
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: i1.SpreadsheetLocalizationService }]; }, propDecorators: { hostClass: [{
|
|
98
106
|
type: HostBinding,
|
|
99
107
|
args: ['class.k-spreadsheet-name-editor']
|
|
100
108
|
}], keyDownHandler: [{
|
|
@@ -11,7 +11,7 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
export class MessagesDirective extends ComponentMessages {
|
|
12
12
|
}
|
|
13
13
|
MessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessagesDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
14
|
-
MessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: MessagesDirective, selector: "[kendoSpreadsheetMessages]", inputs: { home: "home", file: "file", insert: "insert", saveFile: "saveFile", loadFile: "loadFile", bold: "bold", italic: "italic", underline: "underline", format: "format", fontFamily: "fontFamily", fontSize: "fontSize", undo: "undo", redo: "redo", background: "background", color: "color", gridLines: "gridLines", addColumnLeft: "addColumnLeft", addColumnRight: "addColumnRight", addRowBelow: "addRowBelow", addRowAbove: "addRowAbove", deleteColumn: "deleteColumn", deleteRow: "deleteRow", wrap: "wrap", align: "align", dialogApply: "dialogApply", dialogCancel: "dialogCancel", dialogDelete: "dialogDelete", dialogRename: "dialogRename", delete: "delete", rename: "rename" }, usesInheritance: true, ngImport: i0 });
|
|
14
|
+
MessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: MessagesDirective, selector: "[kendoSpreadsheetMessages]", inputs: { home: "home", file: "file", insert: "insert", saveFile: "saveFile", loadFile: "loadFile", bold: "bold", italic: "italic", underline: "underline", format: "format", fontFamily: "fontFamily", fontSize: "fontSize", undo: "undo", redo: "redo", background: "background", color: "color", gridLines: "gridLines", addColumnLeft: "addColumnLeft", addColumnRight: "addColumnRight", addRowBelow: "addRowBelow", addRowAbove: "addRowAbove", deleteColumn: "deleteColumn", deleteRow: "deleteRow", wrap: "wrap", align: "align", dialogApply: "dialogApply", dialogCancel: "dialogCancel", dialogDelete: "dialogDelete", dialogRename: "dialogRename", delete: "delete", rename: "rename", nameBox: "nameBox", addSheet: "addSheet", sheetsMenu: "sheetsMenu" }, usesInheritance: true, ngImport: i0 });
|
|
15
15
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessagesDirective, decorators: [{
|
|
16
16
|
type: Directive,
|
|
17
17
|
args: [{
|
|
@@ -77,4 +77,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
77
77
|
type: Input
|
|
78
78
|
}], rename: [{
|
|
79
79
|
type: Input
|
|
80
|
+
}], nameBox: [{
|
|
81
|
+
type: Input
|
|
82
|
+
}], addSheet: [{
|
|
83
|
+
type: Input
|
|
84
|
+
}], sheetsMenu: [{
|
|
85
|
+
type: Input
|
|
80
86
|
}] } });
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-spreadsheet',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
13
|
-
version: '14.0.0-develop.
|
|
12
|
+
publishDate: 1696001484,
|
|
13
|
+
version: '14.0.0-develop.3',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning',
|
|
15
15
|
};
|
|
@@ -29,7 +29,7 @@ ActionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
29
29
|
<p>Are you sure you want to proceed?</p>
|
|
30
30
|
</ng-container>
|
|
31
31
|
|
|
32
|
-
<form class="k-form k-form-md" *ngIf="commandName === 'rename'">
|
|
32
|
+
<form class="k-form k-form-md" *ngIf="commandName === 'rename'" method="dialog">
|
|
33
33
|
<div class="k-form-field">
|
|
34
34
|
<label class="k-label k-form-label">Rename sheet</label>
|
|
35
35
|
<div class="k-form-field-wrap">
|
|
@@ -51,7 +51,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
51
51
|
<p>Are you sure you want to proceed?</p>
|
|
52
52
|
</ng-container>
|
|
53
53
|
|
|
54
|
-
<form class="k-form k-form-md" *ngIf="commandName === 'rename'">
|
|
54
|
+
<form class="k-form k-form-md" *ngIf="commandName === 'rename'" method="dialog">
|
|
55
55
|
<div class="k-form-field">
|
|
56
56
|
<label class="k-label k-form-label">Rename sheet</label>
|
|
57
57
|
<div class="k-form-field-wrap">
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, ElementRef, HostBinding, Input, NgZone, Renderer2 } from '@angular/core';
|
|
5
|
+
import { Component, ElementRef, HostBinding, HostListener, Input, NgZone, Renderer2, ViewChild } from '@angular/core';
|
|
6
6
|
import { caretAltDownIcon, menuIcon, plusIcon, caretAltLeftIcon, caretAltRightIcon, eyeIcon } from '@progress/kendo-svg-icons';
|
|
7
7
|
import { SpreadsheetService } from '../common/spreadsheet.service';
|
|
8
|
-
import {
|
|
8
|
+
import { ButtonComponent, DropDownButtonComponent } from '@progress/kendo-angular-buttons';
|
|
9
|
+
import { Keys, isDocumentAvailable, isPresent } from '@progress/kendo-angular-common';
|
|
9
10
|
import { DialogService } from '@progress/kendo-angular-dialog';
|
|
10
11
|
import { SpreadsheetLocalizationService } from '../localization/spreadsheet-localization.service';
|
|
11
12
|
import { take } from 'rxjs/operators';
|
|
12
13
|
import { ActionDialogComponent } from './action-dialog.component';
|
|
14
|
+
import { TabStripComponent } from '@progress/kendo-angular-layout';
|
|
13
15
|
import { mapToSheetDescriptor } from '../utils';
|
|
14
16
|
import { getSheetActions } from './utils';
|
|
15
17
|
import * as i0 from "@angular/core";
|
|
@@ -19,7 +21,8 @@ import * as i3 from "@progress/kendo-angular-dialog";
|
|
|
19
21
|
import * as i4 from "@progress/kendo-angular-buttons";
|
|
20
22
|
import * as i5 from "@progress/kendo-angular-layout";
|
|
21
23
|
import * as i6 from "@progress/kendo-angular-common";
|
|
22
|
-
import * as i7 from "
|
|
24
|
+
import * as i7 from "./spreadsheet-tabstrip.directive";
|
|
25
|
+
import * as i8 from "@angular/common";
|
|
23
26
|
/**
|
|
24
27
|
* @hidden
|
|
25
28
|
*/
|
|
@@ -40,6 +43,7 @@ export class SheetsBarComponent {
|
|
|
40
43
|
this.selected = false;
|
|
41
44
|
this.openedDdb = null;
|
|
42
45
|
this.eyeIcon = eyeIcon;
|
|
46
|
+
this.focusedEl = null;
|
|
43
47
|
this.onAddClick = () => {
|
|
44
48
|
if (this.spreadsheetService.spreadsheet) {
|
|
45
49
|
this.spreadsheetService.spreadsheet.view.sheetsbar.onAddSelect();
|
|
@@ -63,6 +67,14 @@ export class SheetsBarComponent {
|
|
|
63
67
|
}
|
|
64
68
|
};
|
|
65
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
onFocus() {
|
|
74
|
+
this.renderer.setAttribute(this.element.nativeElement, 'tabindex', '-1');
|
|
75
|
+
this.addButton.focus();
|
|
76
|
+
this.focusedEl = this.addButton;
|
|
77
|
+
}
|
|
66
78
|
get activeSheet() {
|
|
67
79
|
return this.spreadsheetService.spreadsheet?.activeSheet()?.name();
|
|
68
80
|
}
|
|
@@ -77,6 +89,23 @@ export class SheetsBarComponent {
|
|
|
77
89
|
const nextBtn = this.element.nativeElement.querySelector('.k-tabstrip-next');
|
|
78
90
|
this.renderer.addClass(prevBtn, 'k-order-1');
|
|
79
91
|
this.renderer.addClass(nextBtn, 'k-order-2');
|
|
92
|
+
this.renderer.setAttribute(this.element.nativeElement, 'tabindex', '0');
|
|
93
|
+
this.hostKeyDownSub = this.renderer.listen(this.element.nativeElement, 'keydown', (ev) => this.onHostKeyDown(ev));
|
|
94
|
+
}
|
|
95
|
+
ngOnDestroy() {
|
|
96
|
+
if (this.hostKeyDownSub) {
|
|
97
|
+
this.hostKeyDownSub();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
onTabStripNavigationEnd(ev) {
|
|
101
|
+
if (ev === 'last') {
|
|
102
|
+
this.addButton.focus();
|
|
103
|
+
this.focusedEl = this.addButton;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
this.menuButton.focus();
|
|
107
|
+
this.focusedEl = this.menuButton;
|
|
108
|
+
}
|
|
80
109
|
}
|
|
81
110
|
onTabSelect(ev) {
|
|
82
111
|
if (ev.title !== this.activeSheet) {
|
|
@@ -107,16 +136,19 @@ export class SheetsBarComponent {
|
|
|
107
136
|
const sheet = this.sheets.find(s => s.text === item.text);
|
|
108
137
|
this.selectSheet(sheet.text);
|
|
109
138
|
}
|
|
139
|
+
messageFor(key) {
|
|
140
|
+
return this.localization.get(key);
|
|
141
|
+
}
|
|
110
142
|
openDialog(dataItem, sheet) {
|
|
111
143
|
const dialogSettings = {
|
|
112
144
|
appendTo: this.spreadsheetService.dialogContainer,
|
|
113
|
-
title: this.
|
|
145
|
+
title: this.messageFor(dataItem.commandName),
|
|
114
146
|
content: ActionDialogComponent,
|
|
115
147
|
actions: [{
|
|
116
|
-
text: this.
|
|
148
|
+
text: this.messageFor(dataItem.dialogButton),
|
|
117
149
|
themeColor: 'primary'
|
|
118
150
|
}, {
|
|
119
|
-
text: this.
|
|
151
|
+
text: this.messageFor('dialogCancel')
|
|
120
152
|
}],
|
|
121
153
|
actionsLayout: 'stretched',
|
|
122
154
|
autoFocusedElement: '.k-textbox .k-input-inner, .k-button-solid-primary'
|
|
@@ -125,7 +157,7 @@ export class SheetsBarComponent {
|
|
|
125
157
|
const dialogInstance = dialog.dialog.instance;
|
|
126
158
|
const dialogContent = dialog.content.instance;
|
|
127
159
|
dialogInstance.action.pipe(take(1)).subscribe((event) => {
|
|
128
|
-
if (event.text === this.
|
|
160
|
+
if (event.text === this.messageFor(dataItem.dialogButton)) {
|
|
129
161
|
const sheetsBar = this.spreadsheetService.spreadsheet.view.sheetsbar;
|
|
130
162
|
if (sheetsBar) {
|
|
131
163
|
dataItem.commandName === 'delete' ? sheetsBar.onSheetRemove(sheet.text) : sheetsBar.onSheetRename(dialogContent.value, this.sheets.indexOf(sheet));
|
|
@@ -150,7 +182,6 @@ export class SheetsBarComponent {
|
|
|
150
182
|
this.ngZone.run(() => {
|
|
151
183
|
const newSheets = this.spreadsheetService.spreadsheet.sheets();
|
|
152
184
|
const sheetDesc = mapToSheetDescriptor(newSheets);
|
|
153
|
-
console.log(newSheets, 'new');
|
|
154
185
|
this.sheets = sheetDesc.map((item, index, items) => ({
|
|
155
186
|
...item,
|
|
156
187
|
inEdit: false,
|
|
@@ -163,108 +194,161 @@ export class SheetsBarComponent {
|
|
|
163
194
|
}));
|
|
164
195
|
});
|
|
165
196
|
}
|
|
197
|
+
onHostKeyDown(ev) {
|
|
198
|
+
const activeSheetIndex = this.sheets.find(s => s.name === this.activeSheet).index;
|
|
199
|
+
switch (ev.keyCode) {
|
|
200
|
+
case Keys.ArrowRight:
|
|
201
|
+
this.focusNext(activeSheetIndex);
|
|
202
|
+
break;
|
|
203
|
+
case Keys.ArrowLeft:
|
|
204
|
+
this.focusPrev(activeSheetIndex);
|
|
205
|
+
break;
|
|
206
|
+
case Keys.Tab:
|
|
207
|
+
this.resetNavigation();
|
|
208
|
+
break;
|
|
209
|
+
default:
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
focusNext(sheetIndex) {
|
|
214
|
+
switch (this.focusedEl) {
|
|
215
|
+
case this.addButton:
|
|
216
|
+
this.menuButton.focus();
|
|
217
|
+
this.focusedEl = this.menuButton;
|
|
218
|
+
break;
|
|
219
|
+
case this.menuButton:
|
|
220
|
+
this.tabstrip.selectTab(sheetIndex);
|
|
221
|
+
this.focusedEl = this.tabstrip;
|
|
222
|
+
break;
|
|
223
|
+
default:
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
focusPrev(sheetIndex) {
|
|
228
|
+
switch (this.focusedEl) {
|
|
229
|
+
case this.addButton:
|
|
230
|
+
this.tabstrip.selectTab(sheetIndex);
|
|
231
|
+
this.focusedEl = this.tabstrip;
|
|
232
|
+
break;
|
|
233
|
+
case this.menuButton:
|
|
234
|
+
this.addButton.focus();
|
|
235
|
+
this.focusedEl = this.addButton;
|
|
236
|
+
break;
|
|
237
|
+
default:
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
resetNavigation() {
|
|
242
|
+
if (this.focusedEl !== this.tabstrip) {
|
|
243
|
+
this.focusedEl.blur();
|
|
244
|
+
}
|
|
245
|
+
this.focusedEl = null;
|
|
246
|
+
this.renderer.setAttribute(this.element.nativeElement, 'tabindex', '0');
|
|
247
|
+
}
|
|
166
248
|
}
|
|
167
249
|
SheetsBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SheetsBarComponent, deps: [{ token: i1.SpreadsheetService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.SpreadsheetLocalizationService }, { token: i3.DialogService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
168
|
-
SheetsBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SheetsBarComponent, selector: "[kendoSpreadsheetSheetsBar]", inputs: { sheets: "sheets", sheetDescriptors: "sheetDescriptors" }, host: { properties: { "class.k-spreadsheet-sheets-bar": "this.hostClasses" } }, ngImport: i0, template: `
|
|
169
|
-
<button kendoButton
|
|
170
|
-
title="
|
|
250
|
+
SheetsBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SheetsBarComponent, selector: "[kendoSpreadsheetSheetsBar]", inputs: { sheets: "sheets", sheetDescriptors: "sheetDescriptors" }, host: { listeners: { "focus": "onFocus()" }, properties: { "class.k-spreadsheet-sheets-bar": "this.hostClasses" } }, viewQueries: [{ propertyName: "addButton", first: true, predicate: ["addButton"], descendants: true }, { propertyName: "menuButton", first: true, predicate: ["menuButton"], descendants: true }, { propertyName: "tabstrip", first: true, predicate: ["tabstrip"], descendants: true }], ngImport: i0, template: `
|
|
251
|
+
<button kendoButton #addButton
|
|
252
|
+
[title]="messageFor('addSheet')"
|
|
171
253
|
type="button"
|
|
172
254
|
fillMode="flat"
|
|
173
255
|
class="k-spreadsheet-sheet-add"
|
|
174
256
|
icon="plus"
|
|
175
257
|
[svgIcon]="plusIcon"
|
|
176
|
-
[kendoEventsOutsideAngular]="{click: onAddClick}"
|
|
258
|
+
[kendoEventsOutsideAngular]="{click: onAddClick}"
|
|
259
|
+
[tabIndex]="-1">
|
|
177
260
|
</button>
|
|
178
|
-
<kendo-dropdownbutton #
|
|
261
|
+
<kendo-dropdownbutton #menuButton
|
|
179
262
|
fillMode="flat"
|
|
180
263
|
buttonClass="k-spreadsheet-sheets-menu"
|
|
181
264
|
icon="menu"
|
|
182
265
|
[svgIcon]="menuIcon"
|
|
183
266
|
[data]="sheetsMenuList"
|
|
184
267
|
(itemClick)="onMenuItemClick($event)"
|
|
185
|
-
(open)="onOpen(
|
|
268
|
+
(open)="onOpen(menuButton)"
|
|
269
|
+
[buttonAttributes]="{title: messageFor('sheetsMenu')}"
|
|
270
|
+
[tabIndex]="-1">
|
|
186
271
|
</kendo-dropdownbutton>
|
|
187
|
-
<kendo-tabstrip
|
|
272
|
+
<kendo-tabstrip #tabstrip kendoSpreadsheetTabStrip
|
|
188
273
|
[tabPosition]="'bottom'"
|
|
189
274
|
[showContentArea]="false"
|
|
190
275
|
[scrollable]="{prevButtonIcon: 'caret-alt-left', prevSVGButtonIcon: caretAltLeftIcon, nextButtonIcon: 'caret-alt-right', nextSVGButtonIcon: caretAltRightIcon}"
|
|
191
276
|
class="k-spreadsheet-sheets k-overflow-hidden"
|
|
192
277
|
(tabSelect)="onTabSelect($event)"
|
|
193
|
-
|
|
194
|
-
<
|
|
195
|
-
<kendo-tabstrip-tab
|
|
278
|
+
(navigationEnd)="onTabStripNavigationEnd($event)">
|
|
279
|
+
<kendo-tabstrip-tab *ngFor="let sheet of sheets"
|
|
196
280
|
[title]="sheet.text"
|
|
197
281
|
[selected]="sheet.text === activeSheet">
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
</ng-container>
|
|
282
|
+
<ng-template kendoTabTemplate>
|
|
283
|
+
<span class="k-link">{{sheet.text}}</span>
|
|
284
|
+
<kendo-dropdownbutton #sheetDdb
|
|
285
|
+
fillMode="flat"
|
|
286
|
+
icon="caret-alt-down"
|
|
287
|
+
[svgIcon]="caretAltDownIcon"
|
|
288
|
+
buttonClass="k-menu-button"
|
|
289
|
+
[data]="sheet.sheetActions"
|
|
290
|
+
[buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
|
|
291
|
+
(open)="onOpen(sheetDdb)"
|
|
292
|
+
(close)="onClose()"
|
|
293
|
+
(click)="$event.stopPropagation()"
|
|
294
|
+
(itemClick)="onActionClick($event, sheet)">
|
|
295
|
+
</kendo-dropdownbutton>
|
|
296
|
+
</ng-template>
|
|
297
|
+
</kendo-tabstrip-tab>
|
|
215
298
|
</kendo-tabstrip>
|
|
216
|
-
`, isInline: true, components: [{ type: i4.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i4.DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: ["arrowIcon", "icon", "svgIcon", "iconClass", "imageUrl", "textField", "data", "size", "rounded", "fillMode", "themeColor", "buttonAttributes"], outputs: ["itemClick", "focus", "blur"], exportAs: ["kendoDropDownButton"] }, { type: i5.TabStripComponent, selector: "kendo-tabstrip", inputs: ["height", "animate", "tabAlignment", "tabPosition", "keepTabContent", "closable", "scrollable", "closeIcon", "closeIconClass", "closeSVGIcon", "showContentArea"], outputs: ["tabSelect", "tabClose", "tabScroll"], exportAs: ["kendoTabStrip"] }, { type: i5.TabStripTabComponent, selector: "kendo-tabstrip-tab", inputs: ["title", "disabled", "cssClass", "cssStyle", "selected", "closable", "closeIcon", "closeIconClass", "closeSVGIcon"], exportAs: ["kendoTabStripTab"] }], directives: [{ type: i6.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.TabTemplateDirective, selector: "[kendoTabTemplate]" }] });
|
|
299
|
+
`, isInline: true, components: [{ type: i4.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i4.DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: ["arrowIcon", "icon", "svgIcon", "iconClass", "imageUrl", "textField", "data", "size", "rounded", "fillMode", "themeColor", "buttonAttributes"], outputs: ["itemClick", "focus", "blur"], exportAs: ["kendoDropDownButton"] }, { type: i5.TabStripComponent, selector: "kendo-tabstrip", inputs: ["height", "animate", "tabAlignment", "tabPosition", "keepTabContent", "closable", "scrollable", "closeIcon", "closeIconClass", "closeSVGIcon", "showContentArea"], outputs: ["tabSelect", "tabClose", "tabScroll"], exportAs: ["kendoTabStrip"] }, { type: i5.TabStripTabComponent, selector: "kendo-tabstrip-tab", inputs: ["title", "disabled", "cssClass", "cssStyle", "selected", "closable", "closeIcon", "closeIconClass", "closeSVGIcon"], exportAs: ["kendoTabStripTab"] }], directives: [{ type: i6.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i7.SpreadsheetTabStripDirective, selector: "[kendoSpreadsheetTabStrip]", outputs: ["navigationEnd"] }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.TabTemplateDirective, selector: "[kendoTabTemplate]" }] });
|
|
217
300
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SheetsBarComponent, decorators: [{
|
|
218
301
|
type: Component,
|
|
219
302
|
args: [{
|
|
220
303
|
selector: '[kendoSpreadsheetSheetsBar]',
|
|
221
304
|
template: `
|
|
222
|
-
<button kendoButton
|
|
223
|
-
title="
|
|
305
|
+
<button kendoButton #addButton
|
|
306
|
+
[title]="messageFor('addSheet')"
|
|
224
307
|
type="button"
|
|
225
308
|
fillMode="flat"
|
|
226
309
|
class="k-spreadsheet-sheet-add"
|
|
227
310
|
icon="plus"
|
|
228
311
|
[svgIcon]="plusIcon"
|
|
229
|
-
[kendoEventsOutsideAngular]="{click: onAddClick}"
|
|
312
|
+
[kendoEventsOutsideAngular]="{click: onAddClick}"
|
|
313
|
+
[tabIndex]="-1">
|
|
230
314
|
</button>
|
|
231
|
-
<kendo-dropdownbutton #
|
|
315
|
+
<kendo-dropdownbutton #menuButton
|
|
232
316
|
fillMode="flat"
|
|
233
317
|
buttonClass="k-spreadsheet-sheets-menu"
|
|
234
318
|
icon="menu"
|
|
235
319
|
[svgIcon]="menuIcon"
|
|
236
320
|
[data]="sheetsMenuList"
|
|
237
321
|
(itemClick)="onMenuItemClick($event)"
|
|
238
|
-
(open)="onOpen(
|
|
322
|
+
(open)="onOpen(menuButton)"
|
|
323
|
+
[buttonAttributes]="{title: messageFor('sheetsMenu')}"
|
|
324
|
+
[tabIndex]="-1">
|
|
239
325
|
</kendo-dropdownbutton>
|
|
240
|
-
<kendo-tabstrip
|
|
326
|
+
<kendo-tabstrip #tabstrip kendoSpreadsheetTabStrip
|
|
241
327
|
[tabPosition]="'bottom'"
|
|
242
328
|
[showContentArea]="false"
|
|
243
329
|
[scrollable]="{prevButtonIcon: 'caret-alt-left', prevSVGButtonIcon: caretAltLeftIcon, nextButtonIcon: 'caret-alt-right', nextSVGButtonIcon: caretAltRightIcon}"
|
|
244
330
|
class="k-spreadsheet-sheets k-overflow-hidden"
|
|
245
331
|
(tabSelect)="onTabSelect($event)"
|
|
246
|
-
|
|
247
|
-
<
|
|
248
|
-
<kendo-tabstrip-tab
|
|
332
|
+
(navigationEnd)="onTabStripNavigationEnd($event)">
|
|
333
|
+
<kendo-tabstrip-tab *ngFor="let sheet of sheets"
|
|
249
334
|
[title]="sheet.text"
|
|
250
335
|
[selected]="sheet.text === activeSheet">
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
</ng-container>
|
|
336
|
+
<ng-template kendoTabTemplate>
|
|
337
|
+
<span class="k-link">{{sheet.text}}</span>
|
|
338
|
+
<kendo-dropdownbutton #sheetDdb
|
|
339
|
+
fillMode="flat"
|
|
340
|
+
icon="caret-alt-down"
|
|
341
|
+
[svgIcon]="caretAltDownIcon"
|
|
342
|
+
buttonClass="k-menu-button"
|
|
343
|
+
[data]="sheet.sheetActions"
|
|
344
|
+
[buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
|
|
345
|
+
(open)="onOpen(sheetDdb)"
|
|
346
|
+
(close)="onClose()"
|
|
347
|
+
(click)="$event.stopPropagation()"
|
|
348
|
+
(itemClick)="onActionClick($event, sheet)">
|
|
349
|
+
</kendo-dropdownbutton>
|
|
350
|
+
</ng-template>
|
|
351
|
+
</kendo-tabstrip-tab>
|
|
268
352
|
</kendo-tabstrip>
|
|
269
353
|
`
|
|
270
354
|
}]
|
|
@@ -275,4 +359,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
275
359
|
type: Input
|
|
276
360
|
}], sheetDescriptors: [{
|
|
277
361
|
type: Input
|
|
362
|
+
}], onFocus: [{
|
|
363
|
+
type: HostListener,
|
|
364
|
+
args: ['focus']
|
|
365
|
+
}], addButton: [{
|
|
366
|
+
type: ViewChild,
|
|
367
|
+
args: ['addButton']
|
|
368
|
+
}], menuButton: [{
|
|
369
|
+
type: ViewChild,
|
|
370
|
+
args: ['menuButton']
|
|
371
|
+
}], tabstrip: [{
|
|
372
|
+
type: ViewChild,
|
|
373
|
+
args: ['tabstrip']
|
|
278
374
|
}] } });
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, EventEmitter, Output } from '@angular/core';
|
|
6
|
+
import { TabStripComponent } from '@progress/kendo-angular-layout';
|
|
7
|
+
import { Keys } from '@progress/kendo-angular-common';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "@progress/kendo-angular-layout";
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export class SpreadsheetTabStripDirective {
|
|
14
|
+
constructor(host) {
|
|
15
|
+
this.host = host;
|
|
16
|
+
this.navigationEnd = new EventEmitter();
|
|
17
|
+
}
|
|
18
|
+
ngAfterViewInit() {
|
|
19
|
+
this.host.tablist.nativeElement.addEventListener('keydown', this.onKeyDown.bind(this), true);
|
|
20
|
+
}
|
|
21
|
+
ngOnDestroy() {
|
|
22
|
+
this.host.tablist.nativeElement.removeEventListener('keydown', this.onKeyDown.bind(this), true);
|
|
23
|
+
}
|
|
24
|
+
get isLastActive() {
|
|
25
|
+
const lastIndex = this.host.tabs.length - 1;
|
|
26
|
+
return Array.from(this.host.tabs)[lastIndex].selected;
|
|
27
|
+
}
|
|
28
|
+
get isFirstActive() {
|
|
29
|
+
return Array.from(this.host.tabs)[0].selected;
|
|
30
|
+
}
|
|
31
|
+
onKeyDown(ev) {
|
|
32
|
+
switch (ev.keyCode) {
|
|
33
|
+
case Keys.ArrowLeft:
|
|
34
|
+
if (this.isFirstActive) {
|
|
35
|
+
ev.stopImmediatePropagation();
|
|
36
|
+
this.navigationEnd.emit('first');
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
case Keys.ArrowRight:
|
|
40
|
+
if (this.isLastActive) {
|
|
41
|
+
ev.stopImmediatePropagation();
|
|
42
|
+
this.navigationEnd.emit('last');
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
SpreadsheetTabStripDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetTabStripDirective, deps: [{ token: i1.TabStripComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
51
|
+
SpreadsheetTabStripDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetTabStripDirective, selector: "[kendoSpreadsheetTabStrip]", outputs: { navigationEnd: "navigationEnd" }, ngImport: i0 });
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetTabStripDirective, decorators: [{
|
|
53
|
+
type: Directive,
|
|
54
|
+
args: [{
|
|
55
|
+
selector: '[kendoSpreadsheetTabStrip]',
|
|
56
|
+
}]
|
|
57
|
+
}], ctorParameters: function () { return [{ type: i1.TabStripComponent }]; }, propDecorators: { navigationEnd: [{
|
|
58
|
+
type: Output
|
|
59
|
+
}] } });
|