@onehat/data 1.22.30 → 1.22.32
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.
package/package.json
CHANGED
package/src/Property/Mixed.js
CHANGED
|
@@ -431,7 +431,7 @@ export default class MixedProperty extends EventEmitter {
|
|
|
431
431
|
defaultValue: null,
|
|
432
432
|
formatter: null,
|
|
433
433
|
};
|
|
434
|
-
|
|
434
|
+
|
|
435
435
|
// If types are configured, use the first type's default value
|
|
436
436
|
if (defaults.types && Array.isArray(defaults.types) && defaults.types.length > 0) {
|
|
437
437
|
const
|
|
@@ -450,7 +450,7 @@ export default class MixedProperty extends EventEmitter {
|
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
-
return _.merge({},
|
|
453
|
+
return _.merge({}, defaults);
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
|
|
@@ -1138,9 +1138,15 @@ export default class Repository extends EventEmitter {
|
|
|
1138
1138
|
entity = Repository._createEntity(this.schema, data, this, isPersisted, isDelayedSave, this.isRemotePhantomMode);
|
|
1139
1139
|
}
|
|
1140
1140
|
this._relayEntityEvents(entity);
|
|
1141
|
-
if (this.isTree
|
|
1142
|
-
|
|
1143
|
-
|
|
1141
|
+
if (this.isTree) {
|
|
1142
|
+
let ix = 1; // default to beginning
|
|
1143
|
+
if (data.previousSiblingId) {
|
|
1144
|
+
// new node to be added as next sibling of previousSiblingId
|
|
1145
|
+
ix = this.getIxById(data.previousSiblingId) +1;
|
|
1146
|
+
} else if (data.parentId) {
|
|
1147
|
+
// new node to be added as first child of parent
|
|
1148
|
+
ix = this.getIxById(data.parentId) +1;
|
|
1149
|
+
}
|
|
1144
1150
|
this.entities = [
|
|
1145
1151
|
...this.entities.slice(0, ix),
|
|
1146
1152
|
entity,
|
package/src/Repository/Tree.js
CHANGED
|
@@ -371,7 +371,7 @@ class TreeRepository extends OneBuildRepository {
|
|
|
371
371
|
getRootNodes() {
|
|
372
372
|
this.ensureTree();
|
|
373
373
|
if (this.isDestroyed) {
|
|
374
|
-
this.throwError('this.
|
|
374
|
+
this.throwError('this.getRootNodes is no longer valid. Repository has been destroyed.');
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
377
377
|
|