mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:20:11 +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 { INode } from '../../document';
|
||||
|
||||
export interface SettingEntry extends IPublicModelSettingTarget {
|
||||
export interface ISettingEntry extends IPublicModelSettingTarget {
|
||||
readonly nodes: INode[];
|
||||
readonly componentMeta: IComponentMeta | null;
|
||||
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';
|
||||
import { Transducer } from './utils';
|
||||
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 { cloneDeep, isCustomView, isDynamicSetter } from '@alilc/lowcode-utils';
|
||||
|
||||
function getSettingFieldCollectorKey(parent: SettingEntry, config: IPublicTypeFieldConfig) {
|
||||
function getSettingFieldCollectorKey(parent: ISettingEntry, config: IPublicTypeFieldConfig) {
|
||||
let cur = parent;
|
||||
const path = [config.name];
|
||||
while (cur !== parent.top) {
|
||||
@ -25,7 +25,11 @@ function getSettingFieldCollectorKey(parent: SettingEntry, config: IPublicTypeFi
|
||||
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 isRequired: boolean;
|
||||
@ -36,7 +40,7 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
||||
|
||||
private hotValue: any;
|
||||
|
||||
parent: SettingEntry;
|
||||
parent: ISettingEntry;
|
||||
|
||||
extraProps: IPublicTypeFieldExtraProps;
|
||||
|
||||
@ -56,7 +60,7 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
||||
private _items: Array<SettingField | IPublicTypeCustomView> = [];
|
||||
|
||||
constructor(
|
||||
parent: SettingEntry,
|
||||
parent: ISettingEntry,
|
||||
config: IPublicTypeFieldConfig,
|
||||
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 { uniqueId, isJSExpression, isSettingField } from '@alilc/lowcode-utils';
|
||||
import { Setters } from '@alilc/lowcode-shell';
|
||||
import { SettingEntry } from './setting-entry';
|
||||
import { ISettingEntry } from './setting-entry';
|
||||
import { INode } from '../../document';
|
||||
import { IComponentMeta } from '../../component-meta';
|
||||
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 ===
|
||||
readonly editor: IPublicModelEditor;
|
||||
|
||||
@ -26,7 +26,7 @@ export class SettingPropEntry implements SettingEntry {
|
||||
|
||||
readonly designer: Designer;
|
||||
|
||||
readonly top: SettingEntry;
|
||||
readonly top: ISettingEntry;
|
||||
|
||||
readonly isGroup: boolean;
|
||||
|
||||
@ -53,7 +53,7 @@ export class SettingPropEntry implements SettingEntry {
|
||||
|
||||
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);
|
||||
if (type == null) {
|
||||
const c = typeof name === 'string' ? name.slice(0, 1) : '';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { IPublicTypeCustomView, IPublicModelEditor } from '@alilc/lowcode-types';
|
||||
import { isCustomView } from '@alilc/lowcode-utils';
|
||||
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 { SettingPropEntry } from './setting-prop-entry';
|
||||
import { INode } from '../../document';
|
||||
@ -16,7 +16,7 @@ function generateSessionId(nodes: INode[]) {
|
||||
.join(',');
|
||||
}
|
||||
|
||||
export interface ISettingTopEntry extends SettingEntry {
|
||||
export interface ISettingTopEntry extends ISettingEntry {
|
||||
}
|
||||
|
||||
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 { Skeleton } from '@alilc/lowcode-editor-skeleton';
|
||||
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 PopupService, { PopupPipe } from '../popup';
|
||||
import { SkeletonContext } from '../../context';
|
||||
@ -58,7 +58,7 @@ class SettingFieldView extends Component<SettingFieldViewProps, SettingFieldView
|
||||
stageName = `${field.getNode().id}_${field.name.toString()}`;
|
||||
// 清除原 stage,不然 content 引用的一直是老的 field,导致数据无法得到更新
|
||||
stages.container.remove(stageName);
|
||||
const stage = stages.add({
|
||||
stages.add({
|
||||
type: 'Widget',
|
||||
name: stageName,
|
||||
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 (item.isGroup) {
|
||||
return <SettingGroupView field={item} key={item.id} />;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {
|
||||
Node as InnerNode,
|
||||
INode,
|
||||
SettingField as InnerSettingField,
|
||||
} from '@alilc/lowcode-designer';
|
||||
import { IShellModelFactory, IPublicModelNode, IPublicModelSettingPropEntry } from '@alilc/lowcode-types';
|
||||
@ -8,7 +8,7 @@ import {
|
||||
SettingPropEntry,
|
||||
} from '@alilc/lowcode-shell';
|
||||
class ShellModelFactory implements IShellModelFactory {
|
||||
createNode(node: InnerNode | null | undefined): IPublicModelNode | null {
|
||||
createNode(node: INode | null | undefined): IPublicModelNode | null {
|
||||
return Node.create(node);
|
||||
}
|
||||
createSettingPropEntry(prop: InnerSettingField): IPublicModelSettingPropEntry {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { SettingField, SettingEntry } from '@alilc/lowcode-designer';
|
||||
import { SettingField, ISettingEntry } from '@alilc/lowcode-designer';
|
||||
import {
|
||||
IPublicTypeCompositeValue,
|
||||
IPublicTypeFieldConfig,
|
||||
@ -233,7 +233,7 @@ export class SettingPropEntry implements IPublicModelSettingPropEntry {
|
||||
* @returns
|
||||
*/
|
||||
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 { Node as ShellNode } from './node';
|
||||
import { SettingPropEntry as ShellSettingPropEntry } from './setting-prop-entry';
|
||||
import { IPublicModelSettingTopEntry, IPublicModelNode, IPublicModelSettingPropEntry } from '@alilc/lowcode-types';
|
||||
|
||||
export class SettingTopEntry implements IPublicModelSettingTopEntry {
|
||||
private readonly [settingTopEntrySymbol]: SettingEntry;
|
||||
private readonly [settingTopEntrySymbol]: ISettingEntry;
|
||||
|
||||
constructor(prop: SettingEntry) {
|
||||
constructor(prop: ISettingEntry) {
|
||||
this[settingTopEntrySymbol] = prop;
|
||||
}
|
||||
|
||||
static create(prop: SettingEntry): IPublicModelSettingTopEntry {
|
||||
static create(prop: ISettingEntry): IPublicModelSettingTopEntry {
|
||||
return new SettingTopEntry(prop);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user