mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-07 10:57:19 +00:00
feat: 补充物料协议
This commit is contained in:
parent
820f8c046c
commit
0ac42471c8
@ -1,10 +1,9 @@
|
||||
import { NpmInfo } from './npm';
|
||||
import { PropConfig } from './prop-config';
|
||||
import { Snippet, ComponentMetadata } from './metadata';
|
||||
import { I18nData } from './i18n';
|
||||
|
||||
/**
|
||||
* 定义组件大包及external资源的信息,应该被编辑器默认加载
|
||||
* 定义组件大包及 external 资源的信息
|
||||
* 应该被编辑器默认加载
|
||||
*/
|
||||
export interface Package {
|
||||
/**
|
||||
@ -39,6 +38,7 @@ export interface Package {
|
||||
|
||||
/**
|
||||
* 组件分类
|
||||
* @deprecated 已被 ComponentMetadata 替代
|
||||
*/
|
||||
export interface ComponentCategory {
|
||||
/**
|
||||
@ -57,6 +57,7 @@ export interface ComponentCategory {
|
||||
|
||||
/**
|
||||
* 组件
|
||||
* @deprecated 已被 ComponentMetadata 替代
|
||||
*/
|
||||
export interface ComponentItem {
|
||||
/**
|
||||
|
||||
@ -3,6 +3,9 @@ import { SetterType, DynamicSetter } from './setter-config';
|
||||
import { SettingTarget } from './setting-target';
|
||||
import { LiveTextEditingConfig } from './metadata';
|
||||
|
||||
/**
|
||||
* extra props for field
|
||||
*/
|
||||
export interface FieldExtraProps {
|
||||
/**
|
||||
* 是否必填参数
|
||||
@ -16,6 +19,9 @@ export interface FieldExtraProps {
|
||||
* get value for field
|
||||
*/
|
||||
getValue?: (target: SettingTarget, fieldValue: any) => any;
|
||||
/**
|
||||
* set value for field
|
||||
*/
|
||||
setValue?: (target: SettingTarget, value: any) => void;
|
||||
/**
|
||||
* the field conditional show, is not set always true
|
||||
@ -84,6 +90,7 @@ export interface FieldConfig extends FieldExtraProps {
|
||||
items?: FieldConfig[];
|
||||
/**
|
||||
* extra props for field
|
||||
* 其他配置属性(不做流通要求)
|
||||
*/
|
||||
extraProps?: FieldExtraProps;
|
||||
/**
|
||||
|
||||
@ -51,6 +51,7 @@ export interface NodeSchema {
|
||||
*/
|
||||
isLocked?: boolean;
|
||||
|
||||
// @todo
|
||||
// ------- future support -----
|
||||
conditionGroup?: string;
|
||||
title?: string;
|
||||
|
||||
@ -15,10 +15,12 @@ export type CustomView = ReactElement | ComponentType<any>;
|
||||
export type DynamicProps = (target: SettingTarget) => Record<string, unknown>;
|
||||
export type DynamicSetter = (target: SettingTarget) => string | SetterConfig | CustomView;
|
||||
|
||||
/**
|
||||
* 设置器配置
|
||||
* @todo
|
||||
*/
|
||||
export interface SetterConfig {
|
||||
/**
|
||||
* if *string* passed must be a registered Setter Name
|
||||
*/
|
||||
// if *string* passed must be a registered Setter Name
|
||||
componentName: string | CustomView;
|
||||
/**
|
||||
* the props pass to Setter Component
|
||||
@ -27,15 +29,13 @@ export interface SetterConfig {
|
||||
children?: any;
|
||||
isRequired?: boolean;
|
||||
initialValue?: any | ((target: SettingTarget) => any);
|
||||
/* for MixedSetter */
|
||||
// for MixedSetter
|
||||
title?: TitleContent;
|
||||
// for MixedSetter check this is available
|
||||
condition?: (target: SettingTarget) => boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* if *string* passed must be a registered Setter Name, future support blockSchema
|
||||
*/
|
||||
// if *string* passed must be a registered Setter Name, future support blockSchema
|
||||
export type SetterType = SetterConfig | SetterConfig[] | string | CustomView;
|
||||
|
||||
export function isSetterConfig(obj: any): obj is SetterConfig {
|
||||
|
||||
@ -13,7 +13,9 @@ export interface JSExpression {
|
||||
* 模拟值
|
||||
*/
|
||||
mock?: any;
|
||||
/** 源码 */
|
||||
/**
|
||||
* 源码
|
||||
*/
|
||||
compiled?: string;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user