Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SfInputComponent

API reference for SfInputComponent

import {SfInputModule} from "@progress/sitefinity-component-framework";


selector: sf-input

Hierarchy

  • SfInputComponent

Implements

  • ControlValueAccessor
  • AfterViewInit
  • OnInit
  • OnChanges

Index

Constructors

constructor

  • Parameters

    • window: any

    Returns SfInputComponent

Properties

ariaLabel

ariaLabel: string

Sets the aria-label attribute of the input

ariaLabelValue

ariaLabelValue: string

Aria-label attribute value

ariaLabelledby

ariaLabelledby: string

Sets the aria-labelledby attribute of the input

autocomplete

autocomplete: string

Sets the autocomplete attribute. Valid for text mode only

autofocus

autofocus: boolean

Sets whether to autofocus the input

disableStepDown

disableStepDown: boolean

Sets whether to disable the step down

disableStepUp

disableStepUp: boolean

Sets whether to disable the step up

disabled

disabled: boolean

Sets the input to be displayed as disabled. Valid for types 'text' and 'textarea'

droppedTooltip

droppedTooltip: boolean

Sets whether the tooltip is visible

Private enableCharCounter

enableCharCounter: boolean = false

Used to determine whether the char counter should be enabled when changing the focus

enableStepperArrows

enableStepperArrows: boolean

Enables stepper arrows for type number

Private helperInput

helperInput: HTMLInputElement

The internal data model used for html sanitize

hint

hint: string | MarkupSection[]

The user friendly message that describes what this input is about

innerValue

innerValue: any = ""

The inner value

Private inputElement

inputElement: any

Gets the input element

isHintString

isHintString: boolean

Sets whether the hint is from type string

label

label: string

The label of the input

look

look: string

Sets the additional css styles for the component

max

max: number

Sets the max attribute of the input

maxlength

maxlength: any

Sets the maxlength attribute of the input and the textarea

min

min: number

Sets the min attribute of the input

minlength

minlength: any

Sets the minlength attribute of the input and the textarea

name

name: string

Sets the name and the id attributes of the input

onArrowDown

onArrowDown: EventEmitter<any> = new EventEmitter()

onArrowDown emitter Triggered when the arrow down key is pressed

onArrowUp

onArrowUp: EventEmitter<any> = new EventEmitter()

onArrowUp emitter Triggered when the arrow up key is pressed

onBlur

onBlur: EventEmitter<any> = new EventEmitter<any>()

Emits whenever the field loses focus

Private onChangeCallback

onChangeCallback: function = noop

Placeholder for the callback which is later provided by the Control Value Accessor

Type declaration

    • (_: any): void
    • Parameters

      • _: any

      Returns void

onClear

onClear: EventEmitter<any> = new EventEmitter<any>()

Emits whenever the input is cleared

onEnter

onEnter: EventEmitter<any> = new EventEmitter<any>()

Emits whenever the Enter key is pressed

onEscape

onEscape: EventEmitter<any> = new EventEmitter()

onEscape emitter Triggered when the escape key is pressed

onFocus

onFocus: EventEmitter<any> = new EventEmitter<any>()

Emits whenever the field gains focus

onInput

onInput: EventEmitter<any> = new EventEmitter<any>()

Emits whenever the value of the input changes

Private onTouchedCallback

onTouchedCallback: function = noop

Placeholder for the callback which is later provided by the Control Value Accessor

Type declaration

    • (): void
    • Returns void

pattern

pattern: any

Sets the pattern attribute of the input and the textarea

placeholder

placeholder: string

The placeholder for the input that apperas with a little grey background when the input does not have a value

readonly

readonly: boolean

Sets the input to be dispalyed in readonly mode. Valid for types 'text' and 'textarea'

recommendedCharacters

recommendedCharacters: number

Recommended characters shows a character counter to the side of the input that gives a visual feedback when the user is in valid range of the value

required

required: boolean

Sets the required attribute of the input and the textarea

rows

rows: number

Sets the rows attribute of the textarea

showCharCounter

showCharCounter: boolean

Whether to show a char counter next to the input

step

step: number

Sets the step attribute of the input

steppersButtonLook

steppersButtonLook: string

Sets the css modifiers of the steppers buttons

steppersLook

steppersLook: string

Sets the css modifiers of the steppers

type

type: string = "text"

Sets the type of the input - text, textarea, number, title (default: text)

unit

unit: string

Sets the unit to be displayed after the input. Eg. kg, km/h

unitCssClass

unitCssClass: string

Sets the css class for the unit

unitLook

unitLook: string

Sets the css modifiers of the unit

unitPosition

unitPosition: string

A css value that controls where the unit value is placed

validationMessages

validationMessages: Array<string>

Sets the validation messages

Private window

window: any

Accessors

charCounterVisible

  • get charCounterVisible(): boolean
  • Sets whether the char counter is visible

    Returns boolean

exceedRecommendedCharacters

  • get exceedRecommendedCharacters(): boolean
  • Sets whether the recommended characters count is exceeded

    Returns boolean

showClearButton

  • get showClearButton(): boolean
  • Gets if the clear button should be visible

    Returns boolean

value

  • get value(): any
  • set value(v: any): void
  • Get accessor

    Returns any

  • Set accessor including call the onchange callback

    Parameters

    • v: any

    Returns void

Methods

Private checkHintType

  • checkHintType(): void
  • Checks hint type

    Returns void

checkShouldDisableSteps

  • checkShouldDisableSteps(value: string, stepUp?: boolean): boolean
  • Check whether to disable steppers

    Parameters

    • value: string
    • Default value stepUp: boolean = true

    Returns boolean

Private enforceMinMax

  • enforceMinMax(value: any): string
  • Enforces min and max for input

    Parameters

    • value: any

    Returns string

focus

  • focus(): void
  • Focuses the input

    Returns void

focusTitle

  • focusTitle(): void
  • Focuses title type

    Returns void

generateCssClassList

  • generateCssClassList(): string
  • Generates input css class

    Returns string

generateSteppersLook

  • generateSteppersLook(): string
  • Generates steppers css modifiers/look

    Returns string

generateUnitCssClassList

  • generateUnitCssClassList(): string
  • Generates unit css class

    Returns string

Private getAriaLabel

  • getAriaLabel(): string
  • Get aria-label value depending on the Inputs

    Returns string

handleArrowDown

  • handleArrowDown(event: KeyboardEvent): void
  • Handles arrow down key pressed

    Parameters

    • event: KeyboardEvent

    Returns void

handleArrowUp

  • handleArrowUp(event: KeyboardEvent): void
  • Handles arrow up key pressed

    Parameters

    • event: KeyboardEvent

    Returns void

handleBlur

  • handleBlur(event: any): void
  • Set touched on blur Handles blur event

    Parameters

    • event: any

    Returns void

handleClear

  • handleClear(): void
  • Handles clear event

    Returns void

handleEnter

  • handleEnter(event: any): void
  • Handles enter event

    Parameters

    • event: any

    Returns void

handleEscape

  • handleEscape(event: KeyboardEvent): void
  • Handles escape key pressed

    Parameters

    • event: KeyboardEvent

    Returns void

handleFocus

  • handleFocus(event: any): void
  • Handles focus event

    Parameters

    • event: any

    Returns void

handleInput

  • handleInput(event: any): void
  • Handles input event

    Parameters

    • event: any

    Returns void

handlePaste

  • handlePaste(event: ClipboardEvent): void
  • Handles paste

    Parameters

    • event: ClipboardEvent

    Returns void

ngAfterViewInit

  • ngAfterViewInit(): void
  • Returns void

ngOnChanges

  • ngOnChanges(changes: SimpleChanges): void
  • Parameters

    • changes: SimpleChanges

    Returns void

ngOnInit

  • ngOnInit(): void
  • Returns void

onToggleTooltip

  • onToggleTooltip(): void
  • Handles toggling of tooltip

    Returns void

placeCaretAtEnd

  • placeCaretAtEnd(el: HTMLElement): void
  • Sets the cursor position at the end

    Parameters

    • el: HTMLElement

    Returns void

registerOnChange

  • registerOnChange(fn: any): void
  • From ControlValueAccessor interface

    Parameters

    • fn: any

    Returns void

registerOnTouched

  • registerOnTouched(fn: any): void
  • From ControlValueAccessor interface

    Parameters

    • fn: any

    Returns void

stepDown

  • stepDown(): void
  • Step down method

    Returns void

stepUp

  • stepUp(): void
  • Step up method

    Returns void

writeValue

  • writeValue(value: any): void
  • From ControlValueAccessor interface

    Parameters

    • value: any

    Returns void

Generated using TypeDoc