@progress/kendo-angular-spreadsheet 13.6.0-develop.6
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/LICENSE.md +11 -0
- package/NOTICE.txt +654 -0
- package/README.md +32 -0
- package/action-bar/formula-input.directive.d.ts +33 -0
- package/action-bar/list.component.d.ts +23 -0
- package/action-bar/namebox.component.d.ts +30 -0
- package/common/main-menu.directive.d.ts +17 -0
- package/common/sheet-changes.d.ts +23 -0
- package/common/spreadsheet.service.d.ts +28 -0
- package/esm2020/action-bar/formula-input.directive.mjs +142 -0
- package/esm2020/action-bar/list.component.mjs +75 -0
- package/esm2020/action-bar/namebox.component.mjs +110 -0
- package/esm2020/common/main-menu.directive.mjs +25 -0
- package/esm2020/common/sheet-changes.mjs +5 -0
- package/esm2020/common/spreadsheet.service.mjs +42 -0
- package/esm2020/index.mjs +12 -0
- package/esm2020/localization/custom-messages.component.mjs +42 -0
- package/esm2020/localization/localized-messages.directive.mjs +33 -0
- package/esm2020/localization/messages.mjs +80 -0
- package/esm2020/localization/spreadsheet-localization.service.mjs +31 -0
- package/esm2020/models/events.mjs +5 -0
- package/esm2020/models/index.mjs +7 -0
- package/esm2020/models/main-menu-item.mjs +5 -0
- package/esm2020/models/sheet-info.mjs +5 -0
- package/esm2020/package-metadata.mjs +15 -0
- package/esm2020/progress-kendo-angular-spreadsheet.mjs +8 -0
- package/esm2020/sheets-bar/action-dialog.component.mjs +68 -0
- package/esm2020/sheets-bar/remove.directive.mjs +25 -0
- package/esm2020/sheets-bar/sheets-bar.component.mjs +278 -0
- package/esm2020/sheets-bar/utils.mjs +45 -0
- package/esm2020/spreadsheet.component.mjs +725 -0
- package/esm2020/spreadsheet.module.mjs +235 -0
- package/esm2020/tools/align-tool.directive.mjs +58 -0
- package/esm2020/tools/colorpicker/spreadsheet-backcolor.component.mjs +98 -0
- package/esm2020/tools/colorpicker/spreadsheet-forecolor.component.mjs +98 -0
- package/esm2020/tools/font-family/font-family-dropdownlist.component.mjs +57 -0
- package/esm2020/tools/font-family/spreadsheet-fontfamily-tool.component.mjs +92 -0
- package/esm2020/tools/font-size/font-size-dropdownlist.component.mjs +42 -0
- package/esm2020/tools/font-size/spreadsheet-fontsize-tool.component.mjs +92 -0
- package/esm2020/tools/format-tool.directive.mjs +61 -0
- package/esm2020/tools/gridlines-tool.directive.mjs +46 -0
- package/esm2020/tools/history/redo-tool.mjs +36 -0
- package/esm2020/tools/history/undo-tool.mjs +36 -0
- package/esm2020/tools/index.mjs +20 -0
- package/esm2020/tools/load-file.component.mjs +186 -0
- package/esm2020/tools/save-file-tool.directive.mjs +52 -0
- package/esm2020/tools/shared/command-icons.mjs +71 -0
- package/esm2020/tools/shared/commands.mjs +5 -0
- package/esm2020/tools/shared/constants.mjs +61 -0
- package/esm2020/tools/shared/dialog-content.component.mjs +114 -0
- package/esm2020/tools/shared/spreadsheet-command-base.mjs +75 -0
- package/esm2020/tools/shared/spreadsheet-command-button.mjs +25 -0
- package/esm2020/tools/shared/spreadsheet-dropdown-tools-base.mjs +184 -0
- package/esm2020/tools/shared/spreadsheet-dropdownlist.base.mjs +50 -0
- package/esm2020/tools/tables/add-column-left-button.directive.mjs +36 -0
- package/esm2020/tools/tables/add-column-right-button.directive.mjs +36 -0
- package/esm2020/tools/tables/add-row-above-button.directive.mjs +36 -0
- package/esm2020/tools/tables/add-row-below-button.directive.mjs +36 -0
- package/esm2020/tools/tables/delete-column-button.directive.mjs +34 -0
- package/esm2020/tools/tables/delete-row-button.directive.mjs +34 -0
- package/esm2020/tools/tables/index.mjs +10 -0
- package/esm2020/tools/text-wrap-tool.directive.mjs +47 -0
- package/esm2020/tools/tools.service.mjs +60 -0
- package/esm2020/tools/typographical-emphasis/bold-tool.directive.mjs +36 -0
- package/esm2020/tools/typographical-emphasis/italic-tool.directive.mjs +36 -0
- package/esm2020/tools/typographical-emphasis/underline-tool.directive.mjs +36 -0
- package/esm2020/tools/utils.mjs +13 -0
- package/esm2020/utils.mjs +25 -0
- package/fesm2015/progress-kendo-angular-spreadsheet.mjs +3372 -0
- package/fesm2020/progress-kendo-angular-spreadsheet.mjs +3382 -0
- package/index.d.ts +13 -0
- package/localization/custom-messages.component.d.ts +18 -0
- package/localization/localized-messages.directive.d.ts +16 -0
- package/localization/messages.d.ts +133 -0
- package/localization/spreadsheet-localization.service.d.ts +14 -0
- package/models/events.d.ts +65 -0
- package/models/index.d.ts +7 -0
- package/models/main-menu-item.d.ts +19 -0
- package/models/sheet-info.d.ts +26 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +65 -0
- package/progress-kendo-angular-spreadsheet.d.ts +9 -0
- package/schematics/collection.json +12 -0
- package/schematics/ngAdd/index.js +13 -0
- package/schematics/ngAdd/schema.json +24 -0
- package/sheets-bar/action-dialog.component.d.ts +19 -0
- package/sheets-bar/remove.directive.d.ts +13 -0
- package/sheets-bar/sheets-bar.component.d.ts +53 -0
- package/sheets-bar/utils.d.ts +10 -0
- package/spreadsheet.component.d.ts +176 -0
- package/spreadsheet.module.d.ts +62 -0
- package/tools/align-tool.directive.d.ts +25 -0
- package/tools/colorpicker/spreadsheet-backcolor.component.d.ts +20 -0
- package/tools/colorpicker/spreadsheet-forecolor.component.d.ts +20 -0
- package/tools/font-family/font-family-dropdownlist.component.d.ts +13 -0
- package/tools/font-family/spreadsheet-fontfamily-tool.component.d.ts +24 -0
- package/tools/font-size/font-size-dropdownlist.component.d.ts +13 -0
- package/tools/font-size/spreadsheet-fontsize-tool.component.d.ts +24 -0
- package/tools/format-tool.directive.d.ts +36 -0
- package/tools/gridlines-tool.directive.d.ts +19 -0
- package/tools/history/redo-tool.d.ts +19 -0
- package/tools/history/undo-tool.d.ts +19 -0
- package/tools/index.d.ts +20 -0
- package/tools/load-file.component.d.ts +41 -0
- package/tools/save-file-tool.directive.d.ts +22 -0
- package/tools/shared/command-icons.d.ts +14 -0
- package/tools/shared/commands.d.ts +8 -0
- package/tools/shared/constants.d.ts +50 -0
- package/tools/shared/dialog-content.component.d.ts +21 -0
- package/tools/shared/spreadsheet-command-base.d.ts +29 -0
- package/tools/shared/spreadsheet-command-button.d.ts +23 -0
- package/tools/shared/spreadsheet-dropdown-tools-base.d.ts +76 -0
- package/tools/shared/spreadsheet-dropdownlist.base.d.ts +25 -0
- package/tools/tables/add-column-left-button.directive.d.ts +18 -0
- package/tools/tables/add-column-right-button.directive.d.ts +18 -0
- package/tools/tables/add-row-above-button.directive.d.ts +18 -0
- package/tools/tables/add-row-below-button.directive.d.ts +18 -0
- package/tools/tables/delete-column-button.directive.d.ts +18 -0
- package/tools/tables/delete-row-button.directive.d.ts +18 -0
- package/tools/tables/index.d.ts +10 -0
- package/tools/text-wrap-tool.directive.d.ts +19 -0
- package/tools/tools.service.d.ts +21 -0
- package/tools/typographical-emphasis/bold-tool.directive.d.ts +18 -0
- package/tools/typographical-emphasis/italic-tool.directive.d.ts +18 -0
- package/tools/typographical-emphasis/underline-tool.directive.d.ts +18 -0
- package/tools/utils.d.ts +8 -0
- package/utils.d.ts +9 -0
|
@@ -0,0 +1,3372 @@
|
|
|
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 * as i0 from '@angular/core';
|
|
6
|
+
import { EventEmitter, Injectable, Output, Inject, Optional, Component, HostBinding, Input, Directive, forwardRef, ElementRef, ViewChild, InjectionToken, HostListener, ViewContainerRef, NgModule } from '@angular/core';
|
|
7
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
8
|
+
import { SpreadsheetWidget } from '@progress/kendo-spreadsheet-common';
|
|
9
|
+
import * as i1$5 from '@progress/kendo-angular-intl';
|
|
10
|
+
import { localeData, IntlModule } from '@progress/kendo-angular-intl';
|
|
11
|
+
import { formulaFxIcon, trashIcon, copyIcon, pencilIcon, arrowRightIcon, arrowLeftIcon, alignCenterIcon, alignJustifyIcon, alignLeftIcon, alignRightIcon, alignTopIcon, alignMiddleIcon, alignBottomIcon, dropletIcon, boldIcon, foregroundColorIcon, italicIcon, arrowRotateCwIcon, underlineIcon, arrowRotateCcwIcon, textWrapIcon, tableColumnInsertLeftIcon, tableColumnInsertRightIcon, tableRowInsertAboveIcon, tableRowInsertBelowIcon, tableRowDeleteIcon, tableColumnDeleteIcon, bordersNoneIcon, folderOpenIcon, downloadIcon, customFormatIcon, fontSizeIcon, fontFamilyIcon, plusIcon, menuIcon, caretAltDownIcon, caretAltLeftIcon, caretAltRightIcon, eyeIcon } from '@progress/kendo-svg-icons';
|
|
12
|
+
import * as i1 from '@progress/kendo-angular-l10n';
|
|
13
|
+
import { LocalizationService, L10N_PREFIX, RTL, ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
14
|
+
import * as i3 from '@progress/kendo-angular-common';
|
|
15
|
+
import { isPresent, hasObservers, isDocumentAvailable, shouldShowValidationUI, EventsModule, WatermarkModule } from '@progress/kendo-angular-common';
|
|
16
|
+
import * as i1$1 from '@progress/kendo-angular-popup';
|
|
17
|
+
import { PopupService, PopupModule } from '@progress/kendo-angular-popup';
|
|
18
|
+
import { Subject, Subscription } from 'rxjs';
|
|
19
|
+
import * as i6 from '@progress/kendo-angular-icons';
|
|
20
|
+
import { IconsModule } from '@progress/kendo-angular-icons';
|
|
21
|
+
import * as i7 from '@angular/common';
|
|
22
|
+
import { CommonModule } from '@angular/common';
|
|
23
|
+
import { take, map } from 'rxjs/operators';
|
|
24
|
+
import * as i5$2 from '@progress/kendo-angular-menu';
|
|
25
|
+
import { MenuModule } from '@progress/kendo-angular-menu';
|
|
26
|
+
import * as i1$2 from '@progress/kendo-angular-toolbar';
|
|
27
|
+
import { ToolBarToolComponent, ToolBarComponent, ToolBarModule } from '@progress/kendo-angular-toolbar';
|
|
28
|
+
import * as i4 from '@progress/kendo-angular-buttons';
|
|
29
|
+
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
30
|
+
import * as i1$4 from '@progress/kendo-angular-dialog';
|
|
31
|
+
import { DialogContentBase, DialogModule } from '@progress/kendo-angular-dialog';
|
|
32
|
+
import * as i1$3 from '@progress/kendo-angular-dropdowns';
|
|
33
|
+
import { DropDownListComponent, ComboBoxModule, DropDownListModule } from '@progress/kendo-angular-dropdowns';
|
|
34
|
+
import * as i5 from '@progress/kendo-angular-inputs';
|
|
35
|
+
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
36
|
+
import * as i5$1 from '@progress/kendo-angular-layout';
|
|
37
|
+
import { TabStripModule } from '@progress/kendo-angular-layout';
|
|
38
|
+
import { saveAs } from '@progress/kendo-file-saver';
|
|
39
|
+
import { Workbook } from '@progress/kendo-ooxml';
|
|
40
|
+
import { LabelModule } from '@progress/kendo-angular-label';
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
const packageMetadata = {
|
|
46
|
+
name: '@progress/kendo-angular-spreadsheet',
|
|
47
|
+
productName: 'Kendo UI for Angular',
|
|
48
|
+
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
49
|
+
publishDate: 1695882759,
|
|
50
|
+
version: '13.6.0-develop.6',
|
|
51
|
+
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',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
class SpreadsheetToolsService {
|
|
58
|
+
constructor(ngZone) {
|
|
59
|
+
this.ngZone = ngZone;
|
|
60
|
+
this.stateChange = new EventEmitter();
|
|
61
|
+
this.toolsFunctions = [
|
|
62
|
+
'bold',
|
|
63
|
+
'italic',
|
|
64
|
+
'underline',
|
|
65
|
+
'fontFamily',
|
|
66
|
+
'fontSize',
|
|
67
|
+
'color',
|
|
68
|
+
'background',
|
|
69
|
+
'textAlign',
|
|
70
|
+
'verticalAlign',
|
|
71
|
+
'wrap',
|
|
72
|
+
'gridLines',
|
|
73
|
+
'format'
|
|
74
|
+
];
|
|
75
|
+
this._toolsState = {};
|
|
76
|
+
this.updateTools = (e) => {
|
|
77
|
+
this.ngZone.run(() => {
|
|
78
|
+
const state = {};
|
|
79
|
+
this.toolsFunctions.forEach(tool => {
|
|
80
|
+
if (typeof e.range[tool] === 'function') {
|
|
81
|
+
state[tool] = e.range[tool]();
|
|
82
|
+
}
|
|
83
|
+
else if (tool === 'gridLines') {
|
|
84
|
+
state[tool] = e.range.sheet().showGridLines();
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
if (this.toolsFunctions.some(k => state[k] !== this.toolsState[k])) {
|
|
88
|
+
this.toolsState = state;
|
|
89
|
+
this.stateChange.emit(state);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
set toolsState(state) {
|
|
95
|
+
this._toolsState = state;
|
|
96
|
+
}
|
|
97
|
+
get toolsState() {
|
|
98
|
+
return this._toolsState;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
SpreadsheetToolsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetToolsService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
102
|
+
SpreadsheetToolsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetToolsService });
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetToolsService, decorators: [{
|
|
104
|
+
type: Injectable
|
|
105
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { stateChange: [{
|
|
106
|
+
type: Output
|
|
107
|
+
}] } });
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @hidden
|
|
111
|
+
*/
|
|
112
|
+
class SpreadsheetLocalizationService extends LocalizationService {
|
|
113
|
+
constructor(prefix, messageService, _rtl) {
|
|
114
|
+
super(prefix, messageService, _rtl);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
SpreadsheetLocalizationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetLocalizationService, deps: [{ token: L10N_PREFIX }, { token: i1.MessageService, optional: true }, { token: RTL, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
118
|
+
SpreadsheetLocalizationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetLocalizationService });
|
|
119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetLocalizationService, decorators: [{
|
|
120
|
+
type: Injectable
|
|
121
|
+
}], ctorParameters: function () {
|
|
122
|
+
return [{ type: undefined, decorators: [{
|
|
123
|
+
type: Inject,
|
|
124
|
+
args: [L10N_PREFIX]
|
|
125
|
+
}] }, { type: i1.MessageService, decorators: [{
|
|
126
|
+
type: Optional
|
|
127
|
+
}] }, { type: undefined, decorators: [{
|
|
128
|
+
type: Optional
|
|
129
|
+
}, {
|
|
130
|
+
type: Inject,
|
|
131
|
+
args: [RTL]
|
|
132
|
+
}] }];
|
|
133
|
+
} });
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @hidden
|
|
137
|
+
*/
|
|
138
|
+
const mapToSheetDescriptor = (sheetsArray) => {
|
|
139
|
+
return sheetsArray.map((sheet) => {
|
|
140
|
+
return {
|
|
141
|
+
activeCell: sheet.activeCell(),
|
|
142
|
+
columns: sheet._columns,
|
|
143
|
+
defaultCellStyle: sheet._defaultCellStyle,
|
|
144
|
+
drawings: sheet._drawings,
|
|
145
|
+
frozenColumns: sheet.frozenColumns,
|
|
146
|
+
frozenRows: sheet.frozenRows,
|
|
147
|
+
hyperlinks: sheet._hyperlinks,
|
|
148
|
+
mergedCells: sheet.mergedCells,
|
|
149
|
+
name: sheet.name(),
|
|
150
|
+
rows: sheet._rows,
|
|
151
|
+
selection: sheet.selection(),
|
|
152
|
+
showGridLines: sheet.showGridLines
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
let spreadsheetCounter = 0;
|
|
158
|
+
/**
|
|
159
|
+
* @hidden
|
|
160
|
+
*/
|
|
161
|
+
class SpreadsheetService {
|
|
162
|
+
constructor() {
|
|
163
|
+
this.sheetsChanged = new Subject();
|
|
164
|
+
this.activeSheetChanged = new Subject();
|
|
165
|
+
spreadsheetCounter++;
|
|
166
|
+
}
|
|
167
|
+
set currentActiveSheet(value) {
|
|
168
|
+
this._currentActiveSheet = value;
|
|
169
|
+
}
|
|
170
|
+
get currentActiveSheet() {
|
|
171
|
+
return this._currentActiveSheet;
|
|
172
|
+
}
|
|
173
|
+
get activeSheet() {
|
|
174
|
+
var _a;
|
|
175
|
+
return (_a = this.spreadsheet.activeSheet()) === null || _a === void 0 ? void 0 : _a.name();
|
|
176
|
+
}
|
|
177
|
+
get formulaListId() {
|
|
178
|
+
return `k-spreadsheet-${spreadsheetCounter}-formula-list`;
|
|
179
|
+
}
|
|
180
|
+
notifySheetsChange(actionType, sheetInfo) {
|
|
181
|
+
const sheets = this.spreadsheet.sheets();
|
|
182
|
+
this.sheetsChanged.next({ sheets, sheet: sheetInfo, actionType });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
SpreadsheetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
186
|
+
SpreadsheetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetService, providedIn: 'root' });
|
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetService, decorators: [{
|
|
188
|
+
type: Injectable,
|
|
189
|
+
args: [{
|
|
190
|
+
providedIn: 'root'
|
|
191
|
+
}]
|
|
192
|
+
}], ctorParameters: function () { return []; } });
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @hidden
|
|
196
|
+
*/
|
|
197
|
+
class FormulaListComponent {
|
|
198
|
+
constructor(element, spreadsheetService) {
|
|
199
|
+
this.element = element;
|
|
200
|
+
this.spreadsheetService = spreadsheetService;
|
|
201
|
+
this.id = this.spreadsheetService.formulaListId;
|
|
202
|
+
this.data = [];
|
|
203
|
+
this.formulaFxIcon = formulaFxIcon;
|
|
204
|
+
this.handleMouseDown = (ev) => {
|
|
205
|
+
ev.preventDefault();
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
FormulaListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormulaListComponent, deps: [{ token: i0.ElementRef }, { token: SpreadsheetService }], target: i0.ɵɵFactoryTarget.Component });
|
|
210
|
+
FormulaListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FormulaListComponent, selector: "kendo-spreadsheet-formula-list", inputs: { data: "data", itemClick: "itemClick" }, host: { properties: { "attr.id": "this.id" } }, ngImport: i0, template: `
|
|
211
|
+
<ul #ulRef
|
|
212
|
+
class="k-spreadsheet-formula-list k-list-ul k-list-md k-group k-reset"
|
|
213
|
+
role="menu"
|
|
214
|
+
[kendoEventsOutsideAngular]="{mousedown: handleMouseDown}">
|
|
215
|
+
<li *ngFor="let item of data"
|
|
216
|
+
(click)="itemClick(item.text)"
|
|
217
|
+
class="k-list-item"
|
|
218
|
+
role="menuitem">
|
|
219
|
+
<kendo-icon-wrapper
|
|
220
|
+
[svgIcon]="formulaFxIcon"
|
|
221
|
+
name="formula-fx"
|
|
222
|
+
></kendo-icon-wrapper>
|
|
223
|
+
<span className="k-list-item-text">{{item.text}}</span>
|
|
224
|
+
</li>
|
|
225
|
+
</ul>
|
|
226
|
+
`, isInline: true, components: [{ type: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i3.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormulaListComponent, decorators: [{
|
|
228
|
+
type: Component,
|
|
229
|
+
args: [{
|
|
230
|
+
selector: 'kendo-spreadsheet-formula-list',
|
|
231
|
+
template: `
|
|
232
|
+
<ul #ulRef
|
|
233
|
+
class="k-spreadsheet-formula-list k-list-ul k-list-md k-group k-reset"
|
|
234
|
+
role="menu"
|
|
235
|
+
[kendoEventsOutsideAngular]="{mousedown: handleMouseDown}">
|
|
236
|
+
<li *ngFor="let item of data"
|
|
237
|
+
(click)="itemClick(item.text)"
|
|
238
|
+
class="k-list-item"
|
|
239
|
+
role="menuitem">
|
|
240
|
+
<kendo-icon-wrapper
|
|
241
|
+
[svgIcon]="formulaFxIcon"
|
|
242
|
+
name="formula-fx"
|
|
243
|
+
></kendo-icon-wrapper>
|
|
244
|
+
<span className="k-list-item-text">{{item.text}}</span>
|
|
245
|
+
</li>
|
|
246
|
+
</ul>
|
|
247
|
+
`
|
|
248
|
+
}]
|
|
249
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: SpreadsheetService }]; }, propDecorators: { id: [{
|
|
250
|
+
type: HostBinding,
|
|
251
|
+
args: ['attr.id']
|
|
252
|
+
}], data: [{
|
|
253
|
+
type: Input
|
|
254
|
+
}], itemClick: [{
|
|
255
|
+
type: Input
|
|
256
|
+
}] } });
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @hidden
|
|
260
|
+
*/
|
|
261
|
+
class FormulaInputDirective {
|
|
262
|
+
constructor(element, popupService, spreadsheetService) {
|
|
263
|
+
this.element = element;
|
|
264
|
+
this.popupService = popupService;
|
|
265
|
+
this.spreadsheetService = spreadsheetService;
|
|
266
|
+
this.hostClasses = true;
|
|
267
|
+
this.ariaHasPopup = 'menu';
|
|
268
|
+
this.ariaExpanded = null;
|
|
269
|
+
this.focusedItem = () => { var _a; return (_a = this.list) === null || _a === void 0 ? void 0 : _a.element.nativeElement.querySelector('.k-focus'); };
|
|
270
|
+
this.unfocus = () => {
|
|
271
|
+
const focused = this.focusedItem();
|
|
272
|
+
if (focused) {
|
|
273
|
+
focused.classList.remove('k-focus');
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
this.focusNext = (dir) => {
|
|
277
|
+
var _a;
|
|
278
|
+
const element = (_a = this.list) === null || _a === void 0 ? void 0 : _a.element.nativeElement.firstElementChild;
|
|
279
|
+
const items = Array.from((element && element.children) || []);
|
|
280
|
+
const focused = this.focusedItem();
|
|
281
|
+
let next;
|
|
282
|
+
if (focused) {
|
|
283
|
+
const index = items.indexOf(focused);
|
|
284
|
+
focused.classList.remove('k-focus');
|
|
285
|
+
next = items[index + dir] ? items[index + dir] : (dir === 1 ? items[0] : items[items.length - 1]);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
next = (dir === 1 ? items[0] : items[items.length - 1]);
|
|
289
|
+
}
|
|
290
|
+
if (next) {
|
|
291
|
+
next.classList.add('k-focus');
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
get ariaControls() {
|
|
296
|
+
return this.ariaExpanded ? this.spreadsheetService.formulaListId : null;
|
|
297
|
+
}
|
|
298
|
+
get listElement() {
|
|
299
|
+
var _a;
|
|
300
|
+
return (_a = this.list) === null || _a === void 0 ? void 0 : _a.element.nativeElement.firstElementChild;
|
|
301
|
+
}
|
|
302
|
+
get current() {
|
|
303
|
+
var _a;
|
|
304
|
+
return {
|
|
305
|
+
element: this.element.nativeElement,
|
|
306
|
+
list: {
|
|
307
|
+
element: (_a = this.list) === null || _a === void 0 ? void 0 : _a.element.nativeElement,
|
|
308
|
+
data: (d) => {
|
|
309
|
+
if (d) {
|
|
310
|
+
this.data = d;
|
|
311
|
+
this.list && (this.list.data = d);
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
return this.data;
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
itemClick: (handler) => {
|
|
318
|
+
this.handler = handler;
|
|
319
|
+
},
|
|
320
|
+
value: () => { return {}; },
|
|
321
|
+
focus: () => {
|
|
322
|
+
var _a;
|
|
323
|
+
const items = Array.from(((_a = this.listElement) === null || _a === void 0 ? void 0 : _a.children) || []);
|
|
324
|
+
return items.indexOf(this.focusedItem());
|
|
325
|
+
},
|
|
326
|
+
focusNext: () => this.focusNext(1),
|
|
327
|
+
focusPrev: () => this.focusNext(-1),
|
|
328
|
+
focusFirst: () => {
|
|
329
|
+
const list = this.listElement;
|
|
330
|
+
if (list && list.children.item(0)) {
|
|
331
|
+
this.unfocus();
|
|
332
|
+
list.children.item(0).classList.add('k-focus');
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
focusLast: () => {
|
|
336
|
+
const list = this.listElement;
|
|
337
|
+
if (list && list.children.length) {
|
|
338
|
+
this.unfocus();
|
|
339
|
+
list.children.item(list.children.length - 1).classList.add('k-focus');
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
popup: {
|
|
344
|
+
open: () => {
|
|
345
|
+
this.popupRef && this.popupRef.close();
|
|
346
|
+
this.popupRef = null;
|
|
347
|
+
this.popupRef = this.popupService.open({
|
|
348
|
+
anchor: this.element,
|
|
349
|
+
content: FormulaListComponent,
|
|
350
|
+
animate: { direction: 'down', duration: 100 }
|
|
351
|
+
});
|
|
352
|
+
const list = this.popupRef.content.instance;
|
|
353
|
+
this.list = list;
|
|
354
|
+
list.data = this.data;
|
|
355
|
+
list.itemClick = this.handler;
|
|
356
|
+
this.ariaExpanded = true;
|
|
357
|
+
},
|
|
358
|
+
close: () => {
|
|
359
|
+
this.popupRef && this.popupRef.close();
|
|
360
|
+
this.popupRef = null;
|
|
361
|
+
this.ariaExpanded = null;
|
|
362
|
+
},
|
|
363
|
+
position: () => {
|
|
364
|
+
// contentKey++;
|
|
365
|
+
},
|
|
366
|
+
visible: () => {
|
|
367
|
+
return this.popupRef;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
FormulaInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormulaInputDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.PopupService }, { token: SpreadsheetService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
374
|
+
FormulaInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: FormulaInputDirective, selector: "[kendoSpreadsheetFormulaInput]", host: { properties: { "class.k-spreadsheet-formula-input": "this.hostClasses", "attr.aria-haspopup": "this.ariaHasPopup", "attr.aria-expanded": "this.ariaExpanded", "attr.aria-controls": "this.ariaControls" } }, ngImport: i0 });
|
|
375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FormulaInputDirective, decorators: [{
|
|
376
|
+
type: Directive,
|
|
377
|
+
args: [{
|
|
378
|
+
selector: '[kendoSpreadsheetFormulaInput]',
|
|
379
|
+
}]
|
|
380
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.PopupService }, { type: SpreadsheetService }]; }, propDecorators: { hostClasses: [{
|
|
381
|
+
type: HostBinding,
|
|
382
|
+
args: ['class.k-spreadsheet-formula-input']
|
|
383
|
+
}], ariaHasPopup: [{
|
|
384
|
+
type: HostBinding,
|
|
385
|
+
args: ['attr.aria-haspopup']
|
|
386
|
+
}], ariaExpanded: [{
|
|
387
|
+
type: HostBinding,
|
|
388
|
+
args: ['attr.aria-expanded']
|
|
389
|
+
}], ariaControls: [{
|
|
390
|
+
type: HostBinding,
|
|
391
|
+
args: ['attr.aria-controls']
|
|
392
|
+
}] } });
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* @hidden
|
|
396
|
+
*/
|
|
397
|
+
const getSheetActions = (index, items) => {
|
|
398
|
+
return [{
|
|
399
|
+
text: 'Delete',
|
|
400
|
+
icon: 'trash',
|
|
401
|
+
svgIcon: trashIcon,
|
|
402
|
+
commandName: 'delete',
|
|
403
|
+
dialogButton: 'dialogDelete',
|
|
404
|
+
disabled: items.length === 1
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
text: 'Duplicate',
|
|
408
|
+
icon: 'copy',
|
|
409
|
+
svgIcon: copyIcon,
|
|
410
|
+
commandName: 'copy'
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
text: 'Rename',
|
|
414
|
+
icon: 'pencil',
|
|
415
|
+
svgIcon: pencilIcon,
|
|
416
|
+
commandName: 'rename',
|
|
417
|
+
dialogButton: 'dialogRename'
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
text: 'Move Right',
|
|
421
|
+
icon: 'arrow-right',
|
|
422
|
+
svgIcon: arrowRightIcon,
|
|
423
|
+
commandName: 'move',
|
|
424
|
+
disabled: index === items.length - 1
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
text: 'Move Left',
|
|
428
|
+
icon: 'arrow-left',
|
|
429
|
+
svgIcon: arrowLeftIcon,
|
|
430
|
+
commandName: 'move',
|
|
431
|
+
disabled: index === 0
|
|
432
|
+
}];
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* @hidden
|
|
437
|
+
*/
|
|
438
|
+
const commandIcons = {
|
|
439
|
+
alignCenter: 'align-center',
|
|
440
|
+
alignJustify: 'align-justify',
|
|
441
|
+
alignLeft: 'align-left',
|
|
442
|
+
alignRight: 'align-right',
|
|
443
|
+
alignTop: 'align-top',
|
|
444
|
+
alignMiddle: 'align-middle',
|
|
445
|
+
alignBottom: 'align-bottom',
|
|
446
|
+
align: 'align-left',
|
|
447
|
+
background: 'droplet',
|
|
448
|
+
bold: 'bold',
|
|
449
|
+
color: 'foreground-color',
|
|
450
|
+
italic: 'italic',
|
|
451
|
+
redo: 'arrow-rotate-cw',
|
|
452
|
+
underline: 'underline',
|
|
453
|
+
undo: 'arrow-rotate-ccw',
|
|
454
|
+
wrap: 'text-wrap',
|
|
455
|
+
addColumnLeft: 'table-column-insert-left',
|
|
456
|
+
addColumnRight: 'table-column-insert-right',
|
|
457
|
+
addRowAbove: 'table-row-insert-above',
|
|
458
|
+
addRowBelow: 'table-row-insert-below',
|
|
459
|
+
deleteRow: 'table-row-delete',
|
|
460
|
+
deleteColumn: 'table-column-delete',
|
|
461
|
+
gridLines: 'borders-none',
|
|
462
|
+
folderOpen: 'folder-open',
|
|
463
|
+
download: 'download',
|
|
464
|
+
format: 'custom-format',
|
|
465
|
+
fontSize: 'font-size',
|
|
466
|
+
fontFamily: 'font-family'
|
|
467
|
+
};
|
|
468
|
+
/**
|
|
469
|
+
* @hidden
|
|
470
|
+
*/
|
|
471
|
+
const commandSVGIcons = {
|
|
472
|
+
alignCenter: alignCenterIcon,
|
|
473
|
+
alignJustify: alignJustifyIcon,
|
|
474
|
+
alignLeft: alignLeftIcon,
|
|
475
|
+
alignRight: alignRightIcon,
|
|
476
|
+
alignTop: alignTopIcon,
|
|
477
|
+
alignMiddle: alignMiddleIcon,
|
|
478
|
+
alignBottom: alignBottomIcon,
|
|
479
|
+
align: alignLeftIcon,
|
|
480
|
+
background: dropletIcon,
|
|
481
|
+
bold: boldIcon,
|
|
482
|
+
color: foregroundColorIcon,
|
|
483
|
+
italic: italicIcon,
|
|
484
|
+
redo: arrowRotateCwIcon,
|
|
485
|
+
underline: underlineIcon,
|
|
486
|
+
undo: arrowRotateCcwIcon,
|
|
487
|
+
wrap: textWrapIcon,
|
|
488
|
+
addColumnLeft: tableColumnInsertLeftIcon,
|
|
489
|
+
addColumnRight: tableColumnInsertRightIcon,
|
|
490
|
+
addRowAbove: tableRowInsertAboveIcon,
|
|
491
|
+
addRowBelow: tableRowInsertBelowIcon,
|
|
492
|
+
deleteRow: tableRowDeleteIcon,
|
|
493
|
+
deleteColumn: tableColumnDeleteIcon,
|
|
494
|
+
gridLines: bordersNoneIcon,
|
|
495
|
+
folderOpen: folderOpenIcon,
|
|
496
|
+
download: downloadIcon,
|
|
497
|
+
format: customFormatIcon,
|
|
498
|
+
fontSize: fontSizeIcon,
|
|
499
|
+
fontFamily: fontFamilyIcon
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
class SpreadsheetLoadFileComponent extends ToolBarToolComponent {
|
|
503
|
+
constructor(localization, spreadsheetService, toolbar) {
|
|
504
|
+
super();
|
|
505
|
+
this.localization = localization;
|
|
506
|
+
this.spreadsheetService = spreadsheetService;
|
|
507
|
+
this.toolbar = toolbar;
|
|
508
|
+
this.icon = commandIcons['folderOpen'];
|
|
509
|
+
this.svgIcon = commandSVGIcons['folderOpen'];
|
|
510
|
+
this.tabindex = -1;
|
|
511
|
+
this.onFileSelect = (e) => {
|
|
512
|
+
const file = e.target.files[0];
|
|
513
|
+
if (file) {
|
|
514
|
+
this.spreadsheetService.spreadsheet.fromFile(file);
|
|
515
|
+
e.target.value = null;
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* @hidden
|
|
521
|
+
*/
|
|
522
|
+
messageFor(key) {
|
|
523
|
+
return this.localization.get(key);
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* @hidden
|
|
527
|
+
*/
|
|
528
|
+
canFocus() {
|
|
529
|
+
return true;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* @hidden
|
|
533
|
+
*/
|
|
534
|
+
focus() {
|
|
535
|
+
this.tabindex = 0;
|
|
536
|
+
if (this.overflows) {
|
|
537
|
+
this.overflowButtonElement.nativeElement.focus();
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
this.button.focus();
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* @hidden
|
|
545
|
+
*/
|
|
546
|
+
handleKey() {
|
|
547
|
+
this.tabindex = -1;
|
|
548
|
+
return false;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
SpreadsheetLoadFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetLoadFileComponent, deps: [{ token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
552
|
+
SpreadsheetLoadFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetLoadFileComponent, selector: "kendo-spreadsheet-load-file-tool", providers: [
|
|
553
|
+
{
|
|
554
|
+
provide: ToolBarToolComponent,
|
|
555
|
+
useExisting: forwardRef(() => SpreadsheetLoadFileComponent),
|
|
556
|
+
},
|
|
557
|
+
], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "overflowButtonElement", first: true, predicate: ["overflowButton"], descendants: true, read: ElementRef }, { propertyName: "button", first: true, predicate: ["button"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
558
|
+
<ng-template #toolbarTemplate>
|
|
559
|
+
<button
|
|
560
|
+
#button
|
|
561
|
+
type="button"
|
|
562
|
+
kendoButton
|
|
563
|
+
[title]="messageFor('loadFile')"
|
|
564
|
+
fillMode="flat"
|
|
565
|
+
[icon]="icon"
|
|
566
|
+
[svgIcon]="svgIcon"
|
|
567
|
+
(click)="fileSelectEl.click()"></button>
|
|
568
|
+
<input
|
|
569
|
+
#fileSelectEl
|
|
570
|
+
type="file"
|
|
571
|
+
(change)="onFileSelect($event)"
|
|
572
|
+
[style.display]="'none'"
|
|
573
|
+
aria-hidden="true"
|
|
574
|
+
accept=".xlsx,.XLSX" />
|
|
575
|
+
</ng-template>
|
|
576
|
+
<ng-template #popupTemplate>
|
|
577
|
+
<div
|
|
578
|
+
#overflowButton
|
|
579
|
+
tabindex="-1"
|
|
580
|
+
role="menuitem"
|
|
581
|
+
class="k-item k-menu-item"
|
|
582
|
+
(click)="toolbar.toggle(false); popupFileSelectEl.click()">
|
|
583
|
+
<span
|
|
584
|
+
class="k-link k-menu-link">
|
|
585
|
+
<kendo-icon-wrapper
|
|
586
|
+
[name]="icon"
|
|
587
|
+
[svgIcon]="svgIcon"
|
|
588
|
+
></kendo-icon-wrapper>
|
|
589
|
+
<span class="k-menu-link-text">{{messageFor('loadFile')}}</span>
|
|
590
|
+
</span>
|
|
591
|
+
<input
|
|
592
|
+
#popupFileSelectEl
|
|
593
|
+
type="file"
|
|
594
|
+
(change)="onFileSelect($event)"
|
|
595
|
+
[style.display]="'none'"
|
|
596
|
+
aria-hidden="true"
|
|
597
|
+
accept=".xlsx,.XLSX" />
|
|
598
|
+
</div>
|
|
599
|
+
</ng-template>
|
|
600
|
+
`, 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: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }] });
|
|
601
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetLoadFileComponent, decorators: [{
|
|
602
|
+
type: Component,
|
|
603
|
+
args: [{
|
|
604
|
+
selector: 'kendo-spreadsheet-load-file-tool',
|
|
605
|
+
providers: [
|
|
606
|
+
{
|
|
607
|
+
provide: ToolBarToolComponent,
|
|
608
|
+
useExisting: forwardRef(() => SpreadsheetLoadFileComponent),
|
|
609
|
+
},
|
|
610
|
+
],
|
|
611
|
+
template: `
|
|
612
|
+
<ng-template #toolbarTemplate>
|
|
613
|
+
<button
|
|
614
|
+
#button
|
|
615
|
+
type="button"
|
|
616
|
+
kendoButton
|
|
617
|
+
[title]="messageFor('loadFile')"
|
|
618
|
+
fillMode="flat"
|
|
619
|
+
[icon]="icon"
|
|
620
|
+
[svgIcon]="svgIcon"
|
|
621
|
+
(click)="fileSelectEl.click()"></button>
|
|
622
|
+
<input
|
|
623
|
+
#fileSelectEl
|
|
624
|
+
type="file"
|
|
625
|
+
(change)="onFileSelect($event)"
|
|
626
|
+
[style.display]="'none'"
|
|
627
|
+
aria-hidden="true"
|
|
628
|
+
accept=".xlsx,.XLSX" />
|
|
629
|
+
</ng-template>
|
|
630
|
+
<ng-template #popupTemplate>
|
|
631
|
+
<div
|
|
632
|
+
#overflowButton
|
|
633
|
+
tabindex="-1"
|
|
634
|
+
role="menuitem"
|
|
635
|
+
class="k-item k-menu-item"
|
|
636
|
+
(click)="toolbar.toggle(false); popupFileSelectEl.click()">
|
|
637
|
+
<span
|
|
638
|
+
class="k-link k-menu-link">
|
|
639
|
+
<kendo-icon-wrapper
|
|
640
|
+
[name]="icon"
|
|
641
|
+
[svgIcon]="svgIcon"
|
|
642
|
+
></kendo-icon-wrapper>
|
|
643
|
+
<span class="k-menu-link-text">{{messageFor('loadFile')}}</span>
|
|
644
|
+
</span>
|
|
645
|
+
<input
|
|
646
|
+
#popupFileSelectEl
|
|
647
|
+
type="file"
|
|
648
|
+
(change)="onFileSelect($event)"
|
|
649
|
+
[style.display]="'none'"
|
|
650
|
+
aria-hidden="true"
|
|
651
|
+
accept=".xlsx,.XLSX" />
|
|
652
|
+
</div>
|
|
653
|
+
</ng-template>
|
|
654
|
+
`
|
|
655
|
+
}]
|
|
656
|
+
}], ctorParameters: function () {
|
|
657
|
+
return [{ type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: i1$2.ToolBarComponent, decorators: [{
|
|
658
|
+
type: Inject,
|
|
659
|
+
args: [ToolBarComponent]
|
|
660
|
+
}] }];
|
|
661
|
+
}, propDecorators: { toolbarTemplate: [{
|
|
662
|
+
type: ViewChild,
|
|
663
|
+
args: ['toolbarTemplate', { static: true }]
|
|
664
|
+
}], popupTemplate: [{
|
|
665
|
+
type: ViewChild,
|
|
666
|
+
args: ['popupTemplate', { static: true }]
|
|
667
|
+
}], overflowButtonElement: [{
|
|
668
|
+
type: ViewChild,
|
|
669
|
+
args: ['overflowButton', { read: ElementRef, static: false }]
|
|
670
|
+
}], button: [{
|
|
671
|
+
type: ViewChild,
|
|
672
|
+
args: ['button']
|
|
673
|
+
}] } });
|
|
674
|
+
|
|
675
|
+
const DEFAULT_FONT_FAMILY = 'Arial';
|
|
676
|
+
const DEFAULT_FONT_SIZE = 12;
|
|
677
|
+
/**
|
|
678
|
+
* @hidden
|
|
679
|
+
*/
|
|
680
|
+
const DEFAULT_FONT_VALUES = {
|
|
681
|
+
fontSize: DEFAULT_FONT_SIZE,
|
|
682
|
+
fontFamily: DEFAULT_FONT_FAMILY
|
|
683
|
+
};
|
|
684
|
+
/**
|
|
685
|
+
* @hidden
|
|
686
|
+
*/
|
|
687
|
+
const FONT_FAMILIES = ['Arial', 'Courier New', 'Georgia', 'Times New Roman', 'Trebuchet MS', 'Verdana'];
|
|
688
|
+
/**
|
|
689
|
+
* @hidden
|
|
690
|
+
*/
|
|
691
|
+
const FONT_SIZES = [8, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72];
|
|
692
|
+
/**
|
|
693
|
+
* @hidden
|
|
694
|
+
*/
|
|
695
|
+
const FONT_DATA = {
|
|
696
|
+
fontFamily: FONT_FAMILIES,
|
|
697
|
+
fontSize: FONT_SIZES
|
|
698
|
+
};
|
|
699
|
+
/**
|
|
700
|
+
* @hidden
|
|
701
|
+
*/
|
|
702
|
+
const FORMATS = [
|
|
703
|
+
{ text: 'Automatic', value: null },
|
|
704
|
+
{ text: 'Text', value: '@' },
|
|
705
|
+
{ text: 'Number', value: '#,0.00' },
|
|
706
|
+
{ text: 'Percent', value: '0.00%' },
|
|
707
|
+
{ text: 'Financial', value: '_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)' },
|
|
708
|
+
{ text: 'Currency', value: '$#,##0.00;[Red]$#,##0.00' },
|
|
709
|
+
{ text: 'Date', value: 'm/d/yyyy' },
|
|
710
|
+
{ text: 'Time', value: 'h:mm:ss AM/PM' },
|
|
711
|
+
{ text: 'Date time', value: 'm/d/yyyy h:mm' },
|
|
712
|
+
{ text: 'Duration', value: '[h]:mm:ss' }
|
|
713
|
+
];
|
|
714
|
+
/**
|
|
715
|
+
* @hidden
|
|
716
|
+
*/
|
|
717
|
+
const ALIGNS = [
|
|
718
|
+
{ icon: 'align-left', svgIcon: commandSVGIcons.alignLeft, textKey: 'Align Left', commandName: 'textAlign', value: 'left', cssClass: '' },
|
|
719
|
+
{ icon: 'align-center', svgIcon: commandSVGIcons.alignCenter, textKey: 'Align Center', commandName: 'textAlign', value: 'center', cssClass: '' },
|
|
720
|
+
{ icon: 'align-right', svgIcon: commandSVGIcons.alignRight, textKey: 'Align Right', commandName: 'textAlign', value: 'right', cssClass: '' },
|
|
721
|
+
{ icon: 'align-justify', svgIcon: commandSVGIcons.alignJustify, textKey: 'Align Justify', commandName: 'textAlign', value: 'justify', cssClass: '' },
|
|
722
|
+
{ icon: 'align-top', svgIcon: commandSVGIcons.alignTop, textKey: 'Align Top', commandName: 'verticalAlign', value: 'top', cssClass: '' },
|
|
723
|
+
{ icon: 'align-middle', svgIcon: commandSVGIcons.alignMiddle, textKey: 'Align Middle', commandName: 'verticalAlign', value: 'center', cssClass: '' },
|
|
724
|
+
{ icon: 'align-bottom', svgIcon: commandSVGIcons.alignBottom, textKey: 'Align Bottom', commandName: 'verticalAlign', value: 'bottom', cssClass: '' }
|
|
725
|
+
];
|
|
726
|
+
/**
|
|
727
|
+
* @hidden
|
|
728
|
+
*/
|
|
729
|
+
const MY_TOKEN = new InjectionToken('COMMAND_TOKEN');
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* @hidden
|
|
733
|
+
*/
|
|
734
|
+
function outerWidth(element) {
|
|
735
|
+
let width = element.offsetWidth;
|
|
736
|
+
const style = getComputedStyle(element);
|
|
737
|
+
width += parseFloat(style.marginLeft) || 0 + parseFloat(style.marginRight) || 0;
|
|
738
|
+
return width;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* @hidden
|
|
743
|
+
*/
|
|
744
|
+
class DropDownListBase {
|
|
745
|
+
constructor() {
|
|
746
|
+
this.display = 'inline-flex';
|
|
747
|
+
this.fillMode = 'flat';
|
|
748
|
+
this.valueChange = new EventEmitter();
|
|
749
|
+
}
|
|
750
|
+
onValueChange(value) {
|
|
751
|
+
this.valueChange.emit(value);
|
|
752
|
+
}
|
|
753
|
+
focus() {
|
|
754
|
+
this.dropDownList.focus();
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
DropDownListBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropDownListBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
758
|
+
DropDownListBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: DropDownListBase, selector: "kendo-spreadsheet-dropdownlist-base", inputs: { data: "data", value: "value", title: "title", tabindex: "tabindex" }, outputs: { valueChange: "valueChange" }, host: { properties: { "style.display": "this.display" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "dropDownList", first: true, predicate: ["element"], descendants: true, read: DropDownListComponent, static: true }], ngImport: i0 });
|
|
759
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropDownListBase, decorators: [{
|
|
760
|
+
type: Directive,
|
|
761
|
+
args: [{
|
|
762
|
+
selector: 'kendo-spreadsheet-dropdownlist-base'
|
|
763
|
+
}]
|
|
764
|
+
}], propDecorators: { display: [{
|
|
765
|
+
type: HostBinding,
|
|
766
|
+
args: ['style.display']
|
|
767
|
+
}], data: [{
|
|
768
|
+
type: Input
|
|
769
|
+
}], value: [{
|
|
770
|
+
type: Input
|
|
771
|
+
}], title: [{
|
|
772
|
+
type: Input
|
|
773
|
+
}], tabindex: [{
|
|
774
|
+
type: Input
|
|
775
|
+
}], valueChange: [{
|
|
776
|
+
type: Output
|
|
777
|
+
}], element: [{
|
|
778
|
+
type: ViewChild,
|
|
779
|
+
args: ['element', { static: true }]
|
|
780
|
+
}], dropDownList: [{
|
|
781
|
+
type: ViewChild,
|
|
782
|
+
args: ['element', { read: DropDownListComponent, static: true }]
|
|
783
|
+
}] } });
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* @hidden
|
|
787
|
+
*/
|
|
788
|
+
class FontFamilyDropDownListComponent extends DropDownListBase {
|
|
789
|
+
}
|
|
790
|
+
FontFamilyDropDownListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FontFamilyDropDownListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
791
|
+
FontFamilyDropDownListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FontFamilyDropDownListComponent, selector: "kendo-spreadsheet-fontfamily-dropdownlist", usesInheritance: true, ngImport: i0, template: `
|
|
792
|
+
<kendo-dropdownlist
|
|
793
|
+
#element
|
|
794
|
+
[data]="data"
|
|
795
|
+
[(value)]="value"
|
|
796
|
+
[attr.title]="title"
|
|
797
|
+
[tabindex]="tabindex"
|
|
798
|
+
(valueChange)="onValueChange($event)"
|
|
799
|
+
[leftRightArrowsNavigation]="false"
|
|
800
|
+
[fillMode]="fillMode"
|
|
801
|
+
[attr.title]="title">
|
|
802
|
+
<ng-template kendoDropDownListItemTemplate let-dataItem>
|
|
803
|
+
<span [ngStyle]="{ 'font-family': dataItem }">
|
|
804
|
+
{{ dataItem }}
|
|
805
|
+
</span>
|
|
806
|
+
</ng-template>
|
|
807
|
+
</kendo-dropdownlist>
|
|
808
|
+
`, isInline: true, components: [{ type: i1$3.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["showStickyHeader", "iconClass", "loading", "data", "value", "textField", "valueField", "adaptiveMode", "title", "subtitle", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "leftRightArrowsNavigation", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }], directives: [{ type: i1$3.ItemTemplateDirective, selector: "[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]" }, { type: i7.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FontFamilyDropDownListComponent, decorators: [{
|
|
810
|
+
type: Component,
|
|
811
|
+
args: [{
|
|
812
|
+
selector: 'kendo-spreadsheet-fontfamily-dropdownlist',
|
|
813
|
+
template: `
|
|
814
|
+
<kendo-dropdownlist
|
|
815
|
+
#element
|
|
816
|
+
[data]="data"
|
|
817
|
+
[(value)]="value"
|
|
818
|
+
[attr.title]="title"
|
|
819
|
+
[tabindex]="tabindex"
|
|
820
|
+
(valueChange)="onValueChange($event)"
|
|
821
|
+
[leftRightArrowsNavigation]="false"
|
|
822
|
+
[fillMode]="fillMode"
|
|
823
|
+
[attr.title]="title">
|
|
824
|
+
<ng-template kendoDropDownListItemTemplate let-dataItem>
|
|
825
|
+
<span [ngStyle]="{ 'font-family': dataItem }">
|
|
826
|
+
{{ dataItem }}
|
|
827
|
+
</span>
|
|
828
|
+
</ng-template>
|
|
829
|
+
</kendo-dropdownlist>
|
|
830
|
+
`
|
|
831
|
+
}]
|
|
832
|
+
}] });
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* @hidden
|
|
836
|
+
*/
|
|
837
|
+
class FontSizeDropDownListComponent extends DropDownListBase {
|
|
838
|
+
}
|
|
839
|
+
FontSizeDropDownListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FontSizeDropDownListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
840
|
+
FontSizeDropDownListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FontSizeDropDownListComponent, selector: "kendo-spreadsheet-fontsize-dropdownlist", usesInheritance: true, ngImport: i0, template: `
|
|
841
|
+
<kendo-dropdownlist
|
|
842
|
+
#element
|
|
843
|
+
[data]="data"
|
|
844
|
+
[(value)]="value"
|
|
845
|
+
[attr.title]="title"
|
|
846
|
+
[tabindex]="tabindex"
|
|
847
|
+
(valueChange)="onValueChange($event)"
|
|
848
|
+
[leftRightArrowsNavigation]="false"
|
|
849
|
+
[fillMode]="fillMode"></kendo-dropdownlist>
|
|
850
|
+
`, isInline: true, components: [{ type: i1$3.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["showStickyHeader", "iconClass", "loading", "data", "value", "textField", "valueField", "adaptiveMode", "title", "subtitle", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "leftRightArrowsNavigation", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }] });
|
|
851
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FontSizeDropDownListComponent, decorators: [{
|
|
852
|
+
type: Component,
|
|
853
|
+
args: [{
|
|
854
|
+
selector: 'kendo-spreadsheet-fontsize-dropdownlist',
|
|
855
|
+
template: `
|
|
856
|
+
<kendo-dropdownlist
|
|
857
|
+
#element
|
|
858
|
+
[data]="data"
|
|
859
|
+
[(value)]="value"
|
|
860
|
+
[attr.title]="title"
|
|
861
|
+
[tabindex]="tabindex"
|
|
862
|
+
(valueChange)="onValueChange($event)"
|
|
863
|
+
[leftRightArrowsNavigation]="false"
|
|
864
|
+
[fillMode]="fillMode"></kendo-dropdownlist>
|
|
865
|
+
`
|
|
866
|
+
}]
|
|
867
|
+
}] });
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* @hidden
|
|
871
|
+
*/
|
|
872
|
+
class DialogContentComponent extends DialogContentBase {
|
|
873
|
+
constructor(dialog) {
|
|
874
|
+
super(dialog);
|
|
875
|
+
this.dialog = dialog;
|
|
876
|
+
this.data = [];
|
|
877
|
+
}
|
|
878
|
+
setData(args) {
|
|
879
|
+
this.data = args.data;
|
|
880
|
+
this.value = args.value;
|
|
881
|
+
this.tabindex = args.tabindex;
|
|
882
|
+
this.componentType = args.componentType;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
DialogContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DialogContentComponent, deps: [{ token: i1$4.DialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
886
|
+
DialogContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: DialogContentComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
887
|
+
<div
|
|
888
|
+
[ngSwitch]="componentType"
|
|
889
|
+
class="k-d-flex k-align-items-center k-justify-content-center">
|
|
890
|
+
<kendo-spreadsheet-fontfamily-dropdownlist
|
|
891
|
+
*ngSwitchCase="'fontFamily'"
|
|
892
|
+
[data]="data"
|
|
893
|
+
[(value)]="value"
|
|
894
|
+
[attr.title]="title"
|
|
895
|
+
[tabindex]="tabindex"
|
|
896
|
+
[style.width.em]="13"
|
|
897
|
+
></kendo-spreadsheet-fontfamily-dropdownlist>
|
|
898
|
+
<kendo-spreadsheet-fontsize-dropdownlist
|
|
899
|
+
*ngSwitchCase="'fontSize'"
|
|
900
|
+
[data]="data"
|
|
901
|
+
[(value)]="value"
|
|
902
|
+
[attr.title]="title"
|
|
903
|
+
[tabindex]="tabindex"
|
|
904
|
+
[style.width.em]="13"
|
|
905
|
+
></kendo-spreadsheet-fontsize-dropdownlist>
|
|
906
|
+
<kendo-colorpicker
|
|
907
|
+
*ngSwitchCase="'color'"
|
|
908
|
+
[attr.title]="title"
|
|
909
|
+
[format]="'hex'"
|
|
910
|
+
[(value)]="value"
|
|
911
|
+
[tabindex]="tabindex"
|
|
912
|
+
[clearButton]="false"
|
|
913
|
+
fillMode="flat"
|
|
914
|
+
></kendo-colorpicker>
|
|
915
|
+
<kendo-colorpicker
|
|
916
|
+
*ngSwitchCase="'background'"
|
|
917
|
+
[attr.title]="title"
|
|
918
|
+
[format]="'hex'"
|
|
919
|
+
[(value)]="value"
|
|
920
|
+
[tabindex]="tabindex"
|
|
921
|
+
[clearButton]="false"
|
|
922
|
+
fillMode="flat"
|
|
923
|
+
></kendo-colorpicker>
|
|
924
|
+
</div>
|
|
925
|
+
`, isInline: true, components: [{ type: FontFamilyDropDownListComponent, selector: "kendo-spreadsheet-fontfamily-dropdownlist" }, { type: FontSizeDropDownListComponent, selector: "kendo-spreadsheet-fontsize-dropdownlist" }, { type: i5.ColorPickerComponent, selector: "kendo-colorpicker", inputs: ["views", "view", "activeView", "readonly", "disabled", "format", "value", "popupSettings", "paletteSettings", "gradientSettings", "icon", "iconClass", "svgIcon", "clearButton", "tabindex", "preview", "actionsLayout", "size", "rounded", "fillMode"], outputs: ["valueChange", "open", "close", "focus", "blur", "cancel", "activeColorClick", "clearButtonClick", "activeViewChange"], exportAs: ["kendoColorPicker"] }], directives: [{ type: i7.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }] });
|
|
926
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DialogContentComponent, decorators: [{
|
|
927
|
+
type: Component,
|
|
928
|
+
args: [{
|
|
929
|
+
template: `
|
|
930
|
+
<div
|
|
931
|
+
[ngSwitch]="componentType"
|
|
932
|
+
class="k-d-flex k-align-items-center k-justify-content-center">
|
|
933
|
+
<kendo-spreadsheet-fontfamily-dropdownlist
|
|
934
|
+
*ngSwitchCase="'fontFamily'"
|
|
935
|
+
[data]="data"
|
|
936
|
+
[(value)]="value"
|
|
937
|
+
[attr.title]="title"
|
|
938
|
+
[tabindex]="tabindex"
|
|
939
|
+
[style.width.em]="13"
|
|
940
|
+
></kendo-spreadsheet-fontfamily-dropdownlist>
|
|
941
|
+
<kendo-spreadsheet-fontsize-dropdownlist
|
|
942
|
+
*ngSwitchCase="'fontSize'"
|
|
943
|
+
[data]="data"
|
|
944
|
+
[(value)]="value"
|
|
945
|
+
[attr.title]="title"
|
|
946
|
+
[tabindex]="tabindex"
|
|
947
|
+
[style.width.em]="13"
|
|
948
|
+
></kendo-spreadsheet-fontsize-dropdownlist>
|
|
949
|
+
<kendo-colorpicker
|
|
950
|
+
*ngSwitchCase="'color'"
|
|
951
|
+
[attr.title]="title"
|
|
952
|
+
[format]="'hex'"
|
|
953
|
+
[(value)]="value"
|
|
954
|
+
[tabindex]="tabindex"
|
|
955
|
+
[clearButton]="false"
|
|
956
|
+
fillMode="flat"
|
|
957
|
+
></kendo-colorpicker>
|
|
958
|
+
<kendo-colorpicker
|
|
959
|
+
*ngSwitchCase="'background'"
|
|
960
|
+
[attr.title]="title"
|
|
961
|
+
[format]="'hex'"
|
|
962
|
+
[(value)]="value"
|
|
963
|
+
[tabindex]="tabindex"
|
|
964
|
+
[clearButton]="false"
|
|
965
|
+
fillMode="flat"
|
|
966
|
+
></kendo-colorpicker>
|
|
967
|
+
</div>
|
|
968
|
+
`
|
|
969
|
+
}]
|
|
970
|
+
}], ctorParameters: function () { return [{ type: i1$4.DialogRef }]; } });
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* @hidden
|
|
974
|
+
*/
|
|
975
|
+
class SpreadsheetDropDownToolBase extends ToolBarToolComponent {
|
|
976
|
+
constructor(command, dialogService, localization, spreadsheetService, toolsService, toolbar) {
|
|
977
|
+
super();
|
|
978
|
+
this.command = command;
|
|
979
|
+
this.dialogService = dialogService;
|
|
980
|
+
this.localization = localization;
|
|
981
|
+
this.spreadsheetService = spreadsheetService;
|
|
982
|
+
this.toolsService = toolsService;
|
|
983
|
+
this.toolbar = toolbar;
|
|
984
|
+
/**
|
|
985
|
+
* Fires when the user updates the value of the drop-down list.
|
|
986
|
+
*/
|
|
987
|
+
this.valueChange = new EventEmitter();
|
|
988
|
+
this.tabindex = -1;
|
|
989
|
+
this.svgIcon = commandSVGIcons[this.command];
|
|
990
|
+
this.icon = commandIcons[this.command];
|
|
991
|
+
this.value = DEFAULT_FONT_VALUES[this.command];
|
|
992
|
+
this.data = FONT_DATA[this.command];
|
|
993
|
+
}
|
|
994
|
+
ngOnInit() {
|
|
995
|
+
this.value = this.toolsService.toolsState[this.command];
|
|
996
|
+
this.subs = this.toolsService.stateChange.subscribe(state => {
|
|
997
|
+
this.value = state[this.command];
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
ngOnDestroy() {
|
|
1001
|
+
if (this.subs) {
|
|
1002
|
+
this.subs.unsubscribe();
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* @hidden
|
|
1007
|
+
*/
|
|
1008
|
+
messageFor(key) {
|
|
1009
|
+
return this.localization.get(key);
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* @hidden
|
|
1013
|
+
*/
|
|
1014
|
+
onValueChange(ev) {
|
|
1015
|
+
if (isPresent(ev)) {
|
|
1016
|
+
if (hasObservers(this.valueChange)) {
|
|
1017
|
+
this.valueChange.emit(ev);
|
|
1018
|
+
}
|
|
1019
|
+
const options = {
|
|
1020
|
+
command: 'PropertyChangeCommand',
|
|
1021
|
+
options: { property: this.command, value: ev || null }
|
|
1022
|
+
};
|
|
1023
|
+
this.spreadsheetService.spreadsheet.executeCommand(options);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* @hidden
|
|
1028
|
+
*/
|
|
1029
|
+
get outerWidth() {
|
|
1030
|
+
if (this.element) {
|
|
1031
|
+
return outerWidth(this.element.nativeElement);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* @hidden
|
|
1036
|
+
*/
|
|
1037
|
+
openDialog() {
|
|
1038
|
+
const dialogSettings = {
|
|
1039
|
+
appendTo: this.spreadsheetService.dialogContainer,
|
|
1040
|
+
title: this.messageFor(this.command),
|
|
1041
|
+
content: DialogContentComponent,
|
|
1042
|
+
actions: [{
|
|
1043
|
+
text: this.messageFor('dialogApply'),
|
|
1044
|
+
themeColor: 'primary'
|
|
1045
|
+
}, {
|
|
1046
|
+
text: this.messageFor('dialogCancel')
|
|
1047
|
+
}],
|
|
1048
|
+
actionsLayout: 'start',
|
|
1049
|
+
width: 400,
|
|
1050
|
+
autoFocusedElement: '.k-dropdownlist'
|
|
1051
|
+
};
|
|
1052
|
+
this.toolbar.toggle(false);
|
|
1053
|
+
const dialog = this.dialogService.open(dialogSettings);
|
|
1054
|
+
const dialogInstance = dialog.dialog.instance;
|
|
1055
|
+
const dialogContent = dialog.content.instance;
|
|
1056
|
+
dialogInstance.action.pipe(take(1)).subscribe((event) => {
|
|
1057
|
+
if (event.text === this.messageFor('dialogApply')) {
|
|
1058
|
+
const options = {
|
|
1059
|
+
command: 'PropertyChangeCommand',
|
|
1060
|
+
options: { property: this.command, value: dialogContent.value || null }
|
|
1061
|
+
};
|
|
1062
|
+
this.spreadsheetService.spreadsheet.executeCommand(options);
|
|
1063
|
+
}
|
|
1064
|
+
this.toolbar.toggle();
|
|
1065
|
+
});
|
|
1066
|
+
dialogInstance.close.pipe(take(1)).subscribe(() => {
|
|
1067
|
+
this.toolbar.toggle();
|
|
1068
|
+
});
|
|
1069
|
+
dialogContent.setData({
|
|
1070
|
+
data: this.data,
|
|
1071
|
+
value: this.value,
|
|
1072
|
+
tabindex: this.tabindex,
|
|
1073
|
+
componentType: this.command,
|
|
1074
|
+
title: this.localization.get(this.command)
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* @hidden
|
|
1079
|
+
*/
|
|
1080
|
+
focus(e) {
|
|
1081
|
+
this.tabindex = 0;
|
|
1082
|
+
if (e instanceof PointerEvent) {
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
if (this.overflows) {
|
|
1086
|
+
this.popupButton.nativeElement.focus();
|
|
1087
|
+
}
|
|
1088
|
+
else {
|
|
1089
|
+
this.dropDownListRef.focus();
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* @hidden
|
|
1094
|
+
*/
|
|
1095
|
+
canFocus() {
|
|
1096
|
+
return true;
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* @hidden
|
|
1100
|
+
*/
|
|
1101
|
+
handleKey() {
|
|
1102
|
+
this.tabindex = -1;
|
|
1103
|
+
return false;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
SpreadsheetDropDownToolBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetDropDownToolBase, deps: [{ token: MY_TOKEN }, { token: i1$4.DialogService }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }, { token: i1$2.ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
1107
|
+
SpreadsheetDropDownToolBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetDropDownToolBase, selector: "ng-component", outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "element", first: true, predicate: ["element"], descendants: true, read: ElementRef }, { propertyName: "dropDownListRef", first: true, predicate: ["element"], descendants: true }, { propertyName: "popupButton", first: true, predicate: ["popupButton"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
1108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetDropDownToolBase, decorators: [{
|
|
1109
|
+
type: Component,
|
|
1110
|
+
args: [{
|
|
1111
|
+
template: ``
|
|
1112
|
+
}]
|
|
1113
|
+
}], ctorParameters: function () {
|
|
1114
|
+
return [{ type: undefined, decorators: [{
|
|
1115
|
+
type: Inject,
|
|
1116
|
+
args: [MY_TOKEN]
|
|
1117
|
+
}] }, { type: i1$4.DialogService }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }, { type: i1$2.ToolBarComponent }];
|
|
1118
|
+
}, propDecorators: { toolbarTemplate: [{
|
|
1119
|
+
type: ViewChild,
|
|
1120
|
+
args: ['toolbarTemplate', { static: true }]
|
|
1121
|
+
}], popupTemplate: [{
|
|
1122
|
+
type: ViewChild,
|
|
1123
|
+
args: ['popupTemplate', { static: true }]
|
|
1124
|
+
}], element: [{
|
|
1125
|
+
type: ViewChild,
|
|
1126
|
+
args: ['element', { read: ElementRef }]
|
|
1127
|
+
}], dropDownListRef: [{
|
|
1128
|
+
type: ViewChild,
|
|
1129
|
+
args: ['element']
|
|
1130
|
+
}], popupButton: [{
|
|
1131
|
+
type: ViewChild,
|
|
1132
|
+
args: ['popupButton', { read: ElementRef }]
|
|
1133
|
+
}], valueChange: [{
|
|
1134
|
+
type: Output
|
|
1135
|
+
}] } });
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* A component which configures an existing `DropDownListComponent` as a Spreadsheet tool
|
|
1139
|
+
* ([see example](ToDo).
|
|
1140
|
+
* The component associates a `kendo-toolbar-dropdownlist` with a Spreadsheet command that changes the font family of a content block and
|
|
1141
|
+
* automatically defines the options of the drop-down list and sets its values ([see example](ToDo).
|
|
1142
|
+
*
|
|
1143
|
+
* @hidden
|
|
1144
|
+
*/
|
|
1145
|
+
class SpreadsheetFontFamilyComponent extends SpreadsheetDropDownToolBase {
|
|
1146
|
+
constructor(dialogService, localization, spreadsheetService, toolsService, toolbar) {
|
|
1147
|
+
super('fontFamily', dialogService, localization, spreadsheetService, toolsService, toolbar);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
SpreadsheetFontFamilyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFontFamilyComponent, deps: [{ token: i1$4.DialogService }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }, { token: ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
1151
|
+
SpreadsheetFontFamilyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetFontFamilyComponent, selector: "kendo-toolbar-dropdownlist[kendoSpreadsheetFontFamily]", providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => SpreadsheetFontFamilyComponent) }], usesInheritance: true, ngImport: i0, template: `
|
|
1152
|
+
<ng-template #toolbarTemplate>
|
|
1153
|
+
<kendo-spreadsheet-fontfamily-dropdownlist
|
|
1154
|
+
#element
|
|
1155
|
+
[data]="data"
|
|
1156
|
+
[(value)]="value"
|
|
1157
|
+
[title]="messageFor(command)"
|
|
1158
|
+
[tabindex]="tabindex"
|
|
1159
|
+
(valueChange)="onValueChange($event)"></kendo-spreadsheet-fontfamily-dropdownlist>
|
|
1160
|
+
</ng-template>
|
|
1161
|
+
<ng-template #popupTemplate>
|
|
1162
|
+
<div #popupButton
|
|
1163
|
+
[tabindex]="tabindex"
|
|
1164
|
+
role="menuitem"
|
|
1165
|
+
class="k-item k-menu-item"
|
|
1166
|
+
(click)="openDialog()">
|
|
1167
|
+
<span
|
|
1168
|
+
class="k-link k-menu-link">
|
|
1169
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
1170
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
1171
|
+
</span>
|
|
1172
|
+
</div>
|
|
1173
|
+
</ng-template>
|
|
1174
|
+
`, isInline: true, components: [{ type: FontFamilyDropDownListComponent, selector: "kendo-spreadsheet-fontfamily-dropdownlist" }, { type: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFontFamilyComponent, decorators: [{
|
|
1176
|
+
type: Component,
|
|
1177
|
+
args: [{
|
|
1178
|
+
providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => SpreadsheetFontFamilyComponent) }],
|
|
1179
|
+
selector: 'kendo-toolbar-dropdownlist[kendoSpreadsheetFontFamily]',
|
|
1180
|
+
template: `
|
|
1181
|
+
<ng-template #toolbarTemplate>
|
|
1182
|
+
<kendo-spreadsheet-fontfamily-dropdownlist
|
|
1183
|
+
#element
|
|
1184
|
+
[data]="data"
|
|
1185
|
+
[(value)]="value"
|
|
1186
|
+
[title]="messageFor(command)"
|
|
1187
|
+
[tabindex]="tabindex"
|
|
1188
|
+
(valueChange)="onValueChange($event)"></kendo-spreadsheet-fontfamily-dropdownlist>
|
|
1189
|
+
</ng-template>
|
|
1190
|
+
<ng-template #popupTemplate>
|
|
1191
|
+
<div #popupButton
|
|
1192
|
+
[tabindex]="tabindex"
|
|
1193
|
+
role="menuitem"
|
|
1194
|
+
class="k-item k-menu-item"
|
|
1195
|
+
(click)="openDialog()">
|
|
1196
|
+
<span
|
|
1197
|
+
class="k-link k-menu-link">
|
|
1198
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
1199
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
1200
|
+
</span>
|
|
1201
|
+
</div>
|
|
1202
|
+
</ng-template>
|
|
1203
|
+
`
|
|
1204
|
+
}]
|
|
1205
|
+
}], ctorParameters: function () {
|
|
1206
|
+
return [{ type: i1$4.DialogService }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }, { type: i1$2.ToolBarComponent, decorators: [{
|
|
1207
|
+
type: Inject,
|
|
1208
|
+
args: [ToolBarComponent]
|
|
1209
|
+
}] }];
|
|
1210
|
+
} });
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* A component which configures an existing `DropDownListComponent` as a Spreadsheet tool
|
|
1214
|
+
* ([see example](ToDo).
|
|
1215
|
+
* The component associates a `kendo-toolbar-dropdownlist` with a Spreadsheet command that changes the font size of a content block and
|
|
1216
|
+
* automatically defines the options of the drop-down list and sets its values ([see example](ToDo).
|
|
1217
|
+
*
|
|
1218
|
+
* @hidden
|
|
1219
|
+
*/
|
|
1220
|
+
class SpreadsheetFontSizeComponent extends SpreadsheetDropDownToolBase {
|
|
1221
|
+
constructor(dialogService, localization, spreadsheetService, toolsService, toolbar) {
|
|
1222
|
+
super('fontSize', dialogService, localization, spreadsheetService, toolsService, toolbar);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
SpreadsheetFontSizeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFontSizeComponent, deps: [{ token: i1$4.DialogService }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }, { token: ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
1226
|
+
SpreadsheetFontSizeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetFontSizeComponent, selector: "kendo-toolbar-dropdownlist[kendoSpreadsheetFontSize]", providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => SpreadsheetFontSizeComponent) }], usesInheritance: true, ngImport: i0, template: `
|
|
1227
|
+
<ng-template #toolbarTemplate>
|
|
1228
|
+
<kendo-spreadsheet-fontsize-dropdownlist
|
|
1229
|
+
#element
|
|
1230
|
+
[data]="data"
|
|
1231
|
+
[(value)]="value"
|
|
1232
|
+
[title]="messageFor(command)"
|
|
1233
|
+
[tabindex]="tabindex"
|
|
1234
|
+
(valueChange)="onValueChange($event)"></kendo-spreadsheet-fontsize-dropdownlist>
|
|
1235
|
+
</ng-template>
|
|
1236
|
+
<ng-template #popupTemplate>
|
|
1237
|
+
<div #popupButton
|
|
1238
|
+
[tabindex]="tabindex"
|
|
1239
|
+
role="menuitem"
|
|
1240
|
+
class="k-item k-menu-item"
|
|
1241
|
+
(click)="openDialog()">
|
|
1242
|
+
<span
|
|
1243
|
+
class="k-link k-menu-link">
|
|
1244
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
1245
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
1246
|
+
</span>
|
|
1247
|
+
</div>
|
|
1248
|
+
</ng-template>
|
|
1249
|
+
`, isInline: true, components: [{ type: FontSizeDropDownListComponent, selector: "kendo-spreadsheet-fontsize-dropdownlist" }, { type: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFontSizeComponent, decorators: [{
|
|
1251
|
+
type: Component,
|
|
1252
|
+
args: [{
|
|
1253
|
+
providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => SpreadsheetFontSizeComponent) }],
|
|
1254
|
+
selector: 'kendo-toolbar-dropdownlist[kendoSpreadsheetFontSize]',
|
|
1255
|
+
template: `
|
|
1256
|
+
<ng-template #toolbarTemplate>
|
|
1257
|
+
<kendo-spreadsheet-fontsize-dropdownlist
|
|
1258
|
+
#element
|
|
1259
|
+
[data]="data"
|
|
1260
|
+
[(value)]="value"
|
|
1261
|
+
[title]="messageFor(command)"
|
|
1262
|
+
[tabindex]="tabindex"
|
|
1263
|
+
(valueChange)="onValueChange($event)"></kendo-spreadsheet-fontsize-dropdownlist>
|
|
1264
|
+
</ng-template>
|
|
1265
|
+
<ng-template #popupTemplate>
|
|
1266
|
+
<div #popupButton
|
|
1267
|
+
[tabindex]="tabindex"
|
|
1268
|
+
role="menuitem"
|
|
1269
|
+
class="k-item k-menu-item"
|
|
1270
|
+
(click)="openDialog()">
|
|
1271
|
+
<span
|
|
1272
|
+
class="k-link k-menu-link">
|
|
1273
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
1274
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
1275
|
+
</span>
|
|
1276
|
+
</div>
|
|
1277
|
+
</ng-template>
|
|
1278
|
+
`
|
|
1279
|
+
}]
|
|
1280
|
+
}], ctorParameters: function () {
|
|
1281
|
+
return [{ type: i1$4.DialogService }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }, { type: i1$2.ToolBarComponent, decorators: [{
|
|
1282
|
+
type: Inject,
|
|
1283
|
+
args: [ToolBarComponent]
|
|
1284
|
+
}] }];
|
|
1285
|
+
} });
|
|
1286
|
+
|
|
1287
|
+
/**
|
|
1288
|
+
* A component which changes the color of the text ([more information](ToDo).
|
|
1289
|
+
* @hidden
|
|
1290
|
+
*/
|
|
1291
|
+
class SpreadsheetForeColorComponent extends SpreadsheetDropDownToolBase {
|
|
1292
|
+
constructor(dialogService, localization, spreadsheetService, toolsService, toolbar) {
|
|
1293
|
+
super('color', dialogService, localization, spreadsheetService, toolsService, toolbar);
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
SpreadsheetForeColorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetForeColorComponent, deps: [{ token: i1$4.DialogService }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }, { token: ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
1297
|
+
SpreadsheetForeColorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetForeColorComponent, selector: "kendo-spreadsheet-forecolor-tool", providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => SpreadsheetForeColorComponent) }], usesInheritance: true, ngImport: i0, template: `
|
|
1298
|
+
<ng-template #toolbarTemplate>
|
|
1299
|
+
<kendo-colorpicker
|
|
1300
|
+
#element
|
|
1301
|
+
[attr.title]="messageFor(command)"
|
|
1302
|
+
[format]="'hex'"
|
|
1303
|
+
[(value)]="value"
|
|
1304
|
+
[tabindex]="tabindex"
|
|
1305
|
+
(valueChange)="onValueChange($event)"
|
|
1306
|
+
[clearButton]="false"
|
|
1307
|
+
fillMode="flat"
|
|
1308
|
+
[icon]="icon"
|
|
1309
|
+
[svgIcon]="svgIcon"
|
|
1310
|
+
[preview]="true"></kendo-colorpicker>
|
|
1311
|
+
</ng-template>
|
|
1312
|
+
<ng-template #popupTemplate>
|
|
1313
|
+
<div #popupButton
|
|
1314
|
+
[tabindex]="tabindex"
|
|
1315
|
+
role="menuitem"
|
|
1316
|
+
class="k-item k-menu-item"
|
|
1317
|
+
(click)="openDialog();">
|
|
1318
|
+
<span
|
|
1319
|
+
class="k-link k-menu-link">
|
|
1320
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
1321
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
1322
|
+
</span>
|
|
1323
|
+
</div>
|
|
1324
|
+
</ng-template>
|
|
1325
|
+
`, isInline: true, components: [{ type: i5.ColorPickerComponent, selector: "kendo-colorpicker", inputs: ["views", "view", "activeView", "readonly", "disabled", "format", "value", "popupSettings", "paletteSettings", "gradientSettings", "icon", "iconClass", "svgIcon", "clearButton", "tabindex", "preview", "actionsLayout", "size", "rounded", "fillMode"], outputs: ["valueChange", "open", "close", "focus", "blur", "cancel", "activeColorClick", "clearButtonClick", "activeViewChange"], exportAs: ["kendoColorPicker"] }, { type: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetForeColorComponent, decorators: [{
|
|
1327
|
+
type: Component,
|
|
1328
|
+
args: [{
|
|
1329
|
+
providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => SpreadsheetForeColorComponent) }],
|
|
1330
|
+
selector: 'kendo-spreadsheet-forecolor-tool',
|
|
1331
|
+
template: `
|
|
1332
|
+
<ng-template #toolbarTemplate>
|
|
1333
|
+
<kendo-colorpicker
|
|
1334
|
+
#element
|
|
1335
|
+
[attr.title]="messageFor(command)"
|
|
1336
|
+
[format]="'hex'"
|
|
1337
|
+
[(value)]="value"
|
|
1338
|
+
[tabindex]="tabindex"
|
|
1339
|
+
(valueChange)="onValueChange($event)"
|
|
1340
|
+
[clearButton]="false"
|
|
1341
|
+
fillMode="flat"
|
|
1342
|
+
[icon]="icon"
|
|
1343
|
+
[svgIcon]="svgIcon"
|
|
1344
|
+
[preview]="true"></kendo-colorpicker>
|
|
1345
|
+
</ng-template>
|
|
1346
|
+
<ng-template #popupTemplate>
|
|
1347
|
+
<div #popupButton
|
|
1348
|
+
[tabindex]="tabindex"
|
|
1349
|
+
role="menuitem"
|
|
1350
|
+
class="k-item k-menu-item"
|
|
1351
|
+
(click)="openDialog();">
|
|
1352
|
+
<span
|
|
1353
|
+
class="k-link k-menu-link">
|
|
1354
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
1355
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
1356
|
+
</span>
|
|
1357
|
+
</div>
|
|
1358
|
+
</ng-template>
|
|
1359
|
+
`
|
|
1360
|
+
}]
|
|
1361
|
+
}], ctorParameters: function () {
|
|
1362
|
+
return [{ type: i1$4.DialogService }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }, { type: i1$2.ToolBarComponent, decorators: [{
|
|
1363
|
+
type: Inject,
|
|
1364
|
+
args: [ToolBarComponent]
|
|
1365
|
+
}] }];
|
|
1366
|
+
} });
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* A component which changes the background color of the text ([more information](ToDo).
|
|
1370
|
+
* @hidden
|
|
1371
|
+
*/
|
|
1372
|
+
class SpreadsheetBackColorComponent extends SpreadsheetDropDownToolBase {
|
|
1373
|
+
constructor(dialogService, localization, spreadsheetService, toolsService, toolbar) {
|
|
1374
|
+
super('background', dialogService, localization, spreadsheetService, toolsService, toolbar);
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
SpreadsheetBackColorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetBackColorComponent, deps: [{ token: i1$4.DialogService }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }, { token: ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
1378
|
+
SpreadsheetBackColorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetBackColorComponent, selector: "kendo-spreadsheet-backcolor-tool", providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => SpreadsheetBackColorComponent) }], usesInheritance: true, ngImport: i0, template: `
|
|
1379
|
+
<ng-template #toolbarTemplate>
|
|
1380
|
+
<kendo-colorpicker
|
|
1381
|
+
#element
|
|
1382
|
+
[attr.title]="messageFor(command)"
|
|
1383
|
+
[format]="'hex'"
|
|
1384
|
+
[(value)]="value"
|
|
1385
|
+
[tabindex]="tabindex"
|
|
1386
|
+
(valueChange)="onValueChange($event)"
|
|
1387
|
+
[clearButton]="false"
|
|
1388
|
+
fillMode="flat"
|
|
1389
|
+
[icon]="icon"
|
|
1390
|
+
[preview]="true"
|
|
1391
|
+
[svgIcon]="svgIcon"></kendo-colorpicker>
|
|
1392
|
+
</ng-template>
|
|
1393
|
+
<ng-template #popupTemplate>
|
|
1394
|
+
<div #popupButton
|
|
1395
|
+
[tabindex]="tabindex"
|
|
1396
|
+
role="menuitem"
|
|
1397
|
+
class="k-item k-menu-item"
|
|
1398
|
+
(click)="openDialog();">
|
|
1399
|
+
<span
|
|
1400
|
+
class="k-link k-menu-link">
|
|
1401
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
1402
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
1403
|
+
</span>
|
|
1404
|
+
</div>
|
|
1405
|
+
</ng-template>
|
|
1406
|
+
`, isInline: true, components: [{ type: i5.ColorPickerComponent, selector: "kendo-colorpicker", inputs: ["views", "view", "activeView", "readonly", "disabled", "format", "value", "popupSettings", "paletteSettings", "gradientSettings", "icon", "iconClass", "svgIcon", "clearButton", "tabindex", "preview", "actionsLayout", "size", "rounded", "fillMode"], outputs: ["valueChange", "open", "close", "focus", "blur", "cancel", "activeColorClick", "clearButtonClick", "activeViewChange"], exportAs: ["kendoColorPicker"] }, { type: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetBackColorComponent, decorators: [{
|
|
1408
|
+
type: Component,
|
|
1409
|
+
args: [{
|
|
1410
|
+
providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => SpreadsheetBackColorComponent) }],
|
|
1411
|
+
selector: 'kendo-spreadsheet-backcolor-tool',
|
|
1412
|
+
template: `
|
|
1413
|
+
<ng-template #toolbarTemplate>
|
|
1414
|
+
<kendo-colorpicker
|
|
1415
|
+
#element
|
|
1416
|
+
[attr.title]="messageFor(command)"
|
|
1417
|
+
[format]="'hex'"
|
|
1418
|
+
[(value)]="value"
|
|
1419
|
+
[tabindex]="tabindex"
|
|
1420
|
+
(valueChange)="onValueChange($event)"
|
|
1421
|
+
[clearButton]="false"
|
|
1422
|
+
fillMode="flat"
|
|
1423
|
+
[icon]="icon"
|
|
1424
|
+
[preview]="true"
|
|
1425
|
+
[svgIcon]="svgIcon"></kendo-colorpicker>
|
|
1426
|
+
</ng-template>
|
|
1427
|
+
<ng-template #popupTemplate>
|
|
1428
|
+
<div #popupButton
|
|
1429
|
+
[tabindex]="tabindex"
|
|
1430
|
+
role="menuitem"
|
|
1431
|
+
class="k-item k-menu-item"
|
|
1432
|
+
(click)="openDialog();">
|
|
1433
|
+
<span
|
|
1434
|
+
class="k-link k-menu-link">
|
|
1435
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
1436
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
1437
|
+
</span>
|
|
1438
|
+
</div>
|
|
1439
|
+
</ng-template>
|
|
1440
|
+
`
|
|
1441
|
+
}]
|
|
1442
|
+
}], ctorParameters: function () {
|
|
1443
|
+
return [{ type: i1$4.DialogService }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }, { type: i1$2.ToolBarComponent, decorators: [{
|
|
1444
|
+
type: Inject,
|
|
1445
|
+
args: [ToolBarComponent]
|
|
1446
|
+
}] }];
|
|
1447
|
+
} });
|
|
1448
|
+
|
|
1449
|
+
/**
|
|
1450
|
+
* @hidden
|
|
1451
|
+
*/
|
|
1452
|
+
class NameBoxComponent {
|
|
1453
|
+
constructor(ngZone, host) {
|
|
1454
|
+
this.ngZone = ngZone;
|
|
1455
|
+
this.host = host;
|
|
1456
|
+
this.hostClass = true;
|
|
1457
|
+
this.valueNormalizer = (text) => text.pipe(map((content) => ({ name: content })));
|
|
1458
|
+
}
|
|
1459
|
+
keyDownHandler() {
|
|
1460
|
+
const editor = this.spreadsheetWidget.view.nameEditor;
|
|
1461
|
+
if (editor) {
|
|
1462
|
+
const name = this.host.nativeElement.querySelector('.k-input-inner').value;
|
|
1463
|
+
editor.trigger('enter', { value: name });
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
get current() {
|
|
1467
|
+
return {
|
|
1468
|
+
value: (val) => {
|
|
1469
|
+
if (val === undefined) {
|
|
1470
|
+
const item = this.combobox && this.combobox.value;
|
|
1471
|
+
return item ? (item.name || item) : item;
|
|
1472
|
+
}
|
|
1473
|
+
else {
|
|
1474
|
+
this.ngZone.run(() => {
|
|
1475
|
+
this.value = { name: val } || null;
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
onSelectionChange(value) {
|
|
1482
|
+
const editor = this.spreadsheetWidget.view.nameEditor;
|
|
1483
|
+
if (editor && value) {
|
|
1484
|
+
const name = value.name;
|
|
1485
|
+
if (name !== this.value.name) {
|
|
1486
|
+
editor.trigger('select', { name });
|
|
1487
|
+
this.value = { name };
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
onOpen() {
|
|
1492
|
+
const editor = this.spreadsheetWidget.view.nameEditor;
|
|
1493
|
+
if (editor) {
|
|
1494
|
+
this.data = editor.readData();
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
;
|
|
1498
|
+
}
|
|
1499
|
+
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 });
|
|
1500
|
+
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: `
|
|
1501
|
+
<kendo-combobox #combobox
|
|
1502
|
+
[popupSettings]="{popupClass: 'k-spreadsheet-names-popup'}"
|
|
1503
|
+
fillMode="flat"
|
|
1504
|
+
[clearButton]="false"
|
|
1505
|
+
textField="name"
|
|
1506
|
+
valueField="name"
|
|
1507
|
+
[data]="data"
|
|
1508
|
+
[allowCustom]="true"
|
|
1509
|
+
(selectionChange)="onSelectionChange($event)"
|
|
1510
|
+
[value]="value"
|
|
1511
|
+
(open)="onOpen()"
|
|
1512
|
+
[valueNormalizer]="valueNormalizer"
|
|
1513
|
+
></kendo-combobox>
|
|
1514
|
+
`, isInline: true, components: [{ type: i1$3.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"] }] });
|
|
1515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: NameBoxComponent, decorators: [{
|
|
1516
|
+
type: Component,
|
|
1517
|
+
args: [{
|
|
1518
|
+
selector: '[kendoSpreadsheetNameBox]',
|
|
1519
|
+
template: `
|
|
1520
|
+
<kendo-combobox #combobox
|
|
1521
|
+
[popupSettings]="{popupClass: 'k-spreadsheet-names-popup'}"
|
|
1522
|
+
fillMode="flat"
|
|
1523
|
+
[clearButton]="false"
|
|
1524
|
+
textField="name"
|
|
1525
|
+
valueField="name"
|
|
1526
|
+
[data]="data"
|
|
1527
|
+
[allowCustom]="true"
|
|
1528
|
+
(selectionChange)="onSelectionChange($event)"
|
|
1529
|
+
[value]="value"
|
|
1530
|
+
(open)="onOpen()"
|
|
1531
|
+
[valueNormalizer]="valueNormalizer"
|
|
1532
|
+
></kendo-combobox>
|
|
1533
|
+
`
|
|
1534
|
+
}]
|
|
1535
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { hostClass: [{
|
|
1536
|
+
type: HostBinding,
|
|
1537
|
+
args: ['class.k-spreadsheet-name-editor']
|
|
1538
|
+
}], keyDownHandler: [{
|
|
1539
|
+
type: HostListener,
|
|
1540
|
+
args: ['keydown.enter']
|
|
1541
|
+
}], combobox: [{
|
|
1542
|
+
type: ViewChild,
|
|
1543
|
+
args: ['combobox']
|
|
1544
|
+
}], data: [{
|
|
1545
|
+
type: Input
|
|
1546
|
+
}], spreadsheetWidget: [{
|
|
1547
|
+
type: Input
|
|
1548
|
+
}] } });
|
|
1549
|
+
|
|
1550
|
+
/**
|
|
1551
|
+
* @hidden
|
|
1552
|
+
*/
|
|
1553
|
+
class ActionDialogComponent extends DialogContentBase {
|
|
1554
|
+
constructor(dialog) {
|
|
1555
|
+
super(dialog);
|
|
1556
|
+
this.dialog = dialog;
|
|
1557
|
+
}
|
|
1558
|
+
setData(args) {
|
|
1559
|
+
this.value = args.value;
|
|
1560
|
+
this.tabindex = args.tabindex;
|
|
1561
|
+
this.commandName = args.commandName;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
ActionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ActionDialogComponent, deps: [{ token: i1$4.DialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1565
|
+
ActionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ActionDialogComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
1566
|
+
<ng-container *ngIf="commandName === 'delete'">
|
|
1567
|
+
<p>The deleted sheet data will be lost.</p>
|
|
1568
|
+
<p>Are you sure you want to proceed?</p>
|
|
1569
|
+
</ng-container>
|
|
1570
|
+
|
|
1571
|
+
<form class="k-form k-form-md" *ngIf="commandName === 'rename'">
|
|
1572
|
+
<div class="k-form-field">
|
|
1573
|
+
<label class="k-label k-form-label">Rename sheet</label>
|
|
1574
|
+
<div class="k-form-field-wrap">
|
|
1575
|
+
<kendo-textbox
|
|
1576
|
+
autocomplete="off"
|
|
1577
|
+
placeholder="Sheet name"
|
|
1578
|
+
[(value)]="value">
|
|
1579
|
+
</kendo-textbox>
|
|
1580
|
+
</div>
|
|
1581
|
+
</div>
|
|
1582
|
+
</form>
|
|
1583
|
+
`, isInline: true, components: [{ type: i5.TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ActionDialogComponent, decorators: [{
|
|
1585
|
+
type: Component,
|
|
1586
|
+
args: [{
|
|
1587
|
+
template: `
|
|
1588
|
+
<ng-container *ngIf="commandName === 'delete'">
|
|
1589
|
+
<p>The deleted sheet data will be lost.</p>
|
|
1590
|
+
<p>Are you sure you want to proceed?</p>
|
|
1591
|
+
</ng-container>
|
|
1592
|
+
|
|
1593
|
+
<form class="k-form k-form-md" *ngIf="commandName === 'rename'">
|
|
1594
|
+
<div class="k-form-field">
|
|
1595
|
+
<label class="k-label k-form-label">Rename sheet</label>
|
|
1596
|
+
<div class="k-form-field-wrap">
|
|
1597
|
+
<kendo-textbox
|
|
1598
|
+
autocomplete="off"
|
|
1599
|
+
placeholder="Sheet name"
|
|
1600
|
+
[(value)]="value">
|
|
1601
|
+
</kendo-textbox>
|
|
1602
|
+
</div>
|
|
1603
|
+
</div>
|
|
1604
|
+
</form>
|
|
1605
|
+
`
|
|
1606
|
+
}]
|
|
1607
|
+
}], ctorParameters: function () { return [{ type: i1$4.DialogRef }]; } });
|
|
1608
|
+
|
|
1609
|
+
/**
|
|
1610
|
+
* @hidden
|
|
1611
|
+
*/
|
|
1612
|
+
class SheetsBarComponent {
|
|
1613
|
+
constructor(spreadsheetService, element, renderer, localization, dialogService, ngZone) {
|
|
1614
|
+
this.spreadsheetService = spreadsheetService;
|
|
1615
|
+
this.element = element;
|
|
1616
|
+
this.renderer = renderer;
|
|
1617
|
+
this.localization = localization;
|
|
1618
|
+
this.dialogService = dialogService;
|
|
1619
|
+
this.ngZone = ngZone;
|
|
1620
|
+
this.hostClasses = true;
|
|
1621
|
+
this.plusIcon = plusIcon;
|
|
1622
|
+
this.menuIcon = menuIcon;
|
|
1623
|
+
this.caretAltDownIcon = caretAltDownIcon;
|
|
1624
|
+
this.caretAltLeftIcon = caretAltLeftIcon;
|
|
1625
|
+
this.caretAltRightIcon = caretAltRightIcon;
|
|
1626
|
+
this.selected = false;
|
|
1627
|
+
this.openedDdb = null;
|
|
1628
|
+
this.eyeIcon = eyeIcon;
|
|
1629
|
+
this.onAddClick = () => {
|
|
1630
|
+
if (this.spreadsheetService.spreadsheet) {
|
|
1631
|
+
this.spreadsheetService.spreadsheet.view.sheetsbar.onAddSelect();
|
|
1632
|
+
this.notifySheetsChange();
|
|
1633
|
+
}
|
|
1634
|
+
};
|
|
1635
|
+
this.actionsCallback = {
|
|
1636
|
+
copy: (sheetInfo) => {
|
|
1637
|
+
sheetInfo.copies ? sheetInfo.copies += 1 : sheetInfo.copies = 1;
|
|
1638
|
+
const sheetToCopy = this.spreadsheetService.spreadsheet.sheets().find(s => s.name() === sheetInfo.text);
|
|
1639
|
+
const newName = `${sheetToCopy.name()} (${sheetInfo.copies})`;
|
|
1640
|
+
this.spreadsheetService.spreadsheet.insertSheet({ data: Object.assign(Object.assign({}, sheetToCopy.toJSON()), { name: newName }), index: sheetInfo.index + 1 });
|
|
1641
|
+
this.selectSheet(newName);
|
|
1642
|
+
},
|
|
1643
|
+
move: (sheetInfo, itemText) => {
|
|
1644
|
+
const oldIndex = this.spreadsheetService.spreadsheet.sheets().findIndex(sheet => sheet.name() === sheetInfo.text);
|
|
1645
|
+
const newIndex = itemText === 'Move Right' ? oldIndex + 1 : oldIndex - 1;
|
|
1646
|
+
const sheetsBar = this.spreadsheetService.spreadsheet.view.sheetsbar;
|
|
1647
|
+
sheetsBar.onSheetReorderEnd({ oldIndex, newIndex });
|
|
1648
|
+
this.notifySheetsChange();
|
|
1649
|
+
}
|
|
1650
|
+
};
|
|
1651
|
+
}
|
|
1652
|
+
get activeSheet() {
|
|
1653
|
+
var _a, _b;
|
|
1654
|
+
return (_b = (_a = this.spreadsheetService.spreadsheet) === null || _a === void 0 ? void 0 : _a.activeSheet()) === null || _b === void 0 ? void 0 : _b.name();
|
|
1655
|
+
}
|
|
1656
|
+
get sheetsMenuList() {
|
|
1657
|
+
var _a;
|
|
1658
|
+
return (_a = this.sheets) === null || _a === void 0 ? void 0 : _a.map(sheet => ({ text: sheet.text, icon: 'eye', svgIcon: this.eyeIcon }));
|
|
1659
|
+
}
|
|
1660
|
+
ngAfterViewInit() {
|
|
1661
|
+
if (!isDocumentAvailable() || !this.element.nativeElement) {
|
|
1662
|
+
return;
|
|
1663
|
+
}
|
|
1664
|
+
const prevBtn = this.element.nativeElement.querySelector('.k-tabstrip-prev');
|
|
1665
|
+
const nextBtn = this.element.nativeElement.querySelector('.k-tabstrip-next');
|
|
1666
|
+
this.renderer.addClass(prevBtn, 'k-order-1');
|
|
1667
|
+
this.renderer.addClass(nextBtn, 'k-order-2');
|
|
1668
|
+
}
|
|
1669
|
+
onTabSelect(ev) {
|
|
1670
|
+
if (ev.title !== this.activeSheet) {
|
|
1671
|
+
this.selectSheet(ev.title);
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
onOpen(ddb) {
|
|
1675
|
+
if (isPresent(this.openedDdb) && this.openedDdb !== ddb) {
|
|
1676
|
+
this.openedDdb.toggle(false);
|
|
1677
|
+
}
|
|
1678
|
+
this.openedDdb = ddb;
|
|
1679
|
+
}
|
|
1680
|
+
onClose() {
|
|
1681
|
+
this.openedDdb = null;
|
|
1682
|
+
}
|
|
1683
|
+
onActionClick(dataItem, sheet) {
|
|
1684
|
+
if (dataItem.disabled) {
|
|
1685
|
+
return;
|
|
1686
|
+
}
|
|
1687
|
+
if (dataItem.commandName === 'delete' || dataItem.commandName === 'rename') {
|
|
1688
|
+
this.openDialog(dataItem, sheet);
|
|
1689
|
+
}
|
|
1690
|
+
else {
|
|
1691
|
+
this.actionsCallback[dataItem.commandName](sheet, dataItem.text);
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
onMenuItemClick(item) {
|
|
1695
|
+
const sheet = this.sheets.find(s => s.text === item.text);
|
|
1696
|
+
this.selectSheet(sheet.text);
|
|
1697
|
+
}
|
|
1698
|
+
openDialog(dataItem, sheet) {
|
|
1699
|
+
const dialogSettings = {
|
|
1700
|
+
appendTo: this.spreadsheetService.dialogContainer,
|
|
1701
|
+
title: this.localization.get(dataItem.commandName),
|
|
1702
|
+
content: ActionDialogComponent,
|
|
1703
|
+
actions: [{
|
|
1704
|
+
text: this.localization.get(dataItem.dialogButton),
|
|
1705
|
+
themeColor: 'primary'
|
|
1706
|
+
}, {
|
|
1707
|
+
text: this.localization.get('dialogCancel')
|
|
1708
|
+
}],
|
|
1709
|
+
actionsLayout: 'stretched',
|
|
1710
|
+
autoFocusedElement: '.k-textbox .k-input-inner, .k-button-solid-primary'
|
|
1711
|
+
};
|
|
1712
|
+
const dialog = this.dialogService.open(dialogSettings);
|
|
1713
|
+
const dialogInstance = dialog.dialog.instance;
|
|
1714
|
+
const dialogContent = dialog.content.instance;
|
|
1715
|
+
dialogInstance.action.pipe(take(1)).subscribe((event) => {
|
|
1716
|
+
if (event.text === this.localization.get(dataItem.dialogButton)) {
|
|
1717
|
+
const sheetsBar = this.spreadsheetService.spreadsheet.view.sheetsbar;
|
|
1718
|
+
if (sheetsBar) {
|
|
1719
|
+
dataItem.commandName === 'delete' ? sheetsBar.onSheetRemove(sheet.text) : sheetsBar.onSheetRename(dialogContent.value, this.sheets.indexOf(sheet));
|
|
1720
|
+
this.notifySheetsChange();
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
});
|
|
1724
|
+
dialogContent.setData({
|
|
1725
|
+
value: sheet.text,
|
|
1726
|
+
tabindex: -1,
|
|
1727
|
+
commandName: dataItem.commandName
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1730
|
+
selectSheet(sheetName) {
|
|
1731
|
+
const spreadsheetSheet = this.spreadsheetService.spreadsheet.sheets().find(s => s.name() === sheetName);
|
|
1732
|
+
this.spreadsheetService.spreadsheet.activeSheet(spreadsheetSheet);
|
|
1733
|
+
this.spreadsheetService.currentActiveSheet = sheetName;
|
|
1734
|
+
this.spreadsheetService.activeSheetChanged.next(spreadsheetSheet);
|
|
1735
|
+
this.notifySheetsChange();
|
|
1736
|
+
}
|
|
1737
|
+
notifySheetsChange() {
|
|
1738
|
+
this.ngZone.run(() => {
|
|
1739
|
+
const newSheets = this.spreadsheetService.spreadsheet.sheets();
|
|
1740
|
+
const sheetDesc = mapToSheetDescriptor(newSheets);
|
|
1741
|
+
console.log(newSheets, 'new');
|
|
1742
|
+
this.sheets = sheetDesc.map((item, index, items) => (Object.assign(Object.assign({}, item), { inEdit: false, first: index === 0, last: index === items.length - 1, text: item.name, active: (item.name === this.activeSheet) || items.length === 1, index, sheetActions: getSheetActions(index, items) })));
|
|
1743
|
+
});
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
SheetsBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SheetsBarComponent, deps: [{ token: SpreadsheetService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SpreadsheetLocalizationService }, { token: i1$4.DialogService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
1747
|
+
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: `
|
|
1748
|
+
<button kendoButton
|
|
1749
|
+
title="Add new sheet"
|
|
1750
|
+
type="button"
|
|
1751
|
+
fillMode="flat"
|
|
1752
|
+
class="k-spreadsheet-sheet-add"
|
|
1753
|
+
icon="plus"
|
|
1754
|
+
[svgIcon]="plusIcon"
|
|
1755
|
+
[kendoEventsOutsideAngular]="{click: onAddClick}">
|
|
1756
|
+
</button>
|
|
1757
|
+
<kendo-dropdownbutton #menuDdb
|
|
1758
|
+
fillMode="flat"
|
|
1759
|
+
buttonClass="k-spreadsheet-sheets-menu"
|
|
1760
|
+
icon="menu"
|
|
1761
|
+
[svgIcon]="menuIcon"
|
|
1762
|
+
[data]="sheetsMenuList"
|
|
1763
|
+
(itemClick)="onMenuItemClick($event)"
|
|
1764
|
+
(open)="onOpen(menuDdb)">
|
|
1765
|
+
</kendo-dropdownbutton>
|
|
1766
|
+
<kendo-tabstrip
|
|
1767
|
+
[tabPosition]="'bottom'"
|
|
1768
|
+
[showContentArea]="false"
|
|
1769
|
+
[scrollable]="{prevButtonIcon: 'caret-alt-left', prevSVGButtonIcon: caretAltLeftIcon, nextButtonIcon: 'caret-alt-right', nextSVGButtonIcon: caretAltRightIcon}"
|
|
1770
|
+
class="k-spreadsheet-sheets k-overflow-hidden"
|
|
1771
|
+
(tabSelect)="onTabSelect($event)"
|
|
1772
|
+
[keepTabContent]="true">
|
|
1773
|
+
<ng-container *ngFor="let sheet of sheets">
|
|
1774
|
+
<kendo-tabstrip-tab
|
|
1775
|
+
[title]="sheet.text"
|
|
1776
|
+
[selected]="sheet.text === activeSheet">
|
|
1777
|
+
<ng-template kendoTabTemplate>
|
|
1778
|
+
<span class="k-link">{{sheet.text}}</span>
|
|
1779
|
+
<kendo-dropdownbutton #sheetDdb
|
|
1780
|
+
fillMode="flat"
|
|
1781
|
+
icon="caret-alt-down"
|
|
1782
|
+
[svgIcon]="caretAltDownIcon"
|
|
1783
|
+
buttonClass="k-menu-button"
|
|
1784
|
+
[data]="sheet.sheetActions"
|
|
1785
|
+
[buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
|
|
1786
|
+
(open)="onOpen(sheetDdb)"
|
|
1787
|
+
(close)="onClose()"
|
|
1788
|
+
(click)="$event.stopPropagation()"
|
|
1789
|
+
(itemClick)="onActionClick($event, sheet)">
|
|
1790
|
+
</kendo-dropdownbutton>
|
|
1791
|
+
</ng-template>
|
|
1792
|
+
</kendo-tabstrip-tab>
|
|
1793
|
+
</ng-container>
|
|
1794
|
+
</kendo-tabstrip>
|
|
1795
|
+
`, 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$1.TabStripComponent, selector: "kendo-tabstrip", inputs: ["height", "animate", "tabAlignment", "tabPosition", "keepTabContent", "closable", "scrollable", "closeIcon", "closeIconClass", "closeSVGIcon", "showContentArea"], outputs: ["tabSelect", "tabClose", "tabScroll"], exportAs: ["kendoTabStrip"] }, { type: i5$1.TabStripTabComponent, selector: "kendo-tabstrip-tab", inputs: ["title", "disabled", "cssClass", "cssStyle", "selected", "closable", "closeIcon", "closeIconClass", "closeSVGIcon"], exportAs: ["kendoTabStripTab"] }], directives: [{ type: i3.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$1.TabTemplateDirective, selector: "[kendoTabTemplate]" }] });
|
|
1796
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SheetsBarComponent, decorators: [{
|
|
1797
|
+
type: Component,
|
|
1798
|
+
args: [{
|
|
1799
|
+
selector: '[kendoSpreadsheetSheetsBar]',
|
|
1800
|
+
template: `
|
|
1801
|
+
<button kendoButton
|
|
1802
|
+
title="Add new sheet"
|
|
1803
|
+
type="button"
|
|
1804
|
+
fillMode="flat"
|
|
1805
|
+
class="k-spreadsheet-sheet-add"
|
|
1806
|
+
icon="plus"
|
|
1807
|
+
[svgIcon]="plusIcon"
|
|
1808
|
+
[kendoEventsOutsideAngular]="{click: onAddClick}">
|
|
1809
|
+
</button>
|
|
1810
|
+
<kendo-dropdownbutton #menuDdb
|
|
1811
|
+
fillMode="flat"
|
|
1812
|
+
buttonClass="k-spreadsheet-sheets-menu"
|
|
1813
|
+
icon="menu"
|
|
1814
|
+
[svgIcon]="menuIcon"
|
|
1815
|
+
[data]="sheetsMenuList"
|
|
1816
|
+
(itemClick)="onMenuItemClick($event)"
|
|
1817
|
+
(open)="onOpen(menuDdb)">
|
|
1818
|
+
</kendo-dropdownbutton>
|
|
1819
|
+
<kendo-tabstrip
|
|
1820
|
+
[tabPosition]="'bottom'"
|
|
1821
|
+
[showContentArea]="false"
|
|
1822
|
+
[scrollable]="{prevButtonIcon: 'caret-alt-left', prevSVGButtonIcon: caretAltLeftIcon, nextButtonIcon: 'caret-alt-right', nextSVGButtonIcon: caretAltRightIcon}"
|
|
1823
|
+
class="k-spreadsheet-sheets k-overflow-hidden"
|
|
1824
|
+
(tabSelect)="onTabSelect($event)"
|
|
1825
|
+
[keepTabContent]="true">
|
|
1826
|
+
<ng-container *ngFor="let sheet of sheets">
|
|
1827
|
+
<kendo-tabstrip-tab
|
|
1828
|
+
[title]="sheet.text"
|
|
1829
|
+
[selected]="sheet.text === activeSheet">
|
|
1830
|
+
<ng-template kendoTabTemplate>
|
|
1831
|
+
<span class="k-link">{{sheet.text}}</span>
|
|
1832
|
+
<kendo-dropdownbutton #sheetDdb
|
|
1833
|
+
fillMode="flat"
|
|
1834
|
+
icon="caret-alt-down"
|
|
1835
|
+
[svgIcon]="caretAltDownIcon"
|
|
1836
|
+
buttonClass="k-menu-button"
|
|
1837
|
+
[data]="sheet.sheetActions"
|
|
1838
|
+
[buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
|
|
1839
|
+
(open)="onOpen(sheetDdb)"
|
|
1840
|
+
(close)="onClose()"
|
|
1841
|
+
(click)="$event.stopPropagation()"
|
|
1842
|
+
(itemClick)="onActionClick($event, sheet)">
|
|
1843
|
+
</kendo-dropdownbutton>
|
|
1844
|
+
</ng-template>
|
|
1845
|
+
</kendo-tabstrip-tab>
|
|
1846
|
+
</ng-container>
|
|
1847
|
+
</kendo-tabstrip>
|
|
1848
|
+
`
|
|
1849
|
+
}]
|
|
1850
|
+
}], ctorParameters: function () { return [{ type: SpreadsheetService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SpreadsheetLocalizationService }, { type: i1$4.DialogService }, { type: i0.NgZone }]; }, propDecorators: { hostClasses: [{
|
|
1851
|
+
type: HostBinding,
|
|
1852
|
+
args: ['class.k-spreadsheet-sheets-bar']
|
|
1853
|
+
}], sheets: [{
|
|
1854
|
+
type: Input
|
|
1855
|
+
}], sheetDescriptors: [{
|
|
1856
|
+
type: Input
|
|
1857
|
+
}] } });
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* @hidden
|
|
1861
|
+
*/
|
|
1862
|
+
class MessagesDirective extends ComponentMessages {
|
|
1863
|
+
}
|
|
1864
|
+
MessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessagesDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1865
|
+
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 });
|
|
1866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessagesDirective, decorators: [{
|
|
1867
|
+
type: Directive,
|
|
1868
|
+
args: [{
|
|
1869
|
+
selector: '[kendoSpreadsheetMessages]'
|
|
1870
|
+
}]
|
|
1871
|
+
}], propDecorators: { home: [{
|
|
1872
|
+
type: Input
|
|
1873
|
+
}], file: [{
|
|
1874
|
+
type: Input
|
|
1875
|
+
}], insert: [{
|
|
1876
|
+
type: Input
|
|
1877
|
+
}], saveFile: [{
|
|
1878
|
+
type: Input
|
|
1879
|
+
}], loadFile: [{
|
|
1880
|
+
type: Input
|
|
1881
|
+
}], bold: [{
|
|
1882
|
+
type: Input
|
|
1883
|
+
}], italic: [{
|
|
1884
|
+
type: Input
|
|
1885
|
+
}], underline: [{
|
|
1886
|
+
type: Input
|
|
1887
|
+
}], format: [{
|
|
1888
|
+
type: Input
|
|
1889
|
+
}], fontFamily: [{
|
|
1890
|
+
type: Input
|
|
1891
|
+
}], fontSize: [{
|
|
1892
|
+
type: Input
|
|
1893
|
+
}], undo: [{
|
|
1894
|
+
type: Input
|
|
1895
|
+
}], redo: [{
|
|
1896
|
+
type: Input
|
|
1897
|
+
}], background: [{
|
|
1898
|
+
type: Input
|
|
1899
|
+
}], color: [{
|
|
1900
|
+
type: Input
|
|
1901
|
+
}], gridLines: [{
|
|
1902
|
+
type: Input
|
|
1903
|
+
}], addColumnLeft: [{
|
|
1904
|
+
type: Input
|
|
1905
|
+
}], addColumnRight: [{
|
|
1906
|
+
type: Input
|
|
1907
|
+
}], addRowBelow: [{
|
|
1908
|
+
type: Input
|
|
1909
|
+
}], addRowAbove: [{
|
|
1910
|
+
type: Input
|
|
1911
|
+
}], deleteColumn: [{
|
|
1912
|
+
type: Input
|
|
1913
|
+
}], deleteRow: [{
|
|
1914
|
+
type: Input
|
|
1915
|
+
}], wrap: [{
|
|
1916
|
+
type: Input
|
|
1917
|
+
}], align: [{
|
|
1918
|
+
type: Input
|
|
1919
|
+
}], dialogApply: [{
|
|
1920
|
+
type: Input
|
|
1921
|
+
}], dialogCancel: [{
|
|
1922
|
+
type: Input
|
|
1923
|
+
}], dialogDelete: [{
|
|
1924
|
+
type: Input
|
|
1925
|
+
}], dialogRename: [{
|
|
1926
|
+
type: Input
|
|
1927
|
+
}], delete: [{
|
|
1928
|
+
type: Input
|
|
1929
|
+
}], rename: [{
|
|
1930
|
+
type: Input
|
|
1931
|
+
}] } });
|
|
1932
|
+
|
|
1933
|
+
/**
|
|
1934
|
+
* @hidden
|
|
1935
|
+
*/
|
|
1936
|
+
class LocalizedMessagesDirective extends MessagesDirective {
|
|
1937
|
+
constructor(service) {
|
|
1938
|
+
super();
|
|
1939
|
+
this.service = service;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1943
|
+
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: LocalizedMessagesDirective, selector: "[kendoSpreadsheetLocalizedMessages]", providers: [{
|
|
1944
|
+
provide: MessagesDirective,
|
|
1945
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
1946
|
+
}], usesInheritance: true, ngImport: i0 });
|
|
1947
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
1948
|
+
type: Directive,
|
|
1949
|
+
args: [{
|
|
1950
|
+
providers: [{
|
|
1951
|
+
provide: MessagesDirective,
|
|
1952
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
1953
|
+
}],
|
|
1954
|
+
selector: '[kendoSpreadsheetLocalizedMessages]'
|
|
1955
|
+
}]
|
|
1956
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
1957
|
+
|
|
1958
|
+
/**
|
|
1959
|
+
* @hidden
|
|
1960
|
+
*/
|
|
1961
|
+
class MainMenuDirective {
|
|
1962
|
+
constructor(host, renderer) {
|
|
1963
|
+
this.host = host;
|
|
1964
|
+
this.renderer = renderer;
|
|
1965
|
+
}
|
|
1966
|
+
ngAfterViewInit() {
|
|
1967
|
+
isDocumentAvailable() && this.renderer.addClass(this.host.nativeElement.firstElementChild, 'k-spreadsheet-menu');
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
MainMenuDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MainMenuDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1971
|
+
MainMenuDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: MainMenuDirective, selector: "[kendoSpreadsheetMenu]", ngImport: i0 });
|
|
1972
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MainMenuDirective, decorators: [{
|
|
1973
|
+
type: Directive,
|
|
1974
|
+
args: [{ selector: '[kendoSpreadsheetMenu]' }]
|
|
1975
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
1976
|
+
|
|
1977
|
+
/**
|
|
1978
|
+
* @hidden
|
|
1979
|
+
*/
|
|
1980
|
+
class SpreadsheetSaveFileDirective {
|
|
1981
|
+
constructor(button, localization, spreadsheetService) {
|
|
1982
|
+
this.button = button;
|
|
1983
|
+
this.localization = localization;
|
|
1984
|
+
this.spreadsheetService = spreadsheetService;
|
|
1985
|
+
this.subs = new Subscription();
|
|
1986
|
+
}
|
|
1987
|
+
ngOnInit() {
|
|
1988
|
+
this.button.title = this.localization.get('saveFile');
|
|
1989
|
+
this.button.icon = commandIcons['download'];
|
|
1990
|
+
this.button.svgIcon = commandSVGIcons['download'];
|
|
1991
|
+
this.button.fillMode = 'flat';
|
|
1992
|
+
this.subs.add(this.button.click.subscribe(() => {
|
|
1993
|
+
const spreadsheet = this.spreadsheetService.spreadsheet;
|
|
1994
|
+
if (spreadsheet) {
|
|
1995
|
+
spreadsheet.saveAsExcel(Object.assign(Object.assign({}, spreadsheet.options.excel), { saveAs,
|
|
1996
|
+
Workbook }));
|
|
1997
|
+
}
|
|
1998
|
+
}));
|
|
1999
|
+
}
|
|
2000
|
+
ngOnDestroy() {
|
|
2001
|
+
this.subs.unsubscribe();
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
SpreadsheetSaveFileDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetSaveFileDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2005
|
+
SpreadsheetSaveFileDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetSaveFileDirective, selector: "[kendoSpreadsheetSaveFile]", ngImport: i0 });
|
|
2006
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetSaveFileDirective, decorators: [{
|
|
2007
|
+
type: Directive,
|
|
2008
|
+
args: [{ selector: '[kendoSpreadsheetSaveFile]' }]
|
|
2009
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }]; } });
|
|
2010
|
+
|
|
2011
|
+
/**
|
|
2012
|
+
* @hidden
|
|
2013
|
+
*/
|
|
2014
|
+
class SpreadsheetCommandBaseDirective {
|
|
2015
|
+
constructor(command, button, localization, spreadsheetService, toolsService) {
|
|
2016
|
+
this.command = command;
|
|
2017
|
+
this.button = button;
|
|
2018
|
+
this.localization = localization;
|
|
2019
|
+
this.spreadsheetService = spreadsheetService;
|
|
2020
|
+
this.toolsService = toolsService;
|
|
2021
|
+
this.subs = new Subscription();
|
|
2022
|
+
// this.toolsService.zone.runOutsideAngular(() => {
|
|
2023
|
+
// setTimeout(() => {
|
|
2024
|
+
const text = this.localization.get(this.command);
|
|
2025
|
+
if (text) {
|
|
2026
|
+
this.button.showText = 'overflow';
|
|
2027
|
+
this.button.showIcon = 'both';
|
|
2028
|
+
this.button.text = text;
|
|
2029
|
+
}
|
|
2030
|
+
if (!this.button.toolbarOptions.icon) {
|
|
2031
|
+
this.button.icon = commandIcons[this.command];
|
|
2032
|
+
}
|
|
2033
|
+
if (!this.button.toolbarOptions.svgIcon) {
|
|
2034
|
+
this.button.svgIcon = commandSVGIcons[this.command];
|
|
2035
|
+
}
|
|
2036
|
+
this.button.title = text;
|
|
2037
|
+
this.button.fillMode = 'flat';
|
|
2038
|
+
this.subs.add(this.toolsService.stateChange.subscribe(state => {
|
|
2039
|
+
this.toolsService.ngZone.onStable.pipe(take(1)).subscribe(() => this.button.selected = state[command]);
|
|
2040
|
+
}));
|
|
2041
|
+
// this.toolsService.zone.run(() => {
|
|
2042
|
+
// this.toolsService.needsCheck.next();
|
|
2043
|
+
// });
|
|
2044
|
+
// });
|
|
2045
|
+
//});
|
|
2046
|
+
}
|
|
2047
|
+
ngOnInit() {
|
|
2048
|
+
this.subs.add(this.button.click.subscribe((this.clickHandler.bind(this))));
|
|
2049
|
+
this.subs.add(this.button.pointerdown.subscribe((this.pointerdownHandler.bind(this))));
|
|
2050
|
+
}
|
|
2051
|
+
ngOnDestroy() {
|
|
2052
|
+
this.subs.unsubscribe();
|
|
2053
|
+
}
|
|
2054
|
+
clickHandler() { }
|
|
2055
|
+
pointerdownHandler(_event) { }
|
|
2056
|
+
}
|
|
2057
|
+
SpreadsheetCommandBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetCommandBaseDirective, deps: [{ token: MY_TOKEN }, { token: i1$2.ToolBarButtonComponent }, { token: i1.LocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2058
|
+
SpreadsheetCommandBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetCommandBaseDirective, selector: "[kendoSpreadsheetCommandBase]", ngImport: i0 });
|
|
2059
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetCommandBaseDirective, decorators: [{
|
|
2060
|
+
type: Directive,
|
|
2061
|
+
args: [{
|
|
2062
|
+
selector: '[kendoSpreadsheetCommandBase]'
|
|
2063
|
+
}]
|
|
2064
|
+
}], ctorParameters: function () {
|
|
2065
|
+
return [{ type: undefined, decorators: [{
|
|
2066
|
+
type: Inject,
|
|
2067
|
+
args: [MY_TOKEN]
|
|
2068
|
+
}] }, { type: i1$2.ToolBarButtonComponent }, { type: i1.LocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }];
|
|
2069
|
+
} });
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* @hidden
|
|
2073
|
+
*/
|
|
2074
|
+
class SpreadsheetCommandButton extends SpreadsheetCommandBaseDirective {
|
|
2075
|
+
constructor(command, button, localization, spreadsheetService, toolsService, commandOptions) {
|
|
2076
|
+
super(command, button, localization, spreadsheetService, toolsService);
|
|
2077
|
+
this.command = command;
|
|
2078
|
+
this.button = button;
|
|
2079
|
+
this.localization = localization;
|
|
2080
|
+
this.spreadsheetService = spreadsheetService;
|
|
2081
|
+
this.toolsService = toolsService;
|
|
2082
|
+
this.commandOptions = commandOptions;
|
|
2083
|
+
}
|
|
2084
|
+
clickHandler() {
|
|
2085
|
+
if (this.commandOptions.command === 'PropertyChangeCommand') {
|
|
2086
|
+
this.commandOptions.options.value = !this.toolsService.toolsState[this.command];
|
|
2087
|
+
}
|
|
2088
|
+
this.spreadsheetService.spreadsheet.executeCommand(this.commandOptions);
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* @hidden
|
|
2094
|
+
*/
|
|
2095
|
+
class SpreadsheetUndoDirective extends SpreadsheetCommandButton {
|
|
2096
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2097
|
+
super('undo', button, localization, spreadsheetService, toolsService, {
|
|
2098
|
+
options: { property: 'undo' }
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
clickHandler() {
|
|
2102
|
+
this.spreadsheetService.spreadsheet.workbook.undoRedoStack['undo']();
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
SpreadsheetUndoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetUndoDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2106
|
+
SpreadsheetUndoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetUndoDirective, selector: "kendo-toolbar-button[kendoSpreadsheetUndo]", usesInheritance: true, ngImport: i0 });
|
|
2107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetUndoDirective, decorators: [{
|
|
2108
|
+
type: Directive,
|
|
2109
|
+
args: [{
|
|
2110
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetUndo]'
|
|
2111
|
+
}]
|
|
2112
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2113
|
+
|
|
2114
|
+
/**
|
|
2115
|
+
* @hidden
|
|
2116
|
+
*/
|
|
2117
|
+
class SpreadsheetRedoDirective extends SpreadsheetCommandButton {
|
|
2118
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2119
|
+
super('redo', button, localization, spreadsheetService, toolsService, {
|
|
2120
|
+
options: { property: 'redo' }
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
clickHandler() {
|
|
2124
|
+
this.spreadsheetService.spreadsheet.workbook.undoRedoStack['redo']();
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
SpreadsheetRedoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetRedoDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2128
|
+
SpreadsheetRedoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetRedoDirective, selector: "kendo-toolbar-button[kendoSpreadsheetRedo]", usesInheritance: true, ngImport: i0 });
|
|
2129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetRedoDirective, decorators: [{
|
|
2130
|
+
type: Directive,
|
|
2131
|
+
args: [{
|
|
2132
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetRedo]'
|
|
2133
|
+
}]
|
|
2134
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2135
|
+
|
|
2136
|
+
/**
|
|
2137
|
+
* @hidden
|
|
2138
|
+
*/
|
|
2139
|
+
class SpreadsheetBoldDirective extends SpreadsheetCommandButton {
|
|
2140
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2141
|
+
super('bold', button, localization, spreadsheetService, toolsService, {
|
|
2142
|
+
command: 'PropertyChangeCommand',
|
|
2143
|
+
options: { property: 'bold',
|
|
2144
|
+
value: !button.selected
|
|
2145
|
+
}
|
|
2146
|
+
});
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
SpreadsheetBoldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetBoldDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2150
|
+
SpreadsheetBoldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetBoldDirective, selector: "kendo-toolbar-button[kendoSpreadsheetBold]", usesInheritance: true, ngImport: i0 });
|
|
2151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetBoldDirective, decorators: [{
|
|
2152
|
+
type: Directive,
|
|
2153
|
+
args: [{
|
|
2154
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetBold]'
|
|
2155
|
+
}]
|
|
2156
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2157
|
+
|
|
2158
|
+
/**
|
|
2159
|
+
* @hidden
|
|
2160
|
+
*/
|
|
2161
|
+
class SpreadsheetItalicDirective extends SpreadsheetCommandButton {
|
|
2162
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2163
|
+
super('italic', button, localization, spreadsheetService, toolsService, {
|
|
2164
|
+
command: 'PropertyChangeCommand',
|
|
2165
|
+
options: { property: 'italic',
|
|
2166
|
+
value: !button.selected
|
|
2167
|
+
}
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
SpreadsheetItalicDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetItalicDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2172
|
+
SpreadsheetItalicDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetItalicDirective, selector: "kendo-toolbar-button[kendoSpreadsheetItalic]", usesInheritance: true, ngImport: i0 });
|
|
2173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetItalicDirective, decorators: [{
|
|
2174
|
+
type: Directive,
|
|
2175
|
+
args: [{
|
|
2176
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetItalic]'
|
|
2177
|
+
}]
|
|
2178
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2179
|
+
|
|
2180
|
+
/**
|
|
2181
|
+
* @hidden
|
|
2182
|
+
*/
|
|
2183
|
+
class SpreadsheetUnderlineDirective extends SpreadsheetCommandButton {
|
|
2184
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2185
|
+
super('underline', button, localization, spreadsheetService, toolsService, {
|
|
2186
|
+
command: 'PropertyChangeCommand',
|
|
2187
|
+
options: { property: 'underline',
|
|
2188
|
+
value: !button.selected
|
|
2189
|
+
}
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
SpreadsheetUnderlineDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetUnderlineDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2194
|
+
SpreadsheetUnderlineDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetUnderlineDirective, selector: "kendo-toolbar-button[kendoSpreadsheetUnderline]", usesInheritance: true, ngImport: i0 });
|
|
2195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetUnderlineDirective, decorators: [{
|
|
2196
|
+
type: Directive,
|
|
2197
|
+
args: [{
|
|
2198
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetUnderline]'
|
|
2199
|
+
}]
|
|
2200
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2201
|
+
|
|
2202
|
+
/**
|
|
2203
|
+
* @hidden
|
|
2204
|
+
*/
|
|
2205
|
+
class SpreadsheetTextAlignDirective {
|
|
2206
|
+
constructor(host, localization, spreadsheetService, toolsService) {
|
|
2207
|
+
this.host = host;
|
|
2208
|
+
this.spreadsheetService = spreadsheetService;
|
|
2209
|
+
this.toolsService = toolsService;
|
|
2210
|
+
this.commandName = 'align';
|
|
2211
|
+
this.subs = new Subscription();
|
|
2212
|
+
host.svgIcon = commandSVGIcons[this.commandName];
|
|
2213
|
+
host.icon = commandIcons[this.commandName];
|
|
2214
|
+
host.arrowIcon = true;
|
|
2215
|
+
host.fillMode = 'flat';
|
|
2216
|
+
host.data = [...ALIGNS];
|
|
2217
|
+
this.subs.add(host.itemClick.subscribe((e) => this.onItemClick(e)));
|
|
2218
|
+
host.title = localization.get(this.commandName);
|
|
2219
|
+
host.textField = 'textKey';
|
|
2220
|
+
}
|
|
2221
|
+
ngOnInit() {
|
|
2222
|
+
this.subs.add(this.toolsService.stateChange.subscribe(state => this.host.data.forEach(i => i.cssClass = i.value === state[i.commandName] ? 'k-selected' : '')));
|
|
2223
|
+
}
|
|
2224
|
+
ngOnDestroy() {
|
|
2225
|
+
this.subs.unsubscribe();
|
|
2226
|
+
}
|
|
2227
|
+
onItemClick(item) {
|
|
2228
|
+
const value = item.value || null;
|
|
2229
|
+
const options = {
|
|
2230
|
+
command: 'PropertyChangeCommand', options: { property: item.commandName, value }
|
|
2231
|
+
};
|
|
2232
|
+
this.spreadsheetService.spreadsheet.executeCommand(options);
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
SpreadsheetTextAlignDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetTextAlignDirective, deps: [{ token: i1$2.ToolBarDropDownButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2236
|
+
SpreadsheetTextAlignDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetTextAlignDirective, selector: "[kendoSpreadsheetTextAlign]", ngImport: i0 });
|
|
2237
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetTextAlignDirective, decorators: [{
|
|
2238
|
+
type: Directive,
|
|
2239
|
+
args: [{
|
|
2240
|
+
selector: '[kendoSpreadsheetTextAlign]',
|
|
2241
|
+
}]
|
|
2242
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarDropDownButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2243
|
+
|
|
2244
|
+
/**
|
|
2245
|
+
* @hidden
|
|
2246
|
+
*/
|
|
2247
|
+
class SpreadsheetTextWrapDirective extends SpreadsheetCommandButton {
|
|
2248
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2249
|
+
super('wrap', button, localization, spreadsheetService, toolsService, {
|
|
2250
|
+
command: 'TextWrapCommand',
|
|
2251
|
+
options: { property: 'wrap',
|
|
2252
|
+
value: !button.selected
|
|
2253
|
+
}
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2256
|
+
clickHandler() {
|
|
2257
|
+
const sheet = this.spreadsheetService.spreadsheet.activeSheet();
|
|
2258
|
+
if (sheet) {
|
|
2259
|
+
const range = sheet.range(sheet.activeCell());
|
|
2260
|
+
const value = !range.wrap();
|
|
2261
|
+
const options = {
|
|
2262
|
+
command: 'TextWrapCommand', options: { property: 'wrap', value }
|
|
2263
|
+
};
|
|
2264
|
+
this.spreadsheetService.spreadsheet.executeCommand(options);
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
SpreadsheetTextWrapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetTextWrapDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2269
|
+
SpreadsheetTextWrapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetTextWrapDirective, selector: "kendo-toolbar-button[kendoSpreadsheetTextWrap]", usesInheritance: true, ngImport: i0 });
|
|
2270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetTextWrapDirective, decorators: [{
|
|
2271
|
+
type: Directive,
|
|
2272
|
+
args: [{
|
|
2273
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetTextWrap]'
|
|
2274
|
+
}]
|
|
2275
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2276
|
+
|
|
2277
|
+
/**
|
|
2278
|
+
* @hidden
|
|
2279
|
+
*/
|
|
2280
|
+
class SpreadsheetFormatDirective {
|
|
2281
|
+
constructor(host, localization, spreadsheetService, toolsService) {
|
|
2282
|
+
this.host = host;
|
|
2283
|
+
this.spreadsheetService = spreadsheetService;
|
|
2284
|
+
this.toolsService = toolsService;
|
|
2285
|
+
this.data = FORMATS;
|
|
2286
|
+
this.commandName = 'format';
|
|
2287
|
+
this.subs = new Subscription();
|
|
2288
|
+
/**
|
|
2289
|
+
* @hidden
|
|
2290
|
+
*/
|
|
2291
|
+
this.onItemClick = (item) => {
|
|
2292
|
+
const value = item.value || null;
|
|
2293
|
+
const options = {
|
|
2294
|
+
command: 'PropertyChangeCommand', options: { property: this.commandName, value }
|
|
2295
|
+
};
|
|
2296
|
+
this.spreadsheetService.spreadsheet.executeCommand(options);
|
|
2297
|
+
};
|
|
2298
|
+
host.svgIcon = commandSVGIcons[this.commandName];
|
|
2299
|
+
host.icon = commandIcons[this.commandName];
|
|
2300
|
+
host.arrowIcon = true;
|
|
2301
|
+
host.fillMode = 'flat';
|
|
2302
|
+
host.data = this.data;
|
|
2303
|
+
this.subs.add(host.itemClick.subscribe((e) => this.onItemClick(e)));
|
|
2304
|
+
host.title = localization.get(this.commandName);
|
|
2305
|
+
}
|
|
2306
|
+
ngOnInit() {
|
|
2307
|
+
this.subs.add(this.toolsService.stateChange.subscribe(state => this.host.data.forEach(i => i.cssClass = i.value === state[this.commandName] ? 'k-selected' : '')));
|
|
2308
|
+
}
|
|
2309
|
+
ngOnDestroy() {
|
|
2310
|
+
this.subs.unsubscribe();
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
SpreadsheetFormatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFormatDirective, deps: [{ token: i1$2.ToolBarDropDownButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2314
|
+
SpreadsheetFormatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetFormatDirective, selector: "[kendoSpreadsheetFormat]", ngImport: i0 });
|
|
2315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFormatDirective, decorators: [{
|
|
2316
|
+
type: Directive,
|
|
2317
|
+
args: [{
|
|
2318
|
+
selector: '[kendoSpreadsheetFormat]',
|
|
2319
|
+
}]
|
|
2320
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarDropDownButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2321
|
+
|
|
2322
|
+
/**
|
|
2323
|
+
* @hidden
|
|
2324
|
+
*/
|
|
2325
|
+
class SpreadsheetGridLinesDirective extends SpreadsheetCommandButton {
|
|
2326
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2327
|
+
super('gridLines', button, localization, spreadsheetService, toolsService, {
|
|
2328
|
+
command: 'GridLinesChangeCommand',
|
|
2329
|
+
options: { property: 'gridLines',
|
|
2330
|
+
value: !button.selected
|
|
2331
|
+
}
|
|
2332
|
+
});
|
|
2333
|
+
}
|
|
2334
|
+
clickHandler() {
|
|
2335
|
+
const sheet = this.spreadsheetService.spreadsheet.activeSheet();
|
|
2336
|
+
if (sheet) {
|
|
2337
|
+
const value = !sheet.showGridLines();
|
|
2338
|
+
const options = {
|
|
2339
|
+
command: 'GridLinesChangeCommand', options: { property: 'gridLines', value }
|
|
2340
|
+
};
|
|
2341
|
+
this.spreadsheetService.spreadsheet.executeCommand(options);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
SpreadsheetGridLinesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetGridLinesDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2346
|
+
SpreadsheetGridLinesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetGridLinesDirective, selector: "kendo-toolbar-button[kendoSpreadsheetGridLines]", usesInheritance: true, ngImport: i0 });
|
|
2347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetGridLinesDirective, decorators: [{
|
|
2348
|
+
type: Directive,
|
|
2349
|
+
args: [{
|
|
2350
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetGridLines]'
|
|
2351
|
+
}]
|
|
2352
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2353
|
+
|
|
2354
|
+
/**
|
|
2355
|
+
* @hidden
|
|
2356
|
+
*/
|
|
2357
|
+
class SpreadsheetAddColumnLeftButtonDirective extends SpreadsheetCommandButton {
|
|
2358
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2359
|
+
super('addColumnLeft', button, localization, spreadsheetService, toolsService, {
|
|
2360
|
+
command: 'AddColumnCommand',
|
|
2361
|
+
options: { property: 'addColumnLeft',
|
|
2362
|
+
value: 'left'
|
|
2363
|
+
}
|
|
2364
|
+
});
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
SpreadsheetAddColumnLeftButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddColumnLeftButtonDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2368
|
+
SpreadsheetAddColumnLeftButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetAddColumnLeftButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetAddColumnLeftButton]", usesInheritance: true, ngImport: i0 });
|
|
2369
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddColumnLeftButtonDirective, decorators: [{
|
|
2370
|
+
type: Directive,
|
|
2371
|
+
args: [{
|
|
2372
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetAddColumnLeftButton]'
|
|
2373
|
+
}]
|
|
2374
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2375
|
+
|
|
2376
|
+
/**
|
|
2377
|
+
* @hidden
|
|
2378
|
+
*/
|
|
2379
|
+
class SpreadsheetAddColumnRightButtonDirective extends SpreadsheetCommandButton {
|
|
2380
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2381
|
+
super('addColumnRight', button, localization, spreadsheetService, toolsService, {
|
|
2382
|
+
command: 'AddColumnCommand',
|
|
2383
|
+
options: { property: 'addColumnRight',
|
|
2384
|
+
value: 'right'
|
|
2385
|
+
}
|
|
2386
|
+
});
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
SpreadsheetAddColumnRightButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddColumnRightButtonDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2390
|
+
SpreadsheetAddColumnRightButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetAddColumnRightButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetAddColumnRightButton]", usesInheritance: true, ngImport: i0 });
|
|
2391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddColumnRightButtonDirective, decorators: [{
|
|
2392
|
+
type: Directive,
|
|
2393
|
+
args: [{
|
|
2394
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetAddColumnRightButton]'
|
|
2395
|
+
}]
|
|
2396
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2397
|
+
|
|
2398
|
+
/**
|
|
2399
|
+
* @hidden
|
|
2400
|
+
*/
|
|
2401
|
+
class SpreadsheetAddRowBelowButtonDirective extends SpreadsheetCommandButton {
|
|
2402
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2403
|
+
super('addRowBelow', button, localization, spreadsheetService, toolsService, {
|
|
2404
|
+
command: 'AddRowCommand',
|
|
2405
|
+
options: { property: 'addRowBelow',
|
|
2406
|
+
value: 'below'
|
|
2407
|
+
}
|
|
2408
|
+
});
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
SpreadsheetAddRowBelowButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddRowBelowButtonDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2412
|
+
SpreadsheetAddRowBelowButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetAddRowBelowButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetAddRowBelowButton]", usesInheritance: true, ngImport: i0 });
|
|
2413
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddRowBelowButtonDirective, decorators: [{
|
|
2414
|
+
type: Directive,
|
|
2415
|
+
args: [{
|
|
2416
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetAddRowBelowButton]'
|
|
2417
|
+
}]
|
|
2418
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2419
|
+
|
|
2420
|
+
/**
|
|
2421
|
+
* @hidden
|
|
2422
|
+
*/
|
|
2423
|
+
class SpreadsheetAddRowAboveButtonDirective extends SpreadsheetCommandButton {
|
|
2424
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2425
|
+
super('addRowAbove', button, localization, spreadsheetService, toolsService, {
|
|
2426
|
+
command: 'AddRowCommand',
|
|
2427
|
+
options: { property: 'addRowAbove',
|
|
2428
|
+
value: 'above'
|
|
2429
|
+
}
|
|
2430
|
+
});
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
SpreadsheetAddRowAboveButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddRowAboveButtonDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2434
|
+
SpreadsheetAddRowAboveButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetAddRowAboveButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetAddRowAboveButton]", usesInheritance: true, ngImport: i0 });
|
|
2435
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddRowAboveButtonDirective, decorators: [{
|
|
2436
|
+
type: Directive,
|
|
2437
|
+
args: [{
|
|
2438
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetAddRowAboveButton]'
|
|
2439
|
+
}]
|
|
2440
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2441
|
+
|
|
2442
|
+
/**
|
|
2443
|
+
* @hidden
|
|
2444
|
+
*/
|
|
2445
|
+
class SpreadsheetDeleteColumnButtonDirective extends SpreadsheetCommandButton {
|
|
2446
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2447
|
+
super('deleteColumn', button, localization, spreadsheetService, toolsService, {
|
|
2448
|
+
command: 'DeleteColumnCommand',
|
|
2449
|
+
options: { property: 'deleteColumn' }
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
SpreadsheetDeleteColumnButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetDeleteColumnButtonDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2454
|
+
SpreadsheetDeleteColumnButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetDeleteColumnButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetDeleteColumnButton]", usesInheritance: true, ngImport: i0 });
|
|
2455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetDeleteColumnButtonDirective, decorators: [{
|
|
2456
|
+
type: Directive,
|
|
2457
|
+
args: [{
|
|
2458
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetDeleteColumnButton]'
|
|
2459
|
+
}]
|
|
2460
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2461
|
+
|
|
2462
|
+
/**
|
|
2463
|
+
* @hidden
|
|
2464
|
+
*/
|
|
2465
|
+
class SpreadsheetDeleteRowButtonDirective extends SpreadsheetCommandButton {
|
|
2466
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
2467
|
+
super('deleteRow', button, localization, spreadsheetService, toolsService, {
|
|
2468
|
+
command: 'DeleteRowCommand',
|
|
2469
|
+
options: { property: 'deleteRow' }
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
SpreadsheetDeleteRowButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetDeleteRowButtonDirective, deps: [{ token: i1$2.ToolBarButtonComponent }, { token: SpreadsheetLocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2474
|
+
SpreadsheetDeleteRowButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetDeleteRowButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetDeleteRowButton]", usesInheritance: true, ngImport: i0 });
|
|
2475
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetDeleteRowButtonDirective, decorators: [{
|
|
2476
|
+
type: Directive,
|
|
2477
|
+
args: [{
|
|
2478
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetDeleteRowButton]'
|
|
2479
|
+
}]
|
|
2480
|
+
}], ctorParameters: function () { return [{ type: i1$2.ToolBarButtonComponent }, { type: SpreadsheetLocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }]; } });
|
|
2481
|
+
|
|
2482
|
+
/**
|
|
2483
|
+
* Represents the [Kendo UI Spreadsheet component for Angular]({% slug overview_spreadsheet %}).
|
|
2484
|
+
*/
|
|
2485
|
+
class SpreadsheetComponent {
|
|
2486
|
+
constructor(ngZone, intl, host, localization, spreadsheetService, toolsService, renderer) {
|
|
2487
|
+
this.ngZone = ngZone;
|
|
2488
|
+
this.intl = intl;
|
|
2489
|
+
this.host = host;
|
|
2490
|
+
this.localization = localization;
|
|
2491
|
+
this.spreadsheetService = spreadsheetService;
|
|
2492
|
+
this.toolsService = toolsService;
|
|
2493
|
+
this.renderer = renderer;
|
|
2494
|
+
this.hostClass = true;
|
|
2495
|
+
this.role = 'application';
|
|
2496
|
+
/**
|
|
2497
|
+
* Sets the overflow option of the built-in Toolbar components.
|
|
2498
|
+
* @default false
|
|
2499
|
+
*/
|
|
2500
|
+
this.overflow = false;
|
|
2501
|
+
/**
|
|
2502
|
+
* The number of columns in the document.
|
|
2503
|
+
*
|
|
2504
|
+
* @default 50
|
|
2505
|
+
*/
|
|
2506
|
+
this.columns = 50;
|
|
2507
|
+
/**
|
|
2508
|
+
* The initial column width in pixels.
|
|
2509
|
+
*
|
|
2510
|
+
* @default 64
|
|
2511
|
+
*/
|
|
2512
|
+
this.columnWidth = 100;
|
|
2513
|
+
/**
|
|
2514
|
+
* The height of the header row in pixels.
|
|
2515
|
+
*
|
|
2516
|
+
* @default 20
|
|
2517
|
+
*/
|
|
2518
|
+
this.headerHeight = 30;
|
|
2519
|
+
/**
|
|
2520
|
+
* The width of the header column in pixels.
|
|
2521
|
+
*
|
|
2522
|
+
* @default 32
|
|
2523
|
+
*/
|
|
2524
|
+
this.headerWidth = 100;
|
|
2525
|
+
/**
|
|
2526
|
+
* The initial row height in pixels.
|
|
2527
|
+
*
|
|
2528
|
+
* @default 20
|
|
2529
|
+
*/
|
|
2530
|
+
this.rowHeight = 30;
|
|
2531
|
+
/**
|
|
2532
|
+
* The number of rows in the document.
|
|
2533
|
+
*
|
|
2534
|
+
* @default 200
|
|
2535
|
+
*/
|
|
2536
|
+
this.rows = 200;
|
|
2537
|
+
/**
|
|
2538
|
+
* Fired when a value in the Spreadsheet is changed. Exposes the `SpreadsheetWidget` instance and the selected `Range` as event data.
|
|
2539
|
+
*/
|
|
2540
|
+
this.change = new EventEmitter();
|
|
2541
|
+
/**
|
|
2542
|
+
* Fired when the selected range format is changed from the UI. Exposes the `SpreadsheetWidget` instance and the selected `Range` as event data.
|
|
2543
|
+
*/
|
|
2544
|
+
this.formatChange = new EventEmitter();
|
|
2545
|
+
/**
|
|
2546
|
+
* Fired when the selection is changed by the end user. Exposes the `SpreadsheetWidget` instance and the selected `Range` as event data.
|
|
2547
|
+
*/
|
|
2548
|
+
this.selectionChange = new EventEmitter();
|
|
2549
|
+
/**
|
|
2550
|
+
* Fired when the end user clicks the Export to Excel toolbar button.
|
|
2551
|
+
* The event is preventable and exposes the `Workbook` object, a `preventDefault` method
|
|
2552
|
+
* (if invoked, the generated file will not be saved), and the SpreadsheetWidget instance.
|
|
2553
|
+
*/
|
|
2554
|
+
this.excelExport = new EventEmitter();
|
|
2555
|
+
/**
|
|
2556
|
+
* Fired when the end user clicks the Open toolbar button.
|
|
2557
|
+
* The event is preventable and exposes the selected `File` or `Blob`, a `preventDefault` method
|
|
2558
|
+
* (if invoked, the selected file will not be loaded), and the SpreadsheetWidget instance.
|
|
2559
|
+
*/
|
|
2560
|
+
this.excelImport = new EventEmitter();
|
|
2561
|
+
/**
|
|
2562
|
+
* Fired when the active sheet is about to change.
|
|
2563
|
+
* The event exposes the new active `Sheet` and the SpreadsheetWidget instance.
|
|
2564
|
+
*/
|
|
2565
|
+
this.activeSheetChange = new EventEmitter();
|
|
2566
|
+
this.formulaFxIcon = formulaFxIcon;
|
|
2567
|
+
this.folderOpenIcon = folderOpenIcon;
|
|
2568
|
+
this.downloadIcon = downloadIcon;
|
|
2569
|
+
/**
|
|
2570
|
+
* @hidden
|
|
2571
|
+
*/
|
|
2572
|
+
this.showLicenseWatermark = false;
|
|
2573
|
+
this.onChange = (e) => hasObservers(this.change) && this.change.emit(e);
|
|
2574
|
+
this.onSelectionChange = (e) => hasObservers(this.selectionChange) && this.selectionChange.emit(e);
|
|
2575
|
+
this.onChangeFormat = (e) => hasObservers(this.formatChange) && this.formatChange.emit(e);
|
|
2576
|
+
this.onExcelExport = (e) => hasObservers(this.excelExport) && this.excelExport.emit(e);
|
|
2577
|
+
this.onExcelImport = (e) => hasObservers(this.excelImport) && this.excelImport.emit(e);
|
|
2578
|
+
this.onActiveSheetChanged = (sheet) => {
|
|
2579
|
+
const eventArgs = { sender: this.spreadsheetService.spreadsheet, sheet };
|
|
2580
|
+
hasObservers(this.activeSheetChange) && this.activeSheetChange.emit(eventArgs);
|
|
2581
|
+
};
|
|
2582
|
+
this.updateState = (e) => {
|
|
2583
|
+
var _a;
|
|
2584
|
+
this.toolsService.updateTools(e);
|
|
2585
|
+
if ((_a = e.reason) === null || _a === void 0 ? void 0 : _a.sheetSelection) {
|
|
2586
|
+
this.sheets = mapToSheetDescriptor(this.spreadsheetService.spreadsheet.sheets());
|
|
2587
|
+
}
|
|
2588
|
+
};
|
|
2589
|
+
const isValid = validatePackage(packageMetadata);
|
|
2590
|
+
this.showLicenseWatermark = shouldShowValidationUI(isValid);
|
|
2591
|
+
ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2592
|
+
if (!this.menuItems) {
|
|
2593
|
+
this._menuItems = [{
|
|
2594
|
+
id: 'file',
|
|
2595
|
+
text: this.messageFor('file')
|
|
2596
|
+
}, {
|
|
2597
|
+
id: 'home',
|
|
2598
|
+
text: this.messageFor('home'),
|
|
2599
|
+
active: true,
|
|
2600
|
+
cssClass: 'k-active'
|
|
2601
|
+
}, {
|
|
2602
|
+
id: 'insert',
|
|
2603
|
+
text: this.messageFor('insert')
|
|
2604
|
+
}];
|
|
2605
|
+
}
|
|
2606
|
+
this.selectedMenuItem = this.menuItems[1];
|
|
2607
|
+
});
|
|
2608
|
+
}
|
|
2609
|
+
/**
|
|
2610
|
+
* The menu items configuration.
|
|
2611
|
+
*/
|
|
2612
|
+
set menuItems(items) {
|
|
2613
|
+
this._menuItems = [];
|
|
2614
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2615
|
+
const normalizedItems = items.map(item => ({
|
|
2616
|
+
active: item.active,
|
|
2617
|
+
text: this.messageFor(item.id),
|
|
2618
|
+
cssClass: item.active ? 'k-active' : null,
|
|
2619
|
+
id: item.id
|
|
2620
|
+
}));
|
|
2621
|
+
this._menuItems = normalizedItems;
|
|
2622
|
+
const activeItemIndex = this.menuItems.findIndex(item => item.active);
|
|
2623
|
+
this.selectedMenuItem = this.menuItems[activeItemIndex > -1 ? activeItemIndex : 0];
|
|
2624
|
+
});
|
|
2625
|
+
}
|
|
2626
|
+
get menuItems() {
|
|
2627
|
+
return this._menuItems;
|
|
2628
|
+
}
|
|
2629
|
+
/**
|
|
2630
|
+
* The name of the currently active sheet. Must match one of the sheet names.
|
|
2631
|
+
*/
|
|
2632
|
+
set activeSheet(value) {
|
|
2633
|
+
var _a, _b;
|
|
2634
|
+
this._activeSheet = value;
|
|
2635
|
+
(_b = (_a = this.spreadsheetService.spreadsheet) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.sheetsbar.onSheetSelect(this.activeSheet);
|
|
2636
|
+
}
|
|
2637
|
+
get activeSheet() {
|
|
2638
|
+
var _a, _b;
|
|
2639
|
+
return this._activeSheet || ((_b = (_a = this.spreadsheetService.spreadsheet) === null || _a === void 0 ? void 0 : _a.activeSheet()) === null || _b === void 0 ? void 0 : _b.name());
|
|
2640
|
+
}
|
|
2641
|
+
/**
|
|
2642
|
+
* An array which defines the document sheets and their content.
|
|
2643
|
+
*/
|
|
2644
|
+
set sheets(value) {
|
|
2645
|
+
const items = value.map((item, index, items) => (Object.assign(Object.assign({}, item), { inEdit: false, first: index === 0, last: index === items.length - 1, text: item.name, active: (item.name === this.activeSheet) || items.length === 1, index, sheetActions: getSheetActions(index, items) })));
|
|
2646
|
+
this._sheetsInfo = items;
|
|
2647
|
+
}
|
|
2648
|
+
get sheetsInfo() {
|
|
2649
|
+
return this._sheetsInfo;
|
|
2650
|
+
}
|
|
2651
|
+
get spreadsheetWidget() {
|
|
2652
|
+
return this.spreadsheetService.spreadsheet;
|
|
2653
|
+
}
|
|
2654
|
+
ngAfterViewInit() {
|
|
2655
|
+
if (!isDocumentAvailable()) {
|
|
2656
|
+
return;
|
|
2657
|
+
}
|
|
2658
|
+
this.ngZone.runOutsideAngular(() => {
|
|
2659
|
+
setTimeout(() => {
|
|
2660
|
+
var _a;
|
|
2661
|
+
const spreadsheet = this.spreadsheetService.spreadsheet = new SpreadsheetWidget(this.host.nativeElement, this.options);
|
|
2662
|
+
spreadsheet.bind('select', this.onSelectionChange);
|
|
2663
|
+
spreadsheet.bind('change', this.onChange);
|
|
2664
|
+
spreadsheet.bind('changeFormat', this.onChangeFormat);
|
|
2665
|
+
spreadsheet.bind('excelImport', this.onExcelImport);
|
|
2666
|
+
spreadsheet.bind('excelExport', this.onExcelExport);
|
|
2667
|
+
spreadsheet.view.bind('update', this.updateState);
|
|
2668
|
+
const sheet = spreadsheet.activeSheet();
|
|
2669
|
+
if (sheet) {
|
|
2670
|
+
this.updateState({ range: sheet.range(sheet.activeCell()) });
|
|
2671
|
+
}
|
|
2672
|
+
this.updateActiveSheet(this.activeSheet || ((_a = spreadsheet === null || spreadsheet === void 0 ? void 0 : spreadsheet.activeSheet()) === null || _a === void 0 ? void 0 : _a.name()));
|
|
2673
|
+
if (!this.sheetsInfo) {
|
|
2674
|
+
this.ngZone.run(() => {
|
|
2675
|
+
const defaultSheetDescriptors = mapToSheetDescriptor([spreadsheet === null || spreadsheet === void 0 ? void 0 : spreadsheet.activeSheet()]);
|
|
2676
|
+
this._sheetsInfo = [Object.assign(Object.assign({ text: this.spreadsheetService.currentActiveSheet, first: true, last: true }, defaultSheetDescriptors), { sheetActions: getSheetActions(0, defaultSheetDescriptors) })];
|
|
2677
|
+
});
|
|
2678
|
+
}
|
|
2679
|
+
});
|
|
2680
|
+
this.spreadsheetService.sheetsChanged.subscribe(this.onSheetsChanged.bind(this));
|
|
2681
|
+
this.spreadsheetService.activeSheetChanged.subscribe(this.onActiveSheetChanged.bind(this));
|
|
2682
|
+
this.spreadsheetService.dialogContainer = this.dialogContainer;
|
|
2683
|
+
});
|
|
2684
|
+
}
|
|
2685
|
+
ngOnChanges(changes) {
|
|
2686
|
+
const dynamicOptions = [
|
|
2687
|
+
'columns',
|
|
2688
|
+
'columnWidth',
|
|
2689
|
+
'defaultCellStyle',
|
|
2690
|
+
'excel',
|
|
2691
|
+
'headerHeight',
|
|
2692
|
+
'headerWidth',
|
|
2693
|
+
'images',
|
|
2694
|
+
'names',
|
|
2695
|
+
'rowHeight',
|
|
2696
|
+
'rows'
|
|
2697
|
+
];
|
|
2698
|
+
const changedDynamicOptions = dynamicOptions.filter(o => isPresent(changes[o] && !changes[o].firstChange));
|
|
2699
|
+
if (this.spreadsheetWidget && changedDynamicOptions.length) {
|
|
2700
|
+
const newOptions = this.spreadsheetWidget.toJSON();
|
|
2701
|
+
changedDynamicOptions.forEach(o => newOptions[o] = changes[o].currentValue);
|
|
2702
|
+
this.spreadsheetWidget.fromJSON(newOptions);
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
/**
|
|
2706
|
+
* @hidden
|
|
2707
|
+
*/
|
|
2708
|
+
messageFor(key) {
|
|
2709
|
+
return this.localization.get(key);
|
|
2710
|
+
}
|
|
2711
|
+
/**
|
|
2712
|
+
* @hidden
|
|
2713
|
+
*/
|
|
2714
|
+
onMenuItemSelect(e) {
|
|
2715
|
+
const selectedMenuItem = this.menuItems.find(item => item.text === e.item.text);
|
|
2716
|
+
const previousSelectedItem = this.menuItems.find(item => item.active);
|
|
2717
|
+
if (selectedMenuItem !== previousSelectedItem) {
|
|
2718
|
+
this._menuItems.forEach((item, idx) => {
|
|
2719
|
+
item.active = idx === +e.index;
|
|
2720
|
+
item.cssClass = idx === +e.index ? 'k-active' : null;
|
|
2721
|
+
});
|
|
2722
|
+
this.selectedMenuItem = this.menuItems.find(item => item.active);
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
updateActiveSheet(name) {
|
|
2726
|
+
this.ngZone.run(() => this.spreadsheetService.currentActiveSheet = name);
|
|
2727
|
+
}
|
|
2728
|
+
onSheetsChanged(e) {
|
|
2729
|
+
console.log(e, 'sheet ch');
|
|
2730
|
+
this.ngZone.run(() => {
|
|
2731
|
+
this.sheets = mapToSheetDescriptor(e.sheets);
|
|
2732
|
+
this.updateActiveSheet(this.spreadsheetService.activeSheet);
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2735
|
+
get options() {
|
|
2736
|
+
return Object.assign(Object.assign({ activeSheet: this.activeSheet }, {
|
|
2737
|
+
sheets: this.sheetsInfo,
|
|
2738
|
+
intl: {
|
|
2739
|
+
localeInfo: () => localeData(this.intl.localeId),
|
|
2740
|
+
parseDate: (value, fmt) => this.intl.parseDate(value, fmt),
|
|
2741
|
+
toString: (value, fmt) => this.intl.toString(value, fmt),
|
|
2742
|
+
format: (fmt, ...values) => this.intl.format(fmt, ...values)
|
|
2743
|
+
}
|
|
2744
|
+
}), { columns: this.columns, columnWidth: this.columnWidth, defaultCellStyle: this.defaultCellStyle, excel: this.excel, headerHeight: this.headerHeight, headerWidth: this.headerHeight, images: this.images, names: this.names, rowHeight: this.rowHeight, rows: this.rows, formulaBarInputRef: { current: this.formulaBarInputRef.current }, formulaCellInputRef: { current: this.formulaCellInputRef.current }, nameBoxRef: { current: this.nameBoxRef.current } });
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
SpreadsheetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetComponent, deps: [{ token: i0.NgZone }, { token: i1$5.IntlService }, { token: i0.ElementRef }, { token: i1.LocalizationService }, { token: SpreadsheetService }, { token: SpreadsheetToolsService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
2748
|
+
SpreadsheetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetComponent, selector: "kendo-spreadsheet", inputs: { menuItems: "menuItems", overflow: "overflow", activeSheet: "activeSheet", sheets: "sheets", columns: "columns", columnWidth: "columnWidth", defaultCellStyle: "defaultCellStyle", headerHeight: "headerHeight", headerWidth: "headerWidth", rowHeight: "rowHeight", rows: "rows", names: "names", images: "images", excel: "excel" }, outputs: { change: "change", formatChange: "formatChange", selectionChange: "selectionChange", excelExport: "excelExport", excelImport: "excelImport", activeSheetChange: "activeSheetChange" }, host: { properties: { "class.k-spreadsheet": "this.hostClass", "attr.role": "this.role" } }, providers: [
|
|
2749
|
+
SpreadsheetLocalizationService,
|
|
2750
|
+
{
|
|
2751
|
+
provide: LocalizationService,
|
|
2752
|
+
useExisting: SpreadsheetLocalizationService
|
|
2753
|
+
},
|
|
2754
|
+
{
|
|
2755
|
+
provide: L10N_PREFIX,
|
|
2756
|
+
useValue: 'kendo.spreadsheet'
|
|
2757
|
+
},
|
|
2758
|
+
SpreadsheetToolsService,
|
|
2759
|
+
PopupService
|
|
2760
|
+
], viewQueries: [{ propertyName: "formulaBarInputRef", first: true, predicate: ["formulaBar"], descendants: true, read: FormulaInputDirective }, { propertyName: "formulaCellInputRef", first: true, predicate: ["formulaCell"], descendants: true, read: FormulaInputDirective }, { propertyName: "nameBoxRef", first: true, predicate: ["nameBox"], descendants: true }, { propertyName: "dialogContainer", first: true, predicate: ["dialogContainer"], descendants: true, read: ViewContainerRef }], exportAs: ["kendo-spreadsheet"], usesOnChanges: true, ngImport: i0, template: `
|
|
2761
|
+
<ng-container
|
|
2762
|
+
kendoSpreadsheetLocalizedMessages
|
|
2763
|
+
i18n-background="kendo.spreadsheet.background|The title of the tool that changes the text background color."
|
|
2764
|
+
background="Background color"
|
|
2765
|
+
i18n-color="kendo.spreadsheet.color|The title of the tool that changes the text font color."
|
|
2766
|
+
color="Font color"
|
|
2767
|
+
i18n-bold="kendo.spreadsheet.bold|The title of the Bold tool."
|
|
2768
|
+
bold="Bold"
|
|
2769
|
+
i18n-italic="kendo.spreadsheet.italic|The title of the Italic tool."
|
|
2770
|
+
italic="Italic"
|
|
2771
|
+
i18n-underline="kendo.spreadsheet.underline|The title of the Underline tool."
|
|
2772
|
+
underline="Underline"
|
|
2773
|
+
i18n-loadFile="kendo.spreadsheet.loadFile|The title of the Load File tool."
|
|
2774
|
+
loadFile="Open..."
|
|
2775
|
+
i18n-saveFile="kendo.spreadsheet.saveFile|The title of the Save File tool."
|
|
2776
|
+
saveFile="Export..."
|
|
2777
|
+
i18n-format="kendo.spreadsheet.format|The text of the Format tool."
|
|
2778
|
+
format="Custom format..."
|
|
2779
|
+
i18n-fontFamily="kendo.spreadsheet.fontFamily|The text of the Font Family tool."
|
|
2780
|
+
fontFamily="Font"
|
|
2781
|
+
i18n-fontSize="kendo.spreadsheet.fontSize|The text of the Font Size tool."
|
|
2782
|
+
fontSize="Font size"
|
|
2783
|
+
i18n-home="kendo.spreadsheet.home|The text of the Home toolbar tab."
|
|
2784
|
+
home="Home"
|
|
2785
|
+
i18n-file="kendo.spreadsheet.file|The text of the File toolbar tab."
|
|
2786
|
+
file="File"
|
|
2787
|
+
i18n-insert="kendo.spreadsheet.insert|The text of the Insert toolbar tab."
|
|
2788
|
+
insert="Insert"
|
|
2789
|
+
i18n-undo="kendo.spreadsheet.undo|The title of the Undo tool."
|
|
2790
|
+
undo="Undo"
|
|
2791
|
+
i18n-redo="kendo.spreadsheet.redo|The title of the Redo tool."
|
|
2792
|
+
redo="Redo"
|
|
2793
|
+
i18n-gridLines="kendo.spreadsheet.gridLines|The title of the Grid Lines tool."
|
|
2794
|
+
gridLines="Toggle grid lines"
|
|
2795
|
+
i18n-addColumnLeft="kendo.spreadsheet.addColumnLeft|The title of the tool that adds new column before currently selected column."
|
|
2796
|
+
addColumnLeft="Add column left"
|
|
2797
|
+
i18n-addColumnRight="kendo.spreadsheet.addColumnRight|The title of the tool that adds new column after currently selected column."
|
|
2798
|
+
addColumnRight="Add column right"
|
|
2799
|
+
i18n-addRowBelow="kendo.spreadsheet.addRowBelow|The title of the tool that adds new row below currently selected row."
|
|
2800
|
+
addRowBelow="Add row below"
|
|
2801
|
+
i18n-addRowAbove="kendo.spreadsheet.addRowAbove|The title of the tool that adds new row above currently selected row."
|
|
2802
|
+
addRowAbove="Add row above"
|
|
2803
|
+
i18n-deleteColumn="kendo.spreadsheet.deleteColumn|The title of the tool that deletes a column."
|
|
2804
|
+
deleteColumn="Delete column"
|
|
2805
|
+
i18n-deleteRow="kendo.spreadsheet.deleteRow|The title of the tool that deletes a row."
|
|
2806
|
+
deleteRow="Delete row"
|
|
2807
|
+
i18n-wrap="kendo.spreadsheet.wrap|The title of the Text Wrap tool."
|
|
2808
|
+
wrap="Text wrap"
|
|
2809
|
+
i18n-align="kendo.spreadsheet.align|The title of the Text Align tool."
|
|
2810
|
+
align="Align"
|
|
2811
|
+
i18n-dialogApply="kendo.spreadsheet.dialogApply|The text of the **Apply** button in all Spreadsheet dialogs."
|
|
2812
|
+
dialogApply="Apply"
|
|
2813
|
+
i18n-dialogCancel="kendo.spreadsheet.dialogCancel|The text of the **Cancel** button in all Spreadsheet dialogs."
|
|
2814
|
+
dialogCancel="Cancel"
|
|
2815
|
+
i18n-dialogDelete="kendo.spreadsheet.dialogDelete|The text of the **Delete** button in the Delete sheet dialog."
|
|
2816
|
+
dialogDelete="Delete"
|
|
2817
|
+
i18n-dialogRename="kendo.spreadsheet.dialogRename|The text of the **Rename** button in the Rename sheet dialog."
|
|
2818
|
+
dialogRename="Rename"
|
|
2819
|
+
i18n-rename="kendo.spreadsheet.rename|The title of the Rename sheet dialog."
|
|
2820
|
+
rename="Rename Sheet"
|
|
2821
|
+
i18n-delete="kendo.spreadsheet.delete|The title of the Delete sheet dialog."
|
|
2822
|
+
delete="Delete Sheet">
|
|
2823
|
+
</ng-container>
|
|
2824
|
+
<div class="k-spreadsheet-header">
|
|
2825
|
+
<kendo-menu kendoSpreadsheetMenu (select)="onMenuItemSelect($event)">
|
|
2826
|
+
<kendo-menu-item *ngFor="let item of menuItems" [text]="item.text" [cssClass]="item.cssClass"></kendo-menu-item>
|
|
2827
|
+
</kendo-menu>
|
|
2828
|
+
<kendo-toolbar *ngIf="selectedMenuItem?.active && selectedMenuItem.id === 'file'"
|
|
2829
|
+
[attr.aria-label]="messageFor('file')"
|
|
2830
|
+
class="k-spreadsheet-toolbar"
|
|
2831
|
+
[overflow]="overflow">
|
|
2832
|
+
<kendo-spreadsheet-load-file-tool></kendo-spreadsheet-load-file-tool>
|
|
2833
|
+
<kendo-toolbar-button kendoSpreadsheetSaveFile></kendo-toolbar-button>
|
|
2834
|
+
</kendo-toolbar>
|
|
2835
|
+
<kendo-toolbar *ngIf="selectedMenuItem?.active && selectedMenuItem.id === 'home'"
|
|
2836
|
+
[attr.aria-label]="messageFor('home')"
|
|
2837
|
+
class="k-spreadsheet-toolbar"
|
|
2838
|
+
[overflow]="overflow">
|
|
2839
|
+
<kendo-toolbar-buttongroup>
|
|
2840
|
+
<kendo-toolbar-button kendoSpreadsheetUndo></kendo-toolbar-button>
|
|
2841
|
+
<kendo-toolbar-button kendoSpreadsheetRedo></kendo-toolbar-button>
|
|
2842
|
+
</kendo-toolbar-buttongroup>
|
|
2843
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
2844
|
+
<kendo-toolbar-dropdownlist kendoSpreadsheetFontFamily></kendo-toolbar-dropdownlist>
|
|
2845
|
+
<kendo-toolbar-dropdownlist kendoSpreadsheetFontSize></kendo-toolbar-dropdownlist>
|
|
2846
|
+
<kendo-toolbar-buttongroup>
|
|
2847
|
+
<kendo-toolbar-button kendoSpreadsheetBold></kendo-toolbar-button>
|
|
2848
|
+
<kendo-toolbar-button kendoSpreadsheetItalic></kendo-toolbar-button>
|
|
2849
|
+
<kendo-toolbar-button kendoSpreadsheetUnderline></kendo-toolbar-button>
|
|
2850
|
+
</kendo-toolbar-buttongroup>
|
|
2851
|
+
<kendo-spreadsheet-forecolor-tool></kendo-spreadsheet-forecolor-tool>
|
|
2852
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
2853
|
+
<kendo-spreadsheet-backcolor-tool></kendo-spreadsheet-backcolor-tool>
|
|
2854
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
2855
|
+
<kendo-toolbar-dropdownbutton kendoSpreadsheetTextAlign></kendo-toolbar-dropdownbutton>
|
|
2856
|
+
<kendo-toolbar-button kendoSpreadsheetTextWrap></kendo-toolbar-button>
|
|
2857
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
2858
|
+
<kendo-toolbar-dropdownbutton kendoSpreadsheetFormat></kendo-toolbar-dropdownbutton>
|
|
2859
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
2860
|
+
<kendo-toolbar-button kendoSpreadsheetGridLines></kendo-toolbar-button>
|
|
2861
|
+
</kendo-toolbar>
|
|
2862
|
+
<kendo-toolbar *ngIf="selectedMenuItem?.active && selectedMenuItem.id === 'insert'"
|
|
2863
|
+
[attr.aria-label]="messageFor('insert')"
|
|
2864
|
+
class="k-spreadsheet-toolbar"
|
|
2865
|
+
[overflow]="overflow">
|
|
2866
|
+
<kendo-toolbar-button kendoSpreadsheetAddColumnLeftButton></kendo-toolbar-button>
|
|
2867
|
+
<kendo-toolbar-button kendoSpreadsheetAddColumnRightButton></kendo-toolbar-button>
|
|
2868
|
+
<kendo-toolbar-button kendoSpreadsheetAddRowBelowButton></kendo-toolbar-button>
|
|
2869
|
+
<kendo-toolbar-button kendoSpreadsheetAddRowAboveButton></kendo-toolbar-button>
|
|
2870
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
2871
|
+
<kendo-toolbar-button kendoSpreadsheetDeleteColumnButton></kendo-toolbar-button>
|
|
2872
|
+
<kendo-toolbar-button kendoSpreadsheetDeleteRowButton></kendo-toolbar-button>
|
|
2873
|
+
</kendo-toolbar>
|
|
2874
|
+
</div>
|
|
2875
|
+
<div class="k-spreadsheet-action-bar">
|
|
2876
|
+
<div #nameBox kendoSpreadsheetNameBox [spreadsheetWidget]="spreadsheetWidget"></div>
|
|
2877
|
+
<div class="k-spreadsheet-formula-bar">
|
|
2878
|
+
<span class="k-separator k-separator-vertical"></span>
|
|
2879
|
+
<button kendoButton
|
|
2880
|
+
icon="formula-fx"
|
|
2881
|
+
[svgIcon]="formulaFxIcon"
|
|
2882
|
+
[fillMode]="'flat'">
|
|
2883
|
+
</button>
|
|
2884
|
+
<span class="k-separator k-separator-vertical"></span>
|
|
2885
|
+
<div #formulaBar kendoSpreadsheetFormulaInput class="k-textbox k-input k-input-md k-input-flat k-rounded-md"></div>
|
|
2886
|
+
<div class="k-widget k-tooltip" style="position: absolute; display: none;">A1</div>
|
|
2887
|
+
</div>
|
|
2888
|
+
</div>
|
|
2889
|
+
<div class="k-spreadsheet-view">
|
|
2890
|
+
<div class="k-spreadsheet-fixed-container"></div>
|
|
2891
|
+
<div class="k-spreadsheet-scroller">
|
|
2892
|
+
<div class="k-spreadsheet-view-size"></div>
|
|
2893
|
+
</div>
|
|
2894
|
+
<div tabIndex="0" class="k-spreadsheet-clipboard" contentEditable="true"></div>
|
|
2895
|
+
<div #formulaCell kendoSpreadsheetFormulaInput class="k-spreadsheet-cell-editor" data-role="formulainput"></div>
|
|
2896
|
+
</div>
|
|
2897
|
+
<div class="k-spreadsheet-sheets-bar"
|
|
2898
|
+
kendoSpreadsheetSheetsBar
|
|
2899
|
+
[sheets]="sheetsInfo"
|
|
2900
|
+
[sheetDescriptors]="sheets">
|
|
2901
|
+
</div>
|
|
2902
|
+
<ng-container #dialogContainer></ng-container>
|
|
2903
|
+
|
|
2904
|
+
<div kendoWatermarkOverlay *ngIf="showLicenseWatermark"></div>
|
|
2905
|
+
`, isInline: true, components: [{ type: i5$2.MenuComponent, selector: "kendo-menu", inputs: ["menuItemTemplate", "ariaRole", "menuItemLinkTemplate"], outputs: ["select", "open", "close"], exportAs: ["kendoMenu"] }, { type: i5$2.MenuItemComponent, selector: "kendo-menu-item", inputs: ["text", "url", "disabled", "cssClass", "cssStyle", "icon", "svgIcon", "data", "separator"] }, { type: i1$2.ToolBarComponent, selector: "kendo-toolbar", inputs: ["overflow", "resizable", "popupSettings", "tabindex", "size", "tabIndex"], outputs: ["open", "close"], exportAs: ["kendoToolBar"] }, { type: SpreadsheetLoadFileComponent, selector: "kendo-spreadsheet-load-file-tool" }, { type: i1$2.ToolBarButtonComponent, selector: "kendo-toolbar-button", inputs: ["showText", "showIcon", "text", "style", "className", "title", "disabled", "toggleable", "look", "togglable", "selected", "fillMode", "themeColor", "icon", "iconClass", "svgIcon", "imageUrl"], outputs: ["click", "pointerdown", "selectedChange"], exportAs: ["kendoToolBarButton"] }, { type: i1$2.ToolBarButtonGroupComponent, selector: "kendo-toolbar-buttongroup", inputs: ["disabled", "selection", "width", "look"], exportAs: ["kendoToolBarButtonGroup"] }, { type: i1$2.ToolBarSeparatorComponent, selector: "kendo-toolbar-separator", exportAs: ["kendoToolBarSeparator"] }, { type: SpreadsheetFontFamilyComponent, selector: "kendo-toolbar-dropdownlist[kendoSpreadsheetFontFamily]" }, { type: SpreadsheetFontSizeComponent, selector: "kendo-toolbar-dropdownlist[kendoSpreadsheetFontSize]" }, { type: SpreadsheetForeColorComponent, selector: "kendo-spreadsheet-forecolor-tool" }, { type: SpreadsheetBackColorComponent, selector: "kendo-spreadsheet-backcolor-tool" }, { type: i1$2.ToolBarDropDownButtonComponent, selector: "kendo-toolbar-dropdownbutton", inputs: ["arrowIcon", "title", "showText", "showIcon", "text", "icon", "svgIcon", "iconClass", "imageUrl", "popupSettings", "look", "primary", "fillMode", "themeColor", "buttonClass", "textField", "disabled", "data"], outputs: ["itemClick", "open", "close"], exportAs: ["kendoToolBarDropDownButton"] }, { type: NameBoxComponent, selector: "[kendoSpreadsheetNameBox]", inputs: ["data", "spreadsheetWidget"] }, { 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: SheetsBarComponent, selector: "[kendoSpreadsheetSheetsBar]", inputs: ["sheets", "sheetDescriptors"] }, { type: i3.WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay]" }], directives: [{ type: LocalizedMessagesDirective, selector: "[kendoSpreadsheetLocalizedMessages]" }, { type: MainMenuDirective, selector: "[kendoSpreadsheetMenu]" }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: SpreadsheetSaveFileDirective, selector: "[kendoSpreadsheetSaveFile]" }, { type: SpreadsheetUndoDirective, selector: "kendo-toolbar-button[kendoSpreadsheetUndo]" }, { type: SpreadsheetRedoDirective, selector: "kendo-toolbar-button[kendoSpreadsheetRedo]" }, { type: SpreadsheetBoldDirective, selector: "kendo-toolbar-button[kendoSpreadsheetBold]" }, { type: SpreadsheetItalicDirective, selector: "kendo-toolbar-button[kendoSpreadsheetItalic]" }, { type: SpreadsheetUnderlineDirective, selector: "kendo-toolbar-button[kendoSpreadsheetUnderline]" }, { type: SpreadsheetTextAlignDirective, selector: "[kendoSpreadsheetTextAlign]" }, { type: SpreadsheetTextWrapDirective, selector: "kendo-toolbar-button[kendoSpreadsheetTextWrap]" }, { type: SpreadsheetFormatDirective, selector: "[kendoSpreadsheetFormat]" }, { type: SpreadsheetGridLinesDirective, selector: "kendo-toolbar-button[kendoSpreadsheetGridLines]" }, { type: SpreadsheetAddColumnLeftButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetAddColumnLeftButton]" }, { type: SpreadsheetAddColumnRightButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetAddColumnRightButton]" }, { type: SpreadsheetAddRowBelowButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetAddRowBelowButton]" }, { type: SpreadsheetAddRowAboveButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetAddRowAboveButton]" }, { type: SpreadsheetDeleteColumnButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetDeleteColumnButton]" }, { type: SpreadsheetDeleteRowButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetDeleteRowButton]" }, { type: FormulaInputDirective, selector: "[kendoSpreadsheetFormulaInput]" }] });
|
|
2906
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetComponent, decorators: [{
|
|
2907
|
+
type: Component,
|
|
2908
|
+
args: [{
|
|
2909
|
+
exportAs: 'kendo-spreadsheet',
|
|
2910
|
+
selector: 'kendo-spreadsheet',
|
|
2911
|
+
providers: [
|
|
2912
|
+
SpreadsheetLocalizationService,
|
|
2913
|
+
{
|
|
2914
|
+
provide: LocalizationService,
|
|
2915
|
+
useExisting: SpreadsheetLocalizationService
|
|
2916
|
+
},
|
|
2917
|
+
{
|
|
2918
|
+
provide: L10N_PREFIX,
|
|
2919
|
+
useValue: 'kendo.spreadsheet'
|
|
2920
|
+
},
|
|
2921
|
+
SpreadsheetToolsService,
|
|
2922
|
+
PopupService
|
|
2923
|
+
],
|
|
2924
|
+
template: `
|
|
2925
|
+
<ng-container
|
|
2926
|
+
kendoSpreadsheetLocalizedMessages
|
|
2927
|
+
i18n-background="kendo.spreadsheet.background|The title of the tool that changes the text background color."
|
|
2928
|
+
background="Background color"
|
|
2929
|
+
i18n-color="kendo.spreadsheet.color|The title of the tool that changes the text font color."
|
|
2930
|
+
color="Font color"
|
|
2931
|
+
i18n-bold="kendo.spreadsheet.bold|The title of the Bold tool."
|
|
2932
|
+
bold="Bold"
|
|
2933
|
+
i18n-italic="kendo.spreadsheet.italic|The title of the Italic tool."
|
|
2934
|
+
italic="Italic"
|
|
2935
|
+
i18n-underline="kendo.spreadsheet.underline|The title of the Underline tool."
|
|
2936
|
+
underline="Underline"
|
|
2937
|
+
i18n-loadFile="kendo.spreadsheet.loadFile|The title of the Load File tool."
|
|
2938
|
+
loadFile="Open..."
|
|
2939
|
+
i18n-saveFile="kendo.spreadsheet.saveFile|The title of the Save File tool."
|
|
2940
|
+
saveFile="Export..."
|
|
2941
|
+
i18n-format="kendo.spreadsheet.format|The text of the Format tool."
|
|
2942
|
+
format="Custom format..."
|
|
2943
|
+
i18n-fontFamily="kendo.spreadsheet.fontFamily|The text of the Font Family tool."
|
|
2944
|
+
fontFamily="Font"
|
|
2945
|
+
i18n-fontSize="kendo.spreadsheet.fontSize|The text of the Font Size tool."
|
|
2946
|
+
fontSize="Font size"
|
|
2947
|
+
i18n-home="kendo.spreadsheet.home|The text of the Home toolbar tab."
|
|
2948
|
+
home="Home"
|
|
2949
|
+
i18n-file="kendo.spreadsheet.file|The text of the File toolbar tab."
|
|
2950
|
+
file="File"
|
|
2951
|
+
i18n-insert="kendo.spreadsheet.insert|The text of the Insert toolbar tab."
|
|
2952
|
+
insert="Insert"
|
|
2953
|
+
i18n-undo="kendo.spreadsheet.undo|The title of the Undo tool."
|
|
2954
|
+
undo="Undo"
|
|
2955
|
+
i18n-redo="kendo.spreadsheet.redo|The title of the Redo tool."
|
|
2956
|
+
redo="Redo"
|
|
2957
|
+
i18n-gridLines="kendo.spreadsheet.gridLines|The title of the Grid Lines tool."
|
|
2958
|
+
gridLines="Toggle grid lines"
|
|
2959
|
+
i18n-addColumnLeft="kendo.spreadsheet.addColumnLeft|The title of the tool that adds new column before currently selected column."
|
|
2960
|
+
addColumnLeft="Add column left"
|
|
2961
|
+
i18n-addColumnRight="kendo.spreadsheet.addColumnRight|The title of the tool that adds new column after currently selected column."
|
|
2962
|
+
addColumnRight="Add column right"
|
|
2963
|
+
i18n-addRowBelow="kendo.spreadsheet.addRowBelow|The title of the tool that adds new row below currently selected row."
|
|
2964
|
+
addRowBelow="Add row below"
|
|
2965
|
+
i18n-addRowAbove="kendo.spreadsheet.addRowAbove|The title of the tool that adds new row above currently selected row."
|
|
2966
|
+
addRowAbove="Add row above"
|
|
2967
|
+
i18n-deleteColumn="kendo.spreadsheet.deleteColumn|The title of the tool that deletes a column."
|
|
2968
|
+
deleteColumn="Delete column"
|
|
2969
|
+
i18n-deleteRow="kendo.spreadsheet.deleteRow|The title of the tool that deletes a row."
|
|
2970
|
+
deleteRow="Delete row"
|
|
2971
|
+
i18n-wrap="kendo.spreadsheet.wrap|The title of the Text Wrap tool."
|
|
2972
|
+
wrap="Text wrap"
|
|
2973
|
+
i18n-align="kendo.spreadsheet.align|The title of the Text Align tool."
|
|
2974
|
+
align="Align"
|
|
2975
|
+
i18n-dialogApply="kendo.spreadsheet.dialogApply|The text of the **Apply** button in all Spreadsheet dialogs."
|
|
2976
|
+
dialogApply="Apply"
|
|
2977
|
+
i18n-dialogCancel="kendo.spreadsheet.dialogCancel|The text of the **Cancel** button in all Spreadsheet dialogs."
|
|
2978
|
+
dialogCancel="Cancel"
|
|
2979
|
+
i18n-dialogDelete="kendo.spreadsheet.dialogDelete|The text of the **Delete** button in the Delete sheet dialog."
|
|
2980
|
+
dialogDelete="Delete"
|
|
2981
|
+
i18n-dialogRename="kendo.spreadsheet.dialogRename|The text of the **Rename** button in the Rename sheet dialog."
|
|
2982
|
+
dialogRename="Rename"
|
|
2983
|
+
i18n-rename="kendo.spreadsheet.rename|The title of the Rename sheet dialog."
|
|
2984
|
+
rename="Rename Sheet"
|
|
2985
|
+
i18n-delete="kendo.spreadsheet.delete|The title of the Delete sheet dialog."
|
|
2986
|
+
delete="Delete Sheet">
|
|
2987
|
+
</ng-container>
|
|
2988
|
+
<div class="k-spreadsheet-header">
|
|
2989
|
+
<kendo-menu kendoSpreadsheetMenu (select)="onMenuItemSelect($event)">
|
|
2990
|
+
<kendo-menu-item *ngFor="let item of menuItems" [text]="item.text" [cssClass]="item.cssClass"></kendo-menu-item>
|
|
2991
|
+
</kendo-menu>
|
|
2992
|
+
<kendo-toolbar *ngIf="selectedMenuItem?.active && selectedMenuItem.id === 'file'"
|
|
2993
|
+
[attr.aria-label]="messageFor('file')"
|
|
2994
|
+
class="k-spreadsheet-toolbar"
|
|
2995
|
+
[overflow]="overflow">
|
|
2996
|
+
<kendo-spreadsheet-load-file-tool></kendo-spreadsheet-load-file-tool>
|
|
2997
|
+
<kendo-toolbar-button kendoSpreadsheetSaveFile></kendo-toolbar-button>
|
|
2998
|
+
</kendo-toolbar>
|
|
2999
|
+
<kendo-toolbar *ngIf="selectedMenuItem?.active && selectedMenuItem.id === 'home'"
|
|
3000
|
+
[attr.aria-label]="messageFor('home')"
|
|
3001
|
+
class="k-spreadsheet-toolbar"
|
|
3002
|
+
[overflow]="overflow">
|
|
3003
|
+
<kendo-toolbar-buttongroup>
|
|
3004
|
+
<kendo-toolbar-button kendoSpreadsheetUndo></kendo-toolbar-button>
|
|
3005
|
+
<kendo-toolbar-button kendoSpreadsheetRedo></kendo-toolbar-button>
|
|
3006
|
+
</kendo-toolbar-buttongroup>
|
|
3007
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
3008
|
+
<kendo-toolbar-dropdownlist kendoSpreadsheetFontFamily></kendo-toolbar-dropdownlist>
|
|
3009
|
+
<kendo-toolbar-dropdownlist kendoSpreadsheetFontSize></kendo-toolbar-dropdownlist>
|
|
3010
|
+
<kendo-toolbar-buttongroup>
|
|
3011
|
+
<kendo-toolbar-button kendoSpreadsheetBold></kendo-toolbar-button>
|
|
3012
|
+
<kendo-toolbar-button kendoSpreadsheetItalic></kendo-toolbar-button>
|
|
3013
|
+
<kendo-toolbar-button kendoSpreadsheetUnderline></kendo-toolbar-button>
|
|
3014
|
+
</kendo-toolbar-buttongroup>
|
|
3015
|
+
<kendo-spreadsheet-forecolor-tool></kendo-spreadsheet-forecolor-tool>
|
|
3016
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
3017
|
+
<kendo-spreadsheet-backcolor-tool></kendo-spreadsheet-backcolor-tool>
|
|
3018
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
3019
|
+
<kendo-toolbar-dropdownbutton kendoSpreadsheetTextAlign></kendo-toolbar-dropdownbutton>
|
|
3020
|
+
<kendo-toolbar-button kendoSpreadsheetTextWrap></kendo-toolbar-button>
|
|
3021
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
3022
|
+
<kendo-toolbar-dropdownbutton kendoSpreadsheetFormat></kendo-toolbar-dropdownbutton>
|
|
3023
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
3024
|
+
<kendo-toolbar-button kendoSpreadsheetGridLines></kendo-toolbar-button>
|
|
3025
|
+
</kendo-toolbar>
|
|
3026
|
+
<kendo-toolbar *ngIf="selectedMenuItem?.active && selectedMenuItem.id === 'insert'"
|
|
3027
|
+
[attr.aria-label]="messageFor('insert')"
|
|
3028
|
+
class="k-spreadsheet-toolbar"
|
|
3029
|
+
[overflow]="overflow">
|
|
3030
|
+
<kendo-toolbar-button kendoSpreadsheetAddColumnLeftButton></kendo-toolbar-button>
|
|
3031
|
+
<kendo-toolbar-button kendoSpreadsheetAddColumnRightButton></kendo-toolbar-button>
|
|
3032
|
+
<kendo-toolbar-button kendoSpreadsheetAddRowBelowButton></kendo-toolbar-button>
|
|
3033
|
+
<kendo-toolbar-button kendoSpreadsheetAddRowAboveButton></kendo-toolbar-button>
|
|
3034
|
+
<kendo-toolbar-separator></kendo-toolbar-separator>
|
|
3035
|
+
<kendo-toolbar-button kendoSpreadsheetDeleteColumnButton></kendo-toolbar-button>
|
|
3036
|
+
<kendo-toolbar-button kendoSpreadsheetDeleteRowButton></kendo-toolbar-button>
|
|
3037
|
+
</kendo-toolbar>
|
|
3038
|
+
</div>
|
|
3039
|
+
<div class="k-spreadsheet-action-bar">
|
|
3040
|
+
<div #nameBox kendoSpreadsheetNameBox [spreadsheetWidget]="spreadsheetWidget"></div>
|
|
3041
|
+
<div class="k-spreadsheet-formula-bar">
|
|
3042
|
+
<span class="k-separator k-separator-vertical"></span>
|
|
3043
|
+
<button kendoButton
|
|
3044
|
+
icon="formula-fx"
|
|
3045
|
+
[svgIcon]="formulaFxIcon"
|
|
3046
|
+
[fillMode]="'flat'">
|
|
3047
|
+
</button>
|
|
3048
|
+
<span class="k-separator k-separator-vertical"></span>
|
|
3049
|
+
<div #formulaBar kendoSpreadsheetFormulaInput class="k-textbox k-input k-input-md k-input-flat k-rounded-md"></div>
|
|
3050
|
+
<div class="k-widget k-tooltip" style="position: absolute; display: none;">A1</div>
|
|
3051
|
+
</div>
|
|
3052
|
+
</div>
|
|
3053
|
+
<div class="k-spreadsheet-view">
|
|
3054
|
+
<div class="k-spreadsheet-fixed-container"></div>
|
|
3055
|
+
<div class="k-spreadsheet-scroller">
|
|
3056
|
+
<div class="k-spreadsheet-view-size"></div>
|
|
3057
|
+
</div>
|
|
3058
|
+
<div tabIndex="0" class="k-spreadsheet-clipboard" contentEditable="true"></div>
|
|
3059
|
+
<div #formulaCell kendoSpreadsheetFormulaInput class="k-spreadsheet-cell-editor" data-role="formulainput"></div>
|
|
3060
|
+
</div>
|
|
3061
|
+
<div class="k-spreadsheet-sheets-bar"
|
|
3062
|
+
kendoSpreadsheetSheetsBar
|
|
3063
|
+
[sheets]="sheetsInfo"
|
|
3064
|
+
[sheetDescriptors]="sheets">
|
|
3065
|
+
</div>
|
|
3066
|
+
<ng-container #dialogContainer></ng-container>
|
|
3067
|
+
|
|
3068
|
+
<div kendoWatermarkOverlay *ngIf="showLicenseWatermark"></div>
|
|
3069
|
+
`,
|
|
3070
|
+
}]
|
|
3071
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1$5.IntlService }, { type: i0.ElementRef }, { type: i1.LocalizationService }, { type: SpreadsheetService }, { type: SpreadsheetToolsService }, { type: i0.Renderer2 }]; }, propDecorators: { formulaBarInputRef: [{
|
|
3072
|
+
type: ViewChild,
|
|
3073
|
+
args: ['formulaBar', { read: FormulaInputDirective }]
|
|
3074
|
+
}], formulaCellInputRef: [{
|
|
3075
|
+
type: ViewChild,
|
|
3076
|
+
args: ['formulaCell', { read: FormulaInputDirective }]
|
|
3077
|
+
}], nameBoxRef: [{
|
|
3078
|
+
type: ViewChild,
|
|
3079
|
+
args: ['nameBox']
|
|
3080
|
+
}], dialogContainer: [{
|
|
3081
|
+
type: ViewChild,
|
|
3082
|
+
args: ['dialogContainer', { read: ViewContainerRef }]
|
|
3083
|
+
}], hostClass: [{
|
|
3084
|
+
type: HostBinding,
|
|
3085
|
+
args: ['class.k-spreadsheet']
|
|
3086
|
+
}], role: [{
|
|
3087
|
+
type: HostBinding,
|
|
3088
|
+
args: ['attr.role']
|
|
3089
|
+
}], menuItems: [{
|
|
3090
|
+
type: Input
|
|
3091
|
+
}], overflow: [{
|
|
3092
|
+
type: Input
|
|
3093
|
+
}], activeSheet: [{
|
|
3094
|
+
type: Input
|
|
3095
|
+
}], sheets: [{
|
|
3096
|
+
type: Input
|
|
3097
|
+
}], columns: [{
|
|
3098
|
+
type: Input
|
|
3099
|
+
}], columnWidth: [{
|
|
3100
|
+
type: Input
|
|
3101
|
+
}], defaultCellStyle: [{
|
|
3102
|
+
type: Input
|
|
3103
|
+
}], headerHeight: [{
|
|
3104
|
+
type: Input
|
|
3105
|
+
}], headerWidth: [{
|
|
3106
|
+
type: Input
|
|
3107
|
+
}], rowHeight: [{
|
|
3108
|
+
type: Input
|
|
3109
|
+
}], rows: [{
|
|
3110
|
+
type: Input
|
|
3111
|
+
}], names: [{
|
|
3112
|
+
type: Input
|
|
3113
|
+
}], images: [{
|
|
3114
|
+
type: Input
|
|
3115
|
+
}], excel: [{
|
|
3116
|
+
type: Input
|
|
3117
|
+
}], change: [{
|
|
3118
|
+
type: Output
|
|
3119
|
+
}], formatChange: [{
|
|
3120
|
+
type: Output
|
|
3121
|
+
}], selectionChange: [{
|
|
3122
|
+
type: Output
|
|
3123
|
+
}], excelExport: [{
|
|
3124
|
+
type: Output
|
|
3125
|
+
}], excelImport: [{
|
|
3126
|
+
type: Output
|
|
3127
|
+
}], activeSheetChange: [{
|
|
3128
|
+
type: Output
|
|
3129
|
+
}] } });
|
|
3130
|
+
|
|
3131
|
+
/**
|
|
3132
|
+
* Custom component messages override default component messages
|
|
3133
|
+
* ([see example]({% slug globalization_spreadsheet %}#toc-localization)).
|
|
3134
|
+
*/
|
|
3135
|
+
class CustomMessagesComponent extends MessagesDirective {
|
|
3136
|
+
constructor(service) {
|
|
3137
|
+
super();
|
|
3138
|
+
this.service = service;
|
|
3139
|
+
}
|
|
3140
|
+
get override() {
|
|
3141
|
+
return true;
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3145
|
+
CustomMessagesComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: CustomMessagesComponent, selector: "kendo-spreadsheet-messages", providers: [
|
|
3146
|
+
{
|
|
3147
|
+
provide: MessagesDirective,
|
|
3148
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
3149
|
+
}
|
|
3150
|
+
], usesInheritance: true, ngImport: i0 });
|
|
3151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CustomMessagesComponent, decorators: [{
|
|
3152
|
+
type: Directive,
|
|
3153
|
+
args: [{
|
|
3154
|
+
providers: [
|
|
3155
|
+
{
|
|
3156
|
+
provide: MessagesDirective,
|
|
3157
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
3158
|
+
}
|
|
3159
|
+
],
|
|
3160
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
3161
|
+
selector: 'kendo-spreadsheet-messages'
|
|
3162
|
+
}]
|
|
3163
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
3164
|
+
|
|
3165
|
+
/**
|
|
3166
|
+
* @hidden
|
|
3167
|
+
*/
|
|
3168
|
+
class RemoveDirective {
|
|
3169
|
+
constructor() {
|
|
3170
|
+
this.hostDisplay = 'none';
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
RemoveDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RemoveDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3174
|
+
RemoveDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: RemoveDirective, selector: "[kendoRemoveDirective]", host: { properties: { "style.display": "this.hostDisplay" } }, ngImport: i0 });
|
|
3175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RemoveDirective, decorators: [{
|
|
3176
|
+
type: Directive,
|
|
3177
|
+
args: [{
|
|
3178
|
+
selector: '[kendoRemoveDirective]',
|
|
3179
|
+
}]
|
|
3180
|
+
}], propDecorators: { hostDisplay: [{
|
|
3181
|
+
type: HostBinding,
|
|
3182
|
+
args: ['style.display']
|
|
3183
|
+
}] } });
|
|
3184
|
+
|
|
3185
|
+
const DIRECTIVES = [
|
|
3186
|
+
SpreadsheetComponent,
|
|
3187
|
+
MessagesDirective,
|
|
3188
|
+
LocalizedMessagesDirective,
|
|
3189
|
+
CustomMessagesComponent,
|
|
3190
|
+
FormulaListComponent,
|
|
3191
|
+
FormulaInputDirective,
|
|
3192
|
+
NameBoxComponent,
|
|
3193
|
+
SheetsBarComponent,
|
|
3194
|
+
SpreadsheetBoldDirective,
|
|
3195
|
+
SpreadsheetItalicDirective,
|
|
3196
|
+
SpreadsheetUnderlineDirective,
|
|
3197
|
+
SpreadsheetLoadFileComponent,
|
|
3198
|
+
SpreadsheetSaveFileDirective,
|
|
3199
|
+
SpreadsheetFormatDirective,
|
|
3200
|
+
SpreadsheetUndoDirective,
|
|
3201
|
+
SpreadsheetRedoDirective,
|
|
3202
|
+
SpreadsheetFontFamilyComponent,
|
|
3203
|
+
SpreadsheetFontSizeComponent,
|
|
3204
|
+
SpreadsheetBackColorComponent,
|
|
3205
|
+
SpreadsheetForeColorComponent,
|
|
3206
|
+
SpreadsheetGridLinesDirective,
|
|
3207
|
+
SpreadsheetAddColumnLeftButtonDirective,
|
|
3208
|
+
SpreadsheetAddColumnRightButtonDirective,
|
|
3209
|
+
SpreadsheetAddRowAboveButtonDirective,
|
|
3210
|
+
SpreadsheetAddRowBelowButtonDirective,
|
|
3211
|
+
SpreadsheetDeleteColumnButtonDirective,
|
|
3212
|
+
SpreadsheetDeleteRowButtonDirective,
|
|
3213
|
+
SpreadsheetTextAlignDirective,
|
|
3214
|
+
SpreadsheetTextWrapDirective,
|
|
3215
|
+
FontFamilyDropDownListComponent,
|
|
3216
|
+
FontSizeDropDownListComponent,
|
|
3217
|
+
DialogContentComponent,
|
|
3218
|
+
MainMenuDirective,
|
|
3219
|
+
ActionDialogComponent,
|
|
3220
|
+
RemoveDirective
|
|
3221
|
+
];
|
|
3222
|
+
const EXPORTS = [
|
|
3223
|
+
SpreadsheetComponent,
|
|
3224
|
+
CustomMessagesComponent,
|
|
3225
|
+
SpreadsheetBoldDirective,
|
|
3226
|
+
SpreadsheetItalicDirective,
|
|
3227
|
+
SpreadsheetUnderlineDirective,
|
|
3228
|
+
SpreadsheetLoadFileComponent,
|
|
3229
|
+
SpreadsheetSaveFileDirective,
|
|
3230
|
+
SpreadsheetFormatDirective,
|
|
3231
|
+
SpreadsheetUndoDirective,
|
|
3232
|
+
SpreadsheetRedoDirective,
|
|
3233
|
+
SpreadsheetFontFamilyComponent,
|
|
3234
|
+
SpreadsheetFontSizeComponent,
|
|
3235
|
+
SpreadsheetBackColorComponent,
|
|
3236
|
+
SpreadsheetForeColorComponent,
|
|
3237
|
+
SpreadsheetGridLinesDirective,
|
|
3238
|
+
SpreadsheetAddColumnLeftButtonDirective,
|
|
3239
|
+
SpreadsheetAddColumnRightButtonDirective,
|
|
3240
|
+
SpreadsheetAddRowAboveButtonDirective,
|
|
3241
|
+
SpreadsheetAddRowBelowButtonDirective,
|
|
3242
|
+
SpreadsheetDeleteColumnButtonDirective,
|
|
3243
|
+
SpreadsheetDeleteRowButtonDirective,
|
|
3244
|
+
SpreadsheetTextAlignDirective,
|
|
3245
|
+
SpreadsheetTextWrapDirective
|
|
3246
|
+
];
|
|
3247
|
+
/**
|
|
3248
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
|
3249
|
+
* definition for the Spreadsheet component.
|
|
3250
|
+
*/
|
|
3251
|
+
class SpreadsheetModule {
|
|
3252
|
+
}
|
|
3253
|
+
SpreadsheetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3254
|
+
SpreadsheetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetModule, declarations: [SpreadsheetComponent,
|
|
3255
|
+
MessagesDirective,
|
|
3256
|
+
LocalizedMessagesDirective,
|
|
3257
|
+
CustomMessagesComponent,
|
|
3258
|
+
FormulaListComponent,
|
|
3259
|
+
FormulaInputDirective,
|
|
3260
|
+
NameBoxComponent,
|
|
3261
|
+
SheetsBarComponent,
|
|
3262
|
+
SpreadsheetBoldDirective,
|
|
3263
|
+
SpreadsheetItalicDirective,
|
|
3264
|
+
SpreadsheetUnderlineDirective,
|
|
3265
|
+
SpreadsheetLoadFileComponent,
|
|
3266
|
+
SpreadsheetSaveFileDirective,
|
|
3267
|
+
SpreadsheetFormatDirective,
|
|
3268
|
+
SpreadsheetUndoDirective,
|
|
3269
|
+
SpreadsheetRedoDirective,
|
|
3270
|
+
SpreadsheetFontFamilyComponent,
|
|
3271
|
+
SpreadsheetFontSizeComponent,
|
|
3272
|
+
SpreadsheetBackColorComponent,
|
|
3273
|
+
SpreadsheetForeColorComponent,
|
|
3274
|
+
SpreadsheetGridLinesDirective,
|
|
3275
|
+
SpreadsheetAddColumnLeftButtonDirective,
|
|
3276
|
+
SpreadsheetAddColumnRightButtonDirective,
|
|
3277
|
+
SpreadsheetAddRowAboveButtonDirective,
|
|
3278
|
+
SpreadsheetAddRowBelowButtonDirective,
|
|
3279
|
+
SpreadsheetDeleteColumnButtonDirective,
|
|
3280
|
+
SpreadsheetDeleteRowButtonDirective,
|
|
3281
|
+
SpreadsheetTextAlignDirective,
|
|
3282
|
+
SpreadsheetTextWrapDirective,
|
|
3283
|
+
FontFamilyDropDownListComponent,
|
|
3284
|
+
FontSizeDropDownListComponent,
|
|
3285
|
+
DialogContentComponent,
|
|
3286
|
+
MainMenuDirective,
|
|
3287
|
+
ActionDialogComponent,
|
|
3288
|
+
RemoveDirective], imports: [CommonModule,
|
|
3289
|
+
ButtonsModule,
|
|
3290
|
+
ComboBoxModule,
|
|
3291
|
+
DropDownListModule,
|
|
3292
|
+
DialogModule,
|
|
3293
|
+
EventsModule,
|
|
3294
|
+
IconsModule,
|
|
3295
|
+
IntlModule,
|
|
3296
|
+
MenuModule,
|
|
3297
|
+
PopupModule,
|
|
3298
|
+
TabStripModule,
|
|
3299
|
+
ToolBarModule,
|
|
3300
|
+
InputsModule,
|
|
3301
|
+
WatermarkModule,
|
|
3302
|
+
LabelModule], exports: [SpreadsheetComponent,
|
|
3303
|
+
CustomMessagesComponent,
|
|
3304
|
+
SpreadsheetBoldDirective,
|
|
3305
|
+
SpreadsheetItalicDirective,
|
|
3306
|
+
SpreadsheetUnderlineDirective,
|
|
3307
|
+
SpreadsheetLoadFileComponent,
|
|
3308
|
+
SpreadsheetSaveFileDirective,
|
|
3309
|
+
SpreadsheetFormatDirective,
|
|
3310
|
+
SpreadsheetUndoDirective,
|
|
3311
|
+
SpreadsheetRedoDirective,
|
|
3312
|
+
SpreadsheetFontFamilyComponent,
|
|
3313
|
+
SpreadsheetFontSizeComponent,
|
|
3314
|
+
SpreadsheetBackColorComponent,
|
|
3315
|
+
SpreadsheetForeColorComponent,
|
|
3316
|
+
SpreadsheetGridLinesDirective,
|
|
3317
|
+
SpreadsheetAddColumnLeftButtonDirective,
|
|
3318
|
+
SpreadsheetAddColumnRightButtonDirective,
|
|
3319
|
+
SpreadsheetAddRowAboveButtonDirective,
|
|
3320
|
+
SpreadsheetAddRowBelowButtonDirective,
|
|
3321
|
+
SpreadsheetDeleteColumnButtonDirective,
|
|
3322
|
+
SpreadsheetDeleteRowButtonDirective,
|
|
3323
|
+
SpreadsheetTextAlignDirective,
|
|
3324
|
+
SpreadsheetTextWrapDirective] });
|
|
3325
|
+
SpreadsheetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetModule, imports: [[
|
|
3326
|
+
CommonModule,
|
|
3327
|
+
ButtonsModule,
|
|
3328
|
+
ComboBoxModule,
|
|
3329
|
+
DropDownListModule,
|
|
3330
|
+
DialogModule,
|
|
3331
|
+
EventsModule,
|
|
3332
|
+
IconsModule,
|
|
3333
|
+
IntlModule,
|
|
3334
|
+
MenuModule,
|
|
3335
|
+
PopupModule,
|
|
3336
|
+
TabStripModule,
|
|
3337
|
+
ToolBarModule,
|
|
3338
|
+
InputsModule,
|
|
3339
|
+
WatermarkModule,
|
|
3340
|
+
LabelModule
|
|
3341
|
+
]] });
|
|
3342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetModule, decorators: [{
|
|
3343
|
+
type: NgModule,
|
|
3344
|
+
args: [{
|
|
3345
|
+
declarations: [DIRECTIVES],
|
|
3346
|
+
exports: [EXPORTS],
|
|
3347
|
+
imports: [
|
|
3348
|
+
CommonModule,
|
|
3349
|
+
ButtonsModule,
|
|
3350
|
+
ComboBoxModule,
|
|
3351
|
+
DropDownListModule,
|
|
3352
|
+
DialogModule,
|
|
3353
|
+
EventsModule,
|
|
3354
|
+
IconsModule,
|
|
3355
|
+
IntlModule,
|
|
3356
|
+
MenuModule,
|
|
3357
|
+
PopupModule,
|
|
3358
|
+
TabStripModule,
|
|
3359
|
+
ToolBarModule,
|
|
3360
|
+
InputsModule,
|
|
3361
|
+
WatermarkModule,
|
|
3362
|
+
LabelModule
|
|
3363
|
+
]
|
|
3364
|
+
}]
|
|
3365
|
+
}] });
|
|
3366
|
+
|
|
3367
|
+
/**
|
|
3368
|
+
* Generated bundle index. Do not edit.
|
|
3369
|
+
*/
|
|
3370
|
+
|
|
3371
|
+
export { CustomMessagesComponent, FormulaInputDirective, FormulaListComponent, NameBoxComponent, SheetsBarComponent, SpreadsheetAddColumnLeftButtonDirective, SpreadsheetAddColumnRightButtonDirective, SpreadsheetAddRowAboveButtonDirective, SpreadsheetAddRowBelowButtonDirective, SpreadsheetBackColorComponent, SpreadsheetBoldDirective, SpreadsheetComponent, SpreadsheetDeleteColumnButtonDirective, SpreadsheetDeleteRowButtonDirective, SpreadsheetFontFamilyComponent, SpreadsheetFontSizeComponent, SpreadsheetForeColorComponent, SpreadsheetFormatDirective, SpreadsheetGridLinesDirective, SpreadsheetItalicDirective, SpreadsheetLoadFileComponent, SpreadsheetModule, SpreadsheetRedoDirective, SpreadsheetSaveFileDirective, SpreadsheetTextAlignDirective as SpreadsheetTextAlignComponent, SpreadsheetTextWrapDirective, SpreadsheetUnderlineDirective, SpreadsheetUndoDirective };
|
|
3372
|
+
|