Hierarchy

  • NumbersInputView
    • IntsInputView

Constructors

  • Public constructor.

    Parameters

    • Optional options: ViewOptions<WidgetModel, HTMLElement> & {
          options?: any;
      }

    Returns IntsInputView

Properties

$el: any
attributes: Record<string, any>
autocompleteList: HTMLDataListElement
cid: string
className?: string
collection: Collection<any>
datalistID: string
displayed: Promise<WidgetView>

A promise that resolves to the parent view when a child view is displayed.

el: HTMLDivElement
formatter: ((value: number) => string)

Type declaration

    • (value: number): string
    • Parameters

      • value: number

      Returns string

hoveredTag: null | HTMLElement = null
hoveredTagIndex: null | number = null
id?: string
inputIndex: number
layoutPromise: Promise<any>
luminoWidget: Widget
options: any
preventLoosingFocus: boolean
selection: null | Selection
stylePromise: Promise<any>
tagName: string
taginput: HTMLInputElement
taginputWrapper: HTMLDivElement
tags: HTMLElement[]
class_map: Dict<string> = ...

Accessors

  • get pWidget(): Widget
  • Deprecated

    Use luminoWidget instead (Since 8.0).

    Returns Widget

Methods

  • Parameters

    • selector: string

    Returns JQuery<HTMLElement>

  • Parameters

    • tagName: string

    Returns void

  • Returns void

  • Returns void

  • Parameters

    • attrs: ObjectHash

    Returns void

  • Parameters

    • el: HTMLElement

    Returns void

  • Add a new tag with a value of tagValue at the index position Return true if the tag was correctly added, false otherwise

    Parameters

    • index: number
    • tagValue: string

    Returns boolean

  • Parameters

    • eventName: string
    • callback: EventHandler
    • Optional context: any

    Returns IntsInputView

  • Parameters

    • eventMap: EventMap
    • Optional context: any

    Returns IntsInputView

  • Create msg callbacks for a comm msg.

    Returns ICallbacks

  • Create the string tag

    Parameters

    • value: string
    • index: number
    • selected: boolean

    Returns HTMLDivElement

  • Create and promise that resolves to a child view of a given model

    Type Parameters

    • VT extends DOMWidgetView<VT> = DOMWidgetView

    Parameters

    • child_model: DOMWidgetModel
    • Optional options: any

    Returns Promise<VT>

  • Type Parameters

    • VT extends WidgetView<VT> = WidgetView

    Parameters

    • child_model: WidgetModel
    • Optional options: any

    Returns Promise<VT>

  • Make an event delegation handler for the given eventName and selector and attach it to this.el. If selector is empty, the listener will be bound to this.el. If not, a new handler that will recursively traverse up the event target's DOM hierarchy looking for a node that matches the selector. If one is found, the event's delegateTarget property is set to it and the return the result of calling bound listener with the parameters given to the handler.

    This does not properly handle selectors for things like focus and blur (see https://github.com/jquery/jquery/blob/7d21f02b9ec9f655583e898350badf89165ed4d5/src/event.js#L442 for some similar exceptional cases).

    Parameters

    • eventName: string
    • listener: Function

    Returns IntsInputView

  • Parameters

    • eventName: string
    • selector: string
    • listener: Function

    Returns IntsInputView

  • Parameters

    • Optional events: _Result<EventsHash>

    Returns IntsInputView

  • Events hash or a method returning the events hash that maps events/selectors to methods on your View. For assigning events as object hash, do it like this: this.events = { "event:selector": callback, ... }; That works only if you set it in the constructor or the initialize method.

    Returns EventsHash

  • Returns the text that should be displayed in the tag element

    Parameters

    • value: string

    Returns string

  • Handle key events on the input element

    Parameters

    • event: KeyboardEvent

    Returns void

  • Handle a new value is added from the input element

    Parameters

    • event: Event

    Returns void

  • Handle message sent to the front end.

    Used to focus or blur the widget.

    Parameters

    • content: any

    Returns void

  • Public constructor

    Parameters

    • parameters: IInitializeParameters<WidgetModel>

    Returns void

  • Parameters

    • object: any
    • events: string
    • callback: EventHandler

    Returns IntsInputView

  • Parameters

    • object: any
    • eventMap: EventMap

    Returns IntsInputView

  • Parameters

    • object: any
    • events: string
    • callback: EventHandler

    Returns IntsInputView

  • Parameters

    • object: any
    • eventMap: EventMap

    Returns IntsInputView

  • Parameters

    • Optional eventName: null | string
    • Optional callback: null | EventHandler
    • Optional context: any

    Returns IntsInputView

  • Parameters

    • eventName: string
    • callback: EventHandler
    • Optional context: any

    Returns IntsInputView

  • Parameters

    • eventMap: EventMap
    • Optional context: any

    Returns IntsInputView

  • Parameters

    • events: string
    • callback: EventHandler
    • Optional context: any

    Returns IntsInputView

  • Parameters

    • eventMap: EventMap
    • Optional context: any

    Returns IntsInputView

  • Function that gets called when a tag with a given value is being dragged.

    Parameters

    • event: DragEvent
    • index: number
    • tagValue: any
    • origin: string

    Returns void

  • Function that gets called when a tag has been dragged on the tag at the index position.

    Parameters

    • event: DragEvent
    • index: number

    Returns void

  • Parameters

    • msg: Message

    Returns void

  • Returns any

  • Select tags from start to start + dx not included.

    Parameters

    • start: number
    • dx: number

    Returns void

  • Send a custom msg associated with this view.

    Parameters

    • content: {}
      • Optional buffers: ArrayBuffer[] | ArrayBufferView[]

      Returns void

    • Parameters

      • element: HTMLElement | JQuery<HTMLElement>

      Returns IntsInputView

    • Parameters

      • layout: LayoutModel
      • Optional oldLayout: LayoutModel

      Returns void

    • Parameters

      • style: StyleModel
      • Optional oldStyle: StyleModel

      Returns void

    • Parameters

      • class_map: Dict<string[]>
      • trait_name: string
      • Optional el: HTMLElement

      Returns void

    • Parameters

      • Optional object: any
      • Optional events: string
      • Optional callback: EventHandler

      Returns IntsInputView

    • Returns void

    • Parameters

      • eventName: string
      • Rest ...args: any[]

      Returns IntsInputView

    • Parameters

      • Optional eventName: string
      • Optional callback: EventHandler
      • Optional context: any

      Returns IntsInputView

    • Parameters

      • eventName: string
      • Optional selector: string
      • Optional listener: Function

      Returns IntsInputView

    • Parameters

      • selector: string
      • Optional listener: Function

      Returns IntsInputView

    • Returns IntsInputView

    • Update the contents of this view

      Called when the model is changed. The model may have been changed by another view or by a state update from the back-end.

      Returns void

    • Returns void

    • Update a given tag

      Parameters

      • tag: HTMLDivElement
      • value: any
      • index: number
      • selected: boolean

      Returns void

    • Returns void

    • Update the DOM classes applied to an element, default to this.el.

      Parameters

      • old_classes: string[]
      • new_classes: string[]
      • Optional el: HTMLElement

      Returns void

    • Update the DOM classes applied to the widget based on a single trait's value.

      Given a trait value classes map, this function automatically handles applying the appropriate classes to the widget element and removing classes that are no longer valid.

      Parameters

      class_map: dictionary Dictionary of trait values to class lists. Example: { success: ['alert', 'alert-success'], info: ['alert', 'alert-info'], warning: ['alert', 'alert-warning'], danger: ['alert', 'alert-danger'] }; trait_name: string Name of the trait to check the value of. el: optional DOM element handle, defaults to this.el Element that the classes are applied to.

      Parameters

      • class_map: Dict<string[]>
      • trait_name: string
      • Optional el: HTMLElement

      Returns void

    • Validate an input tag typed by the user, returning the correct tag type. This should be overridden in subclasses.

      Parameters

      • value: string

      Returns any

    • Do not use, prefer TypeScript's extend functionality.

      Parameters

      • properties: any
      • Optional classProperties: any

      Returns any

    Generated using TypeDoc