@antv/s2
Version:
effective spreadsheet render core lib
24 lines • 701 B
JavaScript
import { Group } from '@antv/g';
import { isEmpty } from 'lodash';
export const getAllChildCells = (children = [], cellType) => {
if (isEmpty(children)) {
return [];
}
const cells = [];
children.forEach((child) => {
if (child instanceof cellType) {
cells.push(child);
}
// panel group has child group
if (child instanceof Group) {
const groupChildren = child.children;
groupChildren.forEach((item) => {
if (item instanceof cellType) {
cells.push(item);
}
});
}
});
return cells;
};
//# sourceMappingURL=get-all-child-cells.js.map