Class

PropertyDecorator

PropertyDecorator(opts)

Decorates property

Constructor

# new PropertyDecorator(opts)

Parameters:
Name Type Description
opts Object
property BaseProperty
admin AdminBro

current instance of AdminBro

options PropertyOptions
resource ResourceDecorator

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 17

Members

PropertyOptions

# options

Options passed along with a given resource

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 26

Methods

# availableValues() → {Array.<{value: string, label: string}>}

If given property has limited number of available values it returns them.

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 88

Array.<{value: string, label: string}>

# isId() → {boolean}

If property should be treated as an ID field

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 135

boolean

# isSortable() → {boolean}

True if given property can be sortable

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 33

boolean

# isTitle() → {boolean}

If property should be treated as an title field Title field is used as a link to the resource page in the list view and in the breadcrumbs

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 145

boolean

# isVisible(element)

Indicates if given property should be visible

Parameters:
Name Type Description
element boolean

it could be either "list", "edit" or "show"

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 102

# label() → {string}

Label of a property

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 71

string

# name() → {string}

Name of the property

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 63

string

# position() → {number}

Position of the field

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 119

number

# reference() → {BaseResource}

When given property is a reference to another Resource - it returns this Resource

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 50

reference resource

BaseResource

# subProperties() → {Array.<PropertyDecorator>}

Decorates subProperties

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 176

decorated subProperties

Array.<PropertyDecorator>

# toJSON() → {PropertyJSON}

Returns JSON representation of a property

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 153

PropertyJSON

# type() → {PropertyType}

Property type

View Source admin-bro/src/backend/decorators/property-decorator.ts, line 79

PropertyType