(
mainType: string | QueryConditionKindA | EachComponentAllCallback,
cb?: EachComponentInMainTypeCallback | T,
context?: T
)
| 716 | context?: T |
| 717 | ): void; |
| 718 | eachComponent<T>( |
| 719 | mainType: string | QueryConditionKindA | EachComponentAllCallback, |
| 720 | cb?: EachComponentInMainTypeCallback | T, |
| 721 | context?: T |
| 722 | ) { |
| 723 | const componentsMap = this._componentsMap; |
| 724 | |
| 725 | if (isFunction(mainType)) { |
| 726 | const ctxForAll = cb as T; |
| 727 | const cbForAll = mainType as EachComponentAllCallback; |
| 728 | componentsMap.each(function (cmpts, componentType) { |
| 729 | for (let i = 0; cmpts && i < cmpts.length; i++) { |
| 730 | const cmpt = cmpts[i]; |
| 731 | cmpt && cbForAll.call(ctxForAll, componentType, cmpt, cmpt.componentIndex); |
| 732 | } |
| 733 | }); |
| 734 | } |
| 735 | else { |
| 736 | const cmpts = isString(mainType) |
| 737 | ? componentsMap.get(mainType) |
| 738 | : isObject(mainType) |
| 739 | ? this.findComponents(mainType) |
| 740 | : null; |
| 741 | for (let i = 0; cmpts && i < cmpts.length; i++) { |
| 742 | const cmpt = cmpts[i]; |
| 743 | cmpt && (cb as EachComponentInMainTypeCallback).call( |
| 744 | context, cmpt, cmpt.componentIndex |
| 745 | ); |
| 746 | } |
| 747 | } |
| 748 | } |
| 749 | |
| 750 | /** |
| 751 | * Get series list before filtered by name. |
no test coverage detected