Move notebooks to workbench (#4888)

* move notebooks under workbench

* fix style imports
This commit is contained in:
Anthony Dresser
2019-04-09 01:59:55 -07:00
committed by GitHub
parent 4ece9b0085
commit 2fb06e7f4f
87 changed files with 109 additions and 114 deletions

View File

@@ -0,0 +1,85 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./placeholder';
import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, SimpleChange, OnChanges } from '@angular/core';
import { CellView } from 'sql/workbench/parts/notebook/cellViews/interfaces';
import { ICellModel } from 'sql/workbench/parts/notebook/models/modelInterfaces';
import { NotebookModel } from 'sql/workbench/parts/notebook/models/notebookModel';
import { localize } from 'vs/nls';
import { CellType } from 'sql/workbench/parts/notebook/models/contracts';
export const PLACEHOLDER_SELECTOR: string = 'placeholder-cell-component';
@Component({
selector: PLACEHOLDER_SELECTOR,
templateUrl: decodeURI(require.toUrl('./placeholderCell.component.html'))
})
export class PlaceholderCellComponent extends CellView implements OnInit, OnChanges {
@Input() cellModel: ICellModel;
@Input() set model(value: NotebookModel) {
this._model = value;
}
private _model: NotebookModel;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
) {
super();
}
ngOnInit() {
if (this.cellModel) {
this._register(this.cellModel.onOutputsChanged(() => {
this._changeRef.detectChanges();
}));
}
}
ngOnChanges(changes: { [propKey: string]: SimpleChange }) {
}
get model(): NotebookModel {
return this._model;
}
get clickOn(): string {
return localize('clickOn','Click on');
}
get plusCode(): string {
return localize('plusCode', '+ Code');
}
get or(): string {
return localize('or', 'or');
}
get plusText(): string {
return localize('plusText', '+ Text');
}
get toAddCell(): string {
return localize('toAddCell', 'to add a code or text cell');
}
public addCell(cellType: string, event?: Event): void {
if (event) {
event.stopPropagation();
}
let type: CellType = <CellType>cellType;
if (!type) {
type = 'code';
}
this._model.addCell(<CellType>cellType);
}
public layout() {
}
}