@jupyterlab/filebrowser
Advanced tools
Comparing version 1.0.0-alpha.12 to 1.0.0-alpha.13
@@ -36,2 +36,9 @@ import { Toolbar } from '@jupyterlab/apputils'; | ||
/** | ||
* Select an item by name. | ||
* | ||
* @param name - The name of the item to select. | ||
*/ | ||
selectItemByName(name: string): Promise<void>; | ||
clearSelectedItems(): void; | ||
/** | ||
* Rename the first currently selected item. | ||
@@ -102,2 +109,6 @@ * | ||
private _onConnectionFailure; | ||
/** | ||
* Whether to show active file in file browser | ||
*/ | ||
navigateToCurrentDirectory: boolean; | ||
private _crumbs; | ||
@@ -107,2 +118,3 @@ private _listing; | ||
private _directoryPending; | ||
private _navigateToCurrentDirectory; | ||
} | ||
@@ -109,0 +121,0 @@ /** |
@@ -87,2 +87,13 @@ // Copyright (c) Jupyter Development Team. | ||
/** | ||
* Select an item by name. | ||
* | ||
* @param name - The name of the item to select. | ||
*/ | ||
async selectItemByName(name) { | ||
await this._listing.selectItemByName(name); | ||
} | ||
clearSelectedItems() { | ||
this._listing.clearSelectedItems(); | ||
} | ||
/** | ||
* Rename the first currently selected item. | ||
@@ -204,2 +215,11 @@ * | ||
} | ||
/** | ||
* Whether to show active file in file browser | ||
*/ | ||
get navigateToCurrentDirectory() { | ||
return this._navigateToCurrentDirectory; | ||
} | ||
set navigateToCurrentDirectory(value) { | ||
this._navigateToCurrentDirectory = value; | ||
} | ||
} |
@@ -147,5 +147,9 @@ import { DocumentRegistry } from '@jupyterlab/docregistry'; | ||
/** | ||
* Clear the selected items. | ||
*/ | ||
clearSelectedItems(): void; | ||
/** | ||
* Select an item by name. | ||
* | ||
* @parem name - The name of the item to select. | ||
* @param name - The name of the item to select. | ||
* | ||
@@ -152,0 +156,0 @@ * @returns A promise that resolves when the name is selected. |
@@ -488,23 +488,28 @@ // Copyright (c) Jupyter Development Team. | ||
/** | ||
* Clear the selected items. | ||
*/ | ||
clearSelectedItems() { | ||
this._selection = Object.create(null); | ||
} | ||
/** | ||
* Select an item by name. | ||
* | ||
* @parem name - The name of the item to select. | ||
* @param name - The name of the item to select. | ||
* | ||
* @returns A promise that resolves when the name is selected. | ||
*/ | ||
selectItemByName(name) { | ||
async selectItemByName(name) { | ||
// Make sure the file is available. | ||
return this.model.refresh().then(() => { | ||
if (this.isDisposed) { | ||
throw new Error('File browser is disposed.'); | ||
} | ||
let items = this._sortedItems; | ||
let index = ArrayExt.findFirstIndex(items, value => value.name === name); | ||
if (index === -1) { | ||
throw new Error('Item does not exist.'); | ||
} | ||
this._selectItem(index, false); | ||
MessageLoop.sendMessage(this, Widget.Msg.UpdateRequest); | ||
ElementExt.scrollIntoViewIfNeeded(this.contentNode, this._items[index]); | ||
}); | ||
await this.model.refresh(); | ||
if (this.isDisposed) { | ||
throw new Error('File browser is disposed.'); | ||
} | ||
let items = this._sortedItems; | ||
let index = ArrayExt.findFirstIndex(items, value => value.name === name); | ||
if (index === -1) { | ||
throw new Error('Item does not exist.'); | ||
} | ||
this._selectItem(index, false); | ||
MessageLoop.sendMessage(this, Widget.Msg.UpdateRequest); | ||
ElementExt.scrollIntoViewIfNeeded(this.contentNode, this._items[index]); | ||
} | ||
@@ -772,3 +777,3 @@ /** | ||
if (!altered && event.button === 0) { | ||
this._selection = Object.create(null); | ||
this.clearSelectedItems(); | ||
this._selection[this._softSelection] = true; | ||
@@ -1120,3 +1125,3 @@ this.update(); | ||
// Select only the given item. | ||
this._selection = Object.create(null); | ||
this.clearSelectedItems(); | ||
this._selection[name] = true; | ||
@@ -1249,3 +1254,3 @@ } | ||
if (!keepExisting) { | ||
this._selection = Object.create(null); | ||
this.clearSelectedItems(); | ||
} | ||
@@ -1262,3 +1267,3 @@ let name = items[index].name; | ||
let existing = Object.keys(this._selection); | ||
this._selection = Object.create(null); | ||
this.clearSelectedItems(); | ||
each(this._model.items(), item => { | ||
@@ -1283,3 +1288,3 @@ let name = item.name; | ||
// Reset the selection. | ||
this._selection = Object.create(null); | ||
this.clearSelectedItems(); | ||
// Update the sorted items. | ||
@@ -1286,0 +1291,0 @@ this.sort(this.sortState); |
{ | ||
"name": "@jupyterlab/filebrowser", | ||
"version": "1.0.0-alpha.12", | ||
"version": "1.0.0-alpha.13", | ||
"description": "JupyterLab - FileBrowser Widget", | ||
@@ -38,8 +38,8 @@ "homepage": "https://github.com/jupyterlab/jupyterlab", | ||
"dependencies": { | ||
"@jupyterlab/apputils": "^1.0.0-alpha.12", | ||
"@jupyterlab/coreutils": "^3.0.0-alpha.12", | ||
"@jupyterlab/docmanager": "^1.0.0-alpha.12", | ||
"@jupyterlab/docregistry": "^1.0.0-alpha.12", | ||
"@jupyterlab/services": "^4.0.0-alpha.12", | ||
"@jupyterlab/statusbar": "^1.0.0-alpha.12", | ||
"@jupyterlab/apputils": "^1.0.0-alpha.13", | ||
"@jupyterlab/coreutils": "^3.0.0-alpha.13", | ||
"@jupyterlab/docmanager": "^1.0.0-alpha.13", | ||
"@jupyterlab/docregistry": "^1.0.0-alpha.13", | ||
"@jupyterlab/services": "^4.0.0-alpha.13", | ||
"@jupyterlab/statusbar": "^1.0.0-alpha.13", | ||
"@phosphor/algorithm": "^1.1.3", | ||
@@ -63,3 +63,3 @@ "@phosphor/coreutils": "^1.3.1", | ||
}, | ||
"gitHead": "f2ca9197ffb3e1d3029f3cc687f9b7cbbe36e159" | ||
"gitHead": "6902480eee213e58fb0b51ce28faa1c057dbc45e" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
142300
4275
32630
7
0
49