Class: Supplier

BIM. Supplier

Stores information about a product supplier or manufacturer.


new Supplier( [config] [, typeName])

Creates a new supplier or manufacturer.

Parameters:
Name Type Argument Description
config object <optional>

An optional configuration object.

Properties of config:
Name Type Argument Description
name string <optional>

A human-readable name for this supplier.

uuid string <optional>

A universally unique identifier of this entity.

contactPerson string <optional>

The name of the primary contact person at the supplier.

contactEmail string <optional>

An email address for the primary contact person.

contactPhone string <optional>

A phone number for the primary contact person.

contactAddress string <optional>

A street or contact address for the supplier.

website string <optional>

The website URL for this supplier.

notes string <optional>

Any notes or comments about the supplier.

typeName string <optional>

An additional parameter typically used by subclasses to set the instance name without modifying the config object.

Author:
  • drajmarsh

Extends

Members


:string

className <readonly>

The name of the subclass for this object instance.

This name must match the name of this class within the PD.Registry. Thus, the base implementation simply references this.constructor.getClassName() to ensure that this is always the case even for subclasses. As a result, there is rarely any need to override this method.

This property is used when copying, storing and exporting data for subclass instances to ensure that they are recreated as instances of the right class.

Type
  • string
Inherited From:
Overrides:

:string

contactEmail

The contact email address of the supplier.

Type
  • string

:string

contactPerson

The name of a contact person.

Type
  • string

:string

contactPhone

The contact phone number of the supplier.

Type
  • string

:string

country

The two letter country code (from ISO 3166).

Type
  • string
Inherited From:
Overrides:

:string

description

A brief description of the address or addressee.

Type
  • string
Inherited From:
Overrides:

:string

displayName <readonly>

The name to display for this class within the user interface.

Type
  • string
Inherited From:
Overrides:

:string

email

One or more email addresses by which email messages may be received.

Type
  • string
Inherited From:
Overrides:

:string

iconName <readonly>

The name of the SVG icon to associate with this object instance.

This name should match the name of the icon associated with this class within the PD.Registry. Thus, the default implementation simply references this.constructor.getClassName() to ensure that this is always the case, even for subclasses. However, you can override this property if you want a different icon dependant on other properties of the class instance, as shown in the example below.

Type
  • string
Inherited From:
Overrides:
Example
// Overriding the icon name.

MyElements.Table = class extends PD.Base {
    /// ...
    get iconName() {
        if (this.hasRoundTop) return 'MyElements.Table.Round';
        return this.constructor.getClassName();
    };
    /// ...
 };

:string

internal

An organization-defined address for internal mail delivery.

Type
  • string
Inherited From:
Overrides:

:boolean

isAddress <readonly>

A flag identifying this object as BIM address details.

Type
  • boolean
Inherited From:
Overrides:

:boolean

isSupplier <readonly>

A flag identifying this object as BIM supplier details.

Type
  • boolean

:string

name

A human-readable name for this item instance.

Type
  • string
Inherited From:
Overrides:

:string

notes

Any notes or comments about the supplier.

Type
  • string

:string

postalAddress

A postal address that is implied by an identifiable mail drop.

Type
  • string
Inherited From:
Overrides:

:string

postalCode

The code that is used by the country's postal service.

Type
  • string
Inherited From:
Overrides:

:string

purpose

A user-defined purpose of the address.

This value is beyond the enumeration values provided by the purpose property. When this property has a value, the type should be set to OTHER.

Type
  • string
Inherited From:
Overrides:

:string

regionOrState

The name of the region, state or county the address is in.

Type
  • string
Inherited From:
Overrides:

:string

social

One or more social media IDs or addresses for any other means of communication.

Type
  • string
Inherited From:
Overrides:

:string

streetAddress

A physical street address.

NOTE: A street address may occupy several lines. Whilst the content of address lines may vary in different countries, it is expected that normal usage will incorporate relevant elements of the following address concepts:

  • A location within a building (e.g. 3rd Floor)
  • Building name (e.g. Interoperability House)
  • Street number (e.g. 6400)
  • Street name (e.g. Alliance Boulevard).
Type
  • string
Inherited From:
Overrides:

:string

telephone

One or more telephone numbers by which telephone calls/messages may be received.

Type
  • string
Inherited From:
Overrides:

:string

townOrCity

The name of the town or city the address is in.

Type
  • string
Inherited From:
Overrides:

:BIM.ADDRESS

type

The type of address this represents.

Type
Inherited From:
Overrides:

:string

uuid

A universally unique identifier for the item instance.

Type
  • string
Inherited From:
Overrides:

:string

website

One or more website addresses as full URL/URI.

These refer to the world wide web address at which the preliminary page of information for the person, supplier or organization can be located.

Information on the world wide web for a person or organization may be separated into a number of pages and across a number of host sites, all of which may be linked together. It is assumed that all such information may be referenced from a single page that is termed the home page for that person or organization.

Type
  • string
Inherited From:
Overrides:

:BIM.Supplier

Core <static, readonly>

The default supplier for core components that are part of the framework.

Type

:object

icon <static>

The icon associated with this class in the PD.Registry.

See PD.Base.icon for more information on this object format.

Type
  • object

Methods


checkDynamicParameter(param, group [, host])

Provides an opportunity to dynamically limit the value and/or range of each parameter.

This method is called whenever a dynamic parameter is interactively changed. The param argument gives access to the parameter being changed whilst the group argument gives access to other parameters within the same parameter group.

NOTE: Range validation in this method is not absolutely required, but doing so can prevent unnecessary model rebuilds due to out-of-range parameters being different from their previous values, even though the object's geometry will not actually change due to range constraints within the subclasses rebuild() method. Thus, it is usually best to do them here so that someone's future airport model is not entirely rebuilt each time they try to set a too-large length in your custom door handle component.

Parameters:
Name Type Argument Description
param PD.Parameter

The parameter that is being interactively changed.

group PD.ParamGroup

The group that the dynamic parameter belongs to.

host object <optional>

For components only, the parent or host object that called this method.

Inherited From:
Overrides:
Example
checkDynamicParameter(param, group, host) {

     switch (param.name) {

         case 'height':
             if (param.value < 1.0) param.value = 1.0;
             break;

         case 'width':
         case 'length':
             if (param.value < 100.0) param.value = 100.0;
             if (this.standardBedSize > 0) { // If not custom.
                 group.setParameterValue('standardBedSize', 0);
                 this.standardBedSize = 0; // Make it custom.
             }
             break;

         case 'standardBedSize': {
                 const std_bed = this.getStandardBedSize(Math.round(param.value));
                 if (std_bed != null) {
                     const [ width, length ] = (PD.DIMENSION.useImperial) ? std_bed.sizeImperial : std_bed.sizeMetric;
                     this.width = PD.Utils.toNumber(width, this.width);
                     group.setParameterValue('width', this.width);
                     this.length = PD.Utils.toNumber(length, this.length);
                     group.setParameterValue('length', this.length);
                 }
             } break;

       }

 };

clone()

Creates a copy of this instance with different name and uuid.

Inherited From:
Overrides:
Returns:

Returns a new instance with copied values.

Type
PD.Base | null

fromJSON(data)

Safely copy properties from a source object.

See the PD.Base#fromJSON method for more details.

Parameters:
Name Type Description
data object

The source object containing data to copy.

Overrides:
Returns:

Returns this instance to support method chaining.

Type
BIM.Supplier

toJSON( [data])

Converts the supplier data to a simple POJO for JSON storage.

This method is used to copy, store and save the data for this supplier, so the returned object must have all the properties required be able to be able to fully rebuild it when passed to the class constructor.

See the PD.Base#toJSON method for more details.

Parameters:
Name Type Argument Description
data object <optional>

An optional parent object to append this data to.

Overrides:
Returns:

Returns a JSON object.

Type
object

getClassDescription() <static>

A brief description of this class to accompany its icon.

Returns:

Returns a brief description.

Type
string

getClassName() <static>

The name of this class within the PD.Registry.

See PD.Base.getClassName for more details as this is required for use with the PD.Registry.

Returns:

Returns the registered name of this class.

Type
string