mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 01:25:39 -05:00
Strict null pass on some base ui files (#4832)
* more strict null checks in base browser code * revert changes to radiobutton * fix some more minor things, enable strict null check in pipelines * formatting * fix compile errors * make null undefined * more null to undefined
This commit is contained in:
@@ -74,9 +74,9 @@ export interface ISelectData {
|
||||
export class SelectBox extends Widget implements ISelectBoxDelegate {
|
||||
// {{SQL CARBON EDIT}}
|
||||
protected selectElement: HTMLSelectElement;
|
||||
protected selectBackground: Color;
|
||||
protected selectForeground: Color;
|
||||
protected selectBorder: Color;
|
||||
protected selectBackground?: Color;
|
||||
protected selectForeground?: Color;
|
||||
protected selectBorder?: Color;
|
||||
private styles: ISelectBoxStyles;
|
||||
private selectBoxDelegate: ISelectBoxDelegate;
|
||||
|
||||
@@ -137,14 +137,15 @@ export class SelectBox extends Widget implements ISelectBoxDelegate {
|
||||
public applyStyles(): void {
|
||||
this.selectBoxDelegate.applyStyles();
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
protected createOption(value: string, disabled?: boolean): HTMLOptionElement {
|
||||
let option = document.createElement('option');
|
||||
option.value = value;
|
||||
option.text = value;
|
||||
option.disabled = disabled;
|
||||
option.disabled = disabled || false;
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ import { ISelectBoxDelegate, ISelectOptionItem, ISelectBoxOptions, ISelectBoxSty
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { renderMarkdown } from 'vs/base/browser/htmlContentRenderer';
|
||||
|
||||
// {{SQL CARBON EDIT}} import color
|
||||
import { Color } from 'vs/base/common/color';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
const SELECT_OPTION_ENTRY_TEMPLATE_ID = 'selectOption.entry.template';
|
||||
@@ -372,23 +375,22 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
|
||||
// Style parent select
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
let background = null;
|
||||
let foreground = null;
|
||||
let border = null;
|
||||
let background: Color | undefined = undefined;
|
||||
let foreground: Color | undefined = undefined;
|
||||
let border: Color | undefined = undefined;
|
||||
|
||||
if (this.selectElement) {
|
||||
if (this.selectElement.disabled) {
|
||||
background = (<any>this.styles).disabledSelectBackground ? (<any>this.styles).disabledSelectBackground.toString() : null;
|
||||
foreground = (<any>this.styles).disabledSelectForeground ? (<any>this.styles).disabledSelectForeground.toString() : null;
|
||||
border = null;
|
||||
background = (<any>this.styles).disabledSelectBackground;
|
||||
foreground = (<any>this.styles).disabledSelectForeground;
|
||||
} else {
|
||||
background = this.styles.selectBackground ? this.styles.selectBackground.toString() : null;
|
||||
foreground = this.styles.selectForeground ? this.styles.selectForeground.toString() : null;
|
||||
border = this.styles.selectBorder ? this.styles.selectBorder.toString() : null;
|
||||
background = this.styles.selectBackground;
|
||||
foreground = this.styles.selectForeground;
|
||||
border = this.styles.selectBorder;
|
||||
}
|
||||
this.selectElement.style.backgroundColor = background;
|
||||
this.selectElement.style.color = foreground;
|
||||
this.selectElement.style.borderColor = border;
|
||||
this.selectElement.style.backgroundColor = background ? background.toString() : null;
|
||||
this.selectElement.style.color = foreground ? foreground.toString() : null;
|
||||
this.selectElement.style.borderColor = border ? border.toString() : null;
|
||||
}
|
||||
|
||||
// Style drop down select list (non-native mode only)
|
||||
|
||||
Reference in New Issue
Block a user