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 16

Members

PropertyOptions

# options

Options passed along with a given resource

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

string

# private path

Property path including all parents. For root property (this without a parent) it will be its name. But when property has children their paths will include parent path: parentName.subPropertyName.

This path serves as a key in PropertyOptions to identify which property has to be updated

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

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 87

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

# private getOptionsForSubProperty(subProperty) → {PropertyOptions}

Returns PropertyOptions passed by the user for a subProperty. Furthermore it changes property name to the nested property key.

Parameters:
Name Type Description
subProperty BaseProperty

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

# isId() → {boolean}

If property should be treated as an ID field

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

boolean

# isRequired() → {boolean}

If property should be marked as a required with a star (*)

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

boolean

# isSortable() → {boolean}

True if given property can be sortable

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

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 155

boolean

# isVisible(where)

Indicates if given property should be visible

Parameters:
Name Type Description
where 'list' | 'edit' | 'show' | 'filter'

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

# label() → {string}

Label of a property

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

string

# name() → {string}

Name of the property

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

string

# position() → {number}

Position of the field

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

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 49

reference resource

BaseResource

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

Decorates subProperties

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

decorated subProperties

Array.<PropertyDecorator>

# toJSON(whereopt) → {PropertyJSON}

Returns JSON representation of a property

Parameters:
Name Type Attributes Description
where PropertyPlace <optional>

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

PropertyJSON