chore: update tslint rules (#7391)

This commit is contained in:
Manol Donev
2019-06-26 15:13:48 +03:00
committed by GitHub
parent 92370279d8
commit 4f39fb728b
399 changed files with 3101 additions and 2210 deletions

View File

@@ -1,4 +1,4 @@
import { ListPickerBase, Color, selectedIndexProperty, itemsProperty, backgroundColorProperty, colorProperty } from "./list-picker-common";
import { ListPickerBase, Color, selectedIndexProperty, itemsProperty, backgroundColorProperty, colorProperty } from "./list-picker-common";
import { ItemsSource } from ".";
import { profile } from "../../profiling";
@@ -6,7 +6,7 @@ export * from "./list-picker-common";
export class ListPicker extends ListPickerBase {
nativeViewProtected: UIPickerView;
// tslint:disable-next-line
// tslint:disable-next-line
private _dataSource: ListPickerDataSource;
private _delegate: ListPickerDelegateImpl;
@@ -84,6 +84,7 @@ class ListPickerDataSource extends NSObject implements UIPickerViewDataSource {
public static initWithOwner(owner: WeakRef<ListPicker>): ListPickerDataSource {
let dataSource = <ListPickerDataSource>ListPickerDataSource.new();
dataSource._owner = owner;
return dataSource;
}
@@ -93,6 +94,7 @@ class ListPickerDataSource extends NSObject implements UIPickerViewDataSource {
public pickerViewNumberOfRowsInComponent(pickerView: UIPickerView, component: number) {
let owner = this._owner.get();
return (owner && owner.items) ? owner.items.length : 0;
}
}
@@ -105,6 +107,7 @@ class ListPickerDelegateImpl extends NSObject implements UIPickerViewDelegate {
public static initWithOwner(owner: WeakRef<ListPicker>): ListPickerDelegateImpl {
let delegate = <ListPickerDelegateImpl>ListPickerDelegateImpl.new();
delegate._owner = owner;
return delegate;
}
@@ -112,8 +115,10 @@ class ListPickerDelegateImpl extends NSObject implements UIPickerViewDelegate {
let owner = this._owner.get();
if (owner) {
let title = NSAttributedString.alloc().initWithStringAttributes(owner._getItemAsString(row), <any>{ [NSForegroundColorAttributeName]: pickerView.tintColor });
return title;
}
return NSAttributedString.alloc().initWithStringAttributes(row.toString(), <any>{ [NSForegroundColorAttributeName]: pickerView.tintColor });
}