feat: the advanced.autoruns parameter uses a shell wrapper

This commit is contained in:
liujuping 2023-01-30 11:13:40 +08:00 committed by 林熠
parent 6482609ac1
commit 5cf395957c
3 changed files with 29 additions and 3 deletions

View File

@ -27,6 +27,7 @@ import { ExclusiveGroup, isExclusiveGroup } from './exclusive-group';
import { includeSlot, removeSlot } from '../../utils/slot';
import { foreachReverse } from '../../utils/tree';
import { NodeRemoveOptions, EDITOR_EVENT } from '../../types';
import { Prop as ShellProp } from '@alilc/lowcode-shell';
export interface NodeStatus {
locking: boolean;
@ -376,7 +377,7 @@ export class Node<Schema extends IPublicTypeNodeSchema = IPublicTypeNodeSchema>
}
this.autoruns = autoruns.map((item) => {
return autorun(() => {
item.autorun(this.props.get(item.name, true) as any);
item.autorun(ShellProp.create(this.props.get(item.name, true))!);
});
});
}

View File

@ -44,6 +44,8 @@ export interface IProps extends Omit<IPublicModelProps, 'getProp' | 'getExtraPro
getNode(): INode;
getProp(path: string): IProp | null;
get(path: string, createIfNone: boolean): Prop;
}
export class Props implements IProps, IPropParent {

View File

@ -1,31 +1,37 @@
import { IPublicTypePropType, IPublicTypeComponentAction } from './';
import { IPublicModelSettingTarget } from '../model';
import { IPublicModelProp, IPublicModelSettingTarget } from '../model';
/**
*
*/
export type IPublicTypeNestingFilter = (testNode: any, currentNode: any) => boolean;
/**
*
* a a, FormField Form Column Table
*/
export interface IPublicTypeNestingRule {
/**
*
*/
childWhitelist?: string[] | string | RegExp | IPublicTypeNestingFilter;
/**
*
*/
parentWhitelist?: string[] | string | RegExp | IPublicTypeNestingFilter;
/**
*
*/
descendantWhitelist?: string[] | string | RegExp | IPublicTypeNestingFilter;
/**
*
*/
descendantBlacklist?: string[] | string | RegExp | IPublicTypeNestingFilter;
/**
*
*/
@ -36,22 +42,27 @@ export interface IPublicTypeNestingRule {
*
*/
export interface IPublicTypeComponentConfigure {
/**
*
*/
isContainer?: boolean;
/**
*
*/
isModal?: boolean;
/**
*
*/
isNullNode?: boolean;
/**
*
*/
descriptor?: string;
/**
*
* a a, FormField Form Column Table
@ -68,10 +79,12 @@ export interface IPublicTypeComponentConfigure {
* cssSelector
*/
rootSelector?: string;
/**
* `'copy'`, `'move'`, `'remove'`
*/
disableBehaviors?: string[] | string;
/**
*
*/
@ -88,7 +101,7 @@ export interface IPublicTypeFilterItem {
}
export interface IPublicTypeAutorunItem {
name: string;
autorun: (target: IPublicModelSettingTarget) => any;
autorun: (prop: IPublicModelProp) => any;
}
// thinkof Array
@ -96,19 +109,23 @@ export interface IPublicTypeAutorunItem {
* Live Text Editing children
*/
export interface IPublicTypeLiveTextEditingConfig {
/**
* @todo
*/
propTarget: string;
/**
* @todo
*/
selector?: string;
/**
* | |
* @default 'plaintext'
*/
mode?: 'plaintext' | 'paragraph' | 'article';
/**
* contentEditable
*/
@ -125,27 +142,33 @@ export type ConfigureSupportEvent = string | {
*
*/
export interface ConfigureSupport {
/**
*
*/
events?: ConfigureSupportEvent[];
/**
* className
*/
className?: boolean;
/**
*
*/
style?: boolean;
/**
*
*/
lifecycles?: any[];
// general?: boolean;
/**
*
*/
loop?: boolean;
/**
*
*/