@ditojs/admin 2.10.0 → 2.10.2
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 +11 -6
- package/dist/dito-admin.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/src/DitoContext.js +1 -1
- package/src/components/DitoPane.vue +9 -0
- package/src/components/DitoSchemaInlined.vue +2 -1
- package/src/types/DitoTypeSection.vue +6 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.2",
|
|
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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"not ie_mob > 0"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@ditojs/ui": "^2.10.
|
|
36
|
+
"@ditojs/ui": "^2.10.2",
|
|
37
37
|
"@ditojs/utils": "^2.10.0",
|
|
38
38
|
"@kyvg/vue3-notification": "^2.9.1",
|
|
39
39
|
"@lk77/vue3-color": "^3.0.6",
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
79
79
|
"@vue/compiler-sfc": "^3.3.4",
|
|
80
80
|
"pug": "^3.0.2",
|
|
81
|
-
"sass": "1.
|
|
81
|
+
"sass": "1.63.2",
|
|
82
82
|
"typescript": "^5.1.3",
|
|
83
83
|
"vite": "^4.3.9"
|
|
84
84
|
},
|
|
85
85
|
"types": "types",
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "b55fe95fb3e52f5ef6a59d0fc8670c15313985d6",
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "vite build",
|
|
89
89
|
"watch": "yarn build --mode 'development' --watch",
|
package/src/DitoContext.js
CHANGED
|
@@ -22,7 +22,7 @@ const contexts = new WeakMap()
|
|
|
22
22
|
|
|
23
23
|
function get(context, key, defaultValue) {
|
|
24
24
|
const object = contexts.get(toRaw(context))
|
|
25
|
-
const value = object[key]
|
|
25
|
+
const value = key in object ? object[key] : undefined
|
|
26
26
|
// If `object` explicitly sets the key to `undefined`, return it.
|
|
27
27
|
return value !== undefined || hasOwnProperty.call(object, key)
|
|
28
28
|
? value
|
|
@@ -292,8 +292,17 @@ export default DitoComponent.component('DitoPane', {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
+
&--padding-inlined {
|
|
296
|
+
padding: 0;
|
|
297
|
+
}
|
|
298
|
+
|
|
295
299
|
&--padding-nested {
|
|
296
300
|
padding: $form-spacing;
|
|
301
|
+
|
|
302
|
+
&:has(> .dito-container--label-vertical:first-of-type) {
|
|
303
|
+
// Reduce top spacing when the first row has labels.
|
|
304
|
+
padding-top: $form-spacing-half;
|
|
305
|
+
}
|
|
297
306
|
}
|
|
298
307
|
|
|
299
308
|
.dito-break {
|
|
@@ -7,7 +7,7 @@ DitoSchema.dito-schema-inlined(
|
|
|
7
7
|
:meta="meta"
|
|
8
8
|
:store="store"
|
|
9
9
|
:label="isCompact ? null : label"
|
|
10
|
-
padding="inlined"
|
|
10
|
+
:padding="padding ?? 'inlined'"
|
|
11
11
|
:inlined="true"
|
|
12
12
|
:disabled="disabled"
|
|
13
13
|
:collapsed="collapsed"
|
|
@@ -49,6 +49,7 @@ export default DitoComponent.component('DitoSchemaInlined', {
|
|
|
49
49
|
meta: { type: Object, required: true },
|
|
50
50
|
store: { type: Object, required: true },
|
|
51
51
|
label: { type: [String, Object], default: null },
|
|
52
|
+
padding: { type: String, default: null },
|
|
52
53
|
disabled: { type: Boolean, required: true },
|
|
53
54
|
collapsed: { type: Boolean, default: false },
|
|
54
55
|
collapsible: { type: Boolean, default: false },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.dito-section(:class="{ 'dito-section--labelled':
|
|
2
|
+
.dito-section(:class="{ 'dito-section--labelled': hasLabel }")
|
|
3
3
|
DitoSchemaInlined.dito-section__schema(
|
|
4
4
|
:label="label"
|
|
5
5
|
:schema="getItemFormSchema(schema, item, context)"
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
:data="item"
|
|
8
8
|
:meta="meta"
|
|
9
9
|
:store="store"
|
|
10
|
+
:padding="hasLabel ? 'nested' : 'inlined'"
|
|
10
11
|
:disabled="disabled"
|
|
11
12
|
:collapsed="collapsed"
|
|
12
13
|
:collapsible="collapsible"
|
|
@@ -31,6 +32,10 @@ export default DitoTypeComponent.register('section', {
|
|
|
31
32
|
return this.nested ? this.value : this.data
|
|
32
33
|
},
|
|
33
34
|
|
|
35
|
+
hasLabel() {
|
|
36
|
+
return !!this.schema.label
|
|
37
|
+
},
|
|
38
|
+
|
|
34
39
|
collapsible: getSchemaAccessor('collapsible', {
|
|
35
40
|
type: Boolean,
|
|
36
41
|
default: null, // so that `??` below can do its thing:
|
|
@@ -69,16 +74,6 @@ export default DitoTypeComponent.register('section', {
|
|
|
69
74
|
&:has(.dito-schema--open) {
|
|
70
75
|
border-color: $border-color;
|
|
71
76
|
}
|
|
72
|
-
|
|
73
|
-
// For animation purposes, move the padding to the contained panes.
|
|
74
|
-
> .dito-schema > .dito-schema-content > .dito-pane {
|
|
75
|
-
padding: $form-spacing;
|
|
76
|
-
|
|
77
|
-
&:has(> .dito-container--label-vertical:first-of-type) {
|
|
78
|
-
// Reduce top spacing when the first row has labels.
|
|
79
|
-
padding-top: $form-spacing-half;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
77
|
}
|
|
83
78
|
}
|
|
84
79
|
</style>
|