@tomino/dynamic-form-semantic-ui
Version:
Semantic UI form renderer based on dynamic form generation
83 lines • 2.25 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const form_query_data_1 = require("./form_query_data");
const common_1 = require("./common");
const schema = {
type: 'object',
properties: {
religion: {
type: 'string'
},
linedReligion: {
type: 'string'
},
religions: {
type: 'array',
items: {
type: 'object',
properties: {
text: { type: 'string' },
value: { type: 'string' }
}
},
$enum: [
{ text: 'Christian', value: 'CH' },
{ text: 'Buddhist', value: 'BU' },
{ text: 'Jedi', value: 'JE' }
]
}
}
};
const formData = {
religion: 'JE',
linedReligion: 'BU',
religions: [
{ text: 'Christian', value: 'CH' },
{ text: 'Buddhist', value: 'BU' },
{ text: 'Jesus', value: 'JE' }
]
};
const formDefinition = form_query_data_1.create.stack({
elements: [
{
props: {
schemaSource: 'religions',
label: 'Religions',
value: { source: 'religion' },
inline: true
},
control: 'Radio'
},
{
props: {
vertical: true,
options: [
{ text: 'Christian', value: 'CH' },
{ text: 'Buddhist', value: 'BU' },
{ text: 'Jehova', value: 'JE' }
],
label: 'Religions',
value: { source: 'linedReligion' }
},
control: 'Radio'
},
{
props: {
options: { source: 'religions' },
label: 'Religions',
value: { source: 'religion' },
inline: true
},
control: 'Radio'
}
]
});
describe('Radio', () => {
return {
component: common_1.prepareComponent(formDefinition, schema, formData, {
addEditor: true,
showStandard: true
})
};
});
//# sourceMappingURL=radio_view.test.js.map