fastlion-amis
Version:
一种MIS页面生成工具
29 lines (28 loc) • 1.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Drawer = void 0;
var tslib_1 = require("tslib");
var antd_1 = require("antd");
var react_1 = tslib_1.__importDefault(require("react"));
var shell_1 = require("../../utils/shell");
var helper_1 = require("../../utils/helper");
var tools_1 = require("../../utils/shell/tools");
// 苹果安全区高度
var IOSSAFEAREAHIGH = 32;
// Drawer代理-方便统一修改antd的参数
var Drawer = function (props) {
var _a, _b;
// 所有高度都走一遍这个设置-方便后续统一修改-移动端会自动加上这个高度
var newProps = tslib_1.__assign({}, props);
var isIOS = !shell_1.Shell.hasShell() && (0, helper_1.isMobile)() && !tools_1.tools.isAndroid;
// ios 弹窗特殊处理
if (isIOS) {
newProps.height = "calc(".concat(newProps.height || '100%', " - ").concat(IOSSAFEAREAHIGH, "px)");
if (!((_a = newProps === null || newProps === void 0 ? void 0 : newProps.style) === null || _a === void 0 ? void 0 : _a.bottom) && !((_b = newProps === null || newProps === void 0 ? void 0 : newProps.style) === null || _b === void 0 ? void 0 : _b.top))
//移动端 调整底部设置
newProps.style = { bottom: IOSSAFEAREAHIGH, top: -IOSSAFEAREAHIGH };
}
return react_1.default.createElement(antd_1.Drawer, tslib_1.__assign({}, newProps));
};
exports.Drawer = Drawer;
//# sourceMappingURL=./components/antdComponentsProxy/index.js.map