@progress/kendo-react-spreadsheet 5.14.0-dev.202305250741 → 5.14.0-dev.202305301859
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 +7 -4
- package/dist/es/SheetsBar.js +4 -2
- package/dist/es/Spreadsheet.js +29 -29
- package/dist/es/SpreadsheetProps.d.ts +55 -17
- package/dist/es/SpreadsheetProps.js +4 -1
- package/dist/es/messages.d.ts +2 -0
- package/dist/es/messages.js +6 -0
- 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/defaultTools.js +17 -5
- 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 +7 -4
- package/dist/npm/SheetsBar.js +4 -2
- package/dist/npm/Spreadsheet.js +29 -29
- package/dist/npm/SpreadsheetProps.d.ts +55 -17
- package/dist/npm/SpreadsheetProps.js +8 -0
- package/dist/npm/messages.d.ts +2 -0
- package/dist/npm/messages.js +6 -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/defaultTools.js +17 -5
- 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
|
@@ -60,10 +60,13 @@ export const NameBox = React.forwardRef((props, ref) => {
|
|
|
60
60
|
}
|
|
61
61
|
const editor = props.nameEditor();
|
|
62
62
|
if (editor && event.value) {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const name = event.value.name;
|
|
64
|
+
if (name !== value) {
|
|
65
|
+
editor.trigger('select', { name });
|
|
66
|
+
setValue(name);
|
|
67
|
+
}
|
|
65
68
|
}
|
|
66
|
-
}, []);
|
|
69
|
+
}, [value]);
|
|
67
70
|
const onKeyDown = React.useCallback((event) => {
|
|
68
71
|
const editor = props.nameEditor();
|
|
69
72
|
if (editor) {
|
|
@@ -82,7 +85,7 @@ export const NameBox = React.forwardRef((props, ref) => {
|
|
|
82
85
|
memo.prevValue = event.value.name;
|
|
83
86
|
}, []);
|
|
84
87
|
return (React.createElement("div", { className: "k-spreadsheet-name-editor", onKeyDown: onKeyDown },
|
|
85
|
-
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 })));
|
|
86
89
|
});
|
|
87
90
|
NameBox.displayName = 'NameBox';
|
|
88
91
|
NameBox.propTypes = {};
|
package/dist/es/SheetsBar.js
CHANGED
|
@@ -224,10 +224,12 @@ export const SheetsBar = (props) => {
|
|
|
224
224
|
const onSheetReorderEnd = React.useCallback((event) => {
|
|
225
225
|
if (spreadsheetRef.current) {
|
|
226
226
|
const { prevIndex, nextIndex } = event;
|
|
227
|
+
activeSheet.current = spreadsheetRef.current.sheets()[prevIndex].name();
|
|
227
228
|
spreadsheetRef.current.view.sheetsbar.onSheetReorderEnd({ oldIndex: prevIndex, newIndex: nextIndex });
|
|
229
|
+
selectActiveSheet();
|
|
228
230
|
}
|
|
229
231
|
}, []);
|
|
230
|
-
return (React.createElement("div", { className: "k-spreadsheet-sheets-bar" },
|
|
231
|
-
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 }),
|
|
232
234
|
React.createElement(Tabs, { sheets: sheets, setSheets: setSheets, onSheetSelect: onSelect, onSheetDelete: onSheetDelete, onSheetEdit: onSheetRename, onSheetReorderEnd: onSheetReorderEnd })));
|
|
233
235
|
};
|
package/dist/es/Spreadsheet.js
CHANGED
|
@@ -1,18 +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
|
-
import { Undo } from './tools/undo';
|
|
7
|
-
import { Redo } from './tools/redo';
|
|
8
5
|
import { FormulaInput } from './FormulaInput';
|
|
9
6
|
import { NameBox } from './NameBox';
|
|
10
7
|
import { SheetsBar } from './SheetsBar';
|
|
8
|
+
import { SpreadsheetWidget } from './SpreadsheetProps';
|
|
11
9
|
import { defaultTabs } from './tools/defaultTools';
|
|
12
10
|
import { IconWrap, classNames, validatePackage } from '@progress/kendo-react-common';
|
|
13
11
|
import { packageMetadata } from './package-metadata';
|
|
14
12
|
import { formulaFxIcon } from '@progress/kendo-svg-icons';
|
|
15
13
|
import { useInternationalization, useLocalization } from '@progress/kendo-react-intl';
|
|
14
|
+
import { saveAs } from '@progress/kendo-file-saver';
|
|
15
|
+
import { Workbook } from '@progress/kendo-ooxml';
|
|
16
16
|
import { keys, messages } from './messages';
|
|
17
17
|
const toolsFunctions = ['bold', 'italic', 'underline', 'fontFamily', 'fontSize', 'color', 'background', 'textAlign', 'verticalAlign', 'wrap', 'gridLines'];
|
|
18
18
|
const toolsValueMap = {
|
|
@@ -41,7 +41,15 @@ const toolbarButtons = [
|
|
|
41
41
|
];
|
|
42
42
|
export const Spreadsheet = React.forwardRef((props, ref) => {
|
|
43
43
|
validatePackage(packageMetadata);
|
|
44
|
-
const
|
|
44
|
+
const { toolbar = defaultTabs } = props;
|
|
45
|
+
const toolbarTools = [];
|
|
46
|
+
if (typeof toolbar === 'boolean') {
|
|
47
|
+
toolbarTools.push(...(toolbar ? defaultTabs : []));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
toolbarTools.push(...toolbar);
|
|
51
|
+
}
|
|
52
|
+
const [tab, setTab] = React.useState(toolbarTools.findIndex(t => t.selected) || 0);
|
|
45
53
|
const [_init, setInit] = React.useState(false);
|
|
46
54
|
const elementRef = React.useRef(null);
|
|
47
55
|
const formulaBarInputRef = React.useRef(null);
|
|
@@ -53,11 +61,6 @@ export const Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
53
61
|
prevState.current = toolsState;
|
|
54
62
|
const propsRef = React.useRef({});
|
|
55
63
|
propsRef.current = props;
|
|
56
|
-
const onRender = React.useCallback((event) => {
|
|
57
|
-
if (propsRef.current.onRender) {
|
|
58
|
-
propsRef.current.onRender.call(undefined, event);
|
|
59
|
-
}
|
|
60
|
-
}, []);
|
|
61
64
|
const onSelect = React.useCallback((event) => {
|
|
62
65
|
if (propsRef.current.onSelect) {
|
|
63
66
|
propsRef.current.onSelect.call(undefined, event);
|
|
@@ -87,7 +90,22 @@ export const Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
87
90
|
React.useImperativeHandle(target, () => ({
|
|
88
91
|
element: elementRef.current,
|
|
89
92
|
get instance() { return spreadsheetRef.current; },
|
|
90
|
-
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(); }
|
|
91
109
|
}), [props]);
|
|
92
110
|
React.useImperativeHandle(ref, () => target.current);
|
|
93
111
|
const nameEditor = React.useCallback(() => {
|
|
@@ -123,9 +141,8 @@ export const Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
123
141
|
}, formulaBarInputRef,
|
|
124
142
|
formulaCellInputRef,
|
|
125
143
|
nameBoxRef });
|
|
126
|
-
const spreadsheet = new
|
|
144
|
+
const spreadsheet = new SpreadsheetWidget(elementRef.current, options);
|
|
127
145
|
spreadsheetRef.current = spreadsheet;
|
|
128
|
-
spreadsheet.bind('render', onRender);
|
|
129
146
|
spreadsheet.bind('select', onSelect);
|
|
130
147
|
spreadsheet.bind('change', onChange);
|
|
131
148
|
spreadsheet.bind('changeFormat', onChangeFormat);
|
|
@@ -137,11 +154,6 @@ export const Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
137
154
|
onUpdateTools({ range: sheet.range(sheet.activeCell()) });
|
|
138
155
|
}
|
|
139
156
|
setInit(true);
|
|
140
|
-
const quickAccessToolbar = elementRef.current && elementRef.current.querySelector('.k-spreadsheet-quick-access-toolbar');
|
|
141
|
-
const tabstripItems = elementRef.current && elementRef.current.querySelector('.k-spreadsheet-tabstrip .k-tabstrip-items');
|
|
142
|
-
if (quickAccessToolbar && tabstripItems) {
|
|
143
|
-
tabstripItems.style.paddingLeft = quickAccessToolbar.offsetWidth + 'px';
|
|
144
|
-
}
|
|
145
157
|
return () => {
|
|
146
158
|
spreadsheet.destroy();
|
|
147
159
|
};
|
|
@@ -150,14 +162,6 @@ export const Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
150
162
|
const tool = (React.createElement(Tool, { spreadsheetRef: spreadsheetRef, value: toolsValueMap[Tool.displayName] ? toolsValueMap[Tool.displayName](toolsState) : undefined, key: index }));
|
|
151
163
|
return tool.type === ToolbarSeparator ? React.createElement(Tool, { key: index }) : tool;
|
|
152
164
|
}, [toolsState]);
|
|
153
|
-
const { toolbar = defaultTabs } = props;
|
|
154
|
-
const toolbarTools = [];
|
|
155
|
-
if (typeof toolbar === 'boolean') {
|
|
156
|
-
toolbarTools.push(...(toolbar ? defaultTabs : []));
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
toolbarTools.push(...toolbar);
|
|
160
|
-
}
|
|
161
165
|
let tabstrip = null;
|
|
162
166
|
if (toolbarTools.length) {
|
|
163
167
|
tabstrip = (React.createElement(TabStrip, { selected: tab, animation: false, className: "k-floatwrap k-spreadsheet-tabstrip", style: { minHeight: 'auto' }, onSelect: e => setTab(e.selected) }, toolbarTools.map((tabData) => {
|
|
@@ -174,9 +178,6 @@ export const Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
174
178
|
})));
|
|
175
179
|
}
|
|
176
180
|
return (React.createElement("div", { ref: elementRef, style: props.style, className: classNames('k-widget k-spreadsheet', props.className), role: "application" },
|
|
177
|
-
tabstrip && React.createElement("div", { className: "k-spreadsheet-quick-access-toolbar" },
|
|
178
|
-
React.createElement(Undo, { spreadsheetRef: spreadsheetRef }),
|
|
179
|
-
React.createElement(Redo, { spreadsheetRef: spreadsheetRef })),
|
|
180
181
|
tabstrip,
|
|
181
182
|
React.createElement("div", { className: "k-spreadsheet-action-bar" },
|
|
182
183
|
React.createElement(NameBox, { ref: nameBoxRef, nameEditor: nameEditor }),
|
|
@@ -197,7 +198,6 @@ Spreadsheet.propTypes = {
|
|
|
197
198
|
defaultProps: PropTypes.any,
|
|
198
199
|
toolbar: PropTypes.oneOfType([PropTypes.bool, PropTypes.arrayOf(PropTypes.any)]),
|
|
199
200
|
style: PropTypes.object,
|
|
200
|
-
onRender: PropTypes.func,
|
|
201
201
|
onSelect: PropTypes.func,
|
|
202
202
|
onChange: PropTypes.func,
|
|
203
203
|
onChangeFormat: PropTypes.func,
|
|
@@ -1,23 +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
|
-
}
|
|
14
|
-
export interface SpreadsheetRenderEvent extends SpreadsheetEvent {
|
|
13
|
+
sender: SpreadsheetWidget;
|
|
15
14
|
}
|
|
16
15
|
export interface SpreadsheetSelectEvent extends SpreadsheetEvent {
|
|
17
16
|
/**
|
|
18
17
|
* The Range that is selected.
|
|
19
18
|
*/
|
|
20
|
-
range:
|
|
19
|
+
range: Range;
|
|
21
20
|
}
|
|
22
21
|
export interface SpreadsheetChangeEvent extends SpreadsheetEvent, SpreadsheetSelectEvent {
|
|
23
22
|
}
|
|
@@ -40,7 +39,7 @@ export interface SpreadsheetExcelExportEvent extends SpreadsheetEvent {
|
|
|
40
39
|
* The Excel workbook configuration object.
|
|
41
40
|
* Modifications of the workbook will reflect in the output Excel document.
|
|
42
41
|
*/
|
|
43
|
-
workbook:
|
|
42
|
+
workbook: OoxmlWorkbook;
|
|
44
43
|
/**
|
|
45
44
|
* If invoked, the Spreadsheet will not save the generated file.
|
|
46
45
|
*/
|
|
@@ -49,6 +48,7 @@ export interface SpreadsheetExcelExportEvent extends SpreadsheetEvent {
|
|
|
49
48
|
export interface SpreadsheetTab {
|
|
50
49
|
text?: string;
|
|
51
50
|
textKey?: string;
|
|
51
|
+
selected?: boolean;
|
|
52
52
|
tools: (React.ComponentType<any> | React.ComponentType<any>[])[];
|
|
53
53
|
}
|
|
54
54
|
export interface SpreadsheetProps {
|
|
@@ -67,12 +67,6 @@ export interface SpreadsheetProps {
|
|
|
67
67
|
* Specifies the styles that will be applied to the wrapping element.
|
|
68
68
|
*/
|
|
69
69
|
style?: React.CSSProperties;
|
|
70
|
-
/**
|
|
71
|
-
* Triggered after the widget has completed rendering.
|
|
72
|
-
* The event will also fire when a cell is selected or when the Spreadsheet's tools (bold, italic) are used,
|
|
73
|
-
* as the target element is re-generated with new styles (e.g background-color, box-shadow, font-weight, etc.).
|
|
74
|
-
*/
|
|
75
|
-
onRender?: (event: SpreadsheetRenderEvent) => void;
|
|
76
70
|
/**
|
|
77
71
|
* Triggered when the Spreadsheet selection is changed.
|
|
78
72
|
*/
|
|
@@ -103,6 +97,50 @@ export interface SpreadsheetHandle {
|
|
|
103
97
|
* The props values of the Spreadsheet.
|
|
104
98
|
*/
|
|
105
99
|
props: SpreadsheetProps;
|
|
106
|
-
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;
|
|
107
146
|
}
|
|
108
|
-
export {};
|
package/dist/es/messages.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export declare const messages: {
|
|
|
33
33
|
"spreadsheet.nameBox": string;
|
|
34
34
|
"spreadsheet.defaultSheetName": string;
|
|
35
35
|
"spreadsheet.home": string;
|
|
36
|
+
"spreadsheet.file": string;
|
|
36
37
|
"spreadsheet.insert": string;
|
|
37
38
|
"spreadsheet.addNewSheet": string;
|
|
38
39
|
};
|
|
@@ -70,6 +71,7 @@ export declare const keys: {
|
|
|
70
71
|
gridLines: string;
|
|
71
72
|
nameBox: string;
|
|
72
73
|
defaultSheetName: string;
|
|
74
|
+
file: string;
|
|
73
75
|
home: string;
|
|
74
76
|
insert: string;
|
|
75
77
|
addNewSheet: string;
|
package/dist/es/messages.js
CHANGED
|
@@ -122,6 +122,10 @@ const defaultSheetName = 'spreadsheet.defaultSheetName';
|
|
|
122
122
|
* @hidden
|
|
123
123
|
*/
|
|
124
124
|
const home = 'spreadsheet.home';
|
|
125
|
+
/**
|
|
126
|
+
* @hidden
|
|
127
|
+
*/
|
|
128
|
+
const file = 'spreadsheet.file';
|
|
125
129
|
/**
|
|
126
130
|
* @hidden
|
|
127
131
|
*/
|
|
@@ -165,6 +169,7 @@ export const messages = {
|
|
|
165
169
|
[nameBox]: 'Name Box',
|
|
166
170
|
[defaultSheetName]: 'Sheet',
|
|
167
171
|
[home]: 'Home',
|
|
172
|
+
[file]: 'File',
|
|
168
173
|
[insert]: 'Insert',
|
|
169
174
|
[addNewSheet]: 'Add new sheet'
|
|
170
175
|
};
|
|
@@ -202,6 +207,7 @@ export const keys = {
|
|
|
202
207
|
gridLines,
|
|
203
208
|
nameBox,
|
|
204
209
|
defaultSheetName,
|
|
210
|
+
file,
|
|
205
211
|
home,
|
|
206
212
|
insert,
|
|
207
213
|
addNewSheet
|
|
@@ -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: 1685472613,
|
|
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';
|
|
@@ -14,22 +14,34 @@ import { GridLines } from './gridLines';
|
|
|
14
14
|
import { Format } from './format';
|
|
15
15
|
import { AddColumnLeft, AddColumnRight, AddRowAbove, AddRowBelow, DeleteColumn, DeleteRow } from './tableTools';
|
|
16
16
|
import { keys } from '../messages';
|
|
17
|
+
import { Undo } from './undo';
|
|
18
|
+
import { Redo } from './redo';
|
|
17
19
|
export const defaultTabs = [
|
|
18
20
|
{
|
|
19
|
-
textKey: keys.
|
|
21
|
+
textKey: keys.file,
|
|
20
22
|
tools: [
|
|
21
23
|
Open,
|
|
22
|
-
ExcelExport
|
|
24
|
+
ExcelExport
|
|
25
|
+
]
|
|
26
|
+
}, {
|
|
27
|
+
textKey: keys.home,
|
|
28
|
+
selected: true,
|
|
29
|
+
tools: [
|
|
30
|
+
[Undo, Redo],
|
|
23
31
|
ToolbarSeparator,
|
|
24
|
-
[Bold, Italic, Underline],
|
|
25
32
|
FontFamily,
|
|
26
33
|
FontSize,
|
|
34
|
+
[Bold, Italic, Underline],
|
|
27
35
|
TextColor,
|
|
36
|
+
ToolbarSeparator,
|
|
28
37
|
BackgroundColor,
|
|
38
|
+
ToolbarSeparator,
|
|
29
39
|
Alignment,
|
|
30
40
|
TextWrap,
|
|
31
|
-
|
|
32
|
-
Format
|
|
41
|
+
ToolbarSeparator,
|
|
42
|
+
Format,
|
|
43
|
+
ToolbarSeparator,
|
|
44
|
+
GridLines
|
|
33
45
|
]
|
|
34
46
|
}, {
|
|
35
47
|
textKey: keys.insert,
|
|
@@ -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 }));
|
|
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';
|