Skip to content

Commit

Permalink
feat(ref: #1295, #1292, #1314, #1310, #1304, #1308, #1299): remove un…
Browse files Browse the repository at this point in the history
…usable code
  • Loading branch information
andriikamaldinov1 committed Mar 25, 2024
1 parent e49f85c commit 4abd338
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 322 deletions.
18 changes: 10 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
https://github.com/JsDaddy/ngx-mask/issues/1295
https://github.com/JsDaddy/ngx-mask/issues/1292
https://github.com/JsDaddy/ngx-mask/issues/1301 ?
https://github.com/JsDaddy/ngx-mask/issues/1302 ?
# 17.0.5(2024-03-25)

### Fix

https://github.com/JsDaddy/ngx-mask/issues/1295
https://github.com/JsDaddy/ngx-mask/issues/1292
https://github.com/JsDaddy/ngx-mask/issues/1314
https://github.com/JsDaddy/ngx-mask/issues/1310
https://github.com/JsDaddy/ngx-mask/issues/1304
https://github.com/JsDaddy/ngx-mask/issues/1308
https://github.com/JsDaddy/ngx-mask/issues/1299
https://github.com/JsDaddy/ngx-mask/issues/1310
https://github.com/JsDaddy/ngx-mask/issues/1304
https://github.com/JsDaddy/ngx-mask/issues/1308
https://github.com/JsDaddy/ngx-mask/issues/1299

# 17.0.4(2023-12-01)

Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-mask-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-mask",
"version": "17.0.4",
"version": "17.0.5",
"description": "awesome ngx mask",
"keywords": [
"ng2-mask",
Expand Down
7 changes: 3 additions & 4 deletions projects/ngx-mask-lib/src/lib/ngx-mask.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,9 @@ export class NgxMaskService extends NgxMaskApplierService {
return value;
}
if (
this.maskExpression.startsWith(MaskExpression.SEPARATOR) &&
(this.leadZero || !this.dropSpecialCharacters)
// ||
// (this.maskExpression.startsWith(MaskExpression.SEPARATOR) && String(value) === '0')
(this.maskExpression.startsWith(MaskExpression.SEPARATOR) &&
(this.leadZero || !this.dropSpecialCharacters)) ||
(this.maskExpression.startsWith(MaskExpression.SEPARATOR) && String(value) === '0')
) {
return value;
}
Expand Down
9 changes: 0 additions & 9 deletions projects/ngx-mask-lib/src/test/add-prefix.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,4 @@ describe('Directive: Mask (Add prefix)', () => {
equal('KZ123123', 'KZ123 123', fixture);
expect(component.form.value).toBe('123123');
});

it('should remove prefix when setValue', () => {
component.mask = '000 000';
component.prefix = 'KZ';
component.dropSpecialCharacters = false;
component.form.setValue('KZ123123');
equal('KZ123123', 'KZ123 123', fixture);
expect(component.form.value).toBe('KZ123 123');
});
});
9 changes: 0 additions & 9 deletions projects/ngx-mask-lib/src/test/drop-special-charaters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,4 @@ describe('Directive: Mask (Drop special characters)', () => {
equal('1234567890', '(123) 456-7890', fixture);
expect(component.form.valid).toBe(true);
});

it('dropSpecialCharacter = false test for valid with setValue', () => {
component.mask = '(000) 000-0000';
component.dropSpecialCharacters = false;
component.validation = true;
component.form.setValue('1234567890');
equal('1234567890', '(123) 456-7890', fixture);
expect(component.form.valid).toBe(true);
});
});
Loading

0 comments on commit 4abd338

Please sign in to comment.