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/property-decorator.ts, line 16

Members

boolean

# isVirtual

Indicates if given property has been created in AdminBro and hasn't been returned by the database adapter

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

string

# propertyPath

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/property-decorator.ts, line 270

Array.<PropertyDecorator>

# private virtualSubProperties

Array of all subProperties which were added in ResourceOption interface rather than in the database

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

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/property-decorator.ts, line 92

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

# isDisabled() → {boolean}

If property should be disabled in the UI

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

boolean

# isId() → {boolean}

If property should be treated as an ID field

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

boolean

# isRequired() → {boolean}

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

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

boolean

# isSortable() → {boolean}

True if given property can be sortable

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

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/property-decorator.ts, line 168

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/property-decorator.ts, line 116

# label() → {string}

Label of a property

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

string

# name() → {string}

Name of the property

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

string

# position() → {number}

Position of the field

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

number

# reference() → {BaseResource}

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

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

reference resource

BaseResource

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

Decorates subProperties

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

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/property-decorator.ts, line 186

PropertyJSON
SoftwareBrothers

Proudly built and maintained by SoftwareBrothers

Software House with a passion for both JavaScript and TypeScript.

See what we do See what we believe in

Proudly built and maintained by

SoftwareBrothers