UNPKG

jjb-lc-designable

Version:

基于alibaba-designable源码二次封装的表单设计器。

41 lines 1.67 kB
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } import React from 'react'; import { usePrefix, usePosition } from '../hooks'; import { Layout } from '../containers'; import cls from 'classnames'; const StudioPanelInternal = ({ logo, actions, ...props }) => { const prefix = usePrefix('main-panel'); const position = usePosition(); const classNameBase = cls('root', position, props.className); if (logo || actions) { return /*#__PURE__*/React.createElement("div", _extends({}, props, { className: cls(`${prefix}-container`, classNameBase) }), /*#__PURE__*/React.createElement("div", { className: prefix + '-header' }, /*#__PURE__*/React.createElement("div", { className: prefix + '-header-logo' }, logo), /*#__PURE__*/React.createElement("div", { className: prefix + '-header-actions' }, actions)), /*#__PURE__*/React.createElement("div", { className: prefix }, props.children)); } return /*#__PURE__*/React.createElement("div", _extends({}, props, { className: cls(prefix, classNameBase) }), props.children); }; export const StudioPanel = props => { return ( /*#__PURE__*/ // @ts-ignore React.createElement(Layout, { theme: props.theme, prefixCls: props.prefixCls, position: props.position }, /*#__PURE__*/React.createElement(StudioPanelInternal, props)) ); };