Skip to main content

HTML class

📖 Description

The HTML class defines a HTML instance for the Tripetto builder. It is derived from the Control class.

📺 Preview


🆕 constructor

Creates a new HTML instance.

Signature

constructor(htmlCode: string, interactive?: boolean, style?: IHTMLStyle): HTML

Parameters

NameTypeOptionalDescription
htmlCodestringNoSpecifies the HTML code for the control.
interactivebooleanYesSpecifies if the HTML code is interactive. Tripetto's touch controller is disabled in that case so events can propagate to the HTML elements.
styleIHTMLStyleYesSpecifies the HTML style (when omitted the default global style will be used).

Return value

Returns a reference to the new HTML instance.

📌 Statics


🏷️ style

Contains the global default style for the HTML control.

Type

IHTMLStyle

🗃️ Fields


🏷️ HTML

Sets or retrieves the HTML code.

Type

string


🏷️ isVisible

Sets or retrieves the visibility of the control.

Type

boolean


🏷️ style

Contains the style for the HTML control.

Type

IHTMLStyle

▶️ Methods


🔧 hide

Hides the control.

Signature

hide(): this

Return value

Returns a reference to the HTML instance to allow chaining.


🔧 indent

Enables control indentation. This can only be set during construction.

Signature

indent(size: number): this

Parameters

NameTypeOptionalDescription
sizenumberNoSpecifies the indent size in pixels.

Return value

Returns a reference to the HTML instance to allow chaining.


🔧 show

Shows the control.

Signature

show(): this

Return value

Returns a reference to the HTML instance to allow chaining.


🔧 update

Indicates to the control something has changed in the HTML hosted by the control and the control needs to update its dimensions.

Signature

update(): void

🔧 visible

Specifies the visibility of the control.

Signature

visible(visible?: boolean): this

Parameters

NameTypeOptionalDescription
visiblebooleanYesSpecifies if the control is visible (default is true).

Return value

Returns a reference to the HTML instance to allow chaining.

⛓️ Interfaces


🔗 IHTMLStyle

Describes the interface for the HTML styles.

Type declaration

interface IHTMLStyle {
/* HTML appearance. */
appearance?: IStyles;

/* HTML appearance when fused with form. */
fused?: IStyles;
}