@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.
Files changed (147) hide show
  1. package/FormulaInput.d.ts +9 -0
  2. package/LICENSE.md +1 -1
  3. package/List.d.ts +9 -0
  4. package/NameBox.d.ts +9 -0
  5. package/SheetsBar.d.ts +8 -0
  6. package/{dist/npm/Spreadsheet.d.ts → Spreadsheet.d.ts} +4 -0
  7. package/{dist/npm/SpreadsheetProps.d.ts → SpreadsheetProps.d.ts} +5 -2
  8. package/dist/cdn/js/kendo-react-spreadsheet.js +5 -1
  9. package/index.d.ts +8 -0
  10. package/index.js +5 -0
  11. package/index.mjs +1357 -0
  12. package/{dist/npm/messages.d.ts → messages.d.ts} +4 -0
  13. package/package-metadata.d.ts +9 -0
  14. package/package.json +43 -57
  15. package/{dist/npm/tools → tools}/adjustDecimals.d.ts +4 -0
  16. package/{dist/npm/tools → tools}/align.d.ts +4 -0
  17. package/tools/backgroundColor.d.ts +14 -0
  18. package/tools/bold.d.ts +14 -0
  19. package/tools/cleanFormat.d.ts +15 -0
  20. package/tools/defaultTools.d.ts +9 -0
  21. package/tools/export.d.ts +15 -0
  22. package/tools/fontFamily.d.ts +15 -0
  23. package/{dist/es/tools → tools}/fontSize.d.ts +4 -0
  24. package/tools/format.d.ts +15 -0
  25. package/{dist/es/tools → tools}/gridLines.d.ts +4 -0
  26. package/{dist/es/tools → tools}/index.d.ts +5 -1
  27. package/tools/italic.d.ts +14 -0
  28. package/tools/open.d.ts +15 -0
  29. package/tools/redo.d.ts +14 -0
  30. package/{dist/npm/tools → tools}/tableTools.d.ts +4 -0
  31. package/tools/textColor.d.ts +14 -0
  32. package/{dist/es/tools → tools}/textWrap.d.ts +4 -0
  33. package/tools/underline.d.ts +14 -0
  34. package/tools/undo.d.ts +14 -0
  35. package/{dist/npm/tools → tools}/utils.d.ts +4 -0
  36. package/about.md +0 -3
  37. package/dist/es/FormulaInput.d.ts +0 -5
  38. package/dist/es/FormulaInput.js +0 -116
  39. package/dist/es/List.d.ts +0 -5
  40. package/dist/es/List.js +0 -22
  41. package/dist/es/NameBox.d.ts +0 -5
  42. package/dist/es/NameBox.js +0 -91
  43. package/dist/es/SheetsBar.d.ts +0 -5
  44. package/dist/es/SheetsBar.js +0 -246
  45. package/dist/es/Spreadsheet.d.ts +0 -47
  46. package/dist/es/Spreadsheet.js +0 -286
  47. package/dist/es/SpreadsheetProps.d.ts +0 -189
  48. package/dist/es/SpreadsheetProps.js +0 -2
  49. package/dist/es/main.d.ts +0 -4
  50. package/dist/es/main.js +0 -4
  51. package/dist/es/messages.d.ts +0 -110
  52. package/dist/es/messages.js +0 -310
  53. package/dist/es/package-metadata.d.ts +0 -5
  54. package/dist/es/package-metadata.js +0 -11
  55. package/dist/es/tools/adjustDecimals.d.ts +0 -20
  56. package/dist/es/tools/adjustDecimals.js +0 -39
  57. package/dist/es/tools/align.d.ts +0 -44
  58. package/dist/es/tools/align.js +0 -96
  59. package/dist/es/tools/backgroundColor.d.ts +0 -11
  60. package/dist/es/tools/backgroundColor.js +0 -15
  61. package/dist/es/tools/bold.d.ts +0 -11
  62. package/dist/es/tools/bold.js +0 -9
  63. package/dist/es/tools/cleanFormat.d.ts +0 -11
  64. package/dist/es/tools/cleanFormat.js +0 -17
  65. package/dist/es/tools/defaultTools.d.ts +0 -5
  66. package/dist/es/tools/defaultTools.js +0 -66
  67. package/dist/es/tools/export.d.ts +0 -11
  68. package/dist/es/tools/export.js +0 -19
  69. package/dist/es/tools/fontFamily.d.ts +0 -11
  70. package/dist/es/tools/fontFamily.js +0 -21
  71. package/dist/es/tools/fontSize.js +0 -82
  72. package/dist/es/tools/format.d.ts +0 -11
  73. package/dist/es/tools/format.js +0 -26
  74. package/dist/es/tools/gridLines.js +0 -25
  75. package/dist/es/tools/index.js +0 -18
  76. package/dist/es/tools/italic.d.ts +0 -11
  77. package/dist/es/tools/italic.js +0 -9
  78. package/dist/es/tools/open.d.ts +0 -11
  79. package/dist/es/tools/open.js +0 -36
  80. package/dist/es/tools/redo.d.ts +0 -11
  81. package/dist/es/tools/redo.js +0 -9
  82. package/dist/es/tools/tableTools.d.ts +0 -64
  83. package/dist/es/tools/tableTools.js +0 -102
  84. package/dist/es/tools/textColor.d.ts +0 -11
  85. package/dist/es/tools/textColor.js +0 -15
  86. package/dist/es/tools/textWrap.js +0 -26
  87. package/dist/es/tools/underline.d.ts +0 -11
  88. package/dist/es/tools/underline.js +0 -9
  89. package/dist/es/tools/undo.d.ts +0 -11
  90. package/dist/es/tools/undo.js +0 -9
  91. package/dist/es/tools/utils.d.ts +0 -91
  92. package/dist/es/tools/utils.js +0 -102
  93. package/dist/npm/FormulaInput.d.ts +0 -5
  94. package/dist/npm/FormulaInput.js +0 -119
  95. package/dist/npm/List.d.ts +0 -5
  96. package/dist/npm/List.js +0 -25
  97. package/dist/npm/NameBox.d.ts +0 -5
  98. package/dist/npm/NameBox.js +0 -94
  99. package/dist/npm/SheetsBar.d.ts +0 -5
  100. package/dist/npm/SheetsBar.js +0 -250
  101. package/dist/npm/Spreadsheet.js +0 -289
  102. package/dist/npm/SpreadsheetProps.js +0 -9
  103. package/dist/npm/main.d.ts +0 -4
  104. package/dist/npm/main.js +0 -39
  105. package/dist/npm/messages.js +0 -313
  106. package/dist/npm/package-metadata.d.ts +0 -5
  107. package/dist/npm/package-metadata.js +0 -14
  108. package/dist/npm/tools/adjustDecimals.js +0 -42
  109. package/dist/npm/tools/align.js +0 -100
  110. package/dist/npm/tools/backgroundColor.d.ts +0 -11
  111. package/dist/npm/tools/backgroundColor.js +0 -18
  112. package/dist/npm/tools/bold.d.ts +0 -11
  113. package/dist/npm/tools/bold.js +0 -12
  114. package/dist/npm/tools/cleanFormat.d.ts +0 -11
  115. package/dist/npm/tools/cleanFormat.js +0 -21
  116. package/dist/npm/tools/defaultTools.d.ts +0 -5
  117. package/dist/npm/tools/defaultTools.js +0 -69
  118. package/dist/npm/tools/export.d.ts +0 -11
  119. package/dist/npm/tools/export.js +0 -23
  120. package/dist/npm/tools/fontFamily.d.ts +0 -11
  121. package/dist/npm/tools/fontFamily.js +0 -25
  122. package/dist/npm/tools/fontSize.d.ts +0 -39
  123. package/dist/npm/tools/fontSize.js +0 -86
  124. package/dist/npm/tools/format.d.ts +0 -11
  125. package/dist/npm/tools/format.js +0 -30
  126. package/dist/npm/tools/gridLines.d.ts +0 -15
  127. package/dist/npm/tools/gridLines.js +0 -29
  128. package/dist/npm/tools/index.d.ts +0 -19
  129. package/dist/npm/tools/index.js +0 -34
  130. package/dist/npm/tools/italic.d.ts +0 -11
  131. package/dist/npm/tools/italic.js +0 -12
  132. package/dist/npm/tools/open.d.ts +0 -11
  133. package/dist/npm/tools/open.js +0 -40
  134. package/dist/npm/tools/redo.d.ts +0 -11
  135. package/dist/npm/tools/redo.js +0 -12
  136. package/dist/npm/tools/tableTools.js +0 -105
  137. package/dist/npm/tools/textColor.d.ts +0 -11
  138. package/dist/npm/tools/textColor.js +0 -18
  139. package/dist/npm/tools/textWrap.d.ts +0 -15
  140. package/dist/npm/tools/textWrap.js +0 -30
  141. package/dist/npm/tools/underline.d.ts +0 -11
  142. package/dist/npm/tools/underline.js +0 -12
  143. package/dist/npm/tools/undo.d.ts +0 -11
  144. package/dist/npm/tools/undo.js +0 -12
  145. package/dist/npm/tools/utils.js +0 -108
  146. package/dist/systemjs/kendo-react-spreadsheet.js +0 -1
  147. package/e2e-next/basic.tests.ts +0 -24
@@ -1,69 +0,0 @@
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
- const undo_1 = require("./undo");
21
- const redo_1 = require("./redo");
22
- const adjustDecimals_1 = require("./adjustDecimals");
23
- /**
24
- * The default toolbar configuration.
25
- */
26
- exports.defaultTabs = [
27
- {
28
- textKey: messages_1.keys.file,
29
- tools: [
30
- open_1.Open,
31
- export_1.ExcelExport
32
- ]
33
- }, {
34
- textKey: messages_1.keys.home,
35
- selected: true,
36
- tools: [
37
- [undo_1.Undo, redo_1.Redo],
38
- kendo_react_buttons_1.ToolbarSeparator,
39
- fontFamily_1.FontFamily,
40
- fontSize_1.FontSize,
41
- fontSize_1.IncreaseFontSize,
42
- fontSize_1.DecreaseFontSize,
43
- kendo_react_buttons_1.ToolbarSeparator,
44
- [bold_1.Bold, italic_1.Italic, underline_1.Underline],
45
- textColor_1.TextColor,
46
- kendo_react_buttons_1.ToolbarSeparator,
47
- backgroundColor_1.BackgroundColor,
48
- kendo_react_buttons_1.ToolbarSeparator,
49
- align_1.AlignHorizontally,
50
- align_1.AlignVertically,
51
- textWrap_1.TextWrap,
52
- kendo_react_buttons_1.ToolbarSeparator,
53
- gridLines_1.GridLines
54
- ]
55
- }, {
56
- textKey: messages_1.keys.insert,
57
- tools: [
58
- [tableTools_1.AddColumnLeft, tableTools_1.AddColumnRight, tableTools_1.AddRowBelow, tableTools_1.AddRowAbove],
59
- kendo_react_buttons_1.ToolbarSeparator,
60
- [tableTools_1.DeleteColumn, tableTools_1.DeleteRow]
61
- ]
62
- }, {
63
- textKey: messages_1.keys.formatTab,
64
- tools: [
65
- format_1.Format,
66
- [adjustDecimals_1.DecreaseDecimal, adjustDecimals_1.IncreaseDecimal]
67
- ]
68
- }
69
- ];
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { SpreadsheetToolProps } from './utils';
3
- /**
4
- * The props of the ExcelExport tool component.
5
- */
6
- export interface ExcelExportProps extends SpreadsheetToolProps {
7
- }
8
- /**
9
- * The ExcelExport tool component.
10
- */
11
- export declare const ExcelExport: React.FunctionComponent<ExcelExportProps>;
@@ -1,23 +0,0 @@
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
- /**
10
- * The ExcelExport tool component.
11
- */
12
- const ExcelExport = props => {
13
- const { spreadsheetRef } = props;
14
- const onDownload = React.useCallback(() => {
15
- if (spreadsheetRef.current) {
16
- spreadsheetRef.current.saveAsExcel(Object.assign(Object.assign({}, spreadsheetRef.current.options.excel), { saveAs: kendo_file_saver_1.saveAs,
17
- Workbook: kendo_ooxml_1.Workbook }));
18
- }
19
- }, []);
20
- return (React.createElement(kendo_react_buttons_1.Button, { className: 'k-toolbar-button', title: 'Export...', icon: 'download', fillMode: "flat", svgIcon: kendo_svg_icons_1.downloadIcon, onClick: onDownload }));
21
- };
22
- exports.ExcelExport = ExcelExport;
23
- exports.ExcelExport.displayName = 'ExcelExport';
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { DropDownToolProps } from './utils';
3
- /**
4
- * The props of the FontFamily tool component.
5
- */
6
- export interface FontFamilyProps extends DropDownToolProps {
7
- }
8
- /**
9
- * The FontFamily tool component.
10
- */
11
- export declare const FontFamily: React.FunctionComponent<FontFamilyProps>;
@@ -1,25 +0,0 @@
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
- /**
10
- * The FontFamily tool component.
11
- */
12
- const FontFamily = props => {
13
- const { spreadsheetRef, value } = props;
14
- const onChange = React.useCallback((event) => {
15
- if (spreadsheetRef.current) {
16
- const options = {
17
- command: 'PropertyChangeCommand', options: { property: 'fontFamily', value: event.value || null }
18
- };
19
- spreadsheetRef.current.executeCommand(options);
20
- }
21
- }, []);
22
- return (React.createElement(kendo_react_dropdowns_1.DropDownList, { onChange: onChange, value: value, data: utils_1.FONT_FAMILIES, defaultValue: utils_1.DEFAULT_FONT_FAMILY, fillMode: "flat", title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.fontName, messages_1.messages[messages_1.keys.fontName]), leftRightKeysNavigation: false }));
23
- };
24
- exports.FontFamily = FontFamily;
25
- exports.FontFamily.displayName = 'FontFamily';
@@ -1,39 +0,0 @@
1
- import * as React from 'react';
2
- import { DropDownToolProps, SpreadsheetToolProps } from './utils';
3
- /**
4
- * The props of the FontSize tool component.
5
- */
6
- export interface FontSizeProps extends DropDownToolProps {
7
- }
8
- /**
9
- * The FontSize tool component.
10
- */
11
- export declare const FontSize: React.FunctionComponent<FontSizeProps>;
12
- /**
13
- * @hidden
14
- */
15
- interface FontSizeChangeToolProps extends SpreadsheetToolProps {
16
- /**
17
- * The selected state of the tool.
18
- */
19
- value: number;
20
- }
21
- /**
22
- * The props of the IncreaseFontSize tool component.
23
- */
24
- export interface IncreaseFontSizeProps extends FontSizeChangeToolProps {
25
- }
26
- /**
27
- * The IncreaseFontSize tool component.
28
- */
29
- export declare const IncreaseFontSize: React.FunctionComponent<IncreaseFontSizeProps>;
30
- /**
31
- * The props of the DecreaseFontSize tool component.
32
- */
33
- export interface DecreaseFontSizeProps extends FontSizeChangeToolProps {
34
- }
35
- /**
36
- * The DecreaseFontSize tool component.
37
- */
38
- export declare const DecreaseFontSize: React.FunctionComponent<DecreaseFontSizeProps>;
39
- export {};
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DecreaseFontSize = exports.IncreaseFontSize = 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 kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
10
- const kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
11
- const minFontSize = 1;
12
- const maxFontSize = 409;
13
- const toNumber = (value) => {
14
- return typeof value === 'string' ? parseFloat(value) : value;
15
- };
16
- /**
17
- * The FontSize tool component.
18
- */
19
- const FontSize = props => {
20
- const { spreadsheetRef } = props;
21
- const value = toNumber(props.value);
22
- const onChange = React.useCallback((event) => {
23
- var _a;
24
- let nextValue = event.value ? toNumber(event.value) : value;
25
- nextValue = isNaN(nextValue) ? value : nextValue;
26
- nextValue = Math.min(maxFontSize, Math.max(minFontSize, nextValue));
27
- const options = {
28
- command: 'PropertyChangeCommand', options: { property: 'fontSize', value: nextValue }
29
- };
30
- if (event.nativeEvent.type === 'keydown' || event.nativeEvent.type === 'focusout') {
31
- (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.executeCommand(options);
32
- }
33
- else {
34
- setTimeout(() => {
35
- var _a;
36
- (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.executeCommand(options);
37
- }, 0);
38
- }
39
- }, [value]);
40
- 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, fillMode: "flat", title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.fontSize, messages_1.messages[messages_1.keys.fontSize]), tabIndex: -1, clearButton: false }));
41
- };
42
- exports.FontSize = FontSize;
43
- exports.FontSize.displayName = 'FontSize';
44
- /**
45
- * @hidden
46
- */
47
- const fontSizeChangeTool = (settings) => {
48
- const tool = props => {
49
- const { property, icon, svgIcon, titleKey, step } = settings;
50
- const { spreadsheetRef } = props;
51
- const value = toNumber(props.value);
52
- const onClick = React.useCallback(() => {
53
- var _a;
54
- const options = {
55
- command: 'PropertyChangeCommand',
56
- options: { property, value: Math.min(maxFontSize, Math.max(minFontSize, value + step)) }
57
- };
58
- (_a = spreadsheetRef.current) === null || _a === void 0 ? void 0 : _a.executeCommand(options);
59
- }, [value]);
60
- return (React.createElement(kendo_react_buttons_1.Button, { type: "button", icon: icon, svgIcon: svgIcon, fillMode: "flat", onClick: onClick, disabled: value + step < minFontSize || value + step > maxFontSize, title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(titleKey, messages_1.messages[titleKey]) }));
61
- };
62
- tool.displayName = settings.displayName;
63
- return tool;
64
- };
65
- /**
66
- * The IncreaseFontSize tool component.
67
- */
68
- exports.IncreaseFontSize = fontSizeChangeTool({
69
- property: 'fontSize',
70
- icon: 'font-grow',
71
- svgIcon: kendo_svg_icons_1.fontGrowIcon,
72
- titleKey: messages_1.keys.fontSizeIncrease,
73
- displayName: 'IncreaseFontSize',
74
- step: 1
75
- });
76
- /**
77
- * The DecreaseFontSize tool component.
78
- */
79
- exports.DecreaseFontSize = fontSizeChangeTool({
80
- property: 'fontSize',
81
- icon: 'font-shrink',
82
- svgIcon: kendo_svg_icons_1.fontShrinkIcon,
83
- titleKey: messages_1.keys.fontSizeDecrease,
84
- displayName: 'DecreaseFontSize',
85
- step: -1
86
- });
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { SpreadsheetToolProps } from './utils';
3
- /**
4
- * The props of the Format tool component.
5
- */
6
- export interface FormatProps extends SpreadsheetToolProps {
7
- }
8
- /**
9
- * The Format tool component.
10
- */
11
- export declare const Format: React.FunctionComponent<FormatProps>;
@@ -1,30 +0,0 @@
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
- /**
12
- * The Format tool component.
13
- */
14
- const Format = props => {
15
- const { spreadsheetRef } = props;
16
- const onChange = React.useCallback((event) => {
17
- const value = event.item.value || null;
18
- setTimeout(() => {
19
- if (spreadsheetRef.current) {
20
- const options = {
21
- command: 'PropertyChangeCommand', options: { property: 'format', value }
22
- };
23
- spreadsheetRef.current.executeCommand(options);
24
- }
25
- }, 0);
26
- }, []);
27
- return (React.createElement(kendo_react_buttons_1.DropDownButton, { icon: 'custom-format', svgIcon: kendo_svg_icons_1.customFormatIcon, fillMode: "flat", 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" }) }));
28
- };
29
- exports.Format = Format;
30
- exports.Format.displayName = 'Format';
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- import { SpreadsheetToolProps } from './utils';
3
- /**
4
- * The props of the GridLines tool component.
5
- */
6
- export interface GridLinesProps extends SpreadsheetToolProps {
7
- /**
8
- * The selected state of the tool.
9
- */
10
- value?: boolean;
11
- }
12
- /**
13
- * The GridLines tool component.
14
- */
15
- export declare const GridLines: React.FunctionComponent<GridLinesProps>;
@@ -1,29 +0,0 @@
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
- /**
10
- * The GridLines tool component.
11
- */
12
- const GridLines = props => {
13
- const { value: selected, spreadsheetRef } = props;
14
- const onClick = React.useCallback(() => {
15
- if (spreadsheetRef.current) {
16
- const sheet = spreadsheetRef.current.activeSheet();
17
- if (sheet) {
18
- const value = !sheet.showGridLines();
19
- const options = {
20
- command: 'GridLinesChangeCommand', options: { property: 'gridLines', value }
21
- };
22
- spreadsheetRef.current.executeCommand(options);
23
- }
24
- }
25
- }, []);
26
- return (React.createElement(kendo_react_buttons_1.Button, { type: 'button', togglable: true, icon: 'borders-none', svgIcon: kendo_svg_icons_1.bordersNoneIcon, fillMode: "flat", title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(messages_1.keys.gridLines, messages_1.messages[messages_1.keys.gridLines]), onClick: onClick, selected: selected }));
27
- };
28
- exports.GridLines = GridLines;
29
- exports.GridLines.displayName = 'GridLines';
@@ -1,19 +0,0 @@
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 './cleanFormat';
9
- export * from './format';
10
- export * from './gridLines';
11
- export * from './italic';
12
- export * from './open';
13
- export * from './redo';
14
- export * from './tableTools';
15
- export * from './textColor';
16
- export * from './textWrap';
17
- export * from './underline';
18
- export * from './undo';
19
- export { SpreadsheetToolProps } from './utils';
@@ -1,34 +0,0 @@
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("./cleanFormat"), exports);
25
- __exportStar(require("./format"), exports);
26
- __exportStar(require("./gridLines"), exports);
27
- __exportStar(require("./italic"), exports);
28
- __exportStar(require("./open"), exports);
29
- __exportStar(require("./redo"), exports);
30
- __exportStar(require("./tableTools"), exports);
31
- __exportStar(require("./textColor"), exports);
32
- __exportStar(require("./textWrap"), exports);
33
- __exportStar(require("./underline"), exports);
34
- __exportStar(require("./undo"), exports);
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { PropertyChangeToolProps } from './utils';
3
- /**
4
- * The props of the Italic tool component.
5
- */
6
- export interface ItalicProps extends PropertyChangeToolProps {
7
- }
8
- /**
9
- * The Italic tool component.
10
- */
11
- export declare const Italic: React.FunctionComponent<ItalicProps>;
@@ -1,12 +0,0 @@
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
- const italicSettings = { property: 'italic', icon: 'italic', svgIcon: kendo_svg_icons_1.italicIcon, titleKey: messages_1.keys.italic };
8
- /**
9
- * The Italic tool component.
10
- */
11
- exports.Italic = (0, utils_1.PropertyChangeTool)(italicSettings);
12
- exports.Italic.displayName = 'Italic';
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { SpreadsheetToolProps } from './utils';
3
- /**
4
- * The props of the Open tool component.
5
- */
6
- export interface OpenProps extends SpreadsheetToolProps {
7
- }
8
- /**
9
- * The Open tool component.
10
- */
11
- export declare const Open: React.FunctionComponent<OpenProps>;
@@ -1,40 +0,0 @@
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
- /**
11
- * The Open tool component.
12
- */
13
- const Open = props => {
14
- const { spreadsheetRef } = props;
15
- const onFileOpen = React.useCallback((event) => {
16
- const targetEl = event.target;
17
- if (targetEl instanceof Element && targetEl.parentNode) {
18
- const toolbarEl = targetEl.closest('.k-toolbar');
19
- const input = toolbarEl && toolbarEl.querySelector('.k-upload input');
20
- if (input) {
21
- input.click();
22
- }
23
- }
24
- }, []);
25
- const onAdd = React.useCallback((event) => {
26
- const fileInfo = event.newState;
27
- if (fileInfo[0] && fileInfo[0].getRawFile) {
28
- const file = fileInfo[0].getRawFile();
29
- if (spreadsheetRef.current) {
30
- spreadsheetRef.current.executeCommand({ command: 'OpenCommand', options: { file } });
31
- }
32
- }
33
- }, []);
34
- return (React.createElement(React.Fragment, null,
35
- 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, fillMode: "flat", onClick: onFileOpen }),
36
- React.createElement("div", { style: { display: 'none' } },
37
- React.createElement(kendo_react_upload_1.Upload, { restrictions: { allowedExtensions: ['.xlsx'] }, onAdd: onAdd, autoUpload: false, defaultFiles: [], multiple: false, accept: ".xlsx,.XLSX", withCredentials: false }))));
38
- };
39
- exports.Open = Open;
40
- exports.Open.displayName = 'Open';
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { SpreadsheetToolProps } from './utils';
3
- /**
4
- * The props of the Redo tool component.
5
- */
6
- export interface RedoProps extends SpreadsheetToolProps {
7
- }
8
- /**
9
- * The Redo tool component.
10
- */
11
- export declare const Redo: React.FunctionComponent<RedoProps>;
@@ -1,12 +0,0 @@
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
- const redoSettings = { action: 'redo', icon: 'reload', svgIcon: kendo_svg_icons_1.arrowRotateCwIcon, titleKey: messages_1.keys.redo };
8
- /**
9
- * The Redo tool component.
10
- */
11
- exports.Redo = (0, utils_1.UndoRedo)(redoSettings);
12
- exports.Redo.displayName = 'Redo';
@@ -1,105 +0,0 @@
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, value } = 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, fillMode: "flat", title: (0, kendo_react_intl_1.useLocalization)().toLanguageString(settings.titleKey, messages_1.messages[settings.titleKey]), onClick: onClick, disabled: value && settings.disabled(value) }));
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
- disabled: (headers) => headers.allCols,
31
- displayName: 'AddColumnLeft'
32
- };
33
- const addColumnRight = {
34
- command: 'AddColumnCommand',
35
- value: 'right',
36
- icon: 'table-column-insert-right',
37
- svgIcon: kendo_svg_icons_1.tableColumnInsertRightIcon,
38
- titleKey: messages_1.keys.addColumnRight,
39
- disabled: (headers) => headers.allCols,
40
- displayName: 'AddColumnRight'
41
- };
42
- const addRowBelow = {
43
- command: 'AddRowCommand',
44
- value: 'below',
45
- icon: 'table-row-insert-below',
46
- svgIcon: kendo_svg_icons_1.tableRowInsertBelowIcon,
47
- titleKey: messages_1.keys.addRowBelow,
48
- disabled: (headers) => headers.allRows,
49
- displayName: 'AddRowBelow'
50
- };
51
- const addRowAbove = {
52
- command: 'AddRowCommand',
53
- value: 'above',
54
- icon: 'table-row-insert-above',
55
- svgIcon: kendo_svg_icons_1.tableRowInsertAboveIcon,
56
- titleKey: messages_1.keys.addRowAbove,
57
- disabled: (headers) => headers.allRows,
58
- displayName: 'AddRowAbove'
59
- };
60
- const deleteColumn = {
61
- command: 'DeleteColumnCommand',
62
- icon: 'table-column-delete',
63
- svgIcon: kendo_svg_icons_1.tableColumnDeleteIcon,
64
- titleKey: messages_1.keys.deleteColumn,
65
- disabled: (headers) => headers.allCols,
66
- displayName: 'DeleteColumn'
67
- };
68
- const deleteRow = {
69
- command: 'DeleteRowCommand',
70
- icon: 'table-row-delete',
71
- svgIcon: kendo_svg_icons_1.tableRowDeleteIcon,
72
- titleKey: messages_1.keys.deleteRow,
73
- disabled: (headers) => headers.allRows,
74
- displayName: 'DeleteRow'
75
- };
76
- /**
77
- * The AddColumnLeft tool component.
78
- */
79
- exports.AddColumnLeft = TableDataTool(addColumnLeft);
80
- /**
81
- * The AddColumnRight tool component.
82
- */
83
- exports.AddColumnRight = TableDataTool(addColumnRight);
84
- /**
85
- * The AddRowBelow tool component.
86
- */
87
- exports.AddRowBelow = TableDataTool(addRowBelow);
88
- /**
89
- * The AddRowAbove tool component.
90
- */
91
- exports.AddRowAbove = TableDataTool(addRowAbove);
92
- /**
93
- * The DeleteColumn tool component.
94
- */
95
- exports.DeleteColumn = TableDataTool(deleteColumn);
96
- /**
97
- * The DeleteRow tool component.
98
- */
99
- exports.DeleteRow = TableDataTool(deleteRow);
100
- exports.AddColumnLeft.displayName = 'AddColumnLeft';
101
- exports.AddColumnRight.displayName = 'AddColumnRight';
102
- exports.AddRowBelow.displayName = 'AddRowBelow';
103
- exports.AddRowAbove.displayName = 'AddRowAbove';
104
- exports.DeleteColumn.displayName = 'DeleteColumn';
105
- exports.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,18 +0,0 @@
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
- /**
8
- * The TextColor tool component.
9
- */
10
- exports.TextColor = (0, utils_1.ColorTool)({
11
- icon: 'foreground-color',
12
- svgIcon: kendo_svg_icons_1.foregroundColorIcon,
13
- view: 'palette',
14
- property: 'color',
15
- titleKey: messages_1.keys.textColor,
16
- ariaLabel: 'Text Color'
17
- });
18
- exports.TextColor.displayName = 'TextColor';