@tomino/dynamic-form-semantic-ui
Version:
Semantic UI form renderer based on dynamic form generation
71 lines • 1.96 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: {
hide: {
type: 'boolean'
}
}
};
const formDefinition = form_query_data_1.create.stack({
props: {
gap: '12px',
layout: 'column'
},
elements: [
{
control: 'Text',
props: { value: 'Segments' }
},
{
control: 'LinkSelector',
props: { text: 'Hide', source: true, target: { source: 'hide' } }
},
{
control: 'LinkSelector',
props: { text: 'Show', source: false, target: { source: 'hide' } }
},
{
props: { attached: 'top', hidden: { source: 'hide' }, name: 'A' },
control: 'Segment',
elements: [
{
control: 'Text',
props: { value: 'SEGMENT A' }
}
]
},
{
props: { attached: 'top', name: 'B' },
control: 'Segment',
elements: [
{
control: 'Text',
props: { value: 'SEGMENT B' }
}
]
},
{
props: { color: 'blue', inverted: true },
control: 'Segment',
elements: []
}
]
});
const formData = {
description: 'Some Description',
hide: false
};
describe('Segment', () => {
it('renders standard', () => {
common_1.testStandard(formDefinition, schema, formData);
});
it('renders editor', () => {
common_1.testEditor(formDefinition, schema, formData);
});
return { component: common_1.prepareComponent(formDefinition, schema, formData, { addEditor: true }) };
});
//# sourceMappingURL=segment.test.js.map