fix eslint warnigs for core project (#7506)

This commit is contained in:
Denys Vuika
2022-02-17 14:35:33 +00:00
committed by GitHub
parent 5b7f255eec
commit bca5a783ab
246 changed files with 5127 additions and 5065 deletions

View File

@@ -21,13 +21,13 @@ export const searchAnimation: AnimationTriggerMetadata = trigger('transitionMess
state('active', style({
'margin-left': '{{ margin-left }}px',
'margin-right': '{{ margin-right }}px',
'transform': '{{ transform }}'
}), { params: { 'margin-left': 0, 'margin-right': 0, 'transform': 'translateX(0%)' } }),
transform: '{{ transform }}'
}), { params: { 'margin-left': 0, 'margin-right': 0, transform: 'translateX(0%)' } }),
state('inactive', style({
'margin-left': '{{ margin-left }}px',
'margin-right': '{{ margin-right }}px',
'transform': '{{ transform }}'
}), { params: { 'margin-left': 0, 'margin-right': 0, 'transform': 'translateX(0%)' } }),
transform: '{{ transform }}'
}), { params: { 'margin-left': 0, 'margin-right': 0, transform: 'translateX(0%)' } }),
state('no-animation', style({ transform: 'translateX(0%)', width: '100%' })),
transition('active <=> inactive', animate('400ms cubic-bezier(0.25, 0.8, 0.25, 1)'))
]);

View File

@@ -216,7 +216,7 @@ describe('SearchTextInputComponent', () => {
fixture.detectChanges();
tick(100);
expect(component.subscriptAnimationState.params).toEqual({ 'transform': 'translateX(82%)' });
expect(component.subscriptAnimationState.params).toEqual({ transform: 'translateX(82%)' });
discardPeriodicTasks();
}));
@@ -247,7 +247,7 @@ describe('SearchTextInputComponent', () => {
fixture.detectChanges();
tick(100);
expect(component.subscriptAnimationState.params).toEqual({ 'transform': 'translateX(-82%)' });
expect(component.subscriptAnimationState.params).toEqual({ transform: 'translateX(-82%)' });
discardPeriodicTasks();
}));

View File

@@ -30,7 +30,7 @@ import { SearchTextStateEnum, SearchAnimationState, SearchAnimationDirection } f
animations: [searchAnimation],
encapsulation: ViewEncapsulation.None,
host: {
'class': 'adf-search-text-input'
class: 'adf-search-text-input'
}
})
export class SearchTextInputComponent implements OnInit, OnDestroy {
@@ -127,11 +127,11 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
animationStates: SearchAnimationDirection = {
ltr : {
active: { value: 'active', params: { 'margin-left': 13 } },
inactive: { value: 'inactive', params: { 'transform': 'translateX(82%)' } }
inactive: { value: 'inactive', params: { transform: 'translateX(82%)' } }
},
rtl: {
active: { value: 'active', params: { 'margin-right': 13 } },
inactive: { value: 'inactive', params: { 'transform': 'translateX(-82%)' } }
inactive: { value: 'inactive', params: { transform: 'translateX(-82%)' } }
}
};
@@ -141,7 +141,7 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
private focusSubscription: Subscription;
private valueChange = new Subject<string>();
constructor (
constructor(
private userPreferencesService: UserPreferencesService
) {
this.toggleSearch
@@ -192,11 +192,11 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
if (this.dir === 'ltr') {
return this.subscriptAnimationState.value === 'inactive' ?
{ value: 'active', params: { 'margin-left': 13 } } :
{ value: 'inactive', params: { 'transform': 'translateX(82%)' } };
{ value: 'inactive', params: { transform: 'translateX(82%)' } };
} else {
return this.subscriptAnimationState.value === 'inactive' ?
{ value: 'active', params: { 'margin-right': 13 } } :
{ value: 'inactive', params: { 'transform': 'translateX(-82%)' } };
{ value: 'inactive', params: { transform: 'translateX(-82%)' } };
}
}
@@ -222,9 +222,7 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
const focusEvents: Observable<FocusEvent> = this.focusListener
.pipe(
debounceTime(50),
filter(($event: any) => {
return this.isSearchBarActive() && ($event.type === 'blur' || $event.type === 'focusout' || $event.type === 'focus');
}),
filter(($event: any) => this.isSearchBarActive() && ($event.type === 'blur' || $event.type === 'focusout' || $event.type === 'focus')),
takeUntil(this.onDestroy$)
);

View File

@@ -48,7 +48,7 @@ export const SEARCH_AUTOCOMPLETE_VALUE_ACCESSOR: any = {
// eslint-disable-next-line @angular-eslint/directive-selector
selector: `input[searchAutocomplete], textarea[searchAutocomplete]`,
host: {
'role': 'combobox',
role: 'combobox',
'[attr.autocomplete]': 'autocomplete',
'aria-autocomplete': 'list',
'[attr.aria-expanded]': 'panelOpen.toString()',