@koumoul/vjsf 3.0.0-beta.13 → 3.0.0-beta.14
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/package.json
CHANGED
package/src/compat/v2.js
CHANGED
|
@@ -84,9 +84,15 @@ const processFragment = (/** @type {import("ajv").SchemaObject} */schema) => {
|
|
|
84
84
|
|
|
85
85
|
if (schema.oneOf) {
|
|
86
86
|
if (!schema.oneOfLayout) {
|
|
87
|
-
const
|
|
88
|
-
.find(
|
|
89
|
-
if (
|
|
87
|
+
const constPropertyKey = Object.keys(schema.oneOf[0]?.properties || {})
|
|
88
|
+
.find(key => !!schema.oneOf[0]?.properties[key].const)
|
|
89
|
+
if (constPropertyKey) {
|
|
90
|
+
const constProperty = schema.oneOf[0]?.properties[constPropertyKey]
|
|
91
|
+
if (constProperty?.title) schema.oneOfLayout = { label: constProperty.title }
|
|
92
|
+
if (schema.required && Array.isArray(schema.required)) {
|
|
93
|
+
schema.required = schema.required.filter(key => key !== constPropertyKey)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
90
96
|
}
|
|
91
97
|
for (const item of schema.oneOf) processFragment(item)
|
|
92
98
|
}
|
package/types/compat/v2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/compat/v2.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/compat/v2.js"],"names":[],"mappings":"AAgHA;;;;;;GAMG;AACH,kCALW,MAAM,+CAEN,MAAM,0BAkBhB;sBAtIqB,KAAK"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
2
|
$emit: ((event: "update:modelValue", data: any) => void) & ((event: "update:state", state: import("../types.js").VjsfStatefulLayout) => void);
|
|
3
|
-
schema: Record<string, any>;
|
|
4
|
-
modelValue: any;
|
|
5
3
|
options: Partial<Omit<import("../types.js").VjsfOptions, "width" | "vjsfSlots">> | null;
|
|
4
|
+
modelValue: any;
|
|
5
|
+
schema: Record<string, any>;
|
|
6
6
|
precompiledLayout: import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout;
|
|
7
7
|
$props: {
|
|
8
|
-
readonly schema?: Record<string, any> | undefined;
|
|
9
|
-
readonly modelValue?: any;
|
|
10
8
|
readonly options?: Partial<Omit<import("../types.js").VjsfOptions, "width" | "vjsfSlots">> | null | undefined;
|
|
9
|
+
readonly modelValue?: any;
|
|
10
|
+
readonly schema?: Record<string, any> | undefined;
|
|
11
11
|
readonly precompiledLayout?: import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout | undefined;
|
|
12
12
|
};
|
|
13
13
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|