UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

44 lines 1.99 kB
import * as tslib_1 from "tslib"; import * as React from 'react'; import { BaseComponent, warn } from '../../Utilities'; import { ButtonType } from './Button.types'; import { DefaultButton } from './DefaultButton/DefaultButton'; import { ActionButton } from './ActionButton/ActionButton'; import { CompoundButton } from './CompoundButton/CompoundButton'; import { IconButton } from './IconButton/IconButton'; import { PrimaryButton } from './PrimaryButton/PrimaryButton'; /** * This class is deprecated. Use the individual *Button components instead. * @deprecated */ var Button = /** @class */ (function (_super) { tslib_1.__extends(Button, _super); function Button(props) { var _this = _super.call(this, props) || this; /** * Set this BaseComponent._skipComponentRefResolution to true, bypassing resolution of componentRef. */ _this._skipComponentRefResolution = true; warn("The Button component has been deprecated. Use specific variants instead. " + "(PrimaryButton, DefaultButton, IconButton, ActionButton, etc.)"); return _this; } Button.prototype.render = function () { var props = this.props; switch (props.buttonType) { case ButtonType.command: return React.createElement(ActionButton, tslib_1.__assign({}, props)); case ButtonType.compound: return React.createElement(CompoundButton, tslib_1.__assign({}, props)); case ButtonType.icon: return React.createElement(IconButton, tslib_1.__assign({}, props)); case ButtonType.primary: return React.createElement(PrimaryButton, tslib_1.__assign({}, props)); default: return React.createElement(DefaultButton, tslib_1.__assign({}, props)); } }; return Button; }(BaseComponent)); export { Button }; //# sourceMappingURL=Button.js.map