@ditojs/admin 2.73.2 → 2.73.4
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.73.
|
|
3
|
+
"version": "2.73.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Dito.js Admin is a schema based admin interface for Dito.js Server, featuring auto-generated views and forms and built with Vue.js",
|
|
6
6
|
"repository": "https://github.com/ditojs/dito/tree/master/packages/admin",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"typescript": "^5.9.3",
|
|
94
94
|
"vite": "^7.3.1"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "bbb41fce56cdd91db7a090a2237bd130a699159a"
|
|
97
97
|
}
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
:label="label"
|
|
37
37
|
:single="single"
|
|
38
38
|
:nested="nested"
|
|
39
|
-
:disabled="componentDisabled"
|
|
40
39
|
:accumulatedBasis="combinedBasis"
|
|
41
40
|
@errors="onErrors"
|
|
41
|
+
@update:component="value => (component = value)"
|
|
42
42
|
)
|
|
43
43
|
DitoErrors(:errors="errors")
|
|
44
44
|
</template>
|
|
@@ -48,6 +48,7 @@ import { isString, isNumber } from '@ditojs/utils'
|
|
|
48
48
|
import DitoComponent from '../DitoComponent.js'
|
|
49
49
|
import ValueMixin from '../mixins/ValueMixin.js'
|
|
50
50
|
import ContextMixin from '../mixins/ContextMixin.js'
|
|
51
|
+
import DitoContext from '../DitoContext.js'
|
|
51
52
|
import { getSchemaAccessor } from '../utils/accessor.js'
|
|
52
53
|
import {
|
|
53
54
|
getAllPanelEntries,
|
|
@@ -77,11 +78,29 @@ export default DitoComponent.component('DitoContainer', {
|
|
|
77
78
|
|
|
78
79
|
data() {
|
|
79
80
|
return {
|
|
80
|
-
errors: null
|
|
81
|
+
errors: null,
|
|
82
|
+
// The nested type component instance, for context-based schema accessor
|
|
83
|
+
// evaluation.
|
|
84
|
+
component: null
|
|
81
85
|
}
|
|
82
86
|
},
|
|
83
87
|
|
|
84
88
|
computed: {
|
|
89
|
+
context() {
|
|
90
|
+
return new DitoContext(
|
|
91
|
+
// When available, use the type component for context-based schema
|
|
92
|
+
// accessors, but fall back to container.
|
|
93
|
+
// TODO: Consider architectural inversion to eliminate timing issues:
|
|
94
|
+
// - Type components render DitoContainer at their root
|
|
95
|
+
// - Pass type component content through container's default slot
|
|
96
|
+
// - DitoPane/DitoButtons render type components directly
|
|
97
|
+
// - Eliminates need for component instance synchronization
|
|
98
|
+
// - Provides true synchronous access to component context
|
|
99
|
+
this.component ?? this,
|
|
100
|
+
{ nested: this.nested }
|
|
101
|
+
)
|
|
102
|
+
},
|
|
103
|
+
|
|
85
104
|
name() {
|
|
86
105
|
return this.schema.name
|
|
87
106
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
component.dito-label(
|
|
3
3
|
v-if="text || collapsible"
|
|
4
|
-
:is="
|
|
4
|
+
:is="collapsible ? 'button' : 'div'"
|
|
5
|
+
:type="collapsible ? 'button' : null"
|
|
5
6
|
v-bind="attributes"
|
|
6
7
|
:class="{ 'dito-label--active': isActive }"
|
|
7
8
|
)
|
|
@@ -51,10 +52,6 @@ export default DitoComponent.component('DitoLabel', {
|
|
|
51
52
|
},
|
|
52
53
|
|
|
53
54
|
computed: {
|
|
54
|
-
as() {
|
|
55
|
-
return this.collapsible ? 'button' : 'div'
|
|
56
|
-
},
|
|
57
|
-
|
|
58
55
|
text() {
|
|
59
56
|
const { label } = this
|
|
60
57
|
return isObject(label) ? label?.text : label
|
package/src/mixins/TypeMixin.js
CHANGED
|
@@ -7,6 +7,7 @@ import { asArray, camelize } from '@ditojs/utils'
|
|
|
7
7
|
// @vue/component
|
|
8
8
|
export default {
|
|
9
9
|
mixins: [ValueMixin, ContextMixin, ValidationMixin],
|
|
10
|
+
emits: ['update:component'],
|
|
10
11
|
|
|
11
12
|
props: {
|
|
12
13
|
schema: { type: Object, required: true },
|
|
@@ -20,7 +21,6 @@ export default {
|
|
|
20
21
|
label: { type: String, default: null },
|
|
21
22
|
single: { type: Boolean, default: false },
|
|
22
23
|
nested: { type: Boolean, default: true },
|
|
23
|
-
disabled: { type: Boolean, default: false },
|
|
24
24
|
accumulatedBasis: { type: Number, default: null }
|
|
25
25
|
},
|
|
26
26
|
|
|
@@ -84,6 +84,11 @@ export default {
|
|
|
84
84
|
}
|
|
85
85
|
}),
|
|
86
86
|
|
|
87
|
+
disabled: getSchemaAccessor('disabled', {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false
|
|
90
|
+
}),
|
|
91
|
+
|
|
87
92
|
maxLength: getSchemaAccessor('maxLength', {
|
|
88
93
|
type: Number
|
|
89
94
|
}),
|
|
@@ -167,6 +172,8 @@ export default {
|
|
|
167
172
|
|
|
168
173
|
methods: {
|
|
169
174
|
_register(add) {
|
|
175
|
+
// Provide component to container for schema accessor evaluation.
|
|
176
|
+
this.$emit('update:component', add ? this : null)
|
|
170
177
|
// Prevent unnested type components from overriding parent data paths
|
|
171
178
|
if (this.nested) {
|
|
172
179
|
this.schemaComponent._registerComponent(this, add)
|