Etemplate: Changes to adapt to get/set in valueWidget interface

This commit is contained in:
nathangray 2021-05-19 13:54:56 -06:00
parent 94f5c437e8
commit 6790ffb273
11 changed files with 7 additions and 16 deletions

View File

@ -44,7 +44,7 @@ export class et2_valueWidget extends et2_baseWidget
};
label: string = '';
value: string|number|Object;
protected value: string|number|Object;
protected _labelContainer: JQuery = null;
/**

View File

@ -87,7 +87,6 @@ class et2_ajaxSelect extends et2_inputWidget
}
};
private input: JQuery = null;
private value : any;
/**
* Constructor
*
@ -215,7 +214,6 @@ class et2_ajaxSelect_ro extends et2_valueWidget implements et2_IDetachedDOM
"ignore": true
}
};
private value: string;
private span: JQuery;
/**

View File

@ -94,9 +94,6 @@ var et2_barcode = /** @class */ (function (_super) {
this.createWidget();
}
};
et2_barcode.prototype.get_value = function () {
return this.value;
};
// Class Constants
/*
* type const

View File

@ -112,7 +112,6 @@ export class et2_barcode extends et2_valueWidget
},
};
private div: JQuery;
private value: string;
private settings: { output: string; barWidth: string; barHeight: string; bgColor: string; color: string };
/**
@ -157,10 +156,5 @@ export class et2_barcode extends et2_valueWidget
this.createWidget();
}
}
get_value()
{
return this.value;
}
}
et2_register_widget(et2_barcode, ["barcode"]);

View File

@ -96,7 +96,7 @@ et2_register_widget(et2_color, ["colorpicker"]);
*/
export class et2_color_ro extends et2_valueWidget implements et2_IDetachedDOM
{
private value: string;
protected value: string;
private $node: JQuery;
/**
* Constructor
@ -115,7 +115,7 @@ export class et2_color_ro extends et2_valueWidget implements et2_IDetachedDOM
this.setDOMNode(this.$node[0]);
}
set_value( _value)
set_value( _value : string)
{
this.value = _value;

View File

@ -70,6 +70,7 @@ var et2_countdown = /** @class */ (function (_super) {
et2_countdown.prototype.set_value = function (_time) {
if (isNaN(_time))
return;
_super.prototype.set_value.call(this, _time);
this.time = new Date();
this.time.setSeconds(this.time.getSeconds() + parseInt(_time));
var self = this;

View File

@ -101,6 +101,7 @@ export class et2_countdown extends et2_valueWidget {
{
if (isNaN(_time)) return;
super.set_value(_time);
this.time = new Date();
this.time.setSeconds(this.time.getSeconds() + parseInt(_time));

View File

@ -88,7 +88,6 @@ export class et2_historylog extends et2_valueWidget implements et2_IDataProvider
private controller: et2_dataview_controller;
private fields: any;
private diff: et2_diff;
private value: any;
/**
* Constructor

View File

@ -69,6 +69,7 @@ var et2_progress = /** @class */ (function (_super) {
};
// setting the value as width of the progress-bar
et2_progress.prototype.set_value = function (_value) {
_super.prototype.set_value.call(this, _value);
_value = parseInt(_value) + "%"; // make sure we have percent attached
this.progress.style.width = _value;
if (!this.options.label)

View File

@ -94,6 +94,7 @@ class et2_progress extends et2_valueWidget implements et2_IDetachedDOM
// setting the value as width of the progress-bar
set_value(_value)
{
super.set_value(_value);
_value = parseInt(_value)+"%"; // make sure we have percent attached
this.progress.style.width = _value;
if (!this.options.label) this.set_label(_value);

View File

@ -124,7 +124,6 @@ export class et2_tree extends et2_inputWidget
* Regexp used by _htmlencode
*/
_lt_regexp : RegExp = /</g;
private value: any;
/**
* Constructor