@progress/kendo-react-spreadsheet 5.14.0-dev.202305151331
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -0
- package/NOTICE.txt +117 -0
- package/README.md +46 -0
- package/about.md +3 -0
- package/dist/cdn/js/kendo-react-spreadsheet.js +1 -0
- package/dist/es/FormulaInput.d.ts +5 -0
- package/dist/es/FormulaInput.js +116 -0
- package/dist/es/List.d.ts +5 -0
- package/dist/es/List.js +17 -0
- package/dist/es/NameBox.d.ts +5 -0
- package/dist/es/NameBox.js +88 -0
- package/dist/es/SheetsBar.d.ts +5 -0
- package/dist/es/SheetsBar.js +233 -0
- package/dist/es/Spreadsheet.d.ts +3 -0
- package/dist/es/Spreadsheet.js +206 -0
- package/dist/es/SpreadsheetProps.d.ts +104 -0
- package/dist/es/SpreadsheetProps.js +1 -0
- package/dist/es/main.d.ts +3 -0
- package/dist/es/main.js +2 -0
- package/dist/es/messages.d.ts +76 -0
- package/dist/es/messages.js +208 -0
- package/dist/es/package-metadata.d.ts +5 -0
- package/dist/es/package-metadata.js +11 -0
- package/dist/es/tools/align.d.ts +9 -0
- package/dist/es/tools/align.js +39 -0
- package/dist/es/tools/backgroundColor.d.ts +5 -0
- package/dist/es/tools/backgroundColor.js +12 -0
- package/dist/es/tools/bold.d.ts +5 -0
- package/dist/es/tools/bold.js +5 -0
- package/dist/es/tools/defaultTools.d.ts +2 -0
- package/dist/es/tools/defaultTools.js +42 -0
- package/dist/es/tools/export.d.ts +5 -0
- package/dist/es/tools/export.js +16 -0
- package/dist/es/tools/fontFamily.d.ts +5 -0
- package/dist/es/tools/fontFamily.js +18 -0
- package/dist/es/tools/fontSize.d.ts +5 -0
- package/dist/es/tools/fontSize.js +20 -0
- package/dist/es/tools/format.d.ts +5 -0
- package/dist/es/tools/format.js +23 -0
- package/dist/es/tools/gridLines.d.ts +6 -0
- package/dist/es/tools/gridLines.js +22 -0
- package/dist/es/tools/index.d.ts +17 -0
- package/dist/es/tools/index.js +17 -0
- package/dist/es/tools/italic.d.ts +5 -0
- package/dist/es/tools/italic.js +5 -0
- package/dist/es/tools/open.d.ts +5 -0
- package/dist/es/tools/open.js +33 -0
- package/dist/es/tools/redo.d.ts +5 -0
- package/dist/es/tools/redo.js +5 -0
- package/dist/es/tools/tableTools.d.ts +20 -0
- package/dist/es/tools/tableTools.js +72 -0
- package/dist/es/tools/textColor.d.ts +5 -0
- package/dist/es/tools/textColor.js +12 -0
- package/dist/es/tools/textWrap.d.ts +6 -0
- package/dist/es/tools/textWrap.js +23 -0
- package/dist/es/tools/underline.d.ts +5 -0
- package/dist/es/tools/underline.js +5 -0
- package/dist/es/tools/undo.d.ts +5 -0
- package/dist/es/tools/undo.js +5 -0
- package/dist/es/tools/utils.d.ts +79 -0
- package/dist/es/tools/utils.js +102 -0
- package/dist/npm/FormulaInput.d.ts +5 -0
- package/dist/npm/FormulaInput.js +119 -0
- package/dist/npm/List.d.ts +5 -0
- package/dist/npm/List.js +20 -0
- package/dist/npm/NameBox.d.ts +5 -0
- package/dist/npm/NameBox.js +91 -0
- package/dist/npm/SheetsBar.d.ts +5 -0
- package/dist/npm/SheetsBar.js +237 -0
- package/dist/npm/Spreadsheet.d.ts +3 -0
- package/dist/npm/Spreadsheet.js +209 -0
- package/dist/npm/SpreadsheetProps.d.ts +104 -0
- package/dist/npm/SpreadsheetProps.js +2 -0
- package/dist/npm/main.d.ts +3 -0
- package/dist/npm/main.js +20 -0
- package/dist/npm/messages.d.ts +76 -0
- package/dist/npm/messages.js +211 -0
- package/dist/npm/package-metadata.d.ts +5 -0
- package/dist/npm/package-metadata.js +14 -0
- package/dist/npm/tools/align.d.ts +9 -0
- package/dist/npm/tools/align.js +43 -0
- package/dist/npm/tools/backgroundColor.d.ts +5 -0
- package/dist/npm/tools/backgroundColor.js +15 -0
- package/dist/npm/tools/bold.d.ts +5 -0
- package/dist/npm/tools/bold.js +8 -0
- package/dist/npm/tools/defaultTools.d.ts +2 -0
- package/dist/npm/tools/defaultTools.js +45 -0
- package/dist/npm/tools/export.d.ts +5 -0
- package/dist/npm/tools/export.js +20 -0
- package/dist/npm/tools/fontFamily.d.ts +5 -0
- package/dist/npm/tools/fontFamily.js +22 -0
- package/dist/npm/tools/fontSize.d.ts +5 -0
- package/dist/npm/tools/fontSize.js +24 -0
- package/dist/npm/tools/format.d.ts +5 -0
- package/dist/npm/tools/format.js +27 -0
- package/dist/npm/tools/gridLines.d.ts +6 -0
- package/dist/npm/tools/gridLines.js +26 -0
- package/dist/npm/tools/index.d.ts +17 -0
- package/dist/npm/tools/index.js +33 -0
- package/dist/npm/tools/italic.d.ts +5 -0
- package/dist/npm/tools/italic.js +8 -0
- package/dist/npm/tools/open.d.ts +5 -0
- package/dist/npm/tools/open.js +37 -0
- package/dist/npm/tools/redo.d.ts +5 -0
- package/dist/npm/tools/redo.js +8 -0
- package/dist/npm/tools/tableTools.d.ts +20 -0
- package/dist/npm/tools/tableTools.js +75 -0
- package/dist/npm/tools/textColor.d.ts +5 -0
- package/dist/npm/tools/textColor.js +15 -0
- package/dist/npm/tools/textWrap.d.ts +6 -0
- package/dist/npm/tools/textWrap.js +27 -0
- package/dist/npm/tools/underline.d.ts +5 -0
- package/dist/npm/tools/underline.js +8 -0
- package/dist/npm/tools/undo.d.ts +5 -0
- package/dist/npm/tools/undo.js +8 -0
- package/dist/npm/tools/utils.d.ts +79 -0
- package/dist/npm/tools/utils.js +108 -0
- package/dist/systemjs/kendo-react-spreadsheet.js +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { keys } from '../messages';
|
|
2
|
+
import { ColorTool } from './utils';
|
|
3
|
+
import { dropletIcon } from '@progress/kendo-svg-icons';
|
|
4
|
+
export const BackgroundColor = ColorTool({
|
|
5
|
+
icon: 'droplet',
|
|
6
|
+
svgIcon: dropletIcon,
|
|
7
|
+
view: 'palette',
|
|
8
|
+
property: 'background',
|
|
9
|
+
titleKey: keys.background,
|
|
10
|
+
ariaLabel: 'Background'
|
|
11
|
+
});
|
|
12
|
+
BackgroundColor.displayName = 'BackgroundColor';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { boldIcon } from '@progress/kendo-svg-icons';
|
|
2
|
+
import { PropertyChangeTool } from './utils';
|
|
3
|
+
import { keys } from '../messages';
|
|
4
|
+
export const Bold = PropertyChangeTool({ property: 'bold', icon: 'bold', svgIcon: boldIcon, titleKey: keys.bold });
|
|
5
|
+
Bold.displayName = 'Bold';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ToolbarSeparator } from '@progress/kendo-react-buttons';
|
|
2
|
+
import { ExcelExport } from './export';
|
|
3
|
+
import { Open } from './open';
|
|
4
|
+
import { Bold } from './bold';
|
|
5
|
+
import { Italic } from './italic';
|
|
6
|
+
import { Underline } from './underline';
|
|
7
|
+
import { FontFamily } from './fontFamily';
|
|
8
|
+
import { FontSize } from './fontSize';
|
|
9
|
+
import { TextColor } from './textColor';
|
|
10
|
+
import { BackgroundColor } from './backgroundColor';
|
|
11
|
+
import { Alignment } from './align';
|
|
12
|
+
import { TextWrap } from './textWrap';
|
|
13
|
+
import { GridLines } from './gridLines';
|
|
14
|
+
import { Format } from './format';
|
|
15
|
+
import { AddColumnLeft, AddColumnRight, AddRowAbove, AddRowBelow, DeleteColumn, DeleteRow } from './tableTools';
|
|
16
|
+
import { keys } from '../messages';
|
|
17
|
+
export const defaultTabs = [
|
|
18
|
+
{
|
|
19
|
+
textKey: keys.home,
|
|
20
|
+
tools: [
|
|
21
|
+
Open,
|
|
22
|
+
ExcelExport,
|
|
23
|
+
ToolbarSeparator,
|
|
24
|
+
[Bold, Italic, Underline],
|
|
25
|
+
FontFamily,
|
|
26
|
+
FontSize,
|
|
27
|
+
TextColor,
|
|
28
|
+
BackgroundColor,
|
|
29
|
+
Alignment,
|
|
30
|
+
TextWrap,
|
|
31
|
+
GridLines,
|
|
32
|
+
Format
|
|
33
|
+
]
|
|
34
|
+
}, {
|
|
35
|
+
textKey: keys.insert,
|
|
36
|
+
tools: [
|
|
37
|
+
[AddColumnLeft, AddColumnRight, AddRowBelow, AddRowAbove],
|
|
38
|
+
ToolbarSeparator,
|
|
39
|
+
[DeleteColumn, DeleteRow]
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
3
|
+
import { saveAs } from '@progress/kendo-file-saver';
|
|
4
|
+
import { Workbook } from '@progress/kendo-ooxml';
|
|
5
|
+
import { downloadIcon } from '@progress/kendo-svg-icons';
|
|
6
|
+
export const ExcelExport = props => {
|
|
7
|
+
const { spreadsheetRef } = props;
|
|
8
|
+
const onDownload = React.useCallback(() => {
|
|
9
|
+
if (spreadsheetRef.current) {
|
|
10
|
+
spreadsheetRef.current.saveAsExcel(Object.assign(Object.assign({}, spreadsheetRef.current.options.excel), { saveAs,
|
|
11
|
+
Workbook }));
|
|
12
|
+
}
|
|
13
|
+
}, []);
|
|
14
|
+
return (React.createElement(Button, { className: 'k-toolbar-button', title: 'Export...', icon: 'download', svgIcon: downloadIcon, onClick: onDownload }));
|
|
15
|
+
};
|
|
16
|
+
ExcelExport.displayName = 'ExcelExport';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DropDownList } from '@progress/kendo-react-dropdowns';
|
|
3
|
+
import { DEFAULT_FONT_FAMILY, FONT_FAMILIES } from './utils';
|
|
4
|
+
import { useLocalization } from '@progress/kendo-react-intl';
|
|
5
|
+
import { keys, messages } from '../messages';
|
|
6
|
+
export const FontFamily = props => {
|
|
7
|
+
const { spreadsheetRef, value } = props;
|
|
8
|
+
const onChange = React.useCallback((event) => {
|
|
9
|
+
if (spreadsheetRef.current) {
|
|
10
|
+
const options = {
|
|
11
|
+
command: 'PropertyChangeCommand', options: { property: 'fontFamily', value: event.value || null }
|
|
12
|
+
};
|
|
13
|
+
spreadsheetRef.current.executeCommand(options);
|
|
14
|
+
}
|
|
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 }));
|
|
17
|
+
};
|
|
18
|
+
FontFamily.displayName = 'FontFamily';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComboBox } from '@progress/kendo-react-dropdowns';
|
|
3
|
+
import { DEFAULT_FONT_SIZE, FONT_SIZES } from './utils';
|
|
4
|
+
import { keys, messages } from '../messages';
|
|
5
|
+
import { useLocalization } from '@progress/kendo-react-intl';
|
|
6
|
+
export const FontSize = (props) => {
|
|
7
|
+
const { spreadsheetRef, value } = props;
|
|
8
|
+
const onChange = React.useCallback((event) => {
|
|
9
|
+
if (spreadsheetRef.current) {
|
|
10
|
+
const options = {
|
|
11
|
+
command: 'PropertyChangeCommand', options: { property: 'fontSize', value: event.value || null }
|
|
12
|
+
};
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
spreadsheetRef.current.executeCommand(options);
|
|
15
|
+
}, 0);
|
|
16
|
+
}
|
|
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 }));
|
|
19
|
+
};
|
|
20
|
+
FontSize.displayName = 'FontSize';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DropDownButton } from '@progress/kendo-react-buttons';
|
|
3
|
+
import { customFormatIcon } from '@progress/kendo-svg-icons';
|
|
4
|
+
import { FORMATS } from './utils';
|
|
5
|
+
import { IconWrap } from '@progress/kendo-react-common';
|
|
6
|
+
import { useLocalization } from '@progress/kendo-react-intl';
|
|
7
|
+
import { keys, messages } from '../messages';
|
|
8
|
+
export const Format = props => {
|
|
9
|
+
const { spreadsheetRef } = props;
|
|
10
|
+
const onChange = React.useCallback((event) => {
|
|
11
|
+
const value = event.item.value || null;
|
|
12
|
+
setTimeout(() => {
|
|
13
|
+
if (spreadsheetRef.current) {
|
|
14
|
+
const options = {
|
|
15
|
+
command: 'PropertyChangeCommand', options: { property: 'format', value }
|
|
16
|
+
};
|
|
17
|
+
spreadsheetRef.current.executeCommand(options);
|
|
18
|
+
}
|
|
19
|
+
}, 0);
|
|
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" }) }));
|
|
22
|
+
};
|
|
23
|
+
Format.displayName = 'Format';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
3
|
+
import { bordersNoneIcon } from '@progress/kendo-svg-icons';
|
|
4
|
+
import { useLocalization } from '@progress/kendo-react-intl';
|
|
5
|
+
import { keys, messages } from '../messages';
|
|
6
|
+
export const GridLines = props => {
|
|
7
|
+
const { value: selected, spreadsheetRef } = props;
|
|
8
|
+
const onClick = React.useCallback(() => {
|
|
9
|
+
if (spreadsheetRef.current) {
|
|
10
|
+
const sheet = spreadsheetRef.current.activeSheet();
|
|
11
|
+
if (sheet) {
|
|
12
|
+
const value = !sheet.showGridLines();
|
|
13
|
+
const options = {
|
|
14
|
+
command: 'GridLinesChangeCommand', options: { property: 'gridLines', value }
|
|
15
|
+
};
|
|
16
|
+
spreadsheetRef.current.executeCommand(options);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
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 }));
|
|
21
|
+
};
|
|
22
|
+
GridLines.displayName = 'GridLines';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './align';
|
|
2
|
+
export * from './backgroundColor';
|
|
3
|
+
export * from './bold';
|
|
4
|
+
export * from './defaultTools';
|
|
5
|
+
export * from './export';
|
|
6
|
+
export * from './fontFamily';
|
|
7
|
+
export * from './fontSize';
|
|
8
|
+
export * from './format';
|
|
9
|
+
export * from './gridLines';
|
|
10
|
+
export * from './italic';
|
|
11
|
+
export * from './open';
|
|
12
|
+
export * from './redo';
|
|
13
|
+
export * from './tableTools';
|
|
14
|
+
export * from './textColor';
|
|
15
|
+
export * from './textWrap';
|
|
16
|
+
export * from './underline';
|
|
17
|
+
export * from './undo';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './align';
|
|
2
|
+
export * from './backgroundColor';
|
|
3
|
+
export * from './bold';
|
|
4
|
+
export * from './defaultTools';
|
|
5
|
+
export * from './export';
|
|
6
|
+
export * from './fontFamily';
|
|
7
|
+
export * from './fontSize';
|
|
8
|
+
export * from './format';
|
|
9
|
+
export * from './gridLines';
|
|
10
|
+
export * from './italic';
|
|
11
|
+
export * from './open';
|
|
12
|
+
export * from './redo';
|
|
13
|
+
export * from './tableTools';
|
|
14
|
+
export * from './textColor';
|
|
15
|
+
export * from './textWrap';
|
|
16
|
+
export * from './underline';
|
|
17
|
+
export * from './undo';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { italicIcon } from '@progress/kendo-svg-icons';
|
|
2
|
+
import { PropertyChangeTool } from './utils';
|
|
3
|
+
import { keys } from '../messages';
|
|
4
|
+
export const Italic = PropertyChangeTool({ property: 'italic', icon: 'italic', svgIcon: italicIcon, titleKey: keys.italic });
|
|
5
|
+
Italic.displayName = 'Italic';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
3
|
+
import { Upload } from '@progress/kendo-react-upload';
|
|
4
|
+
import { folderOpenIcon } from '@progress/kendo-svg-icons';
|
|
5
|
+
import { useLocalization } from '@progress/kendo-react-intl';
|
|
6
|
+
import { keys, messages } from '../messages';
|
|
7
|
+
export const Open = props => {
|
|
8
|
+
const { spreadsheetRef } = props;
|
|
9
|
+
const onFileOpen = React.useCallback((event) => {
|
|
10
|
+
const targetEl = event.target;
|
|
11
|
+
if (targetEl instanceof HTMLElement && targetEl.parentNode) {
|
|
12
|
+
const toolbarEl = targetEl.closest('.k-toolbar');
|
|
13
|
+
const input = toolbarEl && toolbarEl.querySelector('.k-upload input');
|
|
14
|
+
if (input) {
|
|
15
|
+
input.click();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}, []);
|
|
19
|
+
const onAdd = React.useCallback((event) => {
|
|
20
|
+
const fileInfo = event.newState;
|
|
21
|
+
if (fileInfo[0] && fileInfo[0].getRawFile) {
|
|
22
|
+
const file = fileInfo[0].getRawFile();
|
|
23
|
+
if (spreadsheetRef.current) {
|
|
24
|
+
spreadsheetRef.current.fromFile(file);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, []);
|
|
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 }),
|
|
30
|
+
React.createElement("div", { style: { display: 'none' } },
|
|
31
|
+
React.createElement(Upload, { restrictions: { allowedExtensions: ['.xlsx'] }, onAdd: onAdd, autoUpload: false, defaultFiles: [], multiple: false, accept: ".xlsx,.XLSX", withCredentials: false }))));
|
|
32
|
+
};
|
|
33
|
+
Open.displayName = 'Open';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BaseToolProps } from './utils';
|
|
3
|
+
export interface AddColumnLeftProps extends BaseToolProps {
|
|
4
|
+
}
|
|
5
|
+
export interface AddColumnRightProps extends BaseToolProps {
|
|
6
|
+
}
|
|
7
|
+
export interface AddRowBelowProps extends BaseToolProps {
|
|
8
|
+
}
|
|
9
|
+
export interface AddRowAboveProps extends BaseToolProps {
|
|
10
|
+
}
|
|
11
|
+
export interface DeleteColumnProps extends BaseToolProps {
|
|
12
|
+
}
|
|
13
|
+
export interface DeleteRowProps extends BaseToolProps {
|
|
14
|
+
}
|
|
15
|
+
export declare const AddColumnLeft: React.FunctionComponent<AddColumnLeftProps>;
|
|
16
|
+
export declare const AddColumnRight: React.FunctionComponent<AddColumnRightProps>;
|
|
17
|
+
export declare const AddRowBelow: React.FunctionComponent<AddRowBelowProps>;
|
|
18
|
+
export declare const AddRowAbove: React.FunctionComponent<AddRowAboveProps>;
|
|
19
|
+
export declare const DeleteColumn: React.FunctionComponent<DeleteColumnProps>;
|
|
20
|
+
export declare const DeleteRow: React.FunctionComponent<DeleteRowProps>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
3
|
+
import { tableColumnInsertLeftIcon, tableColumnInsertRightIcon, tableRowInsertBelowIcon, tableRowInsertAboveIcon, tableColumnDeleteIcon, tableRowDeleteIcon } from '@progress/kendo-svg-icons';
|
|
4
|
+
import { keys, messages } from '../messages';
|
|
5
|
+
import { useLocalization } from '@progress/kendo-react-intl';
|
|
6
|
+
const TableDataTool = (settings) => {
|
|
7
|
+
const tool = props => {
|
|
8
|
+
const { spreadsheetRef } = props;
|
|
9
|
+
const onClick = React.useCallback(() => {
|
|
10
|
+
if (spreadsheetRef.current) {
|
|
11
|
+
const options = {
|
|
12
|
+
command: settings.command, options: { value: settings.value }
|
|
13
|
+
};
|
|
14
|
+
spreadsheetRef.current.executeCommand(options);
|
|
15
|
+
}
|
|
16
|
+
}, []);
|
|
17
|
+
return (React.createElement(Button, { type: "button", icon: settings.icon, svgIcon: settings.svgIcon, title: useLocalization().toLanguageString(settings.titleKey, messages[settings.titleKey]), onClick: onClick }));
|
|
18
|
+
};
|
|
19
|
+
return tool;
|
|
20
|
+
};
|
|
21
|
+
const addColumnLeft = {
|
|
22
|
+
command: 'AddColumnCommand',
|
|
23
|
+
value: 'left',
|
|
24
|
+
icon: 'table-column-insert-left',
|
|
25
|
+
svgIcon: tableColumnInsertLeftIcon,
|
|
26
|
+
titleKey: keys.addColumnLeft
|
|
27
|
+
};
|
|
28
|
+
const addColumnRight = {
|
|
29
|
+
command: 'AddColumnCommand',
|
|
30
|
+
value: 'right',
|
|
31
|
+
icon: 'table-column-insert-right',
|
|
32
|
+
svgIcon: tableColumnInsertRightIcon,
|
|
33
|
+
titleKey: keys.addColumnRight
|
|
34
|
+
};
|
|
35
|
+
const addRowBelow = {
|
|
36
|
+
command: 'AddRowCommand',
|
|
37
|
+
value: 'below',
|
|
38
|
+
icon: 'table-row-insert-below',
|
|
39
|
+
svgIcon: tableRowInsertBelowIcon,
|
|
40
|
+
titleKey: keys.addRowBelow
|
|
41
|
+
};
|
|
42
|
+
const addRowAbove = {
|
|
43
|
+
command: 'AddRowCommand',
|
|
44
|
+
value: 'above',
|
|
45
|
+
icon: 'table-row-insert-above',
|
|
46
|
+
svgIcon: tableRowInsertAboveIcon,
|
|
47
|
+
titleKey: keys.addRowAbove
|
|
48
|
+
};
|
|
49
|
+
const deleteColumn = {
|
|
50
|
+
command: 'DeleteColumnCommand',
|
|
51
|
+
icon: 'table-column-delete',
|
|
52
|
+
svgIcon: tableColumnDeleteIcon,
|
|
53
|
+
titleKey: keys.deleteColumn
|
|
54
|
+
};
|
|
55
|
+
const deleteRow = {
|
|
56
|
+
command: 'DeleteRowCommand',
|
|
57
|
+
icon: 'table-row-delete',
|
|
58
|
+
svgIcon: tableRowDeleteIcon,
|
|
59
|
+
titleKey: keys.deleteRow
|
|
60
|
+
};
|
|
61
|
+
export const AddColumnLeft = TableDataTool(addColumnLeft);
|
|
62
|
+
export const AddColumnRight = TableDataTool(addColumnRight);
|
|
63
|
+
export const AddRowBelow = TableDataTool(addRowBelow);
|
|
64
|
+
export const AddRowAbove = TableDataTool(addRowAbove);
|
|
65
|
+
export const DeleteColumn = TableDataTool(deleteColumn);
|
|
66
|
+
export const DeleteRow = TableDataTool(deleteRow);
|
|
67
|
+
AddColumnLeft.displayName = 'AddColumnLeft';
|
|
68
|
+
AddColumnRight.displayName = 'AddColumnRight';
|
|
69
|
+
AddRowBelow.displayName = 'AddRowBelow';
|
|
70
|
+
AddRowAbove.displayName = 'AddRowAbove';
|
|
71
|
+
DeleteColumn.displayName = 'DeleteColumn';
|
|
72
|
+
DeleteRow.displayName = 'DeleteRow';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { keys } from '../messages';
|
|
2
|
+
import { ColorTool } from './utils';
|
|
3
|
+
import { foregroundColorIcon } from '@progress/kendo-svg-icons';
|
|
4
|
+
export const TextColor = ColorTool({
|
|
5
|
+
icon: 'foreground-color',
|
|
6
|
+
svgIcon: foregroundColorIcon,
|
|
7
|
+
view: 'palette',
|
|
8
|
+
property: 'color',
|
|
9
|
+
titleKey: keys.textColor,
|
|
10
|
+
ariaLabel: 'Text Color'
|
|
11
|
+
});
|
|
12
|
+
TextColor.displayName = 'TextColor';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
3
|
+
import { textWrapIcon } from '@progress/kendo-svg-icons';
|
|
4
|
+
import { useLocalization } from '@progress/kendo-react-intl';
|
|
5
|
+
import { keys, messages } from '../messages';
|
|
6
|
+
export const TextWrap = props => {
|
|
7
|
+
const { value: selected, spreadsheetRef } = props;
|
|
8
|
+
const onClick = React.useCallback(() => {
|
|
9
|
+
if (spreadsheetRef.current) {
|
|
10
|
+
const sheet = spreadsheetRef.current.activeSheet();
|
|
11
|
+
if (sheet) {
|
|
12
|
+
const range = sheet.range(sheet.activeCell());
|
|
13
|
+
const value = !range.wrap();
|
|
14
|
+
const options = {
|
|
15
|
+
command: 'TextWrapCommand', options: { property: 'wrap', value }
|
|
16
|
+
};
|
|
17
|
+
spreadsheetRef.current.executeCommand(options);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
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 }));
|
|
22
|
+
};
|
|
23
|
+
TextWrap.displayName = 'TextWrap';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { underlineIcon } from '@progress/kendo-svg-icons';
|
|
2
|
+
import { PropertyChangeTool } from './utils';
|
|
3
|
+
import { keys } from '../messages';
|
|
4
|
+
export const Underline = PropertyChangeTool({ property: 'underline', icon: 'underline', svgIcon: underlineIcon, titleKey: keys.underline });
|
|
5
|
+
Underline.displayName = 'Underline';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Spreadsheet as SpreadsheetInstance } from '@progress/kendo-spreadsheet-common';
|
|
3
|
+
import { ColorPickerProps } from '@progress/kendo-react-inputs';
|
|
4
|
+
import { SVGIcon } from '@progress/kendo-react-common';
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export declare const FONT_FAMILIES: string[];
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_FONT_FAMILY = "Arial";
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export declare const FONT_SIZES: number[];
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEFAULT_FONT_SIZE = 12;
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export declare const FORMATS: ({
|
|
25
|
+
text: string;
|
|
26
|
+
value: null;
|
|
27
|
+
} | {
|
|
28
|
+
text: string;
|
|
29
|
+
value: string;
|
|
30
|
+
})[];
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
export interface BaseToolProps {
|
|
35
|
+
spreadsheetRef: React.RefObject<SpreadsheetInstance>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
export interface PropertyChangeToolProps extends BaseToolProps {
|
|
41
|
+
value?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
export interface DropDownToolProps extends BaseToolProps {
|
|
47
|
+
value?: any;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export declare const PropertyChangeTool: <Props extends PropertyChangeToolProps>(settings: {
|
|
53
|
+
property: string;
|
|
54
|
+
icon: string;
|
|
55
|
+
svgIcon: SVGIcon;
|
|
56
|
+
titleKey: string;
|
|
57
|
+
}) => React.FunctionComponent<Props>;
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
export interface ColorToolProps extends BaseToolProps {
|
|
62
|
+
value?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @hidden
|
|
66
|
+
*/
|
|
67
|
+
export declare const ColorTool: <Props extends ColorToolProps>(settings: ColorPickerProps & {
|
|
68
|
+
property: string;
|
|
69
|
+
titleKey: string;
|
|
70
|
+
}) => React.FunctionComponent<Props>;
|
|
71
|
+
/**
|
|
72
|
+
* @hidden
|
|
73
|
+
*/
|
|
74
|
+
export declare const UndoRedo: <Props extends BaseToolProps>(settings: {
|
|
75
|
+
action: string;
|
|
76
|
+
icon: string;
|
|
77
|
+
svgIcon: SVGIcon;
|
|
78
|
+
titleKey: string;
|
|
79
|
+
}) => React.FunctionComponent<Props>;
|