mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Switch withProperties to be withProps (#16380)
* Transition to withProps in arc * Transition to withProps inputbox * Transition to withProps in checkbox * Transition to withProps text * Transition to withProps in declarative table * Transition to withProps hyperlink * Transition to withProps in button * Transition to withProps radiobutton * Transition to withProps in input * Transition to withProps button * Transition to withProps in text * Transition to withProps image * Transition to withProps declare table * Transition to withProps in table * Transition to withProps radio button * Transition to withProps in image * Transition to withProps radio button * Transition to withProps in commit * Transition to withProps div cont * Transition to withProps in comp * Transition to withProps radio card * Transition to withProps in comp icon * Transition to withProps card * Transition to withProps list
This commit is contained in:
@@ -26,7 +26,7 @@ export class FilePicker {
|
||||
) {
|
||||
const buttonWidth = 80;
|
||||
this.filePathInputBox = modelBuilder.inputBox()
|
||||
.withProperties<azdata.InputBoxProperties>({
|
||||
.withProps({
|
||||
value: initialPath,
|
||||
ariaLabel: ariaLabel,
|
||||
validationErrorMessage: validationErrorMessage,
|
||||
@@ -43,7 +43,7 @@ export class FilePicker {
|
||||
}).component();
|
||||
|
||||
this.filePickerButton = modelBuilder.button()
|
||||
.withProperties<azdata.ButtonProperties>({
|
||||
.withProps({
|
||||
label: loc.browse,
|
||||
width: buttonWidth,
|
||||
secondary: true
|
||||
@@ -89,5 +89,5 @@ function createFlexContainer(modelBuilder: azdata.ModelBuilder, items: azdata.Co
|
||||
alignItems = alignItems || (rowLayout ? 'center' : undefined);
|
||||
const itemsStyle = rowLayout ? { CSSStyles: { 'margin-right': '5px', } } : {};
|
||||
const flexLayout: azdata.FlexLayout = { flexFlow: flexFlow, height: height, width: width, alignItems: alignItems };
|
||||
return modelBuilder.flexContainer().withItems(items, itemsStyle).withLayout(flexLayout).withProperties<azdata.ComponentProperties>({ CSSStyles: cssStyles || {} }).component();
|
||||
return modelBuilder.flexContainer().withItems(items, itemsStyle).withLayout(flexLayout).withProps({ CSSStyles: cssStyles || {} }).component();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export abstract class KeyValue extends vscode.Disposable {
|
||||
alignItems: 'center'
|
||||
}).component();
|
||||
|
||||
const keyComponent = modelBuilder.text().withProperties<azdata.TextComponentProperties>({
|
||||
const keyComponent = modelBuilder.text().withProps({
|
||||
value: key,
|
||||
CSSStyles: { ...cssStyles.text, 'font-weight': 'bold', 'margin-block-start': '0px', 'margin-block-end': '0px' }
|
||||
}).component();
|
||||
@@ -80,7 +80,7 @@ export class TextKeyValue extends KeyValue {
|
||||
constructor(modelBuilder: azdata.ModelBuilder, key: string, value: string) {
|
||||
super(modelBuilder, key, value);
|
||||
|
||||
this.text = modelBuilder.text().withProperties<azdata.TextComponentProperties>({
|
||||
this.text = modelBuilder.text().withProps({
|
||||
value: value,
|
||||
CSSStyles: { ...cssStyles.text, 'margin-block-start': '0px', 'margin-block-end': '0px' }
|
||||
}).component();
|
||||
@@ -101,7 +101,7 @@ export abstract class BaseInputKeyValue extends KeyValue {
|
||||
constructor(modelBuilder: azdata.ModelBuilder, key: string, value: string, multiline: boolean) {
|
||||
super(modelBuilder, key, value);
|
||||
|
||||
this.input = modelBuilder.inputBox().withProperties<azdata.InputBoxProperties>({
|
||||
this.input = modelBuilder.inputBox().withProps({
|
||||
value: value,
|
||||
readOnly: true,
|
||||
multiline: multiline
|
||||
@@ -110,7 +110,7 @@ export abstract class BaseInputKeyValue extends KeyValue {
|
||||
const inputContainer = modelBuilder.flexContainer().withLayout({ alignItems: 'center' }).component();
|
||||
inputContainer.addItem(this.input);
|
||||
|
||||
const copy = modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||
const copy = modelBuilder.button().withProps({
|
||||
iconPath: IconPathHelper.copy,
|
||||
width: '17px',
|
||||
height: '17px',
|
||||
@@ -153,7 +153,7 @@ export class LinkKeyValue extends KeyValue {
|
||||
constructor(modelBuilder: azdata.ModelBuilder, key: string, value: string, onClick: (e: any) => any) {
|
||||
super(modelBuilder, key, value);
|
||||
|
||||
this.link = modelBuilder.hyperlink().withProperties<azdata.HyperlinkComponentProperties>({
|
||||
this.link = modelBuilder.hyperlink().withProps({
|
||||
label: value,
|
||||
url: ''
|
||||
}).component();
|
||||
|
||||
@@ -26,7 +26,7 @@ export class RadioOptionsGroup {
|
||||
private _loadingCompleteMessage: string,
|
||||
private _loadingCompleteErrorMessage: (error: any) => string
|
||||
) {
|
||||
this._divContainer = this._modelBuilder.divContainer().withProperties<azdata.DivContainerProperties>({ clickable: false }).component();
|
||||
this._divContainer = this._modelBuilder.divContainer().withProps({ clickable: false }).component();
|
||||
this._loadingBuilder = this._modelBuilder.loadingComponent().withItem(this._divContainer);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export class RadioOptionsGroup {
|
||||
const options = optionsInfo.values!;
|
||||
let defaultValue: string = optionsInfo.defaultValue!;
|
||||
options.forEach((option: string) => {
|
||||
const radioOption = this._modelBuilder.radioButton().withProperties<azdata.RadioButtonProperties>({
|
||||
const radioOption = this._modelBuilder.radioButton().withProps({
|
||||
label: option,
|
||||
checked: option === defaultValue,
|
||||
name: this._groupName,
|
||||
|
||||
Reference in New Issue
Block a user