Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace utils

Index

Properties

UISchema

UISchema: { UI_PROPERTY: string; copyOptions: (pointer: JSONPointer, editron: default) => EditorSettings; enumOptions: (schema: JSONSchema) => any[]; extendSchema: <T>(rootSchema: T) => T; getBreadcrumps: (pointer: JSONPointer, editron: default) => string[]; getDefaultOption: (schema: JSONSchema, option: string) => "" | any; getEditronOptions: (schema: JSONSchema) => any; getOption: (pointer: JSONPointer, editron: default, ...options: string[]) => any; getTitle: (pointer: JSONPointer, editron: default) => any; isPointer: (string: JSONPointer) => boolean }

Type declaration

  • UI_PROPERTY: string
  • copyOptions: (pointer: JSONPointer, editron: default) => EditorSettings
      • Returns the resolved copy of an options object. This method is used by the editron to help setup the main options object of an editor instance. It is simplified, in that it currently does not resolve any reference on the current data

        Parameters

        Returns EditorSettings

        a resolved copy of the editron:ui settings

  • enumOptions: (schema: JSONSchema) => any[]
  • extendSchema: <T>(rootSchema: T) => T
      • <T>(rootSchema: T): T
      • Ensures each schema contains a valid schema[UI_PROPERTY] object

        Type parameters

        Parameters

        • rootSchema: T

        Returns T

        extended clone of json-schema

  • getBreadcrumps: (pointer: JSONPointer, editron: default) => string[]
  • getDefaultOption: (schema: JSONSchema, option: string) => "" | any
      • Parameters

        Returns "" | any

  • getEditronOptions: (schema: JSONSchema) => any
  • getOption: (pointer: JSONPointer, editron: default, ...options: string[]) => any
      • Returns the first defined option set in schema. Supports relative and absolute pointers in data

        Parameters

        • pointer: JSONPointer
        • editron: default
        • Rest ...options: string[]

          a list of option properties. The first non-empty option will be returned

        Returns any

        the first non-empty option

  • getTitle: (pointer: JSONPointer, editron: default) => any
  • isPointer: (string: JSONPointer) => boolean

array

array: { addItem: any; cloneItem: any; moveElement: any; moveItem: any; removeItem: any }

Type declaration

  • addItem: function
    • addItem(pointer: string, editron: default, index: number): void
  • cloneItem: function
    • cloneItem(pointer: string, editron: default, index: number): void
  • moveElement: function
    • moveElement(list: any[], index: number, destinationIndex: number): void
    • Parameters

      • list: any[]
      • index: number
      • destinationIndex: number

      Returns void

  • moveItem: function
    • moveItem(pointer: string, editron: default, index: number, destinationIndex: number): void
  • removeItem: function
    • removeItem(pointer: string, editron: default, index: number): void

selection

selection: { focusNextInput: (editron: default, direction?: Direction, options?: Options) => boolean; getActiveInput: (editron: default, parent?: HTMLElement) => FocusableElement | false; getAvailableInputs: (parent: HTMLElement) => FocusableElement[]; getNextInput: (editron: default, direction?: Direction, __namedParameters?: { parent: any }) => false | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; mayBlur: (element: FocusableElement | Blurable, direction: Direction) => boolean }

Type declaration

  • focusNextInput: (editron: default, direction?: Direction, options?: Options) => boolean
      • move the focus from current element to next visible input-element inputs being (textarea, input and select with an id-attribute containing a json-pointer-id)

        Parameters

        Returns boolean

        true - if there was a new target was found or the move prevented

  • getActiveInput: (editron: default, parent?: HTMLElement) => FocusableElement | false
      • (editron: default, parent?: HTMLElement): FocusableElement | false
      • returns the current active (editron) input element or false

        Parameters

        • editron: default
        • parent: HTMLElement = ...

        Returns FocusableElement | false

  • getAvailableInputs: (parent: HTMLElement) => FocusableElement[]
      • (parent: HTMLElement): FocusableElement[]
      • returns a list of available editron input-elements (including textaras, select)

        Parameters

        • parent: HTMLElement

        Returns FocusableElement[]

  • getNextInput: (editron: default, direction?: Direction, __namedParameters?: { parent: any }) => false | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement
      • (editron: default, direction?: Direction, __namedParameters?: { parent: any }): false | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement
      • returns the next input element in direction or false if it is last/first

        Parameters

        • editron: default
        • direction: Direction = "down"
        • __namedParameters: { parent: any } = ...
          • parent:

        Returns false | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement

  • mayBlur: (element: FocusableElement | Blurable, direction: Direction) => boolean
      • (element: FocusableElement | Blurable, direction: Direction): boolean
      • returns true if one may trigger blur on the element via cursor movement

        Parameters

        • element: FocusableElement | Blurable
        • direction: Direction

        Returns boolean

Functions

addItem

  • Request to insert an array child item at the given pointer. If multiple options are present, a dialogue is opened to let the user select the appropriate type of child (oneof).

    Parameters

    • dataService: DataService
    • schemaService: SchemaService
    • locationService: LocationService
    • pointer: JSONPointer

      to array on which to insert the child

    • index: number = 0

      index within array, where the child should be inserted (does not replace). Default: 0

    Returns void

createElement

  • createElement(selector: string, attributes?: HTMLAttributes): HTMLElement

createProxy

  • createProxy(options?: Options | Foxy): Foxy

isEmpty

  • isEmpty(value: any): boolean

isNodeContext

  • isNodeContext(): boolean

populated

  • populated<T, K>(value: any, returnIf?: K, returnElse?: T): boolean | T | K
  • Type parameters

    • T: unknown

    • K: unknown

    Parameters

    • value: any
    • Optional returnIf: K
    • Optional returnElse: T

    Returns boolean | T | K

selectEditor

  • Selects an editor based on the given schema

    Parameters

    • editors: EditorPlugin[]
    • pointer: JSONPointer

      current pointer in data

    • editron: default
    • options: any

      the complete and resolved (UISchema) options object (editron:ui + additions)

    Returns EditorPlugin | false | undefined

    The constructor of the chosen editor od false if no editor could be resolved or is denied

Generated using TypeDoc