@progress/kendo-angular-spreadsheet 21.4.1 → 22.0.0

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.
Files changed (87) hide show
  1. package/fesm2022/progress-kendo-angular-spreadsheet.mjs +183 -183
  2. package/package.json +22 -30
  3. package/schematics/ngAdd/index.js +2 -2
  4. package/tools/shared/spreadsheet-command-base.d.ts +1 -1
  5. package/tools/shared/spreadsheet-dropdown-tools-base.d.ts +1 -1
  6. package/tools/shared/spreadsheet-dropdownlist.base.d.ts +1 -1
  7. package/esm2022/action-bar/formula-input.directive.mjs +0 -183
  8. package/esm2022/action-bar/list.component.mjs +0 -91
  9. package/esm2022/action-bar/namebox.component.mjs +0 -134
  10. package/esm2022/common/calendar-editor.component.mjs +0 -48
  11. package/esm2022/common/error-handling.service.mjs +0 -99
  12. package/esm2022/common/list-editor.component.mjs +0 -146
  13. package/esm2022/common/main-menu.directive.mjs +0 -30
  14. package/esm2022/common/sheet-changes.mjs +0 -5
  15. package/esm2022/common/spreadsheet.service.mjs +0 -49
  16. package/esm2022/directives.mjs +0 -94
  17. package/esm2022/filter-menu/filter-menu-item-content-template.directive.mjs +0 -26
  18. package/esm2022/filter-menu/filter-menu-item.component.mjs +0 -271
  19. package/esm2022/index.mjs +0 -14
  20. package/esm2022/localization/custom-messages.component.mjs +0 -52
  21. package/esm2022/localization/localized-messages.directive.mjs +0 -35
  22. package/esm2022/localization/messages.mjs +0 -884
  23. package/esm2022/localization/spreadsheet-localization.service.mjs +0 -31
  24. package/esm2022/models/cell-editor-action-args.mjs +0 -5
  25. package/esm2022/models/cell-editor-options.mjs +0 -5
  26. package/esm2022/models/events.mjs +0 -5
  27. package/esm2022/models/filter-menu-item.mjs +0 -5
  28. package/esm2022/models/index.mjs +0 -11
  29. package/esm2022/models/main-menu-item.mjs +0 -5
  30. package/esm2022/models/range-filter-value.mjs +0 -5
  31. package/esm2022/models/sheet-info.mjs +0 -5
  32. package/esm2022/package-metadata.mjs +0 -16
  33. package/esm2022/progress-kendo-angular-spreadsheet.mjs +0 -8
  34. package/esm2022/sheets-bar/action-dialog.component.mjs +0 -78
  35. package/esm2022/sheets-bar/sheets-bar.component.mjs +0 -433
  36. package/esm2022/sheets-bar/utils.mjs +0 -49
  37. package/esm2022/spreadsheet.component.mjs +0 -2408
  38. package/esm2022/spreadsheet.module.mjs +0 -72
  39. package/esm2022/tools/align/align-tool.directive.mjs +0 -62
  40. package/esm2022/tools/align/horizontal-align-tool.directive.mjs +0 -62
  41. package/esm2022/tools/align/vertical-align-tool.directive.mjs +0 -62
  42. package/esm2022/tools/colorpicker/spreadsheet-backcolor.component.mjs +0 -142
  43. package/esm2022/tools/colorpicker/spreadsheet-forecolor.component.mjs +0 -142
  44. package/esm2022/tools/data-validation-dialog.component.mjs +0 -481
  45. package/esm2022/tools/data-validation-tool.directive.mjs +0 -156
  46. package/esm2022/tools/decrease-decimal-tool.directive.mjs +0 -41
  47. package/esm2022/tools/filter-sort/filter-tool.directive.mjs +0 -89
  48. package/esm2022/tools/filter-sort/sort-tool.directive.mjs +0 -62
  49. package/esm2022/tools/font-family/font-family-dropdownlist.component.mjs +0 -59
  50. package/esm2022/tools/font-family/spreadsheet-fontfamily-tool.component.mjs +0 -114
  51. package/esm2022/tools/font-size/decrease-font-tool.directive.mjs +0 -52
  52. package/esm2022/tools/font-size/font-size-dropdownlist.component.mjs +0 -46
  53. package/esm2022/tools/font-size/increase-font-tool.directive.mjs +0 -52
  54. package/esm2022/tools/font-size/spreadsheet-fontsize-tool.component.mjs +0 -114
  55. package/esm2022/tools/format-tool.directive.mjs +0 -65
  56. package/esm2022/tools/gridlines-tool.directive.mjs +0 -47
  57. package/esm2022/tools/history/redo-tool.mjs +0 -37
  58. package/esm2022/tools/history/undo-tool.mjs +0 -37
  59. package/esm2022/tools/increase-decimal-tool.directive.mjs +0 -41
  60. package/esm2022/tools/index.mjs +0 -30
  61. package/esm2022/tools/insert/insert-link-dialog.component.mjs +0 -53
  62. package/esm2022/tools/insert/insert-link-tool.directive.mjs +0 -97
  63. package/esm2022/tools/load-file.component.mjs +0 -226
  64. package/esm2022/tools/save-file-tool.directive.mjs +0 -58
  65. package/esm2022/tools/shared/command-icons.mjs +0 -121
  66. package/esm2022/tools/shared/commands.mjs +0 -5
  67. package/esm2022/tools/shared/constants.mjs +0 -77
  68. package/esm2022/tools/shared/dialog-content.component.mjs +0 -130
  69. package/esm2022/tools/shared/spreadsheet-command-base.mjs +0 -73
  70. package/esm2022/tools/shared/spreadsheet-command-button.mjs +0 -31
  71. package/esm2022/tools/shared/spreadsheet-dropdown-tools-base.mjs +0 -194
  72. package/esm2022/tools/shared/spreadsheet-dropdownlist.base.mjs +0 -54
  73. package/esm2022/tools/tables/add-column-left-button.directive.mjs +0 -37
  74. package/esm2022/tools/tables/add-column-right-button.directive.mjs +0 -37
  75. package/esm2022/tools/tables/add-row-above-button.directive.mjs +0 -37
  76. package/esm2022/tools/tables/add-row-below-button.directive.mjs +0 -37
  77. package/esm2022/tools/tables/delete-column-button.directive.mjs +0 -35
  78. package/esm2022/tools/tables/delete-row-button.directive.mjs +0 -35
  79. package/esm2022/tools/tables/index.mjs +0 -11
  80. package/esm2022/tools/tables/merge-tool.directive.mjs +0 -72
  81. package/esm2022/tools/text-wrap-tool.directive.mjs +0 -48
  82. package/esm2022/tools/tools.service.mjs +0 -61
  83. package/esm2022/tools/typographical-emphasis/bold-tool.directive.mjs +0 -37
  84. package/esm2022/tools/typographical-emphasis/italic-tool.directive.mjs +0 -37
  85. package/esm2022/tools/typographical-emphasis/underline-tool.directive.mjs +0 -37
  86. package/esm2022/tools/utils.mjs +0 -35
  87. package/esm2022/utils.mjs +0 -32
@@ -1,31 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Inject, Injectable, Optional } from '@angular/core';
6
- import { LocalizationService, L10N_PREFIX, MessageService, RTL } from '@progress/kendo-angular-l10n';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "@progress/kendo-angular-l10n";
9
- /**
10
- * @hidden
11
- */
12
- export class SpreadsheetLocalizationService extends LocalizationService {
13
- constructor(prefix, messageService, _rtl) {
14
- super(prefix, messageService, _rtl);
15
- }
16
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpreadsheetLocalizationService, deps: [{ token: L10N_PREFIX }, { token: i1.MessageService, optional: true }, { token: RTL, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
17
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpreadsheetLocalizationService });
18
- }
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpreadsheetLocalizationService, decorators: [{
20
- type: Injectable
21
- }], ctorParameters: () => [{ type: undefined, decorators: [{
22
- type: Inject,
23
- args: [L10N_PREFIX]
24
- }] }, { type: i1.MessageService, decorators: [{
25
- type: Optional
26
- }] }, { type: undefined, decorators: [{
27
- type: Optional
28
- }, {
29
- type: Inject,
30
- args: [RTL]
31
- }] }] });
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,11 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export * from './sheet-info';
6
- export * from './main-menu-item';
7
- export * from './events';
8
- export * from './cell-editor-options';
9
- export * from './cell-editor-action-args';
10
- export * from './filter-menu-item';
11
- export * from './range-filter-value';
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,16 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- /**
6
- * @hidden
7
- */
8
- export const packageMetadata = {
9
- name: '@progress/kendo-angular-spreadsheet',
10
- productName: 'Kendo UI for Angular',
11
- productCode: 'KENDOUIANGULAR',
12
- productCodes: ['KENDOUIANGULAR'],
13
- publishDate: 1768393214,
14
- version: '21.4.1',
15
- 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',
16
- };
@@ -1,8 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- /**
6
- * Generated bundle index. Do not edit.
7
- */
8
- export * from './index';
@@ -1,78 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Component } from '@angular/core';
6
- import { DialogRef, DialogContentBase } from '@progress/kendo-angular-dialog';
7
- import { TextBoxComponent } from '@progress/kendo-angular-inputs';
8
- import { LabelComponent } from '@progress/kendo-angular-label';
9
- import * as i0 from "@angular/core";
10
- import * as i1 from "@progress/kendo-angular-dialog";
11
- /**
12
- * @hidden
13
- */
14
- export class ActionDialogComponent extends DialogContentBase {
15
- dialog;
16
- commandName;
17
- value;
18
- tabindex;
19
- constructor(dialog) {
20
- super(dialog);
21
- this.dialog = dialog;
22
- }
23
- setData(args) {
24
- this.value = args.value;
25
- this.tabindex = args.tabindex;
26
- this.commandName = args.commandName;
27
- }
28
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ActionDialogComponent, deps: [{ token: i1.DialogRef }], target: i0.ɵɵFactoryTarget.Component });
29
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ActionDialogComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
30
- @if (commandName === 'delete') {
31
- <p>The deleted sheet data will be lost.</p>
32
- <p>Are you sure you want to proceed?</p>
33
- }
34
-
35
- @if (commandName === 'rename') {
36
- <form class="k-form k-form-md" method="dialog">
37
- <div class="k-form-field">
38
- <kendo-label [for]="textbox" text="Rename sheet"></kendo-label>
39
- <div class="k-form-field-wrap">
40
- <kendo-textbox #textbox
41
- autocomplete="off"
42
- placeholder="Sheet name"
43
- [(value)]="value">
44
- </kendo-textbox>
45
- </div>
46
- </div>
47
- </form>
48
- }
49
- `, isInline: true, dependencies: [{ kind: "component", type: LabelComponent, selector: "kendo-label", inputs: ["text", "for", "optional", "labelCssStyle", "labelCssClass"], exportAs: ["kendoLabel"] }, { kind: "component", type: TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }] });
50
- }
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ActionDialogComponent, decorators: [{
52
- type: Component,
53
- args: [{
54
- template: `
55
- @if (commandName === 'delete') {
56
- <p>The deleted sheet data will be lost.</p>
57
- <p>Are you sure you want to proceed?</p>
58
- }
59
-
60
- @if (commandName === 'rename') {
61
- <form class="k-form k-form-md" method="dialog">
62
- <div class="k-form-field">
63
- <kendo-label [for]="textbox" text="Rename sheet"></kendo-label>
64
- <div class="k-form-field-wrap">
65
- <kendo-textbox #textbox
66
- autocomplete="off"
67
- placeholder="Sheet name"
68
- [(value)]="value">
69
- </kendo-textbox>
70
- </div>
71
- </div>
72
- </form>
73
- }
74
- `,
75
- standalone: true,
76
- imports: [LabelComponent, TextBoxComponent]
77
- }]
78
- }], ctorParameters: () => [{ type: i1.DialogRef }] });
@@ -1,433 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Component, ElementRef, HostBinding, Input, NgZone, QueryList, Renderer2, ViewChild, ViewChildren } from '@angular/core';
6
- import { Subscription } from 'rxjs';
7
- import { take } from 'rxjs/operators';
8
- import { ButtonComponent, DropDownButtonComponent } from '@progress/kendo-angular-buttons';
9
- import { Keys, isDocumentAvailable, isPresent, EventsOutsideAngularDirective, normalizeKeys } from '@progress/kendo-angular-common';
10
- import { DialogService } from '@progress/kendo-angular-dialog';
11
- import { TabStripComponent, TabTemplateDirective, TabStripTabComponent } from '@progress/kendo-angular-layout';
12
- import { caretAltDownIcon, menuIcon, plusIcon, eyeIcon, eyeSlashIcon } from '@progress/kendo-svg-icons';
13
- import { SpreadsheetService } from '../common/spreadsheet.service';
14
- import { SpreadsheetLocalizationService } from '../localization/spreadsheet-localization.service';
15
- import { ActionDialogComponent } from './action-dialog.component';
16
- import { mapToSheetDescriptor } from '../utils';
17
- import { getSheetActions } from './utils';
18
- import * as i0 from "@angular/core";
19
- import * as i1 from "../common/spreadsheet.service";
20
- import * as i2 from "../localization/spreadsheet-localization.service";
21
- import * as i3 from "@progress/kendo-angular-dialog";
22
- /**
23
- * @hidden
24
- */
25
- export class SheetsBarComponent {
26
- spreadsheetService;
27
- element;
28
- renderer;
29
- localization;
30
- dialogService;
31
- ngZone;
32
- hostClasses = true;
33
- trackByItemKey = (index, item) => this.hiding ? item : index;
34
- sheets;
35
- sheetDescriptors;
36
- subs = new Subscription();
37
- hiding = false;
38
- constructor(spreadsheetService, element, renderer, localization, dialogService, ngZone) {
39
- this.spreadsheetService = spreadsheetService;
40
- this.element = element;
41
- this.renderer = renderer;
42
- this.localization = localization;
43
- this.dialogService = dialogService;
44
- this.ngZone = ngZone;
45
- this.subs.add(spreadsheetService.onSheetsBarFocus.subscribe(() => ngZone.run(() => this.tabstrip.selectTab(this.sheets.findIndex(sh => sh.text === spreadsheetService.currentActiveSheet)))));
46
- }
47
- addButton;
48
- menuButton;
49
- tabstrip;
50
- actionDdbs;
51
- actionDdbRefs;
52
- get activeSheet() {
53
- return this.spreadsheetService.spreadsheet?.activeSheet()?.name();
54
- }
55
- plusIcon = plusIcon;
56
- menuIcon = menuIcon;
57
- caretAltDownIcon = caretAltDownIcon;
58
- selected = false;
59
- sheetsMenuList = [];
60
- openedDdb = null;
61
- tabListSub;
62
- hiddenStateIcons = {
63
- hidden: 'eye-slash',
64
- visible: 'eye'
65
- };
66
- hiddenStateSVGIcons = {
67
- hidden: eyeSlashIcon,
68
- visible: eyeIcon
69
- };
70
- get tablistId() {
71
- return this.spreadsheetService.tablistId;
72
- }
73
- ngAfterViewInit() {
74
- if (!isDocumentAvailable() || !this.element.nativeElement) {
75
- return;
76
- }
77
- const tablist = this.element.nativeElement.querySelector('.k-tabstrip-items');
78
- this.renderer.setAttribute(tablist, 'id', this.tablistId);
79
- this.tabListSub = this.renderer.listen(tablist, 'keydown', this.onTabListKeyDown.bind(this));
80
- }
81
- ngOnChanges(changes) {
82
- if (changes['sheets']) {
83
- this.sheetsMenuList = this.sheets?.map(sheet => ({
84
- text: sheet.text,
85
- icon: this.hiddenStateIcons[sheet.state],
86
- svgIcon: this.hiddenStateSVGIcons[sheet.state]
87
- }));
88
- this.sheets = changes['sheets'].currentValue?.map((sheet, _, items) => ({
89
- ...sheet,
90
- sheetActions: getSheetActions(items, sheet)
91
- .map(item => ({ ...item, text: this.messageFor(item.messageKey) }))
92
- }));
93
- }
94
- }
95
- ngOnDestroy() {
96
- if (this.tabListSub) {
97
- this.tabListSub();
98
- }
99
- this.subs.unsubscribe();
100
- }
101
- onAddClick = () => {
102
- if (this.spreadsheetService.spreadsheet) {
103
- this.spreadsheetService.spreadsheet.view.sheetsbar.onAddSelect();
104
- this.notifySheetsChange();
105
- }
106
- };
107
- onTabSelect(ev) {
108
- if (ev.title !== this.activeSheet) {
109
- this.selectSheet(ev.title);
110
- }
111
- }
112
- onOpen(ddb) {
113
- if (isPresent(this.openedDdb) && this.openedDdb !== ddb) {
114
- this.openedDdb.toggle(false);
115
- }
116
- this.openedDdb = ddb;
117
- }
118
- onClose() {
119
- this.openedDdb = null;
120
- const activeTabIdx = this.sheets.findIndex(sheet => sheet.active);
121
- this.tabstrip.selectTab(activeTabIdx);
122
- }
123
- onActionClick(dataItem, sheet) {
124
- if (dataItem.disabled) {
125
- return;
126
- }
127
- if (dataItem.commandName === 'delete' || dataItem.commandName === 'rename') {
128
- this.openDialog(dataItem, sheet);
129
- }
130
- else {
131
- this.actionsCallback[dataItem.commandName](sheet, dataItem.messageKey);
132
- }
133
- }
134
- onMenuItemClick(item) {
135
- const sheet = this.sheets.find(s => s.text === item.text);
136
- sheet.state = 'visible';
137
- this.spreadsheetService.spreadsheet.sheets().find(sh => sh.name() === sheet.text)._state('visible');
138
- this.selectSheet(sheet.text);
139
- }
140
- messageFor(key) {
141
- return this.localization.get(key);
142
- }
143
- openDialog(dataItem, sheet) {
144
- const dialogSettings = {
145
- appendTo: this.spreadsheetService.dialogContainer,
146
- title: this.messageFor(dataItem.commandName),
147
- content: ActionDialogComponent,
148
- actions: [{
149
- text: this.messageFor(dataItem.dialogButton),
150
- themeColor: 'primary'
151
- }, {
152
- text: this.messageFor('dialogCancel')
153
- }],
154
- actionsLayout: 'stretched',
155
- autoFocusedElement: '.k-textbox .k-input-inner, .k-button-solid-primary'
156
- };
157
- const dialog = this.dialogService.open(dialogSettings);
158
- const dialogInstance = dialog.dialog.instance;
159
- const dialogContent = dialog.content.instance;
160
- dialogInstance.action.pipe(take(1)).subscribe((event) => {
161
- if (event.text === this.messageFor(dataItem.dialogButton)) {
162
- const sheetsBar = this.spreadsheetService.spreadsheet.view.sheetsbar;
163
- if (sheetsBar) {
164
- const allSheets = this.spreadsheetService.spreadsheet.sheets();
165
- const sheetIndex = allSheets.findIndex(s => s.name() === sheet.text);
166
- dataItem.commandName === 'delete' ? sheetsBar.onSheetRemove(sheet.text) : sheetsBar.onSheetRename(dialogContent.value, sheetIndex);
167
- this.notifySheetsChange();
168
- }
169
- }
170
- });
171
- dialogContent.setData({
172
- value: sheet.text,
173
- tabindex: -1,
174
- commandName: dataItem.commandName
175
- });
176
- }
177
- getCopyRegex(sheetName) {
178
- const newName = sheetName.replaceAll('(', '\\(').replaceAll(')', '\\)');
179
- const st = `(${newName})\\s?\\(`;
180
- return new RegExp(st, 's');
181
- }
182
- actionsCallback = {
183
- copy: (sheetInfo) => {
184
- let copies = 0;
185
- const regex = this.getCopyRegex(sheetInfo.text);
186
- this.sheets.forEach(sheet => {
187
- const isPresent = regex.test(sheet.text);
188
- if (isPresent) {
189
- copies += 1;
190
- }
191
- });
192
- const sheetToCopy = this.spreadsheetService.spreadsheet.sheets().find(s => s.name() === sheetInfo.text);
193
- const newName = `${sheetInfo.text} (${copies + 1})`;
194
- this.spreadsheetService.spreadsheet.insertSheet({ data: { ...sheetToCopy.toJSON(), name: newName }, index: sheetInfo.index + 1 });
195
- this.selectSheet(newName);
196
- },
197
- move: (sheetInfo, itemKey) => {
198
- const isMoveRight = itemKey === 'sheetMoveRight';
199
- let oldIndex = -1;
200
- let newIndex = -1;
201
- const sheets = this.spreadsheetService.spreadsheet.sheets();
202
- if (isMoveRight) {
203
- for (let i = 0; i < sheets.length; i++) {
204
- if (sheets[i].name() === sheetInfo.text) {
205
- oldIndex = i;
206
- }
207
- if (oldIndex > -1 && i > oldIndex && sheets[i]._state() === 'visible') {
208
- newIndex = i;
209
- break;
210
- }
211
- }
212
- }
213
- else {
214
- for (let i = sheets.length - 1; i >= 0; i--) {
215
- if (sheets[i].name() === sheetInfo.text) {
216
- oldIndex = i;
217
- }
218
- if (oldIndex > -1 && (i < oldIndex) && sheets[i]._state() === 'visible') {
219
- newIndex = i;
220
- break;
221
- }
222
- }
223
- }
224
- const sheetsBar = this.spreadsheetService.spreadsheet.view.sheetsbar;
225
- sheetsBar.onSheetReorderEnd({ oldIndex, newIndex });
226
- this.selectSheet(sheetInfo.text);
227
- this.notifySheetsChange();
228
- },
229
- hide: (sheet) => {
230
- this.hiding = true;
231
- sheet.state = 'hidden';
232
- const sheets = this.spreadsheetService.spreadsheet.sheets();
233
- const sheetIndex = sheets.findIndex(s => s.name() === sheet.text);
234
- sheets[sheetIndex]._state('hidden');
235
- const newSelectedIndex = sheetIndex < sheets.length - 1 ? sheetIndex + 1 : 0;
236
- const sheetToSelect = sheets[newSelectedIndex].name();
237
- this.selectSheet(sheetToSelect);
238
- this.notifySheetsChange();
239
- }
240
- };
241
- selectSheet(sheetName) {
242
- const spreadsheetSheet = this.spreadsheetService.spreadsheet.sheets().find(s => s.name() === sheetName);
243
- this.spreadsheetService.spreadsheet.activeSheet(spreadsheetSheet);
244
- this.spreadsheetService.currentActiveSheet = sheetName;
245
- this.spreadsheetService.activeSheetChanged.next(spreadsheetSheet);
246
- this.notifySheetsChange();
247
- }
248
- onTabListKeyDown(ev) {
249
- const buttonEl = ev.target.querySelector('kendo-dropdownbutton');
250
- const index = Array.from(this.actionDdbRefs).findIndex(el => el.nativeElement === buttonEl);
251
- const ddb = Array.from(this.actionDdbs)[index];
252
- if (!ddb) {
253
- return;
254
- }
255
- const altKey = ev.altKey;
256
- const code = normalizeKeys(ev);
257
- const arrowDown = code === Keys.ArrowDown;
258
- const shouldOpenDdb = altKey && arrowDown && !ddb.isOpen;
259
- if (shouldOpenDdb) {
260
- ev.preventDefault();
261
- ddb.togglePopupVisibility();
262
- }
263
- }
264
- notifySheetsChange() {
265
- this.ngZone.run(() => {
266
- const newSheets = this.spreadsheetService.spreadsheet.sheets();
267
- const sheetDesc = mapToSheetDescriptor(newSheets);
268
- this.sheets = sheetDesc
269
- .flatMap((item, index, items) => item.state === 'visible' ? [{
270
- ...item,
271
- inEdit: false,
272
- first: index === 0,
273
- last: index === items.length - 1,
274
- text: item.name,
275
- active: (item.name === this.activeSheet) || items.length === 1,
276
- index,
277
- sheetActions: getSheetActions(items, item)
278
- .map(item => ({ ...item, text: this.messageFor(item.messageKey) }))
279
- }] : []);
280
- this.sheetsMenuList = this.sheets?.map(sheet => ({
281
- text: sheet.text,
282
- icon: this.hiddenStateIcons[sheet.state],
283
- svgIcon: this.hiddenStateSVGIcons[sheet.state]
284
- }));
285
- });
286
- this.ngZone.onStable.pipe(take(1)).subscribe(() => { this.spreadsheetService.spreadsheet.view.clipboard.focus(); this.hiding = false; });
287
- }
288
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", 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 });
289
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SheetsBarComponent, isStandalone: true, 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 }], usesOnChanges: true, ngImport: i0, template: `
290
- <button kendoButton #addButton
291
- [title]="messageFor('addSheet')"
292
- type="button"
293
- fillMode="flat"
294
- class="k-spreadsheet-sheet-add"
295
- icon="plus"
296
- [svgIcon]="plusIcon"
297
- [kendoEventsOutsideAngular]="{click: onAddClick}"
298
- [attr.aria-controls]="tablistId">
299
- </button>
300
- <kendo-dropdownbutton #menuButton
301
- fillMode="flat"
302
- buttonClass="k-spreadsheet-sheets-menu"
303
- icon="menu"
304
- [svgIcon]="menuIcon"
305
- [data]="sheetsMenuList"
306
- (itemClick)="onMenuItemClick($event)"
307
- (open)="onOpen(menuButton)"
308
- [buttonAttributes]="{title: messageFor('sheetsMenu')}"
309
- [attr.aria-controls]="tablistId">
310
- </kendo-dropdownbutton>
311
- <kendo-tabstrip #tabstrip
312
- [tabPosition]="'bottom'"
313
- [showContentArea]="false"
314
- [scrollable]="{ scrollButtonsPosition: 'end', mouseScroll: false }"
315
- class="k-spreadsheet-sheets"
316
- (tabSelect)="onTabSelect($event)">
317
- @for (sheet of sheets; track trackByItemKey($index, sheet)) {
318
- @if (sheet.state === 'visible') {
319
- <kendo-tabstrip-tab
320
- [title]="sheet.text"
321
- [selected]="sheet.text === activeSheet">
322
- <ng-template kendoTabTemplate>
323
- <span class="k-link">
324
- <span class="k-link-text">{{sheet.text}}</span>
325
- </span>
326
- <span class="k-item-actions">
327
- <kendo-dropdownbutton #sheetDdb
328
- fillMode="flat"
329
- icon="caret-alt-down"
330
- [svgIcon]="caretAltDownIcon"
331
- buttonClass="k-menu-button"
332
- [data]="sheet.sheetActions"
333
- [buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
334
- (open)="onOpen(sheetDdb)"
335
- (close)="onClose()"
336
- (click)="$event.stopPropagation()"
337
- (itemClick)="onActionClick($event, sheet)">
338
- </kendo-dropdownbutton>
339
- </span>
340
- </ng-template>
341
- </kendo-tabstrip-tab>
342
- }
343
- }
344
- </kendo-tabstrip>
345
- `, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: ["arrowIcon", "icon", "svgIcon", "iconClass", "imageUrl", "textField", "data", "size", "rounded", "fillMode", "themeColor", "buttonAttributes"], outputs: ["itemClick", "focus", "blur"], exportAs: ["kendoDropDownButton"] }, { kind: "component", type: TabStripComponent, selector: "kendo-tabstrip", inputs: ["height", "animate", "tabAlignment", "tabPosition", "keepTabContent", "closable", "scrollable", "size", "closeIcon", "closeIconClass", "closeSVGIcon", "showContentArea"], outputs: ["tabSelect", "tabClose", "tabScroll"], exportAs: ["kendoTabStrip"] }, { kind: "component", type: TabStripTabComponent, selector: "kendo-tabstrip-tab", inputs: ["title", "disabled", "cssClass", "cssStyle", "selected", "closable", "closeIcon", "closeIconClass", "closeSVGIcon"], exportAs: ["kendoTabStripTab"] }, { kind: "directive", type: TabTemplateDirective, selector: "[kendoTabTemplate]" }] });
346
- }
347
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SheetsBarComponent, decorators: [{
348
- type: Component,
349
- args: [{
350
- selector: '[kendoSpreadsheetSheetsBar]',
351
- template: `
352
- <button kendoButton #addButton
353
- [title]="messageFor('addSheet')"
354
- type="button"
355
- fillMode="flat"
356
- class="k-spreadsheet-sheet-add"
357
- icon="plus"
358
- [svgIcon]="plusIcon"
359
- [kendoEventsOutsideAngular]="{click: onAddClick}"
360
- [attr.aria-controls]="tablistId">
361
- </button>
362
- <kendo-dropdownbutton #menuButton
363
- fillMode="flat"
364
- buttonClass="k-spreadsheet-sheets-menu"
365
- icon="menu"
366
- [svgIcon]="menuIcon"
367
- [data]="sheetsMenuList"
368
- (itemClick)="onMenuItemClick($event)"
369
- (open)="onOpen(menuButton)"
370
- [buttonAttributes]="{title: messageFor('sheetsMenu')}"
371
- [attr.aria-controls]="tablistId">
372
- </kendo-dropdownbutton>
373
- <kendo-tabstrip #tabstrip
374
- [tabPosition]="'bottom'"
375
- [showContentArea]="false"
376
- [scrollable]="{ scrollButtonsPosition: 'end', mouseScroll: false }"
377
- class="k-spreadsheet-sheets"
378
- (tabSelect)="onTabSelect($event)">
379
- @for (sheet of sheets; track trackByItemKey($index, sheet)) {
380
- @if (sheet.state === 'visible') {
381
- <kendo-tabstrip-tab
382
- [title]="sheet.text"
383
- [selected]="sheet.text === activeSheet">
384
- <ng-template kendoTabTemplate>
385
- <span class="k-link">
386
- <span class="k-link-text">{{sheet.text}}</span>
387
- </span>
388
- <span class="k-item-actions">
389
- <kendo-dropdownbutton #sheetDdb
390
- fillMode="flat"
391
- icon="caret-alt-down"
392
- [svgIcon]="caretAltDownIcon"
393
- buttonClass="k-menu-button"
394
- [data]="sheet.sheetActions"
395
- [buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
396
- (open)="onOpen(sheetDdb)"
397
- (close)="onClose()"
398
- (click)="$event.stopPropagation()"
399
- (itemClick)="onActionClick($event, sheet)">
400
- </kendo-dropdownbutton>
401
- </span>
402
- </ng-template>
403
- </kendo-tabstrip-tab>
404
- }
405
- }
406
- </kendo-tabstrip>
407
- `,
408
- standalone: true,
409
- imports: [ButtonComponent, EventsOutsideAngularDirective, DropDownButtonComponent, TabStripComponent, TabStripTabComponent, TabTemplateDirective]
410
- }]
411
- }], ctorParameters: () => [{ type: i1.SpreadsheetService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.SpreadsheetLocalizationService }, { type: i3.DialogService }, { type: i0.NgZone }], propDecorators: { hostClasses: [{
412
- type: HostBinding,
413
- args: ['class.k-spreadsheet-sheets-bar']
414
- }], sheets: [{
415
- type: Input
416
- }], sheetDescriptors: [{
417
- type: Input
418
- }], addButton: [{
419
- type: ViewChild,
420
- args: ['addButton']
421
- }], menuButton: [{
422
- type: ViewChild,
423
- args: ['menuButton']
424
- }], tabstrip: [{
425
- type: ViewChild,
426
- args: ['tabstrip']
427
- }], actionDdbs: [{
428
- type: ViewChildren,
429
- args: ['sheetDdb']
430
- }], actionDdbRefs: [{
431
- type: ViewChildren,
432
- args: ['sheetDdb', { read: ElementRef }]
433
- }] } });