@progress/kendo-react-spreadsheet 5.14.0-dev.202305291502 → 5.14.0-dev.202305311028
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/README.md +9 -0
- package/dist/cdn/js/kendo-react-spreadsheet.js +1 -1
- package/dist/es/NameBox.js +1 -1
- package/dist/es/SheetsBar.js +2 -2
- package/dist/es/Spreadsheet.js +20 -3
- package/dist/es/SpreadsheetProps.d.ts +54 -9
- package/dist/es/SpreadsheetProps.js +4 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/tools/align.d.ts +2 -2
- package/dist/es/tools/align.js +1 -1
- package/dist/es/tools/export.d.ts +2 -2
- package/dist/es/tools/export.js +1 -1
- package/dist/es/tools/fontFamily.js +1 -1
- package/dist/es/tools/fontSize.js +1 -1
- package/dist/es/tools/format.d.ts +2 -2
- package/dist/es/tools/format.js +1 -1
- package/dist/es/tools/gridLines.d.ts +2 -2
- package/dist/es/tools/gridLines.js +1 -1
- package/dist/es/tools/index.d.ts +1 -0
- package/dist/es/tools/open.d.ts +2 -2
- package/dist/es/tools/open.js +1 -1
- package/dist/es/tools/redo.d.ts +2 -2
- package/dist/es/tools/redo.js +3 -2
- package/dist/es/tools/tableTools.d.ts +7 -7
- package/dist/es/tools/tableTools.js +1 -1
- package/dist/es/tools/textWrap.d.ts +2 -2
- package/dist/es/tools/textWrap.js +1 -1
- package/dist/es/tools/undo.d.ts +2 -2
- package/dist/es/tools/undo.js +3 -2
- package/dist/es/tools/utils.d.ts +7 -10
- package/dist/es/tools/utils.js +3 -3
- package/dist/npm/NameBox.js +1 -1
- package/dist/npm/SheetsBar.js +2 -2
- package/dist/npm/Spreadsheet.js +20 -3
- package/dist/npm/SpreadsheetProps.d.ts +54 -9
- package/dist/npm/SpreadsheetProps.js +8 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/tools/align.d.ts +2 -2
- package/dist/npm/tools/align.js +1 -1
- package/dist/npm/tools/export.d.ts +2 -2
- package/dist/npm/tools/export.js +1 -1
- package/dist/npm/tools/fontFamily.js +1 -1
- package/dist/npm/tools/fontSize.js +1 -1
- package/dist/npm/tools/format.d.ts +2 -2
- package/dist/npm/tools/format.js +1 -1
- package/dist/npm/tools/gridLines.d.ts +2 -2
- package/dist/npm/tools/gridLines.js +1 -1
- package/dist/npm/tools/index.d.ts +1 -0
- package/dist/npm/tools/open.d.ts +2 -2
- package/dist/npm/tools/open.js +1 -1
- package/dist/npm/tools/redo.d.ts +2 -2
- package/dist/npm/tools/redo.js +2 -1
- package/dist/npm/tools/tableTools.d.ts +7 -7
- package/dist/npm/tools/tableTools.js +1 -1
- package/dist/npm/tools/textWrap.d.ts +2 -2
- package/dist/npm/tools/textWrap.js +1 -1
- package/dist/npm/tools/undo.d.ts +2 -2
- package/dist/npm/tools/undo.js +2 -1
- package/dist/npm/tools/utils.d.ts +7 -10
- package/dist/npm/tools/utils.js +3 -3
- package/dist/systemjs/kendo-react-spreadsheet.js +1 -1
- package/package.json +11 -11
package/dist/es/NameBox.js
CHANGED
|
@@ -85,7 +85,7 @@ export const NameBox = React.forwardRef((props, ref) => {
|
|
|
85
85
|
memo.prevValue = event.value.name;
|
|
86
86
|
}, []);
|
|
87
87
|
return (React.createElement("div", { className: "k-spreadsheet-name-editor", onKeyDown: onKeyDown },
|
|
88
|
-
React.createElement(ComboBox, { ref: comboboxRef, title: useLocalization().toLanguageString(keys.nameBox, messages[keys.nameBox]), popupSettings: { className: 'k-spreadsheet-names-popup' }, clearButton: false, dataItemKey: "name", textField: "name", itemRender: itemRender, data: data, value: value ? (data.find((d) => d.name === name) || { name: value }) : null, onChange: onChange, opened: open, onOpen: onOpen, onClose: onClose, onFocus: onFocus, listNoDataRender: listNoDataRender, allowCustom: true })));
|
|
88
|
+
React.createElement(ComboBox, { ref: comboboxRef, title: useLocalization().toLanguageString(keys.nameBox, messages[keys.nameBox]), popupSettings: { className: 'k-spreadsheet-names-popup' }, fillMode: "flat", clearButton: false, dataItemKey: "name", textField: "name", itemRender: itemRender, data: data, value: value ? (data.find((d) => d.name === name) || { name: value }) : null, onChange: onChange, opened: open, onOpen: onOpen, onClose: onClose, onFocus: onFocus, listNoDataRender: listNoDataRender, allowCustom: true })));
|
|
89
89
|
});
|
|
90
90
|
NameBox.displayName = 'NameBox';
|
|
91
91
|
NameBox.propTypes = {};
|
package/dist/es/SheetsBar.js
CHANGED
|
@@ -229,7 +229,7 @@ export const SheetsBar = (props) => {
|
|
|
229
229
|
selectActiveSheet();
|
|
230
230
|
}
|
|
231
231
|
}, []);
|
|
232
|
-
return (React.createElement("div", { className: "k-spreadsheet-sheets-bar" },
|
|
233
|
-
React.createElement(Button, { fillMode: "flat", icon: "plus", title: useLocalization().toLanguageString(keys.addNewSheet, messages[keys.addNewSheet]), svgIcon: plusIcon, onClick: onAddSheet }),
|
|
232
|
+
return (React.createElement("div", { className: "k-spreadsheet-sheets-bar k-header" },
|
|
233
|
+
React.createElement(Button, { fillMode: "flat", icon: "plus", className: "k-spreadsheet-sheets-bar-add", title: useLocalization().toLanguageString(keys.addNewSheet, messages[keys.addNewSheet]), svgIcon: plusIcon, onClick: onAddSheet }),
|
|
234
234
|
React.createElement(Tabs, { sheets: sheets, setSheets: setSheets, onSheetSelect: onSelect, onSheetDelete: onSheetDelete, onSheetEdit: onSheetRename, onSheetReorderEnd: onSheetReorderEnd })));
|
|
235
235
|
};
|
package/dist/es/Spreadsheet.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
|
-
import { Spreadsheet as SpreadsheetInstance } from '@progress/kendo-spreadsheet-common';
|
|
4
3
|
import { ButtonGroup, Toolbar, ToolbarSeparator } from '@progress/kendo-react-buttons';
|
|
5
4
|
import { TabStrip, TabStripTab } from '@progress/kendo-react-layout';
|
|
6
5
|
import { FormulaInput } from './FormulaInput';
|
|
7
6
|
import { NameBox } from './NameBox';
|
|
8
7
|
import { SheetsBar } from './SheetsBar';
|
|
8
|
+
import { SpreadsheetWidget } from './SpreadsheetProps';
|
|
9
9
|
import { defaultTabs } from './tools/defaultTools';
|
|
10
10
|
import { IconWrap, classNames, validatePackage } from '@progress/kendo-react-common';
|
|
11
11
|
import { packageMetadata } from './package-metadata';
|
|
12
12
|
import { formulaFxIcon } from '@progress/kendo-svg-icons';
|
|
13
13
|
import { useInternationalization, useLocalization } from '@progress/kendo-react-intl';
|
|
14
|
+
import { saveAs } from '@progress/kendo-file-saver';
|
|
15
|
+
import { Workbook } from '@progress/kendo-ooxml';
|
|
14
16
|
import { keys, messages } from './messages';
|
|
15
17
|
const toolsFunctions = ['bold', 'italic', 'underline', 'fontFamily', 'fontSize', 'color', 'background', 'textAlign', 'verticalAlign', 'wrap', 'gridLines'];
|
|
16
18
|
const toolsValueMap = {
|
|
@@ -88,7 +90,22 @@ export const Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
88
90
|
React.useImperativeHandle(target, () => ({
|
|
89
91
|
element: elementRef.current,
|
|
90
92
|
get instance() { return spreadsheetRef.current; },
|
|
91
|
-
props
|
|
93
|
+
props,
|
|
94
|
+
get view() { return spreadsheetRef.current.view; },
|
|
95
|
+
get workbook() { return spreadsheetRef.current.workbook; },
|
|
96
|
+
executeCommand(options) { var _a; (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.executeCommand(options); },
|
|
97
|
+
fromJSON(json) { var _a; return (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.fromJSON(json); },
|
|
98
|
+
toJSON() { return spreadsheetRef.current.toJSON(); },
|
|
99
|
+
saveJSON() { return spreadsheetRef.current.saveJSON(); },
|
|
100
|
+
fromFile(file) { return spreadsheetRef.current.fromFile(file); },
|
|
101
|
+
saveAsExcel(options) {
|
|
102
|
+
var _a;
|
|
103
|
+
(_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.saveAsExcel(Object.assign(Object.assign(Object.assign({}, spreadsheetRef.current.options.excel), { saveAs,
|
|
104
|
+
Workbook }), options));
|
|
105
|
+
},
|
|
106
|
+
activeSheet(sheet) { var _a; return (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.activeSheet(sheet); },
|
|
107
|
+
sheets() { return spreadsheetRef.current.sheets(); },
|
|
108
|
+
refresh() { var _a; return (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.refresh(); }
|
|
92
109
|
}), [props]);
|
|
93
110
|
React.useImperativeHandle(ref, () => target.current);
|
|
94
111
|
const nameEditor = React.useCallback(() => {
|
|
@@ -124,7 +141,7 @@ export const Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
124
141
|
}, formulaBarInputRef,
|
|
125
142
|
formulaCellInputRef,
|
|
126
143
|
nameBoxRef });
|
|
127
|
-
const spreadsheet = new
|
|
144
|
+
const spreadsheet = new SpreadsheetWidget(elementRef.current, options);
|
|
128
145
|
spreadsheetRef.current = spreadsheet;
|
|
129
146
|
spreadsheet.bind('select', onSelect);
|
|
130
147
|
spreadsheet.bind('change', onChange);
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Workbook } from '@progress/kendo-ooxml';
|
|
3
|
-
import { SpreadsheetOptions as SpreadsheetOpts, Spreadsheet, Range
|
|
4
|
-
export
|
|
2
|
+
import { Workbook as OoxmlWorkbook } from '@progress/kendo-ooxml';
|
|
3
|
+
import { SpreadsheetOptions as SpreadsheetOpts, Spreadsheet, Range, DocumentDescriptor, View, Sheet, ExcelExportSettings, SheetDescriptor, Workbook } from '@progress/kendo-spreadsheet-common';
|
|
4
|
+
export declare class SpreadsheetWidget extends Spreadsheet {
|
|
5
5
|
}
|
|
6
|
-
export interface SpreadsheetOptions extends SpreadsheetOpts {
|
|
6
|
+
export interface SpreadsheetOptions extends Omit<SpreadsheetOpts, 'formulaBarInputRef' | 'formulaCellInputRef' | 'nameBoxRef' | 'locale'> {
|
|
7
7
|
}
|
|
8
|
+
export { DocumentDescriptor, View, Workbook, Sheet, SheetDescriptor, ExcelExportSettings };
|
|
8
9
|
interface SpreadsheetEvent {
|
|
9
10
|
/**
|
|
10
11
|
* The widget instance which fired the event.
|
|
11
12
|
*/
|
|
12
|
-
sender:
|
|
13
|
+
sender: SpreadsheetWidget;
|
|
13
14
|
}
|
|
14
15
|
export interface SpreadsheetSelectEvent extends SpreadsheetEvent {
|
|
15
16
|
/**
|
|
16
17
|
* The Range that is selected.
|
|
17
18
|
*/
|
|
18
|
-
range:
|
|
19
|
+
range: Range;
|
|
19
20
|
}
|
|
20
21
|
export interface SpreadsheetChangeEvent extends SpreadsheetEvent, SpreadsheetSelectEvent {
|
|
21
22
|
}
|
|
@@ -38,7 +39,7 @@ export interface SpreadsheetExcelExportEvent extends SpreadsheetEvent {
|
|
|
38
39
|
* The Excel workbook configuration object.
|
|
39
40
|
* Modifications of the workbook will reflect in the output Excel document.
|
|
40
41
|
*/
|
|
41
|
-
workbook:
|
|
42
|
+
workbook: OoxmlWorkbook;
|
|
42
43
|
/**
|
|
43
44
|
* If invoked, the Spreadsheet will not save the generated file.
|
|
44
45
|
*/
|
|
@@ -96,6 +97,50 @@ export interface SpreadsheetHandle {
|
|
|
96
97
|
* The props values of the Spreadsheet.
|
|
97
98
|
*/
|
|
98
99
|
props: SpreadsheetProps;
|
|
99
|
-
instance:
|
|
100
|
+
instance: SpreadsheetWidget | null;
|
|
101
|
+
get view(): View;
|
|
102
|
+
get workbook(): Workbook;
|
|
103
|
+
executeCommand(options: any): void;
|
|
104
|
+
/**
|
|
105
|
+
* Loads the workbook data from an object with the format that is defined in the configuration.
|
|
106
|
+
*
|
|
107
|
+
* Note: All existing sheets and their data will be lost.
|
|
108
|
+
*
|
|
109
|
+
* @param json The object from where data will be loaded. This has to be the deserialized object, not the JSON string.
|
|
110
|
+
*/
|
|
111
|
+
fromJSON(json: DocumentDescriptor): void;
|
|
112
|
+
/**
|
|
113
|
+
* Serializes the workbook.
|
|
114
|
+
*/
|
|
115
|
+
toJSON(): DocumentDescriptor;
|
|
116
|
+
/**
|
|
117
|
+
* Serializes the workbook. This method does not return the JSON, but a Promise object which will yield the JSON data when it is available.
|
|
118
|
+
* The method is functionally similar to `toJSON`, but it is also able to save the embedded images (this is the reason why it must be asynchronous).
|
|
119
|
+
*/
|
|
120
|
+
saveJSON(): Promise<DocumentDescriptor>;
|
|
121
|
+
/**
|
|
122
|
+
* Clears the Spreadsheet and populates it with data from the specified Excel (.xlsx) file.
|
|
123
|
+
*
|
|
124
|
+
* @param blob The file or blob that is usually obtained through a file input.
|
|
125
|
+
*/
|
|
126
|
+
fromFile(file: File | Blob): void;
|
|
127
|
+
/**
|
|
128
|
+
* Initiates the Excel export. Also fires the excelExport event.
|
|
129
|
+
*
|
|
130
|
+
* Node: Calling this method may trigger the built-in popup blocker of the browser.
|
|
131
|
+
* To avoid that, always call it as a response to an end-user action, for example, a button click.
|
|
132
|
+
*/
|
|
133
|
+
saveAsExcel(options: any): void;
|
|
134
|
+
/**
|
|
135
|
+
* Gets or sets the active sheet.
|
|
136
|
+
*/
|
|
137
|
+
activeSheet(sheet?: Sheet): Sheet | void;
|
|
138
|
+
/**
|
|
139
|
+
* Returns an array with the sheets in the workbook.
|
|
140
|
+
*/
|
|
141
|
+
sheets(): Sheet[];
|
|
142
|
+
/**
|
|
143
|
+
* Re-renders all data in the Spreadsheet.
|
|
144
|
+
*/
|
|
145
|
+
refresh(): void;
|
|
100
146
|
}
|
|
101
|
-
export {};
|
|
@@ -5,7 +5,7 @@ export const packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-spreadsheet',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1685528389,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
package/dist/es/tools/align.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface AlignmentProps extends
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
export interface AlignmentProps extends SpreadsheetToolProps {
|
|
4
4
|
value: {
|
|
5
5
|
textAlign?: string;
|
|
6
6
|
verticalAlign?: string;
|
package/dist/es/tools/align.js
CHANGED
|
@@ -34,6 +34,6 @@ export const Alignment = props => {
|
|
|
34
34
|
if (verticalAlign) {
|
|
35
35
|
items = items.map(i => i.commandName === 'verticalAlign' ? Object.assign(Object.assign({}, i), { selected: i.value === verticalAlign }) : i);
|
|
36
36
|
}
|
|
37
|
-
return (React.createElement(DropDownButton, { icon: "align-left", svgIcon: alignLeftIcon, items: items, onItemClick: onItemClick, title: loc.toLanguageString(keys.align, messages[keys.align]), text: React.createElement(IconWrap, { name: "caret-alt-down", icon: caretAltDownIcon }) }));
|
|
37
|
+
return (React.createElement(DropDownButton, { icon: "align-left", svgIcon: alignLeftIcon, items: items, fillMode: "flat", onItemClick: onItemClick, title: loc.toLanguageString(keys.align, messages[keys.align]), text: React.createElement(IconWrap, { name: "caret-alt-down", icon: caretAltDownIcon }) }));
|
|
38
38
|
};
|
|
39
39
|
Alignment.displayName = 'Alignment';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface ExcelExportProps extends
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
export interface ExcelExportProps extends SpreadsheetToolProps {
|
|
4
4
|
}
|
|
5
5
|
export declare const ExcelExport: React.FunctionComponent<ExcelExportProps>;
|
package/dist/es/tools/export.js
CHANGED
|
@@ -11,6 +11,6 @@ export const ExcelExport = props => {
|
|
|
11
11
|
Workbook }));
|
|
12
12
|
}
|
|
13
13
|
}, []);
|
|
14
|
-
return (React.createElement(Button, { className: 'k-toolbar-button', title: 'Export...', icon: 'download', svgIcon: downloadIcon, onClick: onDownload }));
|
|
14
|
+
return (React.createElement(Button, { className: 'k-toolbar-button', title: 'Export...', icon: 'download', fillMode: "flat", svgIcon: downloadIcon, onClick: onDownload }));
|
|
15
15
|
};
|
|
16
16
|
ExcelExport.displayName = 'ExcelExport';
|
|
@@ -13,6 +13,6 @@ export const FontFamily = props => {
|
|
|
13
13
|
spreadsheetRef.current.executeCommand(options);
|
|
14
14
|
}
|
|
15
15
|
}, []);
|
|
16
|
-
return (React.createElement(DropDownList, { onChange: onChange, value: value, data: FONT_FAMILIES, defaultValue: DEFAULT_FONT_FAMILY, title: useLocalization().toLanguageString(keys.fontName, messages[keys.fontName]), leftRightKeysNavigation: false }));
|
|
16
|
+
return (React.createElement(DropDownList, { onChange: onChange, value: value, data: FONT_FAMILIES, defaultValue: DEFAULT_FONT_FAMILY, fillMode: "flat", title: useLocalization().toLanguageString(keys.fontName, messages[keys.fontName]), leftRightKeysNavigation: false }));
|
|
17
17
|
};
|
|
18
18
|
FontFamily.displayName = 'FontFamily';
|
|
@@ -15,6 +15,6 @@ export const FontSize = props => {
|
|
|
15
15
|
}
|
|
16
16
|
}, 0);
|
|
17
17
|
}, []);
|
|
18
|
-
return (React.createElement(ComboBox, { onChange: onChange, value: value, data: FONT_SIZES, defaultValue: DEFAULT_FONT_SIZE, allowCustom: true, title: useLocalization().toLanguageString(keys.fontSize, messages[keys.fontSize]), tabIndex: -1, clearButton: false }));
|
|
18
|
+
return (React.createElement(ComboBox, { onChange: onChange, value: value, data: FONT_SIZES, defaultValue: DEFAULT_FONT_SIZE, allowCustom: true, fillMode: "flat", title: useLocalization().toLanguageString(keys.fontSize, messages[keys.fontSize]), tabIndex: -1, clearButton: false }));
|
|
19
19
|
};
|
|
20
20
|
FontSize.displayName = 'FontSize';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface FormatProps extends
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
export interface FormatProps extends SpreadsheetToolProps {
|
|
4
4
|
}
|
|
5
5
|
export declare const Format: React.FunctionComponent<FormatProps>;
|
package/dist/es/tools/format.js
CHANGED
|
@@ -18,6 +18,6 @@ export const Format = props => {
|
|
|
18
18
|
}
|
|
19
19
|
}, 0);
|
|
20
20
|
}, []);
|
|
21
|
-
return (React.createElement(DropDownButton, { icon: 'custom-format', svgIcon: customFormatIcon, onItemClick: onChange, items: FORMATS, title: useLocalization().toLanguageString(keys.format, messages[keys.format]), text: React.createElement(IconWrap, { name: "caret-alt-down" }) }));
|
|
21
|
+
return (React.createElement(DropDownButton, { icon: 'custom-format', svgIcon: customFormatIcon, fillMode: "flat", onItemClick: onChange, items: FORMATS, title: useLocalization().toLanguageString(keys.format, messages[keys.format]), text: React.createElement(IconWrap, { name: "caret-alt-down" }) }));
|
|
22
22
|
};
|
|
23
23
|
Format.displayName = 'Format';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface GridLinesProps extends
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
export interface GridLinesProps extends SpreadsheetToolProps {
|
|
4
4
|
value?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const GridLines: React.FunctionComponent<GridLinesProps>;
|
|
@@ -17,6 +17,6 @@ export const GridLines = props => {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}, []);
|
|
20
|
-
return (React.createElement(Button, { type: 'button', togglable: true, icon: 'borders-none', svgIcon: bordersNoneIcon, title: useLocalization().toLanguageString(keys.gridLines, messages[keys.gridLines]), onClick: onClick, selected: selected }));
|
|
20
|
+
return (React.createElement(Button, { type: 'button', togglable: true, icon: 'borders-none', svgIcon: bordersNoneIcon, fillMode: "flat", title: useLocalization().toLanguageString(keys.gridLines, messages[keys.gridLines]), onClick: onClick, selected: selected }));
|
|
21
21
|
};
|
|
22
22
|
GridLines.displayName = 'GridLines';
|
package/dist/es/tools/index.d.ts
CHANGED
package/dist/es/tools/open.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface OpenProps extends
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
export interface OpenProps extends SpreadsheetToolProps {
|
|
4
4
|
}
|
|
5
5
|
export declare const Open: React.FunctionComponent<OpenProps>;
|
package/dist/es/tools/open.js
CHANGED
|
@@ -26,7 +26,7 @@ export const Open = props => {
|
|
|
26
26
|
}
|
|
27
27
|
}, []);
|
|
28
28
|
return (React.createElement(React.Fragment, null,
|
|
29
|
-
React.createElement(Button, { className: 'k-toolbar-button', title: useLocalization().toLanguageString(keys.open, messages[keys.open]), icon: 'folder-open', svgIcon: folderOpenIcon, onClick: onFileOpen }),
|
|
29
|
+
React.createElement(Button, { className: 'k-toolbar-button', title: useLocalization().toLanguageString(keys.open, messages[keys.open]), icon: 'folder-open', svgIcon: folderOpenIcon, fillMode: "flat", onClick: onFileOpen }),
|
|
30
30
|
React.createElement("div", { style: { display: 'none' } },
|
|
31
31
|
React.createElement(Upload, { restrictions: { allowedExtensions: ['.xlsx'] }, onAdd: onAdd, autoUpload: false, defaultFiles: [], multiple: false, accept: ".xlsx,.XLSX", withCredentials: false }))));
|
|
32
32
|
};
|
package/dist/es/tools/redo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export interface RedoProps extends
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
export interface RedoProps extends SpreadsheetToolProps {
|
|
4
4
|
}
|
|
5
5
|
export declare const Redo: React.FunctionComponent<RedoProps>;
|
package/dist/es/tools/redo.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { arrowRotateCwIcon } from '@progress/kendo-svg-icons';
|
|
2
2
|
import { UndoRedo } from './utils';
|
|
3
3
|
import { keys } from '../messages';
|
|
4
|
-
|
|
4
|
+
const redoSettings = { action: 'redo', icon: 'reload', svgIcon: arrowRotateCwIcon, titleKey: keys.redo };
|
|
5
|
+
export const Redo = UndoRedo(redoSettings);
|
|
5
6
|
Redo.displayName = 'Redo';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface AddColumnLeftProps extends
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
export interface AddColumnLeftProps extends SpreadsheetToolProps {
|
|
4
4
|
}
|
|
5
|
-
export interface AddColumnRightProps extends
|
|
5
|
+
export interface AddColumnRightProps extends SpreadsheetToolProps {
|
|
6
6
|
}
|
|
7
|
-
export interface AddRowBelowProps extends
|
|
7
|
+
export interface AddRowBelowProps extends SpreadsheetToolProps {
|
|
8
8
|
}
|
|
9
|
-
export interface AddRowAboveProps extends
|
|
9
|
+
export interface AddRowAboveProps extends SpreadsheetToolProps {
|
|
10
10
|
}
|
|
11
|
-
export interface DeleteColumnProps extends
|
|
11
|
+
export interface DeleteColumnProps extends SpreadsheetToolProps {
|
|
12
12
|
}
|
|
13
|
-
export interface DeleteRowProps extends
|
|
13
|
+
export interface DeleteRowProps extends SpreadsheetToolProps {
|
|
14
14
|
}
|
|
15
15
|
export declare const AddColumnLeft: React.FunctionComponent<AddColumnLeftProps>;
|
|
16
16
|
export declare const AddColumnRight: React.FunctionComponent<AddColumnRightProps>;
|
|
@@ -14,7 +14,7 @@ const TableDataTool = (settings) => {
|
|
|
14
14
|
spreadsheetRef.current.executeCommand(options);
|
|
15
15
|
}
|
|
16
16
|
}, []);
|
|
17
|
-
return (React.createElement(Button, { type: "button", icon: settings.icon, svgIcon: settings.svgIcon, title: useLocalization().toLanguageString(settings.titleKey, messages[settings.titleKey]), onClick: onClick }));
|
|
17
|
+
return (React.createElement(Button, { type: "button", icon: settings.icon, svgIcon: settings.svgIcon, fillMode: "flat", title: useLocalization().toLanguageString(settings.titleKey, messages[settings.titleKey]), onClick: onClick }));
|
|
18
18
|
};
|
|
19
19
|
return tool;
|
|
20
20
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface TextWrapProps extends
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
export interface TextWrapProps extends SpreadsheetToolProps {
|
|
4
4
|
value?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const TextWrap: React.FunctionComponent<TextWrapProps>;
|
|
@@ -18,6 +18,6 @@ export const TextWrap = props => {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}, []);
|
|
21
|
-
return (React.createElement(Button, { type: 'button', togglable: true, icon: 'text-wrap', svgIcon: textWrapIcon, title: useLocalization().toLanguageString(keys.textWrap, messages[keys.textWrap]), onClick: onClick, selected: selected }));
|
|
21
|
+
return (React.createElement(Button, { type: 'button', togglable: true, icon: 'text-wrap', svgIcon: textWrapIcon, fillMode: "flat", title: useLocalization().toLanguageString(keys.textWrap, messages[keys.textWrap]), onClick: onClick, selected: selected }));
|
|
22
22
|
};
|
|
23
23
|
TextWrap.displayName = 'TextWrap';
|
package/dist/es/tools/undo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export interface UndoProps extends
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
export interface UndoProps extends SpreadsheetToolProps {
|
|
4
4
|
}
|
|
5
5
|
export declare const Undo: React.FunctionComponent<UndoProps>;
|
package/dist/es/tools/undo.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { arrowRotateCcwIcon } from '@progress/kendo-svg-icons';
|
|
2
2
|
import { UndoRedo } from './utils';
|
|
3
3
|
import { keys } from '../messages';
|
|
4
|
-
|
|
4
|
+
const undoSettings = { action: 'undo', icon: 'reset', svgIcon: arrowRotateCcwIcon, titleKey: keys.undo };
|
|
5
|
+
export const Undo = UndoRedo(undoSettings);
|
|
5
6
|
Undo.displayName = 'Undo';
|
package/dist/es/tools/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SpreadsheetWidget } from './../SpreadsheetProps';
|
|
3
3
|
import { ColorPickerProps } from '@progress/kendo-react-inputs';
|
|
4
4
|
import { SVGIcon } from '@progress/kendo-react-common';
|
|
5
5
|
/**
|
|
@@ -28,22 +28,19 @@ export declare const FORMATS: ({
|
|
|
28
28
|
text: string;
|
|
29
29
|
value: string;
|
|
30
30
|
})[];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*/
|
|
34
|
-
export interface BaseToolProps {
|
|
35
|
-
spreadsheetRef: React.RefObject<SpreadsheetInstance>;
|
|
31
|
+
export interface SpreadsheetToolProps {
|
|
32
|
+
spreadsheetRef: React.RefObject<SpreadsheetWidget>;
|
|
36
33
|
}
|
|
37
34
|
/**
|
|
38
35
|
* @hidden
|
|
39
36
|
*/
|
|
40
|
-
export interface PropertyChangeToolProps extends
|
|
37
|
+
export interface PropertyChangeToolProps extends SpreadsheetToolProps {
|
|
41
38
|
value?: boolean;
|
|
42
39
|
}
|
|
43
40
|
/**
|
|
44
41
|
* @hidden
|
|
45
42
|
*/
|
|
46
|
-
export interface DropDownToolProps extends
|
|
43
|
+
export interface DropDownToolProps extends SpreadsheetToolProps {
|
|
47
44
|
value?: any;
|
|
48
45
|
}
|
|
49
46
|
/**
|
|
@@ -58,7 +55,7 @@ export declare const PropertyChangeTool: <Props extends PropertyChangeToolProps>
|
|
|
58
55
|
/**
|
|
59
56
|
* @hidden
|
|
60
57
|
*/
|
|
61
|
-
export interface ColorToolProps extends
|
|
58
|
+
export interface ColorToolProps extends SpreadsheetToolProps {
|
|
62
59
|
value?: string;
|
|
63
60
|
}
|
|
64
61
|
/**
|
|
@@ -71,7 +68,7 @@ export declare const ColorTool: <Props extends ColorToolProps>(settings: ColorPi
|
|
|
71
68
|
/**
|
|
72
69
|
* @hidden
|
|
73
70
|
*/
|
|
74
|
-
export declare const UndoRedo: <Props extends
|
|
71
|
+
export declare const UndoRedo: <Props extends SpreadsheetToolProps>(settings: {
|
|
75
72
|
action: string;
|
|
76
73
|
icon: string;
|
|
77
74
|
svgIcon: SVGIcon;
|
package/dist/es/tools/utils.js
CHANGED
|
@@ -61,7 +61,7 @@ export const PropertyChangeTool = (settings) => {
|
|
|
61
61
|
spreadsheetRef.current.executeCommand(options);
|
|
62
62
|
}
|
|
63
63
|
}, [selected]);
|
|
64
|
-
return (React.createElement(Button, { type: "button", icon: icon, svgIcon: svgIcon, togglable: true, onClick: onClick, selected: selected, title: useLocalization().toLanguageString(titleKey, messages[titleKey]) }));
|
|
64
|
+
return (React.createElement(Button, { type: "button", icon: icon, svgIcon: svgIcon, fillMode: "flat", togglable: true, onClick: onClick, selected: selected, title: useLocalization().toLanguageString(titleKey, messages[titleKey]) }));
|
|
65
65
|
};
|
|
66
66
|
return tool;
|
|
67
67
|
};
|
|
@@ -80,7 +80,7 @@ export const ColorTool = (settings) => {
|
|
|
80
80
|
spreadsheetRef.current.executeCommand(options);
|
|
81
81
|
}
|
|
82
82
|
}, [property]);
|
|
83
|
-
return (React.createElement(ColorPicker, Object.assign({ onChange: onChange, onActiveColorClick: onChange }, colorPickerProps, { title: useLocalization().toLanguageString(titleKey, messages[titleKey]), value: value })));
|
|
83
|
+
return (React.createElement(ColorPicker, Object.assign({ onChange: onChange, onActiveColorClick: onChange, fillMode: "flat" }, colorPickerProps, { title: useLocalization().toLanguageString(titleKey, messages[titleKey]), value: value })));
|
|
84
84
|
};
|
|
85
85
|
return tool;
|
|
86
86
|
};
|
|
@@ -96,7 +96,7 @@ export const UndoRedo = (settings) => {
|
|
|
96
96
|
workbook.undoRedoStack[settings.action]();
|
|
97
97
|
}
|
|
98
98
|
}, []);
|
|
99
|
-
return (React.createElement(Button, { type: "button", icon: settings.icon, svgIcon: settings.svgIcon, title: useLocalization().toLanguageString(settings.titleKey, messages[settings.titleKey]), onClick: onClick }));
|
|
99
|
+
return (React.createElement(Button, { type: "button", icon: settings.icon, svgIcon: settings.svgIcon, fillMode: "flat", title: useLocalization().toLanguageString(settings.titleKey, messages[settings.titleKey]), onClick: onClick }));
|
|
100
100
|
};
|
|
101
101
|
return tool;
|
|
102
102
|
};
|
package/dist/npm/NameBox.js
CHANGED
|
@@ -88,7 +88,7 @@ exports.NameBox = React.forwardRef((props, ref) => {
|
|
|
88
88
|
memo.prevValue = event.value.name;
|
|
89
89
|
}, []);
|
|
90
90
|
return (React.createElement("div", { className: "k-spreadsheet-name-editor", onKeyDown: onKeyDown },
|
|
91
|
-
React.createElement(kendo_react_dropdowns_1.ComboBox, { ref: comboboxRef, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.nameBox, messages_1.messages[messages_1.keys.nameBox]), popupSettings: { className: 'k-spreadsheet-names-popup' }, clearButton: false, dataItemKey: "name", textField: "name", itemRender: itemRender, data: data, value: value ? (data.find((d) => d.name === name) || { name: value }) : null, onChange: onChange, opened: open, onOpen: onOpen, onClose: onClose, onFocus: onFocus, listNoDataRender: listNoDataRender, allowCustom: true })));
|
|
91
|
+
React.createElement(kendo_react_dropdowns_1.ComboBox, { ref: comboboxRef, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.nameBox, messages_1.messages[messages_1.keys.nameBox]), popupSettings: { className: 'k-spreadsheet-names-popup' }, fillMode: "flat", clearButton: false, dataItemKey: "name", textField: "name", itemRender: itemRender, data: data, value: value ? (data.find((d) => d.name === name) || { name: value }) : null, onChange: onChange, opened: open, onOpen: onOpen, onClose: onClose, onFocus: onFocus, listNoDataRender: listNoDataRender, allowCustom: true })));
|
|
92
92
|
});
|
|
93
93
|
exports.NameBox.displayName = 'NameBox';
|
|
94
94
|
exports.NameBox.propTypes = {};
|
package/dist/npm/SheetsBar.js
CHANGED
|
@@ -232,8 +232,8 @@ const SheetsBar = (props) => {
|
|
|
232
232
|
selectActiveSheet();
|
|
233
233
|
}
|
|
234
234
|
}, []);
|
|
235
|
-
return (React.createElement("div", { className: "k-spreadsheet-sheets-bar" },
|
|
236
|
-
React.createElement(kendo_react_buttons_1.Button, { fillMode: "flat", icon: "plus", title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.addNewSheet, messages_1.messages[messages_1.keys.addNewSheet]), svgIcon: kendo_svg_icons_1.plusIcon, onClick: onAddSheet }),
|
|
235
|
+
return (React.createElement("div", { className: "k-spreadsheet-sheets-bar k-header" },
|
|
236
|
+
React.createElement(kendo_react_buttons_1.Button, { fillMode: "flat", icon: "plus", className: "k-spreadsheet-sheets-bar-add", title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.addNewSheet, messages_1.messages[messages_1.keys.addNewSheet]), svgIcon: kendo_svg_icons_1.plusIcon, onClick: onAddSheet }),
|
|
237
237
|
React.createElement(Tabs, { sheets: sheets, setSheets: setSheets, onSheetSelect: onSelect, onSheetDelete: onSheetDelete, onSheetEdit: onSheetRename, onSheetReorderEnd: onSheetReorderEnd })));
|
|
238
238
|
};
|
|
239
239
|
exports.SheetsBar = SheetsBar;
|
package/dist/npm/Spreadsheet.js
CHANGED
|
@@ -3,17 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Spreadsheet = void 0;
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const PropTypes = require("prop-types");
|
|
6
|
-
const kendo_spreadsheet_common_1 = require("@progress/kendo-spreadsheet-common");
|
|
7
6
|
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
8
7
|
const kendo_react_layout_1 = require("@progress/kendo-react-layout");
|
|
9
8
|
const FormulaInput_1 = require("./FormulaInput");
|
|
10
9
|
const NameBox_1 = require("./NameBox");
|
|
11
10
|
const SheetsBar_1 = require("./SheetsBar");
|
|
11
|
+
const SpreadsheetProps_1 = require("./SpreadsheetProps");
|
|
12
12
|
const defaultTools_1 = require("./tools/defaultTools");
|
|
13
13
|
const kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
14
14
|
const package_metadata_1 = require("./package-metadata");
|
|
15
15
|
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
16
16
|
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
17
|
+
const kendo_file_saver_1 = require("@progress/kendo-file-saver");
|
|
18
|
+
const kendo_ooxml_1 = require("@progress/kendo-ooxml");
|
|
17
19
|
const messages_1 = require("./messages");
|
|
18
20
|
const toolsFunctions = ['bold', 'italic', 'underline', 'fontFamily', 'fontSize', 'color', 'background', 'textAlign', 'verticalAlign', 'wrap', 'gridLines'];
|
|
19
21
|
const toolsValueMap = {
|
|
@@ -91,7 +93,22 @@ exports.Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
91
93
|
React.useImperativeHandle(target, () => ({
|
|
92
94
|
element: elementRef.current,
|
|
93
95
|
get instance() { return spreadsheetRef.current; },
|
|
94
|
-
props
|
|
96
|
+
props,
|
|
97
|
+
get view() { return spreadsheetRef.current.view; },
|
|
98
|
+
get workbook() { return spreadsheetRef.current.workbook; },
|
|
99
|
+
executeCommand(options) { var _a; (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.executeCommand(options); },
|
|
100
|
+
fromJSON(json) { var _a; return (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.fromJSON(json); },
|
|
101
|
+
toJSON() { return spreadsheetRef.current.toJSON(); },
|
|
102
|
+
saveJSON() { return spreadsheetRef.current.saveJSON(); },
|
|
103
|
+
fromFile(file) { return spreadsheetRef.current.fromFile(file); },
|
|
104
|
+
saveAsExcel(options) {
|
|
105
|
+
var _a;
|
|
106
|
+
(_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.saveAsExcel(Object.assign(Object.assign(Object.assign({}, spreadsheetRef.current.options.excel), { saveAs: kendo_file_saver_1.saveAs,
|
|
107
|
+
Workbook: kendo_ooxml_1.Workbook }), options));
|
|
108
|
+
},
|
|
109
|
+
activeSheet(sheet) { var _a; return (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.activeSheet(sheet); },
|
|
110
|
+
sheets() { return spreadsheetRef.current.sheets(); },
|
|
111
|
+
refresh() { var _a; return (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.refresh(); }
|
|
95
112
|
}), [props]);
|
|
96
113
|
React.useImperativeHandle(ref, () => target.current);
|
|
97
114
|
const nameEditor = React.useCallback(() => {
|
|
@@ -127,7 +144,7 @@ exports.Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
127
144
|
}, formulaBarInputRef,
|
|
128
145
|
formulaCellInputRef,
|
|
129
146
|
nameBoxRef });
|
|
130
|
-
const spreadsheet = new
|
|
147
|
+
const spreadsheet = new SpreadsheetProps_1.SpreadsheetWidget(elementRef.current, options);
|
|
131
148
|
spreadsheetRef.current = spreadsheet;
|
|
132
149
|
spreadsheet.bind('select', onSelect);
|
|
133
150
|
spreadsheet.bind('change', onChange);
|