Class

PropertyDecorator

PropertyDecorator(opts)

Decorates property

Constructor

# new PropertyDecorator(opts)

Parameters:
Name Type Description
opts Object
property BaseProperty
admin AdminJS

current instance of AdminJS

options PropertyOptions
resource ResourceDecorator

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 16

Members

boolean

# isVirtual

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

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 284

PropertyOptions

# options

Options passed along with a given resource

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 27

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 adminjs/src/backend/decorators/property/property-decorator.ts, line 277

Array.<PropertyDecorator>

# private virtualSubProperties

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

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 293

Methods

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

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

View Source adminjs/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 adminjs/src/backend/decorators/property/property-decorator.ts, line 182

boolean

# isId() → {boolean}

If property should be treated as an ID field

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 156

boolean

# isRequired() → {boolean}

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

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 164

boolean

# isSortable() → {boolean}

True if given property can be sortable

View Source adminjs/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 adminjs/src/backend/decorators/property/property-decorator.ts, line 174

boolean

# isVisible(where)

Indicates if given property should be visible

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

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 122

# label() → {string}

Label of a property

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

string

# name() → {string}

Name of the property

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

string

# position() → {number}

Position of the field

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 139

number

# reference() → {BaseResource}

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

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

reference resource

BaseResource

# resource()

Resource decorator of given property

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 64

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

Decorates subProperties

View Source adminjs/src/backend/decorators/property/property-decorator.ts, line 224

decorated subProperties

Array.<PropertyDecorator>

# toJSON(whereopt) → {PropertyJSON}

Returns JSON representation of a property

Parameters:
Name Type Attributes Description
where PropertyPlace <optional>

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

PropertyJSON