Skip to content

Latest commit

 

History

History
568 lines (290 loc) · 9.88 KB

Widget.md

File metadata and controls

568 lines (290 loc) · 9.88 KB

@serenity-is/corelib / Widget

Class: Widget<P>

Extended by

Type Parameters

P = {}

Constructors

new Widget()

new Widget<P>(props): Widget<P>

Parameters

props

WidgetProps<P>

Returns

Widget<P>

Defined in

src/ui/widgets/widget.ts:19

Properties

domNode

readonly domNode: HTMLElement

Defined in

src/ui/widgets/widget.ts:17


idPrefix

readonly idPrefix: string

Defined in

src/ui/widgets/widget.ts:16


options

protected readonly options: WidgetProps<P>

Defined in

src/ui/widgets/widget.ts:14


uniqueName

readonly uniqueName: string

Defined in

src/ui/widgets/widget.ts:15


isComponent

readonly static isComponent: true = true

Defined in

src/ui/widgets/widget.ts:223


typeInfo

static typeInfo: ClassTypeInfo<"Serenity.Widget">

Defined in

src/ui/widgets/widget.ts:11

Accessors

element

Get Signature

get element(): Fluent<HTMLElement>

Returns a Fluent(this.domNode) object

Returns

Fluent<HTMLElement>

Defined in

src/ui/widgets/widget.ts:63


props

Get Signature

get props(): WidgetProps<P>

Returns

WidgetProps<P>

Defined in

src/ui/widgets/widget.ts:207

Methods

addCssClass()

protected addCssClass(): void

Returns

void

Defined in

src/ui/widgets/widget.ts:67


addValidationRule()

Call Signature

addValidationRule(rule, uniqueName?): void

Parameters
rule

(input) => string

uniqueName?

string

Returns

void

Defined in

src/ui/widgets/widget.ts:99

Call Signature

addValidationRule(uniqueName, rule): void

Parameters
uniqueName

string

rule

(input) => string

Returns

void

Defined in

src/ui/widgets/widget.ts:100


afterRender()

protected afterRender(callback): void

Parameters

callback

() => void

Returns

void

Defined in

src/ui/widgets/widget.ts:146


byId()

protected byId<TElement>(id): Fluent<TElement>

Type Parameters

TElement extends HTMLElement = HTMLElement

Parameters

id

string

Returns

Fluent<TElement>

Defined in

src/ui/widgets/widget.ts:106


change()

change(handler): void

Parameters

handler

(e) => void

Returns

void

Defined in

src/ui/widgets/widget.ts:118


changeSelect2()

changeSelect2(handler): void

Parameters

handler

(e) => void

Returns

void

Defined in

src/ui/widgets/widget.ts:122


deferRender()

protected deferRender(): boolean

Returns

boolean

Defined in

src/ui/widgets/widget.ts:71


destroy()

destroy(): void

Returns

void

Defined in

src/ui/widgets/widget.ts:47


findById()

protected findById<TElement>(id): TElement

Type Parameters

TElement extends HTMLElement = HTMLElement

Parameters

id

string

Returns

TElement

Defined in

src/ui/widgets/widget.ts:110


getCssClass()

protected getCssClass(): string

Returns

string

Defined in

src/ui/widgets/widget.ts:75


getCustomAttribute()

protected getCustomAttribute<TAttr>(attrType, inherit): TAttr

Type Parameters

TAttr

Parameters

attrType

(...args) => TAttr

inherit

boolean = true

Returns

TAttr

Defined in

src/ui/widgets/widget.ts:142


getGridField()

getGridField(): Fluent<HTMLElement>

Returns

Fluent<HTMLElement>

Defined in

src/ui/widgets/widget.ts:114


init()

init(): this

Returns

this

Defined in

src/ui/widgets/widget.ts:157


internalRenderContents()

internalRenderContents(): void

Returns

void

Defined in

src/ui/widgets/widget.ts:177


legacyTemplateRender()

protected legacyTemplateRender(): boolean

Returns

boolean

Defined in

src/ui/widgets/widget.ts:194


render()

render(): any

Returns the main element for this widget or the document fragment. As widgets may get their elements from props unlike regular JSX widgets, this method should not be overridden. Override renderContents() instead.

Returns

any

Defined in

src/ui/widgets/widget.ts:167


renderContents()

protected renderContents(): any

Returns

any

Defined in

src/ui/widgets/widget.ts:188


syncOrAsyncThen()

protected syncOrAsyncThen<T>(syncMethod, asyncMethod, then): void

Type Parameters

T

Parameters

syncMethod

() => T

asyncMethod

() => PromiseLike<T>

then

(v) => void

Returns

void

Defined in

src/ui/widgets/widget.ts:211


useIdPrefix()

protected useIdPrefix(): IdPrefixType

Returns

IdPrefixType

Defined in

src/ui/widgets/widget.ts:218


create()

static create<TWidget, P>(params): TWidget

Type Parameters

TWidget extends Widget<P>

P

Parameters

params

CreateWidgetParams<TWidget, P>

Returns

TWidget

Defined in

src/ui/widgets/widget.ts:130


createDefaultElement()

static createDefaultElement(): HTMLElement

Returns

HTMLElement

Defined in

src/ui/widgets/widget.ts:56


getWidgetName()

static getWidgetName(type): string

Parameters

type

Function

Returns

string

Defined in

src/ui/widgets/widget.ts:95