forked from verdnatura/hedera-web
35 lines
454 B
JavaScript
35 lines
454 B
JavaScript
|
|
module.exports = new Class
|
|
({
|
|
Extends: Htk.Field
|
|
,Tag: 'htk-label'
|
|
,Properties:
|
|
{
|
|
/**
|
|
* Format that applies to the value.
|
|
*/
|
|
format:
|
|
{
|
|
type: String
|
|
,set(x) {
|
|
this._format = _(x);
|
|
this.putValue(this._value);
|
|
}
|
|
,get() {
|
|
return this._format;
|
|
}
|
|
}
|
|
}
|
|
|
|
,_format: null
|
|
|
|
,render() {
|
|
this.createRoot('label');
|
|
}
|
|
|
|
,putValue(value) {
|
|
Vn.Node.setText(this.node,
|
|
Vn.Value.format(value, this._format));
|
|
}
|
|
});
|