selectbox widget and some fixes

This commit is contained in:
Ralf Becker 2020-01-22 20:12:36 +01:00 committed by Hadi Nategh
parent 05b92c97f2
commit ec7f8931b2
8 changed files with 3329 additions and 1774 deletions

View File

@ -96,7 +96,7 @@ var et2_inputWidget = /** @class */ (function (_super) {
// } // }
_super.prototype.detachFromDOM.call(this); _super.prototype.detachFromDOM.call(this);
}; };
et2_inputWidget.prototype.change = function (_node) { et2_inputWidget.prototype.change = function (_node, _widget, _value) {
var messages = []; var messages = [];
var valid = this.isValid(messages); var valid = this.isValid(messages);
// Passing false will clear any set messages // Passing false will clear any set messages

View File

@ -146,7 +146,7 @@ export class et2_inputWidget extends et2_valueWidget implements et2_IInput, et2_
super.detachFromDOM(); super.detachFromDOM();
} }
change(_node) change(_node, _widget?, _value?)
{ {
var messages = []; var messages = [];
var valid = this.isValid(messages); var valid = this.isValid(messages);

View File

@ -775,7 +775,7 @@ export class et2_widget extends ClassWithAttributes
* *
* @param {Promise[]} promises List of promises from widgets that are not done. Pass an empty array, it will be filled if needed. * @param {Promise[]} promises List of promises from widgets that are not done. Pass an empty array, it will be filled if needed.
*/ */
loadingFinished(promises) loadingFinished(promises?)
{ {
// Call all availble setters // Call all availble setters
this.initAttributes(this.options); this.initAttributes(this.options);

View File

@ -119,12 +119,7 @@ declare var et2_radioGroup : any;
declare var et2_script : any; declare var et2_script : any;
declare var et2_selectAccount : any; declare var et2_selectAccount : any;
declare var et2_selectAccount_ro : any; declare var et2_selectAccount_ro : any;
declare class et2_selectbox extends et2_inputWidget { declare class et2_selectbox extends et2_inputWidget {}
loadingFinished()
getDOMNode()
set_value(s: string)
getValue()
}
declare var et2_selectbox_ro : any; declare var et2_selectbox_ro : any;
declare var et2_menulist : any; declare var et2_menulist : any;
declare var et2_split : any; declare var et2_split : any;
@ -164,4 +159,5 @@ declare function et2_compileLegacyJS(_code : string, _widget : et2_widget, _cont
declare function et2_loadXMLFromURL(_url : string, _callback : Function, _context? : object, _fail_callback? : Function) : void; declare function et2_loadXMLFromURL(_url : string, _callback : Function, _context? : object, _fail_callback? : Function) : void;
declare function et2_directChildrenByTagName(_node, _tagName); declare function et2_directChildrenByTagName(_node, _tagName);
declare function et2_filteredNodeIterator(_node, _callback, _context); declare function et2_filteredNodeIterator(_node, _callback, _context);
declare function et2_readAttrWithDefault(_node, _name, _default?); declare function et2_readAttrWithDefault(_node, _name, _default?);
declare function sprintf(format : string, ...args : any) : string;

View File

@ -156,7 +156,7 @@ var et2_date = /** @class */ (function (_super) {
*/ */
et2_date.prototype.set_readonly = function (_ro) { et2_date.prototype.set_readonly = function (_ro) {
if (this.input_date && !this.input_date.attr('disabled') != !_ro) { if (this.input_date && !this.input_date.attr('disabled') != !_ro) {
this.input_date.attr('disabled', !_ro ? 0 : 1) this.input_date.prop('disabled', !!_ro)
.datepicker('option', 'disabled', !!_ro); .datepicker('option', 'disabled', !!_ro);
} }
}; };
@ -573,6 +573,7 @@ String: A string in the user\'s date format, or a relative date. Relative dates
}; };
return et2_date; return et2_date;
}(et2_core_inputWidget_1.et2_inputWidget)); }(et2_core_inputWidget_1.et2_inputWidget));
exports.et2_date = et2_date;
et2_core_widget_1.et2_register_widget(et2_date, ["date", "date-time", "date-timeonly"]); et2_core_widget_1.et2_register_widget(et2_date, ["date", "date-time", "date-timeonly"]);
/** /**
* Class which implements the "date-duration" XET-Tag * Class which implements the "date-duration" XET-Tag
@ -820,6 +821,7 @@ var et2_date_duration = /** @class */ (function (_super) {
}; };
return et2_date_duration; return et2_date_duration;
}(et2_date)); }(et2_date));
exports.et2_date_duration = et2_date_duration;
et2_core_widget_1.et2_register_widget(et2_date_duration, ["date-duration"]); et2_core_widget_1.et2_register_widget(et2_date_duration, ["date-duration"]);
/** /**
* r/o date-duration * r/o date-duration
@ -885,6 +887,7 @@ var et2_date_duration_ro = /** @class */ (function (_super) {
}; };
return et2_date_duration_ro; return et2_date_duration_ro;
}(et2_date_duration)); }(et2_date_duration));
exports.et2_date_duration_ro = et2_date_duration_ro;
et2_core_widget_1.et2_register_widget(et2_date_duration_ro, ["date-duration_ro"]); et2_core_widget_1.et2_register_widget(et2_date_duration_ro, ["date-duration_ro"]);
/** /**
* et2_date_ro is the readonly implementation of some date widget. * et2_date_ro is the readonly implementation of some date widget.
@ -1090,6 +1093,7 @@ var et2_date_ro = /** @class */ (function (_super) {
}; };
return et2_date_ro; return et2_date_ro;
}(et2_core_valueWidget_1.et2_valueWidget)); }(et2_core_valueWidget_1.et2_valueWidget));
exports.et2_date_ro = et2_date_ro;
et2_core_widget_1.et2_register_widget(et2_date_ro, ["date_ro", "date-time_ro", "date-since", "date-time_today", "time_or_date", "date-timeonly_ro"]); et2_core_widget_1.et2_register_widget(et2_date_ro, ["date_ro", "date-time_ro", "date-since", "date-time_today", "time_or_date", "date-timeonly_ro"]);
/** /**
* Widget for selecting a date range * Widget for selecting a date range
@ -1360,5 +1364,6 @@ var et2_date_range = /** @class */ (function (_super) {
]; ];
return et2_date_range; return et2_date_range;
}(et2_core_inputWidget_1.et2_inputWidget)); }(et2_core_inputWidget_1.et2_inputWidget));
exports.et2_date_range = et2_date_range;
et2_core_widget_1.et2_register_widget(et2_date_range, ["date-range"]); et2_core_widget_1.et2_register_widget(et2_date_range, ["date-range"]);
//# sourceMappingURL=et2_widget_date.js.map //# sourceMappingURL=et2_widget_date.js.map

View File

@ -22,6 +22,7 @@ import { ClassWithAttributes } from "./et2_core_inheritance";
import { et2_widget, et2_createWidget, et2_register_widget, WidgetConfig } from "./et2_core_widget"; import { et2_widget, et2_createWidget, et2_register_widget, WidgetConfig } from "./et2_core_widget";
import { et2_valueWidget } from './et2_core_valueWidget' import { et2_valueWidget } from './et2_core_valueWidget'
import { et2_inputWidget } from './et2_core_inputWidget' import { et2_inputWidget } from './et2_core_inputWidget'
import { et2_selectbox } from './et2_widget_selectbox'
import './et2_types'; import './et2_types';
import {et2_DOMWidget} from "./et2_core_DOMWidget"; import {et2_DOMWidget} from "./et2_core_DOMWidget";
@ -40,7 +41,7 @@ declare function date (format : string, timestamp? : string | number | Date);
* Widgets uses jQuery date- and time-picker for desktop browsers and * Widgets uses jQuery date- and time-picker for desktop browsers and
* HTML5 input fields for mobile devices to get their native UI for date/time entry. * HTML5 input fields for mobile devices to get their native UI for date/time entry.
*/ */
class et2_date extends et2_inputWidget export class et2_date extends et2_inputWidget
{ {
static readonly _attributes: any = { static readonly _attributes: any = {
"value": { "value": {
@ -228,7 +229,7 @@ String: A string in the user\'s date format, or a relative date. Relative dates
{ {
if (this.input_date && !this.input_date.attr('disabled') != !_ro) if (this.input_date && !this.input_date.attr('disabled') != !_ro)
{ {
this.input_date.attr('disabled', !_ro ? 0 : 1) this.input_date.prop('disabled', !!_ro)
.datepicker('option', 'disabled', !!_ro); .datepicker('option', 'disabled', !!_ro);
} }
} }
@ -655,7 +656,7 @@ et2_register_widget(et2_date, ["date", "date-time", "date-timeonly"]);
/** /**
* Class which implements the "date-duration" XET-Tag * Class which implements the "date-duration" XET-Tag
*/ */
class et2_date_duration extends et2_date export class et2_date_duration extends et2_date
{ {
static readonly _attributes: any = { static readonly _attributes: any = {
"data_format": { "data_format": {
@ -963,7 +964,7 @@ et2_register_widget(et2_date_duration, ["date-duration"]);
/** /**
* r/o date-duration * r/o date-duration
*/ */
class et2_date_duration_ro extends et2_date_duration implements et2_IDetachedDOM export class et2_date_duration_ro extends et2_date_duration implements et2_IDetachedDOM
{ {
createInputWidget() createInputWidget()
{ {
@ -1037,7 +1038,7 @@ et2_register_widget(et2_date_duration_ro, ["date-duration_ro"]);
/** /**
* et2_date_ro is the readonly implementation of some date widget. * et2_date_ro is the readonly implementation of some date widget.
*/ */
class et2_date_ro extends et2_valueWidget implements et2_IDetachedDOM export class et2_date_ro extends et2_valueWidget implements et2_IDetachedDOM
{ {
/** /**
* Ignore all more advanced attributes. * Ignore all more advanced attributes.
@ -1282,7 +1283,7 @@ et2_register_widget(et2_date_ro, ["date_ro", "date-time_ro", "date-since", "date
/** /**
* Widget for selecting a date range * Widget for selecting a date range
*/ */
class et2_date_range extends et2_inputWidget export class et2_date_range extends et2_inputWidget
{ {
static readonly _attributes: any = { static readonly _attributes: any = {
value: { value: {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff