diff --git a/src/components/number/Number.js b/src/components/number/Number.js index cb416b8854..bc968ed07c 100644 --- a/src/components/number/Number.js +++ b/src/components/number/Number.js @@ -63,7 +63,7 @@ export default class NumberComponent extends Input { this.delimiter = this.component.thousandsSeparator || this.options.properties?.thousandsSeparator || this.options.thousandsSeparator || separators.delimiter; } else { - if (this.component.thousandsSeparator || this.options.properties?.thousandsSeparator || this.options.thousandsSeparator){ + if (this.component.thousandsSeparator || this.options.properties?.thousandsSeparator || this.options.thousandsSeparator) { console.warn('In order for thousands separator to work properly, you must set the delimiter to true in the component json'); } this.delimiter = ''; diff --git a/src/components/number/Number.unit.js b/src/components/number/Number.unit.js index 3a4d99ff4d..a3c737d42e 100644 --- a/src/components/number/Number.unit.js +++ b/src/components/number/Number.unit.js @@ -16,7 +16,7 @@ import { comp8, comp9 } from './fixtures'; -import CurrencyComponent from "../currency/Currency"; +import CurrencyComponent from '../currency/Currency'; describe('Number Component', () => { it('Should build an number component', () => { @@ -431,12 +431,12 @@ describe('Number Component', () => { const inputEvent = new Event('input'); const numberComponent = form.getComponent('number'); const buttonComponent = form.getComponent('submit'); - numberComponent.refs.input[0].value = "123-456"; + numberComponent.refs.input[0].value = '123-456'; numberComponent.refs.input[0].dispatchEvent(inputEvent); setTimeout(()=>{ buttonComponent.refs.button.click(); setTimeout(()=>{ - assert.equal(numberComponent.refs.input[0].value, "123-456"); + assert.equal(numberComponent.refs.input[0].value, '123-456'); done(); },200); },200); @@ -444,7 +444,7 @@ describe('Number Component', () => { }); it('Should remove thousands separator in parseValue function if set on component JSON', () => { - const numberComponent = new NumberComponent({thousandsSeparator: '.', decimalSymbol: ',', delimiter: true}); + const numberComponent = new NumberComponent({ thousandsSeparator: '.', decimalSymbol: ',', delimiter: true }); assert.equal(numberComponent.parseValue('123.456.789,1'), '123456789,1'); }); @@ -459,8 +459,8 @@ describe('Number Component', () => { setTimeout(()=>{ assert.equal(numberComponent.refs.input[0].value, '111.222.333'); done(); - },200) - }) + },200); + }); }); // it('Should add trailing zeros on blur, if decimal required', (done) => { diff --git a/src/components/number/fixtures/comp8.js b/src/components/number/fixtures/comp8.js index da06ccd63e..212853a107 100644 --- a/src/components/number/fixtures/comp8.js +++ b/src/components/number/fixtures/comp8.js @@ -1,26 +1,26 @@ export default { components: [ { - "label": "Number", - "applyMaskOn": "change", - "mask": false, - "tableView": false, - "delimiter": false, - "requireDecimal": false, - "inputFormat": "plain", - "truncateMultipleSpaces": false, - "key": "number", - "type": "number", - "input": true, - "decimalSymbol": "-" + label: 'Number', + applyMaskOn: 'change', + mask: false, + tableView: false, + delimiter: false, + requireDecimal: false, + inputFormat: 'plain', + truncateMultipleSpaces: false, + key: 'number', + type: 'number', + input: true, + decimalSymbol: '-' }, { - "type": "button", - "label": "Submit", - "key": "submit", - "disableOnInvalid": true, - "input": true, - "tableView": false + type: 'button', + label: 'Submit', + key: 'submit', + disableOnInvalid: true, + input: true, + tableView: false } ] -} +}; diff --git a/src/components/number/fixtures/comp9.js b/src/components/number/fixtures/comp9.js index 9a8d59b2fd..ecc5cc73f8 100644 --- a/src/components/number/fixtures/comp9.js +++ b/src/components/number/fixtures/comp9.js @@ -1,19 +1,19 @@ export default { components: [ { - "label": "Number", - "applyMaskOn": "change", - "mask": false, - "tableView": false, - "delimiter": true, - "requireDecimal": false, - "inputFormat": "plain", - "truncateMultipleSpaces": false, - "key": "number", - "type": "number", - "input": true, - "decimalSymbol": ",", - "thousandsSeparator": "." + label: 'Number', + applyMaskOn: 'change', + mask: false, + tableView: false, + delimiter: true, + requireDecimal: false, + inputFormat: 'plain', + truncateMultipleSpaces: false, + key: 'number', + type: 'number', + input: true, + decimalSymbol: ',', + thousandsSeparator: '.' } ] -} +};