SQL Operations Studio Public Preview 1 (0.23) release source code

This commit is contained in:
Karl Burtram
2017-11-09 14:30:27 -08:00
parent b88ecb8d93
commit 3cdac41339
8829 changed files with 759707 additions and 286 deletions

View File

@@ -0,0 +1,26 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { ElementRef, Directive, Inject, Output, EventEmitter, forwardRef } from '@angular/core';
@Directive({
selector: '[mousedown]'
})
export class MouseDownDirective {
@Output('mousedown') onMouseDown = new EventEmitter();
constructor(@Inject(forwardRef(() => ElementRef)) private _el: ElementRef) {
const self = this;
setTimeout(() => {
let $gridCanvas = $(this._el.nativeElement).find('.grid-canvas');
$gridCanvas.on('mousedown', () => {
self.onMouseDown.emit();
});
let jQueryCast: any = $;
let mouseDownFuncs: any[] = jQueryCast._data($gridCanvas[0], 'events')['mousedown'];
// reverse the event array so that our event fires first.
mouseDownFuncs.reverse();
});
}
}

View File

@@ -0,0 +1,24 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { ElementRef, Directive, Input, Output, EventEmitter, forwardRef,
Inject } from '@angular/core';
import { Observable } from 'rxjs/Observable';
@Directive({
selector: '[onScroll]'
})
export class ScrollDirective {
@Input() scrollEnabled: boolean = true;
@Output('onScroll') onScroll = new EventEmitter();
constructor(@Inject(forwardRef(() => ElementRef)) private _el: ElementRef) {
const self = this;
Observable.fromEvent(this._el.nativeElement, 'scroll').subscribe((event) => {
if (self.scrollEnabled) {
self.onScroll.emit(self._el.nativeElement.scrollTop);
}
});
}
}