@ditojs/admin 2.2.16 → 2.3.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 +1372 -1318
- package/dist/dito-admin.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/src/components/DitoContainer.vue +36 -22
- package/src/components/DitoEditButtons.vue +13 -11
- package/src/components/DitoForm.vue +3 -2
- package/src/components/DitoLabel.vue +5 -3
- package/src/components/DitoPanel.vue +3 -3
- package/src/components/DitoRoot.vue +10 -1
- package/src/mixins/OptionsMixin.js +20 -2
- package/src/mixins/TypeMixin.js +2 -6
- package/src/styles/_button.scss +5 -5
- package/src/styles/_info.scss +3 -0
- package/src/types/DitoTypeButton.vue +8 -6
- package/src/types/DitoTypeList.vue +4 -2
- package/src/types/DitoTypeMultiselect.vue +54 -31
- package/src/types/DitoTypeSelect.vue +58 -37
- package/src/utils/schema.js +13 -7
package/src/utils/schema.js
CHANGED
|
@@ -416,13 +416,19 @@ export function getViewSchema(schema, context) {
|
|
|
416
416
|
: null
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
export function
|
|
419
|
+
export function hasViewSchema(schema, context) {
|
|
420
|
+
return !!getViewSchema(schema, context)
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export function getViewEditPath(schema, id, context) {
|
|
420
424
|
const view = getViewSchema(schema, context)
|
|
421
|
-
|
|
422
|
-
|
|
425
|
+
if (view) {
|
|
426
|
+
const path = isSingleComponentView(view)
|
|
423
427
|
? `/${view.path}`
|
|
424
428
|
: `/${view.path}/${view.path}`
|
|
425
|
-
|
|
429
|
+
return `${path}/${id}`
|
|
430
|
+
}
|
|
431
|
+
return null
|
|
426
432
|
}
|
|
427
433
|
|
|
428
434
|
export function getFormSchemas(schema, context, modifyForm) {
|
|
@@ -595,7 +601,7 @@ export function computeValue(schema, data, name, dataPath, {
|
|
|
595
601
|
const { compute } = schema
|
|
596
602
|
if (compute) {
|
|
597
603
|
const value = compute(
|
|
598
|
-
DitoContext
|
|
604
|
+
new DitoContext(component, {
|
|
599
605
|
schema,
|
|
600
606
|
// Override value to prevent endless recursion through calling the
|
|
601
607
|
// getter for `this.value` in `DitoContext`:
|
|
@@ -691,7 +697,7 @@ export function processData(schema, sourceSchema, data, dataPath, {
|
|
|
691
697
|
|
|
692
698
|
// NOTE: We don't cache this context, since `value` is changing.
|
|
693
699
|
const getContext = () =>
|
|
694
|
-
DitoContext
|
|
700
|
+
new DitoContext(component, {
|
|
695
701
|
schema,
|
|
696
702
|
value,
|
|
697
703
|
name,
|
|
@@ -782,7 +788,7 @@ export function processSchemaData(
|
|
|
782
788
|
index !== null
|
|
783
789
|
? getDataPath(componentDataPath, index)
|
|
784
790
|
: componentDataPath
|
|
785
|
-
const context = DitoContext
|
|
791
|
+
const context = new DitoContext(options.component, {
|
|
786
792
|
schema: componentSchema,
|
|
787
793
|
data,
|
|
788
794
|
value: item,
|