joint trunk-pane

This commit is contained in:
kangwei 2020-04-22 14:42:27 +08:00
parent f15c0ad0ff
commit a21490a379
5 changed files with 26 additions and 6 deletions

View File

@ -488,6 +488,9 @@ export class Node {
insertBefore(node: Node, ref?: Node) {
this.children?.insert(node, ref ? ref.index : null);
}
insertAfter(node: Node, ref?: Node) {
this.children?.insert(node, ref ? (ref.index + 1) : null);
}
getParent() {
return this.parent;
}

View File

@ -1,5 +1,5 @@
import { I18nData } from './i18n';
import { ReactNode, ReactElement } from 'react';
import { ReactNode } from 'react';
export interface TipConfig {
className?: string;
@ -8,4 +8,4 @@ export interface TipConfig {
direction?: 'top' | 'bottom' | 'left' | 'right';
}
export type TipContent = string | I18nData | ReactElement | TipConfig;
export type TipContent = string | I18nData | ReactNode | TipConfig;

View File

@ -58,7 +58,7 @@ const builtinSetters = {
DateRangeSetter,
EventsSetter,
// StyleSetter,
ColorSetter,
// ColorSetter,
JsonSetter,
};

View File

@ -10,10 +10,27 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
shouldComponentUpdate() {
return false;
}
private dispose?: () => void;
componentDidMount() {
const { area } = this.props;
const triggerClose = () => area.setVisible(false);
area.skeleton.editor.on('designer.dragstart', triggerClose);
this.dispose = () => {
area.skeleton.editor.removeListener('designer.dragstart', triggerClose);
}
}
componentWillUnmount() {
this.dispose?.();
}
render() {
const { area } = this.props;
// TODO: add focusingManager
// TODO: dragstart close
// focusin set focus (push|replace)
// focusout remove focus
// onEsc
return (
<div
className={classNames('lc-left-float-pane', {

View File

@ -1,5 +1,5 @@
import { ReactElement, ComponentType } from 'react';
import { TitleContent, IconType, I18nData } from '@ali/lowcode-globals';
import { TitleContent, IconType, I18nData, TipContent } from '@ali/lowcode-globals';
export interface IWidgetBaseConfig {
type: string;
@ -30,7 +30,7 @@ export interface DockProps {
icon?: IconType;
size?: 'small' | 'medium' | 'large';
className?: string;
description?: string | I18nData;
description?: TipContent;
onClick?: () => void;
}