@progress/kendo-react-spreadsheet 5.17.0-dev.202308241527 → 5.17.0-dev.202308241633
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/dist/cdn/js/kendo-react-spreadsheet.js +1 -1
- package/dist/es/FormulaInput.js +1 -1
- package/dist/es/List.js +7 -2
- package/dist/es/Spreadsheet.js +13 -2
- package/dist/es/messages.d.ts +20 -0
- package/dist/es/messages.js +68 -8
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/tools/adjustDecimals.d.ts +20 -0
- package/dist/es/tools/adjustDecimals.js +39 -0
- package/dist/es/tools/align.d.ts +26 -0
- package/dist/es/tools/align.js +61 -7
- package/dist/es/tools/cleanFormat.d.ts +11 -0
- package/dist/es/tools/cleanFormat.js +17 -0
- package/dist/es/tools/defaultTools.js +14 -5
- package/dist/es/tools/fontSize.d.ts +29 -1
- package/dist/es/tools/fontSize.js +65 -9
- package/dist/es/tools/index.d.ts +1 -0
- package/dist/es/tools/index.js +1 -0
- package/dist/es/tools/tableTools.d.ts +14 -6
- package/dist/es/tools/tableTools.js +20 -8
- package/dist/npm/FormulaInput.js +1 -1
- package/dist/npm/List.js +7 -2
- package/dist/npm/Spreadsheet.js +13 -2
- package/dist/npm/messages.d.ts +20 -0
- package/dist/npm/messages.js +68 -8
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/tools/adjustDecimals.d.ts +20 -0
- package/dist/npm/tools/adjustDecimals.js +42 -0
- package/dist/npm/tools/align.d.ts +26 -0
- package/dist/npm/tools/align.js +62 -8
- package/dist/npm/tools/cleanFormat.d.ts +11 -0
- package/dist/npm/tools/cleanFormat.js +21 -0
- package/dist/npm/tools/defaultTools.js +12 -3
- package/dist/npm/tools/fontSize.d.ts +29 -1
- package/dist/npm/tools/fontSize.js +66 -10
- package/dist/npm/tools/index.d.ts +1 -0
- package/dist/npm/tools/index.js +1 -0
- package/dist/npm/tools/tableTools.d.ts +14 -6
- package/dist/npm/tools/tableTools.js +20 -8
- package/dist/systemjs/kendo-react-spreadsheet.js +1 -1
- package/package.json +12 -12
|
@@ -3,21 +3,77 @@ import { ComboBox } from '@progress/kendo-react-dropdowns';
|
|
|
3
3
|
import { DEFAULT_FONT_SIZE, FONT_SIZES } from './utils';
|
|
4
4
|
import { keys, messages } from '../messages';
|
|
5
5
|
import { useLocalization } from '@progress/kendo-react-intl';
|
|
6
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
7
|
+
import { fontGrowIcon, fontShrinkIcon } from '@progress/kendo-svg-icons';
|
|
8
|
+
const toNumber = (value) => {
|
|
9
|
+
return typeof value === 'string' ? parseFloat(value) : value;
|
|
10
|
+
};
|
|
6
11
|
/**
|
|
7
12
|
* The FontSize tool component.
|
|
8
13
|
*/
|
|
9
14
|
export const FontSize = props => {
|
|
10
|
-
const { spreadsheetRef
|
|
15
|
+
const { spreadsheetRef } = props;
|
|
16
|
+
const value = toNumber(props.value);
|
|
11
17
|
const onChange = React.useCallback((event) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
var _a;
|
|
19
|
+
const options = {
|
|
20
|
+
command: 'PropertyChangeCommand', options: { property: 'fontSize', value: event.value ? toNumber(event.value) : null }
|
|
21
|
+
};
|
|
22
|
+
if (event.nativeEvent.type === 'keydown' || event.nativeEvent.type === 'focusout') {
|
|
23
|
+
(_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.executeCommand(options);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
(_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.executeCommand(options);
|
|
29
|
+
}, 0);
|
|
30
|
+
}
|
|
20
31
|
}, []);
|
|
21
32
|
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 }));
|
|
22
33
|
};
|
|
23
34
|
FontSize.displayName = 'FontSize';
|
|
35
|
+
const minFontSize = 1;
|
|
36
|
+
const maxFontSize = 409;
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
const fontSizeChangeTool = (settings) => {
|
|
41
|
+
const tool = props => {
|
|
42
|
+
const { property, icon, svgIcon, titleKey, step } = settings;
|
|
43
|
+
const { spreadsheetRef } = props;
|
|
44
|
+
const value = toNumber(props.value);
|
|
45
|
+
const onClick = React.useCallback(() => {
|
|
46
|
+
var _a;
|
|
47
|
+
const options = {
|
|
48
|
+
command: 'PropertyChangeCommand',
|
|
49
|
+
options: { property, value: Math.min(maxFontSize, Math.max(minFontSize, value + step)) }
|
|
50
|
+
};
|
|
51
|
+
(_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.executeCommand(options);
|
|
52
|
+
}, [value]);
|
|
53
|
+
return (React.createElement(Button, { type: "button", icon: icon, svgIcon: svgIcon, fillMode: "flat", onClick: onClick, disabled: value + step < minFontSize || value + step > maxFontSize, title: useLocalization().toLanguageString(titleKey, messages[titleKey]) }));
|
|
54
|
+
};
|
|
55
|
+
tool.displayName = settings.displayName;
|
|
56
|
+
return tool;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The IncreaseFontSize tool component.
|
|
60
|
+
*/
|
|
61
|
+
export const IncreaseFontSize = fontSizeChangeTool({
|
|
62
|
+
property: 'fontSize',
|
|
63
|
+
icon: 'font-grow',
|
|
64
|
+
svgIcon: fontGrowIcon,
|
|
65
|
+
titleKey: keys.fontSizeIncrease,
|
|
66
|
+
displayName: 'IncreaseFontSize',
|
|
67
|
+
step: 1
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* The DecreaseFontSize tool component.
|
|
71
|
+
*/
|
|
72
|
+
export const DecreaseFontSize = fontSizeChangeTool({
|
|
73
|
+
property: 'fontSize',
|
|
74
|
+
icon: 'font-shrink',
|
|
75
|
+
svgIcon: fontShrinkIcon,
|
|
76
|
+
titleKey: keys.fontSizeDecrease,
|
|
77
|
+
displayName: 'DecreaseFontSize',
|
|
78
|
+
step: -1
|
|
79
|
+
});
|
package/dist/es/tools/index.d.ts
CHANGED
package/dist/es/tools/index.js
CHANGED
|
@@ -1,34 +1,41 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
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
|
+
}
|
|
3
10
|
/**
|
|
4
11
|
* The props of the AddColumnLeft tool component.
|
|
5
12
|
*/
|
|
6
|
-
export interface AddColumnLeftProps extends
|
|
13
|
+
export interface AddColumnLeftProps extends TableToolProps {
|
|
7
14
|
}
|
|
8
15
|
/**
|
|
9
16
|
* The props of the AddColumnRight tool component.
|
|
10
17
|
*/
|
|
11
|
-
export interface AddColumnRightProps extends
|
|
18
|
+
export interface AddColumnRightProps extends TableToolProps {
|
|
12
19
|
}
|
|
13
20
|
/**
|
|
14
21
|
* The props of the AddRowBelow tool component.
|
|
15
22
|
*/
|
|
16
|
-
export interface AddRowBelowProps extends
|
|
23
|
+
export interface AddRowBelowProps extends TableToolProps {
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
19
26
|
* The props of the AddRowAbove tool component.
|
|
20
27
|
*/
|
|
21
|
-
export interface AddRowAboveProps extends
|
|
28
|
+
export interface AddRowAboveProps extends TableToolProps {
|
|
22
29
|
}
|
|
23
30
|
/**
|
|
24
31
|
* The props of the DeleteColumn tool component.
|
|
25
32
|
*/
|
|
26
|
-
export interface DeleteColumnProps extends
|
|
33
|
+
export interface DeleteColumnProps extends TableToolProps {
|
|
27
34
|
}
|
|
28
35
|
/**
|
|
29
36
|
* The props of the DeleteRow tool component.
|
|
30
37
|
*/
|
|
31
|
-
export interface DeleteRowProps extends
|
|
38
|
+
export interface DeleteRowProps extends TableToolProps {
|
|
32
39
|
}
|
|
33
40
|
/**
|
|
34
41
|
* The AddColumnLeft tool component.
|
|
@@ -54,3 +61,4 @@ export declare const DeleteColumn: React.FunctionComponent<DeleteColumnProps>;
|
|
|
54
61
|
* The DeleteRow tool component.
|
|
55
62
|
*/
|
|
56
63
|
export declare const DeleteRow: React.FunctionComponent<DeleteRowProps>;
|
|
64
|
+
export {};
|
|
@@ -5,7 +5,7 @@ import { keys, messages } from '../messages';
|
|
|
5
5
|
import { useLocalization } from '@progress/kendo-react-intl';
|
|
6
6
|
const TableDataTool = (settings) => {
|
|
7
7
|
const tool = props => {
|
|
8
|
-
const { spreadsheetRef } = props;
|
|
8
|
+
const { spreadsheetRef, value } = props;
|
|
9
9
|
const onClick = React.useCallback(() => {
|
|
10
10
|
if (spreadsheetRef.current) {
|
|
11
11
|
const options = {
|
|
@@ -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, fillMode: "flat", 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, disabled: value && settings.disabled(value) }));
|
|
18
18
|
};
|
|
19
19
|
return tool;
|
|
20
20
|
};
|
|
@@ -23,40 +23,52 @@ const addColumnLeft = {
|
|
|
23
23
|
value: 'left',
|
|
24
24
|
icon: 'table-column-insert-left',
|
|
25
25
|
svgIcon: tableColumnInsertLeftIcon,
|
|
26
|
-
titleKey: keys.addColumnLeft
|
|
26
|
+
titleKey: keys.addColumnLeft,
|
|
27
|
+
disabled: (headers) => headers.allCols,
|
|
28
|
+
displayName: 'AddColumnLeft'
|
|
27
29
|
};
|
|
28
30
|
const addColumnRight = {
|
|
29
31
|
command: 'AddColumnCommand',
|
|
30
32
|
value: 'right',
|
|
31
33
|
icon: 'table-column-insert-right',
|
|
32
34
|
svgIcon: tableColumnInsertRightIcon,
|
|
33
|
-
titleKey: keys.addColumnRight
|
|
35
|
+
titleKey: keys.addColumnRight,
|
|
36
|
+
disabled: (headers) => headers.allCols,
|
|
37
|
+
displayName: 'AddColumnRight'
|
|
34
38
|
};
|
|
35
39
|
const addRowBelow = {
|
|
36
40
|
command: 'AddRowCommand',
|
|
37
41
|
value: 'below',
|
|
38
42
|
icon: 'table-row-insert-below',
|
|
39
43
|
svgIcon: tableRowInsertBelowIcon,
|
|
40
|
-
titleKey: keys.addRowBelow
|
|
44
|
+
titleKey: keys.addRowBelow,
|
|
45
|
+
disabled: (headers) => headers.allRows,
|
|
46
|
+
displayName: 'AddRowBelow'
|
|
41
47
|
};
|
|
42
48
|
const addRowAbove = {
|
|
43
49
|
command: 'AddRowCommand',
|
|
44
50
|
value: 'above',
|
|
45
51
|
icon: 'table-row-insert-above',
|
|
46
52
|
svgIcon: tableRowInsertAboveIcon,
|
|
47
|
-
titleKey: keys.addRowAbove
|
|
53
|
+
titleKey: keys.addRowAbove,
|
|
54
|
+
disabled: (headers) => headers.allRows,
|
|
55
|
+
displayName: 'AddRowAbove'
|
|
48
56
|
};
|
|
49
57
|
const deleteColumn = {
|
|
50
58
|
command: 'DeleteColumnCommand',
|
|
51
59
|
icon: 'table-column-delete',
|
|
52
60
|
svgIcon: tableColumnDeleteIcon,
|
|
53
|
-
titleKey: keys.deleteColumn
|
|
61
|
+
titleKey: keys.deleteColumn,
|
|
62
|
+
disabled: (headers) => headers.allCols,
|
|
63
|
+
displayName: 'DeleteColumn'
|
|
54
64
|
};
|
|
55
65
|
const deleteRow = {
|
|
56
66
|
command: 'DeleteRowCommand',
|
|
57
67
|
icon: 'table-row-delete',
|
|
58
68
|
svgIcon: tableRowDeleteIcon,
|
|
59
|
-
titleKey: keys.deleteRow
|
|
69
|
+
titleKey: keys.deleteRow,
|
|
70
|
+
disabled: (headers) => headers.allRows,
|
|
71
|
+
displayName: 'DeleteRow'
|
|
60
72
|
};
|
|
61
73
|
/**
|
|
62
74
|
* The AddColumnLeft tool component.
|
package/dist/npm/FormulaInput.js
CHANGED
|
@@ -112,7 +112,7 @@ exports.FormulaInput = React.forwardRef((props, ref) => {
|
|
|
112
112
|
}, []);
|
|
113
113
|
return (React.createElement(React.Fragment, null,
|
|
114
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 },
|
|
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
116
|
React.createElement(List_1.List, { data: data, ref: listRef, onItemClick: onItemClick }))));
|
|
117
117
|
});
|
|
118
118
|
exports.FormulaInput.displayName = 'FormulaInput';
|
package/dist/npm/List.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.List = void 0;
|
|
4
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");
|
|
5
7
|
/**
|
|
6
8
|
* @hidden
|
|
7
9
|
*/
|
|
@@ -13,8 +15,11 @@ exports.List = React.forwardRef((props, ref) => {
|
|
|
13
15
|
props
|
|
14
16
|
}));
|
|
15
17
|
React.useImperativeHandle(ref, () => target.current);
|
|
16
|
-
return (React.createElement("
|
|
17
|
-
React.createElement("
|
|
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))))))));
|
|
18
23
|
});
|
|
19
24
|
exports.List.displayName = 'List';
|
|
20
25
|
exports.List.propTypes = {};
|
package/dist/npm/Spreadsheet.js
CHANGED
|
@@ -25,11 +25,21 @@ const toolsValueMap = {
|
|
|
25
25
|
Underline: (state) => state.underline,
|
|
26
26
|
FontFamily: (state) => state.fontFamily,
|
|
27
27
|
FontSize: (state) => state.fontSize,
|
|
28
|
+
IncreaseFontSize: (state) => state.fontSize,
|
|
29
|
+
DecreaseFontSize: (state) => state.fontSize,
|
|
28
30
|
TextColor: (state) => state.color,
|
|
29
31
|
BackgroundColor: (state) => state.background,
|
|
30
32
|
Alignment: (state) => ({ textAlign: state.textAlign, verticalAlign: state.verticalAlign }),
|
|
33
|
+
AlignHorizontally: (state) => state.textAlign,
|
|
34
|
+
AlignVertically: (state) => state.verticalAlign,
|
|
31
35
|
TextWrap: (state) => state.wrap,
|
|
32
|
-
GridLines: (state) => state.gridLines
|
|
36
|
+
GridLines: (state) => state.gridLines,
|
|
37
|
+
AddColumnLeft: (state) => state.selectedHeaders,
|
|
38
|
+
AddColumnRight: (state) => state.selectedHeaders,
|
|
39
|
+
AddRowBelow: (state) => state.selectedHeaders,
|
|
40
|
+
AddRowAbove: (state) => state.selectedHeaders,
|
|
41
|
+
DeleteColumn: (state) => state.selectedHeaders,
|
|
42
|
+
DeleteRow: (state) => state.selectedHeaders
|
|
33
43
|
};
|
|
34
44
|
const noInnerButton = ':not(.k-dropdownlist button)' +
|
|
35
45
|
':not(.k-combobox button)' +
|
|
@@ -134,7 +144,8 @@ exports.Spreadsheet = React.forwardRef((props, ref) => {
|
|
|
134
144
|
state[tool] = e.range.sheet().showGridLines();
|
|
135
145
|
}
|
|
136
146
|
});
|
|
137
|
-
|
|
147
|
+
state.selectedHeaders = e.range.sheet().selectedHeaders();
|
|
148
|
+
if (Object.keys(state).some(k => state[k] !== prevState.current[k])) {
|
|
138
149
|
setToolsState(state);
|
|
139
150
|
}
|
|
140
151
|
}, []);
|
package/dist/npm/messages.d.ts
CHANGED
|
@@ -8,16 +8,25 @@ export declare const messages: {
|
|
|
8
8
|
"spreadsheet.undo": string;
|
|
9
9
|
"spreadsheet.redo": string;
|
|
10
10
|
"spreadsheet.fontSize": string;
|
|
11
|
+
"spreadsheet.fontSizeIncrease": string;
|
|
12
|
+
"spreadsheet.fontSizeDecrease": string;
|
|
11
13
|
"spreadsheet.fontName": string;
|
|
14
|
+
"spreadsheet.cleanFormatting": string;
|
|
12
15
|
"spreadsheet.format": string;
|
|
16
|
+
"spreadsheet.alignHorizontally": string;
|
|
17
|
+
"spreadsheet.alignVertically": string;
|
|
13
18
|
"spreadsheet.align": string;
|
|
14
19
|
"spreadsheet.alignLeft": string;
|
|
15
20
|
"spreadsheet.alignRight": string;
|
|
16
21
|
"spreadsheet.alignCenter": string;
|
|
17
22
|
"spreadsheet.alignJustify": string;
|
|
23
|
+
"spreadsheet.center": string;
|
|
24
|
+
"spreadsheet.justify": string;
|
|
18
25
|
"spreadsheet.alignTop": string;
|
|
19
26
|
"spreadsheet.alignMiddle": string;
|
|
20
27
|
"spreadsheet.alignBottom": string;
|
|
28
|
+
"spreadsheet.increaseDecimal": string;
|
|
29
|
+
"spreadsheet.decreaseDecimal": string;
|
|
21
30
|
"spreadsheet.textColor": string;
|
|
22
31
|
"spreadsheet.background": string;
|
|
23
32
|
"spreadsheet.addRowAbove": string;
|
|
@@ -36,6 +45,7 @@ export declare const messages: {
|
|
|
36
45
|
"spreadsheet.file": string;
|
|
37
46
|
"spreadsheet.insert": string;
|
|
38
47
|
"spreadsheet.addNewSheet": string;
|
|
48
|
+
"spreadsheet.formatTab": string;
|
|
39
49
|
"spreadsheet.modifyMerged": string;
|
|
40
50
|
"spreadsheet.cannotModifyDisabled": string;
|
|
41
51
|
"spreadsheet.openUnsupported": string;
|
|
@@ -52,16 +62,25 @@ export declare const keys: {
|
|
|
52
62
|
undo: string;
|
|
53
63
|
redo: string;
|
|
54
64
|
fontSize: string;
|
|
65
|
+
fontSizeIncrease: string;
|
|
66
|
+
fontSizeDecrease: string;
|
|
55
67
|
fontName: string;
|
|
68
|
+
cleanFormatting: string;
|
|
56
69
|
format: string;
|
|
70
|
+
alignHorizontally: string;
|
|
71
|
+
alignVertically: string;
|
|
57
72
|
align: string;
|
|
58
73
|
alignLeft: string;
|
|
59
74
|
alignRight: string;
|
|
60
75
|
alignCenter: string;
|
|
76
|
+
center: string;
|
|
61
77
|
alignJustify: string;
|
|
78
|
+
justify: string;
|
|
62
79
|
alignTop: string;
|
|
63
80
|
alignMiddle: string;
|
|
64
81
|
alignBottom: string;
|
|
82
|
+
increaseDecimal: string;
|
|
83
|
+
decreaseDecimal: string;
|
|
65
84
|
textColor: string;
|
|
66
85
|
background: string;
|
|
67
86
|
addRowAbove: string;
|
|
@@ -85,4 +104,5 @@ export declare const keys: {
|
|
|
85
104
|
modifyMerged: string;
|
|
86
105
|
cannotModifyDisabled: string;
|
|
87
106
|
openUnsupported: string;
|
|
107
|
+
formatTab: string;
|
|
88
108
|
};
|
package/dist/npm/messages.js
CHANGED
|
@@ -61,14 +61,34 @@ const redo = 'spreadsheet.redo';
|
|
|
61
61
|
* @hidden
|
|
62
62
|
*/
|
|
63
63
|
const fontSize = 'spreadsheet.fontSize';
|
|
64
|
+
/**
|
|
65
|
+
* @hidden
|
|
66
|
+
*/
|
|
67
|
+
const fontSizeIncrease = 'spreadsheet.fontSizeIncrease';
|
|
68
|
+
/**
|
|
69
|
+
* @hidden
|
|
70
|
+
*/
|
|
71
|
+
const fontSizeDecrease = 'spreadsheet.fontSizeDecrease';
|
|
64
72
|
/**
|
|
65
73
|
* @hidden
|
|
66
74
|
*/
|
|
67
75
|
const fontName = 'spreadsheet.fontName';
|
|
76
|
+
/**
|
|
77
|
+
* @hidden
|
|
78
|
+
*/
|
|
79
|
+
const cleanFormatting = 'spreadsheet.cleanFormatting';
|
|
68
80
|
/**
|
|
69
81
|
* @hidden
|
|
70
82
|
*/
|
|
71
83
|
const format = 'spreadsheet.format';
|
|
84
|
+
/**
|
|
85
|
+
* @hidden
|
|
86
|
+
*/
|
|
87
|
+
const alignHorizontally = 'spreadsheet.alignHorizontally';
|
|
88
|
+
/**
|
|
89
|
+
* @hidden
|
|
90
|
+
*/
|
|
91
|
+
const alignVertically = 'spreadsheet.alignVertically';
|
|
72
92
|
/**
|
|
73
93
|
* @hidden
|
|
74
94
|
*/
|
|
@@ -85,10 +105,18 @@ const alignRight = 'spreadsheet.alignRight';
|
|
|
85
105
|
* @hidden
|
|
86
106
|
*/
|
|
87
107
|
const alignCenter = 'spreadsheet.alignCenter';
|
|
108
|
+
/**
|
|
109
|
+
* @hidden
|
|
110
|
+
*/
|
|
111
|
+
const center = 'spreadsheet.center';
|
|
88
112
|
/**
|
|
89
113
|
* @hidden
|
|
90
114
|
*/
|
|
91
115
|
const alignJustify = 'spreadsheet.alignJustify';
|
|
116
|
+
/**
|
|
117
|
+
* @hidden
|
|
118
|
+
*/
|
|
119
|
+
const justify = 'spreadsheet.justify';
|
|
92
120
|
/**
|
|
93
121
|
* @hidden
|
|
94
122
|
*/
|
|
@@ -101,6 +129,14 @@ const alignMiddle = 'spreadsheet.alignMiddle';
|
|
|
101
129
|
* @hidden
|
|
102
130
|
*/
|
|
103
131
|
const alignBottom = 'spreadsheet.alignBottom';
|
|
132
|
+
/**
|
|
133
|
+
* @hidden
|
|
134
|
+
*/
|
|
135
|
+
const increaseDecimal = 'spreadsheet.increaseDecimal';
|
|
136
|
+
/**
|
|
137
|
+
* @hidden
|
|
138
|
+
*/
|
|
139
|
+
const decreaseDecimal = 'spreadsheet.decreaseDecimal';
|
|
104
140
|
/**
|
|
105
141
|
* @hidden
|
|
106
142
|
*/
|
|
@@ -133,6 +169,10 @@ const file = 'spreadsheet.file';
|
|
|
133
169
|
* @hidden
|
|
134
170
|
*/
|
|
135
171
|
const insert = 'spreadsheet.insert';
|
|
172
|
+
/**
|
|
173
|
+
* @hidden
|
|
174
|
+
*/
|
|
175
|
+
const formatTab = 'spreadsheet.formatTab';
|
|
136
176
|
/**
|
|
137
177
|
* @hidden
|
|
138
178
|
*/
|
|
@@ -167,16 +207,25 @@ exports.messages = {
|
|
|
167
207
|
[undo]: 'Undo',
|
|
168
208
|
[redo]: 'Redo',
|
|
169
209
|
[fontSize]: 'Font size',
|
|
210
|
+
[fontSizeIncrease]: 'Increase Font size',
|
|
211
|
+
[fontSizeDecrease]: 'Decrease Font size',
|
|
170
212
|
[fontName]: 'Font',
|
|
213
|
+
[cleanFormatting]: 'Clean formatting',
|
|
171
214
|
[format]: 'Custom format...',
|
|
215
|
+
[alignHorizontally]: 'Align horizontally',
|
|
216
|
+
[alignVertically]: 'Align vertically',
|
|
172
217
|
[align]: 'Align',
|
|
173
|
-
[alignLeft]: 'Align
|
|
174
|
-
[alignRight]: 'Align
|
|
175
|
-
[alignCenter]: 'Align
|
|
176
|
-
[alignJustify]: 'Align
|
|
177
|
-
[
|
|
178
|
-
[
|
|
179
|
-
[
|
|
218
|
+
[alignLeft]: 'Align left',
|
|
219
|
+
[alignRight]: 'Align right',
|
|
220
|
+
[alignCenter]: 'Align center',
|
|
221
|
+
[alignJustify]: 'Align justify',
|
|
222
|
+
[center]: 'Center',
|
|
223
|
+
[justify]: 'Justify',
|
|
224
|
+
[alignTop]: 'Align top',
|
|
225
|
+
[alignMiddle]: 'Align middle',
|
|
226
|
+
[alignBottom]: 'Align bottom',
|
|
227
|
+
[increaseDecimal]: 'Increase decimal',
|
|
228
|
+
[decreaseDecimal]: 'Decrease decimal',
|
|
180
229
|
[textColor]: 'Text Color',
|
|
181
230
|
[background]: 'Background color',
|
|
182
231
|
[addRowAbove]: 'Add row above',
|
|
@@ -195,6 +244,7 @@ exports.messages = {
|
|
|
195
244
|
[file]: 'File',
|
|
196
245
|
[insert]: 'Insert',
|
|
197
246
|
[addNewSheet]: 'Add new sheet',
|
|
247
|
+
[formatTab]: 'Format',
|
|
198
248
|
[modifyMerged]: 'Cannot change part of a merged cell.',
|
|
199
249
|
[cannotModifyDisabled]: 'Cannot modify disabled cells.',
|
|
200
250
|
[openUnsupported]: 'Unsupported format. Please select an .xlsx file.',
|
|
@@ -211,16 +261,25 @@ exports.keys = {
|
|
|
211
261
|
undo,
|
|
212
262
|
redo,
|
|
213
263
|
fontSize,
|
|
264
|
+
fontSizeIncrease,
|
|
265
|
+
fontSizeDecrease,
|
|
214
266
|
fontName,
|
|
267
|
+
cleanFormatting,
|
|
215
268
|
format,
|
|
269
|
+
alignHorizontally,
|
|
270
|
+
alignVertically,
|
|
216
271
|
align,
|
|
217
272
|
alignLeft,
|
|
218
273
|
alignRight,
|
|
219
274
|
alignCenter,
|
|
275
|
+
center,
|
|
220
276
|
alignJustify,
|
|
277
|
+
justify,
|
|
221
278
|
alignTop,
|
|
222
279
|
alignMiddle,
|
|
223
280
|
alignBottom,
|
|
281
|
+
increaseDecimal,
|
|
282
|
+
decreaseDecimal,
|
|
224
283
|
textColor,
|
|
225
284
|
background,
|
|
226
285
|
addRowAbove,
|
|
@@ -243,5 +302,6 @@ exports.keys = {
|
|
|
243
302
|
ok,
|
|
244
303
|
modifyMerged,
|
|
245
304
|
cannotModifyDisabled,
|
|
246
|
-
openUnsupported
|
|
305
|
+
openUnsupported,
|
|
306
|
+
formatTab
|
|
247
307
|
};
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-react-spreadsheet',
|
|
9
9
|
productName: 'KendoReact',
|
|
10
10
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1692893863,
|
|
12
12
|
version: '',
|
|
13
13
|
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'
|
|
14
14
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SpreadsheetToolProps } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* The props of the IncreaseDecimal tool component.
|
|
5
|
+
*/
|
|
6
|
+
export interface IncreaseDecimalProps extends SpreadsheetToolProps {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The IncreaseDecimal tool component.
|
|
10
|
+
*/
|
|
11
|
+
export declare const IncreaseDecimal: React.FunctionComponent<IncreaseDecimalProps>;
|
|
12
|
+
/**
|
|
13
|
+
* The props of the DecreaseDecimal tool component.
|
|
14
|
+
*/
|
|
15
|
+
export interface DecreaseDecimalProps extends SpreadsheetToolProps {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The DecreaseDecimal tool component.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DecreaseDecimal: React.FunctionComponent<DecreaseDecimalProps>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DecreaseDecimal = exports.IncreaseDecimal = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
6
|
+
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
7
|
+
const messages_1 = require("../messages");
|
|
8
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
9
|
+
const adjustDecimalsTool = (settings) => {
|
|
10
|
+
const tool = props => {
|
|
11
|
+
const { icon, svgIcon, titleKey, value } = settings;
|
|
12
|
+
const { spreadsheetRef } = props;
|
|
13
|
+
const onClick = React.useCallback(() => {
|
|
14
|
+
if (spreadsheetRef.current) {
|
|
15
|
+
const options = {
|
|
16
|
+
command: 'AdjustDecimalsCommand', options: { value }
|
|
17
|
+
};
|
|
18
|
+
spreadsheetRef.current.executeCommand(options);
|
|
19
|
+
}
|
|
20
|
+
}, []);
|
|
21
|
+
return (React.createElement(kendo_react_buttons_1.Button, { type: "button", icon: icon, svgIcon: svgIcon, fillMode: "flat", onClick: onClick, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(titleKey, messages_1.messages[titleKey]) }));
|
|
22
|
+
};
|
|
23
|
+
return tool;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The IncreaseDecimal tool component.
|
|
27
|
+
*/
|
|
28
|
+
exports.IncreaseDecimal = adjustDecimalsTool({
|
|
29
|
+
icon: kendo_svg_icons_1.decimalIncreaseIcon.name,
|
|
30
|
+
svgIcon: kendo_svg_icons_1.decimalIncreaseIcon,
|
|
31
|
+
value: 1,
|
|
32
|
+
titleKey: messages_1.keys.increaseDecimal
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* The DecreaseDecimal tool component.
|
|
36
|
+
*/
|
|
37
|
+
exports.DecreaseDecimal = adjustDecimalsTool({
|
|
38
|
+
icon: kendo_svg_icons_1.decimalDecreaseIcon.name,
|
|
39
|
+
svgIcon: kendo_svg_icons_1.decimalDecreaseIcon,
|
|
40
|
+
value: -1,
|
|
41
|
+
titleKey: messages_1.keys.decreaseDecimal
|
|
42
|
+
});
|
|
@@ -16,3 +16,29 @@ export interface AlignmentProps extends SpreadsheetToolProps {
|
|
|
16
16
|
* The Alignment tool component.
|
|
17
17
|
*/
|
|
18
18
|
export declare const Alignment: React.FunctionComponent<AlignmentProps>;
|
|
19
|
+
/**
|
|
20
|
+
* The props of the AlignHorizontally tool component.
|
|
21
|
+
*/
|
|
22
|
+
export interface AlignHorizontallyProps extends SpreadsheetToolProps {
|
|
23
|
+
/**
|
|
24
|
+
* The value of the tool.
|
|
25
|
+
*/
|
|
26
|
+
value: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The props of the AlignVertically tool component.
|
|
30
|
+
*/
|
|
31
|
+
export interface AlignVerticallyProps extends SpreadsheetToolProps {
|
|
32
|
+
/**
|
|
33
|
+
* The value of the tool.
|
|
34
|
+
*/
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The AlignHorizontally tool component.
|
|
39
|
+
*/
|
|
40
|
+
export declare const AlignHorizontally: React.FunctionComponent<AlignHorizontallyProps>;
|
|
41
|
+
/**
|
|
42
|
+
* The AlignVertically tool component.
|
|
43
|
+
*/
|
|
44
|
+
export declare const AlignVertically: React.FunctionComponent<AlignVerticallyProps>;
|