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

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,4 +1,7 @@
1
- /// <reference types="react" />
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
2
5
  import { ChipHandle } from './../Chip/Chip';
3
6
  import { ChipListHandle } from './../Chip/ChipList';
4
7
  /**
@@ -0,0 +1,9 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { PackageMetadata } from '@progress/kendo-licensing';
6
+ /**
7
+ * @hidden
8
+ */
9
+ export declare const packageMetadata: PackageMetadata;
package/package.json CHANGED
@@ -1,20 +1,30 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-buttons",
3
- "version": "6.1.1",
3
+ "version": "7.0.0-develop.2",
4
4
  "description": "All you need in React Button in one package: disabled/enabled states, built-in styles and more. KendoReact Buttons package",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/telerik/kendo-react.git"
5
+ "author": "Progress",
6
+ "license": "SEE LICENSE IN LICENSE.md",
7
+ "homepage": "https://www.telerik.com/kendo-react-ui",
8
+ "main": "./index.js",
9
+ "types": "./index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./index.mjs",
13
+ "require": "./index.js"
14
+ }
15
+ },
16
+ "sideEffects": false,
17
+ "peerDependencies": {
18
+ "@progress/kendo-licensing": "^1.3.0",
19
+ "@progress/kendo-react-common": "7.0.0-develop.2",
20
+ "@progress/kendo-react-popup": "7.0.0-develop.2",
21
+ "@progress/kendo-svg-icons": "^2.0.0",
22
+ "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
23
+ "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
8
24
  },
9
- "main": "dist/npm/main.js",
10
- "types": "dist/npm/main.d.ts",
11
- "module": "dist/es/main.js",
12
- "jsnext:main": "dist/es/main.js",
13
- "scripts": {
14
- "test": "cd ../../ && npm run test -- --testPathPattern=/packages/buttons/.*",
15
- "build-package": "gulp build-package"
25
+ "dependencies": {
26
+ "prop-types": "^15.6.0"
16
27
  },
17
- "homepage": "https://www.telerik.com/kendo-react-ui",
18
28
  "keywords": [
19
29
  "Kendo UI",
20
30
  "React",
@@ -27,39 +37,15 @@
27
37
  "React component",
28
38
  "Telerik"
29
39
  ],
30
- "peerDependencies": {
31
- "@progress/kendo-licensing": "^1.3.0",
32
- "@progress/kendo-svg-icons": "^2.0.0",
33
- "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
34
- "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
35
- },
36
- "dependencies": {
37
- "@progress/kendo-react-common": "6.1.1",
38
- "@progress/kendo-react-popup": "6.1.1",
39
- "prop-types": "^15.6.0"
40
- },
41
- "devDependencies": {
42
- "@progress/kendo-drawing": "^1.17.2",
43
- "@progress/kendo-licensing": "^1.3.0",
44
- "@progress/kendo-react-animation": "6.1.1",
45
- "@progress/kendo-react-dialogs": "6.1.1",
46
- "@progress/kendo-react-dropdowns": "6.1.1",
47
- "@progress/kendo-react-form": "6.1.1",
48
- "@progress/kendo-react-inputs": "6.1.1",
49
- "@progress/kendo-react-intl": "6.1.1",
50
- "@progress/kendo-react-labels": "6.1.1",
51
- "@progress/kendo-react-layout": "6.1.1",
52
- "@progress/kendo-react-ripple": "6.1.1",
53
- "@progress/kendo-svg-icons": "^2.0.0"
54
- },
55
40
  "@progress": {
56
41
  "friendlyName": "Buttons",
57
42
  "framework": "KendoReact"
58
43
  },
59
- "author": "Progress",
60
- "license": "SEE LICENSE IN LICENSE.md",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/telerik/kendo-react.git"
47
+ },
61
48
  "publishConfig": {
62
49
  "access": "public"
63
- },
64
- "sideEffects": false
65
- }
50
+ }
51
+ }
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  import * as React from 'react';
2
6
  import * as PropTypes from 'prop-types';
3
7
  import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
@@ -163,7 +167,7 @@ export declare class Toolbar extends React.Component<ToolbarProps> {
163
167
  /**
164
168
  * @hidden
165
169
  */
166
- render(): JSX.Element;
170
+ render(): import("react/jsx-runtime").JSX.Element;
167
171
  private setTabIndex;
168
172
  private onKeyDown;
169
173
  private focusButton;
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  import * as React from 'react';
2
6
  import * as PropTypes from 'prop-types';
3
7
  import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
@@ -34,5 +38,5 @@ export declare class ToolbarItem extends React.PureComponent<ToolbarItemProps> {
34
38
  /**
35
39
  * @hidden
36
40
  */
37
- render(): JSX.Element;
41
+ render(): import("react/jsx-runtime").JSX.Element;
38
42
  }
@@ -0,0 +1,20 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as React from 'react';
6
+ /**
7
+ * Represents the KendoReact Toolbar Separator component.
8
+ */
9
+ export interface ToolbarSeparatorProps {
10
+ /**
11
+ * Sets additional classes to the ToolbarSeparator component.
12
+ */
13
+ className?: string;
14
+ }
15
+ export declare class ToolbarSeparator extends React.PureComponent<ToolbarSeparatorProps> {
16
+ /**
17
+ * @hidden
18
+ */
19
+ render(): import("react/jsx-runtime").JSX.Element;
20
+ }
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  import * as React from 'react';
2
6
  /**
3
7
  * Represents the props of KendoReact ToolbarSpacer component.
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  /**
2
6
  * @hidden
3
7
  */
package/about.md DELETED
@@ -1,3 +0,0 @@
1
- <a href="https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-buttons&utm_content=banner" target="_blank">
2
- <img src="https://www.telerik.com/kendo-react-ui/components/npm-banner.svg" alt="KendoReact NPM Banner">
3
- </a>
package/dist/es/Button.js DELETED
@@ -1,171 +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
- var __rest = (this && this.__rest) || function (s, e) {
28
- var t = {};
29
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
30
- t[p] = s[p];
31
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
32
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
33
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
34
- t[p[i]] = s[p[i]];
35
- }
36
- return t;
37
- };
38
- import * as React from 'react';
39
- import * as PropTypes from 'prop-types';
40
- import { classNames, kendoThemeMaps, IconWrap, svgIconPropType } from '@progress/kendo-react-common';
41
- import { validatePackage } from '@progress/kendo-react-common';
42
- import { packageMetadata } from './package-metadata';
43
- /**
44
- * @hidden
45
- */
46
- function iconElement(_a) {
47
- var imageUrl = _a.imageUrl, name = _a.name, iconClass = _a.iconClass, svgIcon = _a.svgIcon, imageAlt = _a.imageAlt;
48
- if (imageUrl) {
49
- return (React.createElement("img", { role: "presentation", className: 'k-button-icon', alt: imageAlt, src: imageUrl }));
50
- }
51
- else if (name || svgIcon) {
52
- return React.createElement(IconWrap, { className: 'k-button-icon', name: name, icon: svgIcon });
53
- }
54
- else if (iconClass) {
55
- return (React.createElement("span", { role: "presentation", className: classNames('k-button-icon', iconClass) }));
56
- }
57
- return null;
58
- }
59
- var Button = /** @class */ (function (_super) {
60
- __extends(Button, _super);
61
- function Button(props) {
62
- var _this = _super.call(this, props) || this;
63
- _this._element = null;
64
- _this.handleClick = function (event) {
65
- _this.toggleIfApplicable();
66
- if (_this.props.onClick) {
67
- _this.props.onClick.call(undefined, event);
68
- }
69
- };
70
- validatePackage(packageMetadata);
71
- _this.state = { selected: _this.props.togglable === true && _this.props.selected === true };
72
- return _this;
73
- }
74
- Object.defineProperty(Button.prototype, "element", {
75
- /**
76
- * Gets the DOM element of the Button component.
77
- */
78
- get: function () {
79
- return this._element;
80
- },
81
- enumerable: false,
82
- configurable: true
83
- });
84
- Object.defineProperty(Button.prototype, "selected", {
85
- /**
86
- * Returns `true` when the component is togglable and selected ([see example]({% slug toggleable_button %})).
87
- * Otherwise, returns `false`.
88
- */
89
- get: function () {
90
- return this._selectedTemp !== undefined ? this._selectedTemp : this.state.selected;
91
- },
92
- enumerable: false,
93
- configurable: true
94
- });
95
- /**
96
- * @hidden
97
- */
98
- Button.getDerivedStateFromProps = function (props, state) {
99
- if (props.togglable && props.selected !== undefined && props.selected !== state.selected) {
100
- return { selected: props.selected };
101
- }
102
- return null;
103
- };
104
- /**
105
- * @hidden
106
- */
107
- Button.prototype.render = function () {
108
- var _a;
109
- var _this = this;
110
- var _b = this.props, children = _b.children, togglable = _b.togglable, icon = _b.icon, iconClass = _b.iconClass, svgIcon = _b.svgIcon, imageUrl = _b.imageUrl, imageAlt = _b.imageAlt, className = _b.className, onClick = _b.onClick, _c = _b.size, size = _c === void 0 ? Button.defaultProps.size : _c, _d = _b.rounded, rounded = _d === void 0 ? Button.defaultProps.rounded : _d, _e = _b.fillMode, fillMode = _e === void 0 ? Button.defaultProps.fillMode : _e, _f = _b.themeColor, themeColor = _f === void 0 ? Button.defaultProps.themeColor : _f, htmlAttributes = __rest(_b, ["children", "togglable", "icon", "iconClass", "svgIcon", "imageUrl", "imageAlt", "className", "onClick", "size", "rounded", "fillMode", "themeColor"]);
111
- var hasIcon = (svgIcon !== undefined || icon !== undefined || iconClass !== undefined || imageUrl !== undefined);
112
- var hasChildren = children !== undefined;
113
- var iconEl = iconElement({
114
- name: icon,
115
- svgIcon: svgIcon,
116
- iconClass: iconClass,
117
- imageUrl: imageUrl,
118
- imageAlt: imageAlt
119
- });
120
- return (React.createElement("button", __assign({ ref: function (button) { return _this._element = button; }, "aria-pressed": togglable ? this.state.selected : undefined }, htmlAttributes, { onClick: this.handleClick, className: classNames('k-button', (_a = {},
121
- _a["k-button-".concat(kendoThemeMaps.sizeMap[size] || size)] = size,
122
- _a["k-button-".concat(fillMode)] = fillMode,
123
- _a["k-button-".concat(fillMode, "-").concat(themeColor)] = Boolean(fillMode && themeColor),
124
- _a["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
125
- _a['k-icon-button'] = !hasChildren && hasIcon,
126
- _a['k-disabled'] = this.props.disabled,
127
- _a['k-selected'] = this.state.selected,
128
- _a['k-rtl'] = this.props.dir === 'rtl',
129
- _a), this.props.className) }),
130
- iconEl,
131
- children && (React.createElement("span", { className: "k-button-text" }, children))));
132
- };
133
- Button.prototype.toggleIfApplicable = function () {
134
- var _this = this;
135
- if (this.props.togglable && this.props.selected === undefined) {
136
- var selected = !this.state.selected;
137
- this._selectedTemp = selected;
138
- this.setState({ selected: selected }, function () { return _this._selectedTemp = undefined; });
139
- }
140
- };
141
- /**
142
- * @hidden
143
- */
144
- Button.propTypes = {
145
- children: PropTypes.node,
146
- selected: PropTypes.bool,
147
- togglable: PropTypes.bool,
148
- icon: PropTypes.string,
149
- svgIcon: svgIconPropType,
150
- iconClass: PropTypes.string,
151
- imageUrl: PropTypes.string,
152
- imageAlt: PropTypes.string,
153
- size: PropTypes.oneOf([null, 'small', 'medium', 'large']),
154
- rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),
155
- fillMode: PropTypes.oneOf([null, 'flat', 'link', 'outline', 'solid']),
156
- // eslint-disable-next-line max-len
157
- themeColor: PropTypes.oneOf([null, 'base', 'primary', 'secondary', 'tertiary', 'info', 'success', 'warning', 'error', 'dark', 'light', 'inverse'])
158
- };
159
- /**
160
- * @hidden
161
- */
162
- Button.defaultProps = {
163
- togglable: false,
164
- size: 'medium',
165
- rounded: 'medium',
166
- fillMode: 'solid',
167
- themeColor: 'base'
168
- };
169
- return Button;
170
- }(React.Component));
171
- export { Button };
@@ -1,32 +0,0 @@
1
- import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
- import { ButtonGroupInterface } from './ButtonGroupInterface';
4
- /**
5
- * Represents the props of the [KendoReact ButtonGroup component]({% slug overview_buttongroup %}).
6
- */
7
- export interface ButtonGroupProps extends ButtonGroupInterface {
8
- /**
9
- * Sets the `className` of the ButtonGroup component.
10
- */
11
- className?: string;
12
- }
13
- export declare class ButtonGroup extends React.Component<ButtonGroupProps, {}> {
14
- /**
15
- * @hidden
16
- */
17
- static propTypes: {
18
- children: PropTypes.Requireable<NonNullable<PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[] | null | undefined>>;
19
- className: PropTypes.Requireable<string>;
20
- disabled: PropTypes.Requireable<boolean>;
21
- width: PropTypes.Requireable<string>;
22
- dir: PropTypes.Requireable<string>;
23
- };
24
- private _element;
25
- constructor(props: ButtonGroupProps);
26
- /**
27
- * @hidden
28
- */
29
- render(): JSX.Element;
30
- private mapButtons;
31
- private renderButton;
32
- }
@@ -1,101 +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 } from '@progress/kendo-react-common';
30
- import { validatePackage } from '@progress/kendo-react-common';
31
- import { packageMetadata } from './package-metadata';
32
- import util from './util';
33
- var styles = util.styles;
34
- var ButtonGroup = /** @class */ (function (_super) {
35
- __extends(ButtonGroup, _super);
36
- function ButtonGroup(props) {
37
- var _this = _super.call(this, props) || this;
38
- _this._element = null;
39
- validatePackage(packageMetadata);
40
- return _this;
41
- }
42
- /**
43
- * @hidden
44
- */
45
- ButtonGroup.prototype.render = function () {
46
- var _a;
47
- var _this = this;
48
- var buttons = this.mapButtons(this.props.children);
49
- var groupClasses = classNames([styles['button-group']], (_a = {},
50
- _a['k-disabled'] = this.props.disabled,
51
- _a[styles['button-group-stretched']] = !!this.props.width,
52
- _a), this.props.className);
53
- var groupProps = {
54
- className: groupClasses,
55
- style: { 'width': "".concat(this.props.width) },
56
- dir: this.props.dir,
57
- // Accessibility properties
58
- role: 'group',
59
- 'aria-disabled': this.props.disabled
60
- };
61
- return (React.createElement("div", __assign({ ref: function (div) { _this._element = div; } }, groupProps, { className: groupClasses }), buttons));
62
- };
63
- ButtonGroup.prototype.mapButtons = function (children) {
64
- var _this = this;
65
- var count = React.Children.count(children);
66
- var rtl = this.props.dir !== undefined
67
- ? this.props.dir === 'rtl'
68
- : (this._element && (getComputedStyle(this._element).direction === 'rtl') || false);
69
- return React.Children.map(children, function (child, index) {
70
- if (React.isValidElement(child)) {
71
- return _this.renderButton(child, index, (index === count - 1), rtl);
72
- }
73
- return child;
74
- });
75
- };
76
- ButtonGroup.prototype.renderButton = function (child, index, isLast, isRtl) {
77
- var _a;
78
- var className = classNames(child.props.className, (_a = {},
79
- _a[styles['group-start']] = isRtl ? isLast : index === 0,
80
- _a[styles['group-end']] = isRtl ? index === 0 : isLast,
81
- _a));
82
- var style = __assign(__assign({}, (this.props.width ? { width: this.props.width } : {})), (child.props.style || {}));
83
- var disabled = this.props.disabled || child.props.disabled;
84
- var buttonProps = __assign(__assign(__assign(__assign({}, child.props), (className ? { className: className } : {})), (Object.keys(style).length ? { style: style } : {})), (disabled !== undefined ? { disabled: disabled } : {}));
85
- return React.Children.count(child.props.children) > 0 ?
86
- React.cloneElement(child, buttonProps, child.props.children) :
87
- React.cloneElement(child, buttonProps);
88
- };
89
- /**
90
- * @hidden
91
- */
92
- ButtonGroup.propTypes = {
93
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element]),
94
- className: PropTypes.string,
95
- disabled: PropTypes.bool,
96
- width: PropTypes.string,
97
- dir: PropTypes.string
98
- };
99
- return ButtonGroup;
100
- }(React.Component));
101
- export { ButtonGroup };
@@ -1,2 +0,0 @@
1
- export {};
2
- // tslint:enable:max-line-length
@@ -1,35 +0,0 @@
1
- import { SVGIcon } from '@progress/kendo-react-common';
2
- /**
3
- * Inherits the native HTML Button. Represents the properties which can be set to a Button.
4
- */
5
- export interface ButtonInterface {
6
- /**
7
- * Specifies if the Button is disabled ([see example]({% slug disabled_button %})). Defaults to `false`.
8
- */
9
- disabled?: boolean;
10
- /**
11
- * Sets the selected state of the Button. Can be used for controlled state.
12
- */
13
- selected?: boolean;
14
- /**
15
- * Provides visual styling that indicates if the Button is selected ([see example]({% slug toggleable_button %})). Defaults to `false`.
16
- */
17
- togglable?: boolean;
18
- /**
19
- * Defines the name for an existing icon in a KendoReact theme ([see example]({% slug icons_button %})). The icon is rendered inside the Button by a `span.k-icon` element.
20
- */
21
- icon?: string;
22
- svgIcon?: SVGIcon;
23
- /**
24
- * Defines a CSS class&mdash;or multiple classes separated by spaces&mdash;which are applied to a `span` element inside the Button ([see example]({% slug icons_button %})). Allows the usage of custom icons.
25
- */
26
- iconClass?: string;
27
- /**
28
- * Defines a URL which is used as an `img` element inside the Button ([see example]({% slug icons_button %})). The URL can be relative or absolute. If relative, it is evaluated with relation to the URL of the web page.
29
- */
30
- imageUrl?: string;
31
- /**
32
- * Defines the alternative text of the image rendered inside the Button component.
33
- */
34
- imageAlt?: string;
35
- }
@@ -1,3 +0,0 @@
1
- /* eslint-disable max-len */
2
- export {};
3
- // tslint:enable:max-line-length