This repository has been archived by the owner on Jul 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
PluginSetting
Danil Andreev edited this page Nov 18, 2020
·
1 revision
PluginSetting - is a base class for all plugin settings fields. It contains required methods for all fields, defines global methods for plugin settigns management.
class PluginSetting implements WebJsonable
Name | Access | Type | Description |
---|---|---|---|
type | private | string | The type of a field. Fills automatically when you creating a field with derived class. |
name | public | readonly string | The key value of the field. Field input value will be saved with that name. |
label | public | readonly string | Label - is a nice name of the variable for the UI. |
id | public | readonly string | number | Custom id for user needs. |
nullable | public | readonly boolean | If true - field is not required. |
Name | Access | Type | Description |
---|---|---|---|
types | public | string[] | Available field types. Used for validation. |
nameRegExp | public | RegExp | Regular expression for name field validation. |
public static validateName(input: any): boolean
Function, designed to validate setting name.
protected setType(type: string): void
Sets the type of the field.
public getType(): string
Returns a type of the field.
isValid(): boolean
If validation has no errors will return true, else - false.
public getValidation(): ValidationError
Returns validation error object.
public validatePayload(payload: any): any
Validates payload. If it is OK - function will return payload. If not - throw a Validation Error.
public getJSON(): object
Returns serialized field.
- Fields
- Entities
- Errors