feat: add getControlList api #455
This commit is contained in:
@@ -108,6 +108,7 @@ export class Command {
|
||||
public getLocale: CommandAdapt['getLocale']
|
||||
public getGroupIds: CommandAdapt['getGroupIds']
|
||||
public getControlValue: CommandAdapt['getControlValue']
|
||||
public getControlList: CommandAdapt['getControlList']
|
||||
public getContainer: CommandAdapt['getContainer']
|
||||
|
||||
constructor(adapt: CommandAdapt) {
|
||||
@@ -228,5 +229,6 @@ export class Command {
|
||||
this.executeSetControlProperties = adapt.setControlProperties.bind(adapt)
|
||||
this.executeSetControlHighlight = adapt.setControlHighlight.bind(adapt)
|
||||
this.getControlValue = adapt.getControlValue.bind(adapt)
|
||||
this.getControlList = adapt.getControlList.bind(adapt)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2388,6 +2388,10 @@ export class CommandAdapt {
|
||||
this.draw.getControl().setHighlightList(payload)
|
||||
}
|
||||
|
||||
public getControlList(): IElement[] {
|
||||
return this.draw.getControl().getList()
|
||||
}
|
||||
|
||||
public getContainer(): HTMLDivElement {
|
||||
return this.draw.getContainer()
|
||||
}
|
||||
|
||||
@@ -752,4 +752,22 @@ export class Control {
|
||||
isSetCursor: false
|
||||
})
|
||||
}
|
||||
|
||||
public getList(): IElement[] {
|
||||
const data = [
|
||||
this.draw.getHeader().getElementList(),
|
||||
this.draw.getOriginalMainElementList(),
|
||||
this.draw.getFooter().getElementList()
|
||||
]
|
||||
const controlElementList: IElement[] = []
|
||||
for (const elementList of data) {
|
||||
for (let e = 0; e < elementList.length; e++) {
|
||||
const element = elementList[e]
|
||||
if (element.controlId) {
|
||||
controlElementList.push(element)
|
||||
}
|
||||
}
|
||||
}
|
||||
return zipElementList(controlElementList)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user