mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 01:25:36 -05:00
Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 (#14050)
* Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 * Fix breaks * Extension management fixes * Fix breaks in windows bundling * Fix/skip failing tests * Update distro * Add clear to nuget.config * Add hygiene task * Bump distro * Fix hygiene issue * Add build to hygiene exclusion * Update distro * Update hygiene * Hygiene exclusions * Update tsconfig * Bump distro for server breaks * Update build config * Update darwin path * Add done calls to notebook tests * Skip failing tests * Disable smoke tests
This commit is contained in:
@@ -29,7 +29,7 @@ const SELECT_OPTION_ENTRY_TEMPLATE_ID = 'selectOption.entry.template';
|
||||
interface ISelectListTemplateData {
|
||||
root: HTMLElement;
|
||||
text: HTMLElement;
|
||||
itemDescription: HTMLElement;
|
||||
detail: HTMLElement;
|
||||
decoratorRight: HTMLElement;
|
||||
disposables: IDisposable[];
|
||||
}
|
||||
@@ -43,31 +43,27 @@ class SelectListRenderer implements IListRenderer<ISelectOptionItem, ISelectList
|
||||
data.disposables = [];
|
||||
data.root = container;
|
||||
data.text = dom.append(container, $('.option-text'));
|
||||
data.detail = dom.append(container, $('.option-detail'));
|
||||
data.decoratorRight = dom.append(container, $('.option-decorator-right'));
|
||||
data.itemDescription = dom.append(container, $('.option-text-description'));
|
||||
data.itemDescription.classList.add('visually-hidden');
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
renderElement(element: ISelectOptionItem, index: number, templateData: ISelectListTemplateData): void {
|
||||
const data: ISelectListTemplateData = templateData;
|
||||
|
||||
const text = element.text;
|
||||
const detail = element.detail;
|
||||
const decoratorRight = element.decoratorRight;
|
||||
|
||||
const isDisabled = element.isDisabled;
|
||||
|
||||
data.text.textContent = text;
|
||||
data.detail.textContent = !!detail ? detail : '';
|
||||
data.decoratorRight.innerText = (!!decoratorRight ? decoratorRight : '');
|
||||
// {{SQL CARBON EDIT}}
|
||||
data.text.setAttribute('aria-label', text);
|
||||
|
||||
if (typeof element.description === 'string') {
|
||||
const itemDescriptionId = (text.replace(/ /g, '_').toLowerCase() + '_description_' + data.root.id);
|
||||
data.text.setAttribute('aria-describedby', itemDescriptionId);
|
||||
data.itemDescription.id = itemDescriptionId;
|
||||
data.itemDescription.innerText = element.description;
|
||||
}
|
||||
|
||||
// pseudo-select disabled option
|
||||
if (isDisabled) {
|
||||
data.root.classList.add('option-disabled');
|
||||
@@ -234,7 +230,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
||||
|
||||
if (showDropDown) {
|
||||
this.showSelectDropDown();
|
||||
dom.EventHelper.stop(e);
|
||||
dom.EventHelper.stop(e, true);
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -683,7 +679,10 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
||||
let longestLength = 0;
|
||||
|
||||
this.options.forEach((option, index) => {
|
||||
const len = option.text.length + (!!option.decoratorRight ? option.decoratorRight.length : 0);
|
||||
const detailLength = !!option.detail ? option.detail.length : 0;
|
||||
const rightDecoratorLength = !!option.decoratorRight ? option.decoratorRight.length : 0;
|
||||
|
||||
const len = option.text.length + detailLength + rightDecoratorLength;
|
||||
if (len > longestLength) {
|
||||
longest = index;
|
||||
longestLength = len;
|
||||
@@ -716,7 +715,22 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
||||
keyboardSupport: false,
|
||||
mouseSupport: false,
|
||||
accessibilityProvider: {
|
||||
getAriaLabel: (element) => element.text,
|
||||
getAriaLabel: element => {
|
||||
let label = element.text;
|
||||
if (element.detail) {
|
||||
label += `. ${element.detail}`;
|
||||
}
|
||||
|
||||
if (element.decoratorRight) {
|
||||
label += `. ${element.decoratorRight}`;
|
||||
}
|
||||
|
||||
if (element.description) {
|
||||
label += `. ${element.description}`;
|
||||
}
|
||||
|
||||
return label;
|
||||
},
|
||||
getWidgetAriaLabel: () => localize({ key: 'selectBox', comment: ['Behave like native select dropdown element.'] }, "Select Box"),
|
||||
getRole: () => 'option',
|
||||
getWidgetRole: () => 'listbox'
|
||||
|
||||
Reference in New Issue
Block a user