mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-07 10:57:19 +00:00
chore: 补充 SettingField 部分 API
This commit is contained in:
parent
3f041b592b
commit
19295bb040
@ -1,16 +1,14 @@
|
|||||||
import { createElement } from 'react';
|
import { createElement } from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import { globalContext, Editor, engineConfig, EngineOptions } from '@ali/lowcode-editor-core';
|
import { globalContext, Editor, engineConfig, EngineOptions } from '@ali/lowcode-editor-core';
|
||||||
import * as editorCabin from '@ali/lowcode-editor-core';
|
|
||||||
import {
|
import {
|
||||||
Designer,
|
Designer,
|
||||||
LowCodePluginManager,
|
LowCodePluginManager,
|
||||||
ILowCodePluginContext,
|
ILowCodePluginContext,
|
||||||
// Setters,
|
// Setters,
|
||||||
} from '@ali/lowcode-designer';
|
} from '@ali/lowcode-designer';
|
||||||
import * as designerCabin from '@ali/lowcode-designer';
|
|
||||||
import { Skeleton as InnerSkeleton, SettingsPrimaryPane, registerDefaults } from '@ali/lowcode-editor-skeleton';
|
import { Skeleton as InnerSkeleton, SettingsPrimaryPane, registerDefaults } from '@ali/lowcode-editor-skeleton';
|
||||||
import * as skeletonCabin from '@ali/lowcode-editor-skeleton';
|
|
||||||
import Outline, { OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
import Outline, { OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
||||||
import DesignerPlugin from '@ali/lowcode-plugin-designer';
|
import DesignerPlugin from '@ali/lowcode-plugin-designer';
|
||||||
import {
|
import {
|
||||||
@ -20,20 +18,19 @@ import {
|
|||||||
Setters,
|
Setters,
|
||||||
Material,
|
Material,
|
||||||
Event,
|
Event,
|
||||||
editorSymbol,
|
|
||||||
designerSymbol,
|
|
||||||
skeletonSymbol,
|
|
||||||
} from '@ali/lowcode-shell';
|
} from '@ali/lowcode-shell';
|
||||||
import { getLogger, Logger, isPlainObject } from '@ali/lowcode-utils';
|
import { getLogger, Logger, isPlainObject } from '@ali/lowcode-utils';
|
||||||
import './modules/live-editing';
|
import './modules/live-editing';
|
||||||
import utils from './modules/utils';
|
import utils from './modules/utils';
|
||||||
|
import * as editorCabin from './modules/editor-cabin';
|
||||||
|
import * as skeletonCabin from './modules/skeleton-cabin';
|
||||||
|
import * as designerCabin from './modules/designer-cabin';
|
||||||
|
|
||||||
export * from './modules/editor-types';
|
export * from './modules/editor-types';
|
||||||
export * from './modules/skeleton-types';
|
export * from './modules/skeleton-types';
|
||||||
export * from './modules/designer-types';
|
export * from './modules/designer-types';
|
||||||
export * from './modules/lowcode-types';
|
export * from './modules/lowcode-types';
|
||||||
|
|
||||||
const { monitor } = editorCabin;
|
|
||||||
registerDefaults();
|
registerDefaults();
|
||||||
|
|
||||||
const editor = new Editor();
|
const editor = new Editor();
|
||||||
@ -88,7 +85,6 @@ export {
|
|||||||
*/
|
*/
|
||||||
// store,
|
// store,
|
||||||
// hotkey,
|
// hotkey,
|
||||||
monitor,
|
|
||||||
utils,
|
utils,
|
||||||
// engineConfig,
|
// engineConfig,
|
||||||
};
|
};
|
||||||
@ -124,7 +120,6 @@ const getSelection = () => designer.currentDocument?.selection;
|
|||||||
*/
|
*/
|
||||||
// store,
|
// store,
|
||||||
// hotkey,
|
// hotkey,
|
||||||
monitor,
|
|
||||||
init,
|
init,
|
||||||
utils,
|
utils,
|
||||||
config,
|
config,
|
||||||
|
|||||||
4
packages/engine/src/modules/designer-cabin.ts
Normal file
4
packages/engine/src/modules/designer-cabin.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export {
|
||||||
|
SettingField,
|
||||||
|
isSettingField,
|
||||||
|
} from '@ali/lowcode-designer';
|
||||||
12
packages/engine/src/modules/editor-cabin.ts
Normal file
12
packages/engine/src/modules/editor-cabin.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
export {
|
||||||
|
Title,
|
||||||
|
shallowIntl,
|
||||||
|
createIntl,
|
||||||
|
createSetterContent,
|
||||||
|
// TODO: To be deleted
|
||||||
|
obx,
|
||||||
|
computed,
|
||||||
|
observer,
|
||||||
|
getSetter,
|
||||||
|
getSettersMap,
|
||||||
|
} from '@ali/lowcode-editor-core';
|
||||||
6
packages/engine/src/modules/skeleton-cabin.ts
Normal file
6
packages/engine/src/modules/skeleton-cabin.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export {
|
||||||
|
createSettingFieldView,
|
||||||
|
PopupContext,
|
||||||
|
PopupPipe,
|
||||||
|
Workbench,
|
||||||
|
} from '@ali/lowcode-editor-skeleton';
|
||||||
@ -1,17 +1,17 @@
|
|||||||
import { SettingEntry } from '@ali/lowcode-designer';
|
import { SettingField } from '@ali/lowcode-designer';
|
||||||
import { CompositeValue, SettingTarget } from '@ali/lowcode-types';
|
import { CompositeValue, FieldConfig } from '@ali/lowcode-types';
|
||||||
import { settingPropEntrySymbol } from './symbols';
|
import { settingPropEntrySymbol } from './symbols';
|
||||||
import Node from './node';
|
import Node from './node';
|
||||||
import SettingTopEntry from './setting-top-entry';
|
import SettingTopEntry from './setting-top-entry';
|
||||||
|
|
||||||
export default class SettingPropEntry {
|
export default class SettingPropEntry {
|
||||||
private readonly [settingPropEntrySymbol]: SettingEntry;
|
private readonly [settingPropEntrySymbol]: SettingField;
|
||||||
|
|
||||||
constructor(prop: SettingEntry) {
|
constructor(prop: SettingField) {
|
||||||
this[settingPropEntrySymbol] = prop;
|
this[settingPropEntrySymbol] = prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
static create(prop: SettingEntry) {
|
static create(prop: SettingField) {
|
||||||
return new SettingPropEntry(prop);
|
return new SettingPropEntry(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,4 +37,20 @@ export default class SettingPropEntry {
|
|||||||
getProps() {
|
getProps() {
|
||||||
return SettingTopEntry.create(this[settingPropEntrySymbol].getProps() as SettingEntry) as any;
|
return SettingTopEntry.create(this[settingPropEntrySymbol].getProps() as SettingEntry) as any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isUseVariable() {
|
||||||
|
return this[settingPropEntrySymbol].isUseVariable();
|
||||||
|
}
|
||||||
|
|
||||||
|
setUseVariable(flag: boolean) {
|
||||||
|
this[settingPropEntrySymbol].setUseVariable(flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
createField(config: FieldConfig) {
|
||||||
|
return SettingPropEntry.create(this[settingPropEntrySymbol].createField(config));
|
||||||
|
}
|
||||||
|
|
||||||
|
getMockOrValue() {
|
||||||
|
return this[settingPropEntrySymbol].getMockOrValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user