diff --git a/src/Webform.js b/src/Webform.js index 7e1acb95d6..316f0e07e7 100644 --- a/src/Webform.js +++ b/src/Webform.js @@ -1012,7 +1012,7 @@ export default class Webform extends NestedDataComponent { resetValue() { _.each(this.getComponents(), (comp) => (comp.resetValue())); this.setPristine(true); - this.onChange(); + this.onChange({ resetValue: true }); } /** diff --git a/src/Webform.unit.js b/src/Webform.unit.js index 324d81d207..4c0d582f39 100644 --- a/src/Webform.unit.js +++ b/src/Webform.unit.js @@ -73,6 +73,7 @@ import formWithRadioInsideDataGrid from '../test/forms/formWithRadioInsideDataGr import formWithCheckboxRadioType from '../test/forms/formWithCheckboxRadioType'; import formWithFormController from '../test/forms/formWithFormController'; import calculateValueOnServerForEditGrid from '../test/forms/calculateValueOnServerForEditGrid'; +import formsWithAllowOverride from '../test/forms/formsWithAllowOverrideComps'; global.requestAnimationFrame = (cb) => cb(); global.cancelAnimationFrame = () => {}; @@ -2855,6 +2856,291 @@ describe('Webform tests', function() { }, 250); }).catch(done); }); + + it('Should recalculate values for components with "allow override" after first and only dataGrid row is removed/reset', function(done) { + const formElement = document.createElement('div'); + Formio.createForm(formElement, formsWithAllowOverride.withDataGrid).then((form) => { + const calculatedValues = { + number: 11111, + textField: 'test DataGrid', + textArea: 'test', + }; + + const overridenValues = { + number: 11111222, + textField: 'test DataGrid 222', + textArea: 'test 222', + }; + + const number = form.getComponent('number'); + const textArea = form.getComponent('textArea'); + const textField = form.getComponent('textField'); + const dgRadio = form.getComponent('dgRadio'); + const dataGrid = form.getComponent('dataGrid'); + // check if values are calculated on form load + assert.deepEqual(dataGrid.dataValue, [ + { + ...calculatedValues, + textField: textField.emptyValue, + dgRadio: dgRadio.emptyValue + } + ], 1); + + dgRadio.setValue('a'); + + setTimeout(() => { + // check if values are calculated correctly + assert.deepEqual(dataGrid.dataValue, [ + { + ...calculatedValues, + dgRadio: 'a' + } + ]); + + // override calculated values + const numberInput = number.refs.input[0]; + const textFieldInput = textField.refs.input[0]; + const textAreaInput = textArea.refs.input[0]; + + numberInput.value = overridenValues.number; + textFieldInput.value = overridenValues.textField; + textAreaInput.value = overridenValues.textArea; + + const inputEvent = new Event('input'); + + numberInput.dispatchEvent(inputEvent); + textFieldInput.dispatchEvent(inputEvent); + textAreaInput.dispatchEvent(inputEvent); + + setTimeout(() => { + // check if values are overriden + assert.deepEqual(dataGrid.dataValue, [ + { + ...overridenValues, + dgRadio: 'a' + } + ], 2); + + // clear first row + dataGrid.removeRow(0); + + setTimeout(() => { + const dgRadio = form.getComponent('dgRadio'); + // make sure values are reset and recalculated + assert.deepEqual(dataGrid.dataValue, [ + { + ...calculatedValues, + textField: textField.emptyValue, + dgRadio: dgRadio.emptyValue + } + ], 3); + + dgRadio.setValue('a'); + setTimeout(() => { + // check if all values are calculated correctly + assert.deepEqual(dataGrid.dataValue, [ + { + ...calculatedValues, + dgRadio: 'a' + } + ], 4); + + document.body.innerHTML = ''; + done(); + }, 400); + }, 400); + }, 400); + }, 400); + }).catch((err) => done(err)); + }); + + it('Should recalculate values for components with "allow override" after the form is reset', function(done) { + const formElement = document.createElement('div'); + Formio.createForm(formElement, formsWithAllowOverride.withResetBtn).then((form) => { + const calculatedValues = { + number: 11111, + textField: 'test DataGrid', + textArea: 'test', + radio: 'one' + }; + + const overridenValues = { + number: 11111222, + textField: 'test DataGrid 222', + textArea: 'test 222', + radio: 'two' + }; + const checkbox = form.getComponent('checkbox'); + const number = form.getComponent('number'); + const textArea = form.getComponent('textArea'); + const radio = form.getComponent('radio'); + const textField = form.getComponent('textField'); + const dgRadio = form.getComponent('dgRadio'); + const resetBtn = form.getComponent('reset'); + + dgRadio.setValue('a'); + checkbox.setValue(true); + setTimeout(() => { + // check if values were calculated correctly + assert.equal(number.dataValue, calculatedValues.number); + assert.equal(textField.dataValue, calculatedValues.textField); + assert.equal(textArea.dataValue, calculatedValues.textArea); + assert.equal(radio.dataValue, calculatedValues.radio); + + // override calculated values + const numberInput = number.refs.input[0]; + const textFieldInput = textField.refs.input[0]; + const textAreaInput = textArea.refs.input[0]; + const radioInput =radio.refs.input[1]; + + numberInput.value = overridenValues.number; + textFieldInput.value = overridenValues.textField; + textAreaInput.value = overridenValues.textArea; + radioInput.checked = true; + const inputEvent = new Event('input'); + const clickEvent = new Event('click'); + + numberInput.dispatchEvent(inputEvent); + textFieldInput.dispatchEvent(inputEvent); + textAreaInput.dispatchEvent(inputEvent); + radioInput.dispatchEvent(clickEvent); + + setTimeout(() => { + // check if values were overriden + assert.equal(number.getValue(), overridenValues.number); + assert.equal(textField.dataValue, overridenValues.textField); + assert.equal(textArea.dataValue, overridenValues.textArea); + assert.equal(radio.dataValue, overridenValues.radio); + + checkbox.setValue(false); + + setTimeout(() => { + // reset form + resetBtn.refs.button.dispatchEvent(clickEvent); + + setTimeout(() => { + // make sure that values are reset + assert.equal(number.dataValue, calculatedValues.number); + assert.equal(textArea.dataValue, calculatedValues.textArea); + assert.equal(textField.dataValue, textField.emptyValue); + assert.equal(radio.dataValue, radio.emptyValue); + assert.equal(dgRadio.dataValue, dgRadio.emptyValue); + assert.equal(checkbox.dataValue, checkbox.emptyValue); + + // trigger values calculation + dgRadio.setValue('a'); + checkbox.setValue(true); + + setTimeout(() => { + // make sure that values are recalculated + assert.equal(number.dataValue, calculatedValues.number); + assert.equal(textField.dataValue, calculatedValues.textField); + assert.equal(textArea.dataValue, calculatedValues.textArea); + assert.equal(radio.dataValue, calculatedValues.radio); + document.body.innerHTML = ''; + done(); + }, 300); + }, 300); + }, 300); + }, 300); + }, 400); + }).catch((err) => done(err)); + }); + + it('Should recalculate values for conditional components with "allow override" and "clear on hide" enabled when components become visible again', function(done) { + const formElement = document.createElement('div'); + Formio.createForm(formElement, formsWithAllowOverride.withClearOnHide).then((form) => { + const calculatedValues = { + number: 111, + textField: 'test', + textArea: 'test value', + radio: 'a' + }; + + const overridenValues = { + number: 11123, + textField: 'test123', + textArea: 'test123', + radio: 'b' + }; + const checkbox = form.getComponent('checkbox'); + const number = form.getComponent('number'); + const textField = form.getComponent('textField'); + const textArea = form.getComponent('textArea'); + const radio = form.getComponent('radio'); + + assert.equal(number.visible, false); + assert.equal(textField.visible, false); + assert.equal(textArea.visible, false); + assert.equal(radio.visible, false); + + checkbox.setValue(true); + setTimeout(() => { + assert.equal(number.visible, true); + assert.equal(textField.visible, true); + assert.equal(textArea.visible, true); + assert.equal(radio.visible, true); + // check if values were calculated correctly + assert.equal(number.dataValue, calculatedValues.number); + assert.equal(textField.dataValue, calculatedValues.textField); + assert.equal(textArea.dataValue, calculatedValues.textArea); + assert.equal(radio.dataValue, calculatedValues.radio); + + // override calculated values + const numberInput = number.refs.input[0]; + const textFieldInput = textField.refs.input[0]; + const textAreaInput = textArea.refs.input[0]; + const radioInput =radio.refs.input[1]; + + numberInput.value = overridenValues.number; + textFieldInput.value = overridenValues.textField; + textAreaInput.value = overridenValues.textArea; + radioInput.checked = true; + const inputEvent = new Event('input'); + const clickEvent = new Event('click'); + + numberInput.dispatchEvent(inputEvent); + textFieldInput.dispatchEvent(inputEvent); + textAreaInput.dispatchEvent(inputEvent); + radioInput.dispatchEvent(clickEvent); + + setTimeout(() => { + // check if values were overriden + assert.equal(number.getValue(), overridenValues.number); + assert.equal(textField.dataValue, overridenValues.textField); + assert.equal(textArea.dataValue, overridenValues.textArea); + assert.equal(radio.dataValue, overridenValues.radio); + + checkbox.setValue(false); + + setTimeout(() => { + // check if conditional components were hidden + assert.equal(number.visible, false); + assert.equal(textField.visible, false); + assert.equal(textArea.visible, false); + assert.equal(radio.visible, false); + + checkbox.setValue(true); + setTimeout(() => { + // make sure that components appear again and values were recalculated + assert.equal(number.visible, true); + assert.equal(textField.visible, true); + assert.equal(textArea.visible, true); + assert.equal(radio.visible, true); + + assert.equal(number.dataValue, calculatedValues.number); + assert.equal(textField.dataValue, calculatedValues.textField); + assert.equal(textArea.dataValue, calculatedValues.textArea); + assert.equal(radio.dataValue, calculatedValues.radio); + document.body.innerHTML = ''; + + done(); + }, 300); + }, 300); + }, 300); + }, 400); + }).catch((err) => done(err)); + }); }); describe('Modal Edit', () => { diff --git a/src/Wizard.js b/src/Wizard.js index 49f54eec5a..59b9db7890 100644 --- a/src/Wizard.js +++ b/src/Wizard.js @@ -821,7 +821,7 @@ export default class Wizard extends Webform { if (this.enabledIndex) { this.enabledIndex = 0; } - this.onChange(); + this.onChange({ resetValue: true }); this.redraw(); return this.page; }); diff --git a/src/Wizard.unit.js b/src/Wizard.unit.js index 549dfcaf10..e710964356 100644 --- a/src/Wizard.unit.js +++ b/src/Wizard.unit.js @@ -40,12 +40,99 @@ import wizardWithPrefixComps from '../test/forms/wizardWithPrefixComps'; import wizardPermission from '../test/forms/wizardPermission'; import formWithFormController from '../test/forms/formWithFormController'; import { fastCloneDeep } from './utils/utils'; +import formsWithAllowOverride from '../test/forms/formsWithAllowOverrideComps'; global.requestAnimationFrame = (cb) => cb(); global.cancelAnimationFrame = () => {}; // eslint-disable-next-line max-statements describe('Wizard tests', () => { + it('Should recalculate values for components with "allow override" after wizard is canceled', function(done) { + const formElement = document.createElement('div'); + Formio.createForm(formElement, formsWithAllowOverride.wizard).then((form) => { + const calculatedValues = { + number: 123, + textField: 'test data', + textArea: 'test data', + radio: 'one' + }; + + const overridenValues = { + number: 1233333, + textField: 'test data3333', + textArea: 'test data3333', + radio: 'two' + }; + + const number = form.getComponent('number'); + const textArea = form.getComponent('textArea'); + const radio = form.getComponent('radio'); + const textField = form.getComponent('textField'); + const radioTrigger = form.getComponent('radio1'); + + assert.equal(number.dataValue, number.emptyValue); + assert.equal(textField.dataValue, textField.emptyValue); + assert.equal(textArea.dataValue, textArea.emptyValue); + assert.equal(radio.dataValue, calculatedValues.radio); + + radioTrigger.setValue('a'); + setTimeout(() => { + // check if values are calculated correctly + assert.equal(number.dataValue, calculatedValues.number); + assert.equal(textField.dataValue, calculatedValues.textField); + assert.equal(textArea.dataValue, calculatedValues.textArea); + assert.equal(radio.dataValue, calculatedValues.radio); + + // override calculated values + const numberInput = number.refs.input[0]; + const textFieldInput = textField.refs.input[0]; + const textAreaInput = textArea.refs.input[0]; + const radioInput =radio.refs.input[1]; + + numberInput.value = overridenValues.number; + textFieldInput.value = overridenValues.textField; + textAreaInput.value = overridenValues.textArea; + radioInput.checked = true; + const inputEvent = new Event('input'); + const clickEvent = new Event('click'); + + numberInput.dispatchEvent(inputEvent); + textFieldInput.dispatchEvent(inputEvent); + textAreaInput.dispatchEvent(inputEvent); + radioInput.dispatchEvent(clickEvent); + + setTimeout(() => { + // check if values are overriden + assert.equal(number.getValue(), overridenValues.number); + assert.equal(textField.dataValue, overridenValues.textField); + assert.equal(textArea.dataValue, overridenValues.textArea); + assert.equal(radio.dataValue, overridenValues.radio); + // reset form + form.cancel(true); + + setTimeout(() => { + // make sure that values are reset + assert.equal(number.dataValue, number.emptyValue); + assert.equal(textField.dataValue, textField.emptyValue); + assert.equal(textArea.dataValue, textArea.emptyValue); + assert.equal(radio.dataValue, calculatedValues.radio); + + radioTrigger.setValue('a'); + setTimeout(() => { + // check if values are recalculated correctly + assert.equal(number.dataValue, calculatedValues.number); + assert.equal(textField.dataValue, calculatedValues.textField); + assert.equal(textArea.dataValue, calculatedValues.textArea); + assert.equal(radio.dataValue, calculatedValues.radio); + document.body.innerHTML = ''; + done(); + }, 300); + }, 300); + }, 300); + }, 400); + }).catch((err) => done(err)); + }); + it('Should execute form controller', function(done) { const form = fastCloneDeep(formWithFormController); form.display = 'wizard'; diff --git a/src/components/_classes/component/Component.js b/src/components/_classes/component/Component.js index 17509671cd..c085f46aa0 100644 --- a/src/components/_classes/component/Component.js +++ b/src/components/_classes/component/Component.js @@ -2868,11 +2868,18 @@ export default class Component extends Element { const shouldBeCleared = !this.visible && clearOnHide; const allowOverride = _.get(this.component, 'allowCalculateOverride', false); + if (shouldBeCleared) { + // remove calculated value so that the value is recalculated once component becomes visible + if (this.hasOwnProperty('calculatedValue') && allowOverride) { + _.unset(this, 'calculatedValue'); + } + return false; + } + // Handle all cases when calculated values should not fire. if ( (this.options.readOnly && !this.options.pdf && !this.component.calculateValue) || !(this.component.calculateValue || this.component.calculateValueVariable) || - shouldBeCleared || (this.options.server && !this.component.calculateServer) || (flags.dataSourceInitialLoading && allowOverride) ) { @@ -2906,7 +2913,7 @@ export default class Component extends Element { return false; } - const firstPass = (this.calculatedValue === undefined); + const firstPass = (this.calculatedValue === undefined) || flags.resetValue; if (firstPass) { this.calculatedValue = null; } diff --git a/src/components/datagrid/DataGrid.js b/src/components/datagrid/DataGrid.js index beac6bd5f0..b3c6342b45 100644 --- a/src/components/datagrid/DataGrid.js +++ b/src/components/datagrid/DataGrid.js @@ -481,12 +481,14 @@ export default class DataGridComponent extends NestedArrayComponent { } removeRow(index) { - this.splice(index, { isReordered: true }); + const makeEmpty = index === 0 && this.rows.length === 1; + const flags = { isReordered: !makeEmpty, resetValue: makeEmpty }; + this.splice(index, flags); this.emit('dataGridDeleteRow', { index }); const [row] = this.rows.splice(index, 1); this.removeRowComponents(row); this.updateRowsComponents(index); - this.setValue(this.dataValue, { isReordered: true }); + this.setValue(this.dataValue, flags); this.redraw(); } diff --git a/test/forms/formsWithAllowOverrideComps.js b/test/forms/formsWithAllowOverrideComps.js new file mode 100644 index 0000000000..55dc5abcce --- /dev/null +++ b/test/forms/formsWithAllowOverrideComps.js @@ -0,0 +1,491 @@ +const withClearOnHide = { + _id: '6597badd4143681594620748', + title: 'test clear on hide', + name: 'testClearOnHide', + path: 'testclearonhide', + type: 'form', + display: 'form', + components: [ + { + label: 'Checkbox', + tableView: false, + key: 'checkbox', + type: 'checkbox', + input: true, + }, + { + label: 'Number', + applyMaskOn: 'change', + mask: false, + tableView: false, + delimiter: false, + requireDecimal: false, + inputFormat: 'plain', + truncateMultipleSpaces: false, + allowCalculateOverride: true, + calculateValue: 'value = 111;', + key: 'number', + conditional: { + show: true, + conjunction: 'all', + conditions: [ + { + component: 'checkbox', + operator: 'isEqual', + value: true, + }, + ], + }, + type: 'number', + input: true, + }, + { + label: 'Text Field', + applyMaskOn: 'change', + tableView: true, + calculateValue: "value = 'test';", + allowCalculateOverride: true, + key: 'textField', + conditional: { + show: true, + conjunction: 'all', + conditions: [ + { + component: 'checkbox', + operator: 'isEqual', + value: true, + }, + ], + }, + type: 'textfield', + input: true, + }, + { + label: 'Text Area', + applyMaskOn: 'change', + autoExpand: false, + tableView: true, + calculateValue: "value = 'test value';", + allowCalculateOverride: true, + key: 'textArea', + conditional: { + show: true, + conjunction: 'all', + conditions: [ + { + component: 'checkbox', + operator: 'isEqual', + value: true, + }, + ], + }, + type: 'textarea', + input: true, + }, + { + label: 'Radio', + optionsLabelPosition: 'right', + inline: false, + tableView: false, + values: [ + { + label: 'a', + value: 'a', + shortcut: '', + }, + { + label: 'b', + value: 'b', + shortcut: '', + }, + { + label: 'c', + value: 'c', + shortcut: '', + }, + ], + calculateValue: "value = 'a';\n\n", + allowCalculateOverride: true, + key: 'radio', + conditional: { + show: true, + conjunction: 'all', + conditions: [ + { + component: 'checkbox', + operator: 'isEqual', + value: true, + }, + ], + }, + type: 'radio', + input: true, + }, + { + label: 'reset', + action: 'reset', + showValidations: false, + tableView: false, + key: 'reset', + type: 'button', + input: true, + }, + ], + }; + + const withDataGrid = { + _id: '6597baa341436815946204d1', + title: 'test clear datagrid first raw', + name: 'testClearDatagridFirstRaw', + path: 'testcleardatagridfirstraw', + type: 'form', + display: 'form', + components: [ + { + label: 'Data Grid', + reorder: false, + addAnotherPosition: 'bottom', + layoutFixed: false, + enableRowGroups: false, + initEmpty: false, + tableView: false, + defaultValue: [ + { + dgRadio: '', + textField: '', + textArea: '', + }, + ], + key: 'dataGrid', + type: 'datagrid', + defaultOpen: false, + alwaysEnabled: false, + input: true, + components: [ + { + label: 'DG radio', + optionsLabelPosition: 'right', + inline: false, + alwaysEnabled: false, + tableView: false, + values: [ + { + label: 'A', + value: 'a', + shortcut: '', + }, + { + label: 'B', + value: 'b', + shortcut: '', + }, + { + label: 'C', + value: 'c', + shortcut: '', + }, + ], + allowCalculateOverride: true, + key: 'dgRadio', + type: 'radio', + input: true, + }, + { + label: 'Text Field', + applyMaskOn: 'change', + tableView: true, + calculateValue: "if (row.dgRadio == 'a'){value = 'test DataGrid'}", + allowCalculateOverride: true, + key: 'textField', + type: 'textfield', + alwaysEnabled: false, + input: true, + }, + { + label: 'Number', + applyMaskOn: 'change', + mask: false, + tableView: false, + delimiter: false, + requireDecimal: false, + inputFormat: 'plain', + truncateMultipleSpaces: false, + calculateValue: 'value = 11111;', + allowCalculateOverride: true, + key: 'number', + type: 'number', + input: true, + }, + { + label: 'Text Area', + applyMaskOn: 'change', + autoExpand: false, + tableView: true, + calculateValue: "value = 'test';", + allowCalculateOverride: true, + key: 'textArea', + type: 'textarea', + input: true, + }, + ], + path: 'dataGrid', + }, + ], + }; + + const withResetBtn = { + _id: '6597c00b4143681594622563', + title: 'recalculate on reset', + name: 'recalculateOnReset', + path: 'recalculateonreset', + type: 'form', + display: 'form', + components: [ + { + label: 'Data Grid', + reorder: false, + addAnotherPosition: 'bottom', + layoutFixed: false, + enableRowGroups: false, + initEmpty: false, + tableView: false, + defaultValue: [ + { + dgRadio: '', + textField: '', + textArea: '', + }, + ], + key: 'dataGrid', + type: 'datagrid', + defaultOpen: false, + alwaysEnabled: false, + input: true, + components: [ + { + label: 'DG radio', + optionsLabelPosition: 'right', + inline: false, + alwaysEnabled: false, + tableView: false, + values: [ + { + label: 'A', + value: 'a', + shortcut: '', + }, + { + label: 'B', + value: 'b', + shortcut: '', + }, + { + label: 'C', + value: 'c', + shortcut: '', + }, + ], + allowCalculateOverride: true, + key: 'dgRadio', + type: 'radio', + input: true, + }, + { + label: 'Text Field', + applyMaskOn: 'change', + tableView: true, + calculateValue: "if (row.dgRadio == 'a'){value = 'test DataGrid'}", + allowCalculateOverride: true, + key: 'textField', + type: 'textfield', + alwaysEnabled: false, + input: true, + }, + ], + path: 'dataGrid', + }, + { + label: 'Checkbox', + tableView: false, + key: 'checkbox', + type: 'checkbox', + input: true, + }, + { + label: 'Radio', + optionsLabelPosition: 'right', + inline: false, + tableView: false, + values: [ + { + label: 'one', + value: 'one', + shortcut: '', + }, + { + label: 'two', + value: 'two', + shortcut: '', + }, + ], + calculateValue: "if (data.checkbox) {\n value = 'one';\n}", + allowCalculateOverride: true, + key: 'radio', + type: 'radio', + input: true, + }, + { + label: 'Text Area', + applyMaskOn: 'change', + autoExpand: false, + tableView: true, + calculateValue: "value = 'test';", + allowCalculateOverride: true, + key: 'textArea', + type: 'textarea', + input: true, + }, + { + label: 'Number', + applyMaskOn: 'change', + mask: false, + tableView: false, + delimiter: false, + requireDecimal: false, + inputFormat: 'plain', + truncateMultipleSpaces: false, + calculateValue: 'value = 11111;', + allowCalculateOverride: true, + key: 'number', + type: 'number', + input: true, + }, + { + label: 'reset', + action: 'reset', + showValidations: false, + tableView: false, + key: 'reset', + type: 'button', + input: true, + }, + ], + }; + + const wizard = { + _id: '65966189ac3dff73a7234dd9', + title: 'clear rows', + name: 'clearRows', + path: 'clearrows', + type: 'form', + display: 'wizard', + components: [ + { + title: 'Page 1', + label: 'Page 1', + type: 'panel', + key: 'page1', + components: [ + { + label: 'Radio', + optionsLabelPosition: 'right', + inline: false, + tableView: true, + values: [ + { + label: ' a', + value: 'a', + shortcut: '', + }, + { + label: 'b', + value: 'b', + shortcut: '', + }, + { + label: 'c', + value: 'c', + shortcut: '', + }, + ], + allowCalculateOverride: true, + key: 'radio1', + type: 'radio', + alwaysEnabled: false, + input: true, + }, + { + label: 'Text Field', + alwaysEnabled: false, + tableView: true, + calculateValue: "if (data.radio1 == 'a'){value = 'test data'}", + allowCalculateOverride: true, + key: 'textField', + type: 'textfield', + input: true, + }, + { + label: 'Text Area', + autoExpand: false, + alwaysEnabled: false, + tableView: true, + calculateValue: "if (data.radio1 == 'a'){value = 'test data'}", + allowCalculateOverride: true, + key: 'textArea', + type: 'textarea', + input: true, + }, + { + label: 'Number', + mask: false, + alwaysEnabled: false, + tableView: false, + delimiter: false, + requireDecimal: false, + inputFormat: 'plain', + calculateValue: "if (data.radio1 == 'a'){value = 123}", + allowCalculateOverride: true, + key: 'number', + type: 'number', + input: true, + }, + { + label: 'Radio', + optionsLabelPosition: 'right', + inline: false, + tableView: false, + values: [ + { + label: 'one', + value: 'one', + shortcut: '', + }, + { + label: 'two', + value: 'two', + shortcut: '', + }, + ], + calculateValue: "value = 'one'", + allowCalculateOverride: true, + key: 'radio', + type: 'radio', + input: true, + }, + ], + input: false, + tableView: false, + alwaysEnabled: false, + path: 'page1', + }, + ], + }; + + export default { + withClearOnHide, + withDataGrid, + withResetBtn, + wizard, + }; + + \ No newline at end of file