@fluentui/react
Version:
Reusable React components for building web experiences.
34 lines • 1.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PlainCardBase = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../../Utilities");
var CardCallout_1 = require("../CardCallout/CardCallout");
var getClassNames = (0, Utilities_1.classNamesFunction)();
var PlainCardBase = /** @class */ (function (_super) {
tslib_1.__extends(PlainCardBase, _super);
function PlainCardBase(props) {
var _this = _super.call(this, props) || this;
_this._onKeyDown = function (ev) {
// eslint-disable-next-line deprecation/deprecation
if (ev.which === Utilities_1.KeyCodes.escape) {
_this.props.onLeave && _this.props.onLeave(ev);
}
};
(0, Utilities_1.initializeComponentRef)(_this);
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_1.CardCallout, tslib_1.__assign({}, this.props, { content: content, className: this._classNames.root }));
};
return PlainCardBase;
}(React.Component));
exports.PlainCardBase = PlainCardBase;
//# sourceMappingURL=PlainCard.base.js.map