@jupyterlab/csvviewer 0.17.2 → 0.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/toolbar.js CHANGED
@@ -9,11 +9,11 @@ const apputils_1 = require("@jupyterlab/apputils");
9
9
  /**
10
10
  * The supported parsing delimiters.
11
11
  */
12
- const DELIMITERS = [',', ';', '\t'];
12
+ const DELIMITERS = [',', ';', '\t', '|'];
13
13
  /**
14
14
  * The labels for each delimiter as they appear in the dropdown menu.
15
15
  */
16
- const LABELS = [',', ';', 'tab'];
16
+ const LABELS = [',', ';', 'tab', 'pipe'];
17
17
  /**
18
18
  * The class name added to a csv toolbar widget.
19
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.js","sourceRoot":"","sources":["../../../../csvviewer/src/toolbar.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,2DAA2D;;AAE3D,mDAAgD;AAIhD,mDAAsD;AAEtD,+CAA2C;AAE3C,mDAA+C;AAE/C;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEjC;;GAEG;AACH,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAE9C,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAE1D;;GAEG;AACH,MAAM,4BAA4B,GAAG,0BAA0B,CAAC;AAEhE;;GAEG;AACH,kBAA0B,SAAQ,gBAAM;IACtC;;OAEG;IACH,YAAY,OAA4B;QACtC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAoDhD,sBAAiB,GAAG,IAAI,kBAAM,CAAe,IAAI,CAAC,CAAC;QAnDzD,IAAI,CAAC,QAAQ,CAAC,mBAAmB,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,IAAI,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC9C,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;YACzB,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAC3B,IAAI,SAAS,KAAK,QAAQ,EAAE;gBAC1B,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;aACxB;YACD,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,IAAI,GAAG,kBAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACjD,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,GAAG,CAAC;IACb,CAAC;IApBe,kBAAU,aAoBzB,CAAA;AACH,CAAC,EAzBS,OAAO,KAAP,OAAO,QAyBhB","sourcesContent":["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { each, zip } from '@phosphor/algorithm';\n\nimport { Message } from '@phosphor/messaging';\n\nimport { ISignal, Signal } from '@phosphor/signaling';\n\nimport { Widget } from '@phosphor/widgets';\n\nimport { Styling } from '@jupyterlab/apputils';\n\n/**\n * The supported parsing delimiters.\n */\nconst DELIMITERS = [',', ';', '\\t'];\n\n/**\n * The labels for each delimiter as they appear in the dropdown menu.\n */\nconst LABELS = [',', ';', 'tab'];\n\n/**\n * The class name added to a csv toolbar widget.\n */\nconst CSV_DELIMITER_CLASS = 'jp-CSVDelimiter';\n\nconst CSV_DELIMITER_LABEL_CLASS = 'jp-CSVDelimiter-label';\n\n/**\n * The class name added to a csv toolbar's dropdown element.\n */\nconst CSV_DELIMITER_DROPDOWN_CLASS = 'jp-CSVDelimiter-dropdown';\n\n/**\n * A widget for selecting a delimiter.\n */\nexport class CSVDelimiter extends Widget {\n /**\n * Construct a new csv table widget.\n */\n constructor(options: CSVToolbar.IOptions) {\n super({ node: Private.createNode(options.selected) });\n this.addClass(CSV_DELIMITER_CLASS);\n }\n\n /**\n * A signal emitted when the delimiter selection has changed.\n */\n get delimiterChanged(): ISignal<this, string> {\n return this._delimiterChanged;\n }\n\n /**\n * The delimiter dropdown menu.\n */\n get selectNode(): HTMLSelectElement {\n return this.node.getElementsByTagName('select')![0];\n }\n\n /**\n * Handle the DOM events for the widget.\n *\n * @param event - The DOM event sent to the widget.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the dock panel's node. It should\n * not be called directly by user code.\n */\n handleEvent(event: Event): void {\n switch (event.type) {\n case 'change':\n this._delimiterChanged.emit(this.selectNode.value);\n break;\n default:\n break;\n }\n }\n\n /**\n * Handle `after-attach` messages for the widget.\n */\n protected onAfterAttach(msg: Message): void {\n this.selectNode.addEventListener('change', this);\n }\n\n /**\n * Handle `before-detach` messages for the widget.\n */\n protected onBeforeDetach(msg: Message): void {\n this.selectNode.removeEventListener('change', this);\n }\n\n private _delimiterChanged = new Signal<this, string>(this);\n}\n\n/**\n * A namespace for `CSVToolbar` statics.\n */\nexport namespace CSVToolbar {\n /**\n * The instantiation options for a CSV toolbar.\n */\n export interface IOptions {\n /**\n * The initially selected delimiter.\n */\n selected: string;\n }\n}\n\n/**\n * A namespace for private toolbar methods.\n */\nnamespace Private {\n /**\n * Create the node for the delimiter switcher.\n */\n export function createNode(selected: string): HTMLElement {\n let div = document.createElement('div');\n let label = document.createElement('span');\n let select = document.createElement('select');\n label.textContent = 'Delimiter: ';\n label.className = CSV_DELIMITER_LABEL_CLASS;\n each(zip(DELIMITERS, LABELS), ([delimiter, label]) => {\n let option = document.createElement('option');\n option.value = delimiter;\n option.textContent = label;\n if (delimiter === selected) {\n option.selected = true;\n }\n select.appendChild(option);\n });\n div.appendChild(label);\n let node = Styling.wrapSelect(select);\n node.classList.add(CSV_DELIMITER_DROPDOWN_CLASS);\n div.appendChild(node);\n return div;\n }\n}\n"]}
1
+ {"version":3,"file":"toolbar.js","sourceRoot":"","sources":["../../../../csvviewer/src/toolbar.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,2DAA2D;;AAE3D,mDAAgD;AAIhD,mDAAsD;AAEtD,+CAA2C;AAE3C,mDAA+C;AAE/C;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAEzC;;GAEG;AACH,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAE9C,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAE1D;;GAEG;AACH,MAAM,4BAA4B,GAAG,0BAA0B,CAAC;AAEhE;;GAEG;AACH,kBAA0B,SAAQ,gBAAM;IACtC;;OAEG;IACH,YAAY,OAA4B;QACtC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAoDhD,sBAAiB,GAAG,IAAI,kBAAM,CAAe,IAAI,CAAC,CAAC;QAnDzD,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAE,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;;OASG;IACH,WAAW,CAAC,KAAY;QACtB,QAAQ,KAAK,CAAC,IAAI,EAAE;YAClB,KAAK,QAAQ;gBACX,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,UA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AC,UAAU,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACjD,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,GAAG,CAAC;IACb,CAAC;IApBe,kBAAU,aAoBzB,CAAA;AACH,CAAC,EAzBS,OAAO,KAAP,OAAO,QAyBhB","sourcesContent":["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { each, zip } from '@phosphor/algorithm';\n\nimport { Message } from '@phosphor/messaging';\n\nimport { ISignal, Signal } from '@phosphor/signaling';\n\nimport { Widget } from '@phosphor/widgets';\n\nimport { Styling } from '@jupyterlab/apputils';\n\n/**\n * The supported parsing delimiters.\n */\nconst DELIMITERS = [',', ';', '\\t', '|'];\n\n/**\n * The labels for each delimiter as they appear in the dropdown menu.\n */\nconst LABELS = [',', ';', 'tab', 'pipe'];\n\n/**\n * The class name added to a csv toolbar widget.\n */\nconst CSV_DELIMITER_CLASS = 'jp-CSVDelimiter';\n\nconst CSV_DELIMITER_LABEL_CLASS = 'jp-CSVDelimiter-label';\n\n/**\n * The class name added to a csv toolbar's dropdown element.\n */\nconst CSV_DELIMITER_DROPDOWN_CLASS = 'jp-CSVDelimiter-dropdown';\n\n/**\n * A widget for selecting a delimiter.\n */\nexport class CSVDelimiter extends Widget {\n /**\n * Construct a new csv table widget.\n */\n constructor(options: CSVToolbar.IOptions) {\n super({ node: Private.createNode(options.selected) });\n this.addClass(CSV_DELIMITER_CLASS);\n }\n\n /**\n * A signal emitted when the delimiter selection has changed.\n */\n get delimiterChanged(): ISignal<this, string> {\n return this._delimiterChanged;\n }\n\n /**\n * The delimiter dropdown menu.\n */\n get selectNode(): HTMLSelectElement {\n return this.node.getElementsByTagName('select')![0];\n }\n\n /**\n * Handle the DOM events for the widget.\n *\n * @param event - The DOM event sent to the widget.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the dock panel's node. It should\n * not be called directly by user code.\n */\n handleEvent(event: Event): void {\n switch (event.type) {\n case 'change':\n this._delimiterChanged.emit(this.selectNode.value);\n break;\n default:\n break;\n }\n }\n\n /**\n * Handle `after-attach` messages for the widget.\n */\n protected onAfterAttach(msg: Message): void {\n this.selectNode.addEventListener('change', this);\n }\n\n /**\n * Handle `before-detach` messages for the widget.\n */\n protected onBeforeDetach(msg: Message): void {\n this.selectNode.removeEventListener('change', this);\n }\n\n private _delimiterChanged = new Signal<this, string>(this);\n}\n\n/**\n * A namespace for `CSVToolbar` statics.\n */\nexport namespace CSVToolbar {\n /**\n * The instantiation options for a CSV toolbar.\n */\n export interface IOptions {\n /**\n * The initially selected delimiter.\n */\n selected: string;\n }\n}\n\n/**\n * A namespace for private toolbar methods.\n */\nnamespace Private {\n /**\n * Create the node for the delimiter switcher.\n */\n export function createNode(selected: string): HTMLElement {\n let div = document.createElement('div');\n let label = document.createElement('span');\n let select = document.createElement('select');\n label.textContent = 'Delimiter: ';\n label.className = CSV_DELIMITER_LABEL_CLASS;\n each(zip(DELIMITERS, LABELS), ([delimiter, label]) => {\n let option = document.createElement('option');\n option.value = delimiter;\n option.textContent = label;\n if (delimiter === selected) {\n option.selected = true;\n }\n select.appendChild(option);\n });\n div.appendChild(label);\n let node = Styling.wrapSelect(select);\n node.classList.add(CSV_DELIMITER_DROPDOWN_CLASS);\n div.appendChild(node);\n return div;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/csvviewer",
3
- "version": "0.17.2",
3
+ "version": "0.18.4",
4
4
  "description": "JupyterLab - CSV Widget",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -30,9 +30,9 @@
30
30
  "watch": "tsc -w --listEmittedFiles"
31
31
  },
32
32
  "dependencies": {
33
- "@jupyterlab/apputils": "^0.17.2",
34
- "@jupyterlab/coreutils": "^2.0.2",
35
- "@jupyterlab/docregistry": "^0.17.2",
33
+ "@jupyterlab/apputils": "^0.18.4",
34
+ "@jupyterlab/coreutils": "^2.1.4",
35
+ "@jupyterlab/docregistry": "^0.18.4",
36
36
  "@phosphor/algorithm": "^1.1.2",
37
37
  "@phosphor/coreutils": "^1.3.0",
38
38
  "@phosphor/datagrid": "^0.1.6",