TableGroup (extends KompElement)

A group of cells that can share rowCount. Useful for splitInto

Options

types description
content String, HTMLElement, Array, Object

content to append to element. Passed to Dolla's content

name String

identifier of the group

SOURCE CODE
import { content } from 'dolla';
import { result } from '../../support';
import KompElement from '../element.js';

class TableGroup extends KompElement {
    static tagName = 'komp-table-group'
    
    get table () { return this.row?.table }
    get row () { return this.parentElement }
    get rowIndex () { return this.row.rowIndex }
    
    get cells () { return Array.from(this.querySelectorAll(this.table.cellSelector))}
    get rowCount () { return Math.max(...this.cells.map(x => x.groupIndex)) }
    
    append (...els) {
        const result = super.append(...els)
        return result
    }
}
window.customElements.define(TableGroup.tagName, TableGroup);