@progress/kendo-angular-spreadsheet 14.3.0-develop.3 → 14.3.0-develop.5
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/common/spreadsheet.service.d.ts +1 -0
- package/esm2020/common/spreadsheet.service.mjs +1 -0
- package/esm2020/localization/messages.mjs +13 -1
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/sheets-bar/sheets-bar.component.mjs +132 -58
- package/esm2020/sheets-bar/utils.mjs +22 -18
- package/esm2020/spreadsheet.component.mjs +47 -6
- package/esm2020/tools/align/horizontal-align-tool.directive.mjs +1 -3
- package/esm2020/tools/align/vertical-align-tool.directive.mjs +1 -3
- package/esm2020/utils.mjs +2 -1
- package/fesm2015/progress-kendo-angular-spreadsheet.mjs +201 -82
- package/fesm2020/progress-kendo-angular-spreadsheet.mjs +218 -90
- package/localization/messages.d.ts +25 -1
- package/models/sheet-info.d.ts +1 -0
- package/package.json +13 -13
- package/schematics/ngAdd/index.js +1 -1
- package/sheets-bar/sheets-bar.component.d.ts +6 -3
- package/sheets-bar/utils.d.ts +1 -1
- package/spreadsheet.component.d.ts +4 -0
@@ -8,7 +8,7 @@ import { validatePackage } from '@progress/kendo-licensing';
|
|
8
8
|
import { SpreadsheetWidget } from '@progress/kendo-spreadsheet-common';
|
9
9
|
import * as i1$4 from '@progress/kendo-angular-intl';
|
10
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, cellsMergeIcon, cellsMergeHorizontallyIcon, cellsMergeVerticallyIcon, tableUnmergeIcon, linkIcon, fontGrowIcon, fontShrinkIcon, decimalDecreaseIcon, decimalIncreaseIcon, cutIcon, clipboardIcon,
|
11
|
+
import { formulaFxIcon, trashIcon, copyIcon, pencilIcon, eyeSlashIcon, 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, cellsMergeIcon, cellsMergeHorizontallyIcon, cellsMergeVerticallyIcon, tableUnmergeIcon, linkIcon, fontGrowIcon, fontShrinkIcon, decimalDecreaseIcon, decimalIncreaseIcon, cutIcon, clipboardIcon, eyeIcon, plusIcon, menuIcon, caretAltDownIcon, caretAltLeftIcon, caretAltRightIcon } from '@progress/kendo-svg-icons';
|
12
12
|
import * as i2 from '@progress/kendo-angular-l10n';
|
13
13
|
import { LocalizationService, L10N_PREFIX, RTL, ComponentMessages } from '@progress/kendo-angular-l10n';
|
14
14
|
import * as i3 from '@progress/kendo-angular-common';
|
@@ -47,8 +47,8 @@ const packageMetadata = {
|
|
47
47
|
name: '@progress/kendo-angular-spreadsheet',
|
48
48
|
productName: 'Kendo UI for Angular',
|
49
49
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
50
|
-
publishDate:
|
51
|
-
version: '14.3.0-develop.
|
50
|
+
publishDate: 1701781986,
|
51
|
+
version: '14.3.0-develop.5',
|
52
52
|
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',
|
53
53
|
};
|
54
54
|
|
@@ -150,7 +150,8 @@ const mapToSheetDescriptor = (sheetsArray) => {
|
|
150
150
|
name: sheet.name(),
|
151
151
|
rows: sheet._rows,
|
152
152
|
selection: sheet.selection(),
|
153
|
-
showGridLines: sheet.showGridLines
|
153
|
+
showGridLines: sheet.showGridLines,
|
154
|
+
state: sheet.state()
|
154
155
|
};
|
155
156
|
});
|
156
157
|
};
|
@@ -162,6 +163,7 @@ let spreadsheetCounter = 0;
|
|
162
163
|
class SpreadsheetService {
|
163
164
|
constructor() {
|
164
165
|
this.sheetsChanged = new Subject();
|
166
|
+
this.onSheetsBarFocus = new Subject();
|
165
167
|
this.activeSheetChanged = new Subject();
|
166
168
|
this.selectionChanged = new Subject();
|
167
169
|
spreadsheetCounter++;
|
@@ -410,41 +412,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
410
412
|
/**
|
411
413
|
* @hidden
|
412
414
|
*/
|
413
|
-
const getSheetActions = (
|
415
|
+
const getSheetActions = (items, item) => {
|
416
|
+
const visibleItems = items.filter(item => item.state === 'visible');
|
417
|
+
const itemIndex = item ? visibleItems.findIndex(i => i === item) : 0;
|
414
418
|
return [{
|
415
|
-
|
419
|
+
messageKey: 'sheetDelete',
|
416
420
|
icon: 'trash',
|
417
421
|
svgIcon: trashIcon,
|
418
422
|
commandName: 'delete',
|
419
423
|
dialogButton: 'dialogDelete',
|
420
|
-
disabled:
|
421
|
-
},
|
422
|
-
|
423
|
-
text: 'Duplicate',
|
424
|
+
disabled: visibleItems.length === 1
|
425
|
+
}, {
|
426
|
+
messageKey: 'sheetDuplicate',
|
424
427
|
icon: 'copy',
|
425
428
|
svgIcon: copyIcon,
|
426
429
|
commandName: 'copy'
|
427
|
-
},
|
428
|
-
|
429
|
-
text: 'Rename',
|
430
|
+
}, {
|
431
|
+
messageKey: 'sheetRename',
|
430
432
|
icon: 'pencil',
|
431
433
|
svgIcon: pencilIcon,
|
432
434
|
commandName: 'rename',
|
433
435
|
dialogButton: 'dialogRename'
|
434
|
-
},
|
435
|
-
|
436
|
-
|
436
|
+
}, {
|
437
|
+
messageKey: 'sheetHide',
|
438
|
+
icon: 'eye-slash',
|
439
|
+
svgIcon: eyeSlashIcon,
|
440
|
+
commandName: 'hide',
|
441
|
+
disabled: visibleItems.length === 1
|
442
|
+
}, {
|
443
|
+
messageKey: 'sheetMoveRight',
|
437
444
|
icon: 'arrow-right',
|
438
445
|
svgIcon: arrowRightIcon,
|
439
446
|
commandName: 'move',
|
440
|
-
disabled:
|
441
|
-
},
|
442
|
-
|
443
|
-
text: 'Move Left',
|
447
|
+
disabled: visibleItems.length === 1 || itemIndex === visibleItems.length - 1
|
448
|
+
}, {
|
449
|
+
messageKey: 'sheetMoveLeft',
|
444
450
|
icon: 'arrow-left',
|
445
451
|
svgIcon: arrowLeftIcon,
|
446
452
|
commandName: 'move',
|
447
|
-
disabled:
|
453
|
+
disabled: visibleItems.length === 1 || itemIndex === 0
|
448
454
|
}];
|
449
455
|
};
|
450
456
|
|
@@ -1799,14 +1805,23 @@ class SheetsBarComponent {
|
|
1799
1805
|
this.dialogService = dialogService;
|
1800
1806
|
this.ngZone = ngZone;
|
1801
1807
|
this.hostClasses = true;
|
1808
|
+
this.subs = new Subscription();
|
1802
1809
|
this.plusIcon = plusIcon;
|
1803
1810
|
this.menuIcon = menuIcon;
|
1804
1811
|
this.caretAltDownIcon = caretAltDownIcon;
|
1805
1812
|
this.caretAltLeftIcon = caretAltLeftIcon;
|
1806
1813
|
this.caretAltRightIcon = caretAltRightIcon;
|
1807
1814
|
this.selected = false;
|
1815
|
+
this.sheetsMenuList = [];
|
1808
1816
|
this.openedDdb = null;
|
1809
|
-
this.
|
1817
|
+
this.hiddenStateIcons = {
|
1818
|
+
hidden: 'eye-slash',
|
1819
|
+
visible: 'eye'
|
1820
|
+
};
|
1821
|
+
this.hiddenStateSVGIcons = {
|
1822
|
+
hidden: eyeSlashIcon,
|
1823
|
+
visible: eyeIcon
|
1824
|
+
};
|
1810
1825
|
this.onAddClick = () => {
|
1811
1826
|
if (this.spreadsheetService.spreadsheet) {
|
1812
1827
|
this.spreadsheetService.spreadsheet.view.sheetsbar.onAddSelect();
|
@@ -1828,23 +1843,53 @@ class SheetsBarComponent {
|
|
1828
1843
|
this.spreadsheetService.spreadsheet.insertSheet({ data: Object.assign(Object.assign({}, sheetToCopy.toJSON()), { name: newName }), index: sheetInfo.index + 1 });
|
1829
1844
|
this.selectSheet(newName);
|
1830
1845
|
},
|
1831
|
-
move: (sheetInfo,
|
1832
|
-
const
|
1833
|
-
|
1846
|
+
move: (sheetInfo, itemKey) => {
|
1847
|
+
const isMoveRight = itemKey === 'sheetMoveRight';
|
1848
|
+
let oldIndex = -1;
|
1849
|
+
let newIndex = -1;
|
1850
|
+
if (isMoveRight) {
|
1851
|
+
for (let i = 0; i < this.sheets.length; i++) {
|
1852
|
+
if (this.sheets[i].text === sheetInfo.text) {
|
1853
|
+
oldIndex = i;
|
1854
|
+
}
|
1855
|
+
if (oldIndex > -1 && i > oldIndex && this.sheets[i].state === 'visible') {
|
1856
|
+
newIndex = i;
|
1857
|
+
break;
|
1858
|
+
}
|
1859
|
+
}
|
1860
|
+
}
|
1861
|
+
else {
|
1862
|
+
for (let i = this.sheets.length - 1; i >= 0; i--) {
|
1863
|
+
if (this.sheets[i].text === sheetInfo.text) {
|
1864
|
+
oldIndex = i;
|
1865
|
+
}
|
1866
|
+
if (oldIndex > -1 && i < oldIndex && this.sheets[i].state === 'visible') {
|
1867
|
+
newIndex = i;
|
1868
|
+
break;
|
1869
|
+
}
|
1870
|
+
}
|
1871
|
+
}
|
1834
1872
|
const sheetsBar = this.spreadsheetService.spreadsheet.view.sheetsbar;
|
1835
1873
|
sheetsBar.onSheetReorderEnd({ oldIndex, newIndex });
|
1836
1874
|
this.notifySheetsChange();
|
1875
|
+
},
|
1876
|
+
hide: (sheet) => {
|
1877
|
+
sheet.state = 'hidden';
|
1878
|
+
const sheets = this.spreadsheetService.spreadsheet.sheets();
|
1879
|
+
const sheetIndex = sheets.findIndex(s => s.name() === sheet.text);
|
1880
|
+
sheets[sheetIndex]._state('hidden');
|
1881
|
+
const newSelectedIndex = sheetIndex < sheets.length - 1 ? sheetIndex + 1 : 0;
|
1882
|
+
const sheetToSelect = sheets[newSelectedIndex].name();
|
1883
|
+
this.selectSheet(sheetToSelect);
|
1884
|
+
this.notifySheetsChange();
|
1837
1885
|
}
|
1838
1886
|
};
|
1887
|
+
this.subs.add(spreadsheetService.onSheetsBarFocus.subscribe(() => ngZone.run(() => this.tabstrip.selectTab(this.sheets.findIndex(sh => sh.text === spreadsheetService.currentActiveSheet)))));
|
1839
1888
|
}
|
1840
1889
|
get activeSheet() {
|
1841
1890
|
var _a, _b;
|
1842
1891
|
return (_b = (_a = this.spreadsheetService.spreadsheet) === null || _a === void 0 ? void 0 : _a.activeSheet()) === null || _b === void 0 ? void 0 : _b.name();
|
1843
1892
|
}
|
1844
|
-
get sheetsMenuList() {
|
1845
|
-
var _a;
|
1846
|
-
return (_a = this.sheets) === null || _a === void 0 ? void 0 : _a.map(sheet => ({ text: sheet.text, icon: 'eye', svgIcon: this.eyeIcon }));
|
1847
|
-
}
|
1848
1893
|
get tablistId() {
|
1849
1894
|
return this.spreadsheetService.tablistId;
|
1850
1895
|
}
|
@@ -1860,10 +1905,24 @@ class SheetsBarComponent {
|
|
1860
1905
|
this.renderer.setAttribute(tablist, 'id', this.tablistId);
|
1861
1906
|
this.tabListSub = this.renderer.listen(tablist, 'keydown', this.onTabListKeyDown.bind(this));
|
1862
1907
|
}
|
1908
|
+
ngOnChanges(changes) {
|
1909
|
+
var _a, _b;
|
1910
|
+
if (changes['sheets']) {
|
1911
|
+
this.sheetsMenuList = (_a = this.sheets) === null || _a === void 0 ? void 0 : _a.map(sheet => ({
|
1912
|
+
text: sheet.text,
|
1913
|
+
icon: this.hiddenStateIcons[sheet.state],
|
1914
|
+
svgIcon: this.hiddenStateSVGIcons[sheet.state]
|
1915
|
+
}));
|
1916
|
+
this.sheets = (_b = changes['sheets'].currentValue) === null || _b === void 0 ? void 0 : _b.map((sheet, _, items) => (Object.assign(Object.assign({}, sheet), { sheetActions: getSheetActions(items, sheet)
|
1917
|
+
.map(item => (Object.assign(Object.assign({}, item), { text: this.messageFor(item.messageKey) }))) })));
|
1918
|
+
}
|
1919
|
+
;
|
1920
|
+
}
|
1863
1921
|
ngOnDestroy() {
|
1864
1922
|
if (this.tabListSub) {
|
1865
1923
|
this.tabListSub();
|
1866
1924
|
}
|
1925
|
+
this.subs.unsubscribe();
|
1867
1926
|
}
|
1868
1927
|
onTabSelect(ev) {
|
1869
1928
|
if (ev.title !== this.activeSheet) {
|
@@ -1889,11 +1948,13 @@ class SheetsBarComponent {
|
|
1889
1948
|
this.openDialog(dataItem, sheet);
|
1890
1949
|
}
|
1891
1950
|
else {
|
1892
|
-
this.actionsCallback[dataItem.commandName](sheet, dataItem.
|
1951
|
+
this.actionsCallback[dataItem.commandName](sheet, dataItem.messageKey);
|
1893
1952
|
}
|
1894
1953
|
}
|
1895
1954
|
onMenuItemClick(item) {
|
1896
1955
|
const sheet = this.sheets.find(s => s.text === item.text);
|
1956
|
+
sheet.state = 'visible';
|
1957
|
+
this.spreadsheetService.spreadsheet.sheets().find(sh => sh.name() === sheet.text)._state('visible');
|
1897
1958
|
this.selectSheet(sheet.text);
|
1898
1959
|
}
|
1899
1960
|
messageFor(key) {
|
@@ -1960,14 +2021,23 @@ class SheetsBarComponent {
|
|
1960
2021
|
}
|
1961
2022
|
notifySheetsChange() {
|
1962
2023
|
this.ngZone.run(() => {
|
2024
|
+
var _a;
|
1963
2025
|
const newSheets = this.spreadsheetService.spreadsheet.sheets();
|
1964
2026
|
const sheetDesc = mapToSheetDescriptor(newSheets);
|
1965
|
-
this.sheets = sheetDesc
|
2027
|
+
this.sheets = sheetDesc
|
2028
|
+
.flatMap((item, index, items) => item.state === 'visible' ? [Object.assign(Object.assign({}, item), { state: item.state || 'visible', inEdit: false, first: index === 0, last: index === items.length - 1, text: item.name, active: (item.name === this.activeSheet) || items.length === 1, index, sheetActions: getSheetActions(items, item)
|
2029
|
+
.map(item => (Object.assign(Object.assign({}, item), { text: this.messageFor(item.messageKey) }))) })] : []);
|
2030
|
+
this.sheetsMenuList = (_a = this.sheets) === null || _a === void 0 ? void 0 : _a.map(sheet => ({
|
2031
|
+
text: sheet.text,
|
2032
|
+
icon: this.hiddenStateIcons[sheet.state],
|
2033
|
+
svgIcon: this.hiddenStateSVGIcons[sheet.state]
|
2034
|
+
}));
|
1966
2035
|
});
|
2036
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => this.spreadsheetService.spreadsheet.view.clipboard.focus());
|
1967
2037
|
}
|
1968
2038
|
}
|
1969
2039
|
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$1.DialogService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
1970
|
-
SheetsBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SheetsBarComponent, selector: "[kendoSpreadsheetSheetsBar]", inputs: { sheets: "sheets", sheetDescriptors: "sheetDescriptors" }, host: { properties: { "class.k-spreadsheet-sheets-bar": "this.hostClasses" } }, viewQueries: [{ propertyName: "addButton", first: true, predicate: ["addButton"], descendants: true }, { propertyName: "menuButton", first: true, predicate: ["menuButton"], descendants: true }, { propertyName: "tabstrip", first: true, predicate: ["tabstrip"], descendants: true }, { propertyName: "actionDdbs", predicate: ["sheetDdb"], descendants: true }, { propertyName: "actionDdbRefs", predicate: ["sheetDdb"], descendants: true, read: ElementRef }], ngImport: i0, template: `
|
2040
|
+
SheetsBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SheetsBarComponent, selector: "[kendoSpreadsheetSheetsBar]", inputs: { sheets: "sheets", sheetDescriptors: "sheetDescriptors" }, host: { properties: { "class.k-spreadsheet-sheets-bar": "this.hostClasses" } }, viewQueries: [{ propertyName: "addButton", first: true, predicate: ["addButton"], descendants: true }, { propertyName: "menuButton", first: true, predicate: ["menuButton"], descendants: true }, { propertyName: "tabstrip", first: true, predicate: ["tabstrip"], descendants: true }, { propertyName: "actionDdbs", predicate: ["sheetDdb"], descendants: true }, { propertyName: "actionDdbRefs", predicate: ["sheetDdb"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: `
|
1971
2041
|
<button kendoButton #addButton
|
1972
2042
|
[title]="messageFor('addSheet')"
|
1973
2043
|
type="button"
|
@@ -1995,27 +2065,30 @@ SheetsBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
|
|
1995
2065
|
[scrollable]="{prevButtonIcon: 'caret-alt-left', prevSVGButtonIcon: caretAltLeftIcon, nextButtonIcon: 'caret-alt-right', nextSVGButtonIcon: caretAltRightIcon}"
|
1996
2066
|
class="k-spreadsheet-sheets k-overflow-hidden"
|
1997
2067
|
(tabSelect)="onTabSelect($event)">
|
1998
|
-
<
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
<
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2068
|
+
<ng-container *ngFor="let sheet of sheets">
|
2069
|
+
<kendo-tabstrip-tab
|
2070
|
+
*ngIf="sheet.state === 'visible'"
|
2071
|
+
[title]="sheet.text"
|
2072
|
+
[selected]="sheet.text === activeSheet">
|
2073
|
+
<ng-template kendoTabTemplate>
|
2074
|
+
<span class="k-link">{{sheet.text}}</span>
|
2075
|
+
<kendo-dropdownbutton #sheetDdb
|
2076
|
+
fillMode="flat"
|
2077
|
+
icon="caret-alt-down"
|
2078
|
+
[svgIcon]="caretAltDownIcon"
|
2079
|
+
buttonClass="k-menu-button"
|
2080
|
+
[data]="sheet.sheetActions"
|
2081
|
+
[buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
|
2082
|
+
(open)="onOpen(sheetDdb)"
|
2083
|
+
(close)="onClose()"
|
2084
|
+
(click)="$event.stopPropagation()"
|
2085
|
+
(itemClick)="onActionClick($event, sheet)">
|
2086
|
+
</kendo-dropdownbutton>
|
2087
|
+
</ng-template>
|
2088
|
+
</kendo-tabstrip-tab>
|
2089
|
+
</ng-container>
|
2017
2090
|
</kendo-tabstrip>
|
2018
|
-
`, 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]" }] });
|
2091
|
+
`, 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: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.TabTemplateDirective, selector: "[kendoTabTemplate]" }] });
|
2019
2092
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SheetsBarComponent, decorators: [{
|
2020
2093
|
type: Component,
|
2021
2094
|
args: [{
|
@@ -2048,25 +2121,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
2048
2121
|
[scrollable]="{prevButtonIcon: 'caret-alt-left', prevSVGButtonIcon: caretAltLeftIcon, nextButtonIcon: 'caret-alt-right', nextSVGButtonIcon: caretAltRightIcon}"
|
2049
2122
|
class="k-spreadsheet-sheets k-overflow-hidden"
|
2050
2123
|
(tabSelect)="onTabSelect($event)">
|
2051
|
-
<
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
<
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2069
|
-
|
2124
|
+
<ng-container *ngFor="let sheet of sheets">
|
2125
|
+
<kendo-tabstrip-tab
|
2126
|
+
*ngIf="sheet.state === 'visible'"
|
2127
|
+
[title]="sheet.text"
|
2128
|
+
[selected]="sheet.text === activeSheet">
|
2129
|
+
<ng-template kendoTabTemplate>
|
2130
|
+
<span class="k-link">{{sheet.text}}</span>
|
2131
|
+
<kendo-dropdownbutton #sheetDdb
|
2132
|
+
fillMode="flat"
|
2133
|
+
icon="caret-alt-down"
|
2134
|
+
[svgIcon]="caretAltDownIcon"
|
2135
|
+
buttonClass="k-menu-button"
|
2136
|
+
[data]="sheet.sheetActions"
|
2137
|
+
[buttonAttributes]="{'aria-hidden': 'true', 'tabindex': '-1', role: 'presentation'}"
|
2138
|
+
(open)="onOpen(sheetDdb)"
|
2139
|
+
(close)="onClose()"
|
2140
|
+
(click)="$event.stopPropagation()"
|
2141
|
+
(itemClick)="onActionClick($event, sheet)">
|
2142
|
+
</kendo-dropdownbutton>
|
2143
|
+
</ng-template>
|
2144
|
+
</kendo-tabstrip-tab>
|
2145
|
+
</ng-container>
|
2070
2146
|
</kendo-tabstrip>
|
2071
2147
|
`
|
2072
2148
|
}]
|
@@ -2100,7 +2176,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
2100
2176
|
class MessagesDirective extends ComponentMessages {
|
2101
2177
|
}
|
2102
2178
|
MessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessagesDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
2103
|
-
MessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: MessagesDirective, selector: "[kendoSpreadsheetMessages]", inputs: { home: "home", file: "file", insert: "insert", formatTab: "formatTab", 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", alignHorizontal: "alignHorizontal", alignVertical: "alignVertical", alignLeft: "alignLeft", alignCenter: "alignCenter", alignRight: "alignRight", alignJustify: "alignJustify", alignTop: "alignTop", alignMiddle: "alignMiddle", alignBottom: "alignBottom", dialogApply: "dialogApply", dialogCancel: "dialogCancel", dialogDelete: "dialogDelete", dialogRename: "dialogRename", dialogInsert: "dialogInsert", dialogRemoveLink: "dialogRemoveLink", delete: "delete", rename: "rename", nameBox: "nameBox", formulaInput: "formulaInput", addSheet: "addSheet", sheetsMenu: "sheetsMenu", view: "view", merge: "merge", mergeHorizontally: "mergeHorizontally", mergeVertically: "mergeVertically", mergeAll: "mergeAll", unmerge: "unmerge", insertLink: "insertLink", increaseDecimal: "increaseDecimal", decreaseDecimal: "decreaseDecimal", increaseFontSize: "increaseFontSize", decreaseFontSize: "decreaseFontSize", openUnsupported: "openUnsupported", modifyMerged: "modifyMerged", cannotModifyDisabled: "cannotModifyDisabled", dialogOk: "dialogOk", dialogError: "dialogError", duplicateSheetName: "duplicateSheetName", copy: "copy", cut: "cut", paste: "paste", hideRow: "hideRow", unhideRow: "unhideRow", hideColumn: "hideColumn", unhideColumn: "unhideColumn" }, usesInheritance: true, ngImport: i0 });
|
2179
|
+
MessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: MessagesDirective, selector: "[kendoSpreadsheetMessages]", inputs: { home: "home", file: "file", insert: "insert", formatTab: "formatTab", 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", alignHorizontal: "alignHorizontal", alignVertical: "alignVertical", alignLeft: "alignLeft", alignCenter: "alignCenter", alignRight: "alignRight", alignJustify: "alignJustify", alignTop: "alignTop", alignMiddle: "alignMiddle", alignBottom: "alignBottom", dialogApply: "dialogApply", dialogCancel: "dialogCancel", dialogDelete: "dialogDelete", dialogRename: "dialogRename", dialogInsert: "dialogInsert", dialogRemoveLink: "dialogRemoveLink", delete: "delete", rename: "rename", nameBox: "nameBox", formulaInput: "formulaInput", addSheet: "addSheet", sheetsMenu: "sheetsMenu", view: "view", merge: "merge", mergeHorizontally: "mergeHorizontally", mergeVertically: "mergeVertically", mergeAll: "mergeAll", unmerge: "unmerge", insertLink: "insertLink", increaseDecimal: "increaseDecimal", decreaseDecimal: "decreaseDecimal", increaseFontSize: "increaseFontSize", decreaseFontSize: "decreaseFontSize", openUnsupported: "openUnsupported", modifyMerged: "modifyMerged", cannotModifyDisabled: "cannotModifyDisabled", dialogOk: "dialogOk", dialogError: "dialogError", duplicateSheetName: "duplicateSheetName", copy: "copy", cut: "cut", paste: "paste", hideRow: "hideRow", unhideRow: "unhideRow", hideColumn: "hideColumn", unhideColumn: "unhideColumn", sheetDelete: "sheetDelete", sheetRename: "sheetRename", sheetHide: "sheetHide", sheetDuplicate: "sheetDuplicate", sheetMoveLeft: "sheetMoveLeft", sheetMoveRight: "sheetMoveRight" }, usesInheritance: true, ngImport: i0 });
|
2104
2180
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessagesDirective, decorators: [{
|
2105
2181
|
type: Directive,
|
2106
2182
|
args: [{
|
@@ -2246,6 +2322,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
2246
2322
|
type: Input
|
2247
2323
|
}], unhideColumn: [{
|
2248
2324
|
type: Input
|
2325
|
+
}], sheetDelete: [{
|
2326
|
+
type: Input
|
2327
|
+
}], sheetRename: [{
|
2328
|
+
type: Input
|
2329
|
+
}], sheetHide: [{
|
2330
|
+
type: Input
|
2331
|
+
}], sheetDuplicate: [{
|
2332
|
+
type: Input
|
2333
|
+
}], sheetMoveLeft: [{
|
2334
|
+
type: Input
|
2335
|
+
}], sheetMoveRight: [{
|
2336
|
+
type: Input
|
2249
2337
|
}] } });
|
2250
2338
|
|
2251
2339
|
/**
|
@@ -2594,9 +2682,7 @@ class SpreadsheetHorizontalTextAlignDirective {
|
|
2594
2682
|
host.icon = commandIcons[this.commandName];
|
2595
2683
|
host.arrowIcon = true;
|
2596
2684
|
host.fillMode = 'flat';
|
2597
|
-
host.data = ALIGNS
|
2598
|
-
.filter(value => value.commandName === 'textAlign')
|
2599
|
-
.map(item => (Object.assign(Object.assign({}, item), { textKey: localization.get(item.commandId) })));
|
2685
|
+
host.data = ALIGNS.flatMap(item => item.commandName === 'textAlign' ? [Object.assign(Object.assign({}, item), { textKey: localization.get(item.commandId) })] : []);
|
2600
2686
|
this.subs.add(host.itemClick.subscribe((e) => this.onItemClick(e)));
|
2601
2687
|
host.title = localization.get(this.commandName);
|
2602
2688
|
host.textField = 'textKey';
|
@@ -2638,9 +2724,7 @@ class SpreadsheetVerticalTextAlignDirective {
|
|
2638
2724
|
host.icon = commandIcons[this.commandName];
|
2639
2725
|
host.arrowIcon = true;
|
2640
2726
|
host.fillMode = 'flat';
|
2641
|
-
host.data = ALIGNS
|
2642
|
-
.filter(value => value.commandName === 'verticalAlign')
|
2643
|
-
.map(item => (Object.assign(Object.assign({}, item), { textKey: localization.get(item.commandId) })));
|
2727
|
+
host.data = ALIGNS.flatMap(item => item.commandName === 'verticalAlign' ? [Object.assign(Object.assign({}, item), { textKey: localization.get(item.commandId) })] : []);
|
2644
2728
|
this.subs.add(host.itemClick.subscribe((e) => this.onItemClick(e)));
|
2645
2729
|
host.title = localization.get(this.commandName);
|
2646
2730
|
host.textField = 'textKey';
|
@@ -3179,6 +3263,16 @@ class SpreadsheetComponent {
|
|
3179
3263
|
this.showLicenseWatermark = false;
|
3180
3264
|
this.contextMenuItems = [];
|
3181
3265
|
this.subs = new Subscription();
|
3266
|
+
/**
|
3267
|
+
* @hidden
|
3268
|
+
*/
|
3269
|
+
this.onKeyDown = (e) => {
|
3270
|
+
const isCtrl = e.ctrlKey || e.metaKey;
|
3271
|
+
const shift = e.shiftKey;
|
3272
|
+
if (isCtrl && shift && e.keyCode === Keys.KeyS) {
|
3273
|
+
this.spreadsheetService.onSheetsBarFocus.next();
|
3274
|
+
}
|
3275
|
+
};
|
3182
3276
|
this.onChange = (e) => {
|
3183
3277
|
hasObservers(this.change) && this.change.emit(e);
|
3184
3278
|
this.spreadsheetService.selectionChanged.next(e.range);
|
@@ -3273,7 +3367,7 @@ class SpreadsheetComponent {
|
|
3273
3367
|
* An array which defines the document sheets and their content.
|
3274
3368
|
*/
|
3275
3369
|
set sheets(value) {
|
3276
|
-
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
|
3370
|
+
const items = value.map((item, index, items) => (Object.assign(Object.assign({}, item), { state: item.state || 'visible', inEdit: false, first: index === 0, last: index === items.length - 1, text: item.name, active: (item.name === this.activeSheet) || items.length === 1, index })));
|
3277
3371
|
this._sheetsInfo = items;
|
3278
3372
|
}
|
3279
3373
|
get sheetsInfo() {
|
@@ -3295,6 +3389,7 @@ class SpreadsheetComponent {
|
|
3295
3389
|
spreadsheet.bind('changeFormat', this.onChangeFormat);
|
3296
3390
|
spreadsheet.bind('excelImport', this.onExcelImport);
|
3297
3391
|
spreadsheet.bind('excelExport', this.onExcelExport);
|
3392
|
+
spreadsheet.bind('keydown', this.onKeyDown);
|
3298
3393
|
spreadsheet.view.bind('update', this.updateState);
|
3299
3394
|
spreadsheet.view.bind('message', this.onMessage);
|
3300
3395
|
spreadsheet.bind('contextmenu', this.onContextMenu.bind(this));
|
@@ -3306,7 +3401,7 @@ class SpreadsheetComponent {
|
|
3306
3401
|
if (!this.sheetsInfo) {
|
3307
3402
|
this.ngZone.run(() => {
|
3308
3403
|
const defaultSheetDescriptors = mapToSheetDescriptor([spreadsheet === null || spreadsheet === void 0 ? void 0 : spreadsheet.activeSheet()]);
|
3309
|
-
this._sheetsInfo = [Object.assign(Object.assign({ text: this.spreadsheetService.currentActiveSheet, first: true, last: true }, defaultSheetDescriptors), { sheetActions: getSheetActions(
|
3404
|
+
this._sheetsInfo = [Object.assign(Object.assign({ text: this.spreadsheetService.currentActiveSheet, first: true, last: true, state: 'visible' }, defaultSheetDescriptors), { sheetActions: getSheetActions(defaultSheetDescriptors).map(item => (Object.assign(Object.assign({}, item), { text: this.messageFor(item.messageKey) }))) })];
|
3310
3405
|
});
|
3311
3406
|
}
|
3312
3407
|
});
|
@@ -3767,7 +3862,19 @@ SpreadsheetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
|
|
3767
3862
|
i18n-hideColumn="kendo.spreadsheet.hideColumn|The Hide column command text."
|
3768
3863
|
hideColumn="Hide"
|
3769
3864
|
i18n-unhideColumn="kendo.spreadsheet.unhideColumn|The Unhide column command text."
|
3770
|
-
unhideColumn="Unhide"
|
3865
|
+
unhideColumn="Unhide"
|
3866
|
+
i18n-sheetDelete="kendo.spreadsheet.sheetDelete|The text of the Sheet menu Delete option."
|
3867
|
+
sheetDelete="Delete"
|
3868
|
+
i18n-sheetRename="kendo.spreadsheet.sheetRename|The text of the Sheet menu Rename option."
|
3869
|
+
sheetRename="Rename"
|
3870
|
+
i18n-sheetDuplicate="kendo.spreadsheet.sheetDuplicate|The text of the Sheet menu Duplicate option."
|
3871
|
+
sheetDuplicate="Duplicate"
|
3872
|
+
i18n-sheetHide="kendo.spreadsheet.sheetHide|The text of the Sheet menu Hide option."
|
3873
|
+
sheetHide="Hide"
|
3874
|
+
i18n-sheetMoveLeft="kendo.spreadsheet.sheetMoveLeft|The text of the Sheet menu Move Left option."
|
3875
|
+
sheetMoveLeft="Move Left"
|
3876
|
+
i18n-sheetMoveRight="kendo.spreadsheet.sheetMoveRight|The text of the Sheet menu Move Right option."
|
3877
|
+
sheetMoveRight="Move Right">
|
3771
3878
|
</ng-container>
|
3772
3879
|
<div class="k-spreadsheet-header">
|
3773
3880
|
<kendo-menu kendoSpreadsheetMenu (select)="onMenuItemSelect($event)">
|
@@ -4034,7 +4141,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
4034
4141
|
i18n-hideColumn="kendo.spreadsheet.hideColumn|The Hide column command text."
|
4035
4142
|
hideColumn="Hide"
|
4036
4143
|
i18n-unhideColumn="kendo.spreadsheet.unhideColumn|The Unhide column command text."
|
4037
|
-
unhideColumn="Unhide"
|
4144
|
+
unhideColumn="Unhide"
|
4145
|
+
i18n-sheetDelete="kendo.spreadsheet.sheetDelete|The text of the Sheet menu Delete option."
|
4146
|
+
sheetDelete="Delete"
|
4147
|
+
i18n-sheetRename="kendo.spreadsheet.sheetRename|The text of the Sheet menu Rename option."
|
4148
|
+
sheetRename="Rename"
|
4149
|
+
i18n-sheetDuplicate="kendo.spreadsheet.sheetDuplicate|The text of the Sheet menu Duplicate option."
|
4150
|
+
sheetDuplicate="Duplicate"
|
4151
|
+
i18n-sheetHide="kendo.spreadsheet.sheetHide|The text of the Sheet menu Hide option."
|
4152
|
+
sheetHide="Hide"
|
4153
|
+
i18n-sheetMoveLeft="kendo.spreadsheet.sheetMoveLeft|The text of the Sheet menu Move Left option."
|
4154
|
+
sheetMoveLeft="Move Left"
|
4155
|
+
i18n-sheetMoveRight="kendo.spreadsheet.sheetMoveRight|The text of the Sheet menu Move Right option."
|
4156
|
+
sheetMoveRight="Move Right">
|
4038
4157
|
</ng-container>
|
4039
4158
|
<div class="k-spreadsheet-header">
|
4040
4159
|
<kendo-menu kendoSpreadsheetMenu (select)="onMenuItemSelect($event)">
|