mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 01:25:37 -05:00
Add more folders to strict compile (#8954)
* add more folders to strictire compile, add more strict compile options * update ci * remove unnecessary assertion
This commit is contained in:
@@ -15,14 +15,14 @@ import { Checkbox as sqlCheckbox } from 'sql/base/browser/ui/checkbox/checkbox';
|
||||
template: ''
|
||||
})
|
||||
export class Checkbox implements OnInit, OnChanges {
|
||||
@Input() label: string;
|
||||
@Input() label!: string;
|
||||
@Input() enabled = true;
|
||||
@Input() checked = true;
|
||||
@Input('aria-label') private ariaLabel: string;
|
||||
@Input('aria-label') private ariaLabel?: string;
|
||||
|
||||
@Output() onChange = new EventEmitter<boolean>();
|
||||
|
||||
private _checkbox: sqlCheckbox;
|
||||
private _checkbox?: sqlCheckbox;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef
|
||||
|
||||
@@ -31,7 +31,7 @@ export class InputBox extends vsInputBox {
|
||||
private _onLoseFocus = this._register(new Emitter<OnLoseFocusParams>());
|
||||
public onLoseFocus: Event<OnLoseFocusParams> = this._onLoseFocus.event;
|
||||
|
||||
private _isTextAreaInput: boolean;
|
||||
private _isTextAreaInput = false;
|
||||
private _hideErrors = false;
|
||||
|
||||
constructor(container: HTMLElement, contextViewProvider: IContextViewProvider, options?: IInputOptions) {
|
||||
|
||||
@@ -60,11 +60,11 @@ export class ListBox extends SelectBox {
|
||||
this.contextViewProvider = contextViewProvider;
|
||||
this.isValid = true;
|
||||
this.selectElement.multiple = true;
|
||||
this.selectElement.style['height'] = '80px';
|
||||
this.selectElement.style.height = '80px';
|
||||
|
||||
// Set width style for horizontal scrollbar
|
||||
this.selectElement.style['width'] = 'inherit';
|
||||
this.selectElement.style['min-width'] = '100%';
|
||||
this.selectElement.style.width = 'inherit';
|
||||
this.selectElement.style.minWidth = '100%';
|
||||
|
||||
this._register(dom.addStandardDisposableListener(this.selectElement, dom.EventType.KEY_DOWN, (e: StandardKeyboardEvent) => this._onKeyDown.fire(e)));
|
||||
|
||||
|
||||
@@ -68,30 +68,29 @@ let idPool = 0;
|
||||
`
|
||||
})
|
||||
export class PanelComponent extends Disposable {
|
||||
@Input() public options: IPanelOptions;
|
||||
@Input() public actions: Array<Action>;
|
||||
@ContentChildren(TabComponent) private _tabs: QueryList<TabComponent>;
|
||||
@ViewChild(ScrollableDirective) private scrollable: ScrollableDirective;
|
||||
@Input() public options?: IPanelOptions;
|
||||
@Input() public actions?: Array<Action>;
|
||||
@ContentChildren(TabComponent) private readonly _tabs!: QueryList<TabComponent>;
|
||||
@ViewChild(ScrollableDirective) private scrollable?: ScrollableDirective;
|
||||
|
||||
@Output() public onTabChange = new EventEmitter<TabComponent>();
|
||||
@Output() public onTabClose = new EventEmitter<TabComponent>();
|
||||
|
||||
private _activeTab: TabComponent;
|
||||
private _actionbar: ActionBar;
|
||||
private _mru: TabComponent[];
|
||||
private _activeTab?: TabComponent;
|
||||
private _actionbar?: ActionBar;
|
||||
private _mru: TabComponent[] = [];
|
||||
|
||||
protected AutoScrollbarVisibility = ScrollbarVisibility.Auto; // used by angular template
|
||||
protected HiddenScrollbarVisibility = ScrollbarVisibility.Hidden; // used by angular template
|
||||
protected NavigationBarLayout = NavigationBarLayout; // used by angular template
|
||||
|
||||
@ViewChild('panelActionbar', { read: ElementRef }) private _actionbarRef: ElementRef;
|
||||
@ViewChild('panelActionbar', { read: ElementRef }) private _actionbarRef!: ElementRef;
|
||||
constructor(@Inject(forwardRef(() => NgZone)) private _zone: NgZone) {
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.options = mixin(this.options || {}, defaultOptions, false);
|
||||
this._mru = [];
|
||||
}
|
||||
|
||||
ngAfterContentInit(): void {
|
||||
@@ -195,8 +194,8 @@ export class PanelComponent extends Disposable {
|
||||
/**
|
||||
* Get the id of the active tab
|
||||
*/
|
||||
public get getActiveTab(): string {
|
||||
return this._activeTab.identifier;
|
||||
public get getActiveTab(): string | undefined {
|
||||
return this._activeTab?.identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,6 +243,6 @@ export class PanelComponent extends Disposable {
|
||||
}
|
||||
|
||||
public layout() {
|
||||
this._activeTab.layout();
|
||||
this._activeTab?.layout();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ export class TabbedPanel extends Disposable {
|
||||
private body: HTMLElement;
|
||||
private parent: HTMLElement;
|
||||
private _actionbar: ActionBar;
|
||||
private _currentDimensions: DOM.Dimension;
|
||||
private _currentDimensions?: DOM.Dimension;
|
||||
private _collapsed = false;
|
||||
private _headerVisible: boolean;
|
||||
private _styleElement: HTMLStyleElement;
|
||||
@@ -130,7 +130,9 @@ export class TabbedPanel extends Disposable {
|
||||
if (this._tabMap.size > 1 && !this._headerVisible) {
|
||||
this.parent.insertBefore(this.header, this.parent.firstChild);
|
||||
this._headerVisible = true;
|
||||
this.layout(this._currentDimensions);
|
||||
if (this._currentDimensions) {
|
||||
this.layout(this._currentDimensions);
|
||||
}
|
||||
}
|
||||
return tab.identifier as PanelTabIdentifier;
|
||||
}
|
||||
@@ -287,7 +289,9 @@ export class TabbedPanel extends Disposable {
|
||||
if (!this.options.showHeaderWhenSingleView && this._tabMap.size === 1 && this._headerVisible) {
|
||||
this.header.remove();
|
||||
this._headerVisible = false;
|
||||
this.layout(this._currentDimensions);
|
||||
if (this._currentDimensions) {
|
||||
this.layout(this._currentDimensions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,14 +21,14 @@ export abstract class TabChild extends Disposable {
|
||||
`
|
||||
})
|
||||
export class TabComponent implements OnDestroy {
|
||||
private _child: TabChild;
|
||||
@ContentChild(TemplateRef) templateRef: TemplateRef<any>;
|
||||
@Input() public title: string;
|
||||
@Input() public canClose: boolean;
|
||||
@Input() public actions: Array<Action>;
|
||||
@Input() public iconClass: string;
|
||||
private _child?: TabChild;
|
||||
@ContentChild(TemplateRef) templateRef!: TemplateRef<any>;
|
||||
@Input() public title!: string;
|
||||
@Input() public canClose!: boolean;
|
||||
@Input() public actions?: Array<Action>;
|
||||
@Input() public iconClass?: string;
|
||||
public _active = false;
|
||||
@Input() public identifier: string;
|
||||
@Input() public identifier!: string;
|
||||
@Input() private visibilityType: 'if' | 'visibility' = 'if';
|
||||
private rendered = false;
|
||||
private destroyed: boolean = false;
|
||||
|
||||
@@ -29,17 +29,17 @@ import { CloseTabAction } from 'sql/base/browser/ui/panel/tabActions';
|
||||
`
|
||||
})
|
||||
export class TabHeaderComponent extends Disposable implements AfterContentInit, OnDestroy {
|
||||
@Input() public tab: TabComponent;
|
||||
@Input() public showIcon: boolean;
|
||||
@Input() public active: boolean;
|
||||
@Input() public tab!: TabComponent;
|
||||
@Input() public showIcon?: boolean;
|
||||
@Input() public active?: boolean;
|
||||
@Output() public onSelectTab: EventEmitter<TabComponent> = new EventEmitter<TabComponent>();
|
||||
@Output() public onCloseTab: EventEmitter<TabComponent> = new EventEmitter<TabComponent>();
|
||||
|
||||
private _actionbar: ActionBar;
|
||||
private _actionbar!: ActionBar;
|
||||
|
||||
@ViewChild('actionHeader', { read: ElementRef }) private _actionHeaderRef: ElementRef;
|
||||
@ViewChild('actionbar', { read: ElementRef }) private _actionbarRef: ElementRef;
|
||||
@ViewChild('tabLabel', { read: ElementRef }) private _tabLabelRef: ElementRef;
|
||||
@ViewChild('actionHeader', { read: ElementRef }) private _actionHeaderRef!: ElementRef;
|
||||
@ViewChild('actionbar', { read: ElementRef }) private _actionbarRef!: ElementRef;
|
||||
@ViewChild('tabLabel', { read: ElementRef }) private _tabLabelRef!: ElementRef;
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ import { AngularDisposable } from 'sql/base/browser/lifecycle';
|
||||
selector: '[scrollable]'
|
||||
})
|
||||
export class ScrollableDirective extends AngularDisposable {
|
||||
private scrollableElement: ScrollableElement;
|
||||
private parent: HTMLElement;
|
||||
private scrolled: HTMLElement;
|
||||
@Input() horizontalScroll: ScrollbarVisibility;
|
||||
@Input() verticalScroll: ScrollbarVisibility;
|
||||
private scrollableElement!: ScrollableElement;
|
||||
private parent!: HTMLElement;
|
||||
private scrolled!: HTMLElement;
|
||||
@Input() horizontalScroll?: ScrollbarVisibility;
|
||||
@Input() verticalScroll?: ScrollbarVisibility;
|
||||
@Input() useShadow = false;
|
||||
@Input() scrollYToX = false;
|
||||
|
||||
|
||||
@@ -121,12 +121,12 @@ export class ScrollableSplitView extends HeightMap implements IDisposable {
|
||||
private proportions: undefined | number[] = undefined;
|
||||
private viewItems: IViewItem[] = [];
|
||||
private sashItems: ISashItem[] = [];
|
||||
private sashDragState: ISashDragState;
|
||||
private sashDragState?: ISashDragState;
|
||||
private state: State = State.Idle;
|
||||
private inverseAltBehavior: boolean;
|
||||
|
||||
private lastRenderHeight: number;
|
||||
private lastRenderTop: number;
|
||||
private lastRenderHeight?: number;
|
||||
private lastRenderTop?: number;
|
||||
|
||||
private options: ISplitViewOptions;
|
||||
|
||||
@@ -317,8 +317,8 @@ export class ScrollableSplitView extends HeightMap implements IDisposable {
|
||||
|
||||
// Re-render the views. Set lastRenderTop and lastRenderHeight to undefined since
|
||||
// this isn't actually scrolling up or down
|
||||
let scrollTop = this.lastRenderTop;
|
||||
let viewHeight = this.lastRenderHeight;
|
||||
let scrollTop = this.lastRenderTop!;
|
||||
let viewHeight = this.lastRenderHeight!;
|
||||
this.lastRenderTop = 0;
|
||||
this.lastRenderHeight = 0;
|
||||
this.render(scrollTop, viewHeight);
|
||||
@@ -528,8 +528,8 @@ export class ScrollableSplitView extends HeightMap implements IDisposable {
|
||||
|
||||
// This way, we can press Alt while we resize a sash, macOS style!
|
||||
const disposable = combinedDisposable(
|
||||
domEvent(document.body, 'keydown')(e => resetSashDragState(this.sashDragState.current, e.altKey)),
|
||||
domEvent(document.body, 'keyup')(() => resetSashDragState(this.sashDragState.current, false))
|
||||
domEvent(document.body, 'keydown')(e => resetSashDragState(this.sashDragState!.current, e.altKey)),
|
||||
domEvent(document.body, 'keyup')(() => resetSashDragState(this.sashDragState!.current, false))
|
||||
);
|
||||
|
||||
const resetSashDragState = (start: number, alt: boolean) => {
|
||||
@@ -565,8 +565,8 @@ export class ScrollableSplitView extends HeightMap implements IDisposable {
|
||||
}
|
||||
|
||||
private onSashChange({ current }: ISashEvent): void {
|
||||
const { index, start, sizes, alt, minDelta, maxDelta } = this.sashDragState;
|
||||
this.sashDragState.current = current;
|
||||
const { index, start, sizes, alt, minDelta, maxDelta } = this.sashDragState!;
|
||||
this.sashDragState!.current = current;
|
||||
|
||||
const delta = current - start;
|
||||
const newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta);
|
||||
@@ -589,7 +589,7 @@ export class ScrollableSplitView extends HeightMap implements IDisposable {
|
||||
|
||||
private onSashEnd(index: number): void {
|
||||
this._onDidSashChange.fire(index);
|
||||
this.sashDragState.disposable.dispose();
|
||||
this.sashDragState!.disposable.dispose();
|
||||
this.saveProportions();
|
||||
}
|
||||
|
||||
@@ -686,7 +686,7 @@ export class ScrollableSplitView extends HeightMap implements IDisposable {
|
||||
|
||||
let renderTop = scrollTop;
|
||||
let renderBottom = scrollTop + viewHeight;
|
||||
let thisRenderBottom = this.lastRenderTop + this.lastRenderHeight;
|
||||
let thisRenderBottom = this.lastRenderTop! + this.lastRenderHeight!;
|
||||
|
||||
// when view scrolls down, start rendering from the renderBottom
|
||||
for (i = this.indexAfter(renderBottom) - 1, stop = this.indexAt(Math.max(thisRenderBottom, renderTop)); i >= stop; i--) {
|
||||
@@ -696,21 +696,21 @@ export class ScrollableSplitView extends HeightMap implements IDisposable {
|
||||
}
|
||||
|
||||
// when view scrolls up, start rendering from either this.renderTop or renderBottom
|
||||
for (i = Math.min(this.indexAt(this.lastRenderTop), this.indexAfter(renderBottom)) - 1, stop = this.indexAt(renderTop); i >= stop; i--) {
|
||||
for (i = Math.min(this.indexAt(this.lastRenderTop!), this.indexAfter(renderBottom)) - 1, stop = this.indexAt(renderTop); i >= stop; i--) {
|
||||
if (this.insertItemInDOM(<IViewItem>this.itemAtIndex(i))) {
|
||||
this.dirtyState = true;
|
||||
}
|
||||
}
|
||||
|
||||
// when view scrolls down, start unrendering from renderTop
|
||||
for (i = this.indexAt(this.lastRenderTop), stop = Math.min(this.indexAt(renderTop), this.indexAfter(thisRenderBottom)); i < stop; i++) {
|
||||
for (i = this.indexAt(this.lastRenderTop!), stop = Math.min(this.indexAt(renderTop), this.indexAfter(thisRenderBottom)); i < stop; i++) {
|
||||
if (this.removeItemFromDOM(<IViewItem>this.itemAtIndex(i))) {
|
||||
this.dirtyState = true;
|
||||
}
|
||||
}
|
||||
|
||||
// when view scrolls up, start unrendering from either renderBottom this.renderTop
|
||||
for (i = Math.max(this.indexAfter(renderBottom), this.indexAt(this.lastRenderTop)), stop = this.indexAfter(thisRenderBottom); i < stop; i++) {
|
||||
for (i = Math.max(this.indexAfter(renderBottom), this.indexAt(this.lastRenderTop!)), stop = this.indexAfter(thisRenderBottom); i < stop; i++) {
|
||||
if (this.removeItemFromDOM(<IViewItem>this.itemAtIndex(i))) {
|
||||
this.dirtyState = true;
|
||||
}
|
||||
@@ -854,7 +854,7 @@ export class ScrollableSplitView extends HeightMap implements IDisposable {
|
||||
this.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);
|
||||
|
||||
if (this.dirtyState) {
|
||||
for (let i = this.indexAt(this.lastRenderTop); i <= this.indexAfter(this.lastRenderTop + this.lastRenderHeight) - 1; i++) {
|
||||
for (let i = this.indexAt(this.lastRenderTop!); i <= this.indexAfter(this.lastRenderTop! + this.lastRenderHeight!) - 1; i++) {
|
||||
this.viewItems[i].layout();
|
||||
if (this.options.enableResizing) {
|
||||
this.sashItems[i].sash.layout();
|
||||
|
||||
@@ -58,9 +58,7 @@ export class SelectBox extends vsSelectBox {
|
||||
private inputValidationErrorBackground?: Color;
|
||||
private inputValidationErrorForeground?: Color;
|
||||
|
||||
private element: HTMLElement;
|
||||
|
||||
|
||||
private element?: HTMLElement;
|
||||
|
||||
constructor(options: string[], selectedOption: string, contextViewProvider: IContextViewProvider, container?: HTMLElement, selectBoxOptions?: ISelectBoxOptions) {
|
||||
super(options.map(option => { return { text: option }; }), 0, contextViewProvider, undefined, selectBoxOptions);
|
||||
@@ -261,10 +259,12 @@ export class SelectBox extends vsSelectBox {
|
||||
}
|
||||
|
||||
public hideMessage(): void {
|
||||
dom.removeClass(this.element, 'info');
|
||||
dom.removeClass(this.element, 'warning');
|
||||
dom.removeClass(this.element, 'error');
|
||||
dom.addClass(this.element, 'idle');
|
||||
if (this.element) {
|
||||
dom.removeClass(this.element, 'info');
|
||||
dom.removeClass(this.element, 'warning');
|
||||
dom.removeClass(this.element, 'error');
|
||||
dom.addClass(this.element, 'idle');
|
||||
}
|
||||
|
||||
this._hideMessage();
|
||||
this.applyStyles();
|
||||
|
||||
@@ -80,7 +80,7 @@ export class VirtualizedCollection<T extends Slick.SlickData> implements IObserv
|
||||
private _bufferWindowAfter: DataWindow<T>;
|
||||
private _lengthChanged = false;
|
||||
|
||||
private collectionChangedCallback: (startIndex: number, count: number) => void;
|
||||
private collectionChangedCallback?: (startIndex: number, count: number) => void;
|
||||
|
||||
constructor(
|
||||
private readonly windowSize: number,
|
||||
|
||||
@@ -6,11 +6,13 @@
|
||||
import { escape } from 'sql/base/common/strings';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
export class DBCellValue {
|
||||
export interface DBCellValue {
|
||||
displayValue: string;
|
||||
isNull: boolean;
|
||||
}
|
||||
|
||||
public static isDBCellValue(object: any): boolean {
|
||||
export namespace DBCellValue {
|
||||
export function isDBCellValue(object: any): boolean {
|
||||
return (object !== undefined && object.displayValue !== undefined && object.isNull !== undefined);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
* Implements the various additional navigation keybindings we want out of slickgrid
|
||||
*/
|
||||
export class AdditionalKeyBindings<T> implements Slick.Plugin<T> {
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private handler = new Slick.EventHandler();
|
||||
|
||||
public init(grid: Slick.Grid<T>) {
|
||||
|
||||
@@ -14,10 +14,10 @@ const defaultOptions: IAutoColumnSizeOptions = {
|
||||
autoSizeOnRender: false
|
||||
};
|
||||
|
||||
export class AutoColumnSize<T extends Object> implements Slick.Plugin<T> {
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _$container: JQuery;
|
||||
private _context: CanvasRenderingContext2D;
|
||||
export class AutoColumnSize<T extends Slick.SlickData> implements Slick.Plugin<T> {
|
||||
private _grid!: Slick.Grid<T>;
|
||||
private _$container!: JQuery;
|
||||
private _context!: CanvasRenderingContext2D;
|
||||
private _options: IAutoColumnSizeOptions;
|
||||
private onPostEventHandler = new Slick.EventHandler();
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ export interface ICellRangeDecorator {
|
||||
}
|
||||
|
||||
export class CellRangeSelector<T> implements ICellRangeSelector<T> {
|
||||
private grid: Slick.Grid<T>;
|
||||
private dragging: boolean;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private dragging?: boolean;
|
||||
private handler = new Slick.EventHandler();
|
||||
private decorator: ICellRangeDecorator;
|
||||
private canvas: HTMLCanvasElement;
|
||||
private currentlySelectedRange: { start: Slick.Cell, end?: Slick.Cell };
|
||||
private decorator!: ICellRangeDecorator;
|
||||
private canvas!: HTMLCanvasElement;
|
||||
private currentlySelectedRange?: { start: Slick.Cell, end?: Slick.Cell };
|
||||
|
||||
public onBeforeCellRangeSelected = new Slick.Event<Slick.Cell>();
|
||||
public onCellRangeSelected = new Slick.Event<Slick.Range>();
|
||||
|
||||
@@ -16,7 +16,7 @@ const defaults: ICellSelectionModelOptions = {
|
||||
};
|
||||
|
||||
export class CellSelectionModel<T> implements Slick.SelectionModel<T, Array<Slick.Range>> {
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private selector: ICellRangeSelector<T>;
|
||||
private ranges: Array<Slick.Range> = [];
|
||||
private _handler = new Slick.EventHandler();
|
||||
|
||||
@@ -47,10 +47,10 @@ const checkboxTemplate = `<div style="display: flex; align-items: center; flex-d
|
||||
|
||||
export class CheckboxSelectColumn<T extends Slick.SlickData> implements Slick.Plugin<T> {
|
||||
private _options: ICheckboxSelectColumnOptions;
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _grid!: Slick.Grid<T>;
|
||||
private _handler = new Slick.EventHandler();
|
||||
private _selectedRowsLookup: dict.INumberDictionary<boolean> = {};
|
||||
private _selectedCheckBoxLookup = {};
|
||||
private _selectedCheckBoxLookup: {[key: string]: boolean} = {};
|
||||
private _useState = false;
|
||||
|
||||
private _onChange = new Emitter<ICheckboxCellActionEventArgs>();
|
||||
@@ -274,7 +274,7 @@ export class CheckboxSelectColumn<T extends Slick.SlickData> implements Slick.Pl
|
||||
|
||||
// use data for first time rendering
|
||||
// note: make sure Init is called before using this._grid
|
||||
let rowVal = (this._grid) ? this._grid.getDataItem(row) : null;
|
||||
let rowVal = this._grid?.getDataItem(row);
|
||||
if (rowVal && this._options.title && rowVal[this._options.title] === true) {
|
||||
this._selectedCheckBoxLookup[row] = true;
|
||||
return strings.format(checkboxTemplate, 'checked', this.getAriaLabel(true));
|
||||
|
||||
@@ -12,7 +12,7 @@ import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
* Implements the various additional navigation keybindings we want out of slickgrid
|
||||
*/
|
||||
export class CopyKeybind<T> implements Slick.Plugin<T> {
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private handler = new Slick.EventHandler();
|
||||
|
||||
private _onCopy = new Emitter<Slick.Range[]>();
|
||||
|
||||
@@ -19,16 +19,16 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
public onFilterApplied = new Slick.Event();
|
||||
public onCommand = new Slick.Event();
|
||||
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private handler = new Slick.EventHandler();
|
||||
|
||||
private $menu?: JQuery<HTMLElement>;
|
||||
private okButton: Button;
|
||||
private clearButton: Button;
|
||||
private cancelButton: Button;
|
||||
private workingFilters: Array<string>;
|
||||
private columnDef: IExtendedColumn<T>;
|
||||
private buttonStyles: IButtonStyles;
|
||||
private okButton?: Button;
|
||||
private clearButton?: Button;
|
||||
private cancelButton?: Button;
|
||||
private workingFilters!: Array<string>;
|
||||
private columnDef!: IExtendedColumn<T>;
|
||||
private buttonStyles?: IButtonStyles;
|
||||
|
||||
private disposableStore = new DisposableStore();
|
||||
|
||||
@@ -286,7 +286,7 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
|
||||
if ($checkbox.prop('checked') && index < 0) {
|
||||
workingFilters.push(filterItems[value]);
|
||||
const nextRow = filterItems[(parseInt(<string><any>value) + 1).toString()]; // for some reason parseInt is defined as only supporting strings even though it works fine for numbers
|
||||
const nextRow = filterItems[Number((parseInt(<string><any>value) + 1).toString())]; // for some reason parseInt is defined as only supporting strings even though it works fine for numbers
|
||||
if (nextRow && nextRow.indexOf('Error:') >= 0) {
|
||||
workingFilters.push(nextRow);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ const defaultOptions: IMouseWheelSupportOptions = {
|
||||
|
||||
export class MouseWheelSupport implements Slick.Plugin<any> {
|
||||
|
||||
private viewport: HTMLElement;
|
||||
private canvas: HTMLElement;
|
||||
private viewport!: HTMLElement;
|
||||
private canvas!: HTMLElement;
|
||||
private options: IMouseWheelSupportOptions;
|
||||
|
||||
private _disposables = new DisposableStore();
|
||||
|
||||
@@ -51,11 +51,11 @@ export class RowDetailView<T extends Slick.SlickData> {
|
||||
public readonly onAfterRowDetailToggle = new Slick.Event<{ grid: Slick.Grid<T>, item: T }>();
|
||||
public readonly onBeforeRowDetailToggle = new Slick.Event<{ grid: Slick.Grid<T>, item: T }>();
|
||||
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _grid!: Slick.Grid<T>;
|
||||
private _expandedRows: Array<ExtendedItem<T>> = [];
|
||||
private _handler = new Slick.EventHandler();
|
||||
|
||||
private _dataView: AugmentedDataView<T>;
|
||||
private _dataView!: AugmentedDataView<T>;
|
||||
private _options: IRowDetailViewOptions<T>;
|
||||
|
||||
constructor(options: IRowDetailViewOptions<T>) {
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface IRowNumberColumnOptions {
|
||||
|
||||
export class RowNumberColumn<T> implements Slick.Plugin<T> {
|
||||
private handler = new Slick.EventHandler();
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
|
||||
constructor(private options: IRowNumberColumnOptions) {
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export interface IRowSelectionModelOptions extends Slick.PluginOptions {
|
||||
|
||||
export class RowSelectionModel<T extends Slick.SlickData> implements Slick.SelectionModel<T, Array<Slick.Range>> {
|
||||
private _options: IRowSelectionModelOptions;
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _grid!: Slick.Grid<T>;
|
||||
private _handler = new Slick.EventHandler();
|
||||
private _ranges: Array<Slick.Range> = [];
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ export class Table<T extends Slick.SlickData> extends Widget implements IDisposa
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _columns: Slick.Column<T>[];
|
||||
private _data: IDisposableDataProvider<T>;
|
||||
private _sorter: ITableSorter<T>;
|
||||
private _sorter?: ITableSorter<T>;
|
||||
|
||||
private _autoscroll: boolean;
|
||||
private _autoscroll?: boolean;
|
||||
private _container: HTMLElement;
|
||||
private _tableContainer: HTMLElement;
|
||||
|
||||
@@ -97,7 +97,7 @@ export class Table<T extends Slick.SlickData> extends Widget implements IDisposa
|
||||
if (configuration && configuration.sorter) {
|
||||
this._sorter = configuration.sorter;
|
||||
this._grid.onSort.subscribe((e, args) => {
|
||||
this._sorter(args);
|
||||
this._sorter!(args);
|
||||
this._grid.invalidate();
|
||||
this._grid.render();
|
||||
});
|
||||
|
||||
@@ -45,9 +45,9 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
//The data exposed publicly, when filter is enabled, _data holds the filtered data.
|
||||
private _data: Array<T>;
|
||||
//Used when filtering is enabled, _allData holds the complete set of data.
|
||||
private _allData: Array<T>;
|
||||
private _findArray: Array<IFindPosition>;
|
||||
private _findIndex: number;
|
||||
private _allData!: Array<T>;
|
||||
private _findArray?: Array<IFindPosition>;
|
||||
private _findIndex?: number;
|
||||
private _filterEnabled: boolean;
|
||||
|
||||
private _onRowCountChange = new Emitter<number>();
|
||||
@@ -166,7 +166,7 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
if (exp) {
|
||||
return new Promise<IFindPosition>((resolve) => {
|
||||
const disp = this.onFindCountChange(e => {
|
||||
resolve(this._findArray[e - 1]);
|
||||
resolve(this._findArray![e - 1]);
|
||||
disp.dispose();
|
||||
});
|
||||
this._startSearch(exp, maxMatches);
|
||||
@@ -185,9 +185,9 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
for (let j = 0; j < result.length; j++) {
|
||||
const pos = result[j];
|
||||
const index = { col: pos, row: i };
|
||||
this._findArray.push(index);
|
||||
this._onFindCountChange.fire(this._findArray.length);
|
||||
if (maxMatches > 0 && this._findArray.length === maxMatches) {
|
||||
this._findArray!.push(index);
|
||||
this._onFindCountChange.fire(this._findArray!.length);
|
||||
if (maxMatches > 0 && this._findArray!.length === maxMatches) {
|
||||
breakout = true;
|
||||
break;
|
||||
}
|
||||
@@ -211,9 +211,9 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
if (this._findIndex === this._findArray.length - 1) {
|
||||
this._findIndex = 0;
|
||||
} else {
|
||||
++this._findIndex;
|
||||
++this._findIndex!;
|
||||
}
|
||||
return Promise.resolve(this._findArray[this._findIndex]);
|
||||
return Promise.resolve(this._findArray[this._findIndex!]);
|
||||
} else {
|
||||
return Promise.reject(new Error('no search running'));
|
||||
}
|
||||
@@ -224,9 +224,9 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
if (this._findIndex === 0) {
|
||||
this._findIndex = this._findArray.length - 1;
|
||||
} else {
|
||||
--this._findIndex;
|
||||
--this._findIndex!;
|
||||
}
|
||||
return Promise.resolve(this._findArray[this._findIndex]);
|
||||
return Promise.resolve(this._findArray[this._findIndex!]);
|
||||
} else {
|
||||
return Promise.reject(new Error('no search running'));
|
||||
}
|
||||
@@ -234,7 +234,7 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
|
||||
get currentFindPosition(): Thenable<IFindPosition> {
|
||||
if (this._findArray && this._findArray.length !== 0) {
|
||||
return Promise.resolve(this._findArray[this._findIndex]);
|
||||
return Promise.resolve(this._findArray[this._findIndex!]);
|
||||
} else {
|
||||
return Promise.reject(new Error('no search running'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user