UNPKG

@mijadesign/mjui-react-taro

Version:

京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序

18 lines (17 loc) 1.18 kB
import { _ as __rest } from "./tslib.es6-iWu3F_1J.js"; import { a } from "./Close-DVjd2R_0.js"; /* empty css */ import { Popup as Popup$1 } from "@nutui/nutui-react-taro"; import { pxTransform } from "@tarojs/taro"; import classNames from "classnames"; import React from "react"; import { g as getHeaderHeight } from "./index-akbK29uE.js"; const Popup = (props) => { const { className, style, round = true, closeIconPosition = "top-right", customHeader = false, position = "center", closeIcon = React.createElement(a, null), lockScroll = true, scrollProps } = props, rest = __rest(props, ["className", "style", "round", "closeIconPosition", "customHeader", "position", "closeIcon", "lockScroll", "scrollProps"]); const headerHeight = getHeaderHeight(); const _style = ["top", "bottom"].includes(position) && !!customHeader ? Object.assign(Object.assign({}, style), { maxHeight: `calc((100% - ${pxTransform(headerHeight)}) * 0.8)` }) : style; return React.createElement(Popup$1, Object.assign({ className: classNames("mj-popup", className), style: _style, round, closeIcon, closeIconPosition, position, lockScroll }, rest)); }; export { Popup as P };