Skip to content

Commit 39045c5

Browse files
committed
chore(*): renaming components to directives where necessary
1 parent 3acc659 commit 39045c5

File tree

64 files changed

+397
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+397
-397
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ before_script:
2020
- npm install -g gulp
2121
- npm install -g istanbul-combine
2222
script:
23-
# - npm run lint:lib
23+
- npm run lint:lib
2424
- ng build igniteui-angular --prod
2525
- npm run build:style
26-
- if [ -z "${TRAVIS_TAG}" ]; then npm run test:lib:perf; fi
26+
# - if [ -z "${TRAVIS_TAG}" ]; then npm run test:lib:perf; fi
2727
- if [ -z "${TRAVIS_TAG}" ]; then npm run test:lib:others; fi
2828
- if [ -z "${TRAVIS_TAG}" ]; then npm run test:lib:grid; fi
2929
- if [ -z "${TRAVIS_TAG}" ]; then npm run test:lib:tgrid; fi

projects/igniteui-angular/src/lib/combo/combo-dropdown.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { IgxDropDownComponent } from '../drop-down/drop-down.component';
77
import { DropDownActionKey } from '../drop-down/drop-down.common';
88
import { IgxComboAddItemComponent } from './combo-add-item.component';
99
import { IgxComboAPIService } from './combo.api';
10-
import { IgxDropDownItemBase } from '../drop-down/drop-down-item.base';
10+
import { IgxDropDownItemBaseDirective } from '../drop-down/drop-down-item.base';
1111
import { IgxSelectionAPIService } from '../core/selection';
1212
import { IgxComboItemComponent } from './combo-item.component';
1313
import { DisplayDensityToken, IDisplayDensityOptions } from '../core/density';
@@ -50,7 +50,7 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
5050
* @internal
5151
*/
5252
@ContentChildren(IgxComboItemComponent, { descendants: true })
53-
public children: QueryList<IgxDropDownItemBase> = null;
53+
public children: QueryList<IgxDropDownItemBaseDirective> = null;
5454

5555
/**
5656
* @hidden @internal
@@ -107,7 +107,7 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
107107
/**
108108
* @hidden @internal
109109
*/
110-
public selectItem(item: IgxDropDownItemBase) {
110+
public selectItem(item: IgxDropDownItemBaseDirective) {
111111
if (item === null || item === undefined) {
112112
return;
113113
}
@@ -127,10 +127,10 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
127127
this.comboAPI.disableTransitions = true;
128128
}
129129

130-
protected get sortedChildren(): IgxDropDownItemBase[] {
130+
protected get sortedChildren(): IgxDropDownItemBaseDirective[] {
131131
if (this.children !== undefined) {
132132
return this.children.toArray()
133-
.sort((a: IgxDropDownItemBase, b: IgxDropDownItemBase) => {
133+
.sort((a: IgxDropDownItemBaseDirective, b: IgxDropDownItemBaseDirective) => {
134134
return a.index - b.index;
135135
});
136136
}

projects/igniteui-angular/src/lib/combo/combo.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { take } from 'rxjs/operators';
1414
import { UIInteractions, wait } from '../test-utils/ui-interactions.spec';
1515
import { DefaultSortingStrategy } from '../data-operations/sorting-strategy';
1616
import { configureTestSuite } from '../test-utils/configure-suite';
17-
import { IgxDropDownItemBase } from '../drop-down/drop-down-item.base';
17+
import { IgxDropDownItemBaseDirective } from '../drop-down/drop-down-item.base';
1818
import { DisplayDensity, DisplayDensityToken } from '../core/density';
1919
import { AbsoluteScrollStrategy, ConnectedPositioningStrategy } from '../services/index';
2020
import { IgxInputState } from '../directives/input/input.directive';
@@ -1009,8 +1009,8 @@ describe('igxCombo', () => {
10091009
expect(combo.collapsed).toEqual(false);
10101010
expect(combo.dropdown.items.length).toEqual(9); // Virtualization
10111011

1012-
let targetItem: IgxDropDownItemBase;
1013-
targetItem = combo.dropdown.items[5] as IgxDropDownItemBase;
1012+
let targetItem: IgxDropDownItemBaseDirective;
1013+
targetItem = combo.dropdown.items[5] as IgxDropDownItemBaseDirective;
10141014
expect(targetItem).toBeDefined();
10151015
expect(targetItem.itemIndex).toEqual(5);
10161016

projects/igniteui-angular/src/lib/drop-down/drop-down-item.base.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let warningShown = false;
1717
@Directive({
1818
selector: '[igxDropDownItemBase]'
1919
})
20-
export class IgxDropDownItemBase implements DoCheck {
20+
export class IgxDropDownItemBaseDirective implements DoCheck {
2121
/**
2222
* @hidden
2323
*/
@@ -62,7 +62,7 @@ export class IgxDropDownItemBase implements DoCheck {
6262
public get index(): number {
6363
if (this._index === null) {
6464
warningShown = showMessage(
65-
'IgxDropDownItemBase: Automatic index is deprecated.' +
65+
'IgxDropDownItemBaseDirective: Automatic index is deprecated.' +
6666
'Bind in the template instead using `<igx-drop-down-item [index]="i"` instead.`',
6767
warningShown);
6868
return this.itemIndex;
@@ -156,7 +156,7 @@ export class IgxDropDownItemBase implements DoCheck {
156156
* @hidden @internal
157157
*/
158158
@Input()
159-
@DeprecateProperty(`IgxDropDownItemBase \`isSelected\` property is deprecated.\n` +
159+
@DeprecateProperty(`IgxDropDownItemBaseDirective \`isSelected\` property is deprecated.\n` +
160160
`Use \`selected\` instead.`)
161161
get isSelected(): boolean {
162162
return this.selected;
@@ -197,7 +197,7 @@ export class IgxDropDownItemBase implements DoCheck {
197197
/**
198198
* @hidden @internal
199199
*/
200-
@DeprecateProperty(`IgxDropDownItemBase \`isFocused\` property is depracated.\n` +
200+
@DeprecateProperty(`IgxDropDownItemBaseDirective \`isFocused\` property is depracated.\n` +
201201
`Use \`focused\` instead.`)
202202
get isFocused(): boolean {
203203
return this.focused;

projects/igniteui-angular/src/lib/drop-down/drop-down-item.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
HostListener,
44
HostBinding
55
} from '@angular/core';
6-
import { IgxDropDownItemBase } from './drop-down-item.base';
6+
import { IgxDropDownItemBaseDirective } from './drop-down-item.base';
77

88
/**
99
* The `<igx-drop-down-item>` is a container intended for row items in
@@ -13,7 +13,7 @@ import { IgxDropDownItemBase } from './drop-down-item.base';
1313
selector: 'igx-drop-down-item',
1414
templateUrl: 'drop-down-item.component.html'
1515
})
16-
export class IgxDropDownItemComponent extends IgxDropDownItemBase {
16+
export class IgxDropDownItemComponent extends IgxDropDownItemBaseDirective {
1717
/**
1818
* @inheritdoc
1919
*/

projects/igniteui-angular/src/lib/drop-down/drop-down-navigation.directive.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { Directive, Optional, Self, Input, HostListener, Inject } from '@angular/core';
22
import { IGX_DROPDOWN_BASE } from './drop-down.common';
33
import { IDropDownNavigationDirective } from './drop-down.common';
4-
import { IgxDropDownBase } from './drop-down.base';
4+
import { IgxDropDownBaseDirective } from './drop-down.base';
55
import { DropDownActionKey } from './drop-down.common';
66

77
/**
8-
* Navigation Directive that handles keyboard events on its host and controls a targeted IgxDropDownBase component
8+
* Navigation Directive that handles keyboard events on its host and controls a targeted IgxDropDownBaseDirective component
99
*/
1010
@Directive({
1111
selector: '[igxDropDownItemNavigation]'
1212
})
1313
export class IgxDropDownItemNavigationDirective implements IDropDownNavigationDirective {
1414

15-
protected _target: IgxDropDownBase = null;
15+
protected _target: IgxDropDownBaseDirective = null;
1616

17-
constructor(@Self() @Optional() @Inject(IGX_DROPDOWN_BASE) public dropdown: IgxDropDownBase) { }
17+
constructor(@Self() @Optional() @Inject(IGX_DROPDOWN_BASE) public dropdown: IgxDropDownBaseDirective) { }
1818

1919
/**
2020
* Gets the target of the navigation directive;
@@ -26,11 +26,11 @@ export class IgxDropDownItemNavigationDirective implements IDropDownNavigationDi
2626
* @ContentChild(IgxDropDownNavigationDirective)
2727
* navDirective: IgxDropDownNavigationDirective = null
2828
* ...
29-
* const navTarget: IgxDropDownBase = navDirective.navTarget
29+
* const navTarget: IgxDropDownBaseDirective = navDirective.navTarget
3030
* }
3131
* ```
3232
*/
33-
get target(): IgxDropDownBase {
33+
get target(): IgxDropDownBaseDirective {
3434
return this._target;
3535
}
3636

@@ -48,7 +48,7 @@ export class IgxDropDownItemNavigationDirective implements IDropDownNavigationDi
4848
* ```
4949
*/
5050
@Input('igxDropDownItemNavigation')
51-
set target(target: IgxDropDownBase) {
51+
set target(target: IgxDropDownBaseDirective) {
5252
this._target = target ? target : this.dropdown;
5353
}
5454

projects/igniteui-angular/src/lib/drop-down/drop-down.base.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ import {
55
import { Navigate, ISelectionEventArgs } from './drop-down.common';
66
import { IDropDownList } from './drop-down.common';
77
import { DropDownActionKey } from './drop-down.common';
8-
import { IgxDropDownItemBase } from './drop-down-item.base';
8+
import { IgxDropDownItemBaseDirective } from './drop-down-item.base';
99
import { DisplayDensityBase, DisplayDensityToken, IDisplayDensityOptions } from '../core/density';
1010

1111
let NEXT_ID = 0;
1212

1313
/**
1414
* An abstract class, defining a drop-down component, with:
1515
* Properties for display styles and classes
16-
* A collection items of type `IgxDropDownItemBase`
16+
* A collection items of type `IgxDropDownItemBaseDirective`
1717
* Properties and methods for navigating (highlighting/focusing) items from the collection
1818
* Properties and methods for selecting items from the collection
1919
*/
2020
@Directive({
2121
selector: '[igxDropDownBase]'
2222
})
23-
export class IgxDropDownBase extends DisplayDensityBase implements IDropDownList {
23+
export class IgxDropDownBaseDirective extends DisplayDensityBase implements IDropDownList {
2424
protected _width;
2525
protected _height;
2626
protected _focusedItem: any = null;
@@ -37,7 +37,7 @@ export class IgxDropDownBase extends DisplayDensityBase implements IDropDownList
3737
* @hidden
3838
* @internal
3939
*/
40-
public children: QueryList<IgxDropDownItemBase>;
40+
public children: QueryList<IgxDropDownItemBaseDirective>;
4141

4242
/**
4343
* Emitted when item selection is changing, before the selection completes
@@ -123,8 +123,8 @@ export class IgxDropDownBase extends DisplayDensityBase implements IDropDownList
123123
* let myDropDownItems = this.dropdown.items;
124124
* ```
125125
*/
126-
public get items(): IgxDropDownItemBase[] {
127-
const items: IgxDropDownItemBase[] = [];
126+
public get items(): IgxDropDownItemBaseDirective[] {
127+
const items: IgxDropDownItemBaseDirective[] = [];
128128
if (this.children !== undefined) {
129129
for (const child of this.children.toArray()) {
130130
if (!child.isHeader) {
@@ -143,8 +143,8 @@ export class IgxDropDownBase extends DisplayDensityBase implements IDropDownList
143143
* let myDropDownHeaderItems = this.dropdown.headers;
144144
* ```
145145
*/
146-
public get headers(): IgxDropDownItemBase[] {
147-
const headers: IgxDropDownItemBase[] = [];
146+
public get headers(): IgxDropDownItemBaseDirective[] {
147+
const headers: IgxDropDownItemBaseDirective[] = [];
148148
if (this.children !== undefined) {
149149
for (const child of this.children.toArray()) {
150150
if (child.isHeader) {
@@ -196,7 +196,7 @@ export class IgxDropDownBase extends DisplayDensityBase implements IDropDownList
196196
* @param newSelection the item selected
197197
* @param event the event that triggered the call
198198
*/
199-
public selectItem(newSelection?: IgxDropDownItemBase, event?: Event) {
199+
public selectItem(newSelection?: IgxDropDownItemBaseDirective, event?: Event) {
200200
this.onSelection.emit({
201201
newSelection,
202202
oldSelection: null,
@@ -207,14 +207,14 @@ export class IgxDropDownBase extends DisplayDensityBase implements IDropDownList
207207
/**
208208
* @hidden @internal
209209
*/
210-
public get focusedItem(): IgxDropDownItemBase {
210+
public get focusedItem(): IgxDropDownItemBaseDirective {
211211
return this._focusedItem;
212212
}
213213

214214
/**
215215
* @hidden @internal
216216
*/
217-
public set focusedItem(item: IgxDropDownItemBase) {
217+
public set focusedItem(item: IgxDropDownItemBaseDirective) {
218218
this._focusedItem = item;
219219
}
220220

@@ -287,7 +287,7 @@ export class IgxDropDownBase extends DisplayDensityBase implements IDropDownList
287287
this.navigate(Navigate.Up);
288288
}
289289

290-
protected scrollToHiddenItem(newItem: IgxDropDownItemBase) {
290+
protected scrollToHiddenItem(newItem: IgxDropDownItemBaseDirective) {
291291
const elementRect = newItem.element.nativeElement.getBoundingClientRect();
292292
const parentRect = this.scrollContainer.getBoundingClientRect();
293293
if (parentRect.top > elementRect.top) {

projects/igniteui-angular/src/lib/drop-down/drop-down.common.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CancelableEventArgs, CancelableBrowserEventArgs, IBaseEventArgs } from '../core/utils';
2-
import { IgxDropDownItemBase } from './drop-down-item.base';
2+
import { IgxDropDownItemBaseDirective } from './drop-down-item.base';
33
import { IToggleView } from '../core/navigation/IToggleView';
44
import { EventEmitter, InjectionToken } from '@angular/core';
55
import { DisplayDensityBase } from '../core/density';
@@ -22,8 +22,8 @@ export enum DropDownActionKey {
2222
* @export
2323
*/
2424
export interface ISelectionEventArgs extends CancelableEventArgs, IBaseEventArgs {
25-
oldSelection: IgxDropDownItemBase;
26-
newSelection: IgxDropDownItemBase;
25+
oldSelection: IgxDropDownItemBaseDirective;
26+
newSelection: IgxDropDownItemBaseDirective;
2727
}
2828

2929
/**
@@ -51,9 +51,9 @@ export interface IDropDownList extends DisplayDensityBase {
5151
id: string;
5252
maxHeight: string;
5353
collapsed: boolean;
54-
items: IgxDropDownItemBase[];
55-
headers: IgxDropDownItemBase[];
56-
focusedItem: IgxDropDownItemBase;
54+
items: IgxDropDownItemBaseDirective[];
55+
headers: IgxDropDownItemBaseDirective[];
56+
focusedItem: IgxDropDownItemBaseDirective;
5757
navigateFirst(): void;
5858
navigateLast(): void;
5959
navigateNext(): void;
@@ -73,6 +73,6 @@ export interface IDropDownBase extends IDropDownList, IToggleView {
7373
onClosed: EventEmitter<void>;
7474
allowItemsFocus?: boolean;
7575
setSelectedItem(index: number): void;
76-
selectItem(item: IgxDropDownItemBase, event?: Event): void;
76+
selectItem(item: IgxDropDownItemBaseDirective, event?: Event): void;
7777
}
7878

projects/igniteui-angular/src/lib/drop-down/drop-down.component.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { configureTestSuite } from '../test-utils/configure-suite';
1313
import { take } from 'rxjs/operators';
1414
import { IgxDropDownGroupComponent } from './drop-down-group.component';
1515
import { IgxForOfDirective, IgxForOfModule } from '../directives/for-of/for_of.directive';
16-
import { IgxDropDownItemBase } from './drop-down-item.base';
16+
import { IgxDropDownItemBaseDirective } from './drop-down-item.base';
1717
import { DisplayDensityToken, DisplayDensity } from '../core/density';
1818

1919
const CSS_CLASS_FOCUSED = 'igx-drop-down__item--focused';
@@ -1398,7 +1398,7 @@ describe('IgxDropDown ', () => {
13981398
it('Should properly preserve selection when scrolled', (done) => {
13991399
dropdown.toggle();
14001400
expect(dropdown.selectedItem).toBe(null);
1401-
dropdown.selectItem({ value: fixture.componentInstance.items[5], index: 5 } as IgxDropDownItemBase);
1401+
dropdown.selectItem({ value: fixture.componentInstance.items[5], index: 5 } as IgxDropDownItemBaseDirective);
14021402
fixture.detectChanges();
14031403
expect(dropdown.selectedItem as any).toEqual({ value: fixture.componentInstance.items[5], index: 5 });
14041404
expect(items.toArray()[5].selected).toEqual(true);
@@ -1419,12 +1419,12 @@ describe('IgxDropDown ', () => {
14191419
it('Should properly select items both inside and outside of the virtual view', (done) => {
14201420
dropdown.toggle();
14211421
expect(dropdown.selectedItem).toBe(null);
1422-
let selectedItem = { value: fixture.componentInstance.items[5], index: 5 } as IgxDropDownItemBase;
1422+
let selectedItem = { value: fixture.componentInstance.items[5], index: 5 } as IgxDropDownItemBaseDirective;
14231423
dropdown.selectItem(selectedItem);
14241424
fixture.detectChanges();
14251425
expect(dropdown.selectedItem as any).toEqual(selectedItem);
14261426
expect(items.toArray()[5].selected).toEqual(true);
1427-
selectedItem = { value: fixture.componentInstance.items[412], index: 412 } as IgxDropDownItemBase;
1427+
selectedItem = { value: fixture.componentInstance.items[412], index: 412 } as IgxDropDownItemBaseDirective;
14281428
dropdown.selectItem(selectedItem);
14291429
fixture.detectChanges();
14301430
expect(dropdown.selectedItem as any).toEqual(selectedItem);
@@ -1442,7 +1442,7 @@ describe('IgxDropDown ', () => {
14421442
dropdown.toggle();
14431443
expect(dropdown.selectedItem).toBe(null);
14441444
const virtualScroll = fixture.componentInstance.virtualScroll;
1445-
const selectedItem = { value: fixture.componentInstance.items[1000], index: 1000 } as IgxDropDownItemBase;
1445+
const selectedItem = { value: fixture.componentInstance.items[1000], index: 1000 } as IgxDropDownItemBaseDirective;
14461446
dropdown.selectItem(selectedItem);
14471447
fixture.detectChanges();
14481448
dropdown.toggle();

0 commit comments

Comments
 (0)