mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
feat: 增加 getConfig / getItems / selected 等兼容 vision 的 API
This commit is contained in:
parent
b0f41a7acf
commit
9a3352b054
@ -117,9 +117,23 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
||||
this.disposeItems();
|
||||
}
|
||||
|
||||
// ======= compatibles for vision ======
|
||||
|
||||
getConfig(): FieldConfig {
|
||||
return this._config;
|
||||
}
|
||||
|
||||
getItems(filter?: (item: SettingField | CustomView) => boolean): Array<SettingField | CustomView> {
|
||||
return this._items.filter(item => {
|
||||
if (filter) {
|
||||
return filter(item);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
private hotValue: any;
|
||||
|
||||
// ======= compatibles for vision ======
|
||||
setValue(val: any, isHotValue?: boolean, force?: boolean, extraOptions?: any) {
|
||||
if (isHotValue) {
|
||||
this.setHotValue(val, extraOptions);
|
||||
|
||||
@ -124,6 +124,7 @@ class SettingFieldView extends Component<{ field: SettingField }> {
|
||||
key: field.id,
|
||||
// === injection
|
||||
prop: field, // for compatible vision
|
||||
selected: field.top?.getNode(),
|
||||
field,
|
||||
// === IO
|
||||
value, // reaction point
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user