Home Manual Reference Source
import Field from 'pvbid-sdk/src/domain/Field.js'
public class | source

Field

Extends:

eventemitter3~EventEmitterAdvanceEventEmitterBidEntity → Field

Field Class

Constructor Summary

Public Constructor
public

constructor(fieldData: object, bid: Bid)

Creates an instance of Field.

Member Summary

Public Members
public get

Returns the actual value of the field after the project has been completed and reviewed for reconciliation.

public set

Sets the actual value for reconciliation.

public get

Returns the anchor identifier of the field.

public

bid: Bid

Reference to the bid that the field belongs to.

public get

Gets the configuration information for the bid entity.

public get
this get was deprecated. Definition ids will become obsolete in planned data structure upgrade.

Gets the field's definition id.

public get

Gets the field type.

public get

Determines if the current value is the result of being auto populated due to the field's ruleset.

public get

Gets value of the field.

public set

Sets the field value.

Method Summary

Public Methods
public

assess(dependency: BidEntity)

Assess the field, determining if it should be auto populated.

public

bind()

Binds the "updated" event for all dependant bid entities.

public

Gets all the bid entities that relay on the field instance.

public

Returns all the dependencies that the field relies on.

public

dirty()

Flags the field and corresponding bid as dirty and to be saved.

public

exportData(alwaysIncludeConfig: boolean): object

Exports internal data.

public

Get the field's assembly if it has one

public

If the field has a fieldType of "list", getDatatable will return the datatable instance that it relies on, otherwise will return null.

public

Gets a list of options bound to a datatable.

public

Gets the selected list option.

public

Gets the value of the selected field list based on the datatable column id.

public

Determines if the field has any null or undefined dependencies

public

Determines if instance is dirty.

public

Determines if a field has a dependency reference.

public

Adds the field to an assembly.

public

unsetAssembly(): void

Removes any assembly reference from the field.

Inherited Summary

From class AdvanceEventEmitter
public

Maximum number of events fired for the requester before events stop.

public

on(eventName: string, requesterId: string, callback: function)

public

onDelay(eventName: string, ms: number, requesterId: string, callback: function)

public

removeListenerByRequester(eventName: string, requesterId: string)

Removes event listeners by event and requesterId.

From class BidEntity
public get

Determine if the entity is in an assembly

public get

Gets the id of the bid entity.

public get

Gets the bid entity title.

public set

Sets the bid entity title.

public get

Gets the bid entity type.

public abstract

assess(dependency: BidEntity)

Assesses bid entity.

public

Gets an array of depndants that rely on the bid entity.

public

Gets all the dependencies that the bid entity relies on.

public

dirty()

Flags the bid entity as dirty and to be saved.

public

Exports the internal data for the bid entity.

public

Determines if bid entity relies on a null or undefined dependency value

public

async initSaveChangeLog(originalValue: *, newValue: *, valueType: *, entityProperty: *, metaData: *): *

public

Determines of bid entity is dirty.

public

Marks the bid entity as clean.

Public Constructors

public constructor(fieldData: object, bid: Bid) source

Creates an instance of Field.

Override:

BidEntity#constructor

Params:

NameTypeAttributeDescription
fieldData object
bid Bid

Public Members

public get actualValue: string source

Returns the actual value of the field after the project has been completed and reviewed for reconciliation.

public set actualValue: string source

Sets the actual value for reconciliation. Marks field as dirty.

public get anchor: string | null source

Returns the anchor identifier of the field. Anchors are a common global identifier that help identify similar fields across different assemblies. They should be unique to their assembly. Using anchors allow for greater automation potential.

public bid: Bid source

Reference to the bid that the field belongs to.

public get config: object source

Gets the configuration information for the bid entity.

public get definitionId: number source

this get was deprecated. Definition ids will become obsolete in planned data structure upgrade.

Gets the field's definition id.

public get fieldType: string source

Gets the field type. Options: text, boolean, number, list

public get isAutoSelected: boolean source

Determines if the current value is the result of being auto populated due to the field's ruleset.

public get value: string | number | boolean source

Gets value of the field. If the field is of a list type, will return the associated datatable row id.

public set value: string source

Sets the field value. Marks field as dirty

Emit:

updated

Public Methods

public assess(dependency: BidEntity) source

Assess the field, determining if it should be auto populated.

Override:

BidEntity#assess

Params:

NameTypeAttributeDescription
dependency BidEntity
  • nullable: true

The calling dependency.

Emit:

assessing

Fires event before assessment.

assessed

Fires event after assessment.

updated

Fires event if the field has been changed during assessment.

public bind() source

Binds the "updated" event for all dependant bid entities.

public dependants(): BidEntity[] source

Gets all the bid entities that relay on the field instance.

Override:

BidEntity#dependants

Return:

BidEntity[]

public dependencies(): BidEntity[] source

Returns all the dependencies that the field relies on.

Override:

BidEntity#dependencies

Return:

BidEntity[]

public dirty() source

Flags the field and corresponding bid as dirty and to be saved.

Override:

BidEntity#dirty

public exportData(alwaysIncludeConfig: boolean): object source

Exports internal data.

Override:

BidEntity#exportData

Params:

NameTypeAttributeDescription
alwaysIncludeConfig boolean
  • optional
  • default: false

Will include config object in export regardless of changed status.

Return:

object

public getAssembly(): Assembly | undefined source

Get the field's assembly if it has one

Return:

Assembly | undefined

public getDatatable(): Datatable source

If the field has a fieldType of "list", getDatatable will return the datatable instance that it relies on, otherwise will return null.

Return:

Datatable (nullable: true)

public getListOptions(): object[] source

Gets a list of options bound to a datatable.

Return:

object[]

Return Properties:

NameTypeAttributeDescription
title string
row_id string

The id of a datatable row. This value should to be applied to the Field.value to selelect specific row.

public getSelectedOption(): object source

Gets the selected list option.

Return:

object

Return Properties:

NameTypeAttributeDescription
title string
row_id string

The id of a datatable row.

public getSelectedOptionValue(datatableColumnId: string): string | number | boolean source

Gets the value of the selected field list based on the datatable column id.

Params:

NameTypeAttributeDescription
datatableColumnId string

Return:

string | number | boolean (nullable: true)

public hasNullDependency(): * source

Determines if the field has any null or undefined dependencies

Override:

BidEntity#hasNullDependency

Return:

*

public isDirty(): boolean source

Determines if instance is dirty.

Override:

BidEntity#isDirty

Return:

boolean

public referenceIsEmpty(): boolean source

Determines if a field has a dependency reference.

Return:

boolean

public setAssembly(assembly: Assembly | string): Assembly source

Adds the field to an assembly.

Params:

NameTypeAttributeDescription
assembly Assembly | string

The assembly entity or an assembly ref id

Return:

Assembly

the new assembly setting

public unsetAssembly(): void source

Removes any assembly reference from the field.

Return:

void