| | |
| | | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | let options = ['width', 'height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'position', 'transform'] |
| | | |
| | | MKEmitter.emit('changeStyle', ['width', 'height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'position', 'transform'], card.style, this.getStyle) |
| | | if (card.style && !card.style.width) { |
| | | if (card.style.height) { |
| | | options = ['height', 'width', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'position', 'transform'] |
| | | } else if (card.style.position && ['fixed', 'absolute'].includes(card.style.position)) { |
| | | options = ['position', 'width', 'height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'transform'] |
| | | } |
| | | } |
| | | |
| | | MKEmitter.emit('changeStyle', options, card.style, this.getStyle) |
| | | } |
| | | |
| | | getStyle = (style) => { |
| | |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="menu-balcony-edit-box" style={_style} id={card.uuid}> |
| | | <div className={'menu-balcony-edit-box' + (['fixed', 'absolute'].includes(_style.position) ? ' ctrl-position' : '')} style={_style} id={card.uuid}> |
| | | {card.style.height ? <ColumnHeightOutlined className="fixed-height" title="定高" /> : null} |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | color: orange; |
| | | } |
| | | } |
| | | .menu-balcony-edit-box.ctrl-position { |
| | | width: auto!important; |
| | | height: auto!important; |
| | | } |
| | | .menu-balcony-edit-box::after { |
| | | display: block; |
| | | content: ' '; |
| | |
| | | padding: 5px; |
| | | background: rgba(255, 255, 255, 0.55); |
| | | } |
| | | .empty-content { |
| | | text-align: center; |
| | | font-size: 30px; |
| | | margin: 0; |
| | | line-height: 90px; |
| | | color: #bcbcbc; |
| | | } |
| | | } |
| | | .menu-editor-sand-box::after { |
| | | display: block; |
| | |
| | | } trigger="hover"> |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | <BraftContent value={card.wrap.datatype !== 'static' ? '<p class="empty-content">富文本</p>' : card.html}/> |
| | | <BraftContent value={card.wrap.datatype !== 'static' ? '<p class="empty-content"><span>富文本<span>字符替换:空格(blank_space_**),其中**代表空格数。 </span></span></p>' : card.html}/> |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | | <div className="title">{card.name}</div> |
| | |
| | | background: rgba(255, 255, 255, 0.55); |
| | | } |
| | | .empty-content { |
| | | text-align: center; |
| | | font-size: 30px; |
| | | margin: 0; |
| | | line-height: 90px; |
| | | height: 90px; |
| | | color: #bcbcbc; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | overflow: hidden; |
| | | |
| | | span { |
| | | display: inline-block; |
| | | text-align: center; |
| | | span { |
| | | display: block; |
| | | font-size: 14px; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | white-space: nowrap; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .menu-normal-editor-box.th-light { |
| | |
| | | padding: 5px; |
| | | background: rgba(255, 255, 255, 0.55); |
| | | } |
| | | .empty-content { |
| | | text-align: center; |
| | | font-size: 30px; |
| | | margin: 0; |
| | | line-height: 90px; |
| | | color: #bcbcbc; |
| | | } |
| | | .model-menu-action-list:not(.length0) { |
| | | margin: 10px 0px; |
| | | } |
| | |
| | | } else { |
| | | _data = [_data] |
| | | } |
| | | } else if (config.html) { |
| | | if (/blank_space_\d+/ig.test(config.html)) { |
| | | config.html = config.html.replace(/blank_space_\d+/ig, (w) => { |
| | | let n = +w.replace(/blank_space_/ig, '') |
| | | if (n) { |
| | | return new Array(n).fill(' ').join('') |
| | | } |
| | | |
| | | return w |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (_config.wrap.minHeight) { |
| | |
| | | item.$html = item.$html.replace(reg, item[key]) |
| | | }) |
| | | } |
| | | |
| | | if (/blank_space_\d+/ig.test(item.$html)) { |
| | | item.$html = item.$html.replace(/blank_space_\d+/ig, (w) => { |
| | | let n = +w.replace(/blank_space_/ig, '') |
| | | if (n) { |
| | | return new Array(n).fill(' ').join('') |
| | | } |
| | | |
| | | return w |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | |