@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,42 @@
|
|
|
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 { Component } from '@angular/core';
|
|
6
|
+
import { DropDownListBase } from '../shared/spreadsheet-dropdownlist.base';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "@progress/kendo-angular-dropdowns";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export class FontSizeDropDownListComponent extends DropDownListBase {
|
|
13
|
+
}
|
|
14
|
+
FontSizeDropDownListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FontSizeDropDownListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
15
|
+
FontSizeDropDownListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: FontSizeDropDownListComponent, selector: "kendo-spreadsheet-fontsize-dropdownlist", usesInheritance: true, ngImport: i0, template: `
|
|
16
|
+
<kendo-dropdownlist
|
|
17
|
+
#element
|
|
18
|
+
[data]="data"
|
|
19
|
+
[(value)]="value"
|
|
20
|
+
[attr.title]="title"
|
|
21
|
+
[tabindex]="tabindex"
|
|
22
|
+
(valueChange)="onValueChange($event)"
|
|
23
|
+
[leftRightArrowsNavigation]="false"
|
|
24
|
+
[fillMode]="fillMode"></kendo-dropdownlist>
|
|
25
|
+
`, isInline: true, components: [{ type: i1.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"] }] });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: FontSizeDropDownListComponent, decorators: [{
|
|
27
|
+
type: Component,
|
|
28
|
+
args: [{
|
|
29
|
+
selector: 'kendo-spreadsheet-fontsize-dropdownlist',
|
|
30
|
+
template: `
|
|
31
|
+
<kendo-dropdownlist
|
|
32
|
+
#element
|
|
33
|
+
[data]="data"
|
|
34
|
+
[(value)]="value"
|
|
35
|
+
[attr.title]="title"
|
|
36
|
+
[tabindex]="tabindex"
|
|
37
|
+
(valueChange)="onValueChange($event)"
|
|
38
|
+
[leftRightArrowsNavigation]="false"
|
|
39
|
+
[fillMode]="fillMode"></kendo-dropdownlist>
|
|
40
|
+
`
|
|
41
|
+
}]
|
|
42
|
+
}] });
|
|
@@ -0,0 +1,92 @@
|
|
|
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 { Component, forwardRef, Inject } from '@angular/core';
|
|
6
|
+
import { ToolBarComponent, ToolBarToolComponent } from '@progress/kendo-angular-toolbar';
|
|
7
|
+
import { SpreadsheetLocalizationService } from '../../localization/spreadsheet-localization.service';
|
|
8
|
+
import { SpreadsheetService } from '../../common/spreadsheet.service';
|
|
9
|
+
import { SpreadsheetToolsService } from '../tools.service';
|
|
10
|
+
import { SpreadsheetDropDownToolBase } from '../shared/spreadsheet-dropdown-tools-base';
|
|
11
|
+
import { DialogService } from '@progress/kendo-angular-dialog';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "@progress/kendo-angular-dialog";
|
|
14
|
+
import * as i2 from "../../localization/spreadsheet-localization.service";
|
|
15
|
+
import * as i3 from "../../common/spreadsheet.service";
|
|
16
|
+
import * as i4 from "../tools.service";
|
|
17
|
+
import * as i5 from "./font-size-dropdownlist.component";
|
|
18
|
+
import * as i6 from "@progress/kendo-angular-icons";
|
|
19
|
+
import * as i7 from "@angular/common";
|
|
20
|
+
import * as i8 from "@progress/kendo-angular-toolbar";
|
|
21
|
+
/**
|
|
22
|
+
* A component which configures an existing `DropDownListComponent` as a Spreadsheet tool
|
|
23
|
+
* ([see example](ToDo).
|
|
24
|
+
* The component associates a `kendo-toolbar-dropdownlist` with a Spreadsheet command that changes the font size of a content block and
|
|
25
|
+
* automatically defines the options of the drop-down list and sets its values ([see example](ToDo).
|
|
26
|
+
*
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
export class SpreadsheetFontSizeComponent extends SpreadsheetDropDownToolBase {
|
|
30
|
+
constructor(dialogService, localization, spreadsheetService, toolsService, toolbar) {
|
|
31
|
+
super('fontSize', dialogService, localization, spreadsheetService, toolsService, toolbar);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
SpreadsheetFontSizeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFontSizeComponent, deps: [{ token: i1.DialogService }, { token: i2.SpreadsheetLocalizationService }, { token: i3.SpreadsheetService }, { token: i4.SpreadsheetToolsService }, { token: ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
+
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: `
|
|
36
|
+
<ng-template #toolbarTemplate>
|
|
37
|
+
<kendo-spreadsheet-fontsize-dropdownlist
|
|
38
|
+
#element
|
|
39
|
+
[data]="data"
|
|
40
|
+
[(value)]="value"
|
|
41
|
+
[title]="messageFor(command)"
|
|
42
|
+
[tabindex]="tabindex"
|
|
43
|
+
(valueChange)="onValueChange($event)"></kendo-spreadsheet-fontsize-dropdownlist>
|
|
44
|
+
</ng-template>
|
|
45
|
+
<ng-template #popupTemplate>
|
|
46
|
+
<div #popupButton
|
|
47
|
+
[tabindex]="tabindex"
|
|
48
|
+
role="menuitem"
|
|
49
|
+
class="k-item k-menu-item"
|
|
50
|
+
(click)="openDialog()">
|
|
51
|
+
<span
|
|
52
|
+
class="k-link k-menu-link">
|
|
53
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
54
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
55
|
+
</span>
|
|
56
|
+
</div>
|
|
57
|
+
</ng-template>
|
|
58
|
+
`, isInline: true, components: [{ type: i5.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"] }] });
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFontSizeComponent, decorators: [{
|
|
60
|
+
type: Component,
|
|
61
|
+
args: [{
|
|
62
|
+
providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => SpreadsheetFontSizeComponent) }],
|
|
63
|
+
selector: 'kendo-toolbar-dropdownlist[kendoSpreadsheetFontSize]',
|
|
64
|
+
template: `
|
|
65
|
+
<ng-template #toolbarTemplate>
|
|
66
|
+
<kendo-spreadsheet-fontsize-dropdownlist
|
|
67
|
+
#element
|
|
68
|
+
[data]="data"
|
|
69
|
+
[(value)]="value"
|
|
70
|
+
[title]="messageFor(command)"
|
|
71
|
+
[tabindex]="tabindex"
|
|
72
|
+
(valueChange)="onValueChange($event)"></kendo-spreadsheet-fontsize-dropdownlist>
|
|
73
|
+
</ng-template>
|
|
74
|
+
<ng-template #popupTemplate>
|
|
75
|
+
<div #popupButton
|
|
76
|
+
[tabindex]="tabindex"
|
|
77
|
+
role="menuitem"
|
|
78
|
+
class="k-item k-menu-item"
|
|
79
|
+
(click)="openDialog()">
|
|
80
|
+
<span
|
|
81
|
+
class="k-link k-menu-link">
|
|
82
|
+
<kendo-icon-wrapper [name]="icon" [svgIcon]="svgIcon"></kendo-icon-wrapper>
|
|
83
|
+
<span *ngIf="messageFor(command)" class="k-menu-link-text">{{messageFor(command)}}</span>
|
|
84
|
+
</span>
|
|
85
|
+
</div>
|
|
86
|
+
</ng-template>
|
|
87
|
+
`
|
|
88
|
+
}]
|
|
89
|
+
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.SpreadsheetLocalizationService }, { type: i3.SpreadsheetService }, { type: i4.SpreadsheetToolsService }, { type: i8.ToolBarComponent, decorators: [{
|
|
90
|
+
type: Inject,
|
|
91
|
+
args: [ToolBarComponent]
|
|
92
|
+
}] }]; } });
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive } from '@angular/core';
|
|
6
|
+
import { ToolBarDropDownButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
7
|
+
import { SpreadsheetLocalizationService } from '../localization/spreadsheet-localization.service';
|
|
8
|
+
import { SpreadsheetService } from '../common/spreadsheet.service';
|
|
9
|
+
import { commandIcons, commandSVGIcons } from './shared/command-icons';
|
|
10
|
+
import { FORMATS } from './shared/constants';
|
|
11
|
+
import { Subscription } from 'rxjs';
|
|
12
|
+
import { SpreadsheetToolsService } from './tools.service';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "@progress/kendo-angular-toolbar";
|
|
15
|
+
import * as i2 from "../localization/spreadsheet-localization.service";
|
|
16
|
+
import * as i3 from "../common/spreadsheet.service";
|
|
17
|
+
import * as i4 from "./tools.service";
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
export class SpreadsheetFormatDirective {
|
|
22
|
+
constructor(host, localization, spreadsheetService, toolsService) {
|
|
23
|
+
this.host = host;
|
|
24
|
+
this.spreadsheetService = spreadsheetService;
|
|
25
|
+
this.toolsService = toolsService;
|
|
26
|
+
this.data = FORMATS;
|
|
27
|
+
this.commandName = 'format';
|
|
28
|
+
this.subs = new Subscription();
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
this.onItemClick = (item) => {
|
|
33
|
+
const value = item.value || null;
|
|
34
|
+
const options = {
|
|
35
|
+
command: 'PropertyChangeCommand', options: { property: this.commandName, value }
|
|
36
|
+
};
|
|
37
|
+
this.spreadsheetService.spreadsheet.executeCommand(options);
|
|
38
|
+
};
|
|
39
|
+
host.svgIcon = commandSVGIcons[this.commandName];
|
|
40
|
+
host.icon = commandIcons[this.commandName];
|
|
41
|
+
host.arrowIcon = true;
|
|
42
|
+
host.fillMode = 'flat';
|
|
43
|
+
host.data = this.data;
|
|
44
|
+
this.subs.add(host.itemClick.subscribe((e) => this.onItemClick(e)));
|
|
45
|
+
host.title = localization.get(this.commandName);
|
|
46
|
+
}
|
|
47
|
+
ngOnInit() {
|
|
48
|
+
this.subs.add(this.toolsService.stateChange.subscribe(state => this.host.data.forEach(i => i.cssClass = i.value === state[this.commandName] ? 'k-selected' : '')));
|
|
49
|
+
}
|
|
50
|
+
ngOnDestroy() {
|
|
51
|
+
this.subs.unsubscribe();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
SpreadsheetFormatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFormatDirective, deps: [{ token: i1.ToolBarDropDownButtonComponent }, { token: i2.SpreadsheetLocalizationService }, { token: i3.SpreadsheetService }, { token: i4.SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
55
|
+
SpreadsheetFormatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetFormatDirective, selector: "[kendoSpreadsheetFormat]", ngImport: i0 });
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetFormatDirective, decorators: [{
|
|
57
|
+
type: Directive,
|
|
58
|
+
args: [{
|
|
59
|
+
selector: '[kendoSpreadsheetFormat]',
|
|
60
|
+
}]
|
|
61
|
+
}], ctorParameters: function () { return [{ type: i1.ToolBarDropDownButtonComponent }, { type: i2.SpreadsheetLocalizationService }, { type: i3.SpreadsheetService }, { type: i4.SpreadsheetToolsService }]; } });
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive } from '@angular/core';
|
|
6
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
7
|
+
import { SpreadsheetLocalizationService } from '../localization/spreadsheet-localization.service';
|
|
8
|
+
import { SpreadsheetService } from '../common/spreadsheet.service';
|
|
9
|
+
import { SpreadsheetToolsService } from './tools.service';
|
|
10
|
+
import { SpreadsheetCommandButton } from './shared/spreadsheet-command-button';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "@progress/kendo-angular-toolbar";
|
|
13
|
+
import * as i2 from "../localization/spreadsheet-localization.service";
|
|
14
|
+
import * as i3 from "../common/spreadsheet.service";
|
|
15
|
+
import * as i4 from "./tools.service";
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export class SpreadsheetGridLinesDirective extends SpreadsheetCommandButton {
|
|
20
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
21
|
+
super('gridLines', button, localization, spreadsheetService, toolsService, {
|
|
22
|
+
command: 'GridLinesChangeCommand',
|
|
23
|
+
options: { property: 'gridLines',
|
|
24
|
+
value: !button.selected
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
clickHandler() {
|
|
29
|
+
const sheet = this.spreadsheetService.spreadsheet.activeSheet();
|
|
30
|
+
if (sheet) {
|
|
31
|
+
const value = !sheet.showGridLines();
|
|
32
|
+
const options = {
|
|
33
|
+
command: 'GridLinesChangeCommand', options: { property: 'gridLines', value }
|
|
34
|
+
};
|
|
35
|
+
this.spreadsheetService.spreadsheet.executeCommand(options);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
SpreadsheetGridLinesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetGridLinesDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.SpreadsheetLocalizationService }, { token: i3.SpreadsheetService }, { token: i4.SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
40
|
+
SpreadsheetGridLinesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetGridLinesDirective, selector: "kendo-toolbar-button[kendoSpreadsheetGridLines]", usesInheritance: true, ngImport: i0 });
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetGridLinesDirective, decorators: [{
|
|
42
|
+
type: Directive,
|
|
43
|
+
args: [{
|
|
44
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetGridLines]'
|
|
45
|
+
}]
|
|
46
|
+
}], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.SpreadsheetLocalizationService }, { type: i3.SpreadsheetService }, { type: i4.SpreadsheetToolsService }]; } });
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive } from '@angular/core';
|
|
6
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
7
|
+
import { SpreadsheetLocalizationService } from '../../localization/spreadsheet-localization.service';
|
|
8
|
+
import { SpreadsheetService } from '../../common/spreadsheet.service';
|
|
9
|
+
import { SpreadsheetToolsService } from '.././tools.service';
|
|
10
|
+
import { SpreadsheetCommandButton } from '.././shared/spreadsheet-command-button';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "@progress/kendo-angular-toolbar";
|
|
13
|
+
import * as i2 from "../../localization/spreadsheet-localization.service";
|
|
14
|
+
import * as i3 from "../../common/spreadsheet.service";
|
|
15
|
+
import * as i4 from ".././tools.service";
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export class SpreadsheetRedoDirective extends SpreadsheetCommandButton {
|
|
20
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
21
|
+
super('redo', button, localization, spreadsheetService, toolsService, {
|
|
22
|
+
options: { property: 'redo' }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
clickHandler() {
|
|
26
|
+
this.spreadsheetService.spreadsheet.workbook.undoRedoStack['redo']();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
SpreadsheetRedoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetRedoDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.SpreadsheetLocalizationService }, { token: i3.SpreadsheetService }, { token: i4.SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
30
|
+
SpreadsheetRedoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetRedoDirective, selector: "kendo-toolbar-button[kendoSpreadsheetRedo]", usesInheritance: true, ngImport: i0 });
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetRedoDirective, decorators: [{
|
|
32
|
+
type: Directive,
|
|
33
|
+
args: [{
|
|
34
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetRedo]'
|
|
35
|
+
}]
|
|
36
|
+
}], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.SpreadsheetLocalizationService }, { type: i3.SpreadsheetService }, { type: i4.SpreadsheetToolsService }]; } });
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive } from '@angular/core';
|
|
6
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
7
|
+
import { SpreadsheetLocalizationService } from '../../localization/spreadsheet-localization.service';
|
|
8
|
+
import { SpreadsheetService } from '../../common/spreadsheet.service';
|
|
9
|
+
import { SpreadsheetToolsService } from '.././tools.service';
|
|
10
|
+
import { SpreadsheetCommandButton } from '.././shared/spreadsheet-command-button';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "@progress/kendo-angular-toolbar";
|
|
13
|
+
import * as i2 from "../../localization/spreadsheet-localization.service";
|
|
14
|
+
import * as i3 from "../../common/spreadsheet.service";
|
|
15
|
+
import * as i4 from ".././tools.service";
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export class SpreadsheetUndoDirective extends SpreadsheetCommandButton {
|
|
20
|
+
constructor(button, localization, spreadsheetService, toolsService) {
|
|
21
|
+
super('undo', button, localization, spreadsheetService, toolsService, {
|
|
22
|
+
options: { property: 'undo' }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
clickHandler() {
|
|
26
|
+
this.spreadsheetService.spreadsheet.workbook.undoRedoStack['undo']();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
SpreadsheetUndoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetUndoDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.SpreadsheetLocalizationService }, { token: i3.SpreadsheetService }, { token: i4.SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
30
|
+
SpreadsheetUndoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetUndoDirective, selector: "kendo-toolbar-button[kendoSpreadsheetUndo]", usesInheritance: true, ngImport: i0 });
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetUndoDirective, decorators: [{
|
|
32
|
+
type: Directive,
|
|
33
|
+
args: [{
|
|
34
|
+
selector: 'kendo-toolbar-button[kendoSpreadsheetUndo]'
|
|
35
|
+
}]
|
|
36
|
+
}], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.SpreadsheetLocalizationService }, { type: i3.SpreadsheetService }, { type: i4.SpreadsheetToolsService }]; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
export { SpreadsheetBackColorComponent } from './colorpicker/spreadsheet-backcolor.component';
|
|
6
|
+
export { SpreadsheetForeColorComponent } from './colorpicker/spreadsheet-forecolor.component';
|
|
7
|
+
export { SpreadsheetFontFamilyComponent } from './font-family/spreadsheet-fontfamily-tool.component';
|
|
8
|
+
export { SpreadsheetFontSizeComponent } from './font-size/spreadsheet-fontsize-tool.component';
|
|
9
|
+
export { SpreadsheetRedoDirective } from './history/redo-tool';
|
|
10
|
+
export { SpreadsheetUndoDirective } from './history/undo-tool';
|
|
11
|
+
export { SpreadsheetBoldDirective } from './typographical-emphasis/bold-tool.directive';
|
|
12
|
+
export { SpreadsheetItalicDirective } from './typographical-emphasis/italic-tool.directive';
|
|
13
|
+
export { SpreadsheetUnderlineDirective } from './typographical-emphasis/underline-tool.directive';
|
|
14
|
+
export { SpreadsheetTextAlignDirective as SpreadsheetTextAlignComponent } from './align-tool.directive';
|
|
15
|
+
export { SpreadsheetFormatDirective } from './format-tool.directive';
|
|
16
|
+
export { SpreadsheetGridLinesDirective } from './gridlines-tool.directive';
|
|
17
|
+
export { SpreadsheetLoadFileComponent } from './load-file.component';
|
|
18
|
+
export { SpreadsheetSaveFileDirective } from './save-file-tool.directive';
|
|
19
|
+
export { SpreadsheetTextWrapDirective } from './text-wrap-tool.directive';
|
|
20
|
+
export * from './tables';
|
|
@@ -0,0 +1,186 @@
|
|
|
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 { Component, ElementRef, Inject, TemplateRef, ViewChild, forwardRef } from '@angular/core';
|
|
6
|
+
import { ToolBarComponent, ToolBarToolComponent } from '@progress/kendo-angular-toolbar';
|
|
7
|
+
import { SpreadsheetService } from '../common/spreadsheet.service';
|
|
8
|
+
import { commandIcons, commandSVGIcons } from './shared/command-icons';
|
|
9
|
+
import { SpreadsheetLocalizationService } from '../localization/spreadsheet-localization.service';
|
|
10
|
+
import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "../localization/spreadsheet-localization.service";
|
|
13
|
+
import * as i2 from "../common/spreadsheet.service";
|
|
14
|
+
import * as i3 from "@progress/kendo-angular-buttons";
|
|
15
|
+
import * as i4 from "@progress/kendo-angular-icons";
|
|
16
|
+
import * as i5 from "@progress/kendo-angular-toolbar";
|
|
17
|
+
export class SpreadsheetLoadFileComponent extends ToolBarToolComponent {
|
|
18
|
+
constructor(localization, spreadsheetService, toolbar) {
|
|
19
|
+
super();
|
|
20
|
+
this.localization = localization;
|
|
21
|
+
this.spreadsheetService = spreadsheetService;
|
|
22
|
+
this.toolbar = toolbar;
|
|
23
|
+
this.icon = commandIcons['folderOpen'];
|
|
24
|
+
this.svgIcon = commandSVGIcons['folderOpen'];
|
|
25
|
+
this.tabindex = -1;
|
|
26
|
+
this.onFileSelect = (e) => {
|
|
27
|
+
const file = e.target.files[0];
|
|
28
|
+
if (file) {
|
|
29
|
+
this.spreadsheetService.spreadsheet.fromFile(file);
|
|
30
|
+
e.target.value = null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
messageFor(key) {
|
|
38
|
+
return this.localization.get(key);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
canFocus() {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
focus() {
|
|
50
|
+
this.tabindex = 0;
|
|
51
|
+
if (this.overflows) {
|
|
52
|
+
this.overflowButtonElement.nativeElement.focus();
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.button.focus();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
handleKey() {
|
|
62
|
+
this.tabindex = -1;
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
SpreadsheetLoadFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetLoadFileComponent, deps: [{ token: i1.SpreadsheetLocalizationService }, { token: i2.SpreadsheetService }, { token: ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
+
SpreadsheetLoadFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetLoadFileComponent, selector: "kendo-spreadsheet-load-file-tool", providers: [
|
|
68
|
+
{
|
|
69
|
+
provide: ToolBarToolComponent,
|
|
70
|
+
useExisting: forwardRef(() => SpreadsheetLoadFileComponent),
|
|
71
|
+
},
|
|
72
|
+
], 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: `
|
|
73
|
+
<ng-template #toolbarTemplate>
|
|
74
|
+
<button
|
|
75
|
+
#button
|
|
76
|
+
type="button"
|
|
77
|
+
kendoButton
|
|
78
|
+
[title]="messageFor('loadFile')"
|
|
79
|
+
fillMode="flat"
|
|
80
|
+
[icon]="icon"
|
|
81
|
+
[svgIcon]="svgIcon"
|
|
82
|
+
(click)="fileSelectEl.click()"></button>
|
|
83
|
+
<input
|
|
84
|
+
#fileSelectEl
|
|
85
|
+
type="file"
|
|
86
|
+
(change)="onFileSelect($event)"
|
|
87
|
+
[style.display]="'none'"
|
|
88
|
+
aria-hidden="true"
|
|
89
|
+
accept=".xlsx,.XLSX" />
|
|
90
|
+
</ng-template>
|
|
91
|
+
<ng-template #popupTemplate>
|
|
92
|
+
<div
|
|
93
|
+
#overflowButton
|
|
94
|
+
tabindex="-1"
|
|
95
|
+
role="menuitem"
|
|
96
|
+
class="k-item k-menu-item"
|
|
97
|
+
(click)="toolbar.toggle(false); popupFileSelectEl.click()">
|
|
98
|
+
<span
|
|
99
|
+
class="k-link k-menu-link">
|
|
100
|
+
<kendo-icon-wrapper
|
|
101
|
+
[name]="icon"
|
|
102
|
+
[svgIcon]="svgIcon"
|
|
103
|
+
></kendo-icon-wrapper>
|
|
104
|
+
<span class="k-menu-link-text">{{messageFor('loadFile')}}</span>
|
|
105
|
+
</span>
|
|
106
|
+
<input
|
|
107
|
+
#popupFileSelectEl
|
|
108
|
+
type="file"
|
|
109
|
+
(change)="onFileSelect($event)"
|
|
110
|
+
[style.display]="'none'"
|
|
111
|
+
aria-hidden="true"
|
|
112
|
+
accept=".xlsx,.XLSX" />
|
|
113
|
+
</div>
|
|
114
|
+
</ng-template>
|
|
115
|
+
`, isInline: true, components: [{ type: i3.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.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }] });
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetLoadFileComponent, decorators: [{
|
|
117
|
+
type: Component,
|
|
118
|
+
args: [{
|
|
119
|
+
selector: 'kendo-spreadsheet-load-file-tool',
|
|
120
|
+
providers: [
|
|
121
|
+
{
|
|
122
|
+
provide: ToolBarToolComponent,
|
|
123
|
+
useExisting: forwardRef(() => SpreadsheetLoadFileComponent),
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
template: `
|
|
127
|
+
<ng-template #toolbarTemplate>
|
|
128
|
+
<button
|
|
129
|
+
#button
|
|
130
|
+
type="button"
|
|
131
|
+
kendoButton
|
|
132
|
+
[title]="messageFor('loadFile')"
|
|
133
|
+
fillMode="flat"
|
|
134
|
+
[icon]="icon"
|
|
135
|
+
[svgIcon]="svgIcon"
|
|
136
|
+
(click)="fileSelectEl.click()"></button>
|
|
137
|
+
<input
|
|
138
|
+
#fileSelectEl
|
|
139
|
+
type="file"
|
|
140
|
+
(change)="onFileSelect($event)"
|
|
141
|
+
[style.display]="'none'"
|
|
142
|
+
aria-hidden="true"
|
|
143
|
+
accept=".xlsx,.XLSX" />
|
|
144
|
+
</ng-template>
|
|
145
|
+
<ng-template #popupTemplate>
|
|
146
|
+
<div
|
|
147
|
+
#overflowButton
|
|
148
|
+
tabindex="-1"
|
|
149
|
+
role="menuitem"
|
|
150
|
+
class="k-item k-menu-item"
|
|
151
|
+
(click)="toolbar.toggle(false); popupFileSelectEl.click()">
|
|
152
|
+
<span
|
|
153
|
+
class="k-link k-menu-link">
|
|
154
|
+
<kendo-icon-wrapper
|
|
155
|
+
[name]="icon"
|
|
156
|
+
[svgIcon]="svgIcon"
|
|
157
|
+
></kendo-icon-wrapper>
|
|
158
|
+
<span class="k-menu-link-text">{{messageFor('loadFile')}}</span>
|
|
159
|
+
</span>
|
|
160
|
+
<input
|
|
161
|
+
#popupFileSelectEl
|
|
162
|
+
type="file"
|
|
163
|
+
(change)="onFileSelect($event)"
|
|
164
|
+
[style.display]="'none'"
|
|
165
|
+
aria-hidden="true"
|
|
166
|
+
accept=".xlsx,.XLSX" />
|
|
167
|
+
</div>
|
|
168
|
+
</ng-template>
|
|
169
|
+
`
|
|
170
|
+
}]
|
|
171
|
+
}], ctorParameters: function () { return [{ type: i1.SpreadsheetLocalizationService }, { type: i2.SpreadsheetService }, { type: i5.ToolBarComponent, decorators: [{
|
|
172
|
+
type: Inject,
|
|
173
|
+
args: [ToolBarComponent]
|
|
174
|
+
}] }]; }, propDecorators: { toolbarTemplate: [{
|
|
175
|
+
type: ViewChild,
|
|
176
|
+
args: ['toolbarTemplate', { static: true }]
|
|
177
|
+
}], popupTemplate: [{
|
|
178
|
+
type: ViewChild,
|
|
179
|
+
args: ['popupTemplate', { static: true }]
|
|
180
|
+
}], overflowButtonElement: [{
|
|
181
|
+
type: ViewChild,
|
|
182
|
+
args: ['overflowButton', { read: ElementRef, static: false }]
|
|
183
|
+
}], button: [{
|
|
184
|
+
type: ViewChild,
|
|
185
|
+
args: ['button']
|
|
186
|
+
}] } });
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive } from '@angular/core';
|
|
6
|
+
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
7
|
+
import { SpreadsheetService } from '../common/spreadsheet.service';
|
|
8
|
+
import { commandIcons, commandSVGIcons } from './shared/command-icons';
|
|
9
|
+
import { Subscription } from 'rxjs';
|
|
10
|
+
import { saveAs } from '@progress/kendo-file-saver';
|
|
11
|
+
import { Workbook } from '@progress/kendo-ooxml';
|
|
12
|
+
import { SpreadsheetLocalizationService } from '../localization/spreadsheet-localization.service';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "@progress/kendo-angular-toolbar";
|
|
15
|
+
import * as i2 from "../localization/spreadsheet-localization.service";
|
|
16
|
+
import * as i3 from "../common/spreadsheet.service";
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export class SpreadsheetSaveFileDirective {
|
|
21
|
+
constructor(button, localization, spreadsheetService) {
|
|
22
|
+
this.button = button;
|
|
23
|
+
this.localization = localization;
|
|
24
|
+
this.spreadsheetService = spreadsheetService;
|
|
25
|
+
this.subs = new Subscription();
|
|
26
|
+
}
|
|
27
|
+
ngOnInit() {
|
|
28
|
+
this.button.title = this.localization.get('saveFile');
|
|
29
|
+
this.button.icon = commandIcons['download'];
|
|
30
|
+
this.button.svgIcon = commandSVGIcons['download'];
|
|
31
|
+
this.button.fillMode = 'flat';
|
|
32
|
+
this.subs.add(this.button.click.subscribe(() => {
|
|
33
|
+
const spreadsheet = this.spreadsheetService.spreadsheet;
|
|
34
|
+
if (spreadsheet) {
|
|
35
|
+
spreadsheet.saveAsExcel({
|
|
36
|
+
...spreadsheet.options.excel,
|
|
37
|
+
saveAs,
|
|
38
|
+
Workbook
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
ngOnDestroy() {
|
|
44
|
+
this.subs.unsubscribe();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
SpreadsheetSaveFileDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetSaveFileDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.SpreadsheetLocalizationService }, { token: i3.SpreadsheetService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
48
|
+
SpreadsheetSaveFileDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetSaveFileDirective, selector: "[kendoSpreadsheetSaveFile]", ngImport: i0 });
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetSaveFileDirective, decorators: [{
|
|
50
|
+
type: Directive,
|
|
51
|
+
args: [{ selector: '[kendoSpreadsheetSaveFile]' }]
|
|
52
|
+
}], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.SpreadsheetLocalizationService }, { type: i3.SpreadsheetService }]; } });
|