Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lane-formio committed Jul 24, 2024
1 parent 74964da commit 6e09d72
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/components/number/Number.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
12 changes: 6 additions & 6 deletions src/components/number/Number.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -431,20 +431,20 @@ 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);
});
});

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');
});

Expand All @@ -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) => {
Expand Down
38 changes: 19 additions & 19 deletions src/components/number/fixtures/comp8.js
Original file line number Diff line number Diff line change
@@ -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
}
]
}
};
28 changes: 14 additions & 14 deletions src/components/number/fixtures/comp9.js
Original file line number Diff line number Diff line change
@@ -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: '.'
}
]
}
};

0 comments on commit 6e09d72

Please sign in to comment.