Adding keyboard shortcuts for column resizing in slickgrid (#21100)

* Adding column resize keyboard shortcuts in slickgrid

* Switching to standard keyboard evt

* Adding comment for the functionality

* Cleaning up code and adding more comments

* Using quick input to get column resize width

* Adding check for negative sizes

* Fixing some stuff
This commit is contained in:
Aasim Khan
2022-11-04 16:15:04 -07:00
committed by GitHub
parent e98f2e2745
commit 00b797b4f3
33 changed files with 192 additions and 62 deletions

View File

@@ -15,6 +15,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IInsightOptions, InsightType } from 'sql/workbench/contrib/charts/common/interfaces';
import { IInsightData } from 'sql/platform/dashboard/browser/insightRegistry';
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
export class TableInsight extends Disposable implements IInsight {
public static readonly types = [InsightType.Table];
@@ -27,7 +28,8 @@ export class TableInsight extends Disposable implements IInsight {
constructor(container: HTMLElement, options: any,
@IThemeService themeService: IThemeService,
@IAccessibilityService accessibilityService: IAccessibilityService
@IAccessibilityService accessibilityService: IAccessibilityService,
@IQuickInputService quickInputService: IQuickInputService
) {
super();
let tableContainer = $('div');
@@ -35,7 +37,7 @@ export class TableInsight extends Disposable implements IInsight {
tableContainer.style.height = '100%';
container.appendChild(tableContainer);
this.dataView = new TableDataView();
this.table = new Table(tableContainer, accessibilityService, { dataProvider: this.dataView }, { showRowNumber: true });
this.table = new Table(tableContainer, accessibilityService, quickInputService, { dataProvider: this.dataView }, { showRowNumber: true });
this.table.setSelectionModel(new CellSelectionModel());
this._register(attachTableStyler(this.table, themeService));
}