Skip to content

Commit

Permalink
feat(kit): Number keeps untouched decimal part if `precision: Infin…
Browse files Browse the repository at this point in the history
…ity` (#253)
  • Loading branch information
nsbarsukov authored Apr 18, 2023
1 parent 08bdfd2 commit 261779e
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 94 deletions.
171 changes: 86 additions & 85 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@
"@ng-web-apis/universal": "^2.1.0",
"@nguniversal/express-engine": "^12.1.3",
"@stackblitz/sdk": "^1.8.2",
"@taiga-ui/addon-doc": "3.22.0",
"@taiga-ui/addon-mobile": "3.22.0",
"@taiga-ui/cdk": "3.22.0",
"@taiga-ui/core": "3.22.0",
"@taiga-ui/icons": "3.22.0",
"@taiga-ui/kit": "3.22.0",
"@taiga-ui/styles": "3.22.0",
"@taiga-ui/testing": "3.22.0",
"@taiga-ui/addon-doc": "3.24.0",
"@taiga-ui/addon-mobile": "3.24.0",
"@taiga-ui/cdk": "3.24.0",
"@taiga-ui/core": "3.24.0",
"@taiga-ui/icons": "3.24.0",
"@taiga-ui/kit": "3.24.0",
"@taiga-ui/styles": "3.24.0",
"@taiga-ui/testing": "3.24.0",
"@tinkoff/ng-dompurify": "^3.0.0",
"core-js": "^2.6.12",
"dompurify": "^2.4.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,14 @@ describe('Number | precision', () => {
.should('have.prop', 'selectionEnd', 1);
});
});

it('keeps untouched decimal part if `precision: Infinity`', () => {
openNumberPage('decimalSeparator=,&precision=Infinity');

cy.get('@input')
.type('0,123456789')
.should('have.value', '0,123456789')
.should('have.prop', 'selectionStart', '0,123456789'.length)
.should('have.prop', 'selectionEnd', '0,123456789'.length);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class NumberMaskDocComponent implements GeneratorOptions {
maskitoOptions: MaskitoOptions = maskitoNumberOptionsGenerator(this);

readonly decimalPseudoSeparatorsOptions = [['.', ',', 'б', 'ю'], ['.'], [',']];
readonly precisionOptions: number[] = [0, 1, 2, 5, 10, Infinity];

precision = 0;
isNegativeAllowed = true;
Expand Down
Loading

0 comments on commit 261779e

Please sign in to comment.