Function
Static Public Summary | ||
public |
Return an empty function |
|
public |
Adds the specified class to the passed element |
|
public |
Add event handler for specified event on passed element |
|
public |
Bind passed function to passed scope |
|
public |
cancelEvt(evt: Event) Cancels the event if it is cancelable, without stopping further propagation of the event. |
|
public |
contains(term: String, data: String, exactMatch: Boolean, caseSensitive: Boolean, ignoreDiacritics: Boolean): Boolean Checks if passed data contains the searched term |
|
public |
Creates and returns a checklist item |
|
public |
Creates an html element with given collection of attributes |
|
public |
Creates and returns an option element |
|
public |
createText(txt: String): Object Returns a text node with given text |
|
public |
dateSortAsc(First: Date, Second: Date): Number Compare function for sorting passed dates in ascending manner according to the corresponding UTC numeric value (returned by getTime) |
|
public |
dateSortDesc(First: Date, Second: Date): Number Compare function for sorting passed dates in descending manner according to the corresponding UTC numeric value (returned by getTime) |
|
public |
defaultsArr(value: Array | Any, default: Array): Array | Any If passed value is not of array type return the default value otherwise return the value itself |
|
public |
defaultsBool(value: Boolean | Any, default: Boolean): Boolean | Any If passed value is not of boolean type return the default value otherwise return the value itself |
|
public |
defaultsFn(value: Function | Any, default: Function): Function | Any If passed value is not of function type return the default value otherwise return the value itself |
|
public |
defaultsNb(value: Number | Any, default: Number): Number | Any If passed value is not of number type return the default value otherwise return the value itself |
|
public |
defaultsStr(value: String | Any, default: String): String | Any If passed value is not of string type return the default value otherwise return the value itself |
|
public |
Returns the element matching the supplied Id |
|
public |
getFirstTextNode(node: NodeElement): String Returns the first text node contained in the supplied node |
|
public |
Returns text + text of children of given node |
|
public |
Checks if given item can be found in the passed collection |
|
public |
Determine whether the passed elements is assigned the given class |
|
public |
hasHashChange(): * Checks if browser has onhashchange event |
|
public |
hasStorage(): * Checks if browser has Storage feature |
|
public |
ignoreCase(First: String, Second: String): Number Case insensitive compare function for passed strings |
|
public |
Check passed argument is an array |
|
public |
Check passed argument is a boolean |
|
public |
Check passed argument is empty (undefined, null or empty string) |
|
public |
Checks if passed string is empty |
|
public |
Check passed argument is a function |
|
public |
isKeyPressed(evt: Event, keyCodes: Array): * Check code of pressed key is one of the expected key codes |
|
public |
Check passed argument is null |
|
public |
Check passed argument is a number |
|
public |
Check passed argument is an object |
|
public |
Check passed argument is a string |
|
public |
Check passed argument is undefined |
|
public |
Returns the Unicode value of pressed key |
|
public |
Returns passed string as lowercase if caseSensitive flag set false. |
|
public |
numSortAsc(First: Number, Second: Number): Number Compare function for sorting passed numbers in ascending manner |
|
public |
numSortDesc(First: Number, Second: Number): Number Compare function for sorting passed numbers in descending manner |
|
public |
Takes a string, removes all formatting/cruft and returns the raw float value |
|
public |
removeClass(ele: DOMElement, cls: String) Removes the specified class to the passed element |
|
public |
removeElm(node: DOMElement): DOMElement Removes passed node from DOM |
|
public |
Remove event handler for specified event on passed element |
|
public |
Makes regex safe string by escaping special characters from passed string |
|
public |
sortDateStr(Compare: Function, locale: String): Function Curried compare function for sorting passed formatted dates in desired fashion according to supplied compare function and locale |
|
public |
sortNumberStr(Compare: Function, decimal: String): Function Curried compare function for sorting passed formatted numbers in desired fashion according to supplied compare function and decimal separator |
|
public |
stopEvt(evt: Event) Prevents further propagation of the current event in the bubbling phase |
|
public |
Returns list of element matching the supplied tag name |
|
public |
targetEvt(evt: Event): DOMElement Reference to the object that dispatched the event |
|
public |
toCamelCase(text: String): String Camelize a string, cutting the string by multiple separators like hyphens, underscores and spaces. |
|
public |
Removes whitespace from both sides of passed string |
|
public |
Generate a string in the format of a UUID (Universally Unique IDentifier). |
Static Public
public EMPTY_FN(): Function source
import {EMPTY_FN} from 'tablefilter/src/types.js'
Return an empty function
public addClass(ele: DOMElement, cls: String) source
import {addClass} from 'tablefilter/src/dom.js'
Adds the specified class to the passed element
Params:
Name | Type | Attribute | Description |
ele | DOMElement | DOM element |
|
cls | String | CSS class name |
public addEvt(obj: DOMElement, type: String, Handler: Function, capture: Boolean) source
import {addEvt} from 'tablefilter/src/event.js'
Add event handler for specified event on passed element
public bound(fn: Function, scope: Object): * source
import {bound} from 'tablefilter/src/event.js'
Bind passed function to passed scope
Return:
* |
public cancelEvt(evt: Event) source
import {cancelEvt} from 'tablefilter/src/event.js'
Cancels the event if it is cancelable, without stopping further propagation of the event.
Params:
Name | Type | Attribute | Description |
evt | Event | Event on the DOM |
public contains(term: String, data: String, exactMatch: Boolean, caseSensitive: Boolean, ignoreDiacritics: Boolean): Boolean source
import {contains} from 'tablefilter/src/string.js'
Checks if passed data contains the searched term
public createCheckItem(id: String, chkValue: String, labelText: String, extraAttr: Array): Object source
import {createCheckItem} from 'tablefilter/src/dom.js'
Creates and returns a checklist item
public createElm(tag: String, an: Array): Object source
import {createElm} from 'tablefilter/src/dom.js'
Creates an html element with given collection of attributes
public createOpt(text: String, value: String, isSel: Boolean): Object source
import {createOpt} from 'tablefilter/src/dom.js'
Creates and returns an option element
public createText(txt: String): Object source
import {createText} from 'tablefilter/src/dom.js'
Returns a text node with given text
Params:
Name | Type | Attribute | Description |
txt | String |
public dateSortAsc(First: Date, Second: Date): Number source
import {dateSortAsc} from 'tablefilter/src/sort.js'
Compare function for sorting passed dates in ascending manner according to the corresponding UTC numeric value (returned by getTime)
public dateSortDesc(First: Date, Second: Date): Number source
import {dateSortDesc} from 'tablefilter/src/sort.js'
Compare function for sorting passed dates in descending manner according to the corresponding UTC numeric value (returned by getTime)
public defaultsArr(value: Array | Any, default: Array): Array | Any source
import {defaultsArr} from 'tablefilter/src/settings.js'
If passed value is not of array type return the default value otherwise return the value itself
public defaultsBool(value: Boolean | Any, default: Boolean): Boolean | Any source
import {defaultsBool} from 'tablefilter/src/settings.js'
If passed value is not of boolean type return the default value otherwise return the value itself
public defaultsFn(value: Function | Any, default: Function): Function | Any source
import {defaultsFn} from 'tablefilter/src/settings.js'
If passed value is not of function type return the default value otherwise return the value itself
public defaultsNb(value: Number | Any, default: Number): Number | Any source
import {defaultsNb} from 'tablefilter/src/settings.js'
If passed value is not of number type return the default value otherwise return the value itself
public defaultsStr(value: String | Any, default: String): String | Any source
import {defaultsStr} from 'tablefilter/src/settings.js'
If passed value is not of string type return the default value otherwise return the value itself
public elm(id: String): DOMElement source
import {elm} from 'tablefilter/src/dom.js'
Returns the element matching the supplied Id
Params:
Name | Type | Attribute | Description |
id | String | Element identifier |
Return:
DOMElement |
public getFirstTextNode(node: NodeElement): String source
import {getFirstTextNode} from 'tablefilter/src/dom.js'
Returns the first text node contained in the supplied node
Params:
Name | Type | Attribute | Description |
node | NodeElement | node |
public getText(node: NodeElement): String source
import {getText} from 'tablefilter/src/dom.js'
Returns text + text of children of given node
Params:
Name | Type | Attribute | Description |
node | NodeElement |
public has(arr: Array, val: Any, caseSensitive: Boolean): Boolean source
import {has} from 'tablefilter/src/array.js'
Checks if given item can be found in the passed collection
public hasClass(ele: DOMElement, cls: String): Boolean source
import {hasClass} from 'tablefilter/src/dom.js'
Determine whether the passed elements is assigned the given class
Params:
Name | Type | Attribute | Description |
ele | DOMElement | DOM element |
|
cls | String | CSS class name |
public hasHashChange(): * source
import {hasHashChange} from 'tablefilter/src/modules/hash.js'
Checks if browser has onhashchange event
Return:
* |
public hasStorage(): * source
import {hasStorage} from 'tablefilter/src/modules/storage.js'
Checks if browser has Storage feature
Return:
* |
public ignoreCase(First: String, Second: String): Number source
import {ignoreCase} from 'tablefilter/src/sort.js'
Case insensitive compare function for passed strings
Return:
Number | 1 if first string lower than second one 0 if first string same order as second one 1 if first string greater than second one |
public isArray(obj: Array): Boolean source
import {isArray} from 'tablefilter/src/types.js'
Check passed argument is an array
Params:
Name | Type | Attribute | Description |
obj | Array |
public isBoolean(obj: Boolean): Boolean source
import {isBoolean} from 'tablefilter/src/types.js'
Check passed argument is a boolean
Params:
Name | Type | Attribute | Description |
obj | Boolean |
public isEmpty(obj: Any): Boolean source
import {isEmpty} from 'tablefilter/src/types.js'
Check passed argument is empty (undefined, null or empty string)
Params:
Name | Type | Attribute | Description |
obj | Any |
public isEmpty(text: String): Boolean source
import {isEmpty} from 'tablefilter/src/string.js'
Checks if passed string is empty
Params:
Name | Type | Attribute | Description |
text | String |
public isFn(obj: Function): Boolean source
import {isFn} from 'tablefilter/src/types.js'
Check passed argument is a function
Params:
Name | Type | Attribute | Description |
obj | Function |
public isKeyPressed(evt: Event, keyCodes: Array): * source
import {isKeyPressed} from 'tablefilter/src/event.js'
Check code of pressed key is one of the expected key codes
Params:
Name | Type | Attribute | Description |
evt | Event | key event |
|
keyCodes | Array | list of keycodes to check |
Return:
* |
public isNull(obj: Any): Boolean source
import {isNull} from 'tablefilter/src/types.js'
Check passed argument is null
Params:
Name | Type | Attribute | Description |
obj | Any |
public isNumber(obj: Number): Boolean source
import {isNumber} from 'tablefilter/src/types.js'
Check passed argument is a number
Params:
Name | Type | Attribute | Description |
obj | Number |
public isObj(obj: Object): Boolean source
import {isObj} from 'tablefilter/src/types.js'
Check passed argument is an object
Params:
Name | Type | Attribute | Description |
obj | Object |
public isString(obj: String): Boolean source
import {isString} from 'tablefilter/src/types.js'
Check passed argument is a string
Params:
Name | Type | Attribute | Description |
obj | String | obj |
public isUndef(obj: Any): Boolean source
import {isUndef} from 'tablefilter/src/types.js'
Check passed argument is undefined
Params:
Name | Type | Attribute | Description |
obj | Any |
public keyCode(evt: Event): Number source
import {keyCode} from 'tablefilter/src/event.js'
Returns the Unicode value of pressed key
Params:
Name | Type | Attribute | Description |
evt | Event | Event on the DOM |
public matchCase(text: String): String source
import {matchCase} from 'tablefilter/src/string.js'
Returns passed string as lowercase if caseSensitive flag set false. By default it returns the string with no casing changes.
Params:
Name | Type | Attribute | Description |
text | String |
public numSortAsc(First: Number, Second: Number): Number source
import {numSortAsc} from 'tablefilter/src/sort.js'
Compare function for sorting passed numbers in ascending manner
public numSortDesc(First: Number, Second: Number): Number source
import {numSortDesc} from 'tablefilter/src/sort.js'
Compare function for sorting passed numbers in descending manner
public parse(Formatted: String, Decimal: String): Number source
import {parse} from 'tablefilter/src/number.js'
Takes a string, removes all formatting/cruft and returns the raw float value
Return:
Number | Unformatted number https://github.com/openexchangerates/accounting.js/blob/master/accounting.js |
public removeClass(ele: DOMElement, cls: String) source
import {removeClass} from 'tablefilter/src/dom.js'
Removes the specified class to the passed element
Params:
Name | Type | Attribute | Description |
ele | DOMElement | DOM element |
|
cls | String | CSS class name |
public removeElm(node: DOMElement): DOMElement source
import {removeElm} from 'tablefilter/src/dom.js'
Removes passed node from DOM
Params:
Name | Type | Attribute | Description |
node | DOMElement |
Return:
DOMElement | old node reference |
public removeEvt(obj: DOMElement, type: String, Handler: Function, capture: Boolean) source
import {removeEvt} from 'tablefilter/src/event.js'
Remove event handler for specified event on passed element
public rgxEsc(text: String): String source
import {rgxEsc} from 'tablefilter/src/string.js'
Makes regex safe string by escaping special characters from passed string
Params:
Name | Type | Attribute | Description |
text | String |
public sortDateStr(Compare: Function, locale: String): Function source
import {sortDateStr} from 'tablefilter/src/sort.js'
Curried compare function for sorting passed formatted dates in desired fashion according to supplied compare function and locale
public sortNumberStr(Compare: Function, decimal: String): Function source
import {sortNumberStr} from 'tablefilter/src/sort.js'
Curried compare function for sorting passed formatted numbers in desired fashion according to supplied compare function and decimal separator
public stopEvt(evt: Event) source
import {stopEvt} from 'tablefilter/src/event.js'
Prevents further propagation of the current event in the bubbling phase
Params:
Name | Type | Attribute | Description |
evt | Event | Event on the DOM |
public tag(tagname: String): NodeList source
import {tag} from 'tablefilter/src/dom.js'
Returns list of element matching the supplied tag name
Params:
Name | Type | Attribute | Description |
tagname | String | Tag name |
Return:
NodeList |
public targetEvt(evt: Event): DOMElement source
import {targetEvt} from 'tablefilter/src/event.js'
Reference to the object that dispatched the event
Params:
Name | Type | Attribute | Description |
evt | Event | Event on the DOM |
Return:
DOMElement |
public toCamelCase(text: String): String source
import {toCamelCase} from 'tablefilter/src/string.js'
Camelize a string, cutting the string by multiple separators like hyphens, underscores and spaces.
Params:
Name | Type | Attribute | Description |
text | String | text to camelize |
public trim(text: String): String source
import {trim} from 'tablefilter/src/string.js'
Removes whitespace from both sides of passed string
Params:
Name | Type | Attribute | Description |
text | String |
public uuid(): String source
import {uuid} from 'tablefilter/src/string.js'
Generate a string in the format of a UUID (Universally Unique IDentifier). NOTE: This format of 8 chars, followed by 3 groups of 4 chars, followed by 12 chars is known as a UUID and is defined in RFC4122 and is a standard for generating unique IDs. This function DOES NOT implement this standard. It simply outputs a string that looks similar. The standard is found here: https://www.ietf.org/rfc/rfc4122.txt source: https://gist.github.com/gordonbrander/2230317