mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:25:48 +00:00
fix: fix build error due to ts definition
This commit is contained in:
parent
d8014c9d1a
commit
93e9b6ee00
@ -3,15 +3,15 @@ import { IComponentMeta } from '../../component-meta';
|
|||||||
import { Designer } from '../designer';
|
import { Designer } from '../designer';
|
||||||
import { INode } from '../../document';
|
import { INode } from '../../document';
|
||||||
|
|
||||||
export interface SettingEntry extends IPublicModelSettingTarget {
|
export interface ISettingEntry extends IPublicModelSettingTarget {
|
||||||
readonly nodes: INode[];
|
readonly nodes: INode[];
|
||||||
readonly componentMeta: IComponentMeta | null;
|
readonly componentMeta: IComponentMeta | null;
|
||||||
readonly designer: Designer;
|
readonly designer: Designer;
|
||||||
|
|
||||||
// 顶端
|
// 顶端
|
||||||
readonly top: SettingEntry;
|
readonly top: ISettingEntry;
|
||||||
// 父级
|
// 父级
|
||||||
readonly parent: SettingEntry;
|
readonly parent: ISettingEntry;
|
||||||
|
|
||||||
get: (propName: string | number) => SettingEntry | null;
|
get: (propName: string | number) => ISettingEntry | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,11 +9,11 @@ import {
|
|||||||
} from '@alilc/lowcode-types';
|
} from '@alilc/lowcode-types';
|
||||||
import { Transducer } from './utils';
|
import { Transducer } from './utils';
|
||||||
import { SettingPropEntry } from './setting-prop-entry';
|
import { SettingPropEntry } from './setting-prop-entry';
|
||||||
import { SettingEntry } from './setting-entry';
|
import { ISettingEntry } from './setting-entry';
|
||||||
import { computed, obx, makeObservable, action, untracked, intl } from '@alilc/lowcode-editor-core';
|
import { computed, obx, makeObservable, action, untracked, intl } from '@alilc/lowcode-editor-core';
|
||||||
import { cloneDeep, isCustomView, isDynamicSetter } from '@alilc/lowcode-utils';
|
import { cloneDeep, isCustomView, isDynamicSetter } from '@alilc/lowcode-utils';
|
||||||
|
|
||||||
function getSettingFieldCollectorKey(parent: SettingEntry, config: IPublicTypeFieldConfig) {
|
function getSettingFieldCollectorKey(parent: ISettingEntry, config: IPublicTypeFieldConfig) {
|
||||||
let cur = parent;
|
let cur = parent;
|
||||||
const path = [config.name];
|
const path = [config.name];
|
||||||
while (cur !== parent.top) {
|
while (cur !== parent.top) {
|
||||||
@ -25,7 +25,11 @@ function getSettingFieldCollectorKey(parent: SettingEntry, config: IPublicTypeFi
|
|||||||
return path.join('.');
|
return path.join('.');
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SettingField extends SettingPropEntry implements SettingEntry {
|
export interface ISettingField extends ISettingEntry {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SettingField extends SettingPropEntry implements ISettingField {
|
||||||
readonly isSettingField = true;
|
readonly isSettingField = true;
|
||||||
|
|
||||||
readonly isRequired: boolean;
|
readonly isRequired: boolean;
|
||||||
@ -36,7 +40,7 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
|||||||
|
|
||||||
private hotValue: any;
|
private hotValue: any;
|
||||||
|
|
||||||
parent: SettingEntry;
|
parent: ISettingEntry;
|
||||||
|
|
||||||
extraProps: IPublicTypeFieldExtraProps;
|
extraProps: IPublicTypeFieldExtraProps;
|
||||||
|
|
||||||
@ -56,7 +60,7 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
|||||||
private _items: Array<SettingField | IPublicTypeCustomView> = [];
|
private _items: Array<SettingField | IPublicTypeCustomView> = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
parent: SettingEntry,
|
parent: ISettingEntry,
|
||||||
config: IPublicTypeFieldConfig,
|
config: IPublicTypeFieldConfig,
|
||||||
private settingFieldCollector?: (name: string | number, field: SettingField) => void,
|
private settingFieldCollector?: (name: string | number, field: SettingField) => void,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -2,13 +2,13 @@ import { obx, computed, makeObservable, runInAction, IEventBus, createModuleEven
|
|||||||
import { GlobalEvent, IPublicModelEditor, IPublicTypeSetValueOptions } from '@alilc/lowcode-types';
|
import { GlobalEvent, IPublicModelEditor, IPublicTypeSetValueOptions } from '@alilc/lowcode-types';
|
||||||
import { uniqueId, isJSExpression, isSettingField } from '@alilc/lowcode-utils';
|
import { uniqueId, isJSExpression, isSettingField } from '@alilc/lowcode-utils';
|
||||||
import { Setters } from '@alilc/lowcode-shell';
|
import { Setters } from '@alilc/lowcode-shell';
|
||||||
import { SettingEntry } from './setting-entry';
|
import { ISettingEntry } from './setting-entry';
|
||||||
import { INode } from '../../document';
|
import { INode } from '../../document';
|
||||||
import { IComponentMeta } from '../../component-meta';
|
import { IComponentMeta } from '../../component-meta';
|
||||||
import { Designer } from '../designer';
|
import { Designer } from '../designer';
|
||||||
import { SettingField } from './setting-field';
|
import { ISettingField } from './setting-field';
|
||||||
|
|
||||||
export class SettingPropEntry implements SettingEntry {
|
export class SettingPropEntry implements ISettingEntry {
|
||||||
// === static properties ===
|
// === static properties ===
|
||||||
readonly editor: IPublicModelEditor;
|
readonly editor: IPublicModelEditor;
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ export class SettingPropEntry implements SettingEntry {
|
|||||||
|
|
||||||
readonly designer: Designer;
|
readonly designer: Designer;
|
||||||
|
|
||||||
readonly top: SettingEntry;
|
readonly top: ISettingEntry;
|
||||||
|
|
||||||
readonly isGroup: boolean;
|
readonly isGroup: boolean;
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ export class SettingPropEntry implements SettingEntry {
|
|||||||
|
|
||||||
extraProps: any = {};
|
extraProps: any = {};
|
||||||
|
|
||||||
constructor(readonly parent: SettingEntry | SettingField, name: string | number, type?: 'field' | 'group') {
|
constructor(readonly parent: ISettingEntry | ISettingField, name: string | number, type?: 'field' | 'group') {
|
||||||
makeObservable(this);
|
makeObservable(this);
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
const c = typeof name === 'string' ? name.slice(0, 1) : '';
|
const c = typeof name === 'string' ? name.slice(0, 1) : '';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { IPublicTypeCustomView, IPublicModelEditor } from '@alilc/lowcode-types';
|
import { IPublicTypeCustomView, IPublicModelEditor } from '@alilc/lowcode-types';
|
||||||
import { isCustomView } from '@alilc/lowcode-utils';
|
import { isCustomView } from '@alilc/lowcode-utils';
|
||||||
import { computed, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
|
import { computed, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
|
||||||
import { SettingEntry } from './setting-entry';
|
import { ISettingEntry } from './setting-entry';
|
||||||
import { SettingField } from './setting-field';
|
import { SettingField } from './setting-field';
|
||||||
import { SettingPropEntry } from './setting-prop-entry';
|
import { SettingPropEntry } from './setting-prop-entry';
|
||||||
import { INode } from '../../document';
|
import { INode } from '../../document';
|
||||||
@ -16,7 +16,7 @@ function generateSessionId(nodes: INode[]) {
|
|||||||
.join(',');
|
.join(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ISettingTopEntry extends SettingEntry {
|
export interface ISettingTopEntry extends ISettingEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SettingTopEntry implements ISettingTopEntry {
|
export class SettingTopEntry implements ISettingTopEntry {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { shallowIntl, observer, obx, engineConfig, runInAction, globalContext }
|
|||||||
import { createContent, isJSSlot, isSetterConfig, isSettingField } from '@alilc/lowcode-utils';
|
import { createContent, isJSSlot, isSetterConfig, isSettingField } from '@alilc/lowcode-utils';
|
||||||
import { Skeleton } from '@alilc/lowcode-editor-skeleton';
|
import { Skeleton } from '@alilc/lowcode-editor-skeleton';
|
||||||
import { IPublicTypeCustomView } from '@alilc/lowcode-types';
|
import { IPublicTypeCustomView } from '@alilc/lowcode-types';
|
||||||
import { SettingField, SettingTopEntry, SettingEntry, ComponentMeta } from '@alilc/lowcode-designer';
|
import { SettingField, SettingTopEntry, ISettingEntry, ComponentMeta } from '@alilc/lowcode-designer';
|
||||||
import { createField } from '../field';
|
import { createField } from '../field';
|
||||||
import PopupService, { PopupPipe } from '../popup';
|
import PopupService, { PopupPipe } from '../popup';
|
||||||
import { SkeletonContext } from '../../context';
|
import { SkeletonContext } from '../../context';
|
||||||
@ -58,7 +58,7 @@ class SettingFieldView extends Component<SettingFieldViewProps, SettingFieldView
|
|||||||
stageName = `${field.getNode().id}_${field.name.toString()}`;
|
stageName = `${field.getNode().id}_${field.name.toString()}`;
|
||||||
// 清除原 stage,不然 content 引用的一直是老的 field,导致数据无法得到更新
|
// 清除原 stage,不然 content 引用的一直是老的 field,导致数据无法得到更新
|
||||||
stages.container.remove(stageName);
|
stages.container.remove(stageName);
|
||||||
const stage = stages.add({
|
stages.add({
|
||||||
type: 'Widget',
|
type: 'Widget',
|
||||||
name: stageName,
|
name: stageName,
|
||||||
content: <Fragment>{field.items.map((item, index) => createSettingFieldView(item, field, index))}</Fragment>,
|
content: <Fragment>{field.items.map((item, index) => createSettingFieldView(item, field, index))}</Fragment>,
|
||||||
@ -324,7 +324,7 @@ class SettingGroupView extends Component<SettingGroupViewProps> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createSettingFieldView(item: SettingField | IPublicTypeCustomView, field: SettingEntry, index?: number) {
|
export function createSettingFieldView(item: SettingField | IPublicTypeCustomView, field: ISettingEntry, index?: number) {
|
||||||
if (isSettingField(item)) {
|
if (isSettingField(item)) {
|
||||||
if (item.isGroup) {
|
if (item.isGroup) {
|
||||||
return <SettingGroupView field={item} key={item.id} />;
|
return <SettingGroupView field={item} key={item.id} />;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
Node as InnerNode,
|
INode,
|
||||||
SettingField as InnerSettingField,
|
SettingField as InnerSettingField,
|
||||||
} from '@alilc/lowcode-designer';
|
} from '@alilc/lowcode-designer';
|
||||||
import { IShellModelFactory, IPublicModelNode, IPublicModelSettingPropEntry } from '@alilc/lowcode-types';
|
import { IShellModelFactory, IPublicModelNode, IPublicModelSettingPropEntry } from '@alilc/lowcode-types';
|
||||||
@ -8,7 +8,7 @@ import {
|
|||||||
SettingPropEntry,
|
SettingPropEntry,
|
||||||
} from '@alilc/lowcode-shell';
|
} from '@alilc/lowcode-shell';
|
||||||
class ShellModelFactory implements IShellModelFactory {
|
class ShellModelFactory implements IShellModelFactory {
|
||||||
createNode(node: InnerNode | null | undefined): IPublicModelNode | null {
|
createNode(node: INode | null | undefined): IPublicModelNode | null {
|
||||||
return Node.create(node);
|
return Node.create(node);
|
||||||
}
|
}
|
||||||
createSettingPropEntry(prop: InnerSettingField): IPublicModelSettingPropEntry {
|
createSettingPropEntry(prop: InnerSettingField): IPublicModelSettingPropEntry {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { SettingField, SettingEntry } from '@alilc/lowcode-designer';
|
import { SettingField, ISettingEntry } from '@alilc/lowcode-designer';
|
||||||
import {
|
import {
|
||||||
IPublicTypeCompositeValue,
|
IPublicTypeCompositeValue,
|
||||||
IPublicTypeFieldConfig,
|
IPublicTypeFieldConfig,
|
||||||
@ -233,7 +233,7 @@ export class SettingPropEntry implements IPublicModelSettingPropEntry {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getProps(): IPublicModelSettingTopEntry {
|
getProps(): IPublicModelSettingTopEntry {
|
||||||
return ShellSettingTopEntry.create(this[settingPropEntrySymbol].getProps() as SettingEntry);
|
return ShellSettingTopEntry.create(this[settingPropEntrySymbol].getProps() as ISettingEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
import { SettingEntry } from '@alilc/lowcode-designer';
|
import { ISettingEntry } from '@alilc/lowcode-designer';
|
||||||
import { settingTopEntrySymbol } from '../symbols';
|
import { settingTopEntrySymbol } from '../symbols';
|
||||||
import { Node as ShellNode } from './node';
|
import { Node as ShellNode } from './node';
|
||||||
import { SettingPropEntry as ShellSettingPropEntry } from './setting-prop-entry';
|
import { SettingPropEntry as ShellSettingPropEntry } from './setting-prop-entry';
|
||||||
import { IPublicModelSettingTopEntry, IPublicModelNode, IPublicModelSettingPropEntry } from '@alilc/lowcode-types';
|
import { IPublicModelSettingTopEntry, IPublicModelNode, IPublicModelSettingPropEntry } from '@alilc/lowcode-types';
|
||||||
|
|
||||||
export class SettingTopEntry implements IPublicModelSettingTopEntry {
|
export class SettingTopEntry implements IPublicModelSettingTopEntry {
|
||||||
private readonly [settingTopEntrySymbol]: SettingEntry;
|
private readonly [settingTopEntrySymbol]: ISettingEntry;
|
||||||
|
|
||||||
constructor(prop: SettingEntry) {
|
constructor(prop: ISettingEntry) {
|
||||||
this[settingTopEntrySymbol] = prop;
|
this[settingTopEntrySymbol] = prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
static create(prop: SettingEntry): IPublicModelSettingTopEntry {
|
static create(prop: ISettingEntry): IPublicModelSettingTopEntry {
|
||||||
return new SettingTopEntry(prop);
|
return new SettingTopEntry(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user