@ditojs/admin 2.67.0 → 2.69.0
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 +1041 -1034
- package/dist/dito-admin.umd.js +5 -5
- package/package.json +36 -36
- package/src/DitoTypeComponent.js +1 -0
- package/src/mixins/OptionsMixin.js +19 -5
- package/src/types/DitoTypeCheckboxes.vue +1 -0
- package/src/utils/schema.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.69.0",
|
|
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",
|
|
@@ -42,56 +42,56 @@
|
|
|
42
42
|
"not ie_mob > 0"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ditojs/ui": "^2.
|
|
46
|
-
"@ditojs/utils": "^2.
|
|
45
|
+
"@ditojs/ui": "^2.69.0",
|
|
46
|
+
"@ditojs/utils": "^2.69.0",
|
|
47
47
|
"@kyvg/vue3-notification": "^3.4.2",
|
|
48
48
|
"@lk77/vue3-color": "^3.0.6",
|
|
49
|
-
"@tiptap/core": "^3.
|
|
50
|
-
"@tiptap/extension-blockquote": "^3.
|
|
51
|
-
"@tiptap/extension-bold": "^3.
|
|
52
|
-
"@tiptap/extension-bullet-list": "^3.
|
|
53
|
-
"@tiptap/extension-code": "^3.
|
|
54
|
-
"@tiptap/extension-code-block": "^3.
|
|
55
|
-
"@tiptap/extension-document": "^3.
|
|
56
|
-
"@tiptap/extension-hard-break": "^3.
|
|
57
|
-
"@tiptap/extension-heading": "^3.
|
|
58
|
-
"@tiptap/extension-history": "^3.
|
|
59
|
-
"@tiptap/extension-horizontal-rule": "^3.
|
|
60
|
-
"@tiptap/extension-italic": "^3.
|
|
61
|
-
"@tiptap/extension-link": "^3.
|
|
62
|
-
"@tiptap/extension-list": "^3.
|
|
63
|
-
"@tiptap/extension-list-item": "^3.
|
|
64
|
-
"@tiptap/extension-ordered-list": "^3.
|
|
65
|
-
"@tiptap/extension-paragraph": "^3.
|
|
66
|
-
"@tiptap/extension-strike": "^3.
|
|
67
|
-
"@tiptap/extension-subscript": "^3.
|
|
68
|
-
"@tiptap/extension-superscript": "^3.
|
|
69
|
-
"@tiptap/extension-text": "^3.
|
|
70
|
-
"@tiptap/extension-text-style": "^3.
|
|
71
|
-
"@tiptap/extension-underline": "^3.
|
|
72
|
-
"@tiptap/extensions": "^3.
|
|
73
|
-
"@tiptap/pm": "^3.
|
|
74
|
-
"@tiptap/vue-3": "^3.
|
|
49
|
+
"@tiptap/core": "^3.14.0",
|
|
50
|
+
"@tiptap/extension-blockquote": "^3.14.0",
|
|
51
|
+
"@tiptap/extension-bold": "^3.14.0",
|
|
52
|
+
"@tiptap/extension-bullet-list": "^3.14.0",
|
|
53
|
+
"@tiptap/extension-code": "^3.14.0",
|
|
54
|
+
"@tiptap/extension-code-block": "^3.14.0",
|
|
55
|
+
"@tiptap/extension-document": "^3.14.0",
|
|
56
|
+
"@tiptap/extension-hard-break": "^3.14.0",
|
|
57
|
+
"@tiptap/extension-heading": "^3.14.0",
|
|
58
|
+
"@tiptap/extension-history": "^3.14.0",
|
|
59
|
+
"@tiptap/extension-horizontal-rule": "^3.14.0",
|
|
60
|
+
"@tiptap/extension-italic": "^3.14.0",
|
|
61
|
+
"@tiptap/extension-link": "^3.14.0",
|
|
62
|
+
"@tiptap/extension-list": "^3.14.0",
|
|
63
|
+
"@tiptap/extension-list-item": "^3.14.0",
|
|
64
|
+
"@tiptap/extension-ordered-list": "^3.14.0",
|
|
65
|
+
"@tiptap/extension-paragraph": "^3.14.0",
|
|
66
|
+
"@tiptap/extension-strike": "^3.14.0",
|
|
67
|
+
"@tiptap/extension-subscript": "^3.14.0",
|
|
68
|
+
"@tiptap/extension-superscript": "^3.14.0",
|
|
69
|
+
"@tiptap/extension-text": "^3.14.0",
|
|
70
|
+
"@tiptap/extension-text-style": "^3.14.0",
|
|
71
|
+
"@tiptap/extension-underline": "^3.14.0",
|
|
72
|
+
"@tiptap/extensions": "^3.14.0",
|
|
73
|
+
"@tiptap/pm": "^3.14.0",
|
|
74
|
+
"@tiptap/vue-3": "^3.14.0",
|
|
75
75
|
"@vueuse/integrations": "^14.1.0",
|
|
76
76
|
"codeflask": "^1.4.1",
|
|
77
77
|
"filesize": "^11.0.13",
|
|
78
78
|
"filesize-parser": "^1.5.1",
|
|
79
|
-
"focus-trap": "^7.
|
|
79
|
+
"focus-trap": "^7.7.0",
|
|
80
80
|
"nanoid": "^5.1.6",
|
|
81
81
|
"sortablejs": "^1.15.6",
|
|
82
82
|
"tinycolor2": "^1.6.0",
|
|
83
83
|
"tippy.js": "^6.3.7",
|
|
84
84
|
"tiptap-footnotes": "^3.0.1",
|
|
85
|
-
"type-fest": "^5.3.
|
|
86
|
-
"vue": "^3.5.
|
|
85
|
+
"type-fest": "^5.3.1",
|
|
86
|
+
"vue": "^3.5.26",
|
|
87
87
|
"vue-multiselect": "^3.4.0",
|
|
88
|
-
"vue-router": "^4.6.
|
|
88
|
+
"vue-router": "^4.6.4",
|
|
89
89
|
"vue-upload-component": "^3.1.17"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@ditojs/build": "^2.
|
|
92
|
+
"@ditojs/build": "^2.69.0",
|
|
93
93
|
"typescript": "^5.9.3",
|
|
94
|
-
"vite": "^7.
|
|
94
|
+
"vite": "^7.3.0"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "a2b28ad175cd3280ceadd394c74ba67e12da03af"
|
|
97
97
|
}
|
package/src/DitoTypeComponent.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import DitoContext from '../DitoContext.js'
|
|
2
2
|
import DataMixin from './DataMixin.js'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
hasViewSchema,
|
|
5
|
+
getViewEditPath,
|
|
6
|
+
getMultipleValue
|
|
7
|
+
} from '../utils/schema.js'
|
|
4
8
|
import { getSchemaAccessor } from '../utils/accessor.js'
|
|
5
9
|
import { setTemporaryId, isReference } from '../utils/data.js'
|
|
6
10
|
import {
|
|
@@ -20,7 +24,7 @@ export default {
|
|
|
20
24
|
computed: {
|
|
21
25
|
// @overridable
|
|
22
26
|
multiple() {
|
|
23
|
-
return
|
|
27
|
+
return getMultipleValue(this.schema)
|
|
24
28
|
},
|
|
25
29
|
|
|
26
30
|
selectedValue: {
|
|
@@ -139,6 +143,11 @@ export default {
|
|
|
139
143
|
}
|
|
140
144
|
}),
|
|
141
145
|
|
|
146
|
+
optionEquals: getSchemaAccessor('options.equals', {
|
|
147
|
+
type: Function,
|
|
148
|
+
default: null
|
|
149
|
+
}),
|
|
150
|
+
|
|
142
151
|
// TODO: Consider moving search to `options.search`?
|
|
143
152
|
searchFilter: getSchemaAccessor('search', {
|
|
144
153
|
type: [Object, Function],
|
|
@@ -233,8 +242,13 @@ export default {
|
|
|
233
242
|
if (found) {
|
|
234
243
|
return found
|
|
235
244
|
}
|
|
236
|
-
} else
|
|
237
|
-
|
|
245
|
+
} else {
|
|
246
|
+
const matches = this.optionEquals
|
|
247
|
+
? this.optionEquals(new DitoContext(this, { value, option }))
|
|
248
|
+
: value === this.getValueForOption(option)
|
|
249
|
+
if (matches) {
|
|
250
|
+
return option
|
|
251
|
+
}
|
|
238
252
|
}
|
|
239
253
|
}
|
|
240
254
|
}
|
|
@@ -281,7 +295,7 @@ export default {
|
|
|
281
295
|
const processRelate = value => (value ? { id: value.id } : value)
|
|
282
296
|
// Selected options can be both objects & arrays, e.g. 'checkboxes':
|
|
283
297
|
value =
|
|
284
|
-
|
|
298
|
+
getMultipleValue(schema) && isArray(value)
|
|
285
299
|
? value.map(processRelate)
|
|
286
300
|
: processRelate(value)
|
|
287
301
|
}
|
package/src/utils/schema.js
CHANGED
|
@@ -670,6 +670,10 @@ export function shouldIgnoreMissingValue(schema, context) {
|
|
|
670
670
|
return !!getTypeOptions(schema)?.ignoreMissingValue?.(getContext(context))
|
|
671
671
|
}
|
|
672
672
|
|
|
673
|
+
export function getMultipleValue(schema) {
|
|
674
|
+
return schema.multiple ?? !!getTypeOptions(schema)?.defaultMultiple
|
|
675
|
+
}
|
|
676
|
+
|
|
673
677
|
export function setDefaultValues(schema, data = {}, component) {
|
|
674
678
|
const options = { component, rootData: data }
|
|
675
679
|
|