Add group details gen & recode input with text field component #22

Merged
MrKBear merged 8 commits from dev-mrkbear into master 2022-03-16 12:50:40 +08:00
Showing only changes of commit 66102a9936 - Show all commits

View File

@ -90,6 +90,31 @@ class Model extends Emitter<ModelEvent> {
}
}
/**
*
* @param label
* @param type
*/
public getObjectByLabel(
label: Label, type?:
(new (...p: any) => Range) |
(new (...p: any) => Group)
): CtrlObject[] {
const res: CtrlObject[] = [];
for (let i = 0; i < this.objectPool.length; i++) {
if (this.objectPool[i].hasLabel(label)) {
if (type) {
if (this.objectPool[i] instanceof type) {
res.push(this.objectPool[i]);
}
} else {
res.push(this.objectPool[i]);
}
}
}
return res;
}
/**
*
*/