mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
Add IconPath type (#14420)
* Add IconPath type * Add ThemedIconPath subtype * Update type
This commit is contained in:
@@ -28,7 +28,7 @@ import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType, ModelViewAction } from 'sql/platform/dashboard/browser/interfaces';
|
||||
import { convertSizeToNumber } from 'sql/base/browser/dom';
|
||||
import { ButtonCellValue, ButtonColumn } from 'sql/base/browser/ui/table/plugins/buttonColumn.plugin';
|
||||
import { IUserFriendlyIcon, createIconCssClass, getIconKey } from 'sql/workbench/browser/modelComponents/iconUtils';
|
||||
import { IconPath, createIconCssClass, getIconKey } from 'sql/workbench/browser/modelComponents/iconUtils';
|
||||
import { HeaderFilter } from 'sql/base/browser/ui/table/plugins/headerFilter.plugin';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
@@ -207,7 +207,7 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
|
||||
}
|
||||
}
|
||||
|
||||
private createIconCssClassInternal(icon: IUserFriendlyIcon): string {
|
||||
private createIconCssClassInternal(icon: IconPath): string {
|
||||
const iconKey: string = getIconKey(icon);
|
||||
const iconCssClass = this._iconCssMap[iconKey] ?? createIconCssClass(icon);
|
||||
if (!this._iconCssMap[iconKey]) {
|
||||
@@ -430,7 +430,7 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
|
||||
private createButtonPlugin(col: azdata.ButtonColumn) {
|
||||
let name = col.value;
|
||||
if (!this._buttonColumns[col.value]) {
|
||||
const icon = <IUserFriendlyIcon>(col.options ? (<any>col.options).icon : col.icon);
|
||||
const icon = <IconPath>(col.options ? (<any>col.options).icon : col.icon);
|
||||
this._buttonColumns[col.value] = new ButtonColumn({
|
||||
title: col.value,
|
||||
iconCssClass: icon ? this.createIconCssClassInternal(icon) : undefined,
|
||||
|
||||
Reference in New Issue
Block a user