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 8

Classes

PropertyDecorator

Members

# 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 24

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 312

PropertyOptions

# options

Options passed along with a given resource

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

# 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 19

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 305

# 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 34

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 321

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 380

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 425

boolean

# isId() → {boolean}

If property should be treated as an ID field

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

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 409

boolean

# isSortable() → {boolean}

True if given property can be sortable

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

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 418

boolean

# isVisible(where) → {boolean}

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 388

boolean

# label() → {string}

Label of a property

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

string

# name() → {string}

Name of the property

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

string

# position() → {number}

Position of the field

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

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 345

reference resource

BaseResource

# resource() → {ResourceDecorator}

Resource decorator of given property

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

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

Decorates subProperties

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

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 434

PropertyJSON