|
|
|
@@ -84,7 +84,8 @@ interface QuickInputUI {
|
|
|
|
|
leftActionBar: ActionBar;
|
|
|
|
|
titleBar: HTMLElement;
|
|
|
|
|
title: HTMLElement;
|
|
|
|
|
description: HTMLElement;
|
|
|
|
|
description1: HTMLElement;
|
|
|
|
|
description2: HTMLElement;
|
|
|
|
|
rightActionBar: ActionBar;
|
|
|
|
|
checkAll: HTMLInputElement;
|
|
|
|
|
filterContainer: HTMLElement;
|
|
|
|
@@ -119,6 +120,7 @@ type Visibilities = {
|
|
|
|
|
description?: boolean;
|
|
|
|
|
checkAll?: boolean;
|
|
|
|
|
inputBox?: boolean;
|
|
|
|
|
checkBox?: boolean;
|
|
|
|
|
visibleCount?: boolean;
|
|
|
|
|
count?: boolean;
|
|
|
|
|
message?: boolean;
|
|
|
|
@@ -281,8 +283,11 @@ class QuickInput extends Disposable implements IQuickInput {
|
|
|
|
|
this.ui.title.innerText = '\u00a0;';
|
|
|
|
|
}
|
|
|
|
|
const description = this.getDescription();
|
|
|
|
|
if (this.ui.description.textContent !== description) {
|
|
|
|
|
this.ui.description.textContent = description;
|
|
|
|
|
if (this.ui.description1.textContent !== description) {
|
|
|
|
|
this.ui.description1.textContent = description;
|
|
|
|
|
}
|
|
|
|
|
if (this.ui.description2.textContent !== description) {
|
|
|
|
|
this.ui.description2.textContent = description;
|
|
|
|
|
}
|
|
|
|
|
if (this.busy && !this.busyDelay) {
|
|
|
|
|
this.busyDelay = new TimeoutTimer();
|
|
|
|
@@ -414,6 +419,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
|
|
|
|
private _customButtonHover: string | undefined;
|
|
|
|
|
private _quickNavigate: IQuickNavigateConfiguration | undefined;
|
|
|
|
|
private _hideInput: boolean | undefined;
|
|
|
|
|
private _hideCheckAll: boolean | undefined;
|
|
|
|
|
|
|
|
|
|
get quickNavigate() {
|
|
|
|
|
return this._quickNavigate;
|
|
|
|
@@ -640,6 +646,15 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
|
|
|
|
this.update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get hideCheckAll() {
|
|
|
|
|
return !!this._hideCheckAll;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set hideCheckAll(hideCheckAll: boolean) {
|
|
|
|
|
this._hideCheckAll = hideCheckAll;
|
|
|
|
|
this.update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onDidChangeSelection = this.onDidChangeSelectionEmitter.event;
|
|
|
|
|
|
|
|
|
|
onDidTriggerItemButton = this.onDidTriggerItemButtonEmitter.event;
|
|
|
|
@@ -856,11 +871,12 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
|
|
|
|
hideInput = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.ui.container.classList.toggle('hidden-input', hideInput);
|
|
|
|
|
this.ui.container.classList.toggle('hidden-input', hideInput && !this.description);
|
|
|
|
|
const visibilities: Visibilities = {
|
|
|
|
|
title: !!this.title || !!this.step || !!this.buttons.length,
|
|
|
|
|
description: !!this.description,
|
|
|
|
|
checkAll: this.canSelectMany,
|
|
|
|
|
checkAll: this.canSelectMany && !this._hideCheckAll,
|
|
|
|
|
checkBox: this.canSelectMany,
|
|
|
|
|
inputBox: !hideInput,
|
|
|
|
|
progressBar: !hideInput,
|
|
|
|
|
visibleCount: true,
|
|
|
|
@@ -959,6 +975,11 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
|
|
|
|
// we need to move focus into the tree to detect keybindings
|
|
|
|
|
// properly when the input box is not visible (quick nav)
|
|
|
|
|
this.ui.list.domFocus();
|
|
|
|
|
|
|
|
|
|
// Focus the first element in the list if multiselect is enabled
|
|
|
|
|
if (this.canSelectMany) {
|
|
|
|
|
this.ui.list.focus(QuickInputListFocus.First);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -1153,8 +1174,7 @@ export class QuickInputController extends Disposable {
|
|
|
|
|
const rightActionBar = this._register(new ActionBar(titleBar));
|
|
|
|
|
rightActionBar.domNode.classList.add('quick-input-right-action-bar');
|
|
|
|
|
|
|
|
|
|
const description = dom.append(container, $('.quick-input-description'));
|
|
|
|
|
|
|
|
|
|
const description1 = dom.append(container, $('.quick-input-description'));
|
|
|
|
|
const headerContainer = dom.append(container, $('.quick-input-header'));
|
|
|
|
|
|
|
|
|
|
const checkAll = <HTMLInputElement>dom.append(headerContainer, $('input.quick-input-check-all'));
|
|
|
|
@@ -1169,6 +1189,7 @@ export class QuickInputController extends Disposable {
|
|
|
|
|
}
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
const description2 = dom.append(headerContainer, $('.quick-input-description'));
|
|
|
|
|
const extraContainer = dom.append(headerContainer, $('.quick-input-and-message'));
|
|
|
|
|
const filterContainer = dom.append(extraContainer, $('.quick-input-filter'));
|
|
|
|
|
|
|
|
|
@@ -1283,7 +1304,8 @@ export class QuickInputController extends Disposable {
|
|
|
|
|
leftActionBar,
|
|
|
|
|
titleBar,
|
|
|
|
|
title,
|
|
|
|
|
description,
|
|
|
|
|
description1,
|
|
|
|
|
description2,
|
|
|
|
|
rightActionBar,
|
|
|
|
|
checkAll,
|
|
|
|
|
filterContainer,
|
|
|
|
@@ -1496,7 +1518,8 @@ export class QuickInputController extends Disposable {
|
|
|
|
|
this.setEnabled(true);
|
|
|
|
|
ui.leftActionBar.clear();
|
|
|
|
|
ui.title.textContent = '';
|
|
|
|
|
ui.description.textContent = '';
|
|
|
|
|
ui.description1.textContent = '';
|
|
|
|
|
ui.description2.textContent = '';
|
|
|
|
|
ui.rightActionBar.clear();
|
|
|
|
|
ui.checkAll.checked = false;
|
|
|
|
|
// ui.inputBox.value = ''; Avoid triggering an event.
|
|
|
|
@@ -1527,7 +1550,8 @@ export class QuickInputController extends Disposable {
|
|
|
|
|
private setVisibilities(visibilities: Visibilities) {
|
|
|
|
|
const ui = this.getUI();
|
|
|
|
|
ui.title.style.display = visibilities.title ? '' : 'none';
|
|
|
|
|
ui.description.style.display = visibilities.description ? '' : 'none';
|
|
|
|
|
ui.description1.style.display = visibilities.description && (visibilities.inputBox || visibilities.checkAll) ? '' : 'none';
|
|
|
|
|
ui.description2.style.display = visibilities.description && !(visibilities.inputBox || visibilities.checkAll) ? '' : 'none';
|
|
|
|
|
ui.checkAll.style.display = visibilities.checkAll ? '' : 'none';
|
|
|
|
|
ui.filterContainer.style.display = visibilities.inputBox ? '' : 'none';
|
|
|
|
|
ui.visibleCountContainer.style.display = visibilities.visibleCount ? '' : 'none';
|
|
|
|
@@ -1537,7 +1561,7 @@ export class QuickInputController extends Disposable {
|
|
|
|
|
ui.message.style.display = visibilities.message ? '' : 'none';
|
|
|
|
|
ui.progressBar.getContainer().style.display = visibilities.progressBar ? '' : 'none';
|
|
|
|
|
ui.list.display(!!visibilities.list);
|
|
|
|
|
ui.container.classList[visibilities.checkAll ? 'add' : 'remove']('show-checkboxes');
|
|
|
|
|
ui.container.classList[visibilities.checkBox ? 'add' : 'remove']('show-checkboxes');
|
|
|
|
|
this.updateLayout(); // TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|