@mongoosejs/studio 0.0.47 → 0.0.48
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/frontend/public/app.js
CHANGED
|
@@ -902,7 +902,7 @@ module.exports = app => app.component('document', {
|
|
|
902
902
|
const { doc, schemaPaths } = await api.Model.getDocument({ model: this.model, documentId: this.documentId });
|
|
903
903
|
window.doc = doc;
|
|
904
904
|
this.document = doc;
|
|
905
|
-
this.schemaPaths =
|
|
905
|
+
this.schemaPaths = Object.keys(schemaPaths).sort((k1, k2) => {
|
|
906
906
|
if (k1 === '_id' && k2 !== '_id') {
|
|
907
907
|
return -1;
|
|
908
908
|
}
|
|
@@ -952,6 +952,7 @@ module.exports = app => app.component('document', {
|
|
|
952
952
|
}
|
|
953
953
|
});
|
|
954
954
|
|
|
955
|
+
|
|
955
956
|
/***/ }),
|
|
956
957
|
|
|
957
958
|
/***/ "./frontend/src/edit-array/edit-array.js":
|
|
@@ -979,7 +980,7 @@ appendCSS(__webpack_require__(/*! ./edit-array.css */ "./frontend/src/edit-array
|
|
|
979
980
|
module.exports = app => app.component('edit-array', {
|
|
980
981
|
template: template,
|
|
981
982
|
props: ['value'],
|
|
982
|
-
data: () => ({ currentValue:
|
|
983
|
+
data: () => ({ currentValue: -1, status: 'init' }),
|
|
983
984
|
mounted() {
|
|
984
985
|
this.currentValue = this.value == null
|
|
985
986
|
? '' + this.value
|
|
@@ -992,14 +993,16 @@ module.exports = app => app.component('edit-array', {
|
|
|
992
993
|
this.editor.on('change', ev => {
|
|
993
994
|
this.currentValue = this.editor.getValue();
|
|
994
995
|
});
|
|
996
|
+
this.$nextTick(() => {
|
|
997
|
+
this.status = 'init';
|
|
998
|
+
})
|
|
995
999
|
},
|
|
996
1000
|
watch: {
|
|
997
1001
|
currentValue(newValue, oldValue) {
|
|
998
1002
|
// Hacky way of skipping initial trigger because `immediate: false` doesn't work in Vue 3
|
|
999
|
-
if (
|
|
1003
|
+
if (oldValue === -1) {
|
|
1000
1004
|
return;
|
|
1001
1005
|
}
|
|
1002
|
-
this.status = 'loaded';
|
|
1003
1006
|
try {
|
|
1004
1007
|
const array = eval(`(${this.currentValue})`);
|
|
1005
1008
|
this.$emit('input', array);
|
|
@@ -28,7 +28,7 @@ module.exports = app => app.component('document', {
|
|
|
28
28
|
const { doc, schemaPaths } = await api.Model.getDocument({ model: this.model, documentId: this.documentId });
|
|
29
29
|
window.doc = doc;
|
|
30
30
|
this.document = doc;
|
|
31
|
-
this.schemaPaths =
|
|
31
|
+
this.schemaPaths = Object.keys(schemaPaths).sort((k1, k2) => {
|
|
32
32
|
if (k1 === '_id' && k2 !== '_id') {
|
|
33
33
|
return -1;
|
|
34
34
|
}
|
|
@@ -76,4 +76,4 @@ module.exports = app => app.component('document', {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
});
|
|
79
|
+
});
|
|
@@ -16,7 +16,7 @@ appendCSS(require('./edit-array.css'));
|
|
|
16
16
|
module.exports = app => app.component('edit-array', {
|
|
17
17
|
template: template,
|
|
18
18
|
props: ['value'],
|
|
19
|
-
data: () => ({ currentValue:
|
|
19
|
+
data: () => ({ currentValue: -1 }),
|
|
20
20
|
mounted() {
|
|
21
21
|
this.currentValue = this.value == null
|
|
22
22
|
? '' + this.value
|
|
@@ -33,10 +33,9 @@ module.exports = app => app.component('edit-array', {
|
|
|
33
33
|
watch: {
|
|
34
34
|
currentValue(newValue, oldValue) {
|
|
35
35
|
// Hacky way of skipping initial trigger because `immediate: false` doesn't work in Vue 3
|
|
36
|
-
if (
|
|
36
|
+
if (oldValue === -1) {
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
this.status = 'loaded';
|
|
40
39
|
try {
|
|
41
40
|
const array = eval(`(${this.currentValue})`);
|
|
42
41
|
this.$emit('input', array);
|