UNPKG

@tomino/dynamic-form-semantic-ui

Version:

Semantic UI form renderer based on dynamic form generation

104 lines 2.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const common_1 = require("../../semantic/tests/common"); const form_query_data_1 = require("../../semantic/tests/form_query_data"); function elements() { return [ { control: 'Text', props: { value: '1', row: 1, column: 1, width: 2, css: `width: 100%; height: 30px; background-color: red;` } }, { control: 'Text', props: { value: '1', row: 1, column: 4, width: 1, css: `width: 100%; height: 50px; background-color: blue;` } }, { control: 'Text', props: { value: '1', row: 2, column: 2, width: 2, css: `width: 100%; height: 20px; background-color: green;` } }, { control: 'Text', props: { value: '1', row: 4, column: 1, width: 1, css: `width: 100%; height: 20px; background-color: green;` } }, { control: 'Text', props: { value: '1', row: 4, column: 4, width: 1, css: `width: 100%; height: 20px; background-color: green;` } } ]; } const formDefinition = form_query_data_1.create.stack({ elements: [ { control: 'Text', props: { value: 'Empty Grid', control: 'Text' } }, { control: 'Grid', props: { rows: 1, columns: 4 }, elements: [] }, { control: 'Text', props: { value: 'With Elements', control: 'Text', css: 'margin-top: 15px;' } }, { control: 'Grid', props: { rows: { value: 8 }, columns: 4, control: 'Grid' }, elements: elements() } ] }); const formData = {}; const schema = { type: 'object', properties: {} }; describe('Grid', () => { 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, showToolBox: true }) }; }); //# sourceMappingURL=grid_view.test.js.map