@qooxdoo/framework 7.0.0 → 7.1.0

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 (28) hide show
  1. package/CHANGELOG.md +8 -3
  2. package/Manifest.json +1 -1
  3. package/README.md +2 -4
  4. package/lib/compiler/compile-info.json +65 -63
  5. package/lib/compiler/index.js +1846 -1569
  6. package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css.map +1 -1
  7. package/npm-shrinkwrap.json +933 -32
  8. package/package.json +2 -1
  9. package/source/class/qx/tool/cli/api/AbstractApi.js +4 -1
  10. package/source/class/qx/tool/cli/commands/Compile.js +1 -0
  11. package/source/class/qx/tool/cli/commands/Lint.js +15 -5
  12. package/source/class/qx/tool/compiler/ClassFile.js +70 -0
  13. package/source/class/qx/tool/compiler/TargetError.js +27 -0
  14. package/source/class/qx/tool/compiler/targets/Target.js +6 -0
  15. package/source/class/qx/tool/compiler/targets/meta/AbstractJavascriptMeta.js +1 -1
  16. package/source/class/qx/tool/compiler/targets/meta/Browserify.js +143 -0
  17. package/source/class/qx/ui/form/AbstractSelectBox.js +4 -1
  18. package/source/class/qx/ui/form/DateField.js +4 -1
  19. package/source/class/qx/ui/progressive/renderer/table/Row.js +2 -1
  20. package/source/class/qx/ui/progressive/renderer/table/cell/Boolean.js +24 -26
  21. package/source/class/qx/ui/progressive/renderer/table/cell/Icon.js +9 -7
  22. package/source/class/qx/ui/progressive/renderer/table/cell/Image.js +16 -13
  23. package/source/class/qx/ui/table/Table.js +0 -1
  24. package/source/class/qx/ui/table/model/Abstract.js +31 -1
  25. package/source/class/qx/ui/table/model/Remote.js +1 -0
  26. package/source/class/qx/ui/table/model/Simple.js +3 -0
  27. package/source/class/qx/ui/treevirtual/MNode.js +60 -5
  28. package/source/class/qx/ui/treevirtual/SimpleTreeDataModel.js +11 -3
@@ -66,11 +66,22 @@ qx.Class.define("qx.ui.table.model.Abstract", {
66
66
  this.__columnIndexMap = {};
67
67
  },
68
68
 
69
+ statics: {
70
+ /**
71
+ * Member to control if a table should throw an error when you try to change the
72
+ * data model data whilst there is an incomplete edit. It could possibly break
73
+ * current implementations so only introduce the change from QX v8.
74
+ * Ref: https://github.com/qooxdoo/qooxdoo/pull/10377#discussion_r818697343
75
+ */
76
+ THROW_ON_MODEL_CHANGE_DURING_EDIT: parseInt(qx.core.Environment.get("qx.version"), 10) >= 8
77
+ },
78
+
69
79
  members: {
70
80
  __columnIdArr: null,
71
81
  __columnNameArr: null,
72
82
  __columnIndexMap: null,
73
83
  __internalChange: null,
84
+ __table: null,
74
85
 
75
86
  /**
76
87
  * Initialize the table model <--> table interaction. The table model is
@@ -84,7 +95,17 @@ qx.Class.define("qx.ui.table.model.Abstract", {
84
95
  * The table to which this model is attached
85
96
  */
86
97
  init(table) {
87
- // default implementation has nothing to do
98
+ // store a reference back to the table
99
+ this.__table = table;
100
+ },
101
+
102
+ /**
103
+ *
104
+ *
105
+ * @returns table {qx.ui.table.Table}
106
+ */
107
+ getTable() {
108
+ return this.__table;
88
109
  },
89
110
 
90
111
  /**
@@ -292,6 +313,15 @@ qx.Class.define("qx.ui.table.model.Abstract", {
292
313
  }
293
314
 
294
315
  this.setColumnNamesByIndex(columnNameArr);
316
+ },
317
+
318
+ _checkEditing() {
319
+ if (!qx.ui.table.model.Abstract.THROW_ON_MODEL_CHANGE_DURING_EDIT) {
320
+ return;
321
+ }
322
+ if (this.getTable() && this.getTable().isEditing()) {
323
+ throw new Error("A cell is currently being edited. Commit or cancel the edit before setting the table data");
324
+ }
295
325
  }
296
326
  },
297
327
 
@@ -548,6 +548,7 @@ qx.Class.define("qx.ui.table.model.Remote", {
548
548
  * @param rowIndex {Integer} the index of the row to remove.
549
549
  */
550
550
  removeRow(rowIndex) {
551
+ this._checkEditing();
551
552
  if (this.getClearCacheOnRemove()) {
552
553
  this.clearCache();
553
554
 
@@ -531,6 +531,7 @@ qx.Class.define("qx.ui.table.model.Simple", {
531
531
  * @param clearSorting {Boolean ? true} Whether to clear the sort state.
532
532
  */
533
533
  setData(rowArr, clearSorting) {
534
+ this._checkEditing();
534
535
  this._rowArr = rowArr;
535
536
 
536
537
  // Inform the listeners
@@ -650,6 +651,7 @@ qx.Class.define("qx.ui.table.model.Simple", {
650
651
  * @param clearSorting {Boolean ? true} Whether to clear the sort state.
651
652
  */
652
653
  setRows(rowArr, startIndex, clearSorting) {
654
+ this._checkEditing();
653
655
  if (startIndex == null) {
654
656
  startIndex = 0;
655
657
  }
@@ -708,6 +710,7 @@ qx.Class.define("qx.ui.table.model.Simple", {
708
710
  * @param clearSorting {Boolean ? true} Whether to clear the sort state.
709
711
  */
710
712
  removeRows(startIndex, howMany, clearSorting) {
713
+ this._checkEditing();
711
714
  // In the case of `removeRows`, specifically, we must create the
712
715
  // listeners' event data before actually removing the rows from
713
716
  // the row data, so that the `lastRow` calculation is correct.
@@ -165,7 +165,33 @@ qx.Mixin.define("qx.ui.treevirtual.MNode", {
165
165
  },
166
166
 
167
167
  /**
168
- * Set the opened state for a node. (Note that this method has no effect
168
+ * Opens all nodes in the tree with minimal redraw
169
+ */
170
+ nodeOpenAll() {
171
+ var model = this.getTableModel();
172
+ model.getData().forEach(node => {
173
+ if (node) {
174
+ model.setState(node.nodeId, {bOpened: true}, true);
175
+ }
176
+ });
177
+ model.setData();
178
+ },
179
+
180
+ /**
181
+ * Closes all nodes in the tree with minimal redraw
182
+ */
183
+ nodeCloseAll() {
184
+ var model = this.getTableModel();
185
+ model.getData().forEach(node => {
186
+ if (node) {
187
+ model.setState(node.nodeId, {bOpened: false}, true);
188
+ }
189
+ });
190
+ model.setData();
191
+ },
192
+
193
+ /**
194
+ * Internal call to set the opened state for a node. (Note that this method has no effect
169
195
  * if the requested state is the same as the current state.)
170
196
  *
171
197
  * @param nodeReference {Object | Integer}
@@ -173,11 +199,16 @@ qx.Mixin.define("qx.ui.treevirtual.MNode", {
173
199
  * represented either by the node object, or the node id (as would have
174
200
  * been returned by addBranch(), addLeaf(), etc.)
175
201
  *
176
- * @param b {Boolean}
202
+ * @param opened {Boolean}
177
203
  * The new opened state for the specified node.
178
204
  *
205
+ * @param cascade {Boolean}
206
+ * Whether to descend the tree changing opened state of all children
207
+ *
208
+ * @param isRecursed {Boolean?}
209
+ * For internal use when cascading to determine outer level and call setData
179
210
  */
180
- nodeSetOpened(nodeReference, b) {
211
+ _nodeSetOpenedInternal(nodeReference, opened, cascade, isRecursed) {
181
212
  var node;
182
213
 
183
214
  if (typeof nodeReference == "object") {
@@ -190,10 +221,34 @@ qx.Mixin.define("qx.ui.treevirtual.MNode", {
190
221
 
191
222
  // Only set new state if not already in the requested state, since
192
223
  // setting new state involves dispatching events.
193
- if (b != node.bOpened) {
194
- this.nodeToggleOpened(node);
224
+ if (opened != node.bOpened) {
225
+ this.getTableModel().setState(node.nodeId, { bOpened: opened }, true);
226
+ }
227
+ if (cascade) {
228
+ node.children.forEach(child => this.nodeSetOpened(child, opened, cascade, true));
229
+ }
230
+ if (!cascade || !isRecursed) {
231
+ this.getTableModel().setData();
195
232
  }
196
233
  },
234
+ /**
235
+ * Set the opened state for a node. (Note that this method has no effect
236
+ * if the requested state is the same as the current state.)
237
+ *
238
+ * @param nodeReference {Object | Integer}
239
+ * The node for which the opened state is being set. The node can be
240
+ * represented either by the node object, or the node id (as would have
241
+ * been returned by addBranch(), addLeaf(), etc.)
242
+ *
243
+ * @param opened {Boolean}
244
+ * The new opened state for the specified node.
245
+ *
246
+ * @param cascade {Boolean}
247
+ * Whether to descend the tree changing opened state of all children
248
+ */
249
+ nodeSetOpened(nodeReference, opened, cascade) {
250
+ this._nodeSetOpenedInternal(nodeReference, opened, cascade, false);
251
+ },
197
252
 
198
253
  /**
199
254
  * Get the opened state for a node.
@@ -795,7 +795,7 @@ qx.Class.define("qx.ui.treevirtual.SimpleTreeDataModel", {
795
795
  * Sets the whole data en bulk, or notifies the data model that node
796
796
  * modifications are complete.
797
797
  *
798
- * @param nodeArr {Array | null}
798
+ * @param nodeArr {Array?null}
799
799
  * Pass either an Array of node objects, or null.
800
800
  *
801
801
  * If non-null, nodeArr is an array of node objects containing the
@@ -813,6 +813,7 @@ qx.Class.define("qx.ui.treevirtual.SimpleTreeDataModel", {
813
813
  * @throws {Error} If the parameter has the wrong type.
814
814
  */
815
815
  setData(nodeArr) {
816
+ this._checkEditing();
816
817
  if (nodeArr instanceof Array) {
817
818
  // Save the user-supplied data.
818
819
  this._nodeArr = nodeArr;
@@ -853,6 +854,7 @@ qx.Class.define("qx.ui.treevirtual.SimpleTreeDataModel", {
853
854
  *
854
855
  */
855
856
  clearData() {
857
+ this._checkEditing();
856
858
  this._clearSelections();
857
859
  this.setData([qx.ui.treevirtual.MTreePrimitive._getEmptyTree()]);
858
860
  },
@@ -907,9 +909,13 @@ qx.Class.define("qx.ui.treevirtual.SimpleTreeDataModel", {
907
909
  * {@link SimpleTreeDataModel}. Each property value will be assigned
908
910
  * to the corresponding property of the node specified by nodeId.
909
911
  *
912
+ * @param suppressRedraw {Boolean}
913
+ * If true then prevents redraw; it becomes the caller's responsibility to
914
+ * call setData() subsequently, to cause a redraw.
915
+ *
910
916
  * @throws {Error} If the node object or id is not valid.
911
917
  */
912
- setState(nodeReference, attributes) {
918
+ setState(nodeReference, attributes, suppressRedraw) {
913
919
  var node;
914
920
  var nodeId;
915
921
 
@@ -1003,7 +1009,9 @@ qx.Class.define("qx.ui.treevirtual.SimpleTreeDataModel", {
1003
1009
 
1004
1010
  // Re-render the row data since formerly visible rows may now be
1005
1011
  // invisible, or vice versa.
1006
- this.setData();
1012
+ if (!suppressRedraw) {
1013
+ this.setData();
1014
+ }
1007
1015
  break;
1008
1016
 
1009
1017
  default: