UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

29 lines 1.42 kB
import * as tslib_1 from "tslib"; import * as React from 'react'; import { classNamesFunction, BaseComponent, KeyCodes } from '../../../Utilities'; import { CardCallout } from '../CardCallout/CardCallout'; var getClassNames = classNamesFunction(); var PlainCardBase = /** @class */ (function (_super) { tslib_1.__extends(PlainCardBase, _super); function PlainCardBase() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._onKeyDown = function (ev) { if (ev.which === KeyCodes.escape) { _this.props.onLeave && _this.props.onLeave(ev); } }; return _this; } PlainCardBase.prototype.render = function () { var _a = this.props, styles = _a.styles, theme = _a.theme, className = _a.className; this._classNames = getClassNames(styles, { theme: theme, className: className }); var content = (React.createElement("div", { onMouseEnter: this.props.onEnter, onMouseLeave: this.props.onLeave, onKeyDown: this._onKeyDown }, this.props.onRenderPlainCard(this.props.renderData))); return React.createElement(CardCallout, tslib_1.__assign({}, this.props, { content: content, className: this._classNames.root })); }; return PlainCardBase; }(BaseComponent)); export { PlainCardBase }; //# sourceMappingURL=PlainCard.base.js.map