@progress/kendo-angular-spreadsheet 14.0.0-develop.1 → 14.0.0-develop.11
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/formula-input.directive.d.ts +1 -1
- package/action-bar/namebox.component.d.ts +4 -1
- package/common/spreadsheet.service.d.ts +1 -0
- package/esm2020/action-bar/formula-input.directive.mjs +4 -4
- package/esm2020/action-bar/namebox.component.mjs +13 -5
- package/esm2020/common/spreadsheet.service.mjs +3 -0
- 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 +123 -64
- package/esm2020/spreadsheet.component.mjs +34 -31
- package/esm2020/spreadsheet.module.mjs +2 -5
- package/esm2020/tools/font-family/font-family-dropdownlist.component.mjs +1 -1
- package/esm2020/tools/font-size/font-size-dropdownlist.component.mjs +1 -1
- package/esm2020/tools/index.mjs +1 -1
- package/esm2020/tools/load-file.component.mjs +3 -0
- package/esm2020/tools/shared/spreadsheet-command-base.mjs +0 -7
- package/fesm2015/progress-kendo-angular-spreadsheet.mjs +189 -139
- package/fesm2020/progress-kendo-angular-spreadsheet.mjs +189 -140
- package/index.d.ts +1 -0
- package/localization/messages.d.ts +13 -1
- package/models/sheet-info.d.ts +0 -1
- package/package.json +13 -13
- package/schematics/ngAdd/index.js +1 -1
- package/sheets-bar/sheets-bar.component.d.ts +15 -4
- package/spreadsheet.component.d.ts +6 -16
- package/spreadsheet.module.d.ts +14 -15
- package/tools/index.d.ts +1 -1
- package/tools/load-file.component.d.ts +3 -0
- 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<{
|
|
@@ -21,6 +21,7 @@ export declare class SpreadsheetService {
|
|
|
21
21
|
get currentActiveSheet(): string;
|
|
22
22
|
get activeSheet(): string;
|
|
23
23
|
get formulaListId(): string;
|
|
24
|
+
get tablistId(): string;
|
|
24
25
|
private _currentActiveSheet;
|
|
25
26
|
notifySheetsChange(actionType: string, sheetInfo?: SheetInfo): void;
|
|
26
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<SpreadsheetService, never>;
|
|
@@ -19,7 +19,7 @@ export class FormulaInputDirective {
|
|
|
19
19
|
this.spreadsheetService = spreadsheetService;
|
|
20
20
|
this.hostClasses = true;
|
|
21
21
|
this.ariaHasPopup = 'menu';
|
|
22
|
-
this.ariaExpanded =
|
|
22
|
+
this.ariaExpanded = 'false';
|
|
23
23
|
this.focusedItem = () => this.list?.element.nativeElement.querySelector('.k-focus');
|
|
24
24
|
this.unfocus = () => {
|
|
25
25
|
const focused = this.focusedItem();
|
|
@@ -46,7 +46,7 @@ export class FormulaInputDirective {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
get ariaControls() {
|
|
49
|
-
return this.ariaExpanded ? this.spreadsheetService.formulaListId : null;
|
|
49
|
+
return this.ariaExpanded === 'true' ? this.spreadsheetService.formulaListId : null;
|
|
50
50
|
}
|
|
51
51
|
get listElement() {
|
|
52
52
|
return this.list?.element.nativeElement.firstElementChild;
|
|
@@ -103,12 +103,12 @@ export class FormulaInputDirective {
|
|
|
103
103
|
this.list = list;
|
|
104
104
|
list.data = this.data;
|
|
105
105
|
list.itemClick = this.handler;
|
|
106
|
-
this.ariaExpanded = true;
|
|
106
|
+
this.ariaExpanded = 'true';
|
|
107
107
|
},
|
|
108
108
|
close: () => {
|
|
109
109
|
this.popupRef && this.popupRef.close();
|
|
110
110
|
this.popupRef = null;
|
|
111
|
-
this.ariaExpanded =
|
|
111
|
+
this.ariaExpanded = 'false';
|
|
112
112
|
},
|
|
113
113
|
position: () => {
|
|
114
114
|
// contentKey++;
|
|
@@ -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: ["icon", "svgIcon", "showStickyHeader", "focusableId", "allowCustom", "data", "value", "textField", "valueField", "valuePrimitive", "valueNormalizer", "placeholder", "adaptiveMode", "title", "subtitle", "popupSettings", "listHeight", "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: [{
|
|
@@ -27,6 +27,9 @@ export class SpreadsheetService {
|
|
|
27
27
|
get formulaListId() {
|
|
28
28
|
return `k-spreadsheet-${spreadsheetCounter}-formula-list`;
|
|
29
29
|
}
|
|
30
|
+
get tablistId() {
|
|
31
|
+
return `k-spreadsheet-${spreadsheetCounter}-tablist`;
|
|
32
|
+
}
|
|
30
33
|
notifySheetsChange(actionType, sheetInfo) {
|
|
31
34
|
const sheets = this.spreadsheet.sheets();
|
|
32
35
|
this.sheetsChanged.next({ sheets, sheet: sheetInfo, actionType });
|
|
@@ -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: 1696927504,
|
|
13
|
+
version: '14.0.0-develop.11',
|
|
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, Input, NgZone, QueryList, Renderer2, ViewChild, ViewChildren } 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";
|
|
@@ -48,9 +50,16 @@ export class SheetsBarComponent {
|
|
|
48
50
|
};
|
|
49
51
|
this.actionsCallback = {
|
|
50
52
|
copy: (sheetInfo) => {
|
|
51
|
-
|
|
53
|
+
let copies = 0;
|
|
54
|
+
const regex = this.getCopyRegex(sheetInfo.text);
|
|
55
|
+
this.sheets.forEach(sheet => {
|
|
56
|
+
const isPresent = regex.test(sheet.text);
|
|
57
|
+
if (isPresent) {
|
|
58
|
+
copies += 1;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
52
61
|
const sheetToCopy = this.spreadsheetService.spreadsheet.sheets().find(s => s.name() === sheetInfo.text);
|
|
53
|
-
const newName = `${
|
|
62
|
+
const newName = `${sheetInfo.text} (${copies + 1})`;
|
|
54
63
|
this.spreadsheetService.spreadsheet.insertSheet({ data: { ...sheetToCopy.toJSON(), name: newName }, index: sheetInfo.index + 1 });
|
|
55
64
|
this.selectSheet(newName);
|
|
56
65
|
},
|
|
@@ -69,14 +78,25 @@ export class SheetsBarComponent {
|
|
|
69
78
|
get sheetsMenuList() {
|
|
70
79
|
return this.sheets?.map(sheet => ({ text: sheet.text, icon: 'eye', svgIcon: this.eyeIcon }));
|
|
71
80
|
}
|
|
81
|
+
get tablistId() {
|
|
82
|
+
return this.spreadsheetService.tablistId;
|
|
83
|
+
}
|
|
72
84
|
ngAfterViewInit() {
|
|
73
85
|
if (!isDocumentAvailable() || !this.element.nativeElement) {
|
|
74
86
|
return;
|
|
75
87
|
}
|
|
76
88
|
const prevBtn = this.element.nativeElement.querySelector('.k-tabstrip-prev');
|
|
77
89
|
const nextBtn = this.element.nativeElement.querySelector('.k-tabstrip-next');
|
|
90
|
+
const tablist = this.element.nativeElement.querySelector('.k-tabstrip-items');
|
|
78
91
|
this.renderer.addClass(prevBtn, 'k-order-1');
|
|
79
92
|
this.renderer.addClass(nextBtn, 'k-order-2');
|
|
93
|
+
this.renderer.setAttribute(tablist, 'id', this.tablistId);
|
|
94
|
+
this.tabListSub = this.renderer.listen(tablist, 'keydown', this.onTabListKeyDown.bind(this));
|
|
95
|
+
}
|
|
96
|
+
ngOnDestroy() {
|
|
97
|
+
if (this.tabListSub) {
|
|
98
|
+
this.tabListSub();
|
|
99
|
+
}
|
|
80
100
|
}
|
|
81
101
|
onTabSelect(ev) {
|
|
82
102
|
if (ev.title !== this.activeSheet) {
|
|
@@ -91,6 +111,8 @@ export class SheetsBarComponent {
|
|
|
91
111
|
}
|
|
92
112
|
onClose() {
|
|
93
113
|
this.openedDdb = null;
|
|
114
|
+
const activeTabIdx = this.sheets.findIndex(sheet => sheet.active);
|
|
115
|
+
this.tabstrip.selectTab(activeTabIdx);
|
|
94
116
|
}
|
|
95
117
|
onActionClick(dataItem, sheet) {
|
|
96
118
|
if (dataItem.disabled) {
|
|
@@ -107,16 +129,19 @@ export class SheetsBarComponent {
|
|
|
107
129
|
const sheet = this.sheets.find(s => s.text === item.text);
|
|
108
130
|
this.selectSheet(sheet.text);
|
|
109
131
|
}
|
|
132
|
+
messageFor(key) {
|
|
133
|
+
return this.localization.get(key);
|
|
134
|
+
}
|
|
110
135
|
openDialog(dataItem, sheet) {
|
|
111
136
|
const dialogSettings = {
|
|
112
137
|
appendTo: this.spreadsheetService.dialogContainer,
|
|
113
|
-
title: this.
|
|
138
|
+
title: this.messageFor(dataItem.commandName),
|
|
114
139
|
content: ActionDialogComponent,
|
|
115
140
|
actions: [{
|
|
116
|
-
text: this.
|
|
141
|
+
text: this.messageFor(dataItem.dialogButton),
|
|
117
142
|
themeColor: 'primary'
|
|
118
143
|
}, {
|
|
119
|
-
text: this.
|
|
144
|
+
text: this.messageFor('dialogCancel')
|
|
120
145
|
}],
|
|
121
146
|
actionsLayout: 'stretched',
|
|
122
147
|
autoFocusedElement: '.k-textbox .k-input-inner, .k-button-solid-primary'
|
|
@@ -125,7 +150,7 @@ export class SheetsBarComponent {
|
|
|
125
150
|
const dialogInstance = dialog.dialog.instance;
|
|
126
151
|
const dialogContent = dialog.content.instance;
|
|
127
152
|
dialogInstance.action.pipe(take(1)).subscribe((event) => {
|
|
128
|
-
if (event.text === this.
|
|
153
|
+
if (event.text === this.messageFor(dataItem.dialogButton)) {
|
|
129
154
|
const sheetsBar = this.spreadsheetService.spreadsheet.view.sheetsbar;
|
|
130
155
|
if (sheetsBar) {
|
|
131
156
|
dataItem.commandName === 'delete' ? sheetsBar.onSheetRemove(sheet.text) : sheetsBar.onSheetRename(dialogContent.value, this.sheets.indexOf(sheet));
|
|
@@ -139,6 +164,11 @@ export class SheetsBarComponent {
|
|
|
139
164
|
commandName: dataItem.commandName
|
|
140
165
|
});
|
|
141
166
|
}
|
|
167
|
+
getCopyRegex(sheetName) {
|
|
168
|
+
const newName = sheetName.replaceAll('(', '\\(').replaceAll(')', '\\)');
|
|
169
|
+
const st = `(${newName})\\s?\\(`;
|
|
170
|
+
return new RegExp(st, 's');
|
|
171
|
+
}
|
|
142
172
|
selectSheet(sheetName) {
|
|
143
173
|
const spreadsheetSheet = this.spreadsheetService.spreadsheet.sheets().find(s => s.name() === sheetName);
|
|
144
174
|
this.spreadsheetService.spreadsheet.activeSheet(spreadsheetSheet);
|
|
@@ -146,11 +176,25 @@ export class SheetsBarComponent {
|
|
|
146
176
|
this.spreadsheetService.activeSheetChanged.next(spreadsheetSheet);
|
|
147
177
|
this.notifySheetsChange();
|
|
148
178
|
}
|
|
179
|
+
onTabListKeyDown(ev) {
|
|
180
|
+
const buttonEl = ev.target.querySelector('.k-dropdown-button');
|
|
181
|
+
const index = Array.from(this.actionDdbRefs).findIndex(el => el.nativeElement === buttonEl);
|
|
182
|
+
const ddb = Array.from(this.actionDdbs)[index];
|
|
183
|
+
if (!ddb) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const altKey = ev.altKey;
|
|
187
|
+
const arrowDown = ev.keyCode === Keys.ArrowDown;
|
|
188
|
+
const shouldOpenDdb = altKey && arrowDown && !ddb.isOpen;
|
|
189
|
+
if (shouldOpenDdb) {
|
|
190
|
+
ev.preventDefault();
|
|
191
|
+
ddb.togglePopupVisibility();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
149
194
|
notifySheetsChange() {
|
|
150
195
|
this.ngZone.run(() => {
|
|
151
196
|
const newSheets = this.spreadsheetService.spreadsheet.sheets();
|
|
152
197
|
const sheetDesc = mapToSheetDescriptor(newSheets);
|
|
153
|
-
console.log(newSheets, 'new');
|
|
154
198
|
this.sheets = sheetDesc.map((item, index, items) => ({
|
|
155
199
|
...item,
|
|
156
200
|
inEdit: false,
|
|
@@ -165,53 +209,53 @@ export class SheetsBarComponent {
|
|
|
165
209
|
}
|
|
166
210
|
}
|
|
167
211
|
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="
|
|
212
|
+
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" } }, 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 }, { propertyName: "actionDdbs", predicate: ["sheetDdb"], descendants: true }, { propertyName: "actionDdbRefs", predicate: ["sheetDdb"], descendants: true, read: ElementRef }], ngImport: i0, template: `
|
|
213
|
+
<button kendoButton #addButton
|
|
214
|
+
[title]="messageFor('addSheet')"
|
|
171
215
|
type="button"
|
|
172
216
|
fillMode="flat"
|
|
173
217
|
class="k-spreadsheet-sheet-add"
|
|
174
218
|
icon="plus"
|
|
175
219
|
[svgIcon]="plusIcon"
|
|
176
|
-
[kendoEventsOutsideAngular]="{click: onAddClick}"
|
|
220
|
+
[kendoEventsOutsideAngular]="{click: onAddClick}"
|
|
221
|
+
[attr.aria-controls]="tablistId">
|
|
177
222
|
</button>
|
|
178
|
-
<kendo-dropdownbutton #
|
|
223
|
+
<kendo-dropdownbutton #menuButton
|
|
179
224
|
fillMode="flat"
|
|
180
225
|
buttonClass="k-spreadsheet-sheets-menu"
|
|
181
226
|
icon="menu"
|
|
182
227
|
[svgIcon]="menuIcon"
|
|
183
228
|
[data]="sheetsMenuList"
|
|
184
229
|
(itemClick)="onMenuItemClick($event)"
|
|
185
|
-
(open)="onOpen(
|
|
230
|
+
(open)="onOpen(menuButton)"
|
|
231
|
+
[buttonAttributes]="{title: messageFor('sheetsMenu')}"
|
|
232
|
+
[attr.aria-controls]="tablistId">
|
|
186
233
|
</kendo-dropdownbutton>
|
|
187
|
-
<kendo-tabstrip
|
|
234
|
+
<kendo-tabstrip #tabstrip
|
|
188
235
|
[tabPosition]="'bottom'"
|
|
189
236
|
[showContentArea]="false"
|
|
190
237
|
[scrollable]="{prevButtonIcon: 'caret-alt-left', prevSVGButtonIcon: caretAltLeftIcon, nextButtonIcon: 'caret-alt-right', nextSVGButtonIcon: caretAltRightIcon}"
|
|
191
238
|
class="k-spreadsheet-sheets k-overflow-hidden"
|
|
192
|
-
(tabSelect)="onTabSelect($event)"
|
|
193
|
-
|
|
194
|
-
<ng-container *ngFor="let sheet of sheets">
|
|
195
|
-
<kendo-tabstrip-tab
|
|
239
|
+
(tabSelect)="onTabSelect($event)">
|
|
240
|
+
<kendo-tabstrip-tab *ngFor="let sheet of sheets"
|
|
196
241
|
[title]="sheet.text"
|
|
197
242
|
[selected]="sheet.text === activeSheet">
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
</ng-container>
|
|
243
|
+
<ng-template kendoTabTemplate>
|
|
244
|
+
<span class="k-link">{{sheet.text}}</span>
|
|
245
|
+
<kendo-dropdownbutton #sheetDdb
|
|
246
|
+
fillMode="flat"
|
|
247
|
+
icon="caret-alt-down"
|
|
248
|
+
[svgIcon]="caretAltDownIcon"
|
|
249
|
+
buttonClass="k-menu-button"
|
|
250
|
+
[data]="sheet.sheetActions"
|
|
251
|
+
[buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
|
|
252
|
+
(open)="onOpen(sheetDdb)"
|
|
253
|
+
(close)="onClose()"
|
|
254
|
+
(click)="$event.stopPropagation()"
|
|
255
|
+
(itemClick)="onActionClick($event, sheet)">
|
|
256
|
+
</kendo-dropdownbutton>
|
|
257
|
+
</ng-template>
|
|
258
|
+
</kendo-tabstrip-tab>
|
|
215
259
|
</kendo-tabstrip>
|
|
216
260
|
`, 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]" }] });
|
|
217
261
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SheetsBarComponent, decorators: [{
|
|
@@ -219,52 +263,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
219
263
|
args: [{
|
|
220
264
|
selector: '[kendoSpreadsheetSheetsBar]',
|
|
221
265
|
template: `
|
|
222
|
-
<button kendoButton
|
|
223
|
-
title="
|
|
266
|
+
<button kendoButton #addButton
|
|
267
|
+
[title]="messageFor('addSheet')"
|
|
224
268
|
type="button"
|
|
225
269
|
fillMode="flat"
|
|
226
270
|
class="k-spreadsheet-sheet-add"
|
|
227
271
|
icon="plus"
|
|
228
272
|
[svgIcon]="plusIcon"
|
|
229
|
-
[kendoEventsOutsideAngular]="{click: onAddClick}"
|
|
273
|
+
[kendoEventsOutsideAngular]="{click: onAddClick}"
|
|
274
|
+
[attr.aria-controls]="tablistId">
|
|
230
275
|
</button>
|
|
231
|
-
<kendo-dropdownbutton #
|
|
276
|
+
<kendo-dropdownbutton #menuButton
|
|
232
277
|
fillMode="flat"
|
|
233
278
|
buttonClass="k-spreadsheet-sheets-menu"
|
|
234
279
|
icon="menu"
|
|
235
280
|
[svgIcon]="menuIcon"
|
|
236
281
|
[data]="sheetsMenuList"
|
|
237
282
|
(itemClick)="onMenuItemClick($event)"
|
|
238
|
-
(open)="onOpen(
|
|
283
|
+
(open)="onOpen(menuButton)"
|
|
284
|
+
[buttonAttributes]="{title: messageFor('sheetsMenu')}"
|
|
285
|
+
[attr.aria-controls]="tablistId">
|
|
239
286
|
</kendo-dropdownbutton>
|
|
240
|
-
<kendo-tabstrip
|
|
287
|
+
<kendo-tabstrip #tabstrip
|
|
241
288
|
[tabPosition]="'bottom'"
|
|
242
289
|
[showContentArea]="false"
|
|
243
290
|
[scrollable]="{prevButtonIcon: 'caret-alt-left', prevSVGButtonIcon: caretAltLeftIcon, nextButtonIcon: 'caret-alt-right', nextSVGButtonIcon: caretAltRightIcon}"
|
|
244
291
|
class="k-spreadsheet-sheets k-overflow-hidden"
|
|
245
|
-
(tabSelect)="onTabSelect($event)"
|
|
246
|
-
|
|
247
|
-
<ng-container *ngFor="let sheet of sheets">
|
|
248
|
-
<kendo-tabstrip-tab
|
|
292
|
+
(tabSelect)="onTabSelect($event)">
|
|
293
|
+
<kendo-tabstrip-tab *ngFor="let sheet of sheets"
|
|
249
294
|
[title]="sheet.text"
|
|
250
295
|
[selected]="sheet.text === activeSheet">
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
</ng-container>
|
|
296
|
+
<ng-template kendoTabTemplate>
|
|
297
|
+
<span class="k-link">{{sheet.text}}</span>
|
|
298
|
+
<kendo-dropdownbutton #sheetDdb
|
|
299
|
+
fillMode="flat"
|
|
300
|
+
icon="caret-alt-down"
|
|
301
|
+
[svgIcon]="caretAltDownIcon"
|
|
302
|
+
buttonClass="k-menu-button"
|
|
303
|
+
[data]="sheet.sheetActions"
|
|
304
|
+
[buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
|
|
305
|
+
(open)="onOpen(sheetDdb)"
|
|
306
|
+
(close)="onClose()"
|
|
307
|
+
(click)="$event.stopPropagation()"
|
|
308
|
+
(itemClick)="onActionClick($event, sheet)">
|
|
309
|
+
</kendo-dropdownbutton>
|
|
310
|
+
</ng-template>
|
|
311
|
+
</kendo-tabstrip-tab>
|
|
268
312
|
</kendo-tabstrip>
|
|
269
313
|
`
|
|
270
314
|
}]
|
|
@@ -275,4 +319,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
275
319
|
type: Input
|
|
276
320
|
}], sheetDescriptors: [{
|
|
277
321
|
type: Input
|
|
322
|
+
}], addButton: [{
|
|
323
|
+
type: ViewChild,
|
|
324
|
+
args: ['addButton']
|
|
325
|
+
}], menuButton: [{
|
|
326
|
+
type: ViewChild,
|
|
327
|
+
args: ['menuButton']
|
|
328
|
+
}], tabstrip: [{
|
|
329
|
+
type: ViewChild,
|
|
330
|
+
args: ['tabstrip']
|
|
331
|
+
}], actionDdbs: [{
|
|
332
|
+
type: ViewChildren,
|
|
333
|
+
args: ['sheetDdb']
|
|
334
|
+
}], actionDdbRefs: [{
|
|
335
|
+
type: ViewChildren,
|
|
336
|
+
args: ['sheetDdb', { read: ElementRef }]
|
|
278
337
|
}] } });
|