@progress/kendo-react-buttons 6.1.1 → 7.0.0-develop.1

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 (189) hide show
  1. package/{dist/es/Button.d.ts → Button.d.ts} +5 -1
  2. package/{dist/npm/ButtonGroup.d.ts → ButtonGroup.d.ts} +5 -1
  3. package/{dist/es/ButtonGroupInterface.d.ts → ButtonGroupInterface.d.ts} +4 -1
  4. package/{dist/npm/ButtonInterface.d.ts → ButtonInterface.d.ts} +4 -0
  5. package/{dist/npm/Chip → Chip}/Chip.d.ts +4 -0
  6. package/{dist/npm/Chip → Chip}/ChipList.d.ts +4 -12
  7. package/Chip/chip-list-contexts.d.ts +17 -0
  8. package/{dist/npm/Chip → Chip}/data-reducer.d.ts +5 -1
  9. package/{dist/es/Chip → Chip}/focus-reducer.d.ts +5 -2
  10. package/{dist/npm/Chip → Chip}/selection-reducer.d.ts +5 -1
  11. package/{dist/npm/FloatingActionButton → FloatingActionButton}/FloatingActionButton.d.ts +4 -0
  12. package/{dist/es/FloatingActionButton → FloatingActionButton}/FloatingActionButtonItem.d.ts +4 -0
  13. package/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +17 -0
  14. package/{dist/es/FloatingActionButton → FloatingActionButton}/interfaces/FloatingActionButtonPopupSettings.d.ts +4 -0
  15. package/{dist/npm/FloatingActionButton → FloatingActionButton}/interfaces/FloatingActionButtonProps.d.ts +5 -2
  16. package/{dist/es/FloatingActionButton → FloatingActionButton}/models/align-offset.d.ts +4 -0
  17. package/{dist/npm/FloatingActionButton → FloatingActionButton}/models/align.d.ts +4 -0
  18. package/{dist/es/FloatingActionButton → FloatingActionButton}/models/events.d.ts +5 -1
  19. package/FloatingActionButton/models/position-mode.d.ts +13 -0
  20. package/FloatingActionButton/models/rounded.d.ts +16 -0
  21. package/FloatingActionButton/models/size.d.ts +15 -0
  22. package/{dist/npm/FloatingActionButton → FloatingActionButton}/models/theme-color.d.ts +5 -1
  23. package/{dist/npm/FloatingActionButton → FloatingActionButton}/utils.d.ts +4 -0
  24. package/LICENSE.md +1 -1
  25. package/{dist/es/ListButton → ListButton}/ButtonItem.d.ts +4 -0
  26. package/{dist/es/ListButton → ListButton}/DropDownButton.d.ts +5 -1
  27. package/{dist/npm/ListButton → ListButton}/DropDownButtonItem.d.ts +4 -0
  28. package/{dist/npm/ListButton → ListButton}/SplitButton.d.ts +5 -1
  29. package/{dist/es/ListButton → ListButton}/SplitButtonItem.d.ts +4 -0
  30. package/{dist/npm/ListButton → ListButton}/models/ButtonItem.d.ts +4 -0
  31. package/{dist/npm/ListButton → ListButton}/models/ListButtonProps.d.ts +4 -1
  32. package/{dist/npm/ListButton → ListButton}/models/PopupSettings.d.ts +4 -0
  33. package/{dist/npm/ListButton → ListButton}/models/events.d.ts +4 -0
  34. package/ListButton/utils/navigation.d.ts +9 -0
  35. package/ListButton/utils/popup.d.ts +13 -0
  36. package/dist/cdn/js/kendo-react-buttons.js +5 -1
  37. package/index.d.ts +36 -0
  38. package/index.js +5 -0
  39. package/index.mjs +1877 -0
  40. package/{dist/npm/models → models}/index.d.ts +4 -1
  41. package/package-metadata.d.ts +9 -0
  42. package/package.json +28 -42
  43. package/{dist/es/toolbar → toolbar}/Toolbar.d.ts +5 -1
  44. package/{dist/es/toolbar → toolbar}/tools/ToolbarItem.d.ts +5 -1
  45. package/toolbar/tools/ToolbarSeparator.d.ts +20 -0
  46. package/{dist/es/toolbar → toolbar}/tools/ToolbarSpacer.d.ts +4 -0
  47. package/{dist/npm/util.d.ts → util.d.ts} +4 -0
  48. package/about.md +0 -3
  49. package/dist/es/Button.js +0 -171
  50. package/dist/es/ButtonGroup.d.ts +0 -32
  51. package/dist/es/ButtonGroup.js +0 -101
  52. package/dist/es/ButtonGroupInterface.js +0 -2
  53. package/dist/es/ButtonInterface.d.ts +0 -35
  54. package/dist/es/ButtonInterface.js +0 -3
  55. package/dist/es/Chip/Chip.d.ts +0 -234
  56. package/dist/es/Chip/Chip.js +0 -173
  57. package/dist/es/Chip/ChipList.d.ts +0 -123
  58. package/dist/es/Chip/ChipList.js +0 -177
  59. package/dist/es/Chip/data-reducer.d.ts +0 -22
  60. package/dist/es/Chip/data-reducer.js +0 -26
  61. package/dist/es/Chip/focus-reducer.js +0 -32
  62. package/dist/es/Chip/selection-reducer.d.ts +0 -30
  63. package/dist/es/Chip/selection-reducer.js +0 -75
  64. package/dist/es/FloatingActionButton/FloatingActionButton.d.ts +0 -17
  65. package/dist/es/FloatingActionButton/FloatingActionButton.js +0 -281
  66. package/dist/es/FloatingActionButton/FloatingActionButtonItem.js +0 -82
  67. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +0 -13
  68. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonHandle.js +0 -1
  69. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.js +0 -1
  70. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +0 -216
  71. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonProps.js +0 -1
  72. package/dist/es/FloatingActionButton/models/align-offset.js +0 -1
  73. package/dist/es/FloatingActionButton/models/align.d.ts +0 -27
  74. package/dist/es/FloatingActionButton/models/align.js +0 -1
  75. package/dist/es/FloatingActionButton/models/events.js +0 -1
  76. package/dist/es/FloatingActionButton/models/position-mode.d.ts +0 -9
  77. package/dist/es/FloatingActionButton/models/position-mode.js +0 -1
  78. package/dist/es/FloatingActionButton/models/rounded.d.ts +0 -12
  79. package/dist/es/FloatingActionButton/models/rounded.js +0 -1
  80. package/dist/es/FloatingActionButton/models/size.d.ts +0 -11
  81. package/dist/es/FloatingActionButton/models/size.js +0 -1
  82. package/dist/es/FloatingActionButton/models/theme-color.d.ts +0 -18
  83. package/dist/es/FloatingActionButton/models/theme-color.js +0 -1
  84. package/dist/es/FloatingActionButton/utils.d.ts +0 -27
  85. package/dist/es/FloatingActionButton/utils.js +0 -93
  86. package/dist/es/ListButton/ButtonItem.js +0 -24
  87. package/dist/es/ListButton/DropDownButton.js +0 -325
  88. package/dist/es/ListButton/DropDownButtonItem.d.ts +0 -30
  89. package/dist/es/ListButton/DropDownButtonItem.js +0 -43
  90. package/dist/es/ListButton/SplitButton.d.ts +0 -120
  91. package/dist/es/ListButton/SplitButton.js +0 -334
  92. package/dist/es/ListButton/SplitButtonItem.js +0 -42
  93. package/dist/es/ListButton/models/ButtonItem.d.ts +0 -34
  94. package/dist/es/ListButton/models/ButtonItem.js +0 -3
  95. package/dist/es/ListButton/models/ListButtonProps.d.ts +0 -336
  96. package/dist/es/ListButton/models/ListButtonProps.js +0 -2
  97. package/dist/es/ListButton/models/PopupSettings.d.ts +0 -24
  98. package/dist/es/ListButton/models/PopupSettings.js +0 -1
  99. package/dist/es/ListButton/models/events.d.ts +0 -47
  100. package/dist/es/ListButton/models/events.js +0 -1
  101. package/dist/es/ListButton/utils/navigation.d.ts +0 -5
  102. package/dist/es/ListButton/utils/navigation.js +0 -29
  103. package/dist/es/ListButton/utils/popup.d.ts +0 -9
  104. package/dist/es/ListButton/utils/popup.js +0 -20
  105. package/dist/es/main.d.ts +0 -32
  106. package/dist/es/main.js +0 -17
  107. package/dist/es/models/index.d.ts +0 -89
  108. package/dist/es/models/index.js +0 -1
  109. package/dist/es/package-metadata.d.ts +0 -5
  110. package/dist/es/package-metadata.js +0 -11
  111. package/dist/es/toolbar/Toolbar.js +0 -214
  112. package/dist/es/toolbar/tools/ToolbarItem.js +0 -56
  113. package/dist/es/toolbar/tools/ToolbarSeparator.d.ts +0 -16
  114. package/dist/es/toolbar/tools/ToolbarSeparator.js +0 -31
  115. package/dist/es/toolbar/tools/ToolbarSpacer.js +0 -20
  116. package/dist/es/util.d.ts +0 -27
  117. package/dist/es/util.js +0 -37
  118. package/dist/npm/Button.d.ts +0 -138
  119. package/dist/npm/Button.js +0 -174
  120. package/dist/npm/ButtonGroup.js +0 -104
  121. package/dist/npm/ButtonGroupInterface.d.ts +0 -33
  122. package/dist/npm/ButtonGroupInterface.js +0 -3
  123. package/dist/npm/ButtonInterface.js +0 -4
  124. package/dist/npm/Chip/Chip.js +0 -176
  125. package/dist/npm/Chip/ChipList.js +0 -180
  126. package/dist/npm/Chip/data-reducer.js +0 -30
  127. package/dist/npm/Chip/focus-reducer.d.ts +0 -25
  128. package/dist/npm/Chip/focus-reducer.js +0 -36
  129. package/dist/npm/Chip/selection-reducer.js +0 -79
  130. package/dist/npm/FloatingActionButton/FloatingActionButton.js +0 -284
  131. package/dist/npm/FloatingActionButton/FloatingActionButtonItem.d.ts +0 -105
  132. package/dist/npm/FloatingActionButton/FloatingActionButtonItem.js +0 -85
  133. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +0 -13
  134. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonHandle.js +0 -2
  135. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.d.ts +0 -24
  136. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.js +0 -2
  137. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonProps.js +0 -2
  138. package/dist/npm/FloatingActionButton/models/align-offset.d.ts +0 -20
  139. package/dist/npm/FloatingActionButton/models/align-offset.js +0 -2
  140. package/dist/npm/FloatingActionButton/models/align.js +0 -2
  141. package/dist/npm/FloatingActionButton/models/events.d.ts +0 -21
  142. package/dist/npm/FloatingActionButton/models/events.js +0 -2
  143. package/dist/npm/FloatingActionButton/models/position-mode.d.ts +0 -9
  144. package/dist/npm/FloatingActionButton/models/position-mode.js +0 -2
  145. package/dist/npm/FloatingActionButton/models/rounded.d.ts +0 -12
  146. package/dist/npm/FloatingActionButton/models/rounded.js +0 -2
  147. package/dist/npm/FloatingActionButton/models/size.d.ts +0 -11
  148. package/dist/npm/FloatingActionButton/models/size.js +0 -2
  149. package/dist/npm/FloatingActionButton/models/theme-color.js +0 -2
  150. package/dist/npm/FloatingActionButton/utils.js +0 -101
  151. package/dist/npm/ListButton/ButtonItem.d.ts +0 -30
  152. package/dist/npm/ListButton/ButtonItem.js +0 -28
  153. package/dist/npm/ListButton/DropDownButton.d.ts +0 -118
  154. package/dist/npm/ListButton/DropDownButton.js +0 -328
  155. package/dist/npm/ListButton/DropDownButtonItem.js +0 -46
  156. package/dist/npm/ListButton/SplitButton.js +0 -337
  157. package/dist/npm/ListButton/SplitButtonItem.d.ts +0 -25
  158. package/dist/npm/ListButton/SplitButtonItem.js +0 -45
  159. package/dist/npm/ListButton/models/ButtonItem.js +0 -4
  160. package/dist/npm/ListButton/models/ListButtonProps.js +0 -3
  161. package/dist/npm/ListButton/models/PopupSettings.js +0 -2
  162. package/dist/npm/ListButton/models/events.js +0 -2
  163. package/dist/npm/ListButton/utils/navigation.d.ts +0 -5
  164. package/dist/npm/ListButton/utils/navigation.js +0 -32
  165. package/dist/npm/ListButton/utils/popup.d.ts +0 -9
  166. package/dist/npm/ListButton/utils/popup.js +0 -25
  167. package/dist/npm/main.d.ts +0 -32
  168. package/dist/npm/main.js +0 -48
  169. package/dist/npm/models/index.js +0 -2
  170. package/dist/npm/package-metadata.d.ts +0 -5
  171. package/dist/npm/package-metadata.js +0 -14
  172. package/dist/npm/toolbar/Toolbar.d.ts +0 -171
  173. package/dist/npm/toolbar/Toolbar.js +0 -217
  174. package/dist/npm/toolbar/tools/ToolbarItem.d.ts +0 -38
  175. package/dist/npm/toolbar/tools/ToolbarItem.js +0 -59
  176. package/dist/npm/toolbar/tools/ToolbarSeparator.d.ts +0 -16
  177. package/dist/npm/toolbar/tools/ToolbarSeparator.js +0 -34
  178. package/dist/npm/toolbar/tools/ToolbarSpacer.d.ts +0 -23
  179. package/dist/npm/toolbar/tools/ToolbarSpacer.js +0 -23
  180. package/dist/npm/util.js +0 -40
  181. package/dist/systemjs/kendo-react-buttons.js +0 -1
  182. package/e2e-next/button.basic.tests.ts +0 -24
  183. package/e2e-next/buttongroup.basic.tests.ts +0 -24
  184. package/e2e-next/chip.basic.tests.ts +0 -24
  185. package/e2e-next/chiplist.basic.tests.ts +0 -24
  186. package/e2e-next/dropdownbutton.basic.tests.ts +0 -24
  187. package/e2e-next/floatingactionbutton.basic.tests.ts +0 -24
  188. package/e2e-next/splitbutton.basic.tests.ts +0 -24
  189. package/e2e-next/toolbar.basic.tests.ts +0 -24
@@ -1,214 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __assign = (this && this.__assign) || function () {
17
- __assign = Object.assign || function(t) {
18
- for (var s, i = 1, n = arguments.length; i < n; i++) {
19
- s = arguments[i];
20
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
- t[p] = s[p];
22
- }
23
- return t;
24
- };
25
- return __assign.apply(this, arguments);
26
- };
27
- import * as React from 'react';
28
- import * as PropTypes from 'prop-types';
29
- import { classNames, Keys, kendoThemeMaps } from '@progress/kendo-react-common';
30
- import { toolbarButtons } from './../util';
31
- import { validatePackage } from '@progress/kendo-react-common';
32
- import { packageMetadata } from '../package-metadata';
33
- /**
34
- * Represents the [KendoReact Toolbar component]({% slug overview_toolbar %}).
35
- *
36
- * @example
37
- * ```jsx
38
- * class App extends React.Component {
39
- * render() {
40
- * return (
41
- * <Toolbar>
42
- * <ToolbarItem>
43
- * <ButtonGroup>
44
- * <Button togglable={true} icon="bold" />
45
- * <Button togglable={true} icon="italic" />
46
- * <Button togglable={true} icon="underline" />
47
- * </ButtonGroup>
48
- * </ToolbarItem>
49
- * <ToolbarItem>
50
- * <ButtonGroup>
51
- * <Button icon="hyperlink">Insert Link</Button>
52
- * <Button icon="image">Insert Image</Button>
53
- * <Button icon="table">Insert Table</Button>
54
- * </ButtonGroup>
55
- * </ToolbarItem>
56
- * </Toolbar>
57
- * );
58
- * }
59
- * }
60
- * ReactDOM.render(<App />, document.querySelector('my-app'));
61
- * ```
62
- */
63
- var Toolbar = /** @class */ (function (_super) {
64
- __extends(Toolbar, _super);
65
- function Toolbar(props) {
66
- var _this = _super.call(this, props) || this;
67
- _this._element = null;
68
- _this.offsetHeight = 0;
69
- _this.offsetWidth = 0;
70
- _this.buttons = [];
71
- _this.focusedSelector = _this.selectors.map(function (s) { return s + ':focus'; }).join(',');
72
- _this.setTabIndex = function (focusedIndex) {
73
- var _a = _this.props.tabIndex, tabIndex = _a === void 0 ? Toolbar.defaultProps.tabIndex : _a;
74
- _this.buttons.forEach(function (button, index) {
75
- button.tabIndex = (index === focusedIndex) ? tabIndex : -1;
76
- });
77
- };
78
- _this.onKeyDown = function (event) {
79
- var target = event.target;
80
- var arrowKey = event.keyCode === Keys.left || event.keyCode === Keys.right;
81
- if (!arrowKey || event.defaultPrevented || _this.buttons.findIndex(function (b) { return b === target; }) === -1) {
82
- return;
83
- }
84
- var focusedIndex = _this.focusedIndex;
85
- if (event.keyCode === Keys.left) {
86
- _this.focusButton(focusedIndex, focusedIndex - 1);
87
- }
88
- else {
89
- _this.focusButton(focusedIndex, focusedIndex + 1);
90
- }
91
- };
92
- _this.onWindowResize = function (event) {
93
- var element = _this.element;
94
- if (!element) {
95
- return;
96
- }
97
- var offsetWidth = element.offsetWidth;
98
- var offsetHeight = element.offsetHeight;
99
- if (_this.offsetWidth !== offsetWidth || _this.offsetHeight !== offsetHeight) {
100
- _this.offsetWidth = offsetWidth;
101
- _this.offsetHeight = offsetHeight;
102
- var newSizes = { offsetWidth: _this.offsetWidth, offsetHeight: _this.offsetHeight };
103
- if (_this.props.onResize) {
104
- _this.props.onResize.call(undefined, __assign(__assign({ target: _this }, newSizes), { nativeEvent: event }));
105
- }
106
- }
107
- };
108
- validatePackage(packageMetadata);
109
- return _this;
110
- }
111
- Object.defineProperty(Toolbar.prototype, "selectors", {
112
- get: function () {
113
- return this.props.buttons || toolbarButtons;
114
- },
115
- enumerable: false,
116
- configurable: true
117
- });
118
- Object.defineProperty(Toolbar.prototype, "focusedIndex", {
119
- get: function () {
120
- var focused = this.element && this.element.querySelector(this.focusedSelector);
121
- return Math.max(0, this.buttons.findIndex(function (e) { return e === focused; }));
122
- },
123
- enumerable: false,
124
- configurable: true
125
- });
126
- Object.defineProperty(Toolbar.prototype, "element", {
127
- /**
128
- * Returns the HTML element of the Toolbar component.
129
- */
130
- get: function () {
131
- return this._element;
132
- },
133
- enumerable: false,
134
- configurable: true
135
- });
136
- /**
137
- * @hidden
138
- */
139
- Toolbar.prototype.componentDidMount = function () {
140
- window.addEventListener('resize', this.onWindowResize);
141
- var element = this.element;
142
- if (element) {
143
- this.offsetWidth = element.offsetWidth;
144
- this.offsetHeight = element.offsetHeight;
145
- if (this.props.keyboardNavigation !== false) {
146
- this.buttons = Array.from(element.querySelectorAll(this.selectors.join(',')));
147
- this.setTabIndex(0);
148
- }
149
- }
150
- };
151
- /**
152
- * @hidden
153
- */
154
- Toolbar.prototype.componentDidUpdate = function () {
155
- var element = this.element;
156
- if (!element || this.props.keyboardNavigation === false) {
157
- return;
158
- }
159
- this.buttons = Array.from(element.querySelectorAll(this.selectors.join(',')));
160
- this.setTabIndex(this.focusedIndex);
161
- };
162
- /**
163
- * @hidden
164
- */
165
- Toolbar.prototype.componentWillUnmount = function () {
166
- window.removeEventListener('resize', this.onWindowResize);
167
- this.buttons.length = 0;
168
- };
169
- /**
170
- * @hidden
171
- */
172
- Toolbar.prototype.render = function () {
173
- var _a;
174
- var _this = this;
175
- return (React.createElement("div", { id: this.props.id, "aria-label": this.props.ariaLabel, className: classNames('k-toolbar', (_a = {},
176
- _a["k-toolbar-".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
177
- _a), this.props.className), style: this.props.style, role: this.props.role !== undefined ? (this.props.role || undefined) : 'toolbar', dir: this.props.dir, ref: function (element) { return _this._element = element; }, onKeyDown: this.props.keyboardNavigation !== false ? this.onKeyDown : undefined }, this.props.children));
178
- };
179
- Toolbar.prototype.focusButton = function (prevIndex, index) {
180
- var _a = this.props.tabIndex, tabIndex = _a === void 0 ? Toolbar.defaultProps.tabIndex : _a;
181
- var button = this.buttons[index];
182
- if (button) {
183
- button.tabIndex = tabIndex;
184
- button.focus();
185
- var prevButton = this.buttons[prevIndex];
186
- if (prevButton) {
187
- prevButton.tabIndex = -1;
188
- }
189
- }
190
- };
191
- /**
192
- * @hidden
193
- */
194
- Toolbar.propTypes = {
195
- tabIndex: PropTypes.number,
196
- dir: PropTypes.string,
197
- keyboardNavigation: PropTypes.bool,
198
- style: PropTypes.object,
199
- className: PropTypes.string,
200
- role: PropTypes.string,
201
- onResize: PropTypes.func,
202
- buttons: PropTypes.arrayOf(PropTypes.string),
203
- size: PropTypes.oneOf([null, 'small', 'medium', 'large'])
204
- };
205
- /**
206
- * @hidden
207
- */
208
- Toolbar.defaultProps = {
209
- tabIndex: 0,
210
- size: 'medium'
211
- };
212
- return Toolbar;
213
- }(React.Component));
214
- export { Toolbar };
@@ -1,56 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- import * as React from 'react';
17
- import * as PropTypes from 'prop-types';
18
- import { classNames } from '@progress/kendo-react-common';
19
- /**
20
- * Represents the KendoReact ToolbarItem component.
21
- * To add a tool to the Toolbar, wrap it inside a ToolbarItem component
22
- * ([see example]({% slug content_toolbar %})).
23
- */
24
- var ToolbarItem = /** @class */ (function (_super) {
25
- __extends(ToolbarItem, _super);
26
- function ToolbarItem() {
27
- var _this = _super !== null && _super.apply(this, arguments) || this;
28
- _this._element = null;
29
- return _this;
30
- }
31
- Object.defineProperty(ToolbarItem.prototype, "element", {
32
- /**
33
- * Returns the HTML element of the ToolbarItem component.
34
- */
35
- get: function () {
36
- return this._element;
37
- },
38
- enumerable: false,
39
- configurable: true
40
- });
41
- /**
42
- * @hidden
43
- */
44
- ToolbarItem.prototype.render = function () {
45
- var _this = this;
46
- return (React.createElement("div", { id: this.props.id, className: classNames('k-toolbar-item', this.props.className), style: this.props.style, ref: function (e) { return _this._element = e; } }, this.props.children));
47
- };
48
- /**
49
- * @hidden
50
- */
51
- ToolbarItem.propTypes = {
52
- className: PropTypes.string
53
- };
54
- return ToolbarItem;
55
- }(React.PureComponent));
56
- export { ToolbarItem };
@@ -1,16 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * Represents the KendoReact Toolbar Separator component.
4
- */
5
- export interface ToolbarSeparatorProps {
6
- /**
7
- * Sets additional classes to the ToolbarSeparator component.
8
- */
9
- className?: string;
10
- }
11
- export declare class ToolbarSeparator extends React.PureComponent<ToolbarSeparatorProps> {
12
- /**
13
- * @hidden
14
- */
15
- render(): JSX.Element;
16
- }
@@ -1,31 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- import * as React from 'react';
17
- import { classNames } from '@progress/kendo-react-common';
18
- var ToolbarSeparator = /** @class */ (function (_super) {
19
- __extends(ToolbarSeparator, _super);
20
- function ToolbarSeparator() {
21
- return _super !== null && _super.apply(this, arguments) || this;
22
- }
23
- /**
24
- * @hidden
25
- */
26
- ToolbarSeparator.prototype.render = function () {
27
- return (React.createElement("div", { className: classNames('k-separator', this.props.className) }));
28
- };
29
- return ToolbarSeparator;
30
- }(React.PureComponent));
31
- export { ToolbarSeparator };
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
- import { classNames } from '@progress/kendo-react-common';
4
- /**
5
- * Represents the KendoReact ToolbarSpacer component.
6
- * To specify an empty space, provide a ToolbarSpacer component
7
- * ([see example]({% slug content_toolbar %})).
8
- */
9
- export var ToolbarSpacer = React.forwardRef(function (props, ref) {
10
- var element = React.useRef(null);
11
- var spacer = React.useRef(null);
12
- React.useImperativeHandle(spacer, function () { return ({ element: element.current }); });
13
- React.useImperativeHandle(ref, function () { return ({ element: element.current }); });
14
- var className = React.useMemo(function () { return classNames('k-spacer', props.className); }, [props.className]);
15
- return (React.createElement("span", { ref: element, className: className }));
16
- });
17
- ToolbarSpacer.displayName = 'KendoReactToolbarSpacer';
18
- ToolbarSpacer.propTypes = {
19
- className: PropTypes.string
20
- };
package/dist/es/util.d.ts DELETED
@@ -1,27 +0,0 @@
1
- /**
2
- * @hidden
3
- */
4
- export declare const toolbarButtons: string[];
5
- /**
6
- * @hidden
7
- */
8
- declare const _default: {
9
- styles: {
10
- button: string;
11
- flat: string;
12
- outline: string;
13
- clear: string;
14
- primary: string;
15
- 'state-selected': string;
16
- 'button-icon': string;
17
- 'button-icontext': string;
18
- 'state-disabled': string;
19
- 'group-start': string;
20
- 'group-end': string;
21
- 'button-group': string;
22
- 'button-group-stretched': string;
23
- ltr: string;
24
- rtl: string;
25
- };
26
- };
27
- export default _default;
package/dist/es/util.js DELETED
@@ -1,37 +0,0 @@
1
- /**
2
- * @hidden
3
- */
4
- var styles = {
5
- button: 'k-button',
6
- 'flat': 'k-flat',
7
- 'outline': 'k-outline',
8
- 'clear': 'k-button-clear',
9
- 'primary': 'k-primary',
10
- 'state-selected': 'k-selected',
11
- 'button-icon': 'k-button-icon',
12
- 'button-icontext': 'k-button-icontext',
13
- 'state-disabled': 'k-disabled',
14
- 'group-start': 'k-group-start',
15
- 'group-end': 'k-group-end',
16
- 'button-group': 'k-button-group',
17
- 'button-group-stretched': 'k-button-group-stretched',
18
- 'ltr': 'k-ltr',
19
- 'rtl': 'k-rtl'
20
- };
21
- // const notDisabled = ':not(.k-disabled):not([disabled]):not([disabled="true"])';
22
- var noInnerButton = ':not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)';
23
- /**
24
- * @hidden
25
- */
26
- export var toolbarButtons = [
27
- 'button' + noInnerButton,
28
- '.k-button-group > button' + noInnerButton,
29
- '.k-colorpicker',
30
- '.k-dropdownlist'
31
- ];
32
- /**
33
- * @hidden
34
- */
35
- export default {
36
- styles: styles
37
- };
@@ -1,138 +0,0 @@
1
- import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
- import { ButtonInterface } from './ButtonInterface';
4
- /**
5
- * Represents the props of the [KendoReact Button component]({% slug overview_button %}).
6
- * Extends the [native button props](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement).
7
- */
8
- export interface ButtonProps extends ButtonInterface, React.ButtonHTMLAttributes<HTMLButtonElement> {
9
- /**
10
- * @hidden
11
- */
12
- children?: React.ReactNode;
13
- /**
14
- * Configures the `size` of the Button.
15
- *
16
- * The available options are:
17
- * - small
18
- * - medium
19
- * - large
20
- * - null&mdash;Does not set a size `className`.
21
- *
22
- * @default `medium`
23
- */
24
- size?: null | 'small' | 'medium' | 'large';
25
- /**
26
- * Configures the `roundness` of the Button.
27
- *
28
- * The available options are:
29
- * - small
30
- * - medium
31
- * - large
32
- * - full
33
- * - null&mdash;Does not set a rounded `className`.
34
- *
35
- * @default `medium`
36
- */
37
- rounded?: null | 'small' | 'medium' | 'large' | 'full';
38
- /**
39
- * Configures the `fillMode` of the Button.
40
- *
41
- * The available options are:
42
- * - solid
43
- * - outline
44
- * - flat
45
- * - link
46
- * - null&mdash;Does not set a fillMode `className`.
47
- *
48
- * @default `solid`
49
- */
50
- fillMode?: null | 'solid' | 'outline' | 'flat' | 'link';
51
- /**
52
- * Configures the `themeColor` of the Button.
53
- *
54
- * The available options are:
55
- * - base
56
- * - primary
57
- * - secondary
58
- * - tertiary
59
- * - info
60
- * - success
61
- * - warning
62
- * - error
63
- * - dark
64
- * - light
65
- * - inverse
66
- * - null&mdash;Does not set a themeColor `className`.
67
- *
68
- * @default `base`
69
- */
70
- themeColor?: null | 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'dark' | 'light' | 'inverse';
71
- }
72
- /**
73
- * @hidden
74
- */
75
- export interface ButtonState {
76
- selected: boolean;
77
- }
78
- export declare class Button extends React.Component<ButtonProps, ButtonState> {
79
- /**
80
- * @hidden
81
- */
82
- static propTypes: {
83
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
84
- selected: PropTypes.Requireable<boolean>;
85
- togglable: PropTypes.Requireable<boolean>;
86
- icon: PropTypes.Requireable<string>;
87
- svgIcon: PropTypes.Requireable<PropTypes.InferProps<{
88
- name: PropTypes.Validator<string>;
89
- content: PropTypes.Validator<string>;
90
- viewBox: PropTypes.Validator<string>;
91
- }>>;
92
- iconClass: PropTypes.Requireable<string>;
93
- imageUrl: PropTypes.Requireable<string>;
94
- imageAlt: PropTypes.Requireable<string>;
95
- size: PropTypes.Requireable<string | null>;
96
- rounded: PropTypes.Requireable<string | null>;
97
- fillMode: PropTypes.Requireable<string | null>;
98
- themeColor: PropTypes.Requireable<string | null>;
99
- };
100
- /**
101
- * @hidden
102
- */
103
- static defaultProps: {
104
- togglable: boolean;
105
- size: string;
106
- rounded: string;
107
- fillMode: string;
108
- themeColor: string;
109
- };
110
- /**
111
- * @hidden
112
- */
113
- readonly state: ButtonState;
114
- private _selectedTemp?;
115
- private _element;
116
- /**
117
- * Gets the DOM element of the Button component.
118
- */
119
- get element(): HTMLButtonElement | null;
120
- /**
121
- * Returns `true` when the component is togglable and selected ([see example]({% slug toggleable_button %})).
122
- * Otherwise, returns `false`.
123
- */
124
- get selected(): boolean;
125
- constructor(props: ButtonProps);
126
- /**
127
- * @hidden
128
- */
129
- static getDerivedStateFromProps(props: ButtonProps, state: ButtonState): {
130
- selected: boolean;
131
- } | null;
132
- /**
133
- * @hidden
134
- */
135
- render(): JSX.Element;
136
- private toggleIfApplicable;
137
- private handleClick;
138
- }