UNPKG

@fluentui/react

Version:

Reusable React components for building web experiences.

35 lines 1.79 kB
define(["require", "exports", "tslib", "react", "../../Utilities"], function (require, exports, tslib_1, React, Utilities_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OverlayBase = void 0; var getClassNames = (0, Utilities_1.classNamesFunction)(); var OverlayBase = /** @class */ (function (_super) { tslib_1.__extends(OverlayBase, _super); function OverlayBase(props) { var _this = _super.call(this, props) || this; (0, Utilities_1.initializeComponentRef)(_this); var _a = _this.props.allowTouchBodyScroll, allowTouchBodyScroll = _a === void 0 ? false : _a; _this._allowTouchBodyScroll = allowTouchBodyScroll; return _this; } OverlayBase.prototype.componentDidMount = function () { !this._allowTouchBodyScroll && (0, Utilities_1.disableBodyScroll)(); }; OverlayBase.prototype.componentWillUnmount = function () { !this._allowTouchBodyScroll && (0, Utilities_1.enableBodyScroll)(); }; OverlayBase.prototype.render = function () { var _a = this.props, isDark = _a.isDarkThemed, className = _a.className, theme = _a.theme, styles = _a.styles; var divProps = (0, Utilities_1.getNativeProps)(this.props, Utilities_1.divProperties); var classNames = getClassNames(styles, { theme: theme, className: className, isDark: isDark, }); return React.createElement("div", tslib_1.__assign({}, divProps, { className: classNames.root })); }; return OverlayBase; }(React.Component)); exports.OverlayBase = OverlayBase; }); //# sourceMappingURL=Overlay.base.js.map