@ditojs/admin 2.9.6 → 2.10.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 +12 -6
- package/dist/dito-admin.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +12 -12
- package/src/components/DitoPane.vue +8 -3
- package/src/components/DitoPanel.vue +1 -1
- package/src/components/DitoSchemaInlined.vue +2 -0
- package/src/types/DitoTypeSection.vue +6 -11
- package/src/utils/schema.js +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.1",
|
|
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,8 +33,8 @@
|
|
|
33
33
|
"not ie_mob > 0"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@ditojs/ui": "^2.
|
|
37
|
-
"@ditojs/utils": "^2.
|
|
36
|
+
"@ditojs/ui": "^2.10.0",
|
|
37
|
+
"@ditojs/utils": "^2.10.0",
|
|
38
38
|
"@kyvg/vue3-notification": "^2.9.1",
|
|
39
39
|
"@lk77/vue3-color": "^3.0.6",
|
|
40
40
|
"@tiptap/core": "^2.0.3",
|
|
@@ -62,28 +62,28 @@
|
|
|
62
62
|
"codeflask": "^1.4.1",
|
|
63
63
|
"filesize": "^10.0.7",
|
|
64
64
|
"filesize-parser": "^1.5.0",
|
|
65
|
-
"focus-trap": "^7.4.
|
|
65
|
+
"focus-trap": "^7.4.3",
|
|
66
66
|
"nanoid": "^4.0.2",
|
|
67
67
|
"sortablejs": "^1.15.0",
|
|
68
68
|
"tinycolor2": "^1.6.0",
|
|
69
69
|
"tippy.js": "^6.3.7",
|
|
70
|
-
"type-fest": "^3.
|
|
71
|
-
"vue": "^3.3.
|
|
70
|
+
"type-fest": "^3.11.1",
|
|
71
|
+
"vue": "^3.3.4",
|
|
72
72
|
"vue-multiselect": "^3.0.0-beta.2",
|
|
73
|
-
"vue-router": "^4.2.
|
|
73
|
+
"vue-router": "^4.2.2",
|
|
74
74
|
"vue-upload-component": "^3.1.8"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@ditojs/build": "^2.
|
|
77
|
+
"@ditojs/build": "^2.10.0",
|
|
78
78
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
79
|
-
"@vue/compiler-sfc": "^3.3.
|
|
79
|
+
"@vue/compiler-sfc": "^3.3.4",
|
|
80
80
|
"pug": "^3.0.2",
|
|
81
81
|
"sass": "1.62.1",
|
|
82
|
-
"typescript": "^5.
|
|
83
|
-
"vite": "^4.3.
|
|
82
|
+
"typescript": "^5.1.3",
|
|
83
|
+
"vite": "^4.3.9"
|
|
84
84
|
},
|
|
85
85
|
"types": "types",
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "add6bbbdd21d0980af235994b96c4641ace5eeda",
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "vite build",
|
|
89
89
|
"watch": "yarn build --mode 'development' --watch",
|
|
@@ -292,12 +292,17 @@ export default DitoComponent.component('DitoPane', {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
&--padding-
|
|
296
|
-
padding:
|
|
295
|
+
&--padding-inlined {
|
|
296
|
+
padding: 0;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
&--padding-
|
|
299
|
+
&--padding-nested {
|
|
300
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
|
+
}
|
|
301
306
|
}
|
|
302
307
|
|
|
303
308
|
.dito-break {
|
|
@@ -7,6 +7,7 @@ DitoSchema.dito-schema-inlined(
|
|
|
7
7
|
:meta="meta"
|
|
8
8
|
:store="store"
|
|
9
9
|
:label="isCompact ? null : label"
|
|
10
|
+
:padding="padding ?? 'inlined'"
|
|
10
11
|
:inlined="true"
|
|
11
12
|
:disabled="disabled"
|
|
12
13
|
:collapsed="collapsed"
|
|
@@ -48,6 +49,7 @@ export default DitoComponent.component('DitoSchemaInlined', {
|
|
|
48
49
|
meta: { type: Object, required: true },
|
|
49
50
|
store: { type: Object, required: true },
|
|
50
51
|
label: { type: [String, Object], default: null },
|
|
52
|
+
padding: { type: String, default: null },
|
|
51
53
|
disabled: { type: Boolean, required: true },
|
|
52
54
|
collapsed: { type: Boolean, default: false },
|
|
53
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-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>
|
package/src/utils/schema.js
CHANGED
|
@@ -133,7 +133,10 @@ export async function resolveSchema(schema, unwrapModule = false) {
|
|
|
133
133
|
schema = { ...schema }
|
|
134
134
|
// Unwrap default or named schema
|
|
135
135
|
if (!schema.name && (unwrapModule || schema.default)) {
|
|
136
|
-
|
|
136
|
+
// Filter out internal key added by vite / vue 3 plugin when changing
|
|
137
|
+
// code in a dynamically imported vue component, see:
|
|
138
|
+
// https://github.com/vitejs/vite-plugin-vue/blob/abdf5f4f32d02af641e5f60871bde14535569b1e/packages/plugin-vue/src/main.ts#L133
|
|
139
|
+
const keys = Object.keys(schema).filter(key => key !== '_rerender_only')
|
|
137
140
|
if (keys.length === 1) {
|
|
138
141
|
const name = keys[0]
|
|
139
142
|
schema = schema[name]
|