Skip to content

Commit f1a7b12

Browse files
refactor(igxMask): remove decorator from placeholder prop
- make inputValue protected - set default value on mask prop
1 parent 2b2f5ca commit f1a7b12

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

projects/igniteui-angular/src/lib/directives/mask/mask.directive.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class IgxMaskDirective implements OnInit, ControlValueAccessor {
2323
* ```
2424
*/
2525
@Input('igxMask')
26-
public mask: string;
26+
public mask = 'CCCCCCCCCC';
2727

2828
/**
2929
* Sets the character representing a fillable spot in the input mask.
@@ -51,7 +51,6 @@ export class IgxMaskDirective implements OnInit, ControlValueAccessor {
5151
* ```
5252
*/
5353
@DeprecateProperty('"placeholder" is deprecated, use native placeholder instead.')
54-
@Input()
5554
public set placeholder(val: string) {
5655
this.renderer.setAttribute(this.nativeElement, 'placeholder', val);
5756
}
@@ -93,18 +92,18 @@ export class IgxMaskDirective implements OnInit, ControlValueAccessor {
9392
public onValueChange = new EventEmitter<IMaskEventArgs>();
9493

9594
/** @hidden @internal; */
96-
public get inputValue(): string {
95+
protected get inputValue(): string {
9796
return this.nativeElement.value;
9897
}
9998

100-
/** @hidden @internal; */
101-
public set inputValue(val) {
99+
/** @hidden @internal */
100+
protected set inputValue(val) {
102101
this.nativeElement.value = val;
103102
}
104103

105104
/** @hidden */
106105
protected get maskOptions() {
107-
const format = this.mask || 'CCCCCCCCCC';
106+
const format = this.mask;
108107
const promptChar = this.promptChar && this.promptChar.substring(0, 1);
109108
return { format, promptChar };
110109
}

src/app/mask/mask.sample.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="sample-wrapper">
1+
<!-- <div class="sample-wrapper">
22
<app-page-header title="Mask">
33
Provide means for controlling user input and formatting the visible value based on a configurable mask rules.
44
</app-page-header>
@@ -43,4 +43,5 @@ <h4>Mask Using Pipes</h4>
4343
</form>
4444
</article>
4545
</section>
46-
</div>
46+
</div> -->
47+
<input type="text" igxMask>

0 commit comments

Comments
 (0)