@progress/kendo-react-spreadsheet 6.1.1 → 7.0.0-develop.10
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/FormulaInput.d.ts +9 -0
- package/LICENSE.md +1 -1
- package/List.d.ts +9 -0
- package/NameBox.d.ts +9 -0
- package/SheetsBar.d.ts +8 -0
- package/{dist/npm/Spreadsheet.d.ts → Spreadsheet.d.ts} +4 -0
- package/{dist/npm/SpreadsheetProps.d.ts → SpreadsheetProps.d.ts} +5 -2
- package/dist/cdn/js/kendo-react-spreadsheet.js +5 -1
- package/index.d.ts +8 -0
- package/index.js +5 -0
- package/index.mjs +1357 -0
- package/{dist/npm/messages.d.ts → messages.d.ts} +4 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +43 -57
- package/{dist/npm/tools → tools}/adjustDecimals.d.ts +4 -0
- package/{dist/npm/tools → tools}/align.d.ts +4 -0
- package/tools/backgroundColor.d.ts +14 -0
- package/tools/bold.d.ts +14 -0
- package/tools/cleanFormat.d.ts +15 -0
- package/tools/defaultTools.d.ts +9 -0
- package/tools/export.d.ts +15 -0
- package/tools/fontFamily.d.ts +15 -0
- package/{dist/es/tools → tools}/fontSize.d.ts +4 -0
- package/tools/format.d.ts +15 -0
- package/{dist/es/tools → tools}/gridLines.d.ts +4 -0
- package/{dist/es/tools → tools}/index.d.ts +5 -1
- package/tools/italic.d.ts +14 -0
- package/tools/open.d.ts +15 -0
- package/tools/redo.d.ts +14 -0
- package/{dist/npm/tools → tools}/tableTools.d.ts +4 -0
- package/tools/textColor.d.ts +14 -0
- package/{dist/es/tools → tools}/textWrap.d.ts +4 -0
- package/tools/underline.d.ts +14 -0
- package/tools/undo.d.ts +14 -0
- package/{dist/npm/tools → tools}/utils.d.ts +4 -0
- package/about.md +0 -3
- package/dist/es/FormulaInput.d.ts +0 -5
- package/dist/es/FormulaInput.js +0 -116
- package/dist/es/List.d.ts +0 -5
- package/dist/es/List.js +0 -22
- package/dist/es/NameBox.d.ts +0 -5
- package/dist/es/NameBox.js +0 -91
- package/dist/es/SheetsBar.d.ts +0 -5
- package/dist/es/SheetsBar.js +0 -246
- package/dist/es/Spreadsheet.d.ts +0 -47
- package/dist/es/Spreadsheet.js +0 -286
- package/dist/es/SpreadsheetProps.d.ts +0 -189
- package/dist/es/SpreadsheetProps.js +0 -2
- package/dist/es/main.d.ts +0 -4
- package/dist/es/main.js +0 -4
- package/dist/es/messages.d.ts +0 -110
- package/dist/es/messages.js +0 -310
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/tools/adjustDecimals.d.ts +0 -20
- package/dist/es/tools/adjustDecimals.js +0 -39
- package/dist/es/tools/align.d.ts +0 -44
- package/dist/es/tools/align.js +0 -96
- package/dist/es/tools/backgroundColor.d.ts +0 -11
- package/dist/es/tools/backgroundColor.js +0 -15
- package/dist/es/tools/bold.d.ts +0 -11
- package/dist/es/tools/bold.js +0 -9
- package/dist/es/tools/cleanFormat.d.ts +0 -11
- package/dist/es/tools/cleanFormat.js +0 -17
- package/dist/es/tools/defaultTools.d.ts +0 -5
- package/dist/es/tools/defaultTools.js +0 -66
- package/dist/es/tools/export.d.ts +0 -11
- package/dist/es/tools/export.js +0 -19
- package/dist/es/tools/fontFamily.d.ts +0 -11
- package/dist/es/tools/fontFamily.js +0 -21
- package/dist/es/tools/fontSize.js +0 -82
- package/dist/es/tools/format.d.ts +0 -11
- package/dist/es/tools/format.js +0 -26
- package/dist/es/tools/gridLines.js +0 -25
- package/dist/es/tools/index.js +0 -18
- package/dist/es/tools/italic.d.ts +0 -11
- package/dist/es/tools/italic.js +0 -9
- package/dist/es/tools/open.d.ts +0 -11
- package/dist/es/tools/open.js +0 -36
- package/dist/es/tools/redo.d.ts +0 -11
- package/dist/es/tools/redo.js +0 -9
- package/dist/es/tools/tableTools.d.ts +0 -64
- package/dist/es/tools/tableTools.js +0 -102
- package/dist/es/tools/textColor.d.ts +0 -11
- package/dist/es/tools/textColor.js +0 -15
- package/dist/es/tools/textWrap.js +0 -26
- package/dist/es/tools/underline.d.ts +0 -11
- package/dist/es/tools/underline.js +0 -9
- package/dist/es/tools/undo.d.ts +0 -11
- package/dist/es/tools/undo.js +0 -9
- package/dist/es/tools/utils.d.ts +0 -91
- package/dist/es/tools/utils.js +0 -102
- package/dist/npm/FormulaInput.d.ts +0 -5
- package/dist/npm/FormulaInput.js +0 -119
- package/dist/npm/List.d.ts +0 -5
- package/dist/npm/List.js +0 -25
- package/dist/npm/NameBox.d.ts +0 -5
- package/dist/npm/NameBox.js +0 -94
- package/dist/npm/SheetsBar.d.ts +0 -5
- package/dist/npm/SheetsBar.js +0 -250
- package/dist/npm/Spreadsheet.js +0 -289
- package/dist/npm/SpreadsheetProps.js +0 -9
- package/dist/npm/main.d.ts +0 -4
- package/dist/npm/main.js +0 -39
- package/dist/npm/messages.js +0 -313
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/tools/adjustDecimals.js +0 -42
- package/dist/npm/tools/align.js +0 -100
- package/dist/npm/tools/backgroundColor.d.ts +0 -11
- package/dist/npm/tools/backgroundColor.js +0 -18
- package/dist/npm/tools/bold.d.ts +0 -11
- package/dist/npm/tools/bold.js +0 -12
- package/dist/npm/tools/cleanFormat.d.ts +0 -11
- package/dist/npm/tools/cleanFormat.js +0 -21
- package/dist/npm/tools/defaultTools.d.ts +0 -5
- package/dist/npm/tools/defaultTools.js +0 -69
- package/dist/npm/tools/export.d.ts +0 -11
- package/dist/npm/tools/export.js +0 -23
- package/dist/npm/tools/fontFamily.d.ts +0 -11
- package/dist/npm/tools/fontFamily.js +0 -25
- package/dist/npm/tools/fontSize.d.ts +0 -39
- package/dist/npm/tools/fontSize.js +0 -86
- package/dist/npm/tools/format.d.ts +0 -11
- package/dist/npm/tools/format.js +0 -30
- package/dist/npm/tools/gridLines.d.ts +0 -15
- package/dist/npm/tools/gridLines.js +0 -29
- package/dist/npm/tools/index.d.ts +0 -19
- package/dist/npm/tools/index.js +0 -34
- package/dist/npm/tools/italic.d.ts +0 -11
- package/dist/npm/tools/italic.js +0 -12
- package/dist/npm/tools/open.d.ts +0 -11
- package/dist/npm/tools/open.js +0 -40
- package/dist/npm/tools/redo.d.ts +0 -11
- package/dist/npm/tools/redo.js +0 -12
- package/dist/npm/tools/tableTools.js +0 -105
- package/dist/npm/tools/textColor.d.ts +0 -11
- package/dist/npm/tools/textColor.js +0 -18
- package/dist/npm/tools/textWrap.d.ts +0 -15
- package/dist/npm/tools/textWrap.js +0 -30
- package/dist/npm/tools/underline.d.ts +0 -11
- package/dist/npm/tools/underline.js +0 -12
- package/dist/npm/tools/undo.d.ts +0 -11
- package/dist/npm/tools/undo.js +0 -12
- package/dist/npm/tools/utils.js +0 -108
- package/dist/systemjs/kendo-react-spreadsheet.js +0 -1
- package/e2e-next/basic.tests.ts +0 -24
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { SpreadsheetToolProps } from './utils';
|
|
3
|
-
import { SelectedHeaders } from '@progress/kendo-spreadsheet-common';
|
|
4
|
-
interface TableToolProps extends SpreadsheetToolProps {
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
value: SelectedHeaders;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The props of the AddColumnLeft tool component.
|
|
12
|
-
*/
|
|
13
|
-
export interface AddColumnLeftProps extends TableToolProps {
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The props of the AddColumnRight tool component.
|
|
17
|
-
*/
|
|
18
|
-
export interface AddColumnRightProps extends TableToolProps {
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The props of the AddRowBelow tool component.
|
|
22
|
-
*/
|
|
23
|
-
export interface AddRowBelowProps extends TableToolProps {
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* The props of the AddRowAbove tool component.
|
|
27
|
-
*/
|
|
28
|
-
export interface AddRowAboveProps extends TableToolProps {
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The props of the DeleteColumn tool component.
|
|
32
|
-
*/
|
|
33
|
-
export interface DeleteColumnProps extends TableToolProps {
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* The props of the DeleteRow tool component.
|
|
37
|
-
*/
|
|
38
|
-
export interface DeleteRowProps extends TableToolProps {
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* The AddColumnLeft tool component.
|
|
42
|
-
*/
|
|
43
|
-
export declare const AddColumnLeft: React.FunctionComponent<AddColumnLeftProps>;
|
|
44
|
-
/**
|
|
45
|
-
* The AddColumnRight tool component.
|
|
46
|
-
*/
|
|
47
|
-
export declare const AddColumnRight: React.FunctionComponent<AddColumnRightProps>;
|
|
48
|
-
/**
|
|
49
|
-
* The AddRowBelow tool component.
|
|
50
|
-
*/
|
|
51
|
-
export declare const AddRowBelow: React.FunctionComponent<AddRowBelowProps>;
|
|
52
|
-
/**
|
|
53
|
-
* The AddRowAbove tool component.
|
|
54
|
-
*/
|
|
55
|
-
export declare const AddRowAbove: React.FunctionComponent<AddRowAboveProps>;
|
|
56
|
-
/**
|
|
57
|
-
* The DeleteColumn tool component.
|
|
58
|
-
*/
|
|
59
|
-
export declare const DeleteColumn: React.FunctionComponent<DeleteColumnProps>;
|
|
60
|
-
/**
|
|
61
|
-
* The DeleteRow tool component.
|
|
62
|
-
*/
|
|
63
|
-
export declare const DeleteRow: React.FunctionComponent<DeleteRowProps>;
|
|
64
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
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, value } = 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, fillMode: "flat", title: useLocalization().toLanguageString(settings.titleKey, messages[settings.titleKey]), onClick: onClick, disabled: value && settings.disabled(value) }));
|
|
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
|
-
disabled: (headers) => headers.allCols,
|
|
28
|
-
displayName: 'AddColumnLeft'
|
|
29
|
-
};
|
|
30
|
-
const addColumnRight = {
|
|
31
|
-
command: 'AddColumnCommand',
|
|
32
|
-
value: 'right',
|
|
33
|
-
icon: 'table-column-insert-right',
|
|
34
|
-
svgIcon: tableColumnInsertRightIcon,
|
|
35
|
-
titleKey: keys.addColumnRight,
|
|
36
|
-
disabled: (headers) => headers.allCols,
|
|
37
|
-
displayName: 'AddColumnRight'
|
|
38
|
-
};
|
|
39
|
-
const addRowBelow = {
|
|
40
|
-
command: 'AddRowCommand',
|
|
41
|
-
value: 'below',
|
|
42
|
-
icon: 'table-row-insert-below',
|
|
43
|
-
svgIcon: tableRowInsertBelowIcon,
|
|
44
|
-
titleKey: keys.addRowBelow,
|
|
45
|
-
disabled: (headers) => headers.allRows,
|
|
46
|
-
displayName: 'AddRowBelow'
|
|
47
|
-
};
|
|
48
|
-
const addRowAbove = {
|
|
49
|
-
command: 'AddRowCommand',
|
|
50
|
-
value: 'above',
|
|
51
|
-
icon: 'table-row-insert-above',
|
|
52
|
-
svgIcon: tableRowInsertAboveIcon,
|
|
53
|
-
titleKey: keys.addRowAbove,
|
|
54
|
-
disabled: (headers) => headers.allRows,
|
|
55
|
-
displayName: 'AddRowAbove'
|
|
56
|
-
};
|
|
57
|
-
const deleteColumn = {
|
|
58
|
-
command: 'DeleteColumnCommand',
|
|
59
|
-
icon: 'table-column-delete',
|
|
60
|
-
svgIcon: tableColumnDeleteIcon,
|
|
61
|
-
titleKey: keys.deleteColumn,
|
|
62
|
-
disabled: (headers) => headers.allCols,
|
|
63
|
-
displayName: 'DeleteColumn'
|
|
64
|
-
};
|
|
65
|
-
const deleteRow = {
|
|
66
|
-
command: 'DeleteRowCommand',
|
|
67
|
-
icon: 'table-row-delete',
|
|
68
|
-
svgIcon: tableRowDeleteIcon,
|
|
69
|
-
titleKey: keys.deleteRow,
|
|
70
|
-
disabled: (headers) => headers.allRows,
|
|
71
|
-
displayName: 'DeleteRow'
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* The AddColumnLeft tool component.
|
|
75
|
-
*/
|
|
76
|
-
export const AddColumnLeft = TableDataTool(addColumnLeft);
|
|
77
|
-
/**
|
|
78
|
-
* The AddColumnRight tool component.
|
|
79
|
-
*/
|
|
80
|
-
export const AddColumnRight = TableDataTool(addColumnRight);
|
|
81
|
-
/**
|
|
82
|
-
* The AddRowBelow tool component.
|
|
83
|
-
*/
|
|
84
|
-
export const AddRowBelow = TableDataTool(addRowBelow);
|
|
85
|
-
/**
|
|
86
|
-
* The AddRowAbove tool component.
|
|
87
|
-
*/
|
|
88
|
-
export const AddRowAbove = TableDataTool(addRowAbove);
|
|
89
|
-
/**
|
|
90
|
-
* The DeleteColumn tool component.
|
|
91
|
-
*/
|
|
92
|
-
export const DeleteColumn = TableDataTool(deleteColumn);
|
|
93
|
-
/**
|
|
94
|
-
* The DeleteRow tool component.
|
|
95
|
-
*/
|
|
96
|
-
export const DeleteRow = TableDataTool(deleteRow);
|
|
97
|
-
AddColumnLeft.displayName = 'AddColumnLeft';
|
|
98
|
-
AddColumnRight.displayName = 'AddColumnRight';
|
|
99
|
-
AddRowBelow.displayName = 'AddRowBelow';
|
|
100
|
-
AddRowAbove.displayName = 'AddRowAbove';
|
|
101
|
-
DeleteColumn.displayName = 'DeleteColumn';
|
|
102
|
-
DeleteRow.displayName = 'DeleteRow';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ColorToolProps } from './utils';
|
|
3
|
-
/**
|
|
4
|
-
* The props of the TextColor tool component.
|
|
5
|
-
*/
|
|
6
|
-
export interface TextColorProps extends ColorToolProps {
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* The TextColor tool component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const TextColor: React.FunctionComponent<TextColorProps>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { keys } from '../messages';
|
|
2
|
-
import { ColorTool } from './utils';
|
|
3
|
-
import { foregroundColorIcon } from '@progress/kendo-svg-icons';
|
|
4
|
-
/**
|
|
5
|
-
* The TextColor tool component.
|
|
6
|
-
*/
|
|
7
|
-
export const TextColor = ColorTool({
|
|
8
|
-
icon: 'foreground-color',
|
|
9
|
-
svgIcon: foregroundColorIcon,
|
|
10
|
-
view: 'palette',
|
|
11
|
-
property: 'color',
|
|
12
|
-
titleKey: keys.textColor,
|
|
13
|
-
ariaLabel: 'Text Color'
|
|
14
|
-
});
|
|
15
|
-
TextColor.displayName = 'TextColor';
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
/**
|
|
7
|
-
* The TextWrap tool component.
|
|
8
|
-
*/
|
|
9
|
-
export const TextWrap = props => {
|
|
10
|
-
const { value: selected, spreadsheetRef } = props;
|
|
11
|
-
const onClick = React.useCallback(() => {
|
|
12
|
-
if (spreadsheetRef.current) {
|
|
13
|
-
const sheet = spreadsheetRef.current.activeSheet();
|
|
14
|
-
if (sheet) {
|
|
15
|
-
const range = sheet.range(sheet.activeCell());
|
|
16
|
-
const value = !range.wrap();
|
|
17
|
-
const options = {
|
|
18
|
-
command: 'TextWrapCommand', options: { property: 'wrap', value }
|
|
19
|
-
};
|
|
20
|
-
spreadsheetRef.current.executeCommand(options);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}, []);
|
|
24
|
-
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 }));
|
|
25
|
-
};
|
|
26
|
-
TextWrap.displayName = 'TextWrap';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { PropertyChangeToolProps } from './utils';
|
|
3
|
-
/**
|
|
4
|
-
* The props of the Underline tool component.
|
|
5
|
-
*/
|
|
6
|
-
export interface UnderlineProps extends PropertyChangeToolProps {
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* The Underline tool component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Underline: React.FunctionComponent<UnderlineProps>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { underlineIcon } from '@progress/kendo-svg-icons';
|
|
2
|
-
import { PropertyChangeTool } from './utils';
|
|
3
|
-
import { keys } from '../messages';
|
|
4
|
-
const underlineSettings = { property: 'underline', icon: 'underline', svgIcon: underlineIcon, titleKey: keys.underline };
|
|
5
|
-
/**
|
|
6
|
-
* The Underline tool component.
|
|
7
|
-
*/
|
|
8
|
-
export const Underline = PropertyChangeTool(underlineSettings);
|
|
9
|
-
Underline.displayName = 'Underline';
|
package/dist/es/tools/undo.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { SpreadsheetToolProps } from './utils';
|
|
3
|
-
/**
|
|
4
|
-
* The props of the Undo tool component.
|
|
5
|
-
*/
|
|
6
|
-
export interface UndoProps extends SpreadsheetToolProps {
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* The Undo tool component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Undo: React.FunctionComponent<UndoProps>;
|
package/dist/es/tools/undo.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { arrowRotateCcwIcon } from '@progress/kendo-svg-icons';
|
|
2
|
-
import { UndoRedo } from './utils';
|
|
3
|
-
import { keys } from '../messages';
|
|
4
|
-
const undoSettings = { action: 'undo', icon: 'reset', svgIcon: arrowRotateCcwIcon, titleKey: keys.undo };
|
|
5
|
-
/**
|
|
6
|
-
* The Undo tool component.
|
|
7
|
-
*/
|
|
8
|
-
export const Undo = UndoRedo(undoSettings);
|
|
9
|
-
Undo.displayName = 'Undo';
|
package/dist/es/tools/utils.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { SpreadsheetWidget } from './../SpreadsheetProps';
|
|
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
|
-
* The base props interface of the Spreadsheet tool component.
|
|
33
|
-
*/
|
|
34
|
-
export interface SpreadsheetToolProps {
|
|
35
|
-
/**
|
|
36
|
-
* The `React.RefObject` object of the SpreadsheetWidget, holding the core functionality of the Spreadsheet.
|
|
37
|
-
*/
|
|
38
|
-
spreadsheetRef: React.RefObject<SpreadsheetWidget>;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @hidden
|
|
42
|
-
*/
|
|
43
|
-
export interface PropertyChangeToolProps extends SpreadsheetToolProps {
|
|
44
|
-
/**
|
|
45
|
-
* The selected state of the tool.
|
|
46
|
-
*/
|
|
47
|
-
value?: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* @hidden
|
|
51
|
-
*/
|
|
52
|
-
export interface DropDownToolProps extends SpreadsheetToolProps {
|
|
53
|
-
/**
|
|
54
|
-
* The value of the tool.
|
|
55
|
-
*/
|
|
56
|
-
value?: any;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @hidden
|
|
60
|
-
*/
|
|
61
|
-
export declare const PropertyChangeTool: <Props extends PropertyChangeToolProps>(settings: {
|
|
62
|
-
property: string;
|
|
63
|
-
icon: string;
|
|
64
|
-
svgIcon: SVGIcon;
|
|
65
|
-
titleKey: string;
|
|
66
|
-
}) => React.FunctionComponent<Props>;
|
|
67
|
-
/**
|
|
68
|
-
* @hidden
|
|
69
|
-
*/
|
|
70
|
-
export interface ColorToolProps extends SpreadsheetToolProps {
|
|
71
|
-
/**
|
|
72
|
-
* The value of the tool.
|
|
73
|
-
*/
|
|
74
|
-
value?: string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* @hidden
|
|
78
|
-
*/
|
|
79
|
-
export declare const ColorTool: <Props extends ColorToolProps>(settings: ColorPickerProps & {
|
|
80
|
-
property: string;
|
|
81
|
-
titleKey: string;
|
|
82
|
-
}) => React.FunctionComponent<Props>;
|
|
83
|
-
/**
|
|
84
|
-
* @hidden
|
|
85
|
-
*/
|
|
86
|
-
export declare const UndoRedo: <Props extends SpreadsheetToolProps>(settings: {
|
|
87
|
-
action: string;
|
|
88
|
-
icon: string;
|
|
89
|
-
svgIcon: SVGIcon;
|
|
90
|
-
titleKey: string;
|
|
91
|
-
}) => React.FunctionComponent<Props>;
|
package/dist/es/tools/utils.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import * as React from 'react';
|
|
13
|
-
import { Button } from '@progress/kendo-react-buttons';
|
|
14
|
-
import { ColorPicker } from '@progress/kendo-react-inputs';
|
|
15
|
-
import { useLocalization } from '@progress/kendo-react-intl';
|
|
16
|
-
import { messages } from '../messages';
|
|
17
|
-
/**
|
|
18
|
-
* @hidden
|
|
19
|
-
*/
|
|
20
|
-
export const FONT_FAMILIES = ['Arial', 'Courier New', 'Georgia', 'Times New Roman', 'Trebuchet MS', 'Verdana'];
|
|
21
|
-
/**
|
|
22
|
-
* @hidden
|
|
23
|
-
*/
|
|
24
|
-
export const DEFAULT_FONT_FAMILY = 'Arial';
|
|
25
|
-
/**
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
export const FONT_SIZES = [8, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72];
|
|
29
|
-
/**
|
|
30
|
-
* @hidden
|
|
31
|
-
*/
|
|
32
|
-
export const DEFAULT_FONT_SIZE = 12;
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
export const FORMATS = [
|
|
37
|
-
{ text: 'Automatic', value: null },
|
|
38
|
-
{ text: 'Text', value: '@' },
|
|
39
|
-
{ text: 'Number', value: '#,0.00' },
|
|
40
|
-
{ text: 'Percent', value: '0.00%' },
|
|
41
|
-
{ text: 'Financial', value: '_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)' },
|
|
42
|
-
{ text: 'Currency', value: '$#,##0.00;[Red]$#,##0.00' },
|
|
43
|
-
{ text: 'Date', value: 'm/d/yyyy' },
|
|
44
|
-
{ text: 'Time', value: 'h:mm:ss AM/PM' },
|
|
45
|
-
{ text: 'Date time', value: 'm/d/yyyy h:mm' },
|
|
46
|
-
{ text: 'Duration', value: '[h]:mm:ss' }
|
|
47
|
-
];
|
|
48
|
-
/**
|
|
49
|
-
* @hidden
|
|
50
|
-
*/
|
|
51
|
-
export const PropertyChangeTool = (settings) => {
|
|
52
|
-
const tool = props => {
|
|
53
|
-
const { property, icon, svgIcon, titleKey } = settings;
|
|
54
|
-
const { spreadsheetRef, value: selected } = props;
|
|
55
|
-
const onClick = React.useCallback(() => {
|
|
56
|
-
if (spreadsheetRef.current) {
|
|
57
|
-
const value = !selected;
|
|
58
|
-
const options = {
|
|
59
|
-
command: 'PropertyChangeCommand', options: { property, value }
|
|
60
|
-
};
|
|
61
|
-
spreadsheetRef.current.executeCommand(options);
|
|
62
|
-
}
|
|
63
|
-
}, [selected]);
|
|
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
|
-
};
|
|
66
|
-
return tool;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* @hidden
|
|
70
|
-
*/
|
|
71
|
-
export const ColorTool = (settings) => {
|
|
72
|
-
const tool = props => {
|
|
73
|
-
const { property, titleKey } = settings, colorPickerProps = __rest(settings, ["property", "titleKey"]);
|
|
74
|
-
const { spreadsheetRef, value } = props;
|
|
75
|
-
const onChange = React.useCallback((event) => {
|
|
76
|
-
if (spreadsheetRef.current) {
|
|
77
|
-
const options = {
|
|
78
|
-
command: 'PropertyChangeCommand', options: { property, value: event.value || null }
|
|
79
|
-
};
|
|
80
|
-
spreadsheetRef.current.executeCommand(options);
|
|
81
|
-
}
|
|
82
|
-
}, [property]);
|
|
83
|
-
return (React.createElement(ColorPicker, Object.assign({ onChange: onChange, onActiveColorClick: onChange, fillMode: "flat" }, colorPickerProps, { title: useLocalization().toLanguageString(titleKey, messages[titleKey]), value: value })));
|
|
84
|
-
};
|
|
85
|
-
return tool;
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* @hidden
|
|
89
|
-
*/
|
|
90
|
-
export const UndoRedo = (settings) => {
|
|
91
|
-
const tool = props => {
|
|
92
|
-
const { spreadsheetRef } = props;
|
|
93
|
-
const onClick = React.useCallback(() => {
|
|
94
|
-
if (spreadsheetRef.current) {
|
|
95
|
-
const workbook = spreadsheetRef.current.workbook;
|
|
96
|
-
workbook.undoRedoStack[settings.action]();
|
|
97
|
-
}
|
|
98
|
-
}, []);
|
|
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
|
-
};
|
|
101
|
-
return tool;
|
|
102
|
-
};
|
package/dist/npm/FormulaInput.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormulaInput = void 0;
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const kendo_react_popup_1 = require("@progress/kendo-react-popup");
|
|
6
|
-
const List_1 = require("./List");
|
|
7
|
-
const kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
exports.FormulaInput = React.forwardRef((props, ref) => {
|
|
12
|
-
const [showPopup, setShowPopup] = React.useState(false);
|
|
13
|
-
const [popupContentKey, setPopupContentKey] = React.useState(0);
|
|
14
|
-
const [data, setData] = React.useState([]);
|
|
15
|
-
const memo = React.useMemo(() => ({}), []);
|
|
16
|
-
memo.showPopup = showPopup;
|
|
17
|
-
memo.popupContentKey = popupContentKey;
|
|
18
|
-
memo.data = data;
|
|
19
|
-
const target = React.useRef(null);
|
|
20
|
-
const elementRef = React.useRef(null);
|
|
21
|
-
const listRef = React.useRef(null);
|
|
22
|
-
const focusedItem = React.useCallback(() => {
|
|
23
|
-
if (listRef.current && listRef.current.element) {
|
|
24
|
-
return listRef.current.element.querySelector('.k-focus');
|
|
25
|
-
}
|
|
26
|
-
}, []);
|
|
27
|
-
const unfocus = React.useCallback(() => {
|
|
28
|
-
const focused = focusedItem();
|
|
29
|
-
if (focused) {
|
|
30
|
-
focused.classList.remove('k-focus');
|
|
31
|
-
}
|
|
32
|
-
}, []);
|
|
33
|
-
const focusNext = React.useCallback((dir) => {
|
|
34
|
-
const items = Array.from((listRef.current && listRef.current.element.children) || []);
|
|
35
|
-
const focused = focusedItem();
|
|
36
|
-
let next;
|
|
37
|
-
if (focused) {
|
|
38
|
-
const index = items.indexOf(focused);
|
|
39
|
-
focused.classList.remove('k-focus');
|
|
40
|
-
next = items[index + dir] ? items[index + dir] : (dir === 1 ? items[0] : items[items.length - 1]);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
next = (dir === 1 ? items[0] : items[items.length - 1]);
|
|
44
|
-
}
|
|
45
|
-
if (next) {
|
|
46
|
-
next.classList.add('k-focus');
|
|
47
|
-
}
|
|
48
|
-
}, []);
|
|
49
|
-
React.useImperativeHandle(target, () => ({
|
|
50
|
-
element: elementRef.current,
|
|
51
|
-
props,
|
|
52
|
-
popup: {
|
|
53
|
-
open: () => {
|
|
54
|
-
setShowPopup(true);
|
|
55
|
-
},
|
|
56
|
-
close: () => {
|
|
57
|
-
setShowPopup(false);
|
|
58
|
-
},
|
|
59
|
-
position: () => {
|
|
60
|
-
setPopupContentKey(memo.popupContentKey + 1);
|
|
61
|
-
},
|
|
62
|
-
visible: () => {
|
|
63
|
-
return memo.showPopup;
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
list: {
|
|
67
|
-
get element() { return listRef.current && listRef.current.element; },
|
|
68
|
-
data: (d) => {
|
|
69
|
-
if (d) {
|
|
70
|
-
setData(d);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
return memo.data;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
value: () => { return {}; },
|
|
77
|
-
focus: () => {
|
|
78
|
-
const items = Array.from((listRef.current && listRef.current.element && listRef.current.element.children) || []);
|
|
79
|
-
return items.indexOf(focusedItem());
|
|
80
|
-
},
|
|
81
|
-
// select: (x) => {
|
|
82
|
-
// console.log('select', x);
|
|
83
|
-
// },
|
|
84
|
-
focusNext: () => {
|
|
85
|
-
focusNext(1);
|
|
86
|
-
},
|
|
87
|
-
focusPrev: () => {
|
|
88
|
-
focusNext(-1);
|
|
89
|
-
},
|
|
90
|
-
focusFirst: () => {
|
|
91
|
-
const list = listRef.current && listRef.current.element;
|
|
92
|
-
if (list && list.children.item(0)) {
|
|
93
|
-
unfocus();
|
|
94
|
-
list.children.item(0).classList.add('k-focus');
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
focusLast: () => {
|
|
98
|
-
const list = listRef.current && listRef.current.element;
|
|
99
|
-
if (list && list.children.length) {
|
|
100
|
-
unfocus();
|
|
101
|
-
list.children.item(list.children.length - 1).classList.add('k-focus');
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
itemClick: (handler) => { memo.itemClick = handler; }
|
|
105
|
-
}
|
|
106
|
-
}), []);
|
|
107
|
-
React.useImperativeHandle(ref, () => target.current, []);
|
|
108
|
-
const onItemClick = React.useCallback((value) => {
|
|
109
|
-
if (memo.itemClick) {
|
|
110
|
-
memo.itemClick(value);
|
|
111
|
-
}
|
|
112
|
-
}, []);
|
|
113
|
-
return (React.createElement(React.Fragment, null,
|
|
114
|
-
React.createElement("div", { className: (0, kendo_react_common_1.classNames)('k-spreadsheet-formula-input', props.className), contentEditable: "true", spellCheck: "false", style: { whiteSpace: 'pre' }, ref: elementRef }),
|
|
115
|
-
React.createElement(kendo_react_popup_1.Popup, { show: showPopup, anchor: elementRef.current, animate: { openDuration: 100, closeDuration: 100 }, contentKey: popupContentKey, popupClass: "k-list-container" },
|
|
116
|
-
React.createElement(List_1.List, { data: data, ref: listRef, onItemClick: onItemClick }))));
|
|
117
|
-
});
|
|
118
|
-
exports.FormulaInput.displayName = 'FormulaInput';
|
|
119
|
-
exports.FormulaInput.propTypes = {};
|
package/dist/npm/List.d.ts
DELETED
package/dist/npm/List.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.List = void 0;
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
6
|
-
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
exports.List = React.forwardRef((props, ref) => {
|
|
11
|
-
const target = React.useRef(null);
|
|
12
|
-
const ulRef = React.useRef(null);
|
|
13
|
-
React.useImperativeHandle(target, () => ({
|
|
14
|
-
element: ulRef.current,
|
|
15
|
-
props
|
|
16
|
-
}));
|
|
17
|
-
React.useImperativeHandle(ref, () => target.current);
|
|
18
|
-
return (React.createElement("div", { className: "k-list k-list-md" },
|
|
19
|
-
React.createElement("div", { className: "k-list-content" },
|
|
20
|
-
React.createElement("ul", { ref: ulRef, className: "k-spreadsheet-formula-list k-list-ul", onMouseDown: e => e.preventDefault(), style: { maxHeight: 280 } }, props.data.map((item) => (React.createElement("li", { key: item.text, className: "k-list-item", onClick: () => props.onItemClick(item.value) },
|
|
21
|
-
React.createElement(kendo_react_common_1.IconWrap, { name: "formula-fx", icon: kendo_svg_icons_1.formulaFxIcon }),
|
|
22
|
-
React.createElement("span", { className: "k-list-item-text" }, item.text))))))));
|
|
23
|
-
});
|
|
24
|
-
exports.List.displayName = 'List';
|
|
25
|
-
exports.List.propTypes = {};
|