mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
.Add types for ModelView CSS properties (#7465)
This commit is contained in:
@@ -648,7 +648,6 @@ export class JobDialog extends AgentDialog<JobData> {
|
|||||||
private createRowContainer(view: azdata.ModelView): azdata.FlexBuilder {
|
private createRowContainer(view: azdata.ModelView): azdata.FlexBuilder {
|
||||||
return view.modelBuilder.flexContainer().withLayout({
|
return view.modelBuilder.flexContainer().withLayout({
|
||||||
flexFlow: 'row',
|
flexFlow: 'row',
|
||||||
alignItems: 'left',
|
|
||||||
justifyContent: 'space-between'
|
justifyContent: 'space-between'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,7 +301,6 @@ export class NotebookDialog extends AgentDialog<NotebookData> {
|
|||||||
private createRowContainer(view: azdata.ModelView): azdata.FlexBuilder {
|
private createRowContainer(view: azdata.ModelView): azdata.FlexBuilder {
|
||||||
return view.modelBuilder.flexContainer().withLayout({
|
return view.modelBuilder.flexContainer().withLayout({
|
||||||
flexFlow: 'row',
|
flexFlow: 'row',
|
||||||
alignItems: 'left',
|
|
||||||
justifyContent: 'space-between'
|
justifyContent: 'space-between'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,7 @@ export class BdcDashboard {
|
|||||||
{
|
{
|
||||||
flexFlow: 'column',
|
flexFlow: 'column',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%'
|
||||||
alignItems: 'left'
|
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
// ###########
|
// ###########
|
||||||
@@ -104,8 +103,7 @@ export class BdcDashboard {
|
|||||||
{
|
{
|
||||||
flexFlow: 'row',
|
flexFlow: 'row',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%'
|
||||||
alignItems: 'left'
|
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
rootContainer.addItem(this.mainAreaContainer, { flex: '0 0 100%' });
|
rootContainer.addItem(this.mainAreaContainer, { flex: '0 0 100%' });
|
||||||
@@ -118,8 +116,7 @@ export class BdcDashboard {
|
|||||||
{
|
{
|
||||||
flexFlow: 'column',
|
flexFlow: 'column',
|
||||||
width: navWidth,
|
width: navWidth,
|
||||||
height: '100%',
|
height: '100%'
|
||||||
alignItems: 'left'
|
|
||||||
}
|
}
|
||||||
).component();
|
).component();
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ export class BdcDashboardOverviewPage {
|
|||||||
{
|
{
|
||||||
flexFlow: 'column',
|
flexFlow: 'column',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%'
|
||||||
alignItems: 'left'
|
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
// ##############
|
// ##############
|
||||||
@@ -109,7 +108,7 @@ export class BdcDashboardOverviewPage {
|
|||||||
|
|
||||||
overviewHeaderContainer.addItem(this.lastUpdatedLabel, { CSSStyles: { 'margin-left': '45px' } });
|
overviewHeaderContainer.addItem(this.lastUpdatedLabel, { CSSStyles: { 'margin-left': '45px' } });
|
||||||
|
|
||||||
const overviewContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%', alignItems: 'left' }).component();
|
const overviewContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%' }).component();
|
||||||
|
|
||||||
// Service Status header row
|
// Service Status header row
|
||||||
const serviceStatusHeaderRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
|
const serviceStatusHeaderRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
|
||||||
@@ -144,7 +143,7 @@ export class BdcDashboardOverviewPage {
|
|||||||
.component();
|
.component();
|
||||||
rootContainer.addItem(endpointsLabel, { CSSStyles: { 'padding-left': '10px', ...cssStyles.title } });
|
rootContainer.addItem(endpointsLabel, { CSSStyles: { 'padding-left': '10px', ...cssStyles.title } });
|
||||||
|
|
||||||
const endpointsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%', alignItems: 'left' }).component();
|
const endpointsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%' }).component();
|
||||||
|
|
||||||
// Service endpoints header row
|
// Service endpoints header row
|
||||||
const endpointsHeaderRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
|
const endpointsHeaderRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
|
||||||
|
|||||||
@@ -60,8 +60,7 @@ export class BdcDashboardResourceStatusPage {
|
|||||||
{
|
{
|
||||||
flexFlow: 'column',
|
flexFlow: 'column',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%'
|
||||||
alignItems: 'left'
|
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
// ##############################
|
// ##############################
|
||||||
|
|||||||
@@ -35,16 +35,14 @@ export class BdcServiceStatusPage {
|
|||||||
{
|
{
|
||||||
flexFlow: 'column',
|
flexFlow: 'column',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%'
|
||||||
alignItems: 'left'
|
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.resourceHeader = this.modelView.modelBuilder.flexContainer().withLayout(
|
this.resourceHeader = this.modelView.modelBuilder.flexContainer().withLayout(
|
||||||
{
|
{
|
||||||
flexFlow: 'row',
|
flexFlow: 'row',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '25px',
|
height: '25px'
|
||||||
alignItems: 'left'
|
|
||||||
}
|
}
|
||||||
).component();
|
).component();
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,12 @@ export function registerBooksWidget(bookContributionProvider: BookContributionPr
|
|||||||
const container = view.modelBuilder.flexContainer().withLayout({
|
const container = view.modelBuilder.flexContainer().withLayout({
|
||||||
flexFlow: 'column',
|
flexFlow: 'column',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%'
|
||||||
alignItems: 'left'
|
|
||||||
}).component();
|
}).component();
|
||||||
const bookslocationContainer = view.modelBuilder.flexContainer().withLayout({
|
const bookslocationContainer = view.modelBuilder.flexContainer().withLayout({
|
||||||
flexFlow: 'column',
|
flexFlow: 'column',
|
||||||
width: '270px',
|
width: '270px',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
alignItems: 'left',
|
|
||||||
position: 'absolute'
|
position: 'absolute'
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export function registerServiceEndpoints(context: vscode.ExtensionContext): void
|
|||||||
.sort((e1, e2) => e1.endpoint.localeCompare(e2.endpoint));
|
.sort((e1, e2) => e1.endpoint.localeCompare(e2.endpoint));
|
||||||
endpointsArray.unshift(...sqlServerMasterEndpoints);
|
endpointsArray.unshift(...sqlServerMasterEndpoints);
|
||||||
|
|
||||||
const container = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%', alignItems: 'left' }).component();
|
const container = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '100%', height: '100%' }).component();
|
||||||
endpointsArray.forEach(endpointInfo => {
|
endpointsArray.forEach(endpointInfo => {
|
||||||
const endPointRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
|
const endPointRow = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'row' }).component();
|
||||||
const nameCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: endpointInfo.description }).component();
|
const nameCell = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: endpointInfo.description }).component();
|
||||||
@@ -103,7 +103,7 @@ export function registerServiceEndpoints(context: vscode.ExtensionContext): void
|
|||||||
|
|
||||||
container.addItem(endPointRow, { CSSStyles: { 'padding-left': '10px', 'border-top': 'solid 1px #ccc', 'box-sizing': 'border-box', 'user-select': 'text' } });
|
container.addItem(endPointRow, { CSSStyles: { 'padding-left': '10px', 'border-top': 'solid 1px #ccc', 'box-sizing': 'border-box', 'user-select': 'text' } });
|
||||||
});
|
});
|
||||||
const endpointsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '540px', height: '100%', alignItems: 'left', position: 'absolute' }).component();
|
const endpointsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column', width: '540px', height: '100%', position: 'absolute' }).component();
|
||||||
endpointsContainer.addItem(container, { CSSStyles: { 'padding-top': '25px', 'padding-left': '5px' } });
|
endpointsContainer.addItem(container, { CSSStyles: { 'padding-top': '25px', 'padding-left': '5px' } });
|
||||||
|
|
||||||
await view.initializeModel(endpointsContainer);
|
await view.initializeModel(endpointsContainer);
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ function processFields(fieldInfoArray: FieldInfo[], components: azdata.Component
|
|||||||
|
|
||||||
export function createFlexContainer(view: azdata.ModelView, items: azdata.Component[], rowLayout: boolean = true): azdata.FlexContainer {
|
export function createFlexContainer(view: azdata.ModelView, items: azdata.Component[], rowLayout: boolean = true): azdata.FlexContainer {
|
||||||
const flexFlow = rowLayout ? 'row' : 'column';
|
const flexFlow = rowLayout ? 'row' : 'column';
|
||||||
const alignItems = rowLayout ? 'center' : '';
|
const alignItems = rowLayout ? 'center' : undefined;
|
||||||
const itemsStyle = rowLayout ? { CSSStyles: { 'margin-right': '5px' } } : {};
|
const itemsStyle = rowLayout ? { CSSStyles: { 'margin-right': '5px' } } : {};
|
||||||
return view.modelBuilder.flexContainer().withItems(items, itemsStyle).withLayout({ flexFlow: flexFlow, alignItems: alignItems }).component();
|
return view.modelBuilder.flexContainer().withItems(items, itemsStyle).withLayout({ flexFlow: flexFlow, alignItems: alignItems }).component();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export class ResourceTypePickerDialog extends DialogBase {
|
|||||||
const tableWidth = 1126;
|
const tableWidth = 1126;
|
||||||
this._view = view;
|
this._view = view;
|
||||||
this.resourceTypeService.getResourceTypes().forEach(resourceType => this.addCard(resourceType));
|
this.resourceTypeService.getResourceTypes().forEach(resourceType => this.addCard(resourceType));
|
||||||
const cardsContainer = view.modelBuilder.flexContainer().withItems(this._resourceTypeCards, { flex: '0 0 auto', CSSStyles: { 'margin-bottom': '10px' } }).withLayout({ flexFlow: 'row', alignItems: 'left' }).component();
|
const cardsContainer = view.modelBuilder.flexContainer().withItems(this._resourceTypeCards, { flex: '0 0 auto', CSSStyles: { 'margin-bottom': '10px' } }).withLayout({ flexFlow: 'row' }).component();
|
||||||
this._resourceDescriptionLabel = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: this._selectedResourceType ? this._selectedResourceType.description : undefined }).component();
|
this._resourceDescriptionLabel = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({ value: this._selectedResourceType ? this._selectedResourceType.description : undefined }).component();
|
||||||
this._optionsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component();
|
this._optionsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component();
|
||||||
this._agreementContainer = view.modelBuilder.divContainer().component();
|
this._agreementContainer = view.modelBuilder.divContainer().component();
|
||||||
|
|||||||
@@ -293,7 +293,6 @@ export default class MainController implements vscode.Disposable {
|
|||||||
let flexRadioButtonsModel = view.modelBuilder.flexContainer()
|
let flexRadioButtonsModel = view.modelBuilder.flexContainer()
|
||||||
.withLayout({
|
.withLayout({
|
||||||
flexFlow: 'column',
|
flexFlow: 'column',
|
||||||
alignItems: 'left',
|
|
||||||
height: 150
|
height: 150
|
||||||
}).withItems([
|
}).withItems([
|
||||||
radioButton, groupModel1, radioButton2]
|
radioButton, groupModel1, radioButton2]
|
||||||
|
|||||||
23
src/sql/azdata.d.ts
vendored
23
src/sql/azdata.d.ts
vendored
@@ -2721,6 +2721,13 @@ declare module 'azdata' {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AlignItemsType = 'normal' | 'stretch' | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center' | 'inherit' | 'initial' | 'unset';
|
||||||
|
export type JustifyContentType = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'initial' | 'inherit';
|
||||||
|
export type AlignContentType = 'stretch' | 'center' | 'flex-start' | 'flex-end' | 'space-between' | 'space-around' | 'initial' | 'inherit';
|
||||||
|
export type FlexWrapType = 'nowrap' | 'wrap' | 'wrap-reverse';
|
||||||
|
export type TextAlignType = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';
|
||||||
|
export type PositionType = 'static' | 'absolute' | 'fixed' | 'relative' | 'sticky' | 'initial' | 'inherit';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The config for a FlexBox-based container. This supports easy
|
* The config for a FlexBox-based container. This supports easy
|
||||||
* addition of content to a container with a flexible layout
|
* addition of content to a container with a flexible layout
|
||||||
@@ -2736,19 +2743,19 @@ declare module 'azdata' {
|
|||||||
/**
|
/**
|
||||||
* Matches the justify-content CSS property.
|
* Matches the justify-content CSS property.
|
||||||
*/
|
*/
|
||||||
justifyContent?: string;
|
justifyContent?: JustifyContentType;
|
||||||
/**
|
/**
|
||||||
* Matches the align-items CSS property.
|
* Matches the align-items CSS property.
|
||||||
*/
|
*/
|
||||||
alignItems?: string;
|
alignItems?: AlignItemsType;
|
||||||
/**
|
/**
|
||||||
* Matches the align-content CSS property.
|
* Matches the align-content CSS property.
|
||||||
*/
|
*/
|
||||||
alignContent?: string;
|
alignContent?: AlignContentType;
|
||||||
/**
|
/**
|
||||||
* Matches the flex-wrap CSS property.
|
* Matches the flex-wrap CSS property.
|
||||||
*/
|
*/
|
||||||
flexWrap?: string;
|
flexWrap?: FlexWrapType;
|
||||||
/**
|
/**
|
||||||
* Container Height
|
* Container Height
|
||||||
*/
|
*/
|
||||||
@@ -2762,7 +2769,7 @@ declare module 'azdata' {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
textAlign?: string;
|
textAlign?: TextAlignType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The position CSS property. Empty by default.
|
* The position CSS property. Empty by default.
|
||||||
@@ -2771,7 +2778,7 @@ declare module 'azdata' {
|
|||||||
* set to 'absolute', with the parent FlexContainer having 'relative' position.
|
* set to 'absolute', with the parent FlexContainer having 'relative' position.
|
||||||
* Without this the component will fail to correctly size itself.
|
* Without this the component will fail to correctly size itself.
|
||||||
*/
|
*/
|
||||||
position?: string;
|
position?: PositionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SplitViewLayout extends FlexLayout {
|
export interface SplitViewLayout extends FlexLayout {
|
||||||
@@ -2959,7 +2966,7 @@ declare module 'azdata' {
|
|||||||
* set to 'absolute', with the parent FlexContainer having 'relative' position.
|
* set to 'absolute', with the parent FlexContainer having 'relative' position.
|
||||||
* Without this the component will fail to correctly size itself
|
* Without this the component will fail to correctly size itself
|
||||||
*/
|
*/
|
||||||
position?: string;
|
position?: PositionType;
|
||||||
/**
|
/**
|
||||||
* Matches the CSS style key and its available values.
|
* Matches the CSS style key and its available values.
|
||||||
*/
|
*/
|
||||||
@@ -3038,7 +3045,7 @@ declare module 'azdata' {
|
|||||||
ownerUri: string;
|
ownerUri: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CheckBoxProperties {
|
export interface CheckBoxProperties extends ComponentProperties {
|
||||||
checked?: boolean;
|
checked?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
17
src/sql/sqlops.proposed.d.ts
vendored
17
src/sql/sqlops.proposed.d.ts
vendored
@@ -270,6 +270,13 @@ declare module 'sqlops' {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AlignItemsType = 'normal' | 'stretch' | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center' | 'inherit' | 'initial' | 'unset';
|
||||||
|
export type JustifyContentType = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'initial' | 'inherit';
|
||||||
|
export type AlignContentType = 'stretch' | 'center' | 'flex-start' | 'flex-end' | 'space-between' | 'space-around' | 'initial' | 'inherit';
|
||||||
|
export type FlexWrapType = 'nowrap' | 'wrap' | 'wrap-reverse';
|
||||||
|
export type TextAlignType = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';
|
||||||
|
export type PositionType = 'static' | 'absolute' | 'fixed' | 'relative' | 'sticky' | 'initial' | 'inherit';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The config for a FlexBox-based container. This supports easy
|
* The config for a FlexBox-based container. This supports easy
|
||||||
* addition of content to a container with a flexible layout
|
* addition of content to a container with a flexible layout
|
||||||
@@ -285,15 +292,15 @@ declare module 'sqlops' {
|
|||||||
/**
|
/**
|
||||||
* Matches the justify-content CSS property.
|
* Matches the justify-content CSS property.
|
||||||
*/
|
*/
|
||||||
justifyContent?: string;
|
justifyContent?: JustifyContentType;
|
||||||
/**
|
/**
|
||||||
* Matches the align-items CSS property.
|
* Matches the align-items CSS property.
|
||||||
*/
|
*/
|
||||||
alignItems?: string;
|
alignItems?: AlignItemsType;
|
||||||
/**
|
/**
|
||||||
* Matches the align-content CSS property.
|
* Matches the align-content CSS property.
|
||||||
*/
|
*/
|
||||||
alignContent?: string;
|
alignContent?: AlignContentType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container Height
|
* Container Height
|
||||||
@@ -308,7 +315,7 @@ declare module 'sqlops' {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
textAlign?: string;
|
textAlign?: TextAlignType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The position CSS property. Empty by default.
|
* The position CSS property. Empty by default.
|
||||||
@@ -317,7 +324,7 @@ declare module 'sqlops' {
|
|||||||
* set to 'absolute', with the parent FlexContainer having 'relative' position.
|
* set to 'absolute', with the parent FlexContainer having 'relative' position.
|
||||||
* Without this the component will fail to correctly size itself.
|
* Without this the component will fail to correctly size itself.
|
||||||
*/
|
*/
|
||||||
position?: string;
|
position?: PositionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FlexItemLayout {
|
export interface FlexItemLayout {
|
||||||
|
|||||||
Reference in New Issue
Block a user