UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

55 lines (51 loc) 1.98 kB
import _extends from "@babel/runtime/helpers/extends"; import _objectSpread from "@babel/runtime/helpers/objectSpread2"; import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; import _regeneratorRuntime from "@babel/runtime/regenerator"; import React from 'react'; import ModalManager from '../modal-manager'; import { getContainer, open } from '../modal-container/ModalContainer'; import PictureViewer from '../picture/PictureViewer'; export default function preview(_x, _x2) { return _preview.apply(this, arguments); } function _preview() { _preview = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(props, modalProps) { var container, customizedPrefixCls; return _regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return getContainer(); case 2: container = _context.sent; customizedPrefixCls = container.context.getProPrefixCls('picture-viewer', props.prefixCls); open(_objectSpread({ key: ModalManager.getKey(), className: "".concat(customizedPrefixCls, "-modal"), border: false, header: null, footer: null, destroyOnClose: true, movable: false, closable: true, style: { width: 'auto' }, fullScreen: true, maskClassName: "".concat(customizedPrefixCls, "-modal-mask"), children: /*#__PURE__*/React.createElement(PictureViewer, _extends({ prefixCls: customizedPrefixCls }, props)) }, modalProps)); case 5: case "end": return _context.stop(); } } }, _callee); })); return _preview.apply(this, arguments); } //# sourceMappingURL=preview.js.map