Skip to content

Commit 55110ea

Browse files
committed
style(*): Corrigir lint dos arquivos.
1 parent 137b982 commit 55110ea

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

src/core/base/component-has-model.base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import { ElementRef, Input, ViewChild, OnInit } from '@angular/core';
2424
import { ComponentDefaultBase } from './component-default.base';
2525
import { TabIndexGenerator } from '../helper/tabindex-generator';
26-
import { ControlValueAccessor } from "@angular/forms/src/forms";
26+
import { ControlValueAccessor } from '@angular/forms/src/forms';
2727

2828

2929
/**

src/core/directives/field-mask.directive.ts

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@ import {
22
Directive,
33
HostListener,
44
Input,
5-
AfterViewInit, OnInit, ViewChild, ElementRef, ContentChildren, QueryList, AfterContentInit, EventEmitter, Output
5+
AfterViewInit, OnInit, ContentChildren, QueryList, AfterContentInit, EventEmitter, Output
66
} from '@angular/core';
7-
import { TlInput } from "../../input/input";
7+
import { TlInput } from '../../input/input';
88

99

1010
@Directive( {
1111
selector: '[mask]',
1212
} )
1313
export class FieldMaskDirective implements AfterViewInit, OnInit, AfterContentInit {
1414

15-
private maskGuides;
16-
1715
@ContentChildren( TlInput ) tlinput : QueryList<TlInput>;
1816

17+
private maskGuides;
1918
private value;
2019
private input;
2120

@@ -54,25 +53,25 @@ export class FieldMaskDirective implements AfterViewInit, OnInit, AfterContentIn
5453
const value = this.input.nativeElement.value;
5554
const start = this.input.nativeElement.selectionStart;
5655
const end = this.input.nativeElement.selectionEnd;
57-
56+
5857
if ( this.maskGuides ) {
59-
if ( value[ end - 1 ] == this.maskGuideExpression[ end - 1 ] ) {
58+
if ( value[ end - 1 ] === this.maskGuideExpression[ end - 1 ] ) {
6059
event.preventDefault();
6160
if ( start > 0 ) {
6261
this.input.nativeElement.setSelectionRange( start - 1, end - 1 );
6362
}
6463
}
6564

66-
if ( value[ end - 1 ] != this.maskGuideExpression[ end - 1 ] ) {
67-
let valueArray = value.split( '' );
65+
if ( value[ end - 1 ] !== this.maskGuideExpression[ end - 1 ] ) {
66+
const valueArray = value.split( '' );
6867
event.preventDefault();
6968
let valueResult = '';
70-
let self = this;
71-
valueArray.forEach( function ( value, index, array ) {
69+
const self = this;
70+
valueArray.forEach( function ( myValue, index, array ) {
7271
if ( index === end - 1 ) {
7372
valueResult = valueResult + self.maskGuideExpression[ end - 1 ];
7473
} else {
75-
valueResult = valueResult + value;
74+
valueResult = valueResult + myValue;
7675
}
7776
} );
7877

@@ -86,10 +85,10 @@ export class FieldMaskDirective implements AfterViewInit, OnInit, AfterContentIn
8685
const cursor = this.input.nativeElement.selectionEnd;
8786
if ( event.code === 'Delete' ) {
8887
event.preventDefault();
89-
let valueArray = this.input.nativeElement.value.split( '' );
90-
let self = this;
88+
const valueArray = this.input.nativeElement.value.split( '' );
89+
const self = this;
9190
valueArray.forEach(function ( value, index, array ) {
92-
if (index == cursor) {
91+
if (index === cursor) {
9392
array[index] = self.maskGuideExpression[cursor];
9493
}
9594
});
@@ -127,7 +126,7 @@ export class FieldMaskDirective implements AfterViewInit, OnInit, AfterContentIn
127126
this.setValueOnInicialize();
128127
this.applyGuides();
129128
this.applyMask();
130-
}, 0 )
129+
}, 0 );
131130
}
132131
}
133132

@@ -173,24 +172,24 @@ export class FieldMaskDirective implements AfterViewInit, OnInit, AfterContentIn
173172

174173
private handleKeypress( event ) {
175174

176-
let charInputed = event.key;
175+
const charInputed = event.key;
177176
if ( charInputed !== 'Enter' && charInputed.length > 0 ) {
178177

179-
let start = this.input.nativeElement.selectionStart;
180-
let end = this.input.nativeElement.selectionEnd;
181-
let inputArray = this.input.nativeElement.value.split( '' );
178+
const start = this.input.nativeElement.selectionStart;
179+
const end = this.input.nativeElement.selectionEnd;
180+
const inputArray = this.input.nativeElement.value.split( '' );
182181

183-
if ( this.isValidSymbolMask( charInputed, this.maskExpression[ end ] ) == false ) {
182+
if ( this.isValidSymbolMask( charInputed, this.maskExpression[ end ] ) === false ) {
184183
event.preventDefault();
185-
return
184+
return;
186185
}
187186

188187
if ( this.maskGuides ) {
189188

190189
this.input.nativeElement.value = this.replaceUndescoreForChar( inputArray, charInputed, end );
191190
event.preventDefault();
192191

193-
if ( this.input.nativeElement.value.split( '' )[ end + 1 ] == this.maskExpression[ end + 1 ]
192+
if ( this.input.nativeElement.value.split( '' )[ end + 1 ] === this.maskExpression[ end + 1 ]
194193
|| this.maskSpecialCharacters.indexOf( this.maskExpression[ end ] ) >= 0 ) {
195194
this.input.nativeElement.setSelectionRange( start + 2, end + 2 );
196195
} else {
@@ -207,7 +206,7 @@ export class FieldMaskDirective implements AfterViewInit, OnInit, AfterContentIn
207206
}
208207

209208
private onComplete() {
210-
if ( this.clearMask( this.maskExpression ).length == this.clearMask( this.input.nativeElement.value ).length ) {
209+
if ( this.clearMask( this.maskExpression ).length === this.clearMask( this.input.nativeElement.value ).length ) {
211210
this.tlinput.toArray()[ 0 ].validations[ 'validMask' ] = true;
212211
} else {
213212
this.tlinput.toArray()[ 0 ].validations[ 'validMask' ] = false;
@@ -236,7 +235,7 @@ export class FieldMaskDirective implements AfterViewInit, OnInit, AfterContentIn
236235
const self = this;
237236
if ( this.maskGuides ) {
238237
setTimeout( function () {
239-
if ( self.input.nativeElement.value.length == 0 ) {
238+
if ( self.input.nativeElement.value.length === 0 ) {
240239
self.input.nativeElement.value = self.maskGuideExpression;
241240
}
242241
}, 1 );

0 commit comments

Comments
 (0)