@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.
Files changed (127) hide show
  1. package/LICENSE.md +11 -0
  2. package/NOTICE.txt +654 -0
  3. package/README.md +32 -0
  4. package/action-bar/formula-input.directive.d.ts +33 -0
  5. package/action-bar/list.component.d.ts +23 -0
  6. package/action-bar/namebox.component.d.ts +30 -0
  7. package/common/main-menu.directive.d.ts +17 -0
  8. package/common/sheet-changes.d.ts +23 -0
  9. package/common/spreadsheet.service.d.ts +28 -0
  10. package/esm2020/action-bar/formula-input.directive.mjs +142 -0
  11. package/esm2020/action-bar/list.component.mjs +75 -0
  12. package/esm2020/action-bar/namebox.component.mjs +110 -0
  13. package/esm2020/common/main-menu.directive.mjs +25 -0
  14. package/esm2020/common/sheet-changes.mjs +5 -0
  15. package/esm2020/common/spreadsheet.service.mjs +42 -0
  16. package/esm2020/index.mjs +12 -0
  17. package/esm2020/localization/custom-messages.component.mjs +42 -0
  18. package/esm2020/localization/localized-messages.directive.mjs +33 -0
  19. package/esm2020/localization/messages.mjs +80 -0
  20. package/esm2020/localization/spreadsheet-localization.service.mjs +31 -0
  21. package/esm2020/models/events.mjs +5 -0
  22. package/esm2020/models/index.mjs +7 -0
  23. package/esm2020/models/main-menu-item.mjs +5 -0
  24. package/esm2020/models/sheet-info.mjs +5 -0
  25. package/esm2020/package-metadata.mjs +15 -0
  26. package/esm2020/progress-kendo-angular-spreadsheet.mjs +8 -0
  27. package/esm2020/sheets-bar/action-dialog.component.mjs +68 -0
  28. package/esm2020/sheets-bar/remove.directive.mjs +25 -0
  29. package/esm2020/sheets-bar/sheets-bar.component.mjs +278 -0
  30. package/esm2020/sheets-bar/utils.mjs +45 -0
  31. package/esm2020/spreadsheet.component.mjs +725 -0
  32. package/esm2020/spreadsheet.module.mjs +235 -0
  33. package/esm2020/tools/align-tool.directive.mjs +58 -0
  34. package/esm2020/tools/colorpicker/spreadsheet-backcolor.component.mjs +98 -0
  35. package/esm2020/tools/colorpicker/spreadsheet-forecolor.component.mjs +98 -0
  36. package/esm2020/tools/font-family/font-family-dropdownlist.component.mjs +57 -0
  37. package/esm2020/tools/font-family/spreadsheet-fontfamily-tool.component.mjs +92 -0
  38. package/esm2020/tools/font-size/font-size-dropdownlist.component.mjs +42 -0
  39. package/esm2020/tools/font-size/spreadsheet-fontsize-tool.component.mjs +92 -0
  40. package/esm2020/tools/format-tool.directive.mjs +61 -0
  41. package/esm2020/tools/gridlines-tool.directive.mjs +46 -0
  42. package/esm2020/tools/history/redo-tool.mjs +36 -0
  43. package/esm2020/tools/history/undo-tool.mjs +36 -0
  44. package/esm2020/tools/index.mjs +20 -0
  45. package/esm2020/tools/load-file.component.mjs +186 -0
  46. package/esm2020/tools/save-file-tool.directive.mjs +52 -0
  47. package/esm2020/tools/shared/command-icons.mjs +71 -0
  48. package/esm2020/tools/shared/commands.mjs +5 -0
  49. package/esm2020/tools/shared/constants.mjs +61 -0
  50. package/esm2020/tools/shared/dialog-content.component.mjs +114 -0
  51. package/esm2020/tools/shared/spreadsheet-command-base.mjs +75 -0
  52. package/esm2020/tools/shared/spreadsheet-command-button.mjs +25 -0
  53. package/esm2020/tools/shared/spreadsheet-dropdown-tools-base.mjs +184 -0
  54. package/esm2020/tools/shared/spreadsheet-dropdownlist.base.mjs +50 -0
  55. package/esm2020/tools/tables/add-column-left-button.directive.mjs +36 -0
  56. package/esm2020/tools/tables/add-column-right-button.directive.mjs +36 -0
  57. package/esm2020/tools/tables/add-row-above-button.directive.mjs +36 -0
  58. package/esm2020/tools/tables/add-row-below-button.directive.mjs +36 -0
  59. package/esm2020/tools/tables/delete-column-button.directive.mjs +34 -0
  60. package/esm2020/tools/tables/delete-row-button.directive.mjs +34 -0
  61. package/esm2020/tools/tables/index.mjs +10 -0
  62. package/esm2020/tools/text-wrap-tool.directive.mjs +47 -0
  63. package/esm2020/tools/tools.service.mjs +60 -0
  64. package/esm2020/tools/typographical-emphasis/bold-tool.directive.mjs +36 -0
  65. package/esm2020/tools/typographical-emphasis/italic-tool.directive.mjs +36 -0
  66. package/esm2020/tools/typographical-emphasis/underline-tool.directive.mjs +36 -0
  67. package/esm2020/tools/utils.mjs +13 -0
  68. package/esm2020/utils.mjs +25 -0
  69. package/fesm2015/progress-kendo-angular-spreadsheet.mjs +3372 -0
  70. package/fesm2020/progress-kendo-angular-spreadsheet.mjs +3382 -0
  71. package/index.d.ts +13 -0
  72. package/localization/custom-messages.component.d.ts +18 -0
  73. package/localization/localized-messages.directive.d.ts +16 -0
  74. package/localization/messages.d.ts +133 -0
  75. package/localization/spreadsheet-localization.service.d.ts +14 -0
  76. package/models/events.d.ts +65 -0
  77. package/models/index.d.ts +7 -0
  78. package/models/main-menu-item.d.ts +19 -0
  79. package/models/sheet-info.d.ts +26 -0
  80. package/package-metadata.d.ts +9 -0
  81. package/package.json +65 -0
  82. package/progress-kendo-angular-spreadsheet.d.ts +9 -0
  83. package/schematics/collection.json +12 -0
  84. package/schematics/ngAdd/index.js +13 -0
  85. package/schematics/ngAdd/schema.json +24 -0
  86. package/sheets-bar/action-dialog.component.d.ts +19 -0
  87. package/sheets-bar/remove.directive.d.ts +13 -0
  88. package/sheets-bar/sheets-bar.component.d.ts +53 -0
  89. package/sheets-bar/utils.d.ts +10 -0
  90. package/spreadsheet.component.d.ts +176 -0
  91. package/spreadsheet.module.d.ts +62 -0
  92. package/tools/align-tool.directive.d.ts +25 -0
  93. package/tools/colorpicker/spreadsheet-backcolor.component.d.ts +20 -0
  94. package/tools/colorpicker/spreadsheet-forecolor.component.d.ts +20 -0
  95. package/tools/font-family/font-family-dropdownlist.component.d.ts +13 -0
  96. package/tools/font-family/spreadsheet-fontfamily-tool.component.d.ts +24 -0
  97. package/tools/font-size/font-size-dropdownlist.component.d.ts +13 -0
  98. package/tools/font-size/spreadsheet-fontsize-tool.component.d.ts +24 -0
  99. package/tools/format-tool.directive.d.ts +36 -0
  100. package/tools/gridlines-tool.directive.d.ts +19 -0
  101. package/tools/history/redo-tool.d.ts +19 -0
  102. package/tools/history/undo-tool.d.ts +19 -0
  103. package/tools/index.d.ts +20 -0
  104. package/tools/load-file.component.d.ts +41 -0
  105. package/tools/save-file-tool.directive.d.ts +22 -0
  106. package/tools/shared/command-icons.d.ts +14 -0
  107. package/tools/shared/commands.d.ts +8 -0
  108. package/tools/shared/constants.d.ts +50 -0
  109. package/tools/shared/dialog-content.component.d.ts +21 -0
  110. package/tools/shared/spreadsheet-command-base.d.ts +29 -0
  111. package/tools/shared/spreadsheet-command-button.d.ts +23 -0
  112. package/tools/shared/spreadsheet-dropdown-tools-base.d.ts +76 -0
  113. package/tools/shared/spreadsheet-dropdownlist.base.d.ts +25 -0
  114. package/tools/tables/add-column-left-button.directive.d.ts +18 -0
  115. package/tools/tables/add-column-right-button.directive.d.ts +18 -0
  116. package/tools/tables/add-row-above-button.directive.d.ts +18 -0
  117. package/tools/tables/add-row-below-button.directive.d.ts +18 -0
  118. package/tools/tables/delete-column-button.directive.d.ts +18 -0
  119. package/tools/tables/delete-row-button.directive.d.ts +18 -0
  120. package/tools/tables/index.d.ts +10 -0
  121. package/tools/text-wrap-tool.directive.d.ts +19 -0
  122. package/tools/tools.service.d.ts +21 -0
  123. package/tools/typographical-emphasis/bold-tool.directive.d.ts +18 -0
  124. package/tools/typographical-emphasis/italic-tool.directive.d.ts +18 -0
  125. package/tools/typographical-emphasis/underline-tool.directive.d.ts +18 -0
  126. package/tools/utils.d.ts +8 -0
  127. package/utils.d.ts +9 -0
@@ -0,0 +1,71 @@
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 { alignCenterIcon, alignJustifyIcon, alignLeftIcon, alignRightIcon, boldIcon, dropletIcon, foregroundColorIcon, italicIcon, tableColumnDeleteIcon, tableColumnInsertLeftIcon, tableColumnInsertRightIcon, tableRowDeleteIcon, tableRowInsertAboveIcon, tableRowInsertBelowIcon, underlineIcon, arrowRotateCcwIcon, arrowRotateCwIcon, bordersNoneIcon, alignTopIcon, alignMiddleIcon, alignBottomIcon, textWrapIcon, folderOpenIcon, downloadIcon, customFormatIcon, fontSizeIcon, fontFamilyIcon } from '@progress/kendo-svg-icons';
6
+ /**
7
+ * @hidden
8
+ */
9
+ export const commandIcons = {
10
+ alignCenter: 'align-center',
11
+ alignJustify: 'align-justify',
12
+ alignLeft: 'align-left',
13
+ alignRight: 'align-right',
14
+ alignTop: 'align-top',
15
+ alignMiddle: 'align-middle',
16
+ alignBottom: 'align-bottom',
17
+ align: 'align-left',
18
+ background: 'droplet',
19
+ bold: 'bold',
20
+ color: 'foreground-color',
21
+ italic: 'italic',
22
+ redo: 'arrow-rotate-cw',
23
+ underline: 'underline',
24
+ undo: 'arrow-rotate-ccw',
25
+ wrap: 'text-wrap',
26
+ addColumnLeft: 'table-column-insert-left',
27
+ addColumnRight: 'table-column-insert-right',
28
+ addRowAbove: 'table-row-insert-above',
29
+ addRowBelow: 'table-row-insert-below',
30
+ deleteRow: 'table-row-delete',
31
+ deleteColumn: 'table-column-delete',
32
+ gridLines: 'borders-none',
33
+ folderOpen: 'folder-open',
34
+ download: 'download',
35
+ format: 'custom-format',
36
+ fontSize: 'font-size',
37
+ fontFamily: 'font-family'
38
+ };
39
+ /**
40
+ * @hidden
41
+ */
42
+ export const commandSVGIcons = {
43
+ alignCenter: alignCenterIcon,
44
+ alignJustify: alignJustifyIcon,
45
+ alignLeft: alignLeftIcon,
46
+ alignRight: alignRightIcon,
47
+ alignTop: alignTopIcon,
48
+ alignMiddle: alignMiddleIcon,
49
+ alignBottom: alignBottomIcon,
50
+ align: alignLeftIcon,
51
+ background: dropletIcon,
52
+ bold: boldIcon,
53
+ color: foregroundColorIcon,
54
+ italic: italicIcon,
55
+ redo: arrowRotateCwIcon,
56
+ underline: underlineIcon,
57
+ undo: arrowRotateCcwIcon,
58
+ wrap: textWrapIcon,
59
+ addColumnLeft: tableColumnInsertLeftIcon,
60
+ addColumnRight: tableColumnInsertRightIcon,
61
+ addRowAbove: tableRowInsertAboveIcon,
62
+ addRowBelow: tableRowInsertBelowIcon,
63
+ deleteRow: tableRowDeleteIcon,
64
+ deleteColumn: tableColumnDeleteIcon,
65
+ gridLines: bordersNoneIcon,
66
+ folderOpen: folderOpenIcon,
67
+ download: downloadIcon,
68
+ format: customFormatIcon,
69
+ fontSize: fontSizeIcon,
70
+ fontFamily: fontFamilyIcon
71
+ };
@@ -0,0 +1,5 @@
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 {};
@@ -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 { InjectionToken } from "@angular/core";
6
+ import { commandSVGIcons } from './command-icons';
7
+ const DEFAULT_FONT_FAMILY = 'Arial';
8
+ const DEFAULT_FONT_SIZE = 12;
9
+ /**
10
+ * @hidden
11
+ */
12
+ export const DEFAULT_FONT_VALUES = {
13
+ fontSize: DEFAULT_FONT_SIZE,
14
+ fontFamily: DEFAULT_FONT_FAMILY
15
+ };
16
+ /**
17
+ * @hidden
18
+ */
19
+ export const FONT_FAMILIES = ['Arial', 'Courier New', 'Georgia', 'Times New Roman', 'Trebuchet MS', 'Verdana'];
20
+ /**
21
+ * @hidden
22
+ */
23
+ export const FONT_SIZES = [8, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72];
24
+ /**
25
+ * @hidden
26
+ */
27
+ export const FONT_DATA = {
28
+ fontFamily: FONT_FAMILIES,
29
+ fontSize: FONT_SIZES
30
+ };
31
+ /**
32
+ * @hidden
33
+ */
34
+ export const FORMATS = [
35
+ { text: 'Automatic', value: null },
36
+ { text: 'Text', value: '@' },
37
+ { text: 'Number', value: '#,0.00' },
38
+ { text: 'Percent', value: '0.00%' },
39
+ { text: 'Financial', value: '_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)' },
40
+ { text: 'Currency', value: '$#,##0.00;[Red]$#,##0.00' },
41
+ { text: 'Date', value: 'm/d/yyyy' },
42
+ { text: 'Time', value: 'h:mm:ss AM/PM' },
43
+ { text: 'Date time', value: 'm/d/yyyy h:mm' },
44
+ { text: 'Duration', value: '[h]:mm:ss' }
45
+ ];
46
+ /**
47
+ * @hidden
48
+ */
49
+ export const ALIGNS = [
50
+ { icon: 'align-left', svgIcon: commandSVGIcons.alignLeft, textKey: 'Align Left', commandName: 'textAlign', value: 'left', cssClass: '' },
51
+ { icon: 'align-center', svgIcon: commandSVGIcons.alignCenter, textKey: 'Align Center', commandName: 'textAlign', value: 'center', cssClass: '' },
52
+ { icon: 'align-right', svgIcon: commandSVGIcons.alignRight, textKey: 'Align Right', commandName: 'textAlign', value: 'right', cssClass: '' },
53
+ { icon: 'align-justify', svgIcon: commandSVGIcons.alignJustify, textKey: 'Align Justify', commandName: 'textAlign', value: 'justify', cssClass: '' },
54
+ { icon: 'align-top', svgIcon: commandSVGIcons.alignTop, textKey: 'Align Top', commandName: 'verticalAlign', value: 'top', cssClass: '' },
55
+ { icon: 'align-middle', svgIcon: commandSVGIcons.alignMiddle, textKey: 'Align Middle', commandName: 'verticalAlign', value: 'center', cssClass: '' },
56
+ { icon: 'align-bottom', svgIcon: commandSVGIcons.alignBottom, textKey: 'Align Bottom', commandName: 'verticalAlign', value: 'bottom', cssClass: '' }
57
+ ];
58
+ /**
59
+ * @hidden
60
+ */
61
+ export const MY_TOKEN = new InjectionToken('COMMAND_TOKEN');
@@ -0,0 +1,114 @@
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 { DialogRef, DialogContentBase } from '@progress/kendo-angular-dialog';
7
+ import * as i0 from "@angular/core";
8
+ import * as i1 from "@progress/kendo-angular-dialog";
9
+ import * as i2 from "../font-family/font-family-dropdownlist.component";
10
+ import * as i3 from "../font-size/font-size-dropdownlist.component";
11
+ import * as i4 from "@progress/kendo-angular-inputs";
12
+ import * as i5 from "@angular/common";
13
+ /**
14
+ * @hidden
15
+ */
16
+ export class DialogContentComponent extends DialogContentBase {
17
+ constructor(dialog) {
18
+ super(dialog);
19
+ this.dialog = dialog;
20
+ this.data = [];
21
+ }
22
+ setData(args) {
23
+ this.data = args.data;
24
+ this.value = args.value;
25
+ this.tabindex = args.tabindex;
26
+ this.componentType = args.componentType;
27
+ }
28
+ }
29
+ DialogContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DialogContentComponent, deps: [{ token: i1.DialogRef }], target: i0.ɵɵFactoryTarget.Component });
30
+ DialogContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: DialogContentComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
31
+ <div
32
+ [ngSwitch]="componentType"
33
+ class="k-d-flex k-align-items-center k-justify-content-center">
34
+ <kendo-spreadsheet-fontfamily-dropdownlist
35
+ *ngSwitchCase="'fontFamily'"
36
+ [data]="data"
37
+ [(value)]="value"
38
+ [attr.title]="title"
39
+ [tabindex]="tabindex"
40
+ [style.width.em]="13"
41
+ ></kendo-spreadsheet-fontfamily-dropdownlist>
42
+ <kendo-spreadsheet-fontsize-dropdownlist
43
+ *ngSwitchCase="'fontSize'"
44
+ [data]="data"
45
+ [(value)]="value"
46
+ [attr.title]="title"
47
+ [tabindex]="tabindex"
48
+ [style.width.em]="13"
49
+ ></kendo-spreadsheet-fontsize-dropdownlist>
50
+ <kendo-colorpicker
51
+ *ngSwitchCase="'color'"
52
+ [attr.title]="title"
53
+ [format]="'hex'"
54
+ [(value)]="value"
55
+ [tabindex]="tabindex"
56
+ [clearButton]="false"
57
+ fillMode="flat"
58
+ ></kendo-colorpicker>
59
+ <kendo-colorpicker
60
+ *ngSwitchCase="'background'"
61
+ [attr.title]="title"
62
+ [format]="'hex'"
63
+ [(value)]="value"
64
+ [tabindex]="tabindex"
65
+ [clearButton]="false"
66
+ fillMode="flat"
67
+ ></kendo-colorpicker>
68
+ </div>
69
+ `, isInline: true, components: [{ type: i2.FontFamilyDropDownListComponent, selector: "kendo-spreadsheet-fontfamily-dropdownlist" }, { type: i3.FontSizeDropDownListComponent, selector: "kendo-spreadsheet-fontsize-dropdownlist" }, { type: i4.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: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }] });
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DialogContentComponent, decorators: [{
71
+ type: Component,
72
+ args: [{
73
+ template: `
74
+ <div
75
+ [ngSwitch]="componentType"
76
+ class="k-d-flex k-align-items-center k-justify-content-center">
77
+ <kendo-spreadsheet-fontfamily-dropdownlist
78
+ *ngSwitchCase="'fontFamily'"
79
+ [data]="data"
80
+ [(value)]="value"
81
+ [attr.title]="title"
82
+ [tabindex]="tabindex"
83
+ [style.width.em]="13"
84
+ ></kendo-spreadsheet-fontfamily-dropdownlist>
85
+ <kendo-spreadsheet-fontsize-dropdownlist
86
+ *ngSwitchCase="'fontSize'"
87
+ [data]="data"
88
+ [(value)]="value"
89
+ [attr.title]="title"
90
+ [tabindex]="tabindex"
91
+ [style.width.em]="13"
92
+ ></kendo-spreadsheet-fontsize-dropdownlist>
93
+ <kendo-colorpicker
94
+ *ngSwitchCase="'color'"
95
+ [attr.title]="title"
96
+ [format]="'hex'"
97
+ [(value)]="value"
98
+ [tabindex]="tabindex"
99
+ [clearButton]="false"
100
+ fillMode="flat"
101
+ ></kendo-colorpicker>
102
+ <kendo-colorpicker
103
+ *ngSwitchCase="'background'"
104
+ [attr.title]="title"
105
+ [format]="'hex'"
106
+ [(value)]="value"
107
+ [tabindex]="tabindex"
108
+ [clearButton]="false"
109
+ fillMode="flat"
110
+ ></kendo-colorpicker>
111
+ </div>
112
+ `
113
+ }]
114
+ }], ctorParameters: function () { return [{ type: i1.DialogRef }]; } });
@@ -0,0 +1,75 @@
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 { Subscription } from 'rxjs';
6
+ import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
7
+ import { LocalizationService } from '@progress/kendo-angular-l10n';
8
+ import { SpreadsheetService } from '../../common/spreadsheet.service';
9
+ import { Directive, Inject } from '@angular/core';
10
+ import { SpreadsheetToolsService } from '../tools.service';
11
+ import { commandIcons, commandSVGIcons } from './command-icons';
12
+ import { MY_TOKEN } from './constants';
13
+ import { take } from 'rxjs/operators';
14
+ import * as i0 from "@angular/core";
15
+ import * as i1 from "@progress/kendo-angular-toolbar";
16
+ import * as i2 from "@progress/kendo-angular-l10n";
17
+ import * as i3 from "../../common/spreadsheet.service";
18
+ import * as i4 from "../tools.service";
19
+ /**
20
+ * @hidden
21
+ */
22
+ export class SpreadsheetCommandBaseDirective {
23
+ constructor(command, button, localization, spreadsheetService, toolsService) {
24
+ this.command = command;
25
+ this.button = button;
26
+ this.localization = localization;
27
+ this.spreadsheetService = spreadsheetService;
28
+ this.toolsService = toolsService;
29
+ this.subs = new Subscription();
30
+ // this.toolsService.zone.runOutsideAngular(() => {
31
+ // setTimeout(() => {
32
+ const text = this.localization.get(this.command);
33
+ if (text) {
34
+ this.button.showText = 'overflow';
35
+ this.button.showIcon = 'both';
36
+ this.button.text = text;
37
+ }
38
+ if (!this.button.toolbarOptions.icon) {
39
+ this.button.icon = commandIcons[this.command];
40
+ }
41
+ if (!this.button.toolbarOptions.svgIcon) {
42
+ this.button.svgIcon = commandSVGIcons[this.command];
43
+ }
44
+ this.button.title = text;
45
+ this.button.fillMode = 'flat';
46
+ this.subs.add(this.toolsService.stateChange.subscribe(state => {
47
+ this.toolsService.ngZone.onStable.pipe(take(1)).subscribe(() => this.button.selected = state[command]);
48
+ }));
49
+ // this.toolsService.zone.run(() => {
50
+ // this.toolsService.needsCheck.next();
51
+ // });
52
+ // });
53
+ //});
54
+ }
55
+ ngOnInit() {
56
+ this.subs.add(this.button.click.subscribe((this.clickHandler.bind(this))));
57
+ this.subs.add(this.button.pointerdown.subscribe((this.pointerdownHandler.bind(this))));
58
+ }
59
+ ngOnDestroy() {
60
+ this.subs.unsubscribe();
61
+ }
62
+ clickHandler() { }
63
+ pointerdownHandler(_event) { }
64
+ }
65
+ SpreadsheetCommandBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetCommandBaseDirective, deps: [{ token: MY_TOKEN }, { token: i1.ToolBarButtonComponent }, { token: i2.LocalizationService }, { token: i3.SpreadsheetService }, { token: i4.SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
66
+ SpreadsheetCommandBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetCommandBaseDirective, selector: "[kendoSpreadsheetCommandBase]", ngImport: i0 });
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetCommandBaseDirective, decorators: [{
68
+ type: Directive,
69
+ args: [{
70
+ selector: '[kendoSpreadsheetCommandBase]'
71
+ }]
72
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
73
+ type: Inject,
74
+ args: [MY_TOKEN]
75
+ }] }, { type: i1.ToolBarButtonComponent }, { type: i2.LocalizationService }, { type: i3.SpreadsheetService }, { type: i4.SpreadsheetToolsService }]; } });
@@ -0,0 +1,25 @@
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 { SpreadsheetCommandBaseDirective } from './spreadsheet-command-base';
6
+ /**
7
+ * @hidden
8
+ */
9
+ export class SpreadsheetCommandButton extends SpreadsheetCommandBaseDirective {
10
+ constructor(command, button, localization, spreadsheetService, toolsService, commandOptions) {
11
+ super(command, button, localization, spreadsheetService, toolsService);
12
+ this.command = command;
13
+ this.button = button;
14
+ this.localization = localization;
15
+ this.spreadsheetService = spreadsheetService;
16
+ this.toolsService = toolsService;
17
+ this.commandOptions = commandOptions;
18
+ }
19
+ clickHandler() {
20
+ if (this.commandOptions.command === 'PropertyChangeCommand') {
21
+ this.commandOptions.options.value = !this.toolsService.toolsState[this.command];
22
+ }
23
+ this.spreadsheetService.spreadsheet.executeCommand(this.commandOptions);
24
+ }
25
+ }
@@ -0,0 +1,184 @@
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, EventEmitter, Inject, Output, TemplateRef, ViewChild } from "@angular/core";
6
+ import { ToolBarComponent, ToolBarToolComponent } from "@progress/kendo-angular-toolbar";
7
+ import { SpreadsheetService } from "../../common/spreadsheet.service";
8
+ import { SpreadsheetLocalizationService } from "../../localization/spreadsheet-localization.service";
9
+ import { SpreadsheetToolsService } from "../tools.service";
10
+ import { hasObservers, isPresent } from '@progress/kendo-angular-common';
11
+ import { DEFAULT_FONT_VALUES, FONT_DATA, MY_TOKEN } from "./constants";
12
+ import { commandIcons, commandSVGIcons } from './command-icons';
13
+ import { outerWidth } from '../utils';
14
+ import { DialogService } from "@progress/kendo-angular-dialog";
15
+ import { DialogContentComponent } from "./dialog-content.component";
16
+ import { take } from "rxjs/operators";
17
+ import * as i0 from "@angular/core";
18
+ import * as i1 from "@progress/kendo-angular-dialog";
19
+ import * as i2 from "../../localization/spreadsheet-localization.service";
20
+ import * as i3 from "../../common/spreadsheet.service";
21
+ import * as i4 from "../tools.service";
22
+ import * as i5 from "@progress/kendo-angular-toolbar";
23
+ /**
24
+ * @hidden
25
+ */
26
+ export class SpreadsheetDropDownToolBase extends ToolBarToolComponent {
27
+ constructor(command, dialogService, localization, spreadsheetService, toolsService, toolbar) {
28
+ super();
29
+ this.command = command;
30
+ this.dialogService = dialogService;
31
+ this.localization = localization;
32
+ this.spreadsheetService = spreadsheetService;
33
+ this.toolsService = toolsService;
34
+ this.toolbar = toolbar;
35
+ /**
36
+ * Fires when the user updates the value of the drop-down list.
37
+ */
38
+ this.valueChange = new EventEmitter();
39
+ this.tabindex = -1;
40
+ this.svgIcon = commandSVGIcons[this.command];
41
+ this.icon = commandIcons[this.command];
42
+ this.value = DEFAULT_FONT_VALUES[this.command];
43
+ this.data = FONT_DATA[this.command];
44
+ }
45
+ ngOnInit() {
46
+ this.value = this.toolsService.toolsState[this.command];
47
+ this.subs = this.toolsService.stateChange.subscribe(state => {
48
+ this.value = state[this.command];
49
+ });
50
+ }
51
+ ngOnDestroy() {
52
+ if (this.subs) {
53
+ this.subs.unsubscribe();
54
+ }
55
+ }
56
+ /**
57
+ * @hidden
58
+ */
59
+ messageFor(key) {
60
+ return this.localization.get(key);
61
+ }
62
+ /**
63
+ * @hidden
64
+ */
65
+ onValueChange(ev) {
66
+ if (isPresent(ev)) {
67
+ if (hasObservers(this.valueChange)) {
68
+ this.valueChange.emit(ev);
69
+ }
70
+ const options = {
71
+ command: 'PropertyChangeCommand',
72
+ options: { property: this.command, value: ev || null }
73
+ };
74
+ this.spreadsheetService.spreadsheet.executeCommand(options);
75
+ }
76
+ }
77
+ /**
78
+ * @hidden
79
+ */
80
+ get outerWidth() {
81
+ if (this.element) {
82
+ return outerWidth(this.element.nativeElement);
83
+ }
84
+ }
85
+ /**
86
+ * @hidden
87
+ */
88
+ openDialog() {
89
+ const dialogSettings = {
90
+ appendTo: this.spreadsheetService.dialogContainer,
91
+ title: this.messageFor(this.command),
92
+ content: DialogContentComponent,
93
+ actions: [{
94
+ text: this.messageFor('dialogApply'),
95
+ themeColor: 'primary'
96
+ }, {
97
+ text: this.messageFor('dialogCancel')
98
+ }],
99
+ actionsLayout: 'start',
100
+ width: 400,
101
+ autoFocusedElement: '.k-dropdownlist'
102
+ };
103
+ this.toolbar.toggle(false);
104
+ const dialog = this.dialogService.open(dialogSettings);
105
+ const dialogInstance = dialog.dialog.instance;
106
+ const dialogContent = dialog.content.instance;
107
+ dialogInstance.action.pipe(take(1)).subscribe((event) => {
108
+ if (event.text === this.messageFor('dialogApply')) {
109
+ const options = {
110
+ command: 'PropertyChangeCommand',
111
+ options: { property: this.command, value: dialogContent.value || null }
112
+ };
113
+ this.spreadsheetService.spreadsheet.executeCommand(options);
114
+ }
115
+ this.toolbar.toggle();
116
+ });
117
+ dialogInstance.close.pipe(take(1)).subscribe(() => {
118
+ this.toolbar.toggle();
119
+ });
120
+ dialogContent.setData({
121
+ data: this.data,
122
+ value: this.value,
123
+ tabindex: this.tabindex,
124
+ componentType: this.command,
125
+ title: this.localization.get(this.command)
126
+ });
127
+ }
128
+ /**
129
+ * @hidden
130
+ */
131
+ focus(e) {
132
+ this.tabindex = 0;
133
+ if (e instanceof PointerEvent) {
134
+ return;
135
+ }
136
+ if (this.overflows) {
137
+ this.popupButton.nativeElement.focus();
138
+ }
139
+ else {
140
+ this.dropDownListRef.focus();
141
+ }
142
+ }
143
+ /**
144
+ * @hidden
145
+ */
146
+ canFocus() {
147
+ return true;
148
+ }
149
+ /**
150
+ * @hidden
151
+ */
152
+ handleKey() {
153
+ this.tabindex = -1;
154
+ return false;
155
+ }
156
+ }
157
+ SpreadsheetDropDownToolBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetDropDownToolBase, deps: [{ token: MY_TOKEN }, { token: i1.DialogService }, { token: i2.SpreadsheetLocalizationService }, { token: i3.SpreadsheetService }, { token: i4.SpreadsheetToolsService }, { token: i5.ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
158
+ 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 });
159
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetDropDownToolBase, decorators: [{
160
+ type: Component,
161
+ args: [{
162
+ template: ``
163
+ }]
164
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
165
+ type: Inject,
166
+ args: [MY_TOKEN]
167
+ }] }, { type: i1.DialogService }, { type: i2.SpreadsheetLocalizationService }, { type: i3.SpreadsheetService }, { type: i4.SpreadsheetToolsService }, { type: i5.ToolBarComponent }]; }, propDecorators: { toolbarTemplate: [{
168
+ type: ViewChild,
169
+ args: ['toolbarTemplate', { static: true }]
170
+ }], popupTemplate: [{
171
+ type: ViewChild,
172
+ args: ['popupTemplate', { static: true }]
173
+ }], element: [{
174
+ type: ViewChild,
175
+ args: ['element', { read: ElementRef }]
176
+ }], dropDownListRef: [{
177
+ type: ViewChild,
178
+ args: ['element']
179
+ }], popupButton: [{
180
+ type: ViewChild,
181
+ args: ['popupButton', { read: ElementRef }]
182
+ }], valueChange: [{
183
+ type: Output
184
+ }] } });
@@ -0,0 +1,50 @@
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, ElementRef, EventEmitter, HostBinding, Input, Output, ViewChild } from "@angular/core";
6
+ import { DropDownListComponent } from "@progress/kendo-angular-dropdowns";
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * @hidden
10
+ */
11
+ export class DropDownListBase {
12
+ constructor() {
13
+ this.display = 'inline-flex';
14
+ this.fillMode = 'flat';
15
+ this.valueChange = new EventEmitter();
16
+ }
17
+ onValueChange(value) {
18
+ this.valueChange.emit(value);
19
+ }
20
+ focus() {
21
+ this.dropDownList.focus();
22
+ }
23
+ }
24
+ DropDownListBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropDownListBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
25
+ 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 });
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DropDownListBase, decorators: [{
27
+ type: Directive,
28
+ args: [{
29
+ selector: 'kendo-spreadsheet-dropdownlist-base'
30
+ }]
31
+ }], propDecorators: { display: [{
32
+ type: HostBinding,
33
+ args: ['style.display']
34
+ }], data: [{
35
+ type: Input
36
+ }], value: [{
37
+ type: Input
38
+ }], title: [{
39
+ type: Input
40
+ }], tabindex: [{
41
+ type: Input
42
+ }], valueChange: [{
43
+ type: Output
44
+ }], element: [{
45
+ type: ViewChild,
46
+ args: ['element', { static: true }]
47
+ }], dropDownList: [{
48
+ type: ViewChild,
49
+ args: ['element', { read: DropDownListComponent, static: true }]
50
+ }] } });
@@ -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 SpreadsheetAddColumnLeftButtonDirective extends SpreadsheetCommandButton {
20
+ constructor(button, localization, spreadsheetService, toolsService) {
21
+ super('addColumnLeft', button, localization, spreadsheetService, toolsService, {
22
+ command: 'AddColumnCommand',
23
+ options: { property: 'addColumnLeft',
24
+ value: 'left'
25
+ }
26
+ });
27
+ }
28
+ }
29
+ SpreadsheetAddColumnLeftButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddColumnLeftButtonDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.SpreadsheetLocalizationService }, { token: i3.SpreadsheetService }, { token: i4.SpreadsheetToolsService }], target: i0.ɵɵFactoryTarget.Directive });
30
+ SpreadsheetAddColumnLeftButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SpreadsheetAddColumnLeftButtonDirective, selector: "kendo-toolbar-button[kendoSpreadsheetAddColumnLeftButton]", usesInheritance: true, ngImport: i0 });
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SpreadsheetAddColumnLeftButtonDirective, decorators: [{
32
+ type: Directive,
33
+ args: [{
34
+ selector: 'kendo-toolbar-button[kendoSpreadsheetAddColumnLeftButton]'
35
+ }]
36
+ }], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.SpreadsheetLocalizationService }, { type: i3.SpreadsheetService }, { type: i4.SpreadsheetToolsService }]; } });