@progress/kendo-react-buttons 4.14.1 → 5.0.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 (57) hide show
  1. package/dist/cdn/js/kendo-react-buttons.js +1 -1
  2. package/dist/es/Button.d.ts +79 -5
  3. package/dist/es/Button.js +30 -31
  4. package/dist/es/ButtonGroup.js +1 -1
  5. package/dist/es/ButtonInterface.d.ts +0 -13
  6. package/dist/es/Chip/Chip.d.ts +51 -9
  7. package/dist/es/Chip/Chip.js +34 -37
  8. package/dist/es/Chip/ChipList.d.ts +12 -0
  9. package/dist/es/Chip/ChipList.js +15 -13
  10. package/dist/es/FloatingActionButton/FloatingActionButton.js +26 -18
  11. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +18 -4
  12. package/dist/es/FloatingActionButton/models/rounded.d.ts +12 -0
  13. package/dist/es/{buttonLook.js → FloatingActionButton/models/rounded.js} +0 -0
  14. package/dist/es/FloatingActionButton/models/shape.d.ts +2 -1
  15. package/dist/es/FloatingActionButton/models/size.d.ts +2 -1
  16. package/dist/es/FloatingActionButton/models/theme-color.d.ts +2 -1
  17. package/dist/es/ListButton/ButtonItem.d.ts +6 -5
  18. package/dist/es/ListButton/ButtonItem.js +24 -44
  19. package/dist/es/ListButton/DropDownButton.d.ts +2 -4
  20. package/dist/es/ListButton/DropDownButton.js +14 -13
  21. package/dist/es/ListButton/SplitButton.d.ts +0 -1
  22. package/dist/es/ListButton/SplitButton.js +13 -13
  23. package/dist/es/ListButton/models/ListButtonProps.d.ts +125 -13
  24. package/dist/es/main.d.ts +3 -3
  25. package/dist/es/models/index.d.ts +0 -16
  26. package/dist/es/package-metadata.js +1 -1
  27. package/dist/es/util.js +3 -3
  28. package/dist/npm/Button.d.ts +79 -5
  29. package/dist/npm/Button.js +29 -30
  30. package/dist/npm/ButtonGroup.js +1 -1
  31. package/dist/npm/ButtonInterface.d.ts +0 -13
  32. package/dist/npm/Chip/Chip.d.ts +51 -9
  33. package/dist/npm/Chip/Chip.js +33 -36
  34. package/dist/npm/Chip/ChipList.d.ts +12 -0
  35. package/dist/npm/Chip/ChipList.js +14 -12
  36. package/dist/npm/FloatingActionButton/FloatingActionButton.js +25 -17
  37. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +18 -4
  38. package/dist/npm/FloatingActionButton/models/rounded.d.ts +12 -0
  39. package/dist/npm/{buttonLook.js → FloatingActionButton/models/rounded.js} +0 -0
  40. package/dist/npm/FloatingActionButton/models/shape.d.ts +2 -1
  41. package/dist/npm/FloatingActionButton/models/size.d.ts +2 -1
  42. package/dist/npm/FloatingActionButton/models/theme-color.d.ts +2 -1
  43. package/dist/npm/ListButton/ButtonItem.d.ts +6 -5
  44. package/dist/npm/ListButton/ButtonItem.js +24 -44
  45. package/dist/npm/ListButton/DropDownButton.d.ts +2 -4
  46. package/dist/npm/ListButton/DropDownButton.js +13 -12
  47. package/dist/npm/ListButton/SplitButton.d.ts +0 -1
  48. package/dist/npm/ListButton/SplitButton.js +12 -12
  49. package/dist/npm/ListButton/models/ListButtonProps.d.ts +125 -13
  50. package/dist/npm/main.d.ts +3 -3
  51. package/dist/npm/models/index.d.ts +0 -16
  52. package/dist/npm/package-metadata.js +1 -1
  53. package/dist/npm/util.js +3 -3
  54. package/dist/systemjs/kendo-react-buttons.js +1 -1
  55. package/package.json +11 -10
  56. package/dist/es/buttonLook.d.ts +0 -14
  57. package/dist/npm/buttonLook.d.ts +0 -14
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  };
21
21
  import * as React from 'react';
22
22
  import * as PropTypes from 'prop-types';
23
- import { validatePackage } from '@progress/kendo-react-common';
23
+ import { kendoThemeMaps, validatePackage } from '@progress/kendo-react-common';
24
24
  import { classNames, guid, useDir, dispatchEvent, Keys, getTabIndex } from '@progress/kendo-react-common';
25
25
  import { FloatingActionButtonItem } from './FloatingActionButtonItem';
26
26
  import { packageMetadata } from '../package-metadata';
@@ -41,7 +41,7 @@ import { Popup } from '@progress/kendo-react-popup';
41
41
  */
42
42
  export var FloatingActionButton = React.forwardRef(function (props, ref) {
43
43
  validatePackage(packageMetadata);
44
- var _a = props.align, align = _a === void 0 ? defaultProps.align : _a, alignOffset = props.alignOffset, className = props.className, disabled = props.disabled, icon = props.icon, iconClass = props.iconClass, id = props.id, items = props.items, item = props.item, text = props.text, _b = props.positionMode, positionMode = _b === void 0 ? defaultProps.positionMode : _b, _c = props.shape, shape = _c === void 0 ? defaultProps.shape : _c, _d = props.size, size = _d === void 0 ? defaultProps.size : _d, style = props.style, _e = props.themeColor, themeColor = _e === void 0 ? defaultProps.themeColor : _e, tabIndex = props.tabIndex, accessKey = props.accessKey, _f = props.popupSettings, popupSettings = _f === void 0 ? {} : _f, onClick = props.onClick, onItemClick = props.onItemClick, onFocus = props.onFocus, onBlur = props.onBlur, onKeyDown = props.onKeyDown, onOpen = props.onOpen, onClose = props.onClose, others = __rest(props, ["align", "alignOffset", "className", "disabled", "icon", "iconClass", "id", "items", "item", "text", "positionMode", "shape", "size", "style", "themeColor", "tabIndex", "accessKey", "popupSettings", "onClick", "onItemClick", "onFocus", "onBlur", "onKeyDown", "onOpen", "onClose"]);
44
+ var _a = props.align, align = _a === void 0 ? defaultProps.align : _a, alignOffset = props.alignOffset, className = props.className, disabled = props.disabled, icon = props.icon, iconClass = props.iconClass, id = props.id, items = props.items, item = props.item, text = props.text, _b = props.positionMode, positionMode = _b === void 0 ? defaultProps.positionMode : _b, _c = props.shape, shape = _c === void 0 ? defaultProps.shape : _c, _d = props.size, size = _d === void 0 ? defaultProps.size : _d, style = props.style, _e = props.rounded, rounded = _e === void 0 ? defaultProps.rounded : _e, _f = props.themeColor, themeColor = _f === void 0 ? defaultProps.themeColor : _f, tabIndex = props.tabIndex, accessKey = props.accessKey, _g = props.popupSettings, popupSettings = _g === void 0 ? {} : _g, onClick = props.onClick, onItemClick = props.onItemClick, onFocus = props.onFocus, onBlur = props.onBlur, onKeyDown = props.onKeyDown, onOpen = props.onOpen, onClose = props.onClose, others = __rest(props, ["align", "alignOffset", "className", "disabled", "icon", "iconClass", "id", "items", "item", "text", "positionMode", "shape", "size", "style", "rounded", "themeColor", "tabIndex", "accessKey", "popupSettings", "onClick", "onItemClick", "onFocus", "onBlur", "onKeyDown", "onOpen", "onClose"]);
45
45
  var target = React.useRef(null);
46
46
  var elementRef = React.useRef(null);
47
47
  var listRef = React.useRef(null);
@@ -57,9 +57,9 @@ export var FloatingActionButton = React.forwardRef(function (props, ref) {
57
57
  }); }, [focusElement]);
58
58
  React.useImperativeHandle(target, getImperativeHandle);
59
59
  React.useImperativeHandle(ref, function () { return target.current; });
60
- var _g = React.useState(false), open = _g[0], setOpen = _g[1];
61
- var _h = React.useState(false), focused = _h[0], setFocused = _h[1];
62
- var _j = React.useState(-1), focusedIndex = _j[0], setFocusedIndex = _j[1];
60
+ var _h = React.useState(false), open = _h[0], setOpen = _h[1];
61
+ var _j = React.useState(false), focused = _j[0], setFocused = _j[1];
62
+ var _k = React.useState(-1), focusedIndex = _k[0], setFocusedIndex = _k[1];
63
63
  var buttonId = React.useMemo(function () { return guid(); }, []);
64
64
  var dir = useDir(elementRef, props.dir);
65
65
  var isRtl = dir === 'rtl';
@@ -191,15 +191,21 @@ export var FloatingActionButton = React.forwardRef(function (props, ref) {
191
191
  }
192
192
  dispatchEvent(onKeyDown, event, getImperativeHandle(), undefined);
193
193
  }, [onKeyDown, focusedIndex, setFocusedIndex, isRtl, setOpen]);
194
- var buttonClassNames = React.useMemo(function () { return classNames('k-fab', "k-fab-" + themeColor, "k-fab-" + shape, {
195
- 'k-fab-sm': size === 'small',
196
- 'k-fab-md': size === 'medium',
197
- 'k-fab-lg': size === 'large',
198
- 'k-state-disabled': disabled,
199
- 'k-pos-absolute': positionMode === 'absolute',
200
- 'k-pos-fixed': positionMode === 'fixed',
201
- 'k-state-focus': focused
202
- }, "k-" + align.vertical + "-" + align.horizontal, className); }, [themeColor, size, shape, disabled, positionMode, align, focused, className]);
194
+ var buttonClassNames = React.useMemo(function () {
195
+ var _a;
196
+ return classNames('k-fab k-fab-solid', (_a = {},
197
+ _a["k-fab-" + shape] = shape,
198
+ _a['k-fab-sm'] = size === 'small',
199
+ _a['k-fab-md'] = size === 'medium',
200
+ _a['k-fab-lg'] = size === 'large',
201
+ _a['k-disabled'] = disabled,
202
+ _a['k-pos-absolute'] = positionMode === 'absolute',
203
+ _a['k-pos-fixed'] = positionMode === 'fixed',
204
+ _a['k-focus'] = focused,
205
+ _a["k-rounded-" + (kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
206
+ _a["k-fab-solid-" + themeColor] = themeColor,
207
+ _a), "k-" + align.vertical + "-" + align.horizontal, className);
208
+ }, [themeColor, size, rounded, shape, disabled, positionMode, align, focused, className]);
203
209
  var fabItems = (items && (items.map(function (element, index) {
204
210
  return (React.createElement(FloatingActionButtonItem, __assign({}, element, { key: index, index: index, id: listId + "-" + index, disabled: disabled || element.disabled, focused: focusedIndex === index, dataItem: element, item: item, className: classNames(element.className, getTextDirectionClass(dir || 'ltr', align.horizontal)), onClick: handleItemClick, onDown: handleItemDown })));
205
211
  })));
@@ -244,9 +250,10 @@ FloatingActionButton.propTypes = {
244
250
  horizontal: PropTypes.oneOf(['start', 'center', 'end'])
245
251
  }),
246
252
  positionMode: PropTypes.oneOf(['absolute', 'fixed']),
247
- shape: PropTypes.oneOf(['rectangle', 'rounded', 'pill']),
248
- size: PropTypes.oneOf(['small', 'medium', 'large']),
249
- themeColor: PropTypes.oneOf([
253
+ shape: PropTypes.oneOf([null, 'rectangle', 'square']),
254
+ size: PropTypes.oneOf([null, 'small', 'medium', 'large']),
255
+ rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']),
256
+ themeColor: PropTypes.oneOf([null,
250
257
  'primary', 'secondary', 'tertiary',
251
258
  'info', 'success', 'warning',
252
259
  'error', 'dark', 'light', 'inverse'
@@ -254,8 +261,9 @@ FloatingActionButton.propTypes = {
254
261
  };
255
262
  var defaultProps = {
256
263
  align: { vertical: 'bottom', horizontal: 'end' },
257
- shape: 'pill',
264
+ shape: 'rectangle',
258
265
  size: 'medium',
266
+ rounded: 'full',
259
267
  themeColor: 'primary',
260
268
  positionMode: 'fixed'
261
269
  };
@@ -8,6 +8,7 @@ import { FloatingActionButtonPositionMode } from '../models/position-mode';
8
8
  import { FloatingActionButtonShape } from '../models/shape';
9
9
  import { FloatingActionButtonSize } from '../models/size';
10
10
  import { FloatingActionButtonThemeColor } from '../models/theme-color';
11
+ import { FloatingActionButtonRounded } from '../models/rounded';
11
12
  /**
12
13
  * @hidden
13
14
  */
@@ -101,13 +102,11 @@ export interface FloatingActionButtonProps extends Omit<React.ButtonHTMLAttribut
101
102
  * [see example]({% slug appearance_floatingactionbutton %}).
102
103
  *
103
104
  * The possible values are:
104
- * * `pill`(Default)&mdash;Applies border radius equal to half of the height of the FloatingActionButton.
105
- * If the Floating Action Button contains only icon, the shape will be circle.
106
- * * `circle`&mdash;Applies circle shape on the FloatingActionButton.
107
105
  * * `rectangle`&mdash;Applies no border radius on the FloatingActionButton.
108
- * * `rounded`&mdash;Applies default border radius on the FloatingActionButton.
109
106
  * * `square`&mdash;Applies square shape on the FloatingActionButton.
107
+ * * `null`&mdash;Does not set a shape `className`.
110
108
  *
109
+ * @default `rectangle`
111
110
  */
112
111
  shape?: FloatingActionButtonShape;
113
112
  /**
@@ -118,9 +117,23 @@ export interface FloatingActionButtonProps extends Omit<React.ButtonHTMLAttribut
118
117
  * * `small`&mdash;Applies half of the default padding, e.g. `8px`.
119
118
  * * `medium` (Default)&mdash;Applies the default padding, e.g. `16px`.
120
119
  * * `large`&mdash;Applies one and one half of the default padding, e.g. `24px`.
120
+ * * `null`&mdash;Does not set a size `className`.
121
121
  *
122
122
  */
123
123
  size?: FloatingActionButtonSize;
124
+ /**
125
+ * Specifies the rounding of the Floating Action Button.
126
+ *
127
+ * The possible values are:
128
+ * * `small`
129
+ * * `medium`
130
+ * * `large`
131
+ * * `full`
132
+ * * `null`&mdash;Does not set a rounded `className`.
133
+ *
134
+ * @default `full`
135
+ */
136
+ rounded?: FloatingActionButtonRounded;
124
137
  /**
125
138
  * Specifies the theme color of the Floating Action Button
126
139
  * [see example]({% slug appearance_floatingactionbutton %}).
@@ -136,6 +149,7 @@ export interface FloatingActionButtonProps extends Omit<React.ButtonHTMLAttribut
136
149
  * * `dark`&mdash; Applies coloring based on the dark theme color.
137
150
  * * `light`&mdash; Applies coloring based on the light theme color.
138
151
  * * `inverse`&mdash; Applies coloring based on the inverse theme color.
152
+ * * `null`&mdash;Does not set a theme color `className`.
139
153
  *
140
154
  */
141
155
  themeColor?: FloatingActionButtonThemeColor;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Specifies the rounding of the Floating Action Button.
3
+ *
4
+ * The possible values are:
5
+ * * `small`
6
+ * * `medium`
7
+ * * `large`
8
+ * * `full`
9
+ * * `null`&mdash;Does not set a rounded `className`.
10
+ *
11
+ */
12
+ export declare type FloatingActionButtonRounded = null | 'small' | 'medium' | 'large' | 'full';
@@ -8,6 +8,7 @@
8
8
  * * `rectangle`&mdash;Applies no border radius on the FloatingActionButton.
9
9
  * * `rounded`&mdash;Applies default border radius on the FloatingActionButton.
10
10
  * * `square`&mdash;Applies square shape on the FloatingActionButton.
11
+ * * `null`&mdash;Does not set a shape `className`.
11
12
  *
12
13
  */
13
- export declare type FloatingActionButtonShape = 'rectangle' | 'rounded' | 'pill' | 'circle' | 'square';
14
+ export declare type FloatingActionButtonShape = null | 'rectangle' | 'square';
@@ -5,6 +5,7 @@
5
5
  * * `small`&mdash;Applies half of the default padding, e.g. `8px`.
6
6
  * * `medium` (Default)&mdash;Applies the default padding, e.g. `16px`.
7
7
  * * `large`&mdash;Applies one and one half of the default padding, e.g. `24px`.
8
+ * * `null`&mdash;Does not set a size `className`.
8
9
  *
9
10
  */
10
- export declare type FloatingActionButtonSize = 'small' | 'medium' | 'large';
11
+ export declare type FloatingActionButtonSize = null | 'small' | 'medium' | 'large';
@@ -12,6 +12,7 @@
12
12
  * * `dark`&mdash; Applies coloring based on the dark theme color.
13
13
  * * `light`&mdash; Applies coloring based on the light theme color.
14
14
  * * `inverse`&mdash; Applies coloring based on the inverse theme color.
15
+ * * `null`&mdash;Does not set a theme color `className`.
15
16
  *
16
17
  */
17
- export declare type FloatingActionButtonThemeColor = 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'dark' | 'light' | 'inverse';
18
+ export declare type FloatingActionButtonThemeColor = null | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'dark' | 'light' | 'inverse';
@@ -19,12 +19,13 @@ export interface ButtonItemProps {
19
19
  dataItem: any;
20
20
  id?: string;
21
21
  textField?: string;
22
+ className?: string;
22
23
  }
23
24
  /**
24
25
  * @hidden
25
26
  */
26
- export default class ButtonItem extends React.Component<ButtonItemProps, {}> {
27
- onClick: (event: any) => void;
28
- render(): any;
29
- private renderContent;
30
- }
27
+ declare const ButtonItem: {
28
+ (props: ButtonItemProps): any;
29
+ displayName: string;
30
+ };
31
+ export default ButtonItem;
@@ -1,50 +1,30 @@
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
1
  import * as React from 'react';
15
2
  import { classNames } from '@progress/kendo-react-common';
16
3
  /**
17
4
  * @hidden
18
5
  */
19
- var ButtonItem = /** @class */ (function (_super) {
20
- __extends(ButtonItem, _super);
21
- function ButtonItem() {
22
- var _this = _super !== null && _super.apply(this, arguments) || this;
23
- _this.onClick = function (event) { return _this.props.onClick(event, _this.props.index); };
24
- return _this;
25
- }
26
- ButtonItem.prototype.render = function () {
27
- var _a = this.props, dataItem = _a.dataItem, focused = _a.focused, id = _a.id, onDown = _a.onDown, render = _a.render;
28
- var item = (React.createElement("li", { id: id, className: classNames('k-item', {
29
- 'k-state-focused': focused,
30
- 'k-state-selected': dataItem.selected,
31
- 'k-state-disabled': dataItem.disabled
32
- }), onClick: this.onClick, onMouseDown: onDown, onPointerDown: onDown, role: "menuItem", "aria-disabled": dataItem.disabled || undefined }, this.renderContent()));
33
- return (this.props.item !== undefined /* to be removed in 5.0.0 */ &&
34
- render !== undefined) ? render.call(undefined, item, this.props) : item;
35
- };
36
- ButtonItem.prototype.renderContent = function () {
37
- var _a = this.props, dataItem = _a.dataItem, textField = _a.textField, index = _a.index;
38
- var As = this.props.dataItem.render || this.props.item || (this.props.item === undefined ? this.props.render : null);
39
- var text = dataItem.text !== undefined ? dataItem.text :
40
- (textField ? dataItem[textField] : dataItem);
41
- var iconClass = dataItem.icon ? "k-icon k-i-" + dataItem.icon : dataItem.iconClass;
42
- return (As && React.createElement(As, { item: dataItem, itemIndex: index })) || ([
43
- (iconClass && (React.createElement("span", { className: iconClass, role: "presentation", key: "icon" }))),
44
- (dataItem.imageUrl && (React.createElement("img", { className: "k-image", alt: "", src: dataItem.imageUrl, role: "presentation", key: "image" }))),
45
- text
46
- ]);
47
- };
48
- return ButtonItem;
49
- }(React.Component));
6
+ var ButtonItem = function (props) {
7
+ var _a;
8
+ var handleClick = React.useCallback(function (event) {
9
+ props.onClick(event, props.index);
10
+ }, [props]);
11
+ var As = props.dataItem.render || props.item || (props.item === undefined ? props.render : null);
12
+ var text = props.dataItem.text !== undefined ? props.dataItem.text : (props.textField ? props.dataItem[props.textField] : props.dataItem);
13
+ var item = (React.createElement("li", { id: props.id, className: classNames('k-item', props.className), onClick: handleClick, onMouseDown: props.onDown, onPointerDown: props.onDown, role: "menuItem", "aria-disabled": props.dataItem.disabled || undefined }, (React.createElement("span", { tabIndex: -1, className: classNames('k-link k-menu-link', {
14
+ 'k-selected': props.dataItem.selected,
15
+ 'k-disabled': props.dataItem.disabled,
16
+ 'k-focus': props.focused
17
+ }), key: "icon" }, As
18
+ ? (React.createElement(As, { item: props.dataItem, itemIndex: props.index }))
19
+ : (React.createElement(React.Fragment, null,
20
+ (props.dataItem.icon || props.dataItem.iconClass) && (React.createElement("span", { className: classNames('k-icon', (_a = {},
21
+ _a["k-i-" + props.dataItem.icon] = props.dataItem.icon,
22
+ _a["" + props.dataItem.iconClass] = props.dataItem.iconClass,
23
+ _a)) })),
24
+ (props.dataItem.imageUrl) && (React.createElement("img", { role: "presentation", alt: "", src: props.dataItem.imageUrl, className: 'k-icon' })),
25
+ (text) && (React.createElement("span", { className: "k-menu-link-text" }, text))))))));
26
+ return ((props.item !== undefined && /* to be removed in 5.0.0 */
27
+ props.render !== undefined) ? props.render.call(undefined, item, props) : item);
28
+ };
29
+ ButtonItem.displayName = 'KendoReactButtonItem';
50
30
  export default ButtonItem;
@@ -34,7 +34,6 @@ export default class DropDownButton extends React.Component<DropDownButtonProps,
34
34
  */
35
35
  static propTypes: {
36
36
  accessKey: PropTypes.Requireable<string>;
37
- primary: PropTypes.Requireable<boolean>;
38
37
  onFocus: PropTypes.Requireable<(...args: any[]) => any>;
39
38
  onBlur: PropTypes.Requireable<(...args: any[]) => any>;
40
39
  onItemClick: PropTypes.Requireable<(...args: any[]) => any>;
@@ -50,7 +49,6 @@ export default class DropDownButton extends React.Component<DropDownButtonProps,
50
49
  popupSettings: PropTypes.Requireable<object>;
51
50
  itemRender: PropTypes.Requireable<(...args: any[]) => any>;
52
51
  item: PropTypes.Requireable<(...args: any[]) => any>;
53
- look: PropTypes.Requireable<string>;
54
52
  className: PropTypes.Requireable<string>;
55
53
  buttonClass: PropTypes.Requireable<string>;
56
54
  dir: PropTypes.Requireable<string>;
@@ -86,8 +84,8 @@ export default class DropDownButton extends React.Component<DropDownButtonProps,
86
84
  */
87
85
  readonly element: HTMLButtonElement | null;
88
86
  private onKeyDown;
89
- private onFocus;
90
- private onBlur;
87
+ private handleFocus;
88
+ private handleBlur;
91
89
  private onItemClick;
92
90
  private onItemDown;
93
91
  private mouseDown;
@@ -25,7 +25,7 @@ var __assign = (this && this.__assign) || function () {
25
25
  import * as React from 'react';
26
26
  import * as PropTypes from 'prop-types';
27
27
  import { Button } from './../main';
28
- import { classNames, guid, Keys } from '@progress/kendo-react-common';
28
+ import { classNames, guid, Keys, kendoThemeMaps } from '@progress/kendo-react-common';
29
29
  import { dispatchEvent } from '@progress/kendo-react-common';
30
30
  import navigation from './utils/navigation';
31
31
  import DropDownButtonItem from './DropDownButtonItem';
@@ -111,11 +111,11 @@ var DropDownButton = /** @class */ (function (_super) {
111
111
  }
112
112
  _this.setState(newState);
113
113
  };
114
- _this.onFocus = function (event) {
114
+ _this.handleFocus = function (event) {
115
115
  _this.setState({ focused: true, focusedIndex: _this.opened ? 0 : -1 });
116
116
  dispatchEvent(_this.props.onFocus, event, _this, undefined);
117
117
  };
118
- _this.onBlur = function (event) {
118
+ _this.handleBlur = function (event) {
119
119
  _this.setState({ focused: false, opened: false, focusedIndex: -1 });
120
120
  dispatchEvent(_this.props.onBlur, event, _this, undefined);
121
121
  var fireCloseEvent = _this.opened;
@@ -174,10 +174,10 @@ var DropDownButton = /** @class */ (function (_super) {
174
174
  React.Children.toArray(this.props.children)
175
175
  .filter(function (child) { return child && child.type === DropDownButtonItem; })
176
176
  .map(function (child) { return child.props; });
177
- return (React.createElement("div", { className: classNames('k-widget', 'k-dropdown-button', this.props.className, {
178
- 'k-state-focused': this.state.focused
179
- }), onKeyDown: this.onKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, dir: dir, ref: function (el) { return _this.wrapper = el; } },
180
- React.createElement(Button, { onClick: this.onClickMainButton, onMouseDown: this.mouseDown, disabled: disabled || undefined, tabIndex: tabIndex, accessKey: this.props.accessKey, icon: this.props.icon, iconClass: this.props.iconClass, className: this.props.buttonClass, imageUrl: this.props.imageUrl, look: this.props.look, primary: this.props.primary, dir: dir, ref: function (btn) { return _this.mainButton = btn && btn.element; }, type: "button", "aria-disabled": disabled, "aria-haspopup": true, "aria-expanded": this.opened, "aria-label": this.props.text + " dropdownbutton", "aria-owns": this.guid, "aria-activedescendant": focusedIndex >= 0 ? this.guid + "-" + focusedIndex : undefined }, this.props.text),
177
+ return (React.createElement("div", { className: classNames('k-dropdown-button', {
178
+ 'k-focus': this.state.focused
179
+ }, this.props.className), onKeyDown: this.onKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, dir: dir, ref: function (el) { return _this.wrapper = el; } },
180
+ React.createElement(Button, { size: this.props.size, shape: this.props.shape, rounded: this.props.rounded, fillMode: this.props.fillMode, themeColor: this.props.themeColor, onClick: this.onClickMainButton, onMouseDown: this.mouseDown, disabled: disabled || undefined, tabIndex: tabIndex, accessKey: this.props.accessKey, icon: this.props.icon, iconClass: this.props.iconClass, className: this.props.buttonClass, imageUrl: this.props.imageUrl, dir: dir, ref: function (btn) { return _this.mainButton = btn && btn.element; }, type: "button", "aria-disabled": disabled, "aria-haspopup": true, "aria-expanded": this.opened, "aria-label": this.props.text + " dropdownbutton", "aria-owns": this.guid, "aria-activedescendant": focusedIndex >= 0 ? this.guid + "-" + focusedIndex : undefined }, this.props.text),
181
181
  this.renderPopup(rtl)));
182
182
  };
183
183
  /**
@@ -217,15 +217,18 @@ var DropDownButton = /** @class */ (function (_super) {
217
217
  }
218
218
  };
219
219
  DropDownButton.prototype.renderPopup = function (rtl) {
220
- var _a = this.props.popupSettings, popupSettings = _a === void 0 ? {} : _a;
221
- return (React.createElement(Popup, { anchor: this.wrapper, show: this.opened, animate: popupSettings.animate, popupClass: classNames('k-list-container k-reset k-group', popupSettings.popupClass), anchorAlign: popupSettings.anchorAlign || getAnchorAlign(rtl), popupAlign: popupSettings.popupAlign || getPopupAlign(rtl), style: rtl ? { direction: 'rtl' } : undefined },
222
- React.createElement("ul", { className: "k-list k-reset", role: "menu", id: this.guid }, this.renderChildItems())));
220
+ var _a;
221
+ var _b = this.props.popupSettings, popupSettings = _b === void 0 ? {} : _b;
222
+ return (React.createElement(Popup, { anchor: this.wrapper, show: this.opened, animate: popupSettings.animate, popupClass: classNames('k-menu-popup', popupSettings.popupClass), anchorAlign: popupSettings.anchorAlign || getAnchorAlign(rtl), popupAlign: popupSettings.popupAlign || getPopupAlign(rtl), style: rtl ? { direction: 'rtl' } : undefined },
223
+ React.createElement("ul", { role: "menu", id: this.guid, className: classNames('k-group k-menu-group k-reset', (_a = {},
224
+ _a["k-menu-group-" + (kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
225
+ _a)) }, this.renderChildItems())));
223
226
  };
224
227
  DropDownButton.prototype.renderChildItems = function () {
225
228
  var _this = this;
226
229
  var _a = this.props, item = _a.item, itemRender = _a.itemRender, textField = _a.textField;
227
230
  return this.buttonsData.length > 0 ? (this.buttonsData.map(function (dataItem, index) {
228
- return (React.createElement(ButtonItem, { dataItem: dataItem, textField: textField, focused: _this.state.focusedIndex === index, onClick: _this.onItemClick, onDown: _this.onItemDown, render: itemRender, item: item, index: index, key: index, id: _this.guid + "-" + index }));
231
+ return (React.createElement(ButtonItem, { className: "k-menu-item", dataItem: dataItem, textField: textField, focused: _this.state.focusedIndex === index, onClick: _this.onItemClick, onDown: _this.onItemDown, render: itemRender, item: item, index: index, key: index, id: _this.guid + "-" + index }));
229
232
  })) : null;
230
233
  };
231
234
  DropDownButton.prototype.isItemDisabled = function (index) {
@@ -240,7 +243,6 @@ var DropDownButton = /** @class */ (function (_super) {
240
243
  */
241
244
  DropDownButton.propTypes = {
242
245
  accessKey: PropTypes.string,
243
- primary: PropTypes.bool,
244
246
  onFocus: PropTypes.func,
245
247
  onBlur: PropTypes.func,
246
248
  onItemClick: PropTypes.func,
@@ -256,7 +258,6 @@ var DropDownButton = /** @class */ (function (_super) {
256
258
  popupSettings: PropTypes.object,
257
259
  itemRender: PropTypes.func,
258
260
  item: PropTypes.func,
259
- look: PropTypes.string,
260
261
  className: PropTypes.string,
261
262
  buttonClass: PropTypes.string,
262
263
  dir: PropTypes.string
@@ -51,7 +51,6 @@ export default class SplitButton extends React.Component<SplitButtonProps, Split
51
51
  popupSettings: PropTypes.Requireable<object>;
52
52
  itemRender: PropTypes.Requireable<any>;
53
53
  item: PropTypes.Requireable<(...args: any[]) => any>;
54
- look: PropTypes.Requireable<string>;
55
54
  className: PropTypes.Requireable<string>;
56
55
  buttonClass: PropTypes.Requireable<string>;
57
56
  dir: PropTypes.Requireable<string>;
@@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || (function () {
14
14
  import * as React from 'react';
15
15
  import * as PropTypes from 'prop-types';
16
16
  import { Button } from './../main';
17
- import { classNames, guid, Keys } from '@progress/kendo-react-common';
17
+ import { classNames, guid, kendoThemeMaps, Keys } from '@progress/kendo-react-common';
18
18
  import { dispatchEvent } from '@progress/kendo-react-common';
19
19
  import ButtonItem from './ButtonItem';
20
20
  import SplitButtonItem from './SplitButtonItem';
@@ -23,8 +23,6 @@ import { Popup } from '@progress/kendo-react-popup';
23
23
  import { getAnchorAlign, getPopupAlign } from './utils/popup';
24
24
  import { validatePackage } from '@progress/kendo-react-common';
25
25
  import { packageMetadata } from '../package-metadata';
26
- import util from '../util';
27
- var styles = util.styles;
28
26
  /**
29
27
  * Represents the [KendoReact SplitButton component]({% slug overview_splitbutton %}).
30
28
  *
@@ -184,11 +182,11 @@ var SplitButton = /** @class */ (function (_super) {
184
182
  var dir = rtl ? 'rtl' : undefined;
185
183
  var _a = this.props, tabIndex = _a.tabIndex, disabled = _a.disabled;
186
184
  var focusedIndex = this.state.focusedIndex;
187
- return (React.createElement("div", { className: classNames('k-widget', 'k-split-button', 'k-button-group', [styles["" + this.props.look]], {
188
- 'k-state-focused': this.state.focused
189
- }, this.props.className), onKeyDown: this.onKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, dir: dir, ref: function (el) { return _this.wrapper = el; } },
190
- React.createElement(Button, { onClick: function (event) { return _this.onItemClick(event, -1); }, disabled: disabled || undefined, tabIndex: tabIndex, accessKey: this.props.accessKey, className: this.props.buttonClass, icon: this.props.icon, iconClass: this.props.iconClass, imageUrl: this.props.imageUrl, look: this.props.look, dir: dir, ref: function (el) { return _this.mainButton = el && el.element; }, type: "button", "aria-disabled": disabled, "aria-haspopup": true, "aria-expanded": this.opened, "aria-label": this.props.text + " splitbutton", "aria-owns": this.guid, "aria-activedescendant": focusedIndex >= 0 ? this.guid + "-" + focusedIndex : undefined }, this.props.text),
191
- React.createElement(Button, { icon: "arrow-s", disabled: disabled || undefined, tabIndex: -1, look: this.props.look, onClick: this.onSplitPartClick, onMouseDown: this.onDownSplitPart, onPointerDown: this.onDownSplitPart, dir: dir, "aria-label": "menu toggling button" }),
185
+ return (React.createElement("div", { className: classNames('k-split-button', 'k-button-group', {
186
+ 'k-focus': this.state.focused
187
+ }, "k-rounded-" + kendoThemeMaps.roundedMap[this.props.rounded || 'medium'], this.props.className), onKeyDown: this.onKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, dir: dir, ref: function (el) { return _this.wrapper = el; } },
188
+ React.createElement(Button, { size: this.props.size, rounded: this.props.rounded, fillMode: this.props.fillMode, themeColor: this.props.themeColor, onClick: function (event) { return _this.onItemClick(event, -1); }, disabled: disabled || undefined, tabIndex: tabIndex, accessKey: this.props.accessKey, className: this.props.buttonClass, icon: this.props.icon, iconClass: this.props.iconClass, imageUrl: this.props.imageUrl, dir: dir, ref: function (el) { return _this.mainButton = el && el.element; }, type: "button", "aria-disabled": disabled, "aria-haspopup": true, "aria-expanded": this.opened, "aria-label": this.props.text + " splitbutton", "aria-owns": this.guid, "aria-activedescendant": focusedIndex >= 0 ? this.guid + "-" + focusedIndex : undefined }, this.props.text),
189
+ React.createElement(Button, { size: this.props.size, rounded: this.props.rounded, fillMode: this.props.fillMode, themeColor: this.props.themeColor, icon: "arrow-s", disabled: disabled || undefined, tabIndex: -1, onClick: this.onSplitPartClick, onMouseDown: this.onDownSplitPart, onPointerDown: this.onDownSplitPart, dir: dir, "aria-label": "menu toggling button" }),
192
190
  this.renderPopup(rtl)));
193
191
  };
194
192
  /**
@@ -224,15 +222,18 @@ var SplitButton = /** @class */ (function (_super) {
224
222
  }
225
223
  };
226
224
  SplitButton.prototype.renderPopup = function (rtl) {
227
- var _a = this.props.popupSettings, popupSettings = _a === void 0 ? {} : _a;
228
- return (React.createElement(Popup, { anchor: this.wrapper, show: this.opened, animate: popupSettings.animate, popupClass: classNames('k-list-container k-reset k-group', popupSettings.popupClass), anchorAlign: popupSettings.anchorAlign || getAnchorAlign(rtl), popupAlign: popupSettings.popupAlign || getPopupAlign(rtl), style: rtl ? { direction: 'rtl' } : undefined },
229
- React.createElement("ul", { className: "k-list k-reset", role: "menu", id: this.guid }, this.renderChildItems())));
225
+ var _a;
226
+ var _b = this.props.popupSettings, popupSettings = _b === void 0 ? {} : _b;
227
+ return (React.createElement(Popup, { anchor: this.wrapper, show: this.opened, animate: popupSettings.animate, popupClass: classNames('k-menu-popup', popupSettings.popupClass), anchorAlign: popupSettings.anchorAlign || getAnchorAlign(rtl), popupAlign: popupSettings.popupAlign || getPopupAlign(rtl), style: rtl ? { direction: 'rtl' } : undefined },
228
+ React.createElement("ul", { role: "menu", id: this.guid, className: classNames('k-group k-menu-group k-reset', (_a = {},
229
+ _a["k-menu-group-" + (kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
230
+ _a)) }, this.renderChildItems())));
230
231
  };
231
232
  SplitButton.prototype.renderChildItems = function () {
232
233
  var _this = this;
233
234
  var _a = this.props, item = _a.item, itemRender = _a.itemRender, textField = _a.textField;
234
235
  return this.buttonsData.length > 0 ? (this.buttonsData.map(function (dataItem, index) {
235
- return (React.createElement(ButtonItem, { dataItem: dataItem, textField: textField, focused: _this.state.focusedIndex === index, onClick: _this.onItemClick, onDown: _this.onItemDown, render: itemRender, item: item, key: index, index: index, id: _this.guid + "-" + index }));
236
+ return (React.createElement(ButtonItem, { className: "k-menu-item", dataItem: dataItem, textField: textField, focused: _this.state.focusedIndex === index, onClick: _this.onItemClick, onDown: _this.onItemDown, render: itemRender, item: item, key: index, index: index, id: _this.guid + "-" + index }));
236
237
  })) : null;
237
238
  };
238
239
  SplitButton.prototype.isItemDisabled = function (index) {
@@ -264,7 +265,6 @@ var SplitButton = /** @class */ (function (_super) {
264
265
  popupSettings: PropTypes.object,
265
266
  itemRender: PropTypes.any,
266
267
  item: PropTypes.func,
267
- look: PropTypes.string,
268
268
  className: PropTypes.string,
269
269
  buttonClass: PropTypes.string,
270
270
  dir: PropTypes.string