mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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:
@@ -186,7 +186,7 @@ function asListOptions<T, TFilterData, TRef>(modelProvider: () => ITreeModel<T,
|
||||
return options.accessibilityProvider!.getWidgetAriaLabel();
|
||||
},
|
||||
getWidgetRole: options.accessibilityProvider && options.accessibilityProvider.getWidgetRole ? () => options.accessibilityProvider!.getWidgetRole!() : () => 'tree',
|
||||
getAriaLevel(node) {
|
||||
getAriaLevel: options.accessibilityProvider && options.accessibilityProvider.getAriaLevel ? (node) => options.accessibilityProvider!.getAriaLevel!(node.element) : (node) => {
|
||||
return node.depth;
|
||||
},
|
||||
getActiveDescendantId: options.accessibilityProvider.getActiveDescendantId && (node => {
|
||||
@@ -400,15 +400,23 @@ class TreeRenderer<T, TFilterData, TRef, TTemplateData> implements IListRenderer
|
||||
}
|
||||
|
||||
private renderTwistie(node: ITreeNode<T, TFilterData>, templateData: ITreeListTemplateData<TTemplateData>) {
|
||||
templateData.twistie.classList.remove(...treeItemExpandedIcon.classNamesArray);
|
||||
|
||||
let twistieRendered = false;
|
||||
|
||||
if (this.renderer.renderTwistie) {
|
||||
this.renderer.renderTwistie(node.element, templateData.twistie);
|
||||
twistieRendered = this.renderer.renderTwistie(node.element, templateData.twistie);
|
||||
}
|
||||
|
||||
if (node.collapsible && (!this.hideTwistiesOfChildlessElements || node.visibleChildrenCount > 0)) {
|
||||
templateData.twistie.classList.add(...treeItemExpandedIcon.classNamesArray, 'collapsible');
|
||||
if (!twistieRendered) {
|
||||
templateData.twistie.classList.add(...treeItemExpandedIcon.classNamesArray);
|
||||
}
|
||||
|
||||
templateData.twistie.classList.add('collapsible');
|
||||
templateData.twistie.classList.toggle('collapsed', node.collapsed);
|
||||
} else {
|
||||
templateData.twistie.classList.remove(...treeItemExpandedIcon.classNamesArray, 'collapsible', 'collapsed');
|
||||
templateData.twistie.classList.remove('collapsible', 'collapsed');
|
||||
}
|
||||
|
||||
if (node.collapsible) {
|
||||
@@ -507,8 +515,9 @@ class TreeRenderer<T, TFilterData, TRef, TTemplateData> implements IListRenderer
|
||||
}
|
||||
}
|
||||
|
||||
class TypeFilter<T> implements ITreeFilter<T, FuzzyScore>, IDisposable {
|
||||
export type LabelFuzzyScore = { label: string; score: FuzzyScore };
|
||||
|
||||
class TypeFilter<T> implements ITreeFilter<T, FuzzyScore | LabelFuzzyScore>, IDisposable {
|
||||
private _totalCount = 0;
|
||||
get totalCount(): number { return this._totalCount; }
|
||||
private _matchCount = 0;
|
||||
@@ -531,7 +540,7 @@ class TypeFilter<T> implements ITreeFilter<T, FuzzyScore>, IDisposable {
|
||||
tree.onWillRefilter(this.reset, this, this.disposables);
|
||||
}
|
||||
|
||||
filter(element: T, parentVisibility: TreeVisibility): TreeFilterResult<FuzzyScore> {
|
||||
filter(element: T, parentVisibility: TreeVisibility): TreeFilterResult<FuzzyScore | LabelFuzzyScore> {
|
||||
if (this._filter) {
|
||||
const result = this._filter.filter(element, parentVisibility);
|
||||
|
||||
@@ -562,27 +571,28 @@ class TypeFilter<T> implements ITreeFilter<T, FuzzyScore>, IDisposable {
|
||||
}
|
||||
|
||||
const label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(element);
|
||||
const labelStr = label && label.toString();
|
||||
const labels = Array.isArray(label) ? label : [label];
|
||||
|
||||
if (typeof labelStr === 'undefined') {
|
||||
return { data: FuzzyScore.Default, visibility: true };
|
||||
}
|
||||
|
||||
const score = fuzzyScore(this._pattern, this._lowercasePattern, 0, labelStr, labelStr.toLowerCase(), 0, true);
|
||||
|
||||
if (!score) {
|
||||
if (this.tree.options.filterOnType) {
|
||||
return TreeVisibility.Recurse;
|
||||
} else {
|
||||
for (const l of labels) {
|
||||
const labelStr = l && l.toString();
|
||||
if (typeof labelStr === 'undefined') {
|
||||
return { data: FuzzyScore.Default, visibility: true };
|
||||
}
|
||||
|
||||
// DEMO: smarter filter ?
|
||||
// return parentVisibility === TreeVisibility.Visible ? true : TreeVisibility.Recurse;
|
||||
const score = fuzzyScore(this._pattern, this._lowercasePattern, 0, labelStr, labelStr.toLowerCase(), 0, true);
|
||||
if (score) {
|
||||
this._matchCount++;
|
||||
return labels.length === 1 ?
|
||||
{ data: score, visibility: true } :
|
||||
{ data: { label: labelStr, score: score }, visibility: true };
|
||||
}
|
||||
}
|
||||
|
||||
this._matchCount++;
|
||||
return { data: score, visibility: true };
|
||||
if (this.tree.options.filterOnType) {
|
||||
return TreeVisibility.Recurse;
|
||||
} else {
|
||||
return { data: FuzzyScore.Default, visibility: true };
|
||||
}
|
||||
}
|
||||
|
||||
private reset(): void {
|
||||
@@ -809,7 +819,7 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
|
||||
const onDragOver = (event: DragEvent) => {
|
||||
event.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome)
|
||||
|
||||
const x = event.screenX - left;
|
||||
const x = event.clientX - left;
|
||||
if (event.dataTransfer) {
|
||||
event.dataTransfer.dropEffect = 'none';
|
||||
}
|
||||
@@ -952,6 +962,7 @@ export interface IAbstractTreeOptionsUpdate extends ITreeRendererOptions {
|
||||
readonly smoothScrolling?: boolean;
|
||||
readonly horizontalScrolling?: boolean;
|
||||
readonly expandOnlyOnDoubleClick?: boolean;
|
||||
readonly expandOnlyOnTwistieClick?: boolean | ((e: any) => boolean); // e is T
|
||||
}
|
||||
|
||||
export interface IAbstractTreeOptions<T, TFilterData = void> extends IAbstractTreeOptionsUpdate, IListOptions<T> {
|
||||
@@ -959,7 +970,6 @@ export interface IAbstractTreeOptions<T, TFilterData = void> extends IAbstractTr
|
||||
readonly filter?: ITreeFilter<T, TFilterData>;
|
||||
readonly dnd?: ITreeDragAndDrop<T>;
|
||||
readonly keyboardNavigationEventFilter?: IKeyboardNavigationEventFilter;
|
||||
readonly expandOnlyOnTwistieClick?: boolean | ((e: T) => boolean);
|
||||
readonly additionalScrollHeight?: number;
|
||||
}
|
||||
|
||||
@@ -992,7 +1002,7 @@ class Trait<T> {
|
||||
constructor(private identityProvider?: IIdentityProvider<T>) { }
|
||||
|
||||
set(nodes: ITreeNode<T, any>[], browserEvent?: UIEvent): void {
|
||||
if (equals(this.nodes, nodes)) {
|
||||
if (!(browserEvent as any)?.__forceEvent && equals(this.nodes, nodes)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1107,7 +1117,9 @@ class TreeNodeListMouseController<T, TFilterData, TRef> extends MouseController<
|
||||
expandOnlyOnTwistieClick = !!this.tree.expandOnlyOnTwistieClick;
|
||||
}
|
||||
|
||||
if (expandOnlyOnTwistieClick && !onTwistie) {
|
||||
const clickedOnFocus = this.tree.getFocus()[0] === node.element;
|
||||
|
||||
if (expandOnlyOnTwistieClick && !onTwistie && e.browserEvent.detail !== 2 && !(clickedOnFocus && !node.collapsed)) {
|
||||
return super.onViewPointer(e);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user