@tomino/dynamic-form-semantic-ui
Version:
Semantic UI form renderer based on dynamic form generation
64 lines • 1.83 kB
JavaScript
import * as React from 'react';
import { prepareComponent } from '../../semantic/tests/common';
const schema = {
type: 'object',
properties: {
schema: {
type: 'string'
}
}
};
const formDefintion = {
control: 'Stack',
props: {
gap: '12px'
},
elements: [
{
control: 'DatasetEditor',
props: {
source: { source: 'schema' },
theme: 'light',
height: '400px'
}
}
]
};
describe('Dataset Editor', () => {
const Component = prepareComponent(formDefintion, schema, {
schema: JSON.stringify({
type: 'object',
properties: {
name: { type: 'string', title: 'name' },
age: { type: 'number', title: 'age' },
car: {
type: 'object',
title: 'car',
properties: {
model: { type: 'string', title: 'model' },
year: { type: 'number', title: 'year' }
}
},
relatives: {
type: 'array',
items: {
type: 'object',
properties: {
father: { type: 'string', title: 'father' },
mother: { type: 'string', title: 'mother' }
}
}
}
}
})
}, {
addEditor: true,
showReadOnly: false
});
const Wrapper = () => (React.createElement("div", { style: { height: '600px' } },
React.createElement(Component, null)));
return {
component: Wrapper
};
});
//# sourceMappingURL=dataset_editor.test.js.map