@ditojs/admin 2.35.0 → 2.36.1
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/dist/dito-admin.es.js +1970 -1939
- package/dist/dito-admin.umd.js +5 -5
- package/package.json +31 -31
- package/src/DitoContext.js +39 -16
- package/src/components/DitoButtons.vue +5 -0
- package/src/components/DitoContainer.vue +5 -3
- package/src/components/DitoCreateButton.vue +3 -1
- package/src/components/DitoEditButtons.vue +5 -0
- package/src/components/DitoPane.vue +8 -0
- package/src/components/DitoPanel.vue +7 -1
- package/src/components/DitoPanels.vue +10 -0
- package/src/components/DitoRoot.vue +1 -1
- package/src/components/DitoSchema.vue +9 -29
- package/src/components/DitoTableCell.vue +3 -0
- package/src/mixins/ContextMixin.js +68 -0
- package/src/mixins/TypeMixin.js +3 -86
- package/src/mixins/ValueMixin.js +32 -0
- package/src/types/DitoTypeComputed.vue +3 -3
- package/src/types/DitoTypeList.vue +1 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import DitoContext from '../DitoContext.js'
|
|
2
|
+
import { computeValue } from '../utils/schema.js'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
computed: {
|
|
6
|
+
value: {
|
|
7
|
+
get() {
|
|
8
|
+
const value = computeValue(
|
|
9
|
+
this.schema,
|
|
10
|
+
this.data,
|
|
11
|
+
this.name,
|
|
12
|
+
this.dataPath,
|
|
13
|
+
{ component: this }
|
|
14
|
+
)
|
|
15
|
+
const { format } = this.schema
|
|
16
|
+
return format
|
|
17
|
+
? format(new DitoContext(this, { value }))
|
|
18
|
+
: value
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
set(value) {
|
|
22
|
+
const { parse } = this.schema
|
|
23
|
+
if (parse) {
|
|
24
|
+
value = parse(new DitoContext(this, { value }))
|
|
25
|
+
}
|
|
26
|
+
this.parsedValue = value
|
|
27
|
+
// eslint-disable-next-line vue/no-mutating-props
|
|
28
|
+
this.data[this.name] = value
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -14,7 +14,7 @@ input.dito-text.dito-input(
|
|
|
14
14
|
|
|
15
15
|
<script>
|
|
16
16
|
import DitoTypeComponent from '../DitoTypeComponent.js'
|
|
17
|
-
import
|
|
17
|
+
import ValueMixin from '../mixins/ValueMixin.js'
|
|
18
18
|
import DataMixin from '../mixins/DataMixin.js'
|
|
19
19
|
|
|
20
20
|
export default DitoTypeComponent.register(
|
|
@@ -37,11 +37,11 @@ export default DitoTypeComponent.register(
|
|
|
37
37
|
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
38
38
|
this.data[this.name] = value
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return ValueMixin.computed.value.get.call(this)
|
|
41
41
|
},
|
|
42
42
|
|
|
43
43
|
set(value) {
|
|
44
|
-
|
|
44
|
+
ValueMixin.computed.value.set.call(this, value)
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|