Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should create a new metadata editor', () => {
let newEditor = new JSONEditor({ editorFactory });
expect(newEditor).to.be.an.instanceof(JSONEditor);
});
});
it('should create a new metadata editor', () => {
let newEditor = new JSONEditor({ editorFactory });
expect(newEditor).to.be.a(JSONEditor);
});
it('should create a new metadata editor', () => {
let newEditor = new JSONEditor({ editorFactory });
expect(newEditor).to.be.an.instanceof(JSONEditor);
});
});
it ('should be settable in the constructor', () => {
let newEditor = new JSONEditor({ editorFactory, collapsible: true });
expect(newEditor.collapsible).to.be(true);
});
it ('should be settable in the constructor', () => {
let newEditor = new JSONEditor({ editorFactory, title: 'foo' });
expect(newEditor.editorTitle).to.be('foo');
});
constructor(options: MetadataEditorTool.IOptions) {
super();
const { editorFactory } = options;
this.addClass('jp-MetadataEditorTool');
let layout = (this.layout = new PanelLayout());
this.editor = new JSONEditor({
editorFactory
});
this.editor.title.label = options.label || 'Edit Metadata';
const titleNode = new Widget({ node: document.createElement('label') });
titleNode.node.textContent = options.label || 'Edit Metadata';
layout.addWidget(titleNode);
layout.addWidget(this.editor);
}
constructor(options: MetadataEditorTool.IOptions) {
super();
const { editorFactory } = options;
this.addClass('jp-MetadataEditorTool');
let layout = (this.layout = new PanelLayout());
this.editor = new JSONEditor<
INotebookData.Schema | ICellData.Schema,
'metadata'
>({
editorFactory
});
this.editor.title.label = options.label || 'Edit Metadata';
const titleNode = new Widget({ node: document.createElement('label') });
titleNode.node.textContent = options.label || 'Edit Metadata';
layout.addWidget(titleNode);
layout.addWidget(this.editor);
}
constructor(options: MetadataEditorTool.IOptions) {
super();
const { editorFactory } = options;
this.addClass('jp-MetadataEditorTool');
let layout = (this.layout = new PanelLayout());
this.editor = new JSONEditor({
editorFactory
});
this.editor.title.label = options.label || 'Edit Metadata';
const titleNode = new Widget({ node: document.createElement('label') });
titleNode.node.textContent = options.label || 'Edit Metadata';
layout.addWidget(titleNode);
layout.addWidget(this.editor);
}
constructor(options: PluginEditor.IOptions) {
super();
this.addClass(PLUGIN_EDITOR_CLASS);
const { editorFactory } = options;
const collapsible = false;
const layout = this.layout = new PanelLayout();
const panel = this._panel = new SplitPanel({
orientation: 'vertical',
renderer: SplitPanel.defaultRenderer,
spacing: 1
});
this.handleMoved = panel.handleMoved;
this._editor = new JSONEditor({ collapsible, editorFactory });
this._fieldset = new PluginFieldset();
layout.addWidget(panel);
panel.addWidget(this._editor);
panel.addWidget(this._fieldset);
}