From 5d786a6a3693c1102641b8c36d617f2824e31646 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 22 Jan 2020 18:38:33 +0100 Subject: [PATCH] fix wrong class-name for attributes in constructor call --- api/js/etemplate/et2_core_inputWidget.js | 3 +-- api/js/etemplate/et2_core_inputWidget.ts | 2 +- api/js/etemplate/et2_core_valueWidget.js | 12 ++++++++---- api/js/etemplate/et2_core_valueWidget.ts | 13 +++++++++++-- api/js/etemplate/et2_widget_button.js | 3 +-- api/js/etemplate/et2_widget_button.ts | 2 +- api/js/etemplate/et2_widget_date.js | 8 ++++---- api/js/etemplate/et2_widget_date.ts | 8 ++++---- api/js/etemplate/et2_widget_tabs.js | 4 ++-- api/js/etemplate/et2_widget_tabs.ts | 2 +- api/js/etemplate/et2_widget_template.js | 2 +- api/js/etemplate/et2_widget_template.ts | 2 +- api/js/etemplate/et2_widget_textbox.js | 7 +++---- api/js/etemplate/et2_widget_textbox.ts | 6 +++--- 14 files changed, 42 insertions(+), 32 deletions(-) diff --git a/api/js/etemplate/et2_core_inputWidget.js b/api/js/etemplate/et2_core_inputWidget.js index dd0feac72d..e933bda57b 100644 --- a/api/js/etemplate/et2_core_inputWidget.js +++ b/api/js/etemplate/et2_core_inputWidget.js @@ -29,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); */ require("./et2_core_common"); var et2_core_inheritance_1 = require("./et2_core_inheritance"); -var et2_core_DOMWidget_1 = require("./et2_core_DOMWidget"); var et2_core_valueWidget_1 = require("./et2_core_valueWidget"); require("./et2_types"); /** @@ -45,7 +44,7 @@ var et2_inputWidget = /** @class */ (function (_super) { function et2_inputWidget(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_inputWidget._attributes, _child || {})) || this; // mark value as not initialised, so set_value can determine if it is necessary to trigger change event _this._oldValue = et2_no_init; _this._labelContainer = null; diff --git a/api/js/etemplate/et2_core_inputWidget.ts b/api/js/etemplate/et2_core_inputWidget.ts index 27a9676050..3dba37724c 100644 --- a/api/js/etemplate/et2_core_inputWidget.ts +++ b/api/js/etemplate/et2_core_inputWidget.ts @@ -76,7 +76,7 @@ export class et2_inputWidget extends et2_valueWidget implements et2_IInput, et2_ constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_inputWidget._attributes, _child || {})); // mark value as not initialised, so set_value can determine if it is necessary to trigger change event this._oldValue = et2_no_init; diff --git a/api/js/etemplate/et2_core_valueWidget.js b/api/js/etemplate/et2_core_valueWidget.js index ea682b185e..e4ba906ccf 100644 --- a/api/js/etemplate/et2_core_valueWidget.js +++ b/api/js/etemplate/et2_core_valueWidget.js @@ -30,6 +30,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); */ var et2_core_baseWidget_1 = require("./et2_core_baseWidget"); require("./et2_core_common"); +var et2_core_inheritance_1 = require("./et2_core_inheritance"); /** * et2_valueWidget is the base class for et2_inputWidget - valueWidget introduces * the "value" attribute and automatically loads it from the "content" array @@ -37,16 +38,19 @@ require("./et2_core_common"); */ var et2_valueWidget = /** @class */ (function (_super) { __extends(et2_valueWidget, _super); - function et2_valueWidget() { - var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * Constructor + */ + function et2_valueWidget(_parent, _attrs, _child) { + var _this = + // Call the inherited constructor + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_valueWidget._attributes, _child || {})) || this; _this.label = ''; _this._labelContainer = null; return _this; } /** * - * - * @memberOf et2_valueWidget * @param _attrs */ et2_valueWidget.prototype.transformAttributes = function (_attrs) { diff --git a/api/js/etemplate/et2_core_valueWidget.ts b/api/js/etemplate/et2_core_valueWidget.ts index 7e28d39339..a8dcb06ce6 100644 --- a/api/js/etemplate/et2_core_valueWidget.ts +++ b/api/js/etemplate/et2_core_valueWidget.ts @@ -17,6 +17,8 @@ import { et2_baseWidget } from './et2_core_baseWidget' import './et2_core_common'; +import {WidgetConfig} from "./et2_core_widget"; +import {ClassWithAttributes} from "./et2_core_inheritance"; /** * et2_valueWidget is the base class for et2_inputWidget - valueWidget introduces @@ -44,10 +46,17 @@ export class et2_valueWidget extends et2_baseWidget label: string = ''; protected _labelContainer: JQuery = null; + /** + * Constructor + */ + constructor(_parent, _attrs? : WidgetConfig, _child? : object) + { + // Call the inherited constructor + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_valueWidget._attributes, _child || {})); + } + /** * - * - * @memberOf et2_valueWidget * @param _attrs */ transformAttributes(_attrs : object) diff --git a/api/js/etemplate/et2_widget_button.js b/api/js/etemplate/et2_widget_button.js index 14aefa7196..99370d07be 100644 --- a/api/js/etemplate/et2_widget_button.js +++ b/api/js/etemplate/et2_widget_button.js @@ -30,7 +30,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); require("./et2_core_common"); var et2_core_inheritance_1 = require("./et2_core_inheritance"); var et2_core_widget_1 = require("./et2_core_widget"); -var et2_core_DOMWidget_1 = require("./et2_core_DOMWidget"); var et2_core_baseWidget_1 = require("./et2_core_baseWidget"); require("./et2_types"); /** @@ -44,7 +43,7 @@ var et2_button = /** @class */ (function (_super) { function et2_button(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_button._attributes, _child || {})) || this; _this.legacyOptions = ["image", "ro_image"]; _this.label = ""; _this.clicked = false; diff --git a/api/js/etemplate/et2_widget_button.ts b/api/js/etemplate/et2_widget_button.ts index 31bf8952e4..eeb2224450 100644 --- a/api/js/etemplate/et2_widget_button.ts +++ b/api/js/etemplate/et2_widget_button.ts @@ -120,7 +120,7 @@ export class et2_button extends et2_baseWidget implements et2_IInput, et2_IDetac constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_button._attributes, _child || {})); if (!this.options.background_image && (this.options.image || this.options.ro_image)) { diff --git a/api/js/etemplate/et2_widget_date.js b/api/js/etemplate/et2_widget_date.js index 9e10c732fc..b8306ff05d 100644 --- a/api/js/etemplate/et2_widget_date.js +++ b/api/js/etemplate/et2_widget_date.js @@ -56,7 +56,7 @@ var et2_date = /** @class */ (function (_super) { function et2_date(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_date._attributes, _child || {})) || this; _this.legacyOptions = ["data_format"]; _this.input_date = null; _this.is_mobile = false; @@ -585,7 +585,7 @@ var et2_date_duration = /** @class */ (function (_super) { function et2_date_duration(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_date_duration._attributes, _child || {})) || this; _this.legacyOptions = ["data_format", "display_format", "hours_per_day", "empty_not_0", "short_labels"]; // Legacy option put percent in with display format if (_this.options.display_format.indexOf("%") != -1) { @@ -897,7 +897,7 @@ var et2_date_ro = /** @class */ (function (_super) { function et2_date_ro(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_date_ro._attributes, _child || {})) || this; /** * Internal container for working easily with dates */ @@ -1102,7 +1102,7 @@ var et2_date_range = /** @class */ (function (_super) { function et2_date_range(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_date_range._attributes, _child || {})) || this; _this.div = jQuery(document.createElement('div')) .attr({ class: 'et2_date_range' }); _this.from = null; diff --git a/api/js/etemplate/et2_widget_date.ts b/api/js/etemplate/et2_widget_date.ts index e08d14a6b5..38e6416a71 100644 --- a/api/js/etemplate/et2_widget_date.ts +++ b/api/js/etemplate/et2_widget_date.ts @@ -106,7 +106,7 @@ String: A string in the user\'s date format, or a relative date. Relative dates constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_date._attributes, _child || {})); this.date = new Date(); this.date.setUTCHours(0); @@ -717,7 +717,7 @@ class et2_date_duration extends et2_date constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_date_duration._attributes, _child || {})); // Legacy option put percent in with display format if(this.options.display_format.indexOf("%") != -1) @@ -1073,7 +1073,7 @@ class et2_date_ro extends et2_valueWidget implements et2_IDetachedDOM constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_date_ro._attributes, _child || {})); this._labelContainer = jQuery(document.createElement("label")) .addClass("et2_label"); @@ -1307,7 +1307,7 @@ class et2_date_range extends et2_inputWidget constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_date_range._attributes, _child || {})); this.div = jQuery(document.createElement('div')) .attr({ class:'et2_date_range'}); diff --git a/api/js/etemplate/et2_widget_tabs.js b/api/js/etemplate/et2_widget_tabs.js index 84933536eb..3dedd1c984 100644 --- a/api/js/etemplate/et2_widget_tabs.js +++ b/api/js/etemplate/et2_widget_tabs.js @@ -30,7 +30,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); require("./et2_core_common"); var et2_core_inheritance_1 = require("./et2_core_inheritance"); var et2_core_widget_1 = require("./et2_core_widget"); -var et2_core_DOMWidget_1 = require("./et2_core_DOMWidget"); var et2_core_valueWidget_1 = require("./et2_core_valueWidget"); require("./et2_types"); /** @@ -44,7 +43,7 @@ var et2_tabbox = /** @class */ (function (_super) { function et2_tabbox(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_tabbox._attributes, _child || {})) || this; /** * Currently selected tab */ @@ -482,3 +481,4 @@ var et2_tabbox = /** @class */ (function (_super) { return et2_tabbox; }(et2_core_valueWidget_1.et2_valueWidget)); et2_core_widget_1.et2_register_widget(et2_tabbox, ["tabbox"]); +//# sourceMappingURL=et2_widget_tabs.js.map \ No newline at end of file diff --git a/api/js/etemplate/et2_widget_tabs.ts b/api/js/etemplate/et2_widget_tabs.ts index e019e15dd5..49a9b966cd 100644 --- a/api/js/etemplate/et2_widget_tabs.ts +++ b/api/js/etemplate/et2_widget_tabs.ts @@ -67,7 +67,7 @@ class et2_tabbox extends et2_valueWidget implements et2_IInput,et2_IResizeable,e constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_tabbox._attributes, _child || {})); // Create the outer tabbox container this.container = jQuery(document.createElement("div")) diff --git a/api/js/etemplate/et2_widget_template.js b/api/js/etemplate/et2_widget_template.js index c7bab3cb36..1d29932c8b 100644 --- a/api/js/etemplate/et2_widget_template.js +++ b/api/js/etemplate/et2_widget_template.js @@ -46,7 +46,7 @@ var et2_template = /** @class */ (function (_super) { function et2_template(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_template._attributes, _child || {})) || this; _this.createNamespace = true; // Set this early, so it's available for creating namespace if (_attrs.content) { diff --git a/api/js/etemplate/et2_widget_template.ts b/api/js/etemplate/et2_widget_template.ts index c5e643c948..fbc30c5da3 100644 --- a/api/js/etemplate/et2_widget_template.ts +++ b/api/js/etemplate/et2_widget_template.ts @@ -81,7 +81,7 @@ class et2_template extends et2_DOMWidget constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_template._attributes, _child || {})); // Set this early, so it's available for creating namespace if(_attrs.content) diff --git a/api/js/etemplate/et2_widget_textbox.js b/api/js/etemplate/et2_widget_textbox.js index 090b827cd1..7e140dd2e6 100644 --- a/api/js/etemplate/et2_widget_textbox.js +++ b/api/js/etemplate/et2_widget_textbox.js @@ -30,7 +30,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); require("./et2_core_common"); var et2_core_inheritance_1 = require("./et2_core_inheritance"); var et2_core_widget_1 = require("./et2_core_widget"); -var et2_core_DOMWidget_1 = require("./et2_core_DOMWidget"); var et2_core_valueWidget_1 = require("./et2_core_valueWidget"); var et2_core_inputWidget_1 = require("./et2_core_inputWidget"); require("./et2_types"); @@ -47,7 +46,7 @@ var et2_textbox = /** @class */ (function (_super) { function et2_textbox(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_textbox._attributes, _child || {})) || this; _this.legacyOptions = ["size", "maxlength", "validator"]; _this.input = null; _this.input = null; @@ -301,7 +300,7 @@ var et2_textbox_ro = /** @class */ (function (_super) { function et2_textbox_ro(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_textbox_ro._attributes, _child || {})) || this; _this.value = ""; _this.span = jQuery(document.createElement("label")) .addClass("et2_label"); @@ -397,7 +396,7 @@ var et2_searchbox = /** @class */ (function (_super) { function et2_searchbox(_parent, _attrs, _child) { var _this = // Call the inherited constructor - _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_core_DOMWidget_1.et2_DOMWidget._attributes, _child || {})) || this; + _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_searchbox._attributes, _child || {})) || this; _this.value = ""; _this.value = ""; _this.div = jQuery(document.createElement('div')) diff --git a/api/js/etemplate/et2_widget_textbox.ts b/api/js/etemplate/et2_widget_textbox.ts index e11ecc7bdf..cb4f4504cd 100644 --- a/api/js/etemplate/et2_widget_textbox.ts +++ b/api/js/etemplate/et2_widget_textbox.ts @@ -99,7 +99,7 @@ export class et2_textbox extends et2_inputWidget implements et2_IResizeable constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_textbox._attributes, _child || {})); this.input = null; @@ -359,7 +359,7 @@ class et2_textbox_ro extends et2_valueWidget implements et2_IDetachedDOM constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_textbox_ro._attributes, _child || {})); this.span = jQuery(document.createElement("label")) .addClass("et2_label"); @@ -472,7 +472,7 @@ class et2_searchbox extends et2_textbox constructor(_parent, _attrs? : WidgetConfig, _child? : object) { // Call the inherited constructor - super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_DOMWidget._attributes, _child || {})); + super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_searchbox._attributes, _child || {})); this.value = ""; this.div = jQuery(document.createElement('div'))