@jsonforms/core 3.4.0-alpha.2 → 3.4.0-alpha.3
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/lib/jsonforms-core.cjs.js +11 -4
- package/lib/jsonforms-core.cjs.js.map +1 -1
- package/lib/jsonforms-core.esm.js +11 -4
- package/lib/jsonforms-core.esm.js.map +1 -1
- package/lib/mappers/renderer.d.ts +1 -0
- package/lib/util/schema.d.ts +1 -1
- package/package.json +1 -1
- package/src/mappers/renderer.ts +1 -0
- package/src/util/schema.ts +21 -10
|
@@ -429,6 +429,7 @@ export declare const mapStateToLabelProps: (state: JsonFormsState, props: OwnPro
|
|
|
429
429
|
config: any;
|
|
430
430
|
renderers: JsonFormsRendererRegistryEntry[];
|
|
431
431
|
cells: JsonFormsCellRendererRegistryEntry[];
|
|
432
|
+
uischema: LabelElement;
|
|
432
433
|
};
|
|
433
434
|
/**
|
|
434
435
|
* Compute the child label title for array based controls
|
package/lib/util/schema.d.ts
CHANGED
package/package.json
CHANGED
package/src/mappers/renderer.ts
CHANGED
package/src/util/schema.ts
CHANGED
|
@@ -26,16 +26,27 @@
|
|
|
26
26
|
import find from 'lodash/find';
|
|
27
27
|
import type { JsonSchema } from '../models';
|
|
28
28
|
|
|
29
|
-
export const getFirstPrimitiveProp = (schema:
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
|
|
29
|
+
export const getFirstPrimitiveProp = (schema: unknown) => {
|
|
30
|
+
if (
|
|
31
|
+
schema &&
|
|
32
|
+
typeof schema === 'object' &&
|
|
33
|
+
'properties' in schema &&
|
|
34
|
+
schema.properties
|
|
35
|
+
) {
|
|
36
|
+
return find(
|
|
37
|
+
Object.keys(schema.properties),
|
|
38
|
+
(propName: keyof typeof schema.properties) => {
|
|
39
|
+
const prop: unknown = schema.properties[propName];
|
|
40
|
+
return (
|
|
41
|
+
prop &&
|
|
42
|
+
typeof prop === 'object' &&
|
|
43
|
+
'type' in prop &&
|
|
44
|
+
(prop.type === 'string' ||
|
|
45
|
+
prop.type === 'number' ||
|
|
46
|
+
prop.type === 'integer')
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
39
50
|
}
|
|
40
51
|
return undefined;
|
|
41
52
|
};
|