Utilities
Utility Service
Constructor Summary
Public Constructor | ||
public |
Creates an instance of the Utility service |
Member Summary
Public Members | ||
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
addStringAt(source: string, string: string, position: number, moveCaret: boolean): * Adds a string to the input at a given position |
|
public |
Transforms an arbitrary string to camelCase |
|
public |
countInArray(array: Array, value: string): * Counts the number of duplicates in a given array |
|
public |
getButtonClass(button: string): string Adds default classes to a given button |
|
public |
getButtonDisplayName(button: string, display: object, mergeDisplay: boolean): * Returns the display (label) name for a given button |
|
public |
getDefaultDiplay(): {"{bksp}": string, "{backspace}": string, "{enter}": string, "{shift}": string, "{shiftleft}": string, "{shiftright}": string, "{alt}": string, "{s}": string, "{tab}": string, "{lock}": string, "{capslock}": string, "{accept}": string, "{space}": string, "{//}": string, "{esc}": string, "{escape}": string, "{f1}": string, "{f2}": string, "{f3}": string, "{f4}": string, "{f5}": string, "{f6}": string, "{f7}": string, "{f8}": string, "{f9}": string, "{f10}": string, "{f11}": string, "{f12}": string, "{numpaddivide}": string, "{numlock}": string, "{arrowup}": string, "{arrowleft}": string, "{arrowdown}": string, "{arrowright}": string, "{prtscr}": string, "{scrolllock}": string, "{pause}": string, "{insert}": string, "{home}": string, "{pageup}": string, "{delete}": string, "{end}": string, "{pagedown}": string, "{numpadmultiply}": string, "{numpadsubtract}": string, "{numpadadd}": string, "{numpadenter}": string, "{period}": string, "{numpaddecimal}": string, "{numpad0}": string, "{numpad1}": string, "{numpad2}": string, "{numpad3}": string, "{numpad4}": string, "{numpad5}": string, "{numpad6}": string, "{numpad7}": string, "{numpad8}": string, "{numpad9}": string} Default button display labels |
|
public |
getUpdatedInput(button: string, input: string, options: object, caretPos: number, moveCaret: boolean): * Returns the updated input resulting from clicking a given button |
|
public |
handleMaxLength(inputObj: object, options: object, updatedInput: string): boolean Determines whether the maxLength has been reached. |
|
public |
isMaxLengthReached(): * Gets the current value of maxLengthReached |
|
public |
Removes an amount of characters at a given position |
|
public |
updateCaretPos(length: number, minus: boolean) Moves the cursor position by a given amount |
|
public |
updateCaretPosAction(instance: object, length: number, minus: boolean) Action method of updateCaretPos |
Public Constructors
Public Methods
public addStringAt(source: string, string: string, position: number, moveCaret: boolean): * source
Adds a string to the input at a given position
Return:
* |
public camelCase(string: string): * source
Transforms an arbitrary string to camelCase
Params:
Name | Type | Attribute | Description |
string | string | The string to transform. |
Return:
* |
public countInArray(array: Array, value: string): * source
Counts the number of duplicates in a given array
Return:
* |
public getButtonClass(button: string): string source
Adds default classes to a given button
Params:
Name | Type | Attribute | Description |
button | string | The button's layout name |
public getButtonDisplayName(button: string, display: object, mergeDisplay: boolean): * source
Returns the display (label) name for a given button
Return:
* |
public getDefaultDiplay(): {"{bksp}": string, "{backspace}": string, "{enter}": string, "{shift}": string, "{shiftleft}": string, "{shiftright}": string, "{alt}": string, "{s}": string, "{tab}": string, "{lock}": string, "{capslock}": string, "{accept}": string, "{space}": string, "{//}": string, "{esc}": string, "{escape}": string, "{f1}": string, "{f2}": string, "{f3}": string, "{f4}": string, "{f5}": string, "{f6}": string, "{f7}": string, "{f8}": string, "{f9}": string, "{f10}": string, "{f11}": string, "{f12}": string, "{numpaddivide}": string, "{numlock}": string, "{arrowup}": string, "{arrowleft}": string, "{arrowdown}": string, "{arrowright}": string, "{prtscr}": string, "{scrolllock}": string, "{pause}": string, "{insert}": string, "{home}": string, "{pageup}": string, "{delete}": string, "{end}": string, "{pagedown}": string, "{numpadmultiply}": string, "{numpadsubtract}": string, "{numpadadd}": string, "{numpadenter}": string, "{period}": string, "{numpaddecimal}": string, "{numpad0}": string, "{numpad1}": string, "{numpad2}": string, "{numpad3}": string, "{numpad4}": string, "{numpad5}": string, "{numpad6}": string, "{numpad7}": string, "{numpad8}": string, "{numpad9}": string} source
Default button display labels
Return:
{"{bksp}": string, "{backspace}": string, "{enter}": string, "{shift}": string, "{shiftleft}": string, "{shiftright}": string, "{alt}": string, "{s}": string, "{tab}": string, "{lock}": string, "{capslock}": string, "{accept}": string, "{space}": string, "{//}": string, "{esc}": string, "{escape}": string, "{f1}": string, "{f2}": string, "{f3}": string, "{f4}": string, "{f5}": string, "{f6}": string, "{f7}": string, "{f8}": string, "{f9}": string, "{f10}": string, "{f11}": string, "{f12}": string, "{numpaddivide}": string, "{numlock}": string, "{arrowup}": string, "{arrowleft}": string, "{arrowdown}": string, "{arrowright}": string, "{prtscr}": string, "{scrolllock}": string, "{pause}": string, "{insert}": string, "{home}": string, "{pageup}": string, "{delete}": string, "{end}": string, "{pagedown}": string, "{numpadmultiply}": string, "{numpadsubtract}": string, "{numpadadd}": string, "{numpadenter}": string, "{period}": string, "{numpaddecimal}": string, "{numpad0}": string, "{numpad1}": string, "{numpad2}": string, "{numpad3}": string, "{numpad4}": string, "{numpad5}": string, "{numpad6}": string, "{numpad7}": string, "{numpad8}": string, "{numpad9}": string} |
public getUpdatedInput(button: string, input: string, options: object, caretPos: number, moveCaret: boolean): * source
Returns the updated input resulting from clicking a given button
Return:
* |
public handleMaxLength(inputObj: object, options: object, updatedInput: string): boolean source
Determines whether the maxLength has been reached. This function is called when the maxLength option it set.
public removeAt(source: string, position: number, moveCaret: boolean): * source
Removes an amount of characters at a given position
Return:
* |
public updateCaretPos(length: number, minus: boolean) source
Moves the cursor position by a given amount