/* * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient * * http://rtsys.informatik.uni-kiel.de/kieler * * Copyright 2022 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 */ // eslint-disable-next-line @typescript-eslint/no-unused-vars import { attributesModule, Classes, classModule, eventListenersModule, init, jsx, propsModule, styleModule, VNode } from 'snabbdom'; import { Cell } from './helper' /** Needed to update the html document */ export const patch = init([ // Init patch function with chosen modules propsModule, // for setting properties on DOM elements styleModule, // handles styling on elements with support for animations eventListenersModule, // attaches event listeners attributesModule, // for using attributes on svg elements // IMPORTANT: classModule must be after attributesModule. Otherwise it does not work when classes are also in the attributes list. classModule // makes it easy to toggle classes ]); /** * Creates a header with the given parameters. * @param id Id of the table. * @param headers Header Values of the table. * @returns the created table as VNode. */ export function createTable(id: string, headers: string[]): VNode { const children: VNode[] = []; for (const head of headers) { children.push(