new Input()
User Interface input for math expressions
Extends
- Component
Members
(static) value
get value - Return a evaluation of the compiled expression
Methods
(static) compile() → {void}
After each change of the input field, this function is called and compiles the entered expression.
If it returns an error the event "error" is launched, otherwise if all happens normally the event "success" is launched.
The method will store a value in "this.compiled" that can be evaluated by the getter "value",
thus offering a much higher computation speed.
The method will check the entered unit and if it does not match the quantity entered in the "type" attribute,
it will return an "invalid measure" error.
Returns:
- Type
- void
(static) getAliasKnowSymbol(input, symbol) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
input |
Cluster.Ui.Input | cluster-input object |
symbol |
char | utf8 char symbol like 'π' |
Returns:
alias like 'pi'
- Type
- string
(static) getHighlightKnowAtoms(input, name) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
input |
Cluster.Ui.Input | cluster-input object |
name |
string | atom name |
Returns:
html content
- Type
- string
(static) getHighlightKnowMethods(input, r) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
input |
Cluster.Ui.Input | cluster-input object |
r |
string | method name |
Returns:
html content
- Type
- string
(static) getHighlightKnowVariables(input, r) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
input |
Cluster.Ui.Input | cluster-input object |
r |
string | variable name |
Returns:
html content
- Type
- string
(static) getSymbolKnowAlias(input, alias) → {char}
Parameters:
| Name | Type | Description |
|---|---|---|
input |
Cluster.Ui.Input | cluster-input object |
alias |
string | alias like 'pi' |
Returns:
utf8 char symbol like 'π'
- Type
- char
(static) getVariableKnowAlias(input, alias) → {object}
Parameters:
| Name | Type | Description |
|---|---|---|
input |
Cluster.Ui.Input | cluster-input object |
alias |
string | alias like 'pi' |
Returns:
the variable object
- Type
- object
(static) getVariableKnowSymbol(input, symbol) → {object}
Parameters:
| Name | Type | Description |
|---|---|---|
input |
Cluster.Ui.Input | cluster-input object |
symbol |
char | utf8 char symbol like 'π' |
Returns:
the variable object
- Type
- object
(static) setKnowAtoms(list) → {void}
setKnowAtoms - set know "atom" keywords to highlight
Parameters:
| Name | Type | Description |
|---|---|---|
list |
array | A formatted list of know atoms |
Returns:
- Type
- void
(static) setKnowVariables(list) → {void}
setKnowVariables - set know variables to aliasing and highlight
Parameters:
| Name | Type | Description |
|---|---|---|
list |
type | list of know variables |
Returns:
- Type
- void
(static) updateContent(valueopt) → {void}
updateContent - update highlight of current content, or specified content
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
type |
<optional> |
A specified value |
Returns:
- Type
- void