mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
Merge branch 'fix/minor-bugs-lianjie.lj' into 'release/0.9.13'
fix(editor-skeleton): add canSetFixed prop to panel config See merge request !951079
This commit is contained in:
commit
4f426f29d6
@ -68,7 +68,7 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
||||
newConfig.type = 'PanelDock';
|
||||
newConfig.area = 'left';
|
||||
newConfig.props.description = description || title;
|
||||
const { contents, hideTitleBar, tip, width, maxWidth, height, maxHeight, menu, isAction } = config;
|
||||
const { contents, hideTitleBar, tip, width, maxWidth, height, maxHeight, menu, isAction, canSetFixed } = config;
|
||||
if (menu) {
|
||||
newConfig.props.title = menu;
|
||||
}
|
||||
@ -83,6 +83,7 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
||||
maxWidth,
|
||||
height,
|
||||
maxHeight,
|
||||
canSetFixed,
|
||||
onInit: init,
|
||||
onDestroy: destroy,
|
||||
};
|
||||
|
||||
@ -91,6 +91,7 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
area.skeleton.leftFloatArea.remove(current);
|
||||
area.skeleton.leftFixedArea.add(current);
|
||||
area.skeleton.leftFixedArea.container.active(current);
|
||||
@ -99,6 +100,12 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
|
||||
render() {
|
||||
const { area } = this.props;
|
||||
const width = area.current?.config.props?.width;
|
||||
// can be set fixed by default
|
||||
let canSetFixed = true;
|
||||
if (area.current?.config.props?.canSetFixed === false) {
|
||||
canSetFixed = false;
|
||||
}
|
||||
|
||||
const hideTitleBar = area.current?.config.props?.hideTitleBar;
|
||||
const style = width ? {
|
||||
width
|
||||
@ -114,13 +121,17 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
|
||||
{
|
||||
!hideTitleBar && (
|
||||
<Fragment>
|
||||
<Button
|
||||
text
|
||||
className="lc-pane-icon-fix"
|
||||
onClick={this.setFixed.bind(this)}
|
||||
>
|
||||
<IconFix />
|
||||
</Button>
|
||||
{
|
||||
canSetFixed && (
|
||||
<Button
|
||||
text
|
||||
className="lc-pane-icon-fix"
|
||||
onClick={this.setFixed.bind(this)}
|
||||
>
|
||||
<IconFix />
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
<Button
|
||||
text
|
||||
className="lc-pane-icon-close"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user