mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-07 02:47:12 +00:00
feat: init
This commit is contained in:
parent
1fa525d64a
commit
f509dc6301
@ -115,24 +115,43 @@ export class Editor extends (EventEmitter as any) implements IEditor {
|
|||||||
remoteComponentDescriptions.map(async (component: any) => {
|
remoteComponentDescriptions.map(async (component: any) => {
|
||||||
const { exportName, url, npm } = component;
|
const { exportName, url, npm } = component;
|
||||||
await (new AssetLoader()).load(url);
|
await (new AssetLoader()).load(url);
|
||||||
if (window[exportName]) {
|
function setAssetsComponent(component: any, extraNpmInfo: any = {}) {
|
||||||
if (Array.isArray(window[exportName])) {
|
const components = component.components;
|
||||||
(window[exportName] as any).forEach((d: any, i: number) => {
|
if (Array.isArray(components)) {
|
||||||
|
components.forEach(d => {
|
||||||
assets.components = assets.components.concat({
|
assets.components = assets.components.concat({
|
||||||
npm: {
|
npm: {
|
||||||
...npm,
|
...npm,
|
||||||
exportName: i.toString(),
|
...extraNpmInfo,
|
||||||
subName: i.toString(),
|
|
||||||
},
|
},
|
||||||
...d.components,
|
...d,
|
||||||
} || []);
|
} || []);
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
assets.components = assets.components.concat({
|
assets.components = assets.components.concat({
|
||||||
npm,
|
npm: {
|
||||||
...window[exportName].components,
|
...npm,
|
||||||
|
...extraNpmInfo,
|
||||||
|
},
|
||||||
|
...component.components,
|
||||||
} || []);
|
} || []);
|
||||||
assets.componentList = assets.componentList.concat(window[exportName].componentList || []);
|
// assets.componentList = assets.componentList.concat(component.componentList || []);
|
||||||
|
}
|
||||||
|
function setArrayAssets(value: any[]) {
|
||||||
|
value.forEach((d: any, i: number) => {
|
||||||
|
Array.isArray(d) ? setArrayAssets(d) : setAssetsComponent(d, {
|
||||||
|
exportName: i.toString(),
|
||||||
|
subName: i.toString(),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (window[exportName]) {
|
||||||
|
if (Array.isArray(window[exportName])) {
|
||||||
|
setArrayAssets(window[exportName] as any);
|
||||||
|
} else {
|
||||||
|
setAssetsComponent(window[exportName] as any);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return window[exportName];
|
return window[exportName];
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -198,7 +198,6 @@ class SettingFieldView extends Component<SettingFieldViewProps, SettingFieldView
|
|||||||
setterProps = {},
|
setterProps = {},
|
||||||
setterType,
|
setterType,
|
||||||
initialValue = null,
|
initialValue = null,
|
||||||
|
|
||||||
} = this.setterInfo;
|
} = this.setterInfo;
|
||||||
|
|
||||||
const value = this.value;
|
const value = this.value;
|
||||||
|
|||||||
@ -363,6 +363,12 @@ export class Skeleton {
|
|||||||
...this.parseConfig(config),
|
...this.parseConfig(config),
|
||||||
...extraConfig,
|
...extraConfig,
|
||||||
};
|
};
|
||||||
|
parsedConfig.contentProps = {
|
||||||
|
context: this.editor.get('plugins')?._getLowCodePluginContext({
|
||||||
|
pluginName: 'any',
|
||||||
|
}),
|
||||||
|
...(parsedConfig.contentProps || {}),
|
||||||
|
};
|
||||||
let { area } = parsedConfig;
|
let { area } = parsedConfig;
|
||||||
if (!area) {
|
if (!area) {
|
||||||
if (parsedConfig.type === 'Panel') {
|
if (parsedConfig.type === 'Panel') {
|
||||||
|
|||||||
@ -104,6 +104,7 @@ export default class ComponentMeta {
|
|||||||
return this[componentMetaSymbol].getMetadata();
|
return this[componentMetaSymbol].getMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isComponentMeta = true;
|
||||||
/**
|
/**
|
||||||
* check if the current node could be placed in parent node
|
* check if the current node could be placed in parent node
|
||||||
* @param my
|
* @param my
|
||||||
|
|||||||
@ -62,7 +62,7 @@ export default class SettingPropEntry {
|
|||||||
* 获取设置属性的 setter
|
* 获取设置属性的 setter
|
||||||
*/
|
*/
|
||||||
get setter() {
|
get setter() {
|
||||||
return this[settingPropEntrySymbol].innerSetters;
|
return this[settingPropEntrySymbol].setter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user