@tomino/dynamic-form-semantic-ui
Version:
Semantic UI form renderer based on dynamic form generation
99 lines • 2.53 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const common_1 = require("./common");
const schema = {
type: 'object',
properties: {
name: {
type: 'string'
}
}
};
const formDefinition = {
control: 'Form',
elements: [
{
control: 'Menu',
props: {
inverted: true,
color: 'blue'
},
elements: []
},
{
control: 'Menu',
props: {
inverted: true,
color: 'red',
row: 1,
column: 1
},
elements: [
{
control: 'MenuItem',
props: { content: 'First', name: 'first', icon: 'doctor' }
},
{
control: 'MenuItem',
props: {}
},
{
control: 'MenuItem',
elements: [
{
control: 'Icon',
props: { name: 'circle' }
},
{
control: 'Text',
props: { text: 'Children' }
}
]
}
]
},
{
control: 'Text',
props: {
row: 2,
column: 1,
text: 'Pre-Selected'
}
},
{
control: 'Menu',
props: {
value: { source: 'name' },
inverted: true,
color: 'green',
row: 3,
column: 1
},
elements: [
{
control: 'MenuItem',
props: { content: 'First', name: 'first' }
},
{
control: 'MenuItem',
props: { content: 'Second', name: 'second' }
}
]
}
]
};
const formData = {
name: 'second'
};
describe('Menu', () => {
describe('Standard', () => {
return {
component: common_1.prepareComponent(formDefinition, schema, formData, {
showReadOnly: false,
addEditor: true,
showOutline: true
})
};
});
});
//# sourceMappingURL=menu_view.test.js.map