Class

BaseProperty

BaseProperty(options)

Represents Resource Property

Constructor

# new BaseProperty(options)

Parameters:
Name Type Attributes Default Description
options object
path string

property path: usually it its key but when property is for an object the path can be divided to parts by dots: i.e. 'address.street'

type string <optional>
'string'

one if: string, float, number, boolean, date

isId boolean <optional>
false

true when field should be treated as an ID

isSortable boolean <optional>
true

if property should be sortable

View Source admin-bro/src/backend/adapters/base-property.ts, line 19

Methods

# availableValues() → {Array.<String>|null}

Returns all available values which field can accept. It is used in case of enums

View Source admin-bro/src/backend/adapters/base-property.ts, line 98

array of all available values or null when field is not an enum.

Array.<String> | null

# isArray() → {boolean}

Returns true when given property is an array

View Source admin-bro/src/backend/adapters/base-property.ts, line 106

boolean

# isEditable() → {boolean}

Indicates if value of given property can be updated

View Source admin-bro/src/backend/adapters/base-property.ts, line 70

boolean

# isId() → {boolean}

Returns true if given property is a uniq key in a table/collection

View Source admin-bro/src/backend/adapters/base-property.ts, line 78

boolean

# isSortable() → {boolean}

Indicates if given property can be sorted

View Source admin-bro/src/backend/adapters/base-property.ts, line 122

boolean

# isTitle() → {boolean}

Return true if given property should be treated as a Record Title.

View Source admin-bro/src/backend/adapters/base-property.ts, line 54

boolean

# isVisible() → {Boolean}

Indicates if given property should be visible

View Source admin-bro/src/backend/adapters/base-property.ts, line 62

Boolean

# name() → {string}

Name of the property

View Source admin-bro/src/backend/adapters/base-property.ts, line 33

name of the property

string

# reference()

If property is a reference to a record of different resource it should contain BaseResource.id of this resource.

When property is responsible for the field: 'user_id' in SQL database reference should be the name of the Resource which it refers to: Users

View Source admin-bro/src/backend/adapters/base-property.ts, line 88

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

In case of mixed type returns all nested properties.

View Source admin-bro/src/backend/adapters/base-property.ts, line 114

sub properties

Array.<BaseProperty>

# type() → {PropertyType}

Return type of a property

View Source admin-bro/src/backend/adapters/base-property.ts, line 46

PropertyType