UNPKG

@maxgraph/core

Version:

maxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.

53 lines (52 loc) 1.7 kB
/** * A simple class for creating HTML forms. * * @category GUI */ declare class MaxForm { constructor(className: string); /** * Holds the DOM node that represents the table. */ table: HTMLTableElement; /** * Holds the DOM node that represents the tbody (table body). New rows * can be added to this object using DOM API. */ body: HTMLElement; /** * Returns the table that contains this form. */ getTable(): HTMLTableElement; /** * Helper method to add an OK and Cancel button using the respective * functions. */ addButtons(okFunct: Function, cancelFunct: Function): void; /** * Adds an input for the given name, type and value and returns it. */ addText(name: string, value: any, type?: string): HTMLInputElement; /** * Adds a checkbox for the given name and value and returns the textfield. */ addCheckbox(name: string, value: boolean): HTMLInputElement; /** * Adds a textarea for the given name and value and returns the textarea. */ addTextarea(name: string, value: string, rows: number): HTMLTextAreaElement; /** * Adds a combo for the given name and returns the combo. */ addCombo(name: string, isMultiSelect: boolean, size?: number): HTMLSelectElement; /** * Adds an option for the given label to the specified combo. */ addOption(combo: HTMLElement, label: string, value: any, isSelected?: boolean): void; /** * Adds a new row with the name and the input field in two columns and * returns the given input. */ addField(name: string, input: Element): Element; } export default MaxForm;