@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,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Alignment = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
6
|
+
const kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
7
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
8
|
+
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
9
|
+
const messages_1 = require("../messages");
|
|
10
|
+
const alignItems = [
|
|
11
|
+
{ icon: 'align-left', svgIcon: kendo_svg_icons_1.alignLeftIcon, textKey: messages_1.keys.alignLeft, commandName: 'textAlign', value: 'left' },
|
|
12
|
+
{ icon: 'align-center', svgIcon: kendo_svg_icons_1.alignCenterIcon, textKey: messages_1.keys.alignCenter, commandName: 'textAlign', value: 'center' },
|
|
13
|
+
{ icon: 'align-right', svgIcon: kendo_svg_icons_1.alignRightIcon, textKey: messages_1.keys.alignRight, commandName: 'textAlign', value: 'right' },
|
|
14
|
+
{ icon: 'align-justify', svgIcon: kendo_svg_icons_1.alignJustifyIcon, textKey: messages_1.keys.alignJustify, commandName: 'textAlign', value: 'justify' },
|
|
15
|
+
{ icon: 'align-top', svgIcon: kendo_svg_icons_1.alignTopIcon, textKey: messages_1.keys.alignTop, commandName: 'verticalAlign', value: 'top' },
|
|
16
|
+
{ icon: 'align-middle', svgIcon: kendo_svg_icons_1.alignMiddleIcon, textKey: messages_1.keys.alignMiddle, commandName: 'verticalAlign', value: 'center' },
|
|
17
|
+
{ icon: 'align-bottom', svgIcon: kendo_svg_icons_1.alignBottomIcon, textKey: messages_1.keys.alignBottom, commandName: 'verticalAlign', value: 'bottom' }
|
|
18
|
+
];
|
|
19
|
+
const Alignment = props => {
|
|
20
|
+
const { value, spreadsheetRef } = props;
|
|
21
|
+
const { textAlign, verticalAlign } = value || {};
|
|
22
|
+
const loc = (0, kendo_react_intl_1.useLocalization)();
|
|
23
|
+
const onItemClick = React.useCallback((event) => {
|
|
24
|
+
if (spreadsheetRef.current) {
|
|
25
|
+
const item = event.item;
|
|
26
|
+
const options = {
|
|
27
|
+
command: 'PropertyChangeCommand', options: { property: item.commandName, value: item.value || null }
|
|
28
|
+
};
|
|
29
|
+
spreadsheetRef.current.executeCommand(options);
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
32
|
+
let items = alignItems.slice();
|
|
33
|
+
items = items.map(i => (Object.assign(Object.assign({}, i), { text: loc.toLanguageString(i.textKey, messages_1.messages[i.textKey]) })));
|
|
34
|
+
if (textAlign) {
|
|
35
|
+
items = items.map(i => i.commandName === 'textAlign' ? Object.assign(Object.assign({}, i), { selected: i.value === textAlign }) : i);
|
|
36
|
+
}
|
|
37
|
+
if (verticalAlign) {
|
|
38
|
+
items = items.map(i => i.commandName === 'verticalAlign' ? Object.assign(Object.assign({}, i), { selected: i.value === verticalAlign }) : i);
|
|
39
|
+
}
|
|
40
|
+
return (React.createElement(kendo_react_buttons_1.DropDownButton, { icon: "align-left", svgIcon: kendo_svg_icons_1.alignLeftIcon, items: items, onItemClick: onItemClick, title: loc.toLanguageString(messages_1.keys.align, messages_1.messages[messages_1.keys.align]), text: React.createElement(kendo_react_common_1.IconWrap, { name: "caret-alt-down", icon: kendo_svg_icons_1.caretAltDownIcon }) }));
|
|
41
|
+
};
|
|
42
|
+
exports.Alignment = Alignment;
|
|
43
|
+
exports.Alignment.displayName = 'Alignment';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BackgroundColor = void 0;
|
|
4
|
+
const messages_1 = require("../messages");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
7
|
+
exports.BackgroundColor = (0, utils_1.ColorTool)({
|
|
8
|
+
icon: 'droplet',
|
|
9
|
+
svgIcon: kendo_svg_icons_1.dropletIcon,
|
|
10
|
+
view: 'palette',
|
|
11
|
+
property: 'background',
|
|
12
|
+
titleKey: messages_1.keys.background,
|
|
13
|
+
ariaLabel: 'Background'
|
|
14
|
+
});
|
|
15
|
+
exports.BackgroundColor.displayName = 'BackgroundColor';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Bold = void 0;
|
|
4
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const messages_1 = require("../messages");
|
|
7
|
+
exports.Bold = (0, utils_1.PropertyChangeTool)({ property: 'bold', icon: 'bold', svgIcon: kendo_svg_icons_1.boldIcon, titleKey: messages_1.keys.bold });
|
|
8
|
+
exports.Bold.displayName = 'Bold';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultTabs = void 0;
|
|
4
|
+
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
5
|
+
const export_1 = require("./export");
|
|
6
|
+
const open_1 = require("./open");
|
|
7
|
+
const bold_1 = require("./bold");
|
|
8
|
+
const italic_1 = require("./italic");
|
|
9
|
+
const underline_1 = require("./underline");
|
|
10
|
+
const fontFamily_1 = require("./fontFamily");
|
|
11
|
+
const fontSize_1 = require("./fontSize");
|
|
12
|
+
const textColor_1 = require("./textColor");
|
|
13
|
+
const backgroundColor_1 = require("./backgroundColor");
|
|
14
|
+
const align_1 = require("./align");
|
|
15
|
+
const textWrap_1 = require("./textWrap");
|
|
16
|
+
const gridLines_1 = require("./gridLines");
|
|
17
|
+
const format_1 = require("./format");
|
|
18
|
+
const tableTools_1 = require("./tableTools");
|
|
19
|
+
const messages_1 = require("../messages");
|
|
20
|
+
exports.defaultTabs = [
|
|
21
|
+
{
|
|
22
|
+
textKey: messages_1.keys.home,
|
|
23
|
+
tools: [
|
|
24
|
+
open_1.Open,
|
|
25
|
+
export_1.ExcelExport,
|
|
26
|
+
kendo_react_buttons_1.ToolbarSeparator,
|
|
27
|
+
[bold_1.Bold, italic_1.Italic, underline_1.Underline],
|
|
28
|
+
fontFamily_1.FontFamily,
|
|
29
|
+
fontSize_1.FontSize,
|
|
30
|
+
textColor_1.TextColor,
|
|
31
|
+
backgroundColor_1.BackgroundColor,
|
|
32
|
+
align_1.Alignment,
|
|
33
|
+
textWrap_1.TextWrap,
|
|
34
|
+
gridLines_1.GridLines,
|
|
35
|
+
format_1.Format
|
|
36
|
+
]
|
|
37
|
+
}, {
|
|
38
|
+
textKey: messages_1.keys.insert,
|
|
39
|
+
tools: [
|
|
40
|
+
[tableTools_1.AddColumnLeft, tableTools_1.AddColumnRight, tableTools_1.AddRowBelow, tableTools_1.AddRowAbove],
|
|
41
|
+
kendo_react_buttons_1.ToolbarSeparator,
|
|
42
|
+
[tableTools_1.DeleteColumn, tableTools_1.DeleteRow]
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExcelExport = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
6
|
+
const kendo_file_saver_1 = require("@progress/kendo-file-saver");
|
|
7
|
+
const kendo_ooxml_1 = require("@progress/kendo-ooxml");
|
|
8
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
9
|
+
const ExcelExport = props => {
|
|
10
|
+
const { spreadsheetRef } = props;
|
|
11
|
+
const onDownload = React.useCallback(() => {
|
|
12
|
+
if (spreadsheetRef.current) {
|
|
13
|
+
spreadsheetRef.current.saveAsExcel(Object.assign(Object.assign({}, spreadsheetRef.current.options.excel), { saveAs: kendo_file_saver_1.saveAs,
|
|
14
|
+
Workbook: kendo_ooxml_1.Workbook }));
|
|
15
|
+
}
|
|
16
|
+
}, []);
|
|
17
|
+
return (React.createElement(kendo_react_buttons_1.Button, { className: 'k-toolbar-button', title: 'Export...', icon: 'download', svgIcon: kendo_svg_icons_1.downloadIcon, onClick: onDownload }));
|
|
18
|
+
};
|
|
19
|
+
exports.ExcelExport = ExcelExport;
|
|
20
|
+
exports.ExcelExport.displayName = 'ExcelExport';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FontFamily = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_dropdowns_1 = require("@progress/kendo-react-dropdowns");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
8
|
+
const messages_1 = require("../messages");
|
|
9
|
+
const FontFamily = props => {
|
|
10
|
+
const { spreadsheetRef, value } = props;
|
|
11
|
+
const onChange = React.useCallback((event) => {
|
|
12
|
+
if (spreadsheetRef.current) {
|
|
13
|
+
const options = {
|
|
14
|
+
command: 'PropertyChangeCommand', options: { property: 'fontFamily', value: event.value || null }
|
|
15
|
+
};
|
|
16
|
+
spreadsheetRef.current.executeCommand(options);
|
|
17
|
+
}
|
|
18
|
+
}, []);
|
|
19
|
+
return (React.createElement(kendo_react_dropdowns_1.DropDownList, { onChange: onChange, value: value, data: utils_1.FONT_FAMILIES, defaultValue: utils_1.DEFAULT_FONT_FAMILY, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.fontName, messages_1.messages[messages_1.keys.fontName]), leftRightKeysNavigation: false }));
|
|
20
|
+
};
|
|
21
|
+
exports.FontFamily = FontFamily;
|
|
22
|
+
exports.FontFamily.displayName = 'FontFamily';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FontSize = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_dropdowns_1 = require("@progress/kendo-react-dropdowns");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const messages_1 = require("../messages");
|
|
8
|
+
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
9
|
+
const FontSize = (props) => {
|
|
10
|
+
const { spreadsheetRef, value } = props;
|
|
11
|
+
const onChange = React.useCallback((event) => {
|
|
12
|
+
if (spreadsheetRef.current) {
|
|
13
|
+
const options = {
|
|
14
|
+
command: 'PropertyChangeCommand', options: { property: 'fontSize', value: event.value || null }
|
|
15
|
+
};
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
spreadsheetRef.current.executeCommand(options);
|
|
18
|
+
}, 0);
|
|
19
|
+
}
|
|
20
|
+
}, []);
|
|
21
|
+
return (React.createElement(kendo_react_dropdowns_1.ComboBox, { onChange: onChange, value: value, data: utils_1.FONT_SIZES, defaultValue: utils_1.DEFAULT_FONT_SIZE, allowCustom: true, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.fontSize, messages_1.messages[messages_1.keys.fontSize]), tabIndex: -1 }));
|
|
22
|
+
};
|
|
23
|
+
exports.FontSize = FontSize;
|
|
24
|
+
exports.FontSize.displayName = 'FontSize';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Format = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
6
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
const kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
9
|
+
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
10
|
+
const messages_1 = require("../messages");
|
|
11
|
+
const Format = props => {
|
|
12
|
+
const { spreadsheetRef } = props;
|
|
13
|
+
const onChange = React.useCallback((event) => {
|
|
14
|
+
const value = event.item.value || null;
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
if (spreadsheetRef.current) {
|
|
17
|
+
const options = {
|
|
18
|
+
command: 'PropertyChangeCommand', options: { property: 'format', value }
|
|
19
|
+
};
|
|
20
|
+
spreadsheetRef.current.executeCommand(options);
|
|
21
|
+
}
|
|
22
|
+
}, 0);
|
|
23
|
+
}, []);
|
|
24
|
+
return (React.createElement(kendo_react_buttons_1.DropDownButton, { icon: 'custom-format', svgIcon: kendo_svg_icons_1.customFormatIcon, onItemClick: onChange, items: utils_1.FORMATS, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.format, messages_1.messages[messages_1.keys.format]), text: React.createElement(kendo_react_common_1.IconWrap, { name: "caret-alt-down" }) }));
|
|
25
|
+
};
|
|
26
|
+
exports.Format = Format;
|
|
27
|
+
exports.Format.displayName = 'Format';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GridLines = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
6
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
7
|
+
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
8
|
+
const messages_1 = require("../messages");
|
|
9
|
+
const GridLines = 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 value = !sheet.showGridLines();
|
|
16
|
+
const options = {
|
|
17
|
+
command: 'GridLinesChangeCommand', options: { property: 'gridLines', value }
|
|
18
|
+
};
|
|
19
|
+
spreadsheetRef.current.executeCommand(options);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
return (React.createElement(kendo_react_buttons_1.Button, { type: 'button', togglable: true, icon: 'borders-none', svgIcon: kendo_svg_icons_1.bordersNoneIcon, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.gridLines, messages_1.messages[messages_1.keys.gridLines]), onClick: onClick, selected: selected }));
|
|
24
|
+
};
|
|
25
|
+
exports.GridLines = GridLines;
|
|
26
|
+
exports.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,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./align"), exports);
|
|
18
|
+
__exportStar(require("./backgroundColor"), exports);
|
|
19
|
+
__exportStar(require("./bold"), exports);
|
|
20
|
+
__exportStar(require("./defaultTools"), exports);
|
|
21
|
+
__exportStar(require("./export"), exports);
|
|
22
|
+
__exportStar(require("./fontFamily"), exports);
|
|
23
|
+
__exportStar(require("./fontSize"), exports);
|
|
24
|
+
__exportStar(require("./format"), exports);
|
|
25
|
+
__exportStar(require("./gridLines"), exports);
|
|
26
|
+
__exportStar(require("./italic"), exports);
|
|
27
|
+
__exportStar(require("./open"), exports);
|
|
28
|
+
__exportStar(require("./redo"), exports);
|
|
29
|
+
__exportStar(require("./tableTools"), exports);
|
|
30
|
+
__exportStar(require("./textColor"), exports);
|
|
31
|
+
__exportStar(require("./textWrap"), exports);
|
|
32
|
+
__exportStar(require("./underline"), exports);
|
|
33
|
+
__exportStar(require("./undo"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Italic = void 0;
|
|
4
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const messages_1 = require("../messages");
|
|
7
|
+
exports.Italic = (0, utils_1.PropertyChangeTool)({ property: 'italic', icon: 'italic', svgIcon: kendo_svg_icons_1.italicIcon, titleKey: messages_1.keys.italic });
|
|
8
|
+
exports.Italic.displayName = 'Italic';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Open = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
6
|
+
const kendo_react_upload_1 = require("@progress/kendo-react-upload");
|
|
7
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
8
|
+
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
9
|
+
const messages_1 = require("../messages");
|
|
10
|
+
const Open = props => {
|
|
11
|
+
const { spreadsheetRef } = props;
|
|
12
|
+
const onFileOpen = React.useCallback((event) => {
|
|
13
|
+
const targetEl = event.target;
|
|
14
|
+
if (targetEl instanceof HTMLElement && targetEl.parentNode) {
|
|
15
|
+
const toolbarEl = targetEl.closest('.k-toolbar');
|
|
16
|
+
const input = toolbarEl && toolbarEl.querySelector('.k-upload input');
|
|
17
|
+
if (input) {
|
|
18
|
+
input.click();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}, []);
|
|
22
|
+
const onAdd = React.useCallback((event) => {
|
|
23
|
+
const fileInfo = event.newState;
|
|
24
|
+
if (fileInfo[0] && fileInfo[0].getRawFile) {
|
|
25
|
+
const file = fileInfo[0].getRawFile();
|
|
26
|
+
if (spreadsheetRef.current) {
|
|
27
|
+
spreadsheetRef.current.fromFile(file);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
return (React.createElement(React.Fragment, null,
|
|
32
|
+
React.createElement(kendo_react_buttons_1.Button, { className: 'k-toolbar-button', title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.open, messages_1.messages[messages_1.keys.open]), icon: 'folder-open', svgIcon: kendo_svg_icons_1.folderOpenIcon, onClick: onFileOpen }),
|
|
33
|
+
React.createElement("div", { style: { display: 'none' } },
|
|
34
|
+
React.createElement(kendo_react_upload_1.Upload, { restrictions: { allowedExtensions: ['.xlsx'] }, onAdd: onAdd, autoUpload: false, defaultFiles: [], multiple: false, accept: ".xlsx,.XLSX", withCredentials: false }))));
|
|
35
|
+
};
|
|
36
|
+
exports.Open = Open;
|
|
37
|
+
exports.Open.displayName = 'Open';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Redo = void 0;
|
|
4
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const messages_1 = require("../messages");
|
|
7
|
+
exports.Redo = (0, utils_1.UndoRedo)({ action: 'redo', icon: 'redo', svgIcon: kendo_svg_icons_1.redoIcon, titleKey: messages_1.keys.redo });
|
|
8
|
+
exports.Redo.displayName = 'Redo';
|
|
@@ -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,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteRow = exports.DeleteColumn = exports.AddRowAbove = exports.AddRowBelow = exports.AddColumnRight = exports.AddColumnLeft = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
6
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
7
|
+
const messages_1 = require("../messages");
|
|
8
|
+
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
9
|
+
const TableDataTool = (settings) => {
|
|
10
|
+
const tool = props => {
|
|
11
|
+
const { spreadsheetRef } = props;
|
|
12
|
+
const onClick = React.useCallback(() => {
|
|
13
|
+
if (spreadsheetRef.current) {
|
|
14
|
+
const options = {
|
|
15
|
+
command: settings.command, options: { value: settings.value }
|
|
16
|
+
};
|
|
17
|
+
spreadsheetRef.current.executeCommand(options);
|
|
18
|
+
}
|
|
19
|
+
}, []);
|
|
20
|
+
return (React.createElement(kendo_react_buttons_1.Button, { type: "button", icon: settings.icon, svgIcon: settings.svgIcon, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(settings.titleKey, messages_1.messages[settings.titleKey]), onClick: onClick }));
|
|
21
|
+
};
|
|
22
|
+
return tool;
|
|
23
|
+
};
|
|
24
|
+
const addColumnLeft = {
|
|
25
|
+
command: 'AddColumnCommand',
|
|
26
|
+
value: 'left',
|
|
27
|
+
icon: 'table-column-insert-left',
|
|
28
|
+
svgIcon: kendo_svg_icons_1.tableColumnInsertLeftIcon,
|
|
29
|
+
titleKey: messages_1.keys.addColumnLeft
|
|
30
|
+
};
|
|
31
|
+
const addColumnRight = {
|
|
32
|
+
command: 'AddColumnCommand',
|
|
33
|
+
value: 'right',
|
|
34
|
+
icon: 'table-column-insert-right',
|
|
35
|
+
svgIcon: kendo_svg_icons_1.tableColumnInsertRightIcon,
|
|
36
|
+
titleKey: messages_1.keys.addColumnRight
|
|
37
|
+
};
|
|
38
|
+
const addRowBelow = {
|
|
39
|
+
command: 'AddRowCommand',
|
|
40
|
+
value: 'below',
|
|
41
|
+
icon: 'table-row-insert-below',
|
|
42
|
+
svgIcon: kendo_svg_icons_1.tableRowInsertBelowIcon,
|
|
43
|
+
titleKey: messages_1.keys.addRowBelow
|
|
44
|
+
};
|
|
45
|
+
const addRowAbove = {
|
|
46
|
+
command: 'AddRowCommand',
|
|
47
|
+
value: 'above',
|
|
48
|
+
icon: 'table-row-insert-above',
|
|
49
|
+
svgIcon: kendo_svg_icons_1.tableRowInsertAboveIcon,
|
|
50
|
+
titleKey: messages_1.keys.addRowAbove
|
|
51
|
+
};
|
|
52
|
+
const deleteColumn = {
|
|
53
|
+
command: 'DeleteColumnCommand',
|
|
54
|
+
icon: 'table-column-delete',
|
|
55
|
+
svgIcon: kendo_svg_icons_1.tableColumnDeleteIcon,
|
|
56
|
+
titleKey: messages_1.keys.deleteColumn
|
|
57
|
+
};
|
|
58
|
+
const deleteRow = {
|
|
59
|
+
command: 'DeleteRowCommand',
|
|
60
|
+
icon: 'table-row-delete',
|
|
61
|
+
svgIcon: kendo_svg_icons_1.tableRowDeleteIcon,
|
|
62
|
+
titleKey: messages_1.keys.deleteRow
|
|
63
|
+
};
|
|
64
|
+
exports.AddColumnLeft = TableDataTool(addColumnLeft);
|
|
65
|
+
exports.AddColumnRight = TableDataTool(addColumnRight);
|
|
66
|
+
exports.AddRowBelow = TableDataTool(addRowBelow);
|
|
67
|
+
exports.AddRowAbove = TableDataTool(addRowAbove);
|
|
68
|
+
exports.DeleteColumn = TableDataTool(deleteColumn);
|
|
69
|
+
exports.DeleteRow = TableDataTool(deleteRow);
|
|
70
|
+
exports.AddColumnLeft.displayName = 'AddColumnLeft';
|
|
71
|
+
exports.AddColumnRight.displayName = 'AddColumnRight';
|
|
72
|
+
exports.AddRowBelow.displayName = 'AddRowBelow';
|
|
73
|
+
exports.AddRowAbove.displayName = 'AddRowAbove';
|
|
74
|
+
exports.DeleteColumn.displayName = 'DeleteColumn';
|
|
75
|
+
exports.DeleteRow.displayName = 'DeleteRow';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextColor = void 0;
|
|
4
|
+
const messages_1 = require("../messages");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
7
|
+
exports.TextColor = (0, utils_1.ColorTool)({
|
|
8
|
+
icon: 'foreground-color',
|
|
9
|
+
svgIcon: kendo_svg_icons_1.foregroundColorIcon,
|
|
10
|
+
view: 'palette',
|
|
11
|
+
property: 'color',
|
|
12
|
+
titleKey: messages_1.keys.textColor,
|
|
13
|
+
ariaLabel: 'Text Color'
|
|
14
|
+
});
|
|
15
|
+
exports.TextColor.displayName = 'TextColor';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextWrap = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
6
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
7
|
+
const kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
8
|
+
const messages_1 = require("../messages");
|
|
9
|
+
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(kendo_react_buttons_1.Button, { type: 'button', togglable: true, icon: 'text-wrap', svgIcon: kendo_svg_icons_1.textWrapIcon, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.textWrap, messages_1.messages[messages_1.keys.textWrap]), onClick: onClick, selected: selected }));
|
|
25
|
+
};
|
|
26
|
+
exports.TextWrap = TextWrap;
|
|
27
|
+
exports.TextWrap.displayName = 'TextWrap';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Underline = void 0;
|
|
4
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const messages_1 = require("../messages");
|
|
7
|
+
exports.Underline = (0, utils_1.PropertyChangeTool)({ property: 'underline', icon: 'underline', svgIcon: kendo_svg_icons_1.underlineIcon, titleKey: messages_1.keys.underline });
|
|
8
|
+
exports.Underline.displayName = 'Underline';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Undo = void 0;
|
|
4
|
+
const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const messages_1 = require("../messages");
|
|
7
|
+
exports.Undo = (0, utils_1.UndoRedo)({ action: 'undo', icon: 'undo', svgIcon: kendo_svg_icons_1.undoIcon, titleKey: messages_1.keys.undo });
|
|
8
|
+
exports.Undo.displayName = 'Undo';
|