@qooxdoo/framework 8.0.0-beta.1 → 8.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/Manifest.json +1 -1
  3. package/lib/compiler/compile-info.json +54 -55
  4. package/lib/compiler/index.js +19039 -23607
  5. package/lib/resource/qx/tool/compiler/cli/templates/class/default.tmpl.js +6 -7
  6. package/lib/resource/qx/tool/compiler/cli/templates/class/singleton.tmpl.js +5 -6
  7. package/lib/resource/qx/tool/compiler/schema/compile-1-0-0.json +6 -2
  8. package/package.json +8 -10
  9. package/source/class/qx/Class.js +26 -7
  10. package/source/class/qx/Mixin.js +15 -6
  11. package/source/class/qx/core/BaseInit.js +14 -13
  12. package/source/class/qx/core/MObjectId.js +16 -0
  13. package/source/class/qx/core/MProperty.js +147 -175
  14. package/source/class/qx/core/check/AbstractCheck.js +5 -1
  15. package/source/class/qx/core/check/CheckFactory.js +6 -0
  16. package/source/class/qx/core/check/DynamicTypeCheck.js +9 -0
  17. package/source/class/qx/core/property/ExplicitPropertyStorage.js +7 -19
  18. package/source/class/qx/core/property/IPropertyStorage.js +2 -21
  19. package/source/class/qx/core/property/Property.js +115 -90
  20. package/source/class/qx/core/property/SimplePropertyStorage.js +2 -18
  21. package/source/class/qx/data/MBinding.js +1 -1
  22. package/source/class/qx/data/SingleValueBinding.js +63 -107
  23. package/source/class/qx/data/binding/AbstractSegment.js +16 -11
  24. package/source/class/qx/data/binding/ArrayIndexSegment.js +17 -10
  25. package/source/class/qx/data/binding/IInputReceiver.js +1 -1
  26. package/source/class/qx/data/binding/PropNameSegment.js +35 -12
  27. package/source/class/qx/dev/unit/TestCase.js +4 -1
  28. package/source/class/qx/event/handler/Focus.js +2 -1
  29. package/source/class/qx/html/Jsx.js +2 -3
  30. package/source/class/qx/html/Node.js +3 -3
  31. package/source/class/qx/io/jsonrpc/Client.js +1 -1
  32. package/source/class/qx/promise/NativeWrapper.js +1 -1
  33. package/source/class/qx/test/Mixin.js +219 -0
  34. package/source/class/qx/test/Promise.js +10 -11
  35. package/source/class/qx/test/core/Property.js +50 -16
  36. package/source/class/qx/test/data/singlevalue/Async.js +17 -4
  37. package/source/class/qx/test/data/singlevalue/Simple.js +6 -0
  38. package/source/class/qx/test/locale/Date.js +2 -2
  39. package/source/class/qx/test/performance/Property.js +0 -1
  40. package/source/class/qx/test/ui/core/SingleSelectionManager.js +150 -0
  41. package/source/class/qx/theme/classic/Appearance.js +21 -0
  42. package/source/class/qx/theme/modern/Appearance.js +21 -0
  43. package/source/class/qx/theme/simple/Appearance.js +21 -0
  44. package/source/class/qx/theme/tangible/Appearance.js +2 -0
  45. package/source/class/qx/tool/cli/AbstractCliApp.js +18 -2
  46. package/source/class/qx/tool/compiler/ClassFile.js +0 -4
  47. package/source/class/qx/tool/compiler/MetaDatabase.js +47 -0
  48. package/source/class/qx/tool/compiler/cli/api/CompilerApi.js +1 -2
  49. package/source/class/qx/tool/compiler/cli/commands/Compile.js +139 -8
  50. package/source/class/qx/tool/compiler/cli/commands/Create.js +1 -1
  51. package/source/class/qx/tool/compiler/cli/commands/Serve.js +1 -1
  52. package/source/class/qx/tool/compiler/cli/commands/Typescript.js +26 -39
  53. package/source/class/qx/tool/compiler/cli/commands/add/Script.js +1 -1
  54. package/source/class/qx/tool/compiler/cli/commands/package/Publish.js +3 -2
  55. package/source/class/qx/tool/compiler/cli/commands/package/Update.js +2 -2
  56. package/source/class/qx/tool/compiler/targets/TypeScriptWriter.js +3 -0
  57. package/source/class/qx/tool/compiler/targets/meta/Browserify.js +142 -80
  58. package/source/class/qx/tool/migration/M8_0_0.js +4 -4
  59. package/source/class/qx/ui/core/SingleSelectionManager.js +4 -4
  60. package/source/class/qx/ui/form/validation/Manager.js +1 -1
  61. package/source/class/qx/ui/toolbar/ToolBar.js +4 -4
  62. package/source/resource/qx/decoration/Modern/table/boolean-false.png +0 -0
  63. package/source/resource/qx/decoration/Modern/table/boolean-true.png +0 -0
  64. package/source/resource/qx/tool/compiler/cli/templates/class/default.tmpl.js +6 -7
  65. package/source/resource/qx/tool/compiler/cli/templates/class/singleton.tmpl.js +5 -6
  66. package/source/resource/qx/tool/compiler/schema/compile-1-0-0.json +6 -2
@@ -20,193 +20,165 @@
20
20
  * This mixin offers the basic property features which include generic
21
21
  * setter, getter and resetter.
22
22
  */
23
- qx.Mixin.define(
24
- "qx.core.MProperty",
25
- {
26
- members:
27
- {
28
- /**
29
- * Sets either multiple properties at once by using a property
30
- * list or sets one property and its value by the first and
31
- * second argument. As a fallback, if no generated property
32
- * setter could be found, a handwritten setter will be searched
33
- * and invoked if available.
34
- *
35
- * @param data {Object | String}
36
- * a map of property values. The key is the name of the property.
37
- *
38
- * @param value {var?}
39
- * the value, only used when <code>data</code> is a string.
40
- *
41
- * @return {Object}
42
- * Returns this instance if <code>data</code> is a map or a
43
- * non-generated setter is called; otherwise returns
44
- * <code>value</code>.
45
- *
46
- * @throws {Error} if a property defined does not exist
47
- */
48
- set(data, value)
49
- {
50
- // If there's just a single property name and value, convert
51
- // it to a map as if there were multiple property names and
52
- // values.
53
- if (qx.Bootstrap.isString(data))
54
- {
55
- data =
56
- {
57
- [data] : value
58
- };
59
- }
60
-
61
- // Set each property specified in the map
62
- for (let prop in data)
63
- {
64
- // If the property exists as a member variable, set it directly
65
- if (prop in this)
66
- {
67
- if (data[prop] !== undefined)
68
- {
69
- this[`$$variant_${prop}`] = "set";
70
- this[prop] = data[prop];
71
- }
72
- continue;
73
- }
74
-
75
- // Otherwise, see if there's a hand-written setter method
76
- if (this["set" + qx.Bootstrap.firstUp(prop)] != undefined)
77
- {
78
- this["set" + qx.Bootstrap.firstUp(prop)](data[prop]);
79
- continue;
80
- }
23
+ qx.Mixin.define("qx.core.MProperty", {
24
+ members: {
25
+ /**
26
+ * Sets either multiple properties at once by using a property
27
+ * list or sets one property and its value by the first and
28
+ * second argument. As a fallback, if no generated property
29
+ * setter could be found, a handwritten setter will be searched
30
+ * and invoked if available.
31
+ *
32
+ * @param data {Object | String}
33
+ * a map of property values. The key is the name of the property.
34
+ *
35
+ * @param value {var?}
36
+ * the value, only used when <code>data</code> is a string.
37
+ *
38
+ * @return {Object}
39
+ * Returns this instance if <code>data</code> is a map or a
40
+ * non-generated setter is called; otherwise returns
41
+ * <code>value</code>.
42
+ *
43
+ * @throws {Error} if a property defined does not exist
44
+ */
45
+ set(data, value) {
46
+ // If there's just a single property name and value, convert
47
+ // it to a map as if there were multiple property names and
48
+ // values.
49
+ if (qx.Bootstrap.isString(data)) {
50
+ data = {
51
+ [data]: value
52
+ };
53
+ }
81
54
 
82
- // Neither was true
83
- throw new Error("No such property: " + data);
55
+ // Set each property specified in the map
56
+ for (let prop in data) {
57
+ // Otherwise, see if there's a hand-written setter method
58
+ if (this["set" + qx.Bootstrap.firstUp(prop)] != undefined) {
59
+ this["set" + qx.Bootstrap.firstUp(prop)](data[prop]);
60
+ continue;
84
61
  }
62
+ // Neither was true
63
+ throw new Error("No such property: " + prop + " in " + this.classname + " (" + this + ")");
64
+ }
85
65
 
86
- // Allow for the case where no properties were given
87
- return this;
88
- },
89
-
90
-
91
- /**
92
- * Sets a property or multiple properties asynchronously.
93
- * First tries calling `setPropetyNameAsync` if it exists,
94
- * otherwise falls back to `setPropertyName`.
95
- *
96
- * @overload
97
- * @param {string} data Name of property to set
98
- * @param {*} value Value to set it to
99
- *
100
- * @overload
101
- * @param {Object<string, *>} data Map of properties to set
102
- *
103
- * @returns {qx.core.Object | Promise<*>} This instance if a map was provided,
104
- * or, if a single property is set,
105
- * a promise which resolves when the setting has completed
106
- * to the set value of the property.
107
- */
108
- async setAsync(data, value) {
109
- const setValueImpl = async (propName, value) => {
110
- let upname = qx.Bootstrap.firstUp(propName);
111
- let setterName = "set" + upname + "Async";
66
+ // Allow for the case where no properties were given
67
+ return this;
68
+ },
69
+
70
+ /**
71
+ * Sets a property or multiple properties asynchronously.
72
+ * First tries calling `setPropetyNameAsync` if it exists,
73
+ * otherwise falls back to `setPropertyName`.
74
+ *
75
+ * @overload
76
+ * @param {string} data Name of property to set
77
+ * @param {*} value Value to set it to
78
+ *
79
+ * @overload
80
+ * @param {Object<string, *>} data Map of properties to set
81
+ *
82
+ * @returns {qx.core.Object | Promise<*>} This instance if a map was provided,
83
+ * or, if a single property is set,
84
+ * a promise which resolves when the setting has completed
85
+ * to the set value of the property.
86
+ */
87
+ async setAsync(data, value) {
88
+ const setValueImpl = async (propName, value) => {
89
+ let upname = qx.Bootstrap.firstUp(propName);
90
+ let setterName = "set" + upname + "Async";
91
+
92
+ if (!this[setterName]) {
93
+ setterName = "set" + upname;
94
+ }
112
95
 
96
+ if (qx.core.Environment.get("qx.debug")) {
113
97
  if (!this[setterName]) {
114
- setterName = "set" + upname;
115
- }
116
-
117
- if (qx.core.Environment.get("qx.debug")) {
118
- if (!this[setterName]) {
119
- throw new Error(
120
- `No such property: ${propName} in ${this.classname} (${this})`
121
- );
122
- }
98
+ throw new Error(`No such property: ${propName} in ${this.classname} (${this})`);
123
99
  }
124
-
125
- return await this[setterName](value);
126
- };
127
-
128
- if (qx.Bootstrap.isString(data)) {
129
- return await setValueImpl(data, value);
130
100
  }
131
101
 
132
- for (let propName in data) {
133
- await setValueImpl(propName, data[propName]);
134
- }
135
- return this;
136
- },
137
-
138
- /**
139
- * Returns the value of the given property. If no generated getter could
140
- * be found, a fallback tries to access a handwritten getter.
141
- *
142
- * @param prop {String}
143
- * Name of the property.
144
- *
145
- * @return {var}
146
- * The value of the value
147
- *
148
- * @param safe {Boolean?false}
149
- *
150
- * @throws {Error}
151
- * if a property defined does not exist
152
- */
153
- get(prop, safe)
154
- {
155
- if (safe) {
156
- let property = qx.Class.getByProperty(this.constructor, prop);
157
- if (property) {
158
- return property.getSafe(this);
159
- }
160
- }
102
+ return await this[setterName](value);
103
+ };
161
104
 
162
- // Otherwise, see if there's a hand-written getter method
163
- if (this["get" + qx.Bootstrap.firstUp(prop)] != undefined)
164
- {
165
- return this["get" + qx.Bootstrap.firstUp(prop)]();
166
- }
105
+ if (qx.Bootstrap.isString(data)) {
106
+ return await setValueImpl(data, value);
107
+ }
167
108
 
168
- // If the property exists as a member variable, get it directly
169
- if (prop in this)
170
- {
171
- return this[prop];
109
+ for (let propName in data) {
110
+ await setValueImpl(propName, data[propName]);
111
+ }
112
+ return this;
113
+ },
114
+
115
+ /**
116
+ * Returns the value of the given property. If no generated getter could
117
+ * be found, a fallback tries to access a handwritten getter.
118
+ *
119
+ * @param prop {String}
120
+ * Name of the property.
121
+ *
122
+ * @return {var}
123
+ * The value of the value
124
+ *
125
+ * @param safe {Boolean?false}
126
+ *
127
+ * @throws {Error}
128
+ * if a property defined does not exist
129
+ */
130
+ get(prop, safe) {
131
+ if (safe) {
132
+ let property = qx.Class.getByProperty(this.constructor, prop);
133
+ if (property) {
134
+ return property.getSafe(this);
172
135
  }
136
+ }
173
137
 
174
- throw new Error("No such property: " + prop);
175
- },
176
-
177
- /**
178
- *
179
- * Returns the value of the given property.
180
- * If the property is not initialized, it will return undefined.
181
- *
182
- * @param prop {String}
183
- * Name of the property.
184
- *
185
- * @returns {*}
186
- */
187
- getSafe(prop) {
188
- return this.get(prop, true);
189
- },
190
-
191
- /**
192
- * Resets the value of the given property. If no generated resetter
193
- * could be found, a handwritten resetter will be invoked, if available.
194
- *
195
- * @param prop {String}
196
- * Name of the property.
197
- *
198
- * @throws {Error}
199
- * if a property defined does not exist
200
- */
201
- reset(prop)
202
- {
203
- // Reset the property
204
- if (this["reset" + qx.Bootstrap.firstUp(prop)] != undefined)
205
- {
206
- return this["reset" + qx.Bootstrap.firstUp(prop)]();
207
- }
138
+ // Otherwise, see if there's a hand-written getter method
139
+ if (this["get" + qx.Bootstrap.firstUp(prop)] != undefined) {
140
+ return this["get" + qx.Bootstrap.firstUp(prop)]();
141
+ }
208
142
 
209
- throw new Error("No such property: " + prop);
143
+ // If the property exists as a member variable, get it directly
144
+ if (prop in this) {
145
+ return this[prop];
210
146
  }
147
+
148
+ throw new Error("No such property: " + prop);
149
+ },
150
+
151
+ /**
152
+ *
153
+ * Returns the value of the given property.
154
+ * If the property is not initialized, it will return undefined.
155
+ *
156
+ * @param prop {String}
157
+ * Name of the property.
158
+ *
159
+ * @returns {*}
160
+ */
161
+ getSafe(prop) {
162
+ return this.get(prop, true);
163
+ },
164
+
165
+ /**
166
+ * Resets the value of the given property. If no generated resetter
167
+ * could be found, a handwritten resetter will be invoked, if available.
168
+ *
169
+ * @param prop {String}
170
+ * Name of the property.
171
+ *
172
+ * @throws {Error}
173
+ * if a property defined does not exist
174
+ */
175
+ reset(prop) {
176
+ // Reset the property
177
+ if (this["reset" + qx.Bootstrap.firstUp(prop)] != undefined) {
178
+ return this["reset" + qx.Bootstrap.firstUp(prop)]();
179
+ }
180
+
181
+ throw new Error("No such property: " + prop);
211
182
  }
212
- });
183
+ }
184
+ });
@@ -23,13 +23,17 @@ qx.Bootstrap.define("qx.core.check.AbstractCheck", {
23
23
  extend: Object,
24
24
  implement: qx.core.check.ICheck,
25
25
 
26
+ /**
27
+ *
28
+ * @param {boolean} nullable
29
+ */
26
30
  construct(nullable) {
27
31
  super();
28
32
  this.__nullable = !!nullable;
29
33
  },
30
34
 
31
35
  members: {
32
- /** @type{Boolean} whether null is allowed */
36
+ /** @type {Boolean} whether null is allowed */
33
37
  __nullable: null,
34
38
 
35
39
  /**
@@ -68,6 +68,12 @@ qx.Bootstrap.define("qx.core.check.CheckFactory", {
68
68
  expr = expr.replace(/<.*>/g, ""); // remove generics
69
69
 
70
70
  let checkname = expr;
71
+ if (checkname.includes("||")) {
72
+ //For now, if the typename contains ||, we just accept it.
73
+ //That's what it was like in version 7
74
+ return new qx.core.check.Any();
75
+ }
76
+
71
77
  if (checkname.endsWith("?")) {
72
78
  checkname = checkname.substring(0, checkname.length - 1);
73
79
  nullable = true;
@@ -22,6 +22,11 @@
22
22
  qx.Bootstrap.define("qx.core.check.DynamicTypeCheck", {
23
23
  extend: qx.core.check.AbstractCheck,
24
24
 
25
+ /**
26
+ *
27
+ * @param {string} typename
28
+ * @param {boolean} nullable
29
+ */
25
30
  construct(typename, nullable) {
26
31
  super(nullable);
27
32
  this.__typename = typename;
@@ -61,6 +66,10 @@ qx.Bootstrap.define("qx.core.check.DynamicTypeCheck", {
61
66
  }
62
67
  tmp = tmp.superclass;
63
68
  }
69
+ } else if (typeof window[this.__typename] === "function") {
70
+ //handle cases where the check is a globally-defined class
71
+ let clazz = window[this.__typename];
72
+ return value instanceof clazz;
64
73
  }
65
74
 
66
75
  return false;
@@ -25,16 +25,10 @@ qx.Bootstrap.define("qx.core.property.ExplicitPropertyStorage", {
25
25
 
26
26
  /**
27
27
  * @param {qx.core.property.Property} property
28
- * @param {Function} clazz Qooxdoo class which the property relates to
29
28
  */
30
- construct(property, clazz) {
29
+ construct(property) {
31
30
  super();
32
- let def = property.getDefinition();
33
31
  this.__property = property;
34
- this.__get = def.get;
35
- this.__getAsync = def.getAsync || def.get;
36
- this.__set = def.set;
37
- this.__setAsync = def.setAsync || def.set;
38
32
  },
39
33
 
40
34
  members: {
@@ -42,32 +36,26 @@ qx.Bootstrap.define("qx.core.property.ExplicitPropertyStorage", {
42
36
  * @type {qx.core.property.Property}
43
37
  */
44
38
  __property: null,
39
+
45
40
  /**
46
41
  * @Override
47
42
  */
48
43
  get(thisObj, property) {
49
- return this.__get.call(thisObj, property, thisObj);
44
+ return this.__property.getDefinition().get.call(thisObj, property, thisObj);
50
45
  },
51
46
 
52
47
  /**
53
48
  * @Override
54
49
  */
55
50
  getAsync(thisObj, property) {
56
- return this.__getAsync.call(thisObj, property, thisObj);
51
+ return this.__property.getDefinition().getAsync.call(thisObj, property, thisObj);
57
52
  },
58
53
 
59
54
  /**
60
55
  * @Override
61
56
  */
62
57
  set(thisObj, property, value) {
63
- this.__set.call(thisObj, value, property, thisObj);
64
- },
65
-
66
- /**
67
- * @Override
68
- */
69
- setAsync(thisObj, property, value) {
70
- return this.__setAsync.call(thisObj, property, value);
58
+ this.__property.getDefinition().set.call(thisObj, value, property, thisObj);
71
59
  },
72
60
 
73
61
  /**
@@ -80,8 +68,8 @@ qx.Bootstrap.define("qx.core.property.ExplicitPropertyStorage", {
80
68
  /**
81
69
  * @Override
82
70
  */
83
- isAsyncStorage() {
84
- return this.__property.isAsync();
71
+ supportsGetAsync() {
72
+ return !!this.__property.getDefinition().getAsync;
85
73
  }
86
74
  }
87
75
  });
@@ -48,25 +48,6 @@ qx.Interface.define("qx.core.property.IPropertyStorage", {
48
48
  */
49
49
  set(thisObj, property, value) {},
50
50
 
51
- /**
52
- * Sets a value asynchronously
53
- *
54
- * @param {qx.core.Object} thisObj
55
- * @param {qx.core.propety.IProperty} property the property to set the value of
56
- * @param {*} value
57
- */
58
- async setAsync(thisObj, property, value) {},
59
-
60
- /**
61
- * Called when the property is reset; for standard properties, this just passes through to
62
- * `set`, but pseudo properties may need to call the implemented `reset` method
63
- *
64
- * @param {qx.core.Object} thisObj
65
- * @param {qx.core.propety.IProperty} property the property to set the value of
66
- * @param {*} value
67
- */
68
- reset(thisObj, property, value) {},
69
-
70
51
  /**
71
52
  * Deletes the value
72
53
  *
@@ -76,8 +57,8 @@ qx.Interface.define("qx.core.property.IPropertyStorage", {
76
57
  dereference(thisObj, property) {},
77
58
 
78
59
  /**
79
- * Returns whether the storage supports asynchronous backing, ie the getter could be async
60
+ * Returns whether the storage supports asynchronous getting.
80
61
  */
81
- isAsyncStorage() {}
62
+ supportsGetAsync() {}
82
63
  }
83
64
  });