Options
All
  • Public
  • Public/Protected
  • All
Menu

Selective Generic Field

Hierarchy

Implements

Index

Constructors

constructor

Properties

Optional _data

_data?: DeepObject

Optional _uuid

_uuid?: string

config

config: InternalFieldConfig

Readonly fieldType

fieldType: string

globalConfig

globalConfig: GlobalConfig

types

types: Types

usingAutoFields

usingAutoFields: boolean

Optional validation

validation?: Validation

Optional zones

zones?: Record<string, ZoneInfo>

Accessors

data

  • get data(): undefined | DeepObject
  • set data(data: undefined | DeepObject | Record<string, any>): void

fullKey

  • get fullKey(): string

isClean

  • get isClean(): boolean
  • Is the field clean?

    The field is considered clean if there are no changes from the original.

    This is used by the editor to determine if there are changes pending.

    Returns boolean

isDataFormatValid

  • get isDataFormatValid(): boolean

isSimple

  • get isSimple(): boolean
  • Is the field simple?

    Complex fields usually have multiple inputs. This is used to determine how the field is shown in non-trivial view. For example, lists will not show a 'simple' view of list items if it uses a complex field.

    Returns boolean

isValid

  • get isValid(): boolean

key

  • get key(): string

rules

  • get rules(): Rules

uid

  • get uid(): string
  • Unique id value for the field. Usually a shortened form of the UUID.

    Returns string

uuid

  • get uuid(): string

value

  • get value(): any

Methods

classesForField

  • classesForField(): Record<string, boolean>
  • Generates a list of classes to apply to the field element.

    Returns Record<string, boolean>

classesForInput

  • classesForInput(zoneKey?: string): Record<string, boolean>
  • Generates a list of classes to apply to the input element.

    Parameters

    • zoneKey: string = DEFAULT_ZONE_KEY

    Returns Record<string, boolean>

classesForLabel

  • classesForLabel(zoneKey?: string): Record<string, boolean>
  • Generates a list of classes to apply to the label element.

    Parameters

    • zoneKey: string = DEFAULT_ZONE_KEY

    Returns Record<string, boolean>

cleanOriginalValue

  • cleanOriginalValue(value: any): any
  • The format of the original value may need to be cleaned up to be used by the editor in a consistent format.

    Parameters

    • value: any

      Original value from the source.

    Returns any

handleBlur

  • handleBlur(): void

handleInput

  • handleInput(evt: Event): void
  • Handle when the input changes value.

    Parameters

    • evt: Event

      Input event from changing value.

    Returns void

hasLostFocus

  • hasLostFocus(zoneKey?: string): boolean
  • Determines if the field has lost focus before for a zone.

    This is used for UI to determine when to display validation messsages for a better UX when they have not interacted with the field.

    Parameters

    • zoneKey: string = DEFAULT_ZONE_KEY

    Returns boolean

lock

  • lock(): void
  • Certain cases require the field to be locked while updating to prevent bad data mixing. This allows for manually locking the fields.

    Returns void

lostFocus

  • lostFocus(zoneKey?: string): void
  • Mark that the field has lost focus for a zone.

    This is used for UI to determine when to display validation messsages for a better UX when they have not interacted with the field.

    Parameters

    • zoneKey: string = DEFAULT_ZONE_KEY

    Returns void

render

  • render(): void

template

  • Template for determining how to render the field.

    The default field template has several levels of templates to make it easier for individual fields to override parts of template without needing to replicate a lot of internal template features.

    Base field template structure:

    template
    └── templateWrapper
    └── templateStructure
    ├── templateHeaderStructure
    │ ├── templateHeader
    │ └── templateLabel
    ├── templateInputStructure
    │ └── templateInput
    └── templateFooterStructure
    └── templateFooter

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateDataFormatInvalid

  • Template for showing the invalid data format messaging.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateErrors

  • Template for rendering the errors.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    • Optional zoneKey: string

      Zone to provide the error messages for.

    Returns TemplateResult<ResultType>

templateFooter

  • Template for rendering the field footer.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateFooterStructure

  • Template for rendering the field footer structure.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateHeader

  • Template for rendering the field header.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateHeaderStructure

  • Template for rendering the field header structure.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateHelp

  • Template for rendering the field help.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    • Optional zoneKey: string

      Zone to provide the error messages for.

    Returns TemplateResult<ResultType>

templateIconDeepLink

  • Template for rendering the icon for deep linking.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateIconValidation

  • Template for rendering the icon for validation.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateInput

  • Template for rendering the field input.

    The help text is part of the input template so complex inputs can use zones for the help text.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateInputStructure

  • Template for rendering the field input structure.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateLabel

  • Template for rendering the field label.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateStructure

  • Template for rendering the field structure.

    Used for controlling the order that parts of the field are rendered.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

templateWrapper

  • Template for rendering the field wrapper.

    Parameters

    • editor: SelectiveEditor

      Selective editor used to render the template.

    • data: DeepObject

      Data provided to render the template.

    Returns TemplateResult<ResultType>

unlock

  • unlock(): void
  • Certain cases require the field to be locked while updating to prevent bad data mixing. This allows for manually unlocking the fields.

    Returns void

updateOriginal

Generated using TypeDoc