Skip to content

Commit 7e0f5a2

Browse files
committed
chore(*): Yet another batch of static flags.
1 parent 4d17841 commit 7e0f5a2

17 files changed

+194
-209
lines changed

projects/igniteui-angular/src/lib/buttonGroup/buttongroup.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,5 +320,5 @@ class TemplatedButtonGroupComponent {
320320
<button igxButton>London</button>
321321
</igx-buttongroup>` })
322322
class TemplatedButtonGroupDesplayDensityComponent {
323-
@ViewChild(IgxButtonGroupComponent, /* TODO: add static flag */ {}) public buttonGroup: IgxButtonGroupComponent;
323+
@ViewChild(IgxButtonGroupComponent, { static: true }) public buttonGroup: IgxButtonGroupComponent;
324324
}

projects/igniteui-angular/src/lib/directives/autocomplete/autocomplete.directive.spec.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,8 @@ class AutocompleteComponent {
889889
</igx-drop-down>`
890890
})
891891
class AutocompleteInputComponent extends AutocompleteComponent {
892-
@ViewChild('plainInput', /* TODO: add static flag */ {}) public plainInput: ElementRef<HTMLInputElement>;
893-
@ViewChild('textarea', /* TODO: add static flag */ {}) public textarea: ElementRef<HTMLTextAreaElement>;
892+
@ViewChild('plainInput', { static: true }) public plainInput: ElementRef<HTMLInputElement>;
893+
@ViewChild('textarea', { static: true }) public textarea: ElementRef<HTMLTextAreaElement>;
894894
}
895895

896896
@Component({
@@ -916,11 +916,11 @@ class AutocompleteInputComponent extends AutocompleteComponent {
916916
})
917917

918918
class AutocompleteFormComponent {
919-
@ViewChild(IgxAutocompleteDirective, /* TODO: add static flag */ {}) public autocomplete: IgxAutocompleteDirective;
920-
@ViewChild(IgxInputGroupComponent, /* TODO: add static flag */ {}) public group: IgxInputGroupComponent;
921-
@ViewChild(IgxInputDirective, /* TODO: add static flag */ {}) public input: IgxInputDirective;
922-
@ViewChild(IgxDropDownComponent, /* TODO: add static flag */ {}) public dropDown: IgxDropDownComponent;
923-
@ViewChild('plainInput', /* TODO: add static flag */ {}) public plainInput: ElementRef<HTMLInputElement>;
919+
@ViewChild(IgxAutocompleteDirective, { static: true }) public autocomplete: IgxAutocompleteDirective;
920+
@ViewChild(IgxInputGroupComponent, { static: true }) public group: IgxInputGroupComponent;
921+
@ViewChild(IgxInputDirective, { static: true }) public input: IgxInputDirective;
922+
@ViewChild(IgxDropDownComponent, { static: true }) public dropDown: IgxDropDownComponent;
923+
@ViewChild('plainInput', { static: true }) public plainInput: ElementRef<HTMLInputElement>;
924924
towns;
925925

926926
reactiveForm: FormGroup;

projects/igniteui-angular/src/lib/directives/button/button.directive.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ class ButtonWithAttribsComponent {
151151
class ButtonsWithDisplayDensityComponent {
152152
public density: DisplayDensity = DisplayDensity.comfortable;
153153

154-
@ViewChild('flat', /* TODO: add static flag */ { read: IgxButtonDirective }) flatButton: IgxButtonDirective;
155-
@ViewChild('raised', /* TODO: add static flag */ { read: IgxButtonDirective }) raisedButton: IgxButtonDirective;
156-
@ViewChild('outlined', /* TODO: add static flag */ { read: IgxButtonDirective }) outlinedButton: IgxButtonDirective;
157-
@ViewChild('fab', /* TODO: add static flag */ { read: IgxButtonDirective }) fabButton: IgxButtonDirective;
158-
@ViewChild('icon', /* TODO: add static flag */ { read: IgxButtonDirective }) iconButton: IgxButtonDirective;
154+
@ViewChild('flat', { read: IgxButtonDirective, static: true }) flatButton: IgxButtonDirective;
155+
@ViewChild('raised', { read: IgxButtonDirective, static: true }) raisedButton: IgxButtonDirective;
156+
@ViewChild('outlined', { read: IgxButtonDirective, static: true }) outlinedButton: IgxButtonDirective;
157+
@ViewChild('fab', { read: IgxButtonDirective, static: true }) fabButton: IgxButtonDirective;
158+
@ViewChild('icon', { read: IgxButtonDirective, static: true }) iconButton: IgxButtonDirective;
159159
}
160160

161161
/**

projects/igniteui-angular/src/lib/directives/dragdrop/dragdrop.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class TestDragDropComponent {
4646
@ViewChildren(IgxDragDirective)
4747
public dragElems: QueryList<IgxDragDirective>;
4848

49-
@ViewChild('dropArea', /* TODO: add static flag */ { read: IgxDropDirective })
49+
@ViewChild('dropArea', { read: IgxDropDirective, static: true })
5050
public dropArea: IgxDropDirective;
5151

52-
@ViewChild('container', /* TODO: add static flag */ { read: ElementRef })
52+
@ViewChild('container', { read: ElementRef, static: true })
5353
public container: ElementRef;
5454
}
5555

projects/igniteui-angular/src/lib/directives/filter/filter.directive.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ class DeclarativeListTestComponent {
159159
public filteringArgs: FilteringArgs;
160160
public filteredArgs: FilteringArgs;
161161

162-
@ViewChild(IgxListComponent, /* TODO: add static flag */ {}) public list: IgxListComponent;
163-
@ViewChild('logInput', /* TODO: add static flag */ {}) public logInput: any;
162+
@ViewChild(IgxListComponent, { static: true }) public list: IgxListComponent;
163+
@ViewChild('logInput', { static: true }) public logInput: any;
164164

165165
get fo() {
166166
const options = new IgxFilterOptions();
@@ -193,7 +193,7 @@ class DynamicListTestComponent {
193193
public filterValue: string;
194194
public isCanceled = false;
195195

196-
@ViewChild(IgxListComponent, /* TODO: add static flag */ {}) public list: IgxListComponent;
196+
@ViewChild(IgxListComponent, { static: true }) public list: IgxListComponent;
197197

198198
protected dataSourceItems: object[] = [
199199
{ key: '1', text: 'Nav1' },

projects/igniteui-angular/src/lib/directives/focus/focus.directive.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class NoFocusComponent { }
115115
`
116116
})
117117
class TriggerFocusOnClickComponent {
118-
@ViewChild(IgxFocusDirective, /* TODO: add static flag */ {}) public focusRef: IgxFocusDirective;
118+
@ViewChild(IgxFocusDirective, { static: true }) public focusRef: IgxFocusDirective;
119119

120120
focus() {
121121
this.focusRef.trigger();
@@ -131,7 +131,7 @@ class TriggerFocusOnClickComponent {
131131
`
132132
})
133133
class CheckboxPickerComponent {
134-
@ViewChild(IgxCheckboxComponent, /* TODO: add static flag */ {}) public checkbox: IgxCheckboxComponent;
135-
@ViewChild(IgxDatePickerComponent, /* TODO: add static flag */ {}) public picker: IgxDatePickerComponent;
136-
@ViewChild('picker', /* TODO: add static flag */ { read: IgxFocusDirective }) public pickerFocusRef: IgxFocusDirective;
134+
@ViewChild(IgxCheckboxComponent, { static: true }) public checkbox: IgxCheckboxComponent;
135+
@ViewChild(IgxDatePickerComponent, { static: true }) public picker: IgxDatePickerComponent;
136+
@ViewChild('picker', { read: IgxFocusDirective, static: true }) public pickerFocusRef: IgxFocusDirective;
137137
}

projects/igniteui-angular/src/lib/directives/input/input.directive.spec.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ describe('IgxInput', () => {
446446
</form>` })
447447
class InputsWithSameNameAttributesComponent {
448448
@ViewChildren('igxInputGroup') public igxInputGroup: QueryList<DebugElement>;
449-
@ViewChild(IgxInputDirective, /* TODO: add static flag */ {}) public igxInput: IgxInputDirective;
449+
@ViewChild(IgxInputDirective, { static: true }) public igxInput: IgxInputDirective;
450450

451451
model = {
452452
firstName: null
@@ -459,8 +459,8 @@ class InputsWithSameNameAttributesComponent {
459459
<input name="test" #igxInput type="text" igxInput />
460460
</igx-input-group>` })
461461
class InputComponent {
462-
@ViewChild('igxInputGroup', /* TODO: add static flag */ {}) public igxInputGroup: IgxInputGroupComponent;
463-
@ViewChild(IgxInputDirective, /* TODO: add static flag */ {}) public igxInput: IgxInputDirective;
462+
@ViewChild('igxInputGroup', { static: true }) public igxInputGroup: IgxInputGroupComponent;
463+
@ViewChild(IgxInputDirective, { static: true }) public igxInput: IgxInputDirective;
464464
}
465465

466466
@Component({ template: `<igx-input-group>
@@ -475,43 +475,43 @@ class TextareaComponent {
475475
<input name="test" placeholder="Test" #igxInput type="text" igxInput />
476476
</igx-input-group>` })
477477
class InputWithPlaceholderComponent {
478-
@ViewChild(IgxInputDirective, /* TODO: add static flag */ {}) public igxInput: IgxInputDirective;
478+
@ViewChild(IgxInputDirective, { static: true }) public igxInput: IgxInputDirective;
479479
}
480480

481481
@Component({ template: `<igx-input-group #igxInputGroup>
482482
<label for="test" igxLabel>Test</label>
483483
<input name="test" #igxInput type="text" igxInput value="Test" />
484484
</igx-input-group>` })
485485
class FilledInputComponent {
486-
@ViewChild('igxInputGroup', /* TODO: add static flag */ {}) public igxInputGroup: IgxInputGroupComponent;
487-
@ViewChild(IgxInputDirective, /* TODO: add static flag */ {}) public igxInput: IgxInputDirective;
486+
@ViewChild('igxInputGroup', { static: true }) public igxInputGroup: IgxInputGroupComponent;
487+
@ViewChild(IgxInputDirective, { static: true }) public igxInput: IgxInputDirective;
488488
}
489489

490490
@Component({ template: `<igx-input-group #igxInputGroup>
491491
<label for="test" igxLabel>Test</label>
492492
<input name="test" #igxInput type="text" igxInput value="Test" disabled="disabled" />
493493
</igx-input-group>` })
494494
class DisabledInputComponent {
495-
@ViewChild('igxInputGroup', /* TODO: add static flag */ {}) public igxInputGroup: IgxInputGroupComponent;
496-
@ViewChild(IgxInputDirective, /* TODO: add static flag */ {}) public igxInput: IgxInputDirective;
495+
@ViewChild('igxInputGroup', { static: true }) public igxInputGroup: IgxInputGroupComponent;
496+
@ViewChild(IgxInputDirective, { static: true }) public igxInput: IgxInputDirective;
497497
}
498498

499499
@Component({ template: `<igx-input-group #igxInputGroup>
500500
<label for="test" igxLabel>Test</label>
501501
<input name="test" #igxInput type="text" igxInput required="required" />
502502
</igx-input-group>` })
503503
class RequiredInputComponent {
504-
@ViewChild('igxInputGroup', /* TODO: add static flag */ {}) public igxInputGroup: IgxInputGroupComponent;
505-
@ViewChild(IgxInputDirective, /* TODO: add static flag */ {}) public igxInput: IgxInputDirective;
504+
@ViewChild('igxInputGroup', { static: true }) public igxInputGroup: IgxInputGroupComponent;
505+
@ViewChild(IgxInputDirective, { static: true }) public igxInput: IgxInputDirective;
506506
}
507507

508508
@Component({ template: `<igx-input-group #igxInputGroup>
509509
<label for="test" igxLabel>Test</label>
510510
<input name="test" #igxInput type="text" igxInput [(ngModel)]="user.firstName" required="required" />
511511
</igx-input-group>` })
512512
class RequiredTwoWayDataBoundInputComponent {
513-
@ViewChild('igxInputGroup', /* TODO: add static flag */ {}) public igxInputGroup: IgxInputGroupComponent;
514-
@ViewChild(IgxInputDirective, /* TODO: add static flag */ {}) public igxInput: IgxInputDirective;
513+
@ViewChild('igxInputGroup', { static: true }) public igxInputGroup: IgxInputGroupComponent;
514+
@ViewChild(IgxInputDirective, { static: true }) public igxInput: IgxInputDirective;
515515

516516
public user = {
517517
firstName: ''
@@ -586,8 +586,8 @@ class InitiallyFilledInputComponent {
586586
<input name="test" #igxInput type="text" igxInput [disabled]="disabled" />
587587
</igx-input-group>` })
588588
class DataBoundDisabledInputComponent {
589-
@ViewChild('igxInputGroup', /* TODO: add static flag */ {}) public igxInputGroup: IgxInputGroupComponent;
590-
@ViewChild(IgxInputDirective, /* TODO: add static flag */ {}) public igxInput: IgxInputDirective;
589+
@ViewChild('igxInputGroup', { static: true }) public igxInputGroup: IgxInputGroupComponent;
590+
@ViewChild(IgxInputDirective, { static: true }) public igxInput: IgxInputDirective;
591591

592592
public disabled = false;
593593
}

projects/igniteui-angular/src/lib/directives/layout/layout.directive.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,6 @@ describe('IgxLayoutDirective', () => {
145145
`
146146
})
147147
class TestFlexLayoutComponent {
148-
@ViewChild(IgxLayoutDirective, /* TODO: add static flag */ {}) public instance: IgxLayoutDirective;
149-
@ViewChild(IgxFlexDirective, /* TODO: add static flag */ {}) public inner: IgxFlexDirective;
148+
@ViewChild(IgxLayoutDirective, { static: true }) public instance: IgxLayoutDirective;
149+
@ViewChild(IgxFlexDirective, { static: true }) public inner: IgxFlexDirective;
150150
}

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

+13-13
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class DefMaskComponent {
346346
public mask;
347347
public value;
348348

349-
@ViewChild('input', /* TODO: add static flag */ {})
349+
@ViewChild('input', { static: true })
350350
public input: ElementRef;
351351
}
352352

@@ -357,7 +357,7 @@ class MaskComponent {
357357
mask = '(000) 0000-000';
358358
value = '1234567890';
359359

360-
@ViewChild('input', /* TODO: add static flag */ {})
360+
@ViewChild('input', { static: true })
361361
public input: ElementRef;
362362
}
363363

@@ -371,10 +371,10 @@ class IncludeLiteralsComponent {
371371
public mask = '(000) 0000-000';
372372
@Input() public value = '55555';
373373

374-
@ViewChild('input', /* TODO: add static flag */ {})
374+
@ViewChild('input', { static: true })
375375
public input: ElementRef;
376376

377-
@ViewChild('input1', /* TODO: add static flag */ {})
377+
@ViewChild('input1', { static: true })
378378
public input1: ElementRef;
379379
}
380380

@@ -385,7 +385,7 @@ class DigitSpaceMaskComponent {
385385
public mask = '999999';
386386
public value = '555 555';
387387

388-
@ViewChild('input', /* TODO: add static flag */ {})
388+
@ViewChild('input', { static: true })
389389
public input: ElementRef;
390390
}
391391

@@ -396,7 +396,7 @@ class DigitPlusMinusMaskComponent {
396396
public mask = '####-### ## ## ##';
397397
public value = '+359884190854';
398398

399-
@ViewChild('input', /* TODO: add static flag */ {})
399+
@ViewChild('input', { static: true })
400400
public input: ElementRef;
401401
}
402402

@@ -407,7 +407,7 @@ class LetterSpaceMaskComponent {
407407
public mask = 'LL??LL??';
408408
public value = 'AB 2CD E';
409409

410-
@ViewChild('input', /* TODO: add static flag */ {})
410+
@ViewChild('input', { static: true })
411411
public input: ElementRef;
412412
}
413413

@@ -418,7 +418,7 @@ class AlphanumSpaceMaskComponent {
418418
public mask = 'AAAaaa';
419419
public value = '7c 8u';
420420

421-
@ViewChild('input', /* TODO: add static flag */ {})
421+
@ViewChild('input', { static: true })
422422
public input: ElementRef;
423423
}
424424

@@ -429,7 +429,7 @@ class AnyCharMaskComponent {
429429
public mask = '&&&.CCC';
430430
public value = ' =% p]';
431431

432-
@ViewChild('input', /* TODO: add static flag */ {})
432+
@ViewChild('input', { static: true })
433433
public input: ElementRef;
434434
}
435435

@@ -443,7 +443,7 @@ class EventFiringComponent {
443443
raw: string;
444444
formatted: string;
445445

446-
@ViewChild('input', /* TODO: add static flag */ {})
446+
@ViewChild('input', { static: true })
447447
public input: ElementRef;
448448

449449
handleValueChange(event) {
@@ -463,7 +463,7 @@ class OneWayBindComponent {
463463
myMask = 'AAAAAAAA';
464464
value = 3456;
465465

466-
@ViewChild('input', /* TODO: add static flag */ {})
466+
@ViewChild('input', { static: true })
467467
public input: ElementRef;
468468
}
469469

@@ -477,7 +477,7 @@ class PlaceholderMaskComponent {
477477
public mask = '(00) (00)';
478478
public value = null;
479479

480-
@ViewChild('input', /* TODO: add static flag */ {})
480+
@ViewChild('input', { static: true })
481481
public input: ElementRef;
482482
}
483483

@@ -495,7 +495,7 @@ class PipesMaskComponent {
495495
public displayFormat = new DisplayFormatPipe();
496496
public inputFormat = new InputFormatPipe();
497497

498-
@ViewChild('input', /* TODO: add static flag */ {})
498+
@ViewChild('input', { static: true })
499499
public input: ElementRef;
500500
}
501501

projects/igniteui-angular/src/lib/directives/radio/radio-group.directive.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ describe('IgxRadioGroupDirective', () => {
193193
`
194194
})
195195
class RadioGroupComponent {
196-
@ViewChild('radioGroup', /* TODO: add static flag */ { read: IgxRadioGroupDirective }) public radioGroup: IgxRadioGroupDirective;
196+
@ViewChild('radioGroup', { read: IgxRadioGroupDirective, static: true }) public radioGroup: IgxRadioGroupDirective;
197197
}
198198

199199
class Person {
@@ -217,7 +217,7 @@ class RadioGroupWithModelComponent {
217217
'Autumn',
218218
];
219219

220-
@ViewChild('radioGroupSeasons', /* TODO: add static flag */ { read: IgxRadioGroupDirective }) public radioGroup: IgxRadioGroupDirective;
220+
@ViewChild('radioGroupSeasons', { read: IgxRadioGroupDirective, static: true }) public radioGroup: IgxRadioGroupDirective;
221221

222222
personBob: Person = { name: 'Bob', favoriteSeason: 'Summer' };
223223
}

projects/igniteui-angular/src/lib/directives/scroll-inertia/scroll_inertia.directive.spec.ts

+6-20
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
11
import {
2-
AfterViewInit,
3-
ChangeDetectorRef,
42
Component,
5-
ComponentFactoryResolver,
63
Directive,
7-
Injectable,
8-
IterableChanges,
9-
IterableDiffers,
104
NgZone,
115
OnInit,
12-
QueryList,
13-
TemplateRef,
146
ViewChild,
15-
ViewChildren,
16-
ViewContainerRef,
17-
DebugElement,
187
ElementRef
198
} from '@angular/core';
209
import { async, TestBed, ComponentFixture } from '@angular/core/testing';
21-
import { By } from '@angular/platform-browser';
22-
import { BehaviorSubject, Observable } from 'rxjs';
2310
import { IgxScrollInertiaModule, IgxScrollInertiaDirective } from './scroll_inertia.directive';
24-
import { take } from 'rxjs/operators';
25-
import { UIInteractions, wait } from '../../test-utils/ui-interactions.spec';
2611

2712
import { configureTestSuite } from '../../test-utils/configure-suite';
13+
import { wait } from '../../test-utils/ui-interactions.spec';
2814

2915
describe('Scroll Inertia Directive ', () => {
3016
configureTestSuite();
@@ -412,7 +398,7 @@ export class IgxTestScrollInertiaDirective extends IgxScrollInertiaDirective {
412398
</div>
413399
`
414400
})
415-
export class ScrollInertiaComponent implements AfterViewInit {
401+
export class ScrollInertiaComponent implements OnInit {
416402
public height = '500px';
417403
public innerHeight = '5000px';
418404
public innerWidth = '5000px';
@@ -421,13 +407,13 @@ export class ScrollInertiaComponent implements AfterViewInit {
421407
public scrLeftArray = [];
422408
public scrLeftStepArray = [];
423409

424-
@ViewChild('container', /* TODO: add static flag */ {}) public container: ElementRef;
425-
@ViewChild('scrBar', /* TODO: add static flag */ {}) public scrollContainer: ElementRef;
410+
@ViewChild('container', { static: true }) public container: ElementRef;
411+
@ViewChild('scrBar', { static: true }) public scrollContainer: ElementRef;
426412

427-
@ViewChild('scrInertiaContainer', /* TODO: add static flag */ { read: IgxTestScrollInertiaDirective })
413+
@ViewChild('scrInertiaContainer', { read: IgxTestScrollInertiaDirective, static: true })
428414
public scrInertiaDir: IgxTestScrollInertiaDirective;
429415

430-
ngAfterViewInit() {
416+
ngOnInit() {
431417
this.scrInertiaDir.IgxScrollInertiaScrollContainer = this.scrollContainer.nativeElement;
432418

433419
this.scrollContainer.nativeElement.addEventListener('scroll', (evt) => { this.onScroll(evt); });

projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ class HighlightLoremIpsumComponent {
321321
// tslint:disable-next-line:max-line-length
322322
public html = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vulputate luctus dui ut maximus. Quisque sed suscipit lorem. Vestibulum sit.';
323323

324-
@ViewChild(forwardRef(() => IgxTextHighlightDirective), /* TODO: add static flag */ { read: IgxTextHighlightDirective })
324+
@ViewChild(forwardRef(() => IgxTextHighlightDirective), { read: IgxTextHighlightDirective, static: true })
325325
public highlight: IgxTextHighlightDirective;
326326

327327
public highlightText(text: string, caseSensitive?: boolean, exactMatch?: boolean) {

0 commit comments

Comments
 (0)