@tomino/dynamic-form-semantic-ui
Version:
Semantic UI form renderer based on dynamic form generation
60 lines • 1.4 kB
JavaScript
import { prepareComponent } from '../../semantic/tests/common';
const schema = {
type: 'object',
properties: {
value: {
type: 'boolean'
}
}
};
const formDefintion = {
control: 'Stack',
props: {
gap: '12px'
},
elements: [
{
control: 'If',
props: {
value: { source: 'value' },
exists: true
},
elements: [
{
control: 'Text',
props: { text: 'Is TRUE' }
},
{
control: 'Text',
props: { text: 'Is FALSE' }
}
]
},
{
control: 'If',
props: {
value: { source: 'value' },
notExists: true
},
elements: [
{
control: 'Text',
props: { text: 'Is TRUE' }
},
{
control: 'Text',
props: { text: 'Is FALSE' }
}
]
}
]
};
describe('If', () => {
return {
component: prepareComponent(formDefintion, schema, { value: true }, {
addEditor: true,
showReadOnly: false
})
};
});
//# sourceMappingURL=if.test.js.map