1 | import { __assign, __extends } from "tslib";
|
2 | import * as React from 'react';
|
3 | import { warn } from '../../Utilities';
|
4 | import { ButtonType } from './Button.types';
|
5 | import { DefaultButton } from './DefaultButton/DefaultButton';
|
6 | import { ActionButton } from './ActionButton/ActionButton';
|
7 | import { CompoundButton } from './CompoundButton/CompoundButton';
|
8 | import { IconButton } from './IconButton/IconButton';
|
9 | import { PrimaryButton } from './PrimaryButton/PrimaryButton';
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | var Button = (function (_super) {
|
16 | __extends(Button, _super);
|
17 | function Button(props) {
|
18 | var _this = _super.call(this, props) || this;
|
19 | warn("The Button component has been deprecated. Use specific variants instead. " +
|
20 | "(PrimaryButton, DefaultButton, IconButton, ActionButton, etc.)");
|
21 | return _this;
|
22 | }
|
23 | Button.prototype.render = function () {
|
24 | var props = this.props;
|
25 |
|
26 | switch (props.buttonType) {
|
27 | case ButtonType.command:
|
28 | return React.createElement(ActionButton, __assign({}, props));
|
29 | case ButtonType.compound:
|
30 | return React.createElement(CompoundButton, __assign({}, props));
|
31 | case ButtonType.icon:
|
32 | return React.createElement(IconButton, __assign({}, props));
|
33 | case ButtonType.primary:
|
34 | return React.createElement(PrimaryButton, __assign({}, props));
|
35 | default:
|
36 | return React.createElement(DefaultButton, __assign({}, props));
|
37 | }
|
38 | };
|
39 | return Button;
|
40 | }(React.Component));
|
41 | export { Button };
|
42 |
|
\ | No newline at end of file |