--- /tmp/lumino-0~20200824+git93880412-2w0t_kaw5/debian/node-lumino_0~20200824+git93880412-2_all.deb +++ node-lumino_0~20200824+git93880412-2_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2020-11-22 20:28:32.000000 debian-binary │ --rw-r--r-- 0 0 0 13740 2020-11-22 20:28:32.000000 control.tar.xz │ --rw-r--r-- 0 0 0 594908 2020-11-22 20:28:32.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 13736 2020-11-22 20:28:32.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 595812 2020-11-22 20:28:32.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ ├── data.tar.xz │ ├── data.tar │ │ ├── ./usr/share/doc/node-lumino/examples/example-datagrid/build/bundle.example.js │ │ │ ├── js-beautify {} │ │ │ │ @@ -168,273 +168,273 @@ │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/commandpalette.css": │ │ │ │ /*!***************************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/commandpalette.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/commandpalette.css ***! │ │ │ │ \***************************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-CommandPalette, /* */\\n.lm-CommandPalette {\\n font-family: sans-serif;\\n background: #F5F5F5;\\n}\\n\\n\\n/* */ .p-CommandPalette-search, /* */\\n.lm-CommandPalette-search {\\n padding: 8px;\\n}\\n\\n\\n/* */ .p-CommandPalette-wrapper, /* */\\n.lm-CommandPalette-wrapper {\\n padding: 4px 6px;\\n background: white;\\n border: 1px solid #E0E0E0;\\n position: relative;\\n}\\n\\n\\n/* */ .p-CommandPalette-input, /* */\\n.lm-CommandPalette-input {\\n width: 92%;\\n border: none;\\n outline: none;\\n font-size: 16px;\\n}\\n\\n\\n/* */ .p-CommandPalette-header, /* */\\n.lm-CommandPalette-header {\\n padding: 4px;\\n color: #757575;\\n font-size: 12px;\\n font-weight: 600;\\n background: #E1E1E1;\\n cursor: pointer;\\n}\\n\\n\\n/* */ .p-CommandPalette-header:hover::before, /* */\\n.lm-CommandPalette-header:hover::before {\\n content: '\\\\2026'; /* ellipsis */\\n float: right;\\n margin-right: 4px;\\n}\\n\\n\\n/* */ .p-CommandPalette-header > mark, /* */\\n.lm-CommandPalette-header > mark {\\n background-color: transparent;\\n font-weight: bold;\\n}\\n\\n\\n/* */ .p-CommandPalette-item, /* */\\n.lm-CommandPalette-item {\\n padding: 4px 8px;\\n color: #757575;\\n font-size: 13px;\\n font-weight: 500;\\n}\\n\\n\\n/* */ .p-CommandPalette-emptyMessage, /* */\\n.lm-CommandPalette-emptyMessage {\\n padding: 4px;\\n color: #757575;\\n font-size: 12px;\\n font-weight: 600;\\n text-align: center;\\n}\\n\\n\\n/* */ .p-CommandPalette-item.p-mod-disabled, /* */\\n.lm-CommandPalette-item.lm-mod-disabled {\\n color: rgba(0, 0, 0, 0.25);\\n}\\n\\n\\n/* */ .p-CommandPalette-item.p-mod-active, /* */\\n.lm-CommandPalette-item.lm-mod-active {\\n background: #7FDBFF;\\n}\\n\\n\\n/* */\\n.p-CommandPalette-item:hover:not(.p-mod-active):not(.p-mod-disabled),\\n/* */\\n.lm-CommandPalette-item:hover:not(.lm-mod-active):not(.lm-mod-disabled) {\\n background: #E5E5E5;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemIcon, /* */\\n.lm-CommandPalette-itemIcon {\\n display: none;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemLabel > mark, /* */\\n.lm-CommandPalette-itemLabel > mark {\\n background-color: transparent;\\n font-weight: bold;\\n}\\n\\n\\n/* */\\n.p-CommandPalette-item.p-mod-disabled mark,\\n/* */\\n.lm-CommandPalette-item.lm-mod-disabled mark {\\n color: rgba(0, 0, 0, 0.4);\\n}\\n\\n\\n/* */ .p-CommandPalette-itemCaption, /* */\\n.lm-CommandPalette-itemCaption {\\n color: #9E9E9E;\\n font-size: 11px;\\n font-weight: 400;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/commandpalette.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-CommandPalette, /* */\\n.lm-CommandPalette {\\n font-family: sans-serif;\\n background: #F5F5F5;\\n}\\n\\n\\n/* */ .p-CommandPalette-search, /* */\\n.lm-CommandPalette-search {\\n padding: 8px;\\n}\\n\\n\\n/* */ .p-CommandPalette-wrapper, /* */\\n.lm-CommandPalette-wrapper {\\n padding: 4px 6px;\\n background: white;\\n border: 1px solid #E0E0E0;\\n position: relative;\\n}\\n\\n\\n/* */ .p-CommandPalette-input, /* */\\n.lm-CommandPalette-input {\\n width: 92%;\\n border: none;\\n outline: none;\\n font-size: 16px;\\n}\\n\\n\\n/* */ .p-CommandPalette-header, /* */\\n.lm-CommandPalette-header {\\n padding: 4px;\\n color: #757575;\\n font-size: 12px;\\n font-weight: 600;\\n background: #E1E1E1;\\n cursor: pointer;\\n}\\n\\n\\n/* */ .p-CommandPalette-header:hover::before, /* */\\n.lm-CommandPalette-header:hover::before {\\n content: '\\\\2026'; /* ellipsis */\\n float: right;\\n margin-right: 4px;\\n}\\n\\n\\n/* */ .p-CommandPalette-header > mark, /* */\\n.lm-CommandPalette-header > mark {\\n background-color: transparent;\\n font-weight: bold;\\n}\\n\\n\\n/* */ .p-CommandPalette-item, /* */\\n.lm-CommandPalette-item {\\n padding: 4px 8px;\\n color: #757575;\\n font-size: 13px;\\n font-weight: 500;\\n}\\n\\n\\n/* */ .p-CommandPalette-emptyMessage, /* */\\n.lm-CommandPalette-emptyMessage {\\n padding: 4px;\\n color: #757575;\\n font-size: 12px;\\n font-weight: 600;\\n text-align: center;\\n}\\n\\n\\n/* */ .p-CommandPalette-item.p-mod-disabled, /* */\\n.lm-CommandPalette-item.lm-mod-disabled {\\n color: rgba(0, 0, 0, 0.25);\\n}\\n\\n\\n/* */ .p-CommandPalette-item.p-mod-active, /* */\\n.lm-CommandPalette-item.lm-mod-active {\\n background: #7FDBFF;\\n}\\n\\n\\n/* */\\n.p-CommandPalette-item:hover:not(.p-mod-active):not(.p-mod-disabled),\\n/* */\\n.lm-CommandPalette-item:hover:not(.lm-mod-active):not(.lm-mod-disabled) {\\n background: #E5E5E5;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemIcon, /* */\\n.lm-CommandPalette-itemIcon {\\n display: none;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemLabel > mark, /* */\\n.lm-CommandPalette-itemLabel > mark {\\n background-color: transparent;\\n font-weight: bold;\\n}\\n\\n\\n/* */\\n.p-CommandPalette-item.p-mod-disabled mark,\\n/* */\\n.lm-CommandPalette-item.lm-mod-disabled mark {\\n color: rgba(0, 0, 0, 0.4);\\n}\\n\\n\\n/* */ .p-CommandPalette-itemCaption, /* */\\n.lm-CommandPalette-itemCaption {\\n color: #9E9E9E;\\n font-size: 11px;\\n font-weight: 400;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/commandpalette.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/datagrid.css": │ │ │ │ /*!*********************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/datagrid.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/datagrid.css ***! │ │ │ │ \*********************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) 2014-2018, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-DataGrid, /* */\\n.lm-DataGrid {\\n min-width: 64px;\\n min-height: 64px;\\n border: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */ .p-DataGrid-scrollCorner, /* */\\n.lm-DataGrid-scrollCorner {\\n background-color: #F0F0F0;\\n}\\n\\n\\n/* */ .p-DataGrid-scrollCorner::after, /* */\\n.lm-DataGrid-scrollCorner::after {\\n content: '';\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 1px;\\n height: 1px;\\n background-color: #A0A0A0;\\n}\\n\\n.lm-DataGrid-cellEditorOccluder {\\n pointer-events: none;\\n position: absolute;\\n overflow: hidden;\\n}\\n\\n.lm-DataGrid-cellEditorContainer {\\n pointer-events: auto;\\n position: absolute;\\n background-color: #ffffff;\\n box-sizing: border-box;\\n box-shadow: 0px 0px 6px #006bf7;\\n border: 2px solid #006bf7;\\n}\\n\\n.lm-DataGrid-cellEditorContainer.lm-mod-invalid {\\n box-shadow: 0px 0px 6px red;\\n border: 2px solid red;\\n}\\n\\n.lm-DataGrid-cellEditorContainer > form {\\n width: 100%;\\n height: 100%;\\n overflow: hidden;\\n}\\n\\n.lm-DataGrid-cellEditorWidget {\\n width: 100%;\\n height: 100%;\\n outline: none;\\n box-sizing: border-box;\\n}\\n\\n.lm-DataGrid-cellEditorInput {\\n background-color: #ffffff;\\n border: 0;\\n}\\n\\n.lm-DataGrid-cellEditorCheckbox {\\n margin: 0;\\n}\\n\\n.lm-DataGrid-notification {\\n position: absolute;\\n display: flex;\\n overflow: visible;\\n animation: fade-in 300ms ease-out;\\n}\\n\\n.lm-DataGrid-notificationContainer {\\n box-shadow: 0px 2px 5px #999999;\\n border-radius: 3px;\\n background-color: white;\\n color: black;\\n border: 1px solid black;\\n font-family: sans-serif;\\n font-size: 13px;\\n padding: 4px;\\n}\\n\\n@keyframes fade-in {\\n 0% {\\n opacity: 0;\\n }\\n 50% {\\n opacity: 0.7;\\n }\\n 100% {\\n opacity: 1;\\n }\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/datagrid.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) 2014-2018, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-DataGrid, /* */\\n.lm-DataGrid {\\n min-width: 64px;\\n min-height: 64px;\\n border: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */ .p-DataGrid-scrollCorner, /* */\\n.lm-DataGrid-scrollCorner {\\n background-color: #F0F0F0;\\n}\\n\\n\\n/* */ .p-DataGrid-scrollCorner::after, /* */\\n.lm-DataGrid-scrollCorner::after {\\n content: '';\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 1px;\\n height: 1px;\\n background-color: #A0A0A0;\\n}\\n\\n.lm-DataGrid-cellEditorOccluder {\\n pointer-events: none;\\n position: absolute;\\n overflow: hidden;\\n}\\n\\n.lm-DataGrid-cellEditorContainer {\\n pointer-events: auto;\\n position: absolute;\\n background-color: #ffffff;\\n box-sizing: border-box;\\n box-shadow: 0px 0px 6px #006bf7;\\n border: 2px solid #006bf7;\\n}\\n\\n.lm-DataGrid-cellEditorContainer.lm-mod-invalid {\\n box-shadow: 0px 0px 6px red;\\n border: 2px solid red;\\n}\\n\\n.lm-DataGrid-cellEditorContainer > form {\\n width: 100%;\\n height: 100%;\\n overflow: hidden;\\n}\\n\\n.lm-DataGrid-cellEditorWidget {\\n width: 100%;\\n height: 100%;\\n outline: none;\\n box-sizing: border-box;\\n}\\n\\n.lm-DataGrid-cellEditorInput {\\n background-color: #ffffff;\\n border: 0;\\n}\\n\\n.lm-DataGrid-cellEditorCheckbox {\\n margin: 0;\\n}\\n\\n.lm-DataGrid-notification {\\n position: absolute;\\n display: flex;\\n overflow: visible;\\n animation: fade-in 300ms ease-out;\\n}\\n\\n.lm-DataGrid-notificationContainer {\\n box-shadow: 0px 2px 5px #999999;\\n border-radius: 3px;\\n background-color: white;\\n color: black;\\n border: 1px solid black;\\n font-family: sans-serif;\\n font-size: 13px;\\n padding: 4px;\\n}\\n\\n@keyframes fade-in {\\n 0% {\\n opacity: 0;\\n }\\n 50% {\\n opacity: 0.7;\\n }\\n 100% {\\n opacity: 1;\\n }\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/datagrid.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/dockpanel.css": │ │ │ │ /*!**********************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/dockpanel.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/dockpanel.css ***! │ │ │ │ \**********************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-DockPanel-overlay, /* */\\n.lm-DockPanel-overlay {\\n background: rgba(255, 255, 255, 0.6);\\n border: 1px dashed black;\\n transition-property: top, left, right, bottom;\\n transition-duration: 150ms;\\n transition-timing-function: ease;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/dockpanel.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-DockPanel-overlay, /* */\\n.lm-DockPanel-overlay {\\n background: rgba(255, 255, 255, 0.6);\\n border: 1px dashed black;\\n transition-property: top, left, right, bottom;\\n transition-duration: 150ms;\\n transition-timing-function: ease;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/dockpanel.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/index.css": │ │ │ │ /*!******************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/index.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/index.css ***! │ │ │ │ \******************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Imports\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!@lumino/dragdrop/style/index.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/dragdrop/style/index.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!@lumino/widgets/style/index.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/index.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./commandpalette.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/commandpalette.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./datagrid.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/datagrid.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./dockpanel.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/dockpanel.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./menu.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/menu.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./menubar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/menubar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./scrollbar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/scrollbar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./tabbar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/tabbar.css\"), \"\");\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) 2014-2018, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/index.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Imports\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!@lumino/dragdrop/style/index.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/dragdrop/style/index.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!@lumino/widgets/style/index.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/index.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./commandpalette.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/commandpalette.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./datagrid.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/datagrid.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./dockpanel.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/dockpanel.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./menu.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/menu.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./menubar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/menubar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./scrollbar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/scrollbar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./tabbar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/tabbar.css\"), \"\");\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) 2014-2018, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/index.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/menu.css": │ │ │ │ /*!*****************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/menu.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/menu.css ***! │ │ │ │ \*****************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-Menu, /* */\\n.lm-Menu {\\n padding: 3px 0px;\\n background: white;\\n color: rgba(0, 0, 0, 0.87);\\n border: 1px solid #C0C0C0;\\n font: 12px Helvetica, Arial, sans-serif;\\n box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.2);\\n}\\n\\n\\n/* */ .p-Menu-item.p-mod-active, /* */\\n.lm-Menu-item.lm-mod-active {\\n background: #E5E5E5;\\n}\\n\\n\\n/* */ .p-Menu-item.p-mod-disabled, /* */\\n.lm-Menu-item.lm-mod-disabled {\\n color: rgba(0, 0, 0, 0.25);\\n}\\n\\n\\n/* */ .p-Menu-itemIcon, /* */\\n.lm-Menu-itemIcon {\\n width: 21px;\\n padding: 4px 2px;\\n}\\n\\n\\n/* */ .p-Menu-itemLabel, /* */\\n.lm-Menu-itemLabel {\\n padding: 4px 35px 4px 2px;\\n}\\n\\n\\n/* */ .p-Menu-itemMnemonic, /* */\\n.lm-Menu-itemMnemonic {\\n text-decoration: underline;\\n}\\n\\n\\n/* */ .p-Menu-itemShortcut, /* */\\n.lm-Menu-itemShortcut {\\n padding: 4px 0px;\\n}\\n\\n\\n/* */ .p-Menu-itemSubmenuIcon, /* */\\n.lm-Menu-itemSubmenuIcon {\\n width: 16px;\\n padding: 4px 0px;\\n}\\n\\n\\n/* */\\n.p-Menu-item[data-type='separator'] > div,\\n/* */\\n.lm-Menu-item[data-type='separator'] > div {\\n padding: 0;\\n height: 9px;\\n}\\n\\n\\n/* */\\n.p-Menu-item[data-type='separator'] > div::after,\\n/* */\\n.lm-Menu-item[data-type='separator'] > div::after {\\n content: '';\\n display: block;\\n position: relative;\\n top: 4px;\\n border-top: 1px solid #DDDDDD;\\n}\\n\\n\\n/* */\\n.p-Menu-itemIcon::before,\\n.p-Menu-itemSubmenuIcon::before,\\n/* */\\n.lm-Menu-itemIcon::before,\\n.lm-Menu-itemSubmenuIcon::before {\\n font-family: FontAwesome;\\n}\\n\\n\\n/* */\\n.p-Menu-item.lm-mod-toggled > .p-Menu-itemIcon::before,\\n/* */\\n.lm-Menu-item.lm-mod-toggled > .lm-Menu-itemIcon::before {\\n content: '\\\\f00c';\\n}\\n\\n\\n/* */\\n.p-Menu-item[data-type='submenu'] > .p-Menu-itemSubmenuIcon::before,\\n/* */\\n.lm-Menu-item[data-type='submenu'] > .lm-Menu-itemSubmenuIcon::before {\\n content: '\\\\f0da';\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/menu.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-Menu, /* */\\n.lm-Menu {\\n padding: 3px 0px;\\n background: white;\\n color: rgba(0, 0, 0, 0.87);\\n border: 1px solid #C0C0C0;\\n font: 12px Helvetica, Arial, sans-serif;\\n box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.2);\\n}\\n\\n\\n/* */ .p-Menu-item.p-mod-active, /* */\\n.lm-Menu-item.lm-mod-active {\\n background: #E5E5E5;\\n}\\n\\n\\n/* */ .p-Menu-item.p-mod-disabled, /* */\\n.lm-Menu-item.lm-mod-disabled {\\n color: rgba(0, 0, 0, 0.25);\\n}\\n\\n\\n/* */ .p-Menu-itemIcon, /* */\\n.lm-Menu-itemIcon {\\n width: 21px;\\n padding: 4px 2px;\\n}\\n\\n\\n/* */ .p-Menu-itemLabel, /* */\\n.lm-Menu-itemLabel {\\n padding: 4px 35px 4px 2px;\\n}\\n\\n\\n/* */ .p-Menu-itemMnemonic, /* */\\n.lm-Menu-itemMnemonic {\\n text-decoration: underline;\\n}\\n\\n\\n/* */ .p-Menu-itemShortcut, /* */\\n.lm-Menu-itemShortcut {\\n padding: 4px 0px;\\n}\\n\\n\\n/* */ .p-Menu-itemSubmenuIcon, /* */\\n.lm-Menu-itemSubmenuIcon {\\n width: 16px;\\n padding: 4px 0px;\\n}\\n\\n\\n/* */\\n.p-Menu-item[data-type='separator'] > div,\\n/* */\\n.lm-Menu-item[data-type='separator'] > div {\\n padding: 0;\\n height: 9px;\\n}\\n\\n\\n/* */\\n.p-Menu-item[data-type='separator'] > div::after,\\n/* */\\n.lm-Menu-item[data-type='separator'] > div::after {\\n content: '';\\n display: block;\\n position: relative;\\n top: 4px;\\n border-top: 1px solid #DDDDDD;\\n}\\n\\n\\n/* */\\n.p-Menu-itemIcon::before,\\n.p-Menu-itemSubmenuIcon::before,\\n/* */\\n.lm-Menu-itemIcon::before,\\n.lm-Menu-itemSubmenuIcon::before {\\n font-family: FontAwesome;\\n}\\n\\n\\n/* */\\n.p-Menu-item.lm-mod-toggled > .p-Menu-itemIcon::before,\\n/* */\\n.lm-Menu-item.lm-mod-toggled > .lm-Menu-itemIcon::before {\\n content: '\\\\f00c';\\n}\\n\\n\\n/* */\\n.p-Menu-item[data-type='submenu'] > .p-Menu-itemSubmenuIcon::before,\\n/* */\\n.lm-Menu-item[data-type='submenu'] > .lm-Menu-itemSubmenuIcon::before {\\n content: '\\\\f0da';\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/menu.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/menubar.css": │ │ │ │ /*!********************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/menubar.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/menubar.css ***! │ │ │ │ \********************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-MenuBar, /* */\\n.lm-MenuBar {\\n padding-left: 5px;\\n background: #FAFAFA;\\n color: rgba(0, 0, 0, 0.87);\\n border-bottom: 1px solid #DDDDDD;\\n font: 13px Helvetica, Arial, sans-serif;\\n}\\n\\n\\n/* */ .p-MenuBar-menu, /* */\\n.lm-MenuBar-menu {\\n transform: translateY(-1px);\\n}\\n\\n\\n/* */ .p-MenuBar-item, /* */\\n.lm-MenuBar-item {\\n padding: 4px 8px;\\n border-left: 1px solid transparent;\\n border-right: 1px solid transparent;\\n}\\n\\n\\n/* */ .p-MenuBar-item.p-mod-active, /* */\\n.lm-MenuBar-item.lm-mod-active {\\n background: #E5E5E5;\\n}\\n\\n\\n/* */\\n.p-MenuBar.p-mod-active .p-MenuBar-item.p-mod-active,\\n/* */\\n.lm-MenuBar.lm-mod-active .lm-MenuBar-item.lm-mod-active {\\n z-index: 10001;\\n background: white;\\n border-left: 1px solid #C0C0C0;\\n border-right: 1px solid #C0C0C0;\\n box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2);\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/menubar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-MenuBar, /* */\\n.lm-MenuBar {\\n padding-left: 5px;\\n background: #FAFAFA;\\n color: rgba(0, 0, 0, 0.87);\\n border-bottom: 1px solid #DDDDDD;\\n font: 13px Helvetica, Arial, sans-serif;\\n}\\n\\n\\n/* */ .p-MenuBar-menu, /* */\\n.lm-MenuBar-menu {\\n transform: translateY(-1px);\\n}\\n\\n\\n/* */ .p-MenuBar-item, /* */\\n.lm-MenuBar-item {\\n padding: 4px 8px;\\n border-left: 1px solid transparent;\\n border-right: 1px solid transparent;\\n}\\n\\n\\n/* */ .p-MenuBar-item.p-mod-active, /* */\\n.lm-MenuBar-item.lm-mod-active {\\n background: #E5E5E5;\\n}\\n\\n\\n/* */\\n.p-MenuBar.p-mod-active .p-MenuBar-item.p-mod-active,\\n/* */\\n.lm-MenuBar.lm-mod-active .lm-MenuBar-item.lm-mod-active {\\n z-index: 10001;\\n background: white;\\n border-left: 1px solid #C0C0C0;\\n border-right: 1px solid #C0C0C0;\\n box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2);\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/menubar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/scrollbar.css": │ │ │ │ /*!**********************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/scrollbar.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/scrollbar.css ***! │ │ │ │ \**********************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Imports\nvar getUrl = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/getUrl.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/getUrl.js\");\nvar ___CSS_LOADER_URL___0___ = getUrl(__webpack_require__(/*! ../images/caretleft.png */ \"../../packages/default-theme/images/caretleft.png\"));\nvar ___CSS_LOADER_URL___1___ = getUrl(__webpack_require__(/*! ../images/caretright.png */ \"../../packages/default-theme/images/caretright.png\"));\nvar ___CSS_LOADER_URL___2___ = getUrl(__webpack_require__(/*! ../images/caretup.png */ \"../../packages/default-theme/images/caretup.png\"));\nvar ___CSS_LOADER_URL___3___ = getUrl(__webpack_require__(/*! ../images/caretdown.png */ \"../../packages/default-theme/images/caretdown.png\"));\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'],\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] {\\n min-height: 16px;\\n max-height: 16px;\\n min-width: 45px;\\n border-top: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'],\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] {\\n min-width: 16px;\\n max-width: 16px;\\n min-height: 45px;\\n border-left: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */ .p-ScrollBar-button, /* */\\n.lm-ScrollBar-button {\\n background-color: #F0F0F0;\\n background-position: center center;\\n min-height: 15px;\\n max-height: 15px;\\n min-width: 15px;\\n max-width: 15px;\\n}\\n\\n\\n/* */ .p-ScrollBar-button:hover, /* */\\n.lm-ScrollBar-button:hover {\\n background-color: #DADADA;\\n}\\n\\n\\n/* */ .p-ScrollBar-button.p-mod-active, /* */\\n.lm-ScrollBar-button.lm-mod-active {\\n background-color: #CDCDCD;\\n}\\n\\n\\n/* */ .p-ScrollBar-track, /* */\\n.lm-ScrollBar-track {\\n background: #F0F0F0;\\n}\\n\\n\\n/* */ .p-ScrollBar-thumb, /* */\\n.lm-ScrollBar-thumb {\\n background: #CDCDCD;\\n}\\n\\n\\n/* */ .p-ScrollBar-thumb:hover, /* */\\n.lm-ScrollBar-thumb:hover {\\n background: #BABABA;\\n}\\n\\n\\n/* */ .p-ScrollBar-thumb.lm-mod-active, /* */\\n.lm-ScrollBar-thumb.lm-mod-active {\\n background: #A0A0A0;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'] .p-ScrollBar-thumb,\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] .lm-ScrollBar-thumb {\\n height: 100%;\\n min-width: 15px;\\n border-left: 1px solid #A0A0A0;\\n border-right: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'] .p-ScrollBar-thumb,\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] .lm-ScrollBar-thumb {\\n width: 100%;\\n min-height: 15px;\\n border-top: 1px solid #A0A0A0;\\n border-bottom: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'] .p-ScrollBar-button[data-action='decrement'],\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] .lm-ScrollBar-button[data-action='decrement'] {\\n background-image: url(\" + ___CSS_LOADER_URL___0___ + \");\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'] .p-ScrollBar-button[data-action='increment'],\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] .lm-ScrollBar-button[data-action='increment'] {\\n background-image: url(\" + ___CSS_LOADER_URL___1___ + \");\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'] .p-ScrollBar-button[data-action='decrement'],\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] .lm-ScrollBar-button[data-action='decrement'] {\\n background-image: url(\" + ___CSS_LOADER_URL___2___ + \");\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'] .p-ScrollBar-button[data-action='increment'],\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] .lm-ScrollBar-button[data-action='increment'] {\\n background-image: url(\" + ___CSS_LOADER_URL___3___ + \");\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/scrollbar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Imports\nvar getUrl = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/getUrl.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/getUrl.js\");\nvar ___CSS_LOADER_URL___0___ = getUrl(__webpack_require__(/*! ../images/caretleft.png */ \"../../packages/default-theme/images/caretleft.png\"));\nvar ___CSS_LOADER_URL___1___ = getUrl(__webpack_require__(/*! ../images/caretright.png */ \"../../packages/default-theme/images/caretright.png\"));\nvar ___CSS_LOADER_URL___2___ = getUrl(__webpack_require__(/*! ../images/caretup.png */ \"../../packages/default-theme/images/caretup.png\"));\nvar ___CSS_LOADER_URL___3___ = getUrl(__webpack_require__(/*! ../images/caretdown.png */ \"../../packages/default-theme/images/caretdown.png\"));\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'],\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] {\\n min-height: 16px;\\n max-height: 16px;\\n min-width: 45px;\\n border-top: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'],\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] {\\n min-width: 16px;\\n max-width: 16px;\\n min-height: 45px;\\n border-left: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */ .p-ScrollBar-button, /* */\\n.lm-ScrollBar-button {\\n background-color: #F0F0F0;\\n background-position: center center;\\n min-height: 15px;\\n max-height: 15px;\\n min-width: 15px;\\n max-width: 15px;\\n}\\n\\n\\n/* */ .p-ScrollBar-button:hover, /* */\\n.lm-ScrollBar-button:hover {\\n background-color: #DADADA;\\n}\\n\\n\\n/* */ .p-ScrollBar-button.p-mod-active, /* */\\n.lm-ScrollBar-button.lm-mod-active {\\n background-color: #CDCDCD;\\n}\\n\\n\\n/* */ .p-ScrollBar-track, /* */\\n.lm-ScrollBar-track {\\n background: #F0F0F0;\\n}\\n\\n\\n/* */ .p-ScrollBar-thumb, /* */\\n.lm-ScrollBar-thumb {\\n background: #CDCDCD;\\n}\\n\\n\\n/* */ .p-ScrollBar-thumb:hover, /* */\\n.lm-ScrollBar-thumb:hover {\\n background: #BABABA;\\n}\\n\\n\\n/* */ .p-ScrollBar-thumb.lm-mod-active, /* */\\n.lm-ScrollBar-thumb.lm-mod-active {\\n background: #A0A0A0;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'] .p-ScrollBar-thumb,\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] .lm-ScrollBar-thumb {\\n height: 100%;\\n min-width: 15px;\\n border-left: 1px solid #A0A0A0;\\n border-right: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'] .p-ScrollBar-thumb,\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] .lm-ScrollBar-thumb {\\n width: 100%;\\n min-height: 15px;\\n border-top: 1px solid #A0A0A0;\\n border-bottom: 1px solid #A0A0A0;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'] .p-ScrollBar-button[data-action='decrement'],\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] .lm-ScrollBar-button[data-action='decrement'] {\\n background-image: url(\" + ___CSS_LOADER_URL___0___ + \");\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'] .p-ScrollBar-button[data-action='increment'],\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] .lm-ScrollBar-button[data-action='increment'] {\\n background-image: url(\" + ___CSS_LOADER_URL___1___ + \");\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'] .p-ScrollBar-button[data-action='decrement'],\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] .lm-ScrollBar-button[data-action='decrement'] {\\n background-image: url(\" + ___CSS_LOADER_URL___2___ + \");\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'] .p-ScrollBar-button[data-action='increment'],\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] .lm-ScrollBar-button[data-action='increment'] {\\n background-image: url(\" + ___CSS_LOADER_URL___3___ + \");\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/scrollbar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/default-theme/style/tabbar.css": │ │ │ │ /*!*******************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/tabbar.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/tabbar.css ***! │ │ │ │ \*******************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-TabBar, /* */\\n.lm-TabBar {\\n min-height: 24px;\\n max-height: 24px;\\n}\\n\\n\\n/* */ .p-TabBar-content, /* */\\n.lm-TabBar-content {\\n min-width: 0;\\n min-height: 0;\\n align-items: flex-end;\\n border-bottom: 1px solid #C0C0C0;\\n}\\n\\n\\n/* */ .p-TabBar-tab, /* */\\n.lm-TabBar-tab {\\n padding: 0px 10px;\\n background: #E5E5E5;\\n border: 1px solid #C0C0C0;\\n border-bottom: none;\\n font: 12px Helvetica, Arial, sans-serif;\\n flex: 0 1 125px;\\n min-height: 20px;\\n max-height: 20px;\\n min-width: 35px;\\n margin-left: -1px;\\n line-height: 20px;\\n}\\n\\n\\n.lm-TabBar-tabLabel .lm-TabBar-tabInput {\\n padding: 0px;\\n border: 0px;\\n font: 12px Helvetica, Arial, sans-serif\\n}\\n\\n\\n/* */ .p-TabBar-tab.p-mod-current, /* */\\n.lm-TabBar-tab.lm-mod-current {\\n background: white;\\n}\\n\\n\\n/* */ .p-TabBar-tab:hover:not(.p-mod-current), /* */\\n.lm-TabBar-tab:hover:not(.lm-mod-current) {\\n background: #F0F0F0;\\n}\\n\\n\\n/* */ .p-TabBar-tab:first-child, /* */\\n.lm-TabBar-tab:first-child {\\n margin-left: 0;\\n}\\n\\n\\n/* */ .p-TabBar-tab.p-mod-current, /* */\\n.lm-TabBar-tab.lm-mod-current {\\n min-height: 23px;\\n max-height: 23px;\\n transform: translateY(1px);\\n}\\n\\n\\n/* */\\n.p-TabBar-tabIcon,\\n.p-TabBar-tabLabel,\\n.p-TabBar-tabCloseIcon,\\n/* */\\n.lm-TabBar-tabIcon,\\n.lm-TabBar-tabLabel,\\n.lm-TabBar-tabCloseIcon {\\n display: inline-block;\\n}\\n\\n\\n/* */\\n.p-TabBar-tab.p-mod-closable > .p-TabBar-tabCloseIcon,\\n/* */\\n.lm-TabBar-tab.lm-mod-closable > .lm-TabBar-tabCloseIcon {\\n margin-left: 4px;\\n}\\n\\n\\n/* */\\n.p-TabBar-tab.p-mod-closable > .p-TabBar-tabCloseIcon:before,\\n/* */\\n.lm-TabBar-tab.lm-mod-closable > .lm-TabBar-tabCloseIcon:before {\\n content: '\\\\f00d';\\n font-family: FontAwesome;\\n}\\n\\n\\n/* */\\n.p-TabBar-tab.p-mod-drag-image,\\n/* */\\n.lm-TabBar-tab.lm-mod-drag-image {\\n min-height: 23px;\\n max-height: 23px;\\n min-width: 125px;\\n border: none;\\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);\\n transform: translateX(-40%) translateY(-58%);\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/style/tabbar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-TabBar, /* */\\n.lm-TabBar {\\n min-height: 24px;\\n max-height: 24px;\\n}\\n\\n\\n/* */ .p-TabBar-content, /* */\\n.lm-TabBar-content {\\n min-width: 0;\\n min-height: 0;\\n align-items: flex-end;\\n border-bottom: 1px solid #C0C0C0;\\n}\\n\\n\\n/* */ .p-TabBar-tab, /* */\\n.lm-TabBar-tab {\\n padding: 0px 10px;\\n background: #E5E5E5;\\n border: 1px solid #C0C0C0;\\n border-bottom: none;\\n font: 12px Helvetica, Arial, sans-serif;\\n flex: 0 1 125px;\\n min-height: 20px;\\n max-height: 20px;\\n min-width: 35px;\\n margin-left: -1px;\\n line-height: 20px;\\n}\\n\\n\\n.lm-TabBar-tabLabel .lm-TabBar-tabInput {\\n padding: 0px;\\n border: 0px;\\n font: 12px Helvetica, Arial, sans-serif\\n}\\n\\n\\n/* */ .p-TabBar-tab.p-mod-current, /* */\\n.lm-TabBar-tab.lm-mod-current {\\n background: white;\\n}\\n\\n\\n/* */ .p-TabBar-tab:hover:not(.p-mod-current), /* */\\n.lm-TabBar-tab:hover:not(.lm-mod-current) {\\n background: #F0F0F0;\\n}\\n\\n\\n/* */ .p-TabBar-tab:first-child, /* */\\n.lm-TabBar-tab:first-child {\\n margin-left: 0;\\n}\\n\\n\\n/* */ .p-TabBar-tab.p-mod-current, /* */\\n.lm-TabBar-tab.lm-mod-current {\\n min-height: 23px;\\n max-height: 23px;\\n transform: translateY(1px);\\n}\\n\\n\\n/* */\\n.p-TabBar-tabIcon,\\n.p-TabBar-tabLabel,\\n.p-TabBar-tabCloseIcon,\\n/* */\\n.lm-TabBar-tabIcon,\\n.lm-TabBar-tabLabel,\\n.lm-TabBar-tabCloseIcon {\\n display: inline-block;\\n}\\n\\n\\n/* */\\n.p-TabBar-tab.p-mod-closable > .p-TabBar-tabCloseIcon,\\n/* */\\n.lm-TabBar-tab.lm-mod-closable > .lm-TabBar-tabCloseIcon {\\n margin-left: 4px;\\n}\\n\\n\\n/* */\\n.p-TabBar-tab.p-mod-closable > .p-TabBar-tabCloseIcon:before,\\n/* */\\n.lm-TabBar-tab.lm-mod-closable > .lm-TabBar-tabCloseIcon:before {\\n content: '\\\\f00d';\\n font-family: FontAwesome;\\n}\\n\\n\\n/* */\\n.p-TabBar-tab.p-mod-drag-image,\\n/* */\\n.lm-TabBar-tab.lm-mod-drag-image {\\n min-height: 23px;\\n max-height: 23px;\\n min-width: 125px;\\n border: none;\\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);\\n transform: translateX(-40%) translateY(-58%);\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/style/tabbar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/dragdrop/style/index.css": │ │ │ │ /*!*************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/dragdrop/style/index.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/dragdrop/style/index.css ***! │ │ │ │ \*************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ body.p-mod-override-cursor *, /* */\\nbody.lm-mod-override-cursor * {\\n cursor: inherit !important;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/dragdrop/style/index.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ body.p-mod-override-cursor *, /* */\\nbody.lm-mod-override-cursor * {\\n cursor: inherit !important;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/dragdrop/style/index.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/commandpalette.css": │ │ │ │ /*!*********************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/commandpalette.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/commandpalette.css ***! │ │ │ │ \*********************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-CommandPalette, /* */\\n.lm-CommandPalette {\\n display: flex;\\n flex-direction: column;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */ .p-CommandPalette-search, /* */\\n.lm-CommandPalette-search {\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-CommandPalette-content, /* */\\n.lm-CommandPalette-content {\\n flex: 1 1 auto;\\n margin: 0;\\n padding: 0;\\n min-height: 0;\\n overflow: auto;\\n list-style-type: none;\\n}\\n\\n\\n/* */ .p-CommandPalette-header, /* */\\n.lm-CommandPalette-header {\\n overflow: hidden;\\n white-space: nowrap;\\n text-overflow: ellipsis;\\n}\\n\\n\\n/* */ .p-CommandPalette-item, /* */\\n.lm-CommandPalette-item {\\n display: flex;\\n flex-direction: row;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemIcon, /* */\\n.lm-CommandPalette-itemIcon {\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemContent, /* */\\n.lm-CommandPalette-itemContent {\\n flex: 1 1 auto;\\n overflow: hidden;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemShortcut, /* */\\n.lm-CommandPalette-itemShortcut {\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemLabel, /* */\\n.lm-CommandPalette-itemLabel {\\n overflow: hidden;\\n white-space: nowrap;\\n text-overflow: ellipsis;\\n}\\n\\n.lm-close-icon {\\n\\tborder:1px solid transparent;\\n background-color: transparent;\\n position: absolute;\\n\\tz-index:1;\\n\\tright:3%;\\n\\ttop: 0;\\n\\tbottom: 0;\\n\\tmargin: auto;\\n\\tpadding: 7px 0;\\n\\tdisplay: none;\\n\\tvertical-align: middle;\\n outline: 0;\\n cursor: pointer;\\n}\\n.lm-close-icon:after {\\n\\tcontent: \\\"X\\\";\\n\\tdisplay: block;\\n\\twidth: 15px;\\n\\theight: 15px;\\n\\ttext-align: center;\\n\\tcolor:#000;\\n\\tfont-weight: normal;\\n\\tfont-size: 12px;\\n\\tcursor: pointer;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/commandpalette.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-CommandPalette, /* */\\n.lm-CommandPalette {\\n display: flex;\\n flex-direction: column;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */ .p-CommandPalette-search, /* */\\n.lm-CommandPalette-search {\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-CommandPalette-content, /* */\\n.lm-CommandPalette-content {\\n flex: 1 1 auto;\\n margin: 0;\\n padding: 0;\\n min-height: 0;\\n overflow: auto;\\n list-style-type: none;\\n}\\n\\n\\n/* */ .p-CommandPalette-header, /* */\\n.lm-CommandPalette-header {\\n overflow: hidden;\\n white-space: nowrap;\\n text-overflow: ellipsis;\\n}\\n\\n\\n/* */ .p-CommandPalette-item, /* */\\n.lm-CommandPalette-item {\\n display: flex;\\n flex-direction: row;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemIcon, /* */\\n.lm-CommandPalette-itemIcon {\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemContent, /* */\\n.lm-CommandPalette-itemContent {\\n flex: 1 1 auto;\\n overflow: hidden;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemShortcut, /* */\\n.lm-CommandPalette-itemShortcut {\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-CommandPalette-itemLabel, /* */\\n.lm-CommandPalette-itemLabel {\\n overflow: hidden;\\n white-space: nowrap;\\n text-overflow: ellipsis;\\n}\\n\\n.lm-close-icon {\\n\\tborder:1px solid transparent;\\n background-color: transparent;\\n position: absolute;\\n\\tz-index:1;\\n\\tright:3%;\\n\\ttop: 0;\\n\\tbottom: 0;\\n\\tmargin: auto;\\n\\tpadding: 7px 0;\\n\\tdisplay: none;\\n\\tvertical-align: middle;\\n outline: 0;\\n cursor: pointer;\\n}\\n.lm-close-icon:after {\\n\\tcontent: \\\"X\\\";\\n\\tdisplay: block;\\n\\twidth: 15px;\\n\\theight: 15px;\\n\\ttext-align: center;\\n\\tcolor:#000;\\n\\tfont-weight: normal;\\n\\tfont-size: 12px;\\n\\tcursor: pointer;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/commandpalette.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/dockpanel.css": │ │ │ │ /*!****************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/dockpanel.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/dockpanel.css ***! │ │ │ │ \****************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-DockPanel, /* */\\n.lm-DockPanel {\\n z-index: 0;\\n}\\n\\n\\n/* */ .p-DockPanel-widget, /* */\\n.lm-DockPanel-widget {\\n z-index: 0;\\n}\\n\\n\\n/* */ .p-DockPanel-tabBar, /* */\\n.lm-DockPanel-tabBar {\\n z-index: 1;\\n}\\n\\n\\n/* */ .p-DockPanel-handle, /* */\\n.lm-DockPanel-handle {\\n z-index: 2;\\n}\\n\\n\\n/* */ .p-DockPanel-handle.p-mod-hidden, /* */\\n.lm-DockPanel-handle.lm-mod-hidden {\\n display: none !important;\\n}\\n\\n\\n/* */ .p-DockPanel-handle:after, /* */\\n.lm-DockPanel-handle:after {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n content: '';\\n}\\n\\n\\n/* */\\n.p-DockPanel-handle[data-orientation='horizontal'],\\n/* */\\n.lm-DockPanel-handle[data-orientation='horizontal'] {\\n cursor: ew-resize;\\n}\\n\\n\\n/* */\\n.p-DockPanel-handle[data-orientation='vertical'],\\n/* */\\n.lm-DockPanel-handle[data-orientation='vertical'] {\\n cursor: ns-resize;\\n}\\n\\n\\n/* */\\n.p-DockPanel-handle[data-orientation='horizontal']:after,\\n/* */\\n.lm-DockPanel-handle[data-orientation='horizontal']:after {\\n left: 50%;\\n min-width: 8px;\\n transform: translateX(-50%);\\n}\\n\\n\\n/* */\\n.p-DockPanel-handle[data-orientation='vertical']:after,\\n/* */\\n.lm-DockPanel-handle[data-orientation='vertical']:after {\\n top: 50%;\\n min-height: 8px;\\n transform: translateY(-50%);\\n}\\n\\n\\n/* */ .p-DockPanel-overlay, /* */\\n.lm-DockPanel-overlay {\\n z-index: 3;\\n box-sizing: border-box;\\n pointer-events: none;\\n}\\n\\n\\n/* */ .p-DockPanel-overlay.p-mod-hidden, /* */\\n.lm-DockPanel-overlay.lm-mod-hidden {\\n display: none !important;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/dockpanel.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-DockPanel, /* */\\n.lm-DockPanel {\\n z-index: 0;\\n}\\n\\n\\n/* */ .p-DockPanel-widget, /* */\\n.lm-DockPanel-widget {\\n z-index: 0;\\n}\\n\\n\\n/* */ .p-DockPanel-tabBar, /* */\\n.lm-DockPanel-tabBar {\\n z-index: 1;\\n}\\n\\n\\n/* */ .p-DockPanel-handle, /* */\\n.lm-DockPanel-handle {\\n z-index: 2;\\n}\\n\\n\\n/* */ .p-DockPanel-handle.p-mod-hidden, /* */\\n.lm-DockPanel-handle.lm-mod-hidden {\\n display: none !important;\\n}\\n\\n\\n/* */ .p-DockPanel-handle:after, /* */\\n.lm-DockPanel-handle:after {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n content: '';\\n}\\n\\n\\n/* */\\n.p-DockPanel-handle[data-orientation='horizontal'],\\n/* */\\n.lm-DockPanel-handle[data-orientation='horizontal'] {\\n cursor: ew-resize;\\n}\\n\\n\\n/* */\\n.p-DockPanel-handle[data-orientation='vertical'],\\n/* */\\n.lm-DockPanel-handle[data-orientation='vertical'] {\\n cursor: ns-resize;\\n}\\n\\n\\n/* */\\n.p-DockPanel-handle[data-orientation='horizontal']:after,\\n/* */\\n.lm-DockPanel-handle[data-orientation='horizontal']:after {\\n left: 50%;\\n min-width: 8px;\\n transform: translateX(-50%);\\n}\\n\\n\\n/* */\\n.p-DockPanel-handle[data-orientation='vertical']:after,\\n/* */\\n.lm-DockPanel-handle[data-orientation='vertical']:after {\\n top: 50%;\\n min-height: 8px;\\n transform: translateY(-50%);\\n}\\n\\n\\n/* */ .p-DockPanel-overlay, /* */\\n.lm-DockPanel-overlay {\\n z-index: 3;\\n box-sizing: border-box;\\n pointer-events: none;\\n}\\n\\n\\n/* */ .p-DockPanel-overlay.p-mod-hidden, /* */\\n.lm-DockPanel-overlay.lm-mod-hidden {\\n display: none !important;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/dockpanel.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/index.css": │ │ │ │ /*!************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/index.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/index.css ***! │ │ │ │ \************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Imports\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./widget.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/widget.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./commandpalette.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/commandpalette.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./dockpanel.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/dockpanel.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./menu.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/menu.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./menubar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/menubar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./scrollbar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/scrollbar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./splitpanel.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/splitpanel.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./tabbar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/tabbar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./tabpanel.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/tabpanel.css\"), \"\");\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/index.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Imports\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./widget.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/widget.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./commandpalette.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/commandpalette.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./dockpanel.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/dockpanel.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./menu.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/menu.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./menubar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/menubar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./scrollbar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/scrollbar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./splitpanel.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/splitpanel.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./tabbar.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/tabbar.css\"), \"\");\nexports.i(__webpack_require__(/*! -!../../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./tabpanel.css */ \"../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/tabpanel.css\"), \"\");\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/index.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/menu.css": │ │ │ │ /*!***********************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/menu.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/menu.css ***! │ │ │ │ \***********************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-Menu, /* */\\n.lm-Menu {\\n z-index: 10000;\\n position: absolute;\\n white-space: nowrap;\\n overflow-x: hidden;\\n overflow-y: auto;\\n outline: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */ .p-Menu-content, /* */\\n.lm-Menu-content {\\n margin: 0;\\n padding: 0;\\n display: table;\\n list-style-type: none;\\n}\\n\\n\\n/* */ .p-Menu-item, /* */\\n.lm-Menu-item {\\n display: table-row;\\n}\\n\\n\\n/* */\\n.p-Menu-item.p-mod-hidden,\\n.p-Menu-item.p-mod-collapsed,\\n/* */\\n.lm-Menu-item.lm-mod-hidden,\\n.lm-Menu-item.lm-mod-collapsed {\\n display: none !important;\\n}\\n\\n\\n/* */\\n.p-Menu-itemIcon,\\n.p-Menu-itemSubmenuIcon,\\n/* */\\n.lm-Menu-itemIcon,\\n.lm-Menu-itemSubmenuIcon {\\n display: table-cell;\\n text-align: center;\\n}\\n\\n\\n/* */ .p-Menu-itemLabel, /* */\\n.lm-Menu-itemLabel {\\n display: table-cell;\\n text-align: left;\\n}\\n\\n\\n/* */ .p-Menu-itemShortcut, /* */\\n.lm-Menu-itemShortcut {\\n display: table-cell;\\n text-align: right;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/menu.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-Menu, /* */\\n.lm-Menu {\\n z-index: 10000;\\n position: absolute;\\n white-space: nowrap;\\n overflow-x: hidden;\\n overflow-y: auto;\\n outline: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */ .p-Menu-content, /* */\\n.lm-Menu-content {\\n margin: 0;\\n padding: 0;\\n display: table;\\n list-style-type: none;\\n}\\n\\n\\n/* */ .p-Menu-item, /* */\\n.lm-Menu-item {\\n display: table-row;\\n}\\n\\n\\n/* */\\n.p-Menu-item.p-mod-hidden,\\n.p-Menu-item.p-mod-collapsed,\\n/* */\\n.lm-Menu-item.lm-mod-hidden,\\n.lm-Menu-item.lm-mod-collapsed {\\n display: none !important;\\n}\\n\\n\\n/* */\\n.p-Menu-itemIcon,\\n.p-Menu-itemSubmenuIcon,\\n/* */\\n.lm-Menu-itemIcon,\\n.lm-Menu-itemSubmenuIcon {\\n display: table-cell;\\n text-align: center;\\n}\\n\\n\\n/* */ .p-Menu-itemLabel, /* */\\n.lm-Menu-itemLabel {\\n display: table-cell;\\n text-align: left;\\n}\\n\\n\\n/* */ .p-Menu-itemShortcut, /* */\\n.lm-Menu-itemShortcut {\\n display: table-cell;\\n text-align: right;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/menu.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/menubar.css": │ │ │ │ /*!**************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/menubar.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/menubar.css ***! │ │ │ │ \**************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-MenuBar, /* */\\n.lm-MenuBar {\\n outline: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */ .p-MenuBar-content, /* */\\n.lm-MenuBar-content {\\n margin: 0;\\n padding: 0;\\n display: flex;\\n flex-direction: row;\\n list-style-type: none;\\n}\\n\\n\\n/* */ .p--MenuBar-item, /* */\\n.lm-MenuBar-item {\\n box-sizing: border-box;\\n}\\n\\n\\n/* */\\n.p-MenuBar-itemIcon,\\n.p-MenuBar-itemLabel,\\n/* */\\n.lm-MenuBar-itemIcon,\\n.lm-MenuBar-itemLabel {\\n display: inline-block;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/menubar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-MenuBar, /* */\\n.lm-MenuBar {\\n outline: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */ .p-MenuBar-content, /* */\\n.lm-MenuBar-content {\\n margin: 0;\\n padding: 0;\\n display: flex;\\n flex-direction: row;\\n list-style-type: none;\\n}\\n\\n\\n/* */ .p--MenuBar-item, /* */\\n.lm-MenuBar-item {\\n box-sizing: border-box;\\n}\\n\\n\\n/* */\\n.p-MenuBar-itemIcon,\\n.p-MenuBar-itemLabel,\\n/* */\\n.lm-MenuBar-itemIcon,\\n.lm-MenuBar-itemLabel {\\n display: inline-block;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/menubar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/scrollbar.css": │ │ │ │ /*!****************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/scrollbar.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/scrollbar.css ***! │ │ │ │ \****************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-ScrollBar, /* */\\n.lm-ScrollBar {\\n display: flex;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'],\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] {\\n flex-direction: row;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'],\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] {\\n flex-direction: column;\\n}\\n\\n\\n/* */ .p-ScrollBar-button, /* */\\n.lm-ScrollBar-button {\\n box-sizing: border-box;\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-ScrollBar-track, /* */\\n.lm-ScrollBar-track {\\n box-sizing: border-box;\\n position: relative;\\n overflow: hidden;\\n flex: 1 1 auto;\\n}\\n\\n\\n/* */ .p-ScrollBar-thumb, /* */\\n.lm-ScrollBar-thumb {\\n box-sizing: border-box;\\n position: absolute;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/scrollbar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-ScrollBar, /* */\\n.lm-ScrollBar {\\n display: flex;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='horizontal'],\\n/* */\\n.lm-ScrollBar[data-orientation='horizontal'] {\\n flex-direction: row;\\n}\\n\\n\\n/* */\\n.p-ScrollBar[data-orientation='vertical'],\\n/* */\\n.lm-ScrollBar[data-orientation='vertical'] {\\n flex-direction: column;\\n}\\n\\n\\n/* */ .p-ScrollBar-button, /* */\\n.lm-ScrollBar-button {\\n box-sizing: border-box;\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-ScrollBar-track, /* */\\n.lm-ScrollBar-track {\\n box-sizing: border-box;\\n position: relative;\\n overflow: hidden;\\n flex: 1 1 auto;\\n}\\n\\n\\n/* */ .p-ScrollBar-thumb, /* */\\n.lm-ScrollBar-thumb {\\n box-sizing: border-box;\\n position: absolute;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/scrollbar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/splitpanel.css": │ │ │ │ /*!*****************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/splitpanel.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/splitpanel.css ***! │ │ │ │ \*****************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-SplitPanel-child, /* */\\n.lm-SplitPanel-child {\\n z-index: 0;\\n}\\n\\n\\n/* */ .p-SplitPanel-handle, /* */\\n.lm-SplitPanel-handle {\\n z-index: 1;\\n}\\n\\n\\n/* */ .p-SplitPanel-handle.p-mod-hidden, /* */\\n.lm-SplitPanel-handle.lm-mod-hidden {\\n display: none !important;\\n}\\n\\n\\n/* */ .p-SplitPanel-handle:after, /* */\\n.lm-SplitPanel-handle:after {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n content: '';\\n}\\n\\n\\n/* */\\n.p-SplitPanel[data-orientation='horizontal'] > .p-SplitPanel-handle,\\n/* */\\n.lm-SplitPanel[data-orientation='horizontal'] > .lm-SplitPanel-handle {\\n cursor: ew-resize;\\n}\\n\\n\\n/* */\\n.p-SplitPanel[data-orientation='vertical'] > .p-SplitPanel-handle,\\n/* */\\n.lm-SplitPanel[data-orientation='vertical'] > .lm-SplitPanel-handle {\\n cursor: ns-resize;\\n}\\n\\n\\n/* */\\n.p-SplitPanel[data-orientation='horizontal'] > .p-SplitPanel-handle:after,\\n/* */\\n.lm-SplitPanel[data-orientation='horizontal'] > .lm-SplitPanel-handle:after {\\n left: 50%;\\n min-width: 8px;\\n transform: translateX(-50%);\\n}\\n\\n\\n/* */\\n.p-SplitPanel[data-orientation='vertical'] > .p-SplitPanel-handle:after,\\n/* */\\n.lm-SplitPanel[data-orientation='vertical'] > .lm-SplitPanel-handle:after {\\n top: 50%;\\n min-height: 8px;\\n transform: translateY(-50%);\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/splitpanel.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-SplitPanel-child, /* */\\n.lm-SplitPanel-child {\\n z-index: 0;\\n}\\n\\n\\n/* */ .p-SplitPanel-handle, /* */\\n.lm-SplitPanel-handle {\\n z-index: 1;\\n}\\n\\n\\n/* */ .p-SplitPanel-handle.p-mod-hidden, /* */\\n.lm-SplitPanel-handle.lm-mod-hidden {\\n display: none !important;\\n}\\n\\n\\n/* */ .p-SplitPanel-handle:after, /* */\\n.lm-SplitPanel-handle:after {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n content: '';\\n}\\n\\n\\n/* */\\n.p-SplitPanel[data-orientation='horizontal'] > .p-SplitPanel-handle,\\n/* */\\n.lm-SplitPanel[data-orientation='horizontal'] > .lm-SplitPanel-handle {\\n cursor: ew-resize;\\n}\\n\\n\\n/* */\\n.p-SplitPanel[data-orientation='vertical'] > .p-SplitPanel-handle,\\n/* */\\n.lm-SplitPanel[data-orientation='vertical'] > .lm-SplitPanel-handle {\\n cursor: ns-resize;\\n}\\n\\n\\n/* */\\n.p-SplitPanel[data-orientation='horizontal'] > .p-SplitPanel-handle:after,\\n/* */\\n.lm-SplitPanel[data-orientation='horizontal'] > .lm-SplitPanel-handle:after {\\n left: 50%;\\n min-width: 8px;\\n transform: translateX(-50%);\\n}\\n\\n\\n/* */\\n.p-SplitPanel[data-orientation='vertical'] > .p-SplitPanel-handle:after,\\n/* */\\n.lm-SplitPanel[data-orientation='vertical'] > .lm-SplitPanel-handle:after {\\n top: 50%;\\n min-height: 8px;\\n transform: translateY(-50%);\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/splitpanel.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/tabbar.css": │ │ │ │ /*!*************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/tabbar.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/tabbar.css ***! │ │ │ │ \*************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-TabBar, /* */\\n.lm-TabBar {\\n display: flex;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */ .p-TabBar[data-orientation='horizontal'], /* */\\n.lm-TabBar[data-orientation='horizontal'] {\\n flex-direction: row;\\n}\\n\\n\\n/* */ .p-TabBar[data-orientation='vertical'], /* */\\n.lm-TabBar[data-orientation='vertical'] {\\n flex-direction: column;\\n}\\n\\n\\n/* */ .p-TabBar-content, /* */\\n.lm-TabBar-content {\\n margin: 0;\\n padding: 0;\\n display: flex;\\n flex: 1 1 auto;\\n list-style-type: none;\\n}\\n\\n\\n/* */\\n.p-TabBar[data-orientation='horizontal'] > .p-TabBar-content,\\n/* */\\n.lm-TabBar[data-orientation='horizontal'] > .lm-TabBar-content {\\n flex-direction: row;\\n}\\n\\n\\n/* */\\n.p-TabBar[data-orientation='vertical'] > .p-TabBar-content,\\n/* */\\n.lm-TabBar[data-orientation='vertical'] > .lm-TabBar-content {\\n flex-direction: column;\\n}\\n\\n\\n/* */ .p-TabBar-tab, /* */\\n.lm-TabBar-tab {\\n display: flex;\\n flex-direction: row;\\n box-sizing: border-box;\\n overflow: hidden;\\n}\\n\\n\\n/* */\\n.p-TabBar-tabIcon,\\n.p-TabBar-tabCloseIcon,\\n/* */\\n.lm-TabBar-tabIcon,\\n.lm-TabBar-tabCloseIcon {\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-TabBar-tabLabel, /* */\\n.lm-TabBar-tabLabel {\\n flex: 1 1 auto;\\n overflow: hidden;\\n white-space: nowrap;\\n}\\n\\n\\n.lm-TabBar-tabInput {\\n user-select: all;\\n width: 100%;\\n box-sizing : border-box;\\n}\\n\\n\\n/* */ .p-TabBar-tab.p-mod-hidden, /* */\\n.lm-TabBar-tab.lm-mod-hidden {\\n display: none !important;\\n}\\n\\n\\n/* */ .p-TabBar.p-mod-dragging .p-TabBar-tab, /* */\\n.lm-TabBar.lm-mod-dragging .lm-TabBar-tab {\\n position: relative;\\n}\\n\\n\\n/* */\\n.p-TabBar.p-mod-dragging[data-orientation='horizontal'] .p-TabBar-tab,\\n/* */\\n.lm-TabBar.lm-mod-dragging[data-orientation='horizontal'] .lm-TabBar-tab {\\n left: 0;\\n transition: left 150ms ease;\\n}\\n\\n\\n/* */\\n.p-TabBar.p-mod-dragging[data-orientation='vertical'] .p-TabBar-tab,\\n/* */\\n.lm-TabBar.lm-mod-dragging[data-orientation='vertical'] .lm-TabBar-tab {\\n top: 0;\\n transition: top 150ms ease;\\n}\\n\\n\\n/* */\\n.p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging\\n/* */\\n.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging {\\n transition: none;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/tabbar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-TabBar, /* */\\n.lm-TabBar {\\n display: flex;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n\\n\\n/* */ .p-TabBar[data-orientation='horizontal'], /* */\\n.lm-TabBar[data-orientation='horizontal'] {\\n flex-direction: row;\\n}\\n\\n\\n/* */ .p-TabBar[data-orientation='vertical'], /* */\\n.lm-TabBar[data-orientation='vertical'] {\\n flex-direction: column;\\n}\\n\\n\\n/* */ .p-TabBar-content, /* */\\n.lm-TabBar-content {\\n margin: 0;\\n padding: 0;\\n display: flex;\\n flex: 1 1 auto;\\n list-style-type: none;\\n}\\n\\n\\n/* */\\n.p-TabBar[data-orientation='horizontal'] > .p-TabBar-content,\\n/* */\\n.lm-TabBar[data-orientation='horizontal'] > .lm-TabBar-content {\\n flex-direction: row;\\n}\\n\\n\\n/* */\\n.p-TabBar[data-orientation='vertical'] > .p-TabBar-content,\\n/* */\\n.lm-TabBar[data-orientation='vertical'] > .lm-TabBar-content {\\n flex-direction: column;\\n}\\n\\n\\n/* */ .p-TabBar-tab, /* */\\n.lm-TabBar-tab {\\n display: flex;\\n flex-direction: row;\\n box-sizing: border-box;\\n overflow: hidden;\\n}\\n\\n\\n/* */\\n.p-TabBar-tabIcon,\\n.p-TabBar-tabCloseIcon,\\n/* */\\n.lm-TabBar-tabIcon,\\n.lm-TabBar-tabCloseIcon {\\n flex: 0 0 auto;\\n}\\n\\n\\n/* */ .p-TabBar-tabLabel, /* */\\n.lm-TabBar-tabLabel {\\n flex: 1 1 auto;\\n overflow: hidden;\\n white-space: nowrap;\\n}\\n\\n\\n.lm-TabBar-tabInput {\\n user-select: all;\\n width: 100%;\\n box-sizing : border-box;\\n}\\n\\n\\n/* */ .p-TabBar-tab.p-mod-hidden, /* */\\n.lm-TabBar-tab.lm-mod-hidden {\\n display: none !important;\\n}\\n\\n\\n/* */ .p-TabBar.p-mod-dragging .p-TabBar-tab, /* */\\n.lm-TabBar.lm-mod-dragging .lm-TabBar-tab {\\n position: relative;\\n}\\n\\n\\n/* */\\n.p-TabBar.p-mod-dragging[data-orientation='horizontal'] .p-TabBar-tab,\\n/* */\\n.lm-TabBar.lm-mod-dragging[data-orientation='horizontal'] .lm-TabBar-tab {\\n left: 0;\\n transition: left 150ms ease;\\n}\\n\\n\\n/* */\\n.p-TabBar.p-mod-dragging[data-orientation='vertical'] .p-TabBar-tab,\\n/* */\\n.lm-TabBar.lm-mod-dragging[data-orientation='vertical'] .lm-TabBar-tab {\\n top: 0;\\n transition: top 150ms ease;\\n}\\n\\n\\n/* */\\n.p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging\\n/* */\\n.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging {\\n transition: none;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/tabbar.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/tabpanel.css": │ │ │ │ /*!***************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/tabpanel.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/tabpanel.css ***! │ │ │ │ \***************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-TabPanel-tabBar, /* */\\n.lm-TabPanel-tabBar {\\n z-index: 1;\\n}\\n\\n\\n/* */ .p-TabPanel-stackedPanel, /* */\\n.lm-TabPanel-stackedPanel {\\n z-index: 0;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/tabpanel.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-TabPanel-tabBar, /* */\\n.lm-TabPanel-tabBar {\\n z-index: 1;\\n}\\n\\n\\n/* */ .p-TabPanel-stackedPanel, /* */\\n.lm-TabPanel-stackedPanel {\\n z-index: 0;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/tabpanel.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!../../packages/widgets/style/widget.css": │ │ │ │ /*!*************************************************************************************************************************************!*\ │ │ │ │ - !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/widget.css ***! │ │ │ │ + !*** /usr/share/nodejs/css-loader/dist/cjs.js!/build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/widget.css ***! │ │ │ │ \*************************************************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ - eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-Widget, /* */\\n.lm-Widget {\\n box-sizing: border-box;\\n position: relative;\\n overflow: hidden;\\n cursor: default;\\n}\\n\\n\\n/* */ .p-Widget.p-mod-hidden, /* */\\n.lm-Widget.lm-mod-hidden {\\n display: none !important;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/style/widget.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ + eval("exports = module.exports = __webpack_require__(/*! ../../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js */ \"../../../../../usr/share/nodejs/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"/*-----------------------------------------------------------------------------\\n| Copyright (c) Jupyter Development Team.\\n| Copyright (c) 2014-2017, PhosphorJS Contributors\\n|\\n| Distributed under the terms of the BSD 3-Clause License.\\n|\\n| The full license is in the file LICENSE, distributed with this software.\\n|----------------------------------------------------------------------------*/\\n\\n\\n/* */ .p-Widget, /* */\\n.lm-Widget {\\n box-sizing: border-box;\\n position: relative;\\n overflow: hidden;\\n cursor: default;\\n}\\n\\n\\n/* */ .p-Widget.p-mod-hidden, /* */\\n.lm-Widget.lm-mod-hidden {\\n display: none !important;\\n}\\n\", \"\"]);\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/style/widget.css?/usr/share/nodejs/css-loader/dist/cjs.js"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../../../../usr/share/nodejs/css-loader/dist/cjs.js!./style/index.css": │ │ │ │ /*!******************************************************************!*\ │ │ │ │ @@ -745,1297 +745,1297 @@ │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/array.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/array.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/array.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var span;\n if (stop < start) {\n span = (stop + 1) + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (var i = 0; i < span; ++i) {\n var j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var span;\n if (start < stop) {\n span = (start + 1) + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (var i = 0; i < span; ++i) {\n var j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var span;\n if (stop < start) {\n span = (stop + 1) + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (var i = 0; i < span; ++i) {\n var j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var d;\n if (start < stop) {\n d = (start + 1) + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (var i = 0; i < d; ++i) {\n var j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var begin = start;\n var span = stop - start + 1;\n while (span > 0) {\n var half = span >> 1;\n var middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var begin = start;\n var span = stop - start + 1;\n while (span > 0) {\n var half = span >> 1;\n var middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (var i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options) {\n if (options === void 0) { options = {}; }\n // Extract the options.\n var start = options.start, stop = options.stop, step = options.step;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n var n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n var length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n var result = [];\n for (var i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n var n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n var value = array[fromIndex];\n var d = fromIndex < toIndex ? 1 : -1;\n for (var i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n var a = array[start];\n var b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n var length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n var pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var span;\n if (stop < start) {\n span = (stop + 1) + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (var i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n var n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (var i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n var n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n var value = array[index];\n for (var i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var count = 0;\n for (var i = 0; i < n; ++i) {\n if (start <= stop && (i >= start && i <= stop) && array[i] === value) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var value;\n var index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index: index, value: value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var value;\n var index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index: index, value: value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var count = 0;\n for (var i = 0; i < n; ++i) {\n if (start <= stop && (i >= start && i <= stop) && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(exports.ArrayExt || (exports.ArrayExt = {}));\n//# sourceMappingURL=array.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/array.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (ArrayExt) {\n /**\n * Find the index of the first occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.firstIndexOf(data, 'red'); // -1\n * ArrayExt.firstIndexOf(data, 'one'); // 0\n * ArrayExt.firstIndexOf(data, 'one', 1); // 4\n * ArrayExt.firstIndexOf(data, 'two', 2); // -1\n * ArrayExt.firstIndexOf(data, 'two', 2, 1); // 1\n * ```\n */\n function firstIndexOf(array, value, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var span;\n if (stop < start) {\n span = (stop + 1) + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (var i = 0; i < span; ++i) {\n var j = (start + i) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.firstIndexOf = firstIndexOf;\n /**\n * Find the index of the last occurrence of a value in an array.\n *\n * @param array - The array-like object to search.\n *\n * @param value - The value to locate in the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last occurrence of the value, or `-1`\n * if the value is not found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four', 'one'];\n * ArrayExt.lastIndexOf(data, 'red'); // -1\n * ArrayExt.lastIndexOf(data, 'one'); // 4\n * ArrayExt.lastIndexOf(data, 'one', 1); // 0\n * ArrayExt.lastIndexOf(data, 'two', 0); // -1\n * ArrayExt.lastIndexOf(data, 'two', 0, 1); // 1\n * ```\n */\n function lastIndexOf(array, value, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var span;\n if (start < stop) {\n span = (start + 1) + (n - stop);\n }\n else {\n span = start - stop + 1;\n }\n for (var i = 0; i < span; ++i) {\n var j = (start - i + n) % n;\n if (array[j] === value) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.lastIndexOf = lastIndexOf;\n /**\n * Find the index of the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstIndex(data, isEven); // 1\n * ArrayExt.findFirstIndex(data, isEven, 4); // 5\n * ArrayExt.findFirstIndex(data, isEven, 6); // -1\n * ArrayExt.findFirstIndex(data, isEven, 6, 5); // 1\n * ```\n */\n function findFirstIndex(array, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var span;\n if (stop < start) {\n span = (stop + 1) + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (var i = 0; i < span; ++i) {\n var j = (start + i) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findFirstIndex = findFirstIndex;\n /**\n * Find the index of the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the last matching value, or `-1` if no\n * matching value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastIndex(data, isEven); // 5\n * ArrayExt.findLastIndex(data, isEven, 4); // 3\n * ArrayExt.findLastIndex(data, isEven, 0); // -1\n * ArrayExt.findLastIndex(data, isEven, 0, 1); // 5\n * ```\n */\n function findLastIndex(array, fn, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var n = array.length;\n if (n === 0) {\n return -1;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var d;\n if (start < stop) {\n d = (start + 1) + (n - stop);\n }\n else {\n d = start - stop + 1;\n }\n for (var i = 0; i < d; ++i) {\n var j = (start - i + n) % n;\n if (fn(array[j], j)) {\n return j;\n }\n }\n return -1;\n }\n ArrayExt.findLastIndex = findLastIndex;\n /**\n * Find the first value which matches a predicate.\n *\n * @param array - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findFirstValue(data, isEven); // 2\n * ArrayExt.findFirstValue(data, isEven, 2); // 4\n * ArrayExt.findFirstValue(data, isEven, 6); // undefined\n * ArrayExt.findFirstValue(data, isEven, 6, 5); // 2\n * ```\n */\n function findFirstValue(array, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var index = findFirstIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findFirstValue = findFirstValue;\n /**\n * Find the last value which matches a predicate.\n *\n * @param object - The array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The last matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the front of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [1, 2, 3, 4, 3, 2, 1];\n * ArrayExt.findLastValue(data, isEven); // 2\n * ArrayExt.findLastValue(data, isEven, 4); // 4\n * ArrayExt.findLastValue(data, isEven, 0); // undefined\n * ArrayExt.findLastValue(data, isEven, 0, 1); // 2\n * ```\n */\n function findLastValue(array, fn, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var index = findLastIndex(array, fn, start, stop);\n return index !== -1 ? array[index] : undefined;\n }\n ArrayExt.findLastValue = findLastValue;\n /**\n * Find the index of the first element which compares `>=` to a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>=` to the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.lowerBound(data, 0, numberCmp); // 0\n * ArrayExt.lowerBound(data, 6, numberCmp); // 3\n * ArrayExt.lowerBound(data, 7, numberCmp); // 3\n * ArrayExt.lowerBound(data, -1, numberCmp); // 0\n * ArrayExt.lowerBound(data, 10, numberCmp); // 6\n * ```\n */\n function lowerBound(array, value, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var begin = start;\n var span = stop - start + 1;\n while (span > 0) {\n var half = span >> 1;\n var middle = begin + half;\n if (fn(array[middle], value) < 0) {\n begin = middle + 1;\n span -= half + 1;\n }\n else {\n span = half;\n }\n }\n return begin;\n }\n ArrayExt.lowerBound = lowerBound;\n /**\n * Find the index of the first element which compares `>` than a value.\n *\n * @param array - The sorted array-like object to search.\n *\n * @param value - The value to locate in the array.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if an element is less than a value, `0` if\n * an element is equal to a value, or `> 0` if an element is greater\n * than a value.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the first element which compares `>` than the\n * value, or `length` if there is no such element. If the computed\n * index for `stop` is less than `start`, then the computed index\n * for `start` is returned.\n *\n * #### Notes\n * The array must already be sorted in ascending order according to\n * the comparison function.\n *\n * #### Complexity\n * Logarithmic.\n *\n * #### Undefined Behavior\n * Searching a range which is not sorted in ascending order.\n *\n * A `start` or `stop` which is non-integral.\n *\n * Modifying the length of the array while searching.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.upperBound(data, 0, numberCmp); // 1\n * ArrayExt.upperBound(data, 6, numberCmp); // 3\n * ArrayExt.upperBound(data, 7, numberCmp); // 5\n * ArrayExt.upperBound(data, -1, numberCmp); // 0\n * ArrayExt.upperBound(data, 10, numberCmp); // 6\n * ```\n */\n function upperBound(array, value, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var begin = start;\n var span = stop - start + 1;\n while (span > 0) {\n var half = span >> 1;\n var middle = begin + half;\n if (fn(array[middle], value) > 0) {\n span = half;\n }\n else {\n begin = middle + 1;\n span -= half + 1;\n }\n }\n return begin;\n }\n ArrayExt.upperBound = upperBound;\n /**\n * Test whether two arrays are shallowly equal.\n *\n * @param a - The first array-like object to compare.\n *\n * @param b - The second array-like object to compare.\n *\n * @param fn - The comparison function to apply to the elements. It\n * should return `true` if the elements are \"equal\". The default\n * compares elements using strict `===` equality.\n *\n * @returns Whether the two arrays are shallowly equal.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * Modifying the length of the arrays while comparing.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let d1 = [0, 3, 4, 7, 7, 9];\n * let d2 = [0, 3, 4, 7, 7, 9];\n * let d3 = [42];\n * ArrayExt.shallowEqual(d1, d2); // true\n * ArrayExt.shallowEqual(d2, d3); // false\n * ```\n */\n function shallowEqual(a, b, fn) {\n // Check for object identity first.\n if (a === b) {\n return true;\n }\n // Bail early if the lengths are different.\n if (a.length !== b.length) {\n return false;\n }\n // Compare each element for equality.\n for (var i = 0, n = a.length; i < n; ++i) {\n if (fn ? !fn(a[i], b[i]) : a[i] !== b[i]) {\n return false;\n }\n }\n // The array are shallowly equal.\n return true;\n }\n ArrayExt.shallowEqual = shallowEqual;\n /**\n * Create a slice of an array subject to an optional step.\n *\n * @param array - The array-like object of interest.\n *\n * @param options - The options for configuring the slice.\n *\n * @returns A new array with the specified values.\n *\n * @throws An exception if the slice `step` is `0`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start`, `stop`, or `step` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 3, 4, 7, 7, 9];\n * ArrayExt.slice(data); // [0, 3, 4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 2 }); // [4, 7, 7, 9]\n * ArrayExt.slice(data, { start: 0, stop: 4 }); // [0, 3, 4, 7]\n * ArrayExt.slice(data, { step: 2 }); // [0, 4, 7]\n * ArrayExt.slice(data, { step: -1 }); // [9, 7, 7, 4, 3, 0]\n * ```\n */\n function slice(array, options) {\n if (options === void 0) { options = {}; }\n // Extract the options.\n var start = options.start, stop = options.stop, step = options.step;\n // Set up the `step` value.\n if (step === undefined) {\n step = 1;\n }\n // Validate the step size.\n if (step === 0) {\n throw new Error('Slice `step` cannot be zero.');\n }\n // Look up the length of the array.\n var n = array.length;\n // Set up the `start` value.\n if (start === undefined) {\n start = step < 0 ? n - 1 : 0;\n }\n else if (start < 0) {\n start = Math.max(start + n, step < 0 ? -1 : 0);\n }\n else if (start >= n) {\n start = step < 0 ? n - 1 : n;\n }\n // Set up the `stop` value.\n if (stop === undefined) {\n stop = step < 0 ? -1 : n;\n }\n else if (stop < 0) {\n stop = Math.max(stop + n, step < 0 ? -1 : 0);\n }\n else if (stop >= n) {\n stop = step < 0 ? n - 1 : n;\n }\n // Compute the slice length.\n var length;\n if ((step < 0 && stop >= start) || (step > 0 && start >= stop)) {\n length = 0;\n }\n else if (step < 0) {\n length = Math.floor((stop - start + 1) / step + 1);\n }\n else {\n length = Math.floor((stop - start - 1) / step + 1);\n }\n // Compute the sliced result.\n var result = [];\n for (var i = 0; i < length; ++i) {\n result[i] = array[start + i * step];\n }\n // Return the result.\n return result;\n }\n ArrayExt.slice = slice;\n /**\n * Move an element in an array from one index to another.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param fromIndex - The index of the element to move. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param toIndex - The target index of the element. Negative\n * values are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `fromIndex` or `toIndex` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.move(data, 1, 2); // [0, 2, 1, 3, 4]\n * ArrayExt.move(data, 4, 2); // [0, 2, 4, 1, 3]\n * ```\n */\n function move(array, fromIndex, toIndex) {\n var n = array.length;\n if (n <= 1) {\n return;\n }\n if (fromIndex < 0) {\n fromIndex = Math.max(0, fromIndex + n);\n }\n else {\n fromIndex = Math.min(fromIndex, n - 1);\n }\n if (toIndex < 0) {\n toIndex = Math.max(0, toIndex + n);\n }\n else {\n toIndex = Math.min(toIndex, n - 1);\n }\n if (fromIndex === toIndex) {\n return;\n }\n var value = array[fromIndex];\n var d = fromIndex < toIndex ? 1 : -1;\n for (var i = fromIndex; i !== toIndex; i += d) {\n array[i] = array[i + d];\n }\n array[toIndex] = value;\n }\n ArrayExt.move = move;\n /**\n * Reverse an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param start - The index of the first element in the range to be\n * reversed, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * reversed, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` index which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.reverse(data, 1, 3); // [0, 3, 2, 1, 4]\n * ArrayExt.reverse(data, 3); // [0, 3, 2, 4, 1]\n * ArrayExt.reverse(data); // [1, 4, 2, 3, 0]\n * ```\n */\n function reverse(array, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n while (start < stop) {\n var a = array[start];\n var b = array[stop];\n array[start++] = b;\n array[stop--] = a;\n }\n }\n ArrayExt.reverse = reverse;\n /**\n * Rotate the elements of an array in-place.\n *\n * @param array - The mutable array-like object of interest.\n *\n * @param delta - The amount of rotation to apply to the elements. A\n * positive value will rotate the elements to the left. A negative\n * value will rotate the elements to the right.\n *\n * @param start - The index of the first element in the range to be\n * rotated, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * rotated, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `delta`, `start`, or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2, 3, 4];\n * ArrayExt.rotate(data, 2); // [2, 3, 4, 0, 1]\n * ArrayExt.rotate(data, -2); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 10); // [0, 1, 2, 3, 4]\n * ArrayExt.rotate(data, 9); // [4, 0, 1, 2, 3]\n * ArrayExt.rotate(data, 2, 1, 3); // [4, 2, 0, 1, 3]\n * ```\n */\n function rotate(array, delta, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n <= 1) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n if (start >= stop) {\n return;\n }\n var length = stop - start + 1;\n if (delta > 0) {\n delta = delta % length;\n }\n else if (delta < 0) {\n delta = ((delta % length) + length) % length;\n }\n if (delta === 0) {\n return;\n }\n var pivot = start + delta;\n reverse(array, start, pivot - 1);\n reverse(array, pivot, stop);\n reverse(array, start, stop);\n }\n ArrayExt.rotate = rotate;\n /**\n * Fill an array with a static value.\n *\n * @param array - The mutable array-like object to fill.\n *\n * @param value - The static value to use to fill the array.\n *\n * @param start - The index of the first element in the range to be\n * filled, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * filled, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * #### Notes\n * If `stop < start` the fill will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * A `start` or `stop` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = ['one', 'two', 'three', 'four'];\n * ArrayExt.fill(data, 'r'); // ['r', 'r', 'r', 'r']\n * ArrayExt.fill(data, 'g', 1); // ['r', 'g', 'g', 'g']\n * ArrayExt.fill(data, 'b', 2, 3); // ['r', 'g', 'b', 'b']\n * ArrayExt.fill(data, 'z', 3, 1); // ['z', 'z', 'b', 'z']\n * ```\n */\n function fill(array, value, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var span;\n if (stop < start) {\n span = (stop + 1) + (n - start);\n }\n else {\n span = stop - start + 1;\n }\n for (var i = 0; i < span; ++i) {\n array[(start + i) % n] = value;\n }\n }\n ArrayExt.fill = fill;\n /**\n * Insert a value into an array at a specific index.\n *\n * @param array - The array of interest.\n *\n * @param index - The index at which to insert the value. Negative\n * values are taken as an offset from the end of the array.\n *\n * @param value - The value to set at the specified index.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 1, 2];\n * ArrayExt.insert(data, 0, -1); // [-1, 0, 1, 2]\n * ArrayExt.insert(data, 2, 12); // [-1, 0, 12, 1, 2]\n * ArrayExt.insert(data, -1, 7); // [-1, 0, 12, 1, 7, 2]\n * ArrayExt.insert(data, 6, 19); // [-1, 0, 12, 1, 7, 2, 19]\n * ```\n */\n function insert(array, index, value) {\n var n = array.length;\n if (index < 0) {\n index = Math.max(0, index + n);\n }\n else {\n index = Math.min(index, n);\n }\n for (var i = n; i > index; --i) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n }\n ArrayExt.insert = insert;\n /**\n * Remove and return a value at a specific index in an array.\n *\n * @param array - The array of interest.\n *\n * @param index - The index of the value to remove. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The value at the specified index, or `undefined` if the\n * index is out of range.\n *\n * #### Complexity\n * Linear.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeAt(data, 2); // 23\n * ArrayExt.removeAt(data, -2); // 12\n * ArrayExt.removeAt(data, 10); // undefined;\n * ```\n */\n function removeAt(array, index) {\n var n = array.length;\n if (index < 0) {\n index += n;\n }\n if (index < 0 || index >= n) {\n return undefined;\n }\n var value = array[index];\n for (var i = index + 1; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length = n - 1;\n return value;\n }\n ArrayExt.removeAt = removeAt;\n /**\n * Remove the first occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstOf(data, 12); // 1\n * ArrayExt.removeFirstOf(data, 17); // -1\n * ArrayExt.removeFirstOf(data, 39, 3); // -1\n * ArrayExt.removeFirstOf(data, 39, 3, 2); // 2\n * ```\n */\n function removeFirstOf(array, value, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var index = firstIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeFirstOf = removeFirstOf;\n /**\n * Remove the last occurrence of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The index of the removed value, or `-1` if the value\n * is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastOf(data, 12); // 5\n * ArrayExt.removeLastOf(data, 17); // -1\n * ArrayExt.removeLastOf(data, 39, 2); // -1\n * ArrayExt.removeLastOf(data, 39, 2, 3); // 3\n * ```\n */\n function removeLastOf(array, value, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var index = lastIndexOf(array, value, start, stop);\n if (index !== -1) {\n removeAt(array, index);\n }\n return index;\n }\n ArrayExt.removeLastOf = removeLastOf;\n /**\n * Remove all occurrences of a value from an array.\n *\n * @param array - The array of interest.\n *\n * @param value - The value to remove from the array. Values are\n * compared using strict `===` equality.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * let data = [14, 12, 23, 39, 14, 12, 19, 14];\n * ArrayExt.removeAllOf(data, 12); // 2\n * ArrayExt.removeAllOf(data, 17); // 0\n * ArrayExt.removeAllOf(data, 14, 1, 4); // 1\n * ```\n */\n function removeAllOf(array, value, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var count = 0;\n for (var i = 0; i < n; ++i) {\n if (start <= stop && (i >= start && i <= stop) && array[i] === value) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && array[i] === value) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllOf = removeAllOf;\n /**\n * Remove the first occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `stop < start` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeFirstWhere(data, isEven); // { index: 0, value: 0 }\n * ArrayExt.removeFirstWhere(data, isEven, 2); // { index: 3, value: 14 }\n * ArrayExt.removeFirstWhere(data, isEven, 4); // { index: -1, value: undefined }\n * ```\n */\n function removeFirstWhere(array, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var value;\n var index = findFirstIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index: index, value: value };\n }\n ArrayExt.removeFirstWhere = removeFirstWhere;\n /**\n * Remove the last occurrence of a value which matches a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The removed `{ index, value }`, which will be `-1` and\n * `undefined` if the value is not contained in the array.\n *\n * #### Notes\n * If `start < stop` the search will wrap at the end of the array.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * let data = [0, 12, 23, 39, 14, 12, 75];\n * ArrayExt.removeLastWhere(data, isEven); // { index: 5, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2); // { index: 1, value: 12 }\n * ArrayExt.removeLastWhere(data, isEven, 2, 1); // { index: -1, value: undefined }\n * ```\n */\n function removeLastWhere(array, fn, start, stop) {\n if (start === void 0) { start = -1; }\n if (stop === void 0) { stop = 0; }\n var value;\n var index = findLastIndex(array, fn, start, stop);\n if (index !== -1) {\n value = removeAt(array, index);\n }\n return { index: index, value: value };\n }\n ArrayExt.removeLastWhere = removeLastWhere;\n /**\n * Remove all occurrences of values which match a predicate.\n *\n * @param array - The array of interest.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @param start - The index of the first element in the range to be\n * searched, inclusive. The default value is `0`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @param stop - The index of the last element in the range to be\n * searched, inclusive. The default value is `-1`. Negative values\n * are taken as an offset from the end of the array.\n *\n * @returns The number of elements removed from the array.\n *\n * #### Notes\n * If `stop < start` the search will conceptually wrap at the end of\n * the array, however the array will be traversed front-to-back.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { ArrayExt } from '@lumino/algorithm';\n *\n * function isEven(value: number): boolean {\n * return value % 2 === 0;\n * }\n *\n * function isNegative(value: number): boolean {\n * return value < 0;\n * }\n *\n * let data = [0, 12, -13, -9, 23, 39, 14, -15, 12, 75];\n * ArrayExt.removeAllWhere(data, isEven); // 4\n * ArrayExt.removeAllWhere(data, isNegative, 0, 3); // 2\n * ```\n */\n function removeAllWhere(array, fn, start, stop) {\n if (start === void 0) { start = 0; }\n if (stop === void 0) { stop = -1; }\n var n = array.length;\n if (n === 0) {\n return 0;\n }\n if (start < 0) {\n start = Math.max(0, start + n);\n }\n else {\n start = Math.min(start, n - 1);\n }\n if (stop < 0) {\n stop = Math.max(0, stop + n);\n }\n else {\n stop = Math.min(stop, n - 1);\n }\n var count = 0;\n for (var i = 0; i < n; ++i) {\n if (start <= stop && (i >= start && i <= stop) && fn(array[i], i)) {\n count++;\n }\n else if (stop < start && (i <= stop || i >= start) && fn(array[i], i)) {\n count++;\n }\n else if (count > 0) {\n array[i - count] = array[i];\n }\n }\n if (count > 0) {\n array.length = n - count;\n }\n return count;\n }\n ArrayExt.removeAllWhere = removeAllWhere;\n})(exports.ArrayExt || (exports.ArrayExt = {}));\n//# sourceMappingURL=array.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/array.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/chain.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/chain.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/chain.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Chain together several iterables.\n *\n * @param objects - The iterable or array-like objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain, toArray } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction chain() {\n var objects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n objects[_i] = arguments[_i];\n }\n return new ChainIterator(iter.iter(objects.map(iter.iter)));\n}\n/**\n * An iterator which chains together several iterators.\n */\nvar ChainIterator = /** @class */ (function () {\n /**\n * Construct a new chain iterator.\n *\n * @param source - The iterator of iterators of interest.\n */\n function ChainIterator(source) {\n this._cloned = false;\n this._source = source;\n this._active = undefined;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ChainIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ChainIterator.prototype.clone = function () {\n var result = new ChainIterator(this._source.clone());\n result._active = this._active && this._active.clone();\n result._cloned = true;\n this._cloned = true;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ChainIterator.prototype.next = function () {\n if (this._active === undefined) {\n var active = this._source.next();\n if (active === undefined) {\n return undefined;\n }\n this._active = this._cloned ? active.clone() : active;\n }\n var value = this._active.next();\n if (value !== undefined) {\n return value;\n }\n this._active = undefined;\n return this.next();\n };\n return ChainIterator;\n}());\n\nexports.ChainIterator = ChainIterator;\nexports.chain = chain;\n//# sourceMappingURL=chain.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/chain.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Chain together several iterables.\n *\n * @param objects - The iterable or array-like objects of interest.\n *\n * @returns An iterator which yields the values of the iterables\n * in the order in which they are supplied.\n *\n * #### Example\n * ```typescript\n * import { chain, toArray } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = chain(data1, data2);\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6]\n * ```\n */\nfunction chain() {\n var objects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n objects[_i] = arguments[_i];\n }\n return new ChainIterator(iter.iter(objects.map(iter.iter)));\n}\n/**\n * An iterator which chains together several iterators.\n */\nvar ChainIterator = /** @class */ (function () {\n /**\n * Construct a new chain iterator.\n *\n * @param source - The iterator of iterators of interest.\n */\n function ChainIterator(source) {\n this._cloned = false;\n this._source = source;\n this._active = undefined;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ChainIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ChainIterator.prototype.clone = function () {\n var result = new ChainIterator(this._source.clone());\n result._active = this._active && this._active.clone();\n result._cloned = true;\n this._cloned = true;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ChainIterator.prototype.next = function () {\n if (this._active === undefined) {\n var active = this._source.next();\n if (active === undefined) {\n return undefined;\n }\n this._active = this._cloned ? active.clone() : active;\n }\n var value = this._active.next();\n if (value !== undefined) {\n return value;\n }\n this._active = undefined;\n return this.next();\n };\n return ChainIterator;\n}());\n\nexports.ChainIterator = ChainIterator;\nexports.chain = chain;\n//# sourceMappingURL=chain.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/chain.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/empty.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/empty.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/empty.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty, toArray } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * toArray(stream); // []\n * ```\n */\nfunction empty() {\n return new EmptyIterator();\n}\n/**\n * An iterator which is always empty.\n */\nvar EmptyIterator = /** @class */ (function () {\n /**\n * Construct a new empty iterator.\n */\n function EmptyIterator() {\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n EmptyIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n EmptyIterator.prototype.clone = function () {\n return new EmptyIterator();\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n EmptyIterator.prototype.next = function () {\n return undefined;\n };\n return EmptyIterator;\n}());\n\nexports.EmptyIterator = EmptyIterator;\nexports.empty = empty;\n//# sourceMappingURL=empty.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/empty.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Create an empty iterator.\n *\n * @returns A new iterator which yields nothing.\n *\n * #### Example\n * ```typescript\n * import { empty, toArray } from '@lumino/algorithm';\n *\n * let stream = empty();\n *\n * toArray(stream); // []\n * ```\n */\nfunction empty() {\n return new EmptyIterator();\n}\n/**\n * An iterator which is always empty.\n */\nvar EmptyIterator = /** @class */ (function () {\n /**\n * Construct a new empty iterator.\n */\n function EmptyIterator() {\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n EmptyIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n EmptyIterator.prototype.clone = function () {\n return new EmptyIterator();\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n EmptyIterator.prototype.next = function () {\n return undefined;\n };\n return EmptyIterator;\n}());\n\nexports.EmptyIterator = EmptyIterator;\nexports.empty = empty;\n//# sourceMappingURL=empty.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/empty.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/enumerate.js": │ │ │ │ /*!***********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/enumerate.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/enumerate.js ***! │ │ │ │ \***********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate, toArray } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * toArray(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction enumerate(object, start) {\n if (start === void 0) { start = 0; }\n return new EnumerateIterator(iter.iter(object), start);\n}\n/**\n * An iterator which enumerates the source values.\n */\nvar EnumerateIterator = /** @class */ (function () {\n /**\n * Construct a new enumerate iterator.\n *\n * @param source - The iterator of values of interest.\n *\n * @param start - The starting enum value.\n */\n function EnumerateIterator(source, start) {\n this._source = source;\n this._index = start;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n EnumerateIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n EnumerateIterator.prototype.clone = function () {\n return new EnumerateIterator(this._source.clone(), this._index);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n EnumerateIterator.prototype.next = function () {\n var value = this._source.next();\n if (value === undefined) {\n return undefined;\n }\n return [this._index++, value];\n };\n return EnumerateIterator;\n}());\n\nexports.EnumerateIterator = EnumerateIterator;\nexports.enumerate = enumerate;\n//# sourceMappingURL=enumerate.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/enumerate.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Enumerate an iterable object.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param start - The starting enum value. The default is `0`.\n *\n * @returns An iterator which yields the enumerated values.\n *\n * #### Example\n * ```typescript\n * import { enumerate, toArray } from '@lumino/algorithm';\n *\n * let data = ['foo', 'bar', 'baz'];\n *\n * let stream = enumerate(data, 1);\n *\n * toArray(stream); // [[1, 'foo'], [2, 'bar'], [3, 'baz']]\n * ```\n */\nfunction enumerate(object, start) {\n if (start === void 0) { start = 0; }\n return new EnumerateIterator(iter.iter(object), start);\n}\n/**\n * An iterator which enumerates the source values.\n */\nvar EnumerateIterator = /** @class */ (function () {\n /**\n * Construct a new enumerate iterator.\n *\n * @param source - The iterator of values of interest.\n *\n * @param start - The starting enum value.\n */\n function EnumerateIterator(source, start) {\n this._source = source;\n this._index = start;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n EnumerateIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n EnumerateIterator.prototype.clone = function () {\n return new EnumerateIterator(this._source.clone(), this._index);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n EnumerateIterator.prototype.next = function () {\n var value = this._source.next();\n if (value === undefined) {\n return undefined;\n }\n return [this._index++, value];\n };\n return EnumerateIterator;\n}());\n\nexports.EnumerateIterator = EnumerateIterator;\nexports.enumerate = enumerate;\n//# sourceMappingURL=enumerate.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/enumerate.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/filter.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/filter.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/filter.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * toArray(stream); // [2, 4, 6]\n * ```\n */\nfunction filter(object, fn) {\n return new FilterIterator(iter.iter(object), fn);\n}\n/**\n * An iterator which yields values which pass a test.\n */\nvar FilterIterator = /** @class */ (function () {\n /**\n * Construct a new filter iterator.\n *\n * @param source - The iterator of values of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n */\n function FilterIterator(source, fn) {\n this._index = 0;\n this._source = source;\n this._fn = fn;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n FilterIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n FilterIterator.prototype.clone = function () {\n var result = new FilterIterator(this._source.clone(), this._fn);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n FilterIterator.prototype.next = function () {\n var fn = this._fn;\n var it = this._source;\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, this._index++)) {\n return value;\n }\n }\n return undefined;\n };\n return FilterIterator;\n}());\n\nexports.FilterIterator = FilterIterator;\nexports.filter = filter;\n//# sourceMappingURL=filter.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/filter.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Filter an iterable for values which pass a test.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns An iterator which yields the values which pass the test.\n *\n * #### Example\n * ```typescript\n * import { filter, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = filter(data, value => value % 2 === 0);\n *\n * toArray(stream); // [2, 4, 6]\n * ```\n */\nfunction filter(object, fn) {\n return new FilterIterator(iter.iter(object), fn);\n}\n/**\n * An iterator which yields values which pass a test.\n */\nvar FilterIterator = /** @class */ (function () {\n /**\n * Construct a new filter iterator.\n *\n * @param source - The iterator of values of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n */\n function FilterIterator(source, fn) {\n this._index = 0;\n this._source = source;\n this._fn = fn;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n FilterIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n FilterIterator.prototype.clone = function () {\n var result = new FilterIterator(this._source.clone(), this._fn);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n FilterIterator.prototype.next = function () {\n var fn = this._fn;\n var it = this._source;\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, this._index++)) {\n return value;\n }\n }\n return undefined;\n };\n return FilterIterator;\n}());\n\nexports.FilterIterator = FilterIterator;\nexports.filter = filter;\n//# sourceMappingURL=filter.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/filter.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/find.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/find.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/find.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n var index = 0;\n var it = iter.iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n var index = 0;\n var it = iter.iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n var it = iter.iter(object);\n var value = it.next();\n if (value === undefined) {\n return undefined;\n }\n var result = value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n var it = iter.iter(object);\n var value = it.next();\n if (value === undefined) {\n return undefined;\n }\n var result = value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n var it = iter.iter(object);\n var value = it.next();\n if (value === undefined) {\n return undefined;\n }\n var vmin = value;\n var vmax = value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return [vmin, vmax];\n}\n\nexports.find = find;\nexports.findIndex = findIndex;\nexports.max = max;\nexports.min = min;\nexports.minmax = minmax;\n//# sourceMappingURL=find.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/find.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Find the first value in an iterable which matches a predicate.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The first matching value, or `undefined` if no matching\n * value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { find } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * find(data, isCat).name; // 'fluffy'\n * ```\n */\nfunction find(object, fn) {\n var index = 0;\n var it = iter.iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, index++)) {\n return value;\n }\n }\n return undefined;\n}\n/**\n * Find the index of the first value which matches a predicate.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The predicate function to apply to the values.\n *\n * @returns The index of the first matching value, or `-1` if no\n * matching value is found.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { findIndex } from '@lumino/algorithm';\n *\n * interface IAnimal { species: string, name: string };\n *\n * function isCat(value: IAnimal): boolean {\n * return value.species === 'cat';\n * }\n *\n * let data: IAnimal[] = [\n * { species: 'dog', name: 'spot' },\n * { species: 'cat', name: 'fluffy' },\n * { species: 'alligator', name: 'pocho' }\n * ];\n *\n * findIndex(data, isCat); // 1\n * ```\n */\nfunction findIndex(object, fn) {\n var index = 0;\n var it = iter.iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, index++)) {\n return index - 1;\n }\n }\n return -1;\n}\n/**\n * Find the minimum value in an iterable.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The minimum value in the iterable. If multiple values are\n * equivalent to the minimum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { min } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * min([7, 4, 0, 3, 9, 4], numberCmp); // 0\n * ```\n */\nfunction min(object, fn) {\n var it = iter.iter(object);\n var value = it.next();\n if (value === undefined) {\n return undefined;\n }\n var result = value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, result) < 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the maximum value in an iterable.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns The maximum value in the iterable. If multiple values are\n * equivalent to the maximum, the left-most value is returned. If\n * the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { max } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * max([7, 4, 0, 3, 9, 4], numberCmp); // 9\n * ```\n */\nfunction max(object, fn) {\n var it = iter.iter(object);\n var value = it.next();\n if (value === undefined) {\n return undefined;\n }\n var result = value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, result) > 0) {\n result = value;\n }\n }\n return result;\n}\n/**\n * Find the minimum and maximum values in an iterable.\n *\n * @param object - The iterable or array-like object to search.\n *\n * @param fn - The 3-way comparison function to apply to the values.\n * It should return `< 0` if the first value is less than the second.\n * `0` if the values are equivalent, or `> 0` if the first value is\n * greater than the second.\n *\n * @returns A 2-tuple of the `[min, max]` values in the iterable. If\n * multiple values are equivalent, the left-most values are returned.\n * If the iterable is empty, this returns `undefined`.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { minmax } from '@lumino/algorithm';\n *\n * function numberCmp(a: number, b: number): number {\n * return a - b;\n * }\n *\n * minmax([7, 4, 0, 3, 9, 4], numberCmp); // [0, 9]\n * ```\n */\nfunction minmax(object, fn) {\n var it = iter.iter(object);\n var value = it.next();\n if (value === undefined) {\n return undefined;\n }\n var vmin = value;\n var vmax = value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, vmin) < 0) {\n vmin = value;\n }\n else if (fn(value, vmax) > 0) {\n vmax = value;\n }\n }\n return [vmin, vmax];\n}\n\nexports.find = find;\nexports.findIndex = findIndex;\nexports.max = max;\nexports.min = min;\nexports.minmax = minmax;\n//# sourceMappingURL=find.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/find.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/index.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/index.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar array = __webpack_require__(/*! ./array.js */ \"../../packages/algorithm/dist/array.js\");\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\nvar chain = __webpack_require__(/*! ./chain.js */ \"../../packages/algorithm/dist/chain.js\");\nvar empty = __webpack_require__(/*! ./empty.js */ \"../../packages/algorithm/dist/empty.js\");\nvar enumerate = __webpack_require__(/*! ./enumerate.js */ \"../../packages/algorithm/dist/enumerate.js\");\nvar filter = __webpack_require__(/*! ./filter.js */ \"../../packages/algorithm/dist/filter.js\");\nvar find = __webpack_require__(/*! ./find.js */ \"../../packages/algorithm/dist/find.js\");\nvar map = __webpack_require__(/*! ./map.js */ \"../../packages/algorithm/dist/map.js\");\nvar range = __webpack_require__(/*! ./range.js */ \"../../packages/algorithm/dist/range.js\");\nvar reduce = __webpack_require__(/*! ./reduce.js */ \"../../packages/algorithm/dist/reduce.js\");\nvar repeat = __webpack_require__(/*! ./repeat.js */ \"../../packages/algorithm/dist/repeat.js\");\nvar retro = __webpack_require__(/*! ./retro.js */ \"../../packages/algorithm/dist/retro.js\");\nvar sort = __webpack_require__(/*! ./sort.js */ \"../../packages/algorithm/dist/sort.js\");\nvar stride = __webpack_require__(/*! ./stride.js */ \"../../packages/algorithm/dist/stride.js\");\nvar string = __webpack_require__(/*! ./string.js */ \"../../packages/algorithm/dist/string.js\");\nvar take = __webpack_require__(/*! ./take.js */ \"../../packages/algorithm/dist/take.js\");\nvar zip = __webpack_require__(/*! ./zip.js */ \"../../packages/algorithm/dist/zip.js\");\n\n\n\nObject.defineProperty(exports, 'ArrayExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn array.ArrayExt;\n\t}\n});\nexports.ArrayIterator = iter.ArrayIterator;\nexports.FnIterator = iter.FnIterator;\nexports.ItemIterator = iter.ItemIterator;\nexports.KeyIterator = iter.KeyIterator;\nexports.ValueIterator = iter.ValueIterator;\nexports.each = iter.each;\nexports.every = iter.every;\nexports.iter = iter.iter;\nexports.iterFn = iter.iterFn;\nexports.iterItems = iter.iterItems;\nexports.iterKeys = iter.iterKeys;\nexports.iterValues = iter.iterValues;\nexports.some = iter.some;\nexports.toArray = iter.toArray;\nexports.toObject = iter.toObject;\nexports.ChainIterator = chain.ChainIterator;\nexports.chain = chain.chain;\nexports.EmptyIterator = empty.EmptyIterator;\nexports.empty = empty.empty;\nexports.EnumerateIterator = enumerate.EnumerateIterator;\nexports.enumerate = enumerate.enumerate;\nexports.FilterIterator = filter.FilterIterator;\nexports.filter = filter.filter;\nexports.find = find.find;\nexports.findIndex = find.findIndex;\nexports.max = find.max;\nexports.min = find.min;\nexports.minmax = find.minmax;\nexports.MapIterator = map.MapIterator;\nexports.map = map.map;\nexports.RangeIterator = range.RangeIterator;\nexports.range = range.range;\nexports.reduce = reduce.reduce;\nexports.RepeatIterator = repeat.RepeatIterator;\nexports.once = repeat.once;\nexports.repeat = repeat.repeat;\nexports.RetroArrayIterator = retro.RetroArrayIterator;\nexports.retro = retro.retro;\nexports.topologicSort = sort.topologicSort;\nexports.StrideIterator = stride.StrideIterator;\nexports.stride = stride.stride;\nObject.defineProperty(exports, 'StringExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn string.StringExt;\n\t}\n});\nexports.TakeIterator = take.TakeIterator;\nexports.take = take.take;\nexports.ZipIterator = zip.ZipIterator;\nexports.zip = zip.zip;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar array = __webpack_require__(/*! ./array.js */ \"../../packages/algorithm/dist/array.js\");\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\nvar chain = __webpack_require__(/*! ./chain.js */ \"../../packages/algorithm/dist/chain.js\");\nvar empty = __webpack_require__(/*! ./empty.js */ \"../../packages/algorithm/dist/empty.js\");\nvar enumerate = __webpack_require__(/*! ./enumerate.js */ \"../../packages/algorithm/dist/enumerate.js\");\nvar filter = __webpack_require__(/*! ./filter.js */ \"../../packages/algorithm/dist/filter.js\");\nvar find = __webpack_require__(/*! ./find.js */ \"../../packages/algorithm/dist/find.js\");\nvar map = __webpack_require__(/*! ./map.js */ \"../../packages/algorithm/dist/map.js\");\nvar range = __webpack_require__(/*! ./range.js */ \"../../packages/algorithm/dist/range.js\");\nvar reduce = __webpack_require__(/*! ./reduce.js */ \"../../packages/algorithm/dist/reduce.js\");\nvar repeat = __webpack_require__(/*! ./repeat.js */ \"../../packages/algorithm/dist/repeat.js\");\nvar retro = __webpack_require__(/*! ./retro.js */ \"../../packages/algorithm/dist/retro.js\");\nvar sort = __webpack_require__(/*! ./sort.js */ \"../../packages/algorithm/dist/sort.js\");\nvar stride = __webpack_require__(/*! ./stride.js */ \"../../packages/algorithm/dist/stride.js\");\nvar string = __webpack_require__(/*! ./string.js */ \"../../packages/algorithm/dist/string.js\");\nvar take = __webpack_require__(/*! ./take.js */ \"../../packages/algorithm/dist/take.js\");\nvar zip = __webpack_require__(/*! ./zip.js */ \"../../packages/algorithm/dist/zip.js\");\n\n\n\nObject.defineProperty(exports, 'ArrayExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn array.ArrayExt;\n\t}\n});\nexports.ArrayIterator = iter.ArrayIterator;\nexports.FnIterator = iter.FnIterator;\nexports.ItemIterator = iter.ItemIterator;\nexports.KeyIterator = iter.KeyIterator;\nexports.ValueIterator = iter.ValueIterator;\nexports.each = iter.each;\nexports.every = iter.every;\nexports.iter = iter.iter;\nexports.iterFn = iter.iterFn;\nexports.iterItems = iter.iterItems;\nexports.iterKeys = iter.iterKeys;\nexports.iterValues = iter.iterValues;\nexports.some = iter.some;\nexports.toArray = iter.toArray;\nexports.toObject = iter.toObject;\nexports.ChainIterator = chain.ChainIterator;\nexports.chain = chain.chain;\nexports.EmptyIterator = empty.EmptyIterator;\nexports.empty = empty.empty;\nexports.EnumerateIterator = enumerate.EnumerateIterator;\nexports.enumerate = enumerate.enumerate;\nexports.FilterIterator = filter.FilterIterator;\nexports.filter = filter.filter;\nexports.find = find.find;\nexports.findIndex = find.findIndex;\nexports.max = find.max;\nexports.min = find.min;\nexports.minmax = find.minmax;\nexports.MapIterator = map.MapIterator;\nexports.map = map.map;\nexports.RangeIterator = range.RangeIterator;\nexports.range = range.range;\nexports.reduce = reduce.reduce;\nexports.RepeatIterator = repeat.RepeatIterator;\nexports.once = repeat.once;\nexports.repeat = repeat.repeat;\nexports.RetroArrayIterator = retro.RetroArrayIterator;\nexports.retro = retro.retro;\nexports.topologicSort = sort.topologicSort;\nexports.StrideIterator = stride.StrideIterator;\nexports.stride = stride.stride;\nObject.defineProperty(exports, 'StringExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn string.StringExt;\n\t}\n});\nexports.TakeIterator = take.TakeIterator;\nexports.take = take.take;\nexports.ZipIterator = zip.ZipIterator;\nexports.zip = zip.zip;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/iter.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/iter.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/iter.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for an iterable object.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @returns A new iterator for the given object.\n *\n * #### Notes\n * This function allows iteration algorithms to operate on user-defined\n * iterable types and builtin array-like objects in a uniform fashion.\n */\nfunction iter(object) {\n var it;\n if (typeof object.iter === 'function') {\n it = object.iter();\n }\n else {\n it = new ArrayIterator(object);\n }\n return it;\n}\n/**\n * Create an iterator for the keys in an object.\n *\n * @param object - The object of interest.\n *\n * @returns A new iterator for the keys in the given object.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each, keys } from '@lumino/algorithm';\n *\n * let data = { one: 1, two: 2, three: 3 };\n *\n * each(keys(data), key => { console.log(key); }); // 'one', 'two', 'three'\n * ```\n */\nfunction iterKeys(object) {\n return new KeyIterator(object);\n}\n/**\n * Create an iterator for the values in an object.\n *\n * @param object - The object of interest.\n *\n * @returns A new iterator for the values in the given object.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each, values } from '@lumino/algorithm';\n *\n * let data = { one: 1, two: 2, three: 3 };\n *\n * each(values(data), value => { console.log(value); }); // 1, 2, 3\n * ```\n */\nfunction iterValues(object) {\n return new ValueIterator(object);\n}\n/**\n * Create an iterator for the items in an object.\n *\n * @param object - The object of interest.\n *\n * @returns A new iterator for the items in the given object.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each, items } from '@lumino/algorithm';\n *\n * let data = { one: 1, two: 2, three: 3 };\n *\n * each(items(data), value => { console.log(value); }); // ['one', 1], ['two', 2], ['three', 3]\n * ```\n */\nfunction iterItems(object) {\n return new ItemIterator(object);\n}\n/**\n * Create an iterator for an iterator-like function.\n *\n * @param fn - A function which behaves like an iterator `next` method.\n *\n * @returns A new iterator for the given function.\n *\n * #### Notes\n * The returned iterator **cannot** be cloned.\n *\n * #### Example\n * ```typescript\n * import { each, iterFn } from '@lumino/algorithm';\n *\n * let it = iterFn((() => {\n * let i = 0;\n * return () => i > 3 ? undefined : i++;\n * })());\n *\n * each(it, v => { console.log(v); }); // 0, 1, 2, 3\n * ```\n */\nfunction iterFn(fn) {\n return new FnIterator(fn);\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n var index = 0;\n var it = iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, index++) === false) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n var index = 0;\n var it = iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (!fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n var index = 0;\n var it = iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Create an array from an iterable of values.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { iter, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = iter(data);\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n var index = 0;\n var result = [];\n var it = iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n result[index++] = value;\n }\n return result;\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n var it = iter(object);\n var pair;\n var result = {};\n while ((pair = it.next()) !== undefined) {\n result[pair[0]] = pair[1];\n }\n return result;\n}\n/**\n * An iterator for an array-like object.\n *\n * #### Notes\n * This iterator can be used for any builtin JS array-like object.\n */\nvar ArrayIterator = /** @class */ (function () {\n /**\n * Construct a new array iterator.\n *\n * @param source - The array-like object of interest.\n */\n function ArrayIterator(source) {\n this._index = 0;\n this._source = source;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ArrayIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ArrayIterator.prototype.clone = function () {\n var result = new ArrayIterator(this._source);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ArrayIterator.prototype.next = function () {\n if (this._index >= this._source.length) {\n return undefined;\n }\n return this._source[this._index++];\n };\n return ArrayIterator;\n}());\n/**\n * An iterator for the keys in an object.\n *\n * #### Notes\n * This iterator can be used for any JS object.\n */\nvar KeyIterator = /** @class */ (function () {\n /**\n * Construct a new key iterator.\n *\n * @param source - The object of interest.\n *\n * @param keys - The keys to iterate, if known.\n */\n function KeyIterator(source, keys) {\n if (keys === void 0) { keys = Object.keys(source); }\n this._index = 0;\n this._source = source;\n this._keys = keys;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n KeyIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n KeyIterator.prototype.clone = function () {\n var result = new KeyIterator(this._source, this._keys);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n KeyIterator.prototype.next = function () {\n if (this._index >= this._keys.length) {\n return undefined;\n }\n var key = this._keys[this._index++];\n if (key in this._source) {\n return key;\n }\n return this.next();\n };\n return KeyIterator;\n}());\n/**\n * An iterator for the values in an object.\n *\n * #### Notes\n * This iterator can be used for any JS object.\n */\nvar ValueIterator = /** @class */ (function () {\n /**\n * Construct a new value iterator.\n *\n * @param source - The object of interest.\n *\n * @param keys - The keys to iterate, if known.\n */\n function ValueIterator(source, keys) {\n if (keys === void 0) { keys = Object.keys(source); }\n this._index = 0;\n this._source = source;\n this._keys = keys;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ValueIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ValueIterator.prototype.clone = function () {\n var result = new ValueIterator(this._source, this._keys);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ValueIterator.prototype.next = function () {\n if (this._index >= this._keys.length) {\n return undefined;\n }\n var key = this._keys[this._index++];\n if (key in this._source) {\n return this._source[key];\n }\n return this.next();\n };\n return ValueIterator;\n}());\n/**\n * An iterator for the items in an object.\n *\n * #### Notes\n * This iterator can be used for any JS object.\n */\nvar ItemIterator = /** @class */ (function () {\n /**\n * Construct a new item iterator.\n *\n * @param source - The object of interest.\n *\n * @param keys - The keys to iterate, if known.\n */\n function ItemIterator(source, keys) {\n if (keys === void 0) { keys = Object.keys(source); }\n this._index = 0;\n this._source = source;\n this._keys = keys;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ItemIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ItemIterator.prototype.clone = function () {\n var result = new ItemIterator(this._source, this._keys);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ItemIterator.prototype.next = function () {\n if (this._index >= this._keys.length) {\n return undefined;\n }\n var key = this._keys[this._index++];\n if (key in this._source) {\n return [key, this._source[key]];\n }\n return this.next();\n };\n return ItemIterator;\n}());\n/**\n * An iterator for an iterator-like function.\n */\nvar FnIterator = /** @class */ (function () {\n /**\n * Construct a new function iterator.\n *\n * @param fn - The iterator-like function of interest.\n */\n function FnIterator(fn) {\n this._fn = fn;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n FnIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n FnIterator.prototype.clone = function () {\n throw new Error('An `FnIterator` cannot be cloned.');\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n FnIterator.prototype.next = function () {\n return this._fn.call(undefined);\n };\n return FnIterator;\n}());\n\nexports.ArrayIterator = ArrayIterator;\nexports.FnIterator = FnIterator;\nexports.ItemIterator = ItemIterator;\nexports.KeyIterator = KeyIterator;\nexports.ValueIterator = ValueIterator;\nexports.each = each;\nexports.every = every;\nexports.iter = iter;\nexports.iterFn = iterFn;\nexports.iterItems = iterItems;\nexports.iterKeys = iterKeys;\nexports.iterValues = iterValues;\nexports.some = some;\nexports.toArray = toArray;\nexports.toObject = toObject;\n//# sourceMappingURL=iter.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/iter.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Create an iterator for an iterable object.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @returns A new iterator for the given object.\n *\n * #### Notes\n * This function allows iteration algorithms to operate on user-defined\n * iterable types and builtin array-like objects in a uniform fashion.\n */\nfunction iter(object) {\n var it;\n if (typeof object.iter === 'function') {\n it = object.iter();\n }\n else {\n it = new ArrayIterator(object);\n }\n return it;\n}\n/**\n * Create an iterator for the keys in an object.\n *\n * @param object - The object of interest.\n *\n * @returns A new iterator for the keys in the given object.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each, keys } from '@lumino/algorithm';\n *\n * let data = { one: 1, two: 2, three: 3 };\n *\n * each(keys(data), key => { console.log(key); }); // 'one', 'two', 'three'\n * ```\n */\nfunction iterKeys(object) {\n return new KeyIterator(object);\n}\n/**\n * Create an iterator for the values in an object.\n *\n * @param object - The object of interest.\n *\n * @returns A new iterator for the values in the given object.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each, values } from '@lumino/algorithm';\n *\n * let data = { one: 1, two: 2, three: 3 };\n *\n * each(values(data), value => { console.log(value); }); // 1, 2, 3\n * ```\n */\nfunction iterValues(object) {\n return new ValueIterator(object);\n}\n/**\n * Create an iterator for the items in an object.\n *\n * @param object - The object of interest.\n *\n * @returns A new iterator for the items in the given object.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each, items } from '@lumino/algorithm';\n *\n * let data = { one: 1, two: 2, three: 3 };\n *\n * each(items(data), value => { console.log(value); }); // ['one', 1], ['two', 2], ['three', 3]\n * ```\n */\nfunction iterItems(object) {\n return new ItemIterator(object);\n}\n/**\n * Create an iterator for an iterator-like function.\n *\n * @param fn - A function which behaves like an iterator `next` method.\n *\n * @returns A new iterator for the given function.\n *\n * #### Notes\n * The returned iterator **cannot** be cloned.\n *\n * #### Example\n * ```typescript\n * import { each, iterFn } from '@lumino/algorithm';\n *\n * let it = iterFn((() => {\n * let i = 0;\n * return () => i > 3 ? undefined : i++;\n * })());\n *\n * each(it, v => { console.log(v); }); // 0, 1, 2, 3\n * ```\n */\nfunction iterFn(fn) {\n return new FnIterator(fn);\n}\n/**\n * Invoke a function for each value in an iterable.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The callback function to invoke for each value.\n *\n * #### Notes\n * Iteration can be terminated early by returning `false` from the\n * callback function.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { each } from '@lumino/algorithm';\n *\n * let data = [5, 7, 0, -2, 9];\n *\n * each(data, value => { console.log(value); });\n * ```\n */\nfunction each(object, fn) {\n var index = 0;\n var it = iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, index++) === false) {\n return;\n }\n }\n}\n/**\n * Test whether all values in an iterable satisfy a predicate.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if all values pass the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `false` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { every } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * every(data, value => value % 2 === 0); // false\n * every(data, value => value % 2 === 1); // true\n * ```\n */\nfunction every(object, fn) {\n var index = 0;\n var it = iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (!fn(value, index++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Test whether any value in an iterable satisfies a predicate.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The predicate function to invoke for each value.\n *\n * @returns `true` if any value passes the test, `false` otherwise.\n *\n * #### Notes\n * Iteration terminates on the first `true` predicate result.\n *\n * #### Complexity\n * Linear.\n *\n * #### Example\n * ```typescript\n * import { some } from '@lumino/algorithm';\n *\n * let data = [5, 7, 1];\n *\n * some(data, value => value === 7); // true\n * some(data, value => value === 3); // false\n * ```\n */\nfunction some(object, fn) {\n var index = 0;\n var it = iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n if (fn(value, index++)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Create an array from an iterable of values.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @returns A new array of values from the given object.\n *\n * #### Example\n * ```typescript\n * import { iter, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = iter(data);\n *\n * toArray(stream); // [1, 2, 3, 4, 5, 6];\n * ```\n */\nfunction toArray(object) {\n var index = 0;\n var result = [];\n var it = iter(object);\n var value;\n while ((value = it.next()) !== undefined) {\n result[index++] = value;\n }\n return result;\n}\n/**\n * Create an object from an iterable of key/value pairs.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @returns A new object mapping keys to values.\n *\n * #### Example\n * ```typescript\n * import { toObject } from '@lumino/algorithm';\n *\n * let data = [['one', 1], ['two', 2], ['three', 3]];\n *\n * toObject(data); // { one: 1, two: 2, three: 3 }\n * ```\n */\nfunction toObject(object) {\n var it = iter(object);\n var pair;\n var result = {};\n while ((pair = it.next()) !== undefined) {\n result[pair[0]] = pair[1];\n }\n return result;\n}\n/**\n * An iterator for an array-like object.\n *\n * #### Notes\n * This iterator can be used for any builtin JS array-like object.\n */\nvar ArrayIterator = /** @class */ (function () {\n /**\n * Construct a new array iterator.\n *\n * @param source - The array-like object of interest.\n */\n function ArrayIterator(source) {\n this._index = 0;\n this._source = source;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ArrayIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ArrayIterator.prototype.clone = function () {\n var result = new ArrayIterator(this._source);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ArrayIterator.prototype.next = function () {\n if (this._index >= this._source.length) {\n return undefined;\n }\n return this._source[this._index++];\n };\n return ArrayIterator;\n}());\n/**\n * An iterator for the keys in an object.\n *\n * #### Notes\n * This iterator can be used for any JS object.\n */\nvar KeyIterator = /** @class */ (function () {\n /**\n * Construct a new key iterator.\n *\n * @param source - The object of interest.\n *\n * @param keys - The keys to iterate, if known.\n */\n function KeyIterator(source, keys) {\n if (keys === void 0) { keys = Object.keys(source); }\n this._index = 0;\n this._source = source;\n this._keys = keys;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n KeyIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n KeyIterator.prototype.clone = function () {\n var result = new KeyIterator(this._source, this._keys);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n KeyIterator.prototype.next = function () {\n if (this._index >= this._keys.length) {\n return undefined;\n }\n var key = this._keys[this._index++];\n if (key in this._source) {\n return key;\n }\n return this.next();\n };\n return KeyIterator;\n}());\n/**\n * An iterator for the values in an object.\n *\n * #### Notes\n * This iterator can be used for any JS object.\n */\nvar ValueIterator = /** @class */ (function () {\n /**\n * Construct a new value iterator.\n *\n * @param source - The object of interest.\n *\n * @param keys - The keys to iterate, if known.\n */\n function ValueIterator(source, keys) {\n if (keys === void 0) { keys = Object.keys(source); }\n this._index = 0;\n this._source = source;\n this._keys = keys;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ValueIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ValueIterator.prototype.clone = function () {\n var result = new ValueIterator(this._source, this._keys);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ValueIterator.prototype.next = function () {\n if (this._index >= this._keys.length) {\n return undefined;\n }\n var key = this._keys[this._index++];\n if (key in this._source) {\n return this._source[key];\n }\n return this.next();\n };\n return ValueIterator;\n}());\n/**\n * An iterator for the items in an object.\n *\n * #### Notes\n * This iterator can be used for any JS object.\n */\nvar ItemIterator = /** @class */ (function () {\n /**\n * Construct a new item iterator.\n *\n * @param source - The object of interest.\n *\n * @param keys - The keys to iterate, if known.\n */\n function ItemIterator(source, keys) {\n if (keys === void 0) { keys = Object.keys(source); }\n this._index = 0;\n this._source = source;\n this._keys = keys;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ItemIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ItemIterator.prototype.clone = function () {\n var result = new ItemIterator(this._source, this._keys);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ItemIterator.prototype.next = function () {\n if (this._index >= this._keys.length) {\n return undefined;\n }\n var key = this._keys[this._index++];\n if (key in this._source) {\n return [key, this._source[key]];\n }\n return this.next();\n };\n return ItemIterator;\n}());\n/**\n * An iterator for an iterator-like function.\n */\nvar FnIterator = /** @class */ (function () {\n /**\n * Construct a new function iterator.\n *\n * @param fn - The iterator-like function of interest.\n */\n function FnIterator(fn) {\n this._fn = fn;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n FnIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n FnIterator.prototype.clone = function () {\n throw new Error('An `FnIterator` cannot be cloned.');\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n FnIterator.prototype.next = function () {\n return this._fn.call(undefined);\n };\n return FnIterator;\n}());\n\nexports.ArrayIterator = ArrayIterator;\nexports.FnIterator = FnIterator;\nexports.ItemIterator = ItemIterator;\nexports.KeyIterator = KeyIterator;\nexports.ValueIterator = ValueIterator;\nexports.each = each;\nexports.every = every;\nexports.iter = iter;\nexports.iterFn = iterFn;\nexports.iterItems = iterItems;\nexports.iterKeys = iterKeys;\nexports.iterValues = iterValues;\nexports.some = some;\nexports.toArray = toArray;\nexports.toObject = toObject;\n//# sourceMappingURL=iter.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/iter.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/map.js": │ │ │ │ /*!*****************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/map.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/map.js ***! │ │ │ │ \*****************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * toArray(stream); // [2, 4, 6]\n * ```\n */\nfunction map(object, fn) {\n return new MapIterator(iter.iter(object), fn);\n}\n/**\n * An iterator which transforms values using a mapping function.\n */\nvar MapIterator = /** @class */ (function () {\n /**\n * Construct a new map iterator.\n *\n * @param source - The iterator of values of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n */\n function MapIterator(source, fn) {\n this._index = 0;\n this._source = source;\n this._fn = fn;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n MapIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n MapIterator.prototype.clone = function () {\n var result = new MapIterator(this._source.clone(), this._fn);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n MapIterator.prototype.next = function () {\n var value = this._source.next();\n if (value === undefined) {\n return undefined;\n }\n return this._fn.call(undefined, value, this._index++);\n };\n return MapIterator;\n}());\n\nexports.MapIterator = MapIterator;\nexports.map = map;\n//# sourceMappingURL=map.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/map.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Transform the values of an iterable with a mapping function.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n *\n * @returns An iterator which yields the transformed values.\n *\n * #### Example\n * ```typescript\n * import { map, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3];\n *\n * let stream = map(data, value => value * 2);\n *\n * toArray(stream); // [2, 4, 6]\n * ```\n */\nfunction map(object, fn) {\n return new MapIterator(iter.iter(object), fn);\n}\n/**\n * An iterator which transforms values using a mapping function.\n */\nvar MapIterator = /** @class */ (function () {\n /**\n * Construct a new map iterator.\n *\n * @param source - The iterator of values of interest.\n *\n * @param fn - The mapping function to invoke for each value.\n */\n function MapIterator(source, fn) {\n this._index = 0;\n this._source = source;\n this._fn = fn;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n MapIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n MapIterator.prototype.clone = function () {\n var result = new MapIterator(this._source.clone(), this._fn);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n MapIterator.prototype.next = function () {\n var value = this._source.next();\n if (value === undefined) {\n return undefined;\n }\n return this._fn.call(undefined, value, this._index++);\n };\n return MapIterator;\n}());\n\nexports.MapIterator = MapIterator;\nexports.map = map;\n//# sourceMappingURL=map.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/map.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/range.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/range.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/range.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n */\nfunction range(start, stop, step) {\n if (stop === undefined) {\n return new RangeIterator(0, start, 1);\n }\n if (step === undefined) {\n return new RangeIterator(start, stop, 1);\n }\n return new RangeIterator(start, stop, step);\n}\n/**\n * An iterator which produces a range of evenly spaced values.\n */\nvar RangeIterator = /** @class */ (function () {\n /**\n * Construct a new range iterator.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n */\n function RangeIterator(start, stop, step) {\n this._index = 0;\n this._start = start;\n this._stop = stop;\n this._step = step;\n this._length = Private.rangeLength(start, stop, step);\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RangeIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RangeIterator.prototype.clone = function () {\n var result = new RangeIterator(this._start, this._stop, this._step);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RangeIterator.prototype.next = function () {\n if (this._index >= this._length) {\n return undefined;\n }\n return this._start + this._step * this._index++;\n };\n return RangeIterator;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\nexports.RangeIterator = RangeIterator;\nexports.range = range;\n//# sourceMappingURL=range.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/range.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Create an iterator of evenly spaced values.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns An iterator which produces evenly spaced values.\n *\n * #### Notes\n * In the single argument form of `range(stop)`, `start` defaults to\n * `0` and `step` defaults to `1`.\n *\n * In the two argument form of `range(start, stop)`, `step` defaults\n * to `1`.\n */\nfunction range(start, stop, step) {\n if (stop === undefined) {\n return new RangeIterator(0, start, 1);\n }\n if (step === undefined) {\n return new RangeIterator(start, stop, 1);\n }\n return new RangeIterator(start, stop, step);\n}\n/**\n * An iterator which produces a range of evenly spaced values.\n */\nvar RangeIterator = /** @class */ (function () {\n /**\n * Construct a new range iterator.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n */\n function RangeIterator(start, stop, step) {\n this._index = 0;\n this._start = start;\n this._stop = stop;\n this._step = step;\n this._length = Private.rangeLength(start, stop, step);\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RangeIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RangeIterator.prototype.clone = function () {\n var result = new RangeIterator(this._start, this._stop, this._step);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RangeIterator.prototype.next = function () {\n if (this._index >= this._length) {\n return undefined;\n }\n return this._start + this._step * this._index++;\n };\n return RangeIterator;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Compute the effective length of a range.\n *\n * @param start - The starting value for the range, inclusive.\n *\n * @param stop - The stopping value for the range, exclusive.\n *\n * @param step - The distance between each value.\n *\n * @returns The number of steps need to traverse the range.\n */\n function rangeLength(start, stop, step) {\n if (step === 0) {\n return Infinity;\n }\n if (start > stop && step > 0) {\n return 0;\n }\n if (start < stop && step < 0) {\n return 0;\n }\n return Math.ceil((stop - start) / step);\n }\n Private.rangeLength = rangeLength;\n})(Private || (Private = {}));\n\nexports.RangeIterator = RangeIterator;\nexports.range = range;\n//# sourceMappingURL=range.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/range.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/reduce.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/reduce.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/reduce.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n var index = 0;\n var it = iter.iter(object);\n var first = it.next();\n // An empty iterator and no initial value is an error.\n if (first === undefined && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first === undefined) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n var second = it.next();\n if (second === undefined && initial === undefined) {\n return first;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second === undefined) {\n return fn(initial, first, index++);\n }\n // Setup the initial accumlated value.\n var accumulator;\n if (initial === undefined) {\n accumulator = fn(first, second, index++);\n }\n else {\n accumulator = fn(fn(initial, first, index++), second, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n var next;\n while ((next = it.next()) !== undefined) {\n accumulator = fn(accumulator, next, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\nexports.reduce = reduce;\n//# sourceMappingURL=reduce.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/reduce.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\nfunction reduce(object, fn, initial) {\n // Setup the iterator and fetch the first value.\n var index = 0;\n var it = iter.iter(object);\n var first = it.next();\n // An empty iterator and no initial value is an error.\n if (first === undefined && initial === undefined) {\n throw new TypeError('Reduce of empty iterable with no initial value.');\n }\n // If the iterator is empty, return the initial value.\n if (first === undefined) {\n return initial;\n }\n // If the iterator has a single item and no initial value, the\n // reducer is not invoked and the first item is the return value.\n var second = it.next();\n if (second === undefined && initial === undefined) {\n return first;\n }\n // If iterator has a single item and an initial value is provided,\n // the reducer is invoked and that result is the return value.\n if (second === undefined) {\n return fn(initial, first, index++);\n }\n // Setup the initial accumlated value.\n var accumulator;\n if (initial === undefined) {\n accumulator = fn(first, second, index++);\n }\n else {\n accumulator = fn(fn(initial, first, index++), second, index++);\n }\n // Iterate the rest of the values, updating the accumulator.\n var next;\n while ((next = it.next()) !== undefined) {\n accumulator = fn(accumulator, next, index++);\n }\n // Return the final accumulated value.\n return accumulator;\n}\n\nexports.reduce = reduce;\n//# sourceMappingURL=reduce.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/reduce.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/repeat.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/repeat.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/repeat.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat, toArray } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * toArray(stream); // [7, 7, 7]\n * ```\n */\nfunction repeat(value, count) {\n return new RepeatIterator(value, count);\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once, toArray } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * toArray(stream); // [7]\n * ```\n */\nfunction once(value) {\n return new RepeatIterator(value, 1);\n}\n/**\n * An iterator which repeats a value a specified number of times.\n */\nvar RepeatIterator = /** @class */ (function () {\n /**\n * Construct a new repeat iterator.\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n */\n function RepeatIterator(value, count) {\n this._value = value;\n this._count = count;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RepeatIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RepeatIterator.prototype.clone = function () {\n return new RepeatIterator(this._value, this._count);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RepeatIterator.prototype.next = function () {\n if (this._count <= 0) {\n return undefined;\n }\n this._count--;\n return this._value;\n };\n return RepeatIterator;\n}());\n\nexports.RepeatIterator = RepeatIterator;\nexports.once = once;\nexports.repeat = repeat;\n//# sourceMappingURL=repeat.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/repeat.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Create an iterator which repeats a value a number of times.\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n *\n * @returns A new iterator which repeats the specified value.\n *\n * #### Example\n * ```typescript\n * import { repeat, toArray } from '@lumino/algorithm';\n *\n * let stream = repeat(7, 3);\n *\n * toArray(stream); // [7, 7, 7]\n * ```\n */\nfunction repeat(value, count) {\n return new RepeatIterator(value, count);\n}\n/**\n * Create an iterator which yields a value a single time.\n *\n * @param value - The value to wrap in an iterator.\n *\n * @returns A new iterator which yields the value a single time.\n *\n * #### Example\n * ```typescript\n * import { once, toArray } from '@lumino/algorithm';\n *\n * let stream = once(7);\n *\n * toArray(stream); // [7]\n * ```\n */\nfunction once(value) {\n return new RepeatIterator(value, 1);\n}\n/**\n * An iterator which repeats a value a specified number of times.\n */\nvar RepeatIterator = /** @class */ (function () {\n /**\n * Construct a new repeat iterator.\n *\n * @param value - The value to repeat.\n *\n * @param count - The number of times to repeat the value.\n */\n function RepeatIterator(value, count) {\n this._value = value;\n this._count = count;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RepeatIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RepeatIterator.prototype.clone = function () {\n return new RepeatIterator(this._value, this._count);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RepeatIterator.prototype.next = function () {\n if (this._count <= 0) {\n return undefined;\n }\n this._count--;\n return this._value;\n };\n return RepeatIterator;\n}());\n\nexports.RepeatIterator = RepeatIterator;\nexports.once = once;\nexports.repeat = repeat;\n//# sourceMappingURL=repeat.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/repeat.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/retro.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/retro.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/retro.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * toArray(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction retro(object) {\n var it;\n if (typeof object.retro === 'function') {\n it = object.retro();\n }\n else {\n it = new RetroArrayIterator(object);\n }\n return it;\n}\n/**\n * An iterator which traverses an array-like object in reverse.\n *\n * #### Notes\n * This iterator can be used for any builtin JS array-like object.\n */\nvar RetroArrayIterator = /** @class */ (function () {\n /**\n * Construct a new retro iterator.\n *\n * @param source - The array-like object of interest.\n */\n function RetroArrayIterator(source) {\n this._source = source;\n this._index = source.length - 1;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RetroArrayIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RetroArrayIterator.prototype.clone = function () {\n var result = new RetroArrayIterator(this._source);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RetroArrayIterator.prototype.next = function () {\n if (this._index < 0 || this._index >= this._source.length) {\n return undefined;\n }\n return this._source[this._index--];\n };\n return RetroArrayIterator;\n}());\n\nexports.RetroArrayIterator = RetroArrayIterator;\nexports.retro = retro;\n//# sourceMappingURL=retro.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/retro.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Create an iterator for a retroable object.\n *\n * @param object - The retroable or array-like object of interest.\n *\n * @returns An iterator which traverses the object's values in reverse.\n *\n * #### Example\n * ```typescript\n * import { retro, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = retro(data);\n *\n * toArray(stream); // [6, 5, 4, 3, 2, 1]\n * ```\n */\nfunction retro(object) {\n var it;\n if (typeof object.retro === 'function') {\n it = object.retro();\n }\n else {\n it = new RetroArrayIterator(object);\n }\n return it;\n}\n/**\n * An iterator which traverses an array-like object in reverse.\n *\n * #### Notes\n * This iterator can be used for any builtin JS array-like object.\n */\nvar RetroArrayIterator = /** @class */ (function () {\n /**\n * Construct a new retro iterator.\n *\n * @param source - The array-like object of interest.\n */\n function RetroArrayIterator(source) {\n this._source = source;\n this._index = source.length - 1;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RetroArrayIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RetroArrayIterator.prototype.clone = function () {\n var result = new RetroArrayIterator(this._source);\n result._index = this._index;\n return result;\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RetroArrayIterator.prototype.next = function () {\n if (this._index < 0 || this._index >= this._source.length) {\n return undefined;\n }\n return this._source[this._index--];\n };\n return RetroArrayIterator;\n}());\n\nexports.RetroArrayIterator = RetroArrayIterator;\nexports.retro = retro;\n//# sourceMappingURL=retro.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/retro.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/sort.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/sort.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/sort.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable or array-like object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n var sorted = [];\n var visited = new Set();\n var graph = new Map();\n // Add the edges to the graph.\n iter.each(edges, addEdge);\n // Visit each node in the graph.\n graph.forEach(function (v, k) { visit(k); });\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n var fromNode = edge[0], toNode = edge[1];\n var children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n var children = graph.get(node);\n if (children) {\n children.forEach(visit);\n }\n sorted.push(node);\n }\n}\n\nexports.topologicSort = topologicSort;\n//# sourceMappingURL=sort.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/sort.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Topologically sort an iterable of edges.\n *\n * @param edges - The iterable or array-like object of edges to sort.\n * An edge is represented as a 2-tuple of `[fromNode, toNode]`.\n *\n * @returns The topologically sorted array of nodes.\n *\n * #### Notes\n * If a cycle is present in the graph, the cycle will be ignored and\n * the return value will be only approximately sorted.\n *\n * #### Example\n * ```typescript\n * import { topologicSort } from '@lumino/algorithm';\n *\n * let data = [\n * ['d', 'e'],\n * ['c', 'd'],\n * ['a', 'b'],\n * ['b', 'c']\n * ];\n *\n * topologicSort(data); // ['a', 'b', 'c', 'd', 'e']\n * ```\n */\nfunction topologicSort(edges) {\n // Setup the shared sorting state.\n var sorted = [];\n var visited = new Set();\n var graph = new Map();\n // Add the edges to the graph.\n iter.each(edges, addEdge);\n // Visit each node in the graph.\n graph.forEach(function (v, k) { visit(k); });\n // Return the sorted results.\n return sorted;\n // Add an edge to the graph.\n function addEdge(edge) {\n var fromNode = edge[0], toNode = edge[1];\n var children = graph.get(toNode);\n if (children) {\n children.push(fromNode);\n }\n else {\n graph.set(toNode, [fromNode]);\n }\n }\n // Recursively visit the node.\n function visit(node) {\n if (visited.has(node)) {\n return;\n }\n visited.add(node);\n var children = graph.get(node);\n if (children) {\n children.forEach(visit);\n }\n sorted.push(node);\n }\n}\n\nexports.topologicSort = topologicSort;\n//# sourceMappingURL=sort.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/sort.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/stride.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/stride.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/stride.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * toArray(stream); // [1, 3, 5];\n * ```\n */\nfunction stride(object, step) {\n return new StrideIterator(iter.iter(object), step);\n}\n/**\n * An iterator which traverses a source iterator step-wise.\n */\nvar StrideIterator = /** @class */ (function () {\n /**\n * Construct a new stride iterator.\n *\n * @param source - The iterator of values of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n */\n function StrideIterator(source, step) {\n this._source = source;\n this._step = step;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n StrideIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n StrideIterator.prototype.clone = function () {\n return new StrideIterator(this._source.clone(), this._step);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n StrideIterator.prototype.next = function () {\n var value = this._source.next();\n for (var n = this._step - 1; n > 0; --n) {\n this._source.next();\n }\n return value;\n };\n return StrideIterator;\n}());\n\nexports.StrideIterator = StrideIterator;\nexports.stride = stride;\n//# sourceMappingURL=stride.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/stride.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Iterate over an iterable using a stepped increment.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n *\n * @returns An iterator which traverses the iterable step-wise.\n *\n * #### Example\n * ```typescript\n * import { stride, toArray } from '@lumino/algorithm';\n *\n * let data = [1, 2, 3, 4, 5, 6];\n *\n * let stream = stride(data, 2);\n *\n * toArray(stream); // [1, 3, 5];\n * ```\n */\nfunction stride(object, step) {\n return new StrideIterator(iter.iter(object), step);\n}\n/**\n * An iterator which traverses a source iterator step-wise.\n */\nvar StrideIterator = /** @class */ (function () {\n /**\n * Construct a new stride iterator.\n *\n * @param source - The iterator of values of interest.\n *\n * @param step - The distance to step on each iteration. A value\n * of less than `1` will behave the same as a value of `1`.\n */\n function StrideIterator(source, step) {\n this._source = source;\n this._step = step;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n StrideIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n StrideIterator.prototype.clone = function () {\n return new StrideIterator(this._source.clone(), this._step);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n StrideIterator.prototype.next = function () {\n var value = this._source.next();\n for (var n = this._step - 1; n > 0; --n) {\n this._source.next();\n }\n return value;\n };\n return StrideIterator;\n}());\n\nexports.StrideIterator = StrideIterator;\nexports.stride = stride;\n//# sourceMappingURL=stride.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/stride.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/string.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/string.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/string.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start) {\n if (start === void 0) { start = 0; }\n var indices = new Array(query.length);\n for (var i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start) {\n if (start === void 0) { start = 0; }\n var indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n var score = 0;\n for (var i = 0, n = indices.length; i < n; ++i) {\n var j = indices[i] - start;\n score += j * j;\n }\n return { score: score, indices: indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start) {\n if (start === void 0) { start = 0; }\n var indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n var score = 0;\n var last = start - 1;\n for (var i = 0, n = indices.length; i < n; ++i) {\n var j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score: score, indices: indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n var result = [];\n // Set up the counter variables.\n var k = 0;\n var last = 0;\n var n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n var i = indices[k];\n var j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(exports.StringExt || (exports.StringExt = {}));\n//# sourceMappingURL=string.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/string.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (StringExt) {\n /**\n * Find the indices of characters in a source text.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The matched indices, or `null` if there is no match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * In order for there to be a match, all of the characters in `query`\n * **must** appear in `source` in the order given by `query`.\n *\n * Characters are matched using strict `===` equality.\n */\n function findIndices(source, query, start) {\n if (start === void 0) { start = 0; }\n var indices = new Array(query.length);\n for (var i = 0, j = start, n = query.length; i < n; ++i, ++j) {\n j = source.indexOf(query[i], j);\n if (j === -1) {\n return null;\n }\n indices[i] = j;\n }\n return indices;\n }\n StringExt.findIndices = findIndices;\n /**\n * A string matcher which uses a sum-of-squares algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-squares approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The index of each\n * matching character is squared and added to the score. This means\n * that early and consecutive character matches are preferred, while\n * late matches are heavily penalized.\n */\n function matchSumOfSquares(source, query, start) {\n if (start === void 0) { start = 0; }\n var indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n var score = 0;\n for (var i = 0, n = indices.length; i < n; ++i) {\n var j = indices[i] - start;\n score += j * j;\n }\n return { score: score, indices: indices };\n }\n StringExt.matchSumOfSquares = matchSumOfSquares;\n /**\n * A string matcher which uses a sum-of-deltas algorithm.\n *\n * @param source - The source text which should be searched.\n *\n * @param query - The characters to locate in the source text.\n *\n * @param start - The index to start the search.\n *\n * @returns The match result, or `null` if there is no match.\n * A lower `score` represents a stronger match.\n *\n * #### Complexity\n * Linear on `sourceText`.\n *\n * #### Notes\n * This scoring algorithm uses a sum-of-deltas approach to determine\n * the score. In order for there to be a match, all of the characters\n * in `query` **must** appear in `source` in order. The delta between\n * the indices are summed to create the score. This means that groups\n * of matched characters are preferred, while fragmented matches are\n * penalized.\n */\n function matchSumOfDeltas(source, query, start) {\n if (start === void 0) { start = 0; }\n var indices = findIndices(source, query, start);\n if (!indices) {\n return null;\n }\n var score = 0;\n var last = start - 1;\n for (var i = 0, n = indices.length; i < n; ++i) {\n var j = indices[i];\n score += j - last - 1;\n last = j;\n }\n return { score: score, indices: indices };\n }\n StringExt.matchSumOfDeltas = matchSumOfDeltas;\n /**\n * Highlight the matched characters of a source text.\n *\n * @param source - The text which should be highlighted.\n *\n * @param indices - The indices of the matched characters. They must\n * appear in increasing order and must be in bounds of the source.\n *\n * @param fn - The function to apply to the matched chunks.\n *\n * @returns An array of unmatched and highlighted chunks.\n */\n function highlight(source, indices, fn) {\n // Set up the result array.\n var result = [];\n // Set up the counter variables.\n var k = 0;\n var last = 0;\n var n = indices.length;\n // Iterator over each index.\n while (k < n) {\n // Set up the chunk indices.\n var i = indices[k];\n var j = indices[k];\n // Advance the right chunk index until it's non-contiguous.\n while (++k < n && indices[k] === j + 1) {\n j++;\n }\n // Extract the unmatched text.\n if (last < i) {\n result.push(source.slice(last, i));\n }\n // Extract and highlight the matched text.\n if (i < j + 1) {\n result.push(fn(source.slice(i, j + 1)));\n }\n // Update the last visited index.\n last = j + 1;\n }\n // Extract any remaining unmatched text.\n if (last < source.length) {\n result.push(source.slice(last));\n }\n // Return the highlighted result.\n return result;\n }\n StringExt.highlight = highlight;\n /**\n * A 3-way string comparison function.\n *\n * @param a - The first string of interest.\n *\n * @param b - The second string of interest.\n *\n * @returns `-1` if `a < b`, else `1` if `a > b`, else `0`.\n */\n function cmp(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }\n StringExt.cmp = cmp;\n})(exports.StringExt || (exports.StringExt = {}));\n//# sourceMappingURL=string.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/string.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/take.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/take.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/take.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n */\nfunction take(object, count) {\n return new TakeIterator(iter.iter(object), count);\n}\n/**\n * An iterator which takes a fixed number of items from a source.\n */\nvar TakeIterator = /** @class */ (function () {\n /**\n * Construct a new take iterator.\n *\n * @param source - The iterator of interest.\n *\n * @param count - The number of items to take from the source.\n */\n function TakeIterator(source, count) {\n this._source = source;\n this._count = count;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n TakeIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n TakeIterator.prototype.clone = function () {\n return new TakeIterator(this._source.clone(), this._count);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n TakeIterator.prototype.next = function () {\n if (this._count <= 0) {\n return undefined;\n }\n var value = this._source.next();\n if (value === undefined) {\n return undefined;\n }\n this._count--;\n return value;\n };\n return TakeIterator;\n}());\n\nexports.TakeIterator = TakeIterator;\nexports.take = take;\n//# sourceMappingURL=take.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/take.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Take a fixed number of items from an iterable.\n *\n * @param object - The iterable or array-like object of interest.\n *\n * @param count - The number of items to take from the iterable.\n *\n * @returns An iterator which yields the specified number of items\n * from the source iterable.\n *\n * #### Notes\n * The returned iterator will exhaust early if the source iterable\n * contains an insufficient number of items.\n */\nfunction take(object, count) {\n return new TakeIterator(iter.iter(object), count);\n}\n/**\n * An iterator which takes a fixed number of items from a source.\n */\nvar TakeIterator = /** @class */ (function () {\n /**\n * Construct a new take iterator.\n *\n * @param source - The iterator of interest.\n *\n * @param count - The number of items to take from the source.\n */\n function TakeIterator(source, count) {\n this._source = source;\n this._count = count;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n TakeIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n TakeIterator.prototype.clone = function () {\n return new TakeIterator(this._source.clone(), this._count);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n TakeIterator.prototype.next = function () {\n if (this._count <= 0) {\n return undefined;\n }\n var value = this._source.next();\n if (value === undefined) {\n return undefined;\n }\n this._count--;\n return value;\n };\n return TakeIterator;\n}());\n\nexports.TakeIterator = TakeIterator;\nexports.take = take;\n//# sourceMappingURL=take.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/take.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/algorithm/dist/zip.js": │ │ │ │ /*!*****************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/zip.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/zip.js ***! │ │ │ │ \*****************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable or array-like objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip, toArray } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * toArray(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction zip() {\n var objects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n objects[_i] = arguments[_i];\n }\n return new ZipIterator(objects.map(iter.iter));\n}\n/**\n * An iterator which iterates several sources in lockstep.\n */\nvar ZipIterator = /** @class */ (function () {\n /**\n * Construct a new zip iterator.\n *\n * @param source - The iterators of interest.\n */\n function ZipIterator(source) {\n this._source = source;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ZipIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ZipIterator.prototype.clone = function () {\n return new ZipIterator(this._source.map(function (it) { return it.clone(); }));\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ZipIterator.prototype.next = function () {\n var result = new Array(this._source.length);\n for (var i = 0, n = this._source.length; i < n; ++i) {\n var value = this._source[i].next();\n if (value === undefined) {\n return undefined;\n }\n result[i] = value;\n }\n return result;\n };\n return ZipIterator;\n}());\n\nexports.ZipIterator = ZipIterator;\nexports.zip = zip;\n//# sourceMappingURL=zip.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/algorithm/dist/zip.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar iter = __webpack_require__(/*! ./iter.js */ \"../../packages/algorithm/dist/iter.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * Iterate several iterables in lockstep.\n *\n * @param objects - The iterable or array-like objects of interest.\n *\n * @returns An iterator which yields successive tuples of values where\n * each value is taken in turn from the provided iterables. It will\n * be as long as the shortest provided iterable.\n *\n * #### Example\n * ```typescript\n * import { zip, toArray } from '@lumino/algorithm';\n *\n * let data1 = [1, 2, 3];\n * let data2 = [4, 5, 6];\n *\n * let stream = zip(data1, data2);\n *\n * toArray(stream); // [[1, 4], [2, 5], [3, 6]]\n * ```\n */\nfunction zip() {\n var objects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n objects[_i] = arguments[_i];\n }\n return new ZipIterator(objects.map(iter.iter));\n}\n/**\n * An iterator which iterates several sources in lockstep.\n */\nvar ZipIterator = /** @class */ (function () {\n /**\n * Construct a new zip iterator.\n *\n * @param source - The iterators of interest.\n */\n function ZipIterator(source) {\n this._source = source;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ZipIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ZipIterator.prototype.clone = function () {\n return new ZipIterator(this._source.map(function (it) { return it.clone(); }));\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ZipIterator.prototype.next = function () {\n var result = new Array(this._source.length);\n for (var i = 0, n = this._source.length; i < n; ++i) {\n var value = this._source[i].next();\n if (value === undefined) {\n return undefined;\n }\n result[i] = value;\n }\n return result;\n };\n return ZipIterator;\n}());\n\nexports.ZipIterator = ZipIterator;\nexports.zip = zip;\n//# sourceMappingURL=zip.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/algorithm/dist/zip.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/collections/dist/bplustree.js": │ │ │ │ /*!*************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/collections/dist/bplustree.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/collections/dist/bplustree.js ***! │ │ │ │ \*************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A generic B+ tree.\n *\n * #### Notes\n * Most operations have `O(log32 n)` or better complexity.\n */\nexports.BPlusTree = /** @class */ (function () {\n /**\n * Construct a new B+ tree.\n *\n * @param cmp - The item comparison function for the tree.\n */\n function BPlusTree(cmp) {\n this._root = new Private.LeafNode();\n this.cmp = cmp;\n }\n Object.defineProperty(BPlusTree.prototype, \"isEmpty\", {\n /**\n * Whether the tree is empty.\n *\n * #### Complexity\n * `O(1)`\n */\n get: function () {\n return this._root.size === 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BPlusTree.prototype, \"size\", {\n /**\n * The size of the tree.\n *\n * #### Complexity\n * `O(1)`\n */\n get: function () {\n return this._root.size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BPlusTree.prototype, \"first\", {\n /**\n * The first item in the tree.\n *\n * This is `undefined` if the tree is empty.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n get: function () {\n var node = Private.firstLeaf(this._root);\n return node.size > 0 ? node.items[0] : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BPlusTree.prototype, \"last\", {\n /**\n * The last item in the tree.\n *\n * This is `undefined` if the tree is empty.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n get: function () {\n var node = Private.lastLeaf(this._root);\n return node.size > 0 ? node.items[node.size - 1] : undefined;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the items in the tree.\n *\n * @returns A new iterator starting with the first item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.iter = function () {\n return Private.iterItems(this._root);\n };\n /**\n * Create a reverse iterator over the items in the tree.\n *\n * @returns A new iterator starting with the last item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.retro = function () {\n return Private.retroItems(this._root);\n };\n /**\n * Create an iterator for a slice of items in the tree.\n *\n * @param start - The index of the first item, inclusive. This\n * should be `< stop`. Negative values are taken as an offset\n * from the end of the tree. The default is `0`.\n *\n * @param stop - The index of the last item, exclusive. This\n * should be `> start`. Negative values are taken as an offset\n * from the end of the tree. The default is `size`.\n *\n * @returns A new iterator starting with the specified item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.slice = function (start, stop) {\n return Private.sliceItems(this._root, start, stop);\n };\n /**\n * Create a reverse iterator for a slice of items in the tree.\n *\n * @param start - The index of the first item, inclusive. This\n * should be `> stop`. Negative values are taken as an offset\n * from the end of the tree. The default is `size - 1`.\n *\n * @param stop - The index of the last item, exclusive. This\n * should be `< start`. Negative values are taken as an offset\n * from the end of the tree. The default is `-size - 1`.\n *\n * @returns A new reverse iterator starting with the specified item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.retroSlice = function (start, stop) {\n return Private.retroSliceItems(this._root, start, stop);\n };\n /**\n * Get the item at a particular index.\n *\n * @param index - The index of the item of interest. Negative\n * values are taken as an offset from the end of the tree.\n *\n * @returns The item at the specified index, or `undefined` if\n * the index is out of range.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.at = function (index) {\n return Private.itemAt(this._root, index);\n };\n /**\n * Test whether the tree has an item which matches a key.\n *\n * @param key - The key of interest.\n *\n * @param cmp - A function which compares an item against the key.\n *\n * @returns `true` if the tree has an item which matches the given\n * key, `false` otherwise.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.has = function (key, cmp) {\n return Private.hasItem(this._root, key, cmp);\n };\n /**\n * Get the index of an item which matches a key.\n *\n * @param key - The key of interest.\n *\n * @param cmp - A function which compares an item against the key.\n *\n * @returns The index of the item which matches the given key. A\n * negative value means that a matching item does not exist in\n * the tree, but if one did it would reside at `-index - 1`.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.indexOf = function (key, cmp) {\n return Private.indexOf(this._root, key, cmp);\n };\n /**\n * Get the item which matches a key.\n *\n * @param item - The key of interest.\n *\n * @param cmp - A function which compares an item against the key.\n *\n * @returns The item which matches the given key, or `undefined` if\n * the tree does not have a matching item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.get = function (key, cmp) {\n return Private.getItem(this._root, key, cmp);\n };\n /**\n * Assign new items to the tree, replacing all current items.\n *\n * @param items - The items to assign to the tree.\n *\n * #### Complexity\n * `O(n log32 n)`\n */\n BPlusTree.prototype.assign = function (items) {\n this.clear();\n this.update(items);\n };\n /**\n * Insert an item into the tree.\n *\n * @param item - The item of interest.\n *\n * @returns If the given item matches an existing item in the tree,\n * the given item will replace it, and the existing item will be\n * returned. Otherwise, this method returns `undefined`.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.insert = function (item) {\n var existing = Private.insertItem(this._root, item, this.cmp);\n this._root = Private.maybeSplitRoot(this._root);\n return existing;\n };\n /**\n * Update the tree with multiple items.\n *\n * @param items - The items to insert into the tree.\n *\n * #### Complexity\n * `O(k log32 n)`\n */\n BPlusTree.prototype.update = function (items) {\n var _this = this;\n algorithm.each(items, function (item) { _this.insert(item); });\n };\n /**\n * Delete an item which matches a particular key.\n *\n * @param key - The key of interest.\n *\n * @param cmp - A function which compares an item against the key.\n *\n * @returns The item removed from the tree, or `undefined` if no\n * item matched the given key.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.delete = function (key, cmp) {\n var item = Private.deleteItem(this._root, key, cmp);\n this._root = Private.maybeExtractRoot(this._root);\n return item;\n };\n /**\n * Remove an item at a particular index.\n *\n * @param index - The index of the item to remove. Negative\n * values are taken as an offset from the end of the tree.\n *\n * @returns The item removed from the tree, or `undefined` if\n * the given index is out of range.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.remove = function (index) {\n var item = Private.removeItem(this._root, index);\n this._root = Private.maybeExtractRoot(this._root);\n return item;\n };\n /**\n * Clear the contents of the tree.\n *\n * #### Complexity\n * `O(n)`\n */\n BPlusTree.prototype.clear = function () {\n Private.clear(this._root);\n this._root = new Private.LeafNode();\n };\n return BPlusTree;\n}());\n/**\n * The namespace for the `BPlusTree` class statics.\n */\n(function (BPlusTree) {\n /**\n * Create a new B+ tree populated with the given items.\n *\n * @param items - The items to add to the tree.\n *\n * @param cmp - The item comparison function for the tree.\n *\n * @returns A new B+ tree populated with the given items.\n *\n * #### Complexity\n * `O(n log32 n)`\n */\n function from(items, cmp) {\n var tree = new BPlusTree(cmp);\n tree.assign(items);\n return tree;\n }\n BPlusTree.from = from;\n})(exports.BPlusTree || (exports.BPlusTree = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A branch node in a B+ tree.\n */\n var BranchNode = /** @class */ (function () {\n function BranchNode() {\n /**\n * The left-most item of each child subtree.\n */\n this.items = [];\n /**\n * The cumulative sizes of each child subtree.\n */\n this.sizes = [];\n /**\n * The child nodes of this branch node.\n */\n this.children = [];\n }\n Object.defineProperty(BranchNode.prototype, \"type\", {\n /**\n * The discriminated type of the node.\n */\n get: function () {\n return 0 /* Branch */;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BranchNode.prototype, \"size\", {\n /**\n * The total number of items in the subtree.\n */\n get: function () {\n return this.sizes[this.sizes.length - 1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BranchNode.prototype, \"width\", {\n /**\n * The tree width of the node.\n */\n get: function () {\n return this.children.length;\n },\n enumerable: false,\n configurable: true\n });\n return BranchNode;\n }());\n Private.BranchNode = BranchNode;\n /**\n * A leaf node in a B+ tree.\n */\n var LeafNode = /** @class */ (function () {\n function LeafNode() {\n /**\n * The next sibling leaf node of this leaf node.\n */\n this.next = null;\n /**\n * The previous sibling leaf node of this leaf node.\n */\n this.prev = null;\n /**\n * The items of the leaf.\n */\n this.items = [];\n }\n Object.defineProperty(LeafNode.prototype, \"type\", {\n /**\n * The discriminated type of the node.\n */\n get: function () {\n return 1 /* Leaf */;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LeafNode.prototype, \"size\", {\n /**\n * The total number of items in the leaf.\n */\n get: function () {\n return this.items.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LeafNode.prototype, \"width\", {\n /**\n * The tree width of the node.\n */\n get: function () {\n return this.items.length;\n },\n enumerable: false,\n configurable: true\n });\n return LeafNode;\n }());\n Private.LeafNode = LeafNode;\n /**\n * Get the first leaf node in the tree.\n *\n * @param node - The root node of interest.\n *\n * @returns The first leaf node in the tree.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function firstLeaf(node) {\n while (node.type === 0 /* Branch */) {\n node = node.children[0];\n }\n return node;\n }\n Private.firstLeaf = firstLeaf;\n /**\n * Get the last leaf node in the tree.\n *\n * @param node - The root node of interest.\n *\n * @returns The last leaf node in the tree.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function lastLeaf(node) {\n while (node.type === 0 /* Branch */) {\n node = node.children[node.children.length - 1];\n }\n return node;\n }\n Private.lastLeaf = lastLeaf;\n /**\n * Create a forward iterator for the items in the tree.\n *\n * @param node - The root node of interest.\n *\n * @returns A new forward iterator starting with the first item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function iterItems(node) {\n var leaf = firstLeaf(node);\n return new ForwardIterator(leaf, 0, -1);\n }\n Private.iterItems = iterItems;\n /**\n * Create a reverse iterator for the items in the tree.\n *\n * @param node - The root node of interest.\n *\n * @returns A new reverse iterator starting with the last item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function retroItems(node) {\n var leaf = lastLeaf(node);\n return new RetroIterator(leaf, leaf.size - 1, -1);\n }\n Private.retroItems = retroItems;\n /**\n * Create an iterator for a slice of items in the tree.\n *\n * @param node - The root node of interest.\n *\n * @param start - The index of the first item, inclusive. This\n * should be `< stop`. Negative values are taken as an offset\n * from the end of the tree. The default is `0`.\n *\n * @param stop - The index of the last item, exclusive. This\n * should be `> start`. Negative values are taken as an offset\n * from the end of the tree. The default is `size`.\n *\n * @returns A new iterator starting with the specified item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function sliceItems(node, start, stop) {\n // Normalize the start index.\n if (start === undefined) {\n start = 0;\n }\n else if (start < 0) {\n start = Math.max(0, start + node.size);\n }\n else {\n start = Math.min(start, node.size);\n }\n // Normalize the stop index.\n if (stop === undefined) {\n stop = node.size;\n }\n else if (stop < 0) {\n stop = Math.max(0, stop + node.size);\n }\n else {\n stop = Math.min(stop, node.size);\n }\n // Compute effective count.\n var count = Math.max(0, stop - start);\n // Bail early if there is nothing to iterate.\n if (count === 0) {\n return algorithm.empty();\n }\n // Find the starting leaf node and local index.\n while (node.type === 0 /* Branch */) {\n var i = findPivotIndexByIndex(node.sizes, start);\n if (i > 0)\n start -= node.sizes[i - 1];\n node = node.children[i];\n }\n // Return the forward iterator for the range.\n return new ForwardIterator(node, start, count);\n }\n Private.sliceItems = sliceItems;\n /**\n * Create a reverse iterator for a slice of items in the tree.\n *\n * @param node - The root node of interest.\n *\n * @param start - The index of the first item, inclusive. This\n * should be `> stop`. Negative values are taken as an offset\n * from the end of the tree. The default is `size - 1`.\n *\n * @param stop - The index of the last item, exclusive. This\n * should be `< start`. Negative values are taken as an offset\n * from the end of the tree. The default is `-size - 1`.\n *\n * @returns A new reverse iterator starting with the specified item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function retroSliceItems(node, start, stop) {\n // Normalize the start index.\n if (start === undefined) {\n start = node.size - 1;\n }\n else if (start < 0) {\n start = Math.max(-1, start + node.size);\n }\n else {\n start = Math.min(start, node.size - 1);\n }\n // Normalize the stop index.\n if (stop === undefined) {\n stop = -1;\n }\n else if (stop < 0) {\n stop = Math.max(-1, stop + node.size);\n }\n else {\n stop = Math.min(stop, node.size - 1);\n }\n // Compute the effective count.\n var count = Math.max(0, start - stop);\n // Bail early if there is nothing to iterate.\n if (count === 0) {\n return algorithm.empty();\n }\n // Find the starting leaf node and local index.\n while (node.type === 0 /* Branch */) {\n var i = findPivotIndexByIndex(node.sizes, start);\n if (i > 0)\n start -= node.sizes[i - 1];\n node = node.children[i];\n }\n // Return the retro iterator for the range.\n return new RetroIterator(node, start, count);\n }\n Private.retroSliceItems = retroSliceItems;\n /**\n * Get the item at the specified index.\n *\n * @param node - The root node of interest.\n *\n * @param index - The index of the item of interest. Negative\n * values are taken as an offset from the end of the tree.\n *\n * @returns The item at the specified index, or `undefined` if\n * the index is out of range.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function itemAt(node, index) {\n // Wrap negative indices.\n if (index < 0) {\n index += node.size;\n }\n // Bail early if the index is out of range.\n if (index < 0 || index >= node.size) {\n return undefined;\n }\n // Find the containing leaf node and local index.\n while (node.type === 0 /* Branch */) {\n var i = findPivotIndexByIndex(node.sizes, index);\n if (i > 0)\n index -= node.sizes[i - 1];\n node = node.children[i];\n }\n // Return the item at the specified index.\n return node.items[index];\n }\n Private.itemAt = itemAt;\n /**\n * Test whether the tree contains an item which matches a key.\n *\n * @param node - The root node of interest.\n *\n * @param key - The key of interest.\n *\n * @param cmp - The key comparison function.\n *\n * @returns Whether the tree contains a matching item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function hasItem(node, key, cmp) {\n // Find the containing leaf node.\n while (node.type === 0 /* Branch */) {\n var i_1 = findPivotIndexByKey(node.items, key, cmp);\n node = node.children[i_1];\n }\n // Find the key index.\n var i = findKeyIndex(node.items, key, cmp);\n // Return whether or not the node contains a matching item.\n return i >= 0;\n }\n Private.hasItem = hasItem;\n /**\n * Get the index of the item which matches a key.\n *\n * @param node - The node of interest.\n *\n * @param key - The key of interest.\n *\n * @param cmp - The key comparison function.\n *\n * @returns The index of the item which matches the given key. A\n * negative value means that a matching item does not exist in\n * the tree, but if one did it would reside at `-index - 1`.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function indexOf(node, key, cmp) {\n // Set up the global index.\n var index = 0;\n // Find the containing leaf node and global index.\n while (node.type === 0 /* Branch */) {\n var i_2 = findPivotIndexByKey(node.items, key, cmp);\n if (i_2 > 0)\n index += node.sizes[i_2 - 1];\n node = node.children[i_2];\n }\n // Find the key index.\n var i = findKeyIndex(node.items, key, cmp);\n // Return the final computed index.\n return i >= 0 ? index + i : -index + i;\n }\n Private.indexOf = indexOf;\n /**\n * Get the item for a particular key.\n *\n * @param node - The node of interest.\n *\n * @param key - The key of interest.\n *\n * @param cmp - The key comparison function.\n *\n * @returns The item for the specified key, or `undefined` if\n * the tree does not have a matching item for the key.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function getItem(node, key, cmp) {\n // Find the containing leaf node.\n while (node.type === 0 /* Branch */) {\n var i_3 = findPivotIndexByKey(node.items, key, cmp);\n node = node.children[i_3];\n }\n // Find the key index.\n var i = findKeyIndex(node.items, key, cmp);\n // Return the item for the given key.\n return i >= 0 ? node.items[i] : undefined;\n }\n Private.getItem = getItem;\n /**\n * Insert an item into the tree.\n *\n * @param node - The root node of interest.\n *\n * @param item - The item of interest.\n *\n * @param cmp - The item comparison function.\n *\n * @returns If the given item matches an existing item in the tree,\n * the given item will replace it, and the existing item will be\n * returned. Otherwise, this function returns `undefined`.\n *\n * #### Complexity\n * `O(log32 n)`\n *\n * #### Notes\n * The root may be overfull after calling this function.\n */\n function insertItem(node, item, cmp) {\n // Handle leaf nodes first.\n if (node.type === 1 /* Leaf */) {\n // Find the index for the given item.\n var i_4 = findKeyIndex(node.items, item, cmp);\n // Fetch the existing item and insert the new item.\n var existing_1;\n if (i_4 >= 0) {\n existing_1 = node.items[i_4];\n node.items[i_4] = item;\n }\n else {\n existing_1 = undefined;\n algorithm.ArrayExt.insert(node.items, -i_4 - 1, item);\n }\n // Return the existing item.\n return existing_1;\n }\n // Find the pivot index for the insert.\n var i = findPivotIndexByKey(node.items, item, cmp);\n // Fetch the pivot child.\n var child = node.children[i];\n // Fetch the current size of the child.\n var prevSize = child.size;\n // Recursively insert the item into the child.\n var existing = insertItem(child, item, cmp);\n // Fetch the updated size of the child.\n var currSize = child.size;\n // Update the item state of the branch.\n node.items[i] = child.items[0];\n // Bail early if the child size did not change.\n if (prevSize === currSize) {\n return existing;\n }\n // Split the child if it's overfull.\n if (child.width > MAX_NODE_WIDTH) {\n var next = splitNode(child);\n algorithm.ArrayExt.insert(node.children, i + 1, next);\n algorithm.ArrayExt.insert(node.items, i + 1, next.items[0]);\n }\n // Update the dirty sizes of the branch.\n updateSizes(node, i);\n // Return the existing item.\n return existing;\n }\n Private.insertItem = insertItem;\n /**\n * Delete an item in the tree.\n *\n * @param node - The node of interest.\n *\n * @param key - The key of interest.\n *\n * @param cmp - The key comparison function.\n *\n * @returns The deleted item or `undefined`.\n *\n * #### Complexity\n * `O(log32 n)`\n *\n * #### Notes\n * The root may be underfull after calling this function.\n */\n function deleteItem(node, key, cmp) {\n // Handle leaf nodes first.\n if (node.type === 1 /* Leaf */) {\n // Find the index for the given key.\n var i_5 = findKeyIndex(node.items, key, cmp);\n // Bail early if the item does not exist.\n if (i_5 < 0) {\n return undefined;\n }\n // Remove the item at the computed index.\n return algorithm.ArrayExt.removeAt(node.items, i_5);\n }\n // Find the pivot index for the delete.\n var i = findPivotIndexByKey(node.items, key, cmp);\n // Fetch the pivot child.\n var child = node.children[i];\n // Fetch the current size of the child.\n var prevSize = child.size;\n // Recursively remove the item from the child.\n var item = deleteItem(child, key, cmp);\n // Fetch the updated size of the child.\n var currSize = child.size;\n // Bail early if the child size did not change.\n if (prevSize === currSize) {\n return item;\n }\n // Update the item state of the branch.\n node.items[i] = child.items[0];\n // Join the child if it's underfull.\n if (child.width < MIN_NODE_WIDTH) {\n i = joinChild(node, i);\n }\n // Update the dirty sizes of the branch.\n updateSizes(node, i);\n // Return the deleted item.\n return item;\n }\n Private.deleteItem = deleteItem;\n /**\n * Remove an item from the tree.\n *\n * @param node - The node of interest.\n *\n * @param index - The index of interest.\n *\n * @returns The removed item or `undefined`.\n *\n * #### Complexity\n * `O(log32 n)`\n *\n * #### Notes\n * The root may be underfull after calling this function.\n */\n function removeItem(node, index) {\n // Wrap negative indices.\n if (index < 0) {\n index += node.size;\n }\n // Bail early if the index is out of range.\n if (index < 0 || index >= node.size) {\n return undefined;\n }\n // Handle leaf nodes first.\n if (node.type === 1 /* Leaf */) {\n return algorithm.ArrayExt.removeAt(node.items, index);\n }\n // Find the pivot index for the remove.\n var i = findPivotIndexByIndex(node.sizes, index);\n if (i > 0)\n index -= node.sizes[i];\n // Fetch the pivot child.\n var child = node.children[i];\n // Recursively remove the item from the child.\n var item = removeItem(child, index);\n // Update the item state of the branch.\n node.items[i] = child.items[0];\n // Join the child if it's underfull.\n if (child.width < MIN_NODE_WIDTH) {\n i = joinChild(node, i);\n }\n // Update the dirty sizes of the branch.\n updateSizes(node, i);\n // Return the removed item.\n return item;\n }\n Private.removeItem = removeItem;\n /**\n * Recursively clear the contents of a node.\n *\n * @param node - The node of interest.\n *\n * #### Complexity\n * `O(n)`\n */\n function clear(node) {\n if (node.type === 0 /* Branch */) {\n algorithm.each(node.children, clear);\n node.children.length = 0;\n node.sizes.length = 0;\n node.items.length = 0;\n }\n else {\n node.items.length = 0;\n node.next = null;\n node.prev = null;\n }\n }\n Private.clear = clear;\n /**\n * Split a root node and create a new root, if needed.\n *\n * @param node - The root node of interest.\n *\n * @returns The new root node.\n */\n function maybeSplitRoot(node) {\n // Bail early if the current root is not overfull.\n if (node.width <= MAX_NODE_WIDTH) {\n return node;\n }\n // Create a new root branch node.\n var root = new BranchNode();\n // Split the node to the right and create a new sibling.\n var next = splitNode(node);\n // Add the sizes to the root.\n root.sizes[0] = node.size;\n root.sizes[1] = node.size + next.size;\n // Add the children to the root.\n root.children[0] = node;\n root.children[1] = next;\n // Add the items to the root.\n root.items[0] = node.items[0];\n root.items[1] = next.items[0];\n // Return the new root node.\n return root;\n }\n Private.maybeSplitRoot = maybeSplitRoot;\n /**\n * Extract a single node child as a new root, if needed.\n *\n * @param node - The root node of interest.\n *\n * @returns The new root node.\n */\n function maybeExtractRoot(node) {\n // Bail early if the node it already a leaf.\n if (node.type === 1 /* Leaf */) {\n return node;\n }\n // Bail early if the branch has more than one child.\n if (node.children.length > 1) {\n return node;\n }\n // Extract the sole remaining child as the new root.\n var root = node.children.pop();\n // Clear the rest of the node state.\n clear(node);\n // Return the new root.\n return root;\n }\n Private.maybeExtractRoot = maybeExtractRoot;\n /**\n * The maximum width for a node in the tree.\n */\n var MAX_NODE_WIDTH = 32;\n /**\n * The minimum width for a node in the tree.\n */\n var MIN_NODE_WIDTH = MAX_NODE_WIDTH >> 1;\n /**\n * A forward iterator for a B+ tree.\n */\n var ForwardIterator = /** @class */ (function () {\n /**\n * Construct a new forward iterator.\n *\n * @param node - The first leaf node in the chain.\n *\n * @param index - The local index of the first item.\n *\n * @param count - The number of items to iterate. A value `< 0`\n * will iterate all available items.\n */\n function ForwardIterator(node, index, count) {\n this._node = node;\n this._index = index;\n this._count = count;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ForwardIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ForwardIterator.prototype.clone = function () {\n return new ForwardIterator(this._node, this._index, this._count);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ForwardIterator.prototype.next = function () {\n if (this._node === null || this._count === 0) {\n return undefined;\n }\n if (this._index >= this._node.size) {\n this._node = this._node.next;\n this._index = 0;\n return this.next();\n }\n if (this._count > 0) {\n this._count--;\n }\n return this._node.items[this._index++];\n };\n return ForwardIterator;\n }());\n /**\n * A reverse iterator for a B+ tree.\n */\n var RetroIterator = /** @class */ (function () {\n /**\n * Construct a new retro iterator.\n *\n * @param node - The last leaf node in the chain.\n *\n * @param index - The local index of the last item.\n *\n * @param count - The number of items to iterate. A value `< 0`\n * will iterate all available items.\n */\n function RetroIterator(node, index, count) {\n this._node = node;\n this._index = index;\n this._count = count;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RetroIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RetroIterator.prototype.clone = function () {\n return new RetroIterator(this._node, this._index, this._count);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RetroIterator.prototype.next = function () {\n if (this._node === null || this._count === 0) {\n return undefined;\n }\n if (this._index >= this._node.size) {\n this._index = this._node.size - 1;\n }\n if (this._index < 0) {\n this._node = this._node.prev;\n this._index = this._node ? this._node.size - 1 : -1;\n return this.next();\n }\n if (this._count > 0) {\n this._count--;\n }\n return this._node.items[this._index--];\n };\n return RetroIterator;\n }());\n /**\n * Find the pivot index for a particular local index.\n */\n function findPivotIndexByIndex(sizes, index) {\n var n = sizes.length;\n for (var i = 0; i < n; ++i) {\n if (sizes[i] > index) {\n return i;\n }\n }\n return n - 1;\n }\n /**\n * Find the pivot index for a particular key.\n */\n function findPivotIndexByKey(items, key, cmp) {\n var n = items.length;\n for (var i = 1; i < n; ++i) {\n if (cmp(items[i], key) > 0) {\n return i - 1;\n }\n }\n return n - 1;\n }\n /**\n * Find the key index for a particular key.\n */\n function findKeyIndex(items, key, cmp) {\n var n = items.length;\n for (var i = 0; i < n; ++i) {\n var c = cmp(items[i], key);\n if (c === 0) {\n return i;\n }\n if (c > 0) {\n return -i - 1;\n }\n }\n return -n - 1;\n }\n /**\n * Update the sizes of a branch node starting at the given index.\n */\n function updateSizes(node, i) {\n var sizes = node.sizes, children = node.children;\n var last = i > 0 ? sizes[i - 1] : 0;\n for (var n = children.length; i < n; ++i) {\n last = sizes[i] = last + children[i].size;\n }\n sizes.length = children.length;\n }\n /**\n * Split a node and return its new next sibling.\n *\n * @param node - The node of interest.\n *\n * @returns The new next sibling node.\n */\n function splitNode(node) {\n // Handle leaf nodes first.\n if (node.type === 1 /* Leaf */) {\n // Create the new sibling leaf node.\n var next_1 = new LeafNode();\n // Move the items to the new sibling.\n var v1_1 = node.items;\n var v2_1 = next_1.items;\n for (var i = MIN_NODE_WIDTH, n = v1_1.length; i < n; ++i) {\n v2_1.push(v1_1[i]);\n }\n v1_1.length = MIN_NODE_WIDTH;\n // Patch up the sibling links.\n if (node.next)\n node.next.prev = next_1;\n next_1.next = node.next;\n next_1.prev = node;\n node.next = next_1;\n // Return the new next sibling.\n return next_1;\n }\n // Create the new sibling branch node.\n var next = new BranchNode();\n // Move the children to the new sibling.\n var c1 = node.children;\n var c2 = next.children;\n for (var i = MIN_NODE_WIDTH, n = c1.length; i < n; ++i) {\n c2.push(c1[i]);\n }\n c1.length = MIN_NODE_WIDTH;\n // Move the items to the new sibling.\n var v1 = node.items;\n var v2 = next.items;\n for (var i = MIN_NODE_WIDTH, n = v1.length; i < n; ++i) {\n v2.push(v1[i]);\n }\n v1.length = MIN_NODE_WIDTH;\n // Update the dirty sizes of the nodes.\n updateSizes(node, MIN_NODE_WIDTH);\n updateSizes(next, 0);\n // Return the new next sibling.\n return next;\n }\n /**\n * Join a child node of a branch with one of its siblings.\n *\n * @param node - The branch node of interest.\n *\n * @param i - The index of the child node of interest.\n *\n * @returns The first modified index.\n *\n * #### Notes\n * This may cause the branch to become underfull.\n */\n function joinChild(node, i) {\n var _a, _b, _c, _d, _e, _f;\n // Fetch the child to be joined.\n var child = node.children[i];\n // Fetch the relevant sibling.\n var sibling = i === 0 ? node.children[i + 1] : node.children[i - 1];\n // Compute the flags which control the join behavior.\n var hasNext = i === 0;\n var isLeaf = child.type === 1 /* Leaf */;\n var hasExtra = sibling.width > MIN_NODE_WIDTH;\n // Join case #1: steal from next sibling leaf\n if (isLeaf && hasExtra && hasNext) {\n // Cast the children as leaves.\n var c = child;\n var s = sibling;\n // Steal an item.\n c.items.push(s.items.shift());\n // Update the branch items.\n node.items[i + 1] = s.items[0];\n // Return the first modified index.\n return i;\n }\n // Join case #2: steal from previous sibling leaf\n if (isLeaf && hasExtra && !hasNext) {\n // Cast the children as leaves.\n var c = child;\n var s = sibling;\n // Steal an item.\n c.items.unshift(s.items.pop());\n // Update the branch items.\n node.items[i] = c.items[0];\n // Return the first modified index.\n return i - 1;\n }\n // Join case #3: merge with next sibling leaf\n if (isLeaf && !hasExtra && hasNext) {\n // Cast the children as leaves.\n var c = child;\n var s = sibling;\n // Merge items.\n (_a = s.items).unshift.apply(_a, c.items);\n // Remove the old branch child.\n algorithm.ArrayExt.removeAt(node.children, i);\n // Remove the stale branch item.\n algorithm.ArrayExt.removeAt(node.items, i + 1);\n // Patch up the sibling links.\n if (c.prev)\n c.prev.next = s;\n s.prev = c.prev;\n // Clear the original child.\n clear(c);\n // Return the first modified index.\n return i;\n }\n // Join case #4: merge with previous sibling leaf\n if (isLeaf && !hasExtra && !hasNext) {\n // Cast the children as leaves.\n var c = child;\n var s = sibling;\n // Merge items.\n (_b = s.items).push.apply(_b, c.items);\n // Remove the old branch child.\n algorithm.ArrayExt.removeAt(node.children, i);\n // Remove the stale branch item.\n algorithm.ArrayExt.removeAt(node.items, i);\n // Patch up the sibling links.\n if (c.next)\n c.next.prev = s;\n s.next = c.next;\n // Clear the original child.\n clear(c);\n // Return the first modified index.\n return i - 1;\n }\n // Join case #5: steal from next sibling branch\n if (!isLeaf && hasExtra && hasNext) {\n // Cast the children to branches.\n var c = child;\n var s = sibling;\n // Steal a child from the next sibling.\n c.children.push(s.children.shift());\n // Steal an item from the next sibling.\n c.items.push(s.items.shift());\n // Update the branch items.\n node.items[i + 1] = s.items[0];\n // Update the sibling sizes.\n updateSizes(c, c.width - 1);\n updateSizes(s, 0);\n // Return the first modified index.\n return i;\n }\n // Join case #6: steal from previous sibling branch\n if (!isLeaf && hasExtra && !hasNext) {\n // Cast the children to branches.\n var c = child;\n var s = sibling;\n // Steal a child from the previous sibling.\n c.children.unshift(s.children.pop());\n // Steal an item from the previous sibling.\n c.items.unshift(s.items.pop());\n // Update the branch items.\n node.items[i] = c.items[0];\n // Update the sibling sizes.\n updateSizes(c, 0);\n updateSizes(s, s.width - 1);\n // Return the first modified index.\n return i - 1;\n }\n // Join case #7: merge with next sibling branch\n if (!isLeaf && !hasExtra && hasNext) {\n // Cast the children to branches.\n var c = child;\n var s = sibling;\n // Merge the children with the next sibling.\n (_c = s.children).unshift.apply(_c, c.children);\n // Merge the items with the next sibling.\n (_d = s.items).unshift.apply(_d, c.items);\n // Remove the old branch child.\n algorithm.ArrayExt.removeAt(node.children, i);\n // Remove the stale branch item.\n algorithm.ArrayExt.removeAt(node.items, i + 1);\n // Update the sibling sizes.\n updateSizes(s, 0);\n // Clear the original child but, not its children.\n c.children.length = 0;\n clear(c);\n // Return the first modified index.\n return i;\n }\n // Join case #8: merge with previous sibling branch\n if (!isLeaf && !hasExtra && !hasNext) {\n // Cast the children to branches.\n var c = child;\n var s = sibling;\n // Merge the children with the previous sibling.\n (_e = s.children).push.apply(_e, c.children);\n // Merge the items with the previous sibling.\n (_f = s.items).push.apply(_f, c.items);\n // Remove the old branch child.\n algorithm.ArrayExt.removeAt(node.children, i);\n // Remove the stale branch item.\n algorithm.ArrayExt.removeAt(node.items, i);\n // Update the sibling sizes.\n updateSizes(s, 0);\n // Clear the original child, but not its children.\n c.children.length = 0;\n clear(c);\n // Return the first modified index.\n return i - 1;\n }\n // One of the above cases must match.\n throw 'unreachable';\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=bplustree.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/collections/dist/bplustree.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A generic B+ tree.\n *\n * #### Notes\n * Most operations have `O(log32 n)` or better complexity.\n */\nexports.BPlusTree = /** @class */ (function () {\n /**\n * Construct a new B+ tree.\n *\n * @param cmp - The item comparison function for the tree.\n */\n function BPlusTree(cmp) {\n this._root = new Private.LeafNode();\n this.cmp = cmp;\n }\n Object.defineProperty(BPlusTree.prototype, \"isEmpty\", {\n /**\n * Whether the tree is empty.\n *\n * #### Complexity\n * `O(1)`\n */\n get: function () {\n return this._root.size === 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BPlusTree.prototype, \"size\", {\n /**\n * The size of the tree.\n *\n * #### Complexity\n * `O(1)`\n */\n get: function () {\n return this._root.size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BPlusTree.prototype, \"first\", {\n /**\n * The first item in the tree.\n *\n * This is `undefined` if the tree is empty.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n get: function () {\n var node = Private.firstLeaf(this._root);\n return node.size > 0 ? node.items[0] : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BPlusTree.prototype, \"last\", {\n /**\n * The last item in the tree.\n *\n * This is `undefined` if the tree is empty.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n get: function () {\n var node = Private.lastLeaf(this._root);\n return node.size > 0 ? node.items[node.size - 1] : undefined;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the items in the tree.\n *\n * @returns A new iterator starting with the first item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.iter = function () {\n return Private.iterItems(this._root);\n };\n /**\n * Create a reverse iterator over the items in the tree.\n *\n * @returns A new iterator starting with the last item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.retro = function () {\n return Private.retroItems(this._root);\n };\n /**\n * Create an iterator for a slice of items in the tree.\n *\n * @param start - The index of the first item, inclusive. This\n * should be `< stop`. Negative values are taken as an offset\n * from the end of the tree. The default is `0`.\n *\n * @param stop - The index of the last item, exclusive. This\n * should be `> start`. Negative values are taken as an offset\n * from the end of the tree. The default is `size`.\n *\n * @returns A new iterator starting with the specified item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.slice = function (start, stop) {\n return Private.sliceItems(this._root, start, stop);\n };\n /**\n * Create a reverse iterator for a slice of items in the tree.\n *\n * @param start - The index of the first item, inclusive. This\n * should be `> stop`. Negative values are taken as an offset\n * from the end of the tree. The default is `size - 1`.\n *\n * @param stop - The index of the last item, exclusive. This\n * should be `< start`. Negative values are taken as an offset\n * from the end of the tree. The default is `-size - 1`.\n *\n * @returns A new reverse iterator starting with the specified item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.retroSlice = function (start, stop) {\n return Private.retroSliceItems(this._root, start, stop);\n };\n /**\n * Get the item at a particular index.\n *\n * @param index - The index of the item of interest. Negative\n * values are taken as an offset from the end of the tree.\n *\n * @returns The item at the specified index, or `undefined` if\n * the index is out of range.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.at = function (index) {\n return Private.itemAt(this._root, index);\n };\n /**\n * Test whether the tree has an item which matches a key.\n *\n * @param key - The key of interest.\n *\n * @param cmp - A function which compares an item against the key.\n *\n * @returns `true` if the tree has an item which matches the given\n * key, `false` otherwise.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.has = function (key, cmp) {\n return Private.hasItem(this._root, key, cmp);\n };\n /**\n * Get the index of an item which matches a key.\n *\n * @param key - The key of interest.\n *\n * @param cmp - A function which compares an item against the key.\n *\n * @returns The index of the item which matches the given key. A\n * negative value means that a matching item does not exist in\n * the tree, but if one did it would reside at `-index - 1`.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.indexOf = function (key, cmp) {\n return Private.indexOf(this._root, key, cmp);\n };\n /**\n * Get the item which matches a key.\n *\n * @param item - The key of interest.\n *\n * @param cmp - A function which compares an item against the key.\n *\n * @returns The item which matches the given key, or `undefined` if\n * the tree does not have a matching item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.get = function (key, cmp) {\n return Private.getItem(this._root, key, cmp);\n };\n /**\n * Assign new items to the tree, replacing all current items.\n *\n * @param items - The items to assign to the tree.\n *\n * #### Complexity\n * `O(n log32 n)`\n */\n BPlusTree.prototype.assign = function (items) {\n this.clear();\n this.update(items);\n };\n /**\n * Insert an item into the tree.\n *\n * @param item - The item of interest.\n *\n * @returns If the given item matches an existing item in the tree,\n * the given item will replace it, and the existing item will be\n * returned. Otherwise, this method returns `undefined`.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.insert = function (item) {\n var existing = Private.insertItem(this._root, item, this.cmp);\n this._root = Private.maybeSplitRoot(this._root);\n return existing;\n };\n /**\n * Update the tree with multiple items.\n *\n * @param items - The items to insert into the tree.\n *\n * #### Complexity\n * `O(k log32 n)`\n */\n BPlusTree.prototype.update = function (items) {\n var _this = this;\n algorithm.each(items, function (item) { _this.insert(item); });\n };\n /**\n * Delete an item which matches a particular key.\n *\n * @param key - The key of interest.\n *\n * @param cmp - A function which compares an item against the key.\n *\n * @returns The item removed from the tree, or `undefined` if no\n * item matched the given key.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.delete = function (key, cmp) {\n var item = Private.deleteItem(this._root, key, cmp);\n this._root = Private.maybeExtractRoot(this._root);\n return item;\n };\n /**\n * Remove an item at a particular index.\n *\n * @param index - The index of the item to remove. Negative\n * values are taken as an offset from the end of the tree.\n *\n * @returns The item removed from the tree, or `undefined` if\n * the given index is out of range.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n BPlusTree.prototype.remove = function (index) {\n var item = Private.removeItem(this._root, index);\n this._root = Private.maybeExtractRoot(this._root);\n return item;\n };\n /**\n * Clear the contents of the tree.\n *\n * #### Complexity\n * `O(n)`\n */\n BPlusTree.prototype.clear = function () {\n Private.clear(this._root);\n this._root = new Private.LeafNode();\n };\n return BPlusTree;\n}());\n/**\n * The namespace for the `BPlusTree` class statics.\n */\n(function (BPlusTree) {\n /**\n * Create a new B+ tree populated with the given items.\n *\n * @param items - The items to add to the tree.\n *\n * @param cmp - The item comparison function for the tree.\n *\n * @returns A new B+ tree populated with the given items.\n *\n * #### Complexity\n * `O(n log32 n)`\n */\n function from(items, cmp) {\n var tree = new BPlusTree(cmp);\n tree.assign(items);\n return tree;\n }\n BPlusTree.from = from;\n})(exports.BPlusTree || (exports.BPlusTree = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A branch node in a B+ tree.\n */\n var BranchNode = /** @class */ (function () {\n function BranchNode() {\n /**\n * The left-most item of each child subtree.\n */\n this.items = [];\n /**\n * The cumulative sizes of each child subtree.\n */\n this.sizes = [];\n /**\n * The child nodes of this branch node.\n */\n this.children = [];\n }\n Object.defineProperty(BranchNode.prototype, \"type\", {\n /**\n * The discriminated type of the node.\n */\n get: function () {\n return 0 /* Branch */;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BranchNode.prototype, \"size\", {\n /**\n * The total number of items in the subtree.\n */\n get: function () {\n return this.sizes[this.sizes.length - 1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BranchNode.prototype, \"width\", {\n /**\n * The tree width of the node.\n */\n get: function () {\n return this.children.length;\n },\n enumerable: false,\n configurable: true\n });\n return BranchNode;\n }());\n Private.BranchNode = BranchNode;\n /**\n * A leaf node in a B+ tree.\n */\n var LeafNode = /** @class */ (function () {\n function LeafNode() {\n /**\n * The next sibling leaf node of this leaf node.\n */\n this.next = null;\n /**\n * The previous sibling leaf node of this leaf node.\n */\n this.prev = null;\n /**\n * The items of the leaf.\n */\n this.items = [];\n }\n Object.defineProperty(LeafNode.prototype, \"type\", {\n /**\n * The discriminated type of the node.\n */\n get: function () {\n return 1 /* Leaf */;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LeafNode.prototype, \"size\", {\n /**\n * The total number of items in the leaf.\n */\n get: function () {\n return this.items.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LeafNode.prototype, \"width\", {\n /**\n * The tree width of the node.\n */\n get: function () {\n return this.items.length;\n },\n enumerable: false,\n configurable: true\n });\n return LeafNode;\n }());\n Private.LeafNode = LeafNode;\n /**\n * Get the first leaf node in the tree.\n *\n * @param node - The root node of interest.\n *\n * @returns The first leaf node in the tree.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function firstLeaf(node) {\n while (node.type === 0 /* Branch */) {\n node = node.children[0];\n }\n return node;\n }\n Private.firstLeaf = firstLeaf;\n /**\n * Get the last leaf node in the tree.\n *\n * @param node - The root node of interest.\n *\n * @returns The last leaf node in the tree.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function lastLeaf(node) {\n while (node.type === 0 /* Branch */) {\n node = node.children[node.children.length - 1];\n }\n return node;\n }\n Private.lastLeaf = lastLeaf;\n /**\n * Create a forward iterator for the items in the tree.\n *\n * @param node - The root node of interest.\n *\n * @returns A new forward iterator starting with the first item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function iterItems(node) {\n var leaf = firstLeaf(node);\n return new ForwardIterator(leaf, 0, -1);\n }\n Private.iterItems = iterItems;\n /**\n * Create a reverse iterator for the items in the tree.\n *\n * @param node - The root node of interest.\n *\n * @returns A new reverse iterator starting with the last item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function retroItems(node) {\n var leaf = lastLeaf(node);\n return new RetroIterator(leaf, leaf.size - 1, -1);\n }\n Private.retroItems = retroItems;\n /**\n * Create an iterator for a slice of items in the tree.\n *\n * @param node - The root node of interest.\n *\n * @param start - The index of the first item, inclusive. This\n * should be `< stop`. Negative values are taken as an offset\n * from the end of the tree. The default is `0`.\n *\n * @param stop - The index of the last item, exclusive. This\n * should be `> start`. Negative values are taken as an offset\n * from the end of the tree. The default is `size`.\n *\n * @returns A new iterator starting with the specified item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function sliceItems(node, start, stop) {\n // Normalize the start index.\n if (start === undefined) {\n start = 0;\n }\n else if (start < 0) {\n start = Math.max(0, start + node.size);\n }\n else {\n start = Math.min(start, node.size);\n }\n // Normalize the stop index.\n if (stop === undefined) {\n stop = node.size;\n }\n else if (stop < 0) {\n stop = Math.max(0, stop + node.size);\n }\n else {\n stop = Math.min(stop, node.size);\n }\n // Compute effective count.\n var count = Math.max(0, stop - start);\n // Bail early if there is nothing to iterate.\n if (count === 0) {\n return algorithm.empty();\n }\n // Find the starting leaf node and local index.\n while (node.type === 0 /* Branch */) {\n var i = findPivotIndexByIndex(node.sizes, start);\n if (i > 0)\n start -= node.sizes[i - 1];\n node = node.children[i];\n }\n // Return the forward iterator for the range.\n return new ForwardIterator(node, start, count);\n }\n Private.sliceItems = sliceItems;\n /**\n * Create a reverse iterator for a slice of items in the tree.\n *\n * @param node - The root node of interest.\n *\n * @param start - The index of the first item, inclusive. This\n * should be `> stop`. Negative values are taken as an offset\n * from the end of the tree. The default is `size - 1`.\n *\n * @param stop - The index of the last item, exclusive. This\n * should be `< start`. Negative values are taken as an offset\n * from the end of the tree. The default is `-size - 1`.\n *\n * @returns A new reverse iterator starting with the specified item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function retroSliceItems(node, start, stop) {\n // Normalize the start index.\n if (start === undefined) {\n start = node.size - 1;\n }\n else if (start < 0) {\n start = Math.max(-1, start + node.size);\n }\n else {\n start = Math.min(start, node.size - 1);\n }\n // Normalize the stop index.\n if (stop === undefined) {\n stop = -1;\n }\n else if (stop < 0) {\n stop = Math.max(-1, stop + node.size);\n }\n else {\n stop = Math.min(stop, node.size - 1);\n }\n // Compute the effective count.\n var count = Math.max(0, start - stop);\n // Bail early if there is nothing to iterate.\n if (count === 0) {\n return algorithm.empty();\n }\n // Find the starting leaf node and local index.\n while (node.type === 0 /* Branch */) {\n var i = findPivotIndexByIndex(node.sizes, start);\n if (i > 0)\n start -= node.sizes[i - 1];\n node = node.children[i];\n }\n // Return the retro iterator for the range.\n return new RetroIterator(node, start, count);\n }\n Private.retroSliceItems = retroSliceItems;\n /**\n * Get the item at the specified index.\n *\n * @param node - The root node of interest.\n *\n * @param index - The index of the item of interest. Negative\n * values are taken as an offset from the end of the tree.\n *\n * @returns The item at the specified index, or `undefined` if\n * the index is out of range.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function itemAt(node, index) {\n // Wrap negative indices.\n if (index < 0) {\n index += node.size;\n }\n // Bail early if the index is out of range.\n if (index < 0 || index >= node.size) {\n return undefined;\n }\n // Find the containing leaf node and local index.\n while (node.type === 0 /* Branch */) {\n var i = findPivotIndexByIndex(node.sizes, index);\n if (i > 0)\n index -= node.sizes[i - 1];\n node = node.children[i];\n }\n // Return the item at the specified index.\n return node.items[index];\n }\n Private.itemAt = itemAt;\n /**\n * Test whether the tree contains an item which matches a key.\n *\n * @param node - The root node of interest.\n *\n * @param key - The key of interest.\n *\n * @param cmp - The key comparison function.\n *\n * @returns Whether the tree contains a matching item.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function hasItem(node, key, cmp) {\n // Find the containing leaf node.\n while (node.type === 0 /* Branch */) {\n var i_1 = findPivotIndexByKey(node.items, key, cmp);\n node = node.children[i_1];\n }\n // Find the key index.\n var i = findKeyIndex(node.items, key, cmp);\n // Return whether or not the node contains a matching item.\n return i >= 0;\n }\n Private.hasItem = hasItem;\n /**\n * Get the index of the item which matches a key.\n *\n * @param node - The node of interest.\n *\n * @param key - The key of interest.\n *\n * @param cmp - The key comparison function.\n *\n * @returns The index of the item which matches the given key. A\n * negative value means that a matching item does not exist in\n * the tree, but if one did it would reside at `-index - 1`.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function indexOf(node, key, cmp) {\n // Set up the global index.\n var index = 0;\n // Find the containing leaf node and global index.\n while (node.type === 0 /* Branch */) {\n var i_2 = findPivotIndexByKey(node.items, key, cmp);\n if (i_2 > 0)\n index += node.sizes[i_2 - 1];\n node = node.children[i_2];\n }\n // Find the key index.\n var i = findKeyIndex(node.items, key, cmp);\n // Return the final computed index.\n return i >= 0 ? index + i : -index + i;\n }\n Private.indexOf = indexOf;\n /**\n * Get the item for a particular key.\n *\n * @param node - The node of interest.\n *\n * @param key - The key of interest.\n *\n * @param cmp - The key comparison function.\n *\n * @returns The item for the specified key, or `undefined` if\n * the tree does not have a matching item for the key.\n *\n * #### Complexity\n * `O(log32 n)`\n */\n function getItem(node, key, cmp) {\n // Find the containing leaf node.\n while (node.type === 0 /* Branch */) {\n var i_3 = findPivotIndexByKey(node.items, key, cmp);\n node = node.children[i_3];\n }\n // Find the key index.\n var i = findKeyIndex(node.items, key, cmp);\n // Return the item for the given key.\n return i >= 0 ? node.items[i] : undefined;\n }\n Private.getItem = getItem;\n /**\n * Insert an item into the tree.\n *\n * @param node - The root node of interest.\n *\n * @param item - The item of interest.\n *\n * @param cmp - The item comparison function.\n *\n * @returns If the given item matches an existing item in the tree,\n * the given item will replace it, and the existing item will be\n * returned. Otherwise, this function returns `undefined`.\n *\n * #### Complexity\n * `O(log32 n)`\n *\n * #### Notes\n * The root may be overfull after calling this function.\n */\n function insertItem(node, item, cmp) {\n // Handle leaf nodes first.\n if (node.type === 1 /* Leaf */) {\n // Find the index for the given item.\n var i_4 = findKeyIndex(node.items, item, cmp);\n // Fetch the existing item and insert the new item.\n var existing_1;\n if (i_4 >= 0) {\n existing_1 = node.items[i_4];\n node.items[i_4] = item;\n }\n else {\n existing_1 = undefined;\n algorithm.ArrayExt.insert(node.items, -i_4 - 1, item);\n }\n // Return the existing item.\n return existing_1;\n }\n // Find the pivot index for the insert.\n var i = findPivotIndexByKey(node.items, item, cmp);\n // Fetch the pivot child.\n var child = node.children[i];\n // Fetch the current size of the child.\n var prevSize = child.size;\n // Recursively insert the item into the child.\n var existing = insertItem(child, item, cmp);\n // Fetch the updated size of the child.\n var currSize = child.size;\n // Update the item state of the branch.\n node.items[i] = child.items[0];\n // Bail early if the child size did not change.\n if (prevSize === currSize) {\n return existing;\n }\n // Split the child if it's overfull.\n if (child.width > MAX_NODE_WIDTH) {\n var next = splitNode(child);\n algorithm.ArrayExt.insert(node.children, i + 1, next);\n algorithm.ArrayExt.insert(node.items, i + 1, next.items[0]);\n }\n // Update the dirty sizes of the branch.\n updateSizes(node, i);\n // Return the existing item.\n return existing;\n }\n Private.insertItem = insertItem;\n /**\n * Delete an item in the tree.\n *\n * @param node - The node of interest.\n *\n * @param key - The key of interest.\n *\n * @param cmp - The key comparison function.\n *\n * @returns The deleted item or `undefined`.\n *\n * #### Complexity\n * `O(log32 n)`\n *\n * #### Notes\n * The root may be underfull after calling this function.\n */\n function deleteItem(node, key, cmp) {\n // Handle leaf nodes first.\n if (node.type === 1 /* Leaf */) {\n // Find the index for the given key.\n var i_5 = findKeyIndex(node.items, key, cmp);\n // Bail early if the item does not exist.\n if (i_5 < 0) {\n return undefined;\n }\n // Remove the item at the computed index.\n return algorithm.ArrayExt.removeAt(node.items, i_5);\n }\n // Find the pivot index for the delete.\n var i = findPivotIndexByKey(node.items, key, cmp);\n // Fetch the pivot child.\n var child = node.children[i];\n // Fetch the current size of the child.\n var prevSize = child.size;\n // Recursively remove the item from the child.\n var item = deleteItem(child, key, cmp);\n // Fetch the updated size of the child.\n var currSize = child.size;\n // Bail early if the child size did not change.\n if (prevSize === currSize) {\n return item;\n }\n // Update the item state of the branch.\n node.items[i] = child.items[0];\n // Join the child if it's underfull.\n if (child.width < MIN_NODE_WIDTH) {\n i = joinChild(node, i);\n }\n // Update the dirty sizes of the branch.\n updateSizes(node, i);\n // Return the deleted item.\n return item;\n }\n Private.deleteItem = deleteItem;\n /**\n * Remove an item from the tree.\n *\n * @param node - The node of interest.\n *\n * @param index - The index of interest.\n *\n * @returns The removed item or `undefined`.\n *\n * #### Complexity\n * `O(log32 n)`\n *\n * #### Notes\n * The root may be underfull after calling this function.\n */\n function removeItem(node, index) {\n // Wrap negative indices.\n if (index < 0) {\n index += node.size;\n }\n // Bail early if the index is out of range.\n if (index < 0 || index >= node.size) {\n return undefined;\n }\n // Handle leaf nodes first.\n if (node.type === 1 /* Leaf */) {\n return algorithm.ArrayExt.removeAt(node.items, index);\n }\n // Find the pivot index for the remove.\n var i = findPivotIndexByIndex(node.sizes, index);\n if (i > 0)\n index -= node.sizes[i];\n // Fetch the pivot child.\n var child = node.children[i];\n // Recursively remove the item from the child.\n var item = removeItem(child, index);\n // Update the item state of the branch.\n node.items[i] = child.items[0];\n // Join the child if it's underfull.\n if (child.width < MIN_NODE_WIDTH) {\n i = joinChild(node, i);\n }\n // Update the dirty sizes of the branch.\n updateSizes(node, i);\n // Return the removed item.\n return item;\n }\n Private.removeItem = removeItem;\n /**\n * Recursively clear the contents of a node.\n *\n * @param node - The node of interest.\n *\n * #### Complexity\n * `O(n)`\n */\n function clear(node) {\n if (node.type === 0 /* Branch */) {\n algorithm.each(node.children, clear);\n node.children.length = 0;\n node.sizes.length = 0;\n node.items.length = 0;\n }\n else {\n node.items.length = 0;\n node.next = null;\n node.prev = null;\n }\n }\n Private.clear = clear;\n /**\n * Split a root node and create a new root, if needed.\n *\n * @param node - The root node of interest.\n *\n * @returns The new root node.\n */\n function maybeSplitRoot(node) {\n // Bail early if the current root is not overfull.\n if (node.width <= MAX_NODE_WIDTH) {\n return node;\n }\n // Create a new root branch node.\n var root = new BranchNode();\n // Split the node to the right and create a new sibling.\n var next = splitNode(node);\n // Add the sizes to the root.\n root.sizes[0] = node.size;\n root.sizes[1] = node.size + next.size;\n // Add the children to the root.\n root.children[0] = node;\n root.children[1] = next;\n // Add the items to the root.\n root.items[0] = node.items[0];\n root.items[1] = next.items[0];\n // Return the new root node.\n return root;\n }\n Private.maybeSplitRoot = maybeSplitRoot;\n /**\n * Extract a single node child as a new root, if needed.\n *\n * @param node - The root node of interest.\n *\n * @returns The new root node.\n */\n function maybeExtractRoot(node) {\n // Bail early if the node it already a leaf.\n if (node.type === 1 /* Leaf */) {\n return node;\n }\n // Bail early if the branch has more than one child.\n if (node.children.length > 1) {\n return node;\n }\n // Extract the sole remaining child as the new root.\n var root = node.children.pop();\n // Clear the rest of the node state.\n clear(node);\n // Return the new root.\n return root;\n }\n Private.maybeExtractRoot = maybeExtractRoot;\n /**\n * The maximum width for a node in the tree.\n */\n var MAX_NODE_WIDTH = 32;\n /**\n * The minimum width for a node in the tree.\n */\n var MIN_NODE_WIDTH = MAX_NODE_WIDTH >> 1;\n /**\n * A forward iterator for a B+ tree.\n */\n var ForwardIterator = /** @class */ (function () {\n /**\n * Construct a new forward iterator.\n *\n * @param node - The first leaf node in the chain.\n *\n * @param index - The local index of the first item.\n *\n * @param count - The number of items to iterate. A value `< 0`\n * will iterate all available items.\n */\n function ForwardIterator(node, index, count) {\n this._node = node;\n this._index = index;\n this._count = count;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ForwardIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ForwardIterator.prototype.clone = function () {\n return new ForwardIterator(this._node, this._index, this._count);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ForwardIterator.prototype.next = function () {\n if (this._node === null || this._count === 0) {\n return undefined;\n }\n if (this._index >= this._node.size) {\n this._node = this._node.next;\n this._index = 0;\n return this.next();\n }\n if (this._count > 0) {\n this._count--;\n }\n return this._node.items[this._index++];\n };\n return ForwardIterator;\n }());\n /**\n * A reverse iterator for a B+ tree.\n */\n var RetroIterator = /** @class */ (function () {\n /**\n * Construct a new retro iterator.\n *\n * @param node - The last leaf node in the chain.\n *\n * @param index - The local index of the last item.\n *\n * @param count - The number of items to iterate. A value `< 0`\n * will iterate all available items.\n */\n function RetroIterator(node, index, count) {\n this._node = node;\n this._index = index;\n this._count = count;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RetroIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RetroIterator.prototype.clone = function () {\n return new RetroIterator(this._node, this._index, this._count);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RetroIterator.prototype.next = function () {\n if (this._node === null || this._count === 0) {\n return undefined;\n }\n if (this._index >= this._node.size) {\n this._index = this._node.size - 1;\n }\n if (this._index < 0) {\n this._node = this._node.prev;\n this._index = this._node ? this._node.size - 1 : -1;\n return this.next();\n }\n if (this._count > 0) {\n this._count--;\n }\n return this._node.items[this._index--];\n };\n return RetroIterator;\n }());\n /**\n * Find the pivot index for a particular local index.\n */\n function findPivotIndexByIndex(sizes, index) {\n var n = sizes.length;\n for (var i = 0; i < n; ++i) {\n if (sizes[i] > index) {\n return i;\n }\n }\n return n - 1;\n }\n /**\n * Find the pivot index for a particular key.\n */\n function findPivotIndexByKey(items, key, cmp) {\n var n = items.length;\n for (var i = 1; i < n; ++i) {\n if (cmp(items[i], key) > 0) {\n return i - 1;\n }\n }\n return n - 1;\n }\n /**\n * Find the key index for a particular key.\n */\n function findKeyIndex(items, key, cmp) {\n var n = items.length;\n for (var i = 0; i < n; ++i) {\n var c = cmp(items[i], key);\n if (c === 0) {\n return i;\n }\n if (c > 0) {\n return -i - 1;\n }\n }\n return -n - 1;\n }\n /**\n * Update the sizes of a branch node starting at the given index.\n */\n function updateSizes(node, i) {\n var sizes = node.sizes, children = node.children;\n var last = i > 0 ? sizes[i - 1] : 0;\n for (var n = children.length; i < n; ++i) {\n last = sizes[i] = last + children[i].size;\n }\n sizes.length = children.length;\n }\n /**\n * Split a node and return its new next sibling.\n *\n * @param node - The node of interest.\n *\n * @returns The new next sibling node.\n */\n function splitNode(node) {\n // Handle leaf nodes first.\n if (node.type === 1 /* Leaf */) {\n // Create the new sibling leaf node.\n var next_1 = new LeafNode();\n // Move the items to the new sibling.\n var v1_1 = node.items;\n var v2_1 = next_1.items;\n for (var i = MIN_NODE_WIDTH, n = v1_1.length; i < n; ++i) {\n v2_1.push(v1_1[i]);\n }\n v1_1.length = MIN_NODE_WIDTH;\n // Patch up the sibling links.\n if (node.next)\n node.next.prev = next_1;\n next_1.next = node.next;\n next_1.prev = node;\n node.next = next_1;\n // Return the new next sibling.\n return next_1;\n }\n // Create the new sibling branch node.\n var next = new BranchNode();\n // Move the children to the new sibling.\n var c1 = node.children;\n var c2 = next.children;\n for (var i = MIN_NODE_WIDTH, n = c1.length; i < n; ++i) {\n c2.push(c1[i]);\n }\n c1.length = MIN_NODE_WIDTH;\n // Move the items to the new sibling.\n var v1 = node.items;\n var v2 = next.items;\n for (var i = MIN_NODE_WIDTH, n = v1.length; i < n; ++i) {\n v2.push(v1[i]);\n }\n v1.length = MIN_NODE_WIDTH;\n // Update the dirty sizes of the nodes.\n updateSizes(node, MIN_NODE_WIDTH);\n updateSizes(next, 0);\n // Return the new next sibling.\n return next;\n }\n /**\n * Join a child node of a branch with one of its siblings.\n *\n * @param node - The branch node of interest.\n *\n * @param i - The index of the child node of interest.\n *\n * @returns The first modified index.\n *\n * #### Notes\n * This may cause the branch to become underfull.\n */\n function joinChild(node, i) {\n var _a, _b, _c, _d, _e, _f;\n // Fetch the child to be joined.\n var child = node.children[i];\n // Fetch the relevant sibling.\n var sibling = i === 0 ? node.children[i + 1] : node.children[i - 1];\n // Compute the flags which control the join behavior.\n var hasNext = i === 0;\n var isLeaf = child.type === 1 /* Leaf */;\n var hasExtra = sibling.width > MIN_NODE_WIDTH;\n // Join case #1: steal from next sibling leaf\n if (isLeaf && hasExtra && hasNext) {\n // Cast the children as leaves.\n var c = child;\n var s = sibling;\n // Steal an item.\n c.items.push(s.items.shift());\n // Update the branch items.\n node.items[i + 1] = s.items[0];\n // Return the first modified index.\n return i;\n }\n // Join case #2: steal from previous sibling leaf\n if (isLeaf && hasExtra && !hasNext) {\n // Cast the children as leaves.\n var c = child;\n var s = sibling;\n // Steal an item.\n c.items.unshift(s.items.pop());\n // Update the branch items.\n node.items[i] = c.items[0];\n // Return the first modified index.\n return i - 1;\n }\n // Join case #3: merge with next sibling leaf\n if (isLeaf && !hasExtra && hasNext) {\n // Cast the children as leaves.\n var c = child;\n var s = sibling;\n // Merge items.\n (_a = s.items).unshift.apply(_a, c.items);\n // Remove the old branch child.\n algorithm.ArrayExt.removeAt(node.children, i);\n // Remove the stale branch item.\n algorithm.ArrayExt.removeAt(node.items, i + 1);\n // Patch up the sibling links.\n if (c.prev)\n c.prev.next = s;\n s.prev = c.prev;\n // Clear the original child.\n clear(c);\n // Return the first modified index.\n return i;\n }\n // Join case #4: merge with previous sibling leaf\n if (isLeaf && !hasExtra && !hasNext) {\n // Cast the children as leaves.\n var c = child;\n var s = sibling;\n // Merge items.\n (_b = s.items).push.apply(_b, c.items);\n // Remove the old branch child.\n algorithm.ArrayExt.removeAt(node.children, i);\n // Remove the stale branch item.\n algorithm.ArrayExt.removeAt(node.items, i);\n // Patch up the sibling links.\n if (c.next)\n c.next.prev = s;\n s.next = c.next;\n // Clear the original child.\n clear(c);\n // Return the first modified index.\n return i - 1;\n }\n // Join case #5: steal from next sibling branch\n if (!isLeaf && hasExtra && hasNext) {\n // Cast the children to branches.\n var c = child;\n var s = sibling;\n // Steal a child from the next sibling.\n c.children.push(s.children.shift());\n // Steal an item from the next sibling.\n c.items.push(s.items.shift());\n // Update the branch items.\n node.items[i + 1] = s.items[0];\n // Update the sibling sizes.\n updateSizes(c, c.width - 1);\n updateSizes(s, 0);\n // Return the first modified index.\n return i;\n }\n // Join case #6: steal from previous sibling branch\n if (!isLeaf && hasExtra && !hasNext) {\n // Cast the children to branches.\n var c = child;\n var s = sibling;\n // Steal a child from the previous sibling.\n c.children.unshift(s.children.pop());\n // Steal an item from the previous sibling.\n c.items.unshift(s.items.pop());\n // Update the branch items.\n node.items[i] = c.items[0];\n // Update the sibling sizes.\n updateSizes(c, 0);\n updateSizes(s, s.width - 1);\n // Return the first modified index.\n return i - 1;\n }\n // Join case #7: merge with next sibling branch\n if (!isLeaf && !hasExtra && hasNext) {\n // Cast the children to branches.\n var c = child;\n var s = sibling;\n // Merge the children with the next sibling.\n (_c = s.children).unshift.apply(_c, c.children);\n // Merge the items with the next sibling.\n (_d = s.items).unshift.apply(_d, c.items);\n // Remove the old branch child.\n algorithm.ArrayExt.removeAt(node.children, i);\n // Remove the stale branch item.\n algorithm.ArrayExt.removeAt(node.items, i + 1);\n // Update the sibling sizes.\n updateSizes(s, 0);\n // Clear the original child but, not its children.\n c.children.length = 0;\n clear(c);\n // Return the first modified index.\n return i;\n }\n // Join case #8: merge with previous sibling branch\n if (!isLeaf && !hasExtra && !hasNext) {\n // Cast the children to branches.\n var c = child;\n var s = sibling;\n // Merge the children with the previous sibling.\n (_e = s.children).push.apply(_e, c.children);\n // Merge the items with the previous sibling.\n (_f = s.items).push.apply(_f, c.items);\n // Remove the old branch child.\n algorithm.ArrayExt.removeAt(node.children, i);\n // Remove the stale branch item.\n algorithm.ArrayExt.removeAt(node.items, i);\n // Update the sibling sizes.\n updateSizes(s, 0);\n // Clear the original child, but not its children.\n c.children.length = 0;\n clear(c);\n // Return the first modified index.\n return i - 1;\n }\n // One of the above cases must match.\n throw 'unreachable';\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=bplustree.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/collections/dist/bplustree.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/collections/dist/index.js": │ │ │ │ /*!*********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/collections/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/collections/dist/index.js ***! │ │ │ │ \*********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar bplustree = __webpack_require__(/*! ./bplustree.js */ \"../../packages/collections/dist/bplustree.js\");\nvar linkedlist = __webpack_require__(/*! ./linkedlist.js */ \"../../packages/collections/dist/linkedlist.js\");\n\n\n\nObject.defineProperty(exports, 'BPlusTree', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn bplustree.BPlusTree;\n\t}\n});\nObject.defineProperty(exports, 'LinkedList', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn linkedlist.LinkedList;\n\t}\n});\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/collections/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar bplustree = __webpack_require__(/*! ./bplustree.js */ \"../../packages/collections/dist/bplustree.js\");\nvar linkedlist = __webpack_require__(/*! ./linkedlist.js */ \"../../packages/collections/dist/linkedlist.js\");\n\n\n\nObject.defineProperty(exports, 'BPlusTree', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn bplustree.BPlusTree;\n\t}\n});\nObject.defineProperty(exports, 'LinkedList', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn linkedlist.LinkedList;\n\t}\n});\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/collections/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/collections/dist/linkedlist.js": │ │ │ │ /*!**************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/collections/dist/linkedlist.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/collections/dist/linkedlist.js ***! │ │ │ │ \**************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A generic doubly-linked list.\n */\nexports.LinkedList = /** @class */ (function () {\n /**\n * Construct a new linked list.\n */\n function LinkedList() {\n this._first = null;\n this._last = null;\n this._size = 0;\n }\n Object.defineProperty(LinkedList.prototype, \"isEmpty\", {\n /**\n * Whether the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._size === 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"size\", {\n /**\n * The size of the list.\n *\n * #### Complexity\n * `O(1)`\n *\n * #### Notes\n * This is equivalent to `length`.\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"length\", {\n /**\n * The length of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `size`.\n *\n * This property is deprecated.\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"first\", {\n /**\n * The first value in the list.\n *\n * This is `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._first ? this._first.value : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"last\", {\n /**\n * The last value in the list.\n *\n * This is `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._last ? this._last.value : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"firstNode\", {\n /**\n * The first node in the list.\n *\n * This is `null` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._first;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"lastNode\", {\n /**\n * The last node in the list.\n *\n * This is `null` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._last;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the values in the list.\n *\n * @returns A new iterator starting with the first value.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.iter = function () {\n return new LinkedList.ForwardValueIterator(this._first);\n };\n /**\n * Create a reverse iterator over the values in the list.\n *\n * @returns A new iterator starting with the last value.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.retro = function () {\n return new LinkedList.RetroValueIterator(this._last);\n };\n /**\n * Create an iterator over the nodes in the list.\n *\n * @returns A new iterator starting with the first node.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.nodes = function () {\n return new LinkedList.ForwardNodeIterator(this._first);\n };\n /**\n * Create a reverse iterator over the nodes in the list.\n *\n * @returns A new iterator starting with the last node.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.retroNodes = function () {\n return new LinkedList.RetroNodeIterator(this._last);\n };\n /**\n * Assign new values to the list, replacing all current values.\n *\n * @param values - The values to assign to the list.\n *\n * #### Complexity\n * Linear.\n */\n LinkedList.prototype.assign = function (values) {\n var _this = this;\n this.clear();\n algorithm.each(values, function (value) { _this.addLast(value); });\n };\n /**\n * Add a value to the end of the list.\n *\n * @param value - The value to add to the end of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `addLast`.\n */\n LinkedList.prototype.push = function (value) {\n this.addLast(value);\n };\n /**\n * Remove and return the value at the end of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `removeLast`.\n */\n LinkedList.prototype.pop = function () {\n return this.removeLast();\n };\n /**\n * Add a value to the beginning of the list.\n *\n * @param value - The value to add to the beginning of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `addFirst`.\n */\n LinkedList.prototype.shift = function (value) {\n this.addFirst(value);\n };\n /**\n * Remove and return the value at the beginning of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `removeFirst`.\n */\n LinkedList.prototype.unshift = function () {\n return this.removeFirst();\n };\n /**\n * Add a value to the beginning of the list.\n *\n * @param value - The value to add to the beginning of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.addFirst = function (value) {\n var node = new Private.LinkedListNode(this, value);\n if (!this._first) {\n this._first = node;\n this._last = node;\n }\n else {\n node.next = this._first;\n this._first.prev = node;\n this._first = node;\n }\n this._size++;\n return node;\n };\n /**\n * Add a value to the end of the list.\n *\n * @param value - The value to add to the end of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.addLast = function (value) {\n var node = new Private.LinkedListNode(this, value);\n if (!this._last) {\n this._first = node;\n this._last = node;\n }\n else {\n node.prev = this._last;\n this._last.next = node;\n this._last = node;\n }\n this._size++;\n return node;\n };\n /**\n * Insert a value before a specific node in the list.\n *\n * @param value - The value to insert before the reference node.\n *\n * @param ref - The reference node of interest. If this is `null`,\n * the value will be added to the beginning of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Notes\n * The reference node must be owned by the list.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.insertBefore = function (value, ref) {\n if (!ref || ref === this._first) {\n return this.addFirst(value);\n }\n if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {\n throw new Error('Reference node is not owned by the list.');\n }\n var node = new Private.LinkedListNode(this, value);\n var _ref = ref;\n var prev = _ref.prev;\n node.next = _ref;\n node.prev = prev;\n _ref.prev = node;\n prev.next = node;\n this._size++;\n return node;\n };\n /**\n * Insert a value after a specific node in the list.\n *\n * @param value - The value to insert after the reference node.\n *\n * @param ref - The reference node of interest. If this is `null`,\n * the value will be added to the end of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Notes\n * The reference node must be owned by the list.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.insertAfter = function (value, ref) {\n if (!ref || ref === this._last) {\n return this.addLast(value);\n }\n if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {\n throw new Error('Reference node is not owned by the list.');\n }\n var node = new Private.LinkedListNode(this, value);\n var _ref = ref;\n var next = _ref.next;\n node.next = next;\n node.prev = _ref;\n _ref.next = node;\n next.prev = node;\n this._size++;\n return node;\n };\n /**\n * Remove and return the value at the beginning of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.removeFirst = function () {\n var node = this._first;\n if (!node) {\n return undefined;\n }\n if (node === this._last) {\n this._first = null;\n this._last = null;\n }\n else {\n this._first = node.next;\n this._first.prev = null;\n }\n node.list = null;\n node.next = null;\n node.prev = null;\n this._size--;\n return node.value;\n };\n /**\n * Remove and return the value at the end of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.removeLast = function () {\n var node = this._last;\n if (!node) {\n return undefined;\n }\n if (node === this._first) {\n this._first = null;\n this._last = null;\n }\n else {\n this._last = node.prev;\n this._last.next = null;\n }\n node.list = null;\n node.next = null;\n node.prev = null;\n this._size--;\n return node.value;\n };\n /**\n * Remove a specific node from the list.\n *\n * @param node - The node to remove from the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * The node must be owned by the list.\n */\n LinkedList.prototype.removeNode = function (node) {\n if (!(node instanceof Private.LinkedListNode) || node.list !== this) {\n throw new Error('Node is not owned by the list.');\n }\n var _node = node;\n if (_node === this._first && _node === this._last) {\n this._first = null;\n this._last = null;\n }\n else if (_node === this._first) {\n this._first = _node.next;\n this._first.prev = null;\n }\n else if (_node === this._last) {\n this._last = _node.prev;\n this._last.next = null;\n }\n else {\n _node.next.prev = _node.prev;\n _node.prev.next = _node.next;\n }\n _node.list = null;\n _node.next = null;\n _node.prev = null;\n this._size--;\n };\n /**\n * Remove all values from the list.\n *\n * #### Complexity\n * Linear.\n */\n LinkedList.prototype.clear = function () {\n var node = this._first;\n while (node) {\n var next = node.next;\n node.list = null;\n node.prev = null;\n node.next = null;\n node = next;\n }\n this._first = null;\n this._last = null;\n this._size = 0;\n };\n return LinkedList;\n}());\n/**\n * The namespace for the `LinkedList` class statics.\n */\n(function (LinkedList) {\n /**\n * Create a linked list from an iterable of values.\n *\n * @param values - The iterable or array-like object of interest.\n *\n * @returns A new linked list initialized with the given values.\n *\n * #### Complexity\n * Linear.\n */\n function from(values) {\n var list = new LinkedList();\n list.assign(values);\n return list;\n }\n LinkedList.from = from;\n /**\n * A forward iterator for values in a linked list.\n */\n var ForwardValueIterator = /** @class */ (function () {\n /**\n * Construct a forward value iterator.\n *\n * @param node - The first node in the list.\n */\n function ForwardValueIterator(node) {\n this._node = node;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ForwardValueIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ForwardValueIterator.prototype.clone = function () {\n return new ForwardValueIterator(this._node);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ForwardValueIterator.prototype.next = function () {\n if (!this._node) {\n return undefined;\n }\n var node = this._node;\n this._node = node.next;\n return node.value;\n };\n return ForwardValueIterator;\n }());\n LinkedList.ForwardValueIterator = ForwardValueIterator;\n /**\n * A reverse iterator for values in a linked list.\n */\n var RetroValueIterator = /** @class */ (function () {\n /**\n * Construct a retro value iterator.\n *\n * @param node - The last node in the list.\n */\n function RetroValueIterator(node) {\n this._node = node;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RetroValueIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RetroValueIterator.prototype.clone = function () {\n return new RetroValueIterator(this._node);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RetroValueIterator.prototype.next = function () {\n if (!this._node) {\n return undefined;\n }\n var node = this._node;\n this._node = node.prev;\n return node.value;\n };\n return RetroValueIterator;\n }());\n LinkedList.RetroValueIterator = RetroValueIterator;\n /**\n * A forward iterator for nodes in a linked list.\n */\n var ForwardNodeIterator = /** @class */ (function () {\n /**\n * Construct a forward node iterator.\n *\n * @param node - The first node in the list.\n */\n function ForwardNodeIterator(node) {\n this._node = node;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ForwardNodeIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ForwardNodeIterator.prototype.clone = function () {\n return new ForwardNodeIterator(this._node);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ForwardNodeIterator.prototype.next = function () {\n if (!this._node) {\n return undefined;\n }\n var node = this._node;\n this._node = node.next;\n return node;\n };\n return ForwardNodeIterator;\n }());\n LinkedList.ForwardNodeIterator = ForwardNodeIterator;\n /**\n * A reverse iterator for nodes in a linked list.\n */\n var RetroNodeIterator = /** @class */ (function () {\n /**\n * Construct a retro node iterator.\n *\n * @param node - The last node in the list.\n */\n function RetroNodeIterator(node) {\n this._node = node;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RetroNodeIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RetroNodeIterator.prototype.clone = function () {\n return new RetroNodeIterator(this._node);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RetroNodeIterator.prototype.next = function () {\n if (!this._node) {\n return undefined;\n }\n var node = this._node;\n this._node = node.prev;\n return node;\n };\n return RetroNodeIterator;\n }());\n LinkedList.RetroNodeIterator = RetroNodeIterator;\n})(exports.LinkedList || (exports.LinkedList = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The internal linked list node implementation.\n */\n var LinkedListNode = /** @class */ (function () {\n /**\n * Construct a new linked list node.\n *\n * @param list - The list which owns the node.\n *\n * @param value - The value for the link.\n */\n function LinkedListNode(list, value) {\n /**\n * The linked list which created and owns the node.\n */\n this.list = null;\n /**\n * The next node in the list.\n */\n this.next = null;\n /**\n * The previous node in the list.\n */\n this.prev = null;\n this.list = list;\n this.value = value;\n }\n return LinkedListNode;\n }());\n Private.LinkedListNode = LinkedListNode;\n})(Private || (Private = {}));\n//# sourceMappingURL=linkedlist.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/collections/dist/linkedlist.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A generic doubly-linked list.\n */\nexports.LinkedList = /** @class */ (function () {\n /**\n * Construct a new linked list.\n */\n function LinkedList() {\n this._first = null;\n this._last = null;\n this._size = 0;\n }\n Object.defineProperty(LinkedList.prototype, \"isEmpty\", {\n /**\n * Whether the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._size === 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"size\", {\n /**\n * The size of the list.\n *\n * #### Complexity\n * `O(1)`\n *\n * #### Notes\n * This is equivalent to `length`.\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"length\", {\n /**\n * The length of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `size`.\n *\n * This property is deprecated.\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"first\", {\n /**\n * The first value in the list.\n *\n * This is `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._first ? this._first.value : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"last\", {\n /**\n * The last value in the list.\n *\n * This is `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._last ? this._last.value : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"firstNode\", {\n /**\n * The first node in the list.\n *\n * This is `null` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._first;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LinkedList.prototype, \"lastNode\", {\n /**\n * The last node in the list.\n *\n * This is `null` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._last;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the values in the list.\n *\n * @returns A new iterator starting with the first value.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.iter = function () {\n return new LinkedList.ForwardValueIterator(this._first);\n };\n /**\n * Create a reverse iterator over the values in the list.\n *\n * @returns A new iterator starting with the last value.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.retro = function () {\n return new LinkedList.RetroValueIterator(this._last);\n };\n /**\n * Create an iterator over the nodes in the list.\n *\n * @returns A new iterator starting with the first node.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.nodes = function () {\n return new LinkedList.ForwardNodeIterator(this._first);\n };\n /**\n * Create a reverse iterator over the nodes in the list.\n *\n * @returns A new iterator starting with the last node.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.retroNodes = function () {\n return new LinkedList.RetroNodeIterator(this._last);\n };\n /**\n * Assign new values to the list, replacing all current values.\n *\n * @param values - The values to assign to the list.\n *\n * #### Complexity\n * Linear.\n */\n LinkedList.prototype.assign = function (values) {\n var _this = this;\n this.clear();\n algorithm.each(values, function (value) { _this.addLast(value); });\n };\n /**\n * Add a value to the end of the list.\n *\n * @param value - The value to add to the end of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `addLast`.\n */\n LinkedList.prototype.push = function (value) {\n this.addLast(value);\n };\n /**\n * Remove and return the value at the end of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `removeLast`.\n */\n LinkedList.prototype.pop = function () {\n return this.removeLast();\n };\n /**\n * Add a value to the beginning of the list.\n *\n * @param value - The value to add to the beginning of the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `addFirst`.\n */\n LinkedList.prototype.shift = function (value) {\n this.addFirst(value);\n };\n /**\n * Remove and return the value at the beginning of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * This is equivalent to `removeFirst`.\n */\n LinkedList.prototype.unshift = function () {\n return this.removeFirst();\n };\n /**\n * Add a value to the beginning of the list.\n *\n * @param value - The value to add to the beginning of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.addFirst = function (value) {\n var node = new Private.LinkedListNode(this, value);\n if (!this._first) {\n this._first = node;\n this._last = node;\n }\n else {\n node.next = this._first;\n this._first.prev = node;\n this._first = node;\n }\n this._size++;\n return node;\n };\n /**\n * Add a value to the end of the list.\n *\n * @param value - The value to add to the end of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.addLast = function (value) {\n var node = new Private.LinkedListNode(this, value);\n if (!this._last) {\n this._first = node;\n this._last = node;\n }\n else {\n node.prev = this._last;\n this._last.next = node;\n this._last = node;\n }\n this._size++;\n return node;\n };\n /**\n * Insert a value before a specific node in the list.\n *\n * @param value - The value to insert before the reference node.\n *\n * @param ref - The reference node of interest. If this is `null`,\n * the value will be added to the beginning of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Notes\n * The reference node must be owned by the list.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.insertBefore = function (value, ref) {\n if (!ref || ref === this._first) {\n return this.addFirst(value);\n }\n if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {\n throw new Error('Reference node is not owned by the list.');\n }\n var node = new Private.LinkedListNode(this, value);\n var _ref = ref;\n var prev = _ref.prev;\n node.next = _ref;\n node.prev = prev;\n _ref.prev = node;\n prev.next = node;\n this._size++;\n return node;\n };\n /**\n * Insert a value after a specific node in the list.\n *\n * @param value - The value to insert after the reference node.\n *\n * @param ref - The reference node of interest. If this is `null`,\n * the value will be added to the end of the list.\n *\n * @returns The list node which holds the value.\n *\n * #### Notes\n * The reference node must be owned by the list.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.insertAfter = function (value, ref) {\n if (!ref || ref === this._last) {\n return this.addLast(value);\n }\n if (!(ref instanceof Private.LinkedListNode) || ref.list !== this) {\n throw new Error('Reference node is not owned by the list.');\n }\n var node = new Private.LinkedListNode(this, value);\n var _ref = ref;\n var next = _ref.next;\n node.next = next;\n node.prev = _ref;\n _ref.next = node;\n next.prev = node;\n this._size++;\n return node;\n };\n /**\n * Remove and return the value at the beginning of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.removeFirst = function () {\n var node = this._first;\n if (!node) {\n return undefined;\n }\n if (node === this._last) {\n this._first = null;\n this._last = null;\n }\n else {\n this._first = node.next;\n this._first.prev = null;\n }\n node.list = null;\n node.next = null;\n node.prev = null;\n this._size--;\n return node.value;\n };\n /**\n * Remove and return the value at the end of the list.\n *\n * @returns The removed value, or `undefined` if the list is empty.\n *\n * #### Complexity\n * Constant.\n */\n LinkedList.prototype.removeLast = function () {\n var node = this._last;\n if (!node) {\n return undefined;\n }\n if (node === this._first) {\n this._first = null;\n this._last = null;\n }\n else {\n this._last = node.prev;\n this._last.next = null;\n }\n node.list = null;\n node.next = null;\n node.prev = null;\n this._size--;\n return node.value;\n };\n /**\n * Remove a specific node from the list.\n *\n * @param node - The node to remove from the list.\n *\n * #### Complexity\n * Constant.\n *\n * #### Notes\n * The node must be owned by the list.\n */\n LinkedList.prototype.removeNode = function (node) {\n if (!(node instanceof Private.LinkedListNode) || node.list !== this) {\n throw new Error('Node is not owned by the list.');\n }\n var _node = node;\n if (_node === this._first && _node === this._last) {\n this._first = null;\n this._last = null;\n }\n else if (_node === this._first) {\n this._first = _node.next;\n this._first.prev = null;\n }\n else if (_node === this._last) {\n this._last = _node.prev;\n this._last.next = null;\n }\n else {\n _node.next.prev = _node.prev;\n _node.prev.next = _node.next;\n }\n _node.list = null;\n _node.next = null;\n _node.prev = null;\n this._size--;\n };\n /**\n * Remove all values from the list.\n *\n * #### Complexity\n * Linear.\n */\n LinkedList.prototype.clear = function () {\n var node = this._first;\n while (node) {\n var next = node.next;\n node.list = null;\n node.prev = null;\n node.next = null;\n node = next;\n }\n this._first = null;\n this._last = null;\n this._size = 0;\n };\n return LinkedList;\n}());\n/**\n * The namespace for the `LinkedList` class statics.\n */\n(function (LinkedList) {\n /**\n * Create a linked list from an iterable of values.\n *\n * @param values - The iterable or array-like object of interest.\n *\n * @returns A new linked list initialized with the given values.\n *\n * #### Complexity\n * Linear.\n */\n function from(values) {\n var list = new LinkedList();\n list.assign(values);\n return list;\n }\n LinkedList.from = from;\n /**\n * A forward iterator for values in a linked list.\n */\n var ForwardValueIterator = /** @class */ (function () {\n /**\n * Construct a forward value iterator.\n *\n * @param node - The first node in the list.\n */\n function ForwardValueIterator(node) {\n this._node = node;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ForwardValueIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ForwardValueIterator.prototype.clone = function () {\n return new ForwardValueIterator(this._node);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ForwardValueIterator.prototype.next = function () {\n if (!this._node) {\n return undefined;\n }\n var node = this._node;\n this._node = node.next;\n return node.value;\n };\n return ForwardValueIterator;\n }());\n LinkedList.ForwardValueIterator = ForwardValueIterator;\n /**\n * A reverse iterator for values in a linked list.\n */\n var RetroValueIterator = /** @class */ (function () {\n /**\n * Construct a retro value iterator.\n *\n * @param node - The last node in the list.\n */\n function RetroValueIterator(node) {\n this._node = node;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RetroValueIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RetroValueIterator.prototype.clone = function () {\n return new RetroValueIterator(this._node);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RetroValueIterator.prototype.next = function () {\n if (!this._node) {\n return undefined;\n }\n var node = this._node;\n this._node = node.prev;\n return node.value;\n };\n return RetroValueIterator;\n }());\n LinkedList.RetroValueIterator = RetroValueIterator;\n /**\n * A forward iterator for nodes in a linked list.\n */\n var ForwardNodeIterator = /** @class */ (function () {\n /**\n * Construct a forward node iterator.\n *\n * @param node - The first node in the list.\n */\n function ForwardNodeIterator(node) {\n this._node = node;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n ForwardNodeIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n ForwardNodeIterator.prototype.clone = function () {\n return new ForwardNodeIterator(this._node);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n ForwardNodeIterator.prototype.next = function () {\n if (!this._node) {\n return undefined;\n }\n var node = this._node;\n this._node = node.next;\n return node;\n };\n return ForwardNodeIterator;\n }());\n LinkedList.ForwardNodeIterator = ForwardNodeIterator;\n /**\n * A reverse iterator for nodes in a linked list.\n */\n var RetroNodeIterator = /** @class */ (function () {\n /**\n * Construct a retro node iterator.\n *\n * @param node - The last node in the list.\n */\n function RetroNodeIterator(node) {\n this._node = node;\n }\n /**\n * Get an iterator over the object's values.\n *\n * @returns An iterator which yields the object's values.\n */\n RetroNodeIterator.prototype.iter = function () {\n return this;\n };\n /**\n * Create an independent clone of the iterator.\n *\n * @returns A new independent clone of the iterator.\n */\n RetroNodeIterator.prototype.clone = function () {\n return new RetroNodeIterator(this._node);\n };\n /**\n * Get the next value from the iterator.\n *\n * @returns The next value from the iterator, or `undefined`.\n */\n RetroNodeIterator.prototype.next = function () {\n if (!this._node) {\n return undefined;\n }\n var node = this._node;\n this._node = node.prev;\n return node;\n };\n return RetroNodeIterator;\n }());\n LinkedList.RetroNodeIterator = RetroNodeIterator;\n})(exports.LinkedList || (exports.LinkedList = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The internal linked list node implementation.\n */\n var LinkedListNode = /** @class */ (function () {\n /**\n * Construct a new linked list node.\n *\n * @param list - The list which owns the node.\n *\n * @param value - The value for the link.\n */\n function LinkedListNode(list, value) {\n /**\n * The linked list which created and owns the node.\n */\n this.list = null;\n /**\n * The next node in the list.\n */\n this.next = null;\n /**\n * The previous node in the list.\n */\n this.prev = null;\n this.list = list;\n this.value = value;\n }\n return LinkedListNode;\n }());\n Private.LinkedListNode = LinkedListNode;\n})(Private || (Private = {}));\n//# sourceMappingURL=linkedlist.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/collections/dist/linkedlist.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/commands/dist/index.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/commands/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/commands/dist/index.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar coreutils = __webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\nvar disposable = __webpack_require__(/*! @lumino/disposable */ \"../../packages/disposable/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * An object which manages a collection of commands.\n *\n * #### Notes\n * A command registry can be used to populate a variety of action-based\n * widgets, such as command palettes, menus, and toolbars.\n */\nexports.CommandRegistry = /** @class */ (function () {\n /**\n * Construct a new command registry.\n */\n function CommandRegistry() {\n this._timerID = 0;\n this._replaying = false;\n this._keystrokes = [];\n this._keydownEvents = [];\n this._keyBindings = [];\n this._exactKeyMatch = null;\n this._commands = Object.create(null);\n this._commandChanged = new signaling.Signal(this);\n this._commandExecuted = new signaling.Signal(this);\n this._keyBindingChanged = new signaling.Signal(this);\n }\n Object.defineProperty(CommandRegistry.prototype, \"commandChanged\", {\n /**\n * A signal emitted when a command has changed.\n *\n * #### Notes\n * This signal is useful for visual representations of commands which\n * need to refresh when the state of a relevant command has changed.\n */\n get: function () {\n return this._commandChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandRegistry.prototype, \"commandExecuted\", {\n /**\n * A signal emitted when a command has executed.\n *\n * #### Notes\n * Care should be taken when consuming this signal. It is intended to\n * be used largely for debugging and logging purposes. It should not\n * be (ab)used for general purpose spying on command execution.\n */\n get: function () {\n return this._commandExecuted;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandRegistry.prototype, \"keyBindingChanged\", {\n /**\n * A signal emitted when a key binding is changed.\n */\n get: function () {\n return this._keyBindingChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandRegistry.prototype, \"keyBindings\", {\n /**\n * A read-only array of the key bindings in the registry.\n */\n get: function () {\n return this._keyBindings;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * List the ids of the registered commands.\n *\n * @returns A new array of the registered command ids.\n */\n CommandRegistry.prototype.listCommands = function () {\n return Object.keys(this._commands);\n };\n /**\n * Test whether a specific command is registered.\n *\n * @param id - The id of the command of interest.\n *\n * @returns `true` if the command is registered, `false` otherwise.\n */\n CommandRegistry.prototype.hasCommand = function (id) {\n return id in this._commands;\n };\n /**\n * Add a command to the registry.\n *\n * @param id - The unique id of the command.\n *\n * @param options - The options for the command.\n *\n * @returns A disposable which will remove the command.\n *\n * @throws An error if the given `id` is already registered.\n */\n CommandRegistry.prototype.addCommand = function (id, options) {\n var _this = this;\n // Throw an error if the id is already registered.\n if (id in this._commands) {\n throw new Error(\"Command '\" + id + \"' already registered.\");\n }\n // Add the command to the registry.\n this._commands[id] = Private.createCommand(options);\n // Emit the `commandChanged` signal.\n this._commandChanged.emit({ id: id, type: 'added' });\n // Return a disposable which will remove the command.\n return new disposable.DisposableDelegate(function () {\n // Remove the command from the registry.\n delete _this._commands[id];\n // Emit the `commandChanged` signal.\n _this._commandChanged.emit({ id: id, type: 'removed' });\n });\n };\n /**\n * Notify listeners that the state of a command has changed.\n *\n * @param id - The id of the command which has changed. If more than\n * one command has changed, this argument should be omitted.\n *\n * @throws An error if the given `id` is not registered.\n *\n * #### Notes\n * This method should be called by the command author whenever the\n * application state changes such that the results of the command\n * metadata functions may have changed.\n *\n * This will cause the `commandChanged` signal to be emitted.\n */\n CommandRegistry.prototype.notifyCommandChanged = function (id) {\n if (id !== undefined && !(id in this._commands)) {\n throw new Error(\"Command '\" + id + \"' is not registered.\");\n }\n this._commandChanged.emit({ id: id, type: id ? 'changed' : 'many-changed' });\n };\n /**\n * Get the display label for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The display label for the command, or an empty string\n * if the command is not registered.\n */\n CommandRegistry.prototype.label = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.label.call(undefined, args) : '';\n };\n /**\n * Get the mnemonic index for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The mnemonic index for the command, or `-1` if the\n * command is not registered.\n */\n CommandRegistry.prototype.mnemonic = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.mnemonic.call(undefined, args) : -1;\n };\n /**\n * Get the icon renderer for a specific command.\n *\n * DEPRECATED: if set to a string value, the .icon field will\n * function as an alias for the .iconClass field, for backwards\n * compatibility. In the future when this is removed, the default\n * return type will become undefined.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The icon renderer for the command, or\n * an empty string if the command is not registered.\n */\n CommandRegistry.prototype.icon = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.icon.call(undefined, args) : /* */ '' /* */ /* undefined */;\n };\n /**\n * Get the icon class for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The icon class for the command, or an empty string if\n * the command is not registered.\n */\n CommandRegistry.prototype.iconClass = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.iconClass.call(undefined, args) : '';\n };\n /**\n * Get the icon label for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The icon label for the command, or an empty string if\n * the command is not registered.\n */\n CommandRegistry.prototype.iconLabel = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.iconLabel.call(undefined, args) : '';\n };\n /**\n * Get the short form caption for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The caption for the command, or an empty string if the\n * command is not registered.\n */\n CommandRegistry.prototype.caption = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.caption.call(undefined, args) : '';\n };\n /**\n * Get the usage help text for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The usage text for the command, or an empty string if\n * the command is not registered.\n */\n CommandRegistry.prototype.usage = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.usage.call(undefined, args) : '';\n };\n /**\n * Get the extra class name for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The class name for the command, or an empty string if\n * the command is not registered.\n */\n CommandRegistry.prototype.className = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.className.call(undefined, args) : '';\n };\n /**\n * Get the dataset for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The dataset for the command, or an empty dataset if\n * the command is not registered.\n */\n CommandRegistry.prototype.dataset = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.dataset.call(undefined, args) : {};\n };\n /**\n * Test whether a specific command is enabled.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is enabled,\n * or `false` if the command is not registered.\n */\n CommandRegistry.prototype.isEnabled = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.isEnabled.call(undefined, args) : false;\n };\n /**\n * Test whether a specific command is toggled.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is toggled,\n * or `false` if the command is not registered.\n */\n CommandRegistry.prototype.isToggled = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.isToggled.call(undefined, args) : false;\n };\n /**\n * Test whether a specific command is visible.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is visible,\n * or `false` if the command is not registered.\n */\n CommandRegistry.prototype.isVisible = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.isVisible.call(undefined, args) : false;\n };\n /**\n * Execute a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A promise which resolves with the result of the command.\n *\n * #### Notes\n * The promise will reject if the command throws an exception,\n * or if the command is not registered.\n */\n CommandRegistry.prototype.execute = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n // Reject if the command is not registered.\n var cmd = this._commands[id];\n if (!cmd) {\n return Promise.reject(new Error(\"Command '\" + id + \"' not registered.\"));\n }\n // Execute the command and reject if an exception is thrown.\n var value;\n try {\n value = cmd.execute.call(undefined, args);\n }\n catch (err) {\n value = Promise.reject(err);\n }\n // Create the return promise which resolves the result.\n var result = Promise.resolve(value);\n // Emit the command executed signal.\n this._commandExecuted.emit({ id: id, args: args, result: result });\n // Return the result promise to the caller.\n return result;\n };\n /**\n * Add a key binding to the registry.\n *\n * @param options - The options for creating the key binding.\n *\n * @returns A disposable which removes the added key binding.\n *\n * #### Notes\n * If multiple key bindings are registered for the same sequence, the\n * binding with the highest selector specificity is executed first. A\n * tie is broken by using the most recently added key binding.\n *\n * Ambiguous key bindings are resolved with a timeout. As an example,\n * suppose two key bindings are registered: one with the key sequence\n * `['Ctrl D']`, and another with `['Ctrl D', 'Ctrl W']`. If the user\n * presses `Ctrl D`, the first binding cannot be immediately executed\n * since the user may intend to complete the chord with `Ctrl W`. For\n * such cases, a timer is used to allow the chord to be completed. If\n * the chord is not completed before the timeout, the first binding\n * is executed.\n */\n CommandRegistry.prototype.addKeyBinding = function (options) {\n var _this = this;\n // Create the binding for the given options.\n var binding = Private.createKeyBinding(options);\n // Add the key binding to the bindings array.\n this._keyBindings.push(binding);\n // Emit the `bindingChanged` signal.\n this._keyBindingChanged.emit({ binding: binding, type: 'added' });\n // Return a disposable which will remove the binding.\n return new disposable.DisposableDelegate(function () {\n // Remove the binding from the array.\n algorithm.ArrayExt.removeFirstOf(_this._keyBindings, binding);\n // Emit the `bindingChanged` signal.\n _this._keyBindingChanged.emit({ binding: binding, type: 'removed' });\n });\n };\n /**\n * Process a `'keydown'` event and invoke a matching key binding.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * #### Notes\n * This should be called in response to a `'keydown'` event in order\n * to invoke the command for the best matching key binding.\n *\n * The registry **does not** install its own listener for `'keydown'`\n * events. This allows the application full control over the nodes\n * and phase for which the registry processes `'keydown'` events.\n *\n * When the keydown event is processed, if the event target or any of its\n * ancestor nodes has a `data-lm-suppress-shortcuts` attribute, its keydown\n * events will not invoke commands.\n */\n CommandRegistry.prototype.processKeydownEvent = function (event) {\n // Bail immediately if playing back keystrokes.\n if (this._replaying) {\n return;\n }\n // Get the normalized keystroke for the event.\n var keystroke = CommandRegistry.keystrokeForKeydownEvent(event);\n // If the keystroke is not valid for the keyboard layout, replay\n // any suppressed events and clear the pending state.\n if (!keystroke) {\n this._replayKeydownEvents();\n this._clearPendingState();\n return;\n }\n // Add the keystroke to the current key sequence.\n this._keystrokes.push(keystroke);\n // Find the exact and partial matches for the key sequence.\n var _a = Private.matchKeyBinding(this._keyBindings, this._keystrokes, event), exact = _a.exact, partial = _a.partial;\n // If there is no exact match and no partial match, replay\n // any suppressed events and clear the pending state.\n if (!exact && !partial) {\n this._replayKeydownEvents();\n this._clearPendingState();\n return;\n }\n // Stop propagation of the event. If there is only a partial match,\n // the event will be replayed if a final exact match never occurs.\n event.preventDefault();\n event.stopPropagation();\n // If there is an exact match but no partial match, the exact match\n // can be dispatched immediately. The pending state is cleared so\n // the next key press starts from the default state.\n if (exact && !partial) {\n this._executeKeyBinding(exact);\n this._clearPendingState();\n return;\n }\n // If there is both an exact match and a partial match, the exact\n // match is stored for future dispatch in case the timer expires\n // before a more specific match is triggered.\n if (exact) {\n this._exactKeyMatch = exact;\n }\n // Store the event for possible playback in the future.\n this._keydownEvents.push(event);\n // (Re)start the timer to dispatch the most recent exact match\n // in case the partial match fails to result in an exact match.\n this._startTimer();\n };\n /**\n * Start or restart the pending timeout.\n */\n CommandRegistry.prototype._startTimer = function () {\n var _this = this;\n this._clearTimer();\n this._timerID = window.setTimeout(function () {\n _this._onPendingTimeout();\n }, Private.CHORD_TIMEOUT);\n };\n /**\n * Clear the pending timeout.\n */\n CommandRegistry.prototype._clearTimer = function () {\n if (this._timerID !== 0) {\n clearTimeout(this._timerID);\n this._timerID = 0;\n }\n };\n /**\n * Replay the keydown events which were suppressed.\n */\n CommandRegistry.prototype._replayKeydownEvents = function () {\n if (this._keydownEvents.length === 0) {\n return;\n }\n this._replaying = true;\n this._keydownEvents.forEach(Private.replayKeyEvent);\n this._replaying = false;\n };\n /**\n * Execute the command for the given key binding.\n *\n * If the command is missing or disabled, a warning will be logged.\n */\n CommandRegistry.prototype._executeKeyBinding = function (binding) {\n var command = binding.command, args = binding.args;\n if (!this.hasCommand(command) || !this.isEnabled(command, args)) {\n var word = this.hasCommand(command) ? 'enabled' : 'registered';\n var keys = binding.keys.join(', ');\n var msg1 = \"Cannot execute key binding '\" + keys + \"':\";\n var msg2 = \"command '\" + command + \"' is not \" + word + \".\";\n console.warn(msg1 + \" \" + msg2);\n return;\n }\n this.execute(command, args);\n };\n /**\n * Clear the internal pending state.\n */\n CommandRegistry.prototype._clearPendingState = function () {\n this._clearTimer();\n this._exactKeyMatch = null;\n this._keystrokes.length = 0;\n this._keydownEvents.length = 0;\n };\n /**\n * Handle the partial match timeout.\n */\n CommandRegistry.prototype._onPendingTimeout = function () {\n this._timerID = 0;\n if (this._exactKeyMatch) {\n this._executeKeyBinding(this._exactKeyMatch);\n }\n else {\n this._replayKeydownEvents();\n }\n this._clearPendingState();\n };\n return CommandRegistry;\n}());\n/**\n * The namespace for the `CommandRegistry` class statics.\n */\n(function (CommandRegistry) {\n /**\n * Parse a keystroke into its constituent components.\n *\n * @param keystroke - The keystroke of interest.\n *\n * @returns The parsed components of the keystroke.\n *\n * #### Notes\n * The keystroke should be of the form:\n * `[ [ [ ]]]`\n *\n * The supported modifiers are: `Accel`, `Alt`, `Cmd`, `Ctrl`, and\n * `Shift`. The `Accel` modifier is translated to `Cmd` on Mac and\n * `Ctrl` on all other platforms.\n *\n * The parsing is tolerant and will not throw exceptions. Notably:\n * - Duplicate modifiers are ignored.\n * - Extra primary keys are ignored.\n * - The order of modifiers and primary key is irrelevant.\n * - The keystroke parts should be separated by whitespace.\n * - The keystroke is case sensitive.\n */\n function parseKeystroke(keystroke) {\n var key = '';\n var alt = false;\n var cmd = false;\n var ctrl = false;\n var shift = false;\n for (var _i = 0, _a = keystroke.split(/\\s+/); _i < _a.length; _i++) {\n var token = _a[_i];\n if (token === 'Accel') {\n if (domutils.Platform.IS_MAC) {\n cmd = true;\n }\n else {\n ctrl = true;\n }\n }\n else if (token === 'Alt') {\n alt = true;\n }\n else if (token === 'Cmd') {\n cmd = true;\n }\n else if (token === 'Ctrl') {\n ctrl = true;\n }\n else if (token === 'Shift') {\n shift = true;\n }\n else if (token.length > 0) {\n key = token;\n }\n }\n return { cmd: cmd, ctrl: ctrl, alt: alt, shift: shift, key: key };\n }\n CommandRegistry.parseKeystroke = parseKeystroke;\n /**\n * Normalize a keystroke into a canonical representation.\n *\n * @param keystroke - The keystroke of interest.\n *\n * @returns The normalized representation of the keystroke.\n *\n * #### Notes\n * This normalizes the keystroke by removing duplicate modifiers and\n * extra primary keys, and assembling the parts in a canonical order.\n *\n * The `Cmd` modifier is ignored on non-Mac platforms.\n */\n function normalizeKeystroke(keystroke) {\n var mods = '';\n var parts = parseKeystroke(keystroke);\n if (parts.ctrl) {\n mods += 'Ctrl ';\n }\n if (parts.alt) {\n mods += 'Alt ';\n }\n if (parts.shift) {\n mods += 'Shift ';\n }\n if (parts.cmd && domutils.Platform.IS_MAC) {\n mods += 'Cmd ';\n }\n return mods + parts.key;\n }\n CommandRegistry.normalizeKeystroke = normalizeKeystroke;\n /**\n * Get the platform-specific normalized keys for an options object.\n *\n * @param options - The options for the key binding.\n *\n * @returns Array of combined, normalized keys.\n */\n function normalizeKeys(options) {\n var keys;\n if (domutils.Platform.IS_WIN) {\n keys = options.winKeys || options.keys;\n }\n else if (domutils.Platform.IS_MAC) {\n keys = options.macKeys || options.keys;\n }\n else {\n keys = options.linuxKeys || options.keys;\n }\n return keys.map(normalizeKeystroke);\n }\n CommandRegistry.normalizeKeys = normalizeKeys;\n /**\n * Format a keystroke for display on the local system.\n */\n function formatKeystroke(keystroke) {\n var mods = '';\n var parts = parseKeystroke(keystroke);\n if (domutils.Platform.IS_MAC) {\n if (parts.ctrl) {\n mods += '\\u2303 ';\n }\n if (parts.alt) {\n mods += '\\u2325 ';\n }\n if (parts.shift) {\n mods += '\\u21E7 ';\n }\n if (parts.cmd) {\n mods += '\\u2318 ';\n }\n }\n else {\n if (parts.ctrl) {\n mods += 'Ctrl+';\n }\n if (parts.alt) {\n mods += 'Alt+';\n }\n if (parts.shift) {\n mods += 'Shift+';\n }\n }\n return mods + parts.key;\n }\n CommandRegistry.formatKeystroke = formatKeystroke;\n /**\n * Create a normalized keystroke for a `'keydown'` event.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * @returns A normalized keystroke, or an empty string if the event\n * does not represent a valid keystroke for the given layout.\n */\n function keystrokeForKeydownEvent(event) {\n var key = keyboard.getKeyboardLayout().keyForKeydownEvent(event);\n if (!key) {\n return '';\n }\n var mods = '';\n if (event.ctrlKey) {\n mods += 'Ctrl ';\n }\n if (event.altKey) {\n mods += 'Alt ';\n }\n if (event.shiftKey) {\n mods += 'Shift ';\n }\n if (event.metaKey && domutils.Platform.IS_MAC) {\n mods += 'Cmd ';\n }\n return mods + key;\n }\n CommandRegistry.keystrokeForKeydownEvent = keystrokeForKeydownEvent;\n})(exports.CommandRegistry || (exports.CommandRegistry = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The timeout in ms for triggering a key binding chord.\n */\n Private.CHORD_TIMEOUT = 1000;\n /**\n * Create a normalized command from an options object.\n */\n function createCommand(options) {\n var icon;\n var iconClass;\n /* */\n if (!(options.icon) || typeof options.icon === 'string') {\n // alias icon to iconClass\n iconClass = asFunc(options.iconClass || options.icon, emptyStringFunc);\n icon = iconClass;\n }\n else {\n /* / */\n iconClass = asFunc(options.iconClass, emptyStringFunc);\n icon = asFunc(options.icon, undefinedFunc);\n /* */\n }\n /* */\n return {\n execute: options.execute,\n label: asFunc(options.label, emptyStringFunc),\n mnemonic: asFunc(options.mnemonic, negativeOneFunc),\n icon: icon,\n iconClass: iconClass,\n iconLabel: asFunc(options.iconLabel, emptyStringFunc),\n caption: asFunc(options.caption, emptyStringFunc),\n usage: asFunc(options.usage, emptyStringFunc),\n className: asFunc(options.className, emptyStringFunc),\n dataset: asFunc(options.dataset, emptyDatasetFunc),\n isEnabled: options.isEnabled || trueFunc,\n isToggled: options.isToggled || falseFunc,\n isVisible: options.isVisible || trueFunc\n };\n }\n Private.createCommand = createCommand;\n /**\n * Create a key binding object from key binding options.\n */\n function createKeyBinding(options) {\n return {\n keys: exports.CommandRegistry.normalizeKeys(options),\n selector: validateSelector(options),\n command: options.command,\n args: options.args || coreutils.JSONExt.emptyObject\n };\n }\n Private.createKeyBinding = createKeyBinding;\n /**\n * Find the key bindings which match a key sequence.\n *\n * This returns a match result which contains the best exact matching\n * binding, and a flag which indicates if there are partial matches.\n */\n function matchKeyBinding(bindings, keys, event) {\n // The current best exact match.\n var exact = null;\n // Whether a partial match has been found.\n var partial = false;\n // The match distance for the exact match.\n var distance = Infinity;\n // The specificity for the exact match.\n var specificity = 0;\n // Iterate over the bindings and search for the best match.\n for (var i = 0, n = bindings.length; i < n; ++i) {\n // Lookup the current binding.\n var binding = bindings[i];\n // Check whether the key binding sequence is a match.\n var sqm = matchSequence(binding.keys, keys);\n // If there is no match, the binding is ignored.\n if (sqm === 0 /* None */) {\n continue;\n }\n // If it is a partial match and no other partial match has been\n // found, ensure the selector matches and set the partial flag.\n if (sqm === 2 /* Partial */) {\n if (!partial && targetDistance(binding.selector, event) !== -1) {\n partial = true;\n }\n continue;\n }\n // Ignore the match if the selector doesn't match, or if the\n // matched node is farther away than the current best match.\n var td = targetDistance(binding.selector, event);\n if (td === -1 || td > distance) {\n continue;\n }\n // Get the specificity for the selector.\n var sp = domutils.Selector.calculateSpecificity(binding.selector);\n // Update the best match if this match is stronger.\n if (!exact || td < distance || sp >= specificity) {\n exact = binding;\n distance = td;\n specificity = sp;\n }\n }\n // Return the match result.\n return { exact: exact, partial: partial };\n }\n Private.matchKeyBinding = matchKeyBinding;\n /**\n * Replay a keyboard event.\n *\n * This synthetically dispatches a clone of the keyboard event.\n */\n function replayKeyEvent(event) {\n event.target.dispatchEvent(cloneKeyboardEvent(event));\n }\n Private.replayKeyEvent = replayKeyEvent;\n /**\n * A singleton empty string function.\n */\n var emptyStringFunc = function () { return ''; };\n /**\n * A singleton `-1` number function\n */\n var negativeOneFunc = function () { return -1; };\n /**\n * A singleton true boolean function.\n */\n var trueFunc = function () { return true; };\n /**\n * A singleton false boolean function.\n */\n var falseFunc = function () { return false; };\n /**\n * A singleton empty dataset function.\n */\n var emptyDatasetFunc = function () { return ({}); };\n /**\n * A singleton undefined function\n */\n var undefinedFunc = function () { return undefined; };\n /**\n * Cast a value or command func to a command func.\n */\n function asFunc(value, dfault) {\n if (value === undefined) {\n return dfault;\n }\n if (typeof value === 'function') {\n return value;\n }\n return function () { return value; };\n }\n /**\n * Validate the selector for an options object.\n *\n * This returns the validated selector, or throws if the selector is\n * invalid or contains commas.\n */\n function validateSelector(options) {\n if (options.selector.indexOf(',') !== -1) {\n throw new Error(\"Selector cannot contain commas: \" + options.selector);\n }\n if (!domutils.Selector.isValid(options.selector)) {\n throw new Error(\"Invalid selector: \" + options.selector);\n }\n return options.selector;\n }\n /**\n * Test whether a key binding sequence matches a key sequence.\n *\n * Returns a `SequenceMatch` value indicating the type of match.\n */\n function matchSequence(bindKeys, userKeys) {\n if (bindKeys.length < userKeys.length) {\n return 0 /* None */;\n }\n for (var i = 0, n = userKeys.length; i < n; ++i) {\n if (bindKeys[i] !== userKeys[i]) {\n return 0 /* None */;\n }\n }\n if (bindKeys.length > userKeys.length) {\n return 2 /* Partial */;\n }\n return 1 /* Exact */;\n }\n /**\n * Find the distance from the target node to the first matching node.\n *\n * This traverses the event path from `target` to `currentTarget` and\n * computes the distance from `target` to the first node which matches\n * the CSS selector. If no match is found, `-1` is returned.\n */\n function targetDistance(selector, event) {\n var targ = event.target;\n var curr = event.currentTarget;\n for (var dist = 0; targ !== null; targ = targ.parentElement, ++dist) {\n if (targ.hasAttribute('data-lm-suppress-shortcuts')) {\n return -1;\n }\n /* */\n if (targ.hasAttribute('data-p-suppress-shortcuts')) {\n return -1;\n }\n /* */\n if (domutils.Selector.matches(targ, selector)) {\n return dist;\n }\n if (targ === curr) {\n return -1;\n }\n }\n return -1;\n }\n /**\n * Clone a keyboard event.\n */\n function cloneKeyboardEvent(event) {\n // A custom event is required because Chrome nulls out the\n // `keyCode` field in user-generated `KeyboardEvent` types.\n var clone = document.createEvent('Event');\n var bubbles = event.bubbles || true;\n var cancelable = event.cancelable || true;\n clone.initEvent(event.type || 'keydown', bubbles, cancelable);\n clone.key = event.key || '';\n clone.keyCode = event.keyCode || 0;\n clone.which = event.keyCode || 0;\n clone.ctrlKey = event.ctrlKey || false;\n clone.altKey = event.altKey || false;\n clone.shiftKey = event.shiftKey || false;\n clone.metaKey = event.metaKey || false;\n clone.view = event.view || window;\n return clone;\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/commands/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar coreutils = __webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\nvar disposable = __webpack_require__(/*! @lumino/disposable */ \"../../packages/disposable/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * An object which manages a collection of commands.\n *\n * #### Notes\n * A command registry can be used to populate a variety of action-based\n * widgets, such as command palettes, menus, and toolbars.\n */\nexports.CommandRegistry = /** @class */ (function () {\n /**\n * Construct a new command registry.\n */\n function CommandRegistry() {\n this._timerID = 0;\n this._replaying = false;\n this._keystrokes = [];\n this._keydownEvents = [];\n this._keyBindings = [];\n this._exactKeyMatch = null;\n this._commands = Object.create(null);\n this._commandChanged = new signaling.Signal(this);\n this._commandExecuted = new signaling.Signal(this);\n this._keyBindingChanged = new signaling.Signal(this);\n }\n Object.defineProperty(CommandRegistry.prototype, \"commandChanged\", {\n /**\n * A signal emitted when a command has changed.\n *\n * #### Notes\n * This signal is useful for visual representations of commands which\n * need to refresh when the state of a relevant command has changed.\n */\n get: function () {\n return this._commandChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandRegistry.prototype, \"commandExecuted\", {\n /**\n * A signal emitted when a command has executed.\n *\n * #### Notes\n * Care should be taken when consuming this signal. It is intended to\n * be used largely for debugging and logging purposes. It should not\n * be (ab)used for general purpose spying on command execution.\n */\n get: function () {\n return this._commandExecuted;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandRegistry.prototype, \"keyBindingChanged\", {\n /**\n * A signal emitted when a key binding is changed.\n */\n get: function () {\n return this._keyBindingChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandRegistry.prototype, \"keyBindings\", {\n /**\n * A read-only array of the key bindings in the registry.\n */\n get: function () {\n return this._keyBindings;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * List the ids of the registered commands.\n *\n * @returns A new array of the registered command ids.\n */\n CommandRegistry.prototype.listCommands = function () {\n return Object.keys(this._commands);\n };\n /**\n * Test whether a specific command is registered.\n *\n * @param id - The id of the command of interest.\n *\n * @returns `true` if the command is registered, `false` otherwise.\n */\n CommandRegistry.prototype.hasCommand = function (id) {\n return id in this._commands;\n };\n /**\n * Add a command to the registry.\n *\n * @param id - The unique id of the command.\n *\n * @param options - The options for the command.\n *\n * @returns A disposable which will remove the command.\n *\n * @throws An error if the given `id` is already registered.\n */\n CommandRegistry.prototype.addCommand = function (id, options) {\n var _this = this;\n // Throw an error if the id is already registered.\n if (id in this._commands) {\n throw new Error(\"Command '\" + id + \"' already registered.\");\n }\n // Add the command to the registry.\n this._commands[id] = Private.createCommand(options);\n // Emit the `commandChanged` signal.\n this._commandChanged.emit({ id: id, type: 'added' });\n // Return a disposable which will remove the command.\n return new disposable.DisposableDelegate(function () {\n // Remove the command from the registry.\n delete _this._commands[id];\n // Emit the `commandChanged` signal.\n _this._commandChanged.emit({ id: id, type: 'removed' });\n });\n };\n /**\n * Notify listeners that the state of a command has changed.\n *\n * @param id - The id of the command which has changed. If more than\n * one command has changed, this argument should be omitted.\n *\n * @throws An error if the given `id` is not registered.\n *\n * #### Notes\n * This method should be called by the command author whenever the\n * application state changes such that the results of the command\n * metadata functions may have changed.\n *\n * This will cause the `commandChanged` signal to be emitted.\n */\n CommandRegistry.prototype.notifyCommandChanged = function (id) {\n if (id !== undefined && !(id in this._commands)) {\n throw new Error(\"Command '\" + id + \"' is not registered.\");\n }\n this._commandChanged.emit({ id: id, type: id ? 'changed' : 'many-changed' });\n };\n /**\n * Get the display label for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The display label for the command, or an empty string\n * if the command is not registered.\n */\n CommandRegistry.prototype.label = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.label.call(undefined, args) : '';\n };\n /**\n * Get the mnemonic index for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The mnemonic index for the command, or `-1` if the\n * command is not registered.\n */\n CommandRegistry.prototype.mnemonic = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.mnemonic.call(undefined, args) : -1;\n };\n /**\n * Get the icon renderer for a specific command.\n *\n * DEPRECATED: if set to a string value, the .icon field will\n * function as an alias for the .iconClass field, for backwards\n * compatibility. In the future when this is removed, the default\n * return type will become undefined.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The icon renderer for the command, or\n * an empty string if the command is not registered.\n */\n CommandRegistry.prototype.icon = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.icon.call(undefined, args) : /* */ '' /* */ /* undefined */;\n };\n /**\n * Get the icon class for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The icon class for the command, or an empty string if\n * the command is not registered.\n */\n CommandRegistry.prototype.iconClass = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.iconClass.call(undefined, args) : '';\n };\n /**\n * Get the icon label for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The icon label for the command, or an empty string if\n * the command is not registered.\n */\n CommandRegistry.prototype.iconLabel = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.iconLabel.call(undefined, args) : '';\n };\n /**\n * Get the short form caption for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The caption for the command, or an empty string if the\n * command is not registered.\n */\n CommandRegistry.prototype.caption = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.caption.call(undefined, args) : '';\n };\n /**\n * Get the usage help text for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The usage text for the command, or an empty string if\n * the command is not registered.\n */\n CommandRegistry.prototype.usage = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.usage.call(undefined, args) : '';\n };\n /**\n * Get the extra class name for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The class name for the command, or an empty string if\n * the command is not registered.\n */\n CommandRegistry.prototype.className = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.className.call(undefined, args) : '';\n };\n /**\n * Get the dataset for a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns The dataset for the command, or an empty dataset if\n * the command is not registered.\n */\n CommandRegistry.prototype.dataset = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.dataset.call(undefined, args) : {};\n };\n /**\n * Test whether a specific command is enabled.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is enabled,\n * or `false` if the command is not registered.\n */\n CommandRegistry.prototype.isEnabled = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.isEnabled.call(undefined, args) : false;\n };\n /**\n * Test whether a specific command is toggled.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is toggled,\n * or `false` if the command is not registered.\n */\n CommandRegistry.prototype.isToggled = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.isToggled.call(undefined, args) : false;\n };\n /**\n * Test whether a specific command is visible.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A boolean indicating whether the command is visible,\n * or `false` if the command is not registered.\n */\n CommandRegistry.prototype.isVisible = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n var cmd = this._commands[id];\n return cmd ? cmd.isVisible.call(undefined, args) : false;\n };\n /**\n * Execute a specific command.\n *\n * @param id - The id of the command of interest.\n *\n * @param args - The arguments for the command.\n *\n * @returns A promise which resolves with the result of the command.\n *\n * #### Notes\n * The promise will reject if the command throws an exception,\n * or if the command is not registered.\n */\n CommandRegistry.prototype.execute = function (id, args) {\n if (args === void 0) { args = coreutils.JSONExt.emptyObject; }\n // Reject if the command is not registered.\n var cmd = this._commands[id];\n if (!cmd) {\n return Promise.reject(new Error(\"Command '\" + id + \"' not registered.\"));\n }\n // Execute the command and reject if an exception is thrown.\n var value;\n try {\n value = cmd.execute.call(undefined, args);\n }\n catch (err) {\n value = Promise.reject(err);\n }\n // Create the return promise which resolves the result.\n var result = Promise.resolve(value);\n // Emit the command executed signal.\n this._commandExecuted.emit({ id: id, args: args, result: result });\n // Return the result promise to the caller.\n return result;\n };\n /**\n * Add a key binding to the registry.\n *\n * @param options - The options for creating the key binding.\n *\n * @returns A disposable which removes the added key binding.\n *\n * #### Notes\n * If multiple key bindings are registered for the same sequence, the\n * binding with the highest selector specificity is executed first. A\n * tie is broken by using the most recently added key binding.\n *\n * Ambiguous key bindings are resolved with a timeout. As an example,\n * suppose two key bindings are registered: one with the key sequence\n * `['Ctrl D']`, and another with `['Ctrl D', 'Ctrl W']`. If the user\n * presses `Ctrl D`, the first binding cannot be immediately executed\n * since the user may intend to complete the chord with `Ctrl W`. For\n * such cases, a timer is used to allow the chord to be completed. If\n * the chord is not completed before the timeout, the first binding\n * is executed.\n */\n CommandRegistry.prototype.addKeyBinding = function (options) {\n var _this = this;\n // Create the binding for the given options.\n var binding = Private.createKeyBinding(options);\n // Add the key binding to the bindings array.\n this._keyBindings.push(binding);\n // Emit the `bindingChanged` signal.\n this._keyBindingChanged.emit({ binding: binding, type: 'added' });\n // Return a disposable which will remove the binding.\n return new disposable.DisposableDelegate(function () {\n // Remove the binding from the array.\n algorithm.ArrayExt.removeFirstOf(_this._keyBindings, binding);\n // Emit the `bindingChanged` signal.\n _this._keyBindingChanged.emit({ binding: binding, type: 'removed' });\n });\n };\n /**\n * Process a `'keydown'` event and invoke a matching key binding.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * #### Notes\n * This should be called in response to a `'keydown'` event in order\n * to invoke the command for the best matching key binding.\n *\n * The registry **does not** install its own listener for `'keydown'`\n * events. This allows the application full control over the nodes\n * and phase for which the registry processes `'keydown'` events.\n *\n * When the keydown event is processed, if the event target or any of its\n * ancestor nodes has a `data-lm-suppress-shortcuts` attribute, its keydown\n * events will not invoke commands.\n */\n CommandRegistry.prototype.processKeydownEvent = function (event) {\n // Bail immediately if playing back keystrokes.\n if (this._replaying) {\n return;\n }\n // Get the normalized keystroke for the event.\n var keystroke = CommandRegistry.keystrokeForKeydownEvent(event);\n // If the keystroke is not valid for the keyboard layout, replay\n // any suppressed events and clear the pending state.\n if (!keystroke) {\n this._replayKeydownEvents();\n this._clearPendingState();\n return;\n }\n // Add the keystroke to the current key sequence.\n this._keystrokes.push(keystroke);\n // Find the exact and partial matches for the key sequence.\n var _a = Private.matchKeyBinding(this._keyBindings, this._keystrokes, event), exact = _a.exact, partial = _a.partial;\n // If there is no exact match and no partial match, replay\n // any suppressed events and clear the pending state.\n if (!exact && !partial) {\n this._replayKeydownEvents();\n this._clearPendingState();\n return;\n }\n // Stop propagation of the event. If there is only a partial match,\n // the event will be replayed if a final exact match never occurs.\n event.preventDefault();\n event.stopPropagation();\n // If there is an exact match but no partial match, the exact match\n // can be dispatched immediately. The pending state is cleared so\n // the next key press starts from the default state.\n if (exact && !partial) {\n this._executeKeyBinding(exact);\n this._clearPendingState();\n return;\n }\n // If there is both an exact match and a partial match, the exact\n // match is stored for future dispatch in case the timer expires\n // before a more specific match is triggered.\n if (exact) {\n this._exactKeyMatch = exact;\n }\n // Store the event for possible playback in the future.\n this._keydownEvents.push(event);\n // (Re)start the timer to dispatch the most recent exact match\n // in case the partial match fails to result in an exact match.\n this._startTimer();\n };\n /**\n * Start or restart the pending timeout.\n */\n CommandRegistry.prototype._startTimer = function () {\n var _this = this;\n this._clearTimer();\n this._timerID = window.setTimeout(function () {\n _this._onPendingTimeout();\n }, Private.CHORD_TIMEOUT);\n };\n /**\n * Clear the pending timeout.\n */\n CommandRegistry.prototype._clearTimer = function () {\n if (this._timerID !== 0) {\n clearTimeout(this._timerID);\n this._timerID = 0;\n }\n };\n /**\n * Replay the keydown events which were suppressed.\n */\n CommandRegistry.prototype._replayKeydownEvents = function () {\n if (this._keydownEvents.length === 0) {\n return;\n }\n this._replaying = true;\n this._keydownEvents.forEach(Private.replayKeyEvent);\n this._replaying = false;\n };\n /**\n * Execute the command for the given key binding.\n *\n * If the command is missing or disabled, a warning will be logged.\n */\n CommandRegistry.prototype._executeKeyBinding = function (binding) {\n var command = binding.command, args = binding.args;\n if (!this.hasCommand(command) || !this.isEnabled(command, args)) {\n var word = this.hasCommand(command) ? 'enabled' : 'registered';\n var keys = binding.keys.join(', ');\n var msg1 = \"Cannot execute key binding '\" + keys + \"':\";\n var msg2 = \"command '\" + command + \"' is not \" + word + \".\";\n console.warn(msg1 + \" \" + msg2);\n return;\n }\n this.execute(command, args);\n };\n /**\n * Clear the internal pending state.\n */\n CommandRegistry.prototype._clearPendingState = function () {\n this._clearTimer();\n this._exactKeyMatch = null;\n this._keystrokes.length = 0;\n this._keydownEvents.length = 0;\n };\n /**\n * Handle the partial match timeout.\n */\n CommandRegistry.prototype._onPendingTimeout = function () {\n this._timerID = 0;\n if (this._exactKeyMatch) {\n this._executeKeyBinding(this._exactKeyMatch);\n }\n else {\n this._replayKeydownEvents();\n }\n this._clearPendingState();\n };\n return CommandRegistry;\n}());\n/**\n * The namespace for the `CommandRegistry` class statics.\n */\n(function (CommandRegistry) {\n /**\n * Parse a keystroke into its constituent components.\n *\n * @param keystroke - The keystroke of interest.\n *\n * @returns The parsed components of the keystroke.\n *\n * #### Notes\n * The keystroke should be of the form:\n * `[ [ [ ]]]`\n *\n * The supported modifiers are: `Accel`, `Alt`, `Cmd`, `Ctrl`, and\n * `Shift`. The `Accel` modifier is translated to `Cmd` on Mac and\n * `Ctrl` on all other platforms.\n *\n * The parsing is tolerant and will not throw exceptions. Notably:\n * - Duplicate modifiers are ignored.\n * - Extra primary keys are ignored.\n * - The order of modifiers and primary key is irrelevant.\n * - The keystroke parts should be separated by whitespace.\n * - The keystroke is case sensitive.\n */\n function parseKeystroke(keystroke) {\n var key = '';\n var alt = false;\n var cmd = false;\n var ctrl = false;\n var shift = false;\n for (var _i = 0, _a = keystroke.split(/\\s+/); _i < _a.length; _i++) {\n var token = _a[_i];\n if (token === 'Accel') {\n if (domutils.Platform.IS_MAC) {\n cmd = true;\n }\n else {\n ctrl = true;\n }\n }\n else if (token === 'Alt') {\n alt = true;\n }\n else if (token === 'Cmd') {\n cmd = true;\n }\n else if (token === 'Ctrl') {\n ctrl = true;\n }\n else if (token === 'Shift') {\n shift = true;\n }\n else if (token.length > 0) {\n key = token;\n }\n }\n return { cmd: cmd, ctrl: ctrl, alt: alt, shift: shift, key: key };\n }\n CommandRegistry.parseKeystroke = parseKeystroke;\n /**\n * Normalize a keystroke into a canonical representation.\n *\n * @param keystroke - The keystroke of interest.\n *\n * @returns The normalized representation of the keystroke.\n *\n * #### Notes\n * This normalizes the keystroke by removing duplicate modifiers and\n * extra primary keys, and assembling the parts in a canonical order.\n *\n * The `Cmd` modifier is ignored on non-Mac platforms.\n */\n function normalizeKeystroke(keystroke) {\n var mods = '';\n var parts = parseKeystroke(keystroke);\n if (parts.ctrl) {\n mods += 'Ctrl ';\n }\n if (parts.alt) {\n mods += 'Alt ';\n }\n if (parts.shift) {\n mods += 'Shift ';\n }\n if (parts.cmd && domutils.Platform.IS_MAC) {\n mods += 'Cmd ';\n }\n return mods + parts.key;\n }\n CommandRegistry.normalizeKeystroke = normalizeKeystroke;\n /**\n * Get the platform-specific normalized keys for an options object.\n *\n * @param options - The options for the key binding.\n *\n * @returns Array of combined, normalized keys.\n */\n function normalizeKeys(options) {\n var keys;\n if (domutils.Platform.IS_WIN) {\n keys = options.winKeys || options.keys;\n }\n else if (domutils.Platform.IS_MAC) {\n keys = options.macKeys || options.keys;\n }\n else {\n keys = options.linuxKeys || options.keys;\n }\n return keys.map(normalizeKeystroke);\n }\n CommandRegistry.normalizeKeys = normalizeKeys;\n /**\n * Format a keystroke for display on the local system.\n */\n function formatKeystroke(keystroke) {\n var mods = '';\n var parts = parseKeystroke(keystroke);\n if (domutils.Platform.IS_MAC) {\n if (parts.ctrl) {\n mods += '\\u2303 ';\n }\n if (parts.alt) {\n mods += '\\u2325 ';\n }\n if (parts.shift) {\n mods += '\\u21E7 ';\n }\n if (parts.cmd) {\n mods += '\\u2318 ';\n }\n }\n else {\n if (parts.ctrl) {\n mods += 'Ctrl+';\n }\n if (parts.alt) {\n mods += 'Alt+';\n }\n if (parts.shift) {\n mods += 'Shift+';\n }\n }\n return mods + parts.key;\n }\n CommandRegistry.formatKeystroke = formatKeystroke;\n /**\n * Create a normalized keystroke for a `'keydown'` event.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * @returns A normalized keystroke, or an empty string if the event\n * does not represent a valid keystroke for the given layout.\n */\n function keystrokeForKeydownEvent(event) {\n var key = keyboard.getKeyboardLayout().keyForKeydownEvent(event);\n if (!key) {\n return '';\n }\n var mods = '';\n if (event.ctrlKey) {\n mods += 'Ctrl ';\n }\n if (event.altKey) {\n mods += 'Alt ';\n }\n if (event.shiftKey) {\n mods += 'Shift ';\n }\n if (event.metaKey && domutils.Platform.IS_MAC) {\n mods += 'Cmd ';\n }\n return mods + key;\n }\n CommandRegistry.keystrokeForKeydownEvent = keystrokeForKeydownEvent;\n})(exports.CommandRegistry || (exports.CommandRegistry = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The timeout in ms for triggering a key binding chord.\n */\n Private.CHORD_TIMEOUT = 1000;\n /**\n * Create a normalized command from an options object.\n */\n function createCommand(options) {\n var icon;\n var iconClass;\n /* */\n if (!(options.icon) || typeof options.icon === 'string') {\n // alias icon to iconClass\n iconClass = asFunc(options.iconClass || options.icon, emptyStringFunc);\n icon = iconClass;\n }\n else {\n /* / */\n iconClass = asFunc(options.iconClass, emptyStringFunc);\n icon = asFunc(options.icon, undefinedFunc);\n /* */\n }\n /* */\n return {\n execute: options.execute,\n label: asFunc(options.label, emptyStringFunc),\n mnemonic: asFunc(options.mnemonic, negativeOneFunc),\n icon: icon,\n iconClass: iconClass,\n iconLabel: asFunc(options.iconLabel, emptyStringFunc),\n caption: asFunc(options.caption, emptyStringFunc),\n usage: asFunc(options.usage, emptyStringFunc),\n className: asFunc(options.className, emptyStringFunc),\n dataset: asFunc(options.dataset, emptyDatasetFunc),\n isEnabled: options.isEnabled || trueFunc,\n isToggled: options.isToggled || falseFunc,\n isVisible: options.isVisible || trueFunc\n };\n }\n Private.createCommand = createCommand;\n /**\n * Create a key binding object from key binding options.\n */\n function createKeyBinding(options) {\n return {\n keys: exports.CommandRegistry.normalizeKeys(options),\n selector: validateSelector(options),\n command: options.command,\n args: options.args || coreutils.JSONExt.emptyObject\n };\n }\n Private.createKeyBinding = createKeyBinding;\n /**\n * Find the key bindings which match a key sequence.\n *\n * This returns a match result which contains the best exact matching\n * binding, and a flag which indicates if there are partial matches.\n */\n function matchKeyBinding(bindings, keys, event) {\n // The current best exact match.\n var exact = null;\n // Whether a partial match has been found.\n var partial = false;\n // The match distance for the exact match.\n var distance = Infinity;\n // The specificity for the exact match.\n var specificity = 0;\n // Iterate over the bindings and search for the best match.\n for (var i = 0, n = bindings.length; i < n; ++i) {\n // Lookup the current binding.\n var binding = bindings[i];\n // Check whether the key binding sequence is a match.\n var sqm = matchSequence(binding.keys, keys);\n // If there is no match, the binding is ignored.\n if (sqm === 0 /* None */) {\n continue;\n }\n // If it is a partial match and no other partial match has been\n // found, ensure the selector matches and set the partial flag.\n if (sqm === 2 /* Partial */) {\n if (!partial && targetDistance(binding.selector, event) !== -1) {\n partial = true;\n }\n continue;\n }\n // Ignore the match if the selector doesn't match, or if the\n // matched node is farther away than the current best match.\n var td = targetDistance(binding.selector, event);\n if (td === -1 || td > distance) {\n continue;\n }\n // Get the specificity for the selector.\n var sp = domutils.Selector.calculateSpecificity(binding.selector);\n // Update the best match if this match is stronger.\n if (!exact || td < distance || sp >= specificity) {\n exact = binding;\n distance = td;\n specificity = sp;\n }\n }\n // Return the match result.\n return { exact: exact, partial: partial };\n }\n Private.matchKeyBinding = matchKeyBinding;\n /**\n * Replay a keyboard event.\n *\n * This synthetically dispatches a clone of the keyboard event.\n */\n function replayKeyEvent(event) {\n event.target.dispatchEvent(cloneKeyboardEvent(event));\n }\n Private.replayKeyEvent = replayKeyEvent;\n /**\n * A singleton empty string function.\n */\n var emptyStringFunc = function () { return ''; };\n /**\n * A singleton `-1` number function\n */\n var negativeOneFunc = function () { return -1; };\n /**\n * A singleton true boolean function.\n */\n var trueFunc = function () { return true; };\n /**\n * A singleton false boolean function.\n */\n var falseFunc = function () { return false; };\n /**\n * A singleton empty dataset function.\n */\n var emptyDatasetFunc = function () { return ({}); };\n /**\n * A singleton undefined function\n */\n var undefinedFunc = function () { return undefined; };\n /**\n * Cast a value or command func to a command func.\n */\n function asFunc(value, dfault) {\n if (value === undefined) {\n return dfault;\n }\n if (typeof value === 'function') {\n return value;\n }\n return function () { return value; };\n }\n /**\n * Validate the selector for an options object.\n *\n * This returns the validated selector, or throws if the selector is\n * invalid or contains commas.\n */\n function validateSelector(options) {\n if (options.selector.indexOf(',') !== -1) {\n throw new Error(\"Selector cannot contain commas: \" + options.selector);\n }\n if (!domutils.Selector.isValid(options.selector)) {\n throw new Error(\"Invalid selector: \" + options.selector);\n }\n return options.selector;\n }\n /**\n * Test whether a key binding sequence matches a key sequence.\n *\n * Returns a `SequenceMatch` value indicating the type of match.\n */\n function matchSequence(bindKeys, userKeys) {\n if (bindKeys.length < userKeys.length) {\n return 0 /* None */;\n }\n for (var i = 0, n = userKeys.length; i < n; ++i) {\n if (bindKeys[i] !== userKeys[i]) {\n return 0 /* None */;\n }\n }\n if (bindKeys.length > userKeys.length) {\n return 2 /* Partial */;\n }\n return 1 /* Exact */;\n }\n /**\n * Find the distance from the target node to the first matching node.\n *\n * This traverses the event path from `target` to `currentTarget` and\n * computes the distance from `target` to the first node which matches\n * the CSS selector. If no match is found, `-1` is returned.\n */\n function targetDistance(selector, event) {\n var targ = event.target;\n var curr = event.currentTarget;\n for (var dist = 0; targ !== null; targ = targ.parentElement, ++dist) {\n if (targ.hasAttribute('data-lm-suppress-shortcuts')) {\n return -1;\n }\n /* */\n if (targ.hasAttribute('data-p-suppress-shortcuts')) {\n return -1;\n }\n /* */\n if (domutils.Selector.matches(targ, selector)) {\n return dist;\n }\n if (targ === curr) {\n return -1;\n }\n }\n return -1;\n }\n /**\n * Clone a keyboard event.\n */\n function cloneKeyboardEvent(event) {\n // A custom event is required because Chrome nulls out the\n // `keyCode` field in user-generated `KeyboardEvent` types.\n var clone = document.createEvent('Event');\n var bubbles = event.bubbles || true;\n var cancelable = event.cancelable || true;\n clone.initEvent(event.type || 'keydown', bubbles, cancelable);\n clone.key = event.key || '';\n clone.keyCode = event.keyCode || 0;\n clone.which = event.keyCode || 0;\n clone.ctrlKey = event.ctrlKey || false;\n clone.altKey = event.altKey || false;\n clone.shiftKey = event.shiftKey || false;\n clone.metaKey = event.metaKey || false;\n clone.view = event.view || window;\n return clone;\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/commands/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/coreutils/dist/index.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/index.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar json = __webpack_require__(/*! ./json.js */ \"../../packages/coreutils/dist/json.js\");\nvar mime = __webpack_require__(/*! ./mime.js */ \"../../packages/coreutils/dist/mime.js\");\nvar promise = __webpack_require__(/*! ./promise.js */ \"../../packages/coreutils/dist/promise.js\");\nvar random = __webpack_require__(/*! ./random.js */ \"../../packages/coreutils/dist/random.js\");\nvar token = __webpack_require__(/*! ./token.js */ \"../../packages/coreutils/dist/token.js\");\nvar uuid = __webpack_require__(/*! ./uuid.js */ \"../../packages/coreutils/dist/uuid.js\");\n\n\n\nObject.defineProperty(exports, 'JSONExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn json.JSONExt;\n\t}\n});\nexports.MimeData = mime.MimeData;\nexports.PromiseDelegate = promise.PromiseDelegate;\nObject.defineProperty(exports, 'Random', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn random.Random;\n\t}\n});\nexports.Token = token.Token;\nObject.defineProperty(exports, 'UUID', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn uuid.UUID;\n\t}\n});\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar json = __webpack_require__(/*! ./json.js */ \"../../packages/coreutils/dist/json.js\");\nvar mime = __webpack_require__(/*! ./mime.js */ \"../../packages/coreutils/dist/mime.js\");\nvar promise = __webpack_require__(/*! ./promise.js */ \"../../packages/coreutils/dist/promise.js\");\nvar random = __webpack_require__(/*! ./random.js */ \"../../packages/coreutils/dist/random.js\");\nvar token = __webpack_require__(/*! ./token.js */ \"../../packages/coreutils/dist/token.js\");\nvar uuid = __webpack_require__(/*! ./uuid.js */ \"../../packages/coreutils/dist/uuid.js\");\n\n\n\nObject.defineProperty(exports, 'JSONExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn json.JSONExt;\n\t}\n});\nexports.MimeData = mime.MimeData;\nexports.PromiseDelegate = promise.PromiseDelegate;\nObject.defineProperty(exports, 'Random', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn random.Random;\n\t}\n});\nexports.Token = token.Token;\nObject.defineProperty(exports, 'UUID', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn uuid.UUID;\n\t}\n});\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/coreutils/dist/json.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/json.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/json.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (JSONExt) {\n /**\n * A shared frozen empty JSONObject\n */\n JSONExt.emptyObject = Object.freeze({});\n /**\n * A shared frozen empty JSONArray\n */\n JSONExt.emptyArray = Object.freeze([]);\n /**\n * Test whether a JSON value is a primitive.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a primitive,`false` otherwise.\n */\n function isPrimitive(value) {\n return (value === null ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string');\n }\n JSONExt.isPrimitive = isPrimitive;\n function isArray(value) {\n return Array.isArray(value);\n }\n JSONExt.isArray = isArray;\n function isObject(value) {\n return !isPrimitive(value) && !isArray(value);\n }\n JSONExt.isObject = isObject;\n /**\n * Compare two JSON values for deep equality.\n *\n * @param first - The first JSON value of interest.\n *\n * @param second - The second JSON value of interest.\n *\n * @returns `true` if the values are equivalent, `false` otherwise.\n */\n function deepEqual(first, second) {\n // Check referential and primitive equality first.\n if (first === second) {\n return true;\n }\n // If one is a primitive, the `===` check ruled out the other.\n if (isPrimitive(first) || isPrimitive(second)) {\n return false;\n }\n // Test whether they are arrays.\n var a1 = isArray(first);\n var a2 = isArray(second);\n // Bail if the types are different.\n if (a1 !== a2) {\n return false;\n }\n // If they are both arrays, compare them.\n if (a1 && a2) {\n return deepArrayEqual(first, second);\n }\n // At this point, they must both be objects.\n return deepObjectEqual(first, second);\n }\n JSONExt.deepEqual = deepEqual;\n /**\n * Create a deep copy of a JSON value.\n *\n * @param value - The JSON value to copy.\n *\n * @returns A deep copy of the given JSON value.\n */\n function deepCopy(value) {\n // Do nothing for primitive values.\n if (isPrimitive(value)) {\n return value;\n }\n // Deep copy an array.\n if (isArray(value)) {\n return deepArrayCopy(value);\n }\n // Deep copy an object.\n return deepObjectCopy(value);\n }\n JSONExt.deepCopy = deepCopy;\n /**\n * Compare two JSON arrays for deep equality.\n */\n function deepArrayEqual(first, second) {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n // Test the arrays for equal length.\n if (first.length !== second.length) {\n return false;\n }\n // Compare the values for equality.\n for (var i = 0, n = first.length; i < n; ++i) {\n if (!deepEqual(first[i], second[i])) {\n return false;\n }\n }\n // At this point, the arrays are equal.\n return true;\n }\n /**\n * Compare two JSON objects for deep equality.\n */\n function deepObjectEqual(first, second) {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n // Check for the first object's keys in the second object.\n for (var key in first) {\n if (first[key] !== undefined && !(key in second)) {\n return false;\n }\n }\n // Check for the second object's keys in the first object.\n for (var key in second) {\n if (second[key] !== undefined && !(key in first)) {\n return false;\n }\n }\n // Compare the values for equality.\n for (var key in first) {\n // Get the values.\n var firstValue = first[key];\n var secondValue = second[key];\n // If both are undefined, ignore the key.\n if (firstValue === undefined && secondValue === undefined) {\n continue;\n }\n // If only one value is undefined, the objects are not equal.\n if (firstValue === undefined || secondValue === undefined) {\n return false;\n }\n // Compare the values.\n if (!deepEqual(firstValue, secondValue)) {\n return false;\n }\n }\n // At this point, the objects are equal.\n return true;\n }\n /**\n * Create a deep copy of a JSON array.\n */\n function deepArrayCopy(value) {\n var result = new Array(value.length);\n for (var i = 0, n = value.length; i < n; ++i) {\n result[i] = deepCopy(value[i]);\n }\n return result;\n }\n /**\n * Create a deep copy of a JSON object.\n */\n function deepObjectCopy(value) {\n var result = {};\n for (var key in value) {\n // Ignore undefined values.\n var subvalue = value[key];\n if (subvalue === undefined) {\n continue;\n }\n result[key] = deepCopy(subvalue);\n }\n return result;\n }\n})(exports.JSONExt || (exports.JSONExt = {}));\n//# sourceMappingURL=json.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/json.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (JSONExt) {\n /**\n * A shared frozen empty JSONObject\n */\n JSONExt.emptyObject = Object.freeze({});\n /**\n * A shared frozen empty JSONArray\n */\n JSONExt.emptyArray = Object.freeze([]);\n /**\n * Test whether a JSON value is a primitive.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a primitive,`false` otherwise.\n */\n function isPrimitive(value) {\n return (value === null ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string');\n }\n JSONExt.isPrimitive = isPrimitive;\n function isArray(value) {\n return Array.isArray(value);\n }\n JSONExt.isArray = isArray;\n function isObject(value) {\n return !isPrimitive(value) && !isArray(value);\n }\n JSONExt.isObject = isObject;\n /**\n * Compare two JSON values for deep equality.\n *\n * @param first - The first JSON value of interest.\n *\n * @param second - The second JSON value of interest.\n *\n * @returns `true` if the values are equivalent, `false` otherwise.\n */\n function deepEqual(first, second) {\n // Check referential and primitive equality first.\n if (first === second) {\n return true;\n }\n // If one is a primitive, the `===` check ruled out the other.\n if (isPrimitive(first) || isPrimitive(second)) {\n return false;\n }\n // Test whether they are arrays.\n var a1 = isArray(first);\n var a2 = isArray(second);\n // Bail if the types are different.\n if (a1 !== a2) {\n return false;\n }\n // If they are both arrays, compare them.\n if (a1 && a2) {\n return deepArrayEqual(first, second);\n }\n // At this point, they must both be objects.\n return deepObjectEqual(first, second);\n }\n JSONExt.deepEqual = deepEqual;\n /**\n * Create a deep copy of a JSON value.\n *\n * @param value - The JSON value to copy.\n *\n * @returns A deep copy of the given JSON value.\n */\n function deepCopy(value) {\n // Do nothing for primitive values.\n if (isPrimitive(value)) {\n return value;\n }\n // Deep copy an array.\n if (isArray(value)) {\n return deepArrayCopy(value);\n }\n // Deep copy an object.\n return deepObjectCopy(value);\n }\n JSONExt.deepCopy = deepCopy;\n /**\n * Compare two JSON arrays for deep equality.\n */\n function deepArrayEqual(first, second) {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n // Test the arrays for equal length.\n if (first.length !== second.length) {\n return false;\n }\n // Compare the values for equality.\n for (var i = 0, n = first.length; i < n; ++i) {\n if (!deepEqual(first[i], second[i])) {\n return false;\n }\n }\n // At this point, the arrays are equal.\n return true;\n }\n /**\n * Compare two JSON objects for deep equality.\n */\n function deepObjectEqual(first, second) {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n // Check for the first object's keys in the second object.\n for (var key in first) {\n if (first[key] !== undefined && !(key in second)) {\n return false;\n }\n }\n // Check for the second object's keys in the first object.\n for (var key in second) {\n if (second[key] !== undefined && !(key in first)) {\n return false;\n }\n }\n // Compare the values for equality.\n for (var key in first) {\n // Get the values.\n var firstValue = first[key];\n var secondValue = second[key];\n // If both are undefined, ignore the key.\n if (firstValue === undefined && secondValue === undefined) {\n continue;\n }\n // If only one value is undefined, the objects are not equal.\n if (firstValue === undefined || secondValue === undefined) {\n return false;\n }\n // Compare the values.\n if (!deepEqual(firstValue, secondValue)) {\n return false;\n }\n }\n // At this point, the objects are equal.\n return true;\n }\n /**\n * Create a deep copy of a JSON array.\n */\n function deepArrayCopy(value) {\n var result = new Array(value.length);\n for (var i = 0, n = value.length; i < n; ++i) {\n result[i] = deepCopy(value[i]);\n }\n return result;\n }\n /**\n * Create a deep copy of a JSON object.\n */\n function deepObjectCopy(value) {\n var result = {};\n for (var key in value) {\n // Ignore undefined values.\n var subvalue = value[key];\n if (subvalue === undefined) {\n continue;\n }\n result[key] = deepCopy(subvalue);\n }\n return result;\n }\n})(exports.JSONExt || (exports.JSONExt = {}));\n//# sourceMappingURL=json.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/json.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/coreutils/dist/mime.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/mime.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/mime.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * An object which stores MIME data for general application use.\n *\n * #### Notes\n * This class does not attempt to enforce \"correctness\" of MIME types\n * and their associated data. Since this class is designed to transfer\n * arbitrary data and objects within the same application, it assumes\n * that the user provides correct and accurate data.\n */\nvar MimeData = /** @class */ (function () {\n function MimeData() {\n this._types = [];\n this._values = [];\n }\n /**\n * Get an array of the MIME types contained within the dataset.\n *\n * @returns A new array of the MIME types, in order of insertion.\n */\n MimeData.prototype.types = function () {\n return this._types.slice();\n };\n /**\n * Test whether the dataset has an entry for the given type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns `true` if the dataset contains a value for the given\n * MIME type, `false` otherwise.\n */\n MimeData.prototype.hasData = function (mime) {\n return this._types.indexOf(mime) !== -1;\n };\n /**\n * Get the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns The value for the given MIME type, or `undefined` if\n * the dataset does not contain a value for the type.\n */\n MimeData.prototype.getData = function (mime) {\n var i = this._types.indexOf(mime);\n return i !== -1 ? this._values[i] : undefined;\n };\n /**\n * Set the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @param data - The data value for the given MIME type.\n *\n * #### Notes\n * This will overwrite any previous entry for the MIME type.\n */\n MimeData.prototype.setData = function (mime, data) {\n this.clearData(mime);\n this._types.push(mime);\n this._values.push(data);\n };\n /**\n * Remove the data entry for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * #### Notes\n * This is a no-op if there is no entry for the given MIME type.\n */\n MimeData.prototype.clearData = function (mime) {\n var i = this._types.indexOf(mime);\n if (i !== -1) {\n this._types.splice(i, 1);\n this._values.splice(i, 1);\n }\n };\n /**\n * Remove all data entries from the dataset.\n */\n MimeData.prototype.clear = function () {\n this._types.length = 0;\n this._values.length = 0;\n };\n return MimeData;\n}());\n\nexports.MimeData = MimeData;\n//# sourceMappingURL=mime.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/mime.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * An object which stores MIME data for general application use.\n *\n * #### Notes\n * This class does not attempt to enforce \"correctness\" of MIME types\n * and their associated data. Since this class is designed to transfer\n * arbitrary data and objects within the same application, it assumes\n * that the user provides correct and accurate data.\n */\nvar MimeData = /** @class */ (function () {\n function MimeData() {\n this._types = [];\n this._values = [];\n }\n /**\n * Get an array of the MIME types contained within the dataset.\n *\n * @returns A new array of the MIME types, in order of insertion.\n */\n MimeData.prototype.types = function () {\n return this._types.slice();\n };\n /**\n * Test whether the dataset has an entry for the given type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns `true` if the dataset contains a value for the given\n * MIME type, `false` otherwise.\n */\n MimeData.prototype.hasData = function (mime) {\n return this._types.indexOf(mime) !== -1;\n };\n /**\n * Get the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns The value for the given MIME type, or `undefined` if\n * the dataset does not contain a value for the type.\n */\n MimeData.prototype.getData = function (mime) {\n var i = this._types.indexOf(mime);\n return i !== -1 ? this._values[i] : undefined;\n };\n /**\n * Set the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @param data - The data value for the given MIME type.\n *\n * #### Notes\n * This will overwrite any previous entry for the MIME type.\n */\n MimeData.prototype.setData = function (mime, data) {\n this.clearData(mime);\n this._types.push(mime);\n this._values.push(data);\n };\n /**\n * Remove the data entry for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * #### Notes\n * This is a no-op if there is no entry for the given MIME type.\n */\n MimeData.prototype.clearData = function (mime) {\n var i = this._types.indexOf(mime);\n if (i !== -1) {\n this._types.splice(i, 1);\n this._values.splice(i, 1);\n }\n };\n /**\n * Remove all data entries from the dataset.\n */\n MimeData.prototype.clear = function () {\n this._types.length = 0;\n this._values.length = 0;\n };\n return MimeData;\n}());\n\nexports.MimeData = MimeData;\n//# sourceMappingURL=mime.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/mime.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/coreutils/dist/promise.js": │ │ │ │ /*!*********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/promise.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/promise.js ***! │ │ │ │ \*********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A class which wraps a promise into a delegate object.\n *\n * #### Notes\n * This class is useful when the logic to resolve or reject a promise\n * cannot be defined at the point where the promise is created.\n */\nvar PromiseDelegate = /** @class */ (function () {\n /**\n * Construct a new promise delegate.\n */\n function PromiseDelegate() {\n var _this = this;\n this.promise = new Promise(function (resolve, reject) {\n _this._resolve = resolve;\n _this._reject = reject;\n });\n }\n /**\n * Resolve the wrapped promise with the given value.\n *\n * @param value - The value to use for resolving the promise.\n */\n PromiseDelegate.prototype.resolve = function (value) {\n var resolve = this._resolve;\n resolve(value);\n };\n /**\n * Reject the wrapped promise with the given value.\n *\n * @reason - The reason for rejecting the promise.\n */\n PromiseDelegate.prototype.reject = function (reason) {\n var reject = this._reject;\n reject(reason);\n };\n return PromiseDelegate;\n}());\n\nexports.PromiseDelegate = PromiseDelegate;\n//# sourceMappingURL=promise.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/promise.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A class which wraps a promise into a delegate object.\n *\n * #### Notes\n * This class is useful when the logic to resolve or reject a promise\n * cannot be defined at the point where the promise is created.\n */\nvar PromiseDelegate = /** @class */ (function () {\n /**\n * Construct a new promise delegate.\n */\n function PromiseDelegate() {\n var _this = this;\n this.promise = new Promise(function (resolve, reject) {\n _this._resolve = resolve;\n _this._reject = reject;\n });\n }\n /**\n * Resolve the wrapped promise with the given value.\n *\n * @param value - The value to use for resolving the promise.\n */\n PromiseDelegate.prototype.resolve = function (value) {\n var resolve = this._resolve;\n resolve(value);\n };\n /**\n * Reject the wrapped promise with the given value.\n *\n * @reason - The reason for rejecting the promise.\n */\n PromiseDelegate.prototype.reject = function (reason) {\n var reject = this._reject;\n reject(reason);\n };\n return PromiseDelegate;\n}());\n\nexports.PromiseDelegate = PromiseDelegate;\n//# sourceMappingURL=promise.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/promise.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/coreutils/dist/random.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/random.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/random.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (Random) {\n /**\n * A function which generates random bytes.\n *\n * @param buffer - The `Uint8Array` to fill with random bytes.\n *\n * #### Notes\n * A cryptographically strong random number generator will be used if\n * available. Otherwise, `Math.random` will be used as a fallback for\n * randomness.\n *\n * The following RNGs are supported, listed in order of precedence:\n * - `window.crypto.getRandomValues`\n * - `window.msCrypto.getRandomValues`\n * - `require('crypto').randomFillSync\n * - `require('crypto').randomBytes\n * - `Math.random`\n */\n Random.getRandomValues = (function () {\n // Look up the crypto module if available.\n var crypto = ((typeof window !== 'undefined' && (window.crypto || window.msCrypto)) ||\n ( true && __webpack_require__(/*! crypto */ 0)) || null);\n // Modern browsers and IE 11\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return function getRandomValues(buffer) {\n return crypto.getRandomValues(buffer);\n };\n }\n // Node 7+\n if (crypto && typeof crypto.randomFillSync === 'function') {\n return function getRandomValues(buffer) {\n return crypto.randomFillSync(buffer);\n };\n }\n // Node 0.10+\n if (crypto && typeof crypto.randomBytes === 'function') {\n return function getRandomValues(buffer) {\n var bytes = crypto.randomBytes(buffer.length);\n for (var i = 0, n = bytes.length; i < n; ++i) {\n buffer[i] = bytes[i];\n }\n };\n }\n // Fallback\n return function getRandomValues(buffer) {\n var value = 0;\n for (var i = 0, n = buffer.length; i < n; ++i) {\n if (i % 4 === 0) {\n value = Math.random() * 0xFFFFFFFF >>> 0;\n }\n buffer[i] = value & 0xFF;\n value >>>= 8;\n }\n };\n })();\n})(exports.Random || (exports.Random = {}));\n//# sourceMappingURL=random.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/random.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (Random) {\n /**\n * A function which generates random bytes.\n *\n * @param buffer - The `Uint8Array` to fill with random bytes.\n *\n * #### Notes\n * A cryptographically strong random number generator will be used if\n * available. Otherwise, `Math.random` will be used as a fallback for\n * randomness.\n *\n * The following RNGs are supported, listed in order of precedence:\n * - `window.crypto.getRandomValues`\n * - `window.msCrypto.getRandomValues`\n * - `require('crypto').randomFillSync\n * - `require('crypto').randomBytes\n * - `Math.random`\n */\n Random.getRandomValues = (function () {\n // Look up the crypto module if available.\n var crypto = ((typeof window !== 'undefined' && (window.crypto || window.msCrypto)) ||\n ( true && __webpack_require__(/*! crypto */ 0)) || null);\n // Modern browsers and IE 11\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return function getRandomValues(buffer) {\n return crypto.getRandomValues(buffer);\n };\n }\n // Node 7+\n if (crypto && typeof crypto.randomFillSync === 'function') {\n return function getRandomValues(buffer) {\n return crypto.randomFillSync(buffer);\n };\n }\n // Node 0.10+\n if (crypto && typeof crypto.randomBytes === 'function') {\n return function getRandomValues(buffer) {\n var bytes = crypto.randomBytes(buffer.length);\n for (var i = 0, n = bytes.length; i < n; ++i) {\n buffer[i] = bytes[i];\n }\n };\n }\n // Fallback\n return function getRandomValues(buffer) {\n var value = 0;\n for (var i = 0, n = buffer.length; i < n; ++i) {\n if (i % 4 === 0) {\n value = Math.random() * 0xFFFFFFFF >>> 0;\n }\n buffer[i] = value & 0xFF;\n value >>>= 8;\n }\n };\n })();\n})(exports.Random || (exports.Random = {}));\n//# sourceMappingURL=random.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/random.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/coreutils/dist/token.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/token.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/token.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A runtime object which captures compile-time type information.\n *\n * #### Notes\n * A token captures the compile-time type of an interface or class in\n * an object which can be used at runtime in a type-safe fashion.\n */\nvar Token = /** @class */ (function () {\n /**\n * Construct a new token.\n *\n * @param name - A human readable name for the token.\n */\n function Token(name) {\n this.name = name;\n this._tokenStructuralPropertyT = null;\n }\n return Token;\n}());\n\nexports.Token = Token;\n//# sourceMappingURL=token.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/token.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A runtime object which captures compile-time type information.\n *\n * #### Notes\n * A token captures the compile-time type of an interface or class in\n * an object which can be used at runtime in a type-safe fashion.\n */\nvar Token = /** @class */ (function () {\n /**\n * Construct a new token.\n *\n * @param name - A human readable name for the token.\n */\n function Token(name) {\n this.name = name;\n this._tokenStructuralPropertyT = null;\n }\n return Token;\n}());\n\nexports.Token = Token;\n//# sourceMappingURL=token.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/token.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/coreutils/dist/uuid.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/uuid.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/uuid.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar random = __webpack_require__(/*! ./random.js */ \"../../packages/coreutils/dist/random.js\");\n\n// Copyright (c) Jupyter Development Team.\n(function (UUID) {\n /**\n * A function which generates UUID v4 identifiers.\n *\n * @returns A new UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\n UUID.uuid4 = (function () {\n // Create a 16 byte array to hold the random values.\n var bytes = new Uint8Array(16);\n // Create a look up table from bytes to hex strings.\n var lut = new Array(256);\n // Pad the single character hex digits with a leading zero.\n for (var i = 0; i < 16; ++i) {\n lut[i] = '0' + i.toString(16);\n }\n // Populate the rest of the hex digits.\n for (var i = 16; i < 256; ++i) {\n lut[i] = i.toString(16);\n }\n // Return a function which generates the UUID.\n return function uuid4() {\n // Get a new batch of random values.\n random.Random.getRandomValues(bytes);\n // Set the UUID version number to 4.\n bytes[6] = 0x40 | (bytes[6] & 0x0F);\n // Set the clock sequence bit to the RFC spec.\n bytes[8] = 0x80 | (bytes[8] & 0x3F);\n // Assemble the UUID string.\n return (lut[bytes[0]] +\n lut[bytes[1]] +\n lut[bytes[2]] +\n lut[bytes[3]] +\n '-' +\n lut[bytes[4]] +\n lut[bytes[5]] +\n '-' +\n lut[bytes[6]] +\n lut[bytes[7]] +\n '-' +\n lut[bytes[8]] +\n lut[bytes[9]] +\n '-' +\n lut[bytes[10]] +\n lut[bytes[11]] +\n lut[bytes[12]] +\n lut[bytes[13]] +\n lut[bytes[14]] +\n lut[bytes[15]]);\n };\n })();\n})(exports.UUID || (exports.UUID = {}));\n//# sourceMappingURL=uuid.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/coreutils/dist/uuid.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar random = __webpack_require__(/*! ./random.js */ \"../../packages/coreutils/dist/random.js\");\n\n// Copyright (c) Jupyter Development Team.\n(function (UUID) {\n /**\n * A function which generates UUID v4 identifiers.\n *\n * @returns A new UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\n UUID.uuid4 = (function () {\n // Create a 16 byte array to hold the random values.\n var bytes = new Uint8Array(16);\n // Create a look up table from bytes to hex strings.\n var lut = new Array(256);\n // Pad the single character hex digits with a leading zero.\n for (var i = 0; i < 16; ++i) {\n lut[i] = '0' + i.toString(16);\n }\n // Populate the rest of the hex digits.\n for (var i = 16; i < 256; ++i) {\n lut[i] = i.toString(16);\n }\n // Return a function which generates the UUID.\n return function uuid4() {\n // Get a new batch of random values.\n random.Random.getRandomValues(bytes);\n // Set the UUID version number to 4.\n bytes[6] = 0x40 | (bytes[6] & 0x0F);\n // Set the clock sequence bit to the RFC spec.\n bytes[8] = 0x80 | (bytes[8] & 0x3F);\n // Assemble the UUID string.\n return (lut[bytes[0]] +\n lut[bytes[1]] +\n lut[bytes[2]] +\n lut[bytes[3]] +\n '-' +\n lut[bytes[4]] +\n lut[bytes[5]] +\n '-' +\n lut[bytes[6]] +\n lut[bytes[7]] +\n '-' +\n lut[bytes[8]] +\n lut[bytes[9]] +\n '-' +\n lut[bytes[10]] +\n lut[bytes[11]] +\n lut[bytes[12]] +\n lut[bytes[13]] +\n lut[bytes[14]] +\n lut[bytes[15]]);\n };\n })();\n})(exports.UUID || (exports.UUID = {}));\n//# sourceMappingURL=uuid.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/coreutils/dist/uuid.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/basickeyhandler.js": │ │ │ │ /*!****************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/basickeyhandler.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/basickeyhandler.js ***! │ │ │ │ \****************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A basic implementation of a data grid key handler.\n *\n * #### Notes\n * This class may be subclassed and customized as needed.\n */\nvar BasicKeyHandler = /** @class */ (function () {\n function BasicKeyHandler() {\n this._disposed = false;\n }\n Object.defineProperty(BasicKeyHandler.prototype, \"isDisposed\", {\n /**\n * Whether the key handler is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the resources held by the key handler.\n */\n BasicKeyHandler.prototype.dispose = function () {\n this._disposed = true;\n };\n /**\n * Handle the key down event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keydown event of interest.\n *\n * #### Notes\n * This will not be called if the mouse button is pressed.\n */\n BasicKeyHandler.prototype.onKeyDown = function (grid, event) {\n // if grid is editable and cell selection available, start cell editing\n // on key press (letters, numbers and space only)\n if (grid.editable &&\n grid.selectionModel.cursorRow !== -1 &&\n grid.selectionModel.cursorColumn !== -1) {\n var input = String.fromCharCode(event.keyCode);\n if (/[a-zA-Z0-9-_ ]/.test(input)) {\n var row = grid.selectionModel.cursorRow;\n var column = grid.selectionModel.cursorColumn;\n var cell = {\n grid: grid,\n row: row,\n column: column\n };\n grid.editorController.edit(cell);\n if (keyboard.getKeyboardLayout().keyForKeydownEvent(event) === 'Space') {\n event.stopPropagation();\n event.preventDefault();\n }\n return;\n }\n }\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'ArrowLeft':\n this.onArrowLeft(grid, event);\n break;\n case 'ArrowRight':\n this.onArrowRight(grid, event);\n break;\n case 'ArrowUp':\n this.onArrowUp(grid, event);\n break;\n case 'ArrowDown':\n this.onArrowDown(grid, event);\n break;\n case 'PageUp':\n this.onPageUp(grid, event);\n break;\n case 'PageDown':\n this.onPageDown(grid, event);\n break;\n case 'Escape':\n this.onEscape(grid, event);\n break;\n case 'Delete':\n this.onDelete(grid, event);\n break;\n case 'C':\n this.onKeyC(grid, event);\n break;\n case 'Enter':\n if (grid.selectionModel) {\n grid.moveCursor(event.shiftKey ? 'up' : 'down');\n grid.scrollToCursor();\n }\n break;\n case 'Tab':\n if (grid.selectionModel) {\n grid.moveCursor(event.shiftKey ? 'left' : 'right');\n grid.scrollToCursor();\n event.stopPropagation();\n event.preventDefault();\n }\n break;\n }\n };\n /**\n * Handle the `'ArrowLeft'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onArrowLeft = function (grid, event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // Handle no model with the accel modifier.\n if (!model && accel) {\n grid.scrollTo(0, grid.scrollY);\n return;\n }\n // Handle no model and no modifier. (ignore shift)\n if (!model) {\n grid.scrollByStep('left');\n return;\n }\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Handle the row selection mode with accel key.\n if (mode === 'row' && accel) {\n grid.scrollTo(0, grid.scrollY);\n return;\n }\n // Handle the row selection mode with no modifier. (ignore shift)\n if (mode === 'row') {\n grid.scrollByStep('left');\n return;\n }\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Dispatch based on the modifier keys.\n if (accel && shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 - 1 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (accel) {\n r1 = r;\n r2 = r;\n c1 = 0;\n c2 = 0;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n else {\n r1 = r;\n r2 = r;\n c1 = c - 1;\n c2 = c - 1;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n if (shift || mode === 'column') {\n grid.scrollToColumn(cs.c2);\n }\n else {\n grid.scrollToCursor();\n }\n };\n /**\n * Handle the `'ArrowRight'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onArrowRight = function (grid, event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // Handle no model with the accel modifier.\n if (!model && accel) {\n grid.scrollTo(grid.maxScrollX, grid.scrollY);\n return;\n }\n // Handle no model and no modifier. (ignore shift)\n if (!model) {\n grid.scrollByStep('right');\n return;\n }\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Handle the row selection model with accel key.\n if (mode === 'row' && accel) {\n grid.scrollTo(grid.maxScrollX, grid.scrollY);\n return;\n }\n // Handle the row selection mode with no modifier. (ignore shift)\n if (mode === 'row') {\n grid.scrollByStep('right');\n return;\n }\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Dispatch based on the modifier keys.\n if (accel && shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = Infinity;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 + 1 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (accel) {\n r1 = r;\n r2 = r;\n c1 = Infinity;\n c2 = Infinity;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n else {\n r1 = r;\n r2 = r;\n c1 = c + 1;\n c2 = c + 1;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n if (shift || mode === 'column') {\n grid.scrollToColumn(cs.c2);\n }\n else {\n grid.scrollToCursor();\n }\n };\n /**\n * Handle the `'ArrowUp'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onArrowUp = function (grid, event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // Handle no model with the accel modifier.\n if (!model && accel) {\n grid.scrollTo(grid.scrollX, 0);\n return;\n }\n // Handle no model and no modifier. (ignore shift)\n if (!model) {\n grid.scrollByStep('up');\n return;\n }\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Handle the column selection mode with accel key.\n if (mode === 'column' && accel) {\n grid.scrollTo(grid.scrollX, 0);\n return;\n }\n // Handle the column selection mode with no modifier. (ignore shift)\n if (mode === 'column') {\n grid.scrollByStep('up');\n return;\n }\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Dispatch based on the modifier keys.\n if (accel && shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 - 1 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (accel) {\n r1 = 0;\n r2 = 0;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n else {\n r1 = r - 1;\n r2 = r - 1;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n if (shift || mode === 'row') {\n grid.scrollToRow(cs.r2);\n }\n else {\n grid.scrollToCursor();\n }\n };\n /**\n * Handle the `'ArrowDown'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onArrowDown = function (grid, event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // Handle no model with the accel modifier.\n if (!model && accel) {\n grid.scrollTo(grid.scrollX, grid.maxScrollY);\n return;\n }\n // Handle no model and no modifier. (ignore shift)\n if (!model) {\n grid.scrollByStep('down');\n return;\n }\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Handle the column selection mode with accel key.\n if (mode === 'column' && accel) {\n grid.scrollTo(grid.scrollX, grid.maxScrollY);\n return;\n }\n // Handle the column selection mode with no modifier. (ignore shift)\n if (mode === 'column') {\n grid.scrollByStep('down');\n return;\n }\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Dispatch based on the modifier keys.\n if (accel && shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = Infinity;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 + 1 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (accel) {\n r1 = Infinity;\n r2 = Infinity;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n else {\n r1 = r + 1;\n r2 = r + 1;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n if (shift || mode === 'row') {\n grid.scrollToRow(cs.r2);\n }\n else {\n grid.scrollToCursor();\n }\n };\n /**\n * Handle the `'PageUp'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onPageUp = function (grid, event) {\n // Ignore the event if the accel key is pressed.\n if (domutils.Platform.accelKey(event)) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Scroll by page if there is no selection model.\n if (!model || model.selectionMode === 'column') {\n grid.scrollByPage('up');\n return;\n }\n // Get the normal number of cells in the page height.\n var n = Math.floor(grid.pageHeight / grid.defaultSizes.rowHeight);\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Select or resize as needed.\n if (event.shiftKey) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 - n : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else {\n r1 = cs ? cs.r1 - n : 0;\n r2 = r1;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n grid.scrollToRow(cs.r2);\n };\n /**\n * Handle the `'PageDown'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onPageDown = function (grid, event) {\n // Ignore the event if the accel key is pressed.\n if (domutils.Platform.accelKey(event)) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Scroll by page if there is no selection model.\n if (!model || model.selectionMode === 'column') {\n grid.scrollByPage('down');\n return;\n }\n // Get the normal number of cells in the page height.\n var n = Math.floor(grid.pageHeight / grid.defaultSizes.rowHeight);\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Select or resize as needed.\n if (event.shiftKey) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 + n : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else {\n r1 = cs ? cs.r1 + n : 0;\n r2 = r1;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n grid.scrollToRow(cs.r2);\n };\n /**\n * Handle the `'Escape'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onEscape = function (grid, event) {\n if (grid.selectionModel) {\n grid.selectionModel.clear();\n }\n };\n /**\n * Handle the `'Delete'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onDelete = function (grid, event) {\n if (grid.editable &&\n !grid.selectionModel.isEmpty) {\n var dataModel = grid.dataModel;\n // Fetch the max row and column.\n var maxRow = dataModel.rowCount('body') - 1;\n var maxColumn = dataModel.columnCount('body') - 1;\n var it = grid.selectionModel.selections();\n var s = void 0;\n while ((s = it.next()) !== undefined) {\n // Clamp the cell to the model bounds.\n var sr1 = Math.max(0, Math.min(s.r1, maxRow));\n var sc1 = Math.max(0, Math.min(s.c1, maxColumn));\n var sr2 = Math.max(0, Math.min(s.r2, maxRow));\n var sc2 = Math.max(0, Math.min(s.c2, maxColumn));\n for (var r = sr1; r <= sr2; ++r) {\n for (var c = sc1; c <= sc2; ++c) {\n dataModel.setData('body', r, c, null);\n }\n }\n }\n }\n };\n /**\n * Handle the `'C'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onKeyC = function (grid, event) {\n // Bail early if the modifiers aren't correct for copy.\n if (event.shiftKey || !domutils.Platform.accelKey(event)) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Copy the current selection to the clipboard.\n grid.copyToClipboard();\n };\n return BasicKeyHandler;\n}());\n\nexports.BasicKeyHandler = BasicKeyHandler;\n//# sourceMappingURL=basickeyhandler.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/basickeyhandler.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A basic implementation of a data grid key handler.\n *\n * #### Notes\n * This class may be subclassed and customized as needed.\n */\nvar BasicKeyHandler = /** @class */ (function () {\n function BasicKeyHandler() {\n this._disposed = false;\n }\n Object.defineProperty(BasicKeyHandler.prototype, \"isDisposed\", {\n /**\n * Whether the key handler is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the resources held by the key handler.\n */\n BasicKeyHandler.prototype.dispose = function () {\n this._disposed = true;\n };\n /**\n * Handle the key down event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keydown event of interest.\n *\n * #### Notes\n * This will not be called if the mouse button is pressed.\n */\n BasicKeyHandler.prototype.onKeyDown = function (grid, event) {\n // if grid is editable and cell selection available, start cell editing\n // on key press (letters, numbers and space only)\n if (grid.editable &&\n grid.selectionModel.cursorRow !== -1 &&\n grid.selectionModel.cursorColumn !== -1) {\n var input = String.fromCharCode(event.keyCode);\n if (/[a-zA-Z0-9-_ ]/.test(input)) {\n var row = grid.selectionModel.cursorRow;\n var column = grid.selectionModel.cursorColumn;\n var cell = {\n grid: grid,\n row: row,\n column: column\n };\n grid.editorController.edit(cell);\n if (keyboard.getKeyboardLayout().keyForKeydownEvent(event) === 'Space') {\n event.stopPropagation();\n event.preventDefault();\n }\n return;\n }\n }\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'ArrowLeft':\n this.onArrowLeft(grid, event);\n break;\n case 'ArrowRight':\n this.onArrowRight(grid, event);\n break;\n case 'ArrowUp':\n this.onArrowUp(grid, event);\n break;\n case 'ArrowDown':\n this.onArrowDown(grid, event);\n break;\n case 'PageUp':\n this.onPageUp(grid, event);\n break;\n case 'PageDown':\n this.onPageDown(grid, event);\n break;\n case 'Escape':\n this.onEscape(grid, event);\n break;\n case 'Delete':\n this.onDelete(grid, event);\n break;\n case 'C':\n this.onKeyC(grid, event);\n break;\n case 'Enter':\n if (grid.selectionModel) {\n grid.moveCursor(event.shiftKey ? 'up' : 'down');\n grid.scrollToCursor();\n }\n break;\n case 'Tab':\n if (grid.selectionModel) {\n grid.moveCursor(event.shiftKey ? 'left' : 'right');\n grid.scrollToCursor();\n event.stopPropagation();\n event.preventDefault();\n }\n break;\n }\n };\n /**\n * Handle the `'ArrowLeft'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onArrowLeft = function (grid, event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // Handle no model with the accel modifier.\n if (!model && accel) {\n grid.scrollTo(0, grid.scrollY);\n return;\n }\n // Handle no model and no modifier. (ignore shift)\n if (!model) {\n grid.scrollByStep('left');\n return;\n }\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Handle the row selection mode with accel key.\n if (mode === 'row' && accel) {\n grid.scrollTo(0, grid.scrollY);\n return;\n }\n // Handle the row selection mode with no modifier. (ignore shift)\n if (mode === 'row') {\n grid.scrollByStep('left');\n return;\n }\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Dispatch based on the modifier keys.\n if (accel && shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 - 1 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (accel) {\n r1 = r;\n r2 = r;\n c1 = 0;\n c2 = 0;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n else {\n r1 = r;\n r2 = r;\n c1 = c - 1;\n c2 = c - 1;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n if (shift || mode === 'column') {\n grid.scrollToColumn(cs.c2);\n }\n else {\n grid.scrollToCursor();\n }\n };\n /**\n * Handle the `'ArrowRight'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onArrowRight = function (grid, event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // Handle no model with the accel modifier.\n if (!model && accel) {\n grid.scrollTo(grid.maxScrollX, grid.scrollY);\n return;\n }\n // Handle no model and no modifier. (ignore shift)\n if (!model) {\n grid.scrollByStep('right');\n return;\n }\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Handle the row selection model with accel key.\n if (mode === 'row' && accel) {\n grid.scrollTo(grid.maxScrollX, grid.scrollY);\n return;\n }\n // Handle the row selection mode with no modifier. (ignore shift)\n if (mode === 'row') {\n grid.scrollByStep('right');\n return;\n }\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Dispatch based on the modifier keys.\n if (accel && shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = Infinity;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 + 1 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (accel) {\n r1 = r;\n r2 = r;\n c1 = Infinity;\n c2 = Infinity;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n else {\n r1 = r;\n r2 = r;\n c1 = c + 1;\n c2 = c + 1;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n if (shift || mode === 'column') {\n grid.scrollToColumn(cs.c2);\n }\n else {\n grid.scrollToCursor();\n }\n };\n /**\n * Handle the `'ArrowUp'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onArrowUp = function (grid, event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // Handle no model with the accel modifier.\n if (!model && accel) {\n grid.scrollTo(grid.scrollX, 0);\n return;\n }\n // Handle no model and no modifier. (ignore shift)\n if (!model) {\n grid.scrollByStep('up');\n return;\n }\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Handle the column selection mode with accel key.\n if (mode === 'column' && accel) {\n grid.scrollTo(grid.scrollX, 0);\n return;\n }\n // Handle the column selection mode with no modifier. (ignore shift)\n if (mode === 'column') {\n grid.scrollByStep('up');\n return;\n }\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Dispatch based on the modifier keys.\n if (accel && shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 - 1 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (accel) {\n r1 = 0;\n r2 = 0;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n else {\n r1 = r - 1;\n r2 = r - 1;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n if (shift || mode === 'row') {\n grid.scrollToRow(cs.r2);\n }\n else {\n grid.scrollToCursor();\n }\n };\n /**\n * Handle the `'ArrowDown'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onArrowDown = function (grid, event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // Handle no model with the accel modifier.\n if (!model && accel) {\n grid.scrollTo(grid.scrollX, grid.maxScrollY);\n return;\n }\n // Handle no model and no modifier. (ignore shift)\n if (!model) {\n grid.scrollByStep('down');\n return;\n }\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Handle the column selection mode with accel key.\n if (mode === 'column' && accel) {\n grid.scrollTo(grid.scrollX, grid.maxScrollY);\n return;\n }\n // Handle the column selection mode with no modifier. (ignore shift)\n if (mode === 'column') {\n grid.scrollByStep('down');\n return;\n }\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Dispatch based on the modifier keys.\n if (accel && shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = Infinity;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (shift) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 + 1 : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else if (accel) {\n r1 = Infinity;\n r2 = Infinity;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n else {\n r1 = r + 1;\n r2 = r + 1;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c1;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n if (shift || mode === 'row') {\n grid.scrollToRow(cs.r2);\n }\n else {\n grid.scrollToCursor();\n }\n };\n /**\n * Handle the `'PageUp'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onPageUp = function (grid, event) {\n // Ignore the event if the accel key is pressed.\n if (domutils.Platform.accelKey(event)) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Scroll by page if there is no selection model.\n if (!model || model.selectionMode === 'column') {\n grid.scrollByPage('up');\n return;\n }\n // Get the normal number of cells in the page height.\n var n = Math.floor(grid.pageHeight / grid.defaultSizes.rowHeight);\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Select or resize as needed.\n if (event.shiftKey) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 - n : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else {\n r1 = cs ? cs.r1 - n : 0;\n r2 = r1;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n grid.scrollToRow(cs.r2);\n };\n /**\n * Handle the `'PageDown'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onPageDown = function (grid, event) {\n // Ignore the event if the accel key is pressed.\n if (domutils.Platform.accelKey(event)) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Scroll by page if there is no selection model.\n if (!model || model.selectionMode === 'column') {\n grid.scrollByPage('down');\n return;\n }\n // Get the normal number of cells in the page height.\n var n = Math.floor(grid.pageHeight / grid.defaultSizes.rowHeight);\n // Fetch the cursor and selection.\n var r = model.cursorRow;\n var c = model.cursorColumn;\n var cs = model.currentSelection();\n // Set up the selection variables.\n var r1;\n var r2;\n var c1;\n var c2;\n var cr;\n var cc;\n var clear;\n // Select or resize as needed.\n if (event.shiftKey) {\n r1 = cs ? cs.r1 : 0;\n r2 = cs ? cs.r2 + n : 0;\n c1 = cs ? cs.c1 : 0;\n c2 = cs ? cs.c2 : 0;\n cr = r;\n cc = c;\n clear = 'current';\n }\n else {\n r1 = cs ? cs.r1 + n : 0;\n r2 = r1;\n c1 = c;\n c2 = c;\n cr = r1;\n cc = c;\n clear = 'all';\n }\n // Create the new selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cr, cursorColumn: cc, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid appropriately.\n grid.scrollToRow(cs.r2);\n };\n /**\n * Handle the `'Escape'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onEscape = function (grid, event) {\n if (grid.selectionModel) {\n grid.selectionModel.clear();\n }\n };\n /**\n * Handle the `'Delete'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onDelete = function (grid, event) {\n if (grid.editable &&\n !grid.selectionModel.isEmpty) {\n var dataModel = grid.dataModel;\n // Fetch the max row and column.\n var maxRow = dataModel.rowCount('body') - 1;\n var maxColumn = dataModel.columnCount('body') - 1;\n var it = grid.selectionModel.selections();\n var s = void 0;\n while ((s = it.next()) !== undefined) {\n // Clamp the cell to the model bounds.\n var sr1 = Math.max(0, Math.min(s.r1, maxRow));\n var sc1 = Math.max(0, Math.min(s.c1, maxColumn));\n var sr2 = Math.max(0, Math.min(s.r2, maxRow));\n var sc2 = Math.max(0, Math.min(s.c2, maxColumn));\n for (var r = sr1; r <= sr2; ++r) {\n for (var c = sc1; c <= sc2; ++c) {\n dataModel.setData('body', r, c, null);\n }\n }\n }\n }\n };\n /**\n * Handle the `'C'` key press for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The keyboard event of interest.\n */\n BasicKeyHandler.prototype.onKeyC = function (grid, event) {\n // Bail early if the modifiers aren't correct for copy.\n if (event.shiftKey || !domutils.Platform.accelKey(event)) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Copy the current selection to the clipboard.\n grid.copyToClipboard();\n };\n return BasicKeyHandler;\n}());\n\nexports.BasicKeyHandler = BasicKeyHandler;\n//# sourceMappingURL=basickeyhandler.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/basickeyhandler.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/basicmousehandler.js": │ │ │ │ /*!******************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/basicmousehandler.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/basicmousehandler.js ***! │ │ │ │ \******************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\n\n/**\n * A basic implementation of a data grid mouse handler.\n *\n * #### Notes\n * This class may be subclassed and customized as needed.\n */\nvar BasicMouseHandler = /** @class */ (function () {\n function BasicMouseHandler() {\n this._disposed = false;\n }\n /**\n * Dispose of the resources held by the mouse handler.\n */\n BasicMouseHandler.prototype.dispose = function () {\n // Bail early if the handler is already disposed.\n if (this._disposed) {\n return;\n }\n // Release any held resources.\n this.release();\n // Mark the handler as disposed.\n this._disposed = true;\n };\n Object.defineProperty(BasicMouseHandler.prototype, \"isDisposed\", {\n /**\n * Whether the mouse handler is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Release the resources held by the handler.\n */\n BasicMouseHandler.prototype.release = function () {\n // Bail early if the is no press data.\n if (!this._pressData) {\n return;\n }\n // Clear the autoselect timeout.\n if (this._pressData.type === 'select') {\n this._pressData.timeout = -1;\n }\n // Clear the press data.\n this._pressData.override.dispose();\n this._pressData = null;\n };\n /**\n * Handle the mouse hover event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse hover event of interest.\n */\n BasicMouseHandler.prototype.onMouseHover = function (grid, event) {\n // Hit test the grid.\n var hit = grid.hitTest(event.clientX, event.clientY);\n // Get the resize handle for the hit test.\n var handle = Private.resizeHandleForHitTest(hit);\n // Fetch the cursor for the handle.\n var cursor = this.cursorForHandle(handle);\n // Update the viewport cursor based on the part.\n grid.viewport.node.style.cursor = cursor;\n // TODO support user-defined hover items\n };\n /**\n * Handle the mouse leave event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse hover event of interest.\n */\n BasicMouseHandler.prototype.onMouseLeave = function (grid, event) {\n // TODO support user-defined hover popups.\n // Clear the viewport cursor.\n grid.viewport.node.style.cursor = '';\n };\n /**\n * Handle the mouse down event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse down event of interest.\n */\n BasicMouseHandler.prototype.onMouseDown = function (grid, event) {\n // Unpack the event.\n var clientX = event.clientX, clientY = event.clientY;\n // Hit test the grid.\n var hit = grid.hitTest(clientX, clientY);\n // Unpack the hit test.\n var region = hit.region, row = hit.row, column = hit.column;\n // Bail if the hit test is on an uninteresting region.\n if (region === 'void') {\n return;\n }\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // If the hit test is the body region, the only option is select.\n if (region === 'body') {\n // Fetch the selection model.\n var model_1 = grid.selectionModel;\n // Bail early if there is no selection model.\n if (!model_1) {\n return;\n }\n // Override the document cursor.\n var override_1 = dragdrop.Drag.overrideCursor('default');\n // Set up the press data.\n this._pressData = {\n type: 'select',\n region: region, row: row, column: column, override: override_1,\n localX: -1, localY: -1, timeout: -1\n };\n // Set up the selection variables.\n var r1_1;\n var c1_1;\n var r2_1;\n var c2_1;\n var cursorRow_1;\n var cursorColumn_1;\n var clear_1;\n // Accel == new selection, keep old selections.\n if (accel) {\n r1_1 = row;\n r2_1 = row;\n c1_1 = column;\n c2_1 = column;\n cursorRow_1 = row;\n cursorColumn_1 = column;\n clear_1 = 'none';\n }\n else if (shift) {\n r1_1 = model_1.cursorRow;\n r2_1 = row;\n c1_1 = model_1.cursorColumn;\n c2_1 = column;\n cursorRow_1 = model_1.cursorRow;\n cursorColumn_1 = model_1.cursorColumn;\n clear_1 = 'current';\n }\n else {\n r1_1 = row;\n r2_1 = row;\n c1_1 = column;\n c2_1 = column;\n cursorRow_1 = row;\n cursorColumn_1 = column;\n clear_1 = 'all';\n }\n // Use selection mode 'cell'\n model_1.selectionMode = 'cell';\n // Make the selection.\n model_1.select({ r1: r1_1, c1: c1_1, r2: r2_1, c2: c2_1, cursorRow: cursorRow_1, cursorColumn: cursorColumn_1, clear: clear_1 });\n // Done.\n return;\n }\n // Otherwise, the hit test is on a header region.\n // Convert the hit test into a part.\n var handle = Private.resizeHandleForHitTest(hit);\n // Fetch the cursor for the handle.\n var cursor = this.cursorForHandle(handle);\n // Handle horizontal resize.\n if (handle === 'left' || handle === 'right') {\n // Set up the resize data type.\n var type = 'column-resize';\n // Determine the column region.\n var rgn = (region === 'column-header' ? 'body' : 'row-header');\n // Determine the section index.\n var index = handle === 'left' ? column - 1 : column;\n // Fetch the section size.\n var size = grid.columnSize(rgn, index);\n // Override the document cursor.\n var override_2 = dragdrop.Drag.overrideCursor(cursor);\n // Create the temporary press data.\n this._pressData = { type: type, region: rgn, index: index, size: size, clientX: clientX, override: override_2 };\n // Done.\n return;\n }\n // Handle vertical resize\n if (handle === 'top' || handle === 'bottom') {\n // Set up the resize data type.\n var type = 'row-resize';\n // Determine the row region.\n var rgn = (region === 'row-header' ? 'body' : 'column-header');\n // Determine the section index.\n var index = handle === 'top' ? row - 1 : row;\n // Fetch the section size.\n var size = grid.rowSize(rgn, index);\n // Override the document cursor.\n var override_3 = dragdrop.Drag.overrideCursor(cursor);\n // Create the temporary press data.\n this._pressData = { type: type, region: rgn, index: index, size: size, clientY: clientY, override: override_3 };\n // Done.\n return;\n }\n // Otherwise, the only option is select.\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Bail if there is no selection model.\n if (!model) {\n return;\n }\n // Override the document cursor.\n var override = dragdrop.Drag.overrideCursor('default');\n // Set up the press data.\n this._pressData = {\n type: 'select',\n region: region, row: row, column: column, override: override,\n localX: -1, localY: -1, timeout: -1\n };\n // Set up the selection variables.\n var r1;\n var c1;\n var r2;\n var c2;\n var cursorRow;\n var cursorColumn;\n var clear;\n // Compute the selection based on the pressed region.\n if (region === 'corner-header') {\n r1 = 0;\n r2 = Infinity;\n c1 = 0;\n c2 = Infinity;\n cursorRow = accel ? 0 : shift ? model.cursorRow : 0;\n cursorColumn = accel ? 0 : shift ? model.cursorColumn : 0;\n clear = accel ? 'none' : shift ? 'current' : 'all';\n }\n else if (region === 'row-header') {\n r1 = accel ? row : shift ? model.cursorRow : row;\n r2 = row;\n c1 = 0;\n c2 = Infinity;\n cursorRow = accel ? row : shift ? model.cursorRow : row;\n cursorColumn = accel ? 0 : shift ? model.cursorColumn : 0;\n clear = accel ? 'none' : shift ? 'current' : 'all';\n }\n else if (region === 'column-header') {\n r1 = 0;\n r2 = Infinity;\n c1 = accel ? column : shift ? model.cursorColumn : column;\n c2 = column;\n cursorRow = accel ? 0 : shift ? model.cursorRow : 0;\n cursorColumn = accel ? column : shift ? model.cursorColumn : column;\n clear = accel ? 'none' : shift ? 'current' : 'all';\n }\n else {\n r1 = accel ? row : shift ? model.cursorRow : row;\n r2 = row;\n c1 = accel ? column : shift ? model.cursorColumn : column;\n c2 = column;\n cursorRow = accel ? row : shift ? model.cursorRow : row;\n cursorColumn = accel ? column : shift ? model.cursorColumn : column;\n clear = accel ? 'none' : shift ? 'current' : 'all';\n }\n // Set selection mode based on region\n switch (region) {\n case 'column-header':\n model.selectionMode = 'column';\n break;\n case 'row-header':\n model.selectionMode = 'row';\n break;\n default:\n model.selectionMode = 'cell';\n break;\n }\n // Make the selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cursorRow, cursorColumn: cursorColumn, clear: clear });\n };\n /**\n * Handle the mouse move event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse move event of interest.\n */\n BasicMouseHandler.prototype.onMouseMove = function (grid, event) {\n // Fetch the press data.\n var data = this._pressData;\n // Bail early if there is no press data.\n if (!data) {\n return;\n }\n // Handle a row resize.\n if (data.type === 'row-resize') {\n var dy = event.clientY - data.clientY;\n grid.resizeRow(data.region, data.index, data.size + dy);\n return;\n }\n // Handle a column resize.\n if (data.type === 'column-resize') {\n var dx = event.clientX - data.clientX;\n grid.resizeColumn(data.region, data.index, data.size + dx);\n return;\n }\n // Otherwise, it's a select.\n // Mouse moves during a corner header press are a no-op.\n if (data.region === 'corner-header') {\n return;\n }\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Bail early if the selection model was removed.\n if (!model) {\n return;\n }\n // Map to local coordinates.\n var _a = grid.mapToLocal(event.clientX, event.clientY), lx = _a.lx, ly = _a.ly;\n // Update the local mouse coordinates in the press data.\n data.localX = lx;\n data.localY = ly;\n // Fetch the grid geometry.\n var hw = grid.headerWidth;\n var hh = grid.headerHeight;\n var vpw = grid.viewportWidth;\n var vph = grid.viewportHeight;\n var sx = grid.scrollX;\n var sy = grid.scrollY;\n var msx = grid.maxScrollY;\n var msy = grid.maxScrollY;\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Set up the timeout variable.\n var timeout = -1;\n // Compute the timemout based on hit region and mouse position.\n if (data.region === 'row-header' || mode === 'row') {\n if (ly < hh && sy > 0) {\n timeout = Private.computeTimeout(hh - ly);\n }\n else if (ly >= vph && sy < msy) {\n timeout = Private.computeTimeout(ly - vph);\n }\n }\n else if (data.region === 'column-header' || mode === 'column') {\n if (lx < hw && sx > 0) {\n timeout = Private.computeTimeout(hw - lx);\n }\n else if (lx >= vpw && sx < msx) {\n timeout = Private.computeTimeout(lx - vpw);\n }\n }\n else {\n if (lx < hw && sx > 0) {\n timeout = Private.computeTimeout(hw - lx);\n }\n else if (lx >= vpw && sx < msx) {\n timeout = Private.computeTimeout(lx - vpw);\n }\n else if (ly < hh && sy > 0) {\n timeout = Private.computeTimeout(hh - ly);\n }\n else if (ly >= vph && sy < msy) {\n timeout = Private.computeTimeout(ly - vph);\n }\n }\n // Update or initiate the autoselect if needed.\n if (timeout >= 0) {\n if (data.timeout < 0) {\n data.timeout = timeout;\n setTimeout(function () { Private.autoselect(grid, data); }, timeout);\n }\n else {\n data.timeout = timeout;\n }\n return;\n }\n // Otherwise, clear the autoselect timeout.\n data.timeout = -1;\n // Map the position to virtual coordinates.\n var _b = grid.mapToVirtual(event.clientX, event.clientY), vx = _b.vx, vy = _b.vy;\n // Clamp the coordinates to the limits.\n vx = Math.max(0, Math.min(vx, grid.bodyWidth - 1));\n vy = Math.max(0, Math.min(vy, grid.bodyHeight - 1));\n // Set up the selection variables.\n var r1;\n var c1;\n var r2;\n var c2;\n var cursorRow = model.cursorRow;\n var cursorColumn = model.cursorColumn;\n var clear = 'current';\n // Compute the selection based pressed region.\n if (data.region === 'row-header' || mode === 'row') {\n r1 = data.row;\n r2 = grid.rowAt('body', vy);\n c1 = 0;\n c2 = Infinity;\n }\n else if (data.region === 'column-header' || mode === 'column') {\n r1 = 0;\n r2 = Infinity;\n c1 = data.column;\n c2 = grid.columnAt('body', vx);\n }\n else {\n r1 = cursorRow;\n r2 = grid.rowAt('body', vy);\n c1 = cursorColumn;\n c2 = grid.columnAt('body', vx);\n }\n // Make the selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cursorRow, cursorColumn: cursorColumn, clear: clear });\n };\n /**\n * Handle the mouse up event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse up event of interest.\n */\n BasicMouseHandler.prototype.onMouseUp = function (grid, event) {\n this.release();\n };\n /**\n * Handle the mouse double click event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse up event of interest.\n */\n BasicMouseHandler.prototype.onMouseDoubleClick = function (grid, event) {\n if (!grid.dataModel) {\n this.release();\n return;\n }\n // Unpack the event.\n var clientX = event.clientX, clientY = event.clientY;\n // Hit test the grid.\n var hit = grid.hitTest(clientX, clientY);\n // Unpack the hit test.\n var region = hit.region, row = hit.row, column = hit.column;\n if (region === 'void') {\n this.release();\n return;\n }\n if (region === 'body') {\n if (grid.editable) {\n var cell = {\n grid: grid,\n row: row,\n column: column\n };\n grid.editorController.edit(cell);\n }\n }\n this.release();\n };\n /**\n * Handle the context menu event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The context menu event of interest.\n */\n BasicMouseHandler.prototype.onContextMenu = function (grid, event) {\n // TODO support user-defined context menus\n };\n /**\n * Handle the wheel event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The wheel event of interest.\n */\n BasicMouseHandler.prototype.onWheel = function (grid, event) {\n // Bail if a mouse press is in progress.\n if (this._pressData) {\n return;\n }\n // Extract the delta X and Y movement.\n var dx = event.deltaX;\n var dy = event.deltaY;\n // Convert the delta values to pixel values.\n switch (event.deltaMode) {\n case 0: // DOM_DELTA_PIXEL\n break;\n case 1: // DOM_DELTA_LINE\n var ds = grid.defaultSizes;\n dx *= ds.columnWidth;\n dy *= ds.rowHeight;\n break;\n case 2: // DOM_DELTA_PAGE\n dx *= grid.pageWidth;\n dy *= grid.pageHeight;\n break;\n default:\n throw 'unreachable';\n }\n // Scroll by the desired amount.\n grid.scrollBy(dx, dy);\n };\n /**\n * Convert a resize handle into a cursor.\n */\n BasicMouseHandler.prototype.cursorForHandle = function (handle) {\n return Private.cursorMap[handle];\n };\n return BasicMouseHandler;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Get the resize handle for a grid hit test.\n */\n function resizeHandleForHitTest(hit) {\n // Fetch the row and column.\n var r = hit.row;\n var c = hit.column;\n // Fetch the leading and trailing sizes.\n var lw = hit.x;\n var lh = hit.y;\n var tw = hit.width - hit.x;\n var th = hit.height - hit.y;\n // Set up the result variable.\n var result;\n // Dispatch based on hit test region.\n switch (hit.region) {\n case 'corner-header':\n if (c > 0 && lw <= 5) {\n result = 'left';\n }\n else if (tw <= 6) {\n result = 'right';\n }\n else if (r > 0 && lh <= 5) {\n result = 'top';\n }\n else if (th <= 6) {\n result = 'bottom';\n }\n else {\n result = 'none';\n }\n break;\n case 'column-header':\n if (c > 0 && lw <= 5) {\n result = 'left';\n }\n else if (tw <= 6) {\n result = 'right';\n }\n else if (r > 0 && lh <= 5) {\n result = 'top';\n }\n else if (th <= 6) {\n result = 'bottom';\n }\n else {\n result = 'none';\n }\n break;\n case 'row-header':\n if (c > 0 && lw <= 5) {\n result = 'left';\n }\n else if (tw <= 6) {\n result = 'right';\n }\n else if (r > 0 && lh <= 5) {\n result = 'top';\n }\n else if (th <= 6) {\n result = 'bottom';\n }\n else {\n result = 'none';\n }\n break;\n case 'body':\n result = 'none';\n break;\n case 'void':\n result = 'none';\n break;\n default:\n throw 'unreachable';\n }\n // Return the result.\n return result;\n }\n Private.resizeHandleForHitTest = resizeHandleForHitTest;\n /**\n * A timer callback for the autoselect loop.\n *\n * @param grid - The datagrid of interest.\n *\n * @param data - The select data of interest.\n */\n function autoselect(grid, data) {\n // Bail early if the timeout has been reset.\n if (data.timeout < 0) {\n return;\n }\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Bail early if the selection model has been removed.\n if (!model) {\n return;\n }\n // Fetch the current selection.\n var cs = model.currentSelection();\n // Bail early if there is no current selection.\n if (!cs) {\n return;\n }\n // Fetch local X and Y coordinates of the mouse.\n var lx = data.localX;\n var ly = data.localY;\n // Set up the selection variables.\n var r1 = cs.r1;\n var c1 = cs.c1;\n var r2 = cs.r2;\n var c2 = cs.c2;\n var cursorRow = model.cursorRow;\n var cursorColumn = model.cursorColumn;\n var clear = 'current';\n // Fetch the grid geometry.\n var hw = grid.headerWidth;\n var hh = grid.headerHeight;\n var vpw = grid.viewportWidth;\n var vph = grid.viewportHeight;\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Update the selection based on the hit region.\n if (data.region === 'row-header' || mode === 'row') {\n r2 += ly <= hh ? -1 : ly >= vph ? 1 : 0;\n }\n else if (data.region === 'column-header' || mode === 'column') {\n c2 += lx <= hw ? -1 : lx >= vpw ? 1 : 0;\n }\n else {\n r2 += ly <= hh ? -1 : ly >= vph ? 1 : 0;\n c2 += lx <= hw ? -1 : lx >= vpw ? 1 : 0;\n }\n // Update the current selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cursorRow, cursorColumn: cursorColumn, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid based on the hit region.\n if (data.region === 'row-header' || mode === 'row') {\n grid.scrollToRow(cs.r2);\n }\n else if (data.region === 'column-header' || mode == 'column') {\n grid.scrollToColumn(cs.c2);\n }\n else if (mode === 'cell') {\n grid.scrollToCell(cs.r2, cs.c2);\n }\n // Schedule the next call with the current timeout.\n setTimeout(function () { autoselect(grid, data); }, data.timeout);\n }\n Private.autoselect = autoselect;\n /**\n * Compute the scroll timeout for the given delta distance.\n *\n * @param delta - The delta pixels from the origin.\n *\n * @returns The scaled timeout in milliseconds.\n */\n function computeTimeout(delta) {\n return 5 + 120 * (1 - Math.min(128, Math.abs(delta)) / 128);\n }\n Private.computeTimeout = computeTimeout;\n /**\n * A mapping of resize handle to cursor.\n */\n Private.cursorMap = {\n top: 'ns-resize',\n left: 'ew-resize',\n right: 'ew-resize',\n bottom: 'ns-resize',\n none: 'default'\n };\n})(Private || (Private = {}));\n\nexports.BasicMouseHandler = BasicMouseHandler;\n//# sourceMappingURL=basicmousehandler.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/basicmousehandler.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\n\n/**\n * A basic implementation of a data grid mouse handler.\n *\n * #### Notes\n * This class may be subclassed and customized as needed.\n */\nvar BasicMouseHandler = /** @class */ (function () {\n function BasicMouseHandler() {\n this._disposed = false;\n }\n /**\n * Dispose of the resources held by the mouse handler.\n */\n BasicMouseHandler.prototype.dispose = function () {\n // Bail early if the handler is already disposed.\n if (this._disposed) {\n return;\n }\n // Release any held resources.\n this.release();\n // Mark the handler as disposed.\n this._disposed = true;\n };\n Object.defineProperty(BasicMouseHandler.prototype, \"isDisposed\", {\n /**\n * Whether the mouse handler is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Release the resources held by the handler.\n */\n BasicMouseHandler.prototype.release = function () {\n // Bail early if the is no press data.\n if (!this._pressData) {\n return;\n }\n // Clear the autoselect timeout.\n if (this._pressData.type === 'select') {\n this._pressData.timeout = -1;\n }\n // Clear the press data.\n this._pressData.override.dispose();\n this._pressData = null;\n };\n /**\n * Handle the mouse hover event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse hover event of interest.\n */\n BasicMouseHandler.prototype.onMouseHover = function (grid, event) {\n // Hit test the grid.\n var hit = grid.hitTest(event.clientX, event.clientY);\n // Get the resize handle for the hit test.\n var handle = Private.resizeHandleForHitTest(hit);\n // Fetch the cursor for the handle.\n var cursor = this.cursorForHandle(handle);\n // Update the viewport cursor based on the part.\n grid.viewport.node.style.cursor = cursor;\n // TODO support user-defined hover items\n };\n /**\n * Handle the mouse leave event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse hover event of interest.\n */\n BasicMouseHandler.prototype.onMouseLeave = function (grid, event) {\n // TODO support user-defined hover popups.\n // Clear the viewport cursor.\n grid.viewport.node.style.cursor = '';\n };\n /**\n * Handle the mouse down event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse down event of interest.\n */\n BasicMouseHandler.prototype.onMouseDown = function (grid, event) {\n // Unpack the event.\n var clientX = event.clientX, clientY = event.clientY;\n // Hit test the grid.\n var hit = grid.hitTest(clientX, clientY);\n // Unpack the hit test.\n var region = hit.region, row = hit.row, column = hit.column;\n // Bail if the hit test is on an uninteresting region.\n if (region === 'void') {\n return;\n }\n // Fetch the modifier flags.\n var shift = event.shiftKey;\n var accel = domutils.Platform.accelKey(event);\n // If the hit test is the body region, the only option is select.\n if (region === 'body') {\n // Fetch the selection model.\n var model_1 = grid.selectionModel;\n // Bail early if there is no selection model.\n if (!model_1) {\n return;\n }\n // Override the document cursor.\n var override_1 = dragdrop.Drag.overrideCursor('default');\n // Set up the press data.\n this._pressData = {\n type: 'select',\n region: region, row: row, column: column, override: override_1,\n localX: -1, localY: -1, timeout: -1\n };\n // Set up the selection variables.\n var r1_1;\n var c1_1;\n var r2_1;\n var c2_1;\n var cursorRow_1;\n var cursorColumn_1;\n var clear_1;\n // Accel == new selection, keep old selections.\n if (accel) {\n r1_1 = row;\n r2_1 = row;\n c1_1 = column;\n c2_1 = column;\n cursorRow_1 = row;\n cursorColumn_1 = column;\n clear_1 = 'none';\n }\n else if (shift) {\n r1_1 = model_1.cursorRow;\n r2_1 = row;\n c1_1 = model_1.cursorColumn;\n c2_1 = column;\n cursorRow_1 = model_1.cursorRow;\n cursorColumn_1 = model_1.cursorColumn;\n clear_1 = 'current';\n }\n else {\n r1_1 = row;\n r2_1 = row;\n c1_1 = column;\n c2_1 = column;\n cursorRow_1 = row;\n cursorColumn_1 = column;\n clear_1 = 'all';\n }\n // Use selection mode 'cell'\n model_1.selectionMode = 'cell';\n // Make the selection.\n model_1.select({ r1: r1_1, c1: c1_1, r2: r2_1, c2: c2_1, cursorRow: cursorRow_1, cursorColumn: cursorColumn_1, clear: clear_1 });\n // Done.\n return;\n }\n // Otherwise, the hit test is on a header region.\n // Convert the hit test into a part.\n var handle = Private.resizeHandleForHitTest(hit);\n // Fetch the cursor for the handle.\n var cursor = this.cursorForHandle(handle);\n // Handle horizontal resize.\n if (handle === 'left' || handle === 'right') {\n // Set up the resize data type.\n var type = 'column-resize';\n // Determine the column region.\n var rgn = (region === 'column-header' ? 'body' : 'row-header');\n // Determine the section index.\n var index = handle === 'left' ? column - 1 : column;\n // Fetch the section size.\n var size = grid.columnSize(rgn, index);\n // Override the document cursor.\n var override_2 = dragdrop.Drag.overrideCursor(cursor);\n // Create the temporary press data.\n this._pressData = { type: type, region: rgn, index: index, size: size, clientX: clientX, override: override_2 };\n // Done.\n return;\n }\n // Handle vertical resize\n if (handle === 'top' || handle === 'bottom') {\n // Set up the resize data type.\n var type = 'row-resize';\n // Determine the row region.\n var rgn = (region === 'row-header' ? 'body' : 'column-header');\n // Determine the section index.\n var index = handle === 'top' ? row - 1 : row;\n // Fetch the section size.\n var size = grid.rowSize(rgn, index);\n // Override the document cursor.\n var override_3 = dragdrop.Drag.overrideCursor(cursor);\n // Create the temporary press data.\n this._pressData = { type: type, region: rgn, index: index, size: size, clientY: clientY, override: override_3 };\n // Done.\n return;\n }\n // Otherwise, the only option is select.\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Bail if there is no selection model.\n if (!model) {\n return;\n }\n // Override the document cursor.\n var override = dragdrop.Drag.overrideCursor('default');\n // Set up the press data.\n this._pressData = {\n type: 'select',\n region: region, row: row, column: column, override: override,\n localX: -1, localY: -1, timeout: -1\n };\n // Set up the selection variables.\n var r1;\n var c1;\n var r2;\n var c2;\n var cursorRow;\n var cursorColumn;\n var clear;\n // Compute the selection based on the pressed region.\n if (region === 'corner-header') {\n r1 = 0;\n r2 = Infinity;\n c1 = 0;\n c2 = Infinity;\n cursorRow = accel ? 0 : shift ? model.cursorRow : 0;\n cursorColumn = accel ? 0 : shift ? model.cursorColumn : 0;\n clear = accel ? 'none' : shift ? 'current' : 'all';\n }\n else if (region === 'row-header') {\n r1 = accel ? row : shift ? model.cursorRow : row;\n r2 = row;\n c1 = 0;\n c2 = Infinity;\n cursorRow = accel ? row : shift ? model.cursorRow : row;\n cursorColumn = accel ? 0 : shift ? model.cursorColumn : 0;\n clear = accel ? 'none' : shift ? 'current' : 'all';\n }\n else if (region === 'column-header') {\n r1 = 0;\n r2 = Infinity;\n c1 = accel ? column : shift ? model.cursorColumn : column;\n c2 = column;\n cursorRow = accel ? 0 : shift ? model.cursorRow : 0;\n cursorColumn = accel ? column : shift ? model.cursorColumn : column;\n clear = accel ? 'none' : shift ? 'current' : 'all';\n }\n else {\n r1 = accel ? row : shift ? model.cursorRow : row;\n r2 = row;\n c1 = accel ? column : shift ? model.cursorColumn : column;\n c2 = column;\n cursorRow = accel ? row : shift ? model.cursorRow : row;\n cursorColumn = accel ? column : shift ? model.cursorColumn : column;\n clear = accel ? 'none' : shift ? 'current' : 'all';\n }\n // Set selection mode based on region\n switch (region) {\n case 'column-header':\n model.selectionMode = 'column';\n break;\n case 'row-header':\n model.selectionMode = 'row';\n break;\n default:\n model.selectionMode = 'cell';\n break;\n }\n // Make the selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cursorRow, cursorColumn: cursorColumn, clear: clear });\n };\n /**\n * Handle the mouse move event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse move event of interest.\n */\n BasicMouseHandler.prototype.onMouseMove = function (grid, event) {\n // Fetch the press data.\n var data = this._pressData;\n // Bail early if there is no press data.\n if (!data) {\n return;\n }\n // Handle a row resize.\n if (data.type === 'row-resize') {\n var dy = event.clientY - data.clientY;\n grid.resizeRow(data.region, data.index, data.size + dy);\n return;\n }\n // Handle a column resize.\n if (data.type === 'column-resize') {\n var dx = event.clientX - data.clientX;\n grid.resizeColumn(data.region, data.index, data.size + dx);\n return;\n }\n // Otherwise, it's a select.\n // Mouse moves during a corner header press are a no-op.\n if (data.region === 'corner-header') {\n return;\n }\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Bail early if the selection model was removed.\n if (!model) {\n return;\n }\n // Map to local coordinates.\n var _a = grid.mapToLocal(event.clientX, event.clientY), lx = _a.lx, ly = _a.ly;\n // Update the local mouse coordinates in the press data.\n data.localX = lx;\n data.localY = ly;\n // Fetch the grid geometry.\n var hw = grid.headerWidth;\n var hh = grid.headerHeight;\n var vpw = grid.viewportWidth;\n var vph = grid.viewportHeight;\n var sx = grid.scrollX;\n var sy = grid.scrollY;\n var msx = grid.maxScrollY;\n var msy = grid.maxScrollY;\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Set up the timeout variable.\n var timeout = -1;\n // Compute the timemout based on hit region and mouse position.\n if (data.region === 'row-header' || mode === 'row') {\n if (ly < hh && sy > 0) {\n timeout = Private.computeTimeout(hh - ly);\n }\n else if (ly >= vph && sy < msy) {\n timeout = Private.computeTimeout(ly - vph);\n }\n }\n else if (data.region === 'column-header' || mode === 'column') {\n if (lx < hw && sx > 0) {\n timeout = Private.computeTimeout(hw - lx);\n }\n else if (lx >= vpw && sx < msx) {\n timeout = Private.computeTimeout(lx - vpw);\n }\n }\n else {\n if (lx < hw && sx > 0) {\n timeout = Private.computeTimeout(hw - lx);\n }\n else if (lx >= vpw && sx < msx) {\n timeout = Private.computeTimeout(lx - vpw);\n }\n else if (ly < hh && sy > 0) {\n timeout = Private.computeTimeout(hh - ly);\n }\n else if (ly >= vph && sy < msy) {\n timeout = Private.computeTimeout(ly - vph);\n }\n }\n // Update or initiate the autoselect if needed.\n if (timeout >= 0) {\n if (data.timeout < 0) {\n data.timeout = timeout;\n setTimeout(function () { Private.autoselect(grid, data); }, timeout);\n }\n else {\n data.timeout = timeout;\n }\n return;\n }\n // Otherwise, clear the autoselect timeout.\n data.timeout = -1;\n // Map the position to virtual coordinates.\n var _b = grid.mapToVirtual(event.clientX, event.clientY), vx = _b.vx, vy = _b.vy;\n // Clamp the coordinates to the limits.\n vx = Math.max(0, Math.min(vx, grid.bodyWidth - 1));\n vy = Math.max(0, Math.min(vy, grid.bodyHeight - 1));\n // Set up the selection variables.\n var r1;\n var c1;\n var r2;\n var c2;\n var cursorRow = model.cursorRow;\n var cursorColumn = model.cursorColumn;\n var clear = 'current';\n // Compute the selection based pressed region.\n if (data.region === 'row-header' || mode === 'row') {\n r1 = data.row;\n r2 = grid.rowAt('body', vy);\n c1 = 0;\n c2 = Infinity;\n }\n else if (data.region === 'column-header' || mode === 'column') {\n r1 = 0;\n r2 = Infinity;\n c1 = data.column;\n c2 = grid.columnAt('body', vx);\n }\n else {\n r1 = cursorRow;\n r2 = grid.rowAt('body', vy);\n c1 = cursorColumn;\n c2 = grid.columnAt('body', vx);\n }\n // Make the selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cursorRow, cursorColumn: cursorColumn, clear: clear });\n };\n /**\n * Handle the mouse up event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse up event of interest.\n */\n BasicMouseHandler.prototype.onMouseUp = function (grid, event) {\n this.release();\n };\n /**\n * Handle the mouse double click event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The mouse up event of interest.\n */\n BasicMouseHandler.prototype.onMouseDoubleClick = function (grid, event) {\n if (!grid.dataModel) {\n this.release();\n return;\n }\n // Unpack the event.\n var clientX = event.clientX, clientY = event.clientY;\n // Hit test the grid.\n var hit = grid.hitTest(clientX, clientY);\n // Unpack the hit test.\n var region = hit.region, row = hit.row, column = hit.column;\n if (region === 'void') {\n this.release();\n return;\n }\n if (region === 'body') {\n if (grid.editable) {\n var cell = {\n grid: grid,\n row: row,\n column: column\n };\n grid.editorController.edit(cell);\n }\n }\n this.release();\n };\n /**\n * Handle the context menu event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The context menu event of interest.\n */\n BasicMouseHandler.prototype.onContextMenu = function (grid, event) {\n // TODO support user-defined context menus\n };\n /**\n * Handle the wheel event for the data grid.\n *\n * @param grid - The data grid of interest.\n *\n * @param event - The wheel event of interest.\n */\n BasicMouseHandler.prototype.onWheel = function (grid, event) {\n // Bail if a mouse press is in progress.\n if (this._pressData) {\n return;\n }\n // Extract the delta X and Y movement.\n var dx = event.deltaX;\n var dy = event.deltaY;\n // Convert the delta values to pixel values.\n switch (event.deltaMode) {\n case 0: // DOM_DELTA_PIXEL\n break;\n case 1: // DOM_DELTA_LINE\n var ds = grid.defaultSizes;\n dx *= ds.columnWidth;\n dy *= ds.rowHeight;\n break;\n case 2: // DOM_DELTA_PAGE\n dx *= grid.pageWidth;\n dy *= grid.pageHeight;\n break;\n default:\n throw 'unreachable';\n }\n // Scroll by the desired amount.\n grid.scrollBy(dx, dy);\n };\n /**\n * Convert a resize handle into a cursor.\n */\n BasicMouseHandler.prototype.cursorForHandle = function (handle) {\n return Private.cursorMap[handle];\n };\n return BasicMouseHandler;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Get the resize handle for a grid hit test.\n */\n function resizeHandleForHitTest(hit) {\n // Fetch the row and column.\n var r = hit.row;\n var c = hit.column;\n // Fetch the leading and trailing sizes.\n var lw = hit.x;\n var lh = hit.y;\n var tw = hit.width - hit.x;\n var th = hit.height - hit.y;\n // Set up the result variable.\n var result;\n // Dispatch based on hit test region.\n switch (hit.region) {\n case 'corner-header':\n if (c > 0 && lw <= 5) {\n result = 'left';\n }\n else if (tw <= 6) {\n result = 'right';\n }\n else if (r > 0 && lh <= 5) {\n result = 'top';\n }\n else if (th <= 6) {\n result = 'bottom';\n }\n else {\n result = 'none';\n }\n break;\n case 'column-header':\n if (c > 0 && lw <= 5) {\n result = 'left';\n }\n else if (tw <= 6) {\n result = 'right';\n }\n else if (r > 0 && lh <= 5) {\n result = 'top';\n }\n else if (th <= 6) {\n result = 'bottom';\n }\n else {\n result = 'none';\n }\n break;\n case 'row-header':\n if (c > 0 && lw <= 5) {\n result = 'left';\n }\n else if (tw <= 6) {\n result = 'right';\n }\n else if (r > 0 && lh <= 5) {\n result = 'top';\n }\n else if (th <= 6) {\n result = 'bottom';\n }\n else {\n result = 'none';\n }\n break;\n case 'body':\n result = 'none';\n break;\n case 'void':\n result = 'none';\n break;\n default:\n throw 'unreachable';\n }\n // Return the result.\n return result;\n }\n Private.resizeHandleForHitTest = resizeHandleForHitTest;\n /**\n * A timer callback for the autoselect loop.\n *\n * @param grid - The datagrid of interest.\n *\n * @param data - The select data of interest.\n */\n function autoselect(grid, data) {\n // Bail early if the timeout has been reset.\n if (data.timeout < 0) {\n return;\n }\n // Fetch the selection model.\n var model = grid.selectionModel;\n // Bail early if the selection model has been removed.\n if (!model) {\n return;\n }\n // Fetch the current selection.\n var cs = model.currentSelection();\n // Bail early if there is no current selection.\n if (!cs) {\n return;\n }\n // Fetch local X and Y coordinates of the mouse.\n var lx = data.localX;\n var ly = data.localY;\n // Set up the selection variables.\n var r1 = cs.r1;\n var c1 = cs.c1;\n var r2 = cs.r2;\n var c2 = cs.c2;\n var cursorRow = model.cursorRow;\n var cursorColumn = model.cursorColumn;\n var clear = 'current';\n // Fetch the grid geometry.\n var hw = grid.headerWidth;\n var hh = grid.headerHeight;\n var vpw = grid.viewportWidth;\n var vph = grid.viewportHeight;\n // Fetch the selection mode.\n var mode = model.selectionMode;\n // Update the selection based on the hit region.\n if (data.region === 'row-header' || mode === 'row') {\n r2 += ly <= hh ? -1 : ly >= vph ? 1 : 0;\n }\n else if (data.region === 'column-header' || mode === 'column') {\n c2 += lx <= hw ? -1 : lx >= vpw ? 1 : 0;\n }\n else {\n r2 += ly <= hh ? -1 : ly >= vph ? 1 : 0;\n c2 += lx <= hw ? -1 : lx >= vpw ? 1 : 0;\n }\n // Update the current selection.\n model.select({ r1: r1, c1: c1, r2: r2, c2: c2, cursorRow: cursorRow, cursorColumn: cursorColumn, clear: clear });\n // Re-fetch the current selection.\n cs = model.currentSelection();\n // Bail if there is no selection.\n if (!cs) {\n return;\n }\n // Scroll the grid based on the hit region.\n if (data.region === 'row-header' || mode === 'row') {\n grid.scrollToRow(cs.r2);\n }\n else if (data.region === 'column-header' || mode == 'column') {\n grid.scrollToColumn(cs.c2);\n }\n else if (mode === 'cell') {\n grid.scrollToCell(cs.r2, cs.c2);\n }\n // Schedule the next call with the current timeout.\n setTimeout(function () { autoselect(grid, data); }, data.timeout);\n }\n Private.autoselect = autoselect;\n /**\n * Compute the scroll timeout for the given delta distance.\n *\n * @param delta - The delta pixels from the origin.\n *\n * @returns The scaled timeout in milliseconds.\n */\n function computeTimeout(delta) {\n return 5 + 120 * (1 - Math.min(128, Math.abs(delta)) / 128);\n }\n Private.computeTimeout = computeTimeout;\n /**\n * A mapping of resize handle to cursor.\n */\n Private.cursorMap = {\n top: 'ns-resize',\n left: 'ew-resize',\n right: 'ew-resize',\n bottom: 'ns-resize',\n none: 'default'\n };\n})(Private || (Private = {}));\n\nexports.BasicMouseHandler = BasicMouseHandler;\n//# sourceMappingURL=basicmousehandler.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/basicmousehandler.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/basicselectionmodel.js": │ │ │ │ /*!********************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/basicselectionmodel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/basicselectionmodel.js ***! │ │ │ │ \********************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar selectionmodel = __webpack_require__(/*! ./selectionmodel.js */ \"../../packages/datagrid/dist/selectionmodel.js\");\n\n/**\n * A basic selection model implementation.\n *\n * #### Notes\n * This selection model is sufficient for most use cases where\n * structural knowledge of the data source is *not* required.\n */\nvar BasicSelectionModel = /** @class */ (function (_super) {\n tslib.__extends(BasicSelectionModel, _super);\n function BasicSelectionModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._cursorRow = -1;\n _this._cursorColumn = -1;\n _this._cursorRectIndex = -1;\n _this._selections = [];\n return _this;\n }\n Object.defineProperty(BasicSelectionModel.prototype, \"isEmpty\", {\n /**\n * Wether the selection model is empty.\n */\n get: function () {\n return this._selections.length === 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BasicSelectionModel.prototype, \"cursorRow\", {\n /**\n * The row index of the cursor.\n */\n get: function () {\n return this._cursorRow;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BasicSelectionModel.prototype, \"cursorColumn\", {\n /**\n * The column index of the cursor.\n */\n get: function () {\n return this._cursorColumn;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Move cursor down/up/left/right while making sure it remains\n * within the bounds of selected rectangles\n *\n * @param direction - The direction of the movement.\n */\n BasicSelectionModel.prototype.moveCursorWithinSelections = function (direction) {\n var _this = this;\n // Bail early if there are no selections or no existing cursor\n if (this.isEmpty || this.cursorRow === -1 || this._cursorColumn === -1) {\n return;\n }\n // Bail early if only single cell is selected\n var firstSelection = this._selections[0];\n if (this._selections.length === 1 &&\n firstSelection.r1 === firstSelection.r2 &&\n firstSelection.c1 === firstSelection.c2) {\n return;\n }\n // start from last selection rectangle\n if (this._cursorRectIndex === -1) {\n this._cursorRectIndex = this._selections.length - 1;\n }\n var cursorRect = this._selections[this._cursorRectIndex];\n var dr = direction === 'down' ? 1 : direction === 'up' ? -1 : 0;\n var dc = direction === 'right' ? 1 : direction === 'left' ? -1 : 0;\n var newRow = this._cursorRow + dr;\n var newColumn = this._cursorColumn + dc;\n var r1 = Math.min(cursorRect.r1, cursorRect.r2);\n var r2 = Math.max(cursorRect.r1, cursorRect.r2);\n var c1 = Math.min(cursorRect.c1, cursorRect.c2);\n var c2 = Math.max(cursorRect.c1, cursorRect.c2);\n var moveToNextRect = function () {\n _this._cursorRectIndex = (_this._cursorRectIndex + 1) % _this._selections.length;\n cursorRect = _this._selections[_this._cursorRectIndex];\n newRow = Math.min(cursorRect.r1, cursorRect.r2);\n newColumn = Math.min(cursorRect.c1, cursorRect.c2);\n };\n var moveToPreviousRect = function () {\n _this._cursorRectIndex = _this._cursorRectIndex === 0 ? _this._selections.length - 1 : _this._cursorRectIndex - 1;\n cursorRect = _this._selections[_this._cursorRectIndex];\n newRow = Math.max(cursorRect.r1, cursorRect.r2);\n newColumn = Math.max(cursorRect.c1, cursorRect.c2);\n };\n if (newRow > r2) {\n newRow = r1;\n newColumn += 1;\n if (newColumn > c2) {\n moveToNextRect();\n }\n }\n else if (newRow < r1) {\n newRow = r2;\n newColumn -= 1;\n if (newColumn < c1) {\n moveToPreviousRect();\n }\n }\n else if (newColumn > c2) {\n newColumn = c1;\n newRow += 1;\n if (newRow > r2) {\n moveToNextRect();\n }\n }\n else if (newColumn < c1) {\n newColumn = c2;\n newRow -= 1;\n if (newRow < r1) {\n moveToPreviousRect();\n }\n }\n this._cursorRow = newRow;\n this._cursorColumn = newColumn;\n // Emit the changed signal.\n this.emitChanged();\n };\n /**\n * Get the current selection in the selection model.\n *\n * @returns The current selection or `null`.\n *\n * #### Notes\n * This is the selection which holds the cursor.\n */\n BasicSelectionModel.prototype.currentSelection = function () {\n return this._selections[this._selections.length - 1] || null;\n };\n /**\n * Get an iterator of the selections in the model.\n *\n * @returns A new iterator of the current selections.\n *\n * #### Notes\n * The data grid will render the selections in order.\n */\n BasicSelectionModel.prototype.selections = function () {\n return algorithm.iter(this._selections);\n };\n /**\n * Select the specified cells.\n *\n * @param args - The arguments for the selection.\n */\n BasicSelectionModel.prototype.select = function (args) {\n // Fetch the current row and column counts;\n var rowCount = this.dataModel.rowCount('body');\n var columnCount = this.dataModel.columnCount('body');\n // Bail early if there is no content.\n if (rowCount <= 0 || columnCount <= 0) {\n return;\n }\n // Unpack the arguments.\n var r1 = args.r1, c1 = args.c1, r2 = args.r2, c2 = args.c2, cursorRow = args.cursorRow, cursorColumn = args.cursorColumn, clear = args.clear;\n // Clear the necessary selections.\n if (clear === 'all') {\n this._selections.length = 0;\n }\n else if (clear === 'current') {\n this._selections.pop();\n }\n // Clamp to the data model bounds.\n r1 = Math.max(0, Math.min(r1, rowCount - 1));\n r2 = Math.max(0, Math.min(r2, rowCount - 1));\n c1 = Math.max(0, Math.min(c1, columnCount - 1));\n c2 = Math.max(0, Math.min(c2, columnCount - 1));\n // Handle the selection mode.\n if (this.selectionMode === 'row') {\n c1 = 0;\n c2 = columnCount - 1;\n }\n else if (this.selectionMode === 'column') {\n r1 = 0;\n r2 = rowCount - 1;\n }\n // Alias the cursor row and column.\n var cr = cursorRow;\n var cc = cursorColumn;\n // Compute the new cursor location.\n if (cr < 0 || (cr < r1 && cr < r2) || (cr > r1 && cr > r2)) {\n cr = r1;\n }\n if (cc < 0 || (cc < c1 && cc < c2) || (cc > c1 && cc > c2)) {\n cc = c1;\n }\n // Update the cursor.\n this._cursorRow = cr;\n this._cursorColumn = cc;\n this._cursorRectIndex = this._selections.length;\n // Add the new selection.\n this._selections.push({ r1: r1, c1: c1, r2: r2, c2: c2 });\n // Emit the changed signal.\n this.emitChanged();\n };\n /**\n * Clear all selections in the selection model.\n */\n BasicSelectionModel.prototype.clear = function () {\n // Bail early if there are no selections.\n if (this._selections.length === 0) {\n return;\n }\n // Reset the internal state.\n this._cursorRow = -1;\n this._cursorColumn = -1;\n this._cursorRectIndex = -1;\n this._selections.length = 0;\n // Emit the changed signal.\n this.emitChanged();\n };\n /**\n * A signal handler for the data model `changed` signal.\n *\n * @param args - The arguments for the signal.\n */\n BasicSelectionModel.prototype.onDataModelChanged = function (sender, args) {\n // Bail early if the model has no current selections.\n if (this._selections.length === 0) {\n return;\n }\n // Bail early if the cells have changed in place.\n if (args.type === 'cells-changed') {\n return;\n }\n // Bail early if there is no change to the row or column count.\n if (args.type === 'rows-moved' || args.type === 'columns-moved') {\n return;\n }\n // Fetch the last row and column index.\n var lr = sender.rowCount('body') - 1;\n var lc = sender.columnCount('body') - 1;\n // Bail early if the data model is empty.\n if (lr < 0 || lc < 0) {\n this._selections.length = 0;\n this.emitChanged();\n return;\n }\n // Fetch the selection mode.\n var mode = this.selectionMode;\n // Set up the assignment index variable.\n var j = 0;\n // Iterate over the current selections.\n for (var i = 0, n = this._selections.length; i < n; ++i) {\n // Unpack the selection.\n var _a = this._selections[i], r1 = _a.r1, c1 = _a.c1, r2 = _a.r2, c2 = _a.c2;\n // Skip the selection if it will disappear.\n if ((lr < r1 && lr < r2) || (lc < c1 && lc < c2)) {\n continue;\n }\n // Modify the bounds based on the selection mode.\n if (mode === 'row') {\n r1 = Math.max(0, Math.min(r1, lr));\n r2 = Math.max(0, Math.min(r2, lr));\n c1 = 0;\n c2 = lc;\n }\n else if (mode === 'column') {\n r1 = 0;\n r2 = lr;\n c1 = Math.max(0, Math.min(c1, lc));\n c2 = Math.max(0, Math.min(c2, lc));\n }\n else {\n r1 = Math.max(0, Math.min(r1, lr));\n r2 = Math.max(0, Math.min(r2, lr));\n c1 = Math.max(0, Math.min(c1, lc));\n c2 = Math.max(0, Math.min(c2, lc));\n }\n // Assign the modified selection to the array.\n this._selections[j++] = { r1: r1, c1: c1, r2: r2, c2: c2 };\n }\n // Remove the stale selections.\n this._selections.length = j;\n // Emit the changed signal.\n this.emitChanged();\n };\n return BasicSelectionModel;\n}(selectionmodel.SelectionModel));\n\nexports.BasicSelectionModel = BasicSelectionModel;\n//# sourceMappingURL=basicselectionmodel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/basicselectionmodel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar selectionmodel = __webpack_require__(/*! ./selectionmodel.js */ \"../../packages/datagrid/dist/selectionmodel.js\");\n\n/**\n * A basic selection model implementation.\n *\n * #### Notes\n * This selection model is sufficient for most use cases where\n * structural knowledge of the data source is *not* required.\n */\nvar BasicSelectionModel = /** @class */ (function (_super) {\n tslib.__extends(BasicSelectionModel, _super);\n function BasicSelectionModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._cursorRow = -1;\n _this._cursorColumn = -1;\n _this._cursorRectIndex = -1;\n _this._selections = [];\n return _this;\n }\n Object.defineProperty(BasicSelectionModel.prototype, \"isEmpty\", {\n /**\n * Wether the selection model is empty.\n */\n get: function () {\n return this._selections.length === 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BasicSelectionModel.prototype, \"cursorRow\", {\n /**\n * The row index of the cursor.\n */\n get: function () {\n return this._cursorRow;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BasicSelectionModel.prototype, \"cursorColumn\", {\n /**\n * The column index of the cursor.\n */\n get: function () {\n return this._cursorColumn;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Move cursor down/up/left/right while making sure it remains\n * within the bounds of selected rectangles\n *\n * @param direction - The direction of the movement.\n */\n BasicSelectionModel.prototype.moveCursorWithinSelections = function (direction) {\n var _this = this;\n // Bail early if there are no selections or no existing cursor\n if (this.isEmpty || this.cursorRow === -1 || this._cursorColumn === -1) {\n return;\n }\n // Bail early if only single cell is selected\n var firstSelection = this._selections[0];\n if (this._selections.length === 1 &&\n firstSelection.r1 === firstSelection.r2 &&\n firstSelection.c1 === firstSelection.c2) {\n return;\n }\n // start from last selection rectangle\n if (this._cursorRectIndex === -1) {\n this._cursorRectIndex = this._selections.length - 1;\n }\n var cursorRect = this._selections[this._cursorRectIndex];\n var dr = direction === 'down' ? 1 : direction === 'up' ? -1 : 0;\n var dc = direction === 'right' ? 1 : direction === 'left' ? -1 : 0;\n var newRow = this._cursorRow + dr;\n var newColumn = this._cursorColumn + dc;\n var r1 = Math.min(cursorRect.r1, cursorRect.r2);\n var r2 = Math.max(cursorRect.r1, cursorRect.r2);\n var c1 = Math.min(cursorRect.c1, cursorRect.c2);\n var c2 = Math.max(cursorRect.c1, cursorRect.c2);\n var moveToNextRect = function () {\n _this._cursorRectIndex = (_this._cursorRectIndex + 1) % _this._selections.length;\n cursorRect = _this._selections[_this._cursorRectIndex];\n newRow = Math.min(cursorRect.r1, cursorRect.r2);\n newColumn = Math.min(cursorRect.c1, cursorRect.c2);\n };\n var moveToPreviousRect = function () {\n _this._cursorRectIndex = _this._cursorRectIndex === 0 ? _this._selections.length - 1 : _this._cursorRectIndex - 1;\n cursorRect = _this._selections[_this._cursorRectIndex];\n newRow = Math.max(cursorRect.r1, cursorRect.r2);\n newColumn = Math.max(cursorRect.c1, cursorRect.c2);\n };\n if (newRow > r2) {\n newRow = r1;\n newColumn += 1;\n if (newColumn > c2) {\n moveToNextRect();\n }\n }\n else if (newRow < r1) {\n newRow = r2;\n newColumn -= 1;\n if (newColumn < c1) {\n moveToPreviousRect();\n }\n }\n else if (newColumn > c2) {\n newColumn = c1;\n newRow += 1;\n if (newRow > r2) {\n moveToNextRect();\n }\n }\n else if (newColumn < c1) {\n newColumn = c2;\n newRow -= 1;\n if (newRow < r1) {\n moveToPreviousRect();\n }\n }\n this._cursorRow = newRow;\n this._cursorColumn = newColumn;\n // Emit the changed signal.\n this.emitChanged();\n };\n /**\n * Get the current selection in the selection model.\n *\n * @returns The current selection or `null`.\n *\n * #### Notes\n * This is the selection which holds the cursor.\n */\n BasicSelectionModel.prototype.currentSelection = function () {\n return this._selections[this._selections.length - 1] || null;\n };\n /**\n * Get an iterator of the selections in the model.\n *\n * @returns A new iterator of the current selections.\n *\n * #### Notes\n * The data grid will render the selections in order.\n */\n BasicSelectionModel.prototype.selections = function () {\n return algorithm.iter(this._selections);\n };\n /**\n * Select the specified cells.\n *\n * @param args - The arguments for the selection.\n */\n BasicSelectionModel.prototype.select = function (args) {\n // Fetch the current row and column counts;\n var rowCount = this.dataModel.rowCount('body');\n var columnCount = this.dataModel.columnCount('body');\n // Bail early if there is no content.\n if (rowCount <= 0 || columnCount <= 0) {\n return;\n }\n // Unpack the arguments.\n var r1 = args.r1, c1 = args.c1, r2 = args.r2, c2 = args.c2, cursorRow = args.cursorRow, cursorColumn = args.cursorColumn, clear = args.clear;\n // Clear the necessary selections.\n if (clear === 'all') {\n this._selections.length = 0;\n }\n else if (clear === 'current') {\n this._selections.pop();\n }\n // Clamp to the data model bounds.\n r1 = Math.max(0, Math.min(r1, rowCount - 1));\n r2 = Math.max(0, Math.min(r2, rowCount - 1));\n c1 = Math.max(0, Math.min(c1, columnCount - 1));\n c2 = Math.max(0, Math.min(c2, columnCount - 1));\n // Handle the selection mode.\n if (this.selectionMode === 'row') {\n c1 = 0;\n c2 = columnCount - 1;\n }\n else if (this.selectionMode === 'column') {\n r1 = 0;\n r2 = rowCount - 1;\n }\n // Alias the cursor row and column.\n var cr = cursorRow;\n var cc = cursorColumn;\n // Compute the new cursor location.\n if (cr < 0 || (cr < r1 && cr < r2) || (cr > r1 && cr > r2)) {\n cr = r1;\n }\n if (cc < 0 || (cc < c1 && cc < c2) || (cc > c1 && cc > c2)) {\n cc = c1;\n }\n // Update the cursor.\n this._cursorRow = cr;\n this._cursorColumn = cc;\n this._cursorRectIndex = this._selections.length;\n // Add the new selection.\n this._selections.push({ r1: r1, c1: c1, r2: r2, c2: c2 });\n // Emit the changed signal.\n this.emitChanged();\n };\n /**\n * Clear all selections in the selection model.\n */\n BasicSelectionModel.prototype.clear = function () {\n // Bail early if there are no selections.\n if (this._selections.length === 0) {\n return;\n }\n // Reset the internal state.\n this._cursorRow = -1;\n this._cursorColumn = -1;\n this._cursorRectIndex = -1;\n this._selections.length = 0;\n // Emit the changed signal.\n this.emitChanged();\n };\n /**\n * A signal handler for the data model `changed` signal.\n *\n * @param args - The arguments for the signal.\n */\n BasicSelectionModel.prototype.onDataModelChanged = function (sender, args) {\n // Bail early if the model has no current selections.\n if (this._selections.length === 0) {\n return;\n }\n // Bail early if the cells have changed in place.\n if (args.type === 'cells-changed') {\n return;\n }\n // Bail early if there is no change to the row or column count.\n if (args.type === 'rows-moved' || args.type === 'columns-moved') {\n return;\n }\n // Fetch the last row and column index.\n var lr = sender.rowCount('body') - 1;\n var lc = sender.columnCount('body') - 1;\n // Bail early if the data model is empty.\n if (lr < 0 || lc < 0) {\n this._selections.length = 0;\n this.emitChanged();\n return;\n }\n // Fetch the selection mode.\n var mode = this.selectionMode;\n // Set up the assignment index variable.\n var j = 0;\n // Iterate over the current selections.\n for (var i = 0, n = this._selections.length; i < n; ++i) {\n // Unpack the selection.\n var _a = this._selections[i], r1 = _a.r1, c1 = _a.c1, r2 = _a.r2, c2 = _a.c2;\n // Skip the selection if it will disappear.\n if ((lr < r1 && lr < r2) || (lc < c1 && lc < c2)) {\n continue;\n }\n // Modify the bounds based on the selection mode.\n if (mode === 'row') {\n r1 = Math.max(0, Math.min(r1, lr));\n r2 = Math.max(0, Math.min(r2, lr));\n c1 = 0;\n c2 = lc;\n }\n else if (mode === 'column') {\n r1 = 0;\n r2 = lr;\n c1 = Math.max(0, Math.min(c1, lc));\n c2 = Math.max(0, Math.min(c2, lc));\n }\n else {\n r1 = Math.max(0, Math.min(r1, lr));\n r2 = Math.max(0, Math.min(r2, lr));\n c1 = Math.max(0, Math.min(c1, lc));\n c2 = Math.max(0, Math.min(c2, lc));\n }\n // Assign the modified selection to the array.\n this._selections[j++] = { r1: r1, c1: c1, r2: r2, c2: c2 };\n }\n // Remove the stale selections.\n this._selections.length = j;\n // Emit the changed signal.\n this.emitChanged();\n };\n return BasicSelectionModel;\n}(selectionmodel.SelectionModel));\n\nexports.BasicSelectionModel = BasicSelectionModel;\n//# sourceMappingURL=basicselectionmodel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/basicselectionmodel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/celleditor.js": │ │ │ │ /*!***********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/celleditor.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/celleditor.js ***! │ │ │ │ \***********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\nvar notification = __webpack_require__(/*! ./notification.js */ \"../../packages/datagrid/dist/notification.js\");\n\n// default validation error message\nvar DEFAULT_INVALID_INPUT_MESSAGE = \"Invalid input!\";\n/**\n * A cell input validator object which always returns valid.\n */\nvar PassInputValidator = /** @class */ (function () {\n function PassInputValidator() {\n }\n /**\n * Validate cell input.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param value - The cell value input.\n *\n * @returns An object with validation result.\n */\n PassInputValidator.prototype.validate = function (cell, value) {\n return { valid: true };\n };\n return PassInputValidator;\n}());\n/**\n * Text cell input validator.\n */\nvar TextInputValidator = /** @class */ (function () {\n function TextInputValidator() {\n /**\n * Minimum text length\n *\n * The default is Number.NaN, meaning no minimum constraint\n */\n this.minLength = Number.NaN;\n /**\n * Maximum text length\n *\n * The default is Number.NaN, meaning no maximum constraint\n */\n this.maxLength = Number.NaN;\n /**\n * Required text pattern as regular expression\n *\n * The default is null, meaning no pattern constraint\n */\n this.pattern = null;\n }\n /**\n * Validate cell input.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param value - The cell value input.\n *\n * @returns An object with validation result.\n */\n TextInputValidator.prototype.validate = function (cell, value) {\n if (value === null) {\n return { valid: true };\n }\n if (typeof value !== 'string') {\n return {\n valid: false,\n message: 'Input must be valid text'\n };\n }\n if (!isNaN(this.minLength) && value.length < this.minLength) {\n return {\n valid: false,\n message: \"Text length must be greater than \" + this.minLength\n };\n }\n if (!isNaN(this.maxLength) && value.length > this.maxLength) {\n return {\n valid: false,\n message: \"Text length must be less than \" + this.maxLength\n };\n }\n if (this.pattern && !this.pattern.test(value)) {\n return {\n valid: false,\n message: \"Text doesn't match the required pattern\"\n };\n }\n return { valid: true };\n };\n return TextInputValidator;\n}());\n/**\n * Integer cell input validator.\n */\nvar IntegerInputValidator = /** @class */ (function () {\n function IntegerInputValidator() {\n /**\n * Minimum value\n *\n * The default is Number.NaN, meaning no minimum constraint\n */\n this.min = Number.NaN;\n /**\n * Maximum value\n *\n * The default is Number.NaN, meaning no maximum constraint\n */\n this.max = Number.NaN;\n }\n /**\n * Validate cell input.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param value - The cell value input.\n *\n * @returns An object with validation result.\n */\n IntegerInputValidator.prototype.validate = function (cell, value) {\n if (value === null) {\n return { valid: true };\n }\n if (isNaN(value) || (value % 1 !== 0)) {\n return {\n valid: false,\n message: 'Input must be valid integer'\n };\n }\n if (!isNaN(this.min) && value < this.min) {\n return {\n valid: false,\n message: \"Input must be greater than \" + this.min\n };\n }\n if (!isNaN(this.max) && value > this.max) {\n return {\n valid: false,\n message: \"Input must be less than \" + this.max\n };\n }\n return { valid: true };\n };\n return IntegerInputValidator;\n}());\n/**\n * Real number cell input validator.\n */\nvar NumberInputValidator = /** @class */ (function () {\n function NumberInputValidator() {\n /**\n * Minimum value\n *\n * The default is Number.NaN, meaning no minimum constraint\n */\n this.min = Number.NaN;\n /**\n * Maximum value\n *\n * The default is Number.NaN, meaning no maximum constraint\n */\n this.max = Number.NaN;\n }\n /**\n * Validate cell input.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param value - The cell value input.\n *\n * @returns An object with validation result.\n */\n NumberInputValidator.prototype.validate = function (cell, value) {\n if (value === null) {\n return { valid: true };\n }\n if (isNaN(value)) {\n return {\n valid: false,\n message: 'Input must be valid number'\n };\n }\n if (!isNaN(this.min) && value < this.min) {\n return {\n valid: false,\n message: \"Input must be greater than \" + this.min\n };\n }\n if (!isNaN(this.max) && value > this.max) {\n return {\n valid: false,\n message: \"Input must be less than \" + this.max\n };\n }\n return { valid: true };\n };\n return NumberInputValidator;\n}());\n/**\n * An abstract base class that provides the most of the functionality\n * needed by a cell editor. All of the built-in cell editors\n * for various cell types are derived from this base class. Custom cell editors\n * can be easily implemented by extending this class.\n */\nvar CellEditor = /** @class */ (function () {\n /**\n * Construct a new cell editor.\n */\n function CellEditor() {\n var _this = this;\n /**\n * A signal emitted when input changes.\n */\n this.inputChanged = new signaling.Signal(this);\n /**\n * Notification popup used to show validation error messages.\n */\n this.validityNotification = null;\n /**\n * Whether the cell editor is disposed.\n */\n this._disposed = false;\n /**\n * Whether the value input is valid.\n */\n this._validInput = true;\n /**\n * Grid wheel event handler.\n */\n this._gridWheelEventHandler = null;\n this.inputChanged.connect(function () {\n _this.validate();\n });\n }\n Object.defineProperty(CellEditor.prototype, \"isDisposed\", {\n /**\n * Whether the cell editor is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the resources held by cell editor.\n */\n CellEditor.prototype.dispose = function () {\n if (this._disposed) {\n return;\n }\n if (this._gridWheelEventHandler) {\n this.cell.grid.node.removeEventListener('wheel', this._gridWheelEventHandler);\n this._gridWheelEventHandler = null;\n }\n this._closeValidityNotification();\n this._disposed = true;\n this.cell.grid.node.removeChild(this.viewportOccluder);\n };\n /**\n * Start editing the cell.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param options - The cell editing options.\n */\n CellEditor.prototype.edit = function (cell, options) {\n var _this = this;\n this.cell = cell;\n this.onCommit = options && options.onCommit;\n this.onCancel = options && options.onCancel;\n this.validator = (options && options.validator) ? options.validator : this.createValidatorBasedOnType();\n this._gridWheelEventHandler = function () {\n _this._closeValidityNotification();\n _this.updatePosition();\n };\n cell.grid.node.addEventListener('wheel', this._gridWheelEventHandler);\n this._addContainer();\n this.updatePosition();\n this.startEditing();\n };\n /**\n * Cancel editing the cell.\n */\n CellEditor.prototype.cancel = function () {\n if (this._disposed) {\n return;\n }\n this.dispose();\n if (this.onCancel) {\n this.onCancel();\n }\n };\n Object.defineProperty(CellEditor.prototype, \"validInput\", {\n /**\n * Whether the value input is valid.\n */\n get: function () {\n return this._validInput;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Validate the cell input. Shows validation error notification when input is invalid.\n */\n CellEditor.prototype.validate = function () {\n var value;\n try {\n value = this.getInput();\n }\n catch (error) {\n console.log(\"Input error: \" + error.message);\n this.setValidity(false, error.message || DEFAULT_INVALID_INPUT_MESSAGE);\n return;\n }\n if (this.validator) {\n var result = this.validator.validate(this.cell, value);\n if (result.valid) {\n this.setValidity(true);\n }\n else {\n this.setValidity(false, result.message || DEFAULT_INVALID_INPUT_MESSAGE);\n }\n }\n else {\n this.setValidity(true);\n }\n };\n /**\n * Set validity flag.\n *\n * @param valid - Whether the input is valid.\n *\n * @param message - Notification message to show.\n *\n * If message is set to empty string (which is the default)\n * existing notification popup is removed if any.\n */\n CellEditor.prototype.setValidity = function (valid, message) {\n if (message === void 0) { message = \"\"; }\n this._validInput = valid;\n this._closeValidityNotification();\n if (valid) {\n this.editorContainer.classList.remove('lm-mod-invalid');\n }\n else {\n this.editorContainer.classList.add('lm-mod-invalid');\n // show a notification popup\n if (message !== \"\") {\n this.validityNotification = new notification.Notification({\n target: this.editorContainer,\n message: message,\n placement: 'bottom',\n timeout: 5000\n });\n this.validityNotification.show();\n }\n }\n };\n /**\n * Create and return a cell input validator based on configuration of the\n * cell being edited. If no suitable validator can be found, it returns undefined.\n */\n CellEditor.prototype.createValidatorBasedOnType = function () {\n var cell = this.cell;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n switch (metadata && metadata.type) {\n case 'string':\n {\n var validator = new TextInputValidator();\n if (typeof (metadata.format) === 'string') {\n var format = metadata.format;\n switch (format) {\n case 'email':\n validator.pattern = new RegExp(\"^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$\");\n break;\n case 'uuid':\n validator.pattern = new RegExp(\"[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}\");\n break;\n }\n }\n if (metadata.constraint) {\n if (metadata.constraint.minLength !== undefined) {\n validator.minLength = metadata.constraint.minLength;\n }\n if (metadata.constraint.maxLength !== undefined) {\n validator.maxLength = metadata.constraint.maxLength;\n }\n if (typeof (metadata.constraint.pattern) === 'string') {\n validator.pattern = new RegExp(metadata.constraint.pattern);\n }\n }\n return validator;\n }\n case 'number':\n {\n var validator = new NumberInputValidator();\n if (metadata.constraint) {\n if (metadata.constraint.minimum !== undefined) {\n validator.min = metadata.constraint.minimum;\n }\n if (metadata.constraint.maximum !== undefined) {\n validator.max = metadata.constraint.maximum;\n }\n }\n return validator;\n }\n case 'integer':\n {\n var validator = new IntegerInputValidator();\n if (metadata.constraint) {\n if (metadata.constraint.minimum !== undefined) {\n validator.min = metadata.constraint.minimum;\n }\n if (metadata.constraint.maximum !== undefined) {\n validator.max = metadata.constraint.maximum;\n }\n }\n return validator;\n }\n }\n return undefined;\n };\n /**\n * Compute cell rectangle and return with other cell properties.\n */\n CellEditor.prototype.getCellInfo = function (cell) {\n var grid = cell.grid, row = cell.row, column = cell.column;\n var data = grid.dataModel.data('body', row, column);\n var columnX = grid.headerWidth - grid.scrollX + grid.columnOffset('body', column);\n var rowY = grid.headerHeight - grid.scrollY + grid.rowOffset('body', row);\n var width = grid.columnSize('body', column);\n var height = grid.rowSize('body', row);\n return {\n grid: grid,\n row: row,\n column: column,\n data: data,\n x: columnX,\n y: rowY,\n width: width,\n height: height\n };\n };\n /**\n * Reposition cell editor by moving viewport occluder and cell editor container.\n */\n CellEditor.prototype.updatePosition = function () {\n var grid = this.cell.grid;\n var cellInfo = this.getCellInfo(this.cell);\n var headerHeight = grid.headerHeight;\n var headerWidth = grid.headerWidth;\n this.viewportOccluder.style.top = headerHeight + 'px';\n this.viewportOccluder.style.left = headerWidth + 'px';\n this.viewportOccluder.style.width = (grid.viewportWidth - headerWidth) + 'px';\n this.viewportOccluder.style.height = (grid.viewportHeight - headerHeight) + 'px';\n this.viewportOccluder.style.position = 'absolute';\n this.editorContainer.style.left = (cellInfo.x - 1 - headerWidth) + 'px';\n this.editorContainer.style.top = (cellInfo.y - 1 - headerHeight) + 'px';\n this.editorContainer.style.width = (cellInfo.width + 1) + 'px';\n this.editorContainer.style.height = (cellInfo.height + 1) + 'px';\n this.editorContainer.style.visibility = 'visible';\n this.editorContainer.style.position = 'absolute';\n };\n /**\n * Commit the edited value.\n *\n * @param cursorMovement - Cursor move direction based on keys pressed to end the edit.\n *\n * @returns true on valid input, false otherwise.\n */\n CellEditor.prototype.commit = function (cursorMovement) {\n if (cursorMovement === void 0) { cursorMovement = 'none'; }\n this.validate();\n if (!this._validInput) {\n return false;\n }\n var value;\n try {\n value = this.getInput();\n }\n catch (error) {\n console.log(\"Input error: \" + error.message);\n return false;\n }\n this.dispose();\n if (this.onCommit) {\n this.onCommit({\n cell: this.cell,\n value: value,\n cursorMovement: cursorMovement\n });\n }\n return true;\n };\n /**\n * Create container elements needed to prevent editor widget overflow\n * beyond viewport and to position cell editor widget.\n */\n CellEditor.prototype._addContainer = function () {\n var _this = this;\n this.viewportOccluder = document.createElement('div');\n this.viewportOccluder.className = 'lm-DataGrid-cellEditorOccluder';\n this.cell.grid.node.appendChild(this.viewportOccluder);\n this.editorContainer = document.createElement('div');\n this.editorContainer.className = 'lm-DataGrid-cellEditorContainer';\n this.viewportOccluder.appendChild(this.editorContainer);\n // update mouse event pass-through state based on input validity\n this.editorContainer.addEventListener('mouseleave', function (event) {\n _this.viewportOccluder.style.pointerEvents = _this._validInput ? 'none' : 'auto';\n });\n this.editorContainer.addEventListener('mouseenter', function (event) {\n _this.viewportOccluder.style.pointerEvents = 'none';\n });\n };\n /**\n * Remove validity notification popup.\n */\n CellEditor.prototype._closeValidityNotification = function () {\n if (this.validityNotification) {\n this.validityNotification.close();\n this.validityNotification = null;\n }\n };\n return CellEditor;\n}());\n/**\n * Abstract base class with shared functionality\n * for cell editors which use HTML Input widget as editor.\n */\nvar InputCellEditor = /** @class */ (function (_super) {\n tslib.__extends(InputCellEditor, _super);\n function InputCellEditor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Handle the DOM events for the editor.\n *\n * @param event - The DOM event sent to the editor.\n */\n InputCellEditor.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._onKeyDown(event);\n break;\n case 'blur':\n this._onBlur(event);\n break;\n case 'input':\n this._onInput(event);\n break;\n }\n };\n /**\n * Dispose of the resources held by cell editor.\n */\n InputCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n this._unbindEvents();\n _super.prototype.dispose.call(this);\n };\n /**\n * Start editing the cell.\n */\n InputCellEditor.prototype.startEditing = function () {\n this.createWidget();\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n this.input.value = this.deserialize(cellInfo.data);\n this.editorContainer.appendChild(this.input);\n this.input.focus();\n this.input.select();\n this.bindEvents();\n };\n InputCellEditor.prototype.deserialize = function (value) {\n if (value === null || value === undefined) {\n return '';\n }\n return value.toString();\n };\n InputCellEditor.prototype.createWidget = function () {\n var input = document.createElement('input');\n input.classList.add('lm-DataGrid-cellEditorWidget');\n input.classList.add('lm-DataGrid-cellEditorInput');\n input.spellcheck = false;\n input.type = this.inputType;\n this.input = input;\n };\n InputCellEditor.prototype.bindEvents = function () {\n this.input.addEventListener('keydown', this);\n this.input.addEventListener('blur', this);\n this.input.addEventListener('input', this);\n };\n InputCellEditor.prototype._unbindEvents = function () {\n this.input.removeEventListener('keydown', this);\n this.input.removeEventListener('blur', this);\n this.input.removeEventListener('input', this);\n };\n InputCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n InputCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this.input.focus();\n }\n };\n InputCellEditor.prototype._onInput = function (event) {\n this.inputChanged.emit(void 0);\n };\n return InputCellEditor;\n}(CellEditor));\n/**\n * Cell editor for text cells.\n */\nvar TextCellEditor = /** @class */ (function (_super) {\n tslib.__extends(TextCellEditor, _super);\n function TextCellEditor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.inputType = 'text';\n return _this;\n }\n /**\n * Return the current text input entered.\n */\n TextCellEditor.prototype.getInput = function () {\n return this.input.value;\n };\n return TextCellEditor;\n}(InputCellEditor));\n/**\n * Cell editor for real number cells.\n */\nvar NumberCellEditor = /** @class */ (function (_super) {\n tslib.__extends(NumberCellEditor, _super);\n function NumberCellEditor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.inputType = 'number';\n return _this;\n }\n /**\n * Start editing the cell.\n */\n NumberCellEditor.prototype.startEditing = function () {\n _super.prototype.startEditing.call(this);\n this.input.step = 'any';\n var cell = this.cell;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n var constraint = metadata.constraint;\n if (constraint) {\n if (constraint.minimum) {\n this.input.min = constraint.minimum;\n }\n if (constraint.maximum) {\n this.input.max = constraint.maximum;\n }\n }\n };\n /**\n * Return the current number input entered. This method throws exception\n * if input is invalid.\n */\n NumberCellEditor.prototype.getInput = function () {\n var value = this.input.value;\n if (value.trim() === '') {\n return null;\n }\n var floatValue = parseFloat(value);\n if (isNaN(floatValue)) {\n throw new Error('Invalid input');\n }\n return floatValue;\n };\n return NumberCellEditor;\n}(InputCellEditor));\n/**\n * Cell editor for integer cells.\n */\nvar IntegerCellEditor = /** @class */ (function (_super) {\n tslib.__extends(IntegerCellEditor, _super);\n function IntegerCellEditor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.inputType = 'number';\n return _this;\n }\n /**\n * Start editing the cell.\n */\n IntegerCellEditor.prototype.startEditing = function () {\n _super.prototype.startEditing.call(this);\n this.input.step = '1';\n var cell = this.cell;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n var constraint = metadata.constraint;\n if (constraint) {\n if (constraint.minimum) {\n this.input.min = constraint.minimum;\n }\n if (constraint.maximum) {\n this.input.max = constraint.maximum;\n }\n }\n };\n /**\n * Return the current integer input entered. This method throws exception\n * if input is invalid.\n */\n IntegerCellEditor.prototype.getInput = function () {\n var value = this.input.value;\n if (value.trim() === '') {\n return null;\n }\n var intValue = parseInt(value);\n if (isNaN(intValue)) {\n throw new Error('Invalid input');\n }\n return intValue;\n };\n return IntegerCellEditor;\n}(InputCellEditor));\n/**\n * Cell editor for date cells.\n */\nvar DateCellEditor = /** @class */ (function (_super) {\n tslib.__extends(DateCellEditor, _super);\n function DateCellEditor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Handle the DOM events for the editor.\n *\n * @param event - The DOM event sent to the editor.\n */\n DateCellEditor.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._onKeyDown(event);\n break;\n case 'blur':\n this._onBlur(event);\n break;\n }\n };\n /**\n * Dispose of the resources held by cell editor.\n */\n DateCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n this._unbindEvents();\n _super.prototype.dispose.call(this);\n };\n /**\n * Start editing the cell.\n */\n DateCellEditor.prototype.startEditing = function () {\n this._createWidget();\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n this._input.value = this._deserialize(cellInfo.data);\n this.editorContainer.appendChild(this._input);\n this._input.focus();\n this._bindEvents();\n };\n /**\n * Return the current date input entered.\n */\n DateCellEditor.prototype.getInput = function () {\n return this._input.value;\n };\n DateCellEditor.prototype._deserialize = function (value) {\n if (value === null || value === undefined) {\n return '';\n }\n return value.toString();\n };\n DateCellEditor.prototype._createWidget = function () {\n var input = document.createElement('input');\n input.type = 'date';\n input.pattern = \"\\d{4}-\\d{2}-\\d{2}\";\n input.classList.add('lm-DataGrid-cellEditorWidget');\n input.classList.add('lm-DataGrid-cellEditorInput');\n this._input = input;\n };\n DateCellEditor.prototype._bindEvents = function () {\n this._input.addEventListener('keydown', this);\n this._input.addEventListener('blur', this);\n };\n DateCellEditor.prototype._unbindEvents = function () {\n this._input.removeEventListener('keydown', this);\n this._input.removeEventListener('blur', this);\n };\n DateCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n DateCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this._input.focus();\n }\n };\n return DateCellEditor;\n}(CellEditor));\n/**\n * Cell editor for boolean cells.\n */\nvar BooleanCellEditor = /** @class */ (function (_super) {\n tslib.__extends(BooleanCellEditor, _super);\n function BooleanCellEditor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Handle the DOM events for the editor.\n *\n * @param event - The DOM event sent to the editor.\n */\n BooleanCellEditor.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._onKeyDown(event);\n break;\n case 'mousedown':\n // fix focus loss problem in Safari and Firefox\n this._input.focus();\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'blur':\n this._onBlur(event);\n break;\n }\n };\n /**\n * Dispose of the resources held by cell editor.\n */\n BooleanCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n this._unbindEvents();\n _super.prototype.dispose.call(this);\n };\n /**\n * Start editing the cell.\n */\n BooleanCellEditor.prototype.startEditing = function () {\n this._createWidget();\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n this._input.checked = this._deserialize(cellInfo.data);\n this.editorContainer.appendChild(this._input);\n this._input.focus();\n this._bindEvents();\n };\n /**\n * Return the current boolean input entered.\n */\n BooleanCellEditor.prototype.getInput = function () {\n return this._input.checked;\n };\n BooleanCellEditor.prototype._deserialize = function (value) {\n if (value === null || value === undefined) {\n return false;\n }\n return value == true;\n };\n BooleanCellEditor.prototype._createWidget = function () {\n var input = document.createElement('input');\n input.classList.add('lm-DataGrid-cellEditorWidget');\n input.classList.add('lm-DataGrid-cellEditorCheckbox');\n input.type = 'checkbox';\n input.spellcheck = false;\n this._input = input;\n };\n BooleanCellEditor.prototype._bindEvents = function () {\n this._input.addEventListener('keydown', this);\n this._input.addEventListener('mousedown', this);\n this._input.addEventListener('blur', this);\n };\n BooleanCellEditor.prototype._unbindEvents = function () {\n this._input.removeEventListener('keydown', this);\n this._input.removeEventListener('mousedown', this);\n this._input.removeEventListener('blur', this);\n };\n BooleanCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n BooleanCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this._input.focus();\n }\n };\n return BooleanCellEditor;\n}(CellEditor));\n/**\n * Cell editor for option cells.\n *\n * It supports multiple option selection. If cell metadata contains\n * type attribute 'array', then it behaves as a multi select.\n * In that case cell data is expected to be list of string values.\n */\nvar OptionCellEditor = /** @class */ (function (_super) {\n tslib.__extends(OptionCellEditor, _super);\n function OptionCellEditor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._isMultiSelect = false;\n return _this;\n }\n /**\n * Dispose of the resources held by cell editor.\n */\n OptionCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n _super.prototype.dispose.call(this);\n if (this._isMultiSelect) {\n document.body.removeChild(this._select);\n }\n };\n /**\n * Start editing the cell.\n */\n OptionCellEditor.prototype.startEditing = function () {\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n this._isMultiSelect = metadata.type === 'array';\n this._createWidget();\n if (this._isMultiSelect) {\n this._select.multiple = true;\n var values = this._deserialize(cellInfo.data);\n for (var i = 0; i < this._select.options.length; ++i) {\n var option = this._select.options.item(i);\n option.selected = values.indexOf(option.value) !== -1;\n }\n document.body.appendChild(this._select);\n }\n else {\n this._select.value = this._deserialize(cellInfo.data);\n this.editorContainer.appendChild(this._select);\n }\n this._select.focus();\n this._bindEvents();\n this.updatePosition();\n };\n /**\n * Return the current option input.\n */\n OptionCellEditor.prototype.getInput = function () {\n if (this._isMultiSelect) {\n var input = [];\n for (var i = 0; i < this._select.selectedOptions.length; ++i) {\n input.push(this._select.selectedOptions.item(i).value);\n }\n return input;\n }\n else {\n return this._select.value;\n }\n };\n /**\n * Reposition cell editor.\n */\n OptionCellEditor.prototype.updatePosition = function () {\n _super.prototype.updatePosition.call(this);\n if (!this._isMultiSelect) {\n return;\n }\n var cellInfo = this.getCellInfo(this.cell);\n this._select.style.position = 'absolute';\n var editorContainerRect = this.editorContainer.getBoundingClientRect();\n this._select.style.left = editorContainerRect.left + 'px';\n this._select.style.top = (editorContainerRect.top + cellInfo.height) + 'px';\n this._select.style.width = editorContainerRect.width + 'px';\n this._select.style.maxHeight = '60px';\n this.editorContainer.style.visibility = 'hidden';\n };\n OptionCellEditor.prototype._deserialize = function (value) {\n if (value === null || value === undefined) {\n return '';\n }\n if (this._isMultiSelect) {\n var values = [];\n if (Array.isArray(value)) {\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\n var item = value_1[_i];\n values.push(item.toString());\n }\n }\n return values;\n }\n else {\n return value.toString();\n }\n };\n OptionCellEditor.prototype._createWidget = function () {\n var cell = this.cell;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n var items = metadata.constraint.enum;\n var select = document.createElement('select');\n select.classList.add('lm-DataGrid-cellEditorWidget');\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var item = items_1[_i];\n var option = document.createElement(\"option\");\n option.value = item;\n option.text = item;\n select.appendChild(option);\n }\n this._select = select;\n };\n OptionCellEditor.prototype._bindEvents = function () {\n this._select.addEventListener('keydown', this._onKeyDown.bind(this));\n this._select.addEventListener('blur', this._onBlur.bind(this));\n };\n OptionCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n OptionCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this._select.focus();\n }\n };\n return OptionCellEditor;\n}(CellEditor));\n/**\n * Cell editor for option cells whose value can be any value\n * from set of pre-defined options or values that can be input by user.\n */\nvar DynamicOptionCellEditor = /** @class */ (function (_super) {\n tslib.__extends(DynamicOptionCellEditor, _super);\n function DynamicOptionCellEditor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Handle the DOM events for the editor.\n *\n * @param event - The DOM event sent to the editor.\n */\n DynamicOptionCellEditor.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._onKeyDown(event);\n break;\n case 'blur':\n this._onBlur(event);\n break;\n }\n };\n /**\n * Dispose of the resources held by cell editor.\n */\n DynamicOptionCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n this._unbindEvents();\n _super.prototype.dispose.call(this);\n };\n /**\n * Start editing the cell.\n */\n DynamicOptionCellEditor.prototype.startEditing = function () {\n this._createWidget();\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n this._input.value = this._deserialize(cellInfo.data);\n this.editorContainer.appendChild(this._input);\n this._input.focus();\n this._input.select();\n this._bindEvents();\n };\n /**\n * Return the current option input.\n */\n DynamicOptionCellEditor.prototype.getInput = function () {\n return this._input.value;\n };\n DynamicOptionCellEditor.prototype._deserialize = function (value) {\n if (value === null || value === undefined) {\n return '';\n }\n return value.toString();\n };\n DynamicOptionCellEditor.prototype._createWidget = function () {\n var cell = this.cell;\n var grid = cell.grid;\n var dataModel = grid.dataModel;\n var rowCount = dataModel.rowCount('body');\n var listId = 'cell-editor-list';\n var list = document.createElement('datalist');\n list.id = listId;\n var input = document.createElement('input');\n input.classList.add('lm-DataGrid-cellEditorWidget');\n input.classList.add('lm-DataGrid-cellEditorInput');\n var valueSet = new Set();\n for (var r = 0; r < rowCount; ++r) {\n var data = dataModel.data('body', r, cell.column);\n if (data) {\n valueSet.add(data);\n }\n }\n valueSet.forEach(function (value) {\n var option = document.createElement(\"option\");\n option.value = value;\n option.text = value;\n list.appendChild(option);\n });\n this.editorContainer.appendChild(list);\n input.setAttribute('list', listId);\n this._input = input;\n };\n DynamicOptionCellEditor.prototype._bindEvents = function () {\n this._input.addEventListener('keydown', this);\n this._input.addEventListener('blur', this);\n };\n DynamicOptionCellEditor.prototype._unbindEvents = function () {\n this._input.removeEventListener('keydown', this);\n this._input.removeEventListener('blur', this);\n };\n DynamicOptionCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n DynamicOptionCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this._input.focus();\n }\n };\n return DynamicOptionCellEditor;\n}(CellEditor));\n\nexports.BooleanCellEditor = BooleanCellEditor;\nexports.CellEditor = CellEditor;\nexports.DateCellEditor = DateCellEditor;\nexports.DynamicOptionCellEditor = DynamicOptionCellEditor;\nexports.InputCellEditor = InputCellEditor;\nexports.IntegerCellEditor = IntegerCellEditor;\nexports.IntegerInputValidator = IntegerInputValidator;\nexports.NumberCellEditor = NumberCellEditor;\nexports.NumberInputValidator = NumberInputValidator;\nexports.OptionCellEditor = OptionCellEditor;\nexports.PassInputValidator = PassInputValidator;\nexports.TextCellEditor = TextCellEditor;\nexports.TextInputValidator = TextInputValidator;\n//# sourceMappingURL=celleditor.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/celleditor.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\nvar notification = __webpack_require__(/*! ./notification.js */ \"../../packages/datagrid/dist/notification.js\");\n\n// default validation error message\nvar DEFAULT_INVALID_INPUT_MESSAGE = \"Invalid input!\";\n/**\n * A cell input validator object which always returns valid.\n */\nvar PassInputValidator = /** @class */ (function () {\n function PassInputValidator() {\n }\n /**\n * Validate cell input.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param value - The cell value input.\n *\n * @returns An object with validation result.\n */\n PassInputValidator.prototype.validate = function (cell, value) {\n return { valid: true };\n };\n return PassInputValidator;\n}());\n/**\n * Text cell input validator.\n */\nvar TextInputValidator = /** @class */ (function () {\n function TextInputValidator() {\n /**\n * Minimum text length\n *\n * The default is Number.NaN, meaning no minimum constraint\n */\n this.minLength = Number.NaN;\n /**\n * Maximum text length\n *\n * The default is Number.NaN, meaning no maximum constraint\n */\n this.maxLength = Number.NaN;\n /**\n * Required text pattern as regular expression\n *\n * The default is null, meaning no pattern constraint\n */\n this.pattern = null;\n }\n /**\n * Validate cell input.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param value - The cell value input.\n *\n * @returns An object with validation result.\n */\n TextInputValidator.prototype.validate = function (cell, value) {\n if (value === null) {\n return { valid: true };\n }\n if (typeof value !== 'string') {\n return {\n valid: false,\n message: 'Input must be valid text'\n };\n }\n if (!isNaN(this.minLength) && value.length < this.minLength) {\n return {\n valid: false,\n message: \"Text length must be greater than \" + this.minLength\n };\n }\n if (!isNaN(this.maxLength) && value.length > this.maxLength) {\n return {\n valid: false,\n message: \"Text length must be less than \" + this.maxLength\n };\n }\n if (this.pattern && !this.pattern.test(value)) {\n return {\n valid: false,\n message: \"Text doesn't match the required pattern\"\n };\n }\n return { valid: true };\n };\n return TextInputValidator;\n}());\n/**\n * Integer cell input validator.\n */\nvar IntegerInputValidator = /** @class */ (function () {\n function IntegerInputValidator() {\n /**\n * Minimum value\n *\n * The default is Number.NaN, meaning no minimum constraint\n */\n this.min = Number.NaN;\n /**\n * Maximum value\n *\n * The default is Number.NaN, meaning no maximum constraint\n */\n this.max = Number.NaN;\n }\n /**\n * Validate cell input.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param value - The cell value input.\n *\n * @returns An object with validation result.\n */\n IntegerInputValidator.prototype.validate = function (cell, value) {\n if (value === null) {\n return { valid: true };\n }\n if (isNaN(value) || (value % 1 !== 0)) {\n return {\n valid: false,\n message: 'Input must be valid integer'\n };\n }\n if (!isNaN(this.min) && value < this.min) {\n return {\n valid: false,\n message: \"Input must be greater than \" + this.min\n };\n }\n if (!isNaN(this.max) && value > this.max) {\n return {\n valid: false,\n message: \"Input must be less than \" + this.max\n };\n }\n return { valid: true };\n };\n return IntegerInputValidator;\n}());\n/**\n * Real number cell input validator.\n */\nvar NumberInputValidator = /** @class */ (function () {\n function NumberInputValidator() {\n /**\n * Minimum value\n *\n * The default is Number.NaN, meaning no minimum constraint\n */\n this.min = Number.NaN;\n /**\n * Maximum value\n *\n * The default is Number.NaN, meaning no maximum constraint\n */\n this.max = Number.NaN;\n }\n /**\n * Validate cell input.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param value - The cell value input.\n *\n * @returns An object with validation result.\n */\n NumberInputValidator.prototype.validate = function (cell, value) {\n if (value === null) {\n return { valid: true };\n }\n if (isNaN(value)) {\n return {\n valid: false,\n message: 'Input must be valid number'\n };\n }\n if (!isNaN(this.min) && value < this.min) {\n return {\n valid: false,\n message: \"Input must be greater than \" + this.min\n };\n }\n if (!isNaN(this.max) && value > this.max) {\n return {\n valid: false,\n message: \"Input must be less than \" + this.max\n };\n }\n return { valid: true };\n };\n return NumberInputValidator;\n}());\n/**\n * An abstract base class that provides the most of the functionality\n * needed by a cell editor. All of the built-in cell editors\n * for various cell types are derived from this base class. Custom cell editors\n * can be easily implemented by extending this class.\n */\nvar CellEditor = /** @class */ (function () {\n /**\n * Construct a new cell editor.\n */\n function CellEditor() {\n var _this = this;\n /**\n * A signal emitted when input changes.\n */\n this.inputChanged = new signaling.Signal(this);\n /**\n * Notification popup used to show validation error messages.\n */\n this.validityNotification = null;\n /**\n * Whether the cell editor is disposed.\n */\n this._disposed = false;\n /**\n * Whether the value input is valid.\n */\n this._validInput = true;\n /**\n * Grid wheel event handler.\n */\n this._gridWheelEventHandler = null;\n this.inputChanged.connect(function () {\n _this.validate();\n });\n }\n Object.defineProperty(CellEditor.prototype, \"isDisposed\", {\n /**\n * Whether the cell editor is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the resources held by cell editor.\n */\n CellEditor.prototype.dispose = function () {\n if (this._disposed) {\n return;\n }\n if (this._gridWheelEventHandler) {\n this.cell.grid.node.removeEventListener('wheel', this._gridWheelEventHandler);\n this._gridWheelEventHandler = null;\n }\n this._closeValidityNotification();\n this._disposed = true;\n this.cell.grid.node.removeChild(this.viewportOccluder);\n };\n /**\n * Start editing the cell.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param options - The cell editing options.\n */\n CellEditor.prototype.edit = function (cell, options) {\n var _this = this;\n this.cell = cell;\n this.onCommit = options && options.onCommit;\n this.onCancel = options && options.onCancel;\n this.validator = (options && options.validator) ? options.validator : this.createValidatorBasedOnType();\n this._gridWheelEventHandler = function () {\n _this._closeValidityNotification();\n _this.updatePosition();\n };\n cell.grid.node.addEventListener('wheel', this._gridWheelEventHandler);\n this._addContainer();\n this.updatePosition();\n this.startEditing();\n };\n /**\n * Cancel editing the cell.\n */\n CellEditor.prototype.cancel = function () {\n if (this._disposed) {\n return;\n }\n this.dispose();\n if (this.onCancel) {\n this.onCancel();\n }\n };\n Object.defineProperty(CellEditor.prototype, \"validInput\", {\n /**\n * Whether the value input is valid.\n */\n get: function () {\n return this._validInput;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Validate the cell input. Shows validation error notification when input is invalid.\n */\n CellEditor.prototype.validate = function () {\n var value;\n try {\n value = this.getInput();\n }\n catch (error) {\n console.log(\"Input error: \" + error.message);\n this.setValidity(false, error.message || DEFAULT_INVALID_INPUT_MESSAGE);\n return;\n }\n if (this.validator) {\n var result = this.validator.validate(this.cell, value);\n if (result.valid) {\n this.setValidity(true);\n }\n else {\n this.setValidity(false, result.message || DEFAULT_INVALID_INPUT_MESSAGE);\n }\n }\n else {\n this.setValidity(true);\n }\n };\n /**\n * Set validity flag.\n *\n * @param valid - Whether the input is valid.\n *\n * @param message - Notification message to show.\n *\n * If message is set to empty string (which is the default)\n * existing notification popup is removed if any.\n */\n CellEditor.prototype.setValidity = function (valid, message) {\n if (message === void 0) { message = \"\"; }\n this._validInput = valid;\n this._closeValidityNotification();\n if (valid) {\n this.editorContainer.classList.remove('lm-mod-invalid');\n }\n else {\n this.editorContainer.classList.add('lm-mod-invalid');\n // show a notification popup\n if (message !== \"\") {\n this.validityNotification = new notification.Notification({\n target: this.editorContainer,\n message: message,\n placement: 'bottom',\n timeout: 5000\n });\n this.validityNotification.show();\n }\n }\n };\n /**\n * Create and return a cell input validator based on configuration of the\n * cell being edited. If no suitable validator can be found, it returns undefined.\n */\n CellEditor.prototype.createValidatorBasedOnType = function () {\n var cell = this.cell;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n switch (metadata && metadata.type) {\n case 'string':\n {\n var validator = new TextInputValidator();\n if (typeof (metadata.format) === 'string') {\n var format = metadata.format;\n switch (format) {\n case 'email':\n validator.pattern = new RegExp(\"^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$\");\n break;\n case 'uuid':\n validator.pattern = new RegExp(\"[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}\");\n break;\n }\n }\n if (metadata.constraint) {\n if (metadata.constraint.minLength !== undefined) {\n validator.minLength = metadata.constraint.minLength;\n }\n if (metadata.constraint.maxLength !== undefined) {\n validator.maxLength = metadata.constraint.maxLength;\n }\n if (typeof (metadata.constraint.pattern) === 'string') {\n validator.pattern = new RegExp(metadata.constraint.pattern);\n }\n }\n return validator;\n }\n case 'number':\n {\n var validator = new NumberInputValidator();\n if (metadata.constraint) {\n if (metadata.constraint.minimum !== undefined) {\n validator.min = metadata.constraint.minimum;\n }\n if (metadata.constraint.maximum !== undefined) {\n validator.max = metadata.constraint.maximum;\n }\n }\n return validator;\n }\n case 'integer':\n {\n var validator = new IntegerInputValidator();\n if (metadata.constraint) {\n if (metadata.constraint.minimum !== undefined) {\n validator.min = metadata.constraint.minimum;\n }\n if (metadata.constraint.maximum !== undefined) {\n validator.max = metadata.constraint.maximum;\n }\n }\n return validator;\n }\n }\n return undefined;\n };\n /**\n * Compute cell rectangle and return with other cell properties.\n */\n CellEditor.prototype.getCellInfo = function (cell) {\n var grid = cell.grid, row = cell.row, column = cell.column;\n var data = grid.dataModel.data('body', row, column);\n var columnX = grid.headerWidth - grid.scrollX + grid.columnOffset('body', column);\n var rowY = grid.headerHeight - grid.scrollY + grid.rowOffset('body', row);\n var width = grid.columnSize('body', column);\n var height = grid.rowSize('body', row);\n return {\n grid: grid,\n row: row,\n column: column,\n data: data,\n x: columnX,\n y: rowY,\n width: width,\n height: height\n };\n };\n /**\n * Reposition cell editor by moving viewport occluder and cell editor container.\n */\n CellEditor.prototype.updatePosition = function () {\n var grid = this.cell.grid;\n var cellInfo = this.getCellInfo(this.cell);\n var headerHeight = grid.headerHeight;\n var headerWidth = grid.headerWidth;\n this.viewportOccluder.style.top = headerHeight + 'px';\n this.viewportOccluder.style.left = headerWidth + 'px';\n this.viewportOccluder.style.width = (grid.viewportWidth - headerWidth) + 'px';\n this.viewportOccluder.style.height = (grid.viewportHeight - headerHeight) + 'px';\n this.viewportOccluder.style.position = 'absolute';\n this.editorContainer.style.left = (cellInfo.x - 1 - headerWidth) + 'px';\n this.editorContainer.style.top = (cellInfo.y - 1 - headerHeight) + 'px';\n this.editorContainer.style.width = (cellInfo.width + 1) + 'px';\n this.editorContainer.style.height = (cellInfo.height + 1) + 'px';\n this.editorContainer.style.visibility = 'visible';\n this.editorContainer.style.position = 'absolute';\n };\n /**\n * Commit the edited value.\n *\n * @param cursorMovement - Cursor move direction based on keys pressed to end the edit.\n *\n * @returns true on valid input, false otherwise.\n */\n CellEditor.prototype.commit = function (cursorMovement) {\n if (cursorMovement === void 0) { cursorMovement = 'none'; }\n this.validate();\n if (!this._validInput) {\n return false;\n }\n var value;\n try {\n value = this.getInput();\n }\n catch (error) {\n console.log(\"Input error: \" + error.message);\n return false;\n }\n this.dispose();\n if (this.onCommit) {\n this.onCommit({\n cell: this.cell,\n value: value,\n cursorMovement: cursorMovement\n });\n }\n return true;\n };\n /**\n * Create container elements needed to prevent editor widget overflow\n * beyond viewport and to position cell editor widget.\n */\n CellEditor.prototype._addContainer = function () {\n var _this = this;\n this.viewportOccluder = document.createElement('div');\n this.viewportOccluder.className = 'lm-DataGrid-cellEditorOccluder';\n this.cell.grid.node.appendChild(this.viewportOccluder);\n this.editorContainer = document.createElement('div');\n this.editorContainer.className = 'lm-DataGrid-cellEditorContainer';\n this.viewportOccluder.appendChild(this.editorContainer);\n // update mouse event pass-through state based on input validity\n this.editorContainer.addEventListener('mouseleave', function (event) {\n _this.viewportOccluder.style.pointerEvents = _this._validInput ? 'none' : 'auto';\n });\n this.editorContainer.addEventListener('mouseenter', function (event) {\n _this.viewportOccluder.style.pointerEvents = 'none';\n });\n };\n /**\n * Remove validity notification popup.\n */\n CellEditor.prototype._closeValidityNotification = function () {\n if (this.validityNotification) {\n this.validityNotification.close();\n this.validityNotification = null;\n }\n };\n return CellEditor;\n}());\n/**\n * Abstract base class with shared functionality\n * for cell editors which use HTML Input widget as editor.\n */\nvar InputCellEditor = /** @class */ (function (_super) {\n tslib.__extends(InputCellEditor, _super);\n function InputCellEditor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Handle the DOM events for the editor.\n *\n * @param event - The DOM event sent to the editor.\n */\n InputCellEditor.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._onKeyDown(event);\n break;\n case 'blur':\n this._onBlur(event);\n break;\n case 'input':\n this._onInput(event);\n break;\n }\n };\n /**\n * Dispose of the resources held by cell editor.\n */\n InputCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n this._unbindEvents();\n _super.prototype.dispose.call(this);\n };\n /**\n * Start editing the cell.\n */\n InputCellEditor.prototype.startEditing = function () {\n this.createWidget();\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n this.input.value = this.deserialize(cellInfo.data);\n this.editorContainer.appendChild(this.input);\n this.input.focus();\n this.input.select();\n this.bindEvents();\n };\n InputCellEditor.prototype.deserialize = function (value) {\n if (value === null || value === undefined) {\n return '';\n }\n return value.toString();\n };\n InputCellEditor.prototype.createWidget = function () {\n var input = document.createElement('input');\n input.classList.add('lm-DataGrid-cellEditorWidget');\n input.classList.add('lm-DataGrid-cellEditorInput');\n input.spellcheck = false;\n input.type = this.inputType;\n this.input = input;\n };\n InputCellEditor.prototype.bindEvents = function () {\n this.input.addEventListener('keydown', this);\n this.input.addEventListener('blur', this);\n this.input.addEventListener('input', this);\n };\n InputCellEditor.prototype._unbindEvents = function () {\n this.input.removeEventListener('keydown', this);\n this.input.removeEventListener('blur', this);\n this.input.removeEventListener('input', this);\n };\n InputCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n InputCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this.input.focus();\n }\n };\n InputCellEditor.prototype._onInput = function (event) {\n this.inputChanged.emit(void 0);\n };\n return InputCellEditor;\n}(CellEditor));\n/**\n * Cell editor for text cells.\n */\nvar TextCellEditor = /** @class */ (function (_super) {\n tslib.__extends(TextCellEditor, _super);\n function TextCellEditor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.inputType = 'text';\n return _this;\n }\n /**\n * Return the current text input entered.\n */\n TextCellEditor.prototype.getInput = function () {\n return this.input.value;\n };\n return TextCellEditor;\n}(InputCellEditor));\n/**\n * Cell editor for real number cells.\n */\nvar NumberCellEditor = /** @class */ (function (_super) {\n tslib.__extends(NumberCellEditor, _super);\n function NumberCellEditor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.inputType = 'number';\n return _this;\n }\n /**\n * Start editing the cell.\n */\n NumberCellEditor.prototype.startEditing = function () {\n _super.prototype.startEditing.call(this);\n this.input.step = 'any';\n var cell = this.cell;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n var constraint = metadata.constraint;\n if (constraint) {\n if (constraint.minimum) {\n this.input.min = constraint.minimum;\n }\n if (constraint.maximum) {\n this.input.max = constraint.maximum;\n }\n }\n };\n /**\n * Return the current number input entered. This method throws exception\n * if input is invalid.\n */\n NumberCellEditor.prototype.getInput = function () {\n var value = this.input.value;\n if (value.trim() === '') {\n return null;\n }\n var floatValue = parseFloat(value);\n if (isNaN(floatValue)) {\n throw new Error('Invalid input');\n }\n return floatValue;\n };\n return NumberCellEditor;\n}(InputCellEditor));\n/**\n * Cell editor for integer cells.\n */\nvar IntegerCellEditor = /** @class */ (function (_super) {\n tslib.__extends(IntegerCellEditor, _super);\n function IntegerCellEditor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.inputType = 'number';\n return _this;\n }\n /**\n * Start editing the cell.\n */\n IntegerCellEditor.prototype.startEditing = function () {\n _super.prototype.startEditing.call(this);\n this.input.step = '1';\n var cell = this.cell;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n var constraint = metadata.constraint;\n if (constraint) {\n if (constraint.minimum) {\n this.input.min = constraint.minimum;\n }\n if (constraint.maximum) {\n this.input.max = constraint.maximum;\n }\n }\n };\n /**\n * Return the current integer input entered. This method throws exception\n * if input is invalid.\n */\n IntegerCellEditor.prototype.getInput = function () {\n var value = this.input.value;\n if (value.trim() === '') {\n return null;\n }\n var intValue = parseInt(value);\n if (isNaN(intValue)) {\n throw new Error('Invalid input');\n }\n return intValue;\n };\n return IntegerCellEditor;\n}(InputCellEditor));\n/**\n * Cell editor for date cells.\n */\nvar DateCellEditor = /** @class */ (function (_super) {\n tslib.__extends(DateCellEditor, _super);\n function DateCellEditor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Handle the DOM events for the editor.\n *\n * @param event - The DOM event sent to the editor.\n */\n DateCellEditor.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._onKeyDown(event);\n break;\n case 'blur':\n this._onBlur(event);\n break;\n }\n };\n /**\n * Dispose of the resources held by cell editor.\n */\n DateCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n this._unbindEvents();\n _super.prototype.dispose.call(this);\n };\n /**\n * Start editing the cell.\n */\n DateCellEditor.prototype.startEditing = function () {\n this._createWidget();\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n this._input.value = this._deserialize(cellInfo.data);\n this.editorContainer.appendChild(this._input);\n this._input.focus();\n this._bindEvents();\n };\n /**\n * Return the current date input entered.\n */\n DateCellEditor.prototype.getInput = function () {\n return this._input.value;\n };\n DateCellEditor.prototype._deserialize = function (value) {\n if (value === null || value === undefined) {\n return '';\n }\n return value.toString();\n };\n DateCellEditor.prototype._createWidget = function () {\n var input = document.createElement('input');\n input.type = 'date';\n input.pattern = \"\\d{4}-\\d{2}-\\d{2}\";\n input.classList.add('lm-DataGrid-cellEditorWidget');\n input.classList.add('lm-DataGrid-cellEditorInput');\n this._input = input;\n };\n DateCellEditor.prototype._bindEvents = function () {\n this._input.addEventListener('keydown', this);\n this._input.addEventListener('blur', this);\n };\n DateCellEditor.prototype._unbindEvents = function () {\n this._input.removeEventListener('keydown', this);\n this._input.removeEventListener('blur', this);\n };\n DateCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n DateCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this._input.focus();\n }\n };\n return DateCellEditor;\n}(CellEditor));\n/**\n * Cell editor for boolean cells.\n */\nvar BooleanCellEditor = /** @class */ (function (_super) {\n tslib.__extends(BooleanCellEditor, _super);\n function BooleanCellEditor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Handle the DOM events for the editor.\n *\n * @param event - The DOM event sent to the editor.\n */\n BooleanCellEditor.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._onKeyDown(event);\n break;\n case 'mousedown':\n // fix focus loss problem in Safari and Firefox\n this._input.focus();\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'blur':\n this._onBlur(event);\n break;\n }\n };\n /**\n * Dispose of the resources held by cell editor.\n */\n BooleanCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n this._unbindEvents();\n _super.prototype.dispose.call(this);\n };\n /**\n * Start editing the cell.\n */\n BooleanCellEditor.prototype.startEditing = function () {\n this._createWidget();\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n this._input.checked = this._deserialize(cellInfo.data);\n this.editorContainer.appendChild(this._input);\n this._input.focus();\n this._bindEvents();\n };\n /**\n * Return the current boolean input entered.\n */\n BooleanCellEditor.prototype.getInput = function () {\n return this._input.checked;\n };\n BooleanCellEditor.prototype._deserialize = function (value) {\n if (value === null || value === undefined) {\n return false;\n }\n return value == true;\n };\n BooleanCellEditor.prototype._createWidget = function () {\n var input = document.createElement('input');\n input.classList.add('lm-DataGrid-cellEditorWidget');\n input.classList.add('lm-DataGrid-cellEditorCheckbox');\n input.type = 'checkbox';\n input.spellcheck = false;\n this._input = input;\n };\n BooleanCellEditor.prototype._bindEvents = function () {\n this._input.addEventListener('keydown', this);\n this._input.addEventListener('mousedown', this);\n this._input.addEventListener('blur', this);\n };\n BooleanCellEditor.prototype._unbindEvents = function () {\n this._input.removeEventListener('keydown', this);\n this._input.removeEventListener('mousedown', this);\n this._input.removeEventListener('blur', this);\n };\n BooleanCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n BooleanCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this._input.focus();\n }\n };\n return BooleanCellEditor;\n}(CellEditor));\n/**\n * Cell editor for option cells.\n *\n * It supports multiple option selection. If cell metadata contains\n * type attribute 'array', then it behaves as a multi select.\n * In that case cell data is expected to be list of string values.\n */\nvar OptionCellEditor = /** @class */ (function (_super) {\n tslib.__extends(OptionCellEditor, _super);\n function OptionCellEditor() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._isMultiSelect = false;\n return _this;\n }\n /**\n * Dispose of the resources held by cell editor.\n */\n OptionCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n _super.prototype.dispose.call(this);\n if (this._isMultiSelect) {\n document.body.removeChild(this._select);\n }\n };\n /**\n * Start editing the cell.\n */\n OptionCellEditor.prototype.startEditing = function () {\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n this._isMultiSelect = metadata.type === 'array';\n this._createWidget();\n if (this._isMultiSelect) {\n this._select.multiple = true;\n var values = this._deserialize(cellInfo.data);\n for (var i = 0; i < this._select.options.length; ++i) {\n var option = this._select.options.item(i);\n option.selected = values.indexOf(option.value) !== -1;\n }\n document.body.appendChild(this._select);\n }\n else {\n this._select.value = this._deserialize(cellInfo.data);\n this.editorContainer.appendChild(this._select);\n }\n this._select.focus();\n this._bindEvents();\n this.updatePosition();\n };\n /**\n * Return the current option input.\n */\n OptionCellEditor.prototype.getInput = function () {\n if (this._isMultiSelect) {\n var input = [];\n for (var i = 0; i < this._select.selectedOptions.length; ++i) {\n input.push(this._select.selectedOptions.item(i).value);\n }\n return input;\n }\n else {\n return this._select.value;\n }\n };\n /**\n * Reposition cell editor.\n */\n OptionCellEditor.prototype.updatePosition = function () {\n _super.prototype.updatePosition.call(this);\n if (!this._isMultiSelect) {\n return;\n }\n var cellInfo = this.getCellInfo(this.cell);\n this._select.style.position = 'absolute';\n var editorContainerRect = this.editorContainer.getBoundingClientRect();\n this._select.style.left = editorContainerRect.left + 'px';\n this._select.style.top = (editorContainerRect.top + cellInfo.height) + 'px';\n this._select.style.width = editorContainerRect.width + 'px';\n this._select.style.maxHeight = '60px';\n this.editorContainer.style.visibility = 'hidden';\n };\n OptionCellEditor.prototype._deserialize = function (value) {\n if (value === null || value === undefined) {\n return '';\n }\n if (this._isMultiSelect) {\n var values = [];\n if (Array.isArray(value)) {\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\n var item = value_1[_i];\n values.push(item.toString());\n }\n }\n return values;\n }\n else {\n return value.toString();\n }\n };\n OptionCellEditor.prototype._createWidget = function () {\n var cell = this.cell;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n var items = metadata.constraint.enum;\n var select = document.createElement('select');\n select.classList.add('lm-DataGrid-cellEditorWidget');\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var item = items_1[_i];\n var option = document.createElement(\"option\");\n option.value = item;\n option.text = item;\n select.appendChild(option);\n }\n this._select = select;\n };\n OptionCellEditor.prototype._bindEvents = function () {\n this._select.addEventListener('keydown', this._onKeyDown.bind(this));\n this._select.addEventListener('blur', this._onBlur.bind(this));\n };\n OptionCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n OptionCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this._select.focus();\n }\n };\n return OptionCellEditor;\n}(CellEditor));\n/**\n * Cell editor for option cells whose value can be any value\n * from set of pre-defined options or values that can be input by user.\n */\nvar DynamicOptionCellEditor = /** @class */ (function (_super) {\n tslib.__extends(DynamicOptionCellEditor, _super);\n function DynamicOptionCellEditor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Handle the DOM events for the editor.\n *\n * @param event - The DOM event sent to the editor.\n */\n DynamicOptionCellEditor.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._onKeyDown(event);\n break;\n case 'blur':\n this._onBlur(event);\n break;\n }\n };\n /**\n * Dispose of the resources held by cell editor.\n */\n DynamicOptionCellEditor.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n this._unbindEvents();\n _super.prototype.dispose.call(this);\n };\n /**\n * Start editing the cell.\n */\n DynamicOptionCellEditor.prototype.startEditing = function () {\n this._createWidget();\n var cell = this.cell;\n var cellInfo = this.getCellInfo(cell);\n this._input.value = this._deserialize(cellInfo.data);\n this.editorContainer.appendChild(this._input);\n this._input.focus();\n this._input.select();\n this._bindEvents();\n };\n /**\n * Return the current option input.\n */\n DynamicOptionCellEditor.prototype.getInput = function () {\n return this._input.value;\n };\n DynamicOptionCellEditor.prototype._deserialize = function (value) {\n if (value === null || value === undefined) {\n return '';\n }\n return value.toString();\n };\n DynamicOptionCellEditor.prototype._createWidget = function () {\n var cell = this.cell;\n var grid = cell.grid;\n var dataModel = grid.dataModel;\n var rowCount = dataModel.rowCount('body');\n var listId = 'cell-editor-list';\n var list = document.createElement('datalist');\n list.id = listId;\n var input = document.createElement('input');\n input.classList.add('lm-DataGrid-cellEditorWidget');\n input.classList.add('lm-DataGrid-cellEditorInput');\n var valueSet = new Set();\n for (var r = 0; r < rowCount; ++r) {\n var data = dataModel.data('body', r, cell.column);\n if (data) {\n valueSet.add(data);\n }\n }\n valueSet.forEach(function (value) {\n var option = document.createElement(\"option\");\n option.value = value;\n option.text = value;\n list.appendChild(option);\n });\n this.editorContainer.appendChild(list);\n input.setAttribute('list', listId);\n this._input = input;\n };\n DynamicOptionCellEditor.prototype._bindEvents = function () {\n this._input.addEventListener('keydown', this);\n this._input.addEventListener('blur', this);\n };\n DynamicOptionCellEditor.prototype._unbindEvents = function () {\n this._input.removeEventListener('keydown', this);\n this._input.removeEventListener('blur', this);\n };\n DynamicOptionCellEditor.prototype._onKeyDown = function (event) {\n switch (keyboard.getKeyboardLayout().keyForKeydownEvent(event)) {\n case 'Enter':\n this.commit(event.shiftKey ? 'up' : 'down');\n break;\n case 'Tab':\n this.commit(event.shiftKey ? 'left' : 'right');\n event.stopPropagation();\n event.preventDefault();\n break;\n case 'Escape':\n this.cancel();\n break;\n }\n };\n DynamicOptionCellEditor.prototype._onBlur = function (event) {\n if (this.isDisposed) {\n return;\n }\n if (!this.commit()) {\n event.preventDefault();\n event.stopPropagation();\n this._input.focus();\n }\n };\n return DynamicOptionCellEditor;\n}(CellEditor));\n\nexports.BooleanCellEditor = BooleanCellEditor;\nexports.CellEditor = CellEditor;\nexports.DateCellEditor = DateCellEditor;\nexports.DynamicOptionCellEditor = DynamicOptionCellEditor;\nexports.InputCellEditor = InputCellEditor;\nexports.IntegerCellEditor = IntegerCellEditor;\nexports.IntegerInputValidator = IntegerInputValidator;\nexports.NumberCellEditor = NumberCellEditor;\nexports.NumberInputValidator = NumberInputValidator;\nexports.OptionCellEditor = OptionCellEditor;\nexports.PassInputValidator = PassInputValidator;\nexports.TextCellEditor = TextCellEditor;\nexports.TextInputValidator = TextInputValidator;\n//# sourceMappingURL=celleditor.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/celleditor.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/celleditorcontroller.js": │ │ │ │ /*!*********************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/celleditorcontroller.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/celleditorcontroller.js ***! │ │ │ │ \*********************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\n__webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\n__webpack_require__(/*! ./notification.js */ \"../../packages/datagrid/dist/notification.js\");\nvar celleditor = __webpack_require__(/*! ./celleditor.js */ \"../../packages/datagrid/dist/celleditor.js\");\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2019, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Resolve a config option for a cell editor.\n *\n * @param option - The config option to resolve.\n *\n * @param config - The cell config object.\n *\n * @returns The resolved value for the option.\n */\nfunction resolveOption(option, config) {\n return typeof option === 'function' ? option(config) : option;\n}\n/**\n * An object which manages cell editing. It stores editor overrides,\n * decides which editor to use for a cell, makes sure there is only one editor active.\n */\nvar CellEditorController = /** @class */ (function () {\n function CellEditorController() {\n // active cell editor\n this._editor = null;\n // active cell being edited\n this._cell = null;\n // cell editor overrides based on cell data type identifier\n this._typeBasedOverrides = new Map();\n // cell editor overrides based on partial metadata match\n this._metadataBasedOverrides = new Map();\n }\n /**\n * Override cell editor for the cells matching the identifier.\n *\n * @param identifier - Cell identifier to use when matching cells.\n * if identifier is a CellDataType, then cell matching is done using data type of the cell,\n * if identifier is a Metadata, then partial match of the cell metadata with identifier is used for match,\n * if identifier is 'default' then override is used as default editor when no other editor is found suitable\n *\n * @param editor - The cell editor to use or resolver to use to get an editor for matching cells.\n */\n CellEditorController.prototype.setEditor = function (identifier, editor) {\n if (typeof identifier === 'string') {\n this._typeBasedOverrides.set(identifier, editor);\n }\n else {\n var key = this._metadataIdentifierToKey(identifier);\n this._metadataBasedOverrides.set(key, [identifier, editor]);\n }\n };\n /**\n * Start editing a cell.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param options - The cell editing options.\n */\n CellEditorController.prototype.edit = function (cell, options) {\n var grid = cell.grid;\n if (!grid.editable) {\n console.error('Grid cannot be edited!');\n return false;\n }\n this.cancel();\n this._cell = cell;\n options = options || {};\n options.onCommit = options.onCommit || this._onCommit.bind(this);\n options.onCancel = options.onCancel || this._onCancel.bind(this);\n // if an editor is passed in with options, then use it for editing\n if (options.editor) {\n this._editor = options.editor;\n options.editor.edit(cell, options);\n return true;\n }\n // choose an editor based on overrides / cell data type\n var editor = this._getEditor(cell);\n if (editor) {\n this._editor = editor;\n editor.edit(cell, options);\n return true;\n }\n return false;\n };\n /**\n * Cancel editing.\n */\n CellEditorController.prototype.cancel = function () {\n if (this._editor) {\n this._editor.cancel();\n this._editor = null;\n }\n this._cell = null;\n };\n CellEditorController.prototype._onCommit = function (response) {\n var cell = this._cell;\n if (!cell) {\n return;\n }\n var grid = cell.grid;\n var dataModel = grid.dataModel;\n dataModel.setData('body', cell.row, cell.column, response.value);\n grid.viewport.node.focus();\n if (response.cursorMovement !== 'none') {\n grid.moveCursor(response.cursorMovement);\n grid.scrollToCursor();\n }\n };\n CellEditorController.prototype._onCancel = function () {\n if (!this._cell) {\n return;\n }\n this._cell.grid.viewport.node.focus();\n };\n CellEditorController.prototype._getDataTypeKey = function (cell) {\n var metadata = cell.grid.dataModel ? cell.grid.dataModel.metadata('body', cell.row, cell.column) : null;\n if (!metadata) {\n return 'default';\n }\n var key = '';\n if (metadata) {\n key = metadata.type;\n }\n if (metadata.constraint && metadata.constraint.enum) {\n if (metadata.constraint.enum === 'dynamic') {\n key += ':dynamic-option';\n }\n else {\n key += ':option';\n }\n }\n return key;\n };\n CellEditorController.prototype._objectToKey = function (object) {\n var str = '';\n for (var key in object) {\n var value = object[key];\n if (typeof value === 'object') {\n str += key + \":\" + this._objectToKey(value);\n }\n else {\n str += \"[\" + key + \":\" + value + \"]\";\n }\n }\n return str;\n };\n CellEditorController.prototype._metadataIdentifierToKey = function (metadata) {\n return this._objectToKey(metadata);\n };\n CellEditorController.prototype._metadataMatchesIdentifier = function (metadata, identifier) {\n for (var key in identifier) {\n if (!metadata.hasOwnProperty(key)) {\n return false;\n }\n var identifierValue = identifier[key];\n var metadataValue = metadata[key];\n if (typeof identifierValue === 'object') {\n if (!this._metadataMatchesIdentifier(metadataValue, identifierValue)) {\n return false;\n }\n }\n else if (metadataValue !== identifierValue) {\n return false;\n }\n }\n return true;\n };\n CellEditorController.prototype._getMetadataBasedEditor = function (cell) {\n var _this = this;\n var editorMatched;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n if (metadata) {\n this._metadataBasedOverrides.forEach(function (value) {\n if (!editorMatched) {\n var identifier = value[0], editor = value[1];\n if (_this._metadataMatchesIdentifier(metadata, identifier)) {\n editorMatched = resolveOption(editor, cell);\n }\n }\n });\n }\n return editorMatched;\n };\n /**\n * Choose the most appropriate cell editor to use based on overrides / cell data type.\n *\n * If no match is found in overrides or based on cell data type, and if cell has a primitive\n * data type then TextCellEditor is used as default cell editor. If 'default' cell editor\n * is overridden, then it is used instead of TextCellEditor for default.\n */\n CellEditorController.prototype._getEditor = function (cell) {\n var dtKey = this._getDataTypeKey(cell);\n // find an editor based on data type based override\n if (this._typeBasedOverrides.has(dtKey)) {\n var editor = this._typeBasedOverrides.get(dtKey);\n return resolveOption(editor, cell);\n } // find an editor based on metadata match based override\n else if (this._metadataBasedOverrides.size > 0) {\n var editor = this._getMetadataBasedEditor(cell);\n if (editor) {\n return editor;\n }\n }\n // choose an editor based on data type\n switch (dtKey) {\n case 'string':\n return new celleditor.TextCellEditor();\n case 'number':\n return new celleditor.NumberCellEditor();\n case 'integer':\n return new celleditor.IntegerCellEditor();\n case 'boolean':\n return new celleditor.BooleanCellEditor();\n case 'date':\n return new celleditor.DateCellEditor();\n case 'string:option':\n case 'number:option':\n case 'integer:option':\n case 'date:option':\n case 'array:option':\n return new celleditor.OptionCellEditor();\n case 'string:dynamic-option':\n case 'number:dynamic-option':\n case 'integer:dynamic-option':\n case 'date:dynamic-option':\n return new celleditor.DynamicOptionCellEditor();\n }\n // if an override exists for 'default', then use it\n if (this._typeBasedOverrides.has('default')) {\n var editor = this._typeBasedOverrides.get('default');\n return resolveOption(editor, cell);\n }\n // if cell has a primitive data type then use TextCellEditor\n var data = cell.grid.dataModel.data('body', cell.row, cell.column);\n if (!data || typeof data !== 'object') {\n return new celleditor.TextCellEditor();\n }\n // no suitable editor found for the cell\n return undefined;\n };\n return CellEditorController;\n}());\n\nexports.CellEditorController = CellEditorController;\nexports.resolveOption = resolveOption;\n//# sourceMappingURL=celleditorcontroller.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/celleditorcontroller.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\n__webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\n__webpack_require__(/*! ./notification.js */ \"../../packages/datagrid/dist/notification.js\");\nvar celleditor = __webpack_require__(/*! ./celleditor.js */ \"../../packages/datagrid/dist/celleditor.js\");\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2019, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Resolve a config option for a cell editor.\n *\n * @param option - The config option to resolve.\n *\n * @param config - The cell config object.\n *\n * @returns The resolved value for the option.\n */\nfunction resolveOption(option, config) {\n return typeof option === 'function' ? option(config) : option;\n}\n/**\n * An object which manages cell editing. It stores editor overrides,\n * decides which editor to use for a cell, makes sure there is only one editor active.\n */\nvar CellEditorController = /** @class */ (function () {\n function CellEditorController() {\n // active cell editor\n this._editor = null;\n // active cell being edited\n this._cell = null;\n // cell editor overrides based on cell data type identifier\n this._typeBasedOverrides = new Map();\n // cell editor overrides based on partial metadata match\n this._metadataBasedOverrides = new Map();\n }\n /**\n * Override cell editor for the cells matching the identifier.\n *\n * @param identifier - Cell identifier to use when matching cells.\n * if identifier is a CellDataType, then cell matching is done using data type of the cell,\n * if identifier is a Metadata, then partial match of the cell metadata with identifier is used for match,\n * if identifier is 'default' then override is used as default editor when no other editor is found suitable\n *\n * @param editor - The cell editor to use or resolver to use to get an editor for matching cells.\n */\n CellEditorController.prototype.setEditor = function (identifier, editor) {\n if (typeof identifier === 'string') {\n this._typeBasedOverrides.set(identifier, editor);\n }\n else {\n var key = this._metadataIdentifierToKey(identifier);\n this._metadataBasedOverrides.set(key, [identifier, editor]);\n }\n };\n /**\n * Start editing a cell.\n *\n * @param cell - The object holding cell configuration data.\n *\n * @param options - The cell editing options.\n */\n CellEditorController.prototype.edit = function (cell, options) {\n var grid = cell.grid;\n if (!grid.editable) {\n console.error('Grid cannot be edited!');\n return false;\n }\n this.cancel();\n this._cell = cell;\n options = options || {};\n options.onCommit = options.onCommit || this._onCommit.bind(this);\n options.onCancel = options.onCancel || this._onCancel.bind(this);\n // if an editor is passed in with options, then use it for editing\n if (options.editor) {\n this._editor = options.editor;\n options.editor.edit(cell, options);\n return true;\n }\n // choose an editor based on overrides / cell data type\n var editor = this._getEditor(cell);\n if (editor) {\n this._editor = editor;\n editor.edit(cell, options);\n return true;\n }\n return false;\n };\n /**\n * Cancel editing.\n */\n CellEditorController.prototype.cancel = function () {\n if (this._editor) {\n this._editor.cancel();\n this._editor = null;\n }\n this._cell = null;\n };\n CellEditorController.prototype._onCommit = function (response) {\n var cell = this._cell;\n if (!cell) {\n return;\n }\n var grid = cell.grid;\n var dataModel = grid.dataModel;\n dataModel.setData('body', cell.row, cell.column, response.value);\n grid.viewport.node.focus();\n if (response.cursorMovement !== 'none') {\n grid.moveCursor(response.cursorMovement);\n grid.scrollToCursor();\n }\n };\n CellEditorController.prototype._onCancel = function () {\n if (!this._cell) {\n return;\n }\n this._cell.grid.viewport.node.focus();\n };\n CellEditorController.prototype._getDataTypeKey = function (cell) {\n var metadata = cell.grid.dataModel ? cell.grid.dataModel.metadata('body', cell.row, cell.column) : null;\n if (!metadata) {\n return 'default';\n }\n var key = '';\n if (metadata) {\n key = metadata.type;\n }\n if (metadata.constraint && metadata.constraint.enum) {\n if (metadata.constraint.enum === 'dynamic') {\n key += ':dynamic-option';\n }\n else {\n key += ':option';\n }\n }\n return key;\n };\n CellEditorController.prototype._objectToKey = function (object) {\n var str = '';\n for (var key in object) {\n var value = object[key];\n if (typeof value === 'object') {\n str += key + \":\" + this._objectToKey(value);\n }\n else {\n str += \"[\" + key + \":\" + value + \"]\";\n }\n }\n return str;\n };\n CellEditorController.prototype._metadataIdentifierToKey = function (metadata) {\n return this._objectToKey(metadata);\n };\n CellEditorController.prototype._metadataMatchesIdentifier = function (metadata, identifier) {\n for (var key in identifier) {\n if (!metadata.hasOwnProperty(key)) {\n return false;\n }\n var identifierValue = identifier[key];\n var metadataValue = metadata[key];\n if (typeof identifierValue === 'object') {\n if (!this._metadataMatchesIdentifier(metadataValue, identifierValue)) {\n return false;\n }\n }\n else if (metadataValue !== identifierValue) {\n return false;\n }\n }\n return true;\n };\n CellEditorController.prototype._getMetadataBasedEditor = function (cell) {\n var _this = this;\n var editorMatched;\n var metadata = cell.grid.dataModel.metadata('body', cell.row, cell.column);\n if (metadata) {\n this._metadataBasedOverrides.forEach(function (value) {\n if (!editorMatched) {\n var identifier = value[0], editor = value[1];\n if (_this._metadataMatchesIdentifier(metadata, identifier)) {\n editorMatched = resolveOption(editor, cell);\n }\n }\n });\n }\n return editorMatched;\n };\n /**\n * Choose the most appropriate cell editor to use based on overrides / cell data type.\n *\n * If no match is found in overrides or based on cell data type, and if cell has a primitive\n * data type then TextCellEditor is used as default cell editor. If 'default' cell editor\n * is overridden, then it is used instead of TextCellEditor for default.\n */\n CellEditorController.prototype._getEditor = function (cell) {\n var dtKey = this._getDataTypeKey(cell);\n // find an editor based on data type based override\n if (this._typeBasedOverrides.has(dtKey)) {\n var editor = this._typeBasedOverrides.get(dtKey);\n return resolveOption(editor, cell);\n } // find an editor based on metadata match based override\n else if (this._metadataBasedOverrides.size > 0) {\n var editor = this._getMetadataBasedEditor(cell);\n if (editor) {\n return editor;\n }\n }\n // choose an editor based on data type\n switch (dtKey) {\n case 'string':\n return new celleditor.TextCellEditor();\n case 'number':\n return new celleditor.NumberCellEditor();\n case 'integer':\n return new celleditor.IntegerCellEditor();\n case 'boolean':\n return new celleditor.BooleanCellEditor();\n case 'date':\n return new celleditor.DateCellEditor();\n case 'string:option':\n case 'number:option':\n case 'integer:option':\n case 'date:option':\n case 'array:option':\n return new celleditor.OptionCellEditor();\n case 'string:dynamic-option':\n case 'number:dynamic-option':\n case 'integer:dynamic-option':\n case 'date:dynamic-option':\n return new celleditor.DynamicOptionCellEditor();\n }\n // if an override exists for 'default', then use it\n if (this._typeBasedOverrides.has('default')) {\n var editor = this._typeBasedOverrides.get('default');\n return resolveOption(editor, cell);\n }\n // if cell has a primitive data type then use TextCellEditor\n var data = cell.grid.dataModel.data('body', cell.row, cell.column);\n if (!data || typeof data !== 'object') {\n return new celleditor.TextCellEditor();\n }\n // no suitable editor found for the cell\n return undefined;\n };\n return CellEditorController;\n}());\n\nexports.CellEditorController = CellEditorController;\nexports.resolveOption = resolveOption;\n//# sourceMappingURL=celleditorcontroller.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/celleditorcontroller.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/cellrenderer.js": │ │ │ │ /*!*************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/cellrenderer.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/cellrenderer.js ***! │ │ │ │ \*************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * An object which renders the cells of a data grid.\n *\n * #### Notes\n * If the predefined cell renderers are insufficient for a particular\n * use case, a custom cell renderer can be defined which derives from\n * this class.\n *\n * The data grid renders cells in column-major order, by region. The\n * region order is: body, row header, column header, corner header.\n */\nexports.CellRenderer = /** @class */ (function () {\n function CellRenderer() {\n }\n return CellRenderer;\n}());\n/**\n * The namespace for the `CellRenderer` class statics.\n */\n(function (CellRenderer) {\n /**\n * Resolve a config option for a cell renderer.\n *\n * @param option - The config option to resolve.\n *\n * @param config - The cell config object.\n *\n * @returns The resolved value for the option.\n */\n function resolveOption(option, config) {\n return typeof option === 'function' ? option(config) : option;\n }\n CellRenderer.resolveOption = resolveOption;\n})(exports.CellRenderer || (exports.CellRenderer = {}));\n//# sourceMappingURL=cellrenderer.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/cellrenderer.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * An object which renders the cells of a data grid.\n *\n * #### Notes\n * If the predefined cell renderers are insufficient for a particular\n * use case, a custom cell renderer can be defined which derives from\n * this class.\n *\n * The data grid renders cells in column-major order, by region. The\n * region order is: body, row header, column header, corner header.\n */\nexports.CellRenderer = /** @class */ (function () {\n function CellRenderer() {\n }\n return CellRenderer;\n}());\n/**\n * The namespace for the `CellRenderer` class statics.\n */\n(function (CellRenderer) {\n /**\n * Resolve a config option for a cell renderer.\n *\n * @param option - The config option to resolve.\n *\n * @param config - The cell config object.\n *\n * @returns The resolved value for the option.\n */\n function resolveOption(option, config) {\n return typeof option === 'function' ? option(config) : option;\n }\n CellRenderer.resolveOption = resolveOption;\n})(exports.CellRenderer || (exports.CellRenderer = {}));\n//# sourceMappingURL=cellrenderer.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/cellrenderer.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/datagrid.js": │ │ │ │ /*!*********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/datagrid.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/datagrid.js ***! │ │ │ │ \*********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar widgets = __webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\n__webpack_require__(/*! ./notification.js */ \"../../packages/datagrid/dist/notification.js\");\n__webpack_require__(/*! ./celleditor.js */ \"../../packages/datagrid/dist/celleditor.js\");\nvar celleditorcontroller = __webpack_require__(/*! ./celleditorcontroller.js */ \"../../packages/datagrid/dist/celleditorcontroller.js\");\n__webpack_require__(/*! ./cellrenderer.js */ \"../../packages/datagrid/dist/cellrenderer.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar datamodel = __webpack_require__(/*! ./datamodel.js */ \"../../packages/datagrid/dist/datamodel.js\");\nvar graphicscontext = __webpack_require__(/*! ./graphicscontext.js */ \"../../packages/datagrid/dist/graphicscontext.js\");\n__webpack_require__(/*! ./textrenderer.js */ \"../../packages/datagrid/dist/textrenderer.js\");\nvar renderermap = __webpack_require__(/*! ./renderermap.js */ \"../../packages/datagrid/dist/renderermap.js\");\nvar sectionlist = __webpack_require__(/*! ./sectionlist.js */ \"../../packages/datagrid/dist/sectionlist.js\");\n\n/**\n * A widget which implements a high-performance tabular data grid.\n *\n * #### Notes\n * A data grid is implemented as a composition of child widgets. These\n * child widgets are considered an implementation detail. Manipulating\n * the child widgets of a data grid directly is undefined behavior.\n *\n * This class is not designed to be subclassed.\n */\nexports.DataGrid = /** @class */ (function (_super) {\n tslib.__extends(DataGrid, _super);\n /**\n * Construct a new data grid.\n *\n * @param options - The options for initializing the data grid.\n */\n function DataGrid(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this._scrollX = 0;\n _this._scrollY = 0;\n _this._viewportWidth = 0;\n _this._viewportHeight = 0;\n _this._mousedown = false;\n _this._keyHandler = null;\n _this._mouseHandler = null;\n _this._vScrollBarMinWidth = 0;\n _this._hScrollBarMinHeight = 0;\n _this._dpiRatio = Math.ceil(window.devicePixelRatio);\n _this._dataModel = null;\n _this._selectionModel = null;\n _this._editingEnabled = false;\n _this.addClass('lm-DataGrid');\n /* */\n _this.addClass('p-DataGrid');\n /* */\n // Parse the simple options.\n _this._style = options.style || DataGrid.defaultStyle;\n _this._stretchLastRow = options.stretchLastRow || false;\n _this._stretchLastColumn = options.stretchLastColumn || false;\n _this._headerVisibility = options.headerVisibility || 'all';\n _this._cellRenderers = options.cellRenderers || new renderermap.RendererMap();\n _this._copyConfig = options.copyConfig || DataGrid.defaultCopyConfig;\n // Connect to the renderer map changed signal.\n _this._cellRenderers.changed.connect(_this._onRenderersChanged, _this);\n // Parse the default sizes.\n var defaultSizes = options.defaultSizes || DataGrid.defaultSizes;\n var minimumSizes = options.minimumSizes || DataGrid.minimumSizes;\n // Set up the sections lists.\n _this._rowSections = new sectionlist.SectionList({ defaultSize: defaultSizes.rowHeight,\n minimumSize: minimumSizes.rowHeight });\n _this._columnSections = new sectionlist.SectionList({ defaultSize: defaultSizes.columnWidth,\n minimumSize: minimumSizes.columnWidth });\n _this._rowHeaderSections = new sectionlist.SectionList({ defaultSize: defaultSizes.rowHeaderWidth,\n minimumSize: minimumSizes.rowHeaderWidth });\n _this._columnHeaderSections = new sectionlist.SectionList({ defaultSize: defaultSizes.columnHeaderHeight,\n minimumSize: minimumSizes.columnHeaderHeight });\n // Create the canvas, buffer, and overlay objects.\n _this._canvas = Private.createCanvas();\n _this._buffer = Private.createCanvas();\n _this._overlay = Private.createCanvas();\n // Get the graphics contexts for the canvases.\n _this._canvasGC = _this._canvas.getContext('2d');\n _this._bufferGC = _this._buffer.getContext('2d');\n _this._overlayGC = _this._overlay.getContext('2d');\n // Set up the on-screen canvas.\n _this._canvas.style.position = 'absolute';\n _this._canvas.style.top = '0px';\n _this._canvas.style.left = '0px';\n _this._canvas.style.width = '0px';\n _this._canvas.style.height = '0px';\n // Set up the on-screen overlay.\n _this._overlay.style.position = 'absolute';\n _this._overlay.style.top = '0px';\n _this._overlay.style.left = '0px';\n _this._overlay.style.width = '0px';\n _this._overlay.style.height = '0px';\n // Create the internal widgets for the data grid.\n _this._viewport = new widgets.Widget();\n _this._viewport.node.tabIndex = -1;\n _this._viewport.node.style.outline = 'none';\n _this._vScrollBar = new widgets.ScrollBar({ orientation: 'vertical' });\n _this._hScrollBar = new widgets.ScrollBar({ orientation: 'horizontal' });\n _this._scrollCorner = new widgets.Widget();\n _this._editorController = new celleditorcontroller.CellEditorController();\n // Add the extra class names to the child widgets.\n _this._viewport.addClass('lm-DataGrid-viewport');\n _this._vScrollBar.addClass('lm-DataGrid-scrollBar');\n _this._hScrollBar.addClass('lm-DataGrid-scrollBar');\n _this._scrollCorner.addClass('lm-DataGrid-scrollCorner');\n /* */\n _this._viewport.addClass('p-DataGrid-viewport');\n _this._vScrollBar.addClass('p-DataGrid-scrollBar');\n _this._hScrollBar.addClass('p-DataGrid-scrollBar');\n _this._scrollCorner.addClass('p-DataGrid-scrollCorner');\n /* */\n // Add the on-screen canvas to the viewport node.\n _this._viewport.node.appendChild(_this._canvas);\n // Add the on-screen overlay to the viewport node.\n _this._viewport.node.appendChild(_this._overlay);\n // Install the message hooks.\n messaging.MessageLoop.installMessageHook(_this._viewport, _this);\n messaging.MessageLoop.installMessageHook(_this._hScrollBar, _this);\n messaging.MessageLoop.installMessageHook(_this._vScrollBar, _this);\n // Hide the scroll bars and corner from the outset.\n _this._vScrollBar.hide();\n _this._hScrollBar.hide();\n _this._scrollCorner.hide();\n // Connect to the scroll bar signals.\n _this._vScrollBar.thumbMoved.connect(_this._onThumbMoved, _this);\n _this._hScrollBar.thumbMoved.connect(_this._onThumbMoved, _this);\n _this._vScrollBar.pageRequested.connect(_this._onPageRequested, _this);\n _this._hScrollBar.pageRequested.connect(_this._onPageRequested, _this);\n _this._vScrollBar.stepRequested.connect(_this._onStepRequested, _this);\n _this._hScrollBar.stepRequested.connect(_this._onStepRequested, _this);\n // Set the layout cell config for the child widgets.\n widgets.GridLayout.setCellConfig(_this._viewport, { row: 0, column: 0 });\n widgets.GridLayout.setCellConfig(_this._vScrollBar, { row: 0, column: 1 });\n widgets.GridLayout.setCellConfig(_this._hScrollBar, { row: 1, column: 0 });\n widgets.GridLayout.setCellConfig(_this._scrollCorner, { row: 1, column: 1 });\n // Create the layout for the data grid.\n var layout = new widgets.GridLayout({\n rowCount: 2,\n columnCount: 2,\n rowSpacing: 0,\n columnSpacing: 0,\n fitPolicy: 'set-no-constraint'\n });\n // Set the stretch factors for the grid.\n layout.setRowStretch(0, 1);\n layout.setRowStretch(1, 0);\n layout.setColumnStretch(0, 1);\n layout.setColumnStretch(1, 0);\n // Add the child widgets to the layout.\n layout.addWidget(_this._viewport);\n layout.addWidget(_this._vScrollBar);\n layout.addWidget(_this._hScrollBar);\n layout.addWidget(_this._scrollCorner);\n // Install the layout on the data grid.\n _this.layout = layout;\n return _this;\n }\n /**\n * Dispose of the resources held by the widgets.\n */\n DataGrid.prototype.dispose = function () {\n // Release the mouse.\n this._releaseMouse();\n // Dispose of the handlers.\n if (this._keyHandler) {\n this._keyHandler.dispose();\n }\n if (this._mouseHandler) {\n this._mouseHandler.dispose();\n }\n this._keyHandler = null;\n this._mouseHandler = null;\n // Clear the models.\n this._dataModel = null;\n this._selectionModel = null;\n // Clear the section lists.\n this._rowSections.clear();\n this._columnSections.clear();\n this._rowHeaderSections.clear();\n this._columnHeaderSections.clear();\n // Dispose of the base class.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(DataGrid.prototype, \"dataModel\", {\n /**\n * Get the data model for the data grid.\n */\n get: function () {\n return this._dataModel;\n },\n /**\n * Set the data model for the data grid.\n *\n * #### Notes\n * This will automatically remove the current selection model.\n */\n set: function (value) {\n // Do nothing if the model does not change.\n if (this._dataModel === value) {\n return;\n }\n // Release the mouse.\n this._releaseMouse();\n // Clear the selection model.\n this.selectionModel = null;\n // Disconnect the change handler from the old model.\n if (this._dataModel) {\n this._dataModel.changed.disconnect(this._onDataModelChanged, this);\n }\n // Connect the change handler for the new model.\n if (value) {\n value.changed.connect(this._onDataModelChanged, this);\n }\n // Update the internal model reference.\n this._dataModel = value;\n // Clear the section lists.\n this._rowSections.clear();\n this._columnSections.clear();\n this._rowHeaderSections.clear();\n this._columnHeaderSections.clear();\n // Populate the section lists.\n if (value) {\n this._rowSections.insert(0, value.rowCount('body'));\n this._columnSections.insert(0, value.columnCount('body'));\n this._rowHeaderSections.insert(0, value.columnCount('row-header'));\n this._columnHeaderSections.insert(0, value.rowCount('column-header'));\n }\n // Reset the scroll position.\n this._scrollX = 0;\n this._scrollY = 0;\n // Sync the viewport.\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"selectionModel\", {\n /**\n * Get the selection model for the data grid.\n */\n get: function () {\n return this._selectionModel;\n },\n /**\n * Set the selection model for the data grid.\n */\n set: function (value) {\n // Do nothing if the selection model does not change.\n if (this._selectionModel === value) {\n return;\n }\n // Release the mouse.\n this._releaseMouse();\n // Ensure the data models are a match.\n if (value && value.dataModel !== this._dataModel) {\n throw new Error('SelectionModel.dataModel !== DataGrid.dataModel');\n }\n // Disconnect the change handler from the old model.\n if (this._selectionModel) {\n this._selectionModel.changed.disconnect(this._onSelectionsChanged, this);\n }\n // Connect the change handler for the new model.\n if (value) {\n value.changed.connect(this._onSelectionsChanged, this);\n }\n // Update the internal selection model reference.\n this._selectionModel = value;\n // Schedule a repaint of the overlay.\n this.repaintOverlay();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"keyHandler\", {\n /**\n * Get the key handler for the data grid.\n */\n get: function () {\n return this._keyHandler;\n },\n /**\n * Set the key handler for the data grid.\n */\n set: function (value) {\n this._keyHandler = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"mouseHandler\", {\n /**\n * Get the mouse handler for the data grid.\n */\n get: function () {\n return this._mouseHandler;\n },\n /**\n * Set the mouse handler for the data grid.\n */\n set: function (value) {\n // Bail early if the mouse handler does not change.\n if (this._mouseHandler === value) {\n return;\n }\n // Release the mouse.\n this._releaseMouse();\n // Update the internal mouse handler.\n this._mouseHandler = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"style\", {\n /**\n * Get the style for the data grid.\n */\n get: function () {\n return this._style;\n },\n /**\n * Set the style for the data grid.\n */\n set: function (value) {\n // Bail if the style does not change.\n if (this._style === value) {\n return;\n }\n // Update the internal style.\n this._style = tslib.__assign({}, value);\n // Schedule a repaint of the content.\n this.repaintContent();\n // Schedule a repaint of the overlay.\n this.repaintOverlay();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"cellRenderers\", {\n /**\n * Get the cell renderer map for the data grid.\n */\n get: function () {\n return this._cellRenderers;\n },\n /**\n * Set the cell renderer map for the data grid.\n */\n set: function (value) {\n // Bail if the renderer map does not change.\n if (this._cellRenderers === value) {\n return;\n }\n // Disconnect the old map.\n this._cellRenderers.changed.disconnect(this._onRenderersChanged, this);\n // Connect the new map.\n value.changed.connect(this._onRenderersChanged, this);\n // Update the internal renderer map.\n this._cellRenderers = value;\n // Schedule a repaint of the grid content.\n this.repaintContent();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"headerVisibility\", {\n /**\n * Get the header visibility for the data grid.\n */\n get: function () {\n return this._headerVisibility;\n },\n /**\n * Set the header visibility for the data grid.\n */\n set: function (value) {\n // Bail if the visibility does not change.\n if (this._headerVisibility === value) {\n return;\n }\n // Update the internal visibility.\n this._headerVisibility = value;\n // Sync the viewport.\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"defaultSizes\", {\n /**\n * Get the default sizes for the various sections of the data grid.\n */\n get: function () {\n var rowHeight = this._rowSections.defaultSize;\n var columnWidth = this._columnSections.defaultSize;\n var rowHeaderWidth = this._rowHeaderSections.defaultSize;\n var columnHeaderHeight = this._columnHeaderSections.defaultSize;\n return { rowHeight: rowHeight, columnWidth: columnWidth, rowHeaderWidth: rowHeaderWidth, columnHeaderHeight: columnHeaderHeight };\n },\n /**\n * Set the default sizes for the various sections of the data grid.\n */\n set: function (value) {\n // Update the section default sizes.\n this._rowSections.defaultSize = value.rowHeight;\n this._columnSections.defaultSize = value.columnWidth;\n this._rowHeaderSections.defaultSize = value.rowHeaderWidth;\n this._columnHeaderSections.defaultSize = value.columnHeaderHeight;\n // Sync the viewport.\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"minimumSizes\", {\n /**\n * Get the minimum sizes for the various sections of the data grid.\n */\n get: function () {\n var rowHeight = this._rowSections.minimumSize;\n var columnWidth = this._columnSections.minimumSize;\n var rowHeaderWidth = this._rowHeaderSections.minimumSize;\n var columnHeaderHeight = this._columnHeaderSections.minimumSize;\n return { rowHeight: rowHeight, columnWidth: columnWidth, rowHeaderWidth: rowHeaderWidth, columnHeaderHeight: columnHeaderHeight };\n },\n /**\n * Set the minimum sizes for the various sections of the data grid.\n */\n set: function (value) {\n // Update the section default sizes.\n this._rowSections.minimumSize = value.rowHeight;\n this._columnSections.minimumSize = value.columnWidth;\n this._rowHeaderSections.minimumSize = value.rowHeaderWidth;\n this._columnHeaderSections.minimumSize = value.columnHeaderHeight;\n // Sync the viewport.\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"copyConfig\", {\n /**\n * Get the copy configuration for the data grid.\n */\n get: function () {\n return this._copyConfig;\n },\n /**\n * Set the copy configuration for the data grid.\n */\n set: function (value) {\n this._copyConfig = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"stretchLastRow\", {\n /**\n * Get whether the last row is stretched.\n */\n get: function () {\n return this._stretchLastRow;\n },\n /**\n * Set whether the last row is stretched.\n */\n set: function (value) {\n // Bail early if the value does not change.\n if (value === this._stretchLastRow) {\n return;\n }\n // Update the internal value.\n this._stretchLastRow = value;\n // Sync the viewport\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"stretchLastColumn\", {\n /**\n * Get whether the last column is stretched.\n */\n get: function () {\n return this._stretchLastColumn;\n },\n /**\n * Set whether the last column is stretched.\n */\n set: function (value) {\n // Bail early if the value does not change.\n if (value === this._stretchLastColumn) {\n return;\n }\n // Update the internal value.\n this._stretchLastColumn = value;\n // Sync the viewport\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"headerWidth\", {\n /**\n * The virtual width of the row headers.\n */\n get: function () {\n if (this._headerVisibility === 'none') {\n return 0;\n }\n if (this._headerVisibility === 'column') {\n return 0;\n }\n return this._rowHeaderSections.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"headerHeight\", {\n /**\n * The virtual height of the column headers.\n */\n get: function () {\n if (this._headerVisibility === 'none') {\n return 0;\n }\n if (this._headerVisibility === 'row') {\n return 0;\n }\n return this._columnHeaderSections.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"bodyWidth\", {\n /**\n * The virtual width of the grid body.\n *\n * #### Notes\n * This does *not* account for a stretched last column.\n */\n get: function () {\n return this._columnSections.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"bodyHeight\", {\n /**\n * The virtual height of the grid body.\n *\n * #### Notes\n * This does *not* account for a stretched last row.\n */\n get: function () {\n return this._rowSections.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"totalWidth\", {\n /**\n * The virtual width of the entire grid.\n *\n * #### Notes\n * This does *not* account for a stretched last column.\n */\n get: function () {\n return this.headerWidth + this.bodyWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"totalHeight\", {\n /**\n * The virtual height of the entire grid.\n *\n * #### Notes\n * This does *not* account for a stretched last row.\n */\n get: function () {\n return this.headerHeight + this.bodyHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"viewportWidth\", {\n /**\n * The actual width of the viewport.\n */\n get: function () {\n return this._viewportWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"viewportHeight\", {\n /**\n * The actual height of the viewport.\n */\n get: function () {\n return this._viewportHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"pageWidth\", {\n /**\n * The width of the visible portion of the grid body.\n */\n get: function () {\n return Math.max(0, this.viewportWidth - this.headerWidth);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"pageHeight\", {\n /**\n * The height of the visible portion of the grid body.\n */\n get: function () {\n return Math.max(0, this.viewportHeight - this.headerHeight);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"scrollX\", {\n /**\n * The current scroll X position of the viewport.\n */\n get: function () {\n return this._hScrollBar.value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"scrollY\", {\n /**\n * The current scroll Y position of the viewport.\n */\n get: function () {\n return this._vScrollBar.value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"maxScrollX\", {\n /**\n * The maximum scroll X position for the grid.\n */\n get: function () {\n return Math.max(0, this.bodyWidth - this.pageWidth - 1);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"maxScrollY\", {\n /**\n * The maximum scroll Y position for the grid.\n */\n get: function () {\n return Math.max(0, this.bodyHeight - this.pageHeight - 1);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"viewport\", {\n /**\n * The viewport widget for the data grid.\n */\n get: function () {\n return this._viewport;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"editorController\", {\n /**\n * The cell editor controller object for the data grid.\n */\n get: function () {\n return this._editorController;\n },\n set: function (controller) {\n this._editorController = controller;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"editingEnabled\", {\n /**\n * Whether the cell editing is enabled for the data grid.\n */\n get: function () {\n return this._editingEnabled;\n },\n set: function (enabled) {\n this._editingEnabled = enabled;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"editable\", {\n /**\n * Whether the grid cells are editable.\n *\n * `editingEnabled` flag must be on and grid must have required\n * selection model, editor controller and data model properties.\n */\n get: function () {\n return this._editingEnabled &&\n this._selectionModel !== null &&\n this._editorController !== null &&\n this.dataModel instanceof datamodel.MutableDataModel;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"canvasGC\", {\n /**\n * The rendering context for painting the data grid.\n */\n get: function () {\n return this._canvasGC;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"rowSections\", {\n /**\n * The row sections of the data grid.\n */\n get: function () {\n return this._rowSections;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"columnSections\", {\n /**\n * The column sections of the data grid.\n */\n get: function () {\n return this._columnSections;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"rowHeaderSections\", {\n /**\n * The row header sections of the data grid.\n */\n get: function () {\n return this._rowHeaderSections;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"columnHeaderSections\", {\n /**\n * The column header sections of the data grid.\n */\n get: function () {\n return this._columnHeaderSections;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Scroll the grid to the specified row.\n *\n * @param row - The row index of the cell.\n *\n * #### Notes\n * This is a no-op if the row is already visible.\n */\n DataGrid.prototype.scrollToRow = function (row) {\n // Fetch the row count.\n var nr = this._rowSections.count;\n // Bail early if there is no content.\n if (nr === 0) {\n return;\n }\n // Floor the row index.\n row = Math.floor(row);\n // Clamp the row index.\n row = Math.max(0, Math.min(row, nr - 1));\n // Get the virtual bounds of the row.\n var y1 = this._rowSections.offsetOf(row);\n var y2 = this._rowSections.extentOf(row);\n // Get the virtual bounds of the viewport.\n var vy1 = this._scrollY;\n var vy2 = this._scrollY + this.pageHeight - 1;\n // Set up the delta variables.\n var dy = 0;\n // Compute the delta Y scroll.\n if (y1 < vy1) {\n dy = y1 - vy1 - 10;\n }\n else if (y2 > vy2) {\n dy = y2 - vy2 + 10;\n }\n // Bail early if no scroll is needed.\n if (dy === 0) {\n return;\n }\n // Scroll by the computed delta.\n this.scrollBy(0, dy);\n };\n /**\n * Scroll the grid to the specified column.\n *\n * @param column - The column index of the cell.\n *\n * #### Notes\n * This is a no-op if the column is already visible.\n */\n DataGrid.prototype.scrollToColumn = function (column) {\n // Fetch the column count.\n var nc = this._columnSections.count;\n // Bail early if there is no content.\n if (nc === 0) {\n return;\n }\n // Floor the column index.\n column = Math.floor(column);\n // Clamp the column index.\n column = Math.max(0, Math.min(column, nc - 1));\n // Get the virtual bounds of the column.\n var x1 = this._columnSections.offsetOf(column);\n var x2 = this._columnSections.extentOf(column);\n // Get the virtual bounds of the viewport.\n var vx1 = this._scrollX;\n var vx2 = this._scrollX + this.pageWidth - 1;\n // Set up the delta variables.\n var dx = 0;\n // Compute the delta X scroll.\n if (x1 < vx1) {\n dx = x1 - vx1 - 10;\n }\n else if (x2 > vx2) {\n dx = x2 - vx2 + 10;\n }\n // Bail early if no scroll is needed.\n if (dx === 0) {\n return;\n }\n // Scroll by the computed delta.\n this.scrollBy(dx, 0);\n };\n /**\n * Scroll the grid to the specified cell.\n *\n * @param row - The row index of the cell.\n *\n * @param column - The column index of the cell.\n *\n * #### Notes\n * This is a no-op if the cell is already visible.\n */\n DataGrid.prototype.scrollToCell = function (row, column) {\n // Fetch the row and column count.\n var nr = this._rowSections.count;\n var nc = this._columnSections.count;\n // Bail early if there is no content.\n if (nr === 0 || nc === 0) {\n return;\n }\n // Floor the cell index.\n row = Math.floor(row);\n column = Math.floor(column);\n // Clamp the cell index.\n row = Math.max(0, Math.min(row, nr - 1));\n column = Math.max(0, Math.min(column, nc - 1));\n // Get the virtual bounds of the cell.\n var x1 = this._columnSections.offsetOf(column);\n var x2 = this._columnSections.extentOf(column);\n var y1 = this._rowSections.offsetOf(row);\n var y2 = this._rowSections.extentOf(row);\n // Get the virtual bounds of the viewport.\n var vx1 = this._scrollX;\n var vx2 = this._scrollX + this.pageWidth - 1;\n var vy1 = this._scrollY;\n var vy2 = this._scrollY + this.pageHeight - 1;\n // Set up the delta variables.\n var dx = 0;\n var dy = 0;\n // Compute the delta X scroll.\n if (x1 < vx1) {\n dx = x1 - vx1 - 10;\n }\n else if (x2 > vx2) {\n dx = x2 - vx2 + 10;\n }\n // Compute the delta Y scroll.\n if (y1 < vy1) {\n dy = y1 - vy1 - 10;\n }\n else if (y2 > vy2) {\n dy = y2 - vy2 + 10;\n }\n // Bail early if no scroll is needed.\n if (dx === 0 && dy === 0) {\n return;\n }\n // Scroll by the computed delta.\n this.scrollBy(dx, dy);\n };\n /**\n * Move cursor down/up/left/right while making sure it remains\n * within the bounds of selected rectangles\n *\n * @param direction - The direction of the movement.\n */\n DataGrid.prototype.moveCursor = function (direction) {\n // Bail early if there is no selection\n if (!this.dataModel ||\n !this._selectionModel ||\n this._selectionModel.isEmpty) {\n return;\n }\n var iter = this._selectionModel.selections();\n var onlyOne = iter.next() && !iter.next();\n // if there is a single selection that is a single cell selection\n // then move the selection and cursor within grid bounds\n if (onlyOne) {\n var currentSel = this._selectionModel.currentSelection();\n if (currentSel.r1 === currentSel.r2 &&\n currentSel.c1 === currentSel.c2) {\n var dr = direction === 'down' ? 1 : direction === 'up' ? -1 : 0;\n var dc = direction === 'right' ? 1 : direction === 'left' ? -1 : 0;\n var newRow = currentSel.r1 + dr;\n var newColumn = currentSel.c1 + dc;\n var rowCount = this.dataModel.rowCount('body');\n var columnCount = this.dataModel.columnCount('body');\n if (newRow >= rowCount) {\n newRow = 0;\n newColumn += 1;\n }\n else if (newRow === -1) {\n newRow = rowCount - 1;\n newColumn -= 1;\n }\n if (newColumn >= columnCount) {\n newColumn = 0;\n newRow += 1;\n if (newRow >= rowCount) {\n newRow = 0;\n }\n }\n else if (newColumn === -1) {\n newColumn = columnCount - 1;\n newRow -= 1;\n if (newRow === -1) {\n newRow = rowCount - 1;\n }\n }\n this._selectionModel.select({\n r1: newRow, c1: newColumn,\n r2: newRow, c2: newColumn,\n cursorRow: newRow, cursorColumn: newColumn,\n clear: 'all'\n });\n return;\n }\n }\n // if there are multiple selections, move cursor\n // within selection rectangles\n this._selectionModel.moveCursorWithinSelections(direction);\n };\n /**\n * Scroll the grid to the current cursor position.\n *\n * #### Notes\n * This is a no-op if the cursor is already visible or\n * if there is no selection model installed on the grid.\n */\n DataGrid.prototype.scrollToCursor = function () {\n // Bail early if there is no selection model.\n if (!this._selectionModel) {\n return;\n }\n // Fetch the cursor row and column.\n var row = this._selectionModel.cursorRow;\n var column = this._selectionModel.cursorColumn;\n // Scroll to the cursor cell.\n this.scrollToCell(row, column);\n };\n /**\n * Scroll the viewport by the specified amount.\n *\n * @param dx - The X scroll amount.\n *\n * @param dy - The Y scroll amount.\n */\n DataGrid.prototype.scrollBy = function (dx, dy) {\n this.scrollTo(this.scrollX + dx, this.scrollY + dy);\n };\n /**\n * Scroll the viewport by one page.\n *\n * @param dir - The desired direction of the scroll.\n */\n DataGrid.prototype.scrollByPage = function (dir) {\n var dx = 0;\n var dy = 0;\n switch (dir) {\n case 'up':\n dy = -this.pageHeight;\n break;\n case 'down':\n dy = this.pageHeight;\n break;\n case 'left':\n dx = -this.pageWidth;\n break;\n case 'right':\n dx = this.pageWidth;\n break;\n default:\n throw 'unreachable';\n }\n this.scrollTo(this.scrollX + dx, this.scrollY + dy);\n };\n /**\n * Scroll the viewport by one cell-aligned step.\n *\n * @param dir - The desired direction of the scroll.\n */\n DataGrid.prototype.scrollByStep = function (dir) {\n var r;\n var c;\n var x = this.scrollX;\n var y = this.scrollY;\n var rows = this._rowSections;\n var columns = this._columnSections;\n switch (dir) {\n case 'up':\n r = rows.indexOf(y - 1);\n y = r < 0 ? y : rows.offsetOf(r);\n break;\n case 'down':\n r = rows.indexOf(y);\n y = r < 0 ? y : rows.offsetOf(r) + rows.sizeOf(r);\n break;\n case 'left':\n c = columns.indexOf(x - 1);\n x = c < 0 ? x : columns.offsetOf(c);\n break;\n case 'right':\n c = columns.indexOf(x);\n x = c < 0 ? x : columns.offsetOf(c) + columns.sizeOf(c);\n break;\n default:\n throw 'unreachable';\n }\n this.scrollTo(x, y);\n };\n /**\n * Scroll to the specified offset position.\n *\n * @param x - The desired X position.\n *\n * @param y - The desired Y position.\n */\n DataGrid.prototype.scrollTo = function (x, y) {\n // Floor and clamp the position to the allowable range.\n x = Math.max(0, Math.min(Math.floor(x), this.maxScrollX));\n y = Math.max(0, Math.min(Math.floor(y), this.maxScrollY));\n // Update the scroll bar values with the desired position.\n this._hScrollBar.value = x;\n this._vScrollBar.value = y;\n // Post a scroll request message to the viewport.\n messaging.MessageLoop.postMessage(this._viewport, Private.ScrollRequest);\n };\n /**\n * Get the row count for a particular region in the data grid.\n *\n * @param region - The row region of interest.\n *\n * @returns The row count for the specified region.\n */\n DataGrid.prototype.rowCount = function (region) {\n var count;\n if (region === 'body') {\n count = this._rowSections.count;\n }\n else {\n count = this._columnHeaderSections.count;\n }\n return count;\n };\n /**\n * Get the column count for a particular region in the data grid.\n *\n * @param region - The column region of interest.\n *\n * @returns The column count for the specified region.\n */\n DataGrid.prototype.columnCount = function (region) {\n var count;\n if (region === 'body') {\n count = this._columnSections.count;\n }\n else {\n count = this._rowHeaderSections.count;\n }\n return count;\n };\n /**\n * Get the row at a virtual offset in the data grid.\n *\n * @param region - The region which holds the row of interest.\n *\n * @param offset - The virtual offset of the row of interest.\n *\n * @returns The index of the row, or `-1` if the offset is out of range.\n *\n * #### Notes\n * This method accounts for a stretched last row.\n */\n DataGrid.prototype.rowAt = function (region, offset) {\n // Bail early if the offset is negative.\n if (offset < 0) {\n return -1;\n }\n // Return early for the column header region.\n if (region === 'column-header') {\n return this._columnHeaderSections.indexOf(offset);\n }\n // Fetch the index.\n var index = this._rowSections.indexOf(offset);\n // Return early if the section is found.\n if (index >= 0) {\n return index;\n }\n // Bail early if the last row is not stretched.\n if (!this._stretchLastRow) {\n return -1;\n }\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n // Bail early if no row stretching is required.\n if (ph <= bh) {\n return -1;\n }\n // Bail early if the offset is out of bounds.\n if (offset >= ph) {\n return -1;\n }\n // Otherwise, return the last row.\n return this._rowSections.count - 1;\n };\n /**\n * Get the column at a virtual offset in the data grid.\n *\n * @param region - The region which holds the column of interest.\n *\n * @param offset - The virtual offset of the column of interest.\n *\n * @returns The index of the column, or `-1` if the offset is out of range.\n *\n * #### Notes\n * This method accounts for a stretched last column.\n */\n DataGrid.prototype.columnAt = function (region, offset) {\n if (offset < 0) {\n return -1;\n }\n // Return early for the row header region.\n if (region === 'row-header') {\n return this._rowHeaderSections.indexOf(offset);\n }\n // Fetch the index.\n var index = this._columnSections.indexOf(offset);\n // Return early if the section is found.\n if (index >= 0) {\n return index;\n }\n // Bail early if the last column is not stretched.\n if (!this._stretchLastColumn) {\n return -1;\n }\n // Fetch the geometry.\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n // Bail early if no column stretching is required.\n if (pw <= bw) {\n return -1;\n }\n // Bail early if the offset is out of bounds.\n if (offset >= pw) {\n return -1;\n }\n // Otherwise, return the last column.\n return this._columnSections.count - 1;\n };\n /**\n * Get the offset of a row in the data grid.\n *\n * @param region - The region which holds the row of interest.\n *\n * @param index - The index of the row of interest.\n *\n * @returns The offset of the row, or `-1` if the index is out of range.\n *\n * #### Notes\n * A stretched last row has no effect on the return value.\n */\n DataGrid.prototype.rowOffset = function (region, index) {\n var offset;\n if (region === 'body') {\n offset = this._rowSections.offsetOf(index);\n }\n else {\n offset = this._columnHeaderSections.offsetOf(index);\n }\n return offset;\n };\n /**\n * Get the offset of a column in the data grid.\n *\n * @param region - The region which holds the column of interest.\n *\n * @param index - The index of the column of interest.\n *\n * @returns The offset of the column, or `-1` if the index is out of range.\n *\n * #### Notes\n * A stretched last column has no effect on the return value.\n */\n DataGrid.prototype.columnOffset = function (region, index) {\n var offset;\n if (region === 'body') {\n offset = this._columnSections.offsetOf(index);\n }\n else {\n offset = this._rowHeaderSections.offsetOf(index);\n }\n return offset;\n };\n /**\n * Get the size of a row in the data grid.\n *\n * @param region - The region which holds the row of interest.\n *\n * @param index - The index of the row of interest.\n *\n * @returns The size of the row, or `-1` if the index is out of range.\n *\n * #### Notes\n * This method accounts for a stretched last row.\n */\n DataGrid.prototype.rowSize = function (region, index) {\n // Return early for the column header region.\n if (region === 'column-header') {\n return this._columnHeaderSections.sizeOf(index);\n }\n // Fetch the row size.\n var size = this._rowSections.sizeOf(index);\n // Bail early if the index is out of bounds.\n if (size < 0) {\n return size;\n }\n // Return early if the last row is not stretched.\n if (!this._stretchLastRow) {\n return size;\n }\n // Return early if its not the last row.\n if (index < this._rowSections.count - 1) {\n return size;\n }\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n // Return early if no stretching is needed.\n if (ph <= bh) {\n return size;\n }\n // Return the adjusted size.\n return size + (ph - bh);\n };\n /**\n * Get the size of a column in the data grid.\n *\n * @param region - The region which holds the column of interest.\n *\n * @param index - The index of the column of interest.\n *\n * @returns The size of the column, or `-1` if the index is out of range.\n *\n * #### Notes\n * This method accounts for a stretched last column.\n */\n DataGrid.prototype.columnSize = function (region, index) {\n // Return early for the row header region.\n if (region === 'row-header') {\n return this._rowHeaderSections.sizeOf(index);\n }\n // Fetch the column size.\n var size = this._columnSections.sizeOf(index);\n // Bail early if the index is out of bounds.\n if (size < 0) {\n return size;\n }\n // Return early if the last column is not stretched.\n if (!this._stretchLastColumn) {\n return size;\n }\n // Return early if its not the last column.\n if (index < this._columnSections.count - 1) {\n return size;\n }\n // Fetch the geometry.\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n // Return early if no stretching is needed.\n if (pw <= bw) {\n return size;\n }\n // Return the adjusted size.\n return size + (pw - bw);\n };\n /**\n * Resize a row in the data grid.\n *\n * @param region - The region which holds the row of interest.\n *\n * @param index - The index of the row of interest.\n *\n * @param size - The desired size of the row.\n */\n DataGrid.prototype.resizeRow = function (region, index, size) {\n var msg = new Private.RowResizeRequest(region, index, size);\n messaging.MessageLoop.postMessage(this._viewport, msg);\n };\n /**\n * Resize a column in the data grid.\n *\n * @param region - The region which holds the column of interest.\n *\n * @param index - The index of the column of interest.\n *\n * @param size - The desired size of the column.\n */\n DataGrid.prototype.resizeColumn = function (region, index, size) {\n var msg = new Private.ColumnResizeRequest(region, index, size);\n messaging.MessageLoop.postMessage(this._viewport, msg);\n };\n /**\n * Reset modified rows to their default size.\n *\n * @param region - The row region of interest.\n */\n DataGrid.prototype.resetRows = function (region) {\n switch (region) {\n case 'all':\n this._rowSections.reset();\n this._columnHeaderSections.reset();\n break;\n case 'body':\n this._rowSections.reset();\n break;\n case 'column-header':\n this._columnHeaderSections.reset();\n break;\n default:\n throw 'unreachable';\n }\n this.repaintContent();\n this.repaintOverlay();\n };\n /**\n * Reset modified columns to their default size.\n *\n * @param region - The column region of interest.\n */\n DataGrid.prototype.resetColumns = function (region) {\n switch (region) {\n case 'all':\n this._columnSections.reset();\n this._rowHeaderSections.reset();\n break;\n case 'body':\n this._columnSections.reset();\n break;\n case 'row-header':\n this._rowHeaderSections.reset();\n break;\n default:\n throw 'unreachable';\n }\n this.repaintContent();\n this.repaintOverlay();\n };\n /**\n * Map a client position to local viewport coordinates.\n *\n * @param clientX - The client X position of the mouse.\n *\n * @param clientY - The client Y position of the mouse.\n *\n * @returns The local viewport coordinates for the position.\n */\n DataGrid.prototype.mapToLocal = function (clientX, clientY) {\n // Fetch the viewport rect.\n var rect = this._viewport.node.getBoundingClientRect();\n // Extract the rect coordinates.\n var left = rect.left, top = rect.top;\n // Round the rect coordinates for sub-pixel positioning.\n left = Math.floor(left);\n top = Math.floor(top);\n // Convert to local coordinates.\n var lx = clientX - left;\n var ly = clientY - top;\n // Return the local coordinates.\n return { lx: lx, ly: ly };\n };\n /**\n * Map a client position to virtual grid coordinates.\n *\n * @param clientX - The client X position of the mouse.\n *\n * @param clientY - The client Y position of the mouse.\n *\n * @returns The virtual grid coordinates for the position.\n */\n DataGrid.prototype.mapToVirtual = function (clientX, clientY) {\n // Convert to local coordiates.\n var _a = this.mapToLocal(clientX, clientY), lx = _a.lx, ly = _a.ly;\n // Convert to virtual coordinates.\n var vx = lx + this.scrollX - this.headerWidth;\n var vy = ly + this.scrollY - this.headerHeight;\n // Return the local coordinates.\n return { vx: vx, vy: vy };\n };\n /**\n * Hit test the viewport for the given client position.\n *\n * @param clientX - The client X position of the mouse.\n *\n * @param clientY - The client Y position of the mouse.\n *\n * @returns The hit test result, or `null` if the client\n * position is out of bounds.\n *\n * #### Notes\n * This method accounts for a stretched last row and/or column.\n */\n DataGrid.prototype.hitTest = function (clientX, clientY) {\n // Convert the mouse position into local coordinates.\n var _a = this.mapToLocal(clientX, clientY), lx = _a.lx, ly = _a.ly;\n // Fetch the header and body dimensions.\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n var pw = this.pageWidth;\n // Adjust the body width for a stretched last column.\n if (this._stretchLastColumn && pw > bw) {\n bw = pw;\n }\n // Adjust the body height for a stretched last row.\n if (this._stretchLastRow && ph > bh) {\n bh = ph;\n }\n // Check for a corner header hit.\n if (lx >= 0 && lx < hw && ly >= 0 && ly < hh) {\n // Convert to unscrolled virtual coordinates.\n var vx = lx;\n var vy = ly;\n // Fetch the row and column index.\n var row_1 = this.rowAt('column-header', vy);\n var column_1 = this.columnAt('row-header', vx);\n // Fetch the cell offset position.\n var ox = this.columnOffset('row-header', column_1);\n var oy = this.rowOffset('column-header', row_1);\n // Fetch cell width and height.\n var width_1 = this.columnSize('row-header', column_1);\n var height_1 = this.rowSize('column-header', row_1);\n // Compute the leading and trailing positions.\n var x_1 = vx - ox;\n var y_1 = vy - oy;\n // Return the hit test result.\n return { region: 'corner-header', row: row_1, column: column_1, x: x_1, y: y_1, width: width_1, height: height_1 };\n }\n // Check for a column header hit.\n if (ly >= 0 && ly < hh && lx >= 0 && lx < (hw + bw)) {\n // Convert to unscrolled virtual coordinates.\n var vx = lx + this._scrollX - hw;\n var vy = ly;\n // Fetch the row and column index.\n var row_2 = this.rowAt('column-header', vy);\n var column_2 = this.columnAt('body', vx);\n // Fetch the cell offset position.\n var ox = this.columnOffset('body', column_2);\n var oy = this.rowOffset('column-header', row_2);\n // Fetch the cell width and height.\n var width_2 = this.columnSize('body', column_2);\n var height_2 = this.rowSize('column-header', row_2);\n // Compute the leading and trailing positions.\n var x_2 = vx - ox;\n var y_2 = vy - oy;\n // Return the hit test result.\n return { region: 'column-header', row: row_2, column: column_2, x: x_2, y: y_2, width: width_2, height: height_2 };\n }\n // Check for a row header hit.\n if (lx >= 0 && lx < hw && ly >= 0 && ly < (hh + bh)) {\n // Convert to unscrolled virtual coordinates.\n var vx = lx;\n var vy = ly + this._scrollY - hh;\n // Fetch the row and column index.\n var row_3 = this.rowAt('body', vy);\n var column_3 = this.columnAt('row-header', vx);\n // Fetch the cell offset position.\n var ox = this.columnOffset('row-header', column_3);\n var oy = this.rowOffset('body', row_3);\n // Fetch the cell width and height.\n var width_3 = this.columnSize('row-header', column_3);\n var height_3 = this.rowSize('body', row_3);\n // Compute the leading and trailing positions.\n var x_3 = vx - ox;\n var y_3 = vy - oy;\n // Return the hit test result.\n return { region: 'row-header', row: row_3, column: column_3, x: x_3, y: y_3, width: width_3, height: height_3 };\n }\n // Check for a body hit.\n if (lx >= hw && lx < (hw + bw) && ly >= hh && ly < (hh + bh)) {\n // Convert to unscrolled virtual coordinates.\n var vx = lx + this._scrollX - hw;\n var vy = ly + this._scrollY - hh;\n // Fetch the row and column index.\n var row_4 = this.rowAt('body', vy);\n var column_4 = this.columnAt('body', vx);\n // Fetch the cell offset position.\n var ox = this.columnOffset('body', column_4);\n var oy = this.rowOffset('body', row_4);\n // Fetch the cell width and height.\n var width_4 = this.columnSize('body', column_4);\n var height_4 = this.rowSize('body', row_4);\n // Compute the part coordinates.\n var x_4 = vx - ox;\n var y_4 = vy - oy;\n // Return the result.\n return { region: 'body', row: row_4, column: column_4, x: x_4, y: y_4, width: width_4, height: height_4 };\n }\n // Otherwise, it's a void space hit.\n var row = -1;\n var column = -1;\n var x = -1;\n var y = -1;\n var width = -1;\n var height = -1;\n // Return the hit test result.\n return { region: 'void', row: row, column: column, x: x, y: y, width: width, height: height };\n };\n /**\n * Copy the current selection to the system clipboard.\n *\n * #### Notes\n * The grid must have a data model and a selection model.\n *\n * The behavior can be configured via `DataGrid.copyConfig`.\n */\n DataGrid.prototype.copyToClipboard = function () {\n var _a, _b;\n // Fetch the data model.\n var dataModel = this._dataModel;\n // Bail early if there is no data model.\n if (!dataModel) {\n return;\n }\n // Fetch the selection model.\n var selectionModel = this._selectionModel;\n // Bail early if there is no selection model.\n if (!selectionModel) {\n return;\n }\n // Coerce the selections to an array.\n var selections = algorithm.toArray(selectionModel.selections());\n // Bail early if there are no selections.\n if (selections.length === 0) {\n return;\n }\n // Alert that multiple selections cannot be copied.\n if (selections.length > 1) {\n alert('Cannot copy multiple grid selections.');\n return;\n }\n // Fetch the model counts.\n var br = dataModel.rowCount('body');\n var bc = dataModel.columnCount('body');\n // Bail early if there is nothing to copy.\n if (br === 0 || bc === 0) {\n return;\n }\n // Unpack the selection.\n var _c = selections[0], r1 = _c.r1, c1 = _c.c1, r2 = _c.r2, c2 = _c.c2;\n // Clamp the selection to the model bounds.\n r1 = Math.max(0, Math.min(r1, br - 1));\n c1 = Math.max(0, Math.min(c1, bc - 1));\n r2 = Math.max(0, Math.min(r2, br - 1));\n c2 = Math.max(0, Math.min(c2, bc - 1));\n // Ensure the limits are well-orderd.\n if (r2 < r1)\n _a = [r2, r1], r1 = _a[0], r2 = _a[1];\n if (c2 < c1)\n _b = [c2, c1], c1 = _b[0], c2 = _b[1];\n // Fetch the header counts.\n var rhc = dataModel.columnCount('row-header');\n var chr = dataModel.rowCount('column-header');\n // Unpack the copy config.\n var separator = this._copyConfig.separator;\n var format = this._copyConfig.format;\n var headers = this._copyConfig.headers;\n var warningThreshold = this._copyConfig.warningThreshold;\n // Compute the number of cells to be copied.\n var rowCount = r2 - r1 + 1;\n var colCount = c2 - c1 + 1;\n switch (headers) {\n case 'none':\n rhc = 0;\n chr = 0;\n break;\n case 'row':\n chr = 0;\n colCount += rhc;\n break;\n case 'column':\n rhc = 0;\n rowCount += chr;\n break;\n case 'all':\n rowCount += chr;\n colCount += rhc;\n break;\n default:\n throw 'unreachable';\n }\n // Compute the total cell count.\n var cellCount = rowCount * colCount;\n // Allow the user to cancel a large copy request.\n if (cellCount > warningThreshold) {\n var msg = \"Copying \" + cellCount + \" cells may take a while. Continue?\";\n if (!window.confirm(msg)) {\n return;\n }\n }\n // Set up the format args.\n var args = {\n region: 'body',\n row: 0,\n column: 0,\n value: null,\n metadata: {}\n };\n // Allocate the array of rows.\n var rows = new Array(rowCount);\n // Iterate over the rows.\n for (var j = 0; j < rowCount; ++j) {\n // Allocate the array of cells.\n var cells = new Array(colCount);\n // Iterate over the columns.\n for (var i = 0; i < colCount; ++i) {\n // Set up the format variables.\n var region = void 0;\n var row = void 0;\n var column = void 0;\n // Populate the format variables.\n if (j < chr && i < rhc) {\n region = 'corner-header';\n row = j;\n column = i;\n }\n else if (j < chr) {\n region = 'column-header';\n row = j;\n column = i - rhc + c1;\n }\n else if (i < rhc) {\n region = 'row-header';\n row = j - chr + r1;\n column = i;\n }\n else {\n region = 'body';\n row = j - chr + r1;\n column = i - rhc + c1;\n }\n // Populate the format args.\n args.region = region;\n args.row = row;\n args.column = column;\n args.value = dataModel.data(region, row, column);\n args.metadata = dataModel.metadata(region, row, column);\n // Format the cell.\n cells[i] = format(args);\n }\n // Save the row of cells.\n rows[j] = cells;\n }\n // Convert the cells into lines.\n var lines = rows.map(function (cells) { return cells.join(separator); });\n // Convert the lines into text.\n var text = lines.join('\\n');\n // Copy the text to the clipboard.\n domutils.ClipboardExt.copyText(text);\n };\n /**\n * Process a message sent to the widget.\n *\n * @param msg - The message sent to the widget.\n */\n DataGrid.prototype.processMessage = function (msg) {\n // Ignore child show/hide messages. The data grid controls the\n // visibility of its children, and will manually dispatch the\n // fit-request messages as a result of visibility change.\n if (msg.type === 'child-shown' || msg.type === 'child-hidden') {\n return;\n }\n // Recompute the scroll bar minimums before the layout refits.\n if (msg.type === 'fit-request') {\n var vsbLimits = domutils.ElementExt.sizeLimits(this._vScrollBar.node);\n var hsbLimits = domutils.ElementExt.sizeLimits(this._hScrollBar.node);\n this._vScrollBarMinWidth = vsbLimits.minWidth;\n this._hScrollBarMinHeight = hsbLimits.minHeight;\n }\n // Process all other messages as normal.\n _super.prototype.processMessage.call(this, msg);\n };\n /**\n * Intercept a message sent to a message handler.\n *\n * @param handler - The target handler of the message.\n *\n * @param msg - The message to be sent to the handler.\n *\n * @returns `true` if the message should continue to be processed\n * as normal, or `false` if processing should cease immediately.\n */\n DataGrid.prototype.messageHook = function (handler, msg) {\n // Process viewport messages.\n if (handler === this._viewport) {\n this._processViewportMessage(msg);\n return true;\n }\n // Process horizontal scroll bar messages.\n if (handler === this._hScrollBar && msg.type === 'activate-request') {\n this.activate();\n return false;\n }\n // Process vertical scroll bar messages.\n if (handler === this._vScrollBar && msg.type === 'activate-request') {\n this.activate();\n return false;\n }\n // Ignore all other messages.\n return true;\n };\n /**\n * Handle the DOM events for the data grid.\n *\n * @param event - The DOM event sent to the data grid.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the data grid's DOM node. It\n * should not be called directly by user code.\n */\n DataGrid.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'dblclick':\n this._evtMouseDoubleClick(event);\n break;\n case 'mouseleave':\n this._evtMouseLeave(event);\n break;\n case 'contextmenu':\n this._evtContextMenu(event);\n break;\n case 'wheel':\n this._evtWheel(event);\n break;\n case 'resize':\n this._refreshDPI();\n break;\n }\n };\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n DataGrid.prototype.onActivateRequest = function (msg) {\n this.viewport.node.focus();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n DataGrid.prototype.onBeforeAttach = function (msg) {\n window.addEventListener('resize', this);\n this.node.addEventListener('wheel', this);\n this._viewport.node.addEventListener('keydown', this);\n this._viewport.node.addEventListener('mousedown', this);\n this._viewport.node.addEventListener('mousemove', this);\n this._viewport.node.addEventListener('dblclick', this);\n this._viewport.node.addEventListener('mouseleave', this);\n this._viewport.node.addEventListener('contextmenu', this);\n this.repaintContent();\n this.repaintOverlay();\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n DataGrid.prototype.onAfterDetach = function (msg) {\n window.removeEventListener('resize', this);\n this.node.removeEventListener('wheel', this);\n this._viewport.node.removeEventListener('keydown', this);\n this._viewport.node.removeEventListener('mousedown', this);\n this._viewport.node.removeEventListener('mousemove', this);\n this._viewport.node.removeEventListener('mouseleave', this);\n this._viewport.node.removeEventListener('dblclick', this);\n this._viewport.node.removeEventListener('contextmenu', this);\n this._releaseMouse();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n DataGrid.prototype.onBeforeShow = function (msg) {\n this.repaintContent();\n this.repaintOverlay();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n DataGrid.prototype.onResize = function (msg) {\n if (this._editorController) {\n this._editorController.cancel();\n }\n this._syncScrollState();\n };\n /**\n * Schedule a repaint of all of the grid content.\n */\n DataGrid.prototype.repaintContent = function () {\n var msg = new Private.PaintRequest('all', 0, 0, 0, 0);\n messaging.MessageLoop.postMessage(this._viewport, msg);\n };\n /**\n * Schedule a repaint of specific grid content.\n */\n DataGrid.prototype._repaintRegion = function (region, r1, c1, r2, c2) {\n var msg = new Private.PaintRequest(region, r1, c1, r2, c2);\n messaging.MessageLoop.postMessage(this._viewport, msg);\n };\n /**\n * Schedule a repaint of the overlay.\n */\n DataGrid.prototype.repaintOverlay = function () {\n messaging.MessageLoop.postMessage(this._viewport, Private.OverlayPaintRequest);\n };\n /**\n * Ensure the canvas is at least the specified size.\n *\n * This method will retain the valid canvas content.\n */\n DataGrid.prototype._resizeCanvasIfNeeded = function (width, height) {\n // Scale the size by the dpi ratio.\n width = width * this._dpiRatio;\n height = height * this._dpiRatio;\n // Compute the maximum canvas size for the given width and height.\n var maxW = (Math.ceil((width + 1) / 512) + 1) * 512;\n var maxH = (Math.ceil((height + 1) / 512) + 1) * 512;\n // Get the current size of the canvas.\n var curW = this._canvas.width;\n var curH = this._canvas.height;\n // Bail early if the canvas size is within bounds.\n if (curW >= width && curH >= height && curW <= maxW && curH <= maxH) {\n return;\n }\n // Compute the expanded canvas size.\n var expW = maxW - 512;\n var expH = maxH - 512;\n // Set the transforms to the identity matrix.\n this._canvasGC.setTransform(1, 0, 0, 1, 0, 0);\n this._bufferGC.setTransform(1, 0, 0, 1, 0, 0);\n this._overlayGC.setTransform(1, 0, 0, 1, 0, 0);\n // Resize the buffer if needed.\n if (curW < width) {\n this._buffer.width = expW;\n }\n else if (curW > maxW) {\n this._buffer.width = maxW;\n }\n // Resize the buffer height if needed.\n if (curH < height) {\n this._buffer.height = expH;\n }\n else if (curH > maxH) {\n this._buffer.height = maxH;\n }\n // Test whether there is content to blit.\n var needBlit = curH > 0 && curH > 0 && width > 0 && height > 0;\n // Copy the valid canvas content into the buffer if needed.\n if (needBlit) {\n this._bufferGC.drawImage(this._canvas, 0, 0);\n }\n // Resize the canvas width if needed.\n if (curW < width) {\n this._canvas.width = expW;\n this._canvas.style.width = expW / this._dpiRatio + \"px\";\n }\n else if (curW > maxW) {\n this._canvas.width = maxW;\n this._canvas.style.width = maxW / this._dpiRatio + \"px\";\n }\n // Resize the canvas height if needed.\n if (curH < height) {\n this._canvas.height = expH;\n this._canvas.style.height = expH / this._dpiRatio + \"px\";\n }\n else if (curH > maxH) {\n this._canvas.height = maxH;\n this._canvas.style.height = maxH / this._dpiRatio + \"px\";\n }\n // Copy the valid canvas content from the buffer if needed.\n if (needBlit) {\n this._canvasGC.drawImage(this._buffer, 0, 0);\n }\n // Copy the valid overlay content into the buffer if needed.\n if (needBlit) {\n this._bufferGC.drawImage(this._overlay, 0, 0);\n }\n // Resize the overlay width if needed.\n if (curW < width) {\n this._overlay.width = expW;\n this._overlay.style.width = expW / this._dpiRatio + \"px\";\n }\n else if (curW > maxW) {\n this._overlay.width = maxW;\n this._overlay.style.width = maxW / this._dpiRatio + \"px\";\n }\n // Resize the overlay height if needed.\n if (curH < height) {\n this._overlay.height = expH;\n this._overlay.style.height = expH / this._dpiRatio + \"px\";\n }\n else if (curH > maxH) {\n this._overlay.height = maxH;\n this._overlay.style.height = maxH / this._dpiRatio + \"px\";\n }\n // Copy the valid overlay content from the buffer if needed.\n if (needBlit) {\n this._overlayGC.drawImage(this._buffer, 0, 0);\n }\n };\n /**\n * Sync the scroll bars and scroll state with the viewport.\n *\n * #### Notes\n * If the visibility of either scroll bar changes, a synchronous\n * fit-request will be dispatched to the data grid to immediately\n * resize the viewport.\n */\n DataGrid.prototype._syncScrollState = function () {\n // Fetch the viewport dimensions.\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n var pw = this.pageWidth;\n var ph = this.pageHeight;\n // Get the current scroll bar visibility.\n var hasVScroll = !this._vScrollBar.isHidden;\n var hasHScroll = !this._hScrollBar.isHidden;\n // Get the minimum sizes of the scroll bars.\n var vsw = this._vScrollBarMinWidth;\n var hsh = this._hScrollBarMinHeight;\n // Get the page size as if no scroll bars are visible.\n var apw = pw + (hasVScroll ? vsw : 0);\n var aph = ph + (hasHScroll ? hsh : 0);\n // Test whether scroll bars are needed for the adjusted size.\n var needVScroll = aph < bh - 1;\n var needHScroll = apw < bw - 1;\n // Re-test the horizontal scroll if a vertical scroll is needed.\n if (needVScroll && !needHScroll) {\n needHScroll = (apw - vsw) < bw - 1;\n }\n // Re-test the vertical scroll if a horizontal scroll is needed.\n if (needHScroll && !needVScroll) {\n needVScroll = (aph - hsh) < bh - 1;\n }\n // If the visibility changes, immediately refit the grid.\n if (needVScroll !== hasVScroll || needHScroll !== hasHScroll) {\n this._vScrollBar.setHidden(!needVScroll);\n this._hScrollBar.setHidden(!needHScroll);\n this._scrollCorner.setHidden(!needVScroll || !needHScroll);\n messaging.MessageLoop.sendMessage(this, widgets.Widget.Msg.FitRequest);\n }\n // Update the scroll bar limits.\n this._vScrollBar.maximum = this.maxScrollY;\n this._vScrollBar.page = this.pageHeight;\n this._hScrollBar.maximum = this.maxScrollX;\n this._hScrollBar.page = this.pageWidth;\n // Re-clamp the scroll position.\n this._scrollTo(this._scrollX, this._scrollY);\n };\n /**\n * Sync the viewport to the given scroll position.\n *\n * #### Notes\n * This schedules a full repaint and syncs the scroll state.\n */\n DataGrid.prototype._syncViewport = function () {\n this.repaintContent();\n this.repaintOverlay();\n this._syncScrollState();\n };\n /**\n * Process a message sent to the viewport\n */\n DataGrid.prototype._processViewportMessage = function (msg) {\n switch (msg.type) {\n case 'resize':\n this._onViewportResize(msg);\n break;\n case 'scroll-request':\n this._onViewportScrollRequest(msg);\n break;\n case 'paint-request':\n this._onViewportPaintRequest(msg);\n break;\n case 'overlay-paint-request':\n this._onViewportOverlayPaintRequest(msg);\n break;\n case 'row-resize-request':\n this._onViewportRowResizeRequest(msg);\n break;\n case 'column-resize-request':\n this._onViewportColumnResizeRequest(msg);\n break;\n }\n };\n /**\n * A message hook invoked on a viewport `'resize'` message.\n */\n DataGrid.prototype._onViewportResize = function (msg) {\n // Bail early if the viewport is not visible.\n if (!this._viewport.isVisible) {\n return;\n }\n // Unpack the message data.\n var width = msg.width, height = msg.height;\n // Measure the viewport node if the dimensions are unknown.\n if (width === -1) {\n width = this._viewport.node.offsetWidth;\n }\n if (height === -1) {\n height = this._viewport.node.offsetHeight;\n }\n // Round the dimensions to the nearest pixel.\n width = Math.round(width);\n height = Math.round(height);\n // Get the current size of the viewport.\n var oldWidth = this._viewportWidth;\n var oldHeight = this._viewportHeight;\n // Updated internal viewport size.\n this._viewportWidth = width;\n this._viewportHeight = height;\n // Resize the canvas if needed.\n this._resizeCanvasIfNeeded(width, height);\n // Bail early if there is nothing to paint.\n if (width === 0 || height === 0) {\n return;\n }\n // Paint the whole grid if the old size was zero.\n if (oldWidth === 0 || oldHeight === 0) {\n this.paintContent(0, 0, width, height);\n this._paintOverlay();\n return;\n }\n // Paint the right edge as needed.\n if (this._stretchLastColumn && this.pageWidth > this.bodyWidth) {\n var bx = this._columnSections.offsetOf(this._columnSections.count - 1);\n var x = Math.min(this.headerWidth + bx, oldWidth);\n this.paintContent(x, 0, width - x, height);\n }\n else if (width > oldWidth) {\n this.paintContent(oldWidth, 0, width - oldWidth, height);\n }\n // Paint the bottom edge as needed.\n if (this._stretchLastRow && this.pageHeight > this.bodyHeight) {\n var by = this._rowSections.offsetOf(this._rowSections.count - 1);\n var y = Math.min(this.headerHeight + by, oldHeight);\n this.paintContent(0, y, width, height - y);\n }\n else if (height > oldHeight) {\n this.paintContent(0, oldHeight, width, height - oldHeight);\n }\n // Paint the overlay.\n this._paintOverlay();\n };\n /**\n * A message hook invoked on a viewport `'scroll-request'` message.\n */\n DataGrid.prototype._onViewportScrollRequest = function (msg) {\n this._scrollTo(this._hScrollBar.value, this._vScrollBar.value);\n };\n /**\n * A message hook invoked on a viewport `'paint-request'` message.\n */\n DataGrid.prototype._onViewportPaintRequest = function (msg) {\n // Bail early if the viewport is not visible.\n if (!this._viewport.isVisible) {\n return;\n }\n // Bail early if the viewport has zero area.\n if (this._viewportWidth === 0 || this._viewportHeight === 0) {\n return;\n }\n // Set up the paint limits.\n var xMin = 0;\n var yMin = 0;\n var xMax = this._viewportWidth - 1;\n var yMax = this._viewportHeight - 1;\n // Fetch the scroll position.\n var sx = this._scrollX;\n var sy = this._scrollY;\n // Fetch the header dimensions.\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n // Fetch the section lists.\n var rs = this._rowSections;\n var cs = this._columnSections;\n var rhs = this._rowHeaderSections;\n var chs = this._columnHeaderSections;\n // Unpack the message data.\n var region = msg.region, r1 = msg.r1, c1 = msg.c1, r2 = msg.r2, c2 = msg.c2;\n // Set up the paint variables.\n var x1;\n var y1;\n var x2;\n var y2;\n // Fill the paint variables based on the paint region.\n switch (region) {\n case 'all':\n x1 = xMin;\n y1 = yMin;\n x2 = xMax;\n y2 = yMax;\n break;\n case 'body':\n r1 = Math.max(0, Math.min(r1, rs.count));\n c1 = Math.max(0, Math.min(c1, cs.count));\n r2 = Math.max(0, Math.min(r2, rs.count));\n c2 = Math.max(0, Math.min(c2, cs.count));\n x1 = cs.offsetOf(c1) - sx + hw;\n y1 = rs.offsetOf(r1) - sy + hh;\n x2 = cs.extentOf(c2) - sx + hw;\n y2 = rs.extentOf(r2) - sy + hh;\n break;\n case 'row-header':\n r1 = Math.max(0, Math.min(r1, rs.count));\n c1 = Math.max(0, Math.min(c1, rhs.count));\n r2 = Math.max(0, Math.min(r2, rs.count));\n c2 = Math.max(0, Math.min(c2, rhs.count));\n x1 = rhs.offsetOf(c1);\n y1 = rs.offsetOf(r1) - sy + hh;\n x2 = rhs.extentOf(c2);\n y2 = rs.extentOf(r2) - sy + hh;\n break;\n case 'column-header':\n r1 = Math.max(0, Math.min(r1, chs.count));\n c1 = Math.max(0, Math.min(c1, cs.count));\n r2 = Math.max(0, Math.min(r2, chs.count));\n c2 = Math.max(0, Math.min(c2, cs.count));\n x1 = cs.offsetOf(c1) - sx + hw;\n y1 = chs.offsetOf(r1);\n x2 = cs.extentOf(c2) - sx + hw;\n y2 = chs.extentOf(r2);\n break;\n case 'corner-header':\n r1 = Math.max(0, Math.min(r1, chs.count));\n c1 = Math.max(0, Math.min(c1, rhs.count));\n r2 = Math.max(0, Math.min(r2, chs.count));\n c2 = Math.max(0, Math.min(c2, rhs.count));\n x1 = rhs.offsetOf(c1);\n y1 = chs.offsetOf(r1);\n x2 = rhs.extentOf(c2);\n y2 = chs.extentOf(r2);\n break;\n default:\n throw 'unreachable';\n }\n // Bail early if the dirty rect is outside the bounds.\n if (x2 < xMin || y2 < yMin || x1 > xMax || y1 > yMax) {\n return;\n }\n // Clamp the dirty rect to the paint bounds.\n x1 = Math.max(xMin, Math.min(x1, xMax));\n y1 = Math.max(yMin, Math.min(y1, yMax));\n x2 = Math.max(xMin, Math.min(x2, xMax));\n y2 = Math.max(yMin, Math.min(y2, yMax));\n // Paint the content of the dirty rect.\n this.paintContent(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n };\n /**\n * A message hook invoked on a viewport `'overlay-paint-request'` message.\n */\n DataGrid.prototype._onViewportOverlayPaintRequest = function (msg) {\n // Bail early if the viewport is not visible.\n if (!this._viewport.isVisible) {\n return;\n }\n // Bail early if the viewport has zero area.\n if (this._viewportWidth === 0 || this._viewportHeight === 0) {\n return;\n }\n // Paint the content of the overlay.\n this._paintOverlay();\n };\n /**\n * A message hook invoked on a viewport `'row-resize-request'` message.\n */\n DataGrid.prototype._onViewportRowResizeRequest = function (msg) {\n if (msg.region === 'body') {\n this._resizeRow(msg.index, msg.size);\n }\n else {\n this._resizeColumnHeader(msg.index, msg.size);\n }\n };\n /**\n * A message hook invoked on a viewport `'column-resize-request'` message.\n */\n DataGrid.prototype._onViewportColumnResizeRequest = function (msg) {\n if (msg.region === 'body') {\n this._resizeColumn(msg.index, msg.size);\n }\n else {\n this._resizeRowHeader(msg.index, msg.size);\n }\n };\n /**\n * Handle the `thumbMoved` signal from a scroll bar.\n */\n DataGrid.prototype._onThumbMoved = function (sender) {\n messaging.MessageLoop.postMessage(this._viewport, Private.ScrollRequest);\n };\n /**\n * Handle the `pageRequested` signal from a scroll bar.\n */\n DataGrid.prototype._onPageRequested = function (sender, dir) {\n if (sender === this._vScrollBar) {\n this.scrollByPage(dir === 'decrement' ? 'up' : 'down');\n }\n else {\n this.scrollByPage(dir === 'decrement' ? 'left' : 'right');\n }\n };\n /**\n * Handle the `stepRequested` signal from a scroll bar.\n */\n DataGrid.prototype._onStepRequested = function (sender, dir) {\n if (sender === this._vScrollBar) {\n this.scrollByStep(dir === 'decrement' ? 'up' : 'down');\n }\n else {\n this.scrollByStep(dir === 'decrement' ? 'left' : 'right');\n }\n };\n /**\n * A signal handler for the data model `changed` signal.\n */\n DataGrid.prototype._onDataModelChanged = function (sender, args) {\n switch (args.type) {\n case 'rows-inserted':\n this._onRowsInserted(args);\n break;\n case 'columns-inserted':\n this._onColumnsInserted(args);\n break;\n case 'rows-removed':\n this._onRowsRemoved(args);\n break;\n case 'columns-removed':\n this._onColumnsRemoved(args);\n break;\n case 'rows-moved':\n this._onRowsMoved(args);\n break;\n case 'columns-moved':\n this._onColumnsMoved(args);\n break;\n case 'cells-changed':\n this._onCellsChanged(args);\n break;\n case 'model-reset':\n this._onModelReset(args);\n break;\n default:\n throw 'unreachable';\n }\n };\n /**\n * A signal handler for the selection model `changed` signal.\n */\n DataGrid.prototype._onSelectionsChanged = function (sender) {\n this.repaintOverlay();\n };\n /**\n * Handle rows being inserted in the data model.\n */\n DataGrid.prototype._onRowsInserted = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span;\n // Bail early if there are no sections to insert.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._rowSections;\n }\n else {\n list = this._columnHeaderSections;\n }\n // Insert the span, maintaining the scroll position as needed.\n if (this._scrollY === this.maxScrollY && this.maxScrollY > 0) {\n list.insert(index, span);\n this._scrollY = this.maxScrollY;\n }\n else {\n list.insert(index, span);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle columns being inserted into the data model.\n */\n DataGrid.prototype._onColumnsInserted = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span;\n // Bail early if there are no sections to insert.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._columnSections;\n }\n else {\n list = this._rowHeaderSections;\n }\n // Insert the span, maintaining the scroll position as needed.\n if (this._scrollX === this.maxScrollX && this.maxScrollX > 0) {\n list.insert(index, span);\n this._scrollX = this.maxScrollX;\n }\n else {\n list.insert(index, span);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle rows being removed from the data model.\n */\n DataGrid.prototype._onRowsRemoved = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span;\n // Bail early if there are no sections to remove.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._rowSections;\n }\n else {\n list = this._columnHeaderSections;\n }\n // Bail if the index or is invalid\n if (index < 0 || index >= list.count) {\n return;\n }\n // Remove the span, maintaining the scroll position as needed.\n if (this._scrollY === this.maxScrollY && this.maxScrollY > 0) {\n list.remove(index, span);\n this._scrollY = this.maxScrollY;\n }\n else {\n list.remove(index, span);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle columns being removed from the data model.\n */\n DataGrid.prototype._onColumnsRemoved = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span;\n // Bail early if there are no sections to remove.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._columnSections;\n }\n else {\n list = this._rowHeaderSections;\n }\n // Bail if the index or is invalid\n if (index < 0 || index >= list.count) {\n return;\n }\n // Remove the span, maintaining the scroll position as needed.\n if (this._scrollX === this.maxScrollX && this.maxScrollX > 0) {\n list.remove(index, span);\n this._scrollX = this.maxScrollX;\n }\n else {\n list.remove(index, span);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle rows moving in the data model.\n */\n DataGrid.prototype._onRowsMoved = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span, destination = args.destination;\n // Bail early if there are no sections to move.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._rowSections;\n }\n else {\n list = this._columnHeaderSections;\n }\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Clamp the move span to the limit.\n span = Math.min(span, list.count - index);\n // Clamp the destination index to the limit.\n destination = Math.min(Math.max(0, destination), list.count - span);\n // Bail early if there is no effective move.\n if (index === destination) {\n return;\n }\n // Compute the first affected index.\n var r1 = Math.min(index, destination);\n // Compute the last affected index.\n var r2 = Math.max(index + span - 1, destination + span - 1);\n // Move the sections in the list.\n list.move(index, span, destination);\n // Schedule a repaint of the dirty cells.\n if (region === 'body') {\n this._repaintRegion('body', r1, 0, r2, Infinity);\n this._repaintRegion('row-header', r1, 0, r2, Infinity);\n }\n else {\n this._repaintRegion('column-header', r1, 0, r2, Infinity);\n this._repaintRegion('corner-header', r1, 0, r2, Infinity);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle columns moving in the data model.\n */\n DataGrid.prototype._onColumnsMoved = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span, destination = args.destination;\n // Bail early if there are no sections to move.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._columnSections;\n }\n else {\n list = this._rowHeaderSections;\n }\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Clamp the move span to the limit.\n span = Math.min(span, list.count - index);\n // Clamp the destination index to the limit.\n destination = Math.min(Math.max(0, destination), list.count - span);\n // Bail early if there is no effective move.\n if (index === destination) {\n return;\n }\n // Move the sections in the list.\n list.move(index, span, destination);\n // Compute the first affected index.\n var c1 = Math.min(index, destination);\n // Compute the last affected index.\n var c2 = Math.max(index + span - 1, destination + span - 1);\n // Schedule a repaint of the dirty cells.\n if (region === 'body') {\n this._repaintRegion('body', 0, c1, Infinity, c2);\n this._repaintRegion('column-header', 0, c1, Infinity, c2);\n }\n else {\n this._repaintRegion('row-header', 0, c1, Infinity, c2);\n this._repaintRegion('corner-header', 0, c1, Infinity, c2);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle cells changing in the data model.\n */\n DataGrid.prototype._onCellsChanged = function (args) {\n // Unpack the arg data.\n var region = args.region, row = args.row, column = args.column, rowSpan = args.rowSpan, columnSpan = args.columnSpan;\n // Bail early if there are no cells to modify.\n if (rowSpan <= 0 && columnSpan <= 0) {\n return;\n }\n // Compute the changed cell bounds.\n var r1 = row;\n var c1 = column;\n var r2 = r1 + rowSpan - 1;\n var c2 = c1 + columnSpan - 1;\n // Schedule a repaint of the cell content.\n this._repaintRegion(region, r1, c1, r2, c2);\n };\n /**\n * Handle a full data model reset.\n */\n DataGrid.prototype._onModelReset = function (args) {\n // Look up the various current section counts.\n var nr = this._rowSections.count;\n var nc = this._columnSections.count;\n var nrh = this._rowHeaderSections.count;\n var nch = this._columnHeaderSections.count;\n // Compute the delta count for each region.\n var dr = this._dataModel.rowCount('body') - nr;\n var dc = this._dataModel.columnCount('body') - nc;\n var drh = this._dataModel.columnCount('row-header') - nrh;\n var dch = this._dataModel.rowCount('column-header') - nch;\n // Update the row sections, if needed.\n if (dr > 0) {\n this._rowSections.insert(nr, dr);\n }\n else if (dr < 0) {\n this._rowSections.remove(nr + dr, -dr);\n }\n // Update the column sections, if needed.\n if (dc > 0) {\n this._columnSections.insert(nc, dc);\n }\n else if (dc < 0) {\n this._columnSections.remove(nc + dc, -dc);\n }\n // Update the row header sections, if needed.\n if (drh > 0) {\n this._rowHeaderSections.insert(nrh, drh);\n }\n else if (drh < 0) {\n this._rowHeaderSections.remove(nrh + drh, -drh);\n }\n // Update the column header sections, if needed.\n if (dch > 0) {\n this._columnHeaderSections.insert(nch, dch);\n }\n else if (dch < 0) {\n this._columnHeaderSections.remove(nch + dch, -dch);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * A signal handler for the renderer map `changed` signal.\n */\n DataGrid.prototype._onRenderersChanged = function () {\n this.repaintContent();\n };\n /**\n * Handle the `'keydown'` event for the data grid.\n */\n DataGrid.prototype._evtKeyDown = function (event) {\n if (this._mousedown) {\n event.preventDefault();\n event.stopPropagation();\n }\n else if (this._keyHandler) {\n this._keyHandler.onKeyDown(this, event);\n }\n };\n /**\n * Handle the `'mousedown'` event for the data grid.\n */\n DataGrid.prototype._evtMouseDown = function (event) {\n // Ignore everything except the left mouse button.\n if (event.button !== 0) {\n return;\n }\n // Activate the grid.\n this.activate();\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Add the extra document listeners.\n document.addEventListener('keydown', this, true);\n document.addEventListener('mouseup', this, true);\n document.addEventListener('mousedown', this, true);\n document.addEventListener('mousemove', this, true);\n document.addEventListener('contextmenu', this, true);\n // Flip the mousedown flag.\n this._mousedown = true;\n // Dispatch to the mouse handler.\n if (this._mouseHandler) {\n this._mouseHandler.onMouseDown(this, event);\n }\n };\n /**\n * Handle the `'mousemove'` event for the data grid.\n */\n DataGrid.prototype._evtMouseMove = function (event) {\n // Stop the event propagation if the mouse is down.\n if (this._mousedown) {\n event.preventDefault();\n event.stopPropagation();\n }\n // Bail if there is no mouse handler.\n if (!this._mouseHandler) {\n return;\n }\n // Dispatch to the mouse handler.\n if (this._mousedown) {\n this._mouseHandler.onMouseMove(this, event);\n }\n else {\n this._mouseHandler.onMouseHover(this, event);\n }\n };\n /**\n * Handle the `'mouseup'` event for the data grid.\n */\n DataGrid.prototype._evtMouseUp = function (event) {\n // Ignore everything except the left mouse button.\n if (event.button !== 0) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Dispatch to the mouse handler.\n if (this._mouseHandler) {\n this._mouseHandler.onMouseUp(this, event);\n }\n // Release the mouse.\n this._releaseMouse();\n };\n /**\n * Handle the `'dblclick'` event for the data grid.\n */\n DataGrid.prototype._evtMouseDoubleClick = function (event) {\n // Ignore everything except the left mouse button.\n if (event.button !== 0) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Dispatch to the mouse handler.\n if (this._mouseHandler) {\n this._mouseHandler.onMouseDoubleClick(this, event);\n }\n // Release the mouse.\n this._releaseMouse();\n };\n /**\n * Handle the `'mouseleave'` event for the data grid.\n */\n DataGrid.prototype._evtMouseLeave = function (event) {\n if (this._mousedown) {\n event.preventDefault();\n event.stopPropagation();\n }\n else if (this._mouseHandler) {\n this._mouseHandler.onMouseLeave(this, event);\n }\n };\n /**\n * Handle the `'contextmenu'` event for the data grid.\n */\n DataGrid.prototype._evtContextMenu = function (event) {\n if (this._mousedown) {\n event.preventDefault();\n event.stopPropagation();\n }\n else if (this._mouseHandler) {\n this._mouseHandler.onContextMenu(this, event);\n }\n };\n /**\n * Handle the `'wheel'` event for the data grid.\n */\n DataGrid.prototype._evtWheel = function (event) {\n // Ignore the event if `accel` is held.\n if (domutils.Platform.accelKey(event)) {\n return;\n }\n // Bail early if there is no mouse handler.\n if (!this._mouseHandler) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Dispatch to the mouse handler.\n this._mouseHandler.onWheel(this, event);\n };\n /**\n * Release the mouse grab.\n */\n DataGrid.prototype._releaseMouse = function () {\n // Clear the mousedown flag.\n this._mousedown = false;\n // Relase the mouse handler.\n if (this._mouseHandler) {\n this._mouseHandler.release();\n }\n // Remove the document listeners.\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('mousedown', this, true);\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('contextmenu', this, true);\n };\n /**\n * Refresh the dpi ratio.\n */\n DataGrid.prototype._refreshDPI = function () {\n // Get the best integral value for the dpi ratio.\n var dpiRatio = Math.ceil(window.devicePixelRatio);\n // Bail early if the computed dpi ratio has not changed.\n if (this._dpiRatio === dpiRatio) {\n return;\n }\n // Update the internal dpi ratio.\n this._dpiRatio = dpiRatio;\n // Schedule a repaint of the content.\n this.repaintContent();\n // Schedule a repaint of the overlay.\n this.repaintOverlay();\n // Update the canvas size for the new dpi ratio.\n this._resizeCanvasIfNeeded(this._viewportWidth, this._viewportHeight);\n // Ensure the canvas style is scaled for the new ratio.\n this._canvas.style.width = this._canvas.width / this._dpiRatio + \"px\";\n this._canvas.style.height = this._canvas.height / this._dpiRatio + \"px\";\n // Ensure the overlay style is scaled for the new ratio.\n this._overlay.style.width = this._overlay.width / this._dpiRatio + \"px\";\n this._overlay.style.height = this._overlay.height / this._dpiRatio + \"px\";\n };\n /**\n * Resize a row section immediately.\n */\n DataGrid.prototype._resizeRow = function (index, size) {\n // Look up the target section list.\n var list = this._rowSections;\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Look up the old size of the section.\n var oldSize = list.sizeOf(index);\n // Normalize the new size of the section.\n var newSize = list.clampSize(size);\n // Bail early if the size does not change.\n if (oldSize === newSize) {\n return;\n }\n // Resize the section in the list.\n list.resize(index, newSize);\n // Get the current size of the viewport.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // If there is nothing to paint, sync the scroll state.\n if (!this._viewport.isVisible || vw === 0 || vh === 0) {\n this._syncScrollState();\n return;\n }\n // Compute the size delta.\n var delta = newSize - oldSize;\n // Look up the column header height.\n var hh = this.headerHeight;\n // Compute the viewport offset of the section.\n var offset = list.offsetOf(index) + hh - this._scrollY;\n // Bail early if there is nothing to paint.\n if (hh >= vh || offset >= vh) {\n this._syncScrollState();\n return;\n }\n // Update the scroll position if the section is not visible.\n if (offset + oldSize <= hh) {\n this._scrollY += delta;\n this._syncScrollState();\n return;\n }\n // Compute the paint origin of the section.\n var pos = Math.max(hh, offset);\n // Paint from the section onward if it spans the viewport.\n if (offset + oldSize >= vh || offset + newSize >= vh) {\n this.paintContent(0, pos, vw, vh - pos);\n this._paintOverlay();\n this._syncScrollState();\n return;\n }\n // Compute the X blit dimensions.\n var sx = 0;\n var sw = vw;\n var dx = 0;\n // Compute the Y blit dimensions.\n var sy;\n var sh;\n var dy;\n if (offset + newSize <= hh) {\n sy = hh - delta;\n sh = vh - sy;\n dy = hh;\n }\n else {\n sy = offset + oldSize;\n sh = vh - sy;\n dy = sy + delta;\n }\n // Blit the valid content to the destination.\n this._blitContent(this._canvas, sx, sy, sw, sh, dx, dy);\n // Repaint the section if needed.\n if (newSize > 0 && offset + newSize > hh) {\n this.paintContent(0, pos, vw, offset + newSize - pos);\n }\n // Paint the trailing space as needed.\n if (this._stretchLastRow && this.pageHeight > this.bodyHeight) {\n var r = this._rowSections.count - 1;\n var y = hh + this._rowSections.offsetOf(r);\n this.paintContent(0, y, vw, vh - y);\n }\n else if (delta < 0) {\n this.paintContent(0, vh + delta, vw, -delta);\n }\n // Paint the overlay.\n this._paintOverlay();\n // Sync the scroll state.\n this._syncScrollState();\n };\n /**\n * Resize a column section immediately.\n */\n DataGrid.prototype._resizeColumn = function (index, size) {\n // Look up the target section list.\n var list = this._columnSections;\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Look up the old size of the section.\n var oldSize = list.sizeOf(index);\n // Normalize the new size of the section.\n var newSize = list.clampSize(size);\n // Bail early if the size does not change.\n if (oldSize === newSize) {\n return;\n }\n // Resize the section in the list.\n list.resize(index, newSize);\n // Get the current size of the viewport.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // If there is nothing to paint, sync the scroll state.\n if (!this._viewport.isVisible || vw === 0 || vh === 0) {\n this._syncScrollState();\n return;\n }\n // Compute the size delta.\n var delta = newSize - oldSize;\n // Look up the row header width.\n var hw = this.headerWidth;\n // Compute the viewport offset of the section.\n var offset = list.offsetOf(index) + hw - this._scrollX;\n // Bail early if there is nothing to paint.\n if (hw >= vw || offset >= vw) {\n this._syncScrollState();\n return;\n }\n // Update the scroll position if the section is not visible.\n if (offset + oldSize <= hw) {\n this._scrollX += delta;\n this._syncScrollState();\n return;\n }\n // Compute the paint origin of the section.\n var pos = Math.max(hw, offset);\n // Paint from the section onward if it spans the viewport.\n if (offset + oldSize >= vw || offset + newSize >= vw) {\n this.paintContent(pos, 0, vw - pos, vh);\n this._paintOverlay();\n this._syncScrollState();\n return;\n }\n // Compute the Y blit dimensions.\n var sy = 0;\n var sh = vh;\n var dy = 0;\n // Compute the X blit dimensions.\n var sx;\n var sw;\n var dx;\n if (offset + newSize <= hw) {\n sx = hw - delta;\n sw = vw - sx;\n dx = hw;\n }\n else {\n sx = offset + oldSize;\n sw = vw - sx;\n dx = sx + delta;\n }\n // Blit the valid content to the destination.\n this._blitContent(this._canvas, sx, sy, sw, sh, dx, dy);\n // Repaint the section if needed.\n if (newSize > 0 && offset + newSize > hw) {\n this.paintContent(pos, 0, offset + newSize - pos, vh);\n }\n // Paint the trailing space as needed.\n if (this._stretchLastColumn && this.pageWidth > this.bodyWidth) {\n var c = this._columnSections.count - 1;\n var x = hw + this._columnSections.offsetOf(c);\n this.paintContent(x, 0, vw - x, vh);\n }\n else if (delta < 0) {\n this.paintContent(vw + delta, 0, -delta, vh);\n }\n // Paint the overlay.\n this._paintOverlay();\n // Sync the scroll state after painting.\n this._syncScrollState();\n };\n /**\n * Resize a row header section immediately.\n */\n DataGrid.prototype._resizeRowHeader = function (index, size) {\n // Look up the target section list.\n var list = this._rowHeaderSections;\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Look up the old size of the section.\n var oldSize = list.sizeOf(index);\n // Normalize the new size of the section.\n var newSize = list.clampSize(size);\n // Bail early if the size does not change.\n if (oldSize === newSize) {\n return;\n }\n // Resize the section in the list.\n list.resize(index, newSize);\n // Get the current size of the viewport.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // If there is nothing to paint, sync the scroll state.\n if (!this._viewport.isVisible || vw === 0 || vh === 0) {\n this._syncScrollState();\n return;\n }\n // Compute the size delta.\n var delta = newSize - oldSize;\n // Look up the offset of the section.\n var offset = list.offsetOf(index);\n // Bail early if the section is fully outside the viewport.\n if (offset >= vw) {\n this._syncScrollState();\n return;\n }\n // Paint the entire tail if the section spans the viewport.\n if (offset + oldSize >= vw || offset + newSize >= vw) {\n this.paintContent(offset, 0, vw - offset, vh);\n this._paintOverlay();\n this._syncScrollState();\n return;\n }\n // Compute the blit content dimensions.\n var sx = offset + oldSize;\n var sy = 0;\n var sw = vw - sx;\n var sh = vh;\n var dx = sx + delta;\n var dy = 0;\n // Blit the valid contents to the destination.\n this._blitContent(this._canvas, sx, sy, sw, sh, dx, dy);\n // Repaint the header section if needed.\n if (newSize > 0) {\n this.paintContent(offset, 0, newSize, vh);\n }\n // Paint the trailing space as needed.\n if (this._stretchLastColumn && this.pageWidth > this.bodyWidth) {\n var c = this._columnSections.count - 1;\n var x = this.headerWidth + this._columnSections.offsetOf(c);\n this.paintContent(x, 0, vw - x, vh);\n }\n else if (delta < 0) {\n this.paintContent(vw + delta, 0, -delta, vh);\n }\n // Paint the overlay.\n this._paintOverlay();\n // Sync the scroll state after painting.\n this._syncScrollState();\n };\n /**\n * Resize a column header section immediately.\n */\n DataGrid.prototype._resizeColumnHeader = function (index, size) {\n // Look up the target section list.\n var list = this._columnHeaderSections;\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Look up the old size of the section.\n var oldSize = list.sizeOf(index);\n // Normalize the new size of the section.\n var newSize = list.clampSize(size);\n // Bail early if the size does not change.\n if (oldSize === newSize) {\n return;\n }\n // Resize the section in the list.\n list.resize(index, newSize);\n // Get the current size of the viewport.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // If there is nothing to paint, sync the scroll state.\n if (!this._viewport.isVisible || vw === 0 || vh === 0) {\n this._syncScrollState();\n return;\n }\n // Paint the overlay.\n this._paintOverlay();\n // Compute the size delta.\n var delta = newSize - oldSize;\n // Look up the offset of the section.\n var offset = list.offsetOf(index);\n // Bail early if the section is fully outside the viewport.\n if (offset >= vh) {\n this._syncScrollState();\n return;\n }\n // Paint the entire tail if the section spans the viewport.\n if (offset + oldSize >= vh || offset + newSize >= vh) {\n this.paintContent(0, offset, vw, vh - offset);\n this._paintOverlay();\n this._syncScrollState();\n return;\n }\n // Compute the blit content dimensions.\n var sx = 0;\n var sy = offset + oldSize;\n var sw = vw;\n var sh = vh - sy;\n var dx = 0;\n var dy = sy + delta;\n // Blit the valid contents to the destination.\n this._blitContent(this._canvas, sx, sy, sw, sh, dx, dy);\n // Repaint the header section if needed.\n if (newSize > 0) {\n this.paintContent(0, offset, vw, newSize);\n }\n // Paint the trailing space as needed.\n if (this._stretchLastRow && this.pageHeight > this.bodyHeight) {\n var r = this._rowSections.count - 1;\n var y = this.headerHeight + this._rowSections.offsetOf(r);\n this.paintContent(0, y, vw, vh - y);\n }\n else if (delta < 0) {\n this.paintContent(0, vh + delta, vw, -delta);\n }\n // Paint the overlay.\n this._paintOverlay();\n // Sync the scroll state after painting.\n this._syncScrollState();\n };\n /**\n * Scroll immediately to the specified offset position.\n */\n DataGrid.prototype._scrollTo = function (x, y) {\n // Floor and clamp the position to the allowable range.\n x = Math.max(0, Math.min(Math.floor(x), this.maxScrollX));\n y = Math.max(0, Math.min(Math.floor(y), this.maxScrollY));\n // Synchronize the scroll bar values.\n this._hScrollBar.value = x;\n this._vScrollBar.value = y;\n // Compute the delta scroll amount.\n var dx = x - this._scrollX;\n var dy = y - this._scrollY;\n // Bail early if there is no effective scroll.\n if (dx === 0 && dy === 0) {\n return;\n }\n // Bail early if the viewport is not visible.\n if (!this._viewport.isVisible) {\n this._scrollX = x;\n this._scrollY = y;\n return;\n }\n // Get the current size of the viewport.\n var width = this._viewportWidth;\n var height = this._viewportHeight;\n // Bail early if the viewport is empty.\n if (width === 0 || height === 0) {\n this._scrollX = x;\n this._scrollY = y;\n return;\n }\n // Get the visible content origin.\n var contentX = this.headerWidth;\n var contentY = this.headerHeight;\n // Get the visible content dimensions.\n var contentWidth = width - contentX;\n var contentHeight = height - contentY;\n // Bail early if there is no content to draw.\n if (contentWidth <= 0 && contentHeight <= 0) {\n this._scrollX = x;\n this._scrollY = y;\n return;\n }\n // Compute the area which needs painting for the `dx` scroll.\n var dxArea = 0;\n if (dx !== 0 && contentWidth > 0) {\n if (Math.abs(dx) >= contentWidth) {\n dxArea = contentWidth * height;\n }\n else {\n dxArea = Math.abs(dx) * height;\n }\n }\n // Compute the area which needs painting for the `dy` scroll.\n var dyArea = 0;\n if (dy !== 0 && contentHeight > 0) {\n if (Math.abs(dy) >= contentHeight) {\n dyArea = width * contentHeight;\n }\n else {\n dyArea = width * Math.abs(dy);\n }\n }\n // If the area sum is larger than the total, paint everything.\n if ((dxArea + dyArea) >= (width * height)) {\n this._scrollX = x;\n this._scrollY = y;\n this.paintContent(0, 0, width, height);\n this._paintOverlay();\n return;\n }\n // Update the internal Y scroll position.\n this._scrollY = y;\n // Scroll the Y axis if needed. If the scroll distance exceeds\n // the visible height, paint everything. Otherwise, blit the\n // valid content and paint the dirty region.\n if (dy !== 0 && contentHeight > 0) {\n if (Math.abs(dy) >= contentHeight) {\n this.paintContent(0, contentY, width, contentHeight);\n }\n else {\n var x_5 = 0;\n var y_5 = dy < 0 ? contentY : contentY + dy;\n var w = width;\n var h = contentHeight - Math.abs(dy);\n this._blitContent(this._canvas, x_5, y_5, w, h, x_5, y_5 - dy);\n this.paintContent(0, dy < 0 ? contentY : height - dy, width, Math.abs(dy));\n }\n }\n // Update the internal X scroll position.\n this._scrollX = x;\n // Scroll the X axis if needed. If the scroll distance exceeds\n // the visible width, paint everything. Otherwise, blit the\n // valid content and paint the dirty region.\n if (dx !== 0 && contentWidth > 0) {\n if (Math.abs(dx) >= contentWidth) {\n this.paintContent(contentX, 0, contentWidth, height);\n }\n else {\n var x_6 = dx < 0 ? contentX : contentX + dx;\n var y_6 = 0;\n var w = contentWidth - Math.abs(dx);\n var h = height;\n this._blitContent(this._canvas, x_6, y_6, w, h, x_6 - dx, y_6);\n this.paintContent(dx < 0 ? contentX : width - dx, 0, Math.abs(dx), height);\n }\n }\n // Paint the overlay.\n this._paintOverlay();\n };\n /**\n * Blit content into the on-screen grid canvas.\n *\n * The rect should be expressed in viewport coordinates.\n *\n * This automatically accounts for the dpi ratio.\n */\n DataGrid.prototype._blitContent = function (source, x, y, w, h, dx, dy) {\n // Scale the blit coordinates by the dpi ratio.\n x *= this._dpiRatio;\n y *= this._dpiRatio;\n w *= this._dpiRatio;\n h *= this._dpiRatio;\n dx *= this._dpiRatio;\n dy *= this._dpiRatio;\n // Save the current gc state.\n this._canvasGC.save();\n // Set the transform to the identity matrix.\n this._canvasGC.setTransform(1, 0, 0, 1, 0, 0);\n // Draw the specified content.\n this._canvasGC.drawImage(source, x, y, w, h, dx, dy, w, h);\n // Restore the gc state.\n this._canvasGC.restore();\n };\n /**\n * Paint the grid content for the given dirty rect.\n *\n * The rect should be expressed in valid viewport coordinates.\n *\n * This is the primary paint entry point. The individual `_draw*`\n * methods should not be invoked directly. This method dispatches\n * to the drawing methods in the correct order.\n */\n DataGrid.prototype.paintContent = function (rx, ry, rw, rh) {\n // Scale the canvas and buffer GC for the dpi ratio.\n this._canvasGC.setTransform(this._dpiRatio, 0, 0, this._dpiRatio, 0, 0);\n this._bufferGC.setTransform(this._dpiRatio, 0, 0, this._dpiRatio, 0, 0);\n // Clear the dirty rect of all content.\n this._canvasGC.clearRect(rx, ry, rw, rh);\n // Draw the void region.\n this._drawVoidRegion(rx, ry, rw, rh);\n // Draw the body region.\n this._drawBodyRegion(rx, ry, rw, rh);\n // Draw the row header region.\n this._drawRowHeaderRegion(rx, ry, rw, rh);\n // Draw the column header region.\n this._drawColumnHeaderRegion(rx, ry, rw, rh);\n // Draw the corner header region.\n this.drawCornerHeaderRegion(rx, ry, rw, rh);\n };\n /**\n * Paint the overlay content for the entire grid.\n *\n * This is the primary overlay paint entry point. The individual\n * `_draw*` methods should not be invoked directly. This method\n * dispatches to the drawing methods in the correct order.\n */\n DataGrid.prototype._paintOverlay = function () {\n // Scale the overlay GC for the dpi ratio.\n this._overlayGC.setTransform(this._dpiRatio, 0, 0, this._dpiRatio, 0, 0);\n // Clear the overlay of all content.\n this._overlayGC.clearRect(0, 0, this._overlay.width, this._overlay.height);\n // Draw the body selections.\n this._drawBodySelections();\n // Draw the row header selections.\n this._drawRowHeaderSelections();\n // Draw the column header selections.\n this._drawColumnHeaderSelections();\n // Draw the cursor.\n this._drawCursor();\n // Draw the shadows.\n this._drawShadows();\n };\n /**\n * Draw the void region for the dirty rect.\n */\n DataGrid.prototype._drawVoidRegion = function (rx, ry, rw, rh) {\n // Look up the void color.\n var color = this._style.voidColor;\n // Bail if there is no void color.\n if (!color) {\n return;\n }\n // Fill the dirty rect with the void color.\n this._canvasGC.fillStyle = color;\n this._canvasGC.fillRect(rx, ry, rw, rh);\n };\n /**\n * Draw the body region which intersects the dirty rect.\n */\n DataGrid.prototype._drawBodyRegion = function (rx, ry, rw, rh) {\n // Get the visible content dimensions.\n var contentW = this._columnSections.length - this._scrollX;\n var contentH = this._rowSections.length - this._scrollY;\n // Bail if there is no content to draw.\n if (contentW <= 0 || contentH <= 0) {\n return;\n }\n // Get the visible content origin.\n var contentX = this.headerWidth;\n var contentY = this.headerHeight;\n // Bail if the dirty rect does not intersect the content area.\n if (rx + rw <= contentX) {\n return;\n }\n if (ry + rh <= contentY) {\n return;\n }\n if (rx >= contentX + contentW) {\n return;\n }\n if (ry >= contentY + contentH) {\n return;\n }\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var bw = this.bodyWidth;\n var ph = this.pageHeight;\n var pw = this.pageWidth;\n // Get the upper and lower bounds of the dirty content area.\n var x1 = Math.max(rx, contentX);\n var y1 = Math.max(ry, contentY);\n var x2 = Math.min(rx + rw - 1, contentX + contentW - 1);\n var y2 = Math.min(ry + rh - 1, contentY + contentH - 1);\n // Convert the dirty content bounds into cell bounds.\n var r1 = this._rowSections.indexOf(y1 - contentY + this._scrollY);\n var c1 = this._columnSections.indexOf(x1 - contentX + this._scrollX);\n var r2 = this._rowSections.indexOf(y2 - contentY + this._scrollY);\n var c2 = this._columnSections.indexOf(x2 - contentX + this._scrollX);\n // Fetch the max row and column.\n var maxRow = this._rowSections.count - 1;\n var maxColumn = this._columnSections.count - 1;\n // Handle a dirty content area larger than the cell count.\n if (r2 < 0) {\n r2 = maxRow;\n }\n if (c2 < 0) {\n c2 = maxColumn;\n }\n // Convert the cell bounds back to visible coordinates.\n var x = this._columnSections.offsetOf(c1) + contentX - this._scrollX;\n var y = this._rowSections.offsetOf(r1) + contentY - this._scrollY;\n // Set up the paint region size variables.\n var width = 0;\n var height = 0;\n // Allocate the section sizes arrays.\n var rowSizes = new Array(r2 - r1 + 1);\n var columnSizes = new Array(c2 - c1 + 1);\n // Get the row sizes for the region.\n for (var j = r1; j <= r2; ++j) {\n var size = this._rowSections.sizeOf(j);\n rowSizes[j - r1] = size;\n height += size;\n }\n // Get the column sizes for the region.\n for (var i = c1; i <= c2; ++i) {\n var size = this._columnSections.sizeOf(i);\n columnSizes[i - c1] = size;\n width += size;\n }\n // Adjust the geometry if the last row is streched.\n if (this._stretchLastRow && ph > bh && r2 === maxRow) {\n var dh = this.pageHeight - this.bodyHeight;\n rowSizes[rowSizes.length - 1] += dh;\n height += dh;\n y2 += dh;\n }\n // Adjust the geometry if the last column is streched.\n if (this._stretchLastColumn && pw > bw && c2 === maxColumn) {\n var dw = this.pageWidth - this.bodyWidth;\n columnSizes[columnSizes.length - 1] += dw;\n width += dw;\n x2 += dw;\n }\n // Create the paint region object.\n var rgn = {\n region: 'body',\n xMin: x1, yMin: y1,\n xMax: x2, yMax: y2,\n x: x, y: y, width: width, height: height,\n row: r1, column: c1,\n rowSizes: rowSizes, columnSizes: columnSizes\n };\n // Draw the background.\n this._drawBackground(rgn, this._style.backgroundColor);\n // Draw the row background.\n this._drawRowBackground(rgn, this._style.rowBackgroundColor);\n // Draw the column background.\n this._drawColumnBackground(rgn, this._style.columnBackgroundColor);\n // Draw the cell content for the paint region.\n this._drawCells(rgn);\n // Draw the horizontal grid lines.\n this._drawHorizontalGridLines(rgn, this._style.horizontalGridLineColor ||\n this._style.gridLineColor);\n // Draw the vertical grid lines.\n this._drawVerticalGridLines(rgn, this._style.verticalGridLineColor ||\n this._style.gridLineColor);\n };\n /**\n * Draw the row header region which intersects the dirty rect.\n */\n DataGrid.prototype._drawRowHeaderRegion = function (rx, ry, rw, rh) {\n // Get the visible content dimensions.\n var contentW = this.headerWidth;\n var contentH = this.bodyHeight - this._scrollY;\n // Bail if there is no content to draw.\n if (contentW <= 0 || contentH <= 0) {\n return;\n }\n // Get the visible content origin.\n var contentX = 0;\n var contentY = this.headerHeight;\n // Bail if the dirty rect does not intersect the content area.\n if (rx + rw <= contentX) {\n return;\n }\n if (ry + rh <= contentY) {\n return;\n }\n if (rx >= contentX + contentW) {\n return;\n }\n if (ry >= contentY + contentH) {\n return;\n }\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n // Get the upper and lower bounds of the dirty content area.\n var x1 = rx;\n var y1 = Math.max(ry, contentY);\n var x2 = Math.min(rx + rw - 1, contentX + contentW - 1);\n var y2 = Math.min(ry + rh - 1, contentY + contentH - 1);\n // Convert the dirty content bounds into cell bounds.\n var r1 = this._rowSections.indexOf(y1 - contentY + this._scrollY);\n var c1 = this._rowHeaderSections.indexOf(x1);\n var r2 = this._rowSections.indexOf(y2 - contentY + this._scrollY);\n var c2 = this._rowHeaderSections.indexOf(x2);\n // Fetch max row and column.\n var maxRow = this._rowSections.count - 1;\n var maxColumn = this._rowHeaderSections.count - 1;\n // Handle a dirty content area larger than the cell count.\n if (r2 < 0) {\n r2 = maxRow;\n }\n if (c2 < 0) {\n c2 = maxColumn;\n }\n // Convert the cell bounds back to visible coordinates.\n var x = this._rowHeaderSections.offsetOf(c1);\n var y = this._rowSections.offsetOf(r1) + contentY - this._scrollY;\n // Set up the paint region size variables.\n var width = 0;\n var height = 0;\n // Allocate the section sizes arrays.\n var rowSizes = new Array(r2 - r1 + 1);\n var columnSizes = new Array(c2 - c1 + 1);\n // Get the row sizes for the region.\n for (var j = r1; j <= r2; ++j) {\n var size = this._rowSections.sizeOf(j);\n rowSizes[j - r1] = size;\n height += size;\n }\n // Get the column sizes for the region.\n for (var i = c1; i <= c2; ++i) {\n var size = this._rowHeaderSections.sizeOf(i);\n columnSizes[i - c1] = size;\n width += size;\n }\n // Adjust the geometry if the last row is stretched.\n if (this._stretchLastRow && ph > bh && r2 === maxRow) {\n var dh = this.pageHeight - this.bodyHeight;\n rowSizes[rowSizes.length - 1] += dh;\n height += dh;\n y2 += dh;\n }\n // Create the paint region object.\n var rgn = {\n region: 'row-header',\n xMin: x1, yMin: y1,\n xMax: x2, yMax: y2,\n x: x, y: y, width: width, height: height,\n row: r1, column: c1,\n rowSizes: rowSizes, columnSizes: columnSizes\n };\n // Draw the background.\n this._drawBackground(rgn, this._style.headerBackgroundColor);\n // Draw the cell content for the paint region.\n this._drawCells(rgn);\n // Draw the horizontal grid lines.\n this._drawHorizontalGridLines(rgn, this._style.headerHorizontalGridLineColor ||\n this._style.headerGridLineColor);\n // Draw the vertical grid lines.\n this._drawVerticalGridLines(rgn, this._style.headerVerticalGridLineColor ||\n this._style.headerGridLineColor);\n };\n /**\n * Draw the column header region which intersects the dirty rect.\n */\n DataGrid.prototype._drawColumnHeaderRegion = function (rx, ry, rw, rh) {\n // Get the visible content dimensions.\n var contentW = this.bodyWidth - this._scrollX;\n var contentH = this.headerHeight;\n // Bail if there is no content to draw.\n if (contentW <= 0 || contentH <= 0) {\n return;\n }\n // Get the visible content origin.\n var contentX = this.headerWidth;\n var contentY = 0;\n // Bail if the dirty rect does not intersect the content area.\n if (rx + rw <= contentX) {\n return;\n }\n if (ry + rh <= contentY) {\n return;\n }\n if (rx >= contentX + contentW) {\n return;\n }\n if (ry >= contentY + contentH) {\n return;\n }\n // Fetch the geometry.\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n // Get the upper and lower bounds of the dirty content area.\n var x1 = Math.max(rx, contentX);\n var y1 = ry;\n var x2 = Math.min(rx + rw - 1, contentX + contentW - 1);\n var y2 = Math.min(ry + rh - 1, contentY + contentH - 1);\n // Convert the dirty content bounds into cell bounds.\n var r1 = this._columnHeaderSections.indexOf(y1);\n var c1 = this._columnSections.indexOf(x1 - contentX + this._scrollX);\n var r2 = this._columnHeaderSections.indexOf(y2);\n var c2 = this._columnSections.indexOf(x2 - contentX + this._scrollX);\n // Fetch the max row and column.\n var maxRow = this._columnHeaderSections.count - 1;\n var maxColumn = this._columnSections.count - 1;\n // Handle a dirty content area larger than the cell count.\n if (r2 < 0) {\n r2 = maxRow;\n }\n if (c2 < 0) {\n c2 = maxColumn;\n }\n // Convert the cell bounds back to visible coordinates.\n var x = this._columnSections.offsetOf(c1) + contentX - this._scrollX;\n var y = this._columnHeaderSections.offsetOf(r1);\n // Set up the paint region size variables.\n var width = 0;\n var height = 0;\n // Allocate the section sizes arrays.\n var rowSizes = new Array(r2 - r1 + 1);\n var columnSizes = new Array(c2 - c1 + 1);\n // Get the row sizes for the region.\n for (var j = r1; j <= r2; ++j) {\n var size = this._columnHeaderSections.sizeOf(j);\n rowSizes[j - r1] = size;\n height += size;\n }\n // Get the column sizes for the region.\n for (var i = c1; i <= c2; ++i) {\n var size = this._columnSections.sizeOf(i);\n columnSizes[i - c1] = size;\n width += size;\n }\n // Adjust the geometry if the last column is stretched.\n if (this._stretchLastColumn && pw > bw && c2 === maxColumn) {\n var dw = this.pageWidth - this.bodyWidth;\n columnSizes[columnSizes.length - 1] += dw;\n width += dw;\n x2 += dw;\n }\n // Create the paint region object.\n var rgn = {\n region: 'column-header',\n xMin: x1, yMin: y1,\n xMax: x2, yMax: y2,\n x: x, y: y, width: width, height: height,\n row: r1, column: c1,\n rowSizes: rowSizes, columnSizes: columnSizes\n };\n // Draw the background.\n this._drawBackground(rgn, this._style.headerBackgroundColor);\n // Draw the cell content for the paint region.\n this._drawCells(rgn);\n // Draw the horizontal grid lines.\n this._drawHorizontalGridLines(rgn, this._style.headerHorizontalGridLineColor ||\n this._style.headerGridLineColor);\n // Draw the vertical grid lines.\n this._drawVerticalGridLines(rgn, this._style.headerVerticalGridLineColor ||\n this._style.headerGridLineColor);\n };\n /**\n * Draw the corner header region which intersects the dirty rect.\n */\n DataGrid.prototype.drawCornerHeaderRegion = function (rx, ry, rw, rh) {\n // Get the visible content dimensions.\n var contentW = this.headerWidth;\n var contentH = this.headerHeight;\n // Bail if there is no content to draw.\n if (contentW <= 0 || contentH <= 0) {\n return;\n }\n // Get the visible content origin.\n var contentX = 0;\n var contentY = 0;\n // Bail if the dirty rect does not intersect the content area.\n if (rx + rw <= contentX) {\n return;\n }\n if (ry + rh <= contentY) {\n return;\n }\n if (rx >= contentX + contentW) {\n return;\n }\n if (ry >= contentY + contentH) {\n return;\n }\n // Get the upper and lower bounds of the dirty content area.\n var x1 = rx;\n var y1 = ry;\n var x2 = Math.min(rx + rw - 1, contentX + contentW - 1);\n var y2 = Math.min(ry + rh - 1, contentY + contentH - 1);\n // Convert the dirty content bounds into cell bounds.\n var r1 = this._columnHeaderSections.indexOf(y1);\n var c1 = this._rowHeaderSections.indexOf(x1);\n var r2 = this._columnHeaderSections.indexOf(y2);\n var c2 = this._rowHeaderSections.indexOf(x2);\n // Handle a dirty content area larger than the cell count.\n if (r2 < 0) {\n r2 = this._columnHeaderSections.count - 1;\n }\n if (c2 < 0) {\n c2 = this._rowHeaderSections.count - 1;\n }\n // Convert the cell bounds back to visible coordinates.\n var x = this._rowHeaderSections.offsetOf(c1);\n var y = this._columnHeaderSections.offsetOf(r1);\n // Set up the paint region size variables.\n var width = 0;\n var height = 0;\n // Allocate the section sizes arrays.\n var rowSizes = new Array(r2 - r1 + 1);\n var columnSizes = new Array(c2 - c1 + 1);\n // Get the row sizes for the region.\n for (var j = r1; j <= r2; ++j) {\n var size = this._columnHeaderSections.sizeOf(j);\n rowSizes[j - r1] = size;\n height += size;\n }\n // Get the column sizes for the region.\n for (var i = c1; i <= c2; ++i) {\n var size = this._rowHeaderSections.sizeOf(i);\n columnSizes[i - c1] = size;\n width += size;\n }\n // Create the paint region object.\n var rgn = {\n region: 'corner-header',\n xMin: x1, yMin: y1,\n xMax: x2, yMax: y2,\n x: x, y: y, width: width, height: height,\n row: r1, column: c1,\n rowSizes: rowSizes, columnSizes: columnSizes\n };\n // Draw the background.\n this._drawBackground(rgn, this._style.headerBackgroundColor);\n // Draw the cell content for the paint region.\n this._drawCells(rgn);\n // Draw the horizontal grid lines.\n this._drawHorizontalGridLines(rgn, this._style.headerHorizontalGridLineColor ||\n this._style.headerGridLineColor);\n // Draw the vertical grid lines.\n this._drawVerticalGridLines(rgn, this._style.headerVerticalGridLineColor ||\n this._style.headerGridLineColor);\n };\n /**\n * Draw the background for the given paint region.\n */\n DataGrid.prototype._drawBackground = function (rgn, color) {\n // Bail if there is no color to draw.\n if (!color) {\n return;\n }\n // Unpack the region.\n var xMin = rgn.xMin, yMin = rgn.yMin, xMax = rgn.xMax, yMax = rgn.yMax;\n // Fill the region with the specified color.\n this._canvasGC.fillStyle = color;\n this._canvasGC.fillRect(xMin, yMin, xMax - xMin + 1, yMax - yMin + 1);\n };\n /**\n * Draw the row background for the given paint region.\n */\n DataGrid.prototype._drawRowBackground = function (rgn, colorFn) {\n // Bail if there is no color function.\n if (!colorFn) {\n return;\n }\n // Compute the X bounds for the row.\n var x1 = Math.max(rgn.xMin, rgn.x);\n var x2 = Math.min(rgn.x + rgn.width - 1, rgn.xMax);\n // Draw the background for the rows in the region.\n for (var y = rgn.y, j = 0, n = rgn.rowSizes.length; j < n; ++j) {\n // Fetch the size of the row.\n var size = rgn.rowSizes[j];\n // Skip zero sized rows.\n if (size === 0) {\n continue;\n }\n // Get the background color for the row.\n var color = colorFn(rgn.row + j);\n // Fill the row with the background color if needed.\n if (color) {\n var y1 = Math.max(rgn.yMin, y);\n var y2 = Math.min(y + size - 1, rgn.yMax);\n this._canvasGC.fillStyle = color;\n this._canvasGC.fillRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n }\n // Increment the running Y coordinate.\n y += size;\n }\n };\n /**\n * Draw the column background for the given paint region.\n */\n DataGrid.prototype._drawColumnBackground = function (rgn, colorFn) {\n // Bail if there is no color function.\n if (!colorFn) {\n return;\n }\n // Compute the Y bounds for the column.\n var y1 = Math.max(rgn.yMin, rgn.y);\n var y2 = Math.min(rgn.y + rgn.height - 1, rgn.yMax);\n // Draw the background for the columns in the region.\n for (var x = rgn.x, i = 0, n = rgn.columnSizes.length; i < n; ++i) {\n // Fetch the size of the column.\n var size = rgn.columnSizes[i];\n // Skip zero sized columns.\n if (size === 0) {\n continue;\n }\n // Get the background color for the column.\n var color = colorFn(rgn.column + i);\n // Fill the column with the background color if needed.\n if (color) {\n var x1 = Math.max(rgn.xMin, x);\n var x2 = Math.min(x + size - 1, rgn.xMax);\n this._canvasGC.fillStyle = color;\n this._canvasGC.fillRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n }\n // Increment the running X coordinate.\n x += size;\n }\n };\n /**\n * Draw the cells for the given paint region.\n */\n DataGrid.prototype._drawCells = function (rgn) {\n // Bail if there is no data model.\n if (!this._dataModel) {\n return;\n }\n // Set up the cell config object for rendering.\n var config = {\n x: 0, y: 0, width: 0, height: 0,\n region: rgn.region, row: 0, column: 0,\n value: null,\n metadata: datamodel.DataModel.emptyMetadata\n };\n // Save the buffer gc before wrapping.\n this._bufferGC.save();\n // Wrap the buffer gc for painting the cells.\n var gc = new graphicscontext.GraphicsContext(this._bufferGC);\n // Compute the actual Y bounds for the cell range.\n var y1 = Math.max(rgn.yMin, rgn.y);\n var y2 = Math.min(rgn.y + rgn.height - 1, rgn.yMax);\n // Loop over the columns in the region.\n for (var x = rgn.x, i = 0, n = rgn.columnSizes.length; i < n; ++i) {\n // Fetch the size of the column.\n var width = rgn.columnSizes[i];\n // Skip zero sized columns.\n if (width === 0) {\n continue;\n }\n // Compute the column index.\n var column = rgn.column + i;\n // Update the config for the current column.\n config.x = x;\n config.width = width;\n config.column = column;\n // Clear the buffer rect for the column.\n gc.clearRect(x, rgn.y, width, rgn.height);\n // Save the GC state.\n gc.save();\n // Loop over the rows in the column.\n for (var y = rgn.y, j = 0, n_1 = rgn.rowSizes.length; j < n_1; ++j) {\n // Fetch the size of the row.\n var height = rgn.rowSizes[j];\n // Skip zero sized rows.\n if (height === 0) {\n continue;\n }\n // Compute the row index.\n var row = rgn.row + j;\n // Get the value for the cell.\n var value = void 0;\n try {\n value = this._dataModel.data(rgn.region, row, column);\n }\n catch (err) {\n value = undefined;\n console.error(err);\n }\n // Get the metadata for the cell.\n var metadata = void 0;\n try {\n metadata = this._dataModel.metadata(rgn.region, row, column);\n }\n catch (err) {\n metadata = datamodel.DataModel.emptyMetadata;\n console.error(err);\n }\n // Update the config for the current cell.\n config.y = y;\n config.height = height;\n config.row = row;\n config.value = value;\n config.metadata = metadata;\n // Get the renderer for the cell.\n var renderer = this._cellRenderers.get(config);\n // Save the GC state.\n gc.save();\n // Paint the cell into the off-screen buffer.\n try {\n renderer.paint(gc, config);\n }\n catch (err) {\n console.error(err);\n }\n // Restore the GC state.\n gc.restore();\n // Increment the running Y coordinate.\n y += height;\n }\n // Restore the GC state.\n gc.restore();\n // Compute the actual X bounds for the column.\n var x1 = Math.max(rgn.xMin, x);\n var x2 = Math.min(x + width - 1, rgn.xMax);\n // Blit the off-screen buffer column into the on-screen canvas.\n //\n // This is *much* faster than drawing directly into the on-screen\n // canvas with a clip rect on the column. Managed column clipping\n // is required to prevent cell renderers from needing to set up a\n // clip rect for handling horizontal overflow text (slow!).\n this._blitContent(this._buffer, x1, y1, x2 - x1 + 1, y2 - y1 + 1, x1, y1);\n // Increment the running X coordinate.\n x += width;\n }\n // Dispose of the wrapped gc.\n gc.dispose();\n // Restore the final buffer gc state.\n this._bufferGC.restore();\n };\n /**\n * Draw the horizontal grid lines for the given paint region.\n */\n DataGrid.prototype._drawHorizontalGridLines = function (rgn, color) {\n // Bail if there is no color to draw.\n if (!color) {\n return;\n }\n // Compute the X bounds for the horizontal lines.\n var x1 = Math.max(rgn.xMin, rgn.x);\n var x2 = Math.min(rgn.x + rgn.width, rgn.xMax + 1);\n // Begin the path for the grid lines.\n this._canvasGC.beginPath();\n // Set the line width for the grid lines.\n this._canvasGC.lineWidth = 1;\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n // Fetch the number of grid lines to be drawn.\n var n = rgn.rowSizes.length;\n // Adjust the count down if the last line shouldn't be drawn.\n if (this._stretchLastRow && ph > bh) {\n if (rgn.row + n === this._rowSections.count) {\n n -= 1;\n }\n }\n // Draw the horizontal grid lines.\n for (var y = rgn.y, j = 0; j < n; ++j) {\n // Fetch the size of the row.\n var size = rgn.rowSizes[j];\n // Skip zero sized rows.\n if (size === 0) {\n continue;\n }\n // Compute the Y position of the line.\n var pos = y + size - 1;\n // Draw the line if it's in range of the dirty rect.\n if (pos >= rgn.yMin && pos <= rgn.yMax) {\n this._canvasGC.moveTo(x1, pos + 0.5);\n this._canvasGC.lineTo(x2, pos + 0.5);\n }\n // Increment the running Y coordinate.\n y += size;\n }\n // Stroke the lines with the specified color.\n this._canvasGC.strokeStyle = color;\n this._canvasGC.stroke();\n };\n /**\n * Draw the vertical grid lines for the given paint region.\n */\n DataGrid.prototype._drawVerticalGridLines = function (rgn, color) {\n // Bail if there is no color to draw.\n if (!color) {\n return;\n }\n // Compute the Y bounds for the vertical lines.\n var y1 = Math.max(rgn.yMin, rgn.y);\n var y2 = Math.min(rgn.y + rgn.height, rgn.yMax + 1);\n // Begin the path for the grid lines\n this._canvasGC.beginPath();\n // Set the line width for the grid lines.\n this._canvasGC.lineWidth = 1;\n // Fetch the geometry.\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n // Fetch the number of grid lines to be drawn.\n var n = rgn.columnSizes.length;\n // Adjust the count down if the last line shouldn't be drawn.\n if (this._stretchLastColumn && pw > bw) {\n if (rgn.column + n === this._columnSections.count) {\n n -= 1;\n }\n }\n // Draw the vertical grid lines.\n for (var x = rgn.x, i = 0; i < n; ++i) {\n // Fetch the size of the column.\n var size = rgn.columnSizes[i];\n // Skip zero sized columns.\n if (size === 0) {\n continue;\n }\n // Compute the X position of the line.\n var pos = x + size - 1;\n // Draw the line if it's in range of the dirty rect.\n if (pos >= rgn.xMin && pos <= rgn.xMax) {\n this._canvasGC.moveTo(pos + 0.5, y1);\n this._canvasGC.lineTo(pos + 0.5, y2);\n }\n // Increment the running X coordinate.\n x += size;\n }\n // Stroke the lines with the specified color.\n this._canvasGC.strokeStyle = color;\n this._canvasGC.stroke();\n };\n /**\n * Draw the body selections for the data grid.\n */\n DataGrid.prototype._drawBodySelections = function () {\n // Fetch the selection model.\n var model = this._selectionModel;\n // Bail early if there are no selections.\n if (!model || model.isEmpty) {\n return;\n }\n // Fetch the selection colors.\n var fill = this._style.selectionFillColor;\n var stroke = this._style.selectionBorderColor;\n // Bail early if there is nothing to draw.\n if (!fill && !stroke) {\n return;\n }\n // Fetch the scroll geometry.\n var sx = this._scrollX;\n var sy = this._scrollY;\n // Get the first visible cell of the grid.\n var r1 = this._rowSections.indexOf(sy);\n var c1 = this._columnSections.indexOf(sx);\n // Bail early if there are no visible cells.\n if (r1 < 0 || c1 < 0) {\n return;\n }\n // Fetch the extra geometry.\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n var pw = this.pageWidth;\n var ph = this.pageHeight;\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n // Get the last visible cell of the grid.\n var r2 = this._rowSections.indexOf(sy + ph);\n var c2 = this._columnSections.indexOf(sx + pw);\n // Fetch the max row and column.\n var maxRow = this._rowSections.count - 1;\n var maxColumn = this._columnSections.count - 1;\n // Clamp the last cell if the void space is visible.\n r2 = r2 < 0 ? maxRow : r2;\n c2 = c2 < 0 ? maxColumn : c2;\n // Fetch the overlay gc.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Set up the body clipping rect.\n gc.beginPath();\n gc.rect(hw, hh, pw, ph);\n gc.clip();\n // Set up the gc style.\n if (fill) {\n gc.fillStyle = fill;\n }\n if (stroke) {\n gc.strokeStyle = stroke;\n gc.lineWidth = 1;\n }\n // Iterate over the selections.\n var it = model.selections();\n var s;\n while ((s = it.next()) !== undefined) {\n // Skip the section if it's not visible.\n if (s.r1 < r1 && s.r2 < r1) {\n continue;\n }\n if (s.r1 > r2 && s.r2 > r2) {\n continue;\n }\n if (s.c1 < c1 && s.c2 < c1) {\n continue;\n }\n if (s.c1 > c2 && s.c2 > c2) {\n continue;\n }\n // Clamp the cell to the model bounds.\n var sr1 = Math.max(0, Math.min(s.r1, maxRow));\n var sc1 = Math.max(0, Math.min(s.c1, maxColumn));\n var sr2 = Math.max(0, Math.min(s.r2, maxRow));\n var sc2 = Math.max(0, Math.min(s.c2, maxColumn));\n // Swap index order if needed.\n var tmp = void 0;\n if (sr1 > sr2) {\n tmp = sr1;\n sr1 = sr2;\n sr2 = tmp;\n }\n if (sc1 > sc2) {\n tmp = sc1;\n sc1 = sc2;\n sc2 = tmp;\n }\n // Convert to pixel coordinates.\n var x1 = this._columnSections.offsetOf(sc1) - sx + hw;\n var y1 = this._rowSections.offsetOf(sr1) - sy + hh;\n var x2 = this._columnSections.extentOf(sc2) - sx + hw;\n var y2 = this._rowSections.extentOf(sr2) - sy + hh;\n // Adjust the trailing X coordinate for column stretch.\n if (this._stretchLastColumn && pw > bw && sc2 === maxColumn) {\n x2 = hw + pw - 1;\n }\n // Adjust the trailing Y coordinate for row stretch.\n if (this._stretchLastRow && ph > bh && sr2 === maxRow) {\n y2 = hh + ph - 1;\n }\n // Clamp the bounds to just outside of the clipping rect.\n x1 = Math.max(hw - 1, x1);\n y1 = Math.max(hh - 1, y1);\n x2 = Math.min(hw + pw + 1, x2);\n y2 = Math.min(hh + ph + 1, y2);\n // Skip zero sized ranges.\n if (x2 < x1 || y2 < y1) {\n continue;\n }\n // Fill the rect if needed.\n if (fill) {\n gc.fillRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n }\n // Stroke the rect if needed.\n if (stroke) {\n gc.strokeRect(x1 - .5, y1 - .5, x2 - x1 + 1, y2 - y1 + 1);\n }\n }\n // Restore the gc state.\n gc.restore();\n };\n /**\n * Draw the row header selections for the data grid.\n */\n DataGrid.prototype._drawRowHeaderSelections = function () {\n // Fetch the selection model.\n var model = this._selectionModel;\n // Bail early if there are no selections or if the selectionMode is the entire column.\n if (!model || model.isEmpty || model.selectionMode == 'column') {\n return;\n }\n // Bail early if the row headers are not visible.\n if (this.headerWidth === 0 || this.pageHeight === 0) {\n return;\n }\n // Fetch the selection colors.\n var fill = this._style.headerSelectionFillColor;\n var stroke = this._style.headerSelectionBorderColor;\n // Bail early if there is nothing to draw.\n if (!fill && !stroke) {\n return;\n }\n // Fetch common geometry.\n var sy = this._scrollY;\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n var rs = this._rowSections;\n // Fetch the overlay gc.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Set up the header clipping rect.\n gc.beginPath();\n gc.rect(0, hh, hw, ph);\n gc.clip();\n // Set up the gc style.\n if (fill) {\n gc.fillStyle = fill;\n }\n if (stroke) {\n gc.strokeStyle = stroke;\n gc.lineWidth = 1;\n }\n // Fetch the max row.\n var maxRow = rs.count - 1;\n // Fetch the visible rows.\n var r1 = rs.indexOf(sy);\n var r2 = rs.indexOf(sy + ph - 1);\n r2 = r2 < 0 ? maxRow : r2;\n // Iterate over the visible rows.\n for (var j = r1; j <= r2; ++j) {\n // Skip rows which aren't selected.\n if (!model.isRowSelected(j)) {\n continue;\n }\n // Get the dimensions of the row.\n var y = rs.offsetOf(j) - sy + hh;\n var h = rs.sizeOf(j);\n // Adjust the height for row stretch.\n if (this._stretchLastRow && ph > bh && j === maxRow) {\n h = hh + ph - y;\n }\n // Skip zero sized rows.\n if (h === 0) {\n continue;\n }\n // Fill the rect if needed.\n if (fill) {\n gc.fillRect(0, y, hw, h);\n }\n // Draw the border if needed.\n if (stroke) {\n gc.beginPath();\n gc.moveTo(hw - .5, y - 1);\n gc.lineTo(hw - .5, y + h);\n gc.stroke();\n }\n }\n // Restore the gc state.\n gc.restore();\n };\n /**\n * Draw the column header selections for the data grid.\n */\n DataGrid.prototype._drawColumnHeaderSelections = function () {\n // Fetch the selection model.\n var model = this._selectionModel;\n // Bail early if there are no selections or if the selectionMode is the entire row\n if (!model || model.isEmpty || model.selectionMode == 'row') {\n return;\n }\n // Bail early if the column headers are not visible.\n if (this.headerHeight === 0 || this.pageWidth === 0) {\n return;\n }\n // Fetch the selection colors.\n var fill = this._style.headerSelectionFillColor;\n var stroke = this._style.headerSelectionBorderColor;\n // Bail early if there is nothing to draw.\n if (!fill && !stroke) {\n return;\n }\n // Fetch common geometry.\n var sx = this._scrollX;\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n var cs = this._columnSections;\n // Fetch the overlay gc.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Set up the header clipping rect.\n gc.beginPath();\n gc.rect(hw, 0, pw, hh);\n gc.clip();\n // Set up the gc style.\n if (fill) {\n gc.fillStyle = fill;\n }\n if (stroke) {\n gc.strokeStyle = stroke;\n gc.lineWidth = 1;\n }\n // Fetch the max column.\n var maxCol = cs.count - 1;\n // Fetch the visible columns.\n var c1 = cs.indexOf(sx);\n var c2 = cs.indexOf(sx + pw - 1);\n c2 = c2 < 0 ? maxCol : c2;\n // Iterate over the visible columns.\n for (var i = c1; i <= c2; ++i) {\n // Skip columns which aren't selected.\n if (!model.isColumnSelected(i)) {\n continue;\n }\n // Get the dimensions of the column.\n var x = cs.offsetOf(i) - sx + hw;\n var w = cs.sizeOf(i);\n // Adjust the width for column stretch.\n if (this._stretchLastColumn && pw > bw && i === maxCol) {\n w = hw + pw - x;\n }\n // Skip zero sized columns.\n if (w === 0) {\n continue;\n }\n // Fill the rect if needed.\n if (fill) {\n gc.fillRect(x, 0, w, hh);\n }\n // Draw the border if needed.\n if (stroke) {\n gc.beginPath();\n gc.moveTo(x - 1, hh - .5);\n gc.lineTo(x + w, hh - .5);\n gc.stroke();\n }\n }\n // Restore the gc state.\n gc.restore();\n };\n /**\n * Draw the overlay cursor for the data grid.\n */\n DataGrid.prototype._drawCursor = function () {\n // Fetch the selection model.\n var model = this._selectionModel;\n // Bail early if there is no cursor.\n if (!model || model.isEmpty || model.selectionMode !== 'cell') {\n return;\n }\n // Extract the style information.\n var fill = this._style.cursorFillColor;\n var stroke = this._style.cursorBorderColor;\n // Bail early if there is nothing to draw.\n if (!fill && !stroke) {\n return;\n }\n // Fetch the cursor location.\n var row = model.cursorRow;\n var column = model.cursorColumn;\n // Fetch the max row and column.\n var maxRow = this._rowSections.count - 1;\n var maxColumn = this._columnSections.count - 1;\n // Bail early if the cursor is out of bounds.\n if (row < 0 || row > maxRow) {\n return;\n }\n if (column < 0 || column > maxColumn) {\n return;\n }\n // Fetch geometry.\n var sx = this._scrollX;\n var sy = this._scrollY;\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n var pw = this.pageWidth;\n var ph = this.pageHeight;\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // Get the cursor bounds in viewport coordinates.\n var x1 = this._columnSections.offsetOf(column) - sx + hw;\n var x2 = this._columnSections.extentOf(column) - sx + hw;\n var y1 = this._rowSections.offsetOf(row) - sy + hh;\n var y2 = this._rowSections.extentOf(row) - sy + hh;\n // Adjust the trailing X coordinate for column stretch.\n if (this._stretchLastColumn && pw > bw && column === maxColumn) {\n x2 = vw - 1;\n }\n // Adjust the trailing Y coordinate for row stretch.\n if (this._stretchLastRow && ph > bh && row === maxRow) {\n y2 = vh - 1;\n }\n // Skip zero sized cursors.\n if (x2 < x1 || y2 < y1) {\n return;\n }\n // Bail early if the cursor is off the screen.\n if ((x1 - 1) >= vw || (y1 - 1) >= vh || (x2 + 1) < hw || (y2 + 1) < hh) {\n return;\n }\n // Fetch the overlay gc.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Set up the body clipping rect.\n gc.beginPath();\n gc.rect(hw, hh, pw, ph);\n gc.clip();\n // Clear any existing overlay content.\n gc.clearRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n // Fill the cursor rect if needed.\n if (fill) {\n // Set up the fill style.\n gc.fillStyle = fill;\n // Fill the cursor rect.\n gc.fillRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n }\n // Stroke the cursor border if needed.\n if (stroke) {\n // Set up the stroke style.\n gc.strokeStyle = stroke;\n gc.lineWidth = 2;\n // Stroke the cursor rect.\n gc.strokeRect(x1, y1, x2 - x1, y2 - y1);\n }\n // Restore the gc state.\n gc.restore();\n };\n /**\n * Draw the overlay shadows for the data grid.\n */\n DataGrid.prototype._drawShadows = function () {\n // Fetch the scroll shadow from the style.\n var shadow = this._style.scrollShadow;\n // Bail early if there is no shadow to draw.\n if (!shadow) {\n return;\n }\n // Fetch the scroll position.\n var sx = this._scrollX;\n var sy = this._scrollY;\n // Fetch maximum scroll position.\n var sxMax = this.maxScrollX;\n var syMax = this.maxScrollY;\n // Fetch the header width and height.\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n // Fetch the page width and height.\n var pw = this.pageWidth;\n var ph = this.pageHeight;\n // Fetch the viewport width and height.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // Fetch the body width and height.\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n // Adjust the body size for row and column stretch.\n if (this._stretchLastRow && ph > bh) {\n bh = ph;\n }\n if (this._stretchLastColumn && pw > bw) {\n bw = pw;\n }\n // Fetch the gc object.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Draw the column header shadow if needed.\n if (sy > 0) {\n // Set up the gradient coordinates.\n var x0 = 0;\n var y0 = hh;\n var x1 = 0;\n var y1 = y0 + shadow.size;\n // Create the gradient object.\n var grad = gc.createLinearGradient(x0, y0, x1, y1);\n // Set the gradient stops.\n grad.addColorStop(0, shadow.color1);\n grad.addColorStop(0.5, shadow.color2);\n grad.addColorStop(1, shadow.color3);\n // Set up the rect coordinates.\n var x = 0;\n var y = hh;\n var w = hw + Math.min(pw, bw - sx);\n var h = shadow.size;\n // Fill the shadow rect with the fill style.\n gc.fillStyle = grad;\n gc.fillRect(x, y, w, h);\n }\n // Draw the row header shadow if needed.\n if (sx > 0) {\n // Set up the gradient coordinates.\n var x0 = hw;\n var y0 = 0;\n var x1 = x0 + shadow.size;\n var y1 = 0;\n // Create the gradient object.\n var grad = gc.createLinearGradient(x0, y0, x1, y1);\n // Set the gradient stops.\n grad.addColorStop(0, shadow.color1);\n grad.addColorStop(0.5, shadow.color2);\n grad.addColorStop(1, shadow.color3);\n // Set up the rect coordinates.\n var x = hw;\n var y = 0;\n var w = shadow.size;\n var h = hh + Math.min(ph, bh - sy);\n // Fill the shadow rect with the fill style.\n gc.fillStyle = grad;\n gc.fillRect(x, y, w, h);\n }\n // Draw the column footer shadow if needed.\n if (sy < syMax) {\n // Set up the gradient coordinates.\n var x0 = 0;\n var y0 = vh;\n var x1 = 0;\n var y1 = vh - shadow.size;\n // Create the gradient object.\n var grad = gc.createLinearGradient(x0, y0, x1, y1);\n // Set the gradient stops.\n grad.addColorStop(0, shadow.color1);\n grad.addColorStop(0.5, shadow.color2);\n grad.addColorStop(1, shadow.color3);\n // Set up the rect coordinates.\n var x = 0;\n var y = vh - shadow.size;\n var w = hw + Math.min(pw, bw - sx);\n var h = shadow.size;\n // Fill the shadow rect with the fill style.\n gc.fillStyle = grad;\n gc.fillRect(x, y, w, h);\n }\n // Draw the row footer shadow if needed.\n if (sx < sxMax) {\n // Set up the gradient coordinates.\n var x0 = vw;\n var y0 = 0;\n var x1 = vw - shadow.size;\n var y1 = 0;\n // Create the gradient object.\n var grad = gc.createLinearGradient(x0, y0, x1, y1);\n // Set the gradient stops.\n grad.addColorStop(0, shadow.color1);\n grad.addColorStop(0.5, shadow.color2);\n grad.addColorStop(1, shadow.color3);\n // Set up the rect coordinates.\n var x = vw - shadow.size;\n var y = 0;\n var w = shadow.size;\n var h = hh + Math.min(ph, bh - sy);\n // Fill the shadow rect with the fill style.\n gc.fillStyle = grad;\n gc.fillRect(x, y, w, h);\n }\n // Restore the gc state.\n gc.restore();\n };\n return DataGrid;\n}(widgets.Widget));\n/**\n * The namespace for the `DataGrid` class statics.\n */\n(function (DataGrid) {\n /**\n * A generic format function for the copy handler.\n *\n * @param args - The format args for the function.\n *\n * @returns The string representation of the value.\n *\n * #### Notes\n * This function uses `String()` to coerce a value to a string.\n */\n function copyFormatGeneric(args) {\n if (args.value === null || args.value === undefined) {\n return '';\n }\n return String(args.value);\n }\n DataGrid.copyFormatGeneric = copyFormatGeneric;\n /**\n * The default theme for a data grid.\n */\n DataGrid.defaultStyle = {\n voidColor: '#F3F3F3',\n backgroundColor: '#FFFFFF',\n gridLineColor: 'rgba(20, 20, 20, 0.15)',\n headerBackgroundColor: '#F3F3F3',\n headerGridLineColor: 'rgba(20, 20, 20, 0.25)',\n selectionFillColor: 'rgba(49, 119, 229, 0.2)',\n selectionBorderColor: 'rgba(0, 107, 247, 1.0)',\n cursorBorderColor: 'rgba(0, 107, 247, 1.0)',\n headerSelectionFillColor: 'rgba(20, 20, 20, 0.1)',\n headerSelectionBorderColor: 'rgba(0, 107, 247, 1.0)',\n scrollShadow: {\n size: 10,\n color1: 'rgba(0, 0, 0, 0.20)',\n color2: 'rgba(0, 0, 0, 0.05)',\n color3: 'rgba(0, 0, 0, 0.00)'\n }\n };\n /**\n * The default sizes for a data grid.\n */\n DataGrid.defaultSizes = {\n rowHeight: 20,\n columnWidth: 64,\n rowHeaderWidth: 64,\n columnHeaderHeight: 20\n };\n /**\n * The default minimum sizes for a data grid.\n */\n DataGrid.minimumSizes = {\n rowHeight: 20,\n columnWidth: 10,\n rowHeaderWidth: 10,\n columnHeaderHeight: 20\n };\n /**\n * The default copy config for a data grid.\n */\n DataGrid.defaultCopyConfig = {\n separator: '\\t',\n format: copyFormatGeneric,\n headers: 'none',\n warningThreshold: 1e6\n };\n})(exports.DataGrid || (exports.DataGrid = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A singleton `scroll-request` conflatable message.\n */\n Private.ScrollRequest = new messaging.ConflatableMessage('scroll-request');\n /**\n * A singleton `section-resize-request` conflatable message.\n */\n Private.SectionResizeRequest = new messaging.ConflatableMessage('section-resize-request');\n /**\n * A singleton `overlay-paint-request` conflatable message.\n */\n Private.OverlayPaintRequest = new messaging.ConflatableMessage('overlay-paint-request');\n /**\n * Create a new zero-sized canvas element.\n */\n function createCanvas() {\n var canvas = document.createElement('canvas');\n canvas.width = 0;\n canvas.height = 0;\n return canvas;\n }\n Private.createCanvas = createCanvas;\n /**\n * A conflatable message which merges dirty paint regions.\n */\n var PaintRequest = /** @class */ (function (_super) {\n tslib.__extends(PaintRequest, _super);\n /**\n * Construct a new paint request messages.\n *\n * @param region - The cell region for the paint.\n *\n * @param r1 - The top-left row of the dirty region.\n *\n * @param c1 - The top-left column of the dirty region.\n *\n * @param r2 - The bottom-right row of the dirty region.\n *\n * @param c2 - The bottom-right column of the dirty region.\n */\n function PaintRequest(region, r1, c1, r2, c2) {\n var _this = _super.call(this, 'paint-request') || this;\n _this._region = region;\n _this._r1 = r1;\n _this._c1 = c1;\n _this._r2 = r2;\n _this._c2 = c2;\n return _this;\n }\n Object.defineProperty(PaintRequest.prototype, \"region\", {\n /**\n * The cell region for the paint.\n */\n get: function () {\n return this._region;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PaintRequest.prototype, \"r1\", {\n /**\n * The top-left row of the dirty region.\n */\n get: function () {\n return this._r1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PaintRequest.prototype, \"c1\", {\n /**\n * The top-left column of the dirty region.\n */\n get: function () {\n return this._c1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PaintRequest.prototype, \"r2\", {\n /**\n * The bottom-right row of the dirty region.\n */\n get: function () {\n return this._r2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PaintRequest.prototype, \"c2\", {\n /**\n * The bottom-right column of the dirty region.\n */\n get: function () {\n return this._c2;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another paint request.\n */\n PaintRequest.prototype.conflate = function (other) {\n // Bail early if the request is already painting everything.\n if (this._region === 'all') {\n return true;\n }\n // Any region can conflate with the `'all'` region.\n if (other._region === 'all') {\n this._region = 'all';\n return true;\n }\n // Otherwise, do not conflate with a different region.\n if (this._region !== other._region) {\n return false;\n }\n // Conflate the region to the total boundary.\n this._r1 = Math.min(this._r1, other._r1);\n this._c1 = Math.min(this._c1, other._c1);\n this._r2 = Math.max(this._r2, other._r2);\n this._c2 = Math.max(this._c2, other._c2);\n return true;\n };\n return PaintRequest;\n }(messaging.ConflatableMessage));\n Private.PaintRequest = PaintRequest;\n /**\n * A conflatable message for resizing rows.\n */\n var RowResizeRequest = /** @class */ (function (_super) {\n tslib.__extends(RowResizeRequest, _super);\n /**\n * Construct a new row resize request.\n *\n * @param region - The row region which holds the section.\n *\n * @param index - The index of row in the region.\n *\n * @param size - The target size of the section.\n */\n function RowResizeRequest(region, index, size) {\n var _this = _super.call(this, 'row-resize-request') || this;\n _this._region = region;\n _this._index = index;\n _this._size = size;\n return _this;\n }\n Object.defineProperty(RowResizeRequest.prototype, \"region\", {\n /**\n * The row region which holds the section.\n */\n get: function () {\n return this._region;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RowResizeRequest.prototype, \"index\", {\n /**\n * The index of the row in the region.\n */\n get: function () {\n return this._index;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RowResizeRequest.prototype, \"size\", {\n /**\n * The target size of the section.\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another row resize request.\n */\n RowResizeRequest.prototype.conflate = function (other) {\n if (this._region !== other._region || this._index !== other._index) {\n return false;\n }\n this._size = other._size;\n return true;\n };\n return RowResizeRequest;\n }(messaging.ConflatableMessage));\n Private.RowResizeRequest = RowResizeRequest;\n /**\n * A conflatable message for resizing columns.\n */\n var ColumnResizeRequest = /** @class */ (function (_super) {\n tslib.__extends(ColumnResizeRequest, _super);\n /**\n * Construct a new column resize request.\n *\n * @param region - The column region which holds the section.\n *\n * @param index - The index of column in the region.\n *\n * @param size - The target size of the section.\n */\n function ColumnResizeRequest(region, index, size) {\n var _this = _super.call(this, 'column-resize-request') || this;\n _this._region = region;\n _this._index = index;\n _this._size = size;\n return _this;\n }\n Object.defineProperty(ColumnResizeRequest.prototype, \"region\", {\n /**\n * The column region which holds the section.\n */\n get: function () {\n return this._region;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColumnResizeRequest.prototype, \"index\", {\n /**\n * The index of the column in the region.\n */\n get: function () {\n return this._index;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColumnResizeRequest.prototype, \"size\", {\n /**\n * The target size of the section.\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another column resize request.\n */\n ColumnResizeRequest.prototype.conflate = function (other) {\n if (this._region !== other._region || this._index !== other._index) {\n return false;\n }\n this._size = other._size;\n return true;\n };\n return ColumnResizeRequest;\n }(messaging.ConflatableMessage));\n Private.ColumnResizeRequest = ColumnResizeRequest;\n})(Private || (Private = {}));\n//# sourceMappingURL=datagrid.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/datagrid.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar widgets = __webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\n__webpack_require__(/*! ./notification.js */ \"../../packages/datagrid/dist/notification.js\");\n__webpack_require__(/*! ./celleditor.js */ \"../../packages/datagrid/dist/celleditor.js\");\nvar celleditorcontroller = __webpack_require__(/*! ./celleditorcontroller.js */ \"../../packages/datagrid/dist/celleditorcontroller.js\");\n__webpack_require__(/*! ./cellrenderer.js */ \"../../packages/datagrid/dist/cellrenderer.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar datamodel = __webpack_require__(/*! ./datamodel.js */ \"../../packages/datagrid/dist/datamodel.js\");\nvar graphicscontext = __webpack_require__(/*! ./graphicscontext.js */ \"../../packages/datagrid/dist/graphicscontext.js\");\n__webpack_require__(/*! ./textrenderer.js */ \"../../packages/datagrid/dist/textrenderer.js\");\nvar renderermap = __webpack_require__(/*! ./renderermap.js */ \"../../packages/datagrid/dist/renderermap.js\");\nvar sectionlist = __webpack_require__(/*! ./sectionlist.js */ \"../../packages/datagrid/dist/sectionlist.js\");\n\n/**\n * A widget which implements a high-performance tabular data grid.\n *\n * #### Notes\n * A data grid is implemented as a composition of child widgets. These\n * child widgets are considered an implementation detail. Manipulating\n * the child widgets of a data grid directly is undefined behavior.\n *\n * This class is not designed to be subclassed.\n */\nexports.DataGrid = /** @class */ (function (_super) {\n tslib.__extends(DataGrid, _super);\n /**\n * Construct a new data grid.\n *\n * @param options - The options for initializing the data grid.\n */\n function DataGrid(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this._scrollX = 0;\n _this._scrollY = 0;\n _this._viewportWidth = 0;\n _this._viewportHeight = 0;\n _this._mousedown = false;\n _this._keyHandler = null;\n _this._mouseHandler = null;\n _this._vScrollBarMinWidth = 0;\n _this._hScrollBarMinHeight = 0;\n _this._dpiRatio = Math.ceil(window.devicePixelRatio);\n _this._dataModel = null;\n _this._selectionModel = null;\n _this._editingEnabled = false;\n _this.addClass('lm-DataGrid');\n /* */\n _this.addClass('p-DataGrid');\n /* */\n // Parse the simple options.\n _this._style = options.style || DataGrid.defaultStyle;\n _this._stretchLastRow = options.stretchLastRow || false;\n _this._stretchLastColumn = options.stretchLastColumn || false;\n _this._headerVisibility = options.headerVisibility || 'all';\n _this._cellRenderers = options.cellRenderers || new renderermap.RendererMap();\n _this._copyConfig = options.copyConfig || DataGrid.defaultCopyConfig;\n // Connect to the renderer map changed signal.\n _this._cellRenderers.changed.connect(_this._onRenderersChanged, _this);\n // Parse the default sizes.\n var defaultSizes = options.defaultSizes || DataGrid.defaultSizes;\n var minimumSizes = options.minimumSizes || DataGrid.minimumSizes;\n // Set up the sections lists.\n _this._rowSections = new sectionlist.SectionList({ defaultSize: defaultSizes.rowHeight,\n minimumSize: minimumSizes.rowHeight });\n _this._columnSections = new sectionlist.SectionList({ defaultSize: defaultSizes.columnWidth,\n minimumSize: minimumSizes.columnWidth });\n _this._rowHeaderSections = new sectionlist.SectionList({ defaultSize: defaultSizes.rowHeaderWidth,\n minimumSize: minimumSizes.rowHeaderWidth });\n _this._columnHeaderSections = new sectionlist.SectionList({ defaultSize: defaultSizes.columnHeaderHeight,\n minimumSize: minimumSizes.columnHeaderHeight });\n // Create the canvas, buffer, and overlay objects.\n _this._canvas = Private.createCanvas();\n _this._buffer = Private.createCanvas();\n _this._overlay = Private.createCanvas();\n // Get the graphics contexts for the canvases.\n _this._canvasGC = _this._canvas.getContext('2d');\n _this._bufferGC = _this._buffer.getContext('2d');\n _this._overlayGC = _this._overlay.getContext('2d');\n // Set up the on-screen canvas.\n _this._canvas.style.position = 'absolute';\n _this._canvas.style.top = '0px';\n _this._canvas.style.left = '0px';\n _this._canvas.style.width = '0px';\n _this._canvas.style.height = '0px';\n // Set up the on-screen overlay.\n _this._overlay.style.position = 'absolute';\n _this._overlay.style.top = '0px';\n _this._overlay.style.left = '0px';\n _this._overlay.style.width = '0px';\n _this._overlay.style.height = '0px';\n // Create the internal widgets for the data grid.\n _this._viewport = new widgets.Widget();\n _this._viewport.node.tabIndex = -1;\n _this._viewport.node.style.outline = 'none';\n _this._vScrollBar = new widgets.ScrollBar({ orientation: 'vertical' });\n _this._hScrollBar = new widgets.ScrollBar({ orientation: 'horizontal' });\n _this._scrollCorner = new widgets.Widget();\n _this._editorController = new celleditorcontroller.CellEditorController();\n // Add the extra class names to the child widgets.\n _this._viewport.addClass('lm-DataGrid-viewport');\n _this._vScrollBar.addClass('lm-DataGrid-scrollBar');\n _this._hScrollBar.addClass('lm-DataGrid-scrollBar');\n _this._scrollCorner.addClass('lm-DataGrid-scrollCorner');\n /* */\n _this._viewport.addClass('p-DataGrid-viewport');\n _this._vScrollBar.addClass('p-DataGrid-scrollBar');\n _this._hScrollBar.addClass('p-DataGrid-scrollBar');\n _this._scrollCorner.addClass('p-DataGrid-scrollCorner');\n /* */\n // Add the on-screen canvas to the viewport node.\n _this._viewport.node.appendChild(_this._canvas);\n // Add the on-screen overlay to the viewport node.\n _this._viewport.node.appendChild(_this._overlay);\n // Install the message hooks.\n messaging.MessageLoop.installMessageHook(_this._viewport, _this);\n messaging.MessageLoop.installMessageHook(_this._hScrollBar, _this);\n messaging.MessageLoop.installMessageHook(_this._vScrollBar, _this);\n // Hide the scroll bars and corner from the outset.\n _this._vScrollBar.hide();\n _this._hScrollBar.hide();\n _this._scrollCorner.hide();\n // Connect to the scroll bar signals.\n _this._vScrollBar.thumbMoved.connect(_this._onThumbMoved, _this);\n _this._hScrollBar.thumbMoved.connect(_this._onThumbMoved, _this);\n _this._vScrollBar.pageRequested.connect(_this._onPageRequested, _this);\n _this._hScrollBar.pageRequested.connect(_this._onPageRequested, _this);\n _this._vScrollBar.stepRequested.connect(_this._onStepRequested, _this);\n _this._hScrollBar.stepRequested.connect(_this._onStepRequested, _this);\n // Set the layout cell config for the child widgets.\n widgets.GridLayout.setCellConfig(_this._viewport, { row: 0, column: 0 });\n widgets.GridLayout.setCellConfig(_this._vScrollBar, { row: 0, column: 1 });\n widgets.GridLayout.setCellConfig(_this._hScrollBar, { row: 1, column: 0 });\n widgets.GridLayout.setCellConfig(_this._scrollCorner, { row: 1, column: 1 });\n // Create the layout for the data grid.\n var layout = new widgets.GridLayout({\n rowCount: 2,\n columnCount: 2,\n rowSpacing: 0,\n columnSpacing: 0,\n fitPolicy: 'set-no-constraint'\n });\n // Set the stretch factors for the grid.\n layout.setRowStretch(0, 1);\n layout.setRowStretch(1, 0);\n layout.setColumnStretch(0, 1);\n layout.setColumnStretch(1, 0);\n // Add the child widgets to the layout.\n layout.addWidget(_this._viewport);\n layout.addWidget(_this._vScrollBar);\n layout.addWidget(_this._hScrollBar);\n layout.addWidget(_this._scrollCorner);\n // Install the layout on the data grid.\n _this.layout = layout;\n return _this;\n }\n /**\n * Dispose of the resources held by the widgets.\n */\n DataGrid.prototype.dispose = function () {\n // Release the mouse.\n this._releaseMouse();\n // Dispose of the handlers.\n if (this._keyHandler) {\n this._keyHandler.dispose();\n }\n if (this._mouseHandler) {\n this._mouseHandler.dispose();\n }\n this._keyHandler = null;\n this._mouseHandler = null;\n // Clear the models.\n this._dataModel = null;\n this._selectionModel = null;\n // Clear the section lists.\n this._rowSections.clear();\n this._columnSections.clear();\n this._rowHeaderSections.clear();\n this._columnHeaderSections.clear();\n // Dispose of the base class.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(DataGrid.prototype, \"dataModel\", {\n /**\n * Get the data model for the data grid.\n */\n get: function () {\n return this._dataModel;\n },\n /**\n * Set the data model for the data grid.\n *\n * #### Notes\n * This will automatically remove the current selection model.\n */\n set: function (value) {\n // Do nothing if the model does not change.\n if (this._dataModel === value) {\n return;\n }\n // Release the mouse.\n this._releaseMouse();\n // Clear the selection model.\n this.selectionModel = null;\n // Disconnect the change handler from the old model.\n if (this._dataModel) {\n this._dataModel.changed.disconnect(this._onDataModelChanged, this);\n }\n // Connect the change handler for the new model.\n if (value) {\n value.changed.connect(this._onDataModelChanged, this);\n }\n // Update the internal model reference.\n this._dataModel = value;\n // Clear the section lists.\n this._rowSections.clear();\n this._columnSections.clear();\n this._rowHeaderSections.clear();\n this._columnHeaderSections.clear();\n // Populate the section lists.\n if (value) {\n this._rowSections.insert(0, value.rowCount('body'));\n this._columnSections.insert(0, value.columnCount('body'));\n this._rowHeaderSections.insert(0, value.columnCount('row-header'));\n this._columnHeaderSections.insert(0, value.rowCount('column-header'));\n }\n // Reset the scroll position.\n this._scrollX = 0;\n this._scrollY = 0;\n // Sync the viewport.\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"selectionModel\", {\n /**\n * Get the selection model for the data grid.\n */\n get: function () {\n return this._selectionModel;\n },\n /**\n * Set the selection model for the data grid.\n */\n set: function (value) {\n // Do nothing if the selection model does not change.\n if (this._selectionModel === value) {\n return;\n }\n // Release the mouse.\n this._releaseMouse();\n // Ensure the data models are a match.\n if (value && value.dataModel !== this._dataModel) {\n throw new Error('SelectionModel.dataModel !== DataGrid.dataModel');\n }\n // Disconnect the change handler from the old model.\n if (this._selectionModel) {\n this._selectionModel.changed.disconnect(this._onSelectionsChanged, this);\n }\n // Connect the change handler for the new model.\n if (value) {\n value.changed.connect(this._onSelectionsChanged, this);\n }\n // Update the internal selection model reference.\n this._selectionModel = value;\n // Schedule a repaint of the overlay.\n this.repaintOverlay();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"keyHandler\", {\n /**\n * Get the key handler for the data grid.\n */\n get: function () {\n return this._keyHandler;\n },\n /**\n * Set the key handler for the data grid.\n */\n set: function (value) {\n this._keyHandler = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"mouseHandler\", {\n /**\n * Get the mouse handler for the data grid.\n */\n get: function () {\n return this._mouseHandler;\n },\n /**\n * Set the mouse handler for the data grid.\n */\n set: function (value) {\n // Bail early if the mouse handler does not change.\n if (this._mouseHandler === value) {\n return;\n }\n // Release the mouse.\n this._releaseMouse();\n // Update the internal mouse handler.\n this._mouseHandler = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"style\", {\n /**\n * Get the style for the data grid.\n */\n get: function () {\n return this._style;\n },\n /**\n * Set the style for the data grid.\n */\n set: function (value) {\n // Bail if the style does not change.\n if (this._style === value) {\n return;\n }\n // Update the internal style.\n this._style = tslib.__assign({}, value);\n // Schedule a repaint of the content.\n this.repaintContent();\n // Schedule a repaint of the overlay.\n this.repaintOverlay();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"cellRenderers\", {\n /**\n * Get the cell renderer map for the data grid.\n */\n get: function () {\n return this._cellRenderers;\n },\n /**\n * Set the cell renderer map for the data grid.\n */\n set: function (value) {\n // Bail if the renderer map does not change.\n if (this._cellRenderers === value) {\n return;\n }\n // Disconnect the old map.\n this._cellRenderers.changed.disconnect(this._onRenderersChanged, this);\n // Connect the new map.\n value.changed.connect(this._onRenderersChanged, this);\n // Update the internal renderer map.\n this._cellRenderers = value;\n // Schedule a repaint of the grid content.\n this.repaintContent();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"headerVisibility\", {\n /**\n * Get the header visibility for the data grid.\n */\n get: function () {\n return this._headerVisibility;\n },\n /**\n * Set the header visibility for the data grid.\n */\n set: function (value) {\n // Bail if the visibility does not change.\n if (this._headerVisibility === value) {\n return;\n }\n // Update the internal visibility.\n this._headerVisibility = value;\n // Sync the viewport.\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"defaultSizes\", {\n /**\n * Get the default sizes for the various sections of the data grid.\n */\n get: function () {\n var rowHeight = this._rowSections.defaultSize;\n var columnWidth = this._columnSections.defaultSize;\n var rowHeaderWidth = this._rowHeaderSections.defaultSize;\n var columnHeaderHeight = this._columnHeaderSections.defaultSize;\n return { rowHeight: rowHeight, columnWidth: columnWidth, rowHeaderWidth: rowHeaderWidth, columnHeaderHeight: columnHeaderHeight };\n },\n /**\n * Set the default sizes for the various sections of the data grid.\n */\n set: function (value) {\n // Update the section default sizes.\n this._rowSections.defaultSize = value.rowHeight;\n this._columnSections.defaultSize = value.columnWidth;\n this._rowHeaderSections.defaultSize = value.rowHeaderWidth;\n this._columnHeaderSections.defaultSize = value.columnHeaderHeight;\n // Sync the viewport.\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"minimumSizes\", {\n /**\n * Get the minimum sizes for the various sections of the data grid.\n */\n get: function () {\n var rowHeight = this._rowSections.minimumSize;\n var columnWidth = this._columnSections.minimumSize;\n var rowHeaderWidth = this._rowHeaderSections.minimumSize;\n var columnHeaderHeight = this._columnHeaderSections.minimumSize;\n return { rowHeight: rowHeight, columnWidth: columnWidth, rowHeaderWidth: rowHeaderWidth, columnHeaderHeight: columnHeaderHeight };\n },\n /**\n * Set the minimum sizes for the various sections of the data grid.\n */\n set: function (value) {\n // Update the section default sizes.\n this._rowSections.minimumSize = value.rowHeight;\n this._columnSections.minimumSize = value.columnWidth;\n this._rowHeaderSections.minimumSize = value.rowHeaderWidth;\n this._columnHeaderSections.minimumSize = value.columnHeaderHeight;\n // Sync the viewport.\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"copyConfig\", {\n /**\n * Get the copy configuration for the data grid.\n */\n get: function () {\n return this._copyConfig;\n },\n /**\n * Set the copy configuration for the data grid.\n */\n set: function (value) {\n this._copyConfig = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"stretchLastRow\", {\n /**\n * Get whether the last row is stretched.\n */\n get: function () {\n return this._stretchLastRow;\n },\n /**\n * Set whether the last row is stretched.\n */\n set: function (value) {\n // Bail early if the value does not change.\n if (value === this._stretchLastRow) {\n return;\n }\n // Update the internal value.\n this._stretchLastRow = value;\n // Sync the viewport\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"stretchLastColumn\", {\n /**\n * Get whether the last column is stretched.\n */\n get: function () {\n return this._stretchLastColumn;\n },\n /**\n * Set whether the last column is stretched.\n */\n set: function (value) {\n // Bail early if the value does not change.\n if (value === this._stretchLastColumn) {\n return;\n }\n // Update the internal value.\n this._stretchLastColumn = value;\n // Sync the viewport\n this._syncViewport();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"headerWidth\", {\n /**\n * The virtual width of the row headers.\n */\n get: function () {\n if (this._headerVisibility === 'none') {\n return 0;\n }\n if (this._headerVisibility === 'column') {\n return 0;\n }\n return this._rowHeaderSections.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"headerHeight\", {\n /**\n * The virtual height of the column headers.\n */\n get: function () {\n if (this._headerVisibility === 'none') {\n return 0;\n }\n if (this._headerVisibility === 'row') {\n return 0;\n }\n return this._columnHeaderSections.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"bodyWidth\", {\n /**\n * The virtual width of the grid body.\n *\n * #### Notes\n * This does *not* account for a stretched last column.\n */\n get: function () {\n return this._columnSections.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"bodyHeight\", {\n /**\n * The virtual height of the grid body.\n *\n * #### Notes\n * This does *not* account for a stretched last row.\n */\n get: function () {\n return this._rowSections.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"totalWidth\", {\n /**\n * The virtual width of the entire grid.\n *\n * #### Notes\n * This does *not* account for a stretched last column.\n */\n get: function () {\n return this.headerWidth + this.bodyWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"totalHeight\", {\n /**\n * The virtual height of the entire grid.\n *\n * #### Notes\n * This does *not* account for a stretched last row.\n */\n get: function () {\n return this.headerHeight + this.bodyHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"viewportWidth\", {\n /**\n * The actual width of the viewport.\n */\n get: function () {\n return this._viewportWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"viewportHeight\", {\n /**\n * The actual height of the viewport.\n */\n get: function () {\n return this._viewportHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"pageWidth\", {\n /**\n * The width of the visible portion of the grid body.\n */\n get: function () {\n return Math.max(0, this.viewportWidth - this.headerWidth);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"pageHeight\", {\n /**\n * The height of the visible portion of the grid body.\n */\n get: function () {\n return Math.max(0, this.viewportHeight - this.headerHeight);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"scrollX\", {\n /**\n * The current scroll X position of the viewport.\n */\n get: function () {\n return this._hScrollBar.value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"scrollY\", {\n /**\n * The current scroll Y position of the viewport.\n */\n get: function () {\n return this._vScrollBar.value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"maxScrollX\", {\n /**\n * The maximum scroll X position for the grid.\n */\n get: function () {\n return Math.max(0, this.bodyWidth - this.pageWidth - 1);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"maxScrollY\", {\n /**\n * The maximum scroll Y position for the grid.\n */\n get: function () {\n return Math.max(0, this.bodyHeight - this.pageHeight - 1);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"viewport\", {\n /**\n * The viewport widget for the data grid.\n */\n get: function () {\n return this._viewport;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"editorController\", {\n /**\n * The cell editor controller object for the data grid.\n */\n get: function () {\n return this._editorController;\n },\n set: function (controller) {\n this._editorController = controller;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"editingEnabled\", {\n /**\n * Whether the cell editing is enabled for the data grid.\n */\n get: function () {\n return this._editingEnabled;\n },\n set: function (enabled) {\n this._editingEnabled = enabled;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"editable\", {\n /**\n * Whether the grid cells are editable.\n *\n * `editingEnabled` flag must be on and grid must have required\n * selection model, editor controller and data model properties.\n */\n get: function () {\n return this._editingEnabled &&\n this._selectionModel !== null &&\n this._editorController !== null &&\n this.dataModel instanceof datamodel.MutableDataModel;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"canvasGC\", {\n /**\n * The rendering context for painting the data grid.\n */\n get: function () {\n return this._canvasGC;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"rowSections\", {\n /**\n * The row sections of the data grid.\n */\n get: function () {\n return this._rowSections;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"columnSections\", {\n /**\n * The column sections of the data grid.\n */\n get: function () {\n return this._columnSections;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"rowHeaderSections\", {\n /**\n * The row header sections of the data grid.\n */\n get: function () {\n return this._rowHeaderSections;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataGrid.prototype, \"columnHeaderSections\", {\n /**\n * The column header sections of the data grid.\n */\n get: function () {\n return this._columnHeaderSections;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Scroll the grid to the specified row.\n *\n * @param row - The row index of the cell.\n *\n * #### Notes\n * This is a no-op if the row is already visible.\n */\n DataGrid.prototype.scrollToRow = function (row) {\n // Fetch the row count.\n var nr = this._rowSections.count;\n // Bail early if there is no content.\n if (nr === 0) {\n return;\n }\n // Floor the row index.\n row = Math.floor(row);\n // Clamp the row index.\n row = Math.max(0, Math.min(row, nr - 1));\n // Get the virtual bounds of the row.\n var y1 = this._rowSections.offsetOf(row);\n var y2 = this._rowSections.extentOf(row);\n // Get the virtual bounds of the viewport.\n var vy1 = this._scrollY;\n var vy2 = this._scrollY + this.pageHeight - 1;\n // Set up the delta variables.\n var dy = 0;\n // Compute the delta Y scroll.\n if (y1 < vy1) {\n dy = y1 - vy1 - 10;\n }\n else if (y2 > vy2) {\n dy = y2 - vy2 + 10;\n }\n // Bail early if no scroll is needed.\n if (dy === 0) {\n return;\n }\n // Scroll by the computed delta.\n this.scrollBy(0, dy);\n };\n /**\n * Scroll the grid to the specified column.\n *\n * @param column - The column index of the cell.\n *\n * #### Notes\n * This is a no-op if the column is already visible.\n */\n DataGrid.prototype.scrollToColumn = function (column) {\n // Fetch the column count.\n var nc = this._columnSections.count;\n // Bail early if there is no content.\n if (nc === 0) {\n return;\n }\n // Floor the column index.\n column = Math.floor(column);\n // Clamp the column index.\n column = Math.max(0, Math.min(column, nc - 1));\n // Get the virtual bounds of the column.\n var x1 = this._columnSections.offsetOf(column);\n var x2 = this._columnSections.extentOf(column);\n // Get the virtual bounds of the viewport.\n var vx1 = this._scrollX;\n var vx2 = this._scrollX + this.pageWidth - 1;\n // Set up the delta variables.\n var dx = 0;\n // Compute the delta X scroll.\n if (x1 < vx1) {\n dx = x1 - vx1 - 10;\n }\n else if (x2 > vx2) {\n dx = x2 - vx2 + 10;\n }\n // Bail early if no scroll is needed.\n if (dx === 0) {\n return;\n }\n // Scroll by the computed delta.\n this.scrollBy(dx, 0);\n };\n /**\n * Scroll the grid to the specified cell.\n *\n * @param row - The row index of the cell.\n *\n * @param column - The column index of the cell.\n *\n * #### Notes\n * This is a no-op if the cell is already visible.\n */\n DataGrid.prototype.scrollToCell = function (row, column) {\n // Fetch the row and column count.\n var nr = this._rowSections.count;\n var nc = this._columnSections.count;\n // Bail early if there is no content.\n if (nr === 0 || nc === 0) {\n return;\n }\n // Floor the cell index.\n row = Math.floor(row);\n column = Math.floor(column);\n // Clamp the cell index.\n row = Math.max(0, Math.min(row, nr - 1));\n column = Math.max(0, Math.min(column, nc - 1));\n // Get the virtual bounds of the cell.\n var x1 = this._columnSections.offsetOf(column);\n var x2 = this._columnSections.extentOf(column);\n var y1 = this._rowSections.offsetOf(row);\n var y2 = this._rowSections.extentOf(row);\n // Get the virtual bounds of the viewport.\n var vx1 = this._scrollX;\n var vx2 = this._scrollX + this.pageWidth - 1;\n var vy1 = this._scrollY;\n var vy2 = this._scrollY + this.pageHeight - 1;\n // Set up the delta variables.\n var dx = 0;\n var dy = 0;\n // Compute the delta X scroll.\n if (x1 < vx1) {\n dx = x1 - vx1 - 10;\n }\n else if (x2 > vx2) {\n dx = x2 - vx2 + 10;\n }\n // Compute the delta Y scroll.\n if (y1 < vy1) {\n dy = y1 - vy1 - 10;\n }\n else if (y2 > vy2) {\n dy = y2 - vy2 + 10;\n }\n // Bail early if no scroll is needed.\n if (dx === 0 && dy === 0) {\n return;\n }\n // Scroll by the computed delta.\n this.scrollBy(dx, dy);\n };\n /**\n * Move cursor down/up/left/right while making sure it remains\n * within the bounds of selected rectangles\n *\n * @param direction - The direction of the movement.\n */\n DataGrid.prototype.moveCursor = function (direction) {\n // Bail early if there is no selection\n if (!this.dataModel ||\n !this._selectionModel ||\n this._selectionModel.isEmpty) {\n return;\n }\n var iter = this._selectionModel.selections();\n var onlyOne = iter.next() && !iter.next();\n // if there is a single selection that is a single cell selection\n // then move the selection and cursor within grid bounds\n if (onlyOne) {\n var currentSel = this._selectionModel.currentSelection();\n if (currentSel.r1 === currentSel.r2 &&\n currentSel.c1 === currentSel.c2) {\n var dr = direction === 'down' ? 1 : direction === 'up' ? -1 : 0;\n var dc = direction === 'right' ? 1 : direction === 'left' ? -1 : 0;\n var newRow = currentSel.r1 + dr;\n var newColumn = currentSel.c1 + dc;\n var rowCount = this.dataModel.rowCount('body');\n var columnCount = this.dataModel.columnCount('body');\n if (newRow >= rowCount) {\n newRow = 0;\n newColumn += 1;\n }\n else if (newRow === -1) {\n newRow = rowCount - 1;\n newColumn -= 1;\n }\n if (newColumn >= columnCount) {\n newColumn = 0;\n newRow += 1;\n if (newRow >= rowCount) {\n newRow = 0;\n }\n }\n else if (newColumn === -1) {\n newColumn = columnCount - 1;\n newRow -= 1;\n if (newRow === -1) {\n newRow = rowCount - 1;\n }\n }\n this._selectionModel.select({\n r1: newRow, c1: newColumn,\n r2: newRow, c2: newColumn,\n cursorRow: newRow, cursorColumn: newColumn,\n clear: 'all'\n });\n return;\n }\n }\n // if there are multiple selections, move cursor\n // within selection rectangles\n this._selectionModel.moveCursorWithinSelections(direction);\n };\n /**\n * Scroll the grid to the current cursor position.\n *\n * #### Notes\n * This is a no-op if the cursor is already visible or\n * if there is no selection model installed on the grid.\n */\n DataGrid.prototype.scrollToCursor = function () {\n // Bail early if there is no selection model.\n if (!this._selectionModel) {\n return;\n }\n // Fetch the cursor row and column.\n var row = this._selectionModel.cursorRow;\n var column = this._selectionModel.cursorColumn;\n // Scroll to the cursor cell.\n this.scrollToCell(row, column);\n };\n /**\n * Scroll the viewport by the specified amount.\n *\n * @param dx - The X scroll amount.\n *\n * @param dy - The Y scroll amount.\n */\n DataGrid.prototype.scrollBy = function (dx, dy) {\n this.scrollTo(this.scrollX + dx, this.scrollY + dy);\n };\n /**\n * Scroll the viewport by one page.\n *\n * @param dir - The desired direction of the scroll.\n */\n DataGrid.prototype.scrollByPage = function (dir) {\n var dx = 0;\n var dy = 0;\n switch (dir) {\n case 'up':\n dy = -this.pageHeight;\n break;\n case 'down':\n dy = this.pageHeight;\n break;\n case 'left':\n dx = -this.pageWidth;\n break;\n case 'right':\n dx = this.pageWidth;\n break;\n default:\n throw 'unreachable';\n }\n this.scrollTo(this.scrollX + dx, this.scrollY + dy);\n };\n /**\n * Scroll the viewport by one cell-aligned step.\n *\n * @param dir - The desired direction of the scroll.\n */\n DataGrid.prototype.scrollByStep = function (dir) {\n var r;\n var c;\n var x = this.scrollX;\n var y = this.scrollY;\n var rows = this._rowSections;\n var columns = this._columnSections;\n switch (dir) {\n case 'up':\n r = rows.indexOf(y - 1);\n y = r < 0 ? y : rows.offsetOf(r);\n break;\n case 'down':\n r = rows.indexOf(y);\n y = r < 0 ? y : rows.offsetOf(r) + rows.sizeOf(r);\n break;\n case 'left':\n c = columns.indexOf(x - 1);\n x = c < 0 ? x : columns.offsetOf(c);\n break;\n case 'right':\n c = columns.indexOf(x);\n x = c < 0 ? x : columns.offsetOf(c) + columns.sizeOf(c);\n break;\n default:\n throw 'unreachable';\n }\n this.scrollTo(x, y);\n };\n /**\n * Scroll to the specified offset position.\n *\n * @param x - The desired X position.\n *\n * @param y - The desired Y position.\n */\n DataGrid.prototype.scrollTo = function (x, y) {\n // Floor and clamp the position to the allowable range.\n x = Math.max(0, Math.min(Math.floor(x), this.maxScrollX));\n y = Math.max(0, Math.min(Math.floor(y), this.maxScrollY));\n // Update the scroll bar values with the desired position.\n this._hScrollBar.value = x;\n this._vScrollBar.value = y;\n // Post a scroll request message to the viewport.\n messaging.MessageLoop.postMessage(this._viewport, Private.ScrollRequest);\n };\n /**\n * Get the row count for a particular region in the data grid.\n *\n * @param region - The row region of interest.\n *\n * @returns The row count for the specified region.\n */\n DataGrid.prototype.rowCount = function (region) {\n var count;\n if (region === 'body') {\n count = this._rowSections.count;\n }\n else {\n count = this._columnHeaderSections.count;\n }\n return count;\n };\n /**\n * Get the column count for a particular region in the data grid.\n *\n * @param region - The column region of interest.\n *\n * @returns The column count for the specified region.\n */\n DataGrid.prototype.columnCount = function (region) {\n var count;\n if (region === 'body') {\n count = this._columnSections.count;\n }\n else {\n count = this._rowHeaderSections.count;\n }\n return count;\n };\n /**\n * Get the row at a virtual offset in the data grid.\n *\n * @param region - The region which holds the row of interest.\n *\n * @param offset - The virtual offset of the row of interest.\n *\n * @returns The index of the row, or `-1` if the offset is out of range.\n *\n * #### Notes\n * This method accounts for a stretched last row.\n */\n DataGrid.prototype.rowAt = function (region, offset) {\n // Bail early if the offset is negative.\n if (offset < 0) {\n return -1;\n }\n // Return early for the column header region.\n if (region === 'column-header') {\n return this._columnHeaderSections.indexOf(offset);\n }\n // Fetch the index.\n var index = this._rowSections.indexOf(offset);\n // Return early if the section is found.\n if (index >= 0) {\n return index;\n }\n // Bail early if the last row is not stretched.\n if (!this._stretchLastRow) {\n return -1;\n }\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n // Bail early if no row stretching is required.\n if (ph <= bh) {\n return -1;\n }\n // Bail early if the offset is out of bounds.\n if (offset >= ph) {\n return -1;\n }\n // Otherwise, return the last row.\n return this._rowSections.count - 1;\n };\n /**\n * Get the column at a virtual offset in the data grid.\n *\n * @param region - The region which holds the column of interest.\n *\n * @param offset - The virtual offset of the column of interest.\n *\n * @returns The index of the column, or `-1` if the offset is out of range.\n *\n * #### Notes\n * This method accounts for a stretched last column.\n */\n DataGrid.prototype.columnAt = function (region, offset) {\n if (offset < 0) {\n return -1;\n }\n // Return early for the row header region.\n if (region === 'row-header') {\n return this._rowHeaderSections.indexOf(offset);\n }\n // Fetch the index.\n var index = this._columnSections.indexOf(offset);\n // Return early if the section is found.\n if (index >= 0) {\n return index;\n }\n // Bail early if the last column is not stretched.\n if (!this._stretchLastColumn) {\n return -1;\n }\n // Fetch the geometry.\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n // Bail early if no column stretching is required.\n if (pw <= bw) {\n return -1;\n }\n // Bail early if the offset is out of bounds.\n if (offset >= pw) {\n return -1;\n }\n // Otherwise, return the last column.\n return this._columnSections.count - 1;\n };\n /**\n * Get the offset of a row in the data grid.\n *\n * @param region - The region which holds the row of interest.\n *\n * @param index - The index of the row of interest.\n *\n * @returns The offset of the row, or `-1` if the index is out of range.\n *\n * #### Notes\n * A stretched last row has no effect on the return value.\n */\n DataGrid.prototype.rowOffset = function (region, index) {\n var offset;\n if (region === 'body') {\n offset = this._rowSections.offsetOf(index);\n }\n else {\n offset = this._columnHeaderSections.offsetOf(index);\n }\n return offset;\n };\n /**\n * Get the offset of a column in the data grid.\n *\n * @param region - The region which holds the column of interest.\n *\n * @param index - The index of the column of interest.\n *\n * @returns The offset of the column, or `-1` if the index is out of range.\n *\n * #### Notes\n * A stretched last column has no effect on the return value.\n */\n DataGrid.prototype.columnOffset = function (region, index) {\n var offset;\n if (region === 'body') {\n offset = this._columnSections.offsetOf(index);\n }\n else {\n offset = this._rowHeaderSections.offsetOf(index);\n }\n return offset;\n };\n /**\n * Get the size of a row in the data grid.\n *\n * @param region - The region which holds the row of interest.\n *\n * @param index - The index of the row of interest.\n *\n * @returns The size of the row, or `-1` if the index is out of range.\n *\n * #### Notes\n * This method accounts for a stretched last row.\n */\n DataGrid.prototype.rowSize = function (region, index) {\n // Return early for the column header region.\n if (region === 'column-header') {\n return this._columnHeaderSections.sizeOf(index);\n }\n // Fetch the row size.\n var size = this._rowSections.sizeOf(index);\n // Bail early if the index is out of bounds.\n if (size < 0) {\n return size;\n }\n // Return early if the last row is not stretched.\n if (!this._stretchLastRow) {\n return size;\n }\n // Return early if its not the last row.\n if (index < this._rowSections.count - 1) {\n return size;\n }\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n // Return early if no stretching is needed.\n if (ph <= bh) {\n return size;\n }\n // Return the adjusted size.\n return size + (ph - bh);\n };\n /**\n * Get the size of a column in the data grid.\n *\n * @param region - The region which holds the column of interest.\n *\n * @param index - The index of the column of interest.\n *\n * @returns The size of the column, or `-1` if the index is out of range.\n *\n * #### Notes\n * This method accounts for a stretched last column.\n */\n DataGrid.prototype.columnSize = function (region, index) {\n // Return early for the row header region.\n if (region === 'row-header') {\n return this._rowHeaderSections.sizeOf(index);\n }\n // Fetch the column size.\n var size = this._columnSections.sizeOf(index);\n // Bail early if the index is out of bounds.\n if (size < 0) {\n return size;\n }\n // Return early if the last column is not stretched.\n if (!this._stretchLastColumn) {\n return size;\n }\n // Return early if its not the last column.\n if (index < this._columnSections.count - 1) {\n return size;\n }\n // Fetch the geometry.\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n // Return early if no stretching is needed.\n if (pw <= bw) {\n return size;\n }\n // Return the adjusted size.\n return size + (pw - bw);\n };\n /**\n * Resize a row in the data grid.\n *\n * @param region - The region which holds the row of interest.\n *\n * @param index - The index of the row of interest.\n *\n * @param size - The desired size of the row.\n */\n DataGrid.prototype.resizeRow = function (region, index, size) {\n var msg = new Private.RowResizeRequest(region, index, size);\n messaging.MessageLoop.postMessage(this._viewport, msg);\n };\n /**\n * Resize a column in the data grid.\n *\n * @param region - The region which holds the column of interest.\n *\n * @param index - The index of the column of interest.\n *\n * @param size - The desired size of the column.\n */\n DataGrid.prototype.resizeColumn = function (region, index, size) {\n var msg = new Private.ColumnResizeRequest(region, index, size);\n messaging.MessageLoop.postMessage(this._viewport, msg);\n };\n /**\n * Reset modified rows to their default size.\n *\n * @param region - The row region of interest.\n */\n DataGrid.prototype.resetRows = function (region) {\n switch (region) {\n case 'all':\n this._rowSections.reset();\n this._columnHeaderSections.reset();\n break;\n case 'body':\n this._rowSections.reset();\n break;\n case 'column-header':\n this._columnHeaderSections.reset();\n break;\n default:\n throw 'unreachable';\n }\n this.repaintContent();\n this.repaintOverlay();\n };\n /**\n * Reset modified columns to their default size.\n *\n * @param region - The column region of interest.\n */\n DataGrid.prototype.resetColumns = function (region) {\n switch (region) {\n case 'all':\n this._columnSections.reset();\n this._rowHeaderSections.reset();\n break;\n case 'body':\n this._columnSections.reset();\n break;\n case 'row-header':\n this._rowHeaderSections.reset();\n break;\n default:\n throw 'unreachable';\n }\n this.repaintContent();\n this.repaintOverlay();\n };\n /**\n * Map a client position to local viewport coordinates.\n *\n * @param clientX - The client X position of the mouse.\n *\n * @param clientY - The client Y position of the mouse.\n *\n * @returns The local viewport coordinates for the position.\n */\n DataGrid.prototype.mapToLocal = function (clientX, clientY) {\n // Fetch the viewport rect.\n var rect = this._viewport.node.getBoundingClientRect();\n // Extract the rect coordinates.\n var left = rect.left, top = rect.top;\n // Round the rect coordinates for sub-pixel positioning.\n left = Math.floor(left);\n top = Math.floor(top);\n // Convert to local coordinates.\n var lx = clientX - left;\n var ly = clientY - top;\n // Return the local coordinates.\n return { lx: lx, ly: ly };\n };\n /**\n * Map a client position to virtual grid coordinates.\n *\n * @param clientX - The client X position of the mouse.\n *\n * @param clientY - The client Y position of the mouse.\n *\n * @returns The virtual grid coordinates for the position.\n */\n DataGrid.prototype.mapToVirtual = function (clientX, clientY) {\n // Convert to local coordiates.\n var _a = this.mapToLocal(clientX, clientY), lx = _a.lx, ly = _a.ly;\n // Convert to virtual coordinates.\n var vx = lx + this.scrollX - this.headerWidth;\n var vy = ly + this.scrollY - this.headerHeight;\n // Return the local coordinates.\n return { vx: vx, vy: vy };\n };\n /**\n * Hit test the viewport for the given client position.\n *\n * @param clientX - The client X position of the mouse.\n *\n * @param clientY - The client Y position of the mouse.\n *\n * @returns The hit test result, or `null` if the client\n * position is out of bounds.\n *\n * #### Notes\n * This method accounts for a stretched last row and/or column.\n */\n DataGrid.prototype.hitTest = function (clientX, clientY) {\n // Convert the mouse position into local coordinates.\n var _a = this.mapToLocal(clientX, clientY), lx = _a.lx, ly = _a.ly;\n // Fetch the header and body dimensions.\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n var pw = this.pageWidth;\n // Adjust the body width for a stretched last column.\n if (this._stretchLastColumn && pw > bw) {\n bw = pw;\n }\n // Adjust the body height for a stretched last row.\n if (this._stretchLastRow && ph > bh) {\n bh = ph;\n }\n // Check for a corner header hit.\n if (lx >= 0 && lx < hw && ly >= 0 && ly < hh) {\n // Convert to unscrolled virtual coordinates.\n var vx = lx;\n var vy = ly;\n // Fetch the row and column index.\n var row_1 = this.rowAt('column-header', vy);\n var column_1 = this.columnAt('row-header', vx);\n // Fetch the cell offset position.\n var ox = this.columnOffset('row-header', column_1);\n var oy = this.rowOffset('column-header', row_1);\n // Fetch cell width and height.\n var width_1 = this.columnSize('row-header', column_1);\n var height_1 = this.rowSize('column-header', row_1);\n // Compute the leading and trailing positions.\n var x_1 = vx - ox;\n var y_1 = vy - oy;\n // Return the hit test result.\n return { region: 'corner-header', row: row_1, column: column_1, x: x_1, y: y_1, width: width_1, height: height_1 };\n }\n // Check for a column header hit.\n if (ly >= 0 && ly < hh && lx >= 0 && lx < (hw + bw)) {\n // Convert to unscrolled virtual coordinates.\n var vx = lx + this._scrollX - hw;\n var vy = ly;\n // Fetch the row and column index.\n var row_2 = this.rowAt('column-header', vy);\n var column_2 = this.columnAt('body', vx);\n // Fetch the cell offset position.\n var ox = this.columnOffset('body', column_2);\n var oy = this.rowOffset('column-header', row_2);\n // Fetch the cell width and height.\n var width_2 = this.columnSize('body', column_2);\n var height_2 = this.rowSize('column-header', row_2);\n // Compute the leading and trailing positions.\n var x_2 = vx - ox;\n var y_2 = vy - oy;\n // Return the hit test result.\n return { region: 'column-header', row: row_2, column: column_2, x: x_2, y: y_2, width: width_2, height: height_2 };\n }\n // Check for a row header hit.\n if (lx >= 0 && lx < hw && ly >= 0 && ly < (hh + bh)) {\n // Convert to unscrolled virtual coordinates.\n var vx = lx;\n var vy = ly + this._scrollY - hh;\n // Fetch the row and column index.\n var row_3 = this.rowAt('body', vy);\n var column_3 = this.columnAt('row-header', vx);\n // Fetch the cell offset position.\n var ox = this.columnOffset('row-header', column_3);\n var oy = this.rowOffset('body', row_3);\n // Fetch the cell width and height.\n var width_3 = this.columnSize('row-header', column_3);\n var height_3 = this.rowSize('body', row_3);\n // Compute the leading and trailing positions.\n var x_3 = vx - ox;\n var y_3 = vy - oy;\n // Return the hit test result.\n return { region: 'row-header', row: row_3, column: column_3, x: x_3, y: y_3, width: width_3, height: height_3 };\n }\n // Check for a body hit.\n if (lx >= hw && lx < (hw + bw) && ly >= hh && ly < (hh + bh)) {\n // Convert to unscrolled virtual coordinates.\n var vx = lx + this._scrollX - hw;\n var vy = ly + this._scrollY - hh;\n // Fetch the row and column index.\n var row_4 = this.rowAt('body', vy);\n var column_4 = this.columnAt('body', vx);\n // Fetch the cell offset position.\n var ox = this.columnOffset('body', column_4);\n var oy = this.rowOffset('body', row_4);\n // Fetch the cell width and height.\n var width_4 = this.columnSize('body', column_4);\n var height_4 = this.rowSize('body', row_4);\n // Compute the part coordinates.\n var x_4 = vx - ox;\n var y_4 = vy - oy;\n // Return the result.\n return { region: 'body', row: row_4, column: column_4, x: x_4, y: y_4, width: width_4, height: height_4 };\n }\n // Otherwise, it's a void space hit.\n var row = -1;\n var column = -1;\n var x = -1;\n var y = -1;\n var width = -1;\n var height = -1;\n // Return the hit test result.\n return { region: 'void', row: row, column: column, x: x, y: y, width: width, height: height };\n };\n /**\n * Copy the current selection to the system clipboard.\n *\n * #### Notes\n * The grid must have a data model and a selection model.\n *\n * The behavior can be configured via `DataGrid.copyConfig`.\n */\n DataGrid.prototype.copyToClipboard = function () {\n var _a, _b;\n // Fetch the data model.\n var dataModel = this._dataModel;\n // Bail early if there is no data model.\n if (!dataModel) {\n return;\n }\n // Fetch the selection model.\n var selectionModel = this._selectionModel;\n // Bail early if there is no selection model.\n if (!selectionModel) {\n return;\n }\n // Coerce the selections to an array.\n var selections = algorithm.toArray(selectionModel.selections());\n // Bail early if there are no selections.\n if (selections.length === 0) {\n return;\n }\n // Alert that multiple selections cannot be copied.\n if (selections.length > 1) {\n alert('Cannot copy multiple grid selections.');\n return;\n }\n // Fetch the model counts.\n var br = dataModel.rowCount('body');\n var bc = dataModel.columnCount('body');\n // Bail early if there is nothing to copy.\n if (br === 0 || bc === 0) {\n return;\n }\n // Unpack the selection.\n var _c = selections[0], r1 = _c.r1, c1 = _c.c1, r2 = _c.r2, c2 = _c.c2;\n // Clamp the selection to the model bounds.\n r1 = Math.max(0, Math.min(r1, br - 1));\n c1 = Math.max(0, Math.min(c1, bc - 1));\n r2 = Math.max(0, Math.min(r2, br - 1));\n c2 = Math.max(0, Math.min(c2, bc - 1));\n // Ensure the limits are well-orderd.\n if (r2 < r1)\n _a = [r2, r1], r1 = _a[0], r2 = _a[1];\n if (c2 < c1)\n _b = [c2, c1], c1 = _b[0], c2 = _b[1];\n // Fetch the header counts.\n var rhc = dataModel.columnCount('row-header');\n var chr = dataModel.rowCount('column-header');\n // Unpack the copy config.\n var separator = this._copyConfig.separator;\n var format = this._copyConfig.format;\n var headers = this._copyConfig.headers;\n var warningThreshold = this._copyConfig.warningThreshold;\n // Compute the number of cells to be copied.\n var rowCount = r2 - r1 + 1;\n var colCount = c2 - c1 + 1;\n switch (headers) {\n case 'none':\n rhc = 0;\n chr = 0;\n break;\n case 'row':\n chr = 0;\n colCount += rhc;\n break;\n case 'column':\n rhc = 0;\n rowCount += chr;\n break;\n case 'all':\n rowCount += chr;\n colCount += rhc;\n break;\n default:\n throw 'unreachable';\n }\n // Compute the total cell count.\n var cellCount = rowCount * colCount;\n // Allow the user to cancel a large copy request.\n if (cellCount > warningThreshold) {\n var msg = \"Copying \" + cellCount + \" cells may take a while. Continue?\";\n if (!window.confirm(msg)) {\n return;\n }\n }\n // Set up the format args.\n var args = {\n region: 'body',\n row: 0,\n column: 0,\n value: null,\n metadata: {}\n };\n // Allocate the array of rows.\n var rows = new Array(rowCount);\n // Iterate over the rows.\n for (var j = 0; j < rowCount; ++j) {\n // Allocate the array of cells.\n var cells = new Array(colCount);\n // Iterate over the columns.\n for (var i = 0; i < colCount; ++i) {\n // Set up the format variables.\n var region = void 0;\n var row = void 0;\n var column = void 0;\n // Populate the format variables.\n if (j < chr && i < rhc) {\n region = 'corner-header';\n row = j;\n column = i;\n }\n else if (j < chr) {\n region = 'column-header';\n row = j;\n column = i - rhc + c1;\n }\n else if (i < rhc) {\n region = 'row-header';\n row = j - chr + r1;\n column = i;\n }\n else {\n region = 'body';\n row = j - chr + r1;\n column = i - rhc + c1;\n }\n // Populate the format args.\n args.region = region;\n args.row = row;\n args.column = column;\n args.value = dataModel.data(region, row, column);\n args.metadata = dataModel.metadata(region, row, column);\n // Format the cell.\n cells[i] = format(args);\n }\n // Save the row of cells.\n rows[j] = cells;\n }\n // Convert the cells into lines.\n var lines = rows.map(function (cells) { return cells.join(separator); });\n // Convert the lines into text.\n var text = lines.join('\\n');\n // Copy the text to the clipboard.\n domutils.ClipboardExt.copyText(text);\n };\n /**\n * Process a message sent to the widget.\n *\n * @param msg - The message sent to the widget.\n */\n DataGrid.prototype.processMessage = function (msg) {\n // Ignore child show/hide messages. The data grid controls the\n // visibility of its children, and will manually dispatch the\n // fit-request messages as a result of visibility change.\n if (msg.type === 'child-shown' || msg.type === 'child-hidden') {\n return;\n }\n // Recompute the scroll bar minimums before the layout refits.\n if (msg.type === 'fit-request') {\n var vsbLimits = domutils.ElementExt.sizeLimits(this._vScrollBar.node);\n var hsbLimits = domutils.ElementExt.sizeLimits(this._hScrollBar.node);\n this._vScrollBarMinWidth = vsbLimits.minWidth;\n this._hScrollBarMinHeight = hsbLimits.minHeight;\n }\n // Process all other messages as normal.\n _super.prototype.processMessage.call(this, msg);\n };\n /**\n * Intercept a message sent to a message handler.\n *\n * @param handler - The target handler of the message.\n *\n * @param msg - The message to be sent to the handler.\n *\n * @returns `true` if the message should continue to be processed\n * as normal, or `false` if processing should cease immediately.\n */\n DataGrid.prototype.messageHook = function (handler, msg) {\n // Process viewport messages.\n if (handler === this._viewport) {\n this._processViewportMessage(msg);\n return true;\n }\n // Process horizontal scroll bar messages.\n if (handler === this._hScrollBar && msg.type === 'activate-request') {\n this.activate();\n return false;\n }\n // Process vertical scroll bar messages.\n if (handler === this._vScrollBar && msg.type === 'activate-request') {\n this.activate();\n return false;\n }\n // Ignore all other messages.\n return true;\n };\n /**\n * Handle the DOM events for the data grid.\n *\n * @param event - The DOM event sent to the data grid.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the data grid's DOM node. It\n * should not be called directly by user code.\n */\n DataGrid.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'dblclick':\n this._evtMouseDoubleClick(event);\n break;\n case 'mouseleave':\n this._evtMouseLeave(event);\n break;\n case 'contextmenu':\n this._evtContextMenu(event);\n break;\n case 'wheel':\n this._evtWheel(event);\n break;\n case 'resize':\n this._refreshDPI();\n break;\n }\n };\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n DataGrid.prototype.onActivateRequest = function (msg) {\n this.viewport.node.focus();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n DataGrid.prototype.onBeforeAttach = function (msg) {\n window.addEventListener('resize', this);\n this.node.addEventListener('wheel', this);\n this._viewport.node.addEventListener('keydown', this);\n this._viewport.node.addEventListener('mousedown', this);\n this._viewport.node.addEventListener('mousemove', this);\n this._viewport.node.addEventListener('dblclick', this);\n this._viewport.node.addEventListener('mouseleave', this);\n this._viewport.node.addEventListener('contextmenu', this);\n this.repaintContent();\n this.repaintOverlay();\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n DataGrid.prototype.onAfterDetach = function (msg) {\n window.removeEventListener('resize', this);\n this.node.removeEventListener('wheel', this);\n this._viewport.node.removeEventListener('keydown', this);\n this._viewport.node.removeEventListener('mousedown', this);\n this._viewport.node.removeEventListener('mousemove', this);\n this._viewport.node.removeEventListener('mouseleave', this);\n this._viewport.node.removeEventListener('dblclick', this);\n this._viewport.node.removeEventListener('contextmenu', this);\n this._releaseMouse();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n DataGrid.prototype.onBeforeShow = function (msg) {\n this.repaintContent();\n this.repaintOverlay();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n DataGrid.prototype.onResize = function (msg) {\n if (this._editorController) {\n this._editorController.cancel();\n }\n this._syncScrollState();\n };\n /**\n * Schedule a repaint of all of the grid content.\n */\n DataGrid.prototype.repaintContent = function () {\n var msg = new Private.PaintRequest('all', 0, 0, 0, 0);\n messaging.MessageLoop.postMessage(this._viewport, msg);\n };\n /**\n * Schedule a repaint of specific grid content.\n */\n DataGrid.prototype._repaintRegion = function (region, r1, c1, r2, c2) {\n var msg = new Private.PaintRequest(region, r1, c1, r2, c2);\n messaging.MessageLoop.postMessage(this._viewport, msg);\n };\n /**\n * Schedule a repaint of the overlay.\n */\n DataGrid.prototype.repaintOverlay = function () {\n messaging.MessageLoop.postMessage(this._viewport, Private.OverlayPaintRequest);\n };\n /**\n * Ensure the canvas is at least the specified size.\n *\n * This method will retain the valid canvas content.\n */\n DataGrid.prototype._resizeCanvasIfNeeded = function (width, height) {\n // Scale the size by the dpi ratio.\n width = width * this._dpiRatio;\n height = height * this._dpiRatio;\n // Compute the maximum canvas size for the given width and height.\n var maxW = (Math.ceil((width + 1) / 512) + 1) * 512;\n var maxH = (Math.ceil((height + 1) / 512) + 1) * 512;\n // Get the current size of the canvas.\n var curW = this._canvas.width;\n var curH = this._canvas.height;\n // Bail early if the canvas size is within bounds.\n if (curW >= width && curH >= height && curW <= maxW && curH <= maxH) {\n return;\n }\n // Compute the expanded canvas size.\n var expW = maxW - 512;\n var expH = maxH - 512;\n // Set the transforms to the identity matrix.\n this._canvasGC.setTransform(1, 0, 0, 1, 0, 0);\n this._bufferGC.setTransform(1, 0, 0, 1, 0, 0);\n this._overlayGC.setTransform(1, 0, 0, 1, 0, 0);\n // Resize the buffer if needed.\n if (curW < width) {\n this._buffer.width = expW;\n }\n else if (curW > maxW) {\n this._buffer.width = maxW;\n }\n // Resize the buffer height if needed.\n if (curH < height) {\n this._buffer.height = expH;\n }\n else if (curH > maxH) {\n this._buffer.height = maxH;\n }\n // Test whether there is content to blit.\n var needBlit = curH > 0 && curH > 0 && width > 0 && height > 0;\n // Copy the valid canvas content into the buffer if needed.\n if (needBlit) {\n this._bufferGC.drawImage(this._canvas, 0, 0);\n }\n // Resize the canvas width if needed.\n if (curW < width) {\n this._canvas.width = expW;\n this._canvas.style.width = expW / this._dpiRatio + \"px\";\n }\n else if (curW > maxW) {\n this._canvas.width = maxW;\n this._canvas.style.width = maxW / this._dpiRatio + \"px\";\n }\n // Resize the canvas height if needed.\n if (curH < height) {\n this._canvas.height = expH;\n this._canvas.style.height = expH / this._dpiRatio + \"px\";\n }\n else if (curH > maxH) {\n this._canvas.height = maxH;\n this._canvas.style.height = maxH / this._dpiRatio + \"px\";\n }\n // Copy the valid canvas content from the buffer if needed.\n if (needBlit) {\n this._canvasGC.drawImage(this._buffer, 0, 0);\n }\n // Copy the valid overlay content into the buffer if needed.\n if (needBlit) {\n this._bufferGC.drawImage(this._overlay, 0, 0);\n }\n // Resize the overlay width if needed.\n if (curW < width) {\n this._overlay.width = expW;\n this._overlay.style.width = expW / this._dpiRatio + \"px\";\n }\n else if (curW > maxW) {\n this._overlay.width = maxW;\n this._overlay.style.width = maxW / this._dpiRatio + \"px\";\n }\n // Resize the overlay height if needed.\n if (curH < height) {\n this._overlay.height = expH;\n this._overlay.style.height = expH / this._dpiRatio + \"px\";\n }\n else if (curH > maxH) {\n this._overlay.height = maxH;\n this._overlay.style.height = maxH / this._dpiRatio + \"px\";\n }\n // Copy the valid overlay content from the buffer if needed.\n if (needBlit) {\n this._overlayGC.drawImage(this._buffer, 0, 0);\n }\n };\n /**\n * Sync the scroll bars and scroll state with the viewport.\n *\n * #### Notes\n * If the visibility of either scroll bar changes, a synchronous\n * fit-request will be dispatched to the data grid to immediately\n * resize the viewport.\n */\n DataGrid.prototype._syncScrollState = function () {\n // Fetch the viewport dimensions.\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n var pw = this.pageWidth;\n var ph = this.pageHeight;\n // Get the current scroll bar visibility.\n var hasVScroll = !this._vScrollBar.isHidden;\n var hasHScroll = !this._hScrollBar.isHidden;\n // Get the minimum sizes of the scroll bars.\n var vsw = this._vScrollBarMinWidth;\n var hsh = this._hScrollBarMinHeight;\n // Get the page size as if no scroll bars are visible.\n var apw = pw + (hasVScroll ? vsw : 0);\n var aph = ph + (hasHScroll ? hsh : 0);\n // Test whether scroll bars are needed for the adjusted size.\n var needVScroll = aph < bh - 1;\n var needHScroll = apw < bw - 1;\n // Re-test the horizontal scroll if a vertical scroll is needed.\n if (needVScroll && !needHScroll) {\n needHScroll = (apw - vsw) < bw - 1;\n }\n // Re-test the vertical scroll if a horizontal scroll is needed.\n if (needHScroll && !needVScroll) {\n needVScroll = (aph - hsh) < bh - 1;\n }\n // If the visibility changes, immediately refit the grid.\n if (needVScroll !== hasVScroll || needHScroll !== hasHScroll) {\n this._vScrollBar.setHidden(!needVScroll);\n this._hScrollBar.setHidden(!needHScroll);\n this._scrollCorner.setHidden(!needVScroll || !needHScroll);\n messaging.MessageLoop.sendMessage(this, widgets.Widget.Msg.FitRequest);\n }\n // Update the scroll bar limits.\n this._vScrollBar.maximum = this.maxScrollY;\n this._vScrollBar.page = this.pageHeight;\n this._hScrollBar.maximum = this.maxScrollX;\n this._hScrollBar.page = this.pageWidth;\n // Re-clamp the scroll position.\n this._scrollTo(this._scrollX, this._scrollY);\n };\n /**\n * Sync the viewport to the given scroll position.\n *\n * #### Notes\n * This schedules a full repaint and syncs the scroll state.\n */\n DataGrid.prototype._syncViewport = function () {\n this.repaintContent();\n this.repaintOverlay();\n this._syncScrollState();\n };\n /**\n * Process a message sent to the viewport\n */\n DataGrid.prototype._processViewportMessage = function (msg) {\n switch (msg.type) {\n case 'resize':\n this._onViewportResize(msg);\n break;\n case 'scroll-request':\n this._onViewportScrollRequest(msg);\n break;\n case 'paint-request':\n this._onViewportPaintRequest(msg);\n break;\n case 'overlay-paint-request':\n this._onViewportOverlayPaintRequest(msg);\n break;\n case 'row-resize-request':\n this._onViewportRowResizeRequest(msg);\n break;\n case 'column-resize-request':\n this._onViewportColumnResizeRequest(msg);\n break;\n }\n };\n /**\n * A message hook invoked on a viewport `'resize'` message.\n */\n DataGrid.prototype._onViewportResize = function (msg) {\n // Bail early if the viewport is not visible.\n if (!this._viewport.isVisible) {\n return;\n }\n // Unpack the message data.\n var width = msg.width, height = msg.height;\n // Measure the viewport node if the dimensions are unknown.\n if (width === -1) {\n width = this._viewport.node.offsetWidth;\n }\n if (height === -1) {\n height = this._viewport.node.offsetHeight;\n }\n // Round the dimensions to the nearest pixel.\n width = Math.round(width);\n height = Math.round(height);\n // Get the current size of the viewport.\n var oldWidth = this._viewportWidth;\n var oldHeight = this._viewportHeight;\n // Updated internal viewport size.\n this._viewportWidth = width;\n this._viewportHeight = height;\n // Resize the canvas if needed.\n this._resizeCanvasIfNeeded(width, height);\n // Bail early if there is nothing to paint.\n if (width === 0 || height === 0) {\n return;\n }\n // Paint the whole grid if the old size was zero.\n if (oldWidth === 0 || oldHeight === 0) {\n this.paintContent(0, 0, width, height);\n this._paintOverlay();\n return;\n }\n // Paint the right edge as needed.\n if (this._stretchLastColumn && this.pageWidth > this.bodyWidth) {\n var bx = this._columnSections.offsetOf(this._columnSections.count - 1);\n var x = Math.min(this.headerWidth + bx, oldWidth);\n this.paintContent(x, 0, width - x, height);\n }\n else if (width > oldWidth) {\n this.paintContent(oldWidth, 0, width - oldWidth, height);\n }\n // Paint the bottom edge as needed.\n if (this._stretchLastRow && this.pageHeight > this.bodyHeight) {\n var by = this._rowSections.offsetOf(this._rowSections.count - 1);\n var y = Math.min(this.headerHeight + by, oldHeight);\n this.paintContent(0, y, width, height - y);\n }\n else if (height > oldHeight) {\n this.paintContent(0, oldHeight, width, height - oldHeight);\n }\n // Paint the overlay.\n this._paintOverlay();\n };\n /**\n * A message hook invoked on a viewport `'scroll-request'` message.\n */\n DataGrid.prototype._onViewportScrollRequest = function (msg) {\n this._scrollTo(this._hScrollBar.value, this._vScrollBar.value);\n };\n /**\n * A message hook invoked on a viewport `'paint-request'` message.\n */\n DataGrid.prototype._onViewportPaintRequest = function (msg) {\n // Bail early if the viewport is not visible.\n if (!this._viewport.isVisible) {\n return;\n }\n // Bail early if the viewport has zero area.\n if (this._viewportWidth === 0 || this._viewportHeight === 0) {\n return;\n }\n // Set up the paint limits.\n var xMin = 0;\n var yMin = 0;\n var xMax = this._viewportWidth - 1;\n var yMax = this._viewportHeight - 1;\n // Fetch the scroll position.\n var sx = this._scrollX;\n var sy = this._scrollY;\n // Fetch the header dimensions.\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n // Fetch the section lists.\n var rs = this._rowSections;\n var cs = this._columnSections;\n var rhs = this._rowHeaderSections;\n var chs = this._columnHeaderSections;\n // Unpack the message data.\n var region = msg.region, r1 = msg.r1, c1 = msg.c1, r2 = msg.r2, c2 = msg.c2;\n // Set up the paint variables.\n var x1;\n var y1;\n var x2;\n var y2;\n // Fill the paint variables based on the paint region.\n switch (region) {\n case 'all':\n x1 = xMin;\n y1 = yMin;\n x2 = xMax;\n y2 = yMax;\n break;\n case 'body':\n r1 = Math.max(0, Math.min(r1, rs.count));\n c1 = Math.max(0, Math.min(c1, cs.count));\n r2 = Math.max(0, Math.min(r2, rs.count));\n c2 = Math.max(0, Math.min(c2, cs.count));\n x1 = cs.offsetOf(c1) - sx + hw;\n y1 = rs.offsetOf(r1) - sy + hh;\n x2 = cs.extentOf(c2) - sx + hw;\n y2 = rs.extentOf(r2) - sy + hh;\n break;\n case 'row-header':\n r1 = Math.max(0, Math.min(r1, rs.count));\n c1 = Math.max(0, Math.min(c1, rhs.count));\n r2 = Math.max(0, Math.min(r2, rs.count));\n c2 = Math.max(0, Math.min(c2, rhs.count));\n x1 = rhs.offsetOf(c1);\n y1 = rs.offsetOf(r1) - sy + hh;\n x2 = rhs.extentOf(c2);\n y2 = rs.extentOf(r2) - sy + hh;\n break;\n case 'column-header':\n r1 = Math.max(0, Math.min(r1, chs.count));\n c1 = Math.max(0, Math.min(c1, cs.count));\n r2 = Math.max(0, Math.min(r2, chs.count));\n c2 = Math.max(0, Math.min(c2, cs.count));\n x1 = cs.offsetOf(c1) - sx + hw;\n y1 = chs.offsetOf(r1);\n x2 = cs.extentOf(c2) - sx + hw;\n y2 = chs.extentOf(r2);\n break;\n case 'corner-header':\n r1 = Math.max(0, Math.min(r1, chs.count));\n c1 = Math.max(0, Math.min(c1, rhs.count));\n r2 = Math.max(0, Math.min(r2, chs.count));\n c2 = Math.max(0, Math.min(c2, rhs.count));\n x1 = rhs.offsetOf(c1);\n y1 = chs.offsetOf(r1);\n x2 = rhs.extentOf(c2);\n y2 = chs.extentOf(r2);\n break;\n default:\n throw 'unreachable';\n }\n // Bail early if the dirty rect is outside the bounds.\n if (x2 < xMin || y2 < yMin || x1 > xMax || y1 > yMax) {\n return;\n }\n // Clamp the dirty rect to the paint bounds.\n x1 = Math.max(xMin, Math.min(x1, xMax));\n y1 = Math.max(yMin, Math.min(y1, yMax));\n x2 = Math.max(xMin, Math.min(x2, xMax));\n y2 = Math.max(yMin, Math.min(y2, yMax));\n // Paint the content of the dirty rect.\n this.paintContent(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n };\n /**\n * A message hook invoked on a viewport `'overlay-paint-request'` message.\n */\n DataGrid.prototype._onViewportOverlayPaintRequest = function (msg) {\n // Bail early if the viewport is not visible.\n if (!this._viewport.isVisible) {\n return;\n }\n // Bail early if the viewport has zero area.\n if (this._viewportWidth === 0 || this._viewportHeight === 0) {\n return;\n }\n // Paint the content of the overlay.\n this._paintOverlay();\n };\n /**\n * A message hook invoked on a viewport `'row-resize-request'` message.\n */\n DataGrid.prototype._onViewportRowResizeRequest = function (msg) {\n if (msg.region === 'body') {\n this._resizeRow(msg.index, msg.size);\n }\n else {\n this._resizeColumnHeader(msg.index, msg.size);\n }\n };\n /**\n * A message hook invoked on a viewport `'column-resize-request'` message.\n */\n DataGrid.prototype._onViewportColumnResizeRequest = function (msg) {\n if (msg.region === 'body') {\n this._resizeColumn(msg.index, msg.size);\n }\n else {\n this._resizeRowHeader(msg.index, msg.size);\n }\n };\n /**\n * Handle the `thumbMoved` signal from a scroll bar.\n */\n DataGrid.prototype._onThumbMoved = function (sender) {\n messaging.MessageLoop.postMessage(this._viewport, Private.ScrollRequest);\n };\n /**\n * Handle the `pageRequested` signal from a scroll bar.\n */\n DataGrid.prototype._onPageRequested = function (sender, dir) {\n if (sender === this._vScrollBar) {\n this.scrollByPage(dir === 'decrement' ? 'up' : 'down');\n }\n else {\n this.scrollByPage(dir === 'decrement' ? 'left' : 'right');\n }\n };\n /**\n * Handle the `stepRequested` signal from a scroll bar.\n */\n DataGrid.prototype._onStepRequested = function (sender, dir) {\n if (sender === this._vScrollBar) {\n this.scrollByStep(dir === 'decrement' ? 'up' : 'down');\n }\n else {\n this.scrollByStep(dir === 'decrement' ? 'left' : 'right');\n }\n };\n /**\n * A signal handler for the data model `changed` signal.\n */\n DataGrid.prototype._onDataModelChanged = function (sender, args) {\n switch (args.type) {\n case 'rows-inserted':\n this._onRowsInserted(args);\n break;\n case 'columns-inserted':\n this._onColumnsInserted(args);\n break;\n case 'rows-removed':\n this._onRowsRemoved(args);\n break;\n case 'columns-removed':\n this._onColumnsRemoved(args);\n break;\n case 'rows-moved':\n this._onRowsMoved(args);\n break;\n case 'columns-moved':\n this._onColumnsMoved(args);\n break;\n case 'cells-changed':\n this._onCellsChanged(args);\n break;\n case 'model-reset':\n this._onModelReset(args);\n break;\n default:\n throw 'unreachable';\n }\n };\n /**\n * A signal handler for the selection model `changed` signal.\n */\n DataGrid.prototype._onSelectionsChanged = function (sender) {\n this.repaintOverlay();\n };\n /**\n * Handle rows being inserted in the data model.\n */\n DataGrid.prototype._onRowsInserted = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span;\n // Bail early if there are no sections to insert.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._rowSections;\n }\n else {\n list = this._columnHeaderSections;\n }\n // Insert the span, maintaining the scroll position as needed.\n if (this._scrollY === this.maxScrollY && this.maxScrollY > 0) {\n list.insert(index, span);\n this._scrollY = this.maxScrollY;\n }\n else {\n list.insert(index, span);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle columns being inserted into the data model.\n */\n DataGrid.prototype._onColumnsInserted = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span;\n // Bail early if there are no sections to insert.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._columnSections;\n }\n else {\n list = this._rowHeaderSections;\n }\n // Insert the span, maintaining the scroll position as needed.\n if (this._scrollX === this.maxScrollX && this.maxScrollX > 0) {\n list.insert(index, span);\n this._scrollX = this.maxScrollX;\n }\n else {\n list.insert(index, span);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle rows being removed from the data model.\n */\n DataGrid.prototype._onRowsRemoved = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span;\n // Bail early if there are no sections to remove.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._rowSections;\n }\n else {\n list = this._columnHeaderSections;\n }\n // Bail if the index or is invalid\n if (index < 0 || index >= list.count) {\n return;\n }\n // Remove the span, maintaining the scroll position as needed.\n if (this._scrollY === this.maxScrollY && this.maxScrollY > 0) {\n list.remove(index, span);\n this._scrollY = this.maxScrollY;\n }\n else {\n list.remove(index, span);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle columns being removed from the data model.\n */\n DataGrid.prototype._onColumnsRemoved = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span;\n // Bail early if there are no sections to remove.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._columnSections;\n }\n else {\n list = this._rowHeaderSections;\n }\n // Bail if the index or is invalid\n if (index < 0 || index >= list.count) {\n return;\n }\n // Remove the span, maintaining the scroll position as needed.\n if (this._scrollX === this.maxScrollX && this.maxScrollX > 0) {\n list.remove(index, span);\n this._scrollX = this.maxScrollX;\n }\n else {\n list.remove(index, span);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle rows moving in the data model.\n */\n DataGrid.prototype._onRowsMoved = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span, destination = args.destination;\n // Bail early if there are no sections to move.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._rowSections;\n }\n else {\n list = this._columnHeaderSections;\n }\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Clamp the move span to the limit.\n span = Math.min(span, list.count - index);\n // Clamp the destination index to the limit.\n destination = Math.min(Math.max(0, destination), list.count - span);\n // Bail early if there is no effective move.\n if (index === destination) {\n return;\n }\n // Compute the first affected index.\n var r1 = Math.min(index, destination);\n // Compute the last affected index.\n var r2 = Math.max(index + span - 1, destination + span - 1);\n // Move the sections in the list.\n list.move(index, span, destination);\n // Schedule a repaint of the dirty cells.\n if (region === 'body') {\n this._repaintRegion('body', r1, 0, r2, Infinity);\n this._repaintRegion('row-header', r1, 0, r2, Infinity);\n }\n else {\n this._repaintRegion('column-header', r1, 0, r2, Infinity);\n this._repaintRegion('corner-header', r1, 0, r2, Infinity);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle columns moving in the data model.\n */\n DataGrid.prototype._onColumnsMoved = function (args) {\n // Unpack the arg data.\n var region = args.region, index = args.index, span = args.span, destination = args.destination;\n // Bail early if there are no sections to move.\n if (span <= 0) {\n return;\n }\n // Look up the relevant section list.\n var list;\n if (region === 'body') {\n list = this._columnSections;\n }\n else {\n list = this._rowHeaderSections;\n }\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Clamp the move span to the limit.\n span = Math.min(span, list.count - index);\n // Clamp the destination index to the limit.\n destination = Math.min(Math.max(0, destination), list.count - span);\n // Bail early if there is no effective move.\n if (index === destination) {\n return;\n }\n // Move the sections in the list.\n list.move(index, span, destination);\n // Compute the first affected index.\n var c1 = Math.min(index, destination);\n // Compute the last affected index.\n var c2 = Math.max(index + span - 1, destination + span - 1);\n // Schedule a repaint of the dirty cells.\n if (region === 'body') {\n this._repaintRegion('body', 0, c1, Infinity, c2);\n this._repaintRegion('column-header', 0, c1, Infinity, c2);\n }\n else {\n this._repaintRegion('row-header', 0, c1, Infinity, c2);\n this._repaintRegion('corner-header', 0, c1, Infinity, c2);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * Handle cells changing in the data model.\n */\n DataGrid.prototype._onCellsChanged = function (args) {\n // Unpack the arg data.\n var region = args.region, row = args.row, column = args.column, rowSpan = args.rowSpan, columnSpan = args.columnSpan;\n // Bail early if there are no cells to modify.\n if (rowSpan <= 0 && columnSpan <= 0) {\n return;\n }\n // Compute the changed cell bounds.\n var r1 = row;\n var c1 = column;\n var r2 = r1 + rowSpan - 1;\n var c2 = c1 + columnSpan - 1;\n // Schedule a repaint of the cell content.\n this._repaintRegion(region, r1, c1, r2, c2);\n };\n /**\n * Handle a full data model reset.\n */\n DataGrid.prototype._onModelReset = function (args) {\n // Look up the various current section counts.\n var nr = this._rowSections.count;\n var nc = this._columnSections.count;\n var nrh = this._rowHeaderSections.count;\n var nch = this._columnHeaderSections.count;\n // Compute the delta count for each region.\n var dr = this._dataModel.rowCount('body') - nr;\n var dc = this._dataModel.columnCount('body') - nc;\n var drh = this._dataModel.columnCount('row-header') - nrh;\n var dch = this._dataModel.rowCount('column-header') - nch;\n // Update the row sections, if needed.\n if (dr > 0) {\n this._rowSections.insert(nr, dr);\n }\n else if (dr < 0) {\n this._rowSections.remove(nr + dr, -dr);\n }\n // Update the column sections, if needed.\n if (dc > 0) {\n this._columnSections.insert(nc, dc);\n }\n else if (dc < 0) {\n this._columnSections.remove(nc + dc, -dc);\n }\n // Update the row header sections, if needed.\n if (drh > 0) {\n this._rowHeaderSections.insert(nrh, drh);\n }\n else if (drh < 0) {\n this._rowHeaderSections.remove(nrh + drh, -drh);\n }\n // Update the column header sections, if needed.\n if (dch > 0) {\n this._columnHeaderSections.insert(nch, dch);\n }\n else if (dch < 0) {\n this._columnHeaderSections.remove(nch + dch, -dch);\n }\n // Sync the viewport.\n this._syncViewport();\n };\n /**\n * A signal handler for the renderer map `changed` signal.\n */\n DataGrid.prototype._onRenderersChanged = function () {\n this.repaintContent();\n };\n /**\n * Handle the `'keydown'` event for the data grid.\n */\n DataGrid.prototype._evtKeyDown = function (event) {\n if (this._mousedown) {\n event.preventDefault();\n event.stopPropagation();\n }\n else if (this._keyHandler) {\n this._keyHandler.onKeyDown(this, event);\n }\n };\n /**\n * Handle the `'mousedown'` event for the data grid.\n */\n DataGrid.prototype._evtMouseDown = function (event) {\n // Ignore everything except the left mouse button.\n if (event.button !== 0) {\n return;\n }\n // Activate the grid.\n this.activate();\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Add the extra document listeners.\n document.addEventListener('keydown', this, true);\n document.addEventListener('mouseup', this, true);\n document.addEventListener('mousedown', this, true);\n document.addEventListener('mousemove', this, true);\n document.addEventListener('contextmenu', this, true);\n // Flip the mousedown flag.\n this._mousedown = true;\n // Dispatch to the mouse handler.\n if (this._mouseHandler) {\n this._mouseHandler.onMouseDown(this, event);\n }\n };\n /**\n * Handle the `'mousemove'` event for the data grid.\n */\n DataGrid.prototype._evtMouseMove = function (event) {\n // Stop the event propagation if the mouse is down.\n if (this._mousedown) {\n event.preventDefault();\n event.stopPropagation();\n }\n // Bail if there is no mouse handler.\n if (!this._mouseHandler) {\n return;\n }\n // Dispatch to the mouse handler.\n if (this._mousedown) {\n this._mouseHandler.onMouseMove(this, event);\n }\n else {\n this._mouseHandler.onMouseHover(this, event);\n }\n };\n /**\n * Handle the `'mouseup'` event for the data grid.\n */\n DataGrid.prototype._evtMouseUp = function (event) {\n // Ignore everything except the left mouse button.\n if (event.button !== 0) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Dispatch to the mouse handler.\n if (this._mouseHandler) {\n this._mouseHandler.onMouseUp(this, event);\n }\n // Release the mouse.\n this._releaseMouse();\n };\n /**\n * Handle the `'dblclick'` event for the data grid.\n */\n DataGrid.prototype._evtMouseDoubleClick = function (event) {\n // Ignore everything except the left mouse button.\n if (event.button !== 0) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Dispatch to the mouse handler.\n if (this._mouseHandler) {\n this._mouseHandler.onMouseDoubleClick(this, event);\n }\n // Release the mouse.\n this._releaseMouse();\n };\n /**\n * Handle the `'mouseleave'` event for the data grid.\n */\n DataGrid.prototype._evtMouseLeave = function (event) {\n if (this._mousedown) {\n event.preventDefault();\n event.stopPropagation();\n }\n else if (this._mouseHandler) {\n this._mouseHandler.onMouseLeave(this, event);\n }\n };\n /**\n * Handle the `'contextmenu'` event for the data grid.\n */\n DataGrid.prototype._evtContextMenu = function (event) {\n if (this._mousedown) {\n event.preventDefault();\n event.stopPropagation();\n }\n else if (this._mouseHandler) {\n this._mouseHandler.onContextMenu(this, event);\n }\n };\n /**\n * Handle the `'wheel'` event for the data grid.\n */\n DataGrid.prototype._evtWheel = function (event) {\n // Ignore the event if `accel` is held.\n if (domutils.Platform.accelKey(event)) {\n return;\n }\n // Bail early if there is no mouse handler.\n if (!this._mouseHandler) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Dispatch to the mouse handler.\n this._mouseHandler.onWheel(this, event);\n };\n /**\n * Release the mouse grab.\n */\n DataGrid.prototype._releaseMouse = function () {\n // Clear the mousedown flag.\n this._mousedown = false;\n // Relase the mouse handler.\n if (this._mouseHandler) {\n this._mouseHandler.release();\n }\n // Remove the document listeners.\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('mousedown', this, true);\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('contextmenu', this, true);\n };\n /**\n * Refresh the dpi ratio.\n */\n DataGrid.prototype._refreshDPI = function () {\n // Get the best integral value for the dpi ratio.\n var dpiRatio = Math.ceil(window.devicePixelRatio);\n // Bail early if the computed dpi ratio has not changed.\n if (this._dpiRatio === dpiRatio) {\n return;\n }\n // Update the internal dpi ratio.\n this._dpiRatio = dpiRatio;\n // Schedule a repaint of the content.\n this.repaintContent();\n // Schedule a repaint of the overlay.\n this.repaintOverlay();\n // Update the canvas size for the new dpi ratio.\n this._resizeCanvasIfNeeded(this._viewportWidth, this._viewportHeight);\n // Ensure the canvas style is scaled for the new ratio.\n this._canvas.style.width = this._canvas.width / this._dpiRatio + \"px\";\n this._canvas.style.height = this._canvas.height / this._dpiRatio + \"px\";\n // Ensure the overlay style is scaled for the new ratio.\n this._overlay.style.width = this._overlay.width / this._dpiRatio + \"px\";\n this._overlay.style.height = this._overlay.height / this._dpiRatio + \"px\";\n };\n /**\n * Resize a row section immediately.\n */\n DataGrid.prototype._resizeRow = function (index, size) {\n // Look up the target section list.\n var list = this._rowSections;\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Look up the old size of the section.\n var oldSize = list.sizeOf(index);\n // Normalize the new size of the section.\n var newSize = list.clampSize(size);\n // Bail early if the size does not change.\n if (oldSize === newSize) {\n return;\n }\n // Resize the section in the list.\n list.resize(index, newSize);\n // Get the current size of the viewport.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // If there is nothing to paint, sync the scroll state.\n if (!this._viewport.isVisible || vw === 0 || vh === 0) {\n this._syncScrollState();\n return;\n }\n // Compute the size delta.\n var delta = newSize - oldSize;\n // Look up the column header height.\n var hh = this.headerHeight;\n // Compute the viewport offset of the section.\n var offset = list.offsetOf(index) + hh - this._scrollY;\n // Bail early if there is nothing to paint.\n if (hh >= vh || offset >= vh) {\n this._syncScrollState();\n return;\n }\n // Update the scroll position if the section is not visible.\n if (offset + oldSize <= hh) {\n this._scrollY += delta;\n this._syncScrollState();\n return;\n }\n // Compute the paint origin of the section.\n var pos = Math.max(hh, offset);\n // Paint from the section onward if it spans the viewport.\n if (offset + oldSize >= vh || offset + newSize >= vh) {\n this.paintContent(0, pos, vw, vh - pos);\n this._paintOverlay();\n this._syncScrollState();\n return;\n }\n // Compute the X blit dimensions.\n var sx = 0;\n var sw = vw;\n var dx = 0;\n // Compute the Y blit dimensions.\n var sy;\n var sh;\n var dy;\n if (offset + newSize <= hh) {\n sy = hh - delta;\n sh = vh - sy;\n dy = hh;\n }\n else {\n sy = offset + oldSize;\n sh = vh - sy;\n dy = sy + delta;\n }\n // Blit the valid content to the destination.\n this._blitContent(this._canvas, sx, sy, sw, sh, dx, dy);\n // Repaint the section if needed.\n if (newSize > 0 && offset + newSize > hh) {\n this.paintContent(0, pos, vw, offset + newSize - pos);\n }\n // Paint the trailing space as needed.\n if (this._stretchLastRow && this.pageHeight > this.bodyHeight) {\n var r = this._rowSections.count - 1;\n var y = hh + this._rowSections.offsetOf(r);\n this.paintContent(0, y, vw, vh - y);\n }\n else if (delta < 0) {\n this.paintContent(0, vh + delta, vw, -delta);\n }\n // Paint the overlay.\n this._paintOverlay();\n // Sync the scroll state.\n this._syncScrollState();\n };\n /**\n * Resize a column section immediately.\n */\n DataGrid.prototype._resizeColumn = function (index, size) {\n // Look up the target section list.\n var list = this._columnSections;\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Look up the old size of the section.\n var oldSize = list.sizeOf(index);\n // Normalize the new size of the section.\n var newSize = list.clampSize(size);\n // Bail early if the size does not change.\n if (oldSize === newSize) {\n return;\n }\n // Resize the section in the list.\n list.resize(index, newSize);\n // Get the current size of the viewport.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // If there is nothing to paint, sync the scroll state.\n if (!this._viewport.isVisible || vw === 0 || vh === 0) {\n this._syncScrollState();\n return;\n }\n // Compute the size delta.\n var delta = newSize - oldSize;\n // Look up the row header width.\n var hw = this.headerWidth;\n // Compute the viewport offset of the section.\n var offset = list.offsetOf(index) + hw - this._scrollX;\n // Bail early if there is nothing to paint.\n if (hw >= vw || offset >= vw) {\n this._syncScrollState();\n return;\n }\n // Update the scroll position if the section is not visible.\n if (offset + oldSize <= hw) {\n this._scrollX += delta;\n this._syncScrollState();\n return;\n }\n // Compute the paint origin of the section.\n var pos = Math.max(hw, offset);\n // Paint from the section onward if it spans the viewport.\n if (offset + oldSize >= vw || offset + newSize >= vw) {\n this.paintContent(pos, 0, vw - pos, vh);\n this._paintOverlay();\n this._syncScrollState();\n return;\n }\n // Compute the Y blit dimensions.\n var sy = 0;\n var sh = vh;\n var dy = 0;\n // Compute the X blit dimensions.\n var sx;\n var sw;\n var dx;\n if (offset + newSize <= hw) {\n sx = hw - delta;\n sw = vw - sx;\n dx = hw;\n }\n else {\n sx = offset + oldSize;\n sw = vw - sx;\n dx = sx + delta;\n }\n // Blit the valid content to the destination.\n this._blitContent(this._canvas, sx, sy, sw, sh, dx, dy);\n // Repaint the section if needed.\n if (newSize > 0 && offset + newSize > hw) {\n this.paintContent(pos, 0, offset + newSize - pos, vh);\n }\n // Paint the trailing space as needed.\n if (this._stretchLastColumn && this.pageWidth > this.bodyWidth) {\n var c = this._columnSections.count - 1;\n var x = hw + this._columnSections.offsetOf(c);\n this.paintContent(x, 0, vw - x, vh);\n }\n else if (delta < 0) {\n this.paintContent(vw + delta, 0, -delta, vh);\n }\n // Paint the overlay.\n this._paintOverlay();\n // Sync the scroll state after painting.\n this._syncScrollState();\n };\n /**\n * Resize a row header section immediately.\n */\n DataGrid.prototype._resizeRowHeader = function (index, size) {\n // Look up the target section list.\n var list = this._rowHeaderSections;\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Look up the old size of the section.\n var oldSize = list.sizeOf(index);\n // Normalize the new size of the section.\n var newSize = list.clampSize(size);\n // Bail early if the size does not change.\n if (oldSize === newSize) {\n return;\n }\n // Resize the section in the list.\n list.resize(index, newSize);\n // Get the current size of the viewport.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // If there is nothing to paint, sync the scroll state.\n if (!this._viewport.isVisible || vw === 0 || vh === 0) {\n this._syncScrollState();\n return;\n }\n // Compute the size delta.\n var delta = newSize - oldSize;\n // Look up the offset of the section.\n var offset = list.offsetOf(index);\n // Bail early if the section is fully outside the viewport.\n if (offset >= vw) {\n this._syncScrollState();\n return;\n }\n // Paint the entire tail if the section spans the viewport.\n if (offset + oldSize >= vw || offset + newSize >= vw) {\n this.paintContent(offset, 0, vw - offset, vh);\n this._paintOverlay();\n this._syncScrollState();\n return;\n }\n // Compute the blit content dimensions.\n var sx = offset + oldSize;\n var sy = 0;\n var sw = vw - sx;\n var sh = vh;\n var dx = sx + delta;\n var dy = 0;\n // Blit the valid contents to the destination.\n this._blitContent(this._canvas, sx, sy, sw, sh, dx, dy);\n // Repaint the header section if needed.\n if (newSize > 0) {\n this.paintContent(offset, 0, newSize, vh);\n }\n // Paint the trailing space as needed.\n if (this._stretchLastColumn && this.pageWidth > this.bodyWidth) {\n var c = this._columnSections.count - 1;\n var x = this.headerWidth + this._columnSections.offsetOf(c);\n this.paintContent(x, 0, vw - x, vh);\n }\n else if (delta < 0) {\n this.paintContent(vw + delta, 0, -delta, vh);\n }\n // Paint the overlay.\n this._paintOverlay();\n // Sync the scroll state after painting.\n this._syncScrollState();\n };\n /**\n * Resize a column header section immediately.\n */\n DataGrid.prototype._resizeColumnHeader = function (index, size) {\n // Look up the target section list.\n var list = this._columnHeaderSections;\n // Bail early if the index is out of range.\n if (index < 0 || index >= list.count) {\n return;\n }\n // Look up the old size of the section.\n var oldSize = list.sizeOf(index);\n // Normalize the new size of the section.\n var newSize = list.clampSize(size);\n // Bail early if the size does not change.\n if (oldSize === newSize) {\n return;\n }\n // Resize the section in the list.\n list.resize(index, newSize);\n // Get the current size of the viewport.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // If there is nothing to paint, sync the scroll state.\n if (!this._viewport.isVisible || vw === 0 || vh === 0) {\n this._syncScrollState();\n return;\n }\n // Paint the overlay.\n this._paintOverlay();\n // Compute the size delta.\n var delta = newSize - oldSize;\n // Look up the offset of the section.\n var offset = list.offsetOf(index);\n // Bail early if the section is fully outside the viewport.\n if (offset >= vh) {\n this._syncScrollState();\n return;\n }\n // Paint the entire tail if the section spans the viewport.\n if (offset + oldSize >= vh || offset + newSize >= vh) {\n this.paintContent(0, offset, vw, vh - offset);\n this._paintOverlay();\n this._syncScrollState();\n return;\n }\n // Compute the blit content dimensions.\n var sx = 0;\n var sy = offset + oldSize;\n var sw = vw;\n var sh = vh - sy;\n var dx = 0;\n var dy = sy + delta;\n // Blit the valid contents to the destination.\n this._blitContent(this._canvas, sx, sy, sw, sh, dx, dy);\n // Repaint the header section if needed.\n if (newSize > 0) {\n this.paintContent(0, offset, vw, newSize);\n }\n // Paint the trailing space as needed.\n if (this._stretchLastRow && this.pageHeight > this.bodyHeight) {\n var r = this._rowSections.count - 1;\n var y = this.headerHeight + this._rowSections.offsetOf(r);\n this.paintContent(0, y, vw, vh - y);\n }\n else if (delta < 0) {\n this.paintContent(0, vh + delta, vw, -delta);\n }\n // Paint the overlay.\n this._paintOverlay();\n // Sync the scroll state after painting.\n this._syncScrollState();\n };\n /**\n * Scroll immediately to the specified offset position.\n */\n DataGrid.prototype._scrollTo = function (x, y) {\n // Floor and clamp the position to the allowable range.\n x = Math.max(0, Math.min(Math.floor(x), this.maxScrollX));\n y = Math.max(0, Math.min(Math.floor(y), this.maxScrollY));\n // Synchronize the scroll bar values.\n this._hScrollBar.value = x;\n this._vScrollBar.value = y;\n // Compute the delta scroll amount.\n var dx = x - this._scrollX;\n var dy = y - this._scrollY;\n // Bail early if there is no effective scroll.\n if (dx === 0 && dy === 0) {\n return;\n }\n // Bail early if the viewport is not visible.\n if (!this._viewport.isVisible) {\n this._scrollX = x;\n this._scrollY = y;\n return;\n }\n // Get the current size of the viewport.\n var width = this._viewportWidth;\n var height = this._viewportHeight;\n // Bail early if the viewport is empty.\n if (width === 0 || height === 0) {\n this._scrollX = x;\n this._scrollY = y;\n return;\n }\n // Get the visible content origin.\n var contentX = this.headerWidth;\n var contentY = this.headerHeight;\n // Get the visible content dimensions.\n var contentWidth = width - contentX;\n var contentHeight = height - contentY;\n // Bail early if there is no content to draw.\n if (contentWidth <= 0 && contentHeight <= 0) {\n this._scrollX = x;\n this._scrollY = y;\n return;\n }\n // Compute the area which needs painting for the `dx` scroll.\n var dxArea = 0;\n if (dx !== 0 && contentWidth > 0) {\n if (Math.abs(dx) >= contentWidth) {\n dxArea = contentWidth * height;\n }\n else {\n dxArea = Math.abs(dx) * height;\n }\n }\n // Compute the area which needs painting for the `dy` scroll.\n var dyArea = 0;\n if (dy !== 0 && contentHeight > 0) {\n if (Math.abs(dy) >= contentHeight) {\n dyArea = width * contentHeight;\n }\n else {\n dyArea = width * Math.abs(dy);\n }\n }\n // If the area sum is larger than the total, paint everything.\n if ((dxArea + dyArea) >= (width * height)) {\n this._scrollX = x;\n this._scrollY = y;\n this.paintContent(0, 0, width, height);\n this._paintOverlay();\n return;\n }\n // Update the internal Y scroll position.\n this._scrollY = y;\n // Scroll the Y axis if needed. If the scroll distance exceeds\n // the visible height, paint everything. Otherwise, blit the\n // valid content and paint the dirty region.\n if (dy !== 0 && contentHeight > 0) {\n if (Math.abs(dy) >= contentHeight) {\n this.paintContent(0, contentY, width, contentHeight);\n }\n else {\n var x_5 = 0;\n var y_5 = dy < 0 ? contentY : contentY + dy;\n var w = width;\n var h = contentHeight - Math.abs(dy);\n this._blitContent(this._canvas, x_5, y_5, w, h, x_5, y_5 - dy);\n this.paintContent(0, dy < 0 ? contentY : height - dy, width, Math.abs(dy));\n }\n }\n // Update the internal X scroll position.\n this._scrollX = x;\n // Scroll the X axis if needed. If the scroll distance exceeds\n // the visible width, paint everything. Otherwise, blit the\n // valid content and paint the dirty region.\n if (dx !== 0 && contentWidth > 0) {\n if (Math.abs(dx) >= contentWidth) {\n this.paintContent(contentX, 0, contentWidth, height);\n }\n else {\n var x_6 = dx < 0 ? contentX : contentX + dx;\n var y_6 = 0;\n var w = contentWidth - Math.abs(dx);\n var h = height;\n this._blitContent(this._canvas, x_6, y_6, w, h, x_6 - dx, y_6);\n this.paintContent(dx < 0 ? contentX : width - dx, 0, Math.abs(dx), height);\n }\n }\n // Paint the overlay.\n this._paintOverlay();\n };\n /**\n * Blit content into the on-screen grid canvas.\n *\n * The rect should be expressed in viewport coordinates.\n *\n * This automatically accounts for the dpi ratio.\n */\n DataGrid.prototype._blitContent = function (source, x, y, w, h, dx, dy) {\n // Scale the blit coordinates by the dpi ratio.\n x *= this._dpiRatio;\n y *= this._dpiRatio;\n w *= this._dpiRatio;\n h *= this._dpiRatio;\n dx *= this._dpiRatio;\n dy *= this._dpiRatio;\n // Save the current gc state.\n this._canvasGC.save();\n // Set the transform to the identity matrix.\n this._canvasGC.setTransform(1, 0, 0, 1, 0, 0);\n // Draw the specified content.\n this._canvasGC.drawImage(source, x, y, w, h, dx, dy, w, h);\n // Restore the gc state.\n this._canvasGC.restore();\n };\n /**\n * Paint the grid content for the given dirty rect.\n *\n * The rect should be expressed in valid viewport coordinates.\n *\n * This is the primary paint entry point. The individual `_draw*`\n * methods should not be invoked directly. This method dispatches\n * to the drawing methods in the correct order.\n */\n DataGrid.prototype.paintContent = function (rx, ry, rw, rh) {\n // Scale the canvas and buffer GC for the dpi ratio.\n this._canvasGC.setTransform(this._dpiRatio, 0, 0, this._dpiRatio, 0, 0);\n this._bufferGC.setTransform(this._dpiRatio, 0, 0, this._dpiRatio, 0, 0);\n // Clear the dirty rect of all content.\n this._canvasGC.clearRect(rx, ry, rw, rh);\n // Draw the void region.\n this._drawVoidRegion(rx, ry, rw, rh);\n // Draw the body region.\n this._drawBodyRegion(rx, ry, rw, rh);\n // Draw the row header region.\n this._drawRowHeaderRegion(rx, ry, rw, rh);\n // Draw the column header region.\n this._drawColumnHeaderRegion(rx, ry, rw, rh);\n // Draw the corner header region.\n this.drawCornerHeaderRegion(rx, ry, rw, rh);\n };\n /**\n * Paint the overlay content for the entire grid.\n *\n * This is the primary overlay paint entry point. The individual\n * `_draw*` methods should not be invoked directly. This method\n * dispatches to the drawing methods in the correct order.\n */\n DataGrid.prototype._paintOverlay = function () {\n // Scale the overlay GC for the dpi ratio.\n this._overlayGC.setTransform(this._dpiRatio, 0, 0, this._dpiRatio, 0, 0);\n // Clear the overlay of all content.\n this._overlayGC.clearRect(0, 0, this._overlay.width, this._overlay.height);\n // Draw the body selections.\n this._drawBodySelections();\n // Draw the row header selections.\n this._drawRowHeaderSelections();\n // Draw the column header selections.\n this._drawColumnHeaderSelections();\n // Draw the cursor.\n this._drawCursor();\n // Draw the shadows.\n this._drawShadows();\n };\n /**\n * Draw the void region for the dirty rect.\n */\n DataGrid.prototype._drawVoidRegion = function (rx, ry, rw, rh) {\n // Look up the void color.\n var color = this._style.voidColor;\n // Bail if there is no void color.\n if (!color) {\n return;\n }\n // Fill the dirty rect with the void color.\n this._canvasGC.fillStyle = color;\n this._canvasGC.fillRect(rx, ry, rw, rh);\n };\n /**\n * Draw the body region which intersects the dirty rect.\n */\n DataGrid.prototype._drawBodyRegion = function (rx, ry, rw, rh) {\n // Get the visible content dimensions.\n var contentW = this._columnSections.length - this._scrollX;\n var contentH = this._rowSections.length - this._scrollY;\n // Bail if there is no content to draw.\n if (contentW <= 0 || contentH <= 0) {\n return;\n }\n // Get the visible content origin.\n var contentX = this.headerWidth;\n var contentY = this.headerHeight;\n // Bail if the dirty rect does not intersect the content area.\n if (rx + rw <= contentX) {\n return;\n }\n if (ry + rh <= contentY) {\n return;\n }\n if (rx >= contentX + contentW) {\n return;\n }\n if (ry >= contentY + contentH) {\n return;\n }\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var bw = this.bodyWidth;\n var ph = this.pageHeight;\n var pw = this.pageWidth;\n // Get the upper and lower bounds of the dirty content area.\n var x1 = Math.max(rx, contentX);\n var y1 = Math.max(ry, contentY);\n var x2 = Math.min(rx + rw - 1, contentX + contentW - 1);\n var y2 = Math.min(ry + rh - 1, contentY + contentH - 1);\n // Convert the dirty content bounds into cell bounds.\n var r1 = this._rowSections.indexOf(y1 - contentY + this._scrollY);\n var c1 = this._columnSections.indexOf(x1 - contentX + this._scrollX);\n var r2 = this._rowSections.indexOf(y2 - contentY + this._scrollY);\n var c2 = this._columnSections.indexOf(x2 - contentX + this._scrollX);\n // Fetch the max row and column.\n var maxRow = this._rowSections.count - 1;\n var maxColumn = this._columnSections.count - 1;\n // Handle a dirty content area larger than the cell count.\n if (r2 < 0) {\n r2 = maxRow;\n }\n if (c2 < 0) {\n c2 = maxColumn;\n }\n // Convert the cell bounds back to visible coordinates.\n var x = this._columnSections.offsetOf(c1) + contentX - this._scrollX;\n var y = this._rowSections.offsetOf(r1) + contentY - this._scrollY;\n // Set up the paint region size variables.\n var width = 0;\n var height = 0;\n // Allocate the section sizes arrays.\n var rowSizes = new Array(r2 - r1 + 1);\n var columnSizes = new Array(c2 - c1 + 1);\n // Get the row sizes for the region.\n for (var j = r1; j <= r2; ++j) {\n var size = this._rowSections.sizeOf(j);\n rowSizes[j - r1] = size;\n height += size;\n }\n // Get the column sizes for the region.\n for (var i = c1; i <= c2; ++i) {\n var size = this._columnSections.sizeOf(i);\n columnSizes[i - c1] = size;\n width += size;\n }\n // Adjust the geometry if the last row is streched.\n if (this._stretchLastRow && ph > bh && r2 === maxRow) {\n var dh = this.pageHeight - this.bodyHeight;\n rowSizes[rowSizes.length - 1] += dh;\n height += dh;\n y2 += dh;\n }\n // Adjust the geometry if the last column is streched.\n if (this._stretchLastColumn && pw > bw && c2 === maxColumn) {\n var dw = this.pageWidth - this.bodyWidth;\n columnSizes[columnSizes.length - 1] += dw;\n width += dw;\n x2 += dw;\n }\n // Create the paint region object.\n var rgn = {\n region: 'body',\n xMin: x1, yMin: y1,\n xMax: x2, yMax: y2,\n x: x, y: y, width: width, height: height,\n row: r1, column: c1,\n rowSizes: rowSizes, columnSizes: columnSizes\n };\n // Draw the background.\n this._drawBackground(rgn, this._style.backgroundColor);\n // Draw the row background.\n this._drawRowBackground(rgn, this._style.rowBackgroundColor);\n // Draw the column background.\n this._drawColumnBackground(rgn, this._style.columnBackgroundColor);\n // Draw the cell content for the paint region.\n this._drawCells(rgn);\n // Draw the horizontal grid lines.\n this._drawHorizontalGridLines(rgn, this._style.horizontalGridLineColor ||\n this._style.gridLineColor);\n // Draw the vertical grid lines.\n this._drawVerticalGridLines(rgn, this._style.verticalGridLineColor ||\n this._style.gridLineColor);\n };\n /**\n * Draw the row header region which intersects the dirty rect.\n */\n DataGrid.prototype._drawRowHeaderRegion = function (rx, ry, rw, rh) {\n // Get the visible content dimensions.\n var contentW = this.headerWidth;\n var contentH = this.bodyHeight - this._scrollY;\n // Bail if there is no content to draw.\n if (contentW <= 0 || contentH <= 0) {\n return;\n }\n // Get the visible content origin.\n var contentX = 0;\n var contentY = this.headerHeight;\n // Bail if the dirty rect does not intersect the content area.\n if (rx + rw <= contentX) {\n return;\n }\n if (ry + rh <= contentY) {\n return;\n }\n if (rx >= contentX + contentW) {\n return;\n }\n if (ry >= contentY + contentH) {\n return;\n }\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n // Get the upper and lower bounds of the dirty content area.\n var x1 = rx;\n var y1 = Math.max(ry, contentY);\n var x2 = Math.min(rx + rw - 1, contentX + contentW - 1);\n var y2 = Math.min(ry + rh - 1, contentY + contentH - 1);\n // Convert the dirty content bounds into cell bounds.\n var r1 = this._rowSections.indexOf(y1 - contentY + this._scrollY);\n var c1 = this._rowHeaderSections.indexOf(x1);\n var r2 = this._rowSections.indexOf(y2 - contentY + this._scrollY);\n var c2 = this._rowHeaderSections.indexOf(x2);\n // Fetch max row and column.\n var maxRow = this._rowSections.count - 1;\n var maxColumn = this._rowHeaderSections.count - 1;\n // Handle a dirty content area larger than the cell count.\n if (r2 < 0) {\n r2 = maxRow;\n }\n if (c2 < 0) {\n c2 = maxColumn;\n }\n // Convert the cell bounds back to visible coordinates.\n var x = this._rowHeaderSections.offsetOf(c1);\n var y = this._rowSections.offsetOf(r1) + contentY - this._scrollY;\n // Set up the paint region size variables.\n var width = 0;\n var height = 0;\n // Allocate the section sizes arrays.\n var rowSizes = new Array(r2 - r1 + 1);\n var columnSizes = new Array(c2 - c1 + 1);\n // Get the row sizes for the region.\n for (var j = r1; j <= r2; ++j) {\n var size = this._rowSections.sizeOf(j);\n rowSizes[j - r1] = size;\n height += size;\n }\n // Get the column sizes for the region.\n for (var i = c1; i <= c2; ++i) {\n var size = this._rowHeaderSections.sizeOf(i);\n columnSizes[i - c1] = size;\n width += size;\n }\n // Adjust the geometry if the last row is stretched.\n if (this._stretchLastRow && ph > bh && r2 === maxRow) {\n var dh = this.pageHeight - this.bodyHeight;\n rowSizes[rowSizes.length - 1] += dh;\n height += dh;\n y2 += dh;\n }\n // Create the paint region object.\n var rgn = {\n region: 'row-header',\n xMin: x1, yMin: y1,\n xMax: x2, yMax: y2,\n x: x, y: y, width: width, height: height,\n row: r1, column: c1,\n rowSizes: rowSizes, columnSizes: columnSizes\n };\n // Draw the background.\n this._drawBackground(rgn, this._style.headerBackgroundColor);\n // Draw the cell content for the paint region.\n this._drawCells(rgn);\n // Draw the horizontal grid lines.\n this._drawHorizontalGridLines(rgn, this._style.headerHorizontalGridLineColor ||\n this._style.headerGridLineColor);\n // Draw the vertical grid lines.\n this._drawVerticalGridLines(rgn, this._style.headerVerticalGridLineColor ||\n this._style.headerGridLineColor);\n };\n /**\n * Draw the column header region which intersects the dirty rect.\n */\n DataGrid.prototype._drawColumnHeaderRegion = function (rx, ry, rw, rh) {\n // Get the visible content dimensions.\n var contentW = this.bodyWidth - this._scrollX;\n var contentH = this.headerHeight;\n // Bail if there is no content to draw.\n if (contentW <= 0 || contentH <= 0) {\n return;\n }\n // Get the visible content origin.\n var contentX = this.headerWidth;\n var contentY = 0;\n // Bail if the dirty rect does not intersect the content area.\n if (rx + rw <= contentX) {\n return;\n }\n if (ry + rh <= contentY) {\n return;\n }\n if (rx >= contentX + contentW) {\n return;\n }\n if (ry >= contentY + contentH) {\n return;\n }\n // Fetch the geometry.\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n // Get the upper and lower bounds of the dirty content area.\n var x1 = Math.max(rx, contentX);\n var y1 = ry;\n var x2 = Math.min(rx + rw - 1, contentX + contentW - 1);\n var y2 = Math.min(ry + rh - 1, contentY + contentH - 1);\n // Convert the dirty content bounds into cell bounds.\n var r1 = this._columnHeaderSections.indexOf(y1);\n var c1 = this._columnSections.indexOf(x1 - contentX + this._scrollX);\n var r2 = this._columnHeaderSections.indexOf(y2);\n var c2 = this._columnSections.indexOf(x2 - contentX + this._scrollX);\n // Fetch the max row and column.\n var maxRow = this._columnHeaderSections.count - 1;\n var maxColumn = this._columnSections.count - 1;\n // Handle a dirty content area larger than the cell count.\n if (r2 < 0) {\n r2 = maxRow;\n }\n if (c2 < 0) {\n c2 = maxColumn;\n }\n // Convert the cell bounds back to visible coordinates.\n var x = this._columnSections.offsetOf(c1) + contentX - this._scrollX;\n var y = this._columnHeaderSections.offsetOf(r1);\n // Set up the paint region size variables.\n var width = 0;\n var height = 0;\n // Allocate the section sizes arrays.\n var rowSizes = new Array(r2 - r1 + 1);\n var columnSizes = new Array(c2 - c1 + 1);\n // Get the row sizes for the region.\n for (var j = r1; j <= r2; ++j) {\n var size = this._columnHeaderSections.sizeOf(j);\n rowSizes[j - r1] = size;\n height += size;\n }\n // Get the column sizes for the region.\n for (var i = c1; i <= c2; ++i) {\n var size = this._columnSections.sizeOf(i);\n columnSizes[i - c1] = size;\n width += size;\n }\n // Adjust the geometry if the last column is stretched.\n if (this._stretchLastColumn && pw > bw && c2 === maxColumn) {\n var dw = this.pageWidth - this.bodyWidth;\n columnSizes[columnSizes.length - 1] += dw;\n width += dw;\n x2 += dw;\n }\n // Create the paint region object.\n var rgn = {\n region: 'column-header',\n xMin: x1, yMin: y1,\n xMax: x2, yMax: y2,\n x: x, y: y, width: width, height: height,\n row: r1, column: c1,\n rowSizes: rowSizes, columnSizes: columnSizes\n };\n // Draw the background.\n this._drawBackground(rgn, this._style.headerBackgroundColor);\n // Draw the cell content for the paint region.\n this._drawCells(rgn);\n // Draw the horizontal grid lines.\n this._drawHorizontalGridLines(rgn, this._style.headerHorizontalGridLineColor ||\n this._style.headerGridLineColor);\n // Draw the vertical grid lines.\n this._drawVerticalGridLines(rgn, this._style.headerVerticalGridLineColor ||\n this._style.headerGridLineColor);\n };\n /**\n * Draw the corner header region which intersects the dirty rect.\n */\n DataGrid.prototype.drawCornerHeaderRegion = function (rx, ry, rw, rh) {\n // Get the visible content dimensions.\n var contentW = this.headerWidth;\n var contentH = this.headerHeight;\n // Bail if there is no content to draw.\n if (contentW <= 0 || contentH <= 0) {\n return;\n }\n // Get the visible content origin.\n var contentX = 0;\n var contentY = 0;\n // Bail if the dirty rect does not intersect the content area.\n if (rx + rw <= contentX) {\n return;\n }\n if (ry + rh <= contentY) {\n return;\n }\n if (rx >= contentX + contentW) {\n return;\n }\n if (ry >= contentY + contentH) {\n return;\n }\n // Get the upper and lower bounds of the dirty content area.\n var x1 = rx;\n var y1 = ry;\n var x2 = Math.min(rx + rw - 1, contentX + contentW - 1);\n var y2 = Math.min(ry + rh - 1, contentY + contentH - 1);\n // Convert the dirty content bounds into cell bounds.\n var r1 = this._columnHeaderSections.indexOf(y1);\n var c1 = this._rowHeaderSections.indexOf(x1);\n var r2 = this._columnHeaderSections.indexOf(y2);\n var c2 = this._rowHeaderSections.indexOf(x2);\n // Handle a dirty content area larger than the cell count.\n if (r2 < 0) {\n r2 = this._columnHeaderSections.count - 1;\n }\n if (c2 < 0) {\n c2 = this._rowHeaderSections.count - 1;\n }\n // Convert the cell bounds back to visible coordinates.\n var x = this._rowHeaderSections.offsetOf(c1);\n var y = this._columnHeaderSections.offsetOf(r1);\n // Set up the paint region size variables.\n var width = 0;\n var height = 0;\n // Allocate the section sizes arrays.\n var rowSizes = new Array(r2 - r1 + 1);\n var columnSizes = new Array(c2 - c1 + 1);\n // Get the row sizes for the region.\n for (var j = r1; j <= r2; ++j) {\n var size = this._columnHeaderSections.sizeOf(j);\n rowSizes[j - r1] = size;\n height += size;\n }\n // Get the column sizes for the region.\n for (var i = c1; i <= c2; ++i) {\n var size = this._rowHeaderSections.sizeOf(i);\n columnSizes[i - c1] = size;\n width += size;\n }\n // Create the paint region object.\n var rgn = {\n region: 'corner-header',\n xMin: x1, yMin: y1,\n xMax: x2, yMax: y2,\n x: x, y: y, width: width, height: height,\n row: r1, column: c1,\n rowSizes: rowSizes, columnSizes: columnSizes\n };\n // Draw the background.\n this._drawBackground(rgn, this._style.headerBackgroundColor);\n // Draw the cell content for the paint region.\n this._drawCells(rgn);\n // Draw the horizontal grid lines.\n this._drawHorizontalGridLines(rgn, this._style.headerHorizontalGridLineColor ||\n this._style.headerGridLineColor);\n // Draw the vertical grid lines.\n this._drawVerticalGridLines(rgn, this._style.headerVerticalGridLineColor ||\n this._style.headerGridLineColor);\n };\n /**\n * Draw the background for the given paint region.\n */\n DataGrid.prototype._drawBackground = function (rgn, color) {\n // Bail if there is no color to draw.\n if (!color) {\n return;\n }\n // Unpack the region.\n var xMin = rgn.xMin, yMin = rgn.yMin, xMax = rgn.xMax, yMax = rgn.yMax;\n // Fill the region with the specified color.\n this._canvasGC.fillStyle = color;\n this._canvasGC.fillRect(xMin, yMin, xMax - xMin + 1, yMax - yMin + 1);\n };\n /**\n * Draw the row background for the given paint region.\n */\n DataGrid.prototype._drawRowBackground = function (rgn, colorFn) {\n // Bail if there is no color function.\n if (!colorFn) {\n return;\n }\n // Compute the X bounds for the row.\n var x1 = Math.max(rgn.xMin, rgn.x);\n var x2 = Math.min(rgn.x + rgn.width - 1, rgn.xMax);\n // Draw the background for the rows in the region.\n for (var y = rgn.y, j = 0, n = rgn.rowSizes.length; j < n; ++j) {\n // Fetch the size of the row.\n var size = rgn.rowSizes[j];\n // Skip zero sized rows.\n if (size === 0) {\n continue;\n }\n // Get the background color for the row.\n var color = colorFn(rgn.row + j);\n // Fill the row with the background color if needed.\n if (color) {\n var y1 = Math.max(rgn.yMin, y);\n var y2 = Math.min(y + size - 1, rgn.yMax);\n this._canvasGC.fillStyle = color;\n this._canvasGC.fillRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n }\n // Increment the running Y coordinate.\n y += size;\n }\n };\n /**\n * Draw the column background for the given paint region.\n */\n DataGrid.prototype._drawColumnBackground = function (rgn, colorFn) {\n // Bail if there is no color function.\n if (!colorFn) {\n return;\n }\n // Compute the Y bounds for the column.\n var y1 = Math.max(rgn.yMin, rgn.y);\n var y2 = Math.min(rgn.y + rgn.height - 1, rgn.yMax);\n // Draw the background for the columns in the region.\n for (var x = rgn.x, i = 0, n = rgn.columnSizes.length; i < n; ++i) {\n // Fetch the size of the column.\n var size = rgn.columnSizes[i];\n // Skip zero sized columns.\n if (size === 0) {\n continue;\n }\n // Get the background color for the column.\n var color = colorFn(rgn.column + i);\n // Fill the column with the background color if needed.\n if (color) {\n var x1 = Math.max(rgn.xMin, x);\n var x2 = Math.min(x + size - 1, rgn.xMax);\n this._canvasGC.fillStyle = color;\n this._canvasGC.fillRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n }\n // Increment the running X coordinate.\n x += size;\n }\n };\n /**\n * Draw the cells for the given paint region.\n */\n DataGrid.prototype._drawCells = function (rgn) {\n // Bail if there is no data model.\n if (!this._dataModel) {\n return;\n }\n // Set up the cell config object for rendering.\n var config = {\n x: 0, y: 0, width: 0, height: 0,\n region: rgn.region, row: 0, column: 0,\n value: null,\n metadata: datamodel.DataModel.emptyMetadata\n };\n // Save the buffer gc before wrapping.\n this._bufferGC.save();\n // Wrap the buffer gc for painting the cells.\n var gc = new graphicscontext.GraphicsContext(this._bufferGC);\n // Compute the actual Y bounds for the cell range.\n var y1 = Math.max(rgn.yMin, rgn.y);\n var y2 = Math.min(rgn.y + rgn.height - 1, rgn.yMax);\n // Loop over the columns in the region.\n for (var x = rgn.x, i = 0, n = rgn.columnSizes.length; i < n; ++i) {\n // Fetch the size of the column.\n var width = rgn.columnSizes[i];\n // Skip zero sized columns.\n if (width === 0) {\n continue;\n }\n // Compute the column index.\n var column = rgn.column + i;\n // Update the config for the current column.\n config.x = x;\n config.width = width;\n config.column = column;\n // Clear the buffer rect for the column.\n gc.clearRect(x, rgn.y, width, rgn.height);\n // Save the GC state.\n gc.save();\n // Loop over the rows in the column.\n for (var y = rgn.y, j = 0, n_1 = rgn.rowSizes.length; j < n_1; ++j) {\n // Fetch the size of the row.\n var height = rgn.rowSizes[j];\n // Skip zero sized rows.\n if (height === 0) {\n continue;\n }\n // Compute the row index.\n var row = rgn.row + j;\n // Get the value for the cell.\n var value = void 0;\n try {\n value = this._dataModel.data(rgn.region, row, column);\n }\n catch (err) {\n value = undefined;\n console.error(err);\n }\n // Get the metadata for the cell.\n var metadata = void 0;\n try {\n metadata = this._dataModel.metadata(rgn.region, row, column);\n }\n catch (err) {\n metadata = datamodel.DataModel.emptyMetadata;\n console.error(err);\n }\n // Update the config for the current cell.\n config.y = y;\n config.height = height;\n config.row = row;\n config.value = value;\n config.metadata = metadata;\n // Get the renderer for the cell.\n var renderer = this._cellRenderers.get(config);\n // Save the GC state.\n gc.save();\n // Paint the cell into the off-screen buffer.\n try {\n renderer.paint(gc, config);\n }\n catch (err) {\n console.error(err);\n }\n // Restore the GC state.\n gc.restore();\n // Increment the running Y coordinate.\n y += height;\n }\n // Restore the GC state.\n gc.restore();\n // Compute the actual X bounds for the column.\n var x1 = Math.max(rgn.xMin, x);\n var x2 = Math.min(x + width - 1, rgn.xMax);\n // Blit the off-screen buffer column into the on-screen canvas.\n //\n // This is *much* faster than drawing directly into the on-screen\n // canvas with a clip rect on the column. Managed column clipping\n // is required to prevent cell renderers from needing to set up a\n // clip rect for handling horizontal overflow text (slow!).\n this._blitContent(this._buffer, x1, y1, x2 - x1 + 1, y2 - y1 + 1, x1, y1);\n // Increment the running X coordinate.\n x += width;\n }\n // Dispose of the wrapped gc.\n gc.dispose();\n // Restore the final buffer gc state.\n this._bufferGC.restore();\n };\n /**\n * Draw the horizontal grid lines for the given paint region.\n */\n DataGrid.prototype._drawHorizontalGridLines = function (rgn, color) {\n // Bail if there is no color to draw.\n if (!color) {\n return;\n }\n // Compute the X bounds for the horizontal lines.\n var x1 = Math.max(rgn.xMin, rgn.x);\n var x2 = Math.min(rgn.x + rgn.width, rgn.xMax + 1);\n // Begin the path for the grid lines.\n this._canvasGC.beginPath();\n // Set the line width for the grid lines.\n this._canvasGC.lineWidth = 1;\n // Fetch the geometry.\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n // Fetch the number of grid lines to be drawn.\n var n = rgn.rowSizes.length;\n // Adjust the count down if the last line shouldn't be drawn.\n if (this._stretchLastRow && ph > bh) {\n if (rgn.row + n === this._rowSections.count) {\n n -= 1;\n }\n }\n // Draw the horizontal grid lines.\n for (var y = rgn.y, j = 0; j < n; ++j) {\n // Fetch the size of the row.\n var size = rgn.rowSizes[j];\n // Skip zero sized rows.\n if (size === 0) {\n continue;\n }\n // Compute the Y position of the line.\n var pos = y + size - 1;\n // Draw the line if it's in range of the dirty rect.\n if (pos >= rgn.yMin && pos <= rgn.yMax) {\n this._canvasGC.moveTo(x1, pos + 0.5);\n this._canvasGC.lineTo(x2, pos + 0.5);\n }\n // Increment the running Y coordinate.\n y += size;\n }\n // Stroke the lines with the specified color.\n this._canvasGC.strokeStyle = color;\n this._canvasGC.stroke();\n };\n /**\n * Draw the vertical grid lines for the given paint region.\n */\n DataGrid.prototype._drawVerticalGridLines = function (rgn, color) {\n // Bail if there is no color to draw.\n if (!color) {\n return;\n }\n // Compute the Y bounds for the vertical lines.\n var y1 = Math.max(rgn.yMin, rgn.y);\n var y2 = Math.min(rgn.y + rgn.height, rgn.yMax + 1);\n // Begin the path for the grid lines\n this._canvasGC.beginPath();\n // Set the line width for the grid lines.\n this._canvasGC.lineWidth = 1;\n // Fetch the geometry.\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n // Fetch the number of grid lines to be drawn.\n var n = rgn.columnSizes.length;\n // Adjust the count down if the last line shouldn't be drawn.\n if (this._stretchLastColumn && pw > bw) {\n if (rgn.column + n === this._columnSections.count) {\n n -= 1;\n }\n }\n // Draw the vertical grid lines.\n for (var x = rgn.x, i = 0; i < n; ++i) {\n // Fetch the size of the column.\n var size = rgn.columnSizes[i];\n // Skip zero sized columns.\n if (size === 0) {\n continue;\n }\n // Compute the X position of the line.\n var pos = x + size - 1;\n // Draw the line if it's in range of the dirty rect.\n if (pos >= rgn.xMin && pos <= rgn.xMax) {\n this._canvasGC.moveTo(pos + 0.5, y1);\n this._canvasGC.lineTo(pos + 0.5, y2);\n }\n // Increment the running X coordinate.\n x += size;\n }\n // Stroke the lines with the specified color.\n this._canvasGC.strokeStyle = color;\n this._canvasGC.stroke();\n };\n /**\n * Draw the body selections for the data grid.\n */\n DataGrid.prototype._drawBodySelections = function () {\n // Fetch the selection model.\n var model = this._selectionModel;\n // Bail early if there are no selections.\n if (!model || model.isEmpty) {\n return;\n }\n // Fetch the selection colors.\n var fill = this._style.selectionFillColor;\n var stroke = this._style.selectionBorderColor;\n // Bail early if there is nothing to draw.\n if (!fill && !stroke) {\n return;\n }\n // Fetch the scroll geometry.\n var sx = this._scrollX;\n var sy = this._scrollY;\n // Get the first visible cell of the grid.\n var r1 = this._rowSections.indexOf(sy);\n var c1 = this._columnSections.indexOf(sx);\n // Bail early if there are no visible cells.\n if (r1 < 0 || c1 < 0) {\n return;\n }\n // Fetch the extra geometry.\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n var pw = this.pageWidth;\n var ph = this.pageHeight;\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n // Get the last visible cell of the grid.\n var r2 = this._rowSections.indexOf(sy + ph);\n var c2 = this._columnSections.indexOf(sx + pw);\n // Fetch the max row and column.\n var maxRow = this._rowSections.count - 1;\n var maxColumn = this._columnSections.count - 1;\n // Clamp the last cell if the void space is visible.\n r2 = r2 < 0 ? maxRow : r2;\n c2 = c2 < 0 ? maxColumn : c2;\n // Fetch the overlay gc.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Set up the body clipping rect.\n gc.beginPath();\n gc.rect(hw, hh, pw, ph);\n gc.clip();\n // Set up the gc style.\n if (fill) {\n gc.fillStyle = fill;\n }\n if (stroke) {\n gc.strokeStyle = stroke;\n gc.lineWidth = 1;\n }\n // Iterate over the selections.\n var it = model.selections();\n var s;\n while ((s = it.next()) !== undefined) {\n // Skip the section if it's not visible.\n if (s.r1 < r1 && s.r2 < r1) {\n continue;\n }\n if (s.r1 > r2 && s.r2 > r2) {\n continue;\n }\n if (s.c1 < c1 && s.c2 < c1) {\n continue;\n }\n if (s.c1 > c2 && s.c2 > c2) {\n continue;\n }\n // Clamp the cell to the model bounds.\n var sr1 = Math.max(0, Math.min(s.r1, maxRow));\n var sc1 = Math.max(0, Math.min(s.c1, maxColumn));\n var sr2 = Math.max(0, Math.min(s.r2, maxRow));\n var sc2 = Math.max(0, Math.min(s.c2, maxColumn));\n // Swap index order if needed.\n var tmp = void 0;\n if (sr1 > sr2) {\n tmp = sr1;\n sr1 = sr2;\n sr2 = tmp;\n }\n if (sc1 > sc2) {\n tmp = sc1;\n sc1 = sc2;\n sc2 = tmp;\n }\n // Convert to pixel coordinates.\n var x1 = this._columnSections.offsetOf(sc1) - sx + hw;\n var y1 = this._rowSections.offsetOf(sr1) - sy + hh;\n var x2 = this._columnSections.extentOf(sc2) - sx + hw;\n var y2 = this._rowSections.extentOf(sr2) - sy + hh;\n // Adjust the trailing X coordinate for column stretch.\n if (this._stretchLastColumn && pw > bw && sc2 === maxColumn) {\n x2 = hw + pw - 1;\n }\n // Adjust the trailing Y coordinate for row stretch.\n if (this._stretchLastRow && ph > bh && sr2 === maxRow) {\n y2 = hh + ph - 1;\n }\n // Clamp the bounds to just outside of the clipping rect.\n x1 = Math.max(hw - 1, x1);\n y1 = Math.max(hh - 1, y1);\n x2 = Math.min(hw + pw + 1, x2);\n y2 = Math.min(hh + ph + 1, y2);\n // Skip zero sized ranges.\n if (x2 < x1 || y2 < y1) {\n continue;\n }\n // Fill the rect if needed.\n if (fill) {\n gc.fillRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n }\n // Stroke the rect if needed.\n if (stroke) {\n gc.strokeRect(x1 - .5, y1 - .5, x2 - x1 + 1, y2 - y1 + 1);\n }\n }\n // Restore the gc state.\n gc.restore();\n };\n /**\n * Draw the row header selections for the data grid.\n */\n DataGrid.prototype._drawRowHeaderSelections = function () {\n // Fetch the selection model.\n var model = this._selectionModel;\n // Bail early if there are no selections or if the selectionMode is the entire column.\n if (!model || model.isEmpty || model.selectionMode == 'column') {\n return;\n }\n // Bail early if the row headers are not visible.\n if (this.headerWidth === 0 || this.pageHeight === 0) {\n return;\n }\n // Fetch the selection colors.\n var fill = this._style.headerSelectionFillColor;\n var stroke = this._style.headerSelectionBorderColor;\n // Bail early if there is nothing to draw.\n if (!fill && !stroke) {\n return;\n }\n // Fetch common geometry.\n var sy = this._scrollY;\n var bh = this.bodyHeight;\n var ph = this.pageHeight;\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n var rs = this._rowSections;\n // Fetch the overlay gc.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Set up the header clipping rect.\n gc.beginPath();\n gc.rect(0, hh, hw, ph);\n gc.clip();\n // Set up the gc style.\n if (fill) {\n gc.fillStyle = fill;\n }\n if (stroke) {\n gc.strokeStyle = stroke;\n gc.lineWidth = 1;\n }\n // Fetch the max row.\n var maxRow = rs.count - 1;\n // Fetch the visible rows.\n var r1 = rs.indexOf(sy);\n var r2 = rs.indexOf(sy + ph - 1);\n r2 = r2 < 0 ? maxRow : r2;\n // Iterate over the visible rows.\n for (var j = r1; j <= r2; ++j) {\n // Skip rows which aren't selected.\n if (!model.isRowSelected(j)) {\n continue;\n }\n // Get the dimensions of the row.\n var y = rs.offsetOf(j) - sy + hh;\n var h = rs.sizeOf(j);\n // Adjust the height for row stretch.\n if (this._stretchLastRow && ph > bh && j === maxRow) {\n h = hh + ph - y;\n }\n // Skip zero sized rows.\n if (h === 0) {\n continue;\n }\n // Fill the rect if needed.\n if (fill) {\n gc.fillRect(0, y, hw, h);\n }\n // Draw the border if needed.\n if (stroke) {\n gc.beginPath();\n gc.moveTo(hw - .5, y - 1);\n gc.lineTo(hw - .5, y + h);\n gc.stroke();\n }\n }\n // Restore the gc state.\n gc.restore();\n };\n /**\n * Draw the column header selections for the data grid.\n */\n DataGrid.prototype._drawColumnHeaderSelections = function () {\n // Fetch the selection model.\n var model = this._selectionModel;\n // Bail early if there are no selections or if the selectionMode is the entire row\n if (!model || model.isEmpty || model.selectionMode == 'row') {\n return;\n }\n // Bail early if the column headers are not visible.\n if (this.headerHeight === 0 || this.pageWidth === 0) {\n return;\n }\n // Fetch the selection colors.\n var fill = this._style.headerSelectionFillColor;\n var stroke = this._style.headerSelectionBorderColor;\n // Bail early if there is nothing to draw.\n if (!fill && !stroke) {\n return;\n }\n // Fetch common geometry.\n var sx = this._scrollX;\n var bw = this.bodyWidth;\n var pw = this.pageWidth;\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n var cs = this._columnSections;\n // Fetch the overlay gc.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Set up the header clipping rect.\n gc.beginPath();\n gc.rect(hw, 0, pw, hh);\n gc.clip();\n // Set up the gc style.\n if (fill) {\n gc.fillStyle = fill;\n }\n if (stroke) {\n gc.strokeStyle = stroke;\n gc.lineWidth = 1;\n }\n // Fetch the max column.\n var maxCol = cs.count - 1;\n // Fetch the visible columns.\n var c1 = cs.indexOf(sx);\n var c2 = cs.indexOf(sx + pw - 1);\n c2 = c2 < 0 ? maxCol : c2;\n // Iterate over the visible columns.\n for (var i = c1; i <= c2; ++i) {\n // Skip columns which aren't selected.\n if (!model.isColumnSelected(i)) {\n continue;\n }\n // Get the dimensions of the column.\n var x = cs.offsetOf(i) - sx + hw;\n var w = cs.sizeOf(i);\n // Adjust the width for column stretch.\n if (this._stretchLastColumn && pw > bw && i === maxCol) {\n w = hw + pw - x;\n }\n // Skip zero sized columns.\n if (w === 0) {\n continue;\n }\n // Fill the rect if needed.\n if (fill) {\n gc.fillRect(x, 0, w, hh);\n }\n // Draw the border if needed.\n if (stroke) {\n gc.beginPath();\n gc.moveTo(x - 1, hh - .5);\n gc.lineTo(x + w, hh - .5);\n gc.stroke();\n }\n }\n // Restore the gc state.\n gc.restore();\n };\n /**\n * Draw the overlay cursor for the data grid.\n */\n DataGrid.prototype._drawCursor = function () {\n // Fetch the selection model.\n var model = this._selectionModel;\n // Bail early if there is no cursor.\n if (!model || model.isEmpty || model.selectionMode !== 'cell') {\n return;\n }\n // Extract the style information.\n var fill = this._style.cursorFillColor;\n var stroke = this._style.cursorBorderColor;\n // Bail early if there is nothing to draw.\n if (!fill && !stroke) {\n return;\n }\n // Fetch the cursor location.\n var row = model.cursorRow;\n var column = model.cursorColumn;\n // Fetch the max row and column.\n var maxRow = this._rowSections.count - 1;\n var maxColumn = this._columnSections.count - 1;\n // Bail early if the cursor is out of bounds.\n if (row < 0 || row > maxRow) {\n return;\n }\n if (column < 0 || column > maxColumn) {\n return;\n }\n // Fetch geometry.\n var sx = this._scrollX;\n var sy = this._scrollY;\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n var pw = this.pageWidth;\n var ph = this.pageHeight;\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // Get the cursor bounds in viewport coordinates.\n var x1 = this._columnSections.offsetOf(column) - sx + hw;\n var x2 = this._columnSections.extentOf(column) - sx + hw;\n var y1 = this._rowSections.offsetOf(row) - sy + hh;\n var y2 = this._rowSections.extentOf(row) - sy + hh;\n // Adjust the trailing X coordinate for column stretch.\n if (this._stretchLastColumn && pw > bw && column === maxColumn) {\n x2 = vw - 1;\n }\n // Adjust the trailing Y coordinate for row stretch.\n if (this._stretchLastRow && ph > bh && row === maxRow) {\n y2 = vh - 1;\n }\n // Skip zero sized cursors.\n if (x2 < x1 || y2 < y1) {\n return;\n }\n // Bail early if the cursor is off the screen.\n if ((x1 - 1) >= vw || (y1 - 1) >= vh || (x2 + 1) < hw || (y2 + 1) < hh) {\n return;\n }\n // Fetch the overlay gc.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Set up the body clipping rect.\n gc.beginPath();\n gc.rect(hw, hh, pw, ph);\n gc.clip();\n // Clear any existing overlay content.\n gc.clearRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n // Fill the cursor rect if needed.\n if (fill) {\n // Set up the fill style.\n gc.fillStyle = fill;\n // Fill the cursor rect.\n gc.fillRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);\n }\n // Stroke the cursor border if needed.\n if (stroke) {\n // Set up the stroke style.\n gc.strokeStyle = stroke;\n gc.lineWidth = 2;\n // Stroke the cursor rect.\n gc.strokeRect(x1, y1, x2 - x1, y2 - y1);\n }\n // Restore the gc state.\n gc.restore();\n };\n /**\n * Draw the overlay shadows for the data grid.\n */\n DataGrid.prototype._drawShadows = function () {\n // Fetch the scroll shadow from the style.\n var shadow = this._style.scrollShadow;\n // Bail early if there is no shadow to draw.\n if (!shadow) {\n return;\n }\n // Fetch the scroll position.\n var sx = this._scrollX;\n var sy = this._scrollY;\n // Fetch maximum scroll position.\n var sxMax = this.maxScrollX;\n var syMax = this.maxScrollY;\n // Fetch the header width and height.\n var hw = this.headerWidth;\n var hh = this.headerHeight;\n // Fetch the page width and height.\n var pw = this.pageWidth;\n var ph = this.pageHeight;\n // Fetch the viewport width and height.\n var vw = this._viewportWidth;\n var vh = this._viewportHeight;\n // Fetch the body width and height.\n var bw = this.bodyWidth;\n var bh = this.bodyHeight;\n // Adjust the body size for row and column stretch.\n if (this._stretchLastRow && ph > bh) {\n bh = ph;\n }\n if (this._stretchLastColumn && pw > bw) {\n bw = pw;\n }\n // Fetch the gc object.\n var gc = this._overlayGC;\n // Save the gc state.\n gc.save();\n // Draw the column header shadow if needed.\n if (sy > 0) {\n // Set up the gradient coordinates.\n var x0 = 0;\n var y0 = hh;\n var x1 = 0;\n var y1 = y0 + shadow.size;\n // Create the gradient object.\n var grad = gc.createLinearGradient(x0, y0, x1, y1);\n // Set the gradient stops.\n grad.addColorStop(0, shadow.color1);\n grad.addColorStop(0.5, shadow.color2);\n grad.addColorStop(1, shadow.color3);\n // Set up the rect coordinates.\n var x = 0;\n var y = hh;\n var w = hw + Math.min(pw, bw - sx);\n var h = shadow.size;\n // Fill the shadow rect with the fill style.\n gc.fillStyle = grad;\n gc.fillRect(x, y, w, h);\n }\n // Draw the row header shadow if needed.\n if (sx > 0) {\n // Set up the gradient coordinates.\n var x0 = hw;\n var y0 = 0;\n var x1 = x0 + shadow.size;\n var y1 = 0;\n // Create the gradient object.\n var grad = gc.createLinearGradient(x0, y0, x1, y1);\n // Set the gradient stops.\n grad.addColorStop(0, shadow.color1);\n grad.addColorStop(0.5, shadow.color2);\n grad.addColorStop(1, shadow.color3);\n // Set up the rect coordinates.\n var x = hw;\n var y = 0;\n var w = shadow.size;\n var h = hh + Math.min(ph, bh - sy);\n // Fill the shadow rect with the fill style.\n gc.fillStyle = grad;\n gc.fillRect(x, y, w, h);\n }\n // Draw the column footer shadow if needed.\n if (sy < syMax) {\n // Set up the gradient coordinates.\n var x0 = 0;\n var y0 = vh;\n var x1 = 0;\n var y1 = vh - shadow.size;\n // Create the gradient object.\n var grad = gc.createLinearGradient(x0, y0, x1, y1);\n // Set the gradient stops.\n grad.addColorStop(0, shadow.color1);\n grad.addColorStop(0.5, shadow.color2);\n grad.addColorStop(1, shadow.color3);\n // Set up the rect coordinates.\n var x = 0;\n var y = vh - shadow.size;\n var w = hw + Math.min(pw, bw - sx);\n var h = shadow.size;\n // Fill the shadow rect with the fill style.\n gc.fillStyle = grad;\n gc.fillRect(x, y, w, h);\n }\n // Draw the row footer shadow if needed.\n if (sx < sxMax) {\n // Set up the gradient coordinates.\n var x0 = vw;\n var y0 = 0;\n var x1 = vw - shadow.size;\n var y1 = 0;\n // Create the gradient object.\n var grad = gc.createLinearGradient(x0, y0, x1, y1);\n // Set the gradient stops.\n grad.addColorStop(0, shadow.color1);\n grad.addColorStop(0.5, shadow.color2);\n grad.addColorStop(1, shadow.color3);\n // Set up the rect coordinates.\n var x = vw - shadow.size;\n var y = 0;\n var w = shadow.size;\n var h = hh + Math.min(ph, bh - sy);\n // Fill the shadow rect with the fill style.\n gc.fillStyle = grad;\n gc.fillRect(x, y, w, h);\n }\n // Restore the gc state.\n gc.restore();\n };\n return DataGrid;\n}(widgets.Widget));\n/**\n * The namespace for the `DataGrid` class statics.\n */\n(function (DataGrid) {\n /**\n * A generic format function for the copy handler.\n *\n * @param args - The format args for the function.\n *\n * @returns The string representation of the value.\n *\n * #### Notes\n * This function uses `String()` to coerce a value to a string.\n */\n function copyFormatGeneric(args) {\n if (args.value === null || args.value === undefined) {\n return '';\n }\n return String(args.value);\n }\n DataGrid.copyFormatGeneric = copyFormatGeneric;\n /**\n * The default theme for a data grid.\n */\n DataGrid.defaultStyle = {\n voidColor: '#F3F3F3',\n backgroundColor: '#FFFFFF',\n gridLineColor: 'rgba(20, 20, 20, 0.15)',\n headerBackgroundColor: '#F3F3F3',\n headerGridLineColor: 'rgba(20, 20, 20, 0.25)',\n selectionFillColor: 'rgba(49, 119, 229, 0.2)',\n selectionBorderColor: 'rgba(0, 107, 247, 1.0)',\n cursorBorderColor: 'rgba(0, 107, 247, 1.0)',\n headerSelectionFillColor: 'rgba(20, 20, 20, 0.1)',\n headerSelectionBorderColor: 'rgba(0, 107, 247, 1.0)',\n scrollShadow: {\n size: 10,\n color1: 'rgba(0, 0, 0, 0.20)',\n color2: 'rgba(0, 0, 0, 0.05)',\n color3: 'rgba(0, 0, 0, 0.00)'\n }\n };\n /**\n * The default sizes for a data grid.\n */\n DataGrid.defaultSizes = {\n rowHeight: 20,\n columnWidth: 64,\n rowHeaderWidth: 64,\n columnHeaderHeight: 20\n };\n /**\n * The default minimum sizes for a data grid.\n */\n DataGrid.minimumSizes = {\n rowHeight: 20,\n columnWidth: 10,\n rowHeaderWidth: 10,\n columnHeaderHeight: 20\n };\n /**\n * The default copy config for a data grid.\n */\n DataGrid.defaultCopyConfig = {\n separator: '\\t',\n format: copyFormatGeneric,\n headers: 'none',\n warningThreshold: 1e6\n };\n})(exports.DataGrid || (exports.DataGrid = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A singleton `scroll-request` conflatable message.\n */\n Private.ScrollRequest = new messaging.ConflatableMessage('scroll-request');\n /**\n * A singleton `section-resize-request` conflatable message.\n */\n Private.SectionResizeRequest = new messaging.ConflatableMessage('section-resize-request');\n /**\n * A singleton `overlay-paint-request` conflatable message.\n */\n Private.OverlayPaintRequest = new messaging.ConflatableMessage('overlay-paint-request');\n /**\n * Create a new zero-sized canvas element.\n */\n function createCanvas() {\n var canvas = document.createElement('canvas');\n canvas.width = 0;\n canvas.height = 0;\n return canvas;\n }\n Private.createCanvas = createCanvas;\n /**\n * A conflatable message which merges dirty paint regions.\n */\n var PaintRequest = /** @class */ (function (_super) {\n tslib.__extends(PaintRequest, _super);\n /**\n * Construct a new paint request messages.\n *\n * @param region - The cell region for the paint.\n *\n * @param r1 - The top-left row of the dirty region.\n *\n * @param c1 - The top-left column of the dirty region.\n *\n * @param r2 - The bottom-right row of the dirty region.\n *\n * @param c2 - The bottom-right column of the dirty region.\n */\n function PaintRequest(region, r1, c1, r2, c2) {\n var _this = _super.call(this, 'paint-request') || this;\n _this._region = region;\n _this._r1 = r1;\n _this._c1 = c1;\n _this._r2 = r2;\n _this._c2 = c2;\n return _this;\n }\n Object.defineProperty(PaintRequest.prototype, \"region\", {\n /**\n * The cell region for the paint.\n */\n get: function () {\n return this._region;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PaintRequest.prototype, \"r1\", {\n /**\n * The top-left row of the dirty region.\n */\n get: function () {\n return this._r1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PaintRequest.prototype, \"c1\", {\n /**\n * The top-left column of the dirty region.\n */\n get: function () {\n return this._c1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PaintRequest.prototype, \"r2\", {\n /**\n * The bottom-right row of the dirty region.\n */\n get: function () {\n return this._r2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PaintRequest.prototype, \"c2\", {\n /**\n * The bottom-right column of the dirty region.\n */\n get: function () {\n return this._c2;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another paint request.\n */\n PaintRequest.prototype.conflate = function (other) {\n // Bail early if the request is already painting everything.\n if (this._region === 'all') {\n return true;\n }\n // Any region can conflate with the `'all'` region.\n if (other._region === 'all') {\n this._region = 'all';\n return true;\n }\n // Otherwise, do not conflate with a different region.\n if (this._region !== other._region) {\n return false;\n }\n // Conflate the region to the total boundary.\n this._r1 = Math.min(this._r1, other._r1);\n this._c1 = Math.min(this._c1, other._c1);\n this._r2 = Math.max(this._r2, other._r2);\n this._c2 = Math.max(this._c2, other._c2);\n return true;\n };\n return PaintRequest;\n }(messaging.ConflatableMessage));\n Private.PaintRequest = PaintRequest;\n /**\n * A conflatable message for resizing rows.\n */\n var RowResizeRequest = /** @class */ (function (_super) {\n tslib.__extends(RowResizeRequest, _super);\n /**\n * Construct a new row resize request.\n *\n * @param region - The row region which holds the section.\n *\n * @param index - The index of row in the region.\n *\n * @param size - The target size of the section.\n */\n function RowResizeRequest(region, index, size) {\n var _this = _super.call(this, 'row-resize-request') || this;\n _this._region = region;\n _this._index = index;\n _this._size = size;\n return _this;\n }\n Object.defineProperty(RowResizeRequest.prototype, \"region\", {\n /**\n * The row region which holds the section.\n */\n get: function () {\n return this._region;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RowResizeRequest.prototype, \"index\", {\n /**\n * The index of the row in the region.\n */\n get: function () {\n return this._index;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RowResizeRequest.prototype, \"size\", {\n /**\n * The target size of the section.\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another row resize request.\n */\n RowResizeRequest.prototype.conflate = function (other) {\n if (this._region !== other._region || this._index !== other._index) {\n return false;\n }\n this._size = other._size;\n return true;\n };\n return RowResizeRequest;\n }(messaging.ConflatableMessage));\n Private.RowResizeRequest = RowResizeRequest;\n /**\n * A conflatable message for resizing columns.\n */\n var ColumnResizeRequest = /** @class */ (function (_super) {\n tslib.__extends(ColumnResizeRequest, _super);\n /**\n * Construct a new column resize request.\n *\n * @param region - The column region which holds the section.\n *\n * @param index - The index of column in the region.\n *\n * @param size - The target size of the section.\n */\n function ColumnResizeRequest(region, index, size) {\n var _this = _super.call(this, 'column-resize-request') || this;\n _this._region = region;\n _this._index = index;\n _this._size = size;\n return _this;\n }\n Object.defineProperty(ColumnResizeRequest.prototype, \"region\", {\n /**\n * The column region which holds the section.\n */\n get: function () {\n return this._region;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColumnResizeRequest.prototype, \"index\", {\n /**\n * The index of the column in the region.\n */\n get: function () {\n return this._index;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColumnResizeRequest.prototype, \"size\", {\n /**\n * The target size of the section.\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another column resize request.\n */\n ColumnResizeRequest.prototype.conflate = function (other) {\n if (this._region !== other._region || this._index !== other._index) {\n return false;\n }\n this._size = other._size;\n return true;\n };\n return ColumnResizeRequest;\n }(messaging.ConflatableMessage));\n Private.ColumnResizeRequest = ColumnResizeRequest;\n})(Private || (Private = {}));\n//# sourceMappingURL=datagrid.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/datagrid.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/datamodel.js": │ │ │ │ /*!**********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/datamodel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/datamodel.js ***! │ │ │ │ \**********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n/**\n * An object which provides the data for a data grid.\n *\n * #### Notes\n * If the predefined data models are insufficient for a particular use\n * case, a custom model can be defined which derives from this class.\n */\nexports.DataModel = /** @class */ (function () {\n function DataModel() {\n this._changed = new signaling.Signal(this);\n }\n Object.defineProperty(DataModel.prototype, \"changed\", {\n /**\n * A signal emitted when the data model has changed.\n */\n get: function () {\n return this._changed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the metadata for a cell in the data model.\n *\n * @param region - The cell region of interest.\n *\n * @param row - The row index of the cell of interest.\n *\n * @param column - The column index of the cell of interest.\n *\n * @returns The metadata for the specified cell.\n *\n * #### Notes\n * The returned metadata should be treated as immutable.\n *\n * This method is called often, and so should be efficient.\n *\n * The default implementation returns `{}`.\n */\n DataModel.prototype.metadata = function (region, row, column) {\n return DataModel.emptyMetadata;\n };\n /**\n * Emit the `changed` signal for the data model.\n *\n * #### Notes\n * Subclasses should call this method whenever the data model has\n * changed so that attached data grids can update themselves.\n */\n DataModel.prototype.emitChanged = function (args) {\n this._changed.emit(args);\n };\n return DataModel;\n}());\n/**\n * An object which provides the mutable data for a data grid.\n *\n * #### Notes\n * This object is an extension to `DataModel` and it only adds ability to\n * change data for cells.\n */\nvar MutableDataModel = /** @class */ (function (_super) {\n tslib.__extends(MutableDataModel, _super);\n function MutableDataModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return MutableDataModel;\n}(exports.DataModel));\n/**\n * The namespace for the `DataModel` class statics.\n */\n(function (DataModel) {\n /**\n * A singleton empty metadata object.\n */\n DataModel.emptyMetadata = Object.freeze({});\n})(exports.DataModel || (exports.DataModel = {}));\n\nexports.MutableDataModel = MutableDataModel;\n//# sourceMappingURL=datamodel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/datamodel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n/**\n * An object which provides the data for a data grid.\n *\n * #### Notes\n * If the predefined data models are insufficient for a particular use\n * case, a custom model can be defined which derives from this class.\n */\nexports.DataModel = /** @class */ (function () {\n function DataModel() {\n this._changed = new signaling.Signal(this);\n }\n Object.defineProperty(DataModel.prototype, \"changed\", {\n /**\n * A signal emitted when the data model has changed.\n */\n get: function () {\n return this._changed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the metadata for a cell in the data model.\n *\n * @param region - The cell region of interest.\n *\n * @param row - The row index of the cell of interest.\n *\n * @param column - The column index of the cell of interest.\n *\n * @returns The metadata for the specified cell.\n *\n * #### Notes\n * The returned metadata should be treated as immutable.\n *\n * This method is called often, and so should be efficient.\n *\n * The default implementation returns `{}`.\n */\n DataModel.prototype.metadata = function (region, row, column) {\n return DataModel.emptyMetadata;\n };\n /**\n * Emit the `changed` signal for the data model.\n *\n * #### Notes\n * Subclasses should call this method whenever the data model has\n * changed so that attached data grids can update themselves.\n */\n DataModel.prototype.emitChanged = function (args) {\n this._changed.emit(args);\n };\n return DataModel;\n}());\n/**\n * An object which provides the mutable data for a data grid.\n *\n * #### Notes\n * This object is an extension to `DataModel` and it only adds ability to\n * change data for cells.\n */\nvar MutableDataModel = /** @class */ (function (_super) {\n tslib.__extends(MutableDataModel, _super);\n function MutableDataModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return MutableDataModel;\n}(exports.DataModel));\n/**\n * The namespace for the `DataModel` class statics.\n */\n(function (DataModel) {\n /**\n * A singleton empty metadata object.\n */\n DataModel.emptyMetadata = Object.freeze({});\n})(exports.DataModel || (exports.DataModel = {}));\n\nexports.MutableDataModel = MutableDataModel;\n//# sourceMappingURL=datamodel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/datamodel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/graphicscontext.js": │ │ │ │ /*!****************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/graphicscontext.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/graphicscontext.js ***! │ │ │ │ \****************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * A thin caching wrapper around a 2D canvas rendering context.\n *\n * #### Notes\n * This class is mostly a transparent wrapper around a canvas rendering\n * context which improves performance when writing context state.\n *\n * For best performance, avoid reading state from the `gc`. Writes are\n * cached based on the previously written value.\n *\n * Unless otherwise specified, the API and semantics of this class are\n * identical to the builtin 2D canvas rendering context:\n * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D\n *\n * The wrapped canvas context should not be manipulated externally\n * until the wrapping `GraphicsContext` object is disposed.\n */\nvar GraphicsContext = /** @class */ (function () {\n /**\n * Create a new graphics context object.\n *\n * @param context - The 2D canvas rendering context to wrap.\n */\n function GraphicsContext(context) {\n this._disposed = false;\n this._context = context;\n this._state = Private.State.create(context);\n }\n GraphicsContext.prototype.dispose = function () {\n // Bail if the gc is already disposed.\n if (this._disposed) {\n return;\n }\n // Mark the gc as disposed.\n this._disposed = true;\n // Pop any unrestored saves.\n while (this._state.next) {\n this._state = this._state.next;\n this._context.restore();\n }\n };\n Object.defineProperty(GraphicsContext.prototype, \"isDisposed\", {\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"fillStyle\", {\n get: function () {\n return this._context.fillStyle;\n },\n set: function (value) {\n if (this._state.fillStyle !== value) {\n this._state.fillStyle = value;\n this._context.fillStyle = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"strokeStyle\", {\n get: function () {\n return this._context.strokeStyle;\n },\n set: function (value) {\n if (this._state.strokeStyle !== value) {\n this._state.strokeStyle = value;\n this._context.strokeStyle = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"font\", {\n get: function () {\n return this._context.font;\n },\n set: function (value) {\n if (this._state.font !== value) {\n this._state.font = value;\n this._context.font = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"textAlign\", {\n get: function () {\n return this._context.textAlign;\n },\n set: function (value) {\n if (this._state.textAlign !== value) {\n this._state.textAlign = value;\n this._context.textAlign = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"textBaseline\", {\n get: function () {\n return this._context.textBaseline;\n },\n set: function (value) {\n if (this._state.textBaseline !== value) {\n this._state.textBaseline = value;\n this._context.textBaseline = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"lineCap\", {\n get: function () {\n return this._context.lineCap;\n },\n set: function (value) {\n if (this._state.lineCap !== value) {\n this._state.lineCap = value;\n this._context.lineCap = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"lineDashOffset\", {\n get: function () {\n return this._context.lineDashOffset;\n },\n set: function (value) {\n if (this._state.lineDashOffset !== value) {\n this._state.lineDashOffset = value;\n this._context.lineDashOffset = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"lineJoin\", {\n get: function () {\n return this._context.lineJoin;\n },\n set: function (value) {\n if (this._state.lineJoin !== value) {\n this._state.lineJoin = value;\n this._context.lineJoin = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"lineWidth\", {\n get: function () {\n return this._context.lineWidth;\n },\n set: function (value) {\n if (this._state.lineWidth !== value) {\n this._state.lineWidth = value;\n this._context.lineWidth = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"miterLimit\", {\n get: function () {\n return this._context.miterLimit;\n },\n set: function (value) {\n if (this._state.miterLimit !== value) {\n this._state.miterLimit = value;\n this._context.miterLimit = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"shadowBlur\", {\n get: function () {\n return this._context.shadowBlur;\n },\n set: function (value) {\n if (this._state.shadowBlur !== value) {\n this._state.shadowBlur = value;\n this._context.shadowBlur = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"shadowColor\", {\n get: function () {\n return this._context.shadowColor;\n },\n set: function (value) {\n if (this._state.shadowColor !== value) {\n this._state.shadowColor = value;\n this._context.shadowColor = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"shadowOffsetX\", {\n get: function () {\n return this._context.shadowOffsetX;\n },\n set: function (value) {\n if (this._state.shadowOffsetX !== value) {\n this._state.shadowOffsetX = value;\n this._context.shadowOffsetX = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"shadowOffsetY\", {\n get: function () {\n return this._context.shadowOffsetY;\n },\n set: function (value) {\n if (this._state.shadowOffsetY !== value) {\n this._state.shadowOffsetY = value;\n this._context.shadowOffsetY = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"imageSmoothingEnabled\", {\n get: function () {\n return this._context.imageSmoothingEnabled;\n },\n set: function (value) {\n if (this._state.imageSmoothingEnabled !== value) {\n this._state.imageSmoothingEnabled = value;\n this._context.imageSmoothingEnabled = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"globalAlpha\", {\n get: function () {\n return this._context.globalAlpha;\n },\n set: function (value) {\n if (this._state.globalAlpha !== value) {\n this._state.globalAlpha = value;\n this._context.globalAlpha = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"globalCompositeOperation\", {\n get: function () {\n return this._context.globalCompositeOperation;\n },\n set: function (value) {\n if (this._state.globalCompositeOperation !== value) {\n this._state.globalCompositeOperation = value;\n this._context.globalCompositeOperation = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n GraphicsContext.prototype.getLineDash = function () {\n return this._context.getLineDash();\n };\n GraphicsContext.prototype.setLineDash = function (segments) {\n this._context.setLineDash(segments);\n };\n GraphicsContext.prototype.rotate = function (angle) {\n this._context.rotate(angle);\n };\n GraphicsContext.prototype.scale = function (x, y) {\n this._context.scale(x, y);\n };\n GraphicsContext.prototype.transform = function (m11, m12, m21, m22, dx, dy) {\n this._context.transform(m11, m12, m21, m22, dx, dy);\n };\n GraphicsContext.prototype.translate = function (x, y) {\n this._context.translate(x, y);\n };\n GraphicsContext.prototype.setTransform = function (m11, m12, m21, m22, dx, dy) {\n this._context.setTransform(m11, m12, m21, m22, dx, dy);\n };\n GraphicsContext.prototype.save = function () {\n // Clone an push the current state to the stack.\n this._state = Private.State.push(this._state);\n // Save the wrapped context state.\n this._context.save();\n };\n GraphicsContext.prototype.restore = function () {\n // Bail if there is no state to restore.\n if (!this._state.next) {\n return;\n }\n // Pop the saved state from the stack.\n this._state = Private.State.pop(this._state);\n // Restore the wrapped context state.\n this._context.restore();\n };\n GraphicsContext.prototype.beginPath = function () {\n return this._context.beginPath();\n };\n GraphicsContext.prototype.closePath = function () {\n this._context.closePath();\n };\n GraphicsContext.prototype.isPointInPath = function (x, y, fillRule) {\n var result;\n if (arguments.length === 2) {\n result = this._context.isPointInPath(x, y);\n }\n else {\n result = this._context.isPointInPath(x, y, fillRule);\n }\n return result;\n };\n GraphicsContext.prototype.arc = function (x, y, radius, startAngle, endAngle, anticlockwise) {\n if (arguments.length === 5) {\n this._context.arc(x, y, radius, startAngle, endAngle);\n }\n else {\n this._context.arc(x, y, radius, startAngle, endAngle, anticlockwise);\n }\n };\n GraphicsContext.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n this._context.arcTo(x1, y1, x2, y2, radius);\n };\n GraphicsContext.prototype.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n };\n GraphicsContext.prototype.ellipse = function (x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {\n if (arguments.length === 7) {\n this._context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle);\n }\n else {\n this._context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);\n }\n };\n GraphicsContext.prototype.lineTo = function (x, y) {\n this._context.lineTo(x, y);\n };\n GraphicsContext.prototype.moveTo = function (x, y) {\n this._context.moveTo(x, y);\n };\n GraphicsContext.prototype.quadraticCurveTo = function (cpx, cpy, x, y) {\n this._context.quadraticCurveTo(cpx, cpy, x, y);\n };\n GraphicsContext.prototype.rect = function (x, y, w, h) {\n this._context.rect(x, y, w, h);\n };\n GraphicsContext.prototype.clip = function (fillRule) {\n if (arguments.length === 0) {\n this._context.clip();\n }\n else {\n this._context.clip(fillRule);\n }\n };\n GraphicsContext.prototype.fill = function (fillRule) {\n if (arguments.length === 0) {\n this._context.fill();\n }\n else {\n this._context.fill(fillRule);\n }\n };\n GraphicsContext.prototype.stroke = function () {\n this._context.stroke();\n };\n GraphicsContext.prototype.clearRect = function (x, y, w, h) {\n return this._context.clearRect(x, y, w, h);\n };\n GraphicsContext.prototype.fillRect = function (x, y, w, h) {\n this._context.fillRect(x, y, w, h);\n };\n GraphicsContext.prototype.fillText = function (text, x, y, maxWidth) {\n if (arguments.length === 3) {\n this._context.fillText(text, x, y);\n }\n else {\n this._context.fillText(text, x, y, maxWidth);\n }\n };\n GraphicsContext.prototype.strokeRect = function (x, y, w, h) {\n this._context.strokeRect(x, y, w, h);\n };\n GraphicsContext.prototype.strokeText = function (text, x, y, maxWidth) {\n if (arguments.length === 3) {\n this._context.strokeText(text, x, y);\n }\n else {\n this._context.strokeText(text, x, y, maxWidth);\n }\n };\n GraphicsContext.prototype.measureText = function (text) {\n return this._context.measureText(text);\n };\n GraphicsContext.prototype.createLinearGradient = function (x0, y0, x1, y1) {\n return this._context.createLinearGradient(x0, y0, x1, y1);\n };\n GraphicsContext.prototype.createRadialGradient = function (x0, y0, r0, x1, y1, r1) {\n return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);\n };\n GraphicsContext.prototype.createPattern = function (image, repetition) {\n return this._context.createPattern(image, repetition);\n };\n GraphicsContext.prototype.createImageData = function () {\n return this._context.createImageData.apply(this._context, arguments);\n };\n GraphicsContext.prototype.getImageData = function (sx, sy, sw, sh) {\n return this._context.getImageData(sx, sy, sw, sh);\n };\n GraphicsContext.prototype.putImageData = function () {\n this._context.putImageData.apply(this._context, arguments);\n };\n GraphicsContext.prototype.drawImage = function () {\n this._context.drawImage.apply(this._context, arguments);\n };\n GraphicsContext.prototype.drawFocusIfNeeded = function (element) {\n this._context.drawFocusIfNeeded(element);\n };\n return GraphicsContext;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The index of next valid pool object.\n */\n var pi = -1;\n /**\n * A state object allocation pool.\n */\n var pool = [];\n /**\n * An object which holds the state for a gc.\n */\n var State = /** @class */ (function () {\n function State() {\n }\n /**\n * Create a gc state object from a 2D canvas context.\n */\n State.create = function (context) {\n var state = pi < 0 ? new State() : pool[pi--];\n state.next = null;\n state.fillStyle = context.fillStyle;\n state.font = context.font;\n state.globalAlpha = context.globalAlpha;\n state.globalCompositeOperation = context.globalCompositeOperation;\n state.imageSmoothingEnabled = context.imageSmoothingEnabled;\n state.lineCap = context.lineCap;\n state.lineDashOffset = context.lineDashOffset;\n state.lineJoin = context.lineJoin;\n state.lineWidth = context.lineWidth;\n state.miterLimit = context.miterLimit;\n state.shadowBlur = context.shadowBlur;\n state.shadowColor = context.shadowColor;\n state.shadowOffsetX = context.shadowOffsetX;\n state.shadowOffsetY = context.shadowOffsetY;\n state.strokeStyle = context.strokeStyle;\n state.textAlign = context.textAlign;\n state.textBaseline = context.textBaseline;\n return state;\n };\n /**\n * Clone an existing gc state object and add it to the state stack.\n */\n State.push = function (other) {\n var state = pi < 0 ? new State() : pool[pi--];\n state.next = other;\n state.fillStyle = other.fillStyle;\n state.font = other.font;\n state.globalAlpha = other.globalAlpha;\n state.globalCompositeOperation = other.globalCompositeOperation;\n state.imageSmoothingEnabled = other.imageSmoothingEnabled;\n state.lineCap = other.lineCap;\n state.lineDashOffset = other.lineDashOffset;\n state.lineJoin = other.lineJoin;\n state.lineWidth = other.lineWidth;\n state.miterLimit = other.miterLimit;\n state.shadowBlur = other.shadowBlur;\n state.shadowColor = other.shadowColor;\n state.shadowOffsetX = other.shadowOffsetX;\n state.shadowOffsetY = other.shadowOffsetY;\n state.strokeStyle = other.strokeStyle;\n state.textAlign = other.textAlign;\n state.textBaseline = other.textBaseline;\n return state;\n };\n /**\n * Pop the next state object and return the current to the pool\n */\n State.pop = function (state) {\n state.fillStyle = '';\n state.strokeStyle = '';\n pool[++pi] = state;\n return state.next;\n };\n return State;\n }());\n Private.State = State;\n})(Private || (Private = {}));\n\nexports.GraphicsContext = GraphicsContext;\n//# sourceMappingURL=graphicscontext.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/graphicscontext.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * A thin caching wrapper around a 2D canvas rendering context.\n *\n * #### Notes\n * This class is mostly a transparent wrapper around a canvas rendering\n * context which improves performance when writing context state.\n *\n * For best performance, avoid reading state from the `gc`. Writes are\n * cached based on the previously written value.\n *\n * Unless otherwise specified, the API and semantics of this class are\n * identical to the builtin 2D canvas rendering context:\n * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D\n *\n * The wrapped canvas context should not be manipulated externally\n * until the wrapping `GraphicsContext` object is disposed.\n */\nvar GraphicsContext = /** @class */ (function () {\n /**\n * Create a new graphics context object.\n *\n * @param context - The 2D canvas rendering context to wrap.\n */\n function GraphicsContext(context) {\n this._disposed = false;\n this._context = context;\n this._state = Private.State.create(context);\n }\n GraphicsContext.prototype.dispose = function () {\n // Bail if the gc is already disposed.\n if (this._disposed) {\n return;\n }\n // Mark the gc as disposed.\n this._disposed = true;\n // Pop any unrestored saves.\n while (this._state.next) {\n this._state = this._state.next;\n this._context.restore();\n }\n };\n Object.defineProperty(GraphicsContext.prototype, \"isDisposed\", {\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"fillStyle\", {\n get: function () {\n return this._context.fillStyle;\n },\n set: function (value) {\n if (this._state.fillStyle !== value) {\n this._state.fillStyle = value;\n this._context.fillStyle = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"strokeStyle\", {\n get: function () {\n return this._context.strokeStyle;\n },\n set: function (value) {\n if (this._state.strokeStyle !== value) {\n this._state.strokeStyle = value;\n this._context.strokeStyle = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"font\", {\n get: function () {\n return this._context.font;\n },\n set: function (value) {\n if (this._state.font !== value) {\n this._state.font = value;\n this._context.font = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"textAlign\", {\n get: function () {\n return this._context.textAlign;\n },\n set: function (value) {\n if (this._state.textAlign !== value) {\n this._state.textAlign = value;\n this._context.textAlign = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"textBaseline\", {\n get: function () {\n return this._context.textBaseline;\n },\n set: function (value) {\n if (this._state.textBaseline !== value) {\n this._state.textBaseline = value;\n this._context.textBaseline = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"lineCap\", {\n get: function () {\n return this._context.lineCap;\n },\n set: function (value) {\n if (this._state.lineCap !== value) {\n this._state.lineCap = value;\n this._context.lineCap = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"lineDashOffset\", {\n get: function () {\n return this._context.lineDashOffset;\n },\n set: function (value) {\n if (this._state.lineDashOffset !== value) {\n this._state.lineDashOffset = value;\n this._context.lineDashOffset = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"lineJoin\", {\n get: function () {\n return this._context.lineJoin;\n },\n set: function (value) {\n if (this._state.lineJoin !== value) {\n this._state.lineJoin = value;\n this._context.lineJoin = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"lineWidth\", {\n get: function () {\n return this._context.lineWidth;\n },\n set: function (value) {\n if (this._state.lineWidth !== value) {\n this._state.lineWidth = value;\n this._context.lineWidth = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"miterLimit\", {\n get: function () {\n return this._context.miterLimit;\n },\n set: function (value) {\n if (this._state.miterLimit !== value) {\n this._state.miterLimit = value;\n this._context.miterLimit = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"shadowBlur\", {\n get: function () {\n return this._context.shadowBlur;\n },\n set: function (value) {\n if (this._state.shadowBlur !== value) {\n this._state.shadowBlur = value;\n this._context.shadowBlur = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"shadowColor\", {\n get: function () {\n return this._context.shadowColor;\n },\n set: function (value) {\n if (this._state.shadowColor !== value) {\n this._state.shadowColor = value;\n this._context.shadowColor = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"shadowOffsetX\", {\n get: function () {\n return this._context.shadowOffsetX;\n },\n set: function (value) {\n if (this._state.shadowOffsetX !== value) {\n this._state.shadowOffsetX = value;\n this._context.shadowOffsetX = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"shadowOffsetY\", {\n get: function () {\n return this._context.shadowOffsetY;\n },\n set: function (value) {\n if (this._state.shadowOffsetY !== value) {\n this._state.shadowOffsetY = value;\n this._context.shadowOffsetY = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"imageSmoothingEnabled\", {\n get: function () {\n return this._context.imageSmoothingEnabled;\n },\n set: function (value) {\n if (this._state.imageSmoothingEnabled !== value) {\n this._state.imageSmoothingEnabled = value;\n this._context.imageSmoothingEnabled = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"globalAlpha\", {\n get: function () {\n return this._context.globalAlpha;\n },\n set: function (value) {\n if (this._state.globalAlpha !== value) {\n this._state.globalAlpha = value;\n this._context.globalAlpha = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GraphicsContext.prototype, \"globalCompositeOperation\", {\n get: function () {\n return this._context.globalCompositeOperation;\n },\n set: function (value) {\n if (this._state.globalCompositeOperation !== value) {\n this._state.globalCompositeOperation = value;\n this._context.globalCompositeOperation = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n GraphicsContext.prototype.getLineDash = function () {\n return this._context.getLineDash();\n };\n GraphicsContext.prototype.setLineDash = function (segments) {\n this._context.setLineDash(segments);\n };\n GraphicsContext.prototype.rotate = function (angle) {\n this._context.rotate(angle);\n };\n GraphicsContext.prototype.scale = function (x, y) {\n this._context.scale(x, y);\n };\n GraphicsContext.prototype.transform = function (m11, m12, m21, m22, dx, dy) {\n this._context.transform(m11, m12, m21, m22, dx, dy);\n };\n GraphicsContext.prototype.translate = function (x, y) {\n this._context.translate(x, y);\n };\n GraphicsContext.prototype.setTransform = function (m11, m12, m21, m22, dx, dy) {\n this._context.setTransform(m11, m12, m21, m22, dx, dy);\n };\n GraphicsContext.prototype.save = function () {\n // Clone an push the current state to the stack.\n this._state = Private.State.push(this._state);\n // Save the wrapped context state.\n this._context.save();\n };\n GraphicsContext.prototype.restore = function () {\n // Bail if there is no state to restore.\n if (!this._state.next) {\n return;\n }\n // Pop the saved state from the stack.\n this._state = Private.State.pop(this._state);\n // Restore the wrapped context state.\n this._context.restore();\n };\n GraphicsContext.prototype.beginPath = function () {\n return this._context.beginPath();\n };\n GraphicsContext.prototype.closePath = function () {\n this._context.closePath();\n };\n GraphicsContext.prototype.isPointInPath = function (x, y, fillRule) {\n var result;\n if (arguments.length === 2) {\n result = this._context.isPointInPath(x, y);\n }\n else {\n result = this._context.isPointInPath(x, y, fillRule);\n }\n return result;\n };\n GraphicsContext.prototype.arc = function (x, y, radius, startAngle, endAngle, anticlockwise) {\n if (arguments.length === 5) {\n this._context.arc(x, y, radius, startAngle, endAngle);\n }\n else {\n this._context.arc(x, y, radius, startAngle, endAngle, anticlockwise);\n }\n };\n GraphicsContext.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n this._context.arcTo(x1, y1, x2, y2, radius);\n };\n GraphicsContext.prototype.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n };\n GraphicsContext.prototype.ellipse = function (x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {\n if (arguments.length === 7) {\n this._context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle);\n }\n else {\n this._context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);\n }\n };\n GraphicsContext.prototype.lineTo = function (x, y) {\n this._context.lineTo(x, y);\n };\n GraphicsContext.prototype.moveTo = function (x, y) {\n this._context.moveTo(x, y);\n };\n GraphicsContext.prototype.quadraticCurveTo = function (cpx, cpy, x, y) {\n this._context.quadraticCurveTo(cpx, cpy, x, y);\n };\n GraphicsContext.prototype.rect = function (x, y, w, h) {\n this._context.rect(x, y, w, h);\n };\n GraphicsContext.prototype.clip = function (fillRule) {\n if (arguments.length === 0) {\n this._context.clip();\n }\n else {\n this._context.clip(fillRule);\n }\n };\n GraphicsContext.prototype.fill = function (fillRule) {\n if (arguments.length === 0) {\n this._context.fill();\n }\n else {\n this._context.fill(fillRule);\n }\n };\n GraphicsContext.prototype.stroke = function () {\n this._context.stroke();\n };\n GraphicsContext.prototype.clearRect = function (x, y, w, h) {\n return this._context.clearRect(x, y, w, h);\n };\n GraphicsContext.prototype.fillRect = function (x, y, w, h) {\n this._context.fillRect(x, y, w, h);\n };\n GraphicsContext.prototype.fillText = function (text, x, y, maxWidth) {\n if (arguments.length === 3) {\n this._context.fillText(text, x, y);\n }\n else {\n this._context.fillText(text, x, y, maxWidth);\n }\n };\n GraphicsContext.prototype.strokeRect = function (x, y, w, h) {\n this._context.strokeRect(x, y, w, h);\n };\n GraphicsContext.prototype.strokeText = function (text, x, y, maxWidth) {\n if (arguments.length === 3) {\n this._context.strokeText(text, x, y);\n }\n else {\n this._context.strokeText(text, x, y, maxWidth);\n }\n };\n GraphicsContext.prototype.measureText = function (text) {\n return this._context.measureText(text);\n };\n GraphicsContext.prototype.createLinearGradient = function (x0, y0, x1, y1) {\n return this._context.createLinearGradient(x0, y0, x1, y1);\n };\n GraphicsContext.prototype.createRadialGradient = function (x0, y0, r0, x1, y1, r1) {\n return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);\n };\n GraphicsContext.prototype.createPattern = function (image, repetition) {\n return this._context.createPattern(image, repetition);\n };\n GraphicsContext.prototype.createImageData = function () {\n return this._context.createImageData.apply(this._context, arguments);\n };\n GraphicsContext.prototype.getImageData = function (sx, sy, sw, sh) {\n return this._context.getImageData(sx, sy, sw, sh);\n };\n GraphicsContext.prototype.putImageData = function () {\n this._context.putImageData.apply(this._context, arguments);\n };\n GraphicsContext.prototype.drawImage = function () {\n this._context.drawImage.apply(this._context, arguments);\n };\n GraphicsContext.prototype.drawFocusIfNeeded = function (element) {\n this._context.drawFocusIfNeeded(element);\n };\n return GraphicsContext;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The index of next valid pool object.\n */\n var pi = -1;\n /**\n * A state object allocation pool.\n */\n var pool = [];\n /**\n * An object which holds the state for a gc.\n */\n var State = /** @class */ (function () {\n function State() {\n }\n /**\n * Create a gc state object from a 2D canvas context.\n */\n State.create = function (context) {\n var state = pi < 0 ? new State() : pool[pi--];\n state.next = null;\n state.fillStyle = context.fillStyle;\n state.font = context.font;\n state.globalAlpha = context.globalAlpha;\n state.globalCompositeOperation = context.globalCompositeOperation;\n state.imageSmoothingEnabled = context.imageSmoothingEnabled;\n state.lineCap = context.lineCap;\n state.lineDashOffset = context.lineDashOffset;\n state.lineJoin = context.lineJoin;\n state.lineWidth = context.lineWidth;\n state.miterLimit = context.miterLimit;\n state.shadowBlur = context.shadowBlur;\n state.shadowColor = context.shadowColor;\n state.shadowOffsetX = context.shadowOffsetX;\n state.shadowOffsetY = context.shadowOffsetY;\n state.strokeStyle = context.strokeStyle;\n state.textAlign = context.textAlign;\n state.textBaseline = context.textBaseline;\n return state;\n };\n /**\n * Clone an existing gc state object and add it to the state stack.\n */\n State.push = function (other) {\n var state = pi < 0 ? new State() : pool[pi--];\n state.next = other;\n state.fillStyle = other.fillStyle;\n state.font = other.font;\n state.globalAlpha = other.globalAlpha;\n state.globalCompositeOperation = other.globalCompositeOperation;\n state.imageSmoothingEnabled = other.imageSmoothingEnabled;\n state.lineCap = other.lineCap;\n state.lineDashOffset = other.lineDashOffset;\n state.lineJoin = other.lineJoin;\n state.lineWidth = other.lineWidth;\n state.miterLimit = other.miterLimit;\n state.shadowBlur = other.shadowBlur;\n state.shadowColor = other.shadowColor;\n state.shadowOffsetX = other.shadowOffsetX;\n state.shadowOffsetY = other.shadowOffsetY;\n state.strokeStyle = other.strokeStyle;\n state.textAlign = other.textAlign;\n state.textBaseline = other.textBaseline;\n return state;\n };\n /**\n * Pop the next state object and return the current to the pool\n */\n State.pop = function (state) {\n state.fillStyle = '';\n state.strokeStyle = '';\n pool[++pi] = state;\n return state.next;\n };\n return State;\n }());\n Private.State = State;\n})(Private || (Private = {}));\n\nexports.GraphicsContext = GraphicsContext;\n//# sourceMappingURL=graphicscontext.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/graphicscontext.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/index.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/index.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar basickeyhandler = __webpack_require__(/*! ./basickeyhandler.js */ \"../../packages/datagrid/dist/basickeyhandler.js\");\n__webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar basicmousehandler = __webpack_require__(/*! ./basicmousehandler.js */ \"../../packages/datagrid/dist/basicmousehandler.js\");\n__webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar selectionmodel = __webpack_require__(/*! ./selectionmodel.js */ \"../../packages/datagrid/dist/selectionmodel.js\");\nvar basicselectionmodel = __webpack_require__(/*! ./basicselectionmodel.js */ \"../../packages/datagrid/dist/basicselectionmodel.js\");\n__webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\n__webpack_require__(/*! ./notification.js */ \"../../packages/datagrid/dist/notification.js\");\nvar celleditor = __webpack_require__(/*! ./celleditor.js */ \"../../packages/datagrid/dist/celleditor.js\");\n__webpack_require__(/*! ./celleditorcontroller.js */ \"../../packages/datagrid/dist/celleditorcontroller.js\");\nvar cellrenderer = __webpack_require__(/*! ./cellrenderer.js */ \"../../packages/datagrid/dist/cellrenderer.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar datamodel = __webpack_require__(/*! ./datamodel.js */ \"../../packages/datagrid/dist/datamodel.js\");\nvar graphicscontext = __webpack_require__(/*! ./graphicscontext.js */ \"../../packages/datagrid/dist/graphicscontext.js\");\nvar textrenderer = __webpack_require__(/*! ./textrenderer.js */ \"../../packages/datagrid/dist/textrenderer.js\");\nvar renderermap = __webpack_require__(/*! ./renderermap.js */ \"../../packages/datagrid/dist/renderermap.js\");\n__webpack_require__(/*! ./sectionlist.js */ \"../../packages/datagrid/dist/sectionlist.js\");\nvar datagrid = __webpack_require__(/*! ./datagrid.js */ \"../../packages/datagrid/dist/datagrid.js\");\nvar jsonmodel = __webpack_require__(/*! ./jsonmodel.js */ \"../../packages/datagrid/dist/jsonmodel.js\");\n\n\n\nexports.BasicKeyHandler = basickeyhandler.BasicKeyHandler;\nexports.BasicMouseHandler = basicmousehandler.BasicMouseHandler;\nexports.SelectionModel = selectionmodel.SelectionModel;\nexports.BasicSelectionModel = basicselectionmodel.BasicSelectionModel;\nexports.BooleanCellEditor = celleditor.BooleanCellEditor;\nexports.CellEditor = celleditor.CellEditor;\nexports.DateCellEditor = celleditor.DateCellEditor;\nexports.DynamicOptionCellEditor = celleditor.DynamicOptionCellEditor;\nexports.InputCellEditor = celleditor.InputCellEditor;\nexports.IntegerCellEditor = celleditor.IntegerCellEditor;\nexports.IntegerInputValidator = celleditor.IntegerInputValidator;\nexports.NumberCellEditor = celleditor.NumberCellEditor;\nexports.NumberInputValidator = celleditor.NumberInputValidator;\nexports.OptionCellEditor = celleditor.OptionCellEditor;\nexports.PassInputValidator = celleditor.PassInputValidator;\nexports.TextCellEditor = celleditor.TextCellEditor;\nexports.TextInputValidator = celleditor.TextInputValidator;\nObject.defineProperty(exports, 'CellRenderer', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn cellrenderer.CellRenderer;\n\t}\n});\nObject.defineProperty(exports, 'DataModel', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn datamodel.DataModel;\n\t}\n});\nexports.MutableDataModel = datamodel.MutableDataModel;\nexports.GraphicsContext = graphicscontext.GraphicsContext;\nObject.defineProperty(exports, 'TextRenderer', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn textrenderer.TextRenderer;\n\t}\n});\nexports.RendererMap = renderermap.RendererMap;\nObject.defineProperty(exports, 'DataGrid', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn datagrid.DataGrid;\n\t}\n});\nexports.JSONModel = jsonmodel.JSONModel;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar basickeyhandler = __webpack_require__(/*! ./basickeyhandler.js */ \"../../packages/datagrid/dist/basickeyhandler.js\");\n__webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar basicmousehandler = __webpack_require__(/*! ./basicmousehandler.js */ \"../../packages/datagrid/dist/basicmousehandler.js\");\n__webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar selectionmodel = __webpack_require__(/*! ./selectionmodel.js */ \"../../packages/datagrid/dist/selectionmodel.js\");\nvar basicselectionmodel = __webpack_require__(/*! ./basicselectionmodel.js */ \"../../packages/datagrid/dist/basicselectionmodel.js\");\n__webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\n__webpack_require__(/*! ./notification.js */ \"../../packages/datagrid/dist/notification.js\");\nvar celleditor = __webpack_require__(/*! ./celleditor.js */ \"../../packages/datagrid/dist/celleditor.js\");\n__webpack_require__(/*! ./celleditorcontroller.js */ \"../../packages/datagrid/dist/celleditorcontroller.js\");\nvar cellrenderer = __webpack_require__(/*! ./cellrenderer.js */ \"../../packages/datagrid/dist/cellrenderer.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar datamodel = __webpack_require__(/*! ./datamodel.js */ \"../../packages/datagrid/dist/datamodel.js\");\nvar graphicscontext = __webpack_require__(/*! ./graphicscontext.js */ \"../../packages/datagrid/dist/graphicscontext.js\");\nvar textrenderer = __webpack_require__(/*! ./textrenderer.js */ \"../../packages/datagrid/dist/textrenderer.js\");\nvar renderermap = __webpack_require__(/*! ./renderermap.js */ \"../../packages/datagrid/dist/renderermap.js\");\n__webpack_require__(/*! ./sectionlist.js */ \"../../packages/datagrid/dist/sectionlist.js\");\nvar datagrid = __webpack_require__(/*! ./datagrid.js */ \"../../packages/datagrid/dist/datagrid.js\");\nvar jsonmodel = __webpack_require__(/*! ./jsonmodel.js */ \"../../packages/datagrid/dist/jsonmodel.js\");\n\n\n\nexports.BasicKeyHandler = basickeyhandler.BasicKeyHandler;\nexports.BasicMouseHandler = basicmousehandler.BasicMouseHandler;\nexports.SelectionModel = selectionmodel.SelectionModel;\nexports.BasicSelectionModel = basicselectionmodel.BasicSelectionModel;\nexports.BooleanCellEditor = celleditor.BooleanCellEditor;\nexports.CellEditor = celleditor.CellEditor;\nexports.DateCellEditor = celleditor.DateCellEditor;\nexports.DynamicOptionCellEditor = celleditor.DynamicOptionCellEditor;\nexports.InputCellEditor = celleditor.InputCellEditor;\nexports.IntegerCellEditor = celleditor.IntegerCellEditor;\nexports.IntegerInputValidator = celleditor.IntegerInputValidator;\nexports.NumberCellEditor = celleditor.NumberCellEditor;\nexports.NumberInputValidator = celleditor.NumberInputValidator;\nexports.OptionCellEditor = celleditor.OptionCellEditor;\nexports.PassInputValidator = celleditor.PassInputValidator;\nexports.TextCellEditor = celleditor.TextCellEditor;\nexports.TextInputValidator = celleditor.TextInputValidator;\nObject.defineProperty(exports, 'CellRenderer', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn cellrenderer.CellRenderer;\n\t}\n});\nObject.defineProperty(exports, 'DataModel', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn datamodel.DataModel;\n\t}\n});\nexports.MutableDataModel = datamodel.MutableDataModel;\nexports.GraphicsContext = graphicscontext.GraphicsContext;\nObject.defineProperty(exports, 'TextRenderer', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn textrenderer.TextRenderer;\n\t}\n});\nexports.RendererMap = renderermap.RendererMap;\nObject.defineProperty(exports, 'DataGrid', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn datagrid.DataGrid;\n\t}\n});\nexports.JSONModel = jsonmodel.JSONModel;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/jsonmodel.js": │ │ │ │ /*!**********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/jsonmodel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/jsonmodel.js ***! │ │ │ │ \**********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar datamodel = __webpack_require__(/*! ./datamodel.js */ \"../../packages/datagrid/dist/datamodel.js\");\n\n/**\n * A data model implementation for in-memory JSON data.\n */\nvar JSONModel = /** @class */ (function (_super) {\n tslib.__extends(JSONModel, _super);\n /**\n * Create a data model with static JSON data.\n *\n * @param options - The options for initializing the data model.\n */\n function JSONModel(options) {\n var _this = _super.call(this) || this;\n var split = Private.splitFields(options.schema);\n _this._data = options.data;\n _this._bodyFields = split.bodyFields;\n _this._headerFields = split.headerFields;\n _this._missingValues = Private.createMissingMap(options.schema);\n return _this;\n }\n /**\n * Get the row count for a region in the data model.\n *\n * @param region - The row region of interest.\n *\n * @returns - The row count for the region.\n */\n JSONModel.prototype.rowCount = function (region) {\n if (region === 'body') {\n return this._data.length;\n }\n return 1; // TODO multiple column-header rows?\n };\n /**\n * Get the column count for a region in the data model.\n *\n * @param region - The column region of interest.\n *\n * @returns - The column count for the region.\n */\n JSONModel.prototype.columnCount = function (region) {\n if (region === 'body') {\n return this._bodyFields.length;\n }\n return this._headerFields.length;\n };\n /**\n * Get the data value for a cell in the data model.\n *\n * @param region - The cell region of interest.\n *\n * @param row - The row index of the cell of interest.\n *\n * @param column - The column index of the cell of interest.\n *\n * @returns - The data value for the specified cell.\n *\n * #### Notes\n * A `missingValue` as defined by the schema is converted to `null`.\n */\n JSONModel.prototype.data = function (region, row, column) {\n // Set up the field and value variables.\n var field;\n var value;\n // Look up the field and value for the region.\n switch (region) {\n case 'body':\n field = this._bodyFields[column];\n value = this._data[row][field.name];\n break;\n case 'column-header':\n field = this._bodyFields[column];\n value = field.title || field.name;\n break;\n case 'row-header':\n field = this._headerFields[column];\n value = this._data[row][field.name];\n break;\n case 'corner-header':\n field = this._headerFields[column];\n value = field.title || field.name;\n break;\n default:\n throw 'unreachable';\n }\n // Test whether the value is a missing value.\n var missing = (this._missingValues !== null &&\n typeof value === 'string' &&\n this._missingValues[value] === true);\n // Return the final value.\n return missing ? null : value;\n };\n /**\n * Get the metadata for a cell in the data model.\n *\n * @param region - The cell region of interest.\n *\n * @param row - The row index of the cell of of interest.\n *\n * @param column - The column index of the cell of interest.\n *\n * @returns The metadata for the cell.\n */\n JSONModel.prototype.metadata = function (region, row, column) {\n if (region === 'body' || region === 'column-header') {\n return this._bodyFields[column];\n }\n return this._headerFields[column];\n };\n return JSONModel;\n}(datamodel.DataModel));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Split the schema fields into header and body fields.\n */\n function splitFields(schema) {\n // Normalize the primary keys.\n var primaryKeys;\n if (schema.primaryKey === undefined) {\n primaryKeys = [];\n }\n else if (typeof schema.primaryKey === 'string') {\n primaryKeys = [schema.primaryKey];\n }\n else {\n primaryKeys = schema.primaryKey;\n }\n // Separate the fields for the body and header.\n var bodyFields = [];\n var headerFields = [];\n for (var _i = 0, _a = schema.fields; _i < _a.length; _i++) {\n var field = _a[_i];\n if (primaryKeys.indexOf(field.name) === -1) {\n bodyFields.push(field);\n }\n else {\n headerFields.push(field);\n }\n }\n // Return the separated fields.\n return { bodyFields: bodyFields, headerFields: headerFields };\n }\n Private.splitFields = splitFields;\n /**\n * Create a missing values map for a schema.\n *\n * This returns `null` if there are no missing values.\n */\n function createMissingMap(schema) {\n // Bail early if there are no missing values.\n if (!schema.missingValues || schema.missingValues.length === 0) {\n return null;\n }\n // Collect the missing values into a map.\n var result = Object.create(null);\n for (var _i = 0, _a = schema.missingValues; _i < _a.length; _i++) {\n var value = _a[_i];\n result[value] = true;\n }\n // Return the populated map.\n return result;\n }\n Private.createMissingMap = createMissingMap;\n})(Private || (Private = {}));\n\nexports.JSONModel = JSONModel;\n//# sourceMappingURL=jsonmodel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/jsonmodel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar datamodel = __webpack_require__(/*! ./datamodel.js */ \"../../packages/datagrid/dist/datamodel.js\");\n\n/**\n * A data model implementation for in-memory JSON data.\n */\nvar JSONModel = /** @class */ (function (_super) {\n tslib.__extends(JSONModel, _super);\n /**\n * Create a data model with static JSON data.\n *\n * @param options - The options for initializing the data model.\n */\n function JSONModel(options) {\n var _this = _super.call(this) || this;\n var split = Private.splitFields(options.schema);\n _this._data = options.data;\n _this._bodyFields = split.bodyFields;\n _this._headerFields = split.headerFields;\n _this._missingValues = Private.createMissingMap(options.schema);\n return _this;\n }\n /**\n * Get the row count for a region in the data model.\n *\n * @param region - The row region of interest.\n *\n * @returns - The row count for the region.\n */\n JSONModel.prototype.rowCount = function (region) {\n if (region === 'body') {\n return this._data.length;\n }\n return 1; // TODO multiple column-header rows?\n };\n /**\n * Get the column count for a region in the data model.\n *\n * @param region - The column region of interest.\n *\n * @returns - The column count for the region.\n */\n JSONModel.prototype.columnCount = function (region) {\n if (region === 'body') {\n return this._bodyFields.length;\n }\n return this._headerFields.length;\n };\n /**\n * Get the data value for a cell in the data model.\n *\n * @param region - The cell region of interest.\n *\n * @param row - The row index of the cell of interest.\n *\n * @param column - The column index of the cell of interest.\n *\n * @returns - The data value for the specified cell.\n *\n * #### Notes\n * A `missingValue` as defined by the schema is converted to `null`.\n */\n JSONModel.prototype.data = function (region, row, column) {\n // Set up the field and value variables.\n var field;\n var value;\n // Look up the field and value for the region.\n switch (region) {\n case 'body':\n field = this._bodyFields[column];\n value = this._data[row][field.name];\n break;\n case 'column-header':\n field = this._bodyFields[column];\n value = field.title || field.name;\n break;\n case 'row-header':\n field = this._headerFields[column];\n value = this._data[row][field.name];\n break;\n case 'corner-header':\n field = this._headerFields[column];\n value = field.title || field.name;\n break;\n default:\n throw 'unreachable';\n }\n // Test whether the value is a missing value.\n var missing = (this._missingValues !== null &&\n typeof value === 'string' &&\n this._missingValues[value] === true);\n // Return the final value.\n return missing ? null : value;\n };\n /**\n * Get the metadata for a cell in the data model.\n *\n * @param region - The cell region of interest.\n *\n * @param row - The row index of the cell of of interest.\n *\n * @param column - The column index of the cell of interest.\n *\n * @returns The metadata for the cell.\n */\n JSONModel.prototype.metadata = function (region, row, column) {\n if (region === 'body' || region === 'column-header') {\n return this._bodyFields[column];\n }\n return this._headerFields[column];\n };\n return JSONModel;\n}(datamodel.DataModel));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Split the schema fields into header and body fields.\n */\n function splitFields(schema) {\n // Normalize the primary keys.\n var primaryKeys;\n if (schema.primaryKey === undefined) {\n primaryKeys = [];\n }\n else if (typeof schema.primaryKey === 'string') {\n primaryKeys = [schema.primaryKey];\n }\n else {\n primaryKeys = schema.primaryKey;\n }\n // Separate the fields for the body and header.\n var bodyFields = [];\n var headerFields = [];\n for (var _i = 0, _a = schema.fields; _i < _a.length; _i++) {\n var field = _a[_i];\n if (primaryKeys.indexOf(field.name) === -1) {\n bodyFields.push(field);\n }\n else {\n headerFields.push(field);\n }\n }\n // Return the separated fields.\n return { bodyFields: bodyFields, headerFields: headerFields };\n }\n Private.splitFields = splitFields;\n /**\n * Create a missing values map for a schema.\n *\n * This returns `null` if there are no missing values.\n */\n function createMissingMap(schema) {\n // Bail early if there are no missing values.\n if (!schema.missingValues || schema.missingValues.length === 0) {\n return null;\n }\n // Collect the missing values into a map.\n var result = Object.create(null);\n for (var _i = 0, _a = schema.missingValues; _i < _a.length; _i++) {\n var value = _a[_i];\n result[value] = true;\n }\n // Return the populated map.\n return result;\n }\n Private.createMissingMap = createMissingMap;\n})(Private || (Private = {}));\n\nexports.JSONModel = JSONModel;\n//# sourceMappingURL=jsonmodel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/jsonmodel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/notification.js": │ │ │ │ /*!*************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/notification.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/notification.js ***! │ │ │ │ \*************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar widgets = __webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A widget which implements a notification popup.\n */\nvar Notification = /** @class */ (function (_super) {\n tslib.__extends(Notification, _super);\n /**\n * Construct a new notification.\n *\n * @param options - The options for initializing the notification.\n */\n function Notification(options) {\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._message = '';\n _this.addClass('lm-DataGrid-notification');\n _this.setFlag(widgets.Widget.Flag.DisallowLayout);\n _this._target = options.target;\n _this._message = options.message || '';\n _this._placement = options.placement || 'bottom';\n widgets.Widget.attach(_this, document.body);\n if (options.timeout && options.timeout > 0) {\n setTimeout(function () {\n _this.close();\n }, options.timeout);\n }\n return _this;\n }\n /**\n * Handle the DOM events for the notification.\n *\n * @param event - The DOM event sent to the notification.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the notification's DOM node.\n *\n * This should not be called directly by user code.\n */\n Notification.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n Object.defineProperty(Notification.prototype, \"placement\", {\n /**\n * Get the placement of the notification.\n */\n get: function () {\n return this._placement;\n },\n /**\n * Set the placement of the notification.\n */\n set: function (value) {\n // Do nothing if the placement does not change.\n if (this._placement === value) {\n return;\n }\n // Update the internal placement.\n this._placement = value;\n // Schedule an update for notification.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Notification.prototype, \"message\", {\n /**\n * Get the current value of the message.\n */\n get: function () {\n return this._message;\n },\n /**\n * Set the current value of the message.\n *\n */\n set: function (value) {\n // Do nothing if the value does not change.\n if (this._message === value) {\n return;\n }\n // Update the internal value.\n this._message = value;\n // Schedule an update for notification.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Notification.prototype, \"messageNode\", {\n /**\n * Get the node presenting the message.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-DataGrid-notificationMessage')[0];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A method invoked on a 'before-attach' message.\n */\n Notification.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('mousedown', this);\n this.update();\n };\n /**\n * A method invoked on an 'after-detach' message.\n */\n Notification.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('mousedown', this);\n };\n /**\n * A method invoked on an 'update-request' message.\n */\n Notification.prototype.onUpdateRequest = function (msg) {\n var targetRect = this._target.getBoundingClientRect();\n var style = this.node.style;\n switch (this._placement) {\n case 'bottom':\n style.left = targetRect.left + 'px';\n style.top = targetRect.bottom + 'px';\n break;\n case 'top':\n style.left = targetRect.left + 'px';\n style.height = targetRect.top + 'px';\n style.top = '0';\n style.alignItems = 'flex-end';\n style.justifyContent = 'flex-end';\n break;\n case 'left':\n style.left = '0';\n style.width = targetRect.left + 'px';\n style.top = targetRect.top + 'px';\n style.alignItems = 'flex-end';\n style.justifyContent = 'flex-end';\n break;\n case 'right':\n style.left = targetRect.right + 'px';\n style.top = targetRect.top + 'px';\n break;\n }\n this.messageNode.innerHTML = this._message;\n };\n /**\n * Handle the `'mousedown'` event for the notification.\n */\n Notification.prototype._evtMouseDown = function (event) {\n // Do nothing if it's not a left mouse press.\n if (event.button !== 0) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.close();\n };\n return Notification;\n}(widgets.Widget));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create the DOM node for notification.\n */\n function createNode() {\n var node = document.createElement('div');\n var container = document.createElement('div');\n container.className = 'lm-DataGrid-notificationContainer';\n var message = document.createElement('span');\n message.className = 'lm-DataGrid-notificationMessage';\n container.appendChild(message);\n node.appendChild(container);\n return node;\n }\n Private.createNode = createNode;\n})(Private || (Private = {}));\n\nexports.Notification = Notification;\n//# sourceMappingURL=notification.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/notification.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar widgets = __webpack_require__(/*! @lumino/widgets */ \"../../packages/widgets/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A widget which implements a notification popup.\n */\nvar Notification = /** @class */ (function (_super) {\n tslib.__extends(Notification, _super);\n /**\n * Construct a new notification.\n *\n * @param options - The options for initializing the notification.\n */\n function Notification(options) {\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._message = '';\n _this.addClass('lm-DataGrid-notification');\n _this.setFlag(widgets.Widget.Flag.DisallowLayout);\n _this._target = options.target;\n _this._message = options.message || '';\n _this._placement = options.placement || 'bottom';\n widgets.Widget.attach(_this, document.body);\n if (options.timeout && options.timeout > 0) {\n setTimeout(function () {\n _this.close();\n }, options.timeout);\n }\n return _this;\n }\n /**\n * Handle the DOM events for the notification.\n *\n * @param event - The DOM event sent to the notification.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the notification's DOM node.\n *\n * This should not be called directly by user code.\n */\n Notification.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n Object.defineProperty(Notification.prototype, \"placement\", {\n /**\n * Get the placement of the notification.\n */\n get: function () {\n return this._placement;\n },\n /**\n * Set the placement of the notification.\n */\n set: function (value) {\n // Do nothing if the placement does not change.\n if (this._placement === value) {\n return;\n }\n // Update the internal placement.\n this._placement = value;\n // Schedule an update for notification.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Notification.prototype, \"message\", {\n /**\n * Get the current value of the message.\n */\n get: function () {\n return this._message;\n },\n /**\n * Set the current value of the message.\n *\n */\n set: function (value) {\n // Do nothing if the value does not change.\n if (this._message === value) {\n return;\n }\n // Update the internal value.\n this._message = value;\n // Schedule an update for notification.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Notification.prototype, \"messageNode\", {\n /**\n * Get the node presenting the message.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-DataGrid-notificationMessage')[0];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A method invoked on a 'before-attach' message.\n */\n Notification.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('mousedown', this);\n this.update();\n };\n /**\n * A method invoked on an 'after-detach' message.\n */\n Notification.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('mousedown', this);\n };\n /**\n * A method invoked on an 'update-request' message.\n */\n Notification.prototype.onUpdateRequest = function (msg) {\n var targetRect = this._target.getBoundingClientRect();\n var style = this.node.style;\n switch (this._placement) {\n case 'bottom':\n style.left = targetRect.left + 'px';\n style.top = targetRect.bottom + 'px';\n break;\n case 'top':\n style.left = targetRect.left + 'px';\n style.height = targetRect.top + 'px';\n style.top = '0';\n style.alignItems = 'flex-end';\n style.justifyContent = 'flex-end';\n break;\n case 'left':\n style.left = '0';\n style.width = targetRect.left + 'px';\n style.top = targetRect.top + 'px';\n style.alignItems = 'flex-end';\n style.justifyContent = 'flex-end';\n break;\n case 'right':\n style.left = targetRect.right + 'px';\n style.top = targetRect.top + 'px';\n break;\n }\n this.messageNode.innerHTML = this._message;\n };\n /**\n * Handle the `'mousedown'` event for the notification.\n */\n Notification.prototype._evtMouseDown = function (event) {\n // Do nothing if it's not a left mouse press.\n if (event.button !== 0) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.close();\n };\n return Notification;\n}(widgets.Widget));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create the DOM node for notification.\n */\n function createNode() {\n var node = document.createElement('div');\n var container = document.createElement('div');\n container.className = 'lm-DataGrid-notificationContainer';\n var message = document.createElement('span');\n message.className = 'lm-DataGrid-notificationMessage';\n container.appendChild(message);\n node.appendChild(container);\n return node;\n }\n Private.createNode = createNode;\n})(Private || (Private = {}));\n\nexports.Notification = Notification;\n//# sourceMappingURL=notification.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/notification.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/renderermap.js": │ │ │ │ /*!************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/renderermap.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/renderermap.js ***! │ │ │ │ \************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./cellrenderer.js */ \"../../packages/datagrid/dist/cellrenderer.js\");\nvar textrenderer = __webpack_require__(/*! ./textrenderer.js */ \"../../packages/datagrid/dist/textrenderer.js\");\n\n/**\n * A class which manages the mapping of cell renderers.\n */\nvar RendererMap = /** @class */ (function () {\n /**\n * Construct a new renderer map.\n *\n * @param values - The initial values for the map.\n *\n * @param fallback - The renderer of last resort.\n */\n function RendererMap(values, fallback) {\n if (values === void 0) { values = {}; }\n this._changed = new signaling.Signal(this);\n this._values = tslib.__assign({}, values);\n this._fallback = fallback || new textrenderer.TextRenderer();\n }\n Object.defineProperty(RendererMap.prototype, \"changed\", {\n /**\n * A signal emitted when the renderer map has changed.\n */\n get: function () {\n return this._changed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the cell renderer to use for the given cell config.\n *\n * @param config - The cell config of interest.\n *\n * @returns The renderer to use for the cell.\n */\n RendererMap.prototype.get = function (config) {\n // Fetch the renderer from the values map.\n var renderer = this._values[config.region];\n // Execute a resolver function if necessary.\n if (typeof renderer === 'function') {\n try {\n renderer = renderer(config);\n }\n catch (err) {\n renderer = undefined;\n console.error(err);\n }\n }\n // Return the renderer or the fallback.\n return renderer || this._fallback;\n };\n /**\n * Update the renderer map with new values\n *\n * @param values - The updated values for the map.\n *\n * @param fallback - The renderer of last resort.\n *\n * #### Notes\n * This method always emits the `changed` signal.\n */\n RendererMap.prototype.update = function (values, fallback) {\n if (values === void 0) { values = {}; }\n this._values = tslib.__assign(tslib.__assign({}, this._values), values);\n this._fallback = fallback || this._fallback;\n this._changed.emit(undefined);\n };\n return RendererMap;\n}());\n\nexports.RendererMap = RendererMap;\n//# sourceMappingURL=renderermap.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/renderermap.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./cellrenderer.js */ \"../../packages/datagrid/dist/cellrenderer.js\");\nvar textrenderer = __webpack_require__(/*! ./textrenderer.js */ \"../../packages/datagrid/dist/textrenderer.js\");\n\n/**\n * A class which manages the mapping of cell renderers.\n */\nvar RendererMap = /** @class */ (function () {\n /**\n * Construct a new renderer map.\n *\n * @param values - The initial values for the map.\n *\n * @param fallback - The renderer of last resort.\n */\n function RendererMap(values, fallback) {\n if (values === void 0) { values = {}; }\n this._changed = new signaling.Signal(this);\n this._values = tslib.__assign({}, values);\n this._fallback = fallback || new textrenderer.TextRenderer();\n }\n Object.defineProperty(RendererMap.prototype, \"changed\", {\n /**\n * A signal emitted when the renderer map has changed.\n */\n get: function () {\n return this._changed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the cell renderer to use for the given cell config.\n *\n * @param config - The cell config of interest.\n *\n * @returns The renderer to use for the cell.\n */\n RendererMap.prototype.get = function (config) {\n // Fetch the renderer from the values map.\n var renderer = this._values[config.region];\n // Execute a resolver function if necessary.\n if (typeof renderer === 'function') {\n try {\n renderer = renderer(config);\n }\n catch (err) {\n renderer = undefined;\n console.error(err);\n }\n }\n // Return the renderer or the fallback.\n return renderer || this._fallback;\n };\n /**\n * Update the renderer map with new values\n *\n * @param values - The updated values for the map.\n *\n * @param fallback - The renderer of last resort.\n *\n * #### Notes\n * This method always emits the `changed` signal.\n */\n RendererMap.prototype.update = function (values, fallback) {\n if (values === void 0) { values = {}; }\n this._values = tslib.__assign(tslib.__assign({}, this._values), values);\n this._fallback = fallback || this._fallback;\n this._changed.emit(undefined);\n };\n return RendererMap;\n}());\n\nexports.RendererMap = RendererMap;\n//# sourceMappingURL=renderermap.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/renderermap.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/sectionlist.js": │ │ │ │ /*!************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/sectionlist.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/sectionlist.js ***! │ │ │ │ \************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * An object which manages a collection of variable sized sections.\n *\n * #### Notes\n * This class is an implementation detail. It is designed to manage\n * the variable row and column sizes for a data grid. User code will\n * not interact with this class directly.\n */\nvar SectionList = /** @class */ (function () {\n /**\n * Construct a new section list.\n *\n * @param options - The options for initializing the list.\n */\n function SectionList(options) {\n this._count = 0;\n this._length = 0;\n this._sections = [];\n this._minimumSize = options.minimumSize || 2;\n this._defaultSize = Math.max(this._minimumSize, Math.floor(options.defaultSize));\n }\n Object.defineProperty(SectionList.prototype, \"length\", {\n /**\n * The total size of all sections in the list.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SectionList.prototype, \"count\", {\n /**\n * The total number of sections in the list.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._count;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SectionList.prototype, \"minimumSize\", {\n /**\n * Get the minimum size of sections in the list.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._minimumSize;\n },\n /**\n * Set the minimum size of sections in the list.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n set: function (value) {\n // Normalize the value.\n value = Math.max(2, Math.floor(value));\n // Bail early if the value does not change.\n if (this._minimumSize === value) {\n return;\n }\n // Update the internal minimum size.\n this._minimumSize = value;\n // Update default size if larger than minimum size\n if (value > this._defaultSize) {\n this.defaultSize = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SectionList.prototype, \"defaultSize\", {\n /**\n * Get the default size of sections in the list.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._defaultSize;\n },\n /**\n * Set the default size of sections in the list.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n set: function (value) {\n // Normalize the value.\n value = Math.max(this._minimumSize, Math.floor(value));\n // Bail early if the value does not change.\n if (this._defaultSize === value) {\n return;\n }\n // Compute the delta default size.\n var delta = value - this._defaultSize;\n // Update the internal default size.\n this._defaultSize = value;\n // Update the length.\n this._length += delta * (this._count - this._sections.length);\n // Bail early if there are no modified sections.\n if (this._sections.length === 0) {\n return;\n }\n // Recompute the offsets of the modified sections.\n for (var i = 0, n = this._sections.length; i < n; ++i) {\n // Look up the previous and current modified sections.\n var prev = this._sections[i - 1];\n var curr = this._sections[i];\n // Adjust the offset for the current section.\n if (prev) {\n var count = curr.index - prev.index - 1;\n curr.offset = prev.offset + prev.size + count * value;\n }\n else {\n curr.offset = curr.index * value;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Clamp a size to the minimum section size\n *\n * @param size - The size to clamp.\n *\n * @returns The size or the section minimum size, whichever is larger\n */\n SectionList.prototype.clampSize = function (size) {\n return Math.max(this._minimumSize, Math.floor(size));\n };\n /**\n * Find the index of the section which covers the given offset.\n *\n * @param offset - The offset of the section of interest.\n *\n * @returns The index of the section which covers the given offset,\n * or `-1` if the offset is out of range.\n *\n * #### Complexity\n * Logarithmic on the number of resized sections.\n */\n SectionList.prototype.indexOf = function (offset) {\n // Bail early if the offset is out of range.\n if (offset < 0 || offset >= this._length || this._count === 0) {\n return -1;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return Math.floor(offset / this._defaultSize);\n }\n // Find the modified section for the given offset.\n var i = algorithm.ArrayExt.lowerBound(this._sections, offset, Private.offsetCmp);\n // Return the index of an exact match.\n if (i < this._sections.length && this._sections[i].offset <= offset) {\n return this._sections[i].index;\n }\n // Handle the case of no modified sections before the offset.\n if (i === 0) {\n return Math.floor(offset / this._defaultSize);\n }\n // Compute the index from the previous modified section.\n var section = this._sections[i - 1];\n var span = offset - (section.offset + section.size);\n return section.index + Math.floor(span / this._defaultSize) + 1;\n };\n /**\n * Find the offset of the section at the given index.\n *\n * @param index - The index of the section of interest.\n *\n * @returns The offset of the section at the given index, or `-1`\n * if the index is out of range.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Complexity\n * Logarithmic on the number of resized sections.\n */\n SectionList.prototype.offsetOf = function (index) {\n // Bail early if the index is out of range.\n if (index < 0 || index >= this._count) {\n return -1;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return index * this._defaultSize;\n }\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Return the offset of an exact match.\n if (i < this._sections.length && this._sections[i].index === index) {\n return this._sections[i].offset;\n }\n // Handle the case of no modified sections before the index.\n if (i === 0) {\n return index * this._defaultSize;\n }\n // Compute the offset from the previous modified section.\n var section = this._sections[i - 1];\n var span = index - section.index - 1;\n return section.offset + section.size + span * this._defaultSize;\n };\n /**\n * Find the extent of the section at the given index.\n *\n * @param index - The index of the section of interest.\n *\n * @returns The extent of the section at the given index, or `-1`\n * if the index is out of range.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Complexity\n * Logarithmic on the number of resized sections.\n */\n SectionList.prototype.extentOf = function (index) {\n // Bail early if the index is out of range.\n if (index < 0 || index >= this._count) {\n return -1;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return (index + 1) * this._defaultSize - 1;\n }\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Return the offset of an exact match.\n if (i < this._sections.length && this._sections[i].index === index) {\n return this._sections[i].offset + this._sections[i].size - 1;\n }\n // Handle the case of no modified sections before the index.\n if (i === 0) {\n return (index + 1) * this._defaultSize - 1;\n }\n // Compute the offset from the previous modified section.\n var section = this._sections[i - 1];\n var span = index - section.index;\n return section.offset + section.size + span * this._defaultSize - 1;\n };\n /**\n * Find the size of the section at the given index.\n *\n * @param index - The index of the section of interest.\n *\n * @returns The size of the section at the given index, or `-1`\n * if the index is out of range.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Complexity\n * Logarithmic on the number of resized sections.\n */\n SectionList.prototype.sizeOf = function (index) {\n // Bail early if the index is out of range.\n if (index < 0 || index >= this._count) {\n return -1;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return this._defaultSize;\n }\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Return the size of an exact match.\n if (i < this._sections.length && this._sections[i].index === index) {\n return this._sections[i].size;\n }\n // Return the default size for all other cases.\n return this._defaultSize;\n };\n /**\n * Resize a section in the list.\n *\n * @param index - The index of the section to resize. This method\n * is a no-op if this value is out of range.\n *\n * @param size - The new size of the section. This value will be\n * clamped to an integer `>= 0`.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n SectionList.prototype.resize = function (index, size) {\n // Bail early if the index is out of range.\n if (index < 0 || index >= this._count) {\n return;\n }\n // Clamp the size to an integer >= minimum size.\n size = Math.max(this._minimumSize, Math.floor(size));\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Update or create the modified section as needed.\n var delta;\n if (i < this._sections.length && this._sections[i].index === index) {\n var section = this._sections[i];\n delta = size - section.size;\n section.size = size;\n }\n else if (i === 0) {\n var offset = index * this._defaultSize;\n algorithm.ArrayExt.insert(this._sections, i, { index: index, offset: offset, size: size });\n delta = size - this._defaultSize;\n }\n else {\n var section = this._sections[i - 1];\n var span = index - section.index - 1;\n var offset = section.offset + section.size + span * this._defaultSize;\n algorithm.ArrayExt.insert(this._sections, i, { index: index, offset: offset, size: size });\n delta = size - this._defaultSize;\n }\n // Adjust the length.\n this._length += delta;\n // Update all modified sections after the resized section.\n for (var j = i + 1, n = this._sections.length; j < n; ++j) {\n this._sections[j].offset += delta;\n }\n };\n /**\n * Insert sections into the list.\n *\n * @param index - The index at which to insert the sections. This\n * value will be clamped to the bounds of the list.\n *\n * @param count - The number of sections to insert. This method\n * is a no-op if this value is `<= 0`.\n *\n * #### Undefined Behavior\n * An `index` or `count` which is non-integral.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n SectionList.prototype.insert = function (index, count) {\n // Bail early if there are no sections to insert.\n if (count <= 0) {\n return;\n }\n // Clamp the index to the bounds of the list.\n index = Math.max(0, Math.min(index, this._count));\n // Add the new sections to the totals.\n var span = count * this._defaultSize;\n this._count += count;\n this._length += span;\n // Bail early if there are no modified sections to update.\n if (this._sections.length === 0) {\n return;\n }\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Update all modified sections after the insert location.\n for (var n = this._sections.length; i < n; ++i) {\n var section = this._sections[i];\n section.index += count;\n section.offset += span;\n }\n };\n /**\n * Remove sections from the list.\n *\n * @param index - The index of the first section to remove. This\n * method is a no-op if this value is out of range.\n *\n * @param count - The number of sections to remove. This method\n * is a no-op if this value is `<= 0`.\n *\n * #### Undefined Behavior\n * An `index` or `count` which is non-integral.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n SectionList.prototype.remove = function (index, count) {\n // Bail early if there is nothing to remove.\n if (index < 0 || index >= this._count || count <= 0) {\n return;\n }\n // Clamp the count to the bounds of the list.\n count = Math.min(this._count - index, count);\n // Handle the simple case of no modified sections to update.\n if (this._sections.length === 0) {\n this._count -= count;\n this._length -= count * this._defaultSize;\n return;\n }\n // Handle the simple case of removing all sections.\n if (count === this._count) {\n this._length = 0;\n this._count = 0;\n this._sections.length = 0;\n return;\n }\n // Find the modified section for the start index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Find the modified section for the end index.\n var j = algorithm.ArrayExt.lowerBound(this._sections, index + count, Private.indexCmp);\n // Remove the relevant modified sections.\n var removed = this._sections.splice(i, j - i);\n // Compute the total removed span.\n var span = (count - removed.length) * this._defaultSize;\n for (var k = 0, n = removed.length; k < n; ++k) {\n span += removed[k].size;\n }\n // Adjust the totals.\n this._count -= count;\n this._length -= span;\n // Update all modified sections after the removed span.\n for (var k = i, n = this._sections.length; k < n; ++k) {\n var section = this._sections[k];\n section.index -= count;\n section.offset -= span;\n }\n };\n /**\n * Move sections within the list.\n *\n * @param index - The index of the first section to move. This method\n * is a no-op if this value is out of range.\n *\n * @param count - The number of sections to move. This method is a\n * no-op if this value is `<= 0`.\n *\n * @param destination - The destination index for the first section.\n * This value will be clamped to the allowable range.\n *\n * #### Undefined Behavior\n * An `index`, `count`, or `destination` which is non-integral.\n *\n * #### Complexity\n * Linear on the number of moved resized sections.\n */\n SectionList.prototype.move = function (index, count, destination) {\n // Bail early if there is nothing to move.\n if (index < 0 || index >= this._count || count <= 0) {\n return;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return;\n }\n // Clamp the move count to the limit.\n count = Math.min(count, this._count - index);\n // Clamp the destination index to the limit.\n destination = Math.min(Math.max(0, destination), this._count - count);\n // Bail early if there is no effective move.\n if (index === destination) {\n return;\n }\n // Compute the first affected index.\n var i1 = Math.min(index, destination);\n // Look up the first affected modified section.\n var k1 = algorithm.ArrayExt.lowerBound(this._sections, i1, Private.indexCmp);\n // Bail early if there are no affected modified sections.\n if (k1 === this._sections.length) {\n return;\n }\n // Compute the last affected index.\n var i2 = Math.max(index + count - 1, destination + count - 1);\n // Look up the last affected modified section.\n var k2 = algorithm.ArrayExt.upperBound(this._sections, i2, Private.indexCmp) - 1;\n // Bail early if there are no affected modified sections.\n if (k2 < k1) {\n return;\n }\n // Compute the pivot index.\n var pivot = destination < index ? index : index + count;\n // Compute the count for each side of the pivot.\n var count1 = pivot - i1;\n var count2 = i2 - pivot + 1;\n // Compute the span for each side of the pivot.\n var span1 = count1 * this._defaultSize;\n var span2 = count2 * this._defaultSize;\n // Adjust the spans for the modified sections.\n for (var j = k1; j <= k2; ++j) {\n var section = this._sections[j];\n if (section.index < pivot) {\n span1 += section.size - this._defaultSize;\n }\n else {\n span2 += section.size - this._defaultSize;\n }\n }\n // Look up the pivot section.\n var k3 = algorithm.ArrayExt.lowerBound(this._sections, pivot, Private.indexCmp);\n // Rotate the modified sections if needed.\n if (k1 <= k3 && k3 <= k2) {\n algorithm.ArrayExt.rotate(this._sections, k3 - k1, k1, k2);\n }\n // Adjust the modified section indices and offsets.\n for (var j = k1; j <= k2; ++j) {\n var section = this._sections[j];\n if (section.index < pivot) {\n section.index += count2;\n section.offset += span2;\n }\n else {\n section.index -= count1;\n section.offset -= span1;\n }\n }\n };\n /**\n * Reset all modified sections to the default size.\n *\n * #### Complexity\n * Constant.\n */\n SectionList.prototype.reset = function () {\n this._sections.length = 0;\n this._length = this._count * this._defaultSize;\n };\n /**\n * Remove all sections from the list.\n *\n * #### Complexity\n * Constant.\n */\n SectionList.prototype.clear = function () {\n this._count = 0;\n this._length = 0;\n this._sections.length = 0;\n };\n return SectionList;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A comparison function for searching by offset.\n */\n function offsetCmp(section, offset) {\n if (offset < section.offset) {\n return 1;\n }\n if (section.offset + section.size <= offset) {\n return -1;\n }\n return 0;\n }\n Private.offsetCmp = offsetCmp;\n /**\n * A comparison function for searching by index.\n */\n function indexCmp(section, index) {\n return section.index - index;\n }\n Private.indexCmp = indexCmp;\n})(Private || (Private = {}));\n\nexports.SectionList = SectionList;\n//# sourceMappingURL=sectionlist.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/sectionlist.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * An object which manages a collection of variable sized sections.\n *\n * #### Notes\n * This class is an implementation detail. It is designed to manage\n * the variable row and column sizes for a data grid. User code will\n * not interact with this class directly.\n */\nvar SectionList = /** @class */ (function () {\n /**\n * Construct a new section list.\n *\n * @param options - The options for initializing the list.\n */\n function SectionList(options) {\n this._count = 0;\n this._length = 0;\n this._sections = [];\n this._minimumSize = options.minimumSize || 2;\n this._defaultSize = Math.max(this._minimumSize, Math.floor(options.defaultSize));\n }\n Object.defineProperty(SectionList.prototype, \"length\", {\n /**\n * The total size of all sections in the list.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SectionList.prototype, \"count\", {\n /**\n * The total number of sections in the list.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._count;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SectionList.prototype, \"minimumSize\", {\n /**\n * Get the minimum size of sections in the list.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._minimumSize;\n },\n /**\n * Set the minimum size of sections in the list.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n set: function (value) {\n // Normalize the value.\n value = Math.max(2, Math.floor(value));\n // Bail early if the value does not change.\n if (this._minimumSize === value) {\n return;\n }\n // Update the internal minimum size.\n this._minimumSize = value;\n // Update default size if larger than minimum size\n if (value > this._defaultSize) {\n this.defaultSize = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SectionList.prototype, \"defaultSize\", {\n /**\n * Get the default size of sections in the list.\n *\n * #### Complexity\n * Constant.\n */\n get: function () {\n return this._defaultSize;\n },\n /**\n * Set the default size of sections in the list.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n set: function (value) {\n // Normalize the value.\n value = Math.max(this._minimumSize, Math.floor(value));\n // Bail early if the value does not change.\n if (this._defaultSize === value) {\n return;\n }\n // Compute the delta default size.\n var delta = value - this._defaultSize;\n // Update the internal default size.\n this._defaultSize = value;\n // Update the length.\n this._length += delta * (this._count - this._sections.length);\n // Bail early if there are no modified sections.\n if (this._sections.length === 0) {\n return;\n }\n // Recompute the offsets of the modified sections.\n for (var i = 0, n = this._sections.length; i < n; ++i) {\n // Look up the previous and current modified sections.\n var prev = this._sections[i - 1];\n var curr = this._sections[i];\n // Adjust the offset for the current section.\n if (prev) {\n var count = curr.index - prev.index - 1;\n curr.offset = prev.offset + prev.size + count * value;\n }\n else {\n curr.offset = curr.index * value;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Clamp a size to the minimum section size\n *\n * @param size - The size to clamp.\n *\n * @returns The size or the section minimum size, whichever is larger\n */\n SectionList.prototype.clampSize = function (size) {\n return Math.max(this._minimumSize, Math.floor(size));\n };\n /**\n * Find the index of the section which covers the given offset.\n *\n * @param offset - The offset of the section of interest.\n *\n * @returns The index of the section which covers the given offset,\n * or `-1` if the offset is out of range.\n *\n * #### Complexity\n * Logarithmic on the number of resized sections.\n */\n SectionList.prototype.indexOf = function (offset) {\n // Bail early if the offset is out of range.\n if (offset < 0 || offset >= this._length || this._count === 0) {\n return -1;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return Math.floor(offset / this._defaultSize);\n }\n // Find the modified section for the given offset.\n var i = algorithm.ArrayExt.lowerBound(this._sections, offset, Private.offsetCmp);\n // Return the index of an exact match.\n if (i < this._sections.length && this._sections[i].offset <= offset) {\n return this._sections[i].index;\n }\n // Handle the case of no modified sections before the offset.\n if (i === 0) {\n return Math.floor(offset / this._defaultSize);\n }\n // Compute the index from the previous modified section.\n var section = this._sections[i - 1];\n var span = offset - (section.offset + section.size);\n return section.index + Math.floor(span / this._defaultSize) + 1;\n };\n /**\n * Find the offset of the section at the given index.\n *\n * @param index - The index of the section of interest.\n *\n * @returns The offset of the section at the given index, or `-1`\n * if the index is out of range.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Complexity\n * Logarithmic on the number of resized sections.\n */\n SectionList.prototype.offsetOf = function (index) {\n // Bail early if the index is out of range.\n if (index < 0 || index >= this._count) {\n return -1;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return index * this._defaultSize;\n }\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Return the offset of an exact match.\n if (i < this._sections.length && this._sections[i].index === index) {\n return this._sections[i].offset;\n }\n // Handle the case of no modified sections before the index.\n if (i === 0) {\n return index * this._defaultSize;\n }\n // Compute the offset from the previous modified section.\n var section = this._sections[i - 1];\n var span = index - section.index - 1;\n return section.offset + section.size + span * this._defaultSize;\n };\n /**\n * Find the extent of the section at the given index.\n *\n * @param index - The index of the section of interest.\n *\n * @returns The extent of the section at the given index, or `-1`\n * if the index is out of range.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Complexity\n * Logarithmic on the number of resized sections.\n */\n SectionList.prototype.extentOf = function (index) {\n // Bail early if the index is out of range.\n if (index < 0 || index >= this._count) {\n return -1;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return (index + 1) * this._defaultSize - 1;\n }\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Return the offset of an exact match.\n if (i < this._sections.length && this._sections[i].index === index) {\n return this._sections[i].offset + this._sections[i].size - 1;\n }\n // Handle the case of no modified sections before the index.\n if (i === 0) {\n return (index + 1) * this._defaultSize - 1;\n }\n // Compute the offset from the previous modified section.\n var section = this._sections[i - 1];\n var span = index - section.index;\n return section.offset + section.size + span * this._defaultSize - 1;\n };\n /**\n * Find the size of the section at the given index.\n *\n * @param index - The index of the section of interest.\n *\n * @returns The size of the section at the given index, or `-1`\n * if the index is out of range.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Complexity\n * Logarithmic on the number of resized sections.\n */\n SectionList.prototype.sizeOf = function (index) {\n // Bail early if the index is out of range.\n if (index < 0 || index >= this._count) {\n return -1;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return this._defaultSize;\n }\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Return the size of an exact match.\n if (i < this._sections.length && this._sections[i].index === index) {\n return this._sections[i].size;\n }\n // Return the default size for all other cases.\n return this._defaultSize;\n };\n /**\n * Resize a section in the list.\n *\n * @param index - The index of the section to resize. This method\n * is a no-op if this value is out of range.\n *\n * @param size - The new size of the section. This value will be\n * clamped to an integer `>= 0`.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n SectionList.prototype.resize = function (index, size) {\n // Bail early if the index is out of range.\n if (index < 0 || index >= this._count) {\n return;\n }\n // Clamp the size to an integer >= minimum size.\n size = Math.max(this._minimumSize, Math.floor(size));\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Update or create the modified section as needed.\n var delta;\n if (i < this._sections.length && this._sections[i].index === index) {\n var section = this._sections[i];\n delta = size - section.size;\n section.size = size;\n }\n else if (i === 0) {\n var offset = index * this._defaultSize;\n algorithm.ArrayExt.insert(this._sections, i, { index: index, offset: offset, size: size });\n delta = size - this._defaultSize;\n }\n else {\n var section = this._sections[i - 1];\n var span = index - section.index - 1;\n var offset = section.offset + section.size + span * this._defaultSize;\n algorithm.ArrayExt.insert(this._sections, i, { index: index, offset: offset, size: size });\n delta = size - this._defaultSize;\n }\n // Adjust the length.\n this._length += delta;\n // Update all modified sections after the resized section.\n for (var j = i + 1, n = this._sections.length; j < n; ++j) {\n this._sections[j].offset += delta;\n }\n };\n /**\n * Insert sections into the list.\n *\n * @param index - The index at which to insert the sections. This\n * value will be clamped to the bounds of the list.\n *\n * @param count - The number of sections to insert. This method\n * is a no-op if this value is `<= 0`.\n *\n * #### Undefined Behavior\n * An `index` or `count` which is non-integral.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n SectionList.prototype.insert = function (index, count) {\n // Bail early if there are no sections to insert.\n if (count <= 0) {\n return;\n }\n // Clamp the index to the bounds of the list.\n index = Math.max(0, Math.min(index, this._count));\n // Add the new sections to the totals.\n var span = count * this._defaultSize;\n this._count += count;\n this._length += span;\n // Bail early if there are no modified sections to update.\n if (this._sections.length === 0) {\n return;\n }\n // Find the modified section for the given index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Update all modified sections after the insert location.\n for (var n = this._sections.length; i < n; ++i) {\n var section = this._sections[i];\n section.index += count;\n section.offset += span;\n }\n };\n /**\n * Remove sections from the list.\n *\n * @param index - The index of the first section to remove. This\n * method is a no-op if this value is out of range.\n *\n * @param count - The number of sections to remove. This method\n * is a no-op if this value is `<= 0`.\n *\n * #### Undefined Behavior\n * An `index` or `count` which is non-integral.\n *\n * #### Complexity\n * Linear on the number of resized sections.\n */\n SectionList.prototype.remove = function (index, count) {\n // Bail early if there is nothing to remove.\n if (index < 0 || index >= this._count || count <= 0) {\n return;\n }\n // Clamp the count to the bounds of the list.\n count = Math.min(this._count - index, count);\n // Handle the simple case of no modified sections to update.\n if (this._sections.length === 0) {\n this._count -= count;\n this._length -= count * this._defaultSize;\n return;\n }\n // Handle the simple case of removing all sections.\n if (count === this._count) {\n this._length = 0;\n this._count = 0;\n this._sections.length = 0;\n return;\n }\n // Find the modified section for the start index.\n var i = algorithm.ArrayExt.lowerBound(this._sections, index, Private.indexCmp);\n // Find the modified section for the end index.\n var j = algorithm.ArrayExt.lowerBound(this._sections, index + count, Private.indexCmp);\n // Remove the relevant modified sections.\n var removed = this._sections.splice(i, j - i);\n // Compute the total removed span.\n var span = (count - removed.length) * this._defaultSize;\n for (var k = 0, n = removed.length; k < n; ++k) {\n span += removed[k].size;\n }\n // Adjust the totals.\n this._count -= count;\n this._length -= span;\n // Update all modified sections after the removed span.\n for (var k = i, n = this._sections.length; k < n; ++k) {\n var section = this._sections[k];\n section.index -= count;\n section.offset -= span;\n }\n };\n /**\n * Move sections within the list.\n *\n * @param index - The index of the first section to move. This method\n * is a no-op if this value is out of range.\n *\n * @param count - The number of sections to move. This method is a\n * no-op if this value is `<= 0`.\n *\n * @param destination - The destination index for the first section.\n * This value will be clamped to the allowable range.\n *\n * #### Undefined Behavior\n * An `index`, `count`, or `destination` which is non-integral.\n *\n * #### Complexity\n * Linear on the number of moved resized sections.\n */\n SectionList.prototype.move = function (index, count, destination) {\n // Bail early if there is nothing to move.\n if (index < 0 || index >= this._count || count <= 0) {\n return;\n }\n // Handle the simple case of no modified sections.\n if (this._sections.length === 0) {\n return;\n }\n // Clamp the move count to the limit.\n count = Math.min(count, this._count - index);\n // Clamp the destination index to the limit.\n destination = Math.min(Math.max(0, destination), this._count - count);\n // Bail early if there is no effective move.\n if (index === destination) {\n return;\n }\n // Compute the first affected index.\n var i1 = Math.min(index, destination);\n // Look up the first affected modified section.\n var k1 = algorithm.ArrayExt.lowerBound(this._sections, i1, Private.indexCmp);\n // Bail early if there are no affected modified sections.\n if (k1 === this._sections.length) {\n return;\n }\n // Compute the last affected index.\n var i2 = Math.max(index + count - 1, destination + count - 1);\n // Look up the last affected modified section.\n var k2 = algorithm.ArrayExt.upperBound(this._sections, i2, Private.indexCmp) - 1;\n // Bail early if there are no affected modified sections.\n if (k2 < k1) {\n return;\n }\n // Compute the pivot index.\n var pivot = destination < index ? index : index + count;\n // Compute the count for each side of the pivot.\n var count1 = pivot - i1;\n var count2 = i2 - pivot + 1;\n // Compute the span for each side of the pivot.\n var span1 = count1 * this._defaultSize;\n var span2 = count2 * this._defaultSize;\n // Adjust the spans for the modified sections.\n for (var j = k1; j <= k2; ++j) {\n var section = this._sections[j];\n if (section.index < pivot) {\n span1 += section.size - this._defaultSize;\n }\n else {\n span2 += section.size - this._defaultSize;\n }\n }\n // Look up the pivot section.\n var k3 = algorithm.ArrayExt.lowerBound(this._sections, pivot, Private.indexCmp);\n // Rotate the modified sections if needed.\n if (k1 <= k3 && k3 <= k2) {\n algorithm.ArrayExt.rotate(this._sections, k3 - k1, k1, k2);\n }\n // Adjust the modified section indices and offsets.\n for (var j = k1; j <= k2; ++j) {\n var section = this._sections[j];\n if (section.index < pivot) {\n section.index += count2;\n section.offset += span2;\n }\n else {\n section.index -= count1;\n section.offset -= span1;\n }\n }\n };\n /**\n * Reset all modified sections to the default size.\n *\n * #### Complexity\n * Constant.\n */\n SectionList.prototype.reset = function () {\n this._sections.length = 0;\n this._length = this._count * this._defaultSize;\n };\n /**\n * Remove all sections from the list.\n *\n * #### Complexity\n * Constant.\n */\n SectionList.prototype.clear = function () {\n this._count = 0;\n this._length = 0;\n this._sections.length = 0;\n };\n return SectionList;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A comparison function for searching by offset.\n */\n function offsetCmp(section, offset) {\n if (offset < section.offset) {\n return 1;\n }\n if (section.offset + section.size <= offset) {\n return -1;\n }\n return 0;\n }\n Private.offsetCmp = offsetCmp;\n /**\n * A comparison function for searching by index.\n */\n function indexCmp(section, index) {\n return section.index - index;\n }\n Private.indexCmp = indexCmp;\n})(Private || (Private = {}));\n\nexports.SectionList = SectionList;\n//# sourceMappingURL=sectionlist.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/sectionlist.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/selectionmodel.js": │ │ │ │ /*!***************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/selectionmodel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/selectionmodel.js ***! │ │ │ │ \***************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A base class for creating data grid selection models.\n *\n * #### Notes\n * If the predefined selection models are insufficient for a particular\n * use case, a custom model can be defined which derives from this class.\n */\nvar SelectionModel = /** @class */ (function () {\n /**\n * Construct a new selection model.\n *\n * @param options - The options for initializing the model.\n */\n function SelectionModel(options) {\n this._changed = new signaling.Signal(this);\n this._selectionMode = 'cell';\n this.dataModel = options.dataModel;\n this._selectionMode = options.selectionMode || 'cell';\n this.dataModel.changed.connect(this.onDataModelChanged, this);\n }\n Object.defineProperty(SelectionModel.prototype, \"changed\", {\n /**\n * A signal emitted when the selection model has changed.\n */\n get: function () {\n return this._changed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SelectionModel.prototype, \"selectionMode\", {\n /**\n * Get the selection mode for the model.\n */\n get: function () {\n return this._selectionMode;\n },\n /**\n * Set the selection mode for the model.\n *\n * #### Notes\n * This will clear the selection model.\n */\n set: function (value) {\n // Bail early if the mode does not change.\n if (this._selectionMode === value) {\n return;\n }\n // Update the internal mode.\n this._selectionMode = value;\n // Clear the current selections.\n this.clear();\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Test whether any selection intersects a row.\n *\n * @param index - The row index of interest.\n *\n * @returns Whether any selection intersects the row.\n *\n * #### Notes\n * This method may be reimplemented in a subclass.\n */\n SelectionModel.prototype.isRowSelected = function (index) {\n return algorithm.some(this.selections(), function (s) { return Private.containsRow(s, index); });\n };\n /**\n * Test whether any selection intersects a column.\n *\n * @param index - The column index of interest.\n *\n * @returns Whether any selection intersects the column.\n *\n * #### Notes\n * This method may be reimplemented in a subclass.\n */\n SelectionModel.prototype.isColumnSelected = function (index) {\n return algorithm.some(this.selections(), function (s) { return Private.containsColumn(s, index); });\n };\n /**\n * Test whether any selection intersects a cell.\n *\n * @param row - The row index of interest.\n *\n * @param column - The column index of interest.\n *\n * @returns Whether any selection intersects the cell.\n *\n * #### Notes\n * This method may be reimplemented in a subclass.\n */\n SelectionModel.prototype.isCellSelected = function (row, column) {\n return algorithm.some(this.selections(), function (s) { return Private.containsCell(s, row, column); });\n };\n /**\n * A signal handler for the data model `changed` signal.\n *\n * @param args - The arguments for the signal.\n *\n * #### Notes\n * Selection model implementations should update their selections\n * in a manner that is relevant for the changes to the data model.\n *\n * The default implementation of this method is a no-op.\n */\n SelectionModel.prototype.onDataModelChanged = function (sender, args) { };\n /**\n * Emit the `changed` signal for the selection model.\n *\n * #### Notes\n * Subclasses should call this method whenever the selection model\n * has changed so that attached data grids can update themselves.\n */\n SelectionModel.prototype.emitChanged = function () {\n this._changed.emit(undefined);\n };\n return SelectionModel;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Test whether a selection contains a given row.\n */\n function containsRow(selection, row) {\n var r1 = selection.r1, r2 = selection.r2;\n return (row >= r1 && row <= r2) || (row >= r2 && row <= r1);\n }\n Private.containsRow = containsRow;\n /**\n * Test whether a selection contains a given column.\n */\n function containsColumn(selection, column) {\n var c1 = selection.c1, c2 = selection.c2;\n return (column >= c1 && column <= c2) || (column >= c2 && column <= c1);\n }\n Private.containsColumn = containsColumn;\n /**\n * Test whether a selection contains a given cell.\n */\n function containsCell(selection, row, column) {\n return containsRow(selection, row) && containsColumn(selection, column);\n }\n Private.containsCell = containsCell;\n})(Private || (Private = {}));\n\nexports.SelectionModel = SelectionModel;\n//# sourceMappingURL=selectionmodel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/selectionmodel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A base class for creating data grid selection models.\n *\n * #### Notes\n * If the predefined selection models are insufficient for a particular\n * use case, a custom model can be defined which derives from this class.\n */\nvar SelectionModel = /** @class */ (function () {\n /**\n * Construct a new selection model.\n *\n * @param options - The options for initializing the model.\n */\n function SelectionModel(options) {\n this._changed = new signaling.Signal(this);\n this._selectionMode = 'cell';\n this.dataModel = options.dataModel;\n this._selectionMode = options.selectionMode || 'cell';\n this.dataModel.changed.connect(this.onDataModelChanged, this);\n }\n Object.defineProperty(SelectionModel.prototype, \"changed\", {\n /**\n * A signal emitted when the selection model has changed.\n */\n get: function () {\n return this._changed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SelectionModel.prototype, \"selectionMode\", {\n /**\n * Get the selection mode for the model.\n */\n get: function () {\n return this._selectionMode;\n },\n /**\n * Set the selection mode for the model.\n *\n * #### Notes\n * This will clear the selection model.\n */\n set: function (value) {\n // Bail early if the mode does not change.\n if (this._selectionMode === value) {\n return;\n }\n // Update the internal mode.\n this._selectionMode = value;\n // Clear the current selections.\n this.clear();\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Test whether any selection intersects a row.\n *\n * @param index - The row index of interest.\n *\n * @returns Whether any selection intersects the row.\n *\n * #### Notes\n * This method may be reimplemented in a subclass.\n */\n SelectionModel.prototype.isRowSelected = function (index) {\n return algorithm.some(this.selections(), function (s) { return Private.containsRow(s, index); });\n };\n /**\n * Test whether any selection intersects a column.\n *\n * @param index - The column index of interest.\n *\n * @returns Whether any selection intersects the column.\n *\n * #### Notes\n * This method may be reimplemented in a subclass.\n */\n SelectionModel.prototype.isColumnSelected = function (index) {\n return algorithm.some(this.selections(), function (s) { return Private.containsColumn(s, index); });\n };\n /**\n * Test whether any selection intersects a cell.\n *\n * @param row - The row index of interest.\n *\n * @param column - The column index of interest.\n *\n * @returns Whether any selection intersects the cell.\n *\n * #### Notes\n * This method may be reimplemented in a subclass.\n */\n SelectionModel.prototype.isCellSelected = function (row, column) {\n return algorithm.some(this.selections(), function (s) { return Private.containsCell(s, row, column); });\n };\n /**\n * A signal handler for the data model `changed` signal.\n *\n * @param args - The arguments for the signal.\n *\n * #### Notes\n * Selection model implementations should update their selections\n * in a manner that is relevant for the changes to the data model.\n *\n * The default implementation of this method is a no-op.\n */\n SelectionModel.prototype.onDataModelChanged = function (sender, args) { };\n /**\n * Emit the `changed` signal for the selection model.\n *\n * #### Notes\n * Subclasses should call this method whenever the selection model\n * has changed so that attached data grids can update themselves.\n */\n SelectionModel.prototype.emitChanged = function () {\n this._changed.emit(undefined);\n };\n return SelectionModel;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Test whether a selection contains a given row.\n */\n function containsRow(selection, row) {\n var r1 = selection.r1, r2 = selection.r2;\n return (row >= r1 && row <= r2) || (row >= r2 && row <= r1);\n }\n Private.containsRow = containsRow;\n /**\n * Test whether a selection contains a given column.\n */\n function containsColumn(selection, column) {\n var c1 = selection.c1, c2 = selection.c2;\n return (column >= c1 && column <= c2) || (column >= c2 && column <= c1);\n }\n Private.containsColumn = containsColumn;\n /**\n * Test whether a selection contains a given cell.\n */\n function containsCell(selection, row, column) {\n return containsRow(selection, row) && containsColumn(selection, column);\n }\n Private.containsCell = containsCell;\n})(Private || (Private = {}));\n\nexports.SelectionModel = SelectionModel;\n//# sourceMappingURL=selectionmodel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/selectionmodel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/datagrid/dist/textrenderer.js": │ │ │ │ /*!*************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/textrenderer.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/textrenderer.js ***! │ │ │ │ \*************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar cellrenderer = __webpack_require__(/*! ./cellrenderer.js */ \"../../packages/datagrid/dist/cellrenderer.js\");\n\n/**\n * A cell renderer which renders data values as text.\n */\nexports.TextRenderer = /** @class */ (function (_super) {\n tslib.__extends(TextRenderer, _super);\n /**\n * Construct a new text renderer.\n *\n * @param options - The options for initializing the renderer.\n */\n function TextRenderer(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this.font = options.font || '12px sans-serif';\n _this.textColor = options.textColor || '#000000';\n _this.backgroundColor = options.backgroundColor || '';\n _this.verticalAlignment = options.verticalAlignment || 'center';\n _this.horizontalAlignment = options.horizontalAlignment || 'left';\n _this.format = options.format || TextRenderer.formatGeneric();\n _this.elideDirection = options.elideDirection || 'right';\n return _this;\n }\n /**\n * Paint the content for a cell.\n *\n * @param gc - The graphics context to use for drawing.\n *\n * @param config - The configuration data for the cell.\n */\n TextRenderer.prototype.paint = function (gc, config) {\n this.drawBackground(gc, config);\n this.drawText(gc, config);\n };\n /**\n * Draw the background for the cell.\n *\n * @param gc - The graphics context to use for drawing.\n *\n * @param config - The configuration data for the cell.\n */\n TextRenderer.prototype.drawBackground = function (gc, config) {\n // Resolve the background color for the cell.\n var color = cellrenderer.CellRenderer.resolveOption(this.backgroundColor, config);\n // Bail if there is no background color to draw.\n if (!color) {\n return;\n }\n // Fill the cell with the background color.\n gc.fillStyle = color;\n gc.fillRect(config.x, config.y, config.width, config.height);\n };\n /**\n * Draw the text for the cell.\n *\n * @param gc - The graphics context to use for drawing.\n *\n * @param config - The configuration data for the cell.\n */\n TextRenderer.prototype.drawText = function (gc, config) {\n // Resolve the font for the cell.\n var font = cellrenderer.CellRenderer.resolveOption(this.font, config);\n // Bail if there is no font to draw.\n if (!font) {\n return;\n }\n // Resolve the text color for the cell.\n var color = cellrenderer.CellRenderer.resolveOption(this.textColor, config);\n // Bail if there is no text color to draw.\n if (!color) {\n return;\n }\n // Format the cell value to text.\n var format = this.format;\n var text = format(config);\n // Bail if there is no text to draw.\n if (!text) {\n return;\n }\n // Resolve the vertical and horizontal alignment.\n var vAlign = cellrenderer.CellRenderer.resolveOption(this.verticalAlignment, config);\n var hAlign = cellrenderer.CellRenderer.resolveOption(this.horizontalAlignment, config);\n // Resolve the elision direction\n var elideDirection = cellrenderer.CellRenderer.resolveOption(this.elideDirection, config);\n // Compute the padded text box height for the specified alignment.\n var boxHeight = config.height - (vAlign === 'center' ? 1 : 2);\n // Bail if the text box has no effective size.\n if (boxHeight <= 0) {\n return;\n }\n // Compute the text height for the gc font.\n var textHeight = TextRenderer.measureFontHeight(font);\n // Set up the text position variables.\n var textX;\n var textY;\n var boxWidth;\n // Compute the Y position for the text.\n switch (vAlign) {\n case 'top':\n textY = config.y + 2 + textHeight;\n break;\n case 'center':\n textY = config.y + config.height / 2 + textHeight / 2;\n break;\n case 'bottom':\n textY = config.y + config.height - 2;\n break;\n default:\n throw 'unreachable';\n }\n // Compute the X position for the text.\n switch (hAlign) {\n case 'left':\n textX = config.x + 8;\n boxWidth = config.width - 14;\n break;\n case 'center':\n textX = config.x + config.width / 2;\n boxWidth = config.width;\n break;\n case 'right':\n textX = config.x + config.width - 8;\n boxWidth = config.width - 14;\n break;\n default:\n throw 'unreachable';\n }\n // Clip the cell if the text is taller than the text box height.\n if (textHeight > boxHeight) {\n gc.beginPath();\n gc.rect(config.x, config.y, config.width, config.height - 1);\n gc.clip();\n }\n // Set the gc state.\n gc.font = font;\n gc.fillStyle = color;\n gc.textAlign = hAlign;\n gc.textBaseline = 'bottom';\n // Elide text that is too long\n var elide = '\\u2026';\n var textWidth = gc.measureText(text).width;\n // Compute elided text\n if (elideDirection === 'right') {\n while ((textWidth > boxWidth) && (text.length > 1)) {\n if (text.length > 4 && textWidth >= 2 * boxWidth) {\n // If text width is substantially bigger, take half the string\n text = text.substring(0, (text.length / 2) + 1) + elide;\n }\n else {\n // Otherwise incrementally remove the last character\n text = text.substring(0, text.length - 2) + elide;\n }\n textWidth = gc.measureText(text).width;\n }\n }\n else {\n while ((textWidth > boxWidth) && (text.length > 1)) {\n if (text.length > 4 && textWidth >= 2 * boxWidth) {\n // If text width is substantially bigger, take half the string\n text = elide + text.substring((text.length / 2));\n }\n else {\n // Otherwise incrementally remove the last character\n text = elide + text.substring(2);\n }\n textWidth = gc.measureText(text).width;\n }\n }\n // Draw the text for the cell.\n gc.fillText(text, textX, textY);\n };\n return TextRenderer;\n}(cellrenderer.CellRenderer));\n/**\n * The namespace for the `TextRenderer` class statics.\n */\n(function (TextRenderer) {\n /**\n * Create a generic text format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new generic text format function.\n *\n * #### Notes\n * This formatter uses the builtin `String()` to coerce any value\n * to a string.\n */\n function formatGeneric(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return String(value);\n };\n }\n TextRenderer.formatGeneric = formatGeneric;\n /**\n * Create a fixed decimal format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new fixed decimal format function.\n *\n * #### Notes\n * This formatter uses the builtin `Number()` and `toFixed()` to\n * coerce values.\n *\n * The `formatIntlNumber()` formatter is more flexible, but slower.\n */\n function formatFixed(options) {\n if (options === void 0) { options = {}; }\n var digits = options.digits;\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return Number(value).toFixed(digits);\n };\n }\n TextRenderer.formatFixed = formatFixed;\n /**\n * Create a significant figure format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new significant figure format function.\n *\n * #### Notes\n * This formatter uses the builtin `Number()` and `toPrecision()`\n * to coerce values.\n *\n * The `formatIntlNumber()` formatter is more flexible, but slower.\n */\n function formatPrecision(options) {\n if (options === void 0) { options = {}; }\n var digits = options.digits;\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return Number(value).toPrecision(digits);\n };\n }\n TextRenderer.formatPrecision = formatPrecision;\n /**\n * Create a scientific notation format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new scientific notation format function.\n *\n * #### Notes\n * This formatter uses the builtin `Number()` and `toExponential()`\n * to coerce values.\n *\n * The `formatIntlNumber()` formatter is more flexible, but slower.\n */\n function formatExponential(options) {\n if (options === void 0) { options = {}; }\n var digits = options.digits;\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return Number(value).toExponential(digits);\n };\n }\n TextRenderer.formatExponential = formatExponential;\n /**\n * Create an international number format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new international number format function.\n *\n * #### Notes\n * This formatter uses the builtin `Intl.NumberFormat` object to\n * coerce values.\n *\n * This is the most flexible (but slowest) number formatter.\n */\n function formatIntlNumber(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n var nft = new Intl.NumberFormat(options.locales, options.options);\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return nft.format(value);\n };\n }\n TextRenderer.formatIntlNumber = formatIntlNumber;\n /**\n * Create a date format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new date format function.\n *\n * #### Notes\n * This formatter uses `Date.toDateString()` to format the values.\n *\n * If a value is not a `Date` object, `new Date(value)` is used to\n * coerce the value to a date.\n *\n * The `formatIntlDateTime()` formatter is more flexible, but slower.\n */\n function formatDate(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n if (value instanceof Date) {\n return value.toDateString();\n }\n return (new Date(value)).toDateString();\n };\n }\n TextRenderer.formatDate = formatDate;\n /**\n * Create a time format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new time format function.\n *\n * #### Notes\n * This formatter uses `Date.toTimeString()` to format the values.\n *\n * If a value is not a `Date` object, `new Date(value)` is used to\n * coerce the value to a date.\n *\n * The `formatIntlDateTime()` formatter is more flexible, but slower.\n */\n function formatTime(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n if (value instanceof Date) {\n return value.toTimeString();\n }\n return (new Date(value)).toTimeString();\n };\n }\n TextRenderer.formatTime = formatTime;\n /**\n * Create an ISO datetime format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new ISO datetime format function.\n *\n * #### Notes\n * This formatter uses `Date.toISOString()` to format the values.\n *\n * If a value is not a `Date` object, `new Date(value)` is used to\n * coerce the value to a date.\n *\n * The `formatIntlDateTime()` formatter is more flexible, but slower.\n */\n function formatISODateTime(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n if (value instanceof Date) {\n return value.toISOString();\n }\n return (new Date(value)).toISOString();\n };\n }\n TextRenderer.formatISODateTime = formatISODateTime;\n /**\n * Create a UTC datetime format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new UTC datetime format function.\n *\n * #### Notes\n * This formatter uses `Date.toUTCString()` to format the values.\n *\n * If a value is not a `Date` object, `new Date(value)` is used to\n * coerce the value to a date.\n *\n * The `formatIntlDateTime()` formatter is more flexible, but slower.\n */\n function formatUTCDateTime(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n if (value instanceof Date) {\n return value.toUTCString();\n }\n return (new Date(value)).toUTCString();\n };\n }\n TextRenderer.formatUTCDateTime = formatUTCDateTime;\n /**\n * Create an international datetime format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new international datetime format function.\n *\n * #### Notes\n * This formatter uses the builtin `Intl.DateTimeFormat` object to\n * coerce values.\n *\n * This is the most flexible (but slowest) datetime formatter.\n */\n function formatIntlDateTime(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n var dtf = new Intl.DateTimeFormat(options.locales, options.options);\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return dtf.format(value);\n };\n }\n TextRenderer.formatIntlDateTime = formatIntlDateTime;\n /**\n * Measure the height of a font.\n *\n * @param font - The CSS font string of interest.\n *\n * @returns The height of the font bounding box.\n *\n * #### Notes\n * This function uses a temporary DOM node to measure the text box\n * height for the specified font. The first call for a given font\n * will incur a DOM reflow, but the return value is cached, so any\n * subsequent call for the same font will return the cached value.\n */\n function measureFontHeight(font) {\n // Look up the cached font height.\n var height = Private.fontHeightCache[font];\n // Return the cached font height if it exists.\n if (height !== undefined) {\n return height;\n }\n // Normalize the font.\n Private.fontMeasurementGC.font = font;\n var normFont = Private.fontMeasurementGC.font;\n // Set the font on the measurement node.\n Private.fontMeasurementNode.style.font = normFont;\n // Add the measurement node to the document.\n document.body.appendChild(Private.fontMeasurementNode);\n // Measure the node height.\n height = Private.fontMeasurementNode.offsetHeight;\n // Remove the measurement node from the document.\n document.body.removeChild(Private.fontMeasurementNode);\n // Cache the measured height for the font and norm font.\n Private.fontHeightCache[font] = height;\n Private.fontHeightCache[normFont] = height;\n // Return the measured height.\n return height;\n }\n TextRenderer.measureFontHeight = measureFontHeight;\n})(exports.TextRenderer || (exports.TextRenderer = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A cache of measured font heights.\n */\n Private.fontHeightCache = Object.create(null);\n /**\n * The DOM node used for font height measurement.\n */\n Private.fontMeasurementNode = (function () {\n var node = document.createElement('div');\n node.style.position = 'absolute';\n node.style.top = '-99999px';\n node.style.left = '-99999px';\n node.style.visibility = 'hidden';\n node.textContent = 'M';\n return node;\n })();\n /**\n * The GC used for font measurement.\n */\n Private.fontMeasurementGC = (function () {\n var canvas = document.createElement('canvas');\n canvas.width = 0;\n canvas.height = 0;\n return canvas.getContext('2d');\n })();\n})(Private || (Private = {}));\n//# sourceMappingURL=textrenderer.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/datagrid/dist/textrenderer.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar cellrenderer = __webpack_require__(/*! ./cellrenderer.js */ \"../../packages/datagrid/dist/cellrenderer.js\");\n\n/**\n * A cell renderer which renders data values as text.\n */\nexports.TextRenderer = /** @class */ (function (_super) {\n tslib.__extends(TextRenderer, _super);\n /**\n * Construct a new text renderer.\n *\n * @param options - The options for initializing the renderer.\n */\n function TextRenderer(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this.font = options.font || '12px sans-serif';\n _this.textColor = options.textColor || '#000000';\n _this.backgroundColor = options.backgroundColor || '';\n _this.verticalAlignment = options.verticalAlignment || 'center';\n _this.horizontalAlignment = options.horizontalAlignment || 'left';\n _this.format = options.format || TextRenderer.formatGeneric();\n _this.elideDirection = options.elideDirection || 'right';\n return _this;\n }\n /**\n * Paint the content for a cell.\n *\n * @param gc - The graphics context to use for drawing.\n *\n * @param config - The configuration data for the cell.\n */\n TextRenderer.prototype.paint = function (gc, config) {\n this.drawBackground(gc, config);\n this.drawText(gc, config);\n };\n /**\n * Draw the background for the cell.\n *\n * @param gc - The graphics context to use for drawing.\n *\n * @param config - The configuration data for the cell.\n */\n TextRenderer.prototype.drawBackground = function (gc, config) {\n // Resolve the background color for the cell.\n var color = cellrenderer.CellRenderer.resolveOption(this.backgroundColor, config);\n // Bail if there is no background color to draw.\n if (!color) {\n return;\n }\n // Fill the cell with the background color.\n gc.fillStyle = color;\n gc.fillRect(config.x, config.y, config.width, config.height);\n };\n /**\n * Draw the text for the cell.\n *\n * @param gc - The graphics context to use for drawing.\n *\n * @param config - The configuration data for the cell.\n */\n TextRenderer.prototype.drawText = function (gc, config) {\n // Resolve the font for the cell.\n var font = cellrenderer.CellRenderer.resolveOption(this.font, config);\n // Bail if there is no font to draw.\n if (!font) {\n return;\n }\n // Resolve the text color for the cell.\n var color = cellrenderer.CellRenderer.resolveOption(this.textColor, config);\n // Bail if there is no text color to draw.\n if (!color) {\n return;\n }\n // Format the cell value to text.\n var format = this.format;\n var text = format(config);\n // Bail if there is no text to draw.\n if (!text) {\n return;\n }\n // Resolve the vertical and horizontal alignment.\n var vAlign = cellrenderer.CellRenderer.resolveOption(this.verticalAlignment, config);\n var hAlign = cellrenderer.CellRenderer.resolveOption(this.horizontalAlignment, config);\n // Resolve the elision direction\n var elideDirection = cellrenderer.CellRenderer.resolveOption(this.elideDirection, config);\n // Compute the padded text box height for the specified alignment.\n var boxHeight = config.height - (vAlign === 'center' ? 1 : 2);\n // Bail if the text box has no effective size.\n if (boxHeight <= 0) {\n return;\n }\n // Compute the text height for the gc font.\n var textHeight = TextRenderer.measureFontHeight(font);\n // Set up the text position variables.\n var textX;\n var textY;\n var boxWidth;\n // Compute the Y position for the text.\n switch (vAlign) {\n case 'top':\n textY = config.y + 2 + textHeight;\n break;\n case 'center':\n textY = config.y + config.height / 2 + textHeight / 2;\n break;\n case 'bottom':\n textY = config.y + config.height - 2;\n break;\n default:\n throw 'unreachable';\n }\n // Compute the X position for the text.\n switch (hAlign) {\n case 'left':\n textX = config.x + 8;\n boxWidth = config.width - 14;\n break;\n case 'center':\n textX = config.x + config.width / 2;\n boxWidth = config.width;\n break;\n case 'right':\n textX = config.x + config.width - 8;\n boxWidth = config.width - 14;\n break;\n default:\n throw 'unreachable';\n }\n // Clip the cell if the text is taller than the text box height.\n if (textHeight > boxHeight) {\n gc.beginPath();\n gc.rect(config.x, config.y, config.width, config.height - 1);\n gc.clip();\n }\n // Set the gc state.\n gc.font = font;\n gc.fillStyle = color;\n gc.textAlign = hAlign;\n gc.textBaseline = 'bottom';\n // Elide text that is too long\n var elide = '\\u2026';\n var textWidth = gc.measureText(text).width;\n // Compute elided text\n if (elideDirection === 'right') {\n while ((textWidth > boxWidth) && (text.length > 1)) {\n if (text.length > 4 && textWidth >= 2 * boxWidth) {\n // If text width is substantially bigger, take half the string\n text = text.substring(0, (text.length / 2) + 1) + elide;\n }\n else {\n // Otherwise incrementally remove the last character\n text = text.substring(0, text.length - 2) + elide;\n }\n textWidth = gc.measureText(text).width;\n }\n }\n else {\n while ((textWidth > boxWidth) && (text.length > 1)) {\n if (text.length > 4 && textWidth >= 2 * boxWidth) {\n // If text width is substantially bigger, take half the string\n text = elide + text.substring((text.length / 2));\n }\n else {\n // Otherwise incrementally remove the last character\n text = elide + text.substring(2);\n }\n textWidth = gc.measureText(text).width;\n }\n }\n // Draw the text for the cell.\n gc.fillText(text, textX, textY);\n };\n return TextRenderer;\n}(cellrenderer.CellRenderer));\n/**\n * The namespace for the `TextRenderer` class statics.\n */\n(function (TextRenderer) {\n /**\n * Create a generic text format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new generic text format function.\n *\n * #### Notes\n * This formatter uses the builtin `String()` to coerce any value\n * to a string.\n */\n function formatGeneric(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return String(value);\n };\n }\n TextRenderer.formatGeneric = formatGeneric;\n /**\n * Create a fixed decimal format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new fixed decimal format function.\n *\n * #### Notes\n * This formatter uses the builtin `Number()` and `toFixed()` to\n * coerce values.\n *\n * The `formatIntlNumber()` formatter is more flexible, but slower.\n */\n function formatFixed(options) {\n if (options === void 0) { options = {}; }\n var digits = options.digits;\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return Number(value).toFixed(digits);\n };\n }\n TextRenderer.formatFixed = formatFixed;\n /**\n * Create a significant figure format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new significant figure format function.\n *\n * #### Notes\n * This formatter uses the builtin `Number()` and `toPrecision()`\n * to coerce values.\n *\n * The `formatIntlNumber()` formatter is more flexible, but slower.\n */\n function formatPrecision(options) {\n if (options === void 0) { options = {}; }\n var digits = options.digits;\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return Number(value).toPrecision(digits);\n };\n }\n TextRenderer.formatPrecision = formatPrecision;\n /**\n * Create a scientific notation format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new scientific notation format function.\n *\n * #### Notes\n * This formatter uses the builtin `Number()` and `toExponential()`\n * to coerce values.\n *\n * The `formatIntlNumber()` formatter is more flexible, but slower.\n */\n function formatExponential(options) {\n if (options === void 0) { options = {}; }\n var digits = options.digits;\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return Number(value).toExponential(digits);\n };\n }\n TextRenderer.formatExponential = formatExponential;\n /**\n * Create an international number format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new international number format function.\n *\n * #### Notes\n * This formatter uses the builtin `Intl.NumberFormat` object to\n * coerce values.\n *\n * This is the most flexible (but slowest) number formatter.\n */\n function formatIntlNumber(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n var nft = new Intl.NumberFormat(options.locales, options.options);\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return nft.format(value);\n };\n }\n TextRenderer.formatIntlNumber = formatIntlNumber;\n /**\n * Create a date format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new date format function.\n *\n * #### Notes\n * This formatter uses `Date.toDateString()` to format the values.\n *\n * If a value is not a `Date` object, `new Date(value)` is used to\n * coerce the value to a date.\n *\n * The `formatIntlDateTime()` formatter is more flexible, but slower.\n */\n function formatDate(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n if (value instanceof Date) {\n return value.toDateString();\n }\n return (new Date(value)).toDateString();\n };\n }\n TextRenderer.formatDate = formatDate;\n /**\n * Create a time format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new time format function.\n *\n * #### Notes\n * This formatter uses `Date.toTimeString()` to format the values.\n *\n * If a value is not a `Date` object, `new Date(value)` is used to\n * coerce the value to a date.\n *\n * The `formatIntlDateTime()` formatter is more flexible, but slower.\n */\n function formatTime(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n if (value instanceof Date) {\n return value.toTimeString();\n }\n return (new Date(value)).toTimeString();\n };\n }\n TextRenderer.formatTime = formatTime;\n /**\n * Create an ISO datetime format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new ISO datetime format function.\n *\n * #### Notes\n * This formatter uses `Date.toISOString()` to format the values.\n *\n * If a value is not a `Date` object, `new Date(value)` is used to\n * coerce the value to a date.\n *\n * The `formatIntlDateTime()` formatter is more flexible, but slower.\n */\n function formatISODateTime(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n if (value instanceof Date) {\n return value.toISOString();\n }\n return (new Date(value)).toISOString();\n };\n }\n TextRenderer.formatISODateTime = formatISODateTime;\n /**\n * Create a UTC datetime format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new UTC datetime format function.\n *\n * #### Notes\n * This formatter uses `Date.toUTCString()` to format the values.\n *\n * If a value is not a `Date` object, `new Date(value)` is used to\n * coerce the value to a date.\n *\n * The `formatIntlDateTime()` formatter is more flexible, but slower.\n */\n function formatUTCDateTime(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n if (value instanceof Date) {\n return value.toUTCString();\n }\n return (new Date(value)).toUTCString();\n };\n }\n TextRenderer.formatUTCDateTime = formatUTCDateTime;\n /**\n * Create an international datetime format function.\n *\n * @param options - The options for creating the format function.\n *\n * @returns A new international datetime format function.\n *\n * #### Notes\n * This formatter uses the builtin `Intl.DateTimeFormat` object to\n * coerce values.\n *\n * This is the most flexible (but slowest) datetime formatter.\n */\n function formatIntlDateTime(options) {\n if (options === void 0) { options = {}; }\n var missing = options.missing || '';\n var dtf = new Intl.DateTimeFormat(options.locales, options.options);\n return function (_a) {\n var value = _a.value;\n if (value === null || value === undefined) {\n return missing;\n }\n return dtf.format(value);\n };\n }\n TextRenderer.formatIntlDateTime = formatIntlDateTime;\n /**\n * Measure the height of a font.\n *\n * @param font - The CSS font string of interest.\n *\n * @returns The height of the font bounding box.\n *\n * #### Notes\n * This function uses a temporary DOM node to measure the text box\n * height for the specified font. The first call for a given font\n * will incur a DOM reflow, but the return value is cached, so any\n * subsequent call for the same font will return the cached value.\n */\n function measureFontHeight(font) {\n // Look up the cached font height.\n var height = Private.fontHeightCache[font];\n // Return the cached font height if it exists.\n if (height !== undefined) {\n return height;\n }\n // Normalize the font.\n Private.fontMeasurementGC.font = font;\n var normFont = Private.fontMeasurementGC.font;\n // Set the font on the measurement node.\n Private.fontMeasurementNode.style.font = normFont;\n // Add the measurement node to the document.\n document.body.appendChild(Private.fontMeasurementNode);\n // Measure the node height.\n height = Private.fontMeasurementNode.offsetHeight;\n // Remove the measurement node from the document.\n document.body.removeChild(Private.fontMeasurementNode);\n // Cache the measured height for the font and norm font.\n Private.fontHeightCache[font] = height;\n Private.fontHeightCache[normFont] = height;\n // Return the measured height.\n return height;\n }\n TextRenderer.measureFontHeight = measureFontHeight;\n})(exports.TextRenderer || (exports.TextRenderer = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A cache of measured font heights.\n */\n Private.fontHeightCache = Object.create(null);\n /**\n * The DOM node used for font height measurement.\n */\n Private.fontMeasurementNode = (function () {\n var node = document.createElement('div');\n node.style.position = 'absolute';\n node.style.top = '-99999px';\n node.style.left = '-99999px';\n node.style.visibility = 'hidden';\n node.textContent = 'M';\n return node;\n })();\n /**\n * The GC used for font measurement.\n */\n Private.fontMeasurementGC = (function () {\n var canvas = document.createElement('canvas');\n canvas.width = 0;\n canvas.height = 0;\n return canvas.getContext('2d');\n })();\n})(Private || (Private = {}));\n//# sourceMappingURL=textrenderer.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/datagrid/dist/textrenderer.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/default-theme/images/caretdown.png": │ │ │ │ /*!******************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/images/caretdown.png ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/images/caretdown.png ***! │ │ │ │ \******************************************************************************************************/ │ │ │ │ /*! exports provided: default */ │ │ │ │ /***/ │ │ │ │ (function(module, __webpack_exports__, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.p + \"ce00730515ffc48dc3092a83ceaa47b5.png\");\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/images/caretdown.png?"); │ │ │ │ + eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.p + \"ce00730515ffc48dc3092a83ceaa47b5.png\");\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/images/caretdown.png?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/default-theme/images/caretleft.png": │ │ │ │ /*!******************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/images/caretleft.png ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/images/caretleft.png ***! │ │ │ │ \******************************************************************************************************/ │ │ │ │ /*! exports provided: default */ │ │ │ │ /***/ │ │ │ │ (function(module, __webpack_exports__, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.p + \"d931ef5dd6f8edf07706d992a5f9c9b1.png\");\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/images/caretleft.png?"); │ │ │ │ + eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.p + \"d931ef5dd6f8edf07706d992a5f9c9b1.png\");\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/images/caretleft.png?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/default-theme/images/caretright.png": │ │ │ │ /*!*******************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/images/caretright.png ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/images/caretright.png ***! │ │ │ │ \*******************************************************************************************************/ │ │ │ │ /*! exports provided: default */ │ │ │ │ /***/ │ │ │ │ (function(module, __webpack_exports__, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.p + \"13d8dd6bab096d39d72e58cc572d0d5e.png\");\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/images/caretright.png?"); │ │ │ │ + eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.p + \"13d8dd6bab096d39d72e58cc572d0d5e.png\");\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/images/caretright.png?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/default-theme/images/caretup.png": │ │ │ │ /*!****************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/images/caretup.png ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/images/caretup.png ***! │ │ │ │ \****************************************************************************************************/ │ │ │ │ /*! exports provided: default */ │ │ │ │ /***/ │ │ │ │ (function(module, __webpack_exports__, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.p + \"5d5a80a1f26acd8f2b0b2185541ba2f5.png\");\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/default-theme/images/caretup.png?"); │ │ │ │ + eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.p + \"5d5a80a1f26acd8f2b0b2185541ba2f5.png\");\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/default-theme/images/caretup.png?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/disposable/dist/index.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/disposable/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/disposable/dist/index.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n/**\n * A disposable object which delegates to a callback function.\n */\nvar DisposableDelegate = /** @class */ (function () {\n /**\n * Construct a new disposable delegate.\n *\n * @param fn - The callback function to invoke on dispose.\n */\n function DisposableDelegate(fn) {\n this._fn = fn;\n }\n Object.defineProperty(DisposableDelegate.prototype, \"isDisposed\", {\n /**\n * Test whether the delegate has been disposed.\n */\n get: function () {\n return !this._fn;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the delegate and invoke the callback function.\n */\n DisposableDelegate.prototype.dispose = function () {\n if (!this._fn) {\n return;\n }\n var fn = this._fn;\n this._fn = null;\n fn();\n };\n return DisposableDelegate;\n}());\n/**\n * An observable disposable object which delegates to a callback function.\n */\nvar ObservableDisposableDelegate = /** @class */ (function (_super) {\n tslib.__extends(ObservableDisposableDelegate, _super);\n function ObservableDisposableDelegate() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._disposed = new signaling.Signal(_this);\n return _this;\n }\n Object.defineProperty(ObservableDisposableDelegate.prototype, \"disposed\", {\n /**\n * A signal emitted when the delegate is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the delegate and invoke the callback function.\n */\n ObservableDisposableDelegate.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n _super.prototype.dispose.call(this);\n this._disposed.emit(undefined);\n signaling.Signal.clearData(this);\n };\n return ObservableDisposableDelegate;\n}(DisposableDelegate));\n/**\n * An object which manages a collection of disposable items.\n */\nexports.DisposableSet = /** @class */ (function () {\n /**\n * Construct a new disposable set.\n */\n function DisposableSet() {\n this._isDisposed = false;\n this._items = new Set();\n }\n Object.defineProperty(DisposableSet.prototype, \"isDisposed\", {\n /**\n * Test whether the set has been disposed.\n */\n get: function () {\n return this._isDisposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the set and the items it contains.\n *\n * #### Notes\n * Items are disposed in the order they are added to the set.\n */\n DisposableSet.prototype.dispose = function () {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._items.forEach(function (item) { item.dispose(); });\n this._items.clear();\n };\n /**\n * Test whether the set contains a specific item.\n *\n * @param item - The item of interest.\n *\n * @returns `true` if the set contains the item, `false` otherwise.\n */\n DisposableSet.prototype.contains = function (item) {\n return this._items.has(item);\n };\n /**\n * Add a disposable item to the set.\n *\n * @param item - The item to add to the set.\n *\n * #### Notes\n * If the item is already contained in the set, this is a no-op.\n */\n DisposableSet.prototype.add = function (item) {\n this._items.add(item);\n };\n /**\n * Remove a disposable item from the set.\n *\n * @param item - The item to remove from the set.\n *\n * #### Notes\n * If the item is not contained in the set, this is a no-op.\n */\n DisposableSet.prototype.remove = function (item) {\n this._items.delete(item);\n };\n /**\n * Remove all items from the set.\n */\n DisposableSet.prototype.clear = function () {\n this._items.clear();\n };\n return DisposableSet;\n}());\n/**\n * The namespace for the `DisposableSet` class statics.\n */\n(function (DisposableSet) {\n /**\n * Create a disposable set from an iterable of items.\n *\n * @param items - The iterable or array-like object of interest.\n *\n * @returns A new disposable initialized with the given items.\n */\n function from(items) {\n var set = new DisposableSet();\n algorithm.each(items, function (item) { set.add(item); });\n return set;\n }\n DisposableSet.from = from;\n})(exports.DisposableSet || (exports.DisposableSet = {}));\n/**\n * An observable object which manages a collection of disposable items.\n */\nexports.ObservableDisposableSet = /** @class */ (function (_super) {\n tslib.__extends(ObservableDisposableSet, _super);\n function ObservableDisposableSet() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._disposed = new signaling.Signal(_this);\n return _this;\n }\n Object.defineProperty(ObservableDisposableSet.prototype, \"disposed\", {\n /**\n * A signal emitted when the set is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the set and the items it contains.\n *\n * #### Notes\n * Items are disposed in the order they are added to the set.\n */\n ObservableDisposableSet.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n _super.prototype.dispose.call(this);\n this._disposed.emit(undefined);\n signaling.Signal.clearData(this);\n };\n return ObservableDisposableSet;\n}(exports.DisposableSet));\n/**\n * The namespace for the `ObservableDisposableSet` class statics.\n */\n(function (ObservableDisposableSet) {\n /**\n * Create an observable disposable set from an iterable of items.\n *\n * @param items - The iterable or array-like object of interest.\n *\n * @returns A new disposable initialized with the given items.\n */\n function from(items) {\n var set = new ObservableDisposableSet();\n algorithm.each(items, function (item) { set.add(item); });\n return set;\n }\n ObservableDisposableSet.from = from;\n})(exports.ObservableDisposableSet || (exports.ObservableDisposableSet = {}));\n\nexports.DisposableDelegate = DisposableDelegate;\nexports.ObservableDisposableDelegate = ObservableDisposableDelegate;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/disposable/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n/**\n * A disposable object which delegates to a callback function.\n */\nvar DisposableDelegate = /** @class */ (function () {\n /**\n * Construct a new disposable delegate.\n *\n * @param fn - The callback function to invoke on dispose.\n */\n function DisposableDelegate(fn) {\n this._fn = fn;\n }\n Object.defineProperty(DisposableDelegate.prototype, \"isDisposed\", {\n /**\n * Test whether the delegate has been disposed.\n */\n get: function () {\n return !this._fn;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the delegate and invoke the callback function.\n */\n DisposableDelegate.prototype.dispose = function () {\n if (!this._fn) {\n return;\n }\n var fn = this._fn;\n this._fn = null;\n fn();\n };\n return DisposableDelegate;\n}());\n/**\n * An observable disposable object which delegates to a callback function.\n */\nvar ObservableDisposableDelegate = /** @class */ (function (_super) {\n tslib.__extends(ObservableDisposableDelegate, _super);\n function ObservableDisposableDelegate() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._disposed = new signaling.Signal(_this);\n return _this;\n }\n Object.defineProperty(ObservableDisposableDelegate.prototype, \"disposed\", {\n /**\n * A signal emitted when the delegate is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the delegate and invoke the callback function.\n */\n ObservableDisposableDelegate.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n _super.prototype.dispose.call(this);\n this._disposed.emit(undefined);\n signaling.Signal.clearData(this);\n };\n return ObservableDisposableDelegate;\n}(DisposableDelegate));\n/**\n * An object which manages a collection of disposable items.\n */\nexports.DisposableSet = /** @class */ (function () {\n /**\n * Construct a new disposable set.\n */\n function DisposableSet() {\n this._isDisposed = false;\n this._items = new Set();\n }\n Object.defineProperty(DisposableSet.prototype, \"isDisposed\", {\n /**\n * Test whether the set has been disposed.\n */\n get: function () {\n return this._isDisposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the set and the items it contains.\n *\n * #### Notes\n * Items are disposed in the order they are added to the set.\n */\n DisposableSet.prototype.dispose = function () {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._items.forEach(function (item) { item.dispose(); });\n this._items.clear();\n };\n /**\n * Test whether the set contains a specific item.\n *\n * @param item - The item of interest.\n *\n * @returns `true` if the set contains the item, `false` otherwise.\n */\n DisposableSet.prototype.contains = function (item) {\n return this._items.has(item);\n };\n /**\n * Add a disposable item to the set.\n *\n * @param item - The item to add to the set.\n *\n * #### Notes\n * If the item is already contained in the set, this is a no-op.\n */\n DisposableSet.prototype.add = function (item) {\n this._items.add(item);\n };\n /**\n * Remove a disposable item from the set.\n *\n * @param item - The item to remove from the set.\n *\n * #### Notes\n * If the item is not contained in the set, this is a no-op.\n */\n DisposableSet.prototype.remove = function (item) {\n this._items.delete(item);\n };\n /**\n * Remove all items from the set.\n */\n DisposableSet.prototype.clear = function () {\n this._items.clear();\n };\n return DisposableSet;\n}());\n/**\n * The namespace for the `DisposableSet` class statics.\n */\n(function (DisposableSet) {\n /**\n * Create a disposable set from an iterable of items.\n *\n * @param items - The iterable or array-like object of interest.\n *\n * @returns A new disposable initialized with the given items.\n */\n function from(items) {\n var set = new DisposableSet();\n algorithm.each(items, function (item) { set.add(item); });\n return set;\n }\n DisposableSet.from = from;\n})(exports.DisposableSet || (exports.DisposableSet = {}));\n/**\n * An observable object which manages a collection of disposable items.\n */\nexports.ObservableDisposableSet = /** @class */ (function (_super) {\n tslib.__extends(ObservableDisposableSet, _super);\n function ObservableDisposableSet() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._disposed = new signaling.Signal(_this);\n return _this;\n }\n Object.defineProperty(ObservableDisposableSet.prototype, \"disposed\", {\n /**\n * A signal emitted when the set is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Dispose of the set and the items it contains.\n *\n * #### Notes\n * Items are disposed in the order they are added to the set.\n */\n ObservableDisposableSet.prototype.dispose = function () {\n if (this.isDisposed) {\n return;\n }\n _super.prototype.dispose.call(this);\n this._disposed.emit(undefined);\n signaling.Signal.clearData(this);\n };\n return ObservableDisposableSet;\n}(exports.DisposableSet));\n/**\n * The namespace for the `ObservableDisposableSet` class statics.\n */\n(function (ObservableDisposableSet) {\n /**\n * Create an observable disposable set from an iterable of items.\n *\n * @param items - The iterable or array-like object of interest.\n *\n * @returns A new disposable initialized with the given items.\n */\n function from(items) {\n var set = new ObservableDisposableSet();\n algorithm.each(items, function (item) { set.add(item); });\n return set;\n }\n ObservableDisposableSet.from = from;\n})(exports.ObservableDisposableSet || (exports.ObservableDisposableSet = {}));\n\nexports.DisposableDelegate = DisposableDelegate;\nexports.ObservableDisposableDelegate = ObservableDisposableDelegate;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/disposable/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/domutils/dist/clipboard.js": │ │ │ │ /*!**********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/clipboard.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/clipboard.js ***! │ │ │ │ \**********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (ClipboardExt) {\n /**\n * Copy text to the system clipboard.\n *\n * @param text - The text to copy to the clipboard.\n */\n function copyText(text) {\n // Fetch the document body.\n var body = document.body;\n // Set up the clipboard event listener.\n var handler = function (event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Set the clipboard data.\n event.clipboardData.setData('text', text);\n // Remove the event listener.\n body.removeEventListener('copy', handler, true);\n };\n // Add the event listener.\n body.addEventListener('copy', handler, true);\n // Trigger the event.\n document.execCommand('copy');\n }\n ClipboardExt.copyText = copyText;\n})(exports.ClipboardExt || (exports.ClipboardExt = {}));\n//# sourceMappingURL=clipboard.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/clipboard.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (ClipboardExt) {\n /**\n * Copy text to the system clipboard.\n *\n * @param text - The text to copy to the clipboard.\n */\n function copyText(text) {\n // Fetch the document body.\n var body = document.body;\n // Set up the clipboard event listener.\n var handler = function (event) {\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Set the clipboard data.\n event.clipboardData.setData('text', text);\n // Remove the event listener.\n body.removeEventListener('copy', handler, true);\n };\n // Add the event listener.\n body.addEventListener('copy', handler, true);\n // Trigger the event.\n document.execCommand('copy');\n }\n ClipboardExt.copyText = copyText;\n})(exports.ClipboardExt || (exports.ClipboardExt = {}));\n//# sourceMappingURL=clipboard.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/clipboard.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/domutils/dist/element.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/element.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/element.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (ElementExt) {\n /**\n * Compute the box sizing for an element.\n *\n * @param element - The element of interest.\n *\n * @returns The box sizing data for the specified element.\n */\n function boxSizing(element) {\n var style = window.getComputedStyle(element);\n var bt = parseFloat(style.borderTopWidth) || 0;\n var bl = parseFloat(style.borderLeftWidth) || 0;\n var br = parseFloat(style.borderRightWidth) || 0;\n var bb = parseFloat(style.borderBottomWidth) || 0;\n var pt = parseFloat(style.paddingTop) || 0;\n var pl = parseFloat(style.paddingLeft) || 0;\n var pr = parseFloat(style.paddingRight) || 0;\n var pb = parseFloat(style.paddingBottom) || 0;\n var hs = bl + pl + pr + br;\n var vs = bt + pt + pb + bb;\n return {\n borderTop: bt,\n borderLeft: bl,\n borderRight: br,\n borderBottom: bb,\n paddingTop: pt,\n paddingLeft: pl,\n paddingRight: pr,\n paddingBottom: pb,\n horizontalSum: hs,\n verticalSum: vs\n };\n }\n ElementExt.boxSizing = boxSizing;\n /**\n * Compute the size limits for an element.\n *\n * @param element - The element of interest.\n *\n * @returns The size limit data for the specified element.\n */\n function sizeLimits(element) {\n var style = window.getComputedStyle(element);\n var minWidth = parseFloat(style.minWidth) || 0;\n var minHeight = parseFloat(style.minHeight) || 0;\n var maxWidth = parseFloat(style.maxWidth) || Infinity;\n var maxHeight = parseFloat(style.maxHeight) || Infinity;\n maxWidth = Math.max(minWidth, maxWidth);\n maxHeight = Math.max(minHeight, maxHeight);\n return { minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight };\n }\n ElementExt.sizeLimits = sizeLimits;\n /**\n * Test whether a client position lies within an element.\n *\n * @param element - The DOM element of interest.\n *\n * @param clientX - The client X coordinate of interest.\n *\n * @param clientY - The client Y coordinate of interest.\n *\n * @returns Whether the point is within the given element.\n */\n function hitTest(element, clientX, clientY) {\n var rect = element.getBoundingClientRect();\n return (clientX >= rect.left &&\n clientX < rect.right &&\n clientY >= rect.top &&\n clientY < rect.bottom);\n }\n ElementExt.hitTest = hitTest;\n /**\n * Vertically scroll an element into view if needed.\n *\n * @param area - The scroll area element.\n *\n * @param element - The element of interest.\n *\n * #### Notes\n * This follows the \"nearest\" behavior of the native `scrollIntoView`\n * method, which is not supported by all browsers.\n * https://drafts.csswg.org/cssom-view/#element-scrolling-members\n *\n * If the element fully covers the visible area or is fully contained\n * within the visible area, no scrolling will take place. Otherwise,\n * the nearest edges of the area and element are aligned.\n */\n function scrollIntoViewIfNeeded(area, element) {\n var ar = area.getBoundingClientRect();\n var er = element.getBoundingClientRect();\n if (er.top <= ar.top && er.bottom >= ar.bottom) {\n return;\n }\n if (er.top < ar.top && er.height <= ar.height) {\n area.scrollTop -= ar.top - er.top;\n return;\n }\n if (er.bottom > ar.bottom && er.height >= ar.height) {\n area.scrollTop -= ar.top - er.top;\n return;\n }\n if (er.top < ar.top && er.height > ar.height) {\n area.scrollTop -= ar.bottom - er.bottom;\n return;\n }\n if (er.bottom > ar.bottom && er.height < ar.height) {\n area.scrollTop -= ar.bottom - er.bottom;\n return;\n }\n }\n ElementExt.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;\n})(exports.ElementExt || (exports.ElementExt = {}));\n//# sourceMappingURL=element.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/element.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (ElementExt) {\n /**\n * Compute the box sizing for an element.\n *\n * @param element - The element of interest.\n *\n * @returns The box sizing data for the specified element.\n */\n function boxSizing(element) {\n var style = window.getComputedStyle(element);\n var bt = parseFloat(style.borderTopWidth) || 0;\n var bl = parseFloat(style.borderLeftWidth) || 0;\n var br = parseFloat(style.borderRightWidth) || 0;\n var bb = parseFloat(style.borderBottomWidth) || 0;\n var pt = parseFloat(style.paddingTop) || 0;\n var pl = parseFloat(style.paddingLeft) || 0;\n var pr = parseFloat(style.paddingRight) || 0;\n var pb = parseFloat(style.paddingBottom) || 0;\n var hs = bl + pl + pr + br;\n var vs = bt + pt + pb + bb;\n return {\n borderTop: bt,\n borderLeft: bl,\n borderRight: br,\n borderBottom: bb,\n paddingTop: pt,\n paddingLeft: pl,\n paddingRight: pr,\n paddingBottom: pb,\n horizontalSum: hs,\n verticalSum: vs\n };\n }\n ElementExt.boxSizing = boxSizing;\n /**\n * Compute the size limits for an element.\n *\n * @param element - The element of interest.\n *\n * @returns The size limit data for the specified element.\n */\n function sizeLimits(element) {\n var style = window.getComputedStyle(element);\n var minWidth = parseFloat(style.minWidth) || 0;\n var minHeight = parseFloat(style.minHeight) || 0;\n var maxWidth = parseFloat(style.maxWidth) || Infinity;\n var maxHeight = parseFloat(style.maxHeight) || Infinity;\n maxWidth = Math.max(minWidth, maxWidth);\n maxHeight = Math.max(minHeight, maxHeight);\n return { minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight };\n }\n ElementExt.sizeLimits = sizeLimits;\n /**\n * Test whether a client position lies within an element.\n *\n * @param element - The DOM element of interest.\n *\n * @param clientX - The client X coordinate of interest.\n *\n * @param clientY - The client Y coordinate of interest.\n *\n * @returns Whether the point is within the given element.\n */\n function hitTest(element, clientX, clientY) {\n var rect = element.getBoundingClientRect();\n return (clientX >= rect.left &&\n clientX < rect.right &&\n clientY >= rect.top &&\n clientY < rect.bottom);\n }\n ElementExt.hitTest = hitTest;\n /**\n * Vertically scroll an element into view if needed.\n *\n * @param area - The scroll area element.\n *\n * @param element - The element of interest.\n *\n * #### Notes\n * This follows the \"nearest\" behavior of the native `scrollIntoView`\n * method, which is not supported by all browsers.\n * https://drafts.csswg.org/cssom-view/#element-scrolling-members\n *\n * If the element fully covers the visible area or is fully contained\n * within the visible area, no scrolling will take place. Otherwise,\n * the nearest edges of the area and element are aligned.\n */\n function scrollIntoViewIfNeeded(area, element) {\n var ar = area.getBoundingClientRect();\n var er = element.getBoundingClientRect();\n if (er.top <= ar.top && er.bottom >= ar.bottom) {\n return;\n }\n if (er.top < ar.top && er.height <= ar.height) {\n area.scrollTop -= ar.top - er.top;\n return;\n }\n if (er.bottom > ar.bottom && er.height >= ar.height) {\n area.scrollTop -= ar.top - er.top;\n return;\n }\n if (er.top < ar.top && er.height > ar.height) {\n area.scrollTop -= ar.bottom - er.bottom;\n return;\n }\n if (er.bottom > ar.bottom && er.height < ar.height) {\n area.scrollTop -= ar.bottom - er.bottom;\n return;\n }\n }\n ElementExt.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;\n})(exports.ElementExt || (exports.ElementExt = {}));\n//# sourceMappingURL=element.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/element.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/domutils/dist/index.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/index.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar clipboard = __webpack_require__(/*! ./clipboard.js */ \"../../packages/domutils/dist/clipboard.js\");\nvar element = __webpack_require__(/*! ./element.js */ \"../../packages/domutils/dist/element.js\");\nvar platform = __webpack_require__(/*! ./platform.js */ \"../../packages/domutils/dist/platform.js\");\nvar selector = __webpack_require__(/*! ./selector.js */ \"../../packages/domutils/dist/selector.js\");\n\n\n\nObject.defineProperty(exports, 'ClipboardExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn clipboard.ClipboardExt;\n\t}\n});\nObject.defineProperty(exports, 'ElementExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn element.ElementExt;\n\t}\n});\nObject.defineProperty(exports, 'Platform', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn platform.Platform;\n\t}\n});\nObject.defineProperty(exports, 'Selector', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn selector.Selector;\n\t}\n});\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar clipboard = __webpack_require__(/*! ./clipboard.js */ \"../../packages/domutils/dist/clipboard.js\");\nvar element = __webpack_require__(/*! ./element.js */ \"../../packages/domutils/dist/element.js\");\nvar platform = __webpack_require__(/*! ./platform.js */ \"../../packages/domutils/dist/platform.js\");\nvar selector = __webpack_require__(/*! ./selector.js */ \"../../packages/domutils/dist/selector.js\");\n\n\n\nObject.defineProperty(exports, 'ClipboardExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn clipboard.ClipboardExt;\n\t}\n});\nObject.defineProperty(exports, 'ElementExt', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn element.ElementExt;\n\t}\n});\nObject.defineProperty(exports, 'Platform', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn platform.Platform;\n\t}\n});\nObject.defineProperty(exports, 'Selector', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn selector.Selector;\n\t}\n});\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/domutils/dist/platform.js": │ │ │ │ /*!*********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/platform.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/platform.js ***! │ │ │ │ \*********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (Platform) {\n /**\n * A flag indicating whether the platform is Mac.\n */\n Platform.IS_MAC = !!navigator.platform.match(/Mac/i);\n /**\n * A flag indicating whether the platform is Windows.\n */\n Platform.IS_WIN = !!navigator.platform.match(/Win/i);\n /**\n * A flag indicating whether the browser is IE.\n */\n Platform.IS_IE = /Trident/.test(navigator.userAgent);\n /**\n * A flag indicating whether the browser is Edge.\n */\n Platform.IS_EDGE = /Edge/.test(navigator.userAgent);\n /**\n * Test whether the `accel` key is pressed.\n *\n * @param event - The keyboard or mouse event of interest.\n *\n * @returns Whether the `accel` key is pressed.\n *\n * #### Notes\n * On Mac the `accel` key is the command key. On all other\n * platforms the `accel` key is the control key.\n */\n function accelKey(event) {\n return Platform.IS_MAC ? event.metaKey : event.ctrlKey;\n }\n Platform.accelKey = accelKey;\n})(exports.Platform || (exports.Platform = {}));\n//# sourceMappingURL=platform.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/platform.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (Platform) {\n /**\n * A flag indicating whether the platform is Mac.\n */\n Platform.IS_MAC = !!navigator.platform.match(/Mac/i);\n /**\n * A flag indicating whether the platform is Windows.\n */\n Platform.IS_WIN = !!navigator.platform.match(/Win/i);\n /**\n * A flag indicating whether the browser is IE.\n */\n Platform.IS_IE = /Trident/.test(navigator.userAgent);\n /**\n * A flag indicating whether the browser is Edge.\n */\n Platform.IS_EDGE = /Edge/.test(navigator.userAgent);\n /**\n * Test whether the `accel` key is pressed.\n *\n * @param event - The keyboard or mouse event of interest.\n *\n * @returns Whether the `accel` key is pressed.\n *\n * #### Notes\n * On Mac the `accel` key is the command key. On all other\n * platforms the `accel` key is the control key.\n */\n function accelKey(event) {\n return Platform.IS_MAC ? event.metaKey : event.ctrlKey;\n }\n Platform.accelKey = accelKey;\n})(exports.Platform || (exports.Platform = {}));\n//# sourceMappingURL=platform.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/platform.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/domutils/dist/selector.js": │ │ │ │ /*!*********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/selector.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/selector.js ***! │ │ │ │ \*********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (Selector) {\n /**\n * Calculate the specificity of a single CSS selector.\n *\n * @param selector - The CSS selector of interest.\n *\n * @returns The specificity of the selector.\n *\n * #### Undefined Behavior\n * The selector is invalid.\n *\n * #### Notes\n * This is based on https://www.w3.org/TR/css3-selectors/#specificity\n *\n * A larger number represents a more specific selector.\n *\n * The smallest possible specificity is `0`.\n *\n * The result is represented as a hex number `0x` where\n * each component is the count of the respective selector clause.\n *\n * If the selector contains commas, only the first clause is used.\n *\n * The computed result is cached, so subsequent calculations for the\n * same selector are extremely fast.\n */\n function calculateSpecificity(selector) {\n if (selector in Private.specificityCache) {\n return Private.specificityCache[selector];\n }\n var result = Private.calculateSingle(selector);\n return Private.specificityCache[selector] = result;\n }\n Selector.calculateSpecificity = calculateSpecificity;\n /**\n * Test whether a selector is a valid CSS selector.\n *\n * @param selector - The CSS selector of interest.\n *\n * @returns `true` if the selector is valid, `false` otherwise.\n *\n * #### Notes\n * The computed result is cached, so subsequent tests for the same\n * selector are extremely fast.\n */\n function isValid(selector) {\n if (selector in Private.validityCache) {\n return Private.validityCache[selector];\n }\n var result = true;\n try {\n Private.testElem.querySelector(selector);\n }\n catch (err) {\n result = false;\n }\n return Private.validityCache[selector] = result;\n }\n Selector.isValid = isValid;\n /**\n * Test whether an element matches a CSS selector.\n *\n * @param element - The element of interest.\n *\n * @param selector - The valid CSS selector of interest.\n *\n * @returns `true` if the element is a match, `false` otherwise.\n *\n * #### Notes\n * This function uses the builtin browser capabilities when possible,\n * falling back onto a document query otherwise.\n */\n function matches(element, selector) {\n return Private.protoMatchFunc.call(element, selector);\n }\n Selector.matches = matches;\n})(exports.Selector || (exports.Selector = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A cache of computed selector specificity values.\n */\n Private.specificityCache = Object.create(null);\n /**\n * A cache of computed selector validity.\n */\n Private.validityCache = Object.create(null);\n /**\n * An empty element for testing selector validity.\n */\n Private.testElem = document.createElement('div');\n /**\n * A cross-browser CSS selector matching prototype function.\n */\n Private.protoMatchFunc = (function () {\n var proto = Element.prototype;\n return (proto.matches ||\n proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector ||\n (function (selector) {\n var elem = this;\n var matches = elem.ownerDocument ? elem.ownerDocument.querySelectorAll(selector) : [];\n return Array.prototype.indexOf.call(matches, elem) !== -1;\n }));\n })();\n /**\n * Calculate the specificity of a single selector.\n *\n * The behavior is undefined if the selector is invalid.\n */\n function calculateSingle(selector) {\n // Ignore anything after the first comma.\n selector = selector.split(',', 1)[0];\n // Setup the aggregate counters.\n var a = 0;\n var b = 0;\n var c = 0;\n // Apply a regex to the front of the selector. If it succeeds, that\n // portion of the selector is removed. Returns a success/fail flag.\n function match(re) {\n var match = selector.match(re);\n if (match === null) {\n return false;\n }\n selector = selector.slice(match[0].length);\n return true;\n }\n // Replace the negation pseudo-class (which is ignored),\n // but keep its inner content (which is not ignored).\n selector = selector.replace(NEGATION_RE, ' $1 ');\n // Continue matching until the selector is consumed.\n while (selector.length > 0) {\n // Match an ID selector.\n if (match(ID_RE)) {\n a++;\n continue;\n }\n // Match a class selector.\n if (match(CLASS_RE)) {\n b++;\n continue;\n }\n // Match an attribute selector.\n if (match(ATTR_RE)) {\n b++;\n continue;\n }\n // Match a pseudo-element selector. This is done before matching\n // a pseudo-class since this regex overlaps with that regex.\n if (match(PSEUDO_ELEM_RE)) {\n c++;\n continue;\n }\n // Match a pseudo-class selector.\n if (match(PSEDUO_CLASS_RE)) {\n b++;\n continue;\n }\n // Match a plain type selector.\n if (match(TYPE_RE)) {\n c++;\n continue;\n }\n // Finally, match any ignored characters.\n if (match(IGNORE_RE)) {\n continue;\n }\n // At this point, the selector is assumed to be invalid.\n return 0;\n }\n // Clamp each component to a reasonable base.\n a = Math.min(a, 0xFF);\n b = Math.min(b, 0xFF);\n c = Math.min(c, 0xFF);\n // Combine the components into a single result.\n return (a << 16) | (b << 8) | c;\n }\n Private.calculateSingle = calculateSingle;\n /**\n * A regex which matches an ID selector at string start.\n */\n var ID_RE = /^#[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches a class selector at string start.\n */\n var CLASS_RE = /^\\.[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches an attribute selector at string start.\n */\n var ATTR_RE = /^\\[[^\\]]+\\]/;\n /**\n * A regex which matches a type selector at string start.\n */\n var TYPE_RE = /^[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches a pseudo-element selector at string start.\n */\n var PSEUDO_ELEM_RE = /^(::[^\\s\\+>~#\\.\\[:]+|:first-line|:first-letter|:before|:after)/;\n /**\n * A regex which matches a pseudo-class selector at string start.\n */\n var PSEDUO_CLASS_RE = /^:[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches ignored characters at string start.\n */\n var IGNORE_RE = /^[\\s\\+>~\\*]+/;\n /**\n * A regex which matches the negation pseudo-class globally.\n */\n var NEGATION_RE = /:not\\(([^\\)]+)\\)/g;\n})(Private || (Private = {}));\n//# sourceMappingURL=selector.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/domutils/dist/selector.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n(function (Selector) {\n /**\n * Calculate the specificity of a single CSS selector.\n *\n * @param selector - The CSS selector of interest.\n *\n * @returns The specificity of the selector.\n *\n * #### Undefined Behavior\n * The selector is invalid.\n *\n * #### Notes\n * This is based on https://www.w3.org/TR/css3-selectors/#specificity\n *\n * A larger number represents a more specific selector.\n *\n * The smallest possible specificity is `0`.\n *\n * The result is represented as a hex number `0x` where\n * each component is the count of the respective selector clause.\n *\n * If the selector contains commas, only the first clause is used.\n *\n * The computed result is cached, so subsequent calculations for the\n * same selector are extremely fast.\n */\n function calculateSpecificity(selector) {\n if (selector in Private.specificityCache) {\n return Private.specificityCache[selector];\n }\n var result = Private.calculateSingle(selector);\n return Private.specificityCache[selector] = result;\n }\n Selector.calculateSpecificity = calculateSpecificity;\n /**\n * Test whether a selector is a valid CSS selector.\n *\n * @param selector - The CSS selector of interest.\n *\n * @returns `true` if the selector is valid, `false` otherwise.\n *\n * #### Notes\n * The computed result is cached, so subsequent tests for the same\n * selector are extremely fast.\n */\n function isValid(selector) {\n if (selector in Private.validityCache) {\n return Private.validityCache[selector];\n }\n var result = true;\n try {\n Private.testElem.querySelector(selector);\n }\n catch (err) {\n result = false;\n }\n return Private.validityCache[selector] = result;\n }\n Selector.isValid = isValid;\n /**\n * Test whether an element matches a CSS selector.\n *\n * @param element - The element of interest.\n *\n * @param selector - The valid CSS selector of interest.\n *\n * @returns `true` if the element is a match, `false` otherwise.\n *\n * #### Notes\n * This function uses the builtin browser capabilities when possible,\n * falling back onto a document query otherwise.\n */\n function matches(element, selector) {\n return Private.protoMatchFunc.call(element, selector);\n }\n Selector.matches = matches;\n})(exports.Selector || (exports.Selector = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A cache of computed selector specificity values.\n */\n Private.specificityCache = Object.create(null);\n /**\n * A cache of computed selector validity.\n */\n Private.validityCache = Object.create(null);\n /**\n * An empty element for testing selector validity.\n */\n Private.testElem = document.createElement('div');\n /**\n * A cross-browser CSS selector matching prototype function.\n */\n Private.protoMatchFunc = (function () {\n var proto = Element.prototype;\n return (proto.matches ||\n proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector ||\n (function (selector) {\n var elem = this;\n var matches = elem.ownerDocument ? elem.ownerDocument.querySelectorAll(selector) : [];\n return Array.prototype.indexOf.call(matches, elem) !== -1;\n }));\n })();\n /**\n * Calculate the specificity of a single selector.\n *\n * The behavior is undefined if the selector is invalid.\n */\n function calculateSingle(selector) {\n // Ignore anything after the first comma.\n selector = selector.split(',', 1)[0];\n // Setup the aggregate counters.\n var a = 0;\n var b = 0;\n var c = 0;\n // Apply a regex to the front of the selector. If it succeeds, that\n // portion of the selector is removed. Returns a success/fail flag.\n function match(re) {\n var match = selector.match(re);\n if (match === null) {\n return false;\n }\n selector = selector.slice(match[0].length);\n return true;\n }\n // Replace the negation pseudo-class (which is ignored),\n // but keep its inner content (which is not ignored).\n selector = selector.replace(NEGATION_RE, ' $1 ');\n // Continue matching until the selector is consumed.\n while (selector.length > 0) {\n // Match an ID selector.\n if (match(ID_RE)) {\n a++;\n continue;\n }\n // Match a class selector.\n if (match(CLASS_RE)) {\n b++;\n continue;\n }\n // Match an attribute selector.\n if (match(ATTR_RE)) {\n b++;\n continue;\n }\n // Match a pseudo-element selector. This is done before matching\n // a pseudo-class since this regex overlaps with that regex.\n if (match(PSEUDO_ELEM_RE)) {\n c++;\n continue;\n }\n // Match a pseudo-class selector.\n if (match(PSEDUO_CLASS_RE)) {\n b++;\n continue;\n }\n // Match a plain type selector.\n if (match(TYPE_RE)) {\n c++;\n continue;\n }\n // Finally, match any ignored characters.\n if (match(IGNORE_RE)) {\n continue;\n }\n // At this point, the selector is assumed to be invalid.\n return 0;\n }\n // Clamp each component to a reasonable base.\n a = Math.min(a, 0xFF);\n b = Math.min(b, 0xFF);\n c = Math.min(c, 0xFF);\n // Combine the components into a single result.\n return (a << 16) | (b << 8) | c;\n }\n Private.calculateSingle = calculateSingle;\n /**\n * A regex which matches an ID selector at string start.\n */\n var ID_RE = /^#[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches a class selector at string start.\n */\n var CLASS_RE = /^\\.[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches an attribute selector at string start.\n */\n var ATTR_RE = /^\\[[^\\]]+\\]/;\n /**\n * A regex which matches a type selector at string start.\n */\n var TYPE_RE = /^[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches a pseudo-element selector at string start.\n */\n var PSEUDO_ELEM_RE = /^(::[^\\s\\+>~#\\.\\[:]+|:first-line|:first-letter|:before|:after)/;\n /**\n * A regex which matches a pseudo-class selector at string start.\n */\n var PSEDUO_CLASS_RE = /^:[^\\s\\+>~#\\.\\[:]+/;\n /**\n * A regex which matches ignored characters at string start.\n */\n var IGNORE_RE = /^[\\s\\+>~\\*]+/;\n /**\n * A regex which matches the negation pseudo-class globally.\n */\n var NEGATION_RE = /:not\\(([^\\)]+)\\)/g;\n})(Private || (Private = {}));\n//# sourceMappingURL=selector.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/domutils/dist/selector.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/dragdrop/dist/index.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/dragdrop/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/dragdrop/dist/index.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar disposable = __webpack_require__(/*! @lumino/disposable */ \"../../packages/disposable/dist/index.js\");\n\n/**\n * An object which manages a drag-drop operation.\n *\n * A drag object dispatches four different events to drop targets:\n *\n * - `'lm-dragenter'` - Dispatched when the mouse enters the target\n * element. This event must be canceled in order to receive any\n * of the other events.\n *\n * - `'lm-dragover'` - Dispatched when the mouse moves over the drop\n * target. It must cancel the event and set the `dropAction` to one\n * of the supported actions in order to receive drop events.\n *\n * - `'lm-dragleave'` - Dispatched when the mouse leaves the target\n * element. This includes moving the mouse into child elements.\n *\n * - `'lm-drop'`- Dispatched when the mouse is released over the target\n * element when the target indicates an appropriate drop action. If\n * the event is canceled, the indicated drop action is returned to\n * the initiator through the resolved promise.\n *\n * A drag operation can be terminated at any time by pressing `Escape`\n * or by disposing the drag object.\n *\n * A drag object has the ability to automatically scroll a scrollable\n * element when the mouse is hovered near one of its edges. To enable\n * this, add the `data-lm-dragscroll` attribute to any element which\n * the drag object should consider for scrolling.\n *\n * #### Notes\n * This class is designed to be used when dragging and dropping custom\n * data *within* a single application. It is *not* a replacement for\n * the native drag-drop API. Instead, it provides an API which allows\n * drag operations to be initiated programmatically and enables the\n * transfer of arbitrary non-string objects; features which are not\n * possible with the native drag-drop API.\n */\nexports.Drag = /** @class */ (function () {\n /**\n * Construct a new drag object.\n *\n * @param options - The options for initializing the drag.\n */\n function Drag(options) {\n var _this = this;\n /**\n * The scroll loop handler function.\n */\n this._onScrollFrame = function () {\n // Bail early if there is no scroll target.\n if (!_this._scrollTarget) {\n return;\n }\n // Unpack the scroll target.\n var _a = _this._scrollTarget, element = _a.element, edge = _a.edge, distance = _a.distance;\n // Calculate the scroll delta using nonlinear acceleration.\n var d = Private.SCROLL_EDGE_SIZE - distance;\n var f = Math.pow(d / Private.SCROLL_EDGE_SIZE, 2);\n var s = Math.max(1, Math.round(f * Private.SCROLL_EDGE_SIZE));\n // Scroll the element in the specified direction.\n switch (edge) {\n case 'top':\n element.scrollTop -= s;\n break;\n case 'left':\n element.scrollLeft -= s;\n break;\n case 'right':\n element.scrollLeft += s;\n break;\n case 'bottom':\n element.scrollTop += s;\n break;\n }\n // Request the next cycle of the scroll loop.\n requestAnimationFrame(_this._onScrollFrame);\n };\n this._disposed = false;\n this._dropAction = 'none';\n this._override = null;\n this._currentTarget = null;\n this._currentElement = null;\n this._promise = null;\n this._scrollTarget = null;\n this._resolve = null;\n this.mimeData = options.mimeData;\n this.dragImage = options.dragImage || null;\n this.proposedAction = options.proposedAction || 'copy';\n this.supportedActions = options.supportedActions || 'all';\n this.source = options.source || null;\n }\n /**\n * Dispose of the resources held by the drag object.\n *\n * #### Notes\n * This will cancel the drag operation if it is active.\n */\n Drag.prototype.dispose = function () {\n // Do nothing if the drag object is already disposed.\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n // If there is a current target, dispatch a drag leave event.\n if (this._currentTarget) {\n var event_1 = Private.createMouseEvent('mouseup', -1, -1);\n Private.dispatchDragLeave(this, this._currentTarget, null, event_1);\n }\n // Finalize the drag object with `'none'`.\n this._finalize('none');\n };\n Object.defineProperty(Drag.prototype, \"isDisposed\", {\n /**\n * Test whether the drag object is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Start the drag operation at the specified client position.\n *\n * @param clientX - The client X position for the drag start.\n *\n * @param clientY - The client Y position for the drag start.\n *\n * @returns A promise which resolves to the result of the drag.\n *\n * #### Notes\n * If the drag has already been started, the promise created by the\n * first call to `start` is returned.\n *\n * If the drag operation has ended, or if the drag object has been\n * disposed, the returned promise will resolve to `'none'`.\n *\n * The drag object will be automatically disposed when drag operation\n * completes. This means `Drag` objects are for single-use only.\n *\n * This method assumes the left mouse button is already held down.\n */\n Drag.prototype.start = function (clientX, clientY) {\n var _this = this;\n // If the drag object is already disposed, resolve to `None`.\n if (this._disposed) {\n return Promise.resolve('none');\n }\n // If the drag has already been started, return the promise.\n if (this._promise) {\n return this._promise;\n }\n // Install the document listeners for the drag object.\n this._addListeners();\n // Attach the drag image at the specified client position.\n this._attachDragImage(clientX, clientY);\n // Create the promise which will be resolved on completion.\n this._promise = new Promise(function (resolve, reject) {\n _this._resolve = resolve;\n });\n // Trigger a fake move event to kick off the drag operation.\n var event = Private.createMouseEvent('mousemove', clientX, clientY);\n document.dispatchEvent(event);\n // Return the pending promise for the drag operation.\n return this._promise;\n };\n /**\n * Handle the DOM events for the drag operation.\n *\n * @param event - The DOM event sent to the drag object.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the document. It should not be\n * called directly by user code.\n */\n Drag.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n default:\n // Stop all other events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * Move the drag image element to the specified location.\n *\n * This is a no-op if there is no drag image element.\n */\n Drag.prototype.moveDragImage = function (clientX, clientY) {\n if (!this.dragImage) {\n return;\n }\n var style = this.dragImage.style;\n style.top = clientY + \"px\";\n style.left = clientX + \"px\";\n };\n /**\n * Handle the `'mousemove'` event for the drag object.\n */\n Drag.prototype._evtMouseMove = function (event) {\n // Stop all input events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n // Update the current target node and dispatch enter/leave events.\n this._updateCurrentTarget(event);\n // Update the drag scroll element.\n this._updateDragScroll(event);\n // Move the drag image to the specified client position. This is\n // performed *after* dispatching to prevent unnecessary reflows.\n this.moveDragImage(event.clientX, event.clientY);\n };\n /**\n * Handle the `'mouseup'` event for the drag object.\n */\n Drag.prototype._evtMouseUp = function (event) {\n // Stop all input events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n // Do nothing if the left button is not released.\n if (event.button !== 0) {\n return;\n }\n // Update the current target node and dispatch enter/leave events.\n // This prevents a subtle issue where the DOM mutates under the\n // cursor after the last move event but before the drop event.\n this._updateCurrentTarget(event);\n // If there is no current target, finalize with `'none'`.\n if (!this._currentTarget) {\n this._finalize('none');\n return;\n }\n // If the last drop action was `'none'`, dispatch a leave event\n // to the current target and finalize the drag with `'none'`.\n if (this._dropAction === 'none') {\n Private.dispatchDragLeave(this, this._currentTarget, null, event);\n this._finalize('none');\n return;\n }\n // Dispatch the drop event at the current target and finalize\n // with the resulting drop action.\n var action = Private.dispatchDrop(this, this._currentTarget, event);\n this._finalize(action);\n };\n /**\n * Handle the `'keydown'` event for the drag object.\n */\n Drag.prototype._evtKeyDown = function (event) {\n // Stop all input events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n // Cancel the drag if `Escape` is pressed.\n if (event.keyCode === 27) {\n this.dispose();\n }\n };\n /**\n * Add the document event listeners for the drag object.\n */\n Drag.prototype._addListeners = function () {\n document.addEventListener('mousedown', this, true);\n document.addEventListener('mousemove', this, true);\n document.addEventListener('mouseup', this, true);\n document.addEventListener('mouseenter', this, true);\n document.addEventListener('mouseleave', this, true);\n document.addEventListener('mouseover', this, true);\n document.addEventListener('mouseout', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('keyup', this, true);\n document.addEventListener('keypress', this, true);\n document.addEventListener('contextmenu', this, true);\n };\n /**\n * Remove the document event listeners for the drag object.\n */\n Drag.prototype._removeListeners = function () {\n document.removeEventListener('mousedown', this, true);\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('mouseenter', this, true);\n document.removeEventListener('mouseleave', this, true);\n document.removeEventListener('mouseover', this, true);\n document.removeEventListener('mouseout', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('keyup', this, true);\n document.removeEventListener('keypress', this, true);\n document.removeEventListener('contextmenu', this, true);\n };\n /**\n * Update the drag scroll element under the mouse.\n */\n Drag.prototype._updateDragScroll = function (event) {\n // Find the scroll target under the mouse.\n var target = Private.findScrollTarget(event);\n // Bail if there is nothing to scroll.\n if (!this._scrollTarget && !target) {\n return;\n }\n // Start the scroll loop if needed.\n if (!this._scrollTarget) {\n setTimeout(this._onScrollFrame, 500);\n }\n // Update the scroll target.\n this._scrollTarget = target;\n };\n /**\n * Update the current target node using the given mouse event.\n */\n Drag.prototype._updateCurrentTarget = function (event) {\n // Fetch common local state.\n var prevTarget = this._currentTarget;\n var currTarget = this._currentTarget;\n var prevElem = this._currentElement;\n // Find the current indicated element at the given position.\n var currElem = document.elementFromPoint(event.clientX, event.clientY);\n // Update the current element reference.\n this._currentElement = currElem;\n // If the indicated element changes from the previous iteration,\n // and is different from the current target, dispatch the exit\n // event to the target.\n if (currElem !== prevElem && currElem !== currTarget) {\n Private.dispatchDragExit(this, currTarget, currElem, event);\n }\n // If the indicated element changes from the previous iteration,\n // and is different from the current target, dispatch the enter\n // event and compute the new target element.\n if (currElem !== prevElem && currElem !== currTarget) {\n currTarget = Private.dispatchDragEnter(this, currElem, currTarget, event);\n }\n // If the current target element has changed, update the current\n // target reference and dispatch the leave event to the old target.\n if (currTarget !== prevTarget) {\n this._currentTarget = currTarget;\n Private.dispatchDragLeave(this, prevTarget, currTarget, event);\n }\n // Dispatch the drag over event and update the drop action.\n var action = Private.dispatchDragOver(this, currTarget, event);\n this._setDropAction(action);\n };\n /**\n * Attach the drag image element at the specified location.\n *\n * This is a no-op if there is no drag image element.\n */\n Drag.prototype._attachDragImage = function (clientX, clientY) {\n if (!this.dragImage) {\n return;\n }\n this.dragImage.classList.add('lm-mod-drag-image');\n /* */\n this.dragImage.classList.add('p-mod-drag-image');\n /* */\n var style = this.dragImage.style;\n style.pointerEvents = 'none';\n style.position = 'fixed';\n style.top = clientY + \"px\";\n style.left = clientX + \"px\";\n document.body.appendChild(this.dragImage);\n };\n /**\n * Detach the drag image element from the DOM.\n *\n * This is a no-op if there is no drag image element.\n */\n Drag.prototype._detachDragImage = function () {\n if (!this.dragImage) {\n return;\n }\n var parent = this.dragImage.parentNode;\n if (!parent) {\n return;\n }\n parent.removeChild(this.dragImage);\n };\n /**\n * Set the internal drop action state and update the drag cursor.\n */\n Drag.prototype._setDropAction = function (action) {\n action = Private.validateAction(action, this.supportedActions);\n if (this._override && this._dropAction === action) {\n return;\n }\n switch (action) {\n case 'none':\n this._dropAction = action;\n this._override = Drag.overrideCursor('no-drop');\n break;\n case 'copy':\n this._dropAction = action;\n this._override = Drag.overrideCursor('copy');\n break;\n case 'link':\n this._dropAction = action;\n this._override = Drag.overrideCursor('alias');\n break;\n case 'move':\n this._dropAction = action;\n this._override = Drag.overrideCursor('move');\n break;\n }\n };\n /**\n * Finalize the drag operation and resolve the drag promise.\n */\n Drag.prototype._finalize = function (action) {\n // Store the resolve function as a temp variable.\n var resolve = this._resolve;\n // Remove the document event listeners.\n this._removeListeners();\n // Detach the drag image.\n this._detachDragImage();\n // Dispose of the cursor override.\n if (this._override) {\n this._override.dispose();\n this._override = null;\n }\n // Clear the mime data.\n this.mimeData.clear();\n // Clear the rest of the internal drag state.\n this._disposed = true;\n this._dropAction = 'none';\n this._currentTarget = null;\n this._currentElement = null;\n this._scrollTarget = null;\n this._promise = null;\n this._resolve = null;\n // Finally, resolve the promise to the given drop action.\n if (resolve) {\n resolve(action);\n }\n };\n return Drag;\n}());\n/**\n * The namespace for the `Drag` class statics.\n */\n(function (Drag) {\n /**\n * Override the cursor icon for the entire document.\n *\n * @param cursor - The string representing the cursor style.\n *\n * @returns A disposable which will clear the override when disposed.\n *\n * #### Notes\n * The most recent call to `overrideCursor` takes precedence.\n * Disposing an old override has no effect on the current override.\n *\n * This utility function is used by the `Drag` class to override the\n * mouse cursor during a drag-drop operation, but it can also be used\n * by other classes to fix the cursor icon during normal mouse drags.\n *\n * #### Example\n * ```typescript\n * import { Drag } from '@lumino/dragdrop';\n *\n * // Force the cursor to be 'wait' for the entire document.\n * let override = Drag.overrideCursor('wait');\n *\n * // Clear the override by disposing the return value.\n * override.dispose();\n * ```\n */\n function overrideCursor(cursor) {\n var id = ++overrideCursorID;\n document.body.style.cursor = cursor;\n document.body.classList.add('lm-mod-override-cursor');\n /* */\n document.body.classList.add('p-mod-override-cursor');\n /* */\n return new disposable.DisposableDelegate(function () {\n if (id === overrideCursorID) {\n document.body.style.cursor = '';\n document.body.classList.remove('lm-mod-override-cursor');\n /* */\n document.body.classList.remove('p-mod-override-cursor');\n /* */\n }\n });\n }\n Drag.overrideCursor = overrideCursor;\n /**\n * The internal id for the active cursor override.\n */\n var overrideCursorID = 0;\n})(exports.Drag || (exports.Drag = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The size of a drag scroll edge, in pixels.\n */\n Private.SCROLL_EDGE_SIZE = 20;\n /**\n * Validate the given action is one of the supported actions.\n *\n * Returns the given action or `'none'` if the action is unsupported.\n */\n function validateAction(action, supported) {\n return (actionTable[action] & supportedTable[supported]) ? action : 'none';\n }\n Private.validateAction = validateAction;\n /**\n * Create a left mouse event at the given position.\n *\n * @param type - The event type for the mouse event.\n *\n * @param clientX - The client X position.\n *\n * @param clientY - The client Y position.\n *\n * @returns A newly created and initialized mouse event.\n */\n function createMouseEvent(type, clientX, clientY) {\n var event = document.createEvent('MouseEvent');\n event.initMouseEvent(type, true, true, window, 0, 0, 0, clientX, clientY, false, false, false, false, 0, null);\n return event;\n }\n Private.createMouseEvent = createMouseEvent;\n /**\n * Find the drag scroll target under the mouse, if any.\n */\n function findScrollTarget(event) {\n // Look up the client mouse position.\n var x = event.clientX;\n var y = event.clientY;\n // Get the element under the mouse.\n var element = document.elementFromPoint(x, y);\n // Search for a scrollable target based on the mouse position.\n // The null assert in third clause of for-loop is required due to:\n // https://github.com/Microsoft/TypeScript/issues/14143\n for (; element; element = element.parentElement) {\n // Ignore elements which are not marked as scrollable.\n var scrollable = element.hasAttribute('data-lm-dragscroll');\n /* */\n scrollable = scrollable || element.hasAttribute('data-p-dragscroll');\n /* */\n if (!scrollable) {\n continue;\n }\n // Set up the coordinate offsets for the element.\n var offsetX = 0;\n var offsetY = 0;\n if (element === document.body) {\n offsetX = window.pageXOffset;\n offsetY = window.pageYOffset;\n }\n // Get the element bounds in viewport coordinates.\n var r = element.getBoundingClientRect();\n var top_1 = r.top + offsetY;\n var left = r.left + offsetX;\n var right = left + r.width;\n var bottom = top_1 + r.height;\n // Skip the element if it's not under the mouse.\n if (x < left || x >= right || y < top_1 || y >= bottom) {\n continue;\n }\n // Compute the distance to each edge.\n var dl = x - left + 1;\n var dt = y - top_1 + 1;\n var dr = right - x;\n var db = bottom - y;\n // Find the smallest of the edge distances.\n var distance = Math.min(dl, dt, dr, db);\n // Skip the element if the mouse is not within a scroll edge.\n if (distance > Private.SCROLL_EDGE_SIZE) {\n continue;\n }\n // Set up the edge result variable.\n var edge = void 0;\n // Find the edge for the computed distance.\n switch (distance) {\n case db:\n edge = 'bottom';\n break;\n case dt:\n edge = 'top';\n break;\n case dr:\n edge = 'right';\n break;\n case dl:\n edge = 'left';\n break;\n default:\n throw 'unreachable';\n }\n // Compute how much the element can scroll in width and height.\n var dsw = element.scrollWidth - element.clientWidth;\n var dsh = element.scrollHeight - element.clientHeight;\n // Determine if the element should be scrolled for the edge.\n var shouldScroll = void 0;\n switch (edge) {\n case 'top':\n shouldScroll = dsh > 0 && element.scrollTop > 0;\n break;\n case 'left':\n shouldScroll = dsw > 0 && element.scrollLeft > 0;\n break;\n case 'right':\n shouldScroll = dsw > 0 && element.scrollLeft < dsw;\n break;\n case 'bottom':\n shouldScroll = dsh > 0 && element.scrollTop < dsh;\n break;\n default:\n throw 'unreachable';\n }\n // Skip the element if it should not be scrolled.\n if (!shouldScroll) {\n continue;\n }\n // Return the drag scroll target.\n return { element: element, edge: edge, distance: distance };\n }\n // No drag scroll target was found.\n return null;\n }\n Private.findScrollTarget = findScrollTarget;\n /**\n * Dispatch a drag enter event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param currElem - The currently indicated element, or `null`. This\n * is the \"immediate user selection\" from the whatwg spec.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * @returns The element to use as the current drag target. This is the\n * \"current target element\" from the whatwg spec, and may be `null`.\n *\n * #### Notes\n * This largely implements the drag enter portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragEnter(drag, currElem, currTarget, event) {\n // If the current element is null, return null as the new target.\n if (!currElem) {\n return null;\n }\n // Dispatch a drag enter event to the current element.\n var dragEvent = createDragEvent('lm-dragenter', drag, event, currTarget);\n var canceled = !currElem.dispatchEvent(dragEvent);\n // If the event was canceled, use the current element as the new target.\n if (canceled) {\n return currElem;\n }\n /* */\n dragEvent = createDragEvent('p-dragenter', drag, event, currTarget);\n canceled = !currElem.dispatchEvent(dragEvent);\n if (canceled) {\n return currElem;\n }\n /* */\n // If the current element is the document body, keep the original target.\n if (currElem === document.body) {\n return currTarget;\n }\n // Dispatch a drag enter event on the document body.\n dragEvent = createDragEvent('lm-dragenter', drag, event, currTarget);\n document.body.dispatchEvent(dragEvent);\n /* */\n dragEvent = createDragEvent('p-dragenter', drag, event, currTarget);\n document.body.dispatchEvent(dragEvent);\n /* */\n // Ignore the event cancellation, and use the body as the new target.\n return document.body;\n }\n Private.dispatchDragEnter = dispatchDragEnter;\n /**\n * Dispatch a drag exit event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param prevTarget - The previous target element, or `null`. This\n * is the previous \"current target element\" from the whatwg spec.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * #### Notes\n * This largely implements the drag exit portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragExit(drag, prevTarget, currTarget, event) {\n // If the previous target is null, do nothing.\n if (!prevTarget) {\n return;\n }\n // Dispatch the drag exit event to the previous target.\n var dragEvent = createDragEvent('lm-dragexit', drag, event, currTarget);\n prevTarget.dispatchEvent(dragEvent);\n /* */\n dragEvent = createDragEvent('p-dragexit', drag, event, currTarget);\n prevTarget.dispatchEvent(dragEvent);\n /* */\n }\n Private.dispatchDragExit = dispatchDragExit;\n /**\n * Dispatch a drag leave event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param prevTarget - The previous target element, or `null`. This\n * is the previous \"current target element\" from the whatwg spec.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * #### Notes\n * This largely implements the drag leave portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragLeave(drag, prevTarget, currTarget, event) {\n // If the previous target is null, do nothing.\n if (!prevTarget) {\n return;\n }\n // Dispatch the drag leave event to the previous target.\n var dragEvent = createDragEvent('lm-dragleave', drag, event, currTarget);\n prevTarget.dispatchEvent(dragEvent);\n /* */\n dragEvent = createDragEvent('p-dragleave', drag, event, currTarget);\n prevTarget.dispatchEvent(dragEvent);\n /* */\n }\n Private.dispatchDragLeave = dispatchDragLeave;\n /**\n * Dispatch a drag over event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * @returns The `DropAction` result of the drag over event.\n *\n * #### Notes\n * This largely implements the drag over portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragOver(drag, currTarget, event) {\n // If there is no current target, the drop action is none.\n if (!currTarget) {\n return 'none';\n }\n // Dispatch the drag over event to the current target.\n var dragEvent = createDragEvent('lm-dragover', drag, event, null);\n var canceled = !currTarget.dispatchEvent(dragEvent);\n // If the event was canceled, return the drop action result.\n if (canceled) {\n return dragEvent.dropAction;\n }\n /* */\n dragEvent = createDragEvent('p-dragover', drag, event, null);\n canceled = !currTarget.dispatchEvent(dragEvent);\n if (canceled) {\n return dragEvent.dropAction;\n }\n /* */\n // Otherwise, the effective drop action is none.\n return 'none';\n }\n Private.dispatchDragOver = dispatchDragOver;\n /**\n * Dispatch a drop event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * @returns The `DropAction` result of the drop event.\n *\n * #### Notes\n * This largely implements the drag over portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDrop(drag, currTarget, event) {\n // If there is no current target, the drop action is none.\n if (!currTarget) {\n return 'none';\n }\n // Dispatch the drop event to the current target.\n var dragEvent = createDragEvent('lm-drop', drag, event, null);\n var canceled = !currTarget.dispatchEvent(dragEvent);\n // If the event was canceled, return the drop action result.\n if (canceled) {\n return dragEvent.dropAction;\n }\n /* */\n dragEvent = createDragEvent('p-drop', drag, event, null);\n canceled = !currTarget.dispatchEvent(dragEvent);\n if (canceled) {\n return dragEvent.dropAction;\n }\n /* */\n // Otherwise, the effective drop action is none.\n return 'none';\n }\n Private.dispatchDrop = dispatchDrop;\n /**\n * A lookup table from drop action to bit value.\n */\n var actionTable = {\n 'none': 0x0,\n 'copy': 0x1,\n 'link': 0x2,\n 'move': 0x4\n };\n /**\n * A lookup table from supported action to drop action bit mask.\n */\n var supportedTable = {\n 'none': actionTable['none'],\n 'copy': actionTable['copy'],\n 'link': actionTable['link'],\n 'move': actionTable['move'],\n 'copy-link': actionTable['copy'] | actionTable['link'],\n 'copy-move': actionTable['copy'] | actionTable['move'],\n 'link-move': actionTable['link'] | actionTable['move'],\n 'all': actionTable['copy'] | actionTable['link'] | actionTable['move']\n };\n /**\n * Create a new initialized `IDragEvent` from the given data.\n *\n * @param type - The event type for the drag event.\n *\n * @param drag - The drag object to use for seeding the drag data.\n *\n * @param event - The mouse event to use for seeding the mouse data.\n *\n * @param related - The related target for the event, or `null`.\n *\n * @returns A new object which implements `IDragEvent`.\n */\n function createDragEvent(type, drag, event, related) {\n // Create a new mouse event to use as the drag event. Currently,\n // JS engines do now allow user-defined Event subclasses.\n var dragEvent = document.createEvent('MouseEvent');\n // Initialize the mouse event data.\n dragEvent.initMouseEvent(type, true, true, window, 0, event.screenX, event.screenY, event.clientX, event.clientY, event.ctrlKey, event.altKey, event.shiftKey, event.metaKey, event.button, related);\n // Forcefully add the custom drag event properties.\n dragEvent.dropAction = 'none';\n dragEvent.mimeData = drag.mimeData;\n dragEvent.proposedAction = drag.proposedAction;\n dragEvent.supportedActions = drag.supportedActions;\n dragEvent.source = drag.source;\n // Return the fully initialized drag event.\n return dragEvent;\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/dragdrop/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar disposable = __webpack_require__(/*! @lumino/disposable */ \"../../packages/disposable/dist/index.js\");\n\n/**\n * An object which manages a drag-drop operation.\n *\n * A drag object dispatches four different events to drop targets:\n *\n * - `'lm-dragenter'` - Dispatched when the mouse enters the target\n * element. This event must be canceled in order to receive any\n * of the other events.\n *\n * - `'lm-dragover'` - Dispatched when the mouse moves over the drop\n * target. It must cancel the event and set the `dropAction` to one\n * of the supported actions in order to receive drop events.\n *\n * - `'lm-dragleave'` - Dispatched when the mouse leaves the target\n * element. This includes moving the mouse into child elements.\n *\n * - `'lm-drop'`- Dispatched when the mouse is released over the target\n * element when the target indicates an appropriate drop action. If\n * the event is canceled, the indicated drop action is returned to\n * the initiator through the resolved promise.\n *\n * A drag operation can be terminated at any time by pressing `Escape`\n * or by disposing the drag object.\n *\n * A drag object has the ability to automatically scroll a scrollable\n * element when the mouse is hovered near one of its edges. To enable\n * this, add the `data-lm-dragscroll` attribute to any element which\n * the drag object should consider for scrolling.\n *\n * #### Notes\n * This class is designed to be used when dragging and dropping custom\n * data *within* a single application. It is *not* a replacement for\n * the native drag-drop API. Instead, it provides an API which allows\n * drag operations to be initiated programmatically and enables the\n * transfer of arbitrary non-string objects; features which are not\n * possible with the native drag-drop API.\n */\nexports.Drag = /** @class */ (function () {\n /**\n * Construct a new drag object.\n *\n * @param options - The options for initializing the drag.\n */\n function Drag(options) {\n var _this = this;\n /**\n * The scroll loop handler function.\n */\n this._onScrollFrame = function () {\n // Bail early if there is no scroll target.\n if (!_this._scrollTarget) {\n return;\n }\n // Unpack the scroll target.\n var _a = _this._scrollTarget, element = _a.element, edge = _a.edge, distance = _a.distance;\n // Calculate the scroll delta using nonlinear acceleration.\n var d = Private.SCROLL_EDGE_SIZE - distance;\n var f = Math.pow(d / Private.SCROLL_EDGE_SIZE, 2);\n var s = Math.max(1, Math.round(f * Private.SCROLL_EDGE_SIZE));\n // Scroll the element in the specified direction.\n switch (edge) {\n case 'top':\n element.scrollTop -= s;\n break;\n case 'left':\n element.scrollLeft -= s;\n break;\n case 'right':\n element.scrollLeft += s;\n break;\n case 'bottom':\n element.scrollTop += s;\n break;\n }\n // Request the next cycle of the scroll loop.\n requestAnimationFrame(_this._onScrollFrame);\n };\n this._disposed = false;\n this._dropAction = 'none';\n this._override = null;\n this._currentTarget = null;\n this._currentElement = null;\n this._promise = null;\n this._scrollTarget = null;\n this._resolve = null;\n this.mimeData = options.mimeData;\n this.dragImage = options.dragImage || null;\n this.proposedAction = options.proposedAction || 'copy';\n this.supportedActions = options.supportedActions || 'all';\n this.source = options.source || null;\n }\n /**\n * Dispose of the resources held by the drag object.\n *\n * #### Notes\n * This will cancel the drag operation if it is active.\n */\n Drag.prototype.dispose = function () {\n // Do nothing if the drag object is already disposed.\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n // If there is a current target, dispatch a drag leave event.\n if (this._currentTarget) {\n var event_1 = Private.createMouseEvent('mouseup', -1, -1);\n Private.dispatchDragLeave(this, this._currentTarget, null, event_1);\n }\n // Finalize the drag object with `'none'`.\n this._finalize('none');\n };\n Object.defineProperty(Drag.prototype, \"isDisposed\", {\n /**\n * Test whether the drag object is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Start the drag operation at the specified client position.\n *\n * @param clientX - The client X position for the drag start.\n *\n * @param clientY - The client Y position for the drag start.\n *\n * @returns A promise which resolves to the result of the drag.\n *\n * #### Notes\n * If the drag has already been started, the promise created by the\n * first call to `start` is returned.\n *\n * If the drag operation has ended, or if the drag object has been\n * disposed, the returned promise will resolve to `'none'`.\n *\n * The drag object will be automatically disposed when drag operation\n * completes. This means `Drag` objects are for single-use only.\n *\n * This method assumes the left mouse button is already held down.\n */\n Drag.prototype.start = function (clientX, clientY) {\n var _this = this;\n // If the drag object is already disposed, resolve to `None`.\n if (this._disposed) {\n return Promise.resolve('none');\n }\n // If the drag has already been started, return the promise.\n if (this._promise) {\n return this._promise;\n }\n // Install the document listeners for the drag object.\n this._addListeners();\n // Attach the drag image at the specified client position.\n this._attachDragImage(clientX, clientY);\n // Create the promise which will be resolved on completion.\n this._promise = new Promise(function (resolve, reject) {\n _this._resolve = resolve;\n });\n // Trigger a fake move event to kick off the drag operation.\n var event = Private.createMouseEvent('mousemove', clientX, clientY);\n document.dispatchEvent(event);\n // Return the pending promise for the drag operation.\n return this._promise;\n };\n /**\n * Handle the DOM events for the drag operation.\n *\n * @param event - The DOM event sent to the drag object.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the document. It should not be\n * called directly by user code.\n */\n Drag.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n default:\n // Stop all other events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * Move the drag image element to the specified location.\n *\n * This is a no-op if there is no drag image element.\n */\n Drag.prototype.moveDragImage = function (clientX, clientY) {\n if (!this.dragImage) {\n return;\n }\n var style = this.dragImage.style;\n style.top = clientY + \"px\";\n style.left = clientX + \"px\";\n };\n /**\n * Handle the `'mousemove'` event for the drag object.\n */\n Drag.prototype._evtMouseMove = function (event) {\n // Stop all input events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n // Update the current target node and dispatch enter/leave events.\n this._updateCurrentTarget(event);\n // Update the drag scroll element.\n this._updateDragScroll(event);\n // Move the drag image to the specified client position. This is\n // performed *after* dispatching to prevent unnecessary reflows.\n this.moveDragImage(event.clientX, event.clientY);\n };\n /**\n * Handle the `'mouseup'` event for the drag object.\n */\n Drag.prototype._evtMouseUp = function (event) {\n // Stop all input events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n // Do nothing if the left button is not released.\n if (event.button !== 0) {\n return;\n }\n // Update the current target node and dispatch enter/leave events.\n // This prevents a subtle issue where the DOM mutates under the\n // cursor after the last move event but before the drop event.\n this._updateCurrentTarget(event);\n // If there is no current target, finalize with `'none'`.\n if (!this._currentTarget) {\n this._finalize('none');\n return;\n }\n // If the last drop action was `'none'`, dispatch a leave event\n // to the current target and finalize the drag with `'none'`.\n if (this._dropAction === 'none') {\n Private.dispatchDragLeave(this, this._currentTarget, null, event);\n this._finalize('none');\n return;\n }\n // Dispatch the drop event at the current target and finalize\n // with the resulting drop action.\n var action = Private.dispatchDrop(this, this._currentTarget, event);\n this._finalize(action);\n };\n /**\n * Handle the `'keydown'` event for the drag object.\n */\n Drag.prototype._evtKeyDown = function (event) {\n // Stop all input events during drag-drop.\n event.preventDefault();\n event.stopPropagation();\n // Cancel the drag if `Escape` is pressed.\n if (event.keyCode === 27) {\n this.dispose();\n }\n };\n /**\n * Add the document event listeners for the drag object.\n */\n Drag.prototype._addListeners = function () {\n document.addEventListener('mousedown', this, true);\n document.addEventListener('mousemove', this, true);\n document.addEventListener('mouseup', this, true);\n document.addEventListener('mouseenter', this, true);\n document.addEventListener('mouseleave', this, true);\n document.addEventListener('mouseover', this, true);\n document.addEventListener('mouseout', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('keyup', this, true);\n document.addEventListener('keypress', this, true);\n document.addEventListener('contextmenu', this, true);\n };\n /**\n * Remove the document event listeners for the drag object.\n */\n Drag.prototype._removeListeners = function () {\n document.removeEventListener('mousedown', this, true);\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('mouseenter', this, true);\n document.removeEventListener('mouseleave', this, true);\n document.removeEventListener('mouseover', this, true);\n document.removeEventListener('mouseout', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('keyup', this, true);\n document.removeEventListener('keypress', this, true);\n document.removeEventListener('contextmenu', this, true);\n };\n /**\n * Update the drag scroll element under the mouse.\n */\n Drag.prototype._updateDragScroll = function (event) {\n // Find the scroll target under the mouse.\n var target = Private.findScrollTarget(event);\n // Bail if there is nothing to scroll.\n if (!this._scrollTarget && !target) {\n return;\n }\n // Start the scroll loop if needed.\n if (!this._scrollTarget) {\n setTimeout(this._onScrollFrame, 500);\n }\n // Update the scroll target.\n this._scrollTarget = target;\n };\n /**\n * Update the current target node using the given mouse event.\n */\n Drag.prototype._updateCurrentTarget = function (event) {\n // Fetch common local state.\n var prevTarget = this._currentTarget;\n var currTarget = this._currentTarget;\n var prevElem = this._currentElement;\n // Find the current indicated element at the given position.\n var currElem = document.elementFromPoint(event.clientX, event.clientY);\n // Update the current element reference.\n this._currentElement = currElem;\n // If the indicated element changes from the previous iteration,\n // and is different from the current target, dispatch the exit\n // event to the target.\n if (currElem !== prevElem && currElem !== currTarget) {\n Private.dispatchDragExit(this, currTarget, currElem, event);\n }\n // If the indicated element changes from the previous iteration,\n // and is different from the current target, dispatch the enter\n // event and compute the new target element.\n if (currElem !== prevElem && currElem !== currTarget) {\n currTarget = Private.dispatchDragEnter(this, currElem, currTarget, event);\n }\n // If the current target element has changed, update the current\n // target reference and dispatch the leave event to the old target.\n if (currTarget !== prevTarget) {\n this._currentTarget = currTarget;\n Private.dispatchDragLeave(this, prevTarget, currTarget, event);\n }\n // Dispatch the drag over event and update the drop action.\n var action = Private.dispatchDragOver(this, currTarget, event);\n this._setDropAction(action);\n };\n /**\n * Attach the drag image element at the specified location.\n *\n * This is a no-op if there is no drag image element.\n */\n Drag.prototype._attachDragImage = function (clientX, clientY) {\n if (!this.dragImage) {\n return;\n }\n this.dragImage.classList.add('lm-mod-drag-image');\n /* */\n this.dragImage.classList.add('p-mod-drag-image');\n /* */\n var style = this.dragImage.style;\n style.pointerEvents = 'none';\n style.position = 'fixed';\n style.top = clientY + \"px\";\n style.left = clientX + \"px\";\n document.body.appendChild(this.dragImage);\n };\n /**\n * Detach the drag image element from the DOM.\n *\n * This is a no-op if there is no drag image element.\n */\n Drag.prototype._detachDragImage = function () {\n if (!this.dragImage) {\n return;\n }\n var parent = this.dragImage.parentNode;\n if (!parent) {\n return;\n }\n parent.removeChild(this.dragImage);\n };\n /**\n * Set the internal drop action state and update the drag cursor.\n */\n Drag.prototype._setDropAction = function (action) {\n action = Private.validateAction(action, this.supportedActions);\n if (this._override && this._dropAction === action) {\n return;\n }\n switch (action) {\n case 'none':\n this._dropAction = action;\n this._override = Drag.overrideCursor('no-drop');\n break;\n case 'copy':\n this._dropAction = action;\n this._override = Drag.overrideCursor('copy');\n break;\n case 'link':\n this._dropAction = action;\n this._override = Drag.overrideCursor('alias');\n break;\n case 'move':\n this._dropAction = action;\n this._override = Drag.overrideCursor('move');\n break;\n }\n };\n /**\n * Finalize the drag operation and resolve the drag promise.\n */\n Drag.prototype._finalize = function (action) {\n // Store the resolve function as a temp variable.\n var resolve = this._resolve;\n // Remove the document event listeners.\n this._removeListeners();\n // Detach the drag image.\n this._detachDragImage();\n // Dispose of the cursor override.\n if (this._override) {\n this._override.dispose();\n this._override = null;\n }\n // Clear the mime data.\n this.mimeData.clear();\n // Clear the rest of the internal drag state.\n this._disposed = true;\n this._dropAction = 'none';\n this._currentTarget = null;\n this._currentElement = null;\n this._scrollTarget = null;\n this._promise = null;\n this._resolve = null;\n // Finally, resolve the promise to the given drop action.\n if (resolve) {\n resolve(action);\n }\n };\n return Drag;\n}());\n/**\n * The namespace for the `Drag` class statics.\n */\n(function (Drag) {\n /**\n * Override the cursor icon for the entire document.\n *\n * @param cursor - The string representing the cursor style.\n *\n * @returns A disposable which will clear the override when disposed.\n *\n * #### Notes\n * The most recent call to `overrideCursor` takes precedence.\n * Disposing an old override has no effect on the current override.\n *\n * This utility function is used by the `Drag` class to override the\n * mouse cursor during a drag-drop operation, but it can also be used\n * by other classes to fix the cursor icon during normal mouse drags.\n *\n * #### Example\n * ```typescript\n * import { Drag } from '@lumino/dragdrop';\n *\n * // Force the cursor to be 'wait' for the entire document.\n * let override = Drag.overrideCursor('wait');\n *\n * // Clear the override by disposing the return value.\n * override.dispose();\n * ```\n */\n function overrideCursor(cursor) {\n var id = ++overrideCursorID;\n document.body.style.cursor = cursor;\n document.body.classList.add('lm-mod-override-cursor');\n /* */\n document.body.classList.add('p-mod-override-cursor');\n /* */\n return new disposable.DisposableDelegate(function () {\n if (id === overrideCursorID) {\n document.body.style.cursor = '';\n document.body.classList.remove('lm-mod-override-cursor');\n /* */\n document.body.classList.remove('p-mod-override-cursor');\n /* */\n }\n });\n }\n Drag.overrideCursor = overrideCursor;\n /**\n * The internal id for the active cursor override.\n */\n var overrideCursorID = 0;\n})(exports.Drag || (exports.Drag = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The size of a drag scroll edge, in pixels.\n */\n Private.SCROLL_EDGE_SIZE = 20;\n /**\n * Validate the given action is one of the supported actions.\n *\n * Returns the given action or `'none'` if the action is unsupported.\n */\n function validateAction(action, supported) {\n return (actionTable[action] & supportedTable[supported]) ? action : 'none';\n }\n Private.validateAction = validateAction;\n /**\n * Create a left mouse event at the given position.\n *\n * @param type - The event type for the mouse event.\n *\n * @param clientX - The client X position.\n *\n * @param clientY - The client Y position.\n *\n * @returns A newly created and initialized mouse event.\n */\n function createMouseEvent(type, clientX, clientY) {\n var event = document.createEvent('MouseEvent');\n event.initMouseEvent(type, true, true, window, 0, 0, 0, clientX, clientY, false, false, false, false, 0, null);\n return event;\n }\n Private.createMouseEvent = createMouseEvent;\n /**\n * Find the drag scroll target under the mouse, if any.\n */\n function findScrollTarget(event) {\n // Look up the client mouse position.\n var x = event.clientX;\n var y = event.clientY;\n // Get the element under the mouse.\n var element = document.elementFromPoint(x, y);\n // Search for a scrollable target based on the mouse position.\n // The null assert in third clause of for-loop is required due to:\n // https://github.com/Microsoft/TypeScript/issues/14143\n for (; element; element = element.parentElement) {\n // Ignore elements which are not marked as scrollable.\n var scrollable = element.hasAttribute('data-lm-dragscroll');\n /* */\n scrollable = scrollable || element.hasAttribute('data-p-dragscroll');\n /* */\n if (!scrollable) {\n continue;\n }\n // Set up the coordinate offsets for the element.\n var offsetX = 0;\n var offsetY = 0;\n if (element === document.body) {\n offsetX = window.pageXOffset;\n offsetY = window.pageYOffset;\n }\n // Get the element bounds in viewport coordinates.\n var r = element.getBoundingClientRect();\n var top_1 = r.top + offsetY;\n var left = r.left + offsetX;\n var right = left + r.width;\n var bottom = top_1 + r.height;\n // Skip the element if it's not under the mouse.\n if (x < left || x >= right || y < top_1 || y >= bottom) {\n continue;\n }\n // Compute the distance to each edge.\n var dl = x - left + 1;\n var dt = y - top_1 + 1;\n var dr = right - x;\n var db = bottom - y;\n // Find the smallest of the edge distances.\n var distance = Math.min(dl, dt, dr, db);\n // Skip the element if the mouse is not within a scroll edge.\n if (distance > Private.SCROLL_EDGE_SIZE) {\n continue;\n }\n // Set up the edge result variable.\n var edge = void 0;\n // Find the edge for the computed distance.\n switch (distance) {\n case db:\n edge = 'bottom';\n break;\n case dt:\n edge = 'top';\n break;\n case dr:\n edge = 'right';\n break;\n case dl:\n edge = 'left';\n break;\n default:\n throw 'unreachable';\n }\n // Compute how much the element can scroll in width and height.\n var dsw = element.scrollWidth - element.clientWidth;\n var dsh = element.scrollHeight - element.clientHeight;\n // Determine if the element should be scrolled for the edge.\n var shouldScroll = void 0;\n switch (edge) {\n case 'top':\n shouldScroll = dsh > 0 && element.scrollTop > 0;\n break;\n case 'left':\n shouldScroll = dsw > 0 && element.scrollLeft > 0;\n break;\n case 'right':\n shouldScroll = dsw > 0 && element.scrollLeft < dsw;\n break;\n case 'bottom':\n shouldScroll = dsh > 0 && element.scrollTop < dsh;\n break;\n default:\n throw 'unreachable';\n }\n // Skip the element if it should not be scrolled.\n if (!shouldScroll) {\n continue;\n }\n // Return the drag scroll target.\n return { element: element, edge: edge, distance: distance };\n }\n // No drag scroll target was found.\n return null;\n }\n Private.findScrollTarget = findScrollTarget;\n /**\n * Dispatch a drag enter event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param currElem - The currently indicated element, or `null`. This\n * is the \"immediate user selection\" from the whatwg spec.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * @returns The element to use as the current drag target. This is the\n * \"current target element\" from the whatwg spec, and may be `null`.\n *\n * #### Notes\n * This largely implements the drag enter portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragEnter(drag, currElem, currTarget, event) {\n // If the current element is null, return null as the new target.\n if (!currElem) {\n return null;\n }\n // Dispatch a drag enter event to the current element.\n var dragEvent = createDragEvent('lm-dragenter', drag, event, currTarget);\n var canceled = !currElem.dispatchEvent(dragEvent);\n // If the event was canceled, use the current element as the new target.\n if (canceled) {\n return currElem;\n }\n /* */\n dragEvent = createDragEvent('p-dragenter', drag, event, currTarget);\n canceled = !currElem.dispatchEvent(dragEvent);\n if (canceled) {\n return currElem;\n }\n /* */\n // If the current element is the document body, keep the original target.\n if (currElem === document.body) {\n return currTarget;\n }\n // Dispatch a drag enter event on the document body.\n dragEvent = createDragEvent('lm-dragenter', drag, event, currTarget);\n document.body.dispatchEvent(dragEvent);\n /* */\n dragEvent = createDragEvent('p-dragenter', drag, event, currTarget);\n document.body.dispatchEvent(dragEvent);\n /* */\n // Ignore the event cancellation, and use the body as the new target.\n return document.body;\n }\n Private.dispatchDragEnter = dispatchDragEnter;\n /**\n * Dispatch a drag exit event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param prevTarget - The previous target element, or `null`. This\n * is the previous \"current target element\" from the whatwg spec.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * #### Notes\n * This largely implements the drag exit portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragExit(drag, prevTarget, currTarget, event) {\n // If the previous target is null, do nothing.\n if (!prevTarget) {\n return;\n }\n // Dispatch the drag exit event to the previous target.\n var dragEvent = createDragEvent('lm-dragexit', drag, event, currTarget);\n prevTarget.dispatchEvent(dragEvent);\n /* */\n dragEvent = createDragEvent('p-dragexit', drag, event, currTarget);\n prevTarget.dispatchEvent(dragEvent);\n /* */\n }\n Private.dispatchDragExit = dispatchDragExit;\n /**\n * Dispatch a drag leave event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param prevTarget - The previous target element, or `null`. This\n * is the previous \"current target element\" from the whatwg spec.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * #### Notes\n * This largely implements the drag leave portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragLeave(drag, prevTarget, currTarget, event) {\n // If the previous target is null, do nothing.\n if (!prevTarget) {\n return;\n }\n // Dispatch the drag leave event to the previous target.\n var dragEvent = createDragEvent('lm-dragleave', drag, event, currTarget);\n prevTarget.dispatchEvent(dragEvent);\n /* */\n dragEvent = createDragEvent('p-dragleave', drag, event, currTarget);\n prevTarget.dispatchEvent(dragEvent);\n /* */\n }\n Private.dispatchDragLeave = dispatchDragLeave;\n /**\n * Dispatch a drag over event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * @returns The `DropAction` result of the drag over event.\n *\n * #### Notes\n * This largely implements the drag over portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDragOver(drag, currTarget, event) {\n // If there is no current target, the drop action is none.\n if (!currTarget) {\n return 'none';\n }\n // Dispatch the drag over event to the current target.\n var dragEvent = createDragEvent('lm-dragover', drag, event, null);\n var canceled = !currTarget.dispatchEvent(dragEvent);\n // If the event was canceled, return the drop action result.\n if (canceled) {\n return dragEvent.dropAction;\n }\n /* */\n dragEvent = createDragEvent('p-dragover', drag, event, null);\n canceled = !currTarget.dispatchEvent(dragEvent);\n if (canceled) {\n return dragEvent.dropAction;\n }\n /* */\n // Otherwise, the effective drop action is none.\n return 'none';\n }\n Private.dispatchDragOver = dispatchDragOver;\n /**\n * Dispatch a drop event to the indicated element.\n *\n * @param drag - The drag object associated with the action.\n *\n * @param currTarget - The current drag target element, or `null`. This\n * is the \"current target element\" from the whatwg spec.\n *\n * @param event - The mouse event related to the action.\n *\n * @returns The `DropAction` result of the drop event.\n *\n * #### Notes\n * This largely implements the drag over portion of the whatwg spec:\n * https://html.spec.whatwg.org/multipage/interaction.html#drag-and-drop-processing-model\n */\n function dispatchDrop(drag, currTarget, event) {\n // If there is no current target, the drop action is none.\n if (!currTarget) {\n return 'none';\n }\n // Dispatch the drop event to the current target.\n var dragEvent = createDragEvent('lm-drop', drag, event, null);\n var canceled = !currTarget.dispatchEvent(dragEvent);\n // If the event was canceled, return the drop action result.\n if (canceled) {\n return dragEvent.dropAction;\n }\n /* */\n dragEvent = createDragEvent('p-drop', drag, event, null);\n canceled = !currTarget.dispatchEvent(dragEvent);\n if (canceled) {\n return dragEvent.dropAction;\n }\n /* */\n // Otherwise, the effective drop action is none.\n return 'none';\n }\n Private.dispatchDrop = dispatchDrop;\n /**\n * A lookup table from drop action to bit value.\n */\n var actionTable = {\n 'none': 0x0,\n 'copy': 0x1,\n 'link': 0x2,\n 'move': 0x4\n };\n /**\n * A lookup table from supported action to drop action bit mask.\n */\n var supportedTable = {\n 'none': actionTable['none'],\n 'copy': actionTable['copy'],\n 'link': actionTable['link'],\n 'move': actionTable['move'],\n 'copy-link': actionTable['copy'] | actionTable['link'],\n 'copy-move': actionTable['copy'] | actionTable['move'],\n 'link-move': actionTable['link'] | actionTable['move'],\n 'all': actionTable['copy'] | actionTable['link'] | actionTable['move']\n };\n /**\n * Create a new initialized `IDragEvent` from the given data.\n *\n * @param type - The event type for the drag event.\n *\n * @param drag - The drag object to use for seeding the drag data.\n *\n * @param event - The mouse event to use for seeding the mouse data.\n *\n * @param related - The related target for the event, or `null`.\n *\n * @returns A new object which implements `IDragEvent`.\n */\n function createDragEvent(type, drag, event, related) {\n // Create a new mouse event to use as the drag event. Currently,\n // JS engines do now allow user-defined Event subclasses.\n var dragEvent = document.createEvent('MouseEvent');\n // Initialize the mouse event data.\n dragEvent.initMouseEvent(type, true, true, window, 0, event.screenX, event.screenY, event.clientX, event.clientY, event.ctrlKey, event.altKey, event.shiftKey, event.metaKey, event.button, related);\n // Forcefully add the custom drag event properties.\n dragEvent.dropAction = 'none';\n dragEvent.mimeData = drag.mimeData;\n dragEvent.proposedAction = drag.proposedAction;\n dragEvent.supportedActions = drag.supportedActions;\n dragEvent.source = drag.source;\n // Return the fully initialized drag event.\n return dragEvent;\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/dragdrop/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/keyboard/dist/index.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/keyboard/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/keyboard/dist/index.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Get the global application keyboard layout instance.\n *\n * @returns The keyboard layout for use by the application.\n *\n * #### Notes\n * The default keyboard layout is US-English.\n */\nfunction getKeyboardLayout() {\n return Private.keyboardLayout;\n}\n/**\n * Set the global application keyboard layout instance.\n *\n * @param - The keyboard layout for use by the application.\n *\n * #### Notes\n * The keyboard layout should typically be set on application startup\n * to a layout which is appropriate for the user's system.\n */\nfunction setKeyboardLayout(layout) {\n Private.keyboardLayout = layout;\n}\n/**\n * A concrete implementation of [[IKeyboardLayout]] based on keycodes.\n *\n * The `keyCode` property of a `'keydown'` event is a browser and OS\n * specific representation of the physical key (not character) which\n * was pressed on a keyboard. While not the most convenient API, it\n * is currently the only one which works reliably on all browsers.\n *\n * This class accepts a user-defined mapping of keycode to key, which\n * allows for reliable shortcuts tailored to the user's system.\n */\nexports.KeycodeLayout = /** @class */ (function () {\n /**\n * Construct a new keycode layout.\n *\n * @param name - The human readable name for the layout.\n *\n * @param codes - A mapping of keycode to key value.\n */\n function KeycodeLayout(name, codes) {\n this.name = name;\n this._codes = codes;\n this._keys = KeycodeLayout.extractKeys(codes);\n }\n /**\n * Get an array of the key values supported by the layout.\n *\n * @returns A new array of the supported key values.\n */\n KeycodeLayout.prototype.keys = function () {\n return Object.keys(this._keys);\n };\n /**\n * Test whether the given key is a valid value for the layout.\n *\n * @param key - The user provided key to test for validity.\n *\n * @returns `true` if the key is valid, `false` otherwise.\n */\n KeycodeLayout.prototype.isValidKey = function (key) {\n return key in this._keys;\n };\n /**\n * Get the key for a `'keydown'` event.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * @returns The associated key value, or an empty string if\n * the event does not represent a valid primary key.\n */\n KeycodeLayout.prototype.keyForKeydownEvent = function (event) {\n return this._codes[event.keyCode] || '';\n };\n return KeycodeLayout;\n}());\n/**\n * The namespace for the `KeycodeLayout` class statics.\n */\n(function (KeycodeLayout) {\n /**\n * Extract the set of keys from a code map.\n *\n * @param code - The code map of interest.\n *\n * @returns A set of the keys in the code map.\n */\n function extractKeys(codes) {\n var keys = Object.create(null);\n for (var c in codes) {\n keys[codes[c]] = true;\n }\n return keys;\n }\n KeycodeLayout.extractKeys = extractKeys;\n})(exports.KeycodeLayout || (exports.KeycodeLayout = {}));\n/**\n * A keycode-based keyboard layout for US English keyboards.\n *\n * This layout is valid for the following OS/Browser combinations.\n *\n * - Windows\n * - Chrome\n * - Firefox\n * - IE\n *\n * - OSX\n * - Chrome\n * - Firefox\n * - Safari\n *\n * - Linux\n * - Chrome\n * - Firefox\n *\n * Other combinations may also work, but are untested.\n */\nvar EN_US = new exports.KeycodeLayout('en-us', {\n 8: 'Backspace',\n 9: 'Tab',\n 13: 'Enter',\n 19: 'Pause',\n 27: 'Escape',\n 32: 'Space',\n 33: 'PageUp',\n 34: 'PageDown',\n 35: 'End',\n 36: 'Home',\n 37: 'ArrowLeft',\n 38: 'ArrowUp',\n 39: 'ArrowRight',\n 40: 'ArrowDown',\n 45: 'Insert',\n 46: 'Delete',\n 48: '0',\n 49: '1',\n 50: '2',\n 51: '3',\n 52: '4',\n 53: '5',\n 54: '6',\n 55: '7',\n 56: '8',\n 57: '9',\n 59: ';',\n 61: '=',\n 65: 'A',\n 66: 'B',\n 67: 'C',\n 68: 'D',\n 69: 'E',\n 70: 'F',\n 71: 'G',\n 72: 'H',\n 73: 'I',\n 74: 'J',\n 75: 'K',\n 76: 'L',\n 77: 'M',\n 78: 'N',\n 79: 'O',\n 80: 'P',\n 81: 'Q',\n 82: 'R',\n 83: 'S',\n 84: 'T',\n 85: 'U',\n 86: 'V',\n 87: 'W',\n 88: 'X',\n 89: 'Y',\n 90: 'Z',\n 93: 'ContextMenu',\n 96: '0',\n 97: '1',\n 98: '2',\n 99: '3',\n 100: '4',\n 101: '5',\n 102: '6',\n 103: '7',\n 104: '8',\n 105: '9',\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111: '/',\n 112: 'F1',\n 113: 'F2',\n 114: 'F3',\n 115: 'F4',\n 116: 'F5',\n 117: 'F6',\n 118: 'F7',\n 119: 'F8',\n 120: 'F9',\n 121: 'F10',\n 122: 'F11',\n 123: 'F12',\n 173: '-',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n});\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The global keyboard layout instance.\n */\n Private.keyboardLayout = EN_US;\n})(Private || (Private = {}));\n\nexports.EN_US = EN_US;\nexports.getKeyboardLayout = getKeyboardLayout;\nexports.setKeyboardLayout = setKeyboardLayout;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/keyboard/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * Get the global application keyboard layout instance.\n *\n * @returns The keyboard layout for use by the application.\n *\n * #### Notes\n * The default keyboard layout is US-English.\n */\nfunction getKeyboardLayout() {\n return Private.keyboardLayout;\n}\n/**\n * Set the global application keyboard layout instance.\n *\n * @param - The keyboard layout for use by the application.\n *\n * #### Notes\n * The keyboard layout should typically be set on application startup\n * to a layout which is appropriate for the user's system.\n */\nfunction setKeyboardLayout(layout) {\n Private.keyboardLayout = layout;\n}\n/**\n * A concrete implementation of [[IKeyboardLayout]] based on keycodes.\n *\n * The `keyCode` property of a `'keydown'` event is a browser and OS\n * specific representation of the physical key (not character) which\n * was pressed on a keyboard. While not the most convenient API, it\n * is currently the only one which works reliably on all browsers.\n *\n * This class accepts a user-defined mapping of keycode to key, which\n * allows for reliable shortcuts tailored to the user's system.\n */\nexports.KeycodeLayout = /** @class */ (function () {\n /**\n * Construct a new keycode layout.\n *\n * @param name - The human readable name for the layout.\n *\n * @param codes - A mapping of keycode to key value.\n */\n function KeycodeLayout(name, codes) {\n this.name = name;\n this._codes = codes;\n this._keys = KeycodeLayout.extractKeys(codes);\n }\n /**\n * Get an array of the key values supported by the layout.\n *\n * @returns A new array of the supported key values.\n */\n KeycodeLayout.prototype.keys = function () {\n return Object.keys(this._keys);\n };\n /**\n * Test whether the given key is a valid value for the layout.\n *\n * @param key - The user provided key to test for validity.\n *\n * @returns `true` if the key is valid, `false` otherwise.\n */\n KeycodeLayout.prototype.isValidKey = function (key) {\n return key in this._keys;\n };\n /**\n * Get the key for a `'keydown'` event.\n *\n * @param event - The event object for a `'keydown'` event.\n *\n * @returns The associated key value, or an empty string if\n * the event does not represent a valid primary key.\n */\n KeycodeLayout.prototype.keyForKeydownEvent = function (event) {\n return this._codes[event.keyCode] || '';\n };\n return KeycodeLayout;\n}());\n/**\n * The namespace for the `KeycodeLayout` class statics.\n */\n(function (KeycodeLayout) {\n /**\n * Extract the set of keys from a code map.\n *\n * @param code - The code map of interest.\n *\n * @returns A set of the keys in the code map.\n */\n function extractKeys(codes) {\n var keys = Object.create(null);\n for (var c in codes) {\n keys[codes[c]] = true;\n }\n return keys;\n }\n KeycodeLayout.extractKeys = extractKeys;\n})(exports.KeycodeLayout || (exports.KeycodeLayout = {}));\n/**\n * A keycode-based keyboard layout for US English keyboards.\n *\n * This layout is valid for the following OS/Browser combinations.\n *\n * - Windows\n * - Chrome\n * - Firefox\n * - IE\n *\n * - OSX\n * - Chrome\n * - Firefox\n * - Safari\n *\n * - Linux\n * - Chrome\n * - Firefox\n *\n * Other combinations may also work, but are untested.\n */\nvar EN_US = new exports.KeycodeLayout('en-us', {\n 8: 'Backspace',\n 9: 'Tab',\n 13: 'Enter',\n 19: 'Pause',\n 27: 'Escape',\n 32: 'Space',\n 33: 'PageUp',\n 34: 'PageDown',\n 35: 'End',\n 36: 'Home',\n 37: 'ArrowLeft',\n 38: 'ArrowUp',\n 39: 'ArrowRight',\n 40: 'ArrowDown',\n 45: 'Insert',\n 46: 'Delete',\n 48: '0',\n 49: '1',\n 50: '2',\n 51: '3',\n 52: '4',\n 53: '5',\n 54: '6',\n 55: '7',\n 56: '8',\n 57: '9',\n 59: ';',\n 61: '=',\n 65: 'A',\n 66: 'B',\n 67: 'C',\n 68: 'D',\n 69: 'E',\n 70: 'F',\n 71: 'G',\n 72: 'H',\n 73: 'I',\n 74: 'J',\n 75: 'K',\n 76: 'L',\n 77: 'M',\n 78: 'N',\n 79: 'O',\n 80: 'P',\n 81: 'Q',\n 82: 'R',\n 83: 'S',\n 84: 'T',\n 85: 'U',\n 86: 'V',\n 87: 'W',\n 88: 'X',\n 89: 'Y',\n 90: 'Z',\n 93: 'ContextMenu',\n 96: '0',\n 97: '1',\n 98: '2',\n 99: '3',\n 100: '4',\n 101: '5',\n 102: '6',\n 103: '7',\n 104: '8',\n 105: '9',\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111: '/',\n 112: 'F1',\n 113: 'F2',\n 114: 'F3',\n 115: 'F4',\n 116: 'F5',\n 117: 'F6',\n 118: 'F7',\n 119: 'F8',\n 120: 'F9',\n 121: 'F10',\n 122: 'F11',\n 123: 'F12',\n 173: '-',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n});\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The global keyboard layout instance.\n */\n Private.keyboardLayout = EN_US;\n})(Private || (Private = {}));\n\nexports.EN_US = EN_US;\nexports.getKeyboardLayout = getKeyboardLayout;\nexports.setKeyboardLayout = setKeyboardLayout;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/keyboard/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/messaging/dist/index.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/messaging/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/messaging/dist/index.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("/* WEBPACK VAR INJECTION */(function(setImmediate, clearImmediate) {\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar collections = __webpack_require__(/*! @lumino/collections */ \"../../packages/collections/dist/index.js\");\n\n/**\n * A message which can be delivered to a message handler.\n *\n * #### Notes\n * This class may be subclassed to create complex message types.\n */\nvar Message = /** @class */ (function () {\n /**\n * Construct a new message.\n *\n * @param type - The type of the message.\n */\n function Message(type) {\n this.type = type;\n }\n Object.defineProperty(Message.prototype, \"isConflatable\", {\n /**\n * Test whether the message is conflatable.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most message types will\n * not make use of this feature.\n *\n * If a conflatable message is posted to a handler while another\n * conflatable message of the same `type` has already been posted\n * to the handler, the `conflate()` method of the existing message\n * will be invoked. If that method returns `true`, the new message\n * will not be enqueued. This allows messages to be compressed, so\n * that only a single instance of the message type is processed per\n * cycle, no matter how many times messages of that type are posted.\n *\n * Custom message types may reimplement this property.\n *\n * The default implementation is always `false`.\n */\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another message of the same `type`.\n *\n * @param other - A conflatable message of the same `type`.\n *\n * @returns `true` if the message was successfully conflated, or\n * `false` otherwise.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most message types will\n * not make use of this feature.\n *\n * This method is called automatically by the message loop when the\n * given message is posted to the handler paired with this message.\n * This message will already be enqueued and conflatable, and the\n * given message will have the same `type` and also be conflatable.\n *\n * This method should merge the state of the other message into this\n * message as needed so that when this message is finally delivered\n * to the handler, it receives the most up-to-date information.\n *\n * If this method returns `true`, it signals that the other message\n * was successfully conflated and that message will not be enqueued.\n *\n * If this method returns `false`, the other message will be enqueued\n * for normal delivery.\n *\n * Custom message types may reimplement this method.\n *\n * The default implementation always returns `false`.\n */\n Message.prototype.conflate = function (other) {\n return false;\n };\n return Message;\n}());\n/**\n * A convenience message class which conflates automatically.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most user code will not\n * make use of this class.\n *\n * This message class is useful for creating message instances which\n * should be conflated, but which have no state other than `type`.\n *\n * If conflation of stateful messages is required, a custom `Message`\n * subclass should be created.\n */\nvar ConflatableMessage = /** @class */ (function (_super) {\n tslib.__extends(ConflatableMessage, _super);\n function ConflatableMessage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(ConflatableMessage.prototype, \"isConflatable\", {\n /**\n * Test whether the message is conflatable.\n *\n * #### Notes\n * This property is always `true`.\n */\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another message of the same `type`.\n *\n * #### Notes\n * This method always returns `true`.\n */\n ConflatableMessage.prototype.conflate = function (other) {\n return true;\n };\n return ConflatableMessage;\n}(Message));\n(function (MessageLoop) {\n /**\n * Send a message to a message handler to process immediately.\n *\n * @param handler - The handler which should process the message.\n *\n * @param msg - The message to deliver to the handler.\n *\n * #### Notes\n * The message will first be sent through any installed message hooks\n * for the handler. If the message passes all hooks, it will then be\n * delivered to the `processMessage` method of the handler.\n *\n * The message will not be conflated with pending posted messages.\n *\n * Exceptions in hooks and handlers will be caught and logged.\n */\n function sendMessage(handler, msg) {\n // Lookup the message hooks for the handler.\n var hooks = messageHooks.get(handler);\n // Handle the common case of no installed hooks.\n if (!hooks || hooks.length === 0) {\n invokeHandler(handler, msg);\n return;\n }\n // Invoke the message hooks starting with the newest first.\n var passed = algorithm.every(algorithm.retro(hooks), function (hook) {\n return hook ? invokeHook(hook, handler, msg) : true;\n });\n // Invoke the handler if the message passes all hooks.\n if (passed) {\n invokeHandler(handler, msg);\n }\n }\n MessageLoop.sendMessage = sendMessage;\n /**\n * Post a message to a message handler to process in the future.\n *\n * @param handler - The handler which should process the message.\n *\n * @param msg - The message to post to the handler.\n *\n * #### Notes\n * The message will be conflated with the pending posted messages for\n * the handler, if possible. If the message is not conflated, it will\n * be queued for normal delivery on the next cycle of the event loop.\n *\n * Exceptions in hooks and handlers will be caught and logged.\n */\n function postMessage(handler, msg) {\n // Handle the common case of a non-conflatable message.\n if (!msg.isConflatable) {\n enqueueMessage(handler, msg);\n return;\n }\n // Conflate the message with an existing message if possible.\n var conflated = algorithm.some(messageQueue, function (posted) {\n if (posted.handler !== handler) {\n return false;\n }\n if (!posted.msg) {\n return false;\n }\n if (posted.msg.type !== msg.type) {\n return false;\n }\n if (!posted.msg.isConflatable) {\n return false;\n }\n return posted.msg.conflate(msg);\n });\n // Enqueue the message if it was not conflated.\n if (!conflated) {\n enqueueMessage(handler, msg);\n }\n }\n MessageLoop.postMessage = postMessage;\n /**\n * Install a message hook for a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * @param hook - The message hook to install.\n *\n * #### Notes\n * A message hook is invoked before a message is delivered to the\n * handler. If the hook returns `false`, no other hooks will be\n * invoked and the message will not be delivered to the handler.\n *\n * The most recently installed message hook is executed first.\n *\n * If the hook is already installed, this is a no-op.\n */\n function installMessageHook(handler, hook) {\n // Lookup the hooks for the handler.\n var hooks = messageHooks.get(handler);\n // Bail early if the hook is already installed.\n if (hooks && hooks.indexOf(hook) !== -1) {\n return;\n }\n // Add the hook to the end, so it will be the first to execute.\n if (!hooks) {\n messageHooks.set(handler, [hook]);\n }\n else {\n hooks.push(hook);\n }\n }\n MessageLoop.installMessageHook = installMessageHook;\n /**\n * Remove an installed message hook for a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * @param hook - The message hook to remove.\n *\n * #### Notes\n * It is safe to call this function while the hook is executing.\n *\n * If the hook is not installed, this is a no-op.\n */\n function removeMessageHook(handler, hook) {\n // Lookup the hooks for the handler.\n var hooks = messageHooks.get(handler);\n // Bail early if the hooks do not exist.\n if (!hooks) {\n return;\n }\n // Lookup the index of the hook and bail if not found.\n var i = hooks.indexOf(hook);\n if (i === -1) {\n return;\n }\n // Clear the hook and schedule a cleanup of the array.\n hooks[i] = null;\n scheduleCleanup(hooks);\n }\n MessageLoop.removeMessageHook = removeMessageHook;\n /**\n * Clear all message data associated with a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * #### Notes\n * This will clear all posted messages and hooks for the handler.\n */\n function clearData(handler) {\n // Lookup the hooks for the handler.\n var hooks = messageHooks.get(handler);\n // Clear all messsage hooks for the handler.\n if (hooks && hooks.length > 0) {\n algorithm.ArrayExt.fill(hooks, null);\n scheduleCleanup(hooks);\n }\n // Clear all posted messages for the handler.\n algorithm.each(messageQueue, function (posted) {\n if (posted.handler === handler) {\n posted.handler = null;\n posted.msg = null;\n }\n });\n }\n MessageLoop.clearData = clearData;\n /**\n * Process the pending posted messages in the queue immediately.\n *\n * #### Notes\n * This function is useful when posted messages must be processed\n * immediately, instead of on the next animation frame.\n *\n * This function should normally not be needed, but it may be\n * required to work around certain browser idiosyncrasies.\n *\n * Recursing into this function is a no-op.\n */\n function flush() {\n // Bail if recursion is detected or if there is no pending task.\n if (flushGuard || loopTaskID === 0) {\n return;\n }\n // Unschedule the pending loop task.\n unschedule(loopTaskID);\n // Run the message loop within the recursion guard.\n flushGuard = true;\n runMessageLoop();\n flushGuard = false;\n }\n MessageLoop.flush = flush;\n /**\n * Get the message loop exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n function getExceptionHandler() {\n return exceptionHandler;\n }\n MessageLoop.getExceptionHandler = getExceptionHandler;\n /**\n * Set the message loop exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a message handler or a\n * message hook throws an exception.\n */\n function setExceptionHandler(handler) {\n var old = exceptionHandler;\n exceptionHandler = handler;\n return old;\n }\n MessageLoop.setExceptionHandler = setExceptionHandler;\n /**\n * The queue of posted message pairs.\n */\n var messageQueue = new collections.LinkedList();\n /**\n * A mapping of handler to array of installed message hooks.\n */\n var messageHooks = new WeakMap();\n /**\n * A set of message hook arrays which are pending cleanup.\n */\n var dirtySet = new Set();\n /**\n * The message loop exception handler.\n */\n var exceptionHandler = function (err) {\n console.error(err);\n };\n /**\n * The id of the pending loop task animation frame.\n */\n var loopTaskID = 0;\n /**\n * A guard flag to prevent flush recursion.\n */\n var flushGuard = false;\n /**\n * A function to schedule an event loop callback.\n */\n var schedule = (function () {\n var ok = typeof requestAnimationFrame === 'function';\n return ok ? requestAnimationFrame : setImmediate;\n })();\n /**\n * A function to unschedule an event loop callback.\n */\n var unschedule = (function () {\n var ok = typeof cancelAnimationFrame === 'function';\n return ok ? cancelAnimationFrame : clearImmediate;\n })();\n /**\n * Invoke a message hook with the specified handler and message.\n *\n * Returns the result of the hook, or `true` if the hook throws.\n *\n * Exceptions in the hook will be caught and logged.\n */\n function invokeHook(hook, handler, msg) {\n var result = true;\n try {\n if (typeof hook === 'function') {\n result = hook(handler, msg);\n }\n else {\n result = hook.messageHook(handler, msg);\n }\n }\n catch (err) {\n exceptionHandler(err);\n }\n return result;\n }\n /**\n * Invoke a message handler with the specified message.\n *\n * Exceptions in the handler will be caught and logged.\n */\n function invokeHandler(handler, msg) {\n try {\n handler.processMessage(msg);\n }\n catch (err) {\n exceptionHandler(err);\n }\n }\n /**\n * Add a message to the end of the message queue.\n *\n * This will automatically schedule a run of the message loop.\n */\n function enqueueMessage(handler, msg) {\n // Add the posted message to the queue.\n messageQueue.addLast({ handler: handler, msg: msg });\n // Bail if a loop task is already pending.\n if (loopTaskID !== 0) {\n return;\n }\n // Schedule a run of the message loop.\n loopTaskID = schedule(runMessageLoop);\n }\n /**\n * Run an iteration of the message loop.\n *\n * This will process all pending messages in the queue. If a message\n * is added to the queue while the message loop is running, it will\n * be processed on the next cycle of the loop.\n */\n function runMessageLoop() {\n // Clear the task ID so the next loop can be scheduled.\n loopTaskID = 0;\n // If the message queue is empty, there is nothing else to do.\n if (messageQueue.isEmpty) {\n return;\n }\n // Add a sentinel value to the end of the queue. The queue will\n // only be processed up to the sentinel. Messages posted during\n // this cycle will execute on the next cycle.\n var sentinel = { handler: null, msg: null };\n messageQueue.addLast(sentinel);\n // Enter the message loop.\n while (true) {\n // Remove the first posted message in the queue.\n var posted = messageQueue.removeFirst();\n // If the value is the sentinel, exit the loop.\n if (posted === sentinel) {\n return;\n }\n // Dispatch the message if it has not been cleared.\n if (posted.handler && posted.msg) {\n sendMessage(posted.handler, posted.msg);\n }\n }\n }\n /**\n * Schedule a cleanup of a message hooks array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any `null` hook will\n * be removed from the array.\n */\n function scheduleCleanup(hooks) {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(hooks);\n }\n /**\n * Cleanup the message hook arrays in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet() {\n dirtySet.forEach(cleanupHooks);\n dirtySet.clear();\n }\n /**\n * Cleanup the dirty hooks in a message hooks array.\n *\n * This will remove any `null` hook from the array.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupHooks(hooks) {\n algorithm.ArrayExt.removeAllWhere(hooks, isNull);\n }\n /**\n * Test whether a value is `null`.\n */\n function isNull(value) {\n return value === null;\n }\n})(exports.MessageLoop || (exports.MessageLoop = {}));\n\nexports.ConflatableMessage = ConflatableMessage;\nexports.Message = Message;\n//# sourceMappingURL=index.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../usr/share/nodejs/timers-browserify/main.js */ \"../../../../../usr/share/nodejs/timers-browserify/main.js\").setImmediate, __webpack_require__(/*! ./../../../../../../usr/share/nodejs/timers-browserify/main.js */ \"../../../../../usr/share/nodejs/timers-browserify/main.js\").clearImmediate))\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/messaging/dist/index.js?"); │ │ │ │ + eval("/* WEBPACK VAR INJECTION */(function(setImmediate, clearImmediate) {\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar collections = __webpack_require__(/*! @lumino/collections */ \"../../packages/collections/dist/index.js\");\n\n/**\n * A message which can be delivered to a message handler.\n *\n * #### Notes\n * This class may be subclassed to create complex message types.\n */\nvar Message = /** @class */ (function () {\n /**\n * Construct a new message.\n *\n * @param type - The type of the message.\n */\n function Message(type) {\n this.type = type;\n }\n Object.defineProperty(Message.prototype, \"isConflatable\", {\n /**\n * Test whether the message is conflatable.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most message types will\n * not make use of this feature.\n *\n * If a conflatable message is posted to a handler while another\n * conflatable message of the same `type` has already been posted\n * to the handler, the `conflate()` method of the existing message\n * will be invoked. If that method returns `true`, the new message\n * will not be enqueued. This allows messages to be compressed, so\n * that only a single instance of the message type is processed per\n * cycle, no matter how many times messages of that type are posted.\n *\n * Custom message types may reimplement this property.\n *\n * The default implementation is always `false`.\n */\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another message of the same `type`.\n *\n * @param other - A conflatable message of the same `type`.\n *\n * @returns `true` if the message was successfully conflated, or\n * `false` otherwise.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most message types will\n * not make use of this feature.\n *\n * This method is called automatically by the message loop when the\n * given message is posted to the handler paired with this message.\n * This message will already be enqueued and conflatable, and the\n * given message will have the same `type` and also be conflatable.\n *\n * This method should merge the state of the other message into this\n * message as needed so that when this message is finally delivered\n * to the handler, it receives the most up-to-date information.\n *\n * If this method returns `true`, it signals that the other message\n * was successfully conflated and that message will not be enqueued.\n *\n * If this method returns `false`, the other message will be enqueued\n * for normal delivery.\n *\n * Custom message types may reimplement this method.\n *\n * The default implementation always returns `false`.\n */\n Message.prototype.conflate = function (other) {\n return false;\n };\n return Message;\n}());\n/**\n * A convenience message class which conflates automatically.\n *\n * #### Notes\n * Message conflation is an advanced topic. Most user code will not\n * make use of this class.\n *\n * This message class is useful for creating message instances which\n * should be conflated, but which have no state other than `type`.\n *\n * If conflation of stateful messages is required, a custom `Message`\n * subclass should be created.\n */\nvar ConflatableMessage = /** @class */ (function (_super) {\n tslib.__extends(ConflatableMessage, _super);\n function ConflatableMessage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(ConflatableMessage.prototype, \"isConflatable\", {\n /**\n * Test whether the message is conflatable.\n *\n * #### Notes\n * This property is always `true`.\n */\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Conflate this message with another message of the same `type`.\n *\n * #### Notes\n * This method always returns `true`.\n */\n ConflatableMessage.prototype.conflate = function (other) {\n return true;\n };\n return ConflatableMessage;\n}(Message));\n(function (MessageLoop) {\n /**\n * Send a message to a message handler to process immediately.\n *\n * @param handler - The handler which should process the message.\n *\n * @param msg - The message to deliver to the handler.\n *\n * #### Notes\n * The message will first be sent through any installed message hooks\n * for the handler. If the message passes all hooks, it will then be\n * delivered to the `processMessage` method of the handler.\n *\n * The message will not be conflated with pending posted messages.\n *\n * Exceptions in hooks and handlers will be caught and logged.\n */\n function sendMessage(handler, msg) {\n // Lookup the message hooks for the handler.\n var hooks = messageHooks.get(handler);\n // Handle the common case of no installed hooks.\n if (!hooks || hooks.length === 0) {\n invokeHandler(handler, msg);\n return;\n }\n // Invoke the message hooks starting with the newest first.\n var passed = algorithm.every(algorithm.retro(hooks), function (hook) {\n return hook ? invokeHook(hook, handler, msg) : true;\n });\n // Invoke the handler if the message passes all hooks.\n if (passed) {\n invokeHandler(handler, msg);\n }\n }\n MessageLoop.sendMessage = sendMessage;\n /**\n * Post a message to a message handler to process in the future.\n *\n * @param handler - The handler which should process the message.\n *\n * @param msg - The message to post to the handler.\n *\n * #### Notes\n * The message will be conflated with the pending posted messages for\n * the handler, if possible. If the message is not conflated, it will\n * be queued for normal delivery on the next cycle of the event loop.\n *\n * Exceptions in hooks and handlers will be caught and logged.\n */\n function postMessage(handler, msg) {\n // Handle the common case of a non-conflatable message.\n if (!msg.isConflatable) {\n enqueueMessage(handler, msg);\n return;\n }\n // Conflate the message with an existing message if possible.\n var conflated = algorithm.some(messageQueue, function (posted) {\n if (posted.handler !== handler) {\n return false;\n }\n if (!posted.msg) {\n return false;\n }\n if (posted.msg.type !== msg.type) {\n return false;\n }\n if (!posted.msg.isConflatable) {\n return false;\n }\n return posted.msg.conflate(msg);\n });\n // Enqueue the message if it was not conflated.\n if (!conflated) {\n enqueueMessage(handler, msg);\n }\n }\n MessageLoop.postMessage = postMessage;\n /**\n * Install a message hook for a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * @param hook - The message hook to install.\n *\n * #### Notes\n * A message hook is invoked before a message is delivered to the\n * handler. If the hook returns `false`, no other hooks will be\n * invoked and the message will not be delivered to the handler.\n *\n * The most recently installed message hook is executed first.\n *\n * If the hook is already installed, this is a no-op.\n */\n function installMessageHook(handler, hook) {\n // Lookup the hooks for the handler.\n var hooks = messageHooks.get(handler);\n // Bail early if the hook is already installed.\n if (hooks && hooks.indexOf(hook) !== -1) {\n return;\n }\n // Add the hook to the end, so it will be the first to execute.\n if (!hooks) {\n messageHooks.set(handler, [hook]);\n }\n else {\n hooks.push(hook);\n }\n }\n MessageLoop.installMessageHook = installMessageHook;\n /**\n * Remove an installed message hook for a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * @param hook - The message hook to remove.\n *\n * #### Notes\n * It is safe to call this function while the hook is executing.\n *\n * If the hook is not installed, this is a no-op.\n */\n function removeMessageHook(handler, hook) {\n // Lookup the hooks for the handler.\n var hooks = messageHooks.get(handler);\n // Bail early if the hooks do not exist.\n if (!hooks) {\n return;\n }\n // Lookup the index of the hook and bail if not found.\n var i = hooks.indexOf(hook);\n if (i === -1) {\n return;\n }\n // Clear the hook and schedule a cleanup of the array.\n hooks[i] = null;\n scheduleCleanup(hooks);\n }\n MessageLoop.removeMessageHook = removeMessageHook;\n /**\n * Clear all message data associated with a message handler.\n *\n * @param handler - The message handler of interest.\n *\n * #### Notes\n * This will clear all posted messages and hooks for the handler.\n */\n function clearData(handler) {\n // Lookup the hooks for the handler.\n var hooks = messageHooks.get(handler);\n // Clear all messsage hooks for the handler.\n if (hooks && hooks.length > 0) {\n algorithm.ArrayExt.fill(hooks, null);\n scheduleCleanup(hooks);\n }\n // Clear all posted messages for the handler.\n algorithm.each(messageQueue, function (posted) {\n if (posted.handler === handler) {\n posted.handler = null;\n posted.msg = null;\n }\n });\n }\n MessageLoop.clearData = clearData;\n /**\n * Process the pending posted messages in the queue immediately.\n *\n * #### Notes\n * This function is useful when posted messages must be processed\n * immediately, instead of on the next animation frame.\n *\n * This function should normally not be needed, but it may be\n * required to work around certain browser idiosyncrasies.\n *\n * Recursing into this function is a no-op.\n */\n function flush() {\n // Bail if recursion is detected or if there is no pending task.\n if (flushGuard || loopTaskID === 0) {\n return;\n }\n // Unschedule the pending loop task.\n unschedule(loopTaskID);\n // Run the message loop within the recursion guard.\n flushGuard = true;\n runMessageLoop();\n flushGuard = false;\n }\n MessageLoop.flush = flush;\n /**\n * Get the message loop exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n function getExceptionHandler() {\n return exceptionHandler;\n }\n MessageLoop.getExceptionHandler = getExceptionHandler;\n /**\n * Set the message loop exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a message handler or a\n * message hook throws an exception.\n */\n function setExceptionHandler(handler) {\n var old = exceptionHandler;\n exceptionHandler = handler;\n return old;\n }\n MessageLoop.setExceptionHandler = setExceptionHandler;\n /**\n * The queue of posted message pairs.\n */\n var messageQueue = new collections.LinkedList();\n /**\n * A mapping of handler to array of installed message hooks.\n */\n var messageHooks = new WeakMap();\n /**\n * A set of message hook arrays which are pending cleanup.\n */\n var dirtySet = new Set();\n /**\n * The message loop exception handler.\n */\n var exceptionHandler = function (err) {\n console.error(err);\n };\n /**\n * The id of the pending loop task animation frame.\n */\n var loopTaskID = 0;\n /**\n * A guard flag to prevent flush recursion.\n */\n var flushGuard = false;\n /**\n * A function to schedule an event loop callback.\n */\n var schedule = (function () {\n var ok = typeof requestAnimationFrame === 'function';\n return ok ? requestAnimationFrame : setImmediate;\n })();\n /**\n * A function to unschedule an event loop callback.\n */\n var unschedule = (function () {\n var ok = typeof cancelAnimationFrame === 'function';\n return ok ? cancelAnimationFrame : clearImmediate;\n })();\n /**\n * Invoke a message hook with the specified handler and message.\n *\n * Returns the result of the hook, or `true` if the hook throws.\n *\n * Exceptions in the hook will be caught and logged.\n */\n function invokeHook(hook, handler, msg) {\n var result = true;\n try {\n if (typeof hook === 'function') {\n result = hook(handler, msg);\n }\n else {\n result = hook.messageHook(handler, msg);\n }\n }\n catch (err) {\n exceptionHandler(err);\n }\n return result;\n }\n /**\n * Invoke a message handler with the specified message.\n *\n * Exceptions in the handler will be caught and logged.\n */\n function invokeHandler(handler, msg) {\n try {\n handler.processMessage(msg);\n }\n catch (err) {\n exceptionHandler(err);\n }\n }\n /**\n * Add a message to the end of the message queue.\n *\n * This will automatically schedule a run of the message loop.\n */\n function enqueueMessage(handler, msg) {\n // Add the posted message to the queue.\n messageQueue.addLast({ handler: handler, msg: msg });\n // Bail if a loop task is already pending.\n if (loopTaskID !== 0) {\n return;\n }\n // Schedule a run of the message loop.\n loopTaskID = schedule(runMessageLoop);\n }\n /**\n * Run an iteration of the message loop.\n *\n * This will process all pending messages in the queue. If a message\n * is added to the queue while the message loop is running, it will\n * be processed on the next cycle of the loop.\n */\n function runMessageLoop() {\n // Clear the task ID so the next loop can be scheduled.\n loopTaskID = 0;\n // If the message queue is empty, there is nothing else to do.\n if (messageQueue.isEmpty) {\n return;\n }\n // Add a sentinel value to the end of the queue. The queue will\n // only be processed up to the sentinel. Messages posted during\n // this cycle will execute on the next cycle.\n var sentinel = { handler: null, msg: null };\n messageQueue.addLast(sentinel);\n // Enter the message loop.\n while (true) {\n // Remove the first posted message in the queue.\n var posted = messageQueue.removeFirst();\n // If the value is the sentinel, exit the loop.\n if (posted === sentinel) {\n return;\n }\n // Dispatch the message if it has not been cleared.\n if (posted.handler && posted.msg) {\n sendMessage(posted.handler, posted.msg);\n }\n }\n }\n /**\n * Schedule a cleanup of a message hooks array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any `null` hook will\n * be removed from the array.\n */\n function scheduleCleanup(hooks) {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(hooks);\n }\n /**\n * Cleanup the message hook arrays in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet() {\n dirtySet.forEach(cleanupHooks);\n dirtySet.clear();\n }\n /**\n * Cleanup the dirty hooks in a message hooks array.\n *\n * This will remove any `null` hook from the array.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupHooks(hooks) {\n algorithm.ArrayExt.removeAllWhere(hooks, isNull);\n }\n /**\n * Test whether a value is `null`.\n */\n function isNull(value) {\n return value === null;\n }\n})(exports.MessageLoop || (exports.MessageLoop = {}));\n\nexports.ConflatableMessage = ConflatableMessage;\nexports.Message = Message;\n//# sourceMappingURL=index.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../usr/share/nodejs/timers-browserify/main.js */ \"../../../../../usr/share/nodejs/timers-browserify/main.js\").setImmediate, __webpack_require__(/*! ./../../../../../../usr/share/nodejs/timers-browserify/main.js */ \"../../../../../usr/share/nodejs/timers-browserify/main.js\").clearImmediate))\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/messaging/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/properties/dist/index.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/properties/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/properties/dist/index.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A class which attaches a value to an external object.\n *\n * #### Notes\n * Attached properties are used to extend the state of an object with\n * semantic data from an unrelated class. They also encapsulate value\n * creation, coercion, and notification.\n *\n * Because attached property values are stored in a hash table, which\n * in turn is stored in a WeakMap keyed on the owner object, there is\n * non-trivial storage overhead involved in their use. The pattern is\n * therefore best used for the storage of rare data.\n */\nexports.AttachedProperty = /** @class */ (function () {\n /**\n * Construct a new attached property.\n *\n * @param options - The options for initializing the property.\n */\n function AttachedProperty(options) {\n this._pid = Private.nextPID();\n this.name = options.name;\n this._create = options.create;\n this._coerce = options.coerce || null;\n this._compare = options.compare || null;\n this._changed = options.changed || null;\n }\n /**\n * Get the current value of the property for a given owner.\n *\n * @param owner - The property owner of interest.\n *\n * @returns The current value of the property.\n *\n * #### Notes\n * If the value has not yet been set, the default value will be\n * computed and assigned as the current value of the property.\n */\n AttachedProperty.prototype.get = function (owner) {\n var value;\n var map = Private.ensureMap(owner);\n if (this._pid in map) {\n value = map[this._pid];\n }\n else {\n value = map[this._pid] = this._createValue(owner);\n }\n return value;\n };\n /**\n * Set the current value of the property for a given owner.\n *\n * @param owner - The property owner of interest.\n *\n * @param value - The value for the property.\n *\n * #### Notes\n * If the value has not yet been set, the default value will be\n * computed and used as the previous value for the comparison.\n */\n AttachedProperty.prototype.set = function (owner, value) {\n var oldValue;\n var map = Private.ensureMap(owner);\n if (this._pid in map) {\n oldValue = map[this._pid];\n }\n else {\n oldValue = map[this._pid] = this._createValue(owner);\n }\n var newValue = this._coerceValue(owner, value);\n this._maybeNotify(owner, oldValue, map[this._pid] = newValue);\n };\n /**\n * Explicitly coerce the current property value for a given owner.\n *\n * @param owner - The property owner of interest.\n *\n * #### Notes\n * If the value has not yet been set, the default value will be\n * computed and used as the previous value for the comparison.\n */\n AttachedProperty.prototype.coerce = function (owner) {\n var oldValue;\n var map = Private.ensureMap(owner);\n if (this._pid in map) {\n oldValue = map[this._pid];\n }\n else {\n oldValue = map[this._pid] = this._createValue(owner);\n }\n var newValue = this._coerceValue(owner, oldValue);\n this._maybeNotify(owner, oldValue, map[this._pid] = newValue);\n };\n /**\n * Get or create the default value for the given owner.\n */\n AttachedProperty.prototype._createValue = function (owner) {\n var create = this._create;\n return create(owner);\n };\n /**\n * Coerce the value for the given owner.\n */\n AttachedProperty.prototype._coerceValue = function (owner, value) {\n var coerce = this._coerce;\n return coerce ? coerce(owner, value) : value;\n };\n /**\n * Compare the old value and new value for equality.\n */\n AttachedProperty.prototype._compareValue = function (oldValue, newValue) {\n var compare = this._compare;\n return compare ? compare(oldValue, newValue) : oldValue === newValue;\n };\n /**\n * Run the change notification if the given values are different.\n */\n AttachedProperty.prototype._maybeNotify = function (owner, oldValue, newValue) {\n var changed = this._changed;\n if (changed && !this._compareValue(oldValue, newValue)) {\n changed(owner, oldValue, newValue);\n }\n };\n return AttachedProperty;\n}());\n/**\n * The namespace for the `AttachedProperty` class statics.\n */\n(function (AttachedProperty) {\n /**\n * Clear the stored property data for the given owner.\n *\n * @param owner - The property owner of interest.\n *\n * #### Notes\n * This will clear all property values for the owner, but it will\n * **not** run the change notification for any of the properties.\n */\n function clearData(owner) {\n Private.ownerData.delete(owner);\n }\n AttachedProperty.clearData = clearData;\n})(exports.AttachedProperty || (exports.AttachedProperty = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A weak mapping of property owner to property map.\n */\n Private.ownerData = new WeakMap();\n /**\n * A function which computes successive unique property ids.\n */\n Private.nextPID = (function () {\n var id = 0;\n return function () {\n var rand = Math.random();\n var stem = (\"\" + rand).slice(2);\n return \"pid-\" + stem + \"-\" + id++;\n };\n })();\n /**\n * Lookup the data map for the property owner.\n *\n * This will create the map if one does not already exist.\n */\n function ensureMap(owner) {\n var map = Private.ownerData.get(owner);\n if (map) {\n return map;\n }\n map = Object.create(null);\n Private.ownerData.set(owner, map);\n return map;\n }\n Private.ensureMap = ensureMap;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/properties/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A class which attaches a value to an external object.\n *\n * #### Notes\n * Attached properties are used to extend the state of an object with\n * semantic data from an unrelated class. They also encapsulate value\n * creation, coercion, and notification.\n *\n * Because attached property values are stored in a hash table, which\n * in turn is stored in a WeakMap keyed on the owner object, there is\n * non-trivial storage overhead involved in their use. The pattern is\n * therefore best used for the storage of rare data.\n */\nexports.AttachedProperty = /** @class */ (function () {\n /**\n * Construct a new attached property.\n *\n * @param options - The options for initializing the property.\n */\n function AttachedProperty(options) {\n this._pid = Private.nextPID();\n this.name = options.name;\n this._create = options.create;\n this._coerce = options.coerce || null;\n this._compare = options.compare || null;\n this._changed = options.changed || null;\n }\n /**\n * Get the current value of the property for a given owner.\n *\n * @param owner - The property owner of interest.\n *\n * @returns The current value of the property.\n *\n * #### Notes\n * If the value has not yet been set, the default value will be\n * computed and assigned as the current value of the property.\n */\n AttachedProperty.prototype.get = function (owner) {\n var value;\n var map = Private.ensureMap(owner);\n if (this._pid in map) {\n value = map[this._pid];\n }\n else {\n value = map[this._pid] = this._createValue(owner);\n }\n return value;\n };\n /**\n * Set the current value of the property for a given owner.\n *\n * @param owner - The property owner of interest.\n *\n * @param value - The value for the property.\n *\n * #### Notes\n * If the value has not yet been set, the default value will be\n * computed and used as the previous value for the comparison.\n */\n AttachedProperty.prototype.set = function (owner, value) {\n var oldValue;\n var map = Private.ensureMap(owner);\n if (this._pid in map) {\n oldValue = map[this._pid];\n }\n else {\n oldValue = map[this._pid] = this._createValue(owner);\n }\n var newValue = this._coerceValue(owner, value);\n this._maybeNotify(owner, oldValue, map[this._pid] = newValue);\n };\n /**\n * Explicitly coerce the current property value for a given owner.\n *\n * @param owner - The property owner of interest.\n *\n * #### Notes\n * If the value has not yet been set, the default value will be\n * computed and used as the previous value for the comparison.\n */\n AttachedProperty.prototype.coerce = function (owner) {\n var oldValue;\n var map = Private.ensureMap(owner);\n if (this._pid in map) {\n oldValue = map[this._pid];\n }\n else {\n oldValue = map[this._pid] = this._createValue(owner);\n }\n var newValue = this._coerceValue(owner, oldValue);\n this._maybeNotify(owner, oldValue, map[this._pid] = newValue);\n };\n /**\n * Get or create the default value for the given owner.\n */\n AttachedProperty.prototype._createValue = function (owner) {\n var create = this._create;\n return create(owner);\n };\n /**\n * Coerce the value for the given owner.\n */\n AttachedProperty.prototype._coerceValue = function (owner, value) {\n var coerce = this._coerce;\n return coerce ? coerce(owner, value) : value;\n };\n /**\n * Compare the old value and new value for equality.\n */\n AttachedProperty.prototype._compareValue = function (oldValue, newValue) {\n var compare = this._compare;\n return compare ? compare(oldValue, newValue) : oldValue === newValue;\n };\n /**\n * Run the change notification if the given values are different.\n */\n AttachedProperty.prototype._maybeNotify = function (owner, oldValue, newValue) {\n var changed = this._changed;\n if (changed && !this._compareValue(oldValue, newValue)) {\n changed(owner, oldValue, newValue);\n }\n };\n return AttachedProperty;\n}());\n/**\n * The namespace for the `AttachedProperty` class statics.\n */\n(function (AttachedProperty) {\n /**\n * Clear the stored property data for the given owner.\n *\n * @param owner - The property owner of interest.\n *\n * #### Notes\n * This will clear all property values for the owner, but it will\n * **not** run the change notification for any of the properties.\n */\n function clearData(owner) {\n Private.ownerData.delete(owner);\n }\n AttachedProperty.clearData = clearData;\n})(exports.AttachedProperty || (exports.AttachedProperty = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A weak mapping of property owner to property map.\n */\n Private.ownerData = new WeakMap();\n /**\n * A function which computes successive unique property ids.\n */\n Private.nextPID = (function () {\n var id = 0;\n return function () {\n var rand = Math.random();\n var stem = (\"\" + rand).slice(2);\n return \"pid-\" + stem + \"-\" + id++;\n };\n })();\n /**\n * Lookup the data map for the property owner.\n *\n * This will create the map if one does not already exist.\n */\n function ensureMap(owner) {\n var map = Private.ownerData.get(owner);\n if (map) {\n return map;\n }\n map = Object.create(null);\n Private.ownerData.set(owner, map);\n return map;\n }\n Private.ensureMap = ensureMap;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/properties/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/signaling/dist/index.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/signaling/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/signaling/dist/index.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A concrete implementation of `ISignal`.\n *\n * #### Example\n * ```typescript\n * import { ISignal, Signal } from '@lumino/signaling';\n *\n * class SomeClass {\n *\n * constructor(name: string) {\n * this.name = name;\n * }\n *\n * readonly name: string;\n *\n * get valueChanged: ISignal {\n * return this._valueChanged;\n * }\n *\n * get value(): number {\n * return this._value;\n * }\n *\n * set value(value: number) {\n * if (value === this._value) {\n * return;\n * }\n * this._value = value;\n * this._valueChanged.emit(value);\n * }\n *\n * private _value = 0;\n * private _valueChanged = new Signal(this);\n * }\n *\n * function logger(sender: SomeClass, value: number): void {\n * console.log(sender.name, value);\n * }\n *\n * let m1 = new SomeClass('foo');\n * let m2 = new SomeClass('bar');\n *\n * m1.valueChanged.connect(logger);\n * m2.valueChanged.connect(logger);\n *\n * m1.value = 42; // logs: foo 42\n * m2.value = 17; // logs: bar 17\n * ```\n */\nexports.Signal = /** @class */ (function () {\n /**\n * Construct a new signal.\n *\n * @param sender - The sender which owns the signal.\n */\n function Signal(sender) {\n this.sender = sender;\n }\n /**\n * Connect a slot to the signal.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n Signal.prototype.connect = function (slot, thisArg) {\n return Private.connect(this, slot, thisArg);\n };\n /**\n * Disconnect a slot from the signal.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n Signal.prototype.disconnect = function (slot, thisArg) {\n return Private.disconnect(this, slot, thisArg);\n };\n /**\n * Emit the signal and invoke the connected slots.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n Signal.prototype.emit = function (args) {\n Private.emit(this, args);\n };\n return Signal;\n}());\n/**\n * The namespace for the `Signal` class statics.\n */\n(function (Signal) {\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n function disconnectBetween(sender, receiver) {\n Private.disconnectBetween(sender, receiver);\n }\n Signal.disconnectBetween = disconnectBetween;\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n function disconnectSender(sender) {\n Private.disconnectSender(sender);\n }\n Signal.disconnectSender = disconnectSender;\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n function disconnectReceiver(receiver) {\n Private.disconnectReceiver(receiver);\n }\n Signal.disconnectReceiver = disconnectReceiver;\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n function disconnectAll(object) {\n Private.disconnectAll(object);\n }\n Signal.disconnectAll = disconnectAll;\n /**\n * Clear all signal data associated with the given object.\n *\n * @param object - The object for which the data should be cleared.\n *\n * #### Notes\n * This removes all signal connections and any other signal data\n * associated with the object.\n */\n function clearData(object) {\n Private.disconnectAll(object);\n }\n Signal.clearData = clearData;\n /**\n * Get the signal exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n function getExceptionHandler() {\n return Private.exceptionHandler;\n }\n Signal.getExceptionHandler = getExceptionHandler;\n /**\n * Set the signal exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a slot throws an exception.\n */\n function setExceptionHandler(handler) {\n var old = Private.exceptionHandler;\n Private.exceptionHandler = handler;\n return old;\n }\n Signal.setExceptionHandler = setExceptionHandler;\n})(exports.Signal || (exports.Signal = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The signal exception handler function.\n */\n Private.exceptionHandler = function (err) {\n console.error(err);\n };\n /**\n * Connect a slot to a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n function connect(signal, slot, thisArg) {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n // Ensure the sender's array of receivers is created.\n var receivers = receiversForSender.get(signal.sender);\n if (!receivers) {\n receivers = [];\n receiversForSender.set(signal.sender, receivers);\n }\n // Bail if a matching connection already exists.\n if (findConnection(receivers, signal, slot, thisArg)) {\n return false;\n }\n // Choose the best object for the receiver.\n var receiver = thisArg || slot;\n // Ensure the receiver's array of senders is created.\n var senders = sendersForReceiver.get(receiver);\n if (!senders) {\n senders = [];\n sendersForReceiver.set(receiver, senders);\n }\n // Create a new connection and add it to the end of each array.\n var connection = { signal: signal, slot: slot, thisArg: thisArg };\n receivers.push(connection);\n senders.push(connection);\n // Indicate a successful connection.\n return true;\n }\n Private.connect = connect;\n /**\n * Disconnect a slot from a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n function disconnect(signal, slot, thisArg) {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n // Lookup the list of receivers, and bail if none exist.\n var receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return false;\n }\n // Bail if no matching connection exits.\n var connection = findConnection(receivers, signal, slot, thisArg);\n if (!connection) {\n return false;\n }\n // Choose the best object for the receiver.\n var receiver = thisArg || slot;\n // Lookup the array of senders, which is now known to exist.\n var senders = sendersForReceiver.get(receiver);\n // Clear the connection and schedule cleanup of the arrays.\n connection.signal = null;\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n // Indicate a successful disconnection.\n return true;\n }\n Private.disconnect = disconnect;\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n */\n function disconnectBetween(sender, receiver) {\n // If there are no receivers, there is nothing to do.\n var receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n // If there are no senders, there is nothing to do.\n var senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n // Clear each connection between the sender and receiver.\n algorithm.each(senders, function (connection) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n return;\n }\n // Clear the connection if it matches the sender.\n if (connection.signal.sender === sender) {\n connection.signal = null;\n }\n });\n // Schedule a cleanup of the senders and receivers.\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n }\n Private.disconnectBetween = disconnectBetween;\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n function disconnectSender(sender) {\n // If there are no receivers, there is nothing to do.\n var receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n // Clear each receiver connection.\n algorithm.each(receivers, function (connection) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n return;\n }\n // Choose the best object for the receiver.\n var receiver = connection.thisArg || connection.slot;\n // Clear the connection.\n connection.signal = null;\n // Cleanup the array of senders, which is now known to exist.\n scheduleCleanup(sendersForReceiver.get(receiver));\n });\n // Schedule a cleanup of the receivers.\n scheduleCleanup(receivers);\n }\n Private.disconnectSender = disconnectSender;\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n */\n function disconnectReceiver(receiver) {\n // If there are no senders, there is nothing to do.\n var senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n // Clear each sender connection.\n algorithm.each(senders, function (connection) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n return;\n }\n // Lookup the sender for the connection.\n var sender = connection.signal.sender;\n // Clear the connection.\n connection.signal = null;\n // Cleanup the array of receivers, which is now known to exist.\n scheduleCleanup(receiversForSender.get(sender));\n });\n // Schedule a cleanup of the list of senders.\n scheduleCleanup(senders);\n }\n Private.disconnectReceiver = disconnectReceiver;\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n */\n function disconnectAll(object) {\n // Remove all connections where the given object is the sender.\n disconnectSender(object);\n // Remove all connections where the given object is the receiver.\n disconnectReceiver(object);\n }\n Private.disconnectAll = disconnectAll;\n /**\n * Emit a signal and invoke its connected slots.\n *\n * @param signal - The signal of interest.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n function emit(signal, args) {\n // If there are no receivers, there is nothing to do.\n var receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n // Invoke the slots for connections with a matching signal.\n // Any connections added during emission are not invoked.\n for (var i = 0, n = receivers.length; i < n; ++i) {\n var connection = receivers[i];\n if (connection.signal === signal) {\n invokeSlot(connection, args);\n }\n }\n }\n Private.emit = emit;\n /**\n * A weak mapping of sender to array of receiver connections.\n */\n var receiversForSender = new WeakMap();\n /**\n * A weak mapping of receiver to array of sender connections.\n */\n var sendersForReceiver = new WeakMap();\n /**\n * A set of connection arrays which are pending cleanup.\n */\n var dirtySet = new Set();\n /**\n * A function to schedule an event loop callback.\n */\n var schedule = (function () {\n var ok = typeof requestAnimationFrame === 'function';\n // @ts-ignore\n return ok ? requestAnimationFrame : setImmediate;\n })();\n /**\n * Find a connection which matches the given parameters.\n */\n function findConnection(connections, signal, slot, thisArg) {\n return algorithm.find(connections, function (connection) { return (connection.signal === signal &&\n connection.slot === slot &&\n connection.thisArg === thisArg); });\n }\n /**\n * Invoke a slot with the given parameters.\n *\n * The connection is assumed to be valid.\n *\n * Exceptions in the slot will be caught and logged.\n */\n function invokeSlot(connection, args) {\n var signal = connection.signal, slot = connection.slot, thisArg = connection.thisArg;\n try {\n slot.call(thisArg, signal.sender, args);\n }\n catch (err) {\n Private.exceptionHandler(err);\n }\n }\n /**\n * Schedule a cleanup of a connection array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any connection with a\n * `null` signal will be removed from the array.\n */\n function scheduleCleanup(array) {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(array);\n }\n /**\n * Cleanup the connection lists in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet() {\n dirtySet.forEach(cleanupConnections);\n dirtySet.clear();\n }\n /**\n * Cleanup the dirty connections in a connections array.\n *\n * This will remove any connection with a `null` signal.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupConnections(connections) {\n algorithm.ArrayExt.removeAllWhere(connections, isDeadConnection);\n }\n /**\n * Test whether a connection is dead.\n *\n * A dead connection has a `null` signal.\n */\n function isDeadConnection(connection) {\n return connection.signal === null;\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../usr/share/nodejs/timers-browserify/main.js */ \"../../../../../usr/share/nodejs/timers-browserify/main.js\").setImmediate))\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/signaling/dist/index.js?"); │ │ │ │ + eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A concrete implementation of `ISignal`.\n *\n * #### Example\n * ```typescript\n * import { ISignal, Signal } from '@lumino/signaling';\n *\n * class SomeClass {\n *\n * constructor(name: string) {\n * this.name = name;\n * }\n *\n * readonly name: string;\n *\n * get valueChanged: ISignal {\n * return this._valueChanged;\n * }\n *\n * get value(): number {\n * return this._value;\n * }\n *\n * set value(value: number) {\n * if (value === this._value) {\n * return;\n * }\n * this._value = value;\n * this._valueChanged.emit(value);\n * }\n *\n * private _value = 0;\n * private _valueChanged = new Signal(this);\n * }\n *\n * function logger(sender: SomeClass, value: number): void {\n * console.log(sender.name, value);\n * }\n *\n * let m1 = new SomeClass('foo');\n * let m2 = new SomeClass('bar');\n *\n * m1.valueChanged.connect(logger);\n * m2.valueChanged.connect(logger);\n *\n * m1.value = 42; // logs: foo 42\n * m2.value = 17; // logs: bar 17\n * ```\n */\nexports.Signal = /** @class */ (function () {\n /**\n * Construct a new signal.\n *\n * @param sender - The sender which owns the signal.\n */\n function Signal(sender) {\n this.sender = sender;\n }\n /**\n * Connect a slot to the signal.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n Signal.prototype.connect = function (slot, thisArg) {\n return Private.connect(this, slot, thisArg);\n };\n /**\n * Disconnect a slot from the signal.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n Signal.prototype.disconnect = function (slot, thisArg) {\n return Private.disconnect(this, slot, thisArg);\n };\n /**\n * Emit the signal and invoke the connected slots.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n Signal.prototype.emit = function (args) {\n Private.emit(this, args);\n };\n return Signal;\n}());\n/**\n * The namespace for the `Signal` class statics.\n */\n(function (Signal) {\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n function disconnectBetween(sender, receiver) {\n Private.disconnectBetween(sender, receiver);\n }\n Signal.disconnectBetween = disconnectBetween;\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n function disconnectSender(sender) {\n Private.disconnectSender(sender);\n }\n Signal.disconnectSender = disconnectSender;\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n function disconnectReceiver(receiver) {\n Private.disconnectReceiver(receiver);\n }\n Signal.disconnectReceiver = disconnectReceiver;\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n function disconnectAll(object) {\n Private.disconnectAll(object);\n }\n Signal.disconnectAll = disconnectAll;\n /**\n * Clear all signal data associated with the given object.\n *\n * @param object - The object for which the data should be cleared.\n *\n * #### Notes\n * This removes all signal connections and any other signal data\n * associated with the object.\n */\n function clearData(object) {\n Private.disconnectAll(object);\n }\n Signal.clearData = clearData;\n /**\n * Get the signal exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n function getExceptionHandler() {\n return Private.exceptionHandler;\n }\n Signal.getExceptionHandler = getExceptionHandler;\n /**\n * Set the signal exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a slot throws an exception.\n */\n function setExceptionHandler(handler) {\n var old = Private.exceptionHandler;\n Private.exceptionHandler = handler;\n return old;\n }\n Signal.setExceptionHandler = setExceptionHandler;\n})(exports.Signal || (exports.Signal = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The signal exception handler function.\n */\n Private.exceptionHandler = function (err) {\n console.error(err);\n };\n /**\n * Connect a slot to a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n function connect(signal, slot, thisArg) {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n // Ensure the sender's array of receivers is created.\n var receivers = receiversForSender.get(signal.sender);\n if (!receivers) {\n receivers = [];\n receiversForSender.set(signal.sender, receivers);\n }\n // Bail if a matching connection already exists.\n if (findConnection(receivers, signal, slot, thisArg)) {\n return false;\n }\n // Choose the best object for the receiver.\n var receiver = thisArg || slot;\n // Ensure the receiver's array of senders is created.\n var senders = sendersForReceiver.get(receiver);\n if (!senders) {\n senders = [];\n sendersForReceiver.set(receiver, senders);\n }\n // Create a new connection and add it to the end of each array.\n var connection = { signal: signal, slot: slot, thisArg: thisArg };\n receivers.push(connection);\n senders.push(connection);\n // Indicate a successful connection.\n return true;\n }\n Private.connect = connect;\n /**\n * Disconnect a slot from a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n function disconnect(signal, slot, thisArg) {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n // Lookup the list of receivers, and bail if none exist.\n var receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return false;\n }\n // Bail if no matching connection exits.\n var connection = findConnection(receivers, signal, slot, thisArg);\n if (!connection) {\n return false;\n }\n // Choose the best object for the receiver.\n var receiver = thisArg || slot;\n // Lookup the array of senders, which is now known to exist.\n var senders = sendersForReceiver.get(receiver);\n // Clear the connection and schedule cleanup of the arrays.\n connection.signal = null;\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n // Indicate a successful disconnection.\n return true;\n }\n Private.disconnect = disconnect;\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n */\n function disconnectBetween(sender, receiver) {\n // If there are no receivers, there is nothing to do.\n var receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n // If there are no senders, there is nothing to do.\n var senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n // Clear each connection between the sender and receiver.\n algorithm.each(senders, function (connection) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n return;\n }\n // Clear the connection if it matches the sender.\n if (connection.signal.sender === sender) {\n connection.signal = null;\n }\n });\n // Schedule a cleanup of the senders and receivers.\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n }\n Private.disconnectBetween = disconnectBetween;\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n function disconnectSender(sender) {\n // If there are no receivers, there is nothing to do.\n var receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n // Clear each receiver connection.\n algorithm.each(receivers, function (connection) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n return;\n }\n // Choose the best object for the receiver.\n var receiver = connection.thisArg || connection.slot;\n // Clear the connection.\n connection.signal = null;\n // Cleanup the array of senders, which is now known to exist.\n scheduleCleanup(sendersForReceiver.get(receiver));\n });\n // Schedule a cleanup of the receivers.\n scheduleCleanup(receivers);\n }\n Private.disconnectSender = disconnectSender;\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n */\n function disconnectReceiver(receiver) {\n // If there are no senders, there is nothing to do.\n var senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n // Clear each sender connection.\n algorithm.each(senders, function (connection) {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n return;\n }\n // Lookup the sender for the connection.\n var sender = connection.signal.sender;\n // Clear the connection.\n connection.signal = null;\n // Cleanup the array of receivers, which is now known to exist.\n scheduleCleanup(receiversForSender.get(sender));\n });\n // Schedule a cleanup of the list of senders.\n scheduleCleanup(senders);\n }\n Private.disconnectReceiver = disconnectReceiver;\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n */\n function disconnectAll(object) {\n // Remove all connections where the given object is the sender.\n disconnectSender(object);\n // Remove all connections where the given object is the receiver.\n disconnectReceiver(object);\n }\n Private.disconnectAll = disconnectAll;\n /**\n * Emit a signal and invoke its connected slots.\n *\n * @param signal - The signal of interest.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n function emit(signal, args) {\n // If there are no receivers, there is nothing to do.\n var receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n // Invoke the slots for connections with a matching signal.\n // Any connections added during emission are not invoked.\n for (var i = 0, n = receivers.length; i < n; ++i) {\n var connection = receivers[i];\n if (connection.signal === signal) {\n invokeSlot(connection, args);\n }\n }\n }\n Private.emit = emit;\n /**\n * A weak mapping of sender to array of receiver connections.\n */\n var receiversForSender = new WeakMap();\n /**\n * A weak mapping of receiver to array of sender connections.\n */\n var sendersForReceiver = new WeakMap();\n /**\n * A set of connection arrays which are pending cleanup.\n */\n var dirtySet = new Set();\n /**\n * A function to schedule an event loop callback.\n */\n var schedule = (function () {\n var ok = typeof requestAnimationFrame === 'function';\n // @ts-ignore\n return ok ? requestAnimationFrame : setImmediate;\n })();\n /**\n * Find a connection which matches the given parameters.\n */\n function findConnection(connections, signal, slot, thisArg) {\n return algorithm.find(connections, function (connection) { return (connection.signal === signal &&\n connection.slot === slot &&\n connection.thisArg === thisArg); });\n }\n /**\n * Invoke a slot with the given parameters.\n *\n * The connection is assumed to be valid.\n *\n * Exceptions in the slot will be caught and logged.\n */\n function invokeSlot(connection, args) {\n var signal = connection.signal, slot = connection.slot, thisArg = connection.thisArg;\n try {\n slot.call(thisArg, signal.sender, args);\n }\n catch (err) {\n Private.exceptionHandler(err);\n }\n }\n /**\n * Schedule a cleanup of a connection array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any connection with a\n * `null` signal will be removed from the array.\n */\n function scheduleCleanup(array) {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(array);\n }\n /**\n * Cleanup the connection lists in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet() {\n dirtySet.forEach(cleanupConnections);\n dirtySet.clear();\n }\n /**\n * Cleanup the dirty connections in a connections array.\n *\n * This will remove any connection with a `null` signal.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupConnections(connections) {\n algorithm.ArrayExt.removeAllWhere(connections, isDeadConnection);\n }\n /**\n * Test whether a connection is dead.\n *\n * A dead connection has a `null` signal.\n */\n function isDeadConnection(connection) {\n return connection.signal === null;\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../usr/share/nodejs/timers-browserify/main.js */ \"../../../../../usr/share/nodejs/timers-browserify/main.js\").setImmediate))\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/signaling/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/virtualdom/dist/index.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/virtualdom/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/virtualdom/dist/index.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n/**\n * A virtual node which represents plain text content.\n *\n * #### Notes\n * User code will not typically create a `VirtualText` node directly.\n * Instead, the `h()` function will be used to create an element tree.\n */\nvar VirtualText = /** @class */ (function () {\n /**\n * Construct a new virtual text node.\n *\n * @param content - The text content for the node.\n */\n function VirtualText(content) {\n /**\n * The type of the node.\n *\n * This value can be used as a type guard for discriminating the\n * `VirtualNode` union type.\n */\n this.type = 'text';\n this.content = content;\n }\n return VirtualText;\n}());\n/**\n * A virtual node which represents an HTML element.\n *\n * #### Notes\n * User code will not typically create a `VirtualElement` node directly.\n * Instead, the `h()` function will be used to create an element tree.\n */\nvar VirtualElement = /** @class */ (function () {\n /**\n * Construct a new virtual element node.\n *\n * @param tag - The element tag name.\n *\n * @param attrs - The element attributes.\n *\n * @param children - The element children.\n *\n * @param renderer - An optional custom renderer for the element.\n */\n function VirtualElement(tag, attrs, children, renderer) {\n /**\n * The type of the node.\n *\n * This value can be used as a type guard for discriminating the\n * `VirtualNode` union type.\n */\n this.type = 'element';\n this.tag = tag;\n this.attrs = attrs;\n this.children = children;\n this.renderer = renderer;\n }\n return VirtualElement;\n}());\n/**\n * DEPRECATED - use VirtualElement with a defined renderer param instead.\n * This class is provided as a backwards compatibility shim\n *\n * A \"pass thru\" virtual node whose children are managed by a render and an\n * unrender callback. The intent of this flavor of virtual node is to make\n * it easy to blend other kinds of virtualdom (eg React) into Phosphor's\n * virtualdom.\n *\n * #### Notes\n * User code will not typically create a `VirtualElementPass` node directly.\n * Instead, the `hpass()` function will be used to create an element tree.\n */\nvar VirtualElementPass = /** @class */ (function (_super) {\n tslib.__extends(VirtualElementPass, _super);\n /**\n * DEPRECATED - use VirtualElement with a defined renderer param instead\n *\n * Construct a new virtual element pass thru node.\n *\n * @param tag - the tag of the parent element of this node. Once the parent\n * element is rendered, it will be passed as an argument to\n * renderer.render\n *\n * @param attrs - attributes that will assigned to the\n * parent element\n *\n * @param renderer - an object with render and unrender\n * functions, each of which should take a single argument of type\n * HTMLElement and return nothing. If null, the parent element\n * will be rendered barren without any children.\n */\n function VirtualElementPass(tag, attrs, renderer) {\n return _super.call(this, tag, attrs, [], renderer || undefined) || this;\n }\n return VirtualElementPass;\n}(VirtualElement));\nfunction h(tag) {\n var attrs = {};\n var renderer;\n var children = [];\n for (var i = 1, n = arguments.length; i < n; ++i) {\n var arg = arguments[i];\n if (typeof arg === 'string') {\n children.push(new VirtualText(arg));\n }\n else if (arg instanceof VirtualText) {\n children.push(arg);\n }\n else if (arg instanceof VirtualElement) {\n children.push(arg);\n }\n else if (arg instanceof Array) {\n extend(children, arg);\n }\n else if ((i === 1 || i === 2) && arg && typeof arg === 'object') {\n if (\"render\" in arg) {\n renderer = arg;\n }\n else {\n attrs = arg;\n }\n }\n }\n return new VirtualElement(tag, attrs, children, renderer);\n function extend(array, values) {\n for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n var child = values_1[_i];\n if (typeof child === 'string') {\n array.push(new VirtualText(child));\n }\n else if (child instanceof VirtualText) {\n array.push(child);\n }\n else if (child instanceof VirtualElement) {\n array.push(child);\n }\n }\n }\n}\n/**\n * The namespace for the `h` function statics.\n */\n(function (h) {\n h.a = h.bind(undefined, 'a');\n h.abbr = h.bind(undefined, 'abbr');\n h.address = h.bind(undefined, 'address');\n h.area = h.bind(undefined, 'area');\n h.article = h.bind(undefined, 'article');\n h.aside = h.bind(undefined, 'aside');\n h.audio = h.bind(undefined, 'audio');\n h.b = h.bind(undefined, 'b');\n h.bdi = h.bind(undefined, 'bdi');\n h.bdo = h.bind(undefined, 'bdo');\n h.blockquote = h.bind(undefined, 'blockquote');\n h.br = h.bind(undefined, 'br');\n h.button = h.bind(undefined, 'button');\n h.canvas = h.bind(undefined, 'canvas');\n h.caption = h.bind(undefined, 'caption');\n h.cite = h.bind(undefined, 'cite');\n h.code = h.bind(undefined, 'code');\n h.col = h.bind(undefined, 'col');\n h.colgroup = h.bind(undefined, 'colgroup');\n h.data = h.bind(undefined, 'data');\n h.datalist = h.bind(undefined, 'datalist');\n h.dd = h.bind(undefined, 'dd');\n h.del = h.bind(undefined, 'del');\n h.dfn = h.bind(undefined, 'dfn');\n h.div = h.bind(undefined, 'div');\n h.dl = h.bind(undefined, 'dl');\n h.dt = h.bind(undefined, 'dt');\n h.em = h.bind(undefined, 'em');\n h.embed = h.bind(undefined, 'embed');\n h.fieldset = h.bind(undefined, 'fieldset');\n h.figcaption = h.bind(undefined, 'figcaption');\n h.figure = h.bind(undefined, 'figure');\n h.footer = h.bind(undefined, 'footer');\n h.form = h.bind(undefined, 'form');\n h.h1 = h.bind(undefined, 'h1');\n h.h2 = h.bind(undefined, 'h2');\n h.h3 = h.bind(undefined, 'h3');\n h.h4 = h.bind(undefined, 'h4');\n h.h5 = h.bind(undefined, 'h5');\n h.h6 = h.bind(undefined, 'h6');\n h.header = h.bind(undefined, 'header');\n h.hr = h.bind(undefined, 'hr');\n h.i = h.bind(undefined, 'i');\n h.iframe = h.bind(undefined, 'iframe');\n h.img = h.bind(undefined, 'img');\n h.input = h.bind(undefined, 'input');\n h.ins = h.bind(undefined, 'ins');\n h.kbd = h.bind(undefined, 'kbd');\n h.label = h.bind(undefined, 'label');\n h.legend = h.bind(undefined, 'legend');\n h.li = h.bind(undefined, 'li');\n h.main = h.bind(undefined, 'main');\n h.map = h.bind(undefined, 'map');\n h.mark = h.bind(undefined, 'mark');\n h.meter = h.bind(undefined, 'meter');\n h.nav = h.bind(undefined, 'nav');\n h.noscript = h.bind(undefined, 'noscript');\n h.object = h.bind(undefined, 'object');\n h.ol = h.bind(undefined, 'ol');\n h.optgroup = h.bind(undefined, 'optgroup');\n h.option = h.bind(undefined, 'option');\n h.output = h.bind(undefined, 'output');\n h.p = h.bind(undefined, 'p');\n h.param = h.bind(undefined, 'param');\n h.pre = h.bind(undefined, 'pre');\n h.progress = h.bind(undefined, 'progress');\n h.q = h.bind(undefined, 'q');\n h.rp = h.bind(undefined, 'rp');\n h.rt = h.bind(undefined, 'rt');\n h.ruby = h.bind(undefined, 'ruby');\n h.s = h.bind(undefined, 's');\n h.samp = h.bind(undefined, 'samp');\n h.section = h.bind(undefined, 'section');\n h.select = h.bind(undefined, 'select');\n h.small = h.bind(undefined, 'small');\n h.source = h.bind(undefined, 'source');\n h.span = h.bind(undefined, 'span');\n h.strong = h.bind(undefined, 'strong');\n h.sub = h.bind(undefined, 'sub');\n h.summary = h.bind(undefined, 'summary');\n h.sup = h.bind(undefined, 'sup');\n h.table = h.bind(undefined, 'table');\n h.tbody = h.bind(undefined, 'tbody');\n h.td = h.bind(undefined, 'td');\n h.textarea = h.bind(undefined, 'textarea');\n h.tfoot = h.bind(undefined, 'tfoot');\n h.th = h.bind(undefined, 'th');\n h.thead = h.bind(undefined, 'thead');\n h.time = h.bind(undefined, 'time');\n h.title = h.bind(undefined, 'title');\n h.tr = h.bind(undefined, 'tr');\n h.track = h.bind(undefined, 'track');\n h.u = h.bind(undefined, 'u');\n h.ul = h.bind(undefined, 'ul');\n h.var_ = h.bind(undefined, 'var');\n h.video = h.bind(undefined, 'video');\n h.wbr = h.bind(undefined, 'wbr');\n})(h || (h = {}));\nfunction hpass(tag) {\n var attrs = {};\n var renderer = null;\n if (arguments.length === 2) {\n var arg = arguments[1];\n if (\"render\" in arg) {\n renderer = arg;\n }\n else {\n attrs = arg;\n }\n }\n else if (arguments.length === 3) {\n attrs = arguments[1];\n renderer = arguments[2];\n }\n else if (arguments.length > 3) {\n throw new Error(\"hpass() should be called with 1, 2, or 3 arguments\");\n }\n return new VirtualElementPass(tag, attrs, renderer);\n}\n(function (VirtualDOM) {\n function realize(node) {\n return Private.createDOMNode(node);\n }\n VirtualDOM.realize = realize;\n /**\n * Render virtual DOM content into a host element.\n *\n * @param content - The virtual DOM content to render.\n *\n * @param host - The host element for the rendered content.\n *\n * #### Notes\n * This renders the delta from the previous rendering. It assumes that\n * the content of the host element is not manipulated by external code.\n *\n * Providing `null` content will clear the rendering.\n *\n * Externally modifying the provided content or the host element will\n * result in undefined rendering behavior.\n */\n function render(content, host) {\n var oldContent = Private.hostMap.get(host) || [];\n var newContent = Private.asContentArray(content);\n Private.hostMap.set(host, newContent);\n Private.updateContent(host, oldContent, newContent);\n }\n VirtualDOM.render = render;\n})(exports.VirtualDOM || (exports.VirtualDOM = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A weak mapping of host element to virtual DOM content.\n */\n Private.hostMap = new WeakMap();\n /**\n * Cast a content value to a content array.\n */\n function asContentArray(value) {\n if (!value) {\n return [];\n }\n if (value instanceof Array) {\n return value;\n }\n return [value];\n }\n Private.asContentArray = asContentArray;\n function createDOMNode(node) {\n var host = arguments[1] || null;\n var before = arguments[2] || null;\n if (host) {\n host.insertBefore(createDOMNode(node), before);\n }\n else {\n // Create a text node for a virtual text node.\n if (node.type === 'text') {\n return document.createTextNode(node.content);\n }\n // Create the HTML element with the specified tag.\n host = document.createElement(node.tag);\n // Add the attributes for the new element.\n addAttrs(host, node.attrs);\n if (node.renderer) {\n node.renderer.render(host, { attrs: node.attrs, children: node.children });\n return host;\n }\n // Recursively populate the element with child content.\n for (var i = 0, n = node.children.length; i < n; ++i) {\n createDOMNode(node.children[i], host);\n }\n }\n return host;\n }\n Private.createDOMNode = createDOMNode;\n /**\n * Update a host element with the delta of the virtual content.\n *\n * This is the core \"diff\" algorithm. There is no explicit \"patch\"\n * phase. The host is patched at each step as the diff progresses.\n */\n function updateContent(host, oldContent, newContent) {\n // Bail early if the content is identical.\n if (oldContent === newContent) {\n return;\n }\n // Collect the old keyed elems into a mapping.\n var oldKeyed = collectKeys(host, oldContent);\n // Create a copy of the old content which can be modified in-place.\n var oldCopy = oldContent.slice();\n // Update the host with the new content. The diff always proceeds\n // forward and never modifies a previously visited index. The old\n // copy array is modified in-place to reflect the changes made to\n // the host children. This causes the stale nodes to be pushed to\n // the end of the host node and removed at the end of the loop.\n var currElem = host.firstChild;\n var newCount = newContent.length;\n for (var i = 0; i < newCount; ++i) {\n // If the old content is exhausted, create a new node.\n if (i >= oldCopy.length) {\n createDOMNode(newContent[i], host);\n continue;\n }\n // Lookup the old and new virtual nodes.\n var oldVNode = oldCopy[i];\n var newVNode = newContent[i];\n // If both elements are identical, there is nothing to do.\n if (oldVNode === newVNode) {\n currElem = currElem.nextSibling;\n continue;\n }\n // Handle the simplest case of in-place text update first.\n if (oldVNode.type === 'text' && newVNode.type === 'text') {\n currElem.textContent = newVNode.content;\n currElem = currElem.nextSibling;\n continue;\n }\n // If the old or new node is a text node, the other node is now\n // known to be an element node, so create and insert a new node.\n if (oldVNode.type === 'text' || newVNode.type === 'text') {\n algorithm.ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // If the old XOR new node has a custom renderer,\n // create and insert a new node.\n if (!(oldVNode.renderer) != !(newVNode.renderer)) {\n algorithm.ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // At this point, both nodes are known to be element nodes.\n // If the new elem is keyed, move an old keyed elem to the proper\n // location before proceeding with the diff. The search can start\n // at the current index, since the unmatched old keyed elems are\n // pushed forward in the old copy array.\n var newKey = newVNode.attrs.key;\n if (newKey && newKey in oldKeyed) {\n var pair = oldKeyed[newKey];\n if (pair.vNode !== oldVNode) {\n algorithm.ArrayExt.move(oldCopy, oldCopy.indexOf(pair.vNode, i + 1), i);\n host.insertBefore(pair.element, currElem);\n oldVNode = pair.vNode;\n currElem = pair.element;\n }\n }\n // If both elements are identical, there is nothing to do.\n if (oldVNode === newVNode) {\n currElem = currElem.nextSibling;\n continue;\n }\n // If the old elem is keyed and does not match the new elem key,\n // create a new node. This is necessary since the old keyed elem\n // may be matched at a later point in the diff.\n var oldKey = oldVNode.attrs.key;\n if (oldKey && oldKey !== newKey) {\n algorithm.ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // If the tags are different, create a new node.\n if (oldVNode.tag !== newVNode.tag) {\n algorithm.ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // At this point, the element can be updated in-place.\n // Update the element attributes.\n updateAttrs(currElem, oldVNode.attrs, newVNode.attrs);\n // Update the element content.\n if (newVNode.renderer) {\n newVNode.renderer.render(currElem, { attrs: newVNode.attrs, children: newVNode.children });\n }\n else {\n updateContent(currElem, oldVNode.children, newVNode.children);\n }\n // Step to the next sibling element.\n currElem = currElem.nextSibling;\n }\n // Cleanup stale DOM\n removeContent(host, oldCopy, newCount, true);\n }\n Private.updateContent = updateContent;\n /**\n * Handle cleanup of stale vdom and its associated DOM. The host node is\n * traversed recursively (in depth-first order), and any explicit cleanup\n * required by a child node is carried out when it is visited (eg if a node\n * has a custom renderer, the renderer.unrender function will be called).\n * Once the subtree beneath each child of host has been completely visited,\n * that child will be removed via a call to host.removeChild.\n */\n function removeContent(host, oldContent, newCount, _sentinel) {\n // Dispose of the old nodes pushed to the end of the host.\n for (var i = oldContent.length - 1; i >= newCount; --i) {\n var oldNode = oldContent[i];\n var child = (_sentinel ? host.lastChild : host.childNodes[i]);\n // recursively clean up host children\n if (oldNode.type === 'text') ;\n else if (oldNode.renderer && oldNode.renderer.unrender) {\n oldNode.renderer.unrender(child, { attrs: oldNode.attrs, children: oldNode.children });\n }\n else {\n removeContent(child, oldNode.children, 0, false);\n }\n if (_sentinel) {\n host.removeChild(child);\n }\n }\n }\n /**\n * A set of special-cased attribute names.\n */\n var specialAttrs = {\n 'key': true,\n 'className': true,\n 'htmlFor': true,\n 'dataset': true,\n 'style': true,\n };\n /**\n * Add element attributes to a newly created HTML element.\n */\n function addAttrs(element, attrs) {\n // Add the inline event listeners and node attributes.\n for (var name_1 in attrs) {\n if (name_1 in specialAttrs) {\n continue;\n }\n if (name_1.substr(0, 2) === 'on') {\n element[name_1] = attrs[name_1];\n }\n else {\n element.setAttribute(name_1, attrs[name_1]);\n }\n }\n // Add the element `class` attribute.\n if (attrs.className !== undefined) {\n element.setAttribute('class', attrs.className);\n }\n // Add the element `for` attribute.\n if (attrs.htmlFor !== undefined) {\n element.setAttribute('for', attrs.htmlFor);\n }\n // Add the dataset values.\n if (attrs.dataset) {\n addDataset(element, attrs.dataset);\n }\n // Add the inline styles.\n if (attrs.style) {\n addStyle(element, attrs.style);\n }\n }\n /**\n * Update the element attributes of an HTML element.\n */\n function updateAttrs(element, oldAttrs, newAttrs) {\n // Do nothing if the attrs are the same object.\n if (oldAttrs === newAttrs) {\n return;\n }\n // Setup the strongly typed loop variable.\n var name;\n // Remove attributes and listeners which no longer exist.\n for (name in oldAttrs) {\n if (name in specialAttrs || name in newAttrs) {\n continue;\n }\n if (name.substr(0, 2) === 'on') {\n element[name] = null;\n }\n else {\n element.removeAttribute(name);\n }\n }\n // Add and update new and existing attributes and listeners.\n for (name in newAttrs) {\n if (name in specialAttrs || oldAttrs[name] === newAttrs[name]) {\n continue;\n }\n if (name.substr(0, 2) === 'on') {\n element[name] = newAttrs[name];\n }\n else {\n element.setAttribute(name, newAttrs[name]);\n }\n }\n // Update the element `class` attribute.\n if (oldAttrs.className !== newAttrs.className) {\n if (newAttrs.className !== undefined) {\n element.setAttribute('class', newAttrs.className);\n }\n else {\n element.removeAttribute('class');\n }\n }\n // Add the element `for` attribute.\n if (oldAttrs.htmlFor !== newAttrs.htmlFor) {\n if (newAttrs.htmlFor !== undefined) {\n element.setAttribute('for', newAttrs.htmlFor);\n }\n else {\n element.removeAttribute('for');\n }\n }\n // Update the dataset values.\n if (oldAttrs.dataset !== newAttrs.dataset) {\n updateDataset(element, oldAttrs.dataset || {}, newAttrs.dataset || {});\n }\n // Update the inline styles.\n if (oldAttrs.style !== newAttrs.style) {\n updateStyle(element, oldAttrs.style || {}, newAttrs.style || {});\n }\n }\n /**\n * Add dataset values to a newly created HTML element.\n */\n function addDataset(element, dataset) {\n for (var name_2 in dataset) {\n element.setAttribute(\"data-\" + name_2, dataset[name_2]);\n }\n }\n /**\n * Update the dataset values of an HTML element.\n */\n function updateDataset(element, oldDataset, newDataset) {\n for (var name_3 in oldDataset) {\n if (!(name_3 in newDataset)) {\n element.removeAttribute(\"data-\" + name_3);\n }\n }\n for (var name_4 in newDataset) {\n if (oldDataset[name_4] !== newDataset[name_4]) {\n element.setAttribute(\"data-\" + name_4, newDataset[name_4]);\n }\n }\n }\n /**\n * Add inline style values to a newly created HTML element.\n */\n function addStyle(element, style) {\n var elemStyle = element.style;\n var name;\n for (name in style) {\n elemStyle[name] = style[name];\n }\n }\n /**\n * Update the inline style values of an HTML element.\n */\n function updateStyle(element, oldStyle, newStyle) {\n var elemStyle = element.style;\n var name;\n for (name in oldStyle) {\n if (!(name in newStyle)) {\n elemStyle[name] = '';\n }\n }\n for (name in newStyle) {\n if (oldStyle[name] !== newStyle[name]) {\n elemStyle[name] = newStyle[name];\n }\n }\n }\n /**\n * Collect a mapping of keyed elements for the host content.\n */\n function collectKeys(host, content) {\n var node = host.firstChild;\n var keyMap = Object.create(null);\n for (var _i = 0, content_1 = content; _i < content_1.length; _i++) {\n var vNode = content_1[_i];\n if (vNode.type === 'element' && vNode.attrs.key) {\n keyMap[vNode.attrs.key] = { vNode: vNode, element: node };\n }\n node = node.nextSibling;\n }\n return keyMap;\n }\n})(Private || (Private = {}));\n\nexports.VirtualElement = VirtualElement;\nexports.VirtualElementPass = VirtualElementPass;\nexports.VirtualText = VirtualText;\nexports.h = h;\nexports.hpass = hpass;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/virtualdom/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n\n/**\n * A virtual node which represents plain text content.\n *\n * #### Notes\n * User code will not typically create a `VirtualText` node directly.\n * Instead, the `h()` function will be used to create an element tree.\n */\nvar VirtualText = /** @class */ (function () {\n /**\n * Construct a new virtual text node.\n *\n * @param content - The text content for the node.\n */\n function VirtualText(content) {\n /**\n * The type of the node.\n *\n * This value can be used as a type guard for discriminating the\n * `VirtualNode` union type.\n */\n this.type = 'text';\n this.content = content;\n }\n return VirtualText;\n}());\n/**\n * A virtual node which represents an HTML element.\n *\n * #### Notes\n * User code will not typically create a `VirtualElement` node directly.\n * Instead, the `h()` function will be used to create an element tree.\n */\nvar VirtualElement = /** @class */ (function () {\n /**\n * Construct a new virtual element node.\n *\n * @param tag - The element tag name.\n *\n * @param attrs - The element attributes.\n *\n * @param children - The element children.\n *\n * @param renderer - An optional custom renderer for the element.\n */\n function VirtualElement(tag, attrs, children, renderer) {\n /**\n * The type of the node.\n *\n * This value can be used as a type guard for discriminating the\n * `VirtualNode` union type.\n */\n this.type = 'element';\n this.tag = tag;\n this.attrs = attrs;\n this.children = children;\n this.renderer = renderer;\n }\n return VirtualElement;\n}());\n/**\n * DEPRECATED - use VirtualElement with a defined renderer param instead.\n * This class is provided as a backwards compatibility shim\n *\n * A \"pass thru\" virtual node whose children are managed by a render and an\n * unrender callback. The intent of this flavor of virtual node is to make\n * it easy to blend other kinds of virtualdom (eg React) into Phosphor's\n * virtualdom.\n *\n * #### Notes\n * User code will not typically create a `VirtualElementPass` node directly.\n * Instead, the `hpass()` function will be used to create an element tree.\n */\nvar VirtualElementPass = /** @class */ (function (_super) {\n tslib.__extends(VirtualElementPass, _super);\n /**\n * DEPRECATED - use VirtualElement with a defined renderer param instead\n *\n * Construct a new virtual element pass thru node.\n *\n * @param tag - the tag of the parent element of this node. Once the parent\n * element is rendered, it will be passed as an argument to\n * renderer.render\n *\n * @param attrs - attributes that will assigned to the\n * parent element\n *\n * @param renderer - an object with render and unrender\n * functions, each of which should take a single argument of type\n * HTMLElement and return nothing. If null, the parent element\n * will be rendered barren without any children.\n */\n function VirtualElementPass(tag, attrs, renderer) {\n return _super.call(this, tag, attrs, [], renderer || undefined) || this;\n }\n return VirtualElementPass;\n}(VirtualElement));\nfunction h(tag) {\n var attrs = {};\n var renderer;\n var children = [];\n for (var i = 1, n = arguments.length; i < n; ++i) {\n var arg = arguments[i];\n if (typeof arg === 'string') {\n children.push(new VirtualText(arg));\n }\n else if (arg instanceof VirtualText) {\n children.push(arg);\n }\n else if (arg instanceof VirtualElement) {\n children.push(arg);\n }\n else if (arg instanceof Array) {\n extend(children, arg);\n }\n else if ((i === 1 || i === 2) && arg && typeof arg === 'object') {\n if (\"render\" in arg) {\n renderer = arg;\n }\n else {\n attrs = arg;\n }\n }\n }\n return new VirtualElement(tag, attrs, children, renderer);\n function extend(array, values) {\n for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n var child = values_1[_i];\n if (typeof child === 'string') {\n array.push(new VirtualText(child));\n }\n else if (child instanceof VirtualText) {\n array.push(child);\n }\n else if (child instanceof VirtualElement) {\n array.push(child);\n }\n }\n }\n}\n/**\n * The namespace for the `h` function statics.\n */\n(function (h) {\n h.a = h.bind(undefined, 'a');\n h.abbr = h.bind(undefined, 'abbr');\n h.address = h.bind(undefined, 'address');\n h.area = h.bind(undefined, 'area');\n h.article = h.bind(undefined, 'article');\n h.aside = h.bind(undefined, 'aside');\n h.audio = h.bind(undefined, 'audio');\n h.b = h.bind(undefined, 'b');\n h.bdi = h.bind(undefined, 'bdi');\n h.bdo = h.bind(undefined, 'bdo');\n h.blockquote = h.bind(undefined, 'blockquote');\n h.br = h.bind(undefined, 'br');\n h.button = h.bind(undefined, 'button');\n h.canvas = h.bind(undefined, 'canvas');\n h.caption = h.bind(undefined, 'caption');\n h.cite = h.bind(undefined, 'cite');\n h.code = h.bind(undefined, 'code');\n h.col = h.bind(undefined, 'col');\n h.colgroup = h.bind(undefined, 'colgroup');\n h.data = h.bind(undefined, 'data');\n h.datalist = h.bind(undefined, 'datalist');\n h.dd = h.bind(undefined, 'dd');\n h.del = h.bind(undefined, 'del');\n h.dfn = h.bind(undefined, 'dfn');\n h.div = h.bind(undefined, 'div');\n h.dl = h.bind(undefined, 'dl');\n h.dt = h.bind(undefined, 'dt');\n h.em = h.bind(undefined, 'em');\n h.embed = h.bind(undefined, 'embed');\n h.fieldset = h.bind(undefined, 'fieldset');\n h.figcaption = h.bind(undefined, 'figcaption');\n h.figure = h.bind(undefined, 'figure');\n h.footer = h.bind(undefined, 'footer');\n h.form = h.bind(undefined, 'form');\n h.h1 = h.bind(undefined, 'h1');\n h.h2 = h.bind(undefined, 'h2');\n h.h3 = h.bind(undefined, 'h3');\n h.h4 = h.bind(undefined, 'h4');\n h.h5 = h.bind(undefined, 'h5');\n h.h6 = h.bind(undefined, 'h6');\n h.header = h.bind(undefined, 'header');\n h.hr = h.bind(undefined, 'hr');\n h.i = h.bind(undefined, 'i');\n h.iframe = h.bind(undefined, 'iframe');\n h.img = h.bind(undefined, 'img');\n h.input = h.bind(undefined, 'input');\n h.ins = h.bind(undefined, 'ins');\n h.kbd = h.bind(undefined, 'kbd');\n h.label = h.bind(undefined, 'label');\n h.legend = h.bind(undefined, 'legend');\n h.li = h.bind(undefined, 'li');\n h.main = h.bind(undefined, 'main');\n h.map = h.bind(undefined, 'map');\n h.mark = h.bind(undefined, 'mark');\n h.meter = h.bind(undefined, 'meter');\n h.nav = h.bind(undefined, 'nav');\n h.noscript = h.bind(undefined, 'noscript');\n h.object = h.bind(undefined, 'object');\n h.ol = h.bind(undefined, 'ol');\n h.optgroup = h.bind(undefined, 'optgroup');\n h.option = h.bind(undefined, 'option');\n h.output = h.bind(undefined, 'output');\n h.p = h.bind(undefined, 'p');\n h.param = h.bind(undefined, 'param');\n h.pre = h.bind(undefined, 'pre');\n h.progress = h.bind(undefined, 'progress');\n h.q = h.bind(undefined, 'q');\n h.rp = h.bind(undefined, 'rp');\n h.rt = h.bind(undefined, 'rt');\n h.ruby = h.bind(undefined, 'ruby');\n h.s = h.bind(undefined, 's');\n h.samp = h.bind(undefined, 'samp');\n h.section = h.bind(undefined, 'section');\n h.select = h.bind(undefined, 'select');\n h.small = h.bind(undefined, 'small');\n h.source = h.bind(undefined, 'source');\n h.span = h.bind(undefined, 'span');\n h.strong = h.bind(undefined, 'strong');\n h.sub = h.bind(undefined, 'sub');\n h.summary = h.bind(undefined, 'summary');\n h.sup = h.bind(undefined, 'sup');\n h.table = h.bind(undefined, 'table');\n h.tbody = h.bind(undefined, 'tbody');\n h.td = h.bind(undefined, 'td');\n h.textarea = h.bind(undefined, 'textarea');\n h.tfoot = h.bind(undefined, 'tfoot');\n h.th = h.bind(undefined, 'th');\n h.thead = h.bind(undefined, 'thead');\n h.time = h.bind(undefined, 'time');\n h.title = h.bind(undefined, 'title');\n h.tr = h.bind(undefined, 'tr');\n h.track = h.bind(undefined, 'track');\n h.u = h.bind(undefined, 'u');\n h.ul = h.bind(undefined, 'ul');\n h.var_ = h.bind(undefined, 'var');\n h.video = h.bind(undefined, 'video');\n h.wbr = h.bind(undefined, 'wbr');\n})(h || (h = {}));\nfunction hpass(tag) {\n var attrs = {};\n var renderer = null;\n if (arguments.length === 2) {\n var arg = arguments[1];\n if (\"render\" in arg) {\n renderer = arg;\n }\n else {\n attrs = arg;\n }\n }\n else if (arguments.length === 3) {\n attrs = arguments[1];\n renderer = arguments[2];\n }\n else if (arguments.length > 3) {\n throw new Error(\"hpass() should be called with 1, 2, or 3 arguments\");\n }\n return new VirtualElementPass(tag, attrs, renderer);\n}\n(function (VirtualDOM) {\n function realize(node) {\n return Private.createDOMNode(node);\n }\n VirtualDOM.realize = realize;\n /**\n * Render virtual DOM content into a host element.\n *\n * @param content - The virtual DOM content to render.\n *\n * @param host - The host element for the rendered content.\n *\n * #### Notes\n * This renders the delta from the previous rendering. It assumes that\n * the content of the host element is not manipulated by external code.\n *\n * Providing `null` content will clear the rendering.\n *\n * Externally modifying the provided content or the host element will\n * result in undefined rendering behavior.\n */\n function render(content, host) {\n var oldContent = Private.hostMap.get(host) || [];\n var newContent = Private.asContentArray(content);\n Private.hostMap.set(host, newContent);\n Private.updateContent(host, oldContent, newContent);\n }\n VirtualDOM.render = render;\n})(exports.VirtualDOM || (exports.VirtualDOM = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A weak mapping of host element to virtual DOM content.\n */\n Private.hostMap = new WeakMap();\n /**\n * Cast a content value to a content array.\n */\n function asContentArray(value) {\n if (!value) {\n return [];\n }\n if (value instanceof Array) {\n return value;\n }\n return [value];\n }\n Private.asContentArray = asContentArray;\n function createDOMNode(node) {\n var host = arguments[1] || null;\n var before = arguments[2] || null;\n if (host) {\n host.insertBefore(createDOMNode(node), before);\n }\n else {\n // Create a text node for a virtual text node.\n if (node.type === 'text') {\n return document.createTextNode(node.content);\n }\n // Create the HTML element with the specified tag.\n host = document.createElement(node.tag);\n // Add the attributes for the new element.\n addAttrs(host, node.attrs);\n if (node.renderer) {\n node.renderer.render(host, { attrs: node.attrs, children: node.children });\n return host;\n }\n // Recursively populate the element with child content.\n for (var i = 0, n = node.children.length; i < n; ++i) {\n createDOMNode(node.children[i], host);\n }\n }\n return host;\n }\n Private.createDOMNode = createDOMNode;\n /**\n * Update a host element with the delta of the virtual content.\n *\n * This is the core \"diff\" algorithm. There is no explicit \"patch\"\n * phase. The host is patched at each step as the diff progresses.\n */\n function updateContent(host, oldContent, newContent) {\n // Bail early if the content is identical.\n if (oldContent === newContent) {\n return;\n }\n // Collect the old keyed elems into a mapping.\n var oldKeyed = collectKeys(host, oldContent);\n // Create a copy of the old content which can be modified in-place.\n var oldCopy = oldContent.slice();\n // Update the host with the new content. The diff always proceeds\n // forward and never modifies a previously visited index. The old\n // copy array is modified in-place to reflect the changes made to\n // the host children. This causes the stale nodes to be pushed to\n // the end of the host node and removed at the end of the loop.\n var currElem = host.firstChild;\n var newCount = newContent.length;\n for (var i = 0; i < newCount; ++i) {\n // If the old content is exhausted, create a new node.\n if (i >= oldCopy.length) {\n createDOMNode(newContent[i], host);\n continue;\n }\n // Lookup the old and new virtual nodes.\n var oldVNode = oldCopy[i];\n var newVNode = newContent[i];\n // If both elements are identical, there is nothing to do.\n if (oldVNode === newVNode) {\n currElem = currElem.nextSibling;\n continue;\n }\n // Handle the simplest case of in-place text update first.\n if (oldVNode.type === 'text' && newVNode.type === 'text') {\n currElem.textContent = newVNode.content;\n currElem = currElem.nextSibling;\n continue;\n }\n // If the old or new node is a text node, the other node is now\n // known to be an element node, so create and insert a new node.\n if (oldVNode.type === 'text' || newVNode.type === 'text') {\n algorithm.ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // If the old XOR new node has a custom renderer,\n // create and insert a new node.\n if (!(oldVNode.renderer) != !(newVNode.renderer)) {\n algorithm.ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // At this point, both nodes are known to be element nodes.\n // If the new elem is keyed, move an old keyed elem to the proper\n // location before proceeding with the diff. The search can start\n // at the current index, since the unmatched old keyed elems are\n // pushed forward in the old copy array.\n var newKey = newVNode.attrs.key;\n if (newKey && newKey in oldKeyed) {\n var pair = oldKeyed[newKey];\n if (pair.vNode !== oldVNode) {\n algorithm.ArrayExt.move(oldCopy, oldCopy.indexOf(pair.vNode, i + 1), i);\n host.insertBefore(pair.element, currElem);\n oldVNode = pair.vNode;\n currElem = pair.element;\n }\n }\n // If both elements are identical, there is nothing to do.\n if (oldVNode === newVNode) {\n currElem = currElem.nextSibling;\n continue;\n }\n // If the old elem is keyed and does not match the new elem key,\n // create a new node. This is necessary since the old keyed elem\n // may be matched at a later point in the diff.\n var oldKey = oldVNode.attrs.key;\n if (oldKey && oldKey !== newKey) {\n algorithm.ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // If the tags are different, create a new node.\n if (oldVNode.tag !== newVNode.tag) {\n algorithm.ArrayExt.insert(oldCopy, i, newVNode);\n createDOMNode(newVNode, host, currElem);\n continue;\n }\n // At this point, the element can be updated in-place.\n // Update the element attributes.\n updateAttrs(currElem, oldVNode.attrs, newVNode.attrs);\n // Update the element content.\n if (newVNode.renderer) {\n newVNode.renderer.render(currElem, { attrs: newVNode.attrs, children: newVNode.children });\n }\n else {\n updateContent(currElem, oldVNode.children, newVNode.children);\n }\n // Step to the next sibling element.\n currElem = currElem.nextSibling;\n }\n // Cleanup stale DOM\n removeContent(host, oldCopy, newCount, true);\n }\n Private.updateContent = updateContent;\n /**\n * Handle cleanup of stale vdom and its associated DOM. The host node is\n * traversed recursively (in depth-first order), and any explicit cleanup\n * required by a child node is carried out when it is visited (eg if a node\n * has a custom renderer, the renderer.unrender function will be called).\n * Once the subtree beneath each child of host has been completely visited,\n * that child will be removed via a call to host.removeChild.\n */\n function removeContent(host, oldContent, newCount, _sentinel) {\n // Dispose of the old nodes pushed to the end of the host.\n for (var i = oldContent.length - 1; i >= newCount; --i) {\n var oldNode = oldContent[i];\n var child = (_sentinel ? host.lastChild : host.childNodes[i]);\n // recursively clean up host children\n if (oldNode.type === 'text') ;\n else if (oldNode.renderer && oldNode.renderer.unrender) {\n oldNode.renderer.unrender(child, { attrs: oldNode.attrs, children: oldNode.children });\n }\n else {\n removeContent(child, oldNode.children, 0, false);\n }\n if (_sentinel) {\n host.removeChild(child);\n }\n }\n }\n /**\n * A set of special-cased attribute names.\n */\n var specialAttrs = {\n 'key': true,\n 'className': true,\n 'htmlFor': true,\n 'dataset': true,\n 'style': true,\n };\n /**\n * Add element attributes to a newly created HTML element.\n */\n function addAttrs(element, attrs) {\n // Add the inline event listeners and node attributes.\n for (var name_1 in attrs) {\n if (name_1 in specialAttrs) {\n continue;\n }\n if (name_1.substr(0, 2) === 'on') {\n element[name_1] = attrs[name_1];\n }\n else {\n element.setAttribute(name_1, attrs[name_1]);\n }\n }\n // Add the element `class` attribute.\n if (attrs.className !== undefined) {\n element.setAttribute('class', attrs.className);\n }\n // Add the element `for` attribute.\n if (attrs.htmlFor !== undefined) {\n element.setAttribute('for', attrs.htmlFor);\n }\n // Add the dataset values.\n if (attrs.dataset) {\n addDataset(element, attrs.dataset);\n }\n // Add the inline styles.\n if (attrs.style) {\n addStyle(element, attrs.style);\n }\n }\n /**\n * Update the element attributes of an HTML element.\n */\n function updateAttrs(element, oldAttrs, newAttrs) {\n // Do nothing if the attrs are the same object.\n if (oldAttrs === newAttrs) {\n return;\n }\n // Setup the strongly typed loop variable.\n var name;\n // Remove attributes and listeners which no longer exist.\n for (name in oldAttrs) {\n if (name in specialAttrs || name in newAttrs) {\n continue;\n }\n if (name.substr(0, 2) === 'on') {\n element[name] = null;\n }\n else {\n element.removeAttribute(name);\n }\n }\n // Add and update new and existing attributes and listeners.\n for (name in newAttrs) {\n if (name in specialAttrs || oldAttrs[name] === newAttrs[name]) {\n continue;\n }\n if (name.substr(0, 2) === 'on') {\n element[name] = newAttrs[name];\n }\n else {\n element.setAttribute(name, newAttrs[name]);\n }\n }\n // Update the element `class` attribute.\n if (oldAttrs.className !== newAttrs.className) {\n if (newAttrs.className !== undefined) {\n element.setAttribute('class', newAttrs.className);\n }\n else {\n element.removeAttribute('class');\n }\n }\n // Add the element `for` attribute.\n if (oldAttrs.htmlFor !== newAttrs.htmlFor) {\n if (newAttrs.htmlFor !== undefined) {\n element.setAttribute('for', newAttrs.htmlFor);\n }\n else {\n element.removeAttribute('for');\n }\n }\n // Update the dataset values.\n if (oldAttrs.dataset !== newAttrs.dataset) {\n updateDataset(element, oldAttrs.dataset || {}, newAttrs.dataset || {});\n }\n // Update the inline styles.\n if (oldAttrs.style !== newAttrs.style) {\n updateStyle(element, oldAttrs.style || {}, newAttrs.style || {});\n }\n }\n /**\n * Add dataset values to a newly created HTML element.\n */\n function addDataset(element, dataset) {\n for (var name_2 in dataset) {\n element.setAttribute(\"data-\" + name_2, dataset[name_2]);\n }\n }\n /**\n * Update the dataset values of an HTML element.\n */\n function updateDataset(element, oldDataset, newDataset) {\n for (var name_3 in oldDataset) {\n if (!(name_3 in newDataset)) {\n element.removeAttribute(\"data-\" + name_3);\n }\n }\n for (var name_4 in newDataset) {\n if (oldDataset[name_4] !== newDataset[name_4]) {\n element.setAttribute(\"data-\" + name_4, newDataset[name_4]);\n }\n }\n }\n /**\n * Add inline style values to a newly created HTML element.\n */\n function addStyle(element, style) {\n var elemStyle = element.style;\n var name;\n for (name in style) {\n elemStyle[name] = style[name];\n }\n }\n /**\n * Update the inline style values of an HTML element.\n */\n function updateStyle(element, oldStyle, newStyle) {\n var elemStyle = element.style;\n var name;\n for (name in oldStyle) {\n if (!(name in newStyle)) {\n elemStyle[name] = '';\n }\n }\n for (name in newStyle) {\n if (oldStyle[name] !== newStyle[name]) {\n elemStyle[name] = newStyle[name];\n }\n }\n }\n /**\n * Collect a mapping of keyed elements for the host content.\n */\n function collectKeys(host, content) {\n var node = host.firstChild;\n var keyMap = Object.create(null);\n for (var _i = 0, content_1 = content; _i < content_1.length; _i++) {\n var vNode = content_1[_i];\n if (vNode.type === 'element' && vNode.attrs.key) {\n keyMap[vNode.attrs.key] = { vNode: vNode, element: node };\n }\n node = node.nextSibling;\n }\n return keyMap;\n }\n})(Private || (Private = {}));\n\nexports.VirtualElement = VirtualElement;\nexports.VirtualElementPass = VirtualElementPass;\nexports.VirtualText = VirtualText;\nexports.h = h;\nexports.hpass = hpass;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/virtualdom/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/boxengine.js": │ │ │ │ /*!*********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/boxengine.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/boxengine.js ***! │ │ │ │ \*********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A sizer object for use with the box engine layout functions.\n *\n * #### Notes\n * A box sizer holds the geometry information for an object along an\n * arbitrary layout orientation.\n *\n * For best performance, this class should be treated as a raw data\n * struct. It should not typically be subclassed.\n */\nvar BoxSizer = /** @class */ (function () {\n function BoxSizer() {\n /**\n * The preferred size for the sizer.\n *\n * #### Notes\n * The sizer will be given this initial size subject to its size\n * bounds. The sizer will not deviate from this size unless such\n * deviation is required to fit into the available layout space.\n *\n * There is no limit to this value, but it will be clamped to the\n * bounds defined by [[minSize]] and [[maxSize]].\n *\n * The default value is `0`.\n */\n this.sizeHint = 0;\n /**\n * The minimum size of the sizer.\n *\n * #### Notes\n * The sizer will never be sized less than this value, even if\n * it means the sizer will overflow the available layout space.\n *\n * It is assumed that this value lies in the range `[0, Infinity)`\n * and that it is `<=` to [[maxSize]]. Failure to adhere to this\n * constraint will yield undefined results.\n *\n * The default value is `0`.\n */\n this.minSize = 0;\n /**\n * The maximum size of the sizer.\n *\n * #### Notes\n * The sizer will never be sized greater than this value, even if\n * it means the sizer will underflow the available layout space.\n *\n * It is assumed that this value lies in the range `[0, Infinity]`\n * and that it is `>=` to [[minSize]]. Failure to adhere to this\n * constraint will yield undefined results.\n *\n * The default value is `Infinity`.\n */\n this.maxSize = Infinity;\n /**\n * The stretch factor for the sizer.\n *\n * #### Notes\n * This controls how much the sizer stretches relative to its sibling\n * sizers when layout space is distributed. A stretch factor of zero\n * is special and will cause the sizer to only be resized after all\n * other sizers with a stretch factor greater than zero have been\n * resized to their limits.\n *\n * It is assumed that this value is an integer that lies in the range\n * `[0, Infinity)`. Failure to adhere to this constraint will yield\n * undefined results.\n *\n * The default value is `1`.\n */\n this.stretch = 1;\n /**\n * The computed size of the sizer.\n *\n * #### Notes\n * This value is the output of a call to [[boxCalc]]. It represents\n * the computed size for the object along the layout orientation,\n * and will always lie in the range `[minSize, maxSize]`.\n *\n * This value is output only.\n *\n * Changing this value will have no effect.\n */\n this.size = 0;\n /**\n * An internal storage property for the layout algorithm.\n *\n * #### Notes\n * This value is used as temporary storage by the layout algorithm.\n *\n * Changing this value will have no effect.\n */\n this.done = false;\n }\n return BoxSizer;\n}());\n(function (BoxEngine) {\n /**\n * Calculate the optimal layout sizes for a sequence of box sizers.\n *\n * This distributes the available layout space among the box sizers\n * according to the following algorithm:\n *\n * 1. Initialize the sizers's size to its size hint and compute the\n * sums for each of size hint, min size, and max size.\n *\n * 2. If the total size hint equals the available space, return.\n *\n * 3. If the available space is less than the total min size, set all\n * sizers to their min size and return.\n *\n * 4. If the available space is greater than the total max size, set\n * all sizers to their max size and return.\n *\n * 5. If the layout space is less than the total size hint, distribute\n * the negative delta as follows:\n *\n * a. Shrink each sizer with a stretch factor greater than zero by\n * an amount proportional to the negative space and the sum of\n * stretch factors. If the sizer reaches its min size, remove\n * it and its stretch factor from the computation.\n *\n * b. If after adjusting all stretch sizers there remains negative\n * space, distribute the space equally among the sizers with a\n * stretch factor of zero. If a sizer reaches its min size,\n * remove it from the computation.\n *\n * 6. If the layout space is greater than the total size hint,\n * distribute the positive delta as follows:\n *\n * a. Expand each sizer with a stretch factor greater than zero by\n * an amount proportional to the postive space and the sum of\n * stretch factors. If the sizer reaches its max size, remove\n * it and its stretch factor from the computation.\n *\n * b. If after adjusting all stretch sizers there remains positive\n * space, distribute the space equally among the sizers with a\n * stretch factor of zero. If a sizer reaches its max size,\n * remove it from the computation.\n *\n * 7. return\n *\n * @param sizers - The sizers for a particular layout line.\n *\n * @param space - The available layout space for the sizers.\n *\n * @returns The delta between the provided available space and the\n * actual consumed space. This value will be zero if the sizers\n * can be adjusted to fit, negative if the available space is too\n * small, and positive if the available space is too large.\n *\n * #### Notes\n * The [[size]] of each sizer is updated with the computed size.\n *\n * This function can be called at any time to recompute the layout for\n * an existing sequence of sizers. The previously computed results will\n * have no effect on the new output. It is therefore not necessary to\n * create new sizer objects on each resize event.\n */\n function calc(sizers, space) {\n // Bail early if there is nothing to do.\n var count = sizers.length;\n if (count === 0) {\n return space;\n }\n // Setup the size and stretch counters.\n var totalMin = 0;\n var totalMax = 0;\n var totalSize = 0;\n var totalStretch = 0;\n var stretchCount = 0;\n // Setup the sizers and compute the totals.\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n var min = sizer.minSize;\n var max = sizer.maxSize;\n var hint = sizer.sizeHint;\n sizer.done = false;\n sizer.size = Math.max(min, Math.min(hint, max));\n totalSize += sizer.size;\n totalMin += min;\n totalMax += max;\n if (sizer.stretch > 0) {\n totalStretch += sizer.stretch;\n stretchCount++;\n }\n }\n // If the space is equal to the total size, return early.\n if (space === totalSize) {\n return 0;\n }\n // If the space is less than the total min, minimize each sizer.\n if (space <= totalMin) {\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n sizer.size = sizer.minSize;\n }\n return space - totalMin;\n }\n // If the space is greater than the total max, maximize each sizer.\n if (space >= totalMax) {\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n sizer.size = sizer.maxSize;\n }\n return space - totalMax;\n }\n // The loops below perform sub-pixel precision sizing. A near zero\n // value is used for compares instead of zero to ensure that the\n // loop terminates when the subdivided space is reasonably small.\n var nearZero = 0.01;\n // A counter which is decremented each time a sizer is resized to\n // its limit. This ensures the loops terminate even if there is\n // space remaining to distribute.\n var notDoneCount = count;\n // Distribute negative delta space.\n if (space < totalSize) {\n // Shrink each stretchable sizer by an amount proportional to its\n // stretch factor. If a sizer reaches its min size it's marked as\n // done. The loop progresses in phases where each sizer is given\n // a chance to consume its fair share for the pass, regardless of\n // whether a sizer before it reached its limit. This continues\n // until the stretchable sizers or the free space is exhausted.\n var freeSpace = totalSize - space;\n while (stretchCount > 0 && freeSpace > nearZero) {\n var distSpace = freeSpace;\n var distStretch = totalStretch;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done || sizer.stretch === 0) {\n continue;\n }\n var amt = sizer.stretch * distSpace / distStretch;\n if (sizer.size - amt <= sizer.minSize) {\n freeSpace -= sizer.size - sizer.minSize;\n totalStretch -= sizer.stretch;\n sizer.size = sizer.minSize;\n sizer.done = true;\n notDoneCount--;\n stretchCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size -= amt;\n }\n }\n }\n // Distribute any remaining space evenly among the non-stretchable\n // sizers. This progresses in phases in the same manner as above.\n while (notDoneCount > 0 && freeSpace > nearZero) {\n var amt = freeSpace / notDoneCount;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done) {\n continue;\n }\n if (sizer.size - amt <= sizer.minSize) {\n freeSpace -= sizer.size - sizer.minSize;\n sizer.size = sizer.minSize;\n sizer.done = true;\n notDoneCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size -= amt;\n }\n }\n }\n }\n // Distribute positive delta space.\n else {\n // Expand each stretchable sizer by an amount proportional to its\n // stretch factor. If a sizer reaches its max size it's marked as\n // done. The loop progresses in phases where each sizer is given\n // a chance to consume its fair share for the pass, regardless of\n // whether a sizer before it reached its limit. This continues\n // until the stretchable sizers or the free space is exhausted.\n var freeSpace = space - totalSize;\n while (stretchCount > 0 && freeSpace > nearZero) {\n var distSpace = freeSpace;\n var distStretch = totalStretch;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done || sizer.stretch === 0) {\n continue;\n }\n var amt = sizer.stretch * distSpace / distStretch;\n if (sizer.size + amt >= sizer.maxSize) {\n freeSpace -= sizer.maxSize - sizer.size;\n totalStretch -= sizer.stretch;\n sizer.size = sizer.maxSize;\n sizer.done = true;\n notDoneCount--;\n stretchCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size += amt;\n }\n }\n }\n // Distribute any remaining space evenly among the non-stretchable\n // sizers. This progresses in phases in the same manner as above.\n while (notDoneCount > 0 && freeSpace > nearZero) {\n var amt = freeSpace / notDoneCount;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done) {\n continue;\n }\n if (sizer.size + amt >= sizer.maxSize) {\n freeSpace -= sizer.maxSize - sizer.size;\n sizer.size = sizer.maxSize;\n sizer.done = true;\n notDoneCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size += amt;\n }\n }\n }\n }\n // Indicate that the consumed space equals the available space.\n return 0;\n }\n BoxEngine.calc = calc;\n /**\n * Adjust a sizer by a delta and update its neighbors accordingly.\n *\n * @param sizers - The sizers which should be adjusted.\n *\n * @param index - The index of the sizer to grow.\n *\n * @param delta - The amount to adjust the sizer, positive or negative.\n *\n * #### Notes\n * This will adjust the indicated sizer by the specified amount, along\n * with the sizes of the appropriate neighbors, subject to the limits\n * specified by each of the sizers.\n *\n * This is useful when implementing box layouts where the boundaries\n * between the sizers are interactively adjustable by the user.\n */\n function adjust(sizers, index, delta) {\n // Bail early when there is nothing to do.\n if (sizers.length === 0 || delta === 0) {\n return;\n }\n // Dispatch to the proper implementation.\n if (delta > 0) {\n growSizer(sizers, index, delta);\n }\n else {\n shrinkSizer(sizers, index, -delta);\n }\n }\n BoxEngine.adjust = adjust;\n /**\n * Grow a sizer by a positive delta and adjust neighbors.\n */\n function growSizer(sizers, index, delta) {\n // Compute how much the items to the left can expand.\n var growLimit = 0;\n for (var i = 0; i <= index; ++i) {\n var sizer = sizers[i];\n growLimit += sizer.maxSize - sizer.size;\n }\n // Compute how much the items to the right can shrink.\n var shrinkLimit = 0;\n for (var i = index + 1, n = sizers.length; i < n; ++i) {\n var sizer = sizers[i];\n shrinkLimit += sizer.size - sizer.minSize;\n }\n // Clamp the delta adjustment to the limits.\n delta = Math.min(delta, growLimit, shrinkLimit);\n // Grow the sizers to the left by the delta.\n var grow = delta;\n for (var i = index; i >= 0 && grow > 0; --i) {\n var sizer = sizers[i];\n var limit = sizer.maxSize - sizer.size;\n if (limit >= grow) {\n sizer.sizeHint = sizer.size + grow;\n grow = 0;\n }\n else {\n sizer.sizeHint = sizer.size + limit;\n grow -= limit;\n }\n }\n // Shrink the sizers to the right by the delta.\n var shrink = delta;\n for (var i = index + 1, n = sizers.length; i < n && shrink > 0; ++i) {\n var sizer = sizers[i];\n var limit = sizer.size - sizer.minSize;\n if (limit >= shrink) {\n sizer.sizeHint = sizer.size - shrink;\n shrink = 0;\n }\n else {\n sizer.sizeHint = sizer.size - limit;\n shrink -= limit;\n }\n }\n }\n /**\n * Shrink a sizer by a positive delta and adjust neighbors.\n */\n function shrinkSizer(sizers, index, delta) {\n // Compute how much the items to the right can expand.\n var growLimit = 0;\n for (var i = index + 1, n = sizers.length; i < n; ++i) {\n var sizer = sizers[i];\n growLimit += sizer.maxSize - sizer.size;\n }\n // Compute how much the items to the left can shrink.\n var shrinkLimit = 0;\n for (var i = 0; i <= index; ++i) {\n var sizer = sizers[i];\n shrinkLimit += sizer.size - sizer.minSize;\n }\n // Clamp the delta adjustment to the limits.\n delta = Math.min(delta, growLimit, shrinkLimit);\n // Grow the sizers to the right by the delta.\n var grow = delta;\n for (var i = index + 1, n = sizers.length; i < n && grow > 0; ++i) {\n var sizer = sizers[i];\n var limit = sizer.maxSize - sizer.size;\n if (limit >= grow) {\n sizer.sizeHint = sizer.size + grow;\n grow = 0;\n }\n else {\n sizer.sizeHint = sizer.size + limit;\n grow -= limit;\n }\n }\n // Shrink the sizers to the left by the delta.\n var shrink = delta;\n for (var i = index; i >= 0 && shrink > 0; --i) {\n var sizer = sizers[i];\n var limit = sizer.size - sizer.minSize;\n if (limit >= shrink) {\n sizer.sizeHint = sizer.size - shrink;\n shrink = 0;\n }\n else {\n sizer.sizeHint = sizer.size - limit;\n shrink -= limit;\n }\n }\n }\n})(exports.BoxEngine || (exports.BoxEngine = {}));\n\nexports.BoxSizer = BoxSizer;\n//# sourceMappingURL=boxengine.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/boxengine.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A sizer object for use with the box engine layout functions.\n *\n * #### Notes\n * A box sizer holds the geometry information for an object along an\n * arbitrary layout orientation.\n *\n * For best performance, this class should be treated as a raw data\n * struct. It should not typically be subclassed.\n */\nvar BoxSizer = /** @class */ (function () {\n function BoxSizer() {\n /**\n * The preferred size for the sizer.\n *\n * #### Notes\n * The sizer will be given this initial size subject to its size\n * bounds. The sizer will not deviate from this size unless such\n * deviation is required to fit into the available layout space.\n *\n * There is no limit to this value, but it will be clamped to the\n * bounds defined by [[minSize]] and [[maxSize]].\n *\n * The default value is `0`.\n */\n this.sizeHint = 0;\n /**\n * The minimum size of the sizer.\n *\n * #### Notes\n * The sizer will never be sized less than this value, even if\n * it means the sizer will overflow the available layout space.\n *\n * It is assumed that this value lies in the range `[0, Infinity)`\n * and that it is `<=` to [[maxSize]]. Failure to adhere to this\n * constraint will yield undefined results.\n *\n * The default value is `0`.\n */\n this.minSize = 0;\n /**\n * The maximum size of the sizer.\n *\n * #### Notes\n * The sizer will never be sized greater than this value, even if\n * it means the sizer will underflow the available layout space.\n *\n * It is assumed that this value lies in the range `[0, Infinity]`\n * and that it is `>=` to [[minSize]]. Failure to adhere to this\n * constraint will yield undefined results.\n *\n * The default value is `Infinity`.\n */\n this.maxSize = Infinity;\n /**\n * The stretch factor for the sizer.\n *\n * #### Notes\n * This controls how much the sizer stretches relative to its sibling\n * sizers when layout space is distributed. A stretch factor of zero\n * is special and will cause the sizer to only be resized after all\n * other sizers with a stretch factor greater than zero have been\n * resized to their limits.\n *\n * It is assumed that this value is an integer that lies in the range\n * `[0, Infinity)`. Failure to adhere to this constraint will yield\n * undefined results.\n *\n * The default value is `1`.\n */\n this.stretch = 1;\n /**\n * The computed size of the sizer.\n *\n * #### Notes\n * This value is the output of a call to [[boxCalc]]. It represents\n * the computed size for the object along the layout orientation,\n * and will always lie in the range `[minSize, maxSize]`.\n *\n * This value is output only.\n *\n * Changing this value will have no effect.\n */\n this.size = 0;\n /**\n * An internal storage property for the layout algorithm.\n *\n * #### Notes\n * This value is used as temporary storage by the layout algorithm.\n *\n * Changing this value will have no effect.\n */\n this.done = false;\n }\n return BoxSizer;\n}());\n(function (BoxEngine) {\n /**\n * Calculate the optimal layout sizes for a sequence of box sizers.\n *\n * This distributes the available layout space among the box sizers\n * according to the following algorithm:\n *\n * 1. Initialize the sizers's size to its size hint and compute the\n * sums for each of size hint, min size, and max size.\n *\n * 2. If the total size hint equals the available space, return.\n *\n * 3. If the available space is less than the total min size, set all\n * sizers to their min size and return.\n *\n * 4. If the available space is greater than the total max size, set\n * all sizers to their max size and return.\n *\n * 5. If the layout space is less than the total size hint, distribute\n * the negative delta as follows:\n *\n * a. Shrink each sizer with a stretch factor greater than zero by\n * an amount proportional to the negative space and the sum of\n * stretch factors. If the sizer reaches its min size, remove\n * it and its stretch factor from the computation.\n *\n * b. If after adjusting all stretch sizers there remains negative\n * space, distribute the space equally among the sizers with a\n * stretch factor of zero. If a sizer reaches its min size,\n * remove it from the computation.\n *\n * 6. If the layout space is greater than the total size hint,\n * distribute the positive delta as follows:\n *\n * a. Expand each sizer with a stretch factor greater than zero by\n * an amount proportional to the postive space and the sum of\n * stretch factors. If the sizer reaches its max size, remove\n * it and its stretch factor from the computation.\n *\n * b. If after adjusting all stretch sizers there remains positive\n * space, distribute the space equally among the sizers with a\n * stretch factor of zero. If a sizer reaches its max size,\n * remove it from the computation.\n *\n * 7. return\n *\n * @param sizers - The sizers for a particular layout line.\n *\n * @param space - The available layout space for the sizers.\n *\n * @returns The delta between the provided available space and the\n * actual consumed space. This value will be zero if the sizers\n * can be adjusted to fit, negative if the available space is too\n * small, and positive if the available space is too large.\n *\n * #### Notes\n * The [[size]] of each sizer is updated with the computed size.\n *\n * This function can be called at any time to recompute the layout for\n * an existing sequence of sizers. The previously computed results will\n * have no effect on the new output. It is therefore not necessary to\n * create new sizer objects on each resize event.\n */\n function calc(sizers, space) {\n // Bail early if there is nothing to do.\n var count = sizers.length;\n if (count === 0) {\n return space;\n }\n // Setup the size and stretch counters.\n var totalMin = 0;\n var totalMax = 0;\n var totalSize = 0;\n var totalStretch = 0;\n var stretchCount = 0;\n // Setup the sizers and compute the totals.\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n var min = sizer.minSize;\n var max = sizer.maxSize;\n var hint = sizer.sizeHint;\n sizer.done = false;\n sizer.size = Math.max(min, Math.min(hint, max));\n totalSize += sizer.size;\n totalMin += min;\n totalMax += max;\n if (sizer.stretch > 0) {\n totalStretch += sizer.stretch;\n stretchCount++;\n }\n }\n // If the space is equal to the total size, return early.\n if (space === totalSize) {\n return 0;\n }\n // If the space is less than the total min, minimize each sizer.\n if (space <= totalMin) {\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n sizer.size = sizer.minSize;\n }\n return space - totalMin;\n }\n // If the space is greater than the total max, maximize each sizer.\n if (space >= totalMax) {\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n sizer.size = sizer.maxSize;\n }\n return space - totalMax;\n }\n // The loops below perform sub-pixel precision sizing. A near zero\n // value is used for compares instead of zero to ensure that the\n // loop terminates when the subdivided space is reasonably small.\n var nearZero = 0.01;\n // A counter which is decremented each time a sizer is resized to\n // its limit. This ensures the loops terminate even if there is\n // space remaining to distribute.\n var notDoneCount = count;\n // Distribute negative delta space.\n if (space < totalSize) {\n // Shrink each stretchable sizer by an amount proportional to its\n // stretch factor. If a sizer reaches its min size it's marked as\n // done. The loop progresses in phases where each sizer is given\n // a chance to consume its fair share for the pass, regardless of\n // whether a sizer before it reached its limit. This continues\n // until the stretchable sizers or the free space is exhausted.\n var freeSpace = totalSize - space;\n while (stretchCount > 0 && freeSpace > nearZero) {\n var distSpace = freeSpace;\n var distStretch = totalStretch;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done || sizer.stretch === 0) {\n continue;\n }\n var amt = sizer.stretch * distSpace / distStretch;\n if (sizer.size - amt <= sizer.minSize) {\n freeSpace -= sizer.size - sizer.minSize;\n totalStretch -= sizer.stretch;\n sizer.size = sizer.minSize;\n sizer.done = true;\n notDoneCount--;\n stretchCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size -= amt;\n }\n }\n }\n // Distribute any remaining space evenly among the non-stretchable\n // sizers. This progresses in phases in the same manner as above.\n while (notDoneCount > 0 && freeSpace > nearZero) {\n var amt = freeSpace / notDoneCount;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done) {\n continue;\n }\n if (sizer.size - amt <= sizer.minSize) {\n freeSpace -= sizer.size - sizer.minSize;\n sizer.size = sizer.minSize;\n sizer.done = true;\n notDoneCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size -= amt;\n }\n }\n }\n }\n // Distribute positive delta space.\n else {\n // Expand each stretchable sizer by an amount proportional to its\n // stretch factor. If a sizer reaches its max size it's marked as\n // done. The loop progresses in phases where each sizer is given\n // a chance to consume its fair share for the pass, regardless of\n // whether a sizer before it reached its limit. This continues\n // until the stretchable sizers or the free space is exhausted.\n var freeSpace = space - totalSize;\n while (stretchCount > 0 && freeSpace > nearZero) {\n var distSpace = freeSpace;\n var distStretch = totalStretch;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done || sizer.stretch === 0) {\n continue;\n }\n var amt = sizer.stretch * distSpace / distStretch;\n if (sizer.size + amt >= sizer.maxSize) {\n freeSpace -= sizer.maxSize - sizer.size;\n totalStretch -= sizer.stretch;\n sizer.size = sizer.maxSize;\n sizer.done = true;\n notDoneCount--;\n stretchCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size += amt;\n }\n }\n }\n // Distribute any remaining space evenly among the non-stretchable\n // sizers. This progresses in phases in the same manner as above.\n while (notDoneCount > 0 && freeSpace > nearZero) {\n var amt = freeSpace / notDoneCount;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done) {\n continue;\n }\n if (sizer.size + amt >= sizer.maxSize) {\n freeSpace -= sizer.maxSize - sizer.size;\n sizer.size = sizer.maxSize;\n sizer.done = true;\n notDoneCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size += amt;\n }\n }\n }\n }\n // Indicate that the consumed space equals the available space.\n return 0;\n }\n BoxEngine.calc = calc;\n /**\n * Adjust a sizer by a delta and update its neighbors accordingly.\n *\n * @param sizers - The sizers which should be adjusted.\n *\n * @param index - The index of the sizer to grow.\n *\n * @param delta - The amount to adjust the sizer, positive or negative.\n *\n * #### Notes\n * This will adjust the indicated sizer by the specified amount, along\n * with the sizes of the appropriate neighbors, subject to the limits\n * specified by each of the sizers.\n *\n * This is useful when implementing box layouts where the boundaries\n * between the sizers are interactively adjustable by the user.\n */\n function adjust(sizers, index, delta) {\n // Bail early when there is nothing to do.\n if (sizers.length === 0 || delta === 0) {\n return;\n }\n // Dispatch to the proper implementation.\n if (delta > 0) {\n growSizer(sizers, index, delta);\n }\n else {\n shrinkSizer(sizers, index, -delta);\n }\n }\n BoxEngine.adjust = adjust;\n /**\n * Grow a sizer by a positive delta and adjust neighbors.\n */\n function growSizer(sizers, index, delta) {\n // Compute how much the items to the left can expand.\n var growLimit = 0;\n for (var i = 0; i <= index; ++i) {\n var sizer = sizers[i];\n growLimit += sizer.maxSize - sizer.size;\n }\n // Compute how much the items to the right can shrink.\n var shrinkLimit = 0;\n for (var i = index + 1, n = sizers.length; i < n; ++i) {\n var sizer = sizers[i];\n shrinkLimit += sizer.size - sizer.minSize;\n }\n // Clamp the delta adjustment to the limits.\n delta = Math.min(delta, growLimit, shrinkLimit);\n // Grow the sizers to the left by the delta.\n var grow = delta;\n for (var i = index; i >= 0 && grow > 0; --i) {\n var sizer = sizers[i];\n var limit = sizer.maxSize - sizer.size;\n if (limit >= grow) {\n sizer.sizeHint = sizer.size + grow;\n grow = 0;\n }\n else {\n sizer.sizeHint = sizer.size + limit;\n grow -= limit;\n }\n }\n // Shrink the sizers to the right by the delta.\n var shrink = delta;\n for (var i = index + 1, n = sizers.length; i < n && shrink > 0; ++i) {\n var sizer = sizers[i];\n var limit = sizer.size - sizer.minSize;\n if (limit >= shrink) {\n sizer.sizeHint = sizer.size - shrink;\n shrink = 0;\n }\n else {\n sizer.sizeHint = sizer.size - limit;\n shrink -= limit;\n }\n }\n }\n /**\n * Shrink a sizer by a positive delta and adjust neighbors.\n */\n function shrinkSizer(sizers, index, delta) {\n // Compute how much the items to the right can expand.\n var growLimit = 0;\n for (var i = index + 1, n = sizers.length; i < n; ++i) {\n var sizer = sizers[i];\n growLimit += sizer.maxSize - sizer.size;\n }\n // Compute how much the items to the left can shrink.\n var shrinkLimit = 0;\n for (var i = 0; i <= index; ++i) {\n var sizer = sizers[i];\n shrinkLimit += sizer.size - sizer.minSize;\n }\n // Clamp the delta adjustment to the limits.\n delta = Math.min(delta, growLimit, shrinkLimit);\n // Grow the sizers to the right by the delta.\n var grow = delta;\n for (var i = index + 1, n = sizers.length; i < n && grow > 0; ++i) {\n var sizer = sizers[i];\n var limit = sizer.maxSize - sizer.size;\n if (limit >= grow) {\n sizer.sizeHint = sizer.size + grow;\n grow = 0;\n }\n else {\n sizer.sizeHint = sizer.size + limit;\n grow -= limit;\n }\n }\n // Shrink the sizers to the left by the delta.\n var shrink = delta;\n for (var i = index; i >= 0 && shrink > 0; --i) {\n var sizer = sizers[i];\n var limit = sizer.size - sizer.minSize;\n if (limit >= shrink) {\n sizer.sizeHint = sizer.size - shrink;\n shrink = 0;\n }\n else {\n sizer.sizeHint = sizer.size - limit;\n shrink -= limit;\n }\n }\n }\n})(exports.BoxEngine || (exports.BoxEngine = {}));\n\nexports.BoxSizer = BoxSizer;\n//# sourceMappingURL=boxengine.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/boxengine.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/boxlayout.js": │ │ │ │ /*!*********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/boxlayout.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/boxlayout.js ***! │ │ │ │ \*********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\n\n/**\n * A layout which arranges its widgets in a single row or column.\n */\nexports.BoxLayout = /** @class */ (function (_super) {\n tslib.__extends(BoxLayout, _super);\n /**\n * Construct a new box layout.\n *\n * @param options - The options for initializing the layout.\n */\n function BoxLayout(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this._fixed = 0;\n _this._spacing = 4;\n _this._dirty = false;\n _this._sizers = [];\n _this._items = [];\n _this._box = null;\n _this._alignment = 'start';\n _this._direction = 'top-to-bottom';\n if (options.direction !== undefined) {\n _this._direction = options.direction;\n }\n if (options.alignment !== undefined) {\n _this._alignment = options.alignment;\n }\n if (options.spacing !== undefined) {\n _this._spacing = Private.clampSpacing(options.spacing);\n }\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n BoxLayout.prototype.dispose = function () {\n // Dispose of the layout items.\n algorithm.each(this._items, function (item) { item.dispose(); });\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n this._sizers.length = 0;\n // Dispose of the rest of the layout.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(BoxLayout.prototype, \"direction\", {\n /**\n * Get the layout direction for the box layout.\n */\n get: function () {\n return this._direction;\n },\n /**\n * Set the layout direction for the box layout.\n */\n set: function (value) {\n if (this._direction === value) {\n return;\n }\n this._direction = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['direction'] = value;\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BoxLayout.prototype, \"alignment\", {\n /**\n * Get the content alignment for the box layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n get: function () {\n return this._alignment;\n },\n /**\n * Set the content alignment for the box layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n set: function (value) {\n if (this._alignment === value) {\n return;\n }\n this._alignment = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['alignment'] = value;\n this.parent.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BoxLayout.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the box layout.\n */\n get: function () {\n return this._spacing;\n },\n /**\n * Set the inter-element spacing for the box layout.\n */\n set: function (value) {\n value = Private.clampSpacing(value);\n if (this._spacing === value) {\n return;\n }\n this._spacing = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Perform layout initialization which requires the parent widget.\n */\n BoxLayout.prototype.init = function () {\n this.parent.dataset['direction'] = this.direction;\n this.parent.dataset['alignment'] = this.alignment;\n _super.prototype.init.call(this);\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n BoxLayout.prototype.attachWidget = function (index, widget$1) {\n // Create and add a new layout item for the widget.\n algorithm.ArrayExt.insert(this._items, index, new layout.LayoutItem(widget$1));\n // Create and add a new sizer for the widget.\n algorithm.ArrayExt.insert(this._sizers, index, new boxengine.BoxSizer());\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n BoxLayout.prototype.moveWidget = function (fromIndex, toIndex, widget) {\n // Move the layout item for the widget.\n algorithm.ArrayExt.move(this._items, fromIndex, toIndex);\n // Move the sizer for the widget.\n algorithm.ArrayExt.move(this._sizers, fromIndex, toIndex);\n // Post an update request for the parent widget.\n this.parent.update();\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n BoxLayout.prototype.detachWidget = function (index, widget$1) {\n // Remove the layout item for the widget.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n // Remove the sizer for the widget.\n algorithm.ArrayExt.removeAt(this._sizers, index);\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Dispose of the layout item.\n item.dispose();\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n BoxLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n BoxLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n BoxLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n BoxLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n BoxLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n BoxLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n BoxLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n BoxLayout.prototype._fit = function () {\n // Compute the visible item count.\n var nVisible = 0;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Update the fixed space for the visible items.\n this._fixed = this._spacing * Math.max(0, nVisible - 1);\n // Setup the computed minimum size.\n var horz = Private.isHorizontal(this._direction);\n var minW = horz ? this._fixed : 0;\n var minH = horz ? 0 : this._fixed;\n // Update the sizers and computed minimum size.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item and corresponding box sizer.\n var item = this._items[i];\n var sizer = this._sizers[i];\n // If the item is hidden, it should consume zero size.\n if (item.isHidden) {\n sizer.minSize = 0;\n sizer.maxSize = 0;\n continue;\n }\n // Update the size limits for the item.\n item.fit();\n // Update the size basis and stretch factor.\n sizer.sizeHint = BoxLayout.getSizeBasis(item.widget);\n sizer.stretch = BoxLayout.getStretch(item.widget);\n // Update the sizer limits and computed min size.\n if (horz) {\n sizer.minSize = item.minWidth;\n sizer.maxSize = item.maxWidth;\n minW += item.minWidth;\n minH = Math.max(minH, item.minHeight);\n }\n else {\n sizer.minSize = item.minHeight;\n sizer.maxSize = item.maxHeight;\n minH += item.minHeight;\n minW = Math.max(minW, item.minWidth);\n }\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n BoxLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Compute the visible item count.\n var nVisible = 0;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Bail early if there are no visible items to layout.\n if (nVisible === 0) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the layout area adjusted for border and padding.\n var top = this._box.paddingTop;\n var left = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Distribute the layout space and adjust the start position.\n var delta;\n switch (this._direction) {\n case 'left-to-right':\n delta = boxengine.BoxEngine.calc(this._sizers, Math.max(0, width - this._fixed));\n break;\n case 'top-to-bottom':\n delta = boxengine.BoxEngine.calc(this._sizers, Math.max(0, height - this._fixed));\n break;\n case 'right-to-left':\n delta = boxengine.BoxEngine.calc(this._sizers, Math.max(0, width - this._fixed));\n left += width;\n break;\n case 'bottom-to-top':\n delta = boxengine.BoxEngine.calc(this._sizers, Math.max(0, height - this._fixed));\n top += height;\n break;\n default:\n throw 'unreachable';\n }\n // Setup the variables for justification and alignment offset.\n var extra = 0;\n var offset = 0;\n // Account for alignment if there is extra layout space.\n if (delta > 0) {\n switch (this._alignment) {\n case 'start':\n break;\n case 'center':\n extra = 0;\n offset = delta / 2;\n break;\n case 'end':\n extra = 0;\n offset = delta;\n break;\n case 'justify':\n extra = delta / nVisible;\n offset = 0;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Layout the items using the computed box sizes.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Fetch the computed size for the widget.\n var size = this._sizers[i].size;\n // Update the widget geometry and advance the relevant edge.\n switch (this._direction) {\n case 'left-to-right':\n item.update(left + offset, top, size + extra, height);\n left += size + extra + this._spacing;\n break;\n case 'top-to-bottom':\n item.update(left, top + offset, width, size + extra);\n top += size + extra + this._spacing;\n break;\n case 'right-to-left':\n item.update(left - offset - size - extra, top, size + extra, height);\n left -= size + extra + this._spacing;\n break;\n case 'bottom-to-top':\n item.update(left, top - offset - size - extra, width, size + extra);\n top -= size + extra + this._spacing;\n break;\n default:\n throw 'unreachable';\n }\n }\n };\n return BoxLayout;\n}(panellayout.PanelLayout));\n/**\n * The namespace for the `BoxLayout` class statics.\n */\n(function (BoxLayout) {\n /**\n * Get the box layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box layout stretch factor for the widget.\n */\n function getStretch(widget) {\n return Private.stretchProperty.get(widget);\n }\n BoxLayout.getStretch = getStretch;\n /**\n * Set the box layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n Private.stretchProperty.set(widget, value);\n }\n BoxLayout.setStretch = setStretch;\n /**\n * Get the box layout size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box layout size basis for the widget.\n */\n function getSizeBasis(widget) {\n return Private.sizeBasisProperty.get(widget);\n }\n BoxLayout.getSizeBasis = getSizeBasis;\n /**\n * Set the box layout size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the size basis.\n */\n function setSizeBasis(widget, value) {\n Private.sizeBasisProperty.set(widget, value);\n }\n BoxLayout.setSizeBasis = setSizeBasis;\n})(exports.BoxLayout || (exports.BoxLayout = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The property descriptor for a widget stretch factor.\n */\n Private.stretchProperty = new properties.AttachedProperty({\n name: 'stretch',\n create: function () { return 0; },\n coerce: function (owner, value) { return Math.max(0, Math.floor(value)); },\n changed: onChildSizingChanged\n });\n /**\n * The property descriptor for a widget size basis.\n */\n Private.sizeBasisProperty = new properties.AttachedProperty({\n name: 'sizeBasis',\n create: function () { return 0; },\n coerce: function (owner, value) { return Math.max(0, Math.floor(value)); },\n changed: onChildSizingChanged\n });\n /**\n * Test whether a direction has horizontal orientation.\n */\n function isHorizontal(dir) {\n return dir === 'left-to-right' || dir === 'right-to-left';\n }\n Private.isHorizontal = isHorizontal;\n /**\n * Clamp a spacing value to an integer >= 0.\n */\n function clampSpacing(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampSpacing = clampSpacing;\n /**\n * The change handler for the attached sizing properties.\n */\n function onChildSizingChanged(child) {\n if (child.parent && child.parent.layout instanceof exports.BoxLayout) {\n child.parent.fit();\n }\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=boxlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/boxlayout.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\n\n/**\n * A layout which arranges its widgets in a single row or column.\n */\nexports.BoxLayout = /** @class */ (function (_super) {\n tslib.__extends(BoxLayout, _super);\n /**\n * Construct a new box layout.\n *\n * @param options - The options for initializing the layout.\n */\n function BoxLayout(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this._fixed = 0;\n _this._spacing = 4;\n _this._dirty = false;\n _this._sizers = [];\n _this._items = [];\n _this._box = null;\n _this._alignment = 'start';\n _this._direction = 'top-to-bottom';\n if (options.direction !== undefined) {\n _this._direction = options.direction;\n }\n if (options.alignment !== undefined) {\n _this._alignment = options.alignment;\n }\n if (options.spacing !== undefined) {\n _this._spacing = Private.clampSpacing(options.spacing);\n }\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n BoxLayout.prototype.dispose = function () {\n // Dispose of the layout items.\n algorithm.each(this._items, function (item) { item.dispose(); });\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n this._sizers.length = 0;\n // Dispose of the rest of the layout.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(BoxLayout.prototype, \"direction\", {\n /**\n * Get the layout direction for the box layout.\n */\n get: function () {\n return this._direction;\n },\n /**\n * Set the layout direction for the box layout.\n */\n set: function (value) {\n if (this._direction === value) {\n return;\n }\n this._direction = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['direction'] = value;\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BoxLayout.prototype, \"alignment\", {\n /**\n * Get the content alignment for the box layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n get: function () {\n return this._alignment;\n },\n /**\n * Set the content alignment for the box layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n set: function (value) {\n if (this._alignment === value) {\n return;\n }\n this._alignment = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['alignment'] = value;\n this.parent.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BoxLayout.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the box layout.\n */\n get: function () {\n return this._spacing;\n },\n /**\n * Set the inter-element spacing for the box layout.\n */\n set: function (value) {\n value = Private.clampSpacing(value);\n if (this._spacing === value) {\n return;\n }\n this._spacing = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Perform layout initialization which requires the parent widget.\n */\n BoxLayout.prototype.init = function () {\n this.parent.dataset['direction'] = this.direction;\n this.parent.dataset['alignment'] = this.alignment;\n _super.prototype.init.call(this);\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n BoxLayout.prototype.attachWidget = function (index, widget$1) {\n // Create and add a new layout item for the widget.\n algorithm.ArrayExt.insert(this._items, index, new layout.LayoutItem(widget$1));\n // Create and add a new sizer for the widget.\n algorithm.ArrayExt.insert(this._sizers, index, new boxengine.BoxSizer());\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n BoxLayout.prototype.moveWidget = function (fromIndex, toIndex, widget) {\n // Move the layout item for the widget.\n algorithm.ArrayExt.move(this._items, fromIndex, toIndex);\n // Move the sizer for the widget.\n algorithm.ArrayExt.move(this._sizers, fromIndex, toIndex);\n // Post an update request for the parent widget.\n this.parent.update();\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n BoxLayout.prototype.detachWidget = function (index, widget$1) {\n // Remove the layout item for the widget.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n // Remove the sizer for the widget.\n algorithm.ArrayExt.removeAt(this._sizers, index);\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Dispose of the layout item.\n item.dispose();\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n BoxLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n BoxLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n BoxLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n BoxLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n BoxLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n BoxLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n BoxLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n BoxLayout.prototype._fit = function () {\n // Compute the visible item count.\n var nVisible = 0;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Update the fixed space for the visible items.\n this._fixed = this._spacing * Math.max(0, nVisible - 1);\n // Setup the computed minimum size.\n var horz = Private.isHorizontal(this._direction);\n var minW = horz ? this._fixed : 0;\n var minH = horz ? 0 : this._fixed;\n // Update the sizers and computed minimum size.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item and corresponding box sizer.\n var item = this._items[i];\n var sizer = this._sizers[i];\n // If the item is hidden, it should consume zero size.\n if (item.isHidden) {\n sizer.minSize = 0;\n sizer.maxSize = 0;\n continue;\n }\n // Update the size limits for the item.\n item.fit();\n // Update the size basis and stretch factor.\n sizer.sizeHint = BoxLayout.getSizeBasis(item.widget);\n sizer.stretch = BoxLayout.getStretch(item.widget);\n // Update the sizer limits and computed min size.\n if (horz) {\n sizer.minSize = item.minWidth;\n sizer.maxSize = item.maxWidth;\n minW += item.minWidth;\n minH = Math.max(minH, item.minHeight);\n }\n else {\n sizer.minSize = item.minHeight;\n sizer.maxSize = item.maxHeight;\n minH += item.minHeight;\n minW = Math.max(minW, item.minWidth);\n }\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n BoxLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Compute the visible item count.\n var nVisible = 0;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Bail early if there are no visible items to layout.\n if (nVisible === 0) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the layout area adjusted for border and padding.\n var top = this._box.paddingTop;\n var left = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Distribute the layout space and adjust the start position.\n var delta;\n switch (this._direction) {\n case 'left-to-right':\n delta = boxengine.BoxEngine.calc(this._sizers, Math.max(0, width - this._fixed));\n break;\n case 'top-to-bottom':\n delta = boxengine.BoxEngine.calc(this._sizers, Math.max(0, height - this._fixed));\n break;\n case 'right-to-left':\n delta = boxengine.BoxEngine.calc(this._sizers, Math.max(0, width - this._fixed));\n left += width;\n break;\n case 'bottom-to-top':\n delta = boxengine.BoxEngine.calc(this._sizers, Math.max(0, height - this._fixed));\n top += height;\n break;\n default:\n throw 'unreachable';\n }\n // Setup the variables for justification and alignment offset.\n var extra = 0;\n var offset = 0;\n // Account for alignment if there is extra layout space.\n if (delta > 0) {\n switch (this._alignment) {\n case 'start':\n break;\n case 'center':\n extra = 0;\n offset = delta / 2;\n break;\n case 'end':\n extra = 0;\n offset = delta;\n break;\n case 'justify':\n extra = delta / nVisible;\n offset = 0;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Layout the items using the computed box sizes.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Fetch the computed size for the widget.\n var size = this._sizers[i].size;\n // Update the widget geometry and advance the relevant edge.\n switch (this._direction) {\n case 'left-to-right':\n item.update(left + offset, top, size + extra, height);\n left += size + extra + this._spacing;\n break;\n case 'top-to-bottom':\n item.update(left, top + offset, width, size + extra);\n top += size + extra + this._spacing;\n break;\n case 'right-to-left':\n item.update(left - offset - size - extra, top, size + extra, height);\n left -= size + extra + this._spacing;\n break;\n case 'bottom-to-top':\n item.update(left, top - offset - size - extra, width, size + extra);\n top -= size + extra + this._spacing;\n break;\n default:\n throw 'unreachable';\n }\n }\n };\n return BoxLayout;\n}(panellayout.PanelLayout));\n/**\n * The namespace for the `BoxLayout` class statics.\n */\n(function (BoxLayout) {\n /**\n * Get the box layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box layout stretch factor for the widget.\n */\n function getStretch(widget) {\n return Private.stretchProperty.get(widget);\n }\n BoxLayout.getStretch = getStretch;\n /**\n * Set the box layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n Private.stretchProperty.set(widget, value);\n }\n BoxLayout.setStretch = setStretch;\n /**\n * Get the box layout size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box layout size basis for the widget.\n */\n function getSizeBasis(widget) {\n return Private.sizeBasisProperty.get(widget);\n }\n BoxLayout.getSizeBasis = getSizeBasis;\n /**\n * Set the box layout size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the size basis.\n */\n function setSizeBasis(widget, value) {\n Private.sizeBasisProperty.set(widget, value);\n }\n BoxLayout.setSizeBasis = setSizeBasis;\n})(exports.BoxLayout || (exports.BoxLayout = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The property descriptor for a widget stretch factor.\n */\n Private.stretchProperty = new properties.AttachedProperty({\n name: 'stretch',\n create: function () { return 0; },\n coerce: function (owner, value) { return Math.max(0, Math.floor(value)); },\n changed: onChildSizingChanged\n });\n /**\n * The property descriptor for a widget size basis.\n */\n Private.sizeBasisProperty = new properties.AttachedProperty({\n name: 'sizeBasis',\n create: function () { return 0; },\n coerce: function (owner, value) { return Math.max(0, Math.floor(value)); },\n changed: onChildSizingChanged\n });\n /**\n * Test whether a direction has horizontal orientation.\n */\n function isHorizontal(dir) {\n return dir === 'left-to-right' || dir === 'right-to-left';\n }\n Private.isHorizontal = isHorizontal;\n /**\n * Clamp a spacing value to an integer >= 0.\n */\n function clampSpacing(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampSpacing = clampSpacing;\n /**\n * The change handler for the attached sizing properties.\n */\n function onChildSizingChanged(child) {\n if (child.parent && child.parent.layout instanceof exports.BoxLayout) {\n child.parent.fit();\n }\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=boxlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/boxlayout.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/boxpanel.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/boxpanel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/boxpanel.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n__webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n__webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar boxlayout = __webpack_require__(/*! ./boxlayout.js */ \"../../packages/widgets/dist/boxlayout.js\");\nvar panel = __webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\n\n/**\n * A panel which arranges its widgets in a single row or column.\n *\n * #### Notes\n * This class provides a convenience wrapper around a [[BoxLayout]].\n */\nexports.BoxPanel = /** @class */ (function (_super) {\n tslib.__extends(BoxPanel, _super);\n /**\n * Construct a new box panel.\n *\n * @param options - The options for initializing the box panel.\n */\n function BoxPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { layout: Private.createLayout(options) }) || this;\n _this.addClass('lm-BoxPanel');\n /* */\n _this.addClass('p-BoxPanel');\n return _this;\n /* */\n }\n Object.defineProperty(BoxPanel.prototype, \"direction\", {\n /**\n * Get the layout direction for the box panel.\n */\n get: function () {\n return this.layout.direction;\n },\n /**\n * Set the layout direction for the box panel.\n */\n set: function (value) {\n this.layout.direction = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BoxPanel.prototype, \"alignment\", {\n /**\n * Get the content alignment for the box panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n get: function () {\n return this.layout.alignment;\n },\n /**\n * Set the content alignment for the box panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n set: function (value) {\n this.layout.alignment = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BoxPanel.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the box panel.\n */\n get: function () {\n return this.layout.spacing;\n },\n /**\n * Set the inter-element spacing for the box panel.\n */\n set: function (value) {\n this.layout.spacing = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n BoxPanel.prototype.onChildAdded = function (msg) {\n msg.child.addClass('lm-BoxPanel-child');\n /* */\n msg.child.addClass('p-BoxPanel-child');\n /* */\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n BoxPanel.prototype.onChildRemoved = function (msg) {\n msg.child.removeClass('lm-BoxPanel-child');\n /* */\n msg.child.removeClass('p-BoxPanel-child');\n /* */\n };\n return BoxPanel;\n}(panel.Panel));\n/**\n * The namespace for the `BoxPanel` class statics.\n */\n(function (BoxPanel) {\n /**\n * Get the box panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box panel stretch factor for the widget.\n */\n function getStretch(widget) {\n return boxlayout.BoxLayout.getStretch(widget);\n }\n BoxPanel.getStretch = getStretch;\n /**\n * Set the box panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n boxlayout.BoxLayout.setStretch(widget, value);\n }\n BoxPanel.setStretch = setStretch;\n /**\n * Get the box panel size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box panel size basis for the widget.\n */\n function getSizeBasis(widget) {\n return boxlayout.BoxLayout.getSizeBasis(widget);\n }\n BoxPanel.getSizeBasis = getSizeBasis;\n /**\n * Set the box panel size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the size basis.\n */\n function setSizeBasis(widget, value) {\n boxlayout.BoxLayout.setSizeBasis(widget, value);\n }\n BoxPanel.setSizeBasis = setSizeBasis;\n})(exports.BoxPanel || (exports.BoxPanel = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a box layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new boxlayout.BoxLayout(options);\n }\n Private.createLayout = createLayout;\n})(Private || (Private = {}));\n//# sourceMappingURL=boxpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/boxpanel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n__webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n__webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar boxlayout = __webpack_require__(/*! ./boxlayout.js */ \"../../packages/widgets/dist/boxlayout.js\");\nvar panel = __webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\n\n/**\n * A panel which arranges its widgets in a single row or column.\n *\n * #### Notes\n * This class provides a convenience wrapper around a [[BoxLayout]].\n */\nexports.BoxPanel = /** @class */ (function (_super) {\n tslib.__extends(BoxPanel, _super);\n /**\n * Construct a new box panel.\n *\n * @param options - The options for initializing the box panel.\n */\n function BoxPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { layout: Private.createLayout(options) }) || this;\n _this.addClass('lm-BoxPanel');\n /* */\n _this.addClass('p-BoxPanel');\n return _this;\n /* */\n }\n Object.defineProperty(BoxPanel.prototype, \"direction\", {\n /**\n * Get the layout direction for the box panel.\n */\n get: function () {\n return this.layout.direction;\n },\n /**\n * Set the layout direction for the box panel.\n */\n set: function (value) {\n this.layout.direction = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BoxPanel.prototype, \"alignment\", {\n /**\n * Get the content alignment for the box panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n get: function () {\n return this.layout.alignment;\n },\n /**\n * Set the content alignment for the box panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire box layout.\n */\n set: function (value) {\n this.layout.alignment = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BoxPanel.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the box panel.\n */\n get: function () {\n return this.layout.spacing;\n },\n /**\n * Set the inter-element spacing for the box panel.\n */\n set: function (value) {\n this.layout.spacing = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n BoxPanel.prototype.onChildAdded = function (msg) {\n msg.child.addClass('lm-BoxPanel-child');\n /* */\n msg.child.addClass('p-BoxPanel-child');\n /* */\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n BoxPanel.prototype.onChildRemoved = function (msg) {\n msg.child.removeClass('lm-BoxPanel-child');\n /* */\n msg.child.removeClass('p-BoxPanel-child');\n /* */\n };\n return BoxPanel;\n}(panel.Panel));\n/**\n * The namespace for the `BoxPanel` class statics.\n */\n(function (BoxPanel) {\n /**\n * Get the box panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box panel stretch factor for the widget.\n */\n function getStretch(widget) {\n return boxlayout.BoxLayout.getStretch(widget);\n }\n BoxPanel.getStretch = getStretch;\n /**\n * Set the box panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n boxlayout.BoxLayout.setStretch(widget, value);\n }\n BoxPanel.setStretch = setStretch;\n /**\n * Get the box panel size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The box panel size basis for the widget.\n */\n function getSizeBasis(widget) {\n return boxlayout.BoxLayout.getSizeBasis(widget);\n }\n BoxPanel.getSizeBasis = getSizeBasis;\n /**\n * Set the box panel size basis for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the size basis.\n */\n function setSizeBasis(widget, value) {\n boxlayout.BoxLayout.setSizeBasis(widget, value);\n }\n BoxPanel.setSizeBasis = setSizeBasis;\n})(exports.BoxPanel || (exports.BoxPanel = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a box layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new boxlayout.BoxLayout(options);\n }\n Private.createLayout = createLayout;\n})(Private || (Private = {}));\n//# sourceMappingURL=boxpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/boxpanel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/commandpalette.js": │ │ │ │ /*!**************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/commandpalette.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/commandpalette.js ***! │ │ │ │ \**************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar coreutils = __webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\nvar commands = __webpack_require__(/*! @lumino/commands */ \"../../packages/commands/dist/index.js\");\nvar virtualdom = __webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\n\n/**\n * A widget which displays command items as a searchable palette.\n */\nexports.CommandPalette = /** @class */ (function (_super) {\n tslib.__extends(CommandPalette, _super);\n /**\n * Construct a new command palette.\n *\n * @param options - The options for initializing the palette.\n */\n function CommandPalette(options) {\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._activeIndex = -1;\n _this._items = [];\n _this._results = null;\n _this.addClass('lm-CommandPalette');\n /* */\n _this.addClass('p-CommandPalette');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n _this.commands = options.commands;\n _this.renderer = options.renderer || CommandPalette.defaultRenderer;\n _this.commands.commandChanged.connect(_this._onGenericChange, _this);\n _this.commands.keyBindingChanged.connect(_this._onGenericChange, _this);\n return _this;\n }\n /**\n * Dispose of the resources held by the widget.\n */\n CommandPalette.prototype.dispose = function () {\n this._items.length = 0;\n this._results = null;\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(CommandPalette.prototype, \"searchNode\", {\n /**\n * The command palette search node.\n *\n * #### Notes\n * This is the node which contains the search-related elements.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-CommandPalette-search')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandPalette.prototype, \"inputNode\", {\n /**\n * The command palette input node.\n *\n * #### Notes\n * This is the actual input node for the search area.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-CommandPalette-input')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandPalette.prototype, \"contentNode\", {\n /**\n * The command palette content node.\n *\n * #### Notes\n * This is the node which holds the command item nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-CommandPalette-content')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandPalette.prototype, \"items\", {\n /**\n * A read-only array of the command items in the palette.\n */\n get: function () {\n return this._items;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add a command item to the command palette.\n *\n * @param options - The options for creating the command item.\n *\n * @returns The command item added to the palette.\n */\n CommandPalette.prototype.addItem = function (options) {\n // Create a new command item for the options.\n var item = Private.createItem(this.commands, options);\n // Add the item to the array.\n this._items.push(item);\n // Refresh the search results.\n this.refresh();\n // Return the item added to the palette.\n return item;\n };\n /**\n * Remove an item from the command palette.\n *\n * @param item - The item to remove from the palette.\n *\n * #### Notes\n * This is a no-op if the item is not in the palette.\n */\n CommandPalette.prototype.removeItem = function (item) {\n this.removeItemAt(this._items.indexOf(item));\n };\n /**\n * Remove the item at a given index from the command palette.\n *\n * @param index - The index of the item to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n CommandPalette.prototype.removeItemAt = function (index) {\n // Remove the item from the array.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n // Bail if the index is out of range.\n if (!item) {\n return;\n }\n // Refresh the search results.\n this.refresh();\n };\n /**\n * Remove all items from the command palette.\n */\n CommandPalette.prototype.clearItems = function () {\n // Bail if there is nothing to remove.\n if (this._items.length === 0) {\n return;\n }\n // Clear the array of items.\n this._items.length = 0;\n // Refresh the search results.\n this.refresh();\n };\n /**\n * Clear the search results and schedule an update.\n *\n * #### Notes\n * This should be called whenever the search results of the palette\n * should be updated.\n *\n * This is typically called automatically by the palette as needed,\n * but can be called manually if the input text is programatically\n * changed.\n *\n * The rendered results are updated asynchronously.\n */\n CommandPalette.prototype.refresh = function () {\n this._results = null;\n if (this.inputNode.value !== '') {\n var clear = this.node.getElementsByClassName('lm-close-icon')[0];\n clear.style.display = 'inherit';\n }\n else {\n var clear = this.node.getElementsByClassName('lm-close-icon')[0];\n clear.style.display = 'none';\n }\n this.update();\n };\n /**\n * Handle the DOM events for the command palette.\n *\n * @param event - The DOM event sent to the command palette.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the command palette's DOM node.\n * It should not be called directly by user code.\n */\n CommandPalette.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'click':\n this._evtClick(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'input':\n this.refresh();\n break;\n case 'focus':\n case 'blur':\n this._toggleFocused();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n CommandPalette.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('click', this);\n this.node.addEventListener('keydown', this);\n this.node.addEventListener('input', this);\n this.node.addEventListener('focus', this, true);\n this.node.addEventListener('blur', this, true);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n CommandPalette.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('click', this);\n this.node.removeEventListener('keydown', this);\n this.node.removeEventListener('input', this);\n this.node.removeEventListener('focus', this, true);\n this.node.removeEventListener('blur', this, true);\n };\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n CommandPalette.prototype.onActivateRequest = function (msg) {\n if (this.isAttached) {\n var input = this.inputNode;\n input.focus();\n input.select();\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n CommandPalette.prototype.onUpdateRequest = function (msg) {\n // Fetch the current query text and content node.\n var query = this.inputNode.value;\n var contentNode = this.contentNode;\n // Ensure the search results are generated.\n var results = this._results;\n if (!results) {\n // Generate and store the new search results.\n results = this._results = Private.search(this._items, query);\n // Reset the active index.\n this._activeIndex = (query ? algorithm.ArrayExt.findFirstIndex(results, Private.canActivate) : -1);\n }\n // If there is no query and no results, clear the content.\n if (!query && results.length === 0) {\n virtualdom.VirtualDOM.render(null, contentNode);\n return;\n }\n // If the is a query but no results, render the empty message.\n if (query && results.length === 0) {\n var content_1 = this.renderer.renderEmptyMessage({ query: query });\n virtualdom.VirtualDOM.render(content_1, contentNode);\n return;\n }\n // Create the render content for the search results.\n var renderer = this.renderer;\n var activeIndex = this._activeIndex;\n var content = new Array(results.length);\n for (var i = 0, n = results.length; i < n; ++i) {\n var result = results[i];\n if (result.type === 'header') {\n var indices = result.indices;\n var category = result.category;\n content[i] = renderer.renderHeader({ category: category, indices: indices });\n }\n else {\n var item = result.item;\n var indices = result.indices;\n var active = i === activeIndex;\n content[i] = renderer.renderItem({ item: item, indices: indices, active: active });\n }\n }\n // Render the search result content.\n virtualdom.VirtualDOM.render(content, contentNode);\n // Adjust the scroll position as needed.\n if (activeIndex < 0 || activeIndex >= results.length) {\n contentNode.scrollTop = 0;\n }\n else {\n var element = contentNode.children[activeIndex];\n domutils.ElementExt.scrollIntoViewIfNeeded(contentNode, element);\n }\n };\n /**\n * Handle the `'click'` event for the command palette.\n */\n CommandPalette.prototype._evtClick = function (event) {\n // Bail if the click is not the left button.\n if (event.button !== 0) {\n return;\n }\n // Clear input if the target is clear button\n if (event.target.classList.contains(\"lm-close-icon\")) {\n this.inputNode.value = '';\n this.refresh();\n return;\n }\n // Find the index of the item which was clicked.\n var index = algorithm.ArrayExt.findFirstIndex(this.contentNode.children, function (node) {\n return node.contains(event.target);\n });\n // Bail if the click was not on an item.\n if (index === -1) {\n return;\n }\n // Kill the event when a content item is clicked.\n event.preventDefault();\n event.stopPropagation();\n // Execute the item if possible.\n this._execute(index);\n };\n /**\n * Handle the `'keydown'` event for the command palette.\n */\n CommandPalette.prototype._evtKeyDown = function (event) {\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {\n return;\n }\n switch (event.keyCode) {\n case 13: // Enter\n event.preventDefault();\n event.stopPropagation();\n this._execute(this._activeIndex);\n break;\n case 38: // Up Arrow\n event.preventDefault();\n event.stopPropagation();\n this._activatePreviousItem();\n break;\n case 40: // Down Arrow\n event.preventDefault();\n event.stopPropagation();\n this._activateNextItem();\n break;\n }\n };\n /**\n * Activate the next enabled command item.\n */\n CommandPalette.prototype._activateNextItem = function () {\n // Bail if there are no search results.\n if (!this._results || this._results.length === 0) {\n return;\n }\n // Find the next enabled item index.\n var ai = this._activeIndex;\n var n = this._results.length;\n var start = ai < n - 1 ? ai + 1 : 0;\n var stop = start === 0 ? n - 1 : start - 1;\n this._activeIndex = algorithm.ArrayExt.findFirstIndex(this._results, Private.canActivate, start, stop);\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Activate the previous enabled command item.\n */\n CommandPalette.prototype._activatePreviousItem = function () {\n // Bail if there are no search results.\n if (!this._results || this._results.length === 0) {\n return;\n }\n // Find the previous enabled item index.\n var ai = this._activeIndex;\n var n = this._results.length;\n var start = ai <= 0 ? n - 1 : ai - 1;\n var stop = start === n - 1 ? 0 : start + 1;\n this._activeIndex = algorithm.ArrayExt.findLastIndex(this._results, Private.canActivate, start, stop);\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Execute the command item at the given index, if possible.\n */\n CommandPalette.prototype._execute = function (index) {\n // Bail if there are no search results.\n if (!this._results) {\n return;\n }\n // Bail if the index is out of range.\n var part = this._results[index];\n if (!part) {\n return;\n }\n // Update the search text if the item is a header.\n if (part.type === 'header') {\n var input = this.inputNode;\n input.value = part.category.toLowerCase() + \" \";\n input.focus();\n this.refresh();\n return;\n }\n // Bail if item is not enabled.\n if (!part.item.isEnabled) {\n return;\n }\n // Execute the item.\n this.commands.execute(part.item.command, part.item.args);\n // Clear the query text.\n this.inputNode.value = '';\n // Refresh the search results.\n this.refresh();\n };\n /**\n * Toggle the focused modifier based on the input node focus state.\n */\n CommandPalette.prototype._toggleFocused = function () {\n var focused = document.activeElement === this.inputNode;\n this.toggleClass('lm-mod-focused', focused);\n /* */\n this.toggleClass('p-mod-focused', focused);\n /* */\n };\n /**\n * A signal handler for generic command changes.\n */\n CommandPalette.prototype._onGenericChange = function () {\n this.refresh();\n };\n return CommandPalette;\n}(widget.Widget));\n/**\n * The namespace for the `CommandPalette` class statics.\n */\n(function (CommandPalette) {\n /**\n * The default implementation of `IRenderer`.\n */\n var Renderer = /** @class */ (function () {\n function Renderer() {\n }\n /**\n * Render the virtual element for a command palette header.\n *\n * @param data - The data to use for rendering the header.\n *\n * @returns A virtual element representing the header.\n */\n Renderer.prototype.renderHeader = function (data) {\n var content = this.formatHeader(data);\n return virtualdom.h.li({ className: 'lm-CommandPalette-header'\n /* */\n + ' p-CommandPalette-header'\n /* */\n }, content);\n };\n /**\n * Render the virtual element for a command palette item.\n *\n * @param data - The data to use for rendering the item.\n *\n * @returns A virtual element representing the item.\n */\n Renderer.prototype.renderItem = function (data) {\n var className = this.createItemClass(data);\n var dataset = this.createItemDataset(data);\n return (virtualdom.h.li({ className: className, dataset: dataset }, this.renderItemIcon(data), this.renderItemContent(data), this.renderItemShortcut(data)));\n };\n /**\n * Render the empty results message for a command palette.\n *\n * @param data - The data to use for rendering the message.\n *\n * @returns A virtual element representing the message.\n */\n Renderer.prototype.renderEmptyMessage = function (data) {\n var content = this.formatEmptyMessage(data);\n return virtualdom.h.li({\n className: 'lm-CommandPalette-emptyMessage'\n /* */\n + ' p-CommandPalette-emptyMessage'\n /* */\n }, content);\n };\n /**\n * Render the icon for a command palette item.\n *\n * @param data - The data to use for rendering the icon.\n *\n * @returns A virtual element representing the icon.\n */\n Renderer.prototype.renderItemIcon = function (data) {\n var className = this.createIconClass(data);\n /* */\n if (typeof data.item.icon === 'string') {\n return virtualdom.h.div({ className: className }, data.item.iconLabel);\n }\n /* */\n // if data.item.icon is undefined, it will be ignored\n return virtualdom.h.div({ className: className }, data.item.icon, data.item.iconLabel);\n };\n /**\n * Render the content for a command palette item.\n *\n * @param data - The data to use for rendering the content.\n *\n * @returns A virtual element representing the content.\n */\n Renderer.prototype.renderItemContent = function (data) {\n return (virtualdom.h.div({\n className: 'lm-CommandPalette-itemContent'\n /* */\n + ' p-CommandPalette-itemContent'\n /* */\n }, this.renderItemLabel(data), this.renderItemCaption(data)));\n };\n /**\n * Render the label for a command palette item.\n *\n * @param data - The data to use for rendering the label.\n *\n * @returns A virtual element representing the label.\n */\n Renderer.prototype.renderItemLabel = function (data) {\n var content = this.formatItemLabel(data);\n return virtualdom.h.div({\n className: 'lm-CommandPalette-itemLabel'\n /* */\n + ' p-CommandPalette-itemLabel'\n /* */\n }, content);\n };\n /**\n * Render the caption for a command palette item.\n *\n * @param data - The data to use for rendering the caption.\n *\n * @returns A virtual element representing the caption.\n */\n Renderer.prototype.renderItemCaption = function (data) {\n var content = this.formatItemCaption(data);\n return virtualdom.h.div({\n className: 'lm-CommandPalette-itemCaption'\n /* */\n + ' p-CommandPalette-itemCaption'\n /* */\n }, content);\n };\n /**\n * Render the shortcut for a command palette item.\n *\n * @param data - The data to use for rendering the shortcut.\n *\n * @returns A virtual element representing the shortcut.\n */\n Renderer.prototype.renderItemShortcut = function (data) {\n var content = this.formatItemShortcut(data);\n return virtualdom.h.div({\n className: 'lm-CommandPalette-itemShortcut'\n /* */\n + ' p-CommandPalette-itemShortcut'\n /* */\n }, content);\n };\n /**\n * Create the class name for the command palette item.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the command palette item.\n */\n Renderer.prototype.createItemClass = function (data) {\n // Set up the initial class name.\n var name = 'lm-CommandPalette-item';\n /* */\n name += ' p-CommandPalette-item';\n /* */\n // Add the boolean state classes.\n if (!data.item.isEnabled) {\n name += ' lm-mod-disabled';\n /* */\n name += ' p-mod-disabled';\n /* */\n }\n if (data.item.isToggled) {\n name += ' lm-mod-toggled';\n /* */\n name += ' p-mod-toggled';\n /* */\n }\n if (data.active) {\n name += ' lm-mod-active';\n /* */\n name += ' p-mod-active';\n /* */\n }\n // Add the extra class.\n var extra = data.item.className;\n if (extra) {\n name += \" \" + extra;\n }\n // Return the complete class name.\n return name;\n };\n /**\n * Create the dataset for the command palette item.\n *\n * @param data - The data to use for creating the dataset.\n *\n * @returns The dataset for the command palette item.\n */\n Renderer.prototype.createItemDataset = function (data) {\n return tslib.__assign(tslib.__assign({}, data.item.dataset), { command: data.item.command });\n };\n /**\n * Create the class name for the command item icon.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the item icon.\n */\n Renderer.prototype.createIconClass = function (data) {\n var name = 'lm-CommandPalette-itemIcon';\n /* */\n name += ' p-CommandPalette-itemIcon';\n /* */\n var extra = data.item.iconClass;\n return extra ? name + \" \" + extra : name;\n };\n /**\n * Create the render content for the header node.\n *\n * @param data - The data to use for the header content.\n *\n * @returns The content to add to the header node.\n */\n Renderer.prototype.formatHeader = function (data) {\n if (!data.indices || data.indices.length === 0) {\n return data.category;\n }\n return algorithm.StringExt.highlight(data.category, data.indices, virtualdom.h.mark);\n };\n /**\n * Create the render content for the empty message node.\n *\n * @param data - The data to use for the empty message content.\n *\n * @returns The content to add to the empty message node.\n */\n Renderer.prototype.formatEmptyMessage = function (data) {\n return \"No commands found that match '\" + data.query + \"'\";\n };\n /**\n * Create the render content for the item shortcut node.\n *\n * @param data - The data to use for the shortcut content.\n *\n * @returns The content to add to the shortcut node.\n */\n Renderer.prototype.formatItemShortcut = function (data) {\n var kb = data.item.keyBinding;\n return kb ? kb.keys.map(commands.CommandRegistry.formatKeystroke).join(', ') : null;\n };\n /**\n * Create the render content for the item label node.\n *\n * @param data - The data to use for the label content.\n *\n * @returns The content to add to the label node.\n */\n Renderer.prototype.formatItemLabel = function (data) {\n if (!data.indices || data.indices.length === 0) {\n return data.item.label;\n }\n return algorithm.StringExt.highlight(data.item.label, data.indices, virtualdom.h.mark);\n };\n /**\n * Create the render content for the item caption node.\n *\n * @param data - The data to use for the caption content.\n *\n * @returns The content to add to the caption node.\n */\n Renderer.prototype.formatItemCaption = function (data) {\n return data.item.caption;\n };\n return Renderer;\n }());\n CommandPalette.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n CommandPalette.defaultRenderer = new Renderer();\n})(exports.CommandPalette || (exports.CommandPalette = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create the DOM node for a command palette.\n */\n function createNode() {\n var node = document.createElement('div');\n var search = document.createElement('div');\n var wrapper = document.createElement('div');\n var input = document.createElement('input');\n var content = document.createElement('ul');\n var clear = document.createElement('button');\n search.className = 'lm-CommandPalette-search';\n wrapper.className = 'lm-CommandPalette-wrapper';\n input.className = 'lm-CommandPalette-input';\n clear.className = 'lm-close-icon';\n content.className = 'lm-CommandPalette-content';\n /* */\n search.classList.add('p-CommandPalette-search');\n wrapper.classList.add('p-CommandPalette-wrapper');\n input.classList.add('p-CommandPalette-input');\n content.classList.add('p-CommandPalette-content');\n /* */\n input.spellcheck = false;\n wrapper.appendChild(input);\n wrapper.appendChild(clear);\n search.appendChild(wrapper);\n node.appendChild(search);\n node.appendChild(content);\n return node;\n }\n Private.createNode = createNode;\n /**\n * Create a new command item from a command registry and options.\n */\n function createItem(commands, options) {\n return new CommandItem(commands, options);\n }\n Private.createItem = createItem;\n /**\n * Search an array of command items for fuzzy matches.\n */\n function search(items, query) {\n // Fuzzy match the items for the query.\n var scores = matchItems(items, query);\n // Sort the items based on their score.\n scores.sort(scoreCmp);\n // Create the results for the search.\n return createResults(scores);\n }\n Private.search = search;\n /**\n * Test whether a result item can be activated.\n */\n function canActivate(result) {\n return result.type === 'item' && result.item.isEnabled;\n }\n Private.canActivate = canActivate;\n /**\n * Normalize a category for a command item.\n */\n function normalizeCategory(category) {\n return category.trim().replace(/\\s+/g, ' ');\n }\n /**\n * Normalize the query text for a fuzzy search.\n */\n function normalizeQuery(text) {\n return text.replace(/\\s+/g, '').toLowerCase();\n }\n /**\n * Perform a fuzzy match on an array of command items.\n */\n function matchItems(items, query) {\n // Normalize the query text to lower case with no whitespace.\n query = normalizeQuery(query);\n // Create the array to hold the scores.\n var scores = [];\n // Iterate over the items and match against the query.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Ignore items which are not visible.\n var item = items[i];\n if (!item.isVisible) {\n continue;\n }\n // If the query is empty, all items are matched by default.\n if (!query) {\n scores.push({\n matchType: 3 /* Default */,\n categoryIndices: null,\n labelIndices: null,\n score: 0,\n item: item\n });\n continue;\n }\n // Run the fuzzy search for the item and query.\n var score = fuzzySearch(item, query);\n // Ignore the item if it is not a match.\n if (!score) {\n continue;\n }\n // Penalize disabled items.\n // TODO - push disabled items all the way down in sort cmp?\n if (!item.isEnabled) {\n score.score += 1000;\n }\n // Add the score to the results.\n scores.push(score);\n }\n // Return the final array of scores.\n return scores;\n }\n /**\n * Perform a fuzzy search on a single command item.\n */\n function fuzzySearch(item, query) {\n // Create the source text to be searched.\n var category = item.category.toLowerCase();\n var label = item.label.toLowerCase();\n var source = category + \" \" + label;\n // Set up the match score and indices array.\n var score = Infinity;\n var indices = null;\n // The regex for search word boundaries\n var rgx = /\\b\\w/g;\n // Search the source by word boundary.\n while (true) {\n // Find the next word boundary in the source.\n var rgxMatch = rgx.exec(source);\n // Break if there is no more source context.\n if (!rgxMatch) {\n break;\n }\n // Run the string match on the relevant substring.\n var match = algorithm.StringExt.matchSumOfDeltas(source, query, rgxMatch.index);\n // Break if there is no match.\n if (!match) {\n break;\n }\n // Update the match if the score is better.\n if (match && match.score <= score) {\n score = match.score;\n indices = match.indices;\n }\n }\n // Bail if there was no match.\n if (!indices || score === Infinity) {\n return null;\n }\n // Compute the pivot index between category and label text.\n var pivot = category.length + 1;\n // Find the slice index to separate matched indices.\n var j = algorithm.ArrayExt.lowerBound(indices, pivot, function (a, b) { return a - b; });\n // Extract the matched category and label indices.\n var categoryIndices = indices.slice(0, j);\n var labelIndices = indices.slice(j);\n // Adjust the label indices for the pivot offset.\n for (var i = 0, n = labelIndices.length; i < n; ++i) {\n labelIndices[i] -= pivot;\n }\n // Handle a pure label match.\n if (categoryIndices.length === 0) {\n return {\n matchType: 0 /* Label */,\n categoryIndices: null,\n labelIndices: labelIndices,\n score: score, item: item\n };\n }\n // Handle a pure category match.\n if (labelIndices.length === 0) {\n return {\n matchType: 1 /* Category */,\n categoryIndices: categoryIndices,\n labelIndices: null,\n score: score, item: item\n };\n }\n // Handle a split match.\n return {\n matchType: 2 /* Split */,\n categoryIndices: categoryIndices,\n labelIndices: labelIndices,\n score: score, item: item\n };\n }\n /**\n * A sort comparison function for a match score.\n */\n function scoreCmp(a, b) {\n // First compare based on the match type\n var m1 = a.matchType - b.matchType;\n if (m1 !== 0) {\n return m1;\n }\n // Otherwise, compare based on the match score.\n var d1 = a.score - b.score;\n if (d1 !== 0) {\n return d1;\n }\n // Find the match index based on the match type.\n var i1 = 0;\n var i2 = 0;\n switch (a.matchType) {\n case 0 /* Label */:\n i1 = a.labelIndices[0];\n i2 = b.labelIndices[0];\n break;\n case 1 /* Category */:\n case 2 /* Split */:\n i1 = a.categoryIndices[0];\n i2 = b.categoryIndices[0];\n break;\n }\n // Compare based on the match index.\n if (i1 !== i2) {\n return i1 - i2;\n }\n // Otherwise, compare by category.\n var d2 = a.item.category.localeCompare(b.item.category);\n if (d2 !== 0) {\n return d2;\n }\n // Otherwise, compare by rank.\n var r1 = a.item.rank;\n var r2 = b.item.rank;\n if (r1 !== r2) {\n return r1 < r2 ? -1 : 1; // Infinity safe\n }\n // Finally, compare by label.\n return a.item.label.localeCompare(b.item.label);\n }\n /**\n * Create the results from an array of sorted scores.\n */\n function createResults(scores) {\n // Set up an array to track which scores have been visited.\n var visited = new Array(scores.length);\n algorithm.ArrayExt.fill(visited, false);\n // Set up the search results array.\n var results = [];\n // Iterate over each score in the array.\n for (var i = 0, n = scores.length; i < n; ++i) {\n // Ignore a score which has already been processed.\n if (visited[i]) {\n continue;\n }\n // Extract the current item and indices.\n var _a = scores[i], item = _a.item, categoryIndices = _a.categoryIndices;\n // Extract the category for the current item.\n var category = item.category;\n // Add the header result for the category.\n results.push({ type: 'header', category: category, indices: categoryIndices });\n // Find the rest of the scores with the same category.\n for (var j = i; j < n; ++j) {\n // Ignore a score which has already been processed.\n if (visited[j]) {\n continue;\n }\n // Extract the data for the current score.\n var _b = scores[j], item_1 = _b.item, labelIndices = _b.labelIndices;\n // Ignore an item with a different category.\n if (item_1.category !== category) {\n continue;\n }\n // Create the item result for the score.\n results.push({ type: 'item', item: item_1, indices: labelIndices });\n // Mark the score as processed.\n visited[j] = true;\n }\n }\n // Return the final results.\n return results;\n }\n /**\n * A concrete implementation of `CommandPalette.IItem`.\n */\n var CommandItem = /** @class */ (function () {\n /**\n * Construct a new command item.\n */\n function CommandItem(commands, options) {\n this._commands = commands;\n this.category = normalizeCategory(options.category);\n this.command = options.command;\n this.args = options.args || coreutils.JSONExt.emptyObject;\n this.rank = options.rank !== undefined ? options.rank : Infinity;\n }\n Object.defineProperty(CommandItem.prototype, \"label\", {\n /**\n * The display label for the command item.\n */\n get: function () {\n return this._commands.label(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"icon\", {\n /**\n * The icon renderer for the command item.\n */\n get: function () {\n return this._commands.icon(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"iconClass\", {\n /**\n * The icon class for the command item.\n */\n get: function () {\n return this._commands.iconClass(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"iconLabel\", {\n /**\n * The icon label for the command item.\n */\n get: function () {\n return this._commands.iconLabel(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"caption\", {\n /**\n * The display caption for the command item.\n */\n get: function () {\n return this._commands.caption(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"className\", {\n /**\n * The extra class name for the command item.\n */\n get: function () {\n return this._commands.className(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"dataset\", {\n /**\n * The dataset for the command item.\n */\n get: function () {\n return this._commands.dataset(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"isEnabled\", {\n /**\n * Whether the command item is enabled.\n */\n get: function () {\n return this._commands.isEnabled(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"isToggled\", {\n /**\n * Whether the command item is toggled.\n */\n get: function () {\n return this._commands.isToggled(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"isVisible\", {\n /**\n * Whether the command item is visible.\n */\n get: function () {\n return this._commands.isVisible(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"keyBinding\", {\n /**\n * The key binding for the command item.\n */\n get: function () {\n var _a = this, command = _a.command, args = _a.args;\n return algorithm.ArrayExt.findLastValue(this._commands.keyBindings, function (kb) {\n return kb.command === command && coreutils.JSONExt.deepEqual(kb.args, args);\n }) || null;\n },\n enumerable: false,\n configurable: true\n });\n return CommandItem;\n }());\n})(Private || (Private = {}));\n//# sourceMappingURL=commandpalette.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/commandpalette.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar coreutils = __webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\nvar commands = __webpack_require__(/*! @lumino/commands */ \"../../packages/commands/dist/index.js\");\nvar virtualdom = __webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\n\n/**\n * A widget which displays command items as a searchable palette.\n */\nexports.CommandPalette = /** @class */ (function (_super) {\n tslib.__extends(CommandPalette, _super);\n /**\n * Construct a new command palette.\n *\n * @param options - The options for initializing the palette.\n */\n function CommandPalette(options) {\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._activeIndex = -1;\n _this._items = [];\n _this._results = null;\n _this.addClass('lm-CommandPalette');\n /* */\n _this.addClass('p-CommandPalette');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n _this.commands = options.commands;\n _this.renderer = options.renderer || CommandPalette.defaultRenderer;\n _this.commands.commandChanged.connect(_this._onGenericChange, _this);\n _this.commands.keyBindingChanged.connect(_this._onGenericChange, _this);\n return _this;\n }\n /**\n * Dispose of the resources held by the widget.\n */\n CommandPalette.prototype.dispose = function () {\n this._items.length = 0;\n this._results = null;\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(CommandPalette.prototype, \"searchNode\", {\n /**\n * The command palette search node.\n *\n * #### Notes\n * This is the node which contains the search-related elements.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-CommandPalette-search')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandPalette.prototype, \"inputNode\", {\n /**\n * The command palette input node.\n *\n * #### Notes\n * This is the actual input node for the search area.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-CommandPalette-input')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandPalette.prototype, \"contentNode\", {\n /**\n * The command palette content node.\n *\n * #### Notes\n * This is the node which holds the command item nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-CommandPalette-content')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandPalette.prototype, \"items\", {\n /**\n * A read-only array of the command items in the palette.\n */\n get: function () {\n return this._items;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add a command item to the command palette.\n *\n * @param options - The options for creating the command item.\n *\n * @returns The command item added to the palette.\n */\n CommandPalette.prototype.addItem = function (options) {\n // Create a new command item for the options.\n var item = Private.createItem(this.commands, options);\n // Add the item to the array.\n this._items.push(item);\n // Refresh the search results.\n this.refresh();\n // Return the item added to the palette.\n return item;\n };\n /**\n * Remove an item from the command palette.\n *\n * @param item - The item to remove from the palette.\n *\n * #### Notes\n * This is a no-op if the item is not in the palette.\n */\n CommandPalette.prototype.removeItem = function (item) {\n this.removeItemAt(this._items.indexOf(item));\n };\n /**\n * Remove the item at a given index from the command palette.\n *\n * @param index - The index of the item to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n CommandPalette.prototype.removeItemAt = function (index) {\n // Remove the item from the array.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n // Bail if the index is out of range.\n if (!item) {\n return;\n }\n // Refresh the search results.\n this.refresh();\n };\n /**\n * Remove all items from the command palette.\n */\n CommandPalette.prototype.clearItems = function () {\n // Bail if there is nothing to remove.\n if (this._items.length === 0) {\n return;\n }\n // Clear the array of items.\n this._items.length = 0;\n // Refresh the search results.\n this.refresh();\n };\n /**\n * Clear the search results and schedule an update.\n *\n * #### Notes\n * This should be called whenever the search results of the palette\n * should be updated.\n *\n * This is typically called automatically by the palette as needed,\n * but can be called manually if the input text is programatically\n * changed.\n *\n * The rendered results are updated asynchronously.\n */\n CommandPalette.prototype.refresh = function () {\n this._results = null;\n if (this.inputNode.value !== '') {\n var clear = this.node.getElementsByClassName('lm-close-icon')[0];\n clear.style.display = 'inherit';\n }\n else {\n var clear = this.node.getElementsByClassName('lm-close-icon')[0];\n clear.style.display = 'none';\n }\n this.update();\n };\n /**\n * Handle the DOM events for the command palette.\n *\n * @param event - The DOM event sent to the command palette.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the command palette's DOM node.\n * It should not be called directly by user code.\n */\n CommandPalette.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'click':\n this._evtClick(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'input':\n this.refresh();\n break;\n case 'focus':\n case 'blur':\n this._toggleFocused();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n CommandPalette.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('click', this);\n this.node.addEventListener('keydown', this);\n this.node.addEventListener('input', this);\n this.node.addEventListener('focus', this, true);\n this.node.addEventListener('blur', this, true);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n CommandPalette.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('click', this);\n this.node.removeEventListener('keydown', this);\n this.node.removeEventListener('input', this);\n this.node.removeEventListener('focus', this, true);\n this.node.removeEventListener('blur', this, true);\n };\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n CommandPalette.prototype.onActivateRequest = function (msg) {\n if (this.isAttached) {\n var input = this.inputNode;\n input.focus();\n input.select();\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n CommandPalette.prototype.onUpdateRequest = function (msg) {\n // Fetch the current query text and content node.\n var query = this.inputNode.value;\n var contentNode = this.contentNode;\n // Ensure the search results are generated.\n var results = this._results;\n if (!results) {\n // Generate and store the new search results.\n results = this._results = Private.search(this._items, query);\n // Reset the active index.\n this._activeIndex = (query ? algorithm.ArrayExt.findFirstIndex(results, Private.canActivate) : -1);\n }\n // If there is no query and no results, clear the content.\n if (!query && results.length === 0) {\n virtualdom.VirtualDOM.render(null, contentNode);\n return;\n }\n // If the is a query but no results, render the empty message.\n if (query && results.length === 0) {\n var content_1 = this.renderer.renderEmptyMessage({ query: query });\n virtualdom.VirtualDOM.render(content_1, contentNode);\n return;\n }\n // Create the render content for the search results.\n var renderer = this.renderer;\n var activeIndex = this._activeIndex;\n var content = new Array(results.length);\n for (var i = 0, n = results.length; i < n; ++i) {\n var result = results[i];\n if (result.type === 'header') {\n var indices = result.indices;\n var category = result.category;\n content[i] = renderer.renderHeader({ category: category, indices: indices });\n }\n else {\n var item = result.item;\n var indices = result.indices;\n var active = i === activeIndex;\n content[i] = renderer.renderItem({ item: item, indices: indices, active: active });\n }\n }\n // Render the search result content.\n virtualdom.VirtualDOM.render(content, contentNode);\n // Adjust the scroll position as needed.\n if (activeIndex < 0 || activeIndex >= results.length) {\n contentNode.scrollTop = 0;\n }\n else {\n var element = contentNode.children[activeIndex];\n domutils.ElementExt.scrollIntoViewIfNeeded(contentNode, element);\n }\n };\n /**\n * Handle the `'click'` event for the command palette.\n */\n CommandPalette.prototype._evtClick = function (event) {\n // Bail if the click is not the left button.\n if (event.button !== 0) {\n return;\n }\n // Clear input if the target is clear button\n if (event.target.classList.contains(\"lm-close-icon\")) {\n this.inputNode.value = '';\n this.refresh();\n return;\n }\n // Find the index of the item which was clicked.\n var index = algorithm.ArrayExt.findFirstIndex(this.contentNode.children, function (node) {\n return node.contains(event.target);\n });\n // Bail if the click was not on an item.\n if (index === -1) {\n return;\n }\n // Kill the event when a content item is clicked.\n event.preventDefault();\n event.stopPropagation();\n // Execute the item if possible.\n this._execute(index);\n };\n /**\n * Handle the `'keydown'` event for the command palette.\n */\n CommandPalette.prototype._evtKeyDown = function (event) {\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {\n return;\n }\n switch (event.keyCode) {\n case 13: // Enter\n event.preventDefault();\n event.stopPropagation();\n this._execute(this._activeIndex);\n break;\n case 38: // Up Arrow\n event.preventDefault();\n event.stopPropagation();\n this._activatePreviousItem();\n break;\n case 40: // Down Arrow\n event.preventDefault();\n event.stopPropagation();\n this._activateNextItem();\n break;\n }\n };\n /**\n * Activate the next enabled command item.\n */\n CommandPalette.prototype._activateNextItem = function () {\n // Bail if there are no search results.\n if (!this._results || this._results.length === 0) {\n return;\n }\n // Find the next enabled item index.\n var ai = this._activeIndex;\n var n = this._results.length;\n var start = ai < n - 1 ? ai + 1 : 0;\n var stop = start === 0 ? n - 1 : start - 1;\n this._activeIndex = algorithm.ArrayExt.findFirstIndex(this._results, Private.canActivate, start, stop);\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Activate the previous enabled command item.\n */\n CommandPalette.prototype._activatePreviousItem = function () {\n // Bail if there are no search results.\n if (!this._results || this._results.length === 0) {\n return;\n }\n // Find the previous enabled item index.\n var ai = this._activeIndex;\n var n = this._results.length;\n var start = ai <= 0 ? n - 1 : ai - 1;\n var stop = start === n - 1 ? 0 : start + 1;\n this._activeIndex = algorithm.ArrayExt.findLastIndex(this._results, Private.canActivate, start, stop);\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Execute the command item at the given index, if possible.\n */\n CommandPalette.prototype._execute = function (index) {\n // Bail if there are no search results.\n if (!this._results) {\n return;\n }\n // Bail if the index is out of range.\n var part = this._results[index];\n if (!part) {\n return;\n }\n // Update the search text if the item is a header.\n if (part.type === 'header') {\n var input = this.inputNode;\n input.value = part.category.toLowerCase() + \" \";\n input.focus();\n this.refresh();\n return;\n }\n // Bail if item is not enabled.\n if (!part.item.isEnabled) {\n return;\n }\n // Execute the item.\n this.commands.execute(part.item.command, part.item.args);\n // Clear the query text.\n this.inputNode.value = '';\n // Refresh the search results.\n this.refresh();\n };\n /**\n * Toggle the focused modifier based on the input node focus state.\n */\n CommandPalette.prototype._toggleFocused = function () {\n var focused = document.activeElement === this.inputNode;\n this.toggleClass('lm-mod-focused', focused);\n /* */\n this.toggleClass('p-mod-focused', focused);\n /* */\n };\n /**\n * A signal handler for generic command changes.\n */\n CommandPalette.prototype._onGenericChange = function () {\n this.refresh();\n };\n return CommandPalette;\n}(widget.Widget));\n/**\n * The namespace for the `CommandPalette` class statics.\n */\n(function (CommandPalette) {\n /**\n * The default implementation of `IRenderer`.\n */\n var Renderer = /** @class */ (function () {\n function Renderer() {\n }\n /**\n * Render the virtual element for a command palette header.\n *\n * @param data - The data to use for rendering the header.\n *\n * @returns A virtual element representing the header.\n */\n Renderer.prototype.renderHeader = function (data) {\n var content = this.formatHeader(data);\n return virtualdom.h.li({ className: 'lm-CommandPalette-header'\n /* */\n + ' p-CommandPalette-header'\n /* */\n }, content);\n };\n /**\n * Render the virtual element for a command palette item.\n *\n * @param data - The data to use for rendering the item.\n *\n * @returns A virtual element representing the item.\n */\n Renderer.prototype.renderItem = function (data) {\n var className = this.createItemClass(data);\n var dataset = this.createItemDataset(data);\n return (virtualdom.h.li({ className: className, dataset: dataset }, this.renderItemIcon(data), this.renderItemContent(data), this.renderItemShortcut(data)));\n };\n /**\n * Render the empty results message for a command palette.\n *\n * @param data - The data to use for rendering the message.\n *\n * @returns A virtual element representing the message.\n */\n Renderer.prototype.renderEmptyMessage = function (data) {\n var content = this.formatEmptyMessage(data);\n return virtualdom.h.li({\n className: 'lm-CommandPalette-emptyMessage'\n /* */\n + ' p-CommandPalette-emptyMessage'\n /* */\n }, content);\n };\n /**\n * Render the icon for a command palette item.\n *\n * @param data - The data to use for rendering the icon.\n *\n * @returns A virtual element representing the icon.\n */\n Renderer.prototype.renderItemIcon = function (data) {\n var className = this.createIconClass(data);\n /* */\n if (typeof data.item.icon === 'string') {\n return virtualdom.h.div({ className: className }, data.item.iconLabel);\n }\n /* */\n // if data.item.icon is undefined, it will be ignored\n return virtualdom.h.div({ className: className }, data.item.icon, data.item.iconLabel);\n };\n /**\n * Render the content for a command palette item.\n *\n * @param data - The data to use for rendering the content.\n *\n * @returns A virtual element representing the content.\n */\n Renderer.prototype.renderItemContent = function (data) {\n return (virtualdom.h.div({\n className: 'lm-CommandPalette-itemContent'\n /* */\n + ' p-CommandPalette-itemContent'\n /* */\n }, this.renderItemLabel(data), this.renderItemCaption(data)));\n };\n /**\n * Render the label for a command palette item.\n *\n * @param data - The data to use for rendering the label.\n *\n * @returns A virtual element representing the label.\n */\n Renderer.prototype.renderItemLabel = function (data) {\n var content = this.formatItemLabel(data);\n return virtualdom.h.div({\n className: 'lm-CommandPalette-itemLabel'\n /* */\n + ' p-CommandPalette-itemLabel'\n /* */\n }, content);\n };\n /**\n * Render the caption for a command palette item.\n *\n * @param data - The data to use for rendering the caption.\n *\n * @returns A virtual element representing the caption.\n */\n Renderer.prototype.renderItemCaption = function (data) {\n var content = this.formatItemCaption(data);\n return virtualdom.h.div({\n className: 'lm-CommandPalette-itemCaption'\n /* */\n + ' p-CommandPalette-itemCaption'\n /* */\n }, content);\n };\n /**\n * Render the shortcut for a command palette item.\n *\n * @param data - The data to use for rendering the shortcut.\n *\n * @returns A virtual element representing the shortcut.\n */\n Renderer.prototype.renderItemShortcut = function (data) {\n var content = this.formatItemShortcut(data);\n return virtualdom.h.div({\n className: 'lm-CommandPalette-itemShortcut'\n /* */\n + ' p-CommandPalette-itemShortcut'\n /* */\n }, content);\n };\n /**\n * Create the class name for the command palette item.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the command palette item.\n */\n Renderer.prototype.createItemClass = function (data) {\n // Set up the initial class name.\n var name = 'lm-CommandPalette-item';\n /* */\n name += ' p-CommandPalette-item';\n /* */\n // Add the boolean state classes.\n if (!data.item.isEnabled) {\n name += ' lm-mod-disabled';\n /* */\n name += ' p-mod-disabled';\n /* */\n }\n if (data.item.isToggled) {\n name += ' lm-mod-toggled';\n /* */\n name += ' p-mod-toggled';\n /* */\n }\n if (data.active) {\n name += ' lm-mod-active';\n /* */\n name += ' p-mod-active';\n /* */\n }\n // Add the extra class.\n var extra = data.item.className;\n if (extra) {\n name += \" \" + extra;\n }\n // Return the complete class name.\n return name;\n };\n /**\n * Create the dataset for the command palette item.\n *\n * @param data - The data to use for creating the dataset.\n *\n * @returns The dataset for the command palette item.\n */\n Renderer.prototype.createItemDataset = function (data) {\n return tslib.__assign(tslib.__assign({}, data.item.dataset), { command: data.item.command });\n };\n /**\n * Create the class name for the command item icon.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the item icon.\n */\n Renderer.prototype.createIconClass = function (data) {\n var name = 'lm-CommandPalette-itemIcon';\n /* */\n name += ' p-CommandPalette-itemIcon';\n /* */\n var extra = data.item.iconClass;\n return extra ? name + \" \" + extra : name;\n };\n /**\n * Create the render content for the header node.\n *\n * @param data - The data to use for the header content.\n *\n * @returns The content to add to the header node.\n */\n Renderer.prototype.formatHeader = function (data) {\n if (!data.indices || data.indices.length === 0) {\n return data.category;\n }\n return algorithm.StringExt.highlight(data.category, data.indices, virtualdom.h.mark);\n };\n /**\n * Create the render content for the empty message node.\n *\n * @param data - The data to use for the empty message content.\n *\n * @returns The content to add to the empty message node.\n */\n Renderer.prototype.formatEmptyMessage = function (data) {\n return \"No commands found that match '\" + data.query + \"'\";\n };\n /**\n * Create the render content for the item shortcut node.\n *\n * @param data - The data to use for the shortcut content.\n *\n * @returns The content to add to the shortcut node.\n */\n Renderer.prototype.formatItemShortcut = function (data) {\n var kb = data.item.keyBinding;\n return kb ? kb.keys.map(commands.CommandRegistry.formatKeystroke).join(', ') : null;\n };\n /**\n * Create the render content for the item label node.\n *\n * @param data - The data to use for the label content.\n *\n * @returns The content to add to the label node.\n */\n Renderer.prototype.formatItemLabel = function (data) {\n if (!data.indices || data.indices.length === 0) {\n return data.item.label;\n }\n return algorithm.StringExt.highlight(data.item.label, data.indices, virtualdom.h.mark);\n };\n /**\n * Create the render content for the item caption node.\n *\n * @param data - The data to use for the caption content.\n *\n * @returns The content to add to the caption node.\n */\n Renderer.prototype.formatItemCaption = function (data) {\n return data.item.caption;\n };\n return Renderer;\n }());\n CommandPalette.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n CommandPalette.defaultRenderer = new Renderer();\n})(exports.CommandPalette || (exports.CommandPalette = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create the DOM node for a command palette.\n */\n function createNode() {\n var node = document.createElement('div');\n var search = document.createElement('div');\n var wrapper = document.createElement('div');\n var input = document.createElement('input');\n var content = document.createElement('ul');\n var clear = document.createElement('button');\n search.className = 'lm-CommandPalette-search';\n wrapper.className = 'lm-CommandPalette-wrapper';\n input.className = 'lm-CommandPalette-input';\n clear.className = 'lm-close-icon';\n content.className = 'lm-CommandPalette-content';\n /* */\n search.classList.add('p-CommandPalette-search');\n wrapper.classList.add('p-CommandPalette-wrapper');\n input.classList.add('p-CommandPalette-input');\n content.classList.add('p-CommandPalette-content');\n /* */\n input.spellcheck = false;\n wrapper.appendChild(input);\n wrapper.appendChild(clear);\n search.appendChild(wrapper);\n node.appendChild(search);\n node.appendChild(content);\n return node;\n }\n Private.createNode = createNode;\n /**\n * Create a new command item from a command registry and options.\n */\n function createItem(commands, options) {\n return new CommandItem(commands, options);\n }\n Private.createItem = createItem;\n /**\n * Search an array of command items for fuzzy matches.\n */\n function search(items, query) {\n // Fuzzy match the items for the query.\n var scores = matchItems(items, query);\n // Sort the items based on their score.\n scores.sort(scoreCmp);\n // Create the results for the search.\n return createResults(scores);\n }\n Private.search = search;\n /**\n * Test whether a result item can be activated.\n */\n function canActivate(result) {\n return result.type === 'item' && result.item.isEnabled;\n }\n Private.canActivate = canActivate;\n /**\n * Normalize a category for a command item.\n */\n function normalizeCategory(category) {\n return category.trim().replace(/\\s+/g, ' ');\n }\n /**\n * Normalize the query text for a fuzzy search.\n */\n function normalizeQuery(text) {\n return text.replace(/\\s+/g, '').toLowerCase();\n }\n /**\n * Perform a fuzzy match on an array of command items.\n */\n function matchItems(items, query) {\n // Normalize the query text to lower case with no whitespace.\n query = normalizeQuery(query);\n // Create the array to hold the scores.\n var scores = [];\n // Iterate over the items and match against the query.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Ignore items which are not visible.\n var item = items[i];\n if (!item.isVisible) {\n continue;\n }\n // If the query is empty, all items are matched by default.\n if (!query) {\n scores.push({\n matchType: 3 /* Default */,\n categoryIndices: null,\n labelIndices: null,\n score: 0,\n item: item\n });\n continue;\n }\n // Run the fuzzy search for the item and query.\n var score = fuzzySearch(item, query);\n // Ignore the item if it is not a match.\n if (!score) {\n continue;\n }\n // Penalize disabled items.\n // TODO - push disabled items all the way down in sort cmp?\n if (!item.isEnabled) {\n score.score += 1000;\n }\n // Add the score to the results.\n scores.push(score);\n }\n // Return the final array of scores.\n return scores;\n }\n /**\n * Perform a fuzzy search on a single command item.\n */\n function fuzzySearch(item, query) {\n // Create the source text to be searched.\n var category = item.category.toLowerCase();\n var label = item.label.toLowerCase();\n var source = category + \" \" + label;\n // Set up the match score and indices array.\n var score = Infinity;\n var indices = null;\n // The regex for search word boundaries\n var rgx = /\\b\\w/g;\n // Search the source by word boundary.\n while (true) {\n // Find the next word boundary in the source.\n var rgxMatch = rgx.exec(source);\n // Break if there is no more source context.\n if (!rgxMatch) {\n break;\n }\n // Run the string match on the relevant substring.\n var match = algorithm.StringExt.matchSumOfDeltas(source, query, rgxMatch.index);\n // Break if there is no match.\n if (!match) {\n break;\n }\n // Update the match if the score is better.\n if (match && match.score <= score) {\n score = match.score;\n indices = match.indices;\n }\n }\n // Bail if there was no match.\n if (!indices || score === Infinity) {\n return null;\n }\n // Compute the pivot index between category and label text.\n var pivot = category.length + 1;\n // Find the slice index to separate matched indices.\n var j = algorithm.ArrayExt.lowerBound(indices, pivot, function (a, b) { return a - b; });\n // Extract the matched category and label indices.\n var categoryIndices = indices.slice(0, j);\n var labelIndices = indices.slice(j);\n // Adjust the label indices for the pivot offset.\n for (var i = 0, n = labelIndices.length; i < n; ++i) {\n labelIndices[i] -= pivot;\n }\n // Handle a pure label match.\n if (categoryIndices.length === 0) {\n return {\n matchType: 0 /* Label */,\n categoryIndices: null,\n labelIndices: labelIndices,\n score: score, item: item\n };\n }\n // Handle a pure category match.\n if (labelIndices.length === 0) {\n return {\n matchType: 1 /* Category */,\n categoryIndices: categoryIndices,\n labelIndices: null,\n score: score, item: item\n };\n }\n // Handle a split match.\n return {\n matchType: 2 /* Split */,\n categoryIndices: categoryIndices,\n labelIndices: labelIndices,\n score: score, item: item\n };\n }\n /**\n * A sort comparison function for a match score.\n */\n function scoreCmp(a, b) {\n // First compare based on the match type\n var m1 = a.matchType - b.matchType;\n if (m1 !== 0) {\n return m1;\n }\n // Otherwise, compare based on the match score.\n var d1 = a.score - b.score;\n if (d1 !== 0) {\n return d1;\n }\n // Find the match index based on the match type.\n var i1 = 0;\n var i2 = 0;\n switch (a.matchType) {\n case 0 /* Label */:\n i1 = a.labelIndices[0];\n i2 = b.labelIndices[0];\n break;\n case 1 /* Category */:\n case 2 /* Split */:\n i1 = a.categoryIndices[0];\n i2 = b.categoryIndices[0];\n break;\n }\n // Compare based on the match index.\n if (i1 !== i2) {\n return i1 - i2;\n }\n // Otherwise, compare by category.\n var d2 = a.item.category.localeCompare(b.item.category);\n if (d2 !== 0) {\n return d2;\n }\n // Otherwise, compare by rank.\n var r1 = a.item.rank;\n var r2 = b.item.rank;\n if (r1 !== r2) {\n return r1 < r2 ? -1 : 1; // Infinity safe\n }\n // Finally, compare by label.\n return a.item.label.localeCompare(b.item.label);\n }\n /**\n * Create the results from an array of sorted scores.\n */\n function createResults(scores) {\n // Set up an array to track which scores have been visited.\n var visited = new Array(scores.length);\n algorithm.ArrayExt.fill(visited, false);\n // Set up the search results array.\n var results = [];\n // Iterate over each score in the array.\n for (var i = 0, n = scores.length; i < n; ++i) {\n // Ignore a score which has already been processed.\n if (visited[i]) {\n continue;\n }\n // Extract the current item and indices.\n var _a = scores[i], item = _a.item, categoryIndices = _a.categoryIndices;\n // Extract the category for the current item.\n var category = item.category;\n // Add the header result for the category.\n results.push({ type: 'header', category: category, indices: categoryIndices });\n // Find the rest of the scores with the same category.\n for (var j = i; j < n; ++j) {\n // Ignore a score which has already been processed.\n if (visited[j]) {\n continue;\n }\n // Extract the data for the current score.\n var _b = scores[j], item_1 = _b.item, labelIndices = _b.labelIndices;\n // Ignore an item with a different category.\n if (item_1.category !== category) {\n continue;\n }\n // Create the item result for the score.\n results.push({ type: 'item', item: item_1, indices: labelIndices });\n // Mark the score as processed.\n visited[j] = true;\n }\n }\n // Return the final results.\n return results;\n }\n /**\n * A concrete implementation of `CommandPalette.IItem`.\n */\n var CommandItem = /** @class */ (function () {\n /**\n * Construct a new command item.\n */\n function CommandItem(commands, options) {\n this._commands = commands;\n this.category = normalizeCategory(options.category);\n this.command = options.command;\n this.args = options.args || coreutils.JSONExt.emptyObject;\n this.rank = options.rank !== undefined ? options.rank : Infinity;\n }\n Object.defineProperty(CommandItem.prototype, \"label\", {\n /**\n * The display label for the command item.\n */\n get: function () {\n return this._commands.label(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"icon\", {\n /**\n * The icon renderer for the command item.\n */\n get: function () {\n return this._commands.icon(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"iconClass\", {\n /**\n * The icon class for the command item.\n */\n get: function () {\n return this._commands.iconClass(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"iconLabel\", {\n /**\n * The icon label for the command item.\n */\n get: function () {\n return this._commands.iconLabel(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"caption\", {\n /**\n * The display caption for the command item.\n */\n get: function () {\n return this._commands.caption(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"className\", {\n /**\n * The extra class name for the command item.\n */\n get: function () {\n return this._commands.className(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"dataset\", {\n /**\n * The dataset for the command item.\n */\n get: function () {\n return this._commands.dataset(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"isEnabled\", {\n /**\n * Whether the command item is enabled.\n */\n get: function () {\n return this._commands.isEnabled(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"isToggled\", {\n /**\n * Whether the command item is toggled.\n */\n get: function () {\n return this._commands.isToggled(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"isVisible\", {\n /**\n * Whether the command item is visible.\n */\n get: function () {\n return this._commands.isVisible(this.command, this.args);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CommandItem.prototype, \"keyBinding\", {\n /**\n * The key binding for the command item.\n */\n get: function () {\n var _a = this, command = _a.command, args = _a.args;\n return algorithm.ArrayExt.findLastValue(this._commands.keyBindings, function (kb) {\n return kb.command === command && coreutils.JSONExt.deepEqual(kb.args, args);\n }) || null;\n },\n enumerable: false,\n configurable: true\n });\n return CommandItem;\n }());\n})(Private || (Private = {}));\n//# sourceMappingURL=commandpalette.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/commandpalette.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/contextmenu.js": │ │ │ │ /*!***********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/contextmenu.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/contextmenu.js ***! │ │ │ │ \***********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n__webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\n__webpack_require__(/*! @lumino/commands */ \"../../packages/commands/dist/index.js\");\n__webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar disposable = __webpack_require__(/*! @lumino/disposable */ \"../../packages/disposable/dist/index.js\");\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar menu = __webpack_require__(/*! ./menu.js */ \"../../packages/widgets/dist/menu.js\");\n\n/**\n * An object which implements a universal context menu.\n *\n * #### Notes\n * The items shown in the context menu are determined by CSS selector\n * matching against the DOM hierarchy at the site of the mouse click.\n * This is similar in concept to how keyboard shortcuts are matched\n * in the command registry.\n */\nvar ContextMenu = /** @class */ (function () {\n /**\n * Construct a new context menu.\n *\n * @param options - The options for initializing the menu.\n */\n function ContextMenu(options) {\n this._idTick = 0;\n this._items = [];\n this.menu = new menu.Menu(options);\n }\n /**\n * Add an item to the context menu.\n *\n * @param options - The options for creating the item.\n *\n * @returns A disposable which will remove the item from the menu.\n */\n ContextMenu.prototype.addItem = function (options) {\n var _this = this;\n // Create an item from the given options.\n var item = Private.createItem(options, this._idTick++);\n // Add the item to the internal array.\n this._items.push(item);\n // Return a disposable which will remove the item.\n return new disposable.DisposableDelegate(function () {\n algorithm.ArrayExt.removeFirstOf(_this._items, item);\n });\n };\n /**\n * Open the context menu in response to a `'contextmenu'` event.\n *\n * @param event - The `'contextmenu'` event of interest.\n *\n * @returns `true` if the menu was opened, or `false` if no items\n * matched the event and the menu was not opened.\n *\n * #### Notes\n * This method will populate the context menu with items which match\n * the propagation path of the event, then open the menu at the mouse\n * position indicated by the event.\n */\n ContextMenu.prototype.open = function (event) {\n var _this = this;\n // Clear the current contents of the context menu.\n this.menu.clearItems();\n // Bail early if there are no items to match.\n if (this._items.length === 0) {\n return false;\n }\n // Find the matching items for the event.\n var items = Private.matchItems(this._items, event);\n // Bail if there are no matching items.\n if (!items || items.length === 0) {\n return false;\n }\n // Add the filtered items to the menu.\n algorithm.each(items, function (item) { _this.menu.addItem(item); });\n // Open the context menu at the current mouse position.\n this.menu.open(event.clientX, event.clientY);\n // Indicate success.\n return true;\n };\n return ContextMenu;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a normalized context menu item from an options object.\n */\n function createItem(options, id) {\n var selector = validateSelector(options.selector);\n var rank = options.rank !== undefined ? options.rank : Infinity;\n return tslib.__assign(tslib.__assign({}, options), { selector: selector, rank: rank, id: id });\n }\n Private.createItem = createItem;\n /**\n * Find the items which match a context menu event.\n *\n * The results are sorted by DOM level, specificity, and rank.\n */\n function matchItems(items, event) {\n // Look up the target of the event.\n var target = event.target;\n // Bail if there is no target.\n if (!target) {\n return null;\n }\n // Look up the current target of the event.\n var currentTarget = event.currentTarget;\n // Bail if there is no current target.\n if (!currentTarget) {\n return null;\n }\n // There are some third party libraries that cause the `target` to\n // be detached from the DOM before lumino can process the event.\n // If that happens, search for a new target node by point. If that\n // node is still dangling, bail.\n if (!currentTarget.contains(target)) {\n target = document.elementFromPoint(event.clientX, event.clientY);\n if (!target || !currentTarget.contains(target)) {\n return null;\n }\n }\n // Set up the result array.\n var result = [];\n // Copy the items array to allow in-place modification.\n var availableItems = items.slice();\n // Walk up the DOM hierarchy searching for matches.\n while (target !== null) {\n // Set up the match array for this DOM level.\n var matches = [];\n // Search the remaining items for matches.\n for (var i = 0, n = availableItems.length; i < n; ++i) {\n // Fetch the item.\n var item = availableItems[i];\n // Skip items which are already consumed.\n if (!item) {\n continue;\n }\n // Skip items which do not match the element.\n if (!domutils.Selector.matches(target, item.selector)) {\n continue;\n }\n // Add the matched item to the result for this DOM level.\n matches.push(item);\n // Mark the item as consumed.\n availableItems[i] = null;\n }\n // Sort the matches for this level and add them to the results.\n if (matches.length !== 0) {\n matches.sort(itemCmp);\n result.push.apply(result, matches);\n }\n // Stop searching at the limits of the DOM range.\n if (target === currentTarget) {\n break;\n }\n // Step to the parent DOM level.\n target = target.parentElement;\n }\n // Return the matched and sorted results.\n return result;\n }\n Private.matchItems = matchItems;\n /**\n * Validate the selector for a menu item.\n *\n * This returns the validated selector, or throws if the selector is\n * invalid or contains commas.\n */\n function validateSelector(selector) {\n if (selector.indexOf(',') !== -1) {\n throw new Error(\"Selector cannot contain commas: \" + selector);\n }\n if (!domutils.Selector.isValid(selector)) {\n throw new Error(\"Invalid selector: \" + selector);\n }\n return selector;\n }\n /**\n * A sort comparison function for a context menu item.\n */\n function itemCmp(a, b) {\n // Sort first based on selector specificity.\n var s1 = domutils.Selector.calculateSpecificity(a.selector);\n var s2 = domutils.Selector.calculateSpecificity(b.selector);\n if (s1 !== s2) {\n return s2 - s1;\n }\n // If specificities are equal, sort based on rank.\n var r1 = a.rank;\n var r2 = b.rank;\n if (r1 !== r2) {\n return r1 < r2 ? -1 : 1; // Infinity-safe\n }\n // When all else fails, sort by item id.\n return a.id - b.id;\n }\n})(Private || (Private = {}));\n\nexports.ContextMenu = ContextMenu;\n//# sourceMappingURL=contextmenu.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/contextmenu.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n__webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\n__webpack_require__(/*! @lumino/commands */ \"../../packages/commands/dist/index.js\");\n__webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar disposable = __webpack_require__(/*! @lumino/disposable */ \"../../packages/disposable/dist/index.js\");\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar menu = __webpack_require__(/*! ./menu.js */ \"../../packages/widgets/dist/menu.js\");\n\n/**\n * An object which implements a universal context menu.\n *\n * #### Notes\n * The items shown in the context menu are determined by CSS selector\n * matching against the DOM hierarchy at the site of the mouse click.\n * This is similar in concept to how keyboard shortcuts are matched\n * in the command registry.\n */\nvar ContextMenu = /** @class */ (function () {\n /**\n * Construct a new context menu.\n *\n * @param options - The options for initializing the menu.\n */\n function ContextMenu(options) {\n this._idTick = 0;\n this._items = [];\n this.menu = new menu.Menu(options);\n }\n /**\n * Add an item to the context menu.\n *\n * @param options - The options for creating the item.\n *\n * @returns A disposable which will remove the item from the menu.\n */\n ContextMenu.prototype.addItem = function (options) {\n var _this = this;\n // Create an item from the given options.\n var item = Private.createItem(options, this._idTick++);\n // Add the item to the internal array.\n this._items.push(item);\n // Return a disposable which will remove the item.\n return new disposable.DisposableDelegate(function () {\n algorithm.ArrayExt.removeFirstOf(_this._items, item);\n });\n };\n /**\n * Open the context menu in response to a `'contextmenu'` event.\n *\n * @param event - The `'contextmenu'` event of interest.\n *\n * @returns `true` if the menu was opened, or `false` if no items\n * matched the event and the menu was not opened.\n *\n * #### Notes\n * This method will populate the context menu with items which match\n * the propagation path of the event, then open the menu at the mouse\n * position indicated by the event.\n */\n ContextMenu.prototype.open = function (event) {\n var _this = this;\n // Clear the current contents of the context menu.\n this.menu.clearItems();\n // Bail early if there are no items to match.\n if (this._items.length === 0) {\n return false;\n }\n // Find the matching items for the event.\n var items = Private.matchItems(this._items, event);\n // Bail if there are no matching items.\n if (!items || items.length === 0) {\n return false;\n }\n // Add the filtered items to the menu.\n algorithm.each(items, function (item) { _this.menu.addItem(item); });\n // Open the context menu at the current mouse position.\n this.menu.open(event.clientX, event.clientY);\n // Indicate success.\n return true;\n };\n return ContextMenu;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a normalized context menu item from an options object.\n */\n function createItem(options, id) {\n var selector = validateSelector(options.selector);\n var rank = options.rank !== undefined ? options.rank : Infinity;\n return tslib.__assign(tslib.__assign({}, options), { selector: selector, rank: rank, id: id });\n }\n Private.createItem = createItem;\n /**\n * Find the items which match a context menu event.\n *\n * The results are sorted by DOM level, specificity, and rank.\n */\n function matchItems(items, event) {\n // Look up the target of the event.\n var target = event.target;\n // Bail if there is no target.\n if (!target) {\n return null;\n }\n // Look up the current target of the event.\n var currentTarget = event.currentTarget;\n // Bail if there is no current target.\n if (!currentTarget) {\n return null;\n }\n // There are some third party libraries that cause the `target` to\n // be detached from the DOM before lumino can process the event.\n // If that happens, search for a new target node by point. If that\n // node is still dangling, bail.\n if (!currentTarget.contains(target)) {\n target = document.elementFromPoint(event.clientX, event.clientY);\n if (!target || !currentTarget.contains(target)) {\n return null;\n }\n }\n // Set up the result array.\n var result = [];\n // Copy the items array to allow in-place modification.\n var availableItems = items.slice();\n // Walk up the DOM hierarchy searching for matches.\n while (target !== null) {\n // Set up the match array for this DOM level.\n var matches = [];\n // Search the remaining items for matches.\n for (var i = 0, n = availableItems.length; i < n; ++i) {\n // Fetch the item.\n var item = availableItems[i];\n // Skip items which are already consumed.\n if (!item) {\n continue;\n }\n // Skip items which do not match the element.\n if (!domutils.Selector.matches(target, item.selector)) {\n continue;\n }\n // Add the matched item to the result for this DOM level.\n matches.push(item);\n // Mark the item as consumed.\n availableItems[i] = null;\n }\n // Sort the matches for this level and add them to the results.\n if (matches.length !== 0) {\n matches.sort(itemCmp);\n result.push.apply(result, matches);\n }\n // Stop searching at the limits of the DOM range.\n if (target === currentTarget) {\n break;\n }\n // Step to the parent DOM level.\n target = target.parentElement;\n }\n // Return the matched and sorted results.\n return result;\n }\n Private.matchItems = matchItems;\n /**\n * Validate the selector for a menu item.\n *\n * This returns the validated selector, or throws if the selector is\n * invalid or contains commas.\n */\n function validateSelector(selector) {\n if (selector.indexOf(',') !== -1) {\n throw new Error(\"Selector cannot contain commas: \" + selector);\n }\n if (!domutils.Selector.isValid(selector)) {\n throw new Error(\"Invalid selector: \" + selector);\n }\n return selector;\n }\n /**\n * A sort comparison function for a context menu item.\n */\n function itemCmp(a, b) {\n // Sort first based on selector specificity.\n var s1 = domutils.Selector.calculateSpecificity(a.selector);\n var s2 = domutils.Selector.calculateSpecificity(b.selector);\n if (s1 !== s2) {\n return s2 - s1;\n }\n // If specificities are equal, sort based on rank.\n var r1 = a.rank;\n var r2 = b.rank;\n if (r1 !== r2) {\n return r1 < r2 ? -1 : 1; // Infinity-safe\n }\n // When all else fails, sort by item id.\n return a.id - b.id;\n }\n})(Private || (Private = {}));\n\nexports.ContextMenu = ContextMenu;\n//# sourceMappingURL=contextmenu.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/contextmenu.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/docklayout.js": │ │ │ │ /*!**********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/docklayout.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/docklayout.js ***! │ │ │ │ \**********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n\n/**\n * A layout which provides a flexible docking arrangement.\n *\n * #### Notes\n * The consumer of this layout is responsible for handling all signals\n * from the generated tab bars and managing the visibility of widgets\n * and tab bars as needed.\n */\nvar DockLayout = /** @class */ (function (_super) {\n tslib.__extends(DockLayout, _super);\n /**\n * Construct a new dock layout.\n *\n * @param options - The options for initializing the layout.\n */\n function DockLayout(options) {\n var _this = _super.call(this) || this;\n _this._spacing = 4;\n _this._dirty = false;\n _this._root = null;\n _this._box = null;\n _this._items = new Map();\n _this.renderer = options.renderer;\n if (options.spacing !== undefined) {\n _this._spacing = Private.clampSpacing(options.spacing);\n }\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n *\n * #### Notes\n * This will clear and dispose all widgets in the layout.\n */\n DockLayout.prototype.dispose = function () {\n // Get an iterator over the widgets in the layout.\n var widgets = this.iter();\n // Dispose of the layout items.\n this._items.forEach(function (item) { item.dispose(); });\n // Clear the layout state before disposing the widgets.\n this._box = null;\n this._root = null;\n this._items.clear();\n // Dispose of the widgets contained in the old layout root.\n algorithm.each(widgets, function (widget) { widget.dispose(); });\n // Dispose of the base class.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(DockLayout.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the dock layout.\n */\n get: function () {\n return this._spacing;\n },\n /**\n * Set the inter-element spacing for the dock layout.\n */\n set: function (value) {\n value = Private.clampSpacing(value);\n if (this._spacing === value) {\n return;\n }\n this._spacing = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockLayout.prototype, \"isEmpty\", {\n /**\n * Whether the dock layout is empty.\n */\n get: function () {\n return this._root === null;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over all widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n *\n * #### Notes\n * This iterator includes the generated tab bars.\n */\n DockLayout.prototype.iter = function () {\n return this._root ? this._root.iterAllWidgets() : algorithm.empty();\n };\n /**\n * Create an iterator over the user widgets in the layout.\n *\n * @returns A new iterator over the user widgets in the layout.\n *\n * #### Notes\n * This iterator does not include the generated tab bars.\n */\n DockLayout.prototype.widgets = function () {\n return this._root ? this._root.iterUserWidgets() : algorithm.empty();\n };\n /**\n * Create an iterator over the selected widgets in the layout.\n *\n * @returns A new iterator over the selected user widgets.\n *\n * #### Notes\n * This iterator yields the widgets corresponding to the current tab\n * of each tab bar in the layout.\n */\n DockLayout.prototype.selectedWidgets = function () {\n return this._root ? this._root.iterSelectedWidgets() : algorithm.empty();\n };\n /**\n * Create an iterator over the tab bars in the layout.\n *\n * @returns A new iterator over the tab bars in the layout.\n *\n * #### Notes\n * This iterator does not include the user widgets.\n */\n DockLayout.prototype.tabBars = function () {\n return this._root ? this._root.iterTabBars() : algorithm.empty();\n };\n /**\n * Create an iterator over the handles in the layout.\n *\n * @returns A new iterator over the handles in the layout.\n */\n DockLayout.prototype.handles = function () {\n return this._root ? this._root.iterHandles() : algorithm.empty();\n };\n /**\n * Move a handle to the given offset position.\n *\n * @param handle - The handle to move.\n *\n * @param offsetX - The desired offset X position of the handle.\n *\n * @param offsetY - The desired offset Y position of the handle.\n *\n * #### Notes\n * If the given handle is not contained in the layout, this is no-op.\n *\n * The handle will be moved as close as possible to the desired\n * position without violating any of the layout constraints.\n *\n * Only one of the coordinates is used depending on the orientation\n * of the handle. This method accepts both coordinates to make it\n * easy to invoke from a mouse move event without needing to know\n * the handle orientation.\n */\n DockLayout.prototype.moveHandle = function (handle, offsetX, offsetY) {\n // Bail early if there is no root or if the handle is hidden.\n var hidden = handle.classList.contains('lm-mod-hidden');\n /* */\n hidden = hidden || handle.classList.contains('p-mod-hidden');\n /* */\n if (!this._root || hidden) {\n return;\n }\n // Lookup the split node for the handle.\n var data = this._root.findSplitNode(handle);\n if (!data) {\n return;\n }\n // Compute the desired delta movement for the handle.\n var delta;\n if (data.node.orientation === 'horizontal') {\n delta = offsetX - handle.offsetLeft;\n }\n else {\n delta = offsetY - handle.offsetTop;\n }\n // Bail if there is no handle movement.\n if (delta === 0) {\n return;\n }\n // Prevent sibling resizing unless needed.\n data.node.holdSizes();\n // Adjust the sizers to reflect the handle movement.\n boxengine.BoxEngine.adjust(data.node.sizers, data.index, delta);\n // Update the layout of the widgets.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Save the current configuration of the dock layout.\n *\n * @returns A new config object for the current layout state.\n *\n * #### Notes\n * The return value can be provided to the `restoreLayout` method\n * in order to restore the layout to its current configuration.\n */\n DockLayout.prototype.saveLayout = function () {\n // Bail early if there is no root.\n if (!this._root) {\n return { main: null };\n }\n // Hold the current sizes in the layout tree.\n this._root.holdAllSizes();\n // Return the layout config.\n return { main: this._root.createConfig() };\n };\n /**\n * Restore the layout to a previously saved configuration.\n *\n * @param config - The layout configuration to restore.\n *\n * #### Notes\n * Widgets which currently belong to the layout but which are not\n * contained in the config will be unparented.\n */\n DockLayout.prototype.restoreLayout = function (config) {\n var _this = this;\n // Create the widget set for validating the config.\n var widgetSet = new Set();\n // Normalize the main area config and collect the widgets.\n var mainConfig;\n if (config.main) {\n mainConfig = Private.normalizeAreaConfig(config.main, widgetSet);\n }\n else {\n mainConfig = null;\n }\n // Create iterators over the old content.\n var oldWidgets = this.widgets();\n var oldTabBars = this.tabBars();\n var oldHandles = this.handles();\n // Clear the root before removing the old content.\n this._root = null;\n // Unparent the old widgets which are not in the new config.\n algorithm.each(oldWidgets, function (widget) {\n if (!widgetSet.has(widget)) {\n widget.parent = null;\n }\n });\n // Dispose of the old tab bars.\n algorithm.each(oldTabBars, function (tabBar) {\n tabBar.dispose();\n });\n // Remove the old handles.\n algorithm.each(oldHandles, function (handle) {\n if (handle.parentNode) {\n handle.parentNode.removeChild(handle);\n }\n });\n // Reparent the new widgets to the current parent.\n widgetSet.forEach(function (widget) {\n widget.parent = _this.parent;\n });\n // Create the root node for the new config.\n if (mainConfig) {\n this._root = Private.realizeAreaConfig(mainConfig, {\n createTabBar: function () { return _this._createTabBar(); },\n createHandle: function () { return _this._createHandle(); }\n });\n }\n else {\n this._root = null;\n }\n // If there is no parent, there is nothing more to do.\n if (!this.parent) {\n return;\n }\n // Attach the new widgets to the parent.\n widgetSet.forEach(function (widget) {\n _this.attachWidget(widget);\n });\n // Post a fit request to the parent.\n this.parent.fit();\n };\n /**\n * Add a widget to the dock layout.\n *\n * @param widget - The widget to add to the dock layout.\n *\n * @param options - The additional options for adding the widget.\n *\n * #### Notes\n * The widget will be moved if it is already contained in the layout.\n *\n * An error will be thrown if the reference widget is invalid.\n */\n DockLayout.prototype.addWidget = function (widget, options) {\n if (options === void 0) { options = {}; }\n // Parse the options.\n var ref = options.ref || null;\n var mode = options.mode || 'tab-after';\n // Find the tab node which holds the reference widget.\n var refNode = null;\n if (this._root && ref) {\n refNode = this._root.findTabNode(ref);\n }\n // Throw an error if the reference widget is invalid.\n if (ref && !refNode) {\n throw new Error('Reference widget is not in the layout.');\n }\n // Reparent the widget to the current layout parent.\n widget.parent = this.parent;\n // Insert the widget according to the insert mode.\n switch (mode) {\n case 'tab-after':\n this._insertTab(widget, ref, refNode, true);\n break;\n case 'tab-before':\n this._insertTab(widget, ref, refNode, false);\n break;\n case 'split-top':\n this._insertSplit(widget, ref, refNode, 'vertical', false);\n break;\n case 'split-left':\n this._insertSplit(widget, ref, refNode, 'horizontal', false);\n break;\n case 'split-right':\n this._insertSplit(widget, ref, refNode, 'horizontal', true);\n break;\n case 'split-bottom':\n this._insertSplit(widget, ref, refNode, 'vertical', true);\n break;\n }\n // Do nothing else if there is no parent widget.\n if (!this.parent) {\n return;\n }\n // Ensure the widget is attached to the parent widget.\n this.attachWidget(widget);\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Remove a widget from the layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n DockLayout.prototype.removeWidget = function (widget) {\n // Remove the widget from its current layout location.\n this._removeWidget(widget);\n // Do nothing else if there is no parent widget.\n if (!this.parent) {\n return;\n }\n // Detach the widget from the parent widget.\n this.detachWidget(widget);\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Find the tab area which contains the given client position.\n *\n * @param clientX - The client X position of interest.\n *\n * @param clientY - The client Y position of interest.\n *\n * @returns The geometry of the tab area at the given position, or\n * `null` if there is no tab area at the given position.\n */\n DockLayout.prototype.hitTestTabAreas = function (clientX, clientY) {\n // Bail early if hit testing cannot produce valid results.\n if (!this._root || !this.parent || !this.parent.isVisible) {\n return null;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Convert from client to local coordinates.\n var rect = this.parent.node.getBoundingClientRect();\n var x = clientX - rect.left - this._box.borderLeft;\n var y = clientY - rect.top - this._box.borderTop;\n // Find the tab layout node at the local position.\n var tabNode = this._root.hitTestTabNodes(x, y);\n // Bail if a tab layout node was not found.\n if (!tabNode) {\n return null;\n }\n // Extract the data from the tab node.\n var tabBar = tabNode.tabBar, top = tabNode.top, left = tabNode.left, width = tabNode.width, height = tabNode.height;\n // Compute the right and bottom edges of the tab area.\n var borderWidth = this._box.borderLeft + this._box.borderRight;\n var borderHeight = this._box.borderTop + this._box.borderBottom;\n var right = rect.width - borderWidth - (left + width);\n var bottom = rect.height - borderHeight - (top + height);\n // Return the hit test results.\n return { tabBar: tabBar, x: x, y: y, top: top, left: left, right: right, bottom: bottom, width: width, height: height };\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n DockLayout.prototype.init = function () {\n var _this = this;\n // Perform superclass initialization.\n _super.prototype.init.call(this);\n // Attach each widget to the parent.\n algorithm.each(this, function (widget) { _this.attachWidget(widget); });\n // Attach each handle to the parent.\n algorithm.each(this.handles(), function (handle) { _this.parent.node.appendChild(handle); });\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Attach the widget to the layout parent widget.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a no-op if the widget is already attached.\n */\n DockLayout.prototype.attachWidget = function (widget$1) {\n // Do nothing if the widget is already attached.\n if (this.parent.node === widget$1.node.parentNode) {\n return;\n }\n // Create the layout item for the widget.\n this._items.set(widget$1, new layout.LayoutItem(widget$1));\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n };\n /**\n * Detach the widget from the layout parent widget.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a no-op if the widget is not attached.\n */\n DockLayout.prototype.detachWidget = function (widget$1) {\n // Do nothing if the widget is not attached.\n if (this.parent.node !== widget$1.node.parentNode) {\n return;\n }\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Delete the layout item for the widget.\n var item = this._items.get(widget$1);\n if (item) {\n this._items.delete(widget$1);\n item.dispose();\n }\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n DockLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n DockLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n DockLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n DockLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n DockLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n DockLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n DockLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Remove the specified widget from the layout structure.\n *\n * #### Notes\n * This is a no-op if the widget is not in the layout tree.\n *\n * This does not detach the widget from the parent node.\n */\n DockLayout.prototype._removeWidget = function (widget) {\n // Bail early if there is no layout root.\n if (!this._root) {\n return;\n }\n // Find the tab node which contains the given widget.\n var tabNode = this._root.findTabNode(widget);\n // Bail early if the tab node is not found.\n if (!tabNode) {\n return;\n }\n // If there are multiple tabs, just remove the widget's tab.\n if (tabNode.tabBar.titles.length > 1) {\n tabNode.tabBar.removeTab(widget.title);\n return;\n }\n // Otherwise, the tab node needs to be removed...\n // Dispose the tab bar.\n tabNode.tabBar.dispose();\n // Handle the case where the tab node is the root.\n if (this._root === tabNode) {\n this._root = null;\n return;\n }\n // Otherwise, remove the tab node from its parent...\n // Prevent widget resizing unless needed.\n this._root.holdAllSizes();\n // Clear the parent reference on the tab node.\n var splitNode = tabNode.parent;\n tabNode.parent = null;\n // Remove the tab node from its parent split node.\n var i = algorithm.ArrayExt.removeFirstOf(splitNode.children, tabNode);\n var handle = algorithm.ArrayExt.removeAt(splitNode.handles, i);\n algorithm.ArrayExt.removeAt(splitNode.sizers, i);\n // Remove the handle from its parent DOM node.\n if (handle.parentNode) {\n handle.parentNode.removeChild(handle);\n }\n // If there are multiple children, just update the handles.\n if (splitNode.children.length > 1) {\n splitNode.syncHandles();\n return;\n }\n // Otherwise, the split node also needs to be removed...\n // Clear the parent reference on the split node.\n var maybeParent = splitNode.parent;\n splitNode.parent = null;\n // Lookup the remaining child node and handle.\n var childNode = splitNode.children[0];\n var childHandle = splitNode.handles[0];\n // Clear the split node data.\n splitNode.children.length = 0;\n splitNode.handles.length = 0;\n splitNode.sizers.length = 0;\n // Remove the child handle from its parent node.\n if (childHandle.parentNode) {\n childHandle.parentNode.removeChild(childHandle);\n }\n // Handle the case where the split node is the root.\n if (this._root === splitNode) {\n childNode.parent = null;\n this._root = childNode;\n return;\n }\n // Otherwise, move the child node to the parent node...\n var parentNode = maybeParent;\n // Lookup the index of the split node.\n var j = parentNode.children.indexOf(splitNode);\n // Handle the case where the child node is a tab node.\n if (childNode instanceof Private.TabLayoutNode) {\n childNode.parent = parentNode;\n parentNode.children[j] = childNode;\n return;\n }\n // Remove the split data from the parent.\n var splitHandle = algorithm.ArrayExt.removeAt(parentNode.handles, j);\n algorithm.ArrayExt.removeAt(parentNode.children, j);\n algorithm.ArrayExt.removeAt(parentNode.sizers, j);\n // Remove the handle from its parent node.\n if (splitHandle.parentNode) {\n splitHandle.parentNode.removeChild(splitHandle);\n }\n // The child node and the split parent node will have the same\n // orientation. Merge the grand-children with the parent node.\n for (var i_1 = 0, n = childNode.children.length; i_1 < n; ++i_1) {\n var gChild = childNode.children[i_1];\n var gHandle = childNode.handles[i_1];\n var gSizer = childNode.sizers[i_1];\n algorithm.ArrayExt.insert(parentNode.children, j + i_1, gChild);\n algorithm.ArrayExt.insert(parentNode.handles, j + i_1, gHandle);\n algorithm.ArrayExt.insert(parentNode.sizers, j + i_1, gSizer);\n gChild.parent = parentNode;\n }\n // Clear the child node.\n childNode.children.length = 0;\n childNode.handles.length = 0;\n childNode.sizers.length = 0;\n childNode.parent = null;\n // Sync the handles on the parent node.\n parentNode.syncHandles();\n };\n /**\n * Insert a widget next to an existing tab.\n *\n * #### Notes\n * This does not attach the widget to the parent widget.\n */\n DockLayout.prototype._insertTab = function (widget, ref, refNode, after) {\n // Do nothing if the tab is inserted next to itself.\n if (widget === ref) {\n return;\n }\n // Create the root if it does not exist.\n if (!this._root) {\n var tabNode = new Private.TabLayoutNode(this._createTabBar());\n tabNode.tabBar.addTab(widget.title);\n this._root = tabNode;\n return;\n }\n // Use the first tab node as the ref node if needed.\n if (!refNode) {\n refNode = this._root.findFirstTabNode();\n }\n // If the widget is not contained in the ref node, ensure it is\n // removed from the layout and hidden before being added again.\n if (refNode.tabBar.titles.indexOf(widget.title) === -1) {\n this._removeWidget(widget);\n widget.hide();\n }\n // Lookup the target index for inserting the tab.\n var index;\n if (ref) {\n index = refNode.tabBar.titles.indexOf(ref.title);\n }\n else {\n index = refNode.tabBar.currentIndex;\n }\n // Insert the widget's tab relative to the target index.\n refNode.tabBar.insertTab(index + (after ? 1 : 0), widget.title);\n };\n /**\n * Insert a widget as a new split area.\n *\n * #### Notes\n * This does not attach the widget to the parent widget.\n */\n DockLayout.prototype._insertSplit = function (widget, ref, refNode, orientation, after) {\n // Do nothing if there is no effective split.\n if (widget === ref && refNode && refNode.tabBar.titles.length === 1) {\n return;\n }\n // Ensure the widget is removed from the current layout.\n this._removeWidget(widget);\n // Create the tab layout node to hold the widget.\n var tabNode = new Private.TabLayoutNode(this._createTabBar());\n tabNode.tabBar.addTab(widget.title);\n // Set the root if it does not exist.\n if (!this._root) {\n this._root = tabNode;\n return;\n }\n // If the ref node parent is null, split the root.\n if (!refNode || !refNode.parent) {\n // Ensure the root is split with the correct orientation.\n var root = this._splitRoot(orientation);\n // Determine the insert index for the new tab node.\n var i_2 = after ? root.children.length : 0;\n // Normalize the split node.\n root.normalizeSizes();\n // Create the sizer for new tab node.\n var sizer = Private.createSizer(refNode ? 1 : Private.GOLDEN_RATIO);\n // Insert the tab node sized to the golden ratio.\n algorithm.ArrayExt.insert(root.children, i_2, tabNode);\n algorithm.ArrayExt.insert(root.sizers, i_2, sizer);\n algorithm.ArrayExt.insert(root.handles, i_2, this._createHandle());\n tabNode.parent = root;\n // Re-normalize the split node to maintain the ratios.\n root.normalizeSizes();\n // Finally, synchronize the visibility of the handles.\n root.syncHandles();\n return;\n }\n // Lookup the split node for the ref widget.\n var splitNode = refNode.parent;\n // If the split node already had the correct orientation,\n // the widget can be inserted into the split node directly.\n if (splitNode.orientation === orientation) {\n // Find the index of the ref node.\n var i_3 = splitNode.children.indexOf(refNode);\n // Normalize the split node.\n splitNode.normalizeSizes();\n // Consume half the space for the insert location.\n var s = splitNode.sizers[i_3].sizeHint /= 2;\n // Insert the tab node sized to the other half.\n var j_1 = i_3 + (after ? 1 : 0);\n algorithm.ArrayExt.insert(splitNode.children, j_1, tabNode);\n algorithm.ArrayExt.insert(splitNode.sizers, j_1, Private.createSizer(s));\n algorithm.ArrayExt.insert(splitNode.handles, j_1, this._createHandle());\n tabNode.parent = splitNode;\n // Finally, synchronize the visibility of the handles.\n splitNode.syncHandles();\n return;\n }\n // Remove the ref node from the split node.\n var i = algorithm.ArrayExt.removeFirstOf(splitNode.children, refNode);\n // Create a new normalized split node for the children.\n var childNode = new Private.SplitLayoutNode(orientation);\n childNode.normalized = true;\n // Add the ref node sized to half the space.\n childNode.children.push(refNode);\n childNode.sizers.push(Private.createSizer(0.5));\n childNode.handles.push(this._createHandle());\n refNode.parent = childNode;\n // Add the tab node sized to the other half.\n var j = after ? 1 : 0;\n algorithm.ArrayExt.insert(childNode.children, j, tabNode);\n algorithm.ArrayExt.insert(childNode.sizers, j, Private.createSizer(0.5));\n algorithm.ArrayExt.insert(childNode.handles, j, this._createHandle());\n tabNode.parent = childNode;\n // Synchronize the visibility of the handles.\n childNode.syncHandles();\n // Finally, add the new child node to the original split node.\n algorithm.ArrayExt.insert(splitNode.children, i, childNode);\n childNode.parent = splitNode;\n };\n /**\n * Ensure the root is a split node with the given orientation.\n */\n DockLayout.prototype._splitRoot = function (orientation) {\n // Bail early if the root already meets the requirements.\n var oldRoot = this._root;\n if (oldRoot instanceof Private.SplitLayoutNode) {\n if (oldRoot.orientation === orientation) {\n return oldRoot;\n }\n }\n // Create a new root node with the specified orientation.\n var newRoot = this._root = new Private.SplitLayoutNode(orientation);\n // Add the old root to the new root.\n if (oldRoot) {\n newRoot.children.push(oldRoot);\n newRoot.sizers.push(Private.createSizer(0));\n newRoot.handles.push(this._createHandle());\n oldRoot.parent = newRoot;\n }\n // Return the new root as a convenience.\n return newRoot;\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n DockLayout.prototype._fit = function () {\n // Set up the computed minimum size.\n var minW = 0;\n var minH = 0;\n // Update the size limits for the layout tree.\n if (this._root) {\n var limits = this._root.fit(this._spacing, this._items);\n minW = limits.minWidth;\n minH = limits.minHeight;\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n DockLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Bail early if there is no root layout node.\n if (!this._root) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the actual layout bounds adjusted for border and padding.\n var x = this._box.paddingTop;\n var y = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Update the geometry of the layout tree.\n this._root.update(x, y, width, height, this._spacing, this._items);\n };\n /**\n * Create a new tab bar for use by the dock layout.\n *\n * #### Notes\n * The tab bar will be attached to the parent if it exists.\n */\n DockLayout.prototype._createTabBar = function () {\n // Create the tab bar using the renderer.\n var tabBar = this.renderer.createTabBar();\n // Enforce necessary tab bar behavior.\n tabBar.orientation = 'horizontal';\n // Reparent and attach the tab bar to the parent if possible.\n if (this.parent) {\n tabBar.parent = this.parent;\n this.attachWidget(tabBar);\n }\n // Return the initialized tab bar.\n return tabBar;\n };\n /**\n * Create a new handle for the dock layout.\n *\n * #### Notes\n * The handle will be attached to the parent if it exists.\n */\n DockLayout.prototype._createHandle = function () {\n // Create the handle using the renderer.\n var handle = this.renderer.createHandle();\n // Initialize the handle layout behavior.\n var style = handle.style;\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.width = '0';\n style.height = '0';\n // Attach the handle to the parent if it exists.\n if (this.parent) {\n this.parent.node.appendChild(handle);\n }\n // Return the initialized handle.\n return handle;\n };\n return DockLayout;\n}(layout.Layout));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A fraction used for sizing root panels; ~= `1 / golden_ratio`.\n */\n Private.GOLDEN_RATIO = 0.618;\n /**\n * Clamp a spacing value to an integer >= 0.\n */\n function clampSpacing(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampSpacing = clampSpacing;\n /**\n * Create a box sizer with an initial size hint.\n */\n function createSizer(hint) {\n var sizer = new boxengine.BoxSizer();\n sizer.sizeHint = hint;\n sizer.size = hint;\n return sizer;\n }\n Private.createSizer = createSizer;\n /**\n * Normalize an area config object and collect the visited widgets.\n */\n function normalizeAreaConfig(config, widgetSet) {\n var result;\n if (config.type === 'tab-area') {\n result = normalizeTabAreaConfig(config, widgetSet);\n }\n else {\n result = normalizeSplitAreaConfig(config, widgetSet);\n }\n return result;\n }\n Private.normalizeAreaConfig = normalizeAreaConfig;\n /**\n * Convert a normalized area config into a layout tree.\n */\n function realizeAreaConfig(config, renderer) {\n var node;\n if (config.type === 'tab-area') {\n node = realizeTabAreaConfig(config, renderer);\n }\n else {\n node = realizeSplitAreaConfig(config, renderer);\n }\n return node;\n }\n Private.realizeAreaConfig = realizeAreaConfig;\n /**\n * A layout node which holds the data for a tabbed area.\n */\n var TabLayoutNode = /** @class */ (function () {\n /**\n * Construct a new tab layout node.\n *\n * @param tabBar - The tab bar to use for the layout node.\n */\n function TabLayoutNode(tabBar) {\n /**\n * The parent of the layout node.\n */\n this.parent = null;\n this._top = 0;\n this._left = 0;\n this._width = 0;\n this._height = 0;\n var tabSizer = new boxengine.BoxSizer();\n var widgetSizer = new boxengine.BoxSizer();\n tabSizer.stretch = 0;\n widgetSizer.stretch = 1;\n this.tabBar = tabBar;\n this.sizers = [tabSizer, widgetSizer];\n }\n Object.defineProperty(TabLayoutNode.prototype, \"top\", {\n /**\n * The most recent value for the `top` edge of the layout box.\n */\n get: function () {\n return this._top;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabLayoutNode.prototype, \"left\", {\n /**\n * The most recent value for the `left` edge of the layout box.\n */\n get: function () {\n return this._left;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabLayoutNode.prototype, \"width\", {\n /**\n * The most recent value for the `width` of the layout box.\n */\n get: function () {\n return this._width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabLayoutNode.prototype, \"height\", {\n /**\n * The most recent value for the `height` of the layout box.\n */\n get: function () {\n return this._height;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator for all widgets in the layout tree.\n */\n TabLayoutNode.prototype.iterAllWidgets = function () {\n return algorithm.chain(algorithm.once(this.tabBar), this.iterUserWidgets());\n };\n /**\n * Create an iterator for the user widgets in the layout tree.\n */\n TabLayoutNode.prototype.iterUserWidgets = function () {\n return algorithm.map(this.tabBar.titles, function (title) { return title.owner; });\n };\n /**\n * Create an iterator for the selected widgets in the layout tree.\n */\n TabLayoutNode.prototype.iterSelectedWidgets = function () {\n var title = this.tabBar.currentTitle;\n return title ? algorithm.once(title.owner) : algorithm.empty();\n };\n /**\n * Create an iterator for the tab bars in the layout tree.\n */\n TabLayoutNode.prototype.iterTabBars = function () {\n return algorithm.once(this.tabBar);\n };\n /**\n * Create an iterator for the handles in the layout tree.\n */\n TabLayoutNode.prototype.iterHandles = function () {\n return algorithm.empty();\n };\n /**\n * Find the tab layout node which contains the given widget.\n */\n TabLayoutNode.prototype.findTabNode = function (widget) {\n return this.tabBar.titles.indexOf(widget.title) !== -1 ? this : null;\n };\n /**\n * Find the split layout node which contains the given handle.\n */\n TabLayoutNode.prototype.findSplitNode = function (handle) {\n return null;\n };\n /**\n * Find the first tab layout node in a layout tree.\n */\n TabLayoutNode.prototype.findFirstTabNode = function () {\n return this;\n };\n /**\n * Find the tab layout node which contains the local point.\n */\n TabLayoutNode.prototype.hitTestTabNodes = function (x, y) {\n if (x < this._left || x >= this._left + this._width) {\n return null;\n }\n if (y < this._top || y >= this._top + this._height) {\n return null;\n }\n return this;\n };\n /**\n * Create a configuration object for the layout tree.\n */\n TabLayoutNode.prototype.createConfig = function () {\n var widgets = this.tabBar.titles.map(function (title) { return title.owner; });\n var currentIndex = this.tabBar.currentIndex;\n return { type: 'tab-area', widgets: widgets, currentIndex: currentIndex };\n };\n /**\n * Recursively hold all of the sizes in the layout tree.\n *\n * This ignores the sizers of tab layout nodes.\n */\n TabLayoutNode.prototype.holdAllSizes = function () {\n return;\n };\n /**\n * Fit the layout tree.\n */\n TabLayoutNode.prototype.fit = function (spacing, items) {\n // Set up the limit variables.\n var minWidth = 0;\n var minHeight = 0;\n var maxWidth = Infinity;\n var maxHeight = Infinity;\n // Lookup the tab bar layout item.\n var tabBarItem = items.get(this.tabBar);\n // Lookup the widget layout item.\n var current = this.tabBar.currentTitle;\n var widgetItem = current ? items.get(current.owner) : undefined;\n // Lookup the tab bar and widget sizers.\n var _a = this.sizers, tabBarSizer = _a[0], widgetSizer = _a[1];\n // Update the tab bar limits.\n if (tabBarItem) {\n tabBarItem.fit();\n }\n // Update the widget limits.\n if (widgetItem) {\n widgetItem.fit();\n }\n // Update the results and sizer for the tab bar.\n if (tabBarItem && !tabBarItem.isHidden) {\n minWidth = Math.max(minWidth, tabBarItem.minWidth);\n minHeight += tabBarItem.minHeight;\n tabBarSizer.minSize = tabBarItem.minHeight;\n tabBarSizer.maxSize = tabBarItem.maxHeight;\n }\n else {\n tabBarSizer.minSize = 0;\n tabBarSizer.maxSize = 0;\n }\n // Update the results and sizer for the current widget.\n if (widgetItem && !widgetItem.isHidden) {\n minWidth = Math.max(minWidth, widgetItem.minWidth);\n minHeight += widgetItem.minHeight;\n widgetSizer.minSize = widgetItem.minHeight;\n widgetSizer.maxSize = Infinity;\n }\n else {\n widgetSizer.minSize = 0;\n widgetSizer.maxSize = Infinity;\n }\n // Return the computed size limits for the layout node.\n return { minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight };\n };\n /**\n * Update the layout tree.\n */\n TabLayoutNode.prototype.update = function (left, top, width, height, spacing, items) {\n // Update the layout box values.\n this._top = top;\n this._left = left;\n this._width = width;\n this._height = height;\n // Lookup the tab bar layout item.\n var tabBarItem = items.get(this.tabBar);\n // Lookup the widget layout item.\n var current = this.tabBar.currentTitle;\n var widgetItem = current ? items.get(current.owner) : undefined;\n // Distribute the layout space to the sizers.\n boxengine.BoxEngine.calc(this.sizers, height);\n // Update the tab bar item using the computed size.\n if (tabBarItem && !tabBarItem.isHidden) {\n var size = this.sizers[0].size;\n tabBarItem.update(left, top, width, size);\n top += size;\n }\n // Layout the widget using the computed size.\n if (widgetItem && !widgetItem.isHidden) {\n var size = this.sizers[1].size;\n widgetItem.update(left, top, width, size);\n }\n };\n return TabLayoutNode;\n }());\n Private.TabLayoutNode = TabLayoutNode;\n /**\n * A layout node which holds the data for a split area.\n */\n var SplitLayoutNode = /** @class */ (function () {\n /**\n * Construct a new split layout node.\n *\n * @param orientation - The orientation of the node.\n */\n function SplitLayoutNode(orientation) {\n /**\n * The parent of the layout node.\n */\n this.parent = null;\n /**\n * Whether the sizers have been normalized.\n */\n this.normalized = false;\n /**\n * The child nodes for the split node.\n */\n this.children = [];\n /**\n * The box sizers for the layout children.\n */\n this.sizers = [];\n /**\n * The handles for the layout children.\n */\n this.handles = [];\n this.orientation = orientation;\n }\n /**\n * Create an iterator for all widgets in the layout tree.\n */\n SplitLayoutNode.prototype.iterAllWidgets = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterAllWidgets(); });\n return new algorithm.ChainIterator(children);\n };\n /**\n * Create an iterator for the user widgets in the layout tree.\n */\n SplitLayoutNode.prototype.iterUserWidgets = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterUserWidgets(); });\n return new algorithm.ChainIterator(children);\n };\n /**\n * Create an iterator for the selected widgets in the layout tree.\n */\n SplitLayoutNode.prototype.iterSelectedWidgets = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterSelectedWidgets(); });\n return new algorithm.ChainIterator(children);\n };\n /**\n * Create an iterator for the tab bars in the layout tree.\n */\n SplitLayoutNode.prototype.iterTabBars = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterTabBars(); });\n return new algorithm.ChainIterator(children);\n };\n /**\n * Create an iterator for the handles in the layout tree.\n */\n SplitLayoutNode.prototype.iterHandles = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterHandles(); });\n return algorithm.chain(this.handles, new algorithm.ChainIterator(children));\n };\n /**\n * Find the tab layout node which contains the given widget.\n */\n SplitLayoutNode.prototype.findTabNode = function (widget) {\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var result = this.children[i].findTabNode(widget);\n if (result) {\n return result;\n }\n }\n return null;\n };\n /**\n * Find the split layout node which contains the given handle.\n */\n SplitLayoutNode.prototype.findSplitNode = function (handle) {\n var index = this.handles.indexOf(handle);\n if (index !== -1) {\n return { index: index, node: this };\n }\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var result = this.children[i].findSplitNode(handle);\n if (result) {\n return result;\n }\n }\n return null;\n };\n /**\n * Find the first tab layout node in a layout tree.\n */\n SplitLayoutNode.prototype.findFirstTabNode = function () {\n if (this.children.length === 0) {\n return null;\n }\n return this.children[0].findFirstTabNode();\n };\n /**\n * Find the tab layout node which contains the local point.\n */\n SplitLayoutNode.prototype.hitTestTabNodes = function (x, y) {\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var result = this.children[i].hitTestTabNodes(x, y);\n if (result) {\n return result;\n }\n }\n return null;\n };\n /**\n * Create a configuration object for the layout tree.\n */\n SplitLayoutNode.prototype.createConfig = function () {\n var orientation = this.orientation;\n var sizes = this.createNormalizedSizes();\n var children = this.children.map(function (child) { return child.createConfig(); });\n return { type: 'split-area', orientation: orientation, children: children, sizes: sizes };\n };\n /**\n * Sync the visibility and orientation of the handles.\n */\n SplitLayoutNode.prototype.syncHandles = function () {\n var _this = this;\n algorithm.each(this.handles, function (handle, i) {\n handle.setAttribute('data-orientation', _this.orientation);\n if (i === _this.handles.length - 1) {\n handle.classList.add('lm-mod-hidden');\n /* */\n handle.classList.add('p-mod-hidden');\n /* */\n }\n else {\n handle.classList.remove('lm-mod-hidden');\n /* */\n handle.classList.remove('p-mod-hidden');\n /* */\n }\n });\n };\n /**\n * Hold the current sizes of the box sizers.\n *\n * This sets the size hint of each sizer to its current size.\n */\n SplitLayoutNode.prototype.holdSizes = function () {\n algorithm.each(this.sizers, function (sizer) { sizer.sizeHint = sizer.size; });\n };\n /**\n * Recursively hold all of the sizes in the layout tree.\n *\n * This ignores the sizers of tab layout nodes.\n */\n SplitLayoutNode.prototype.holdAllSizes = function () {\n algorithm.each(this.children, function (child) { return child.holdAllSizes(); });\n this.holdSizes();\n };\n /**\n * Normalize the sizes of the split layout node.\n */\n SplitLayoutNode.prototype.normalizeSizes = function () {\n // Bail early if the sizers are empty.\n var n = this.sizers.length;\n if (n === 0) {\n return;\n }\n // Hold the current sizes of the sizers.\n this.holdSizes();\n // Compute the sum of the sizes.\n var sum = algorithm.reduce(this.sizers, function (v, sizer) { return v + sizer.sizeHint; }, 0);\n // Normalize the sizes based on the sum.\n if (sum === 0) {\n algorithm.each(this.sizers, function (sizer) {\n sizer.size = sizer.sizeHint = 1 / n;\n });\n }\n else {\n algorithm.each(this.sizers, function (sizer) {\n sizer.size = sizer.sizeHint /= sum;\n });\n }\n // Mark the sizes as normalized.\n this.normalized = true;\n };\n /**\n * Snap the normalized sizes of the split layout node.\n */\n SplitLayoutNode.prototype.createNormalizedSizes = function () {\n // Bail early if the sizers are empty.\n var n = this.sizers.length;\n if (n === 0) {\n return [];\n }\n // Grab the current sizes of the sizers.\n var sizes = this.sizers.map(function (sizer) { return sizer.size; });\n // Compute the sum of the sizes.\n var sum = algorithm.reduce(sizes, function (v, size) { return v + size; }, 0);\n // Normalize the sizes based on the sum.\n if (sum === 0) {\n algorithm.each(sizes, function (size, i) { sizes[i] = 1 / n; });\n }\n else {\n algorithm.each(sizes, function (size, i) { sizes[i] = size / sum; });\n }\n // Return the normalized sizes.\n return sizes;\n };\n /**\n * Fit the layout tree.\n */\n SplitLayoutNode.prototype.fit = function (spacing, items) {\n // Compute the required fixed space.\n var horizontal = this.orientation === 'horizontal';\n var fixed = Math.max(0, this.children.length - 1) * spacing;\n // Set up the limit variables.\n var minWidth = horizontal ? fixed : 0;\n var minHeight = horizontal ? 0 : fixed;\n var maxWidth = Infinity;\n var maxHeight = Infinity;\n // Fit the children and update the limits.\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var limits = this.children[i].fit(spacing, items);\n if (horizontal) {\n minHeight = Math.max(minHeight, limits.minHeight);\n minWidth += limits.minWidth;\n this.sizers[i].minSize = limits.minWidth;\n }\n else {\n minWidth = Math.max(minWidth, limits.minWidth);\n minHeight += limits.minHeight;\n this.sizers[i].minSize = limits.minHeight;\n }\n }\n // Return the computed limits for the layout node.\n return { minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight };\n };\n /**\n * Update the layout tree.\n */\n SplitLayoutNode.prototype.update = function (left, top, width, height, spacing, items) {\n // Compute the available layout space.\n var horizontal = this.orientation === 'horizontal';\n var fixed = Math.max(0, this.children.length - 1) * spacing;\n var space = Math.max(0, (horizontal ? width : height) - fixed);\n // De-normalize the sizes if needed.\n if (this.normalized) {\n algorithm.each(this.sizers, function (sizer) { sizer.sizeHint *= space; });\n this.normalized = false;\n }\n // Distribute the layout space to the sizers.\n boxengine.BoxEngine.calc(this.sizers, space);\n // Update the geometry of the child nodes and handles.\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var child = this.children[i];\n var size = this.sizers[i].size;\n var handleStyle = this.handles[i].style;\n if (horizontal) {\n child.update(left, top, size, height, spacing, items);\n left += size;\n handleStyle.top = top + \"px\";\n handleStyle.left = left + \"px\";\n handleStyle.width = spacing + \"px\";\n handleStyle.height = height + \"px\";\n left += spacing;\n }\n else {\n child.update(left, top, width, size, spacing, items);\n top += size;\n handleStyle.top = top + \"px\";\n handleStyle.left = left + \"px\";\n handleStyle.width = width + \"px\";\n handleStyle.height = spacing + \"px\";\n top += spacing;\n }\n }\n };\n return SplitLayoutNode;\n }());\n Private.SplitLayoutNode = SplitLayoutNode;\n /**\n * Normalize a tab area config and collect the visited widgets.\n */\n function normalizeTabAreaConfig(config, widgetSet) {\n // Bail early if there is no content.\n if (config.widgets.length === 0) {\n return null;\n }\n // Setup the filtered widgets array.\n var widgets = [];\n // Filter the config for unique widgets.\n algorithm.each(config.widgets, function (widget) {\n if (!widgetSet.has(widget)) {\n widgetSet.add(widget);\n widgets.push(widget);\n }\n });\n // Bail if there are no effective widgets.\n if (widgets.length === 0) {\n return null;\n }\n // Normalize the current index.\n var index = config.currentIndex;\n if (index !== -1 && (index < 0 || index >= widgets.length)) {\n index = 0;\n }\n // Return a normalized config object.\n return { type: 'tab-area', widgets: widgets, currentIndex: index };\n }\n /**\n * Normalize a split area config and collect the visited widgets.\n */\n function normalizeSplitAreaConfig(config, widgetSet) {\n // Set up the result variables.\n var orientation = config.orientation;\n var children = [];\n var sizes = [];\n // Normalize the config children.\n for (var i = 0, n = config.children.length; i < n; ++i) {\n // Normalize the child config.\n var child = normalizeAreaConfig(config.children[i], widgetSet);\n // Ignore an empty child.\n if (!child) {\n continue;\n }\n // Add the child or hoist its content as appropriate.\n if (child.type === 'tab-area' || child.orientation !== orientation) {\n children.push(child);\n sizes.push(Math.abs(config.sizes[i] || 0));\n }\n else {\n children.push.apply(children, child.children);\n sizes.push.apply(sizes, child.sizes);\n }\n }\n // Bail if there are no effective children.\n if (children.length === 0) {\n return null;\n }\n // If there is only one effective child, return that child.\n if (children.length === 1) {\n return children[0];\n }\n // Return a normalized config object.\n return { type: 'split-area', orientation: orientation, children: children, sizes: sizes };\n }\n /**\n * Convert a normalized tab area config into a layout tree.\n */\n function realizeTabAreaConfig(config, renderer) {\n // Create the tab bar for the layout node.\n var tabBar = renderer.createTabBar();\n // Hide each widget and add it to the tab bar.\n algorithm.each(config.widgets, function (widget) {\n widget.hide();\n tabBar.addTab(widget.title);\n });\n // Set the current index of the tab bar.\n tabBar.currentIndex = config.currentIndex;\n // Return the new tab layout node.\n return new TabLayoutNode(tabBar);\n }\n /**\n * Convert a normalized split area config into a layout tree.\n */\n function realizeSplitAreaConfig(config, renderer) {\n // Create the split layout node.\n var node = new SplitLayoutNode(config.orientation);\n // Add each child to the layout node.\n algorithm.each(config.children, function (child, i) {\n // Create the child data for the layout node.\n var childNode = realizeAreaConfig(child, renderer);\n var sizer = createSizer(config.sizes[i]);\n var handle = renderer.createHandle();\n // Add the child data to the layout node.\n node.children.push(childNode);\n node.handles.push(handle);\n node.sizers.push(sizer);\n // Update the parent for the child node.\n childNode.parent = node;\n });\n // Synchronize the handle state for the layout node.\n node.syncHandles();\n // Normalize the sizes for the layout node.\n node.normalizeSizes();\n // Return the new layout node.\n return node;\n }\n})(Private || (Private = {}));\n\nexports.DockLayout = DockLayout;\n//# sourceMappingURL=docklayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/docklayout.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n\n/**\n * A layout which provides a flexible docking arrangement.\n *\n * #### Notes\n * The consumer of this layout is responsible for handling all signals\n * from the generated tab bars and managing the visibility of widgets\n * and tab bars as needed.\n */\nvar DockLayout = /** @class */ (function (_super) {\n tslib.__extends(DockLayout, _super);\n /**\n * Construct a new dock layout.\n *\n * @param options - The options for initializing the layout.\n */\n function DockLayout(options) {\n var _this = _super.call(this) || this;\n _this._spacing = 4;\n _this._dirty = false;\n _this._root = null;\n _this._box = null;\n _this._items = new Map();\n _this.renderer = options.renderer;\n if (options.spacing !== undefined) {\n _this._spacing = Private.clampSpacing(options.spacing);\n }\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n *\n * #### Notes\n * This will clear and dispose all widgets in the layout.\n */\n DockLayout.prototype.dispose = function () {\n // Get an iterator over the widgets in the layout.\n var widgets = this.iter();\n // Dispose of the layout items.\n this._items.forEach(function (item) { item.dispose(); });\n // Clear the layout state before disposing the widgets.\n this._box = null;\n this._root = null;\n this._items.clear();\n // Dispose of the widgets contained in the old layout root.\n algorithm.each(widgets, function (widget) { widget.dispose(); });\n // Dispose of the base class.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(DockLayout.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the dock layout.\n */\n get: function () {\n return this._spacing;\n },\n /**\n * Set the inter-element spacing for the dock layout.\n */\n set: function (value) {\n value = Private.clampSpacing(value);\n if (this._spacing === value) {\n return;\n }\n this._spacing = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockLayout.prototype, \"isEmpty\", {\n /**\n * Whether the dock layout is empty.\n */\n get: function () {\n return this._root === null;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over all widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n *\n * #### Notes\n * This iterator includes the generated tab bars.\n */\n DockLayout.prototype.iter = function () {\n return this._root ? this._root.iterAllWidgets() : algorithm.empty();\n };\n /**\n * Create an iterator over the user widgets in the layout.\n *\n * @returns A new iterator over the user widgets in the layout.\n *\n * #### Notes\n * This iterator does not include the generated tab bars.\n */\n DockLayout.prototype.widgets = function () {\n return this._root ? this._root.iterUserWidgets() : algorithm.empty();\n };\n /**\n * Create an iterator over the selected widgets in the layout.\n *\n * @returns A new iterator over the selected user widgets.\n *\n * #### Notes\n * This iterator yields the widgets corresponding to the current tab\n * of each tab bar in the layout.\n */\n DockLayout.prototype.selectedWidgets = function () {\n return this._root ? this._root.iterSelectedWidgets() : algorithm.empty();\n };\n /**\n * Create an iterator over the tab bars in the layout.\n *\n * @returns A new iterator over the tab bars in the layout.\n *\n * #### Notes\n * This iterator does not include the user widgets.\n */\n DockLayout.prototype.tabBars = function () {\n return this._root ? this._root.iterTabBars() : algorithm.empty();\n };\n /**\n * Create an iterator over the handles in the layout.\n *\n * @returns A new iterator over the handles in the layout.\n */\n DockLayout.prototype.handles = function () {\n return this._root ? this._root.iterHandles() : algorithm.empty();\n };\n /**\n * Move a handle to the given offset position.\n *\n * @param handle - The handle to move.\n *\n * @param offsetX - The desired offset X position of the handle.\n *\n * @param offsetY - The desired offset Y position of the handle.\n *\n * #### Notes\n * If the given handle is not contained in the layout, this is no-op.\n *\n * The handle will be moved as close as possible to the desired\n * position without violating any of the layout constraints.\n *\n * Only one of the coordinates is used depending on the orientation\n * of the handle. This method accepts both coordinates to make it\n * easy to invoke from a mouse move event without needing to know\n * the handle orientation.\n */\n DockLayout.prototype.moveHandle = function (handle, offsetX, offsetY) {\n // Bail early if there is no root or if the handle is hidden.\n var hidden = handle.classList.contains('lm-mod-hidden');\n /* */\n hidden = hidden || handle.classList.contains('p-mod-hidden');\n /* */\n if (!this._root || hidden) {\n return;\n }\n // Lookup the split node for the handle.\n var data = this._root.findSplitNode(handle);\n if (!data) {\n return;\n }\n // Compute the desired delta movement for the handle.\n var delta;\n if (data.node.orientation === 'horizontal') {\n delta = offsetX - handle.offsetLeft;\n }\n else {\n delta = offsetY - handle.offsetTop;\n }\n // Bail if there is no handle movement.\n if (delta === 0) {\n return;\n }\n // Prevent sibling resizing unless needed.\n data.node.holdSizes();\n // Adjust the sizers to reflect the handle movement.\n boxengine.BoxEngine.adjust(data.node.sizers, data.index, delta);\n // Update the layout of the widgets.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Save the current configuration of the dock layout.\n *\n * @returns A new config object for the current layout state.\n *\n * #### Notes\n * The return value can be provided to the `restoreLayout` method\n * in order to restore the layout to its current configuration.\n */\n DockLayout.prototype.saveLayout = function () {\n // Bail early if there is no root.\n if (!this._root) {\n return { main: null };\n }\n // Hold the current sizes in the layout tree.\n this._root.holdAllSizes();\n // Return the layout config.\n return { main: this._root.createConfig() };\n };\n /**\n * Restore the layout to a previously saved configuration.\n *\n * @param config - The layout configuration to restore.\n *\n * #### Notes\n * Widgets which currently belong to the layout but which are not\n * contained in the config will be unparented.\n */\n DockLayout.prototype.restoreLayout = function (config) {\n var _this = this;\n // Create the widget set for validating the config.\n var widgetSet = new Set();\n // Normalize the main area config and collect the widgets.\n var mainConfig;\n if (config.main) {\n mainConfig = Private.normalizeAreaConfig(config.main, widgetSet);\n }\n else {\n mainConfig = null;\n }\n // Create iterators over the old content.\n var oldWidgets = this.widgets();\n var oldTabBars = this.tabBars();\n var oldHandles = this.handles();\n // Clear the root before removing the old content.\n this._root = null;\n // Unparent the old widgets which are not in the new config.\n algorithm.each(oldWidgets, function (widget) {\n if (!widgetSet.has(widget)) {\n widget.parent = null;\n }\n });\n // Dispose of the old tab bars.\n algorithm.each(oldTabBars, function (tabBar) {\n tabBar.dispose();\n });\n // Remove the old handles.\n algorithm.each(oldHandles, function (handle) {\n if (handle.parentNode) {\n handle.parentNode.removeChild(handle);\n }\n });\n // Reparent the new widgets to the current parent.\n widgetSet.forEach(function (widget) {\n widget.parent = _this.parent;\n });\n // Create the root node for the new config.\n if (mainConfig) {\n this._root = Private.realizeAreaConfig(mainConfig, {\n createTabBar: function () { return _this._createTabBar(); },\n createHandle: function () { return _this._createHandle(); }\n });\n }\n else {\n this._root = null;\n }\n // If there is no parent, there is nothing more to do.\n if (!this.parent) {\n return;\n }\n // Attach the new widgets to the parent.\n widgetSet.forEach(function (widget) {\n _this.attachWidget(widget);\n });\n // Post a fit request to the parent.\n this.parent.fit();\n };\n /**\n * Add a widget to the dock layout.\n *\n * @param widget - The widget to add to the dock layout.\n *\n * @param options - The additional options for adding the widget.\n *\n * #### Notes\n * The widget will be moved if it is already contained in the layout.\n *\n * An error will be thrown if the reference widget is invalid.\n */\n DockLayout.prototype.addWidget = function (widget, options) {\n if (options === void 0) { options = {}; }\n // Parse the options.\n var ref = options.ref || null;\n var mode = options.mode || 'tab-after';\n // Find the tab node which holds the reference widget.\n var refNode = null;\n if (this._root && ref) {\n refNode = this._root.findTabNode(ref);\n }\n // Throw an error if the reference widget is invalid.\n if (ref && !refNode) {\n throw new Error('Reference widget is not in the layout.');\n }\n // Reparent the widget to the current layout parent.\n widget.parent = this.parent;\n // Insert the widget according to the insert mode.\n switch (mode) {\n case 'tab-after':\n this._insertTab(widget, ref, refNode, true);\n break;\n case 'tab-before':\n this._insertTab(widget, ref, refNode, false);\n break;\n case 'split-top':\n this._insertSplit(widget, ref, refNode, 'vertical', false);\n break;\n case 'split-left':\n this._insertSplit(widget, ref, refNode, 'horizontal', false);\n break;\n case 'split-right':\n this._insertSplit(widget, ref, refNode, 'horizontal', true);\n break;\n case 'split-bottom':\n this._insertSplit(widget, ref, refNode, 'vertical', true);\n break;\n }\n // Do nothing else if there is no parent widget.\n if (!this.parent) {\n return;\n }\n // Ensure the widget is attached to the parent widget.\n this.attachWidget(widget);\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Remove a widget from the layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n DockLayout.prototype.removeWidget = function (widget) {\n // Remove the widget from its current layout location.\n this._removeWidget(widget);\n // Do nothing else if there is no parent widget.\n if (!this.parent) {\n return;\n }\n // Detach the widget from the parent widget.\n this.detachWidget(widget);\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Find the tab area which contains the given client position.\n *\n * @param clientX - The client X position of interest.\n *\n * @param clientY - The client Y position of interest.\n *\n * @returns The geometry of the tab area at the given position, or\n * `null` if there is no tab area at the given position.\n */\n DockLayout.prototype.hitTestTabAreas = function (clientX, clientY) {\n // Bail early if hit testing cannot produce valid results.\n if (!this._root || !this.parent || !this.parent.isVisible) {\n return null;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Convert from client to local coordinates.\n var rect = this.parent.node.getBoundingClientRect();\n var x = clientX - rect.left - this._box.borderLeft;\n var y = clientY - rect.top - this._box.borderTop;\n // Find the tab layout node at the local position.\n var tabNode = this._root.hitTestTabNodes(x, y);\n // Bail if a tab layout node was not found.\n if (!tabNode) {\n return null;\n }\n // Extract the data from the tab node.\n var tabBar = tabNode.tabBar, top = tabNode.top, left = tabNode.left, width = tabNode.width, height = tabNode.height;\n // Compute the right and bottom edges of the tab area.\n var borderWidth = this._box.borderLeft + this._box.borderRight;\n var borderHeight = this._box.borderTop + this._box.borderBottom;\n var right = rect.width - borderWidth - (left + width);\n var bottom = rect.height - borderHeight - (top + height);\n // Return the hit test results.\n return { tabBar: tabBar, x: x, y: y, top: top, left: left, right: right, bottom: bottom, width: width, height: height };\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n DockLayout.prototype.init = function () {\n var _this = this;\n // Perform superclass initialization.\n _super.prototype.init.call(this);\n // Attach each widget to the parent.\n algorithm.each(this, function (widget) { _this.attachWidget(widget); });\n // Attach each handle to the parent.\n algorithm.each(this.handles(), function (handle) { _this.parent.node.appendChild(handle); });\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Attach the widget to the layout parent widget.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a no-op if the widget is already attached.\n */\n DockLayout.prototype.attachWidget = function (widget$1) {\n // Do nothing if the widget is already attached.\n if (this.parent.node === widget$1.node.parentNode) {\n return;\n }\n // Create the layout item for the widget.\n this._items.set(widget$1, new layout.LayoutItem(widget$1));\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n };\n /**\n * Detach the widget from the layout parent widget.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a no-op if the widget is not attached.\n */\n DockLayout.prototype.detachWidget = function (widget$1) {\n // Do nothing if the widget is not attached.\n if (this.parent.node !== widget$1.node.parentNode) {\n return;\n }\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Delete the layout item for the widget.\n var item = this._items.get(widget$1);\n if (item) {\n this._items.delete(widget$1);\n item.dispose();\n }\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n DockLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n DockLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n DockLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n DockLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n DockLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n DockLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n DockLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Remove the specified widget from the layout structure.\n *\n * #### Notes\n * This is a no-op if the widget is not in the layout tree.\n *\n * This does not detach the widget from the parent node.\n */\n DockLayout.prototype._removeWidget = function (widget) {\n // Bail early if there is no layout root.\n if (!this._root) {\n return;\n }\n // Find the tab node which contains the given widget.\n var tabNode = this._root.findTabNode(widget);\n // Bail early if the tab node is not found.\n if (!tabNode) {\n return;\n }\n // If there are multiple tabs, just remove the widget's tab.\n if (tabNode.tabBar.titles.length > 1) {\n tabNode.tabBar.removeTab(widget.title);\n return;\n }\n // Otherwise, the tab node needs to be removed...\n // Dispose the tab bar.\n tabNode.tabBar.dispose();\n // Handle the case where the tab node is the root.\n if (this._root === tabNode) {\n this._root = null;\n return;\n }\n // Otherwise, remove the tab node from its parent...\n // Prevent widget resizing unless needed.\n this._root.holdAllSizes();\n // Clear the parent reference on the tab node.\n var splitNode = tabNode.parent;\n tabNode.parent = null;\n // Remove the tab node from its parent split node.\n var i = algorithm.ArrayExt.removeFirstOf(splitNode.children, tabNode);\n var handle = algorithm.ArrayExt.removeAt(splitNode.handles, i);\n algorithm.ArrayExt.removeAt(splitNode.sizers, i);\n // Remove the handle from its parent DOM node.\n if (handle.parentNode) {\n handle.parentNode.removeChild(handle);\n }\n // If there are multiple children, just update the handles.\n if (splitNode.children.length > 1) {\n splitNode.syncHandles();\n return;\n }\n // Otherwise, the split node also needs to be removed...\n // Clear the parent reference on the split node.\n var maybeParent = splitNode.parent;\n splitNode.parent = null;\n // Lookup the remaining child node and handle.\n var childNode = splitNode.children[0];\n var childHandle = splitNode.handles[0];\n // Clear the split node data.\n splitNode.children.length = 0;\n splitNode.handles.length = 0;\n splitNode.sizers.length = 0;\n // Remove the child handle from its parent node.\n if (childHandle.parentNode) {\n childHandle.parentNode.removeChild(childHandle);\n }\n // Handle the case where the split node is the root.\n if (this._root === splitNode) {\n childNode.parent = null;\n this._root = childNode;\n return;\n }\n // Otherwise, move the child node to the parent node...\n var parentNode = maybeParent;\n // Lookup the index of the split node.\n var j = parentNode.children.indexOf(splitNode);\n // Handle the case where the child node is a tab node.\n if (childNode instanceof Private.TabLayoutNode) {\n childNode.parent = parentNode;\n parentNode.children[j] = childNode;\n return;\n }\n // Remove the split data from the parent.\n var splitHandle = algorithm.ArrayExt.removeAt(parentNode.handles, j);\n algorithm.ArrayExt.removeAt(parentNode.children, j);\n algorithm.ArrayExt.removeAt(parentNode.sizers, j);\n // Remove the handle from its parent node.\n if (splitHandle.parentNode) {\n splitHandle.parentNode.removeChild(splitHandle);\n }\n // The child node and the split parent node will have the same\n // orientation. Merge the grand-children with the parent node.\n for (var i_1 = 0, n = childNode.children.length; i_1 < n; ++i_1) {\n var gChild = childNode.children[i_1];\n var gHandle = childNode.handles[i_1];\n var gSizer = childNode.sizers[i_1];\n algorithm.ArrayExt.insert(parentNode.children, j + i_1, gChild);\n algorithm.ArrayExt.insert(parentNode.handles, j + i_1, gHandle);\n algorithm.ArrayExt.insert(parentNode.sizers, j + i_1, gSizer);\n gChild.parent = parentNode;\n }\n // Clear the child node.\n childNode.children.length = 0;\n childNode.handles.length = 0;\n childNode.sizers.length = 0;\n childNode.parent = null;\n // Sync the handles on the parent node.\n parentNode.syncHandles();\n };\n /**\n * Insert a widget next to an existing tab.\n *\n * #### Notes\n * This does not attach the widget to the parent widget.\n */\n DockLayout.prototype._insertTab = function (widget, ref, refNode, after) {\n // Do nothing if the tab is inserted next to itself.\n if (widget === ref) {\n return;\n }\n // Create the root if it does not exist.\n if (!this._root) {\n var tabNode = new Private.TabLayoutNode(this._createTabBar());\n tabNode.tabBar.addTab(widget.title);\n this._root = tabNode;\n return;\n }\n // Use the first tab node as the ref node if needed.\n if (!refNode) {\n refNode = this._root.findFirstTabNode();\n }\n // If the widget is not contained in the ref node, ensure it is\n // removed from the layout and hidden before being added again.\n if (refNode.tabBar.titles.indexOf(widget.title) === -1) {\n this._removeWidget(widget);\n widget.hide();\n }\n // Lookup the target index for inserting the tab.\n var index;\n if (ref) {\n index = refNode.tabBar.titles.indexOf(ref.title);\n }\n else {\n index = refNode.tabBar.currentIndex;\n }\n // Insert the widget's tab relative to the target index.\n refNode.tabBar.insertTab(index + (after ? 1 : 0), widget.title);\n };\n /**\n * Insert a widget as a new split area.\n *\n * #### Notes\n * This does not attach the widget to the parent widget.\n */\n DockLayout.prototype._insertSplit = function (widget, ref, refNode, orientation, after) {\n // Do nothing if there is no effective split.\n if (widget === ref && refNode && refNode.tabBar.titles.length === 1) {\n return;\n }\n // Ensure the widget is removed from the current layout.\n this._removeWidget(widget);\n // Create the tab layout node to hold the widget.\n var tabNode = new Private.TabLayoutNode(this._createTabBar());\n tabNode.tabBar.addTab(widget.title);\n // Set the root if it does not exist.\n if (!this._root) {\n this._root = tabNode;\n return;\n }\n // If the ref node parent is null, split the root.\n if (!refNode || !refNode.parent) {\n // Ensure the root is split with the correct orientation.\n var root = this._splitRoot(orientation);\n // Determine the insert index for the new tab node.\n var i_2 = after ? root.children.length : 0;\n // Normalize the split node.\n root.normalizeSizes();\n // Create the sizer for new tab node.\n var sizer = Private.createSizer(refNode ? 1 : Private.GOLDEN_RATIO);\n // Insert the tab node sized to the golden ratio.\n algorithm.ArrayExt.insert(root.children, i_2, tabNode);\n algorithm.ArrayExt.insert(root.sizers, i_2, sizer);\n algorithm.ArrayExt.insert(root.handles, i_2, this._createHandle());\n tabNode.parent = root;\n // Re-normalize the split node to maintain the ratios.\n root.normalizeSizes();\n // Finally, synchronize the visibility of the handles.\n root.syncHandles();\n return;\n }\n // Lookup the split node for the ref widget.\n var splitNode = refNode.parent;\n // If the split node already had the correct orientation,\n // the widget can be inserted into the split node directly.\n if (splitNode.orientation === orientation) {\n // Find the index of the ref node.\n var i_3 = splitNode.children.indexOf(refNode);\n // Normalize the split node.\n splitNode.normalizeSizes();\n // Consume half the space for the insert location.\n var s = splitNode.sizers[i_3].sizeHint /= 2;\n // Insert the tab node sized to the other half.\n var j_1 = i_3 + (after ? 1 : 0);\n algorithm.ArrayExt.insert(splitNode.children, j_1, tabNode);\n algorithm.ArrayExt.insert(splitNode.sizers, j_1, Private.createSizer(s));\n algorithm.ArrayExt.insert(splitNode.handles, j_1, this._createHandle());\n tabNode.parent = splitNode;\n // Finally, synchronize the visibility of the handles.\n splitNode.syncHandles();\n return;\n }\n // Remove the ref node from the split node.\n var i = algorithm.ArrayExt.removeFirstOf(splitNode.children, refNode);\n // Create a new normalized split node for the children.\n var childNode = new Private.SplitLayoutNode(orientation);\n childNode.normalized = true;\n // Add the ref node sized to half the space.\n childNode.children.push(refNode);\n childNode.sizers.push(Private.createSizer(0.5));\n childNode.handles.push(this._createHandle());\n refNode.parent = childNode;\n // Add the tab node sized to the other half.\n var j = after ? 1 : 0;\n algorithm.ArrayExt.insert(childNode.children, j, tabNode);\n algorithm.ArrayExt.insert(childNode.sizers, j, Private.createSizer(0.5));\n algorithm.ArrayExt.insert(childNode.handles, j, this._createHandle());\n tabNode.parent = childNode;\n // Synchronize the visibility of the handles.\n childNode.syncHandles();\n // Finally, add the new child node to the original split node.\n algorithm.ArrayExt.insert(splitNode.children, i, childNode);\n childNode.parent = splitNode;\n };\n /**\n * Ensure the root is a split node with the given orientation.\n */\n DockLayout.prototype._splitRoot = function (orientation) {\n // Bail early if the root already meets the requirements.\n var oldRoot = this._root;\n if (oldRoot instanceof Private.SplitLayoutNode) {\n if (oldRoot.orientation === orientation) {\n return oldRoot;\n }\n }\n // Create a new root node with the specified orientation.\n var newRoot = this._root = new Private.SplitLayoutNode(orientation);\n // Add the old root to the new root.\n if (oldRoot) {\n newRoot.children.push(oldRoot);\n newRoot.sizers.push(Private.createSizer(0));\n newRoot.handles.push(this._createHandle());\n oldRoot.parent = newRoot;\n }\n // Return the new root as a convenience.\n return newRoot;\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n DockLayout.prototype._fit = function () {\n // Set up the computed minimum size.\n var minW = 0;\n var minH = 0;\n // Update the size limits for the layout tree.\n if (this._root) {\n var limits = this._root.fit(this._spacing, this._items);\n minW = limits.minWidth;\n minH = limits.minHeight;\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n DockLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Bail early if there is no root layout node.\n if (!this._root) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the actual layout bounds adjusted for border and padding.\n var x = this._box.paddingTop;\n var y = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Update the geometry of the layout tree.\n this._root.update(x, y, width, height, this._spacing, this._items);\n };\n /**\n * Create a new tab bar for use by the dock layout.\n *\n * #### Notes\n * The tab bar will be attached to the parent if it exists.\n */\n DockLayout.prototype._createTabBar = function () {\n // Create the tab bar using the renderer.\n var tabBar = this.renderer.createTabBar();\n // Enforce necessary tab bar behavior.\n tabBar.orientation = 'horizontal';\n // Reparent and attach the tab bar to the parent if possible.\n if (this.parent) {\n tabBar.parent = this.parent;\n this.attachWidget(tabBar);\n }\n // Return the initialized tab bar.\n return tabBar;\n };\n /**\n * Create a new handle for the dock layout.\n *\n * #### Notes\n * The handle will be attached to the parent if it exists.\n */\n DockLayout.prototype._createHandle = function () {\n // Create the handle using the renderer.\n var handle = this.renderer.createHandle();\n // Initialize the handle layout behavior.\n var style = handle.style;\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.width = '0';\n style.height = '0';\n // Attach the handle to the parent if it exists.\n if (this.parent) {\n this.parent.node.appendChild(handle);\n }\n // Return the initialized handle.\n return handle;\n };\n return DockLayout;\n}(layout.Layout));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A fraction used for sizing root panels; ~= `1 / golden_ratio`.\n */\n Private.GOLDEN_RATIO = 0.618;\n /**\n * Clamp a spacing value to an integer >= 0.\n */\n function clampSpacing(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampSpacing = clampSpacing;\n /**\n * Create a box sizer with an initial size hint.\n */\n function createSizer(hint) {\n var sizer = new boxengine.BoxSizer();\n sizer.sizeHint = hint;\n sizer.size = hint;\n return sizer;\n }\n Private.createSizer = createSizer;\n /**\n * Normalize an area config object and collect the visited widgets.\n */\n function normalizeAreaConfig(config, widgetSet) {\n var result;\n if (config.type === 'tab-area') {\n result = normalizeTabAreaConfig(config, widgetSet);\n }\n else {\n result = normalizeSplitAreaConfig(config, widgetSet);\n }\n return result;\n }\n Private.normalizeAreaConfig = normalizeAreaConfig;\n /**\n * Convert a normalized area config into a layout tree.\n */\n function realizeAreaConfig(config, renderer) {\n var node;\n if (config.type === 'tab-area') {\n node = realizeTabAreaConfig(config, renderer);\n }\n else {\n node = realizeSplitAreaConfig(config, renderer);\n }\n return node;\n }\n Private.realizeAreaConfig = realizeAreaConfig;\n /**\n * A layout node which holds the data for a tabbed area.\n */\n var TabLayoutNode = /** @class */ (function () {\n /**\n * Construct a new tab layout node.\n *\n * @param tabBar - The tab bar to use for the layout node.\n */\n function TabLayoutNode(tabBar) {\n /**\n * The parent of the layout node.\n */\n this.parent = null;\n this._top = 0;\n this._left = 0;\n this._width = 0;\n this._height = 0;\n var tabSizer = new boxengine.BoxSizer();\n var widgetSizer = new boxengine.BoxSizer();\n tabSizer.stretch = 0;\n widgetSizer.stretch = 1;\n this.tabBar = tabBar;\n this.sizers = [tabSizer, widgetSizer];\n }\n Object.defineProperty(TabLayoutNode.prototype, \"top\", {\n /**\n * The most recent value for the `top` edge of the layout box.\n */\n get: function () {\n return this._top;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabLayoutNode.prototype, \"left\", {\n /**\n * The most recent value for the `left` edge of the layout box.\n */\n get: function () {\n return this._left;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabLayoutNode.prototype, \"width\", {\n /**\n * The most recent value for the `width` of the layout box.\n */\n get: function () {\n return this._width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabLayoutNode.prototype, \"height\", {\n /**\n * The most recent value for the `height` of the layout box.\n */\n get: function () {\n return this._height;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator for all widgets in the layout tree.\n */\n TabLayoutNode.prototype.iterAllWidgets = function () {\n return algorithm.chain(algorithm.once(this.tabBar), this.iterUserWidgets());\n };\n /**\n * Create an iterator for the user widgets in the layout tree.\n */\n TabLayoutNode.prototype.iterUserWidgets = function () {\n return algorithm.map(this.tabBar.titles, function (title) { return title.owner; });\n };\n /**\n * Create an iterator for the selected widgets in the layout tree.\n */\n TabLayoutNode.prototype.iterSelectedWidgets = function () {\n var title = this.tabBar.currentTitle;\n return title ? algorithm.once(title.owner) : algorithm.empty();\n };\n /**\n * Create an iterator for the tab bars in the layout tree.\n */\n TabLayoutNode.prototype.iterTabBars = function () {\n return algorithm.once(this.tabBar);\n };\n /**\n * Create an iterator for the handles in the layout tree.\n */\n TabLayoutNode.prototype.iterHandles = function () {\n return algorithm.empty();\n };\n /**\n * Find the tab layout node which contains the given widget.\n */\n TabLayoutNode.prototype.findTabNode = function (widget) {\n return this.tabBar.titles.indexOf(widget.title) !== -1 ? this : null;\n };\n /**\n * Find the split layout node which contains the given handle.\n */\n TabLayoutNode.prototype.findSplitNode = function (handle) {\n return null;\n };\n /**\n * Find the first tab layout node in a layout tree.\n */\n TabLayoutNode.prototype.findFirstTabNode = function () {\n return this;\n };\n /**\n * Find the tab layout node which contains the local point.\n */\n TabLayoutNode.prototype.hitTestTabNodes = function (x, y) {\n if (x < this._left || x >= this._left + this._width) {\n return null;\n }\n if (y < this._top || y >= this._top + this._height) {\n return null;\n }\n return this;\n };\n /**\n * Create a configuration object for the layout tree.\n */\n TabLayoutNode.prototype.createConfig = function () {\n var widgets = this.tabBar.titles.map(function (title) { return title.owner; });\n var currentIndex = this.tabBar.currentIndex;\n return { type: 'tab-area', widgets: widgets, currentIndex: currentIndex };\n };\n /**\n * Recursively hold all of the sizes in the layout tree.\n *\n * This ignores the sizers of tab layout nodes.\n */\n TabLayoutNode.prototype.holdAllSizes = function () {\n return;\n };\n /**\n * Fit the layout tree.\n */\n TabLayoutNode.prototype.fit = function (spacing, items) {\n // Set up the limit variables.\n var minWidth = 0;\n var minHeight = 0;\n var maxWidth = Infinity;\n var maxHeight = Infinity;\n // Lookup the tab bar layout item.\n var tabBarItem = items.get(this.tabBar);\n // Lookup the widget layout item.\n var current = this.tabBar.currentTitle;\n var widgetItem = current ? items.get(current.owner) : undefined;\n // Lookup the tab bar and widget sizers.\n var _a = this.sizers, tabBarSizer = _a[0], widgetSizer = _a[1];\n // Update the tab bar limits.\n if (tabBarItem) {\n tabBarItem.fit();\n }\n // Update the widget limits.\n if (widgetItem) {\n widgetItem.fit();\n }\n // Update the results and sizer for the tab bar.\n if (tabBarItem && !tabBarItem.isHidden) {\n minWidth = Math.max(minWidth, tabBarItem.minWidth);\n minHeight += tabBarItem.minHeight;\n tabBarSizer.minSize = tabBarItem.minHeight;\n tabBarSizer.maxSize = tabBarItem.maxHeight;\n }\n else {\n tabBarSizer.minSize = 0;\n tabBarSizer.maxSize = 0;\n }\n // Update the results and sizer for the current widget.\n if (widgetItem && !widgetItem.isHidden) {\n minWidth = Math.max(minWidth, widgetItem.minWidth);\n minHeight += widgetItem.minHeight;\n widgetSizer.minSize = widgetItem.minHeight;\n widgetSizer.maxSize = Infinity;\n }\n else {\n widgetSizer.minSize = 0;\n widgetSizer.maxSize = Infinity;\n }\n // Return the computed size limits for the layout node.\n return { minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight };\n };\n /**\n * Update the layout tree.\n */\n TabLayoutNode.prototype.update = function (left, top, width, height, spacing, items) {\n // Update the layout box values.\n this._top = top;\n this._left = left;\n this._width = width;\n this._height = height;\n // Lookup the tab bar layout item.\n var tabBarItem = items.get(this.tabBar);\n // Lookup the widget layout item.\n var current = this.tabBar.currentTitle;\n var widgetItem = current ? items.get(current.owner) : undefined;\n // Distribute the layout space to the sizers.\n boxengine.BoxEngine.calc(this.sizers, height);\n // Update the tab bar item using the computed size.\n if (tabBarItem && !tabBarItem.isHidden) {\n var size = this.sizers[0].size;\n tabBarItem.update(left, top, width, size);\n top += size;\n }\n // Layout the widget using the computed size.\n if (widgetItem && !widgetItem.isHidden) {\n var size = this.sizers[1].size;\n widgetItem.update(left, top, width, size);\n }\n };\n return TabLayoutNode;\n }());\n Private.TabLayoutNode = TabLayoutNode;\n /**\n * A layout node which holds the data for a split area.\n */\n var SplitLayoutNode = /** @class */ (function () {\n /**\n * Construct a new split layout node.\n *\n * @param orientation - The orientation of the node.\n */\n function SplitLayoutNode(orientation) {\n /**\n * The parent of the layout node.\n */\n this.parent = null;\n /**\n * Whether the sizers have been normalized.\n */\n this.normalized = false;\n /**\n * The child nodes for the split node.\n */\n this.children = [];\n /**\n * The box sizers for the layout children.\n */\n this.sizers = [];\n /**\n * The handles for the layout children.\n */\n this.handles = [];\n this.orientation = orientation;\n }\n /**\n * Create an iterator for all widgets in the layout tree.\n */\n SplitLayoutNode.prototype.iterAllWidgets = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterAllWidgets(); });\n return new algorithm.ChainIterator(children);\n };\n /**\n * Create an iterator for the user widgets in the layout tree.\n */\n SplitLayoutNode.prototype.iterUserWidgets = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterUserWidgets(); });\n return new algorithm.ChainIterator(children);\n };\n /**\n * Create an iterator for the selected widgets in the layout tree.\n */\n SplitLayoutNode.prototype.iterSelectedWidgets = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterSelectedWidgets(); });\n return new algorithm.ChainIterator(children);\n };\n /**\n * Create an iterator for the tab bars in the layout tree.\n */\n SplitLayoutNode.prototype.iterTabBars = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterTabBars(); });\n return new algorithm.ChainIterator(children);\n };\n /**\n * Create an iterator for the handles in the layout tree.\n */\n SplitLayoutNode.prototype.iterHandles = function () {\n var children = algorithm.map(this.children, function (child) { return child.iterHandles(); });\n return algorithm.chain(this.handles, new algorithm.ChainIterator(children));\n };\n /**\n * Find the tab layout node which contains the given widget.\n */\n SplitLayoutNode.prototype.findTabNode = function (widget) {\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var result = this.children[i].findTabNode(widget);\n if (result) {\n return result;\n }\n }\n return null;\n };\n /**\n * Find the split layout node which contains the given handle.\n */\n SplitLayoutNode.prototype.findSplitNode = function (handle) {\n var index = this.handles.indexOf(handle);\n if (index !== -1) {\n return { index: index, node: this };\n }\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var result = this.children[i].findSplitNode(handle);\n if (result) {\n return result;\n }\n }\n return null;\n };\n /**\n * Find the first tab layout node in a layout tree.\n */\n SplitLayoutNode.prototype.findFirstTabNode = function () {\n if (this.children.length === 0) {\n return null;\n }\n return this.children[0].findFirstTabNode();\n };\n /**\n * Find the tab layout node which contains the local point.\n */\n SplitLayoutNode.prototype.hitTestTabNodes = function (x, y) {\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var result = this.children[i].hitTestTabNodes(x, y);\n if (result) {\n return result;\n }\n }\n return null;\n };\n /**\n * Create a configuration object for the layout tree.\n */\n SplitLayoutNode.prototype.createConfig = function () {\n var orientation = this.orientation;\n var sizes = this.createNormalizedSizes();\n var children = this.children.map(function (child) { return child.createConfig(); });\n return { type: 'split-area', orientation: orientation, children: children, sizes: sizes };\n };\n /**\n * Sync the visibility and orientation of the handles.\n */\n SplitLayoutNode.prototype.syncHandles = function () {\n var _this = this;\n algorithm.each(this.handles, function (handle, i) {\n handle.setAttribute('data-orientation', _this.orientation);\n if (i === _this.handles.length - 1) {\n handle.classList.add('lm-mod-hidden');\n /* */\n handle.classList.add('p-mod-hidden');\n /* */\n }\n else {\n handle.classList.remove('lm-mod-hidden');\n /* */\n handle.classList.remove('p-mod-hidden');\n /* */\n }\n });\n };\n /**\n * Hold the current sizes of the box sizers.\n *\n * This sets the size hint of each sizer to its current size.\n */\n SplitLayoutNode.prototype.holdSizes = function () {\n algorithm.each(this.sizers, function (sizer) { sizer.sizeHint = sizer.size; });\n };\n /**\n * Recursively hold all of the sizes in the layout tree.\n *\n * This ignores the sizers of tab layout nodes.\n */\n SplitLayoutNode.prototype.holdAllSizes = function () {\n algorithm.each(this.children, function (child) { return child.holdAllSizes(); });\n this.holdSizes();\n };\n /**\n * Normalize the sizes of the split layout node.\n */\n SplitLayoutNode.prototype.normalizeSizes = function () {\n // Bail early if the sizers are empty.\n var n = this.sizers.length;\n if (n === 0) {\n return;\n }\n // Hold the current sizes of the sizers.\n this.holdSizes();\n // Compute the sum of the sizes.\n var sum = algorithm.reduce(this.sizers, function (v, sizer) { return v + sizer.sizeHint; }, 0);\n // Normalize the sizes based on the sum.\n if (sum === 0) {\n algorithm.each(this.sizers, function (sizer) {\n sizer.size = sizer.sizeHint = 1 / n;\n });\n }\n else {\n algorithm.each(this.sizers, function (sizer) {\n sizer.size = sizer.sizeHint /= sum;\n });\n }\n // Mark the sizes as normalized.\n this.normalized = true;\n };\n /**\n * Snap the normalized sizes of the split layout node.\n */\n SplitLayoutNode.prototype.createNormalizedSizes = function () {\n // Bail early if the sizers are empty.\n var n = this.sizers.length;\n if (n === 0) {\n return [];\n }\n // Grab the current sizes of the sizers.\n var sizes = this.sizers.map(function (sizer) { return sizer.size; });\n // Compute the sum of the sizes.\n var sum = algorithm.reduce(sizes, function (v, size) { return v + size; }, 0);\n // Normalize the sizes based on the sum.\n if (sum === 0) {\n algorithm.each(sizes, function (size, i) { sizes[i] = 1 / n; });\n }\n else {\n algorithm.each(sizes, function (size, i) { sizes[i] = size / sum; });\n }\n // Return the normalized sizes.\n return sizes;\n };\n /**\n * Fit the layout tree.\n */\n SplitLayoutNode.prototype.fit = function (spacing, items) {\n // Compute the required fixed space.\n var horizontal = this.orientation === 'horizontal';\n var fixed = Math.max(0, this.children.length - 1) * spacing;\n // Set up the limit variables.\n var minWidth = horizontal ? fixed : 0;\n var minHeight = horizontal ? 0 : fixed;\n var maxWidth = Infinity;\n var maxHeight = Infinity;\n // Fit the children and update the limits.\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var limits = this.children[i].fit(spacing, items);\n if (horizontal) {\n minHeight = Math.max(minHeight, limits.minHeight);\n minWidth += limits.minWidth;\n this.sizers[i].minSize = limits.minWidth;\n }\n else {\n minWidth = Math.max(minWidth, limits.minWidth);\n minHeight += limits.minHeight;\n this.sizers[i].minSize = limits.minHeight;\n }\n }\n // Return the computed limits for the layout node.\n return { minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight };\n };\n /**\n * Update the layout tree.\n */\n SplitLayoutNode.prototype.update = function (left, top, width, height, spacing, items) {\n // Compute the available layout space.\n var horizontal = this.orientation === 'horizontal';\n var fixed = Math.max(0, this.children.length - 1) * spacing;\n var space = Math.max(0, (horizontal ? width : height) - fixed);\n // De-normalize the sizes if needed.\n if (this.normalized) {\n algorithm.each(this.sizers, function (sizer) { sizer.sizeHint *= space; });\n this.normalized = false;\n }\n // Distribute the layout space to the sizers.\n boxengine.BoxEngine.calc(this.sizers, space);\n // Update the geometry of the child nodes and handles.\n for (var i = 0, n = this.children.length; i < n; ++i) {\n var child = this.children[i];\n var size = this.sizers[i].size;\n var handleStyle = this.handles[i].style;\n if (horizontal) {\n child.update(left, top, size, height, spacing, items);\n left += size;\n handleStyle.top = top + \"px\";\n handleStyle.left = left + \"px\";\n handleStyle.width = spacing + \"px\";\n handleStyle.height = height + \"px\";\n left += spacing;\n }\n else {\n child.update(left, top, width, size, spacing, items);\n top += size;\n handleStyle.top = top + \"px\";\n handleStyle.left = left + \"px\";\n handleStyle.width = width + \"px\";\n handleStyle.height = spacing + \"px\";\n top += spacing;\n }\n }\n };\n return SplitLayoutNode;\n }());\n Private.SplitLayoutNode = SplitLayoutNode;\n /**\n * Normalize a tab area config and collect the visited widgets.\n */\n function normalizeTabAreaConfig(config, widgetSet) {\n // Bail early if there is no content.\n if (config.widgets.length === 0) {\n return null;\n }\n // Setup the filtered widgets array.\n var widgets = [];\n // Filter the config for unique widgets.\n algorithm.each(config.widgets, function (widget) {\n if (!widgetSet.has(widget)) {\n widgetSet.add(widget);\n widgets.push(widget);\n }\n });\n // Bail if there are no effective widgets.\n if (widgets.length === 0) {\n return null;\n }\n // Normalize the current index.\n var index = config.currentIndex;\n if (index !== -1 && (index < 0 || index >= widgets.length)) {\n index = 0;\n }\n // Return a normalized config object.\n return { type: 'tab-area', widgets: widgets, currentIndex: index };\n }\n /**\n * Normalize a split area config and collect the visited widgets.\n */\n function normalizeSplitAreaConfig(config, widgetSet) {\n // Set up the result variables.\n var orientation = config.orientation;\n var children = [];\n var sizes = [];\n // Normalize the config children.\n for (var i = 0, n = config.children.length; i < n; ++i) {\n // Normalize the child config.\n var child = normalizeAreaConfig(config.children[i], widgetSet);\n // Ignore an empty child.\n if (!child) {\n continue;\n }\n // Add the child or hoist its content as appropriate.\n if (child.type === 'tab-area' || child.orientation !== orientation) {\n children.push(child);\n sizes.push(Math.abs(config.sizes[i] || 0));\n }\n else {\n children.push.apply(children, child.children);\n sizes.push.apply(sizes, child.sizes);\n }\n }\n // Bail if there are no effective children.\n if (children.length === 0) {\n return null;\n }\n // If there is only one effective child, return that child.\n if (children.length === 1) {\n return children[0];\n }\n // Return a normalized config object.\n return { type: 'split-area', orientation: orientation, children: children, sizes: sizes };\n }\n /**\n * Convert a normalized tab area config into a layout tree.\n */\n function realizeTabAreaConfig(config, renderer) {\n // Create the tab bar for the layout node.\n var tabBar = renderer.createTabBar();\n // Hide each widget and add it to the tab bar.\n algorithm.each(config.widgets, function (widget) {\n widget.hide();\n tabBar.addTab(widget.title);\n });\n // Set the current index of the tab bar.\n tabBar.currentIndex = config.currentIndex;\n // Return the new tab layout node.\n return new TabLayoutNode(tabBar);\n }\n /**\n * Convert a normalized split area config into a layout tree.\n */\n function realizeSplitAreaConfig(config, renderer) {\n // Create the split layout node.\n var node = new SplitLayoutNode(config.orientation);\n // Add each child to the layout node.\n algorithm.each(config.children, function (child, i) {\n // Create the child data for the layout node.\n var childNode = realizeAreaConfig(child, renderer);\n var sizer = createSizer(config.sizes[i]);\n var handle = renderer.createHandle();\n // Add the child data to the layout node.\n node.children.push(childNode);\n node.handles.push(handle);\n node.sizers.push(sizer);\n // Update the parent for the child node.\n childNode.parent = node;\n });\n // Synchronize the handle state for the layout node.\n node.syncHandles();\n // Normalize the sizes for the layout node.\n node.normalizeSizes();\n // Return the new layout node.\n return node;\n }\n})(Private || (Private = {}));\n\nexports.DockLayout = DockLayout;\n//# sourceMappingURL=docklayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/docklayout.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/dockpanel.js": │ │ │ │ /*!*********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/dockpanel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/dockpanel.js ***! │ │ │ │ \*********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar coreutils = __webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\n__webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar docklayout = __webpack_require__(/*! ./docklayout.js */ \"../../packages/widgets/dist/docklayout.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar tabbar = __webpack_require__(/*! ./tabbar.js */ \"../../packages/widgets/dist/tabbar.js\");\n\n/**\n * A widget which provides a flexible docking area for widgets.\n */\nexports.DockPanel = /** @class */ (function (_super) {\n tslib.__extends(DockPanel, _super);\n /**\n * Construct a new dock panel.\n *\n * @param options - The options for initializing the panel.\n */\n function DockPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this._drag = null;\n _this._tabsMovable = true;\n _this._pressData = null;\n _this._layoutModified = new signaling.Signal(_this);\n _this.addClass('lm-DockPanel');\n /* */\n _this.addClass('p-DockPanel');\n /* */\n _this._mode = options.mode || 'multiple-document';\n _this._renderer = options.renderer || DockPanel.defaultRenderer;\n _this._edges = options.edges || Private.DEFAULT_EDGES;\n if (options.tabsMovable !== undefined) {\n _this._tabsMovable = options.tabsMovable;\n }\n // Toggle the CSS mode attribute.\n _this.dataset['mode'] = _this._mode;\n // Create the delegate renderer for the layout.\n var renderer = {\n createTabBar: function () { return _this._createTabBar(); },\n createHandle: function () { return _this._createHandle(); }\n };\n // Set up the dock layout for the panel.\n _this.layout = new docklayout.DockLayout({ renderer: renderer, spacing: options.spacing });\n // Set up the overlay drop indicator.\n _this.overlay = options.overlay || new DockPanel.Overlay();\n _this.node.appendChild(_this.overlay.node);\n return _this;\n }\n /**\n * Dispose of the resources held by the panel.\n */\n DockPanel.prototype.dispose = function () {\n // Ensure the mouse is released.\n this._releaseMouse();\n // Hide the overlay.\n this.overlay.hide(0);\n // Cancel a drag if one is in progress.\n if (this._drag) {\n this._drag.dispose();\n }\n // Dispose of the base class.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(DockPanel.prototype, \"layoutModified\", {\n /**\n * A signal emitted when the layout configuration is modified.\n *\n * #### Notes\n * This signal is emitted whenever the current layout configuration\n * may have changed.\n *\n * This signal is emitted asynchronously in a collapsed fashion, so\n * that multiple synchronous modifications results in only a single\n * emit of the signal.\n */\n get: function () {\n return this._layoutModified;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"renderer\", {\n /**\n * The renderer used by the dock panel.\n */\n get: function () {\n return this.layout.renderer;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"spacing\", {\n /**\n * Get the spacing between the widgets.\n */\n get: function () {\n return this.layout.spacing;\n },\n /**\n * Set the spacing between the widgets.\n */\n set: function (value) {\n this.layout.spacing = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"mode\", {\n /**\n * Get the mode for the dock panel.\n */\n get: function () {\n return this._mode;\n },\n /**\n * Set the mode for the dock panel.\n *\n * #### Notes\n * Changing the mode is a destructive operation with respect to the\n * panel's layout configuration. If layout state must be preserved,\n * save the current layout config before changing the mode.\n */\n set: function (value) {\n // Bail early if the mode does not change.\n if (this._mode === value) {\n return;\n }\n // Update the internal mode.\n this._mode = value;\n // Toggle the CSS mode attribute.\n this.dataset['mode'] = value;\n // Get the layout for the panel.\n var layout = this.layout;\n // Configure the layout for the specified mode.\n switch (value) {\n case 'multiple-document':\n algorithm.each(layout.tabBars(), function (tabBar) { tabBar.show(); });\n break;\n case 'single-document':\n layout.restoreLayout(Private.createSingleDocumentConfig(this));\n break;\n default:\n throw 'unreachable';\n }\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"tabsMovable\", {\n /**\n * Whether the tabs can be dragged / moved at runtime.\n */\n get: function () {\n return this._tabsMovable;\n },\n /**\n * Enable / Disable draggable / movable tabs.\n */\n set: function (value) {\n this._tabsMovable = value;\n algorithm.each(this.tabBars(), function (tabbar) { tabbar.tabsMovable = value; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"isEmpty\", {\n /**\n * Whether the dock panel is empty.\n */\n get: function () {\n return this.layout.isEmpty;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the user widgets in the panel.\n *\n * @returns A new iterator over the user widgets in the panel.\n *\n * #### Notes\n * This iterator does not include the generated tab bars.\n */\n DockPanel.prototype.widgets = function () {\n return this.layout.widgets();\n };\n /**\n * Create an iterator over the selected widgets in the panel.\n *\n * @returns A new iterator over the selected user widgets.\n *\n * #### Notes\n * This iterator yields the widgets corresponding to the current tab\n * of each tab bar in the panel.\n */\n DockPanel.prototype.selectedWidgets = function () {\n return this.layout.selectedWidgets();\n };\n /**\n * Create an iterator over the tab bars in the panel.\n *\n * @returns A new iterator over the tab bars in the panel.\n *\n * #### Notes\n * This iterator does not include the user widgets.\n */\n DockPanel.prototype.tabBars = function () {\n return this.layout.tabBars();\n };\n /**\n * Create an iterator over the handles in the panel.\n *\n * @returns A new iterator over the handles in the panel.\n */\n DockPanel.prototype.handles = function () {\n return this.layout.handles();\n };\n /**\n * Select a specific widget in the dock panel.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * This will make the widget the current widget in its tab area.\n */\n DockPanel.prototype.selectWidget = function (widget) {\n // Find the tab bar which contains the widget.\n var tabBar = algorithm.find(this.tabBars(), function (bar) {\n return bar.titles.indexOf(widget.title) !== -1;\n });\n // Throw an error if no tab bar is found.\n if (!tabBar) {\n throw new Error('Widget is not contained in the dock panel.');\n }\n // Ensure the widget is the current widget.\n tabBar.currentTitle = widget.title;\n };\n /**\n * Activate a specified widget in the dock panel.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * This will select and activate the given widget.\n */\n DockPanel.prototype.activateWidget = function (widget) {\n this.selectWidget(widget);\n widget.activate();\n };\n /**\n * Save the current layout configuration of the dock panel.\n *\n * @returns A new config object for the current layout state.\n *\n * #### Notes\n * The return value can be provided to the `restoreLayout` method\n * in order to restore the layout to its current configuration.\n */\n DockPanel.prototype.saveLayout = function () {\n return this.layout.saveLayout();\n };\n /**\n * Restore the layout to a previously saved configuration.\n *\n * @param config - The layout configuration to restore.\n *\n * #### Notes\n * Widgets which currently belong to the layout but which are not\n * contained in the config will be unparented.\n *\n * The dock panel automatically reverts to `'multiple-document'`\n * mode when a layout config is restored.\n */\n DockPanel.prototype.restoreLayout = function (config) {\n // Reset the mode.\n this._mode = 'multiple-document';\n // Restore the layout.\n this.layout.restoreLayout(config);\n // Flush the message loop on IE and Edge to prevent flicker.\n if (domutils.Platform.IS_EDGE || domutils.Platform.IS_IE) {\n messaging.MessageLoop.flush();\n }\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Add a widget to the dock panel.\n *\n * @param widget - The widget to add to the dock panel.\n *\n * @param options - The additional options for adding the widget.\n *\n * #### Notes\n * If the panel is in single document mode, the options are ignored\n * and the widget is always added as tab in the hidden tab bar.\n */\n DockPanel.prototype.addWidget = function (widget, options) {\n if (options === void 0) { options = {}; }\n // Add the widget to the layout.\n if (this._mode === 'single-document') {\n this.layout.addWidget(widget);\n }\n else {\n this.layout.addWidget(widget, options);\n }\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Process a message sent to the widget.\n *\n * @param msg - The message sent to the widget.\n */\n DockPanel.prototype.processMessage = function (msg) {\n if (msg.type === 'layout-modified') {\n this._layoutModified.emit(undefined);\n }\n else {\n _super.prototype.processMessage.call(this, msg);\n }\n };\n /**\n * Handle the DOM events for the dock panel.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the panel's DOM node. It should\n * not be called directly by user code.\n */\n DockPanel.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'lm-dragenter':\n this._evtDragEnter(event);\n break;\n case 'lm-dragleave':\n this._evtDragLeave(event);\n break;\n case 'lm-dragover':\n this._evtDragOver(event);\n break;\n case 'lm-drop':\n this._evtDrop(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n DockPanel.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('lm-dragenter', this);\n this.node.addEventListener('lm-dragleave', this);\n this.node.addEventListener('lm-dragover', this);\n this.node.addEventListener('lm-drop', this);\n this.node.addEventListener('mousedown', this);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n DockPanel.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('lm-dragenter', this);\n this.node.removeEventListener('lm-dragleave', this);\n this.node.removeEventListener('lm-dragover', this);\n this.node.removeEventListener('lm-drop', this);\n this.node.removeEventListener('mousedown', this);\n this._releaseMouse();\n };\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n DockPanel.prototype.onChildAdded = function (msg) {\n // Ignore the generated tab bars.\n if (Private.isGeneratedTabBarProperty.get(msg.child)) {\n return;\n }\n // Add the widget class to the child.\n msg.child.addClass('lm-DockPanel-widget');\n /* */\n msg.child.addClass('p-DockPanel-widget');\n /* */\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n DockPanel.prototype.onChildRemoved = function (msg) {\n // Ignore the generated tab bars.\n if (Private.isGeneratedTabBarProperty.get(msg.child)) {\n return;\n }\n // Remove the widget class from the child.\n msg.child.removeClass('lm-DockPanel-widget');\n /* */\n msg.child.removeClass('p-DockPanel-widget');\n /* */\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Handle the `'lm-dragenter'` event for the dock panel.\n */\n DockPanel.prototype._evtDragEnter = function (event) {\n // If the factory mime type is present, mark the event as\n // handled in order to get the rest of the drag events.\n if (event.mimeData.hasData('application/vnd.lumino.widget-factory')) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n /**\n * Handle the `'lm-dragleave'` event for the dock panel.\n */\n DockPanel.prototype._evtDragLeave = function (event) {\n // Mark the event as handled.\n event.preventDefault();\n event.stopPropagation();\n // The new target might be a descendant, so we might still handle the drop.\n // Hide asynchronously so that if a lm-dragover event bubbles up to us, the\n // hide is cancelled by the lm-dragover handler's show overlay logic.\n this.overlay.hide(1);\n };\n /**\n * Handle the `'lm-dragover'` event for the dock panel.\n */\n DockPanel.prototype._evtDragOver = function (event) {\n // Mark the event as handled.\n event.preventDefault();\n event.stopPropagation();\n // Show the drop indicator overlay and update the drop\n // action based on the drop target zone under the mouse.\n if (this._showOverlay(event.clientX, event.clientY) === 'invalid') {\n event.dropAction = 'none';\n }\n else {\n event.dropAction = event.proposedAction;\n }\n };\n /**\n * Handle the `'lm-drop'` event for the dock panel.\n */\n DockPanel.prototype._evtDrop = function (event) {\n // Mark the event as handled.\n event.preventDefault();\n event.stopPropagation();\n // Hide the drop indicator overlay.\n this.overlay.hide(0);\n // Bail if the proposed action is to do nothing.\n if (event.proposedAction === 'none') {\n event.dropAction = 'none';\n return;\n }\n // Find the drop target under the mouse.\n var clientX = event.clientX, clientY = event.clientY;\n var _a = Private.findDropTarget(this, clientX, clientY, this._edges), zone = _a.zone, target = _a.target;\n // Bail if the drop zone is invalid.\n if (zone === 'invalid') {\n event.dropAction = 'none';\n return;\n }\n // Bail if the factory mime type has invalid data.\n var mimeData = event.mimeData;\n var factory = mimeData.getData('application/vnd.lumino.widget-factory');\n if (typeof factory !== 'function') {\n event.dropAction = 'none';\n return;\n }\n // Bail if the factory does not produce a widget.\n var widget$1 = factory();\n if (!(widget$1 instanceof widget.Widget)) {\n event.dropAction = 'none';\n return;\n }\n // Bail if the widget is an ancestor of the dock panel.\n if (widget$1.contains(this)) {\n event.dropAction = 'none';\n return;\n }\n // Find the reference widget for the drop target.\n var ref = target ? Private.getDropRef(target.tabBar) : null;\n // Add the widget according to the indicated drop zone.\n switch (zone) {\n case 'root-all':\n this.addWidget(widget$1);\n break;\n case 'root-top':\n this.addWidget(widget$1, { mode: 'split-top' });\n break;\n case 'root-left':\n this.addWidget(widget$1, { mode: 'split-left' });\n break;\n case 'root-right':\n this.addWidget(widget$1, { mode: 'split-right' });\n break;\n case 'root-bottom':\n this.addWidget(widget$1, { mode: 'split-bottom' });\n break;\n case 'widget-all':\n this.addWidget(widget$1, { mode: 'tab-after', ref: ref });\n break;\n case 'widget-top':\n this.addWidget(widget$1, { mode: 'split-top', ref: ref });\n break;\n case 'widget-left':\n this.addWidget(widget$1, { mode: 'split-left', ref: ref });\n break;\n case 'widget-right':\n this.addWidget(widget$1, { mode: 'split-right', ref: ref });\n break;\n case 'widget-bottom':\n this.addWidget(widget$1, { mode: 'split-bottom', ref: ref });\n break;\n case 'widget-tab':\n this.addWidget(widget$1, { mode: 'tab-after', ref: ref });\n break;\n default:\n throw 'unreachable';\n }\n // Accept the proposed drop action.\n event.dropAction = event.proposedAction;\n // Activate the dropped widget.\n this.activateWidget(widget$1);\n };\n /**\n * Handle the `'keydown'` event for the dock panel.\n */\n DockPanel.prototype._evtKeyDown = function (event) {\n // Stop input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse if `Escape` is pressed.\n if (event.keyCode === 27) {\n // Finalize the mouse release.\n this._releaseMouse();\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n }\n };\n /**\n * Handle the `'mousedown'` event for the dock panel.\n */\n DockPanel.prototype._evtMouseDown = function (event) {\n // Do nothing if the left mouse button is not pressed.\n if (event.button !== 0) {\n return;\n }\n // Find the handle which contains the mouse target, if any.\n var layout = this.layout;\n var target = event.target;\n var handle = algorithm.find(layout.handles(), function (handle) { return handle.contains(target); });\n if (!handle) {\n return;\n }\n // Stop the event when a handle is pressed.\n event.preventDefault();\n event.stopPropagation();\n // Add the extra document listeners.\n document.addEventListener('keydown', this, true);\n document.addEventListener('mouseup', this, true);\n document.addEventListener('mousemove', this, true);\n document.addEventListener('contextmenu', this, true);\n // Compute the offset deltas for the handle press.\n var rect = handle.getBoundingClientRect();\n var deltaX = event.clientX - rect.left;\n var deltaY = event.clientY - rect.top;\n // Override the cursor and store the press data.\n var style = window.getComputedStyle(handle);\n var override = dragdrop.Drag.overrideCursor(style.cursor);\n this._pressData = { handle: handle, deltaX: deltaX, deltaY: deltaY, override: override };\n };\n /**\n * Handle the `'mousemove'` event for the dock panel.\n */\n DockPanel.prototype._evtMouseMove = function (event) {\n // Bail early if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Stop the event when dragging a handle.\n event.preventDefault();\n event.stopPropagation();\n // Compute the desired offset position for the handle.\n var rect = this.node.getBoundingClientRect();\n var xPos = event.clientX - rect.left - this._pressData.deltaX;\n var yPos = event.clientY - rect.top - this._pressData.deltaY;\n // Set the handle as close to the desired position as possible.\n var layout = this.layout;\n layout.moveHandle(this._pressData.handle, xPos, yPos);\n };\n /**\n * Handle the `'mouseup'` event for the dock panel.\n */\n DockPanel.prototype._evtMouseUp = function (event) {\n // Do nothing if the left mouse button is not released.\n if (event.button !== 0) {\n return;\n }\n // Stop the event when releasing a handle.\n event.preventDefault();\n event.stopPropagation();\n // Finalize the mouse release.\n this._releaseMouse();\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Release the mouse grab for the dock panel.\n */\n DockPanel.prototype._releaseMouse = function () {\n // Bail early if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Clear the override cursor.\n this._pressData.override.dispose();\n this._pressData = null;\n // Remove the extra document listeners.\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('contextmenu', this, true);\n };\n /**\n * Show the overlay indicator at the given client position.\n *\n * Returns the drop zone at the specified client position.\n *\n * #### Notes\n * If the position is not over a valid zone, the overlay is hidden.\n */\n DockPanel.prototype._showOverlay = function (clientX, clientY) {\n // Find the dock target for the given client position.\n var _a = Private.findDropTarget(this, clientX, clientY, this._edges), zone = _a.zone, target = _a.target;\n // If the drop zone is invalid, hide the overlay and bail.\n if (zone === 'invalid') {\n this.overlay.hide(100);\n return zone;\n }\n // Setup the variables needed to compute the overlay geometry.\n var top;\n var left;\n var right;\n var bottom;\n var box = domutils.ElementExt.boxSizing(this.node); // TODO cache this?\n var rect = this.node.getBoundingClientRect();\n // Compute the overlay geometry based on the dock zone.\n switch (zone) {\n case 'root-all':\n top = box.paddingTop;\n left = box.paddingLeft;\n right = box.paddingRight;\n bottom = box.paddingBottom;\n break;\n case 'root-top':\n top = box.paddingTop;\n left = box.paddingLeft;\n right = box.paddingRight;\n bottom = rect.height * Private.GOLDEN_RATIO;\n break;\n case 'root-left':\n top = box.paddingTop;\n left = box.paddingLeft;\n right = rect.width * Private.GOLDEN_RATIO;\n bottom = box.paddingBottom;\n break;\n case 'root-right':\n top = box.paddingTop;\n left = rect.width * Private.GOLDEN_RATIO;\n right = box.paddingRight;\n bottom = box.paddingBottom;\n break;\n case 'root-bottom':\n top = rect.height * Private.GOLDEN_RATIO;\n left = box.paddingLeft;\n right = box.paddingRight;\n bottom = box.paddingBottom;\n break;\n case 'widget-all':\n top = target.top;\n left = target.left;\n right = target.right;\n bottom = target.bottom;\n break;\n case 'widget-top':\n top = target.top;\n left = target.left;\n right = target.right;\n bottom = target.bottom + target.height / 2;\n break;\n case 'widget-left':\n top = target.top;\n left = target.left;\n right = target.right + target.width / 2;\n bottom = target.bottom;\n break;\n case 'widget-right':\n top = target.top;\n left = target.left + target.width / 2;\n right = target.right;\n bottom = target.bottom;\n break;\n case 'widget-bottom':\n top = target.top + target.height / 2;\n left = target.left;\n right = target.right;\n bottom = target.bottom;\n break;\n case 'widget-tab':\n var tabHeight = target.tabBar.node.getBoundingClientRect().height;\n top = target.top;\n left = target.left;\n right = target.right;\n bottom = target.bottom + target.height - tabHeight;\n break;\n default:\n throw 'unreachable';\n }\n // Show the overlay with the computed geometry.\n this.overlay.show({ top: top, left: left, right: right, bottom: bottom });\n // Finally, return the computed drop zone.\n return zone;\n };\n /**\n * Create a new tab bar for use by the panel.\n */\n DockPanel.prototype._createTabBar = function () {\n // Create the tab bar.\n var tabBar = this._renderer.createTabBar();\n // Set the generated tab bar property for the tab bar.\n Private.isGeneratedTabBarProperty.set(tabBar, true);\n // Hide the tab bar when in single document mode.\n if (this._mode === 'single-document') {\n tabBar.hide();\n }\n // Enforce necessary tab bar behavior.\n // TODO do we really want to enforce *all* of these?\n tabBar.tabsMovable = this._tabsMovable;\n tabBar.allowDeselect = false;\n tabBar.removeBehavior = 'select-previous-tab';\n tabBar.insertBehavior = 'select-tab-if-needed';\n // Connect the signal handlers for the tab bar.\n tabBar.tabMoved.connect(this._onTabMoved, this);\n tabBar.currentChanged.connect(this._onCurrentChanged, this);\n tabBar.tabCloseRequested.connect(this._onTabCloseRequested, this);\n tabBar.tabDetachRequested.connect(this._onTabDetachRequested, this);\n tabBar.tabActivateRequested.connect(this._onTabActivateRequested, this);\n // Return the initialized tab bar.\n return tabBar;\n };\n /**\n * Create a new handle for use by the panel.\n */\n DockPanel.prototype._createHandle = function () {\n return this._renderer.createHandle();\n };\n /**\n * Handle the `tabMoved` signal from a tab bar.\n */\n DockPanel.prototype._onTabMoved = function () {\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Handle the `currentChanged` signal from a tab bar.\n */\n DockPanel.prototype._onCurrentChanged = function (sender, args) {\n // Extract the previous and current title from the args.\n var previousTitle = args.previousTitle, currentTitle = args.currentTitle;\n // Hide the previous widget.\n if (previousTitle) {\n previousTitle.owner.hide();\n }\n // Show the current widget.\n if (currentTitle) {\n currentTitle.owner.show();\n }\n // Flush the message loop on IE and Edge to prevent flicker.\n if (domutils.Platform.IS_EDGE || domutils.Platform.IS_IE) {\n messaging.MessageLoop.flush();\n }\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Handle the `tabActivateRequested` signal from a tab bar.\n */\n DockPanel.prototype._onTabActivateRequested = function (sender, args) {\n args.title.owner.activate();\n };\n /**\n * Handle the `tabCloseRequested` signal from a tab bar.\n */\n DockPanel.prototype._onTabCloseRequested = function (sender, args) {\n args.title.owner.close();\n };\n /**\n * Handle the `tabDetachRequested` signal from a tab bar.\n */\n DockPanel.prototype._onTabDetachRequested = function (sender, args) {\n var _this = this;\n // Do nothing if a drag is already in progress.\n if (this._drag) {\n return;\n }\n // Release the tab bar's hold on the mouse.\n sender.releaseMouse();\n // Extract the data from the args.\n var title = args.title, tab = args.tab, clientX = args.clientX, clientY = args.clientY;\n // Setup the mime data for the drag operation.\n var mimeData = new coreutils.MimeData();\n var factory = function () { return title.owner; };\n mimeData.setData('application/vnd.lumino.widget-factory', factory);\n // Create the drag image for the drag operation.\n var dragImage = tab.cloneNode(true);\n // Create the drag object to manage the drag-drop operation.\n this._drag = new dragdrop.Drag({\n mimeData: mimeData, dragImage: dragImage,\n proposedAction: 'move',\n supportedActions: 'move',\n });\n // Hide the tab node in the original tab.\n tab.classList.add('lm-mod-hidden');\n /* */\n tab.classList.add('p-mod-hidden');\n // Create the cleanup callback.\n var cleanup = (function () {\n _this._drag = null;\n tab.classList.remove('lm-mod-hidden');\n /* */\n tab.classList.remove('p-mod-hidden');\n });\n // Start the drag operation and cleanup when done.\n this._drag.start(clientX, clientY).then(cleanup);\n };\n return DockPanel;\n}(widget.Widget));\n/**\n * The namespace for the `DockPanel` class statics.\n */\n(function (DockPanel) {\n /**\n * A concrete implementation of `IOverlay`.\n *\n * This is the default overlay implementation for a dock panel.\n */\n var Overlay = /** @class */ (function () {\n /**\n * Construct a new overlay.\n */\n function Overlay() {\n this._timer = -1;\n this._hidden = true;\n this.node = document.createElement('div');\n this.node.classList.add('lm-DockPanel-overlay');\n this.node.classList.add('lm-mod-hidden');\n /* */\n this.node.classList.add('p-DockPanel-overlay');\n this.node.classList.add('p-mod-hidden');\n this.node.style.position = 'absolute';\n }\n /**\n * Show the overlay using the given overlay geometry.\n *\n * @param geo - The desired geometry for the overlay.\n */\n Overlay.prototype.show = function (geo) {\n // Update the position of the overlay.\n var style = this.node.style;\n style.top = geo.top + \"px\";\n style.left = geo.left + \"px\";\n style.right = geo.right + \"px\";\n style.bottom = geo.bottom + \"px\";\n // Clear any pending hide timer.\n clearTimeout(this._timer);\n this._timer = -1;\n // If the overlay is already visible, we're done.\n if (!this._hidden) {\n return;\n }\n // Clear the hidden flag.\n this._hidden = false;\n // Finally, show the overlay.\n this.node.classList.remove('lm-mod-hidden');\n /* */\n this.node.classList.remove('p-mod-hidden');\n };\n /**\n * Hide the overlay node.\n *\n * @param delay - The delay (in ms) before hiding the overlay.\n * A delay value <= 0 will hide the overlay immediately.\n */\n Overlay.prototype.hide = function (delay) {\n var _this = this;\n // Do nothing if the overlay is already hidden.\n if (this._hidden) {\n return;\n }\n // Hide immediately if the delay is <= 0.\n if (delay <= 0) {\n clearTimeout(this._timer);\n this._timer = -1;\n this._hidden = true;\n this.node.classList.add('lm-mod-hidden');\n /* */\n this.node.classList.add('p-mod-hidden');\n return;\n }\n // Do nothing if a hide is already pending.\n if (this._timer !== -1) {\n return;\n }\n // Otherwise setup the hide timer.\n this._timer = window.setTimeout(function () {\n _this._timer = -1;\n _this._hidden = true;\n _this.node.classList.add('lm-mod-hidden');\n /* */\n _this.node.classList.add('p-mod-hidden');\n }, delay);\n };\n return Overlay;\n }());\n DockPanel.Overlay = Overlay;\n /**\n * The default implementation of `IRenderer`.\n */\n var Renderer = /** @class */ (function () {\n function Renderer() {\n }\n /**\n * Create a new tab bar for use with a dock panel.\n *\n * @returns A new tab bar for a dock panel.\n */\n Renderer.prototype.createTabBar = function () {\n var bar = new tabbar.TabBar();\n bar.addClass('lm-DockPanel-tabBar');\n /* */\n bar.addClass('p-DockPanel-tabBar');\n /* */\n return bar;\n };\n /**\n * Create a new handle node for use with a dock panel.\n *\n * @returns A new handle node for a dock panel.\n */\n Renderer.prototype.createHandle = function () {\n var handle = document.createElement('div');\n handle.className = 'lm-DockPanel-handle';\n /* */\n handle.classList.add('p-DockPanel-handle');\n return handle;\n };\n return Renderer;\n }());\n DockPanel.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n DockPanel.defaultRenderer = new Renderer();\n})(exports.DockPanel || (exports.DockPanel = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A fraction used for sizing root panels; ~= `1 / golden_ratio`.\n */\n Private.GOLDEN_RATIO = 0.618;\n /**\n * The default sizes for the edge drop zones, in pixels.\n */\n Private.DEFAULT_EDGES = {\n /**\n * The size of the top edge dock zone for the root panel, in pixels.\n * This is different from the others to distinguish between the top\n * tab bar and the top root zone.\n */\n top: 12,\n /**\n * The size of the edge dock zone for the root panel, in pixels.\n */\n right: 40,\n /**\n * The size of the edge dock zone for the root panel, in pixels.\n */\n bottom: 40,\n /**\n * The size of the edge dock zone for the root panel, in pixels.\n */\n left: 40\n };\n /**\n * A singleton `'layout-modified'` conflatable message.\n */\n Private.LayoutModified = new messaging.ConflatableMessage('layout-modified');\n /**\n * An attached property used to track generated tab bars.\n */\n Private.isGeneratedTabBarProperty = new properties.AttachedProperty({\n name: 'isGeneratedTabBar',\n create: function () { return false; }\n });\n /**\n * Create a single document config for the widgets in a dock panel.\n */\n function createSingleDocumentConfig(panel) {\n // Return an empty config if the panel is empty.\n if (panel.isEmpty) {\n return { main: null };\n }\n // Get a flat array of the widgets in the panel.\n var widgets = algorithm.toArray(panel.widgets());\n // Get the first selected widget in the panel.\n var selected = panel.selectedWidgets().next();\n // Compute the current index for the new config.\n var currentIndex = selected ? widgets.indexOf(selected) : -1;\n // Return the single document config.\n return { main: { type: 'tab-area', widgets: widgets, currentIndex: currentIndex } };\n }\n Private.createSingleDocumentConfig = createSingleDocumentConfig;\n /**\n * Find the drop target at the given client position.\n */\n function findDropTarget(panel, clientX, clientY, edges) {\n // Bail if the mouse is not over the dock panel.\n if (!domutils.ElementExt.hitTest(panel.node, clientX, clientY)) {\n return { zone: 'invalid', target: null };\n }\n // Look up the layout for the panel.\n var layout = panel.layout;\n // If the layout is empty, indicate the entire root drop zone.\n if (layout.isEmpty) {\n return { zone: 'root-all', target: null };\n }\n // Test the edge zones when in multiple document mode.\n if (panel.mode === 'multiple-document') {\n // Get the client rect for the dock panel.\n var panelRect = panel.node.getBoundingClientRect();\n // Compute the distance to each edge of the panel.\n var pl = clientX - panelRect.left + 1;\n var pt = clientY - panelRect.top + 1;\n var pr = panelRect.right - clientX;\n var pb = panelRect.bottom - clientY;\n // Find the minimum distance to an edge.\n var pd = Math.min(pt, pr, pb, pl);\n // Return a root zone if the mouse is within an edge.\n switch (pd) {\n case pt:\n if (pt < edges.top) {\n return { zone: 'root-top', target: null };\n }\n break;\n case pr:\n if (pr < edges.right) {\n return { zone: 'root-right', target: null };\n }\n break;\n case pb:\n if (pb < edges.bottom) {\n return { zone: 'root-bottom', target: null };\n }\n break;\n case pl:\n if (pl < edges.left) {\n return { zone: 'root-left', target: null };\n }\n break;\n default:\n throw 'unreachable';\n }\n }\n // Hit test the dock layout at the given client position.\n var target = layout.hitTestTabAreas(clientX, clientY);\n // Bail if no target area was found.\n if (!target) {\n return { zone: 'invalid', target: null };\n }\n // Return the whole tab area when in single document mode.\n if (panel.mode === 'single-document') {\n return { zone: 'widget-all', target: target };\n }\n // Compute the distance to each edge of the tab area.\n var al = target.x - target.left + 1;\n var at = target.y - target.top + 1;\n var ar = target.left + target.width - target.x;\n var ab = target.top + target.height - target.y;\n var tabHeight = target.tabBar.node.getBoundingClientRect().height;\n if (at < tabHeight) {\n return { zone: 'widget-tab', target: target };\n }\n // Get the X and Y edge sizes for the area.\n var rx = Math.round(target.width / 3);\n var ry = Math.round(target.height / 3);\n // If the mouse is not within an edge, indicate the entire area.\n if (al > rx && ar > rx && at > ry && ab > ry) {\n return { zone: 'widget-all', target: target };\n }\n // Scale the distances by the slenderness ratio.\n al /= rx;\n at /= ry;\n ar /= rx;\n ab /= ry;\n // Find the minimum distance to the area edge.\n var ad = Math.min(al, at, ar, ab);\n // Find the widget zone for the area edge.\n var zone;\n switch (ad) {\n case al:\n zone = 'widget-left';\n break;\n case at:\n zone = 'widget-top';\n break;\n case ar:\n zone = 'widget-right';\n break;\n case ab:\n zone = 'widget-bottom';\n break;\n default:\n throw 'unreachable';\n }\n // Return the final drop target.\n return { zone: zone, target: target };\n }\n Private.findDropTarget = findDropTarget;\n /**\n * Get the drop reference widget for a tab bar.\n */\n function getDropRef(tabBar) {\n if (tabBar.titles.length === 0) {\n return null;\n }\n if (tabBar.currentTitle) {\n return tabBar.currentTitle.owner;\n }\n return tabBar.titles[tabBar.titles.length - 1].owner;\n }\n Private.getDropRef = getDropRef;\n})(Private || (Private = {}));\n//# sourceMappingURL=dockpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/dockpanel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar coreutils = __webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\n__webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar docklayout = __webpack_require__(/*! ./docklayout.js */ \"../../packages/widgets/dist/docklayout.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar tabbar = __webpack_require__(/*! ./tabbar.js */ \"../../packages/widgets/dist/tabbar.js\");\n\n/**\n * A widget which provides a flexible docking area for widgets.\n */\nexports.DockPanel = /** @class */ (function (_super) {\n tslib.__extends(DockPanel, _super);\n /**\n * Construct a new dock panel.\n *\n * @param options - The options for initializing the panel.\n */\n function DockPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this._drag = null;\n _this._tabsMovable = true;\n _this._pressData = null;\n _this._layoutModified = new signaling.Signal(_this);\n _this.addClass('lm-DockPanel');\n /* */\n _this.addClass('p-DockPanel');\n /* */\n _this._mode = options.mode || 'multiple-document';\n _this._renderer = options.renderer || DockPanel.defaultRenderer;\n _this._edges = options.edges || Private.DEFAULT_EDGES;\n if (options.tabsMovable !== undefined) {\n _this._tabsMovable = options.tabsMovable;\n }\n // Toggle the CSS mode attribute.\n _this.dataset['mode'] = _this._mode;\n // Create the delegate renderer for the layout.\n var renderer = {\n createTabBar: function () { return _this._createTabBar(); },\n createHandle: function () { return _this._createHandle(); }\n };\n // Set up the dock layout for the panel.\n _this.layout = new docklayout.DockLayout({ renderer: renderer, spacing: options.spacing });\n // Set up the overlay drop indicator.\n _this.overlay = options.overlay || new DockPanel.Overlay();\n _this.node.appendChild(_this.overlay.node);\n return _this;\n }\n /**\n * Dispose of the resources held by the panel.\n */\n DockPanel.prototype.dispose = function () {\n // Ensure the mouse is released.\n this._releaseMouse();\n // Hide the overlay.\n this.overlay.hide(0);\n // Cancel a drag if one is in progress.\n if (this._drag) {\n this._drag.dispose();\n }\n // Dispose of the base class.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(DockPanel.prototype, \"layoutModified\", {\n /**\n * A signal emitted when the layout configuration is modified.\n *\n * #### Notes\n * This signal is emitted whenever the current layout configuration\n * may have changed.\n *\n * This signal is emitted asynchronously in a collapsed fashion, so\n * that multiple synchronous modifications results in only a single\n * emit of the signal.\n */\n get: function () {\n return this._layoutModified;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"renderer\", {\n /**\n * The renderer used by the dock panel.\n */\n get: function () {\n return this.layout.renderer;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"spacing\", {\n /**\n * Get the spacing between the widgets.\n */\n get: function () {\n return this.layout.spacing;\n },\n /**\n * Set the spacing between the widgets.\n */\n set: function (value) {\n this.layout.spacing = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"mode\", {\n /**\n * Get the mode for the dock panel.\n */\n get: function () {\n return this._mode;\n },\n /**\n * Set the mode for the dock panel.\n *\n * #### Notes\n * Changing the mode is a destructive operation with respect to the\n * panel's layout configuration. If layout state must be preserved,\n * save the current layout config before changing the mode.\n */\n set: function (value) {\n // Bail early if the mode does not change.\n if (this._mode === value) {\n return;\n }\n // Update the internal mode.\n this._mode = value;\n // Toggle the CSS mode attribute.\n this.dataset['mode'] = value;\n // Get the layout for the panel.\n var layout = this.layout;\n // Configure the layout for the specified mode.\n switch (value) {\n case 'multiple-document':\n algorithm.each(layout.tabBars(), function (tabBar) { tabBar.show(); });\n break;\n case 'single-document':\n layout.restoreLayout(Private.createSingleDocumentConfig(this));\n break;\n default:\n throw 'unreachable';\n }\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"tabsMovable\", {\n /**\n * Whether the tabs can be dragged / moved at runtime.\n */\n get: function () {\n return this._tabsMovable;\n },\n /**\n * Enable / Disable draggable / movable tabs.\n */\n set: function (value) {\n this._tabsMovable = value;\n algorithm.each(this.tabBars(), function (tabbar) { tabbar.tabsMovable = value; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DockPanel.prototype, \"isEmpty\", {\n /**\n * Whether the dock panel is empty.\n */\n get: function () {\n return this.layout.isEmpty;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the user widgets in the panel.\n *\n * @returns A new iterator over the user widgets in the panel.\n *\n * #### Notes\n * This iterator does not include the generated tab bars.\n */\n DockPanel.prototype.widgets = function () {\n return this.layout.widgets();\n };\n /**\n * Create an iterator over the selected widgets in the panel.\n *\n * @returns A new iterator over the selected user widgets.\n *\n * #### Notes\n * This iterator yields the widgets corresponding to the current tab\n * of each tab bar in the panel.\n */\n DockPanel.prototype.selectedWidgets = function () {\n return this.layout.selectedWidgets();\n };\n /**\n * Create an iterator over the tab bars in the panel.\n *\n * @returns A new iterator over the tab bars in the panel.\n *\n * #### Notes\n * This iterator does not include the user widgets.\n */\n DockPanel.prototype.tabBars = function () {\n return this.layout.tabBars();\n };\n /**\n * Create an iterator over the handles in the panel.\n *\n * @returns A new iterator over the handles in the panel.\n */\n DockPanel.prototype.handles = function () {\n return this.layout.handles();\n };\n /**\n * Select a specific widget in the dock panel.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * This will make the widget the current widget in its tab area.\n */\n DockPanel.prototype.selectWidget = function (widget) {\n // Find the tab bar which contains the widget.\n var tabBar = algorithm.find(this.tabBars(), function (bar) {\n return bar.titles.indexOf(widget.title) !== -1;\n });\n // Throw an error if no tab bar is found.\n if (!tabBar) {\n throw new Error('Widget is not contained in the dock panel.');\n }\n // Ensure the widget is the current widget.\n tabBar.currentTitle = widget.title;\n };\n /**\n * Activate a specified widget in the dock panel.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * This will select and activate the given widget.\n */\n DockPanel.prototype.activateWidget = function (widget) {\n this.selectWidget(widget);\n widget.activate();\n };\n /**\n * Save the current layout configuration of the dock panel.\n *\n * @returns A new config object for the current layout state.\n *\n * #### Notes\n * The return value can be provided to the `restoreLayout` method\n * in order to restore the layout to its current configuration.\n */\n DockPanel.prototype.saveLayout = function () {\n return this.layout.saveLayout();\n };\n /**\n * Restore the layout to a previously saved configuration.\n *\n * @param config - The layout configuration to restore.\n *\n * #### Notes\n * Widgets which currently belong to the layout but which are not\n * contained in the config will be unparented.\n *\n * The dock panel automatically reverts to `'multiple-document'`\n * mode when a layout config is restored.\n */\n DockPanel.prototype.restoreLayout = function (config) {\n // Reset the mode.\n this._mode = 'multiple-document';\n // Restore the layout.\n this.layout.restoreLayout(config);\n // Flush the message loop on IE and Edge to prevent flicker.\n if (domutils.Platform.IS_EDGE || domutils.Platform.IS_IE) {\n messaging.MessageLoop.flush();\n }\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Add a widget to the dock panel.\n *\n * @param widget - The widget to add to the dock panel.\n *\n * @param options - The additional options for adding the widget.\n *\n * #### Notes\n * If the panel is in single document mode, the options are ignored\n * and the widget is always added as tab in the hidden tab bar.\n */\n DockPanel.prototype.addWidget = function (widget, options) {\n if (options === void 0) { options = {}; }\n // Add the widget to the layout.\n if (this._mode === 'single-document') {\n this.layout.addWidget(widget);\n }\n else {\n this.layout.addWidget(widget, options);\n }\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Process a message sent to the widget.\n *\n * @param msg - The message sent to the widget.\n */\n DockPanel.prototype.processMessage = function (msg) {\n if (msg.type === 'layout-modified') {\n this._layoutModified.emit(undefined);\n }\n else {\n _super.prototype.processMessage.call(this, msg);\n }\n };\n /**\n * Handle the DOM events for the dock panel.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the panel's DOM node. It should\n * not be called directly by user code.\n */\n DockPanel.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'lm-dragenter':\n this._evtDragEnter(event);\n break;\n case 'lm-dragleave':\n this._evtDragLeave(event);\n break;\n case 'lm-dragover':\n this._evtDragOver(event);\n break;\n case 'lm-drop':\n this._evtDrop(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n DockPanel.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('lm-dragenter', this);\n this.node.addEventListener('lm-dragleave', this);\n this.node.addEventListener('lm-dragover', this);\n this.node.addEventListener('lm-drop', this);\n this.node.addEventListener('mousedown', this);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n DockPanel.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('lm-dragenter', this);\n this.node.removeEventListener('lm-dragleave', this);\n this.node.removeEventListener('lm-dragover', this);\n this.node.removeEventListener('lm-drop', this);\n this.node.removeEventListener('mousedown', this);\n this._releaseMouse();\n };\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n DockPanel.prototype.onChildAdded = function (msg) {\n // Ignore the generated tab bars.\n if (Private.isGeneratedTabBarProperty.get(msg.child)) {\n return;\n }\n // Add the widget class to the child.\n msg.child.addClass('lm-DockPanel-widget');\n /* */\n msg.child.addClass('p-DockPanel-widget');\n /* */\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n DockPanel.prototype.onChildRemoved = function (msg) {\n // Ignore the generated tab bars.\n if (Private.isGeneratedTabBarProperty.get(msg.child)) {\n return;\n }\n // Remove the widget class from the child.\n msg.child.removeClass('lm-DockPanel-widget');\n /* */\n msg.child.removeClass('p-DockPanel-widget');\n /* */\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Handle the `'lm-dragenter'` event for the dock panel.\n */\n DockPanel.prototype._evtDragEnter = function (event) {\n // If the factory mime type is present, mark the event as\n // handled in order to get the rest of the drag events.\n if (event.mimeData.hasData('application/vnd.lumino.widget-factory')) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n /**\n * Handle the `'lm-dragleave'` event for the dock panel.\n */\n DockPanel.prototype._evtDragLeave = function (event) {\n // Mark the event as handled.\n event.preventDefault();\n event.stopPropagation();\n // The new target might be a descendant, so we might still handle the drop.\n // Hide asynchronously so that if a lm-dragover event bubbles up to us, the\n // hide is cancelled by the lm-dragover handler's show overlay logic.\n this.overlay.hide(1);\n };\n /**\n * Handle the `'lm-dragover'` event for the dock panel.\n */\n DockPanel.prototype._evtDragOver = function (event) {\n // Mark the event as handled.\n event.preventDefault();\n event.stopPropagation();\n // Show the drop indicator overlay and update the drop\n // action based on the drop target zone under the mouse.\n if (this._showOverlay(event.clientX, event.clientY) === 'invalid') {\n event.dropAction = 'none';\n }\n else {\n event.dropAction = event.proposedAction;\n }\n };\n /**\n * Handle the `'lm-drop'` event for the dock panel.\n */\n DockPanel.prototype._evtDrop = function (event) {\n // Mark the event as handled.\n event.preventDefault();\n event.stopPropagation();\n // Hide the drop indicator overlay.\n this.overlay.hide(0);\n // Bail if the proposed action is to do nothing.\n if (event.proposedAction === 'none') {\n event.dropAction = 'none';\n return;\n }\n // Find the drop target under the mouse.\n var clientX = event.clientX, clientY = event.clientY;\n var _a = Private.findDropTarget(this, clientX, clientY, this._edges), zone = _a.zone, target = _a.target;\n // Bail if the drop zone is invalid.\n if (zone === 'invalid') {\n event.dropAction = 'none';\n return;\n }\n // Bail if the factory mime type has invalid data.\n var mimeData = event.mimeData;\n var factory = mimeData.getData('application/vnd.lumino.widget-factory');\n if (typeof factory !== 'function') {\n event.dropAction = 'none';\n return;\n }\n // Bail if the factory does not produce a widget.\n var widget$1 = factory();\n if (!(widget$1 instanceof widget.Widget)) {\n event.dropAction = 'none';\n return;\n }\n // Bail if the widget is an ancestor of the dock panel.\n if (widget$1.contains(this)) {\n event.dropAction = 'none';\n return;\n }\n // Find the reference widget for the drop target.\n var ref = target ? Private.getDropRef(target.tabBar) : null;\n // Add the widget according to the indicated drop zone.\n switch (zone) {\n case 'root-all':\n this.addWidget(widget$1);\n break;\n case 'root-top':\n this.addWidget(widget$1, { mode: 'split-top' });\n break;\n case 'root-left':\n this.addWidget(widget$1, { mode: 'split-left' });\n break;\n case 'root-right':\n this.addWidget(widget$1, { mode: 'split-right' });\n break;\n case 'root-bottom':\n this.addWidget(widget$1, { mode: 'split-bottom' });\n break;\n case 'widget-all':\n this.addWidget(widget$1, { mode: 'tab-after', ref: ref });\n break;\n case 'widget-top':\n this.addWidget(widget$1, { mode: 'split-top', ref: ref });\n break;\n case 'widget-left':\n this.addWidget(widget$1, { mode: 'split-left', ref: ref });\n break;\n case 'widget-right':\n this.addWidget(widget$1, { mode: 'split-right', ref: ref });\n break;\n case 'widget-bottom':\n this.addWidget(widget$1, { mode: 'split-bottom', ref: ref });\n break;\n case 'widget-tab':\n this.addWidget(widget$1, { mode: 'tab-after', ref: ref });\n break;\n default:\n throw 'unreachable';\n }\n // Accept the proposed drop action.\n event.dropAction = event.proposedAction;\n // Activate the dropped widget.\n this.activateWidget(widget$1);\n };\n /**\n * Handle the `'keydown'` event for the dock panel.\n */\n DockPanel.prototype._evtKeyDown = function (event) {\n // Stop input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse if `Escape` is pressed.\n if (event.keyCode === 27) {\n // Finalize the mouse release.\n this._releaseMouse();\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n }\n };\n /**\n * Handle the `'mousedown'` event for the dock panel.\n */\n DockPanel.prototype._evtMouseDown = function (event) {\n // Do nothing if the left mouse button is not pressed.\n if (event.button !== 0) {\n return;\n }\n // Find the handle which contains the mouse target, if any.\n var layout = this.layout;\n var target = event.target;\n var handle = algorithm.find(layout.handles(), function (handle) { return handle.contains(target); });\n if (!handle) {\n return;\n }\n // Stop the event when a handle is pressed.\n event.preventDefault();\n event.stopPropagation();\n // Add the extra document listeners.\n document.addEventListener('keydown', this, true);\n document.addEventListener('mouseup', this, true);\n document.addEventListener('mousemove', this, true);\n document.addEventListener('contextmenu', this, true);\n // Compute the offset deltas for the handle press.\n var rect = handle.getBoundingClientRect();\n var deltaX = event.clientX - rect.left;\n var deltaY = event.clientY - rect.top;\n // Override the cursor and store the press data.\n var style = window.getComputedStyle(handle);\n var override = dragdrop.Drag.overrideCursor(style.cursor);\n this._pressData = { handle: handle, deltaX: deltaX, deltaY: deltaY, override: override };\n };\n /**\n * Handle the `'mousemove'` event for the dock panel.\n */\n DockPanel.prototype._evtMouseMove = function (event) {\n // Bail early if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Stop the event when dragging a handle.\n event.preventDefault();\n event.stopPropagation();\n // Compute the desired offset position for the handle.\n var rect = this.node.getBoundingClientRect();\n var xPos = event.clientX - rect.left - this._pressData.deltaX;\n var yPos = event.clientY - rect.top - this._pressData.deltaY;\n // Set the handle as close to the desired position as possible.\n var layout = this.layout;\n layout.moveHandle(this._pressData.handle, xPos, yPos);\n };\n /**\n * Handle the `'mouseup'` event for the dock panel.\n */\n DockPanel.prototype._evtMouseUp = function (event) {\n // Do nothing if the left mouse button is not released.\n if (event.button !== 0) {\n return;\n }\n // Stop the event when releasing a handle.\n event.preventDefault();\n event.stopPropagation();\n // Finalize the mouse release.\n this._releaseMouse();\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Release the mouse grab for the dock panel.\n */\n DockPanel.prototype._releaseMouse = function () {\n // Bail early if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Clear the override cursor.\n this._pressData.override.dispose();\n this._pressData = null;\n // Remove the extra document listeners.\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('contextmenu', this, true);\n };\n /**\n * Show the overlay indicator at the given client position.\n *\n * Returns the drop zone at the specified client position.\n *\n * #### Notes\n * If the position is not over a valid zone, the overlay is hidden.\n */\n DockPanel.prototype._showOverlay = function (clientX, clientY) {\n // Find the dock target for the given client position.\n var _a = Private.findDropTarget(this, clientX, clientY, this._edges), zone = _a.zone, target = _a.target;\n // If the drop zone is invalid, hide the overlay and bail.\n if (zone === 'invalid') {\n this.overlay.hide(100);\n return zone;\n }\n // Setup the variables needed to compute the overlay geometry.\n var top;\n var left;\n var right;\n var bottom;\n var box = domutils.ElementExt.boxSizing(this.node); // TODO cache this?\n var rect = this.node.getBoundingClientRect();\n // Compute the overlay geometry based on the dock zone.\n switch (zone) {\n case 'root-all':\n top = box.paddingTop;\n left = box.paddingLeft;\n right = box.paddingRight;\n bottom = box.paddingBottom;\n break;\n case 'root-top':\n top = box.paddingTop;\n left = box.paddingLeft;\n right = box.paddingRight;\n bottom = rect.height * Private.GOLDEN_RATIO;\n break;\n case 'root-left':\n top = box.paddingTop;\n left = box.paddingLeft;\n right = rect.width * Private.GOLDEN_RATIO;\n bottom = box.paddingBottom;\n break;\n case 'root-right':\n top = box.paddingTop;\n left = rect.width * Private.GOLDEN_RATIO;\n right = box.paddingRight;\n bottom = box.paddingBottom;\n break;\n case 'root-bottom':\n top = rect.height * Private.GOLDEN_RATIO;\n left = box.paddingLeft;\n right = box.paddingRight;\n bottom = box.paddingBottom;\n break;\n case 'widget-all':\n top = target.top;\n left = target.left;\n right = target.right;\n bottom = target.bottom;\n break;\n case 'widget-top':\n top = target.top;\n left = target.left;\n right = target.right;\n bottom = target.bottom + target.height / 2;\n break;\n case 'widget-left':\n top = target.top;\n left = target.left;\n right = target.right + target.width / 2;\n bottom = target.bottom;\n break;\n case 'widget-right':\n top = target.top;\n left = target.left + target.width / 2;\n right = target.right;\n bottom = target.bottom;\n break;\n case 'widget-bottom':\n top = target.top + target.height / 2;\n left = target.left;\n right = target.right;\n bottom = target.bottom;\n break;\n case 'widget-tab':\n var tabHeight = target.tabBar.node.getBoundingClientRect().height;\n top = target.top;\n left = target.left;\n right = target.right;\n bottom = target.bottom + target.height - tabHeight;\n break;\n default:\n throw 'unreachable';\n }\n // Show the overlay with the computed geometry.\n this.overlay.show({ top: top, left: left, right: right, bottom: bottom });\n // Finally, return the computed drop zone.\n return zone;\n };\n /**\n * Create a new tab bar for use by the panel.\n */\n DockPanel.prototype._createTabBar = function () {\n // Create the tab bar.\n var tabBar = this._renderer.createTabBar();\n // Set the generated tab bar property for the tab bar.\n Private.isGeneratedTabBarProperty.set(tabBar, true);\n // Hide the tab bar when in single document mode.\n if (this._mode === 'single-document') {\n tabBar.hide();\n }\n // Enforce necessary tab bar behavior.\n // TODO do we really want to enforce *all* of these?\n tabBar.tabsMovable = this._tabsMovable;\n tabBar.allowDeselect = false;\n tabBar.removeBehavior = 'select-previous-tab';\n tabBar.insertBehavior = 'select-tab-if-needed';\n // Connect the signal handlers for the tab bar.\n tabBar.tabMoved.connect(this._onTabMoved, this);\n tabBar.currentChanged.connect(this._onCurrentChanged, this);\n tabBar.tabCloseRequested.connect(this._onTabCloseRequested, this);\n tabBar.tabDetachRequested.connect(this._onTabDetachRequested, this);\n tabBar.tabActivateRequested.connect(this._onTabActivateRequested, this);\n // Return the initialized tab bar.\n return tabBar;\n };\n /**\n * Create a new handle for use by the panel.\n */\n DockPanel.prototype._createHandle = function () {\n return this._renderer.createHandle();\n };\n /**\n * Handle the `tabMoved` signal from a tab bar.\n */\n DockPanel.prototype._onTabMoved = function () {\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Handle the `currentChanged` signal from a tab bar.\n */\n DockPanel.prototype._onCurrentChanged = function (sender, args) {\n // Extract the previous and current title from the args.\n var previousTitle = args.previousTitle, currentTitle = args.currentTitle;\n // Hide the previous widget.\n if (previousTitle) {\n previousTitle.owner.hide();\n }\n // Show the current widget.\n if (currentTitle) {\n currentTitle.owner.show();\n }\n // Flush the message loop on IE and Edge to prevent flicker.\n if (domutils.Platform.IS_EDGE || domutils.Platform.IS_IE) {\n messaging.MessageLoop.flush();\n }\n // Schedule an emit of the layout modified signal.\n messaging.MessageLoop.postMessage(this, Private.LayoutModified);\n };\n /**\n * Handle the `tabActivateRequested` signal from a tab bar.\n */\n DockPanel.prototype._onTabActivateRequested = function (sender, args) {\n args.title.owner.activate();\n };\n /**\n * Handle the `tabCloseRequested` signal from a tab bar.\n */\n DockPanel.prototype._onTabCloseRequested = function (sender, args) {\n args.title.owner.close();\n };\n /**\n * Handle the `tabDetachRequested` signal from a tab bar.\n */\n DockPanel.prototype._onTabDetachRequested = function (sender, args) {\n var _this = this;\n // Do nothing if a drag is already in progress.\n if (this._drag) {\n return;\n }\n // Release the tab bar's hold on the mouse.\n sender.releaseMouse();\n // Extract the data from the args.\n var title = args.title, tab = args.tab, clientX = args.clientX, clientY = args.clientY;\n // Setup the mime data for the drag operation.\n var mimeData = new coreutils.MimeData();\n var factory = function () { return title.owner; };\n mimeData.setData('application/vnd.lumino.widget-factory', factory);\n // Create the drag image for the drag operation.\n var dragImage = tab.cloneNode(true);\n // Create the drag object to manage the drag-drop operation.\n this._drag = new dragdrop.Drag({\n mimeData: mimeData, dragImage: dragImage,\n proposedAction: 'move',\n supportedActions: 'move',\n });\n // Hide the tab node in the original tab.\n tab.classList.add('lm-mod-hidden');\n /* */\n tab.classList.add('p-mod-hidden');\n // Create the cleanup callback.\n var cleanup = (function () {\n _this._drag = null;\n tab.classList.remove('lm-mod-hidden');\n /* */\n tab.classList.remove('p-mod-hidden');\n });\n // Start the drag operation and cleanup when done.\n this._drag.start(clientX, clientY).then(cleanup);\n };\n return DockPanel;\n}(widget.Widget));\n/**\n * The namespace for the `DockPanel` class statics.\n */\n(function (DockPanel) {\n /**\n * A concrete implementation of `IOverlay`.\n *\n * This is the default overlay implementation for a dock panel.\n */\n var Overlay = /** @class */ (function () {\n /**\n * Construct a new overlay.\n */\n function Overlay() {\n this._timer = -1;\n this._hidden = true;\n this.node = document.createElement('div');\n this.node.classList.add('lm-DockPanel-overlay');\n this.node.classList.add('lm-mod-hidden');\n /* */\n this.node.classList.add('p-DockPanel-overlay');\n this.node.classList.add('p-mod-hidden');\n this.node.style.position = 'absolute';\n }\n /**\n * Show the overlay using the given overlay geometry.\n *\n * @param geo - The desired geometry for the overlay.\n */\n Overlay.prototype.show = function (geo) {\n // Update the position of the overlay.\n var style = this.node.style;\n style.top = geo.top + \"px\";\n style.left = geo.left + \"px\";\n style.right = geo.right + \"px\";\n style.bottom = geo.bottom + \"px\";\n // Clear any pending hide timer.\n clearTimeout(this._timer);\n this._timer = -1;\n // If the overlay is already visible, we're done.\n if (!this._hidden) {\n return;\n }\n // Clear the hidden flag.\n this._hidden = false;\n // Finally, show the overlay.\n this.node.classList.remove('lm-mod-hidden');\n /* */\n this.node.classList.remove('p-mod-hidden');\n };\n /**\n * Hide the overlay node.\n *\n * @param delay - The delay (in ms) before hiding the overlay.\n * A delay value <= 0 will hide the overlay immediately.\n */\n Overlay.prototype.hide = function (delay) {\n var _this = this;\n // Do nothing if the overlay is already hidden.\n if (this._hidden) {\n return;\n }\n // Hide immediately if the delay is <= 0.\n if (delay <= 0) {\n clearTimeout(this._timer);\n this._timer = -1;\n this._hidden = true;\n this.node.classList.add('lm-mod-hidden');\n /* */\n this.node.classList.add('p-mod-hidden');\n return;\n }\n // Do nothing if a hide is already pending.\n if (this._timer !== -1) {\n return;\n }\n // Otherwise setup the hide timer.\n this._timer = window.setTimeout(function () {\n _this._timer = -1;\n _this._hidden = true;\n _this.node.classList.add('lm-mod-hidden');\n /* */\n _this.node.classList.add('p-mod-hidden');\n }, delay);\n };\n return Overlay;\n }());\n DockPanel.Overlay = Overlay;\n /**\n * The default implementation of `IRenderer`.\n */\n var Renderer = /** @class */ (function () {\n function Renderer() {\n }\n /**\n * Create a new tab bar for use with a dock panel.\n *\n * @returns A new tab bar for a dock panel.\n */\n Renderer.prototype.createTabBar = function () {\n var bar = new tabbar.TabBar();\n bar.addClass('lm-DockPanel-tabBar');\n /* */\n bar.addClass('p-DockPanel-tabBar');\n /* */\n return bar;\n };\n /**\n * Create a new handle node for use with a dock panel.\n *\n * @returns A new handle node for a dock panel.\n */\n Renderer.prototype.createHandle = function () {\n var handle = document.createElement('div');\n handle.className = 'lm-DockPanel-handle';\n /* */\n handle.classList.add('p-DockPanel-handle');\n return handle;\n };\n return Renderer;\n }());\n DockPanel.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n DockPanel.defaultRenderer = new Renderer();\n})(exports.DockPanel || (exports.DockPanel = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * A fraction used for sizing root panels; ~= `1 / golden_ratio`.\n */\n Private.GOLDEN_RATIO = 0.618;\n /**\n * The default sizes for the edge drop zones, in pixels.\n */\n Private.DEFAULT_EDGES = {\n /**\n * The size of the top edge dock zone for the root panel, in pixels.\n * This is different from the others to distinguish between the top\n * tab bar and the top root zone.\n */\n top: 12,\n /**\n * The size of the edge dock zone for the root panel, in pixels.\n */\n right: 40,\n /**\n * The size of the edge dock zone for the root panel, in pixels.\n */\n bottom: 40,\n /**\n * The size of the edge dock zone for the root panel, in pixels.\n */\n left: 40\n };\n /**\n * A singleton `'layout-modified'` conflatable message.\n */\n Private.LayoutModified = new messaging.ConflatableMessage('layout-modified');\n /**\n * An attached property used to track generated tab bars.\n */\n Private.isGeneratedTabBarProperty = new properties.AttachedProperty({\n name: 'isGeneratedTabBar',\n create: function () { return false; }\n });\n /**\n * Create a single document config for the widgets in a dock panel.\n */\n function createSingleDocumentConfig(panel) {\n // Return an empty config if the panel is empty.\n if (panel.isEmpty) {\n return { main: null };\n }\n // Get a flat array of the widgets in the panel.\n var widgets = algorithm.toArray(panel.widgets());\n // Get the first selected widget in the panel.\n var selected = panel.selectedWidgets().next();\n // Compute the current index for the new config.\n var currentIndex = selected ? widgets.indexOf(selected) : -1;\n // Return the single document config.\n return { main: { type: 'tab-area', widgets: widgets, currentIndex: currentIndex } };\n }\n Private.createSingleDocumentConfig = createSingleDocumentConfig;\n /**\n * Find the drop target at the given client position.\n */\n function findDropTarget(panel, clientX, clientY, edges) {\n // Bail if the mouse is not over the dock panel.\n if (!domutils.ElementExt.hitTest(panel.node, clientX, clientY)) {\n return { zone: 'invalid', target: null };\n }\n // Look up the layout for the panel.\n var layout = panel.layout;\n // If the layout is empty, indicate the entire root drop zone.\n if (layout.isEmpty) {\n return { zone: 'root-all', target: null };\n }\n // Test the edge zones when in multiple document mode.\n if (panel.mode === 'multiple-document') {\n // Get the client rect for the dock panel.\n var panelRect = panel.node.getBoundingClientRect();\n // Compute the distance to each edge of the panel.\n var pl = clientX - panelRect.left + 1;\n var pt = clientY - panelRect.top + 1;\n var pr = panelRect.right - clientX;\n var pb = panelRect.bottom - clientY;\n // Find the minimum distance to an edge.\n var pd = Math.min(pt, pr, pb, pl);\n // Return a root zone if the mouse is within an edge.\n switch (pd) {\n case pt:\n if (pt < edges.top) {\n return { zone: 'root-top', target: null };\n }\n break;\n case pr:\n if (pr < edges.right) {\n return { zone: 'root-right', target: null };\n }\n break;\n case pb:\n if (pb < edges.bottom) {\n return { zone: 'root-bottom', target: null };\n }\n break;\n case pl:\n if (pl < edges.left) {\n return { zone: 'root-left', target: null };\n }\n break;\n default:\n throw 'unreachable';\n }\n }\n // Hit test the dock layout at the given client position.\n var target = layout.hitTestTabAreas(clientX, clientY);\n // Bail if no target area was found.\n if (!target) {\n return { zone: 'invalid', target: null };\n }\n // Return the whole tab area when in single document mode.\n if (panel.mode === 'single-document') {\n return { zone: 'widget-all', target: target };\n }\n // Compute the distance to each edge of the tab area.\n var al = target.x - target.left + 1;\n var at = target.y - target.top + 1;\n var ar = target.left + target.width - target.x;\n var ab = target.top + target.height - target.y;\n var tabHeight = target.tabBar.node.getBoundingClientRect().height;\n if (at < tabHeight) {\n return { zone: 'widget-tab', target: target };\n }\n // Get the X and Y edge sizes for the area.\n var rx = Math.round(target.width / 3);\n var ry = Math.round(target.height / 3);\n // If the mouse is not within an edge, indicate the entire area.\n if (al > rx && ar > rx && at > ry && ab > ry) {\n return { zone: 'widget-all', target: target };\n }\n // Scale the distances by the slenderness ratio.\n al /= rx;\n at /= ry;\n ar /= rx;\n ab /= ry;\n // Find the minimum distance to the area edge.\n var ad = Math.min(al, at, ar, ab);\n // Find the widget zone for the area edge.\n var zone;\n switch (ad) {\n case al:\n zone = 'widget-left';\n break;\n case at:\n zone = 'widget-top';\n break;\n case ar:\n zone = 'widget-right';\n break;\n case ab:\n zone = 'widget-bottom';\n break;\n default:\n throw 'unreachable';\n }\n // Return the final drop target.\n return { zone: zone, target: target };\n }\n Private.findDropTarget = findDropTarget;\n /**\n * Get the drop reference widget for a tab bar.\n */\n function getDropRef(tabBar) {\n if (tabBar.titles.length === 0) {\n return null;\n }\n if (tabBar.currentTitle) {\n return tabBar.currentTitle.owner;\n }\n return tabBar.titles[tabBar.titles.length - 1].owner;\n }\n Private.getDropRef = getDropRef;\n})(Private || (Private = {}));\n//# sourceMappingURL=dockpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/dockpanel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/focustracker.js": │ │ │ │ /*!************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/focustracker.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/focustracker.js ***! │ │ │ │ \************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A class which tracks focus among a set of widgets.\n *\n * This class is useful when code needs to keep track of the most\n * recently focused widget(s) among a set of related widgets.\n */\nvar FocusTracker = /** @class */ (function () {\n /**\n * Construct a new focus tracker.\n */\n function FocusTracker() {\n this._counter = 0;\n this._widgets = [];\n this._activeWidget = null;\n this._currentWidget = null;\n this._numbers = new Map();\n this._nodes = new Map();\n this._activeChanged = new signaling.Signal(this);\n this._currentChanged = new signaling.Signal(this);\n }\n /**\n * Dispose of the resources held by the tracker.\n */\n FocusTracker.prototype.dispose = function () {\n var _this = this;\n // Do nothing if the tracker is already disposed.\n if (this._counter < 0) {\n return;\n }\n // Mark the tracker as disposed.\n this._counter = -1;\n // Clear the connections for the tracker.\n signaling.Signal.clearData(this);\n // Remove all event listeners.\n algorithm.each(this._widgets, function (w) {\n w.node.removeEventListener('focus', _this, true);\n w.node.removeEventListener('blur', _this, true);\n });\n // Clear the internal data structures.\n this._activeWidget = null;\n this._currentWidget = null;\n this._nodes.clear();\n this._numbers.clear();\n this._widgets.length = 0;\n };\n Object.defineProperty(FocusTracker.prototype, \"currentChanged\", {\n /**\n * A signal emitted when the current widget has changed.\n */\n get: function () {\n return this._currentChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"activeChanged\", {\n /**\n * A signal emitted when the active widget has changed.\n */\n get: function () {\n return this._activeChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"isDisposed\", {\n /**\n * A flag indicating whether the tracker is disposed.\n */\n get: function () {\n return this._counter < 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"currentWidget\", {\n /**\n * The current widget in the tracker.\n *\n * #### Notes\n * The current widget is the widget among the tracked widgets which\n * has the *descendant node* which has most recently been focused.\n *\n * The current widget will not be updated if the node loses focus. It\n * will only be updated when a different tracked widget gains focus.\n *\n * If the current widget is removed from the tracker, the previous\n * current widget will be restored.\n *\n * This behavior is intended to follow a user's conceptual model of\n * a semantically \"current\" widget, where the \"last thing of type X\"\n * to be interacted with is the \"current instance of X\", regardless\n * of whether that instance still has focus.\n */\n get: function () {\n return this._currentWidget;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"activeWidget\", {\n /**\n * The active widget in the tracker.\n *\n * #### Notes\n * The active widget is the widget among the tracked widgets which\n * has the *descendant node* which is currently focused.\n */\n get: function () {\n return this._activeWidget;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"widgets\", {\n /**\n * A read only array of the widgets being tracked.\n */\n get: function () {\n return this._widgets;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the focus number for a particular widget in the tracker.\n *\n * @param widget - The widget of interest.\n *\n * @returns The focus number for the given widget, or `-1` if the\n * widget has not had focus since being added to the tracker, or\n * is not contained by the tracker.\n *\n * #### Notes\n * The focus number indicates the relative order in which the widgets\n * have gained focus. A widget with a larger number has gained focus\n * more recently than a widget with a smaller number.\n *\n * The `currentWidget` will always have the largest focus number.\n *\n * All widgets start with a focus number of `-1`, which indicates that\n * the widget has not been focused since being added to the tracker.\n */\n FocusTracker.prototype.focusNumber = function (widget) {\n var n = this._numbers.get(widget);\n return n === undefined ? -1 : n;\n };\n /**\n * Test whether the focus tracker contains a given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns `true` if the widget is tracked, `false` otherwise.\n */\n FocusTracker.prototype.has = function (widget) {\n return this._numbers.has(widget);\n };\n /**\n * Add a widget to the focus tracker.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * A widget will be automatically removed from the tracker if it\n * is disposed after being added.\n *\n * If the widget is already tracked, this is a no-op.\n */\n FocusTracker.prototype.add = function (widget) {\n // Do nothing if the widget is already tracked.\n if (this._numbers.has(widget)) {\n return;\n }\n // Test whether the widget has focus.\n var focused = widget.node.contains(document.activeElement);\n // Set up the initial focus number.\n var n = focused ? this._counter++ : -1;\n // Add the widget to the internal data structures.\n this._widgets.push(widget);\n this._numbers.set(widget, n);\n this._nodes.set(widget.node, widget);\n // Set up the event listeners. The capturing phase must be used\n // since the 'focus' and 'blur' events don't bubble and Firefox\n // doesn't support the 'focusin' or 'focusout' events.\n widget.node.addEventListener('focus', this, true);\n widget.node.addEventListener('blur', this, true);\n // Connect the disposed signal handler.\n widget.disposed.connect(this._onWidgetDisposed, this);\n // Set the current and active widgets if needed.\n if (focused) {\n this._setWidgets(widget, widget);\n }\n };\n /**\n * Remove a widget from the focus tracker.\n *\n * #### Notes\n * If the widget is the `currentWidget`, the previous current widget\n * will become the new `currentWidget`.\n *\n * A widget will be automatically removed from the tracker if it\n * is disposed after being added.\n *\n * If the widget is not tracked, this is a no-op.\n */\n FocusTracker.prototype.remove = function (widget) {\n var _this = this;\n // Bail early if the widget is not tracked.\n if (!this._numbers.has(widget)) {\n return;\n }\n // Disconnect the disposed signal handler.\n widget.disposed.disconnect(this._onWidgetDisposed, this);\n // Remove the event listeners.\n widget.node.removeEventListener('focus', this, true);\n widget.node.removeEventListener('blur', this, true);\n // Remove the widget from the internal data structures.\n algorithm.ArrayExt.removeFirstOf(this._widgets, widget);\n this._nodes.delete(widget.node);\n this._numbers.delete(widget);\n // Bail early if the widget is not the current widget.\n if (this._currentWidget !== widget) {\n return;\n }\n // Filter the widgets for those which have had focus.\n var valid = algorithm.filter(this._widgets, function (w) { return _this._numbers.get(w) !== -1; });\n // Get the valid widget with the max focus number.\n var previous = algorithm.max(valid, function (first, second) {\n var a = _this._numbers.get(first);\n var b = _this._numbers.get(second);\n return a - b;\n }) || null;\n // Set the current and active widgets.\n this._setWidgets(previous, null);\n };\n /**\n * Handle the DOM events for the focus tracker.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the tracked nodes. It should\n * not be called directly by user code.\n */\n FocusTracker.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'focus':\n this._evtFocus(event);\n break;\n case 'blur':\n this._evtBlur(event);\n break;\n }\n };\n /**\n * Set the current and active widgets for the tracker.\n */\n FocusTracker.prototype._setWidgets = function (current, active) {\n // Swap the current widget.\n var oldCurrent = this._currentWidget;\n this._currentWidget = current;\n // Swap the active widget.\n var oldActive = this._activeWidget;\n this._activeWidget = active;\n // Emit the `currentChanged` signal if needed.\n if (oldCurrent !== current) {\n this._currentChanged.emit({ oldValue: oldCurrent, newValue: current });\n }\n // Emit the `activeChanged` signal if needed.\n if (oldActive !== active) {\n this._activeChanged.emit({ oldValue: oldActive, newValue: active });\n }\n };\n /**\n * Handle the `'focus'` event for a tracked widget.\n */\n FocusTracker.prototype._evtFocus = function (event) {\n // Find the widget which gained focus, which is known to exist.\n var widget = this._nodes.get(event.currentTarget);\n // Update the focus number if necessary.\n if (widget !== this._currentWidget) {\n this._numbers.set(widget, this._counter++);\n }\n // Set the current and active widgets.\n this._setWidgets(widget, widget);\n };\n /**\n * Handle the `'blur'` event for a tracked widget.\n */\n FocusTracker.prototype._evtBlur = function (event) {\n // Find the widget which lost focus, which is known to exist.\n var widget = this._nodes.get(event.currentTarget);\n // Get the node which being focused after this blur.\n var focusTarget = event.relatedTarget;\n // If no other node is being focused, clear the active widget.\n if (!focusTarget) {\n this._setWidgets(this._currentWidget, null);\n return;\n }\n // Bail if the focus widget is not changing.\n if (widget.node.contains(focusTarget)) {\n return;\n }\n // If no tracked widget is being focused, clear the active widget.\n if (!algorithm.find(this._widgets, function (w) { return w.node.contains(focusTarget); })) {\n this._setWidgets(this._currentWidget, null);\n return;\n }\n };\n /**\n * Handle the `disposed` signal for a tracked widget.\n */\n FocusTracker.prototype._onWidgetDisposed = function (sender) {\n this.remove(sender);\n };\n return FocusTracker;\n}());\n\nexports.FocusTracker = FocusTracker;\n//# sourceMappingURL=focustracker.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/focustracker.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * A class which tracks focus among a set of widgets.\n *\n * This class is useful when code needs to keep track of the most\n * recently focused widget(s) among a set of related widgets.\n */\nvar FocusTracker = /** @class */ (function () {\n /**\n * Construct a new focus tracker.\n */\n function FocusTracker() {\n this._counter = 0;\n this._widgets = [];\n this._activeWidget = null;\n this._currentWidget = null;\n this._numbers = new Map();\n this._nodes = new Map();\n this._activeChanged = new signaling.Signal(this);\n this._currentChanged = new signaling.Signal(this);\n }\n /**\n * Dispose of the resources held by the tracker.\n */\n FocusTracker.prototype.dispose = function () {\n var _this = this;\n // Do nothing if the tracker is already disposed.\n if (this._counter < 0) {\n return;\n }\n // Mark the tracker as disposed.\n this._counter = -1;\n // Clear the connections for the tracker.\n signaling.Signal.clearData(this);\n // Remove all event listeners.\n algorithm.each(this._widgets, function (w) {\n w.node.removeEventListener('focus', _this, true);\n w.node.removeEventListener('blur', _this, true);\n });\n // Clear the internal data structures.\n this._activeWidget = null;\n this._currentWidget = null;\n this._nodes.clear();\n this._numbers.clear();\n this._widgets.length = 0;\n };\n Object.defineProperty(FocusTracker.prototype, \"currentChanged\", {\n /**\n * A signal emitted when the current widget has changed.\n */\n get: function () {\n return this._currentChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"activeChanged\", {\n /**\n * A signal emitted when the active widget has changed.\n */\n get: function () {\n return this._activeChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"isDisposed\", {\n /**\n * A flag indicating whether the tracker is disposed.\n */\n get: function () {\n return this._counter < 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"currentWidget\", {\n /**\n * The current widget in the tracker.\n *\n * #### Notes\n * The current widget is the widget among the tracked widgets which\n * has the *descendant node* which has most recently been focused.\n *\n * The current widget will not be updated if the node loses focus. It\n * will only be updated when a different tracked widget gains focus.\n *\n * If the current widget is removed from the tracker, the previous\n * current widget will be restored.\n *\n * This behavior is intended to follow a user's conceptual model of\n * a semantically \"current\" widget, where the \"last thing of type X\"\n * to be interacted with is the \"current instance of X\", regardless\n * of whether that instance still has focus.\n */\n get: function () {\n return this._currentWidget;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"activeWidget\", {\n /**\n * The active widget in the tracker.\n *\n * #### Notes\n * The active widget is the widget among the tracked widgets which\n * has the *descendant node* which is currently focused.\n */\n get: function () {\n return this._activeWidget;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FocusTracker.prototype, \"widgets\", {\n /**\n * A read only array of the widgets being tracked.\n */\n get: function () {\n return this._widgets;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the focus number for a particular widget in the tracker.\n *\n * @param widget - The widget of interest.\n *\n * @returns The focus number for the given widget, or `-1` if the\n * widget has not had focus since being added to the tracker, or\n * is not contained by the tracker.\n *\n * #### Notes\n * The focus number indicates the relative order in which the widgets\n * have gained focus. A widget with a larger number has gained focus\n * more recently than a widget with a smaller number.\n *\n * The `currentWidget` will always have the largest focus number.\n *\n * All widgets start with a focus number of `-1`, which indicates that\n * the widget has not been focused since being added to the tracker.\n */\n FocusTracker.prototype.focusNumber = function (widget) {\n var n = this._numbers.get(widget);\n return n === undefined ? -1 : n;\n };\n /**\n * Test whether the focus tracker contains a given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns `true` if the widget is tracked, `false` otherwise.\n */\n FocusTracker.prototype.has = function (widget) {\n return this._numbers.has(widget);\n };\n /**\n * Add a widget to the focus tracker.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * A widget will be automatically removed from the tracker if it\n * is disposed after being added.\n *\n * If the widget is already tracked, this is a no-op.\n */\n FocusTracker.prototype.add = function (widget) {\n // Do nothing if the widget is already tracked.\n if (this._numbers.has(widget)) {\n return;\n }\n // Test whether the widget has focus.\n var focused = widget.node.contains(document.activeElement);\n // Set up the initial focus number.\n var n = focused ? this._counter++ : -1;\n // Add the widget to the internal data structures.\n this._widgets.push(widget);\n this._numbers.set(widget, n);\n this._nodes.set(widget.node, widget);\n // Set up the event listeners. The capturing phase must be used\n // since the 'focus' and 'blur' events don't bubble and Firefox\n // doesn't support the 'focusin' or 'focusout' events.\n widget.node.addEventListener('focus', this, true);\n widget.node.addEventListener('blur', this, true);\n // Connect the disposed signal handler.\n widget.disposed.connect(this._onWidgetDisposed, this);\n // Set the current and active widgets if needed.\n if (focused) {\n this._setWidgets(widget, widget);\n }\n };\n /**\n * Remove a widget from the focus tracker.\n *\n * #### Notes\n * If the widget is the `currentWidget`, the previous current widget\n * will become the new `currentWidget`.\n *\n * A widget will be automatically removed from the tracker if it\n * is disposed after being added.\n *\n * If the widget is not tracked, this is a no-op.\n */\n FocusTracker.prototype.remove = function (widget) {\n var _this = this;\n // Bail early if the widget is not tracked.\n if (!this._numbers.has(widget)) {\n return;\n }\n // Disconnect the disposed signal handler.\n widget.disposed.disconnect(this._onWidgetDisposed, this);\n // Remove the event listeners.\n widget.node.removeEventListener('focus', this, true);\n widget.node.removeEventListener('blur', this, true);\n // Remove the widget from the internal data structures.\n algorithm.ArrayExt.removeFirstOf(this._widgets, widget);\n this._nodes.delete(widget.node);\n this._numbers.delete(widget);\n // Bail early if the widget is not the current widget.\n if (this._currentWidget !== widget) {\n return;\n }\n // Filter the widgets for those which have had focus.\n var valid = algorithm.filter(this._widgets, function (w) { return _this._numbers.get(w) !== -1; });\n // Get the valid widget with the max focus number.\n var previous = algorithm.max(valid, function (first, second) {\n var a = _this._numbers.get(first);\n var b = _this._numbers.get(second);\n return a - b;\n }) || null;\n // Set the current and active widgets.\n this._setWidgets(previous, null);\n };\n /**\n * Handle the DOM events for the focus tracker.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the tracked nodes. It should\n * not be called directly by user code.\n */\n FocusTracker.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'focus':\n this._evtFocus(event);\n break;\n case 'blur':\n this._evtBlur(event);\n break;\n }\n };\n /**\n * Set the current and active widgets for the tracker.\n */\n FocusTracker.prototype._setWidgets = function (current, active) {\n // Swap the current widget.\n var oldCurrent = this._currentWidget;\n this._currentWidget = current;\n // Swap the active widget.\n var oldActive = this._activeWidget;\n this._activeWidget = active;\n // Emit the `currentChanged` signal if needed.\n if (oldCurrent !== current) {\n this._currentChanged.emit({ oldValue: oldCurrent, newValue: current });\n }\n // Emit the `activeChanged` signal if needed.\n if (oldActive !== active) {\n this._activeChanged.emit({ oldValue: oldActive, newValue: active });\n }\n };\n /**\n * Handle the `'focus'` event for a tracked widget.\n */\n FocusTracker.prototype._evtFocus = function (event) {\n // Find the widget which gained focus, which is known to exist.\n var widget = this._nodes.get(event.currentTarget);\n // Update the focus number if necessary.\n if (widget !== this._currentWidget) {\n this._numbers.set(widget, this._counter++);\n }\n // Set the current and active widgets.\n this._setWidgets(widget, widget);\n };\n /**\n * Handle the `'blur'` event for a tracked widget.\n */\n FocusTracker.prototype._evtBlur = function (event) {\n // Find the widget which lost focus, which is known to exist.\n var widget = this._nodes.get(event.currentTarget);\n // Get the node which being focused after this blur.\n var focusTarget = event.relatedTarget;\n // If no other node is being focused, clear the active widget.\n if (!focusTarget) {\n this._setWidgets(this._currentWidget, null);\n return;\n }\n // Bail if the focus widget is not changing.\n if (widget.node.contains(focusTarget)) {\n return;\n }\n // If no tracked widget is being focused, clear the active widget.\n if (!algorithm.find(this._widgets, function (w) { return w.node.contains(focusTarget); })) {\n this._setWidgets(this._currentWidget, null);\n return;\n }\n };\n /**\n * Handle the `disposed` signal for a tracked widget.\n */\n FocusTracker.prototype._onWidgetDisposed = function (sender) {\n this.remove(sender);\n };\n return FocusTracker;\n}());\n\nexports.FocusTracker = FocusTracker;\n//# sourceMappingURL=focustracker.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/focustracker.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/gridlayout.js": │ │ │ │ /*!**********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/gridlayout.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/gridlayout.js ***! │ │ │ │ \**********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n\n/**\n * A layout which arranges its widgets in a grid.\n */\nexports.GridLayout = /** @class */ (function (_super) {\n tslib.__extends(GridLayout, _super);\n /**\n * Construct a new grid layout.\n *\n * @param options - The options for initializing the layout.\n */\n function GridLayout(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, options) || this;\n _this._dirty = false;\n _this._rowSpacing = 4;\n _this._columnSpacing = 4;\n _this._items = [];\n _this._rowStarts = [];\n _this._columnStarts = [];\n _this._rowSizers = [new boxengine.BoxSizer()];\n _this._columnSizers = [new boxengine.BoxSizer()];\n _this._box = null;\n if (options.rowCount !== undefined) {\n Private.reallocSizers(_this._rowSizers, options.rowCount);\n }\n if (options.columnCount !== undefined) {\n Private.reallocSizers(_this._columnSizers, options.columnCount);\n }\n if (options.rowSpacing !== undefined) {\n _this._rowSpacing = Private.clampValue(options.rowSpacing);\n }\n if (options.columnSpacing !== undefined) {\n _this._columnSpacing = Private.clampValue(options.columnSpacing);\n }\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n GridLayout.prototype.dispose = function () {\n // Dispose of the widgets and layout items.\n algorithm.each(this._items, function (item) {\n var widget = item.widget;\n item.dispose();\n widget.dispose();\n });\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n this._rowStarts.length = 0;\n this._rowSizers.length = 0;\n this._columnStarts.length = 0;\n this._columnSizers.length = 0;\n // Dispose of the rest of the layout.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(GridLayout.prototype, \"rowCount\", {\n /**\n * Get the number of rows in the layout.\n */\n get: function () {\n return this._rowSizers.length;\n },\n /**\n * Set the number of rows in the layout.\n *\n * #### Notes\n * The minimum row count is `1`.\n */\n set: function (value) {\n // Do nothing if the row count does not change.\n if (value === this.rowCount) {\n return;\n }\n // Reallocate the row sizers.\n Private.reallocSizers(this._rowSizers, value);\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GridLayout.prototype, \"columnCount\", {\n /**\n * Get the number of columns in the layout.\n */\n get: function () {\n return this._columnSizers.length;\n },\n /**\n * Set the number of columns in the layout.\n *\n * #### Notes\n * The minimum column count is `1`.\n */\n set: function (value) {\n // Do nothing if the column count does not change.\n if (value === this.columnCount) {\n return;\n }\n // Reallocate the column sizers.\n Private.reallocSizers(this._columnSizers, value);\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GridLayout.prototype, \"rowSpacing\", {\n /**\n * Get the row spacing for the layout.\n */\n get: function () {\n return this._rowSpacing;\n },\n /**\n * Set the row spacing for the layout.\n */\n set: function (value) {\n // Clamp the spacing to the allowed range.\n value = Private.clampValue(value);\n // Bail if the spacing does not change\n if (this._rowSpacing === value) {\n return;\n }\n // Update the internal spacing.\n this._rowSpacing = value;\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GridLayout.prototype, \"columnSpacing\", {\n /**\n * Get the column spacing for the layout.\n */\n get: function () {\n return this._columnSpacing;\n },\n /**\n * Set the col spacing for the layout.\n */\n set: function (value) {\n // Clamp the spacing to the allowed range.\n value = Private.clampValue(value);\n // Bail if the spacing does not change\n if (this._columnSpacing === value) {\n return;\n }\n // Update the internal spacing.\n this._columnSpacing = value;\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the stretch factor for a specific row.\n *\n * @param index - The row index of interest.\n *\n * @returns The stretch factor for the row.\n *\n * #### Notes\n * This returns `-1` if the index is out of range.\n */\n GridLayout.prototype.rowStretch = function (index) {\n var sizer = this._rowSizers[index];\n return sizer ? sizer.stretch : -1;\n };\n /**\n * Set the stretch factor for a specific row.\n *\n * @param index - The row index of interest.\n *\n * @param value - The stretch factor for the row.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n GridLayout.prototype.setRowStretch = function (index, value) {\n // Look up the row sizer.\n var sizer = this._rowSizers[index];\n // Bail if the index is out of range.\n if (!sizer) {\n return;\n }\n // Clamp the value to the allowed range.\n value = Private.clampValue(value);\n // Bail if the stretch does not change.\n if (sizer.stretch === value) {\n return;\n }\n // Update the sizer stretch.\n sizer.stretch = value;\n // Schedule an update of the parent.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Get the stretch factor for a specific column.\n *\n * @param index - The column index of interest.\n *\n * @returns The stretch factor for the column.\n *\n * #### Notes\n * This returns `-1` if the index is out of range.\n */\n GridLayout.prototype.columnStretch = function (index) {\n var sizer = this._columnSizers[index];\n return sizer ? sizer.stretch : -1;\n };\n /**\n * Set the stretch factor for a specific column.\n *\n * @param index - The column index of interest.\n *\n * @param value - The stretch factor for the column.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n GridLayout.prototype.setColumnStretch = function (index, value) {\n // Look up the column sizer.\n var sizer = this._columnSizers[index];\n // Bail if the index is out of range.\n if (!sizer) {\n return;\n }\n // Clamp the value to the allowed range.\n value = Private.clampValue(value);\n // Bail if the stretch does not change.\n if (sizer.stretch === value) {\n return;\n }\n // Update the sizer stretch.\n sizer.stretch = value;\n // Schedule an update of the parent.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Create an iterator over the widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n */\n GridLayout.prototype.iter = function () {\n return algorithm.map(this._items, function (item) { return item.widget; });\n };\n /**\n * Add a widget to the grid layout.\n *\n * @param widget - The widget to add to the layout.\n *\n * #### Notes\n * If the widget is already contained in the layout, this is no-op.\n */\n GridLayout.prototype.addWidget = function (widget) {\n // Look up the index for the widget.\n var i = algorithm.ArrayExt.findFirstIndex(this._items, function (it) { return it.widget === widget; });\n // Bail if the widget is already in the layout.\n if (i !== -1) {\n return;\n }\n // Add the widget to the layout.\n this._items.push(new layout.LayoutItem(widget));\n // Attach the widget to the parent.\n if (this.parent) {\n this.attachWidget(widget);\n }\n };\n /**\n * Remove a widget from the grid layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n GridLayout.prototype.removeWidget = function (widget) {\n // Look up the index for the widget.\n var i = algorithm.ArrayExt.findFirstIndex(this._items, function (it) { return it.widget === widget; });\n // Bail if the widget is not in the layout.\n if (i === -1) {\n return;\n }\n // Remove the widget from the layout.\n var item = algorithm.ArrayExt.removeAt(this._items, i);\n // Detach the widget from the parent.\n if (this.parent) {\n this.detachWidget(widget);\n }\n // Dispose the layout item.\n item.dispose();\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n GridLayout.prototype.init = function () {\n var _this = this;\n _super.prototype.init.call(this);\n algorithm.each(this, function (widget) { _this.attachWidget(widget); });\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param widget - The widget to attach to the parent.\n */\n GridLayout.prototype.attachWidget = function (widget$1) {\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param widget - The widget to detach from the parent.\n */\n GridLayout.prototype.detachWidget = function (widget$1) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n GridLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n GridLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n GridLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n GridLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n GridLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n GridLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n GridLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n GridLayout.prototype._fit = function () {\n // Reset the min sizes of the sizers.\n for (var i = 0, n = this.rowCount; i < n; ++i) {\n this._rowSizers[i].minSize = 0;\n }\n for (var i = 0, n = this.columnCount; i < n; ++i) {\n this._columnSizers[i].minSize = 0;\n }\n // Filter for the visible layout items.\n var items = this._items.filter(function (it) { return !it.isHidden; });\n // Fit the layout items.\n for (var i = 0, n = items.length; i < n; ++i) {\n items[i].fit();\n }\n // Get the max row and column index.\n var maxRow = this.rowCount - 1;\n var maxCol = this.columnCount - 1;\n // Sort the items by row span.\n items.sort(Private.rowSpanCmp);\n // Update the min sizes of the row sizers.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Fetch the item.\n var item = items[i];\n // Get the row bounds for the item.\n var config = GridLayout.getCellConfig(item.widget);\n var r1 = Math.min(config.row, maxRow);\n var r2 = Math.min(config.row + config.rowSpan - 1, maxRow);\n // Distribute the minimum height to the sizers as needed.\n Private.distributeMin(this._rowSizers, r1, r2, item.minHeight);\n }\n // Sort the items by column span.\n items.sort(Private.columnSpanCmp);\n // Update the min sizes of the column sizers.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Fetch the item.\n var item = items[i];\n // Get the column bounds for the item.\n var config = GridLayout.getCellConfig(item.widget);\n var c1 = Math.min(config.column, maxCol);\n var c2 = Math.min(config.column + config.columnSpan - 1, maxCol);\n // Distribute the minimum width to the sizers as needed.\n Private.distributeMin(this._columnSizers, c1, c2, item.minWidth);\n }\n // If no size constraint is needed, just update the parent.\n if (this.fitPolicy === 'set-no-constraint') {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n return;\n }\n // Set up the computed min size.\n var minH = maxRow * this._rowSpacing;\n var minW = maxCol * this._columnSpacing;\n // Add the sizer minimums to the computed min size.\n for (var i = 0, n = this.rowCount; i < n; ++i) {\n minH += this._rowSizers[i].minSize;\n }\n for (var i = 0, n = this.columnCount; i < n; ++i) {\n minW += this._columnSizers[i].minSize;\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n GridLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the layout area adjusted for border and padding.\n var top = this._box.paddingTop;\n var left = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Get the max row and column index.\n var maxRow = this.rowCount - 1;\n var maxCol = this.columnCount - 1;\n // Compute the total fixed row and column space.\n var fixedRowSpace = maxRow * this._rowSpacing;\n var fixedColSpace = maxCol * this._columnSpacing;\n // Distribute the available space to the box sizers.\n boxengine.BoxEngine.calc(this._rowSizers, Math.max(0, height - fixedRowSpace));\n boxengine.BoxEngine.calc(this._columnSizers, Math.max(0, width - fixedColSpace));\n // Update the row start positions.\n for (var i = 0, pos = top, n = this.rowCount; i < n; ++i) {\n this._rowStarts[i] = pos;\n pos += this._rowSizers[i].size + this._rowSpacing;\n }\n // Update the column start positions.\n for (var i = 0, pos = left, n = this.columnCount; i < n; ++i) {\n this._columnStarts[i] = pos;\n pos += this._columnSizers[i].size + this._columnSpacing;\n }\n // Update the geometry of the layout items.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Fetch the cell bounds for the widget.\n var config = GridLayout.getCellConfig(item.widget);\n var r1 = Math.min(config.row, maxRow);\n var c1 = Math.min(config.column, maxCol);\n var r2 = Math.min(config.row + config.rowSpan - 1, maxRow);\n var c2 = Math.min(config.column + config.columnSpan - 1, maxCol);\n // Compute the cell geometry.\n var x = this._columnStarts[c1];\n var y = this._rowStarts[r1];\n var w = this._columnStarts[c2] + this._columnSizers[c2].size - x;\n var h = this._rowStarts[r2] + this._rowSizers[r2].size - y;\n // Update the geometry of the layout item.\n item.update(x, y, w, h);\n }\n };\n return GridLayout;\n}(layout.Layout));\n/**\n * The namespace for the `GridLayout` class statics.\n */\n(function (GridLayout) {\n /**\n * Get the cell config for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The cell config for the widget.\n */\n function getCellConfig(widget) {\n return Private.cellConfigProperty.get(widget);\n }\n GridLayout.getCellConfig = getCellConfig;\n /**\n * Set the cell config for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the cell config.\n */\n function setCellConfig(widget, value) {\n Private.cellConfigProperty.set(widget, Private.normalizeConfig(value));\n }\n GridLayout.setCellConfig = setCellConfig;\n})(exports.GridLayout || (exports.GridLayout = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The property descriptor for the widget cell config.\n */\n Private.cellConfigProperty = new properties.AttachedProperty({\n name: 'cellConfig',\n create: function () { return ({ row: 0, column: 0, rowSpan: 1, columnSpan: 1 }); },\n changed: onChildCellConfigChanged\n });\n /**\n * Normalize a partial cell config object.\n */\n function normalizeConfig(config) {\n var row = Math.max(0, Math.floor(config.row || 0));\n var column = Math.max(0, Math.floor(config.column || 0));\n var rowSpan = Math.max(1, Math.floor(config.rowSpan || 0));\n var columnSpan = Math.max(1, Math.floor(config.columnSpan || 0));\n return { row: row, column: column, rowSpan: rowSpan, columnSpan: columnSpan };\n }\n Private.normalizeConfig = normalizeConfig;\n /**\n * Clamp a value to an integer >= 0.\n */\n function clampValue(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampValue = clampValue;\n /**\n * A sort comparison function for row spans.\n */\n function rowSpanCmp(a, b) {\n var c1 = Private.cellConfigProperty.get(a.widget);\n var c2 = Private.cellConfigProperty.get(b.widget);\n return c1.rowSpan - c2.rowSpan;\n }\n Private.rowSpanCmp = rowSpanCmp;\n /**\n * A sort comparison function for column spans.\n */\n function columnSpanCmp(a, b) {\n var c1 = Private.cellConfigProperty.get(a.widget);\n var c2 = Private.cellConfigProperty.get(b.widget);\n return c1.columnSpan - c2.columnSpan;\n }\n Private.columnSpanCmp = columnSpanCmp;\n /**\n * Reallocate the box sizers for the given grid dimensions.\n */\n function reallocSizers(sizers, count) {\n // Coerce the count to the valid range.\n count = Math.max(1, Math.floor(count));\n // Add the missing sizers.\n while (sizers.length < count) {\n sizers.push(new boxengine.BoxSizer());\n }\n // Remove the extra sizers.\n if (sizers.length > count) {\n sizers.length = count;\n }\n }\n Private.reallocSizers = reallocSizers;\n /**\n * Distribute a min size constraint across a range of sizers.\n */\n function distributeMin(sizers, i1, i2, minSize) {\n // Sanity check the indices.\n if (i2 < i1) {\n return;\n }\n // Handle the simple case of no cell span.\n if (i1 === i2) {\n var sizer = sizers[i1];\n sizer.minSize = Math.max(sizer.minSize, minSize);\n return;\n }\n // Compute the total current min size of the span.\n var totalMin = 0;\n for (var i = i1; i <= i2; ++i) {\n totalMin += sizers[i].minSize;\n }\n // Do nothing if the total is greater than the required.\n if (totalMin >= minSize) {\n return;\n }\n // Compute the portion of the space to allocate to each sizer.\n var portion = (minSize - totalMin) / (i2 - i1 + 1);\n // Add the portion to each sizer.\n for (var i = i1; i <= i2; ++i) {\n sizers[i].minSize += portion;\n }\n }\n Private.distributeMin = distributeMin;\n /**\n * The change handler for the child cell config property.\n */\n function onChildCellConfigChanged(child) {\n if (child.parent && child.parent.layout instanceof exports.GridLayout) {\n child.parent.fit();\n }\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=gridlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/gridlayout.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n\n/**\n * A layout which arranges its widgets in a grid.\n */\nexports.GridLayout = /** @class */ (function (_super) {\n tslib.__extends(GridLayout, _super);\n /**\n * Construct a new grid layout.\n *\n * @param options - The options for initializing the layout.\n */\n function GridLayout(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, options) || this;\n _this._dirty = false;\n _this._rowSpacing = 4;\n _this._columnSpacing = 4;\n _this._items = [];\n _this._rowStarts = [];\n _this._columnStarts = [];\n _this._rowSizers = [new boxengine.BoxSizer()];\n _this._columnSizers = [new boxengine.BoxSizer()];\n _this._box = null;\n if (options.rowCount !== undefined) {\n Private.reallocSizers(_this._rowSizers, options.rowCount);\n }\n if (options.columnCount !== undefined) {\n Private.reallocSizers(_this._columnSizers, options.columnCount);\n }\n if (options.rowSpacing !== undefined) {\n _this._rowSpacing = Private.clampValue(options.rowSpacing);\n }\n if (options.columnSpacing !== undefined) {\n _this._columnSpacing = Private.clampValue(options.columnSpacing);\n }\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n GridLayout.prototype.dispose = function () {\n // Dispose of the widgets and layout items.\n algorithm.each(this._items, function (item) {\n var widget = item.widget;\n item.dispose();\n widget.dispose();\n });\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n this._rowStarts.length = 0;\n this._rowSizers.length = 0;\n this._columnStarts.length = 0;\n this._columnSizers.length = 0;\n // Dispose of the rest of the layout.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(GridLayout.prototype, \"rowCount\", {\n /**\n * Get the number of rows in the layout.\n */\n get: function () {\n return this._rowSizers.length;\n },\n /**\n * Set the number of rows in the layout.\n *\n * #### Notes\n * The minimum row count is `1`.\n */\n set: function (value) {\n // Do nothing if the row count does not change.\n if (value === this.rowCount) {\n return;\n }\n // Reallocate the row sizers.\n Private.reallocSizers(this._rowSizers, value);\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GridLayout.prototype, \"columnCount\", {\n /**\n * Get the number of columns in the layout.\n */\n get: function () {\n return this._columnSizers.length;\n },\n /**\n * Set the number of columns in the layout.\n *\n * #### Notes\n * The minimum column count is `1`.\n */\n set: function (value) {\n // Do nothing if the column count does not change.\n if (value === this.columnCount) {\n return;\n }\n // Reallocate the column sizers.\n Private.reallocSizers(this._columnSizers, value);\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GridLayout.prototype, \"rowSpacing\", {\n /**\n * Get the row spacing for the layout.\n */\n get: function () {\n return this._rowSpacing;\n },\n /**\n * Set the row spacing for the layout.\n */\n set: function (value) {\n // Clamp the spacing to the allowed range.\n value = Private.clampValue(value);\n // Bail if the spacing does not change\n if (this._rowSpacing === value) {\n return;\n }\n // Update the internal spacing.\n this._rowSpacing = value;\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GridLayout.prototype, \"columnSpacing\", {\n /**\n * Get the column spacing for the layout.\n */\n get: function () {\n return this._columnSpacing;\n },\n /**\n * Set the col spacing for the layout.\n */\n set: function (value) {\n // Clamp the spacing to the allowed range.\n value = Private.clampValue(value);\n // Bail if the spacing does not change\n if (this._columnSpacing === value) {\n return;\n }\n // Update the internal spacing.\n this._columnSpacing = value;\n // Schedule a fit of the parent.\n if (this.parent) {\n this.parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the stretch factor for a specific row.\n *\n * @param index - The row index of interest.\n *\n * @returns The stretch factor for the row.\n *\n * #### Notes\n * This returns `-1` if the index is out of range.\n */\n GridLayout.prototype.rowStretch = function (index) {\n var sizer = this._rowSizers[index];\n return sizer ? sizer.stretch : -1;\n };\n /**\n * Set the stretch factor for a specific row.\n *\n * @param index - The row index of interest.\n *\n * @param value - The stretch factor for the row.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n GridLayout.prototype.setRowStretch = function (index, value) {\n // Look up the row sizer.\n var sizer = this._rowSizers[index];\n // Bail if the index is out of range.\n if (!sizer) {\n return;\n }\n // Clamp the value to the allowed range.\n value = Private.clampValue(value);\n // Bail if the stretch does not change.\n if (sizer.stretch === value) {\n return;\n }\n // Update the sizer stretch.\n sizer.stretch = value;\n // Schedule an update of the parent.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Get the stretch factor for a specific column.\n *\n * @param index - The column index of interest.\n *\n * @returns The stretch factor for the column.\n *\n * #### Notes\n * This returns `-1` if the index is out of range.\n */\n GridLayout.prototype.columnStretch = function (index) {\n var sizer = this._columnSizers[index];\n return sizer ? sizer.stretch : -1;\n };\n /**\n * Set the stretch factor for a specific column.\n *\n * @param index - The column index of interest.\n *\n * @param value - The stretch factor for the column.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n GridLayout.prototype.setColumnStretch = function (index, value) {\n // Look up the column sizer.\n var sizer = this._columnSizers[index];\n // Bail if the index is out of range.\n if (!sizer) {\n return;\n }\n // Clamp the value to the allowed range.\n value = Private.clampValue(value);\n // Bail if the stretch does not change.\n if (sizer.stretch === value) {\n return;\n }\n // Update the sizer stretch.\n sizer.stretch = value;\n // Schedule an update of the parent.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Create an iterator over the widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n */\n GridLayout.prototype.iter = function () {\n return algorithm.map(this._items, function (item) { return item.widget; });\n };\n /**\n * Add a widget to the grid layout.\n *\n * @param widget - The widget to add to the layout.\n *\n * #### Notes\n * If the widget is already contained in the layout, this is no-op.\n */\n GridLayout.prototype.addWidget = function (widget) {\n // Look up the index for the widget.\n var i = algorithm.ArrayExt.findFirstIndex(this._items, function (it) { return it.widget === widget; });\n // Bail if the widget is already in the layout.\n if (i !== -1) {\n return;\n }\n // Add the widget to the layout.\n this._items.push(new layout.LayoutItem(widget));\n // Attach the widget to the parent.\n if (this.parent) {\n this.attachWidget(widget);\n }\n };\n /**\n * Remove a widget from the grid layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n GridLayout.prototype.removeWidget = function (widget) {\n // Look up the index for the widget.\n var i = algorithm.ArrayExt.findFirstIndex(this._items, function (it) { return it.widget === widget; });\n // Bail if the widget is not in the layout.\n if (i === -1) {\n return;\n }\n // Remove the widget from the layout.\n var item = algorithm.ArrayExt.removeAt(this._items, i);\n // Detach the widget from the parent.\n if (this.parent) {\n this.detachWidget(widget);\n }\n // Dispose the layout item.\n item.dispose();\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n GridLayout.prototype.init = function () {\n var _this = this;\n _super.prototype.init.call(this);\n algorithm.each(this, function (widget) { _this.attachWidget(widget); });\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param widget - The widget to attach to the parent.\n */\n GridLayout.prototype.attachWidget = function (widget$1) {\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param widget - The widget to detach from the parent.\n */\n GridLayout.prototype.detachWidget = function (widget$1) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n GridLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n GridLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n GridLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n GridLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n GridLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n GridLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n GridLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n GridLayout.prototype._fit = function () {\n // Reset the min sizes of the sizers.\n for (var i = 0, n = this.rowCount; i < n; ++i) {\n this._rowSizers[i].minSize = 0;\n }\n for (var i = 0, n = this.columnCount; i < n; ++i) {\n this._columnSizers[i].minSize = 0;\n }\n // Filter for the visible layout items.\n var items = this._items.filter(function (it) { return !it.isHidden; });\n // Fit the layout items.\n for (var i = 0, n = items.length; i < n; ++i) {\n items[i].fit();\n }\n // Get the max row and column index.\n var maxRow = this.rowCount - 1;\n var maxCol = this.columnCount - 1;\n // Sort the items by row span.\n items.sort(Private.rowSpanCmp);\n // Update the min sizes of the row sizers.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Fetch the item.\n var item = items[i];\n // Get the row bounds for the item.\n var config = GridLayout.getCellConfig(item.widget);\n var r1 = Math.min(config.row, maxRow);\n var r2 = Math.min(config.row + config.rowSpan - 1, maxRow);\n // Distribute the minimum height to the sizers as needed.\n Private.distributeMin(this._rowSizers, r1, r2, item.minHeight);\n }\n // Sort the items by column span.\n items.sort(Private.columnSpanCmp);\n // Update the min sizes of the column sizers.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Fetch the item.\n var item = items[i];\n // Get the column bounds for the item.\n var config = GridLayout.getCellConfig(item.widget);\n var c1 = Math.min(config.column, maxCol);\n var c2 = Math.min(config.column + config.columnSpan - 1, maxCol);\n // Distribute the minimum width to the sizers as needed.\n Private.distributeMin(this._columnSizers, c1, c2, item.minWidth);\n }\n // If no size constraint is needed, just update the parent.\n if (this.fitPolicy === 'set-no-constraint') {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n return;\n }\n // Set up the computed min size.\n var minH = maxRow * this._rowSpacing;\n var minW = maxCol * this._columnSpacing;\n // Add the sizer minimums to the computed min size.\n for (var i = 0, n = this.rowCount; i < n; ++i) {\n minH += this._rowSizers[i].minSize;\n }\n for (var i = 0, n = this.columnCount; i < n; ++i) {\n minW += this._columnSizers[i].minSize;\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n GridLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the layout area adjusted for border and padding.\n var top = this._box.paddingTop;\n var left = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Get the max row and column index.\n var maxRow = this.rowCount - 1;\n var maxCol = this.columnCount - 1;\n // Compute the total fixed row and column space.\n var fixedRowSpace = maxRow * this._rowSpacing;\n var fixedColSpace = maxCol * this._columnSpacing;\n // Distribute the available space to the box sizers.\n boxengine.BoxEngine.calc(this._rowSizers, Math.max(0, height - fixedRowSpace));\n boxengine.BoxEngine.calc(this._columnSizers, Math.max(0, width - fixedColSpace));\n // Update the row start positions.\n for (var i = 0, pos = top, n = this.rowCount; i < n; ++i) {\n this._rowStarts[i] = pos;\n pos += this._rowSizers[i].size + this._rowSpacing;\n }\n // Update the column start positions.\n for (var i = 0, pos = left, n = this.columnCount; i < n; ++i) {\n this._columnStarts[i] = pos;\n pos += this._columnSizers[i].size + this._columnSpacing;\n }\n // Update the geometry of the layout items.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Fetch the cell bounds for the widget.\n var config = GridLayout.getCellConfig(item.widget);\n var r1 = Math.min(config.row, maxRow);\n var c1 = Math.min(config.column, maxCol);\n var r2 = Math.min(config.row + config.rowSpan - 1, maxRow);\n var c2 = Math.min(config.column + config.columnSpan - 1, maxCol);\n // Compute the cell geometry.\n var x = this._columnStarts[c1];\n var y = this._rowStarts[r1];\n var w = this._columnStarts[c2] + this._columnSizers[c2].size - x;\n var h = this._rowStarts[r2] + this._rowSizers[r2].size - y;\n // Update the geometry of the layout item.\n item.update(x, y, w, h);\n }\n };\n return GridLayout;\n}(layout.Layout));\n/**\n * The namespace for the `GridLayout` class statics.\n */\n(function (GridLayout) {\n /**\n * Get the cell config for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The cell config for the widget.\n */\n function getCellConfig(widget) {\n return Private.cellConfigProperty.get(widget);\n }\n GridLayout.getCellConfig = getCellConfig;\n /**\n * Set the cell config for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the cell config.\n */\n function setCellConfig(widget, value) {\n Private.cellConfigProperty.set(widget, Private.normalizeConfig(value));\n }\n GridLayout.setCellConfig = setCellConfig;\n})(exports.GridLayout || (exports.GridLayout = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The property descriptor for the widget cell config.\n */\n Private.cellConfigProperty = new properties.AttachedProperty({\n name: 'cellConfig',\n create: function () { return ({ row: 0, column: 0, rowSpan: 1, columnSpan: 1 }); },\n changed: onChildCellConfigChanged\n });\n /**\n * Normalize a partial cell config object.\n */\n function normalizeConfig(config) {\n var row = Math.max(0, Math.floor(config.row || 0));\n var column = Math.max(0, Math.floor(config.column || 0));\n var rowSpan = Math.max(1, Math.floor(config.rowSpan || 0));\n var columnSpan = Math.max(1, Math.floor(config.columnSpan || 0));\n return { row: row, column: column, rowSpan: rowSpan, columnSpan: columnSpan };\n }\n Private.normalizeConfig = normalizeConfig;\n /**\n * Clamp a value to an integer >= 0.\n */\n function clampValue(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampValue = clampValue;\n /**\n * A sort comparison function for row spans.\n */\n function rowSpanCmp(a, b) {\n var c1 = Private.cellConfigProperty.get(a.widget);\n var c2 = Private.cellConfigProperty.get(b.widget);\n return c1.rowSpan - c2.rowSpan;\n }\n Private.rowSpanCmp = rowSpanCmp;\n /**\n * A sort comparison function for column spans.\n */\n function columnSpanCmp(a, b) {\n var c1 = Private.cellConfigProperty.get(a.widget);\n var c2 = Private.cellConfigProperty.get(b.widget);\n return c1.columnSpan - c2.columnSpan;\n }\n Private.columnSpanCmp = columnSpanCmp;\n /**\n * Reallocate the box sizers for the given grid dimensions.\n */\n function reallocSizers(sizers, count) {\n // Coerce the count to the valid range.\n count = Math.max(1, Math.floor(count));\n // Add the missing sizers.\n while (sizers.length < count) {\n sizers.push(new boxengine.BoxSizer());\n }\n // Remove the extra sizers.\n if (sizers.length > count) {\n sizers.length = count;\n }\n }\n Private.reallocSizers = reallocSizers;\n /**\n * Distribute a min size constraint across a range of sizers.\n */\n function distributeMin(sizers, i1, i2, minSize) {\n // Sanity check the indices.\n if (i2 < i1) {\n return;\n }\n // Handle the simple case of no cell span.\n if (i1 === i2) {\n var sizer = sizers[i1];\n sizer.minSize = Math.max(sizer.minSize, minSize);\n return;\n }\n // Compute the total current min size of the span.\n var totalMin = 0;\n for (var i = i1; i <= i2; ++i) {\n totalMin += sizers[i].minSize;\n }\n // Do nothing if the total is greater than the required.\n if (totalMin >= minSize) {\n return;\n }\n // Compute the portion of the space to allocate to each sizer.\n var portion = (minSize - totalMin) / (i2 - i1 + 1);\n // Add the portion to each sizer.\n for (var i = i1; i <= i2; ++i) {\n sizers[i].minSize += portion;\n }\n }\n Private.distributeMin = distributeMin;\n /**\n * The change handler for the child cell config property.\n */\n function onChildCellConfigChanged(child) {\n if (child.parent && child.parent.layout instanceof exports.GridLayout) {\n child.parent.fit();\n }\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=gridlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/gridlayout.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/index.js": │ │ │ │ /*!*****************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/index.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/index.js ***! │ │ │ │ \*****************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\n__webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar title = __webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar boxlayout = __webpack_require__(/*! ./boxlayout.js */ \"../../packages/widgets/dist/boxlayout.js\");\nvar panel = __webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\nvar boxpanel = __webpack_require__(/*! ./boxpanel.js */ \"../../packages/widgets/dist/boxpanel.js\");\n__webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\n__webpack_require__(/*! @lumino/commands */ \"../../packages/commands/dist/index.js\");\n__webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar commandpalette = __webpack_require__(/*! ./commandpalette.js */ \"../../packages/widgets/dist/commandpalette.js\");\n__webpack_require__(/*! @lumino/disposable */ \"../../packages/disposable/dist/index.js\");\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar menu = __webpack_require__(/*! ./menu.js */ \"../../packages/widgets/dist/menu.js\");\nvar contextmenu = __webpack_require__(/*! ./contextmenu.js */ \"../../packages/widgets/dist/contextmenu.js\");\nvar docklayout = __webpack_require__(/*! ./docklayout.js */ \"../../packages/widgets/dist/docklayout.js\");\n__webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar tabbar = __webpack_require__(/*! ./tabbar.js */ \"../../packages/widgets/dist/tabbar.js\");\nvar dockpanel = __webpack_require__(/*! ./dockpanel.js */ \"../../packages/widgets/dist/dockpanel.js\");\nvar focustracker = __webpack_require__(/*! ./focustracker.js */ \"../../packages/widgets/dist/focustracker.js\");\nvar gridlayout = __webpack_require__(/*! ./gridlayout.js */ \"../../packages/widgets/dist/gridlayout.js\");\nvar menubar = __webpack_require__(/*! ./menubar.js */ \"../../packages/widgets/dist/menubar.js\");\nvar scrollbar = __webpack_require__(/*! ./scrollbar.js */ \"../../packages/widgets/dist/scrollbar.js\");\nvar singletonlayout = __webpack_require__(/*! ./singletonlayout.js */ \"../../packages/widgets/dist/singletonlayout.js\");\nvar splitlayout = __webpack_require__(/*! ./splitlayout.js */ \"../../packages/widgets/dist/splitlayout.js\");\nvar splitpanel = __webpack_require__(/*! ./splitpanel.js */ \"../../packages/widgets/dist/splitpanel.js\");\nvar stackedlayout = __webpack_require__(/*! ./stackedlayout.js */ \"../../packages/widgets/dist/stackedlayout.js\");\nvar stackedpanel = __webpack_require__(/*! ./stackedpanel.js */ \"../../packages/widgets/dist/stackedpanel.js\");\nvar tabpanel = __webpack_require__(/*! ./tabpanel.js */ \"../../packages/widgets/dist/tabpanel.js\");\n\n\n\nObject.defineProperty(exports, 'BoxEngine', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn boxengine.BoxEngine;\n\t}\n});\nexports.BoxSizer = boxengine.BoxSizer;\nexports.Title = title.Title;\nObject.defineProperty(exports, 'Widget', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn widget.Widget;\n\t}\n});\nObject.defineProperty(exports, 'Layout', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn layout.Layout;\n\t}\n});\nexports.LayoutItem = layout.LayoutItem;\nexports.PanelLayout = panellayout.PanelLayout;\nObject.defineProperty(exports, 'BoxLayout', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn boxlayout.BoxLayout;\n\t}\n});\nexports.Panel = panel.Panel;\nObject.defineProperty(exports, 'BoxPanel', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn boxpanel.BoxPanel;\n\t}\n});\nObject.defineProperty(exports, 'CommandPalette', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn commandpalette.CommandPalette;\n\t}\n});\nObject.defineProperty(exports, 'Menu', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn menu.Menu;\n\t}\n});\nexports.ContextMenu = contextmenu.ContextMenu;\nexports.DockLayout = docklayout.DockLayout;\nObject.defineProperty(exports, 'TabBar', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn tabbar.TabBar;\n\t}\n});\nObject.defineProperty(exports, 'DockPanel', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn dockpanel.DockPanel;\n\t}\n});\nexports.FocusTracker = focustracker.FocusTracker;\nObject.defineProperty(exports, 'GridLayout', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn gridlayout.GridLayout;\n\t}\n});\nObject.defineProperty(exports, 'MenuBar', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn menubar.MenuBar;\n\t}\n});\nexports.ScrollBar = scrollbar.ScrollBar;\nexports.SingletonLayout = singletonlayout.SingletonLayout;\nObject.defineProperty(exports, 'SplitLayout', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn splitlayout.SplitLayout;\n\t}\n});\nObject.defineProperty(exports, 'SplitPanel', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn splitpanel.SplitPanel;\n\t}\n});\nexports.StackedLayout = stackedlayout.StackedLayout;\nexports.StackedPanel = stackedpanel.StackedPanel;\nexports.TabPanel = tabpanel.TabPanel;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/index.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\n__webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar title = __webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar boxlayout = __webpack_require__(/*! ./boxlayout.js */ \"../../packages/widgets/dist/boxlayout.js\");\nvar panel = __webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\nvar boxpanel = __webpack_require__(/*! ./boxpanel.js */ \"../../packages/widgets/dist/boxpanel.js\");\n__webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\n__webpack_require__(/*! @lumino/commands */ \"../../packages/commands/dist/index.js\");\n__webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar commandpalette = __webpack_require__(/*! ./commandpalette.js */ \"../../packages/widgets/dist/commandpalette.js\");\n__webpack_require__(/*! @lumino/disposable */ \"../../packages/disposable/dist/index.js\");\n__webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\nvar menu = __webpack_require__(/*! ./menu.js */ \"../../packages/widgets/dist/menu.js\");\nvar contextmenu = __webpack_require__(/*! ./contextmenu.js */ \"../../packages/widgets/dist/contextmenu.js\");\nvar docklayout = __webpack_require__(/*! ./docklayout.js */ \"../../packages/widgets/dist/docklayout.js\");\n__webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar tabbar = __webpack_require__(/*! ./tabbar.js */ \"../../packages/widgets/dist/tabbar.js\");\nvar dockpanel = __webpack_require__(/*! ./dockpanel.js */ \"../../packages/widgets/dist/dockpanel.js\");\nvar focustracker = __webpack_require__(/*! ./focustracker.js */ \"../../packages/widgets/dist/focustracker.js\");\nvar gridlayout = __webpack_require__(/*! ./gridlayout.js */ \"../../packages/widgets/dist/gridlayout.js\");\nvar menubar = __webpack_require__(/*! ./menubar.js */ \"../../packages/widgets/dist/menubar.js\");\nvar scrollbar = __webpack_require__(/*! ./scrollbar.js */ \"../../packages/widgets/dist/scrollbar.js\");\nvar singletonlayout = __webpack_require__(/*! ./singletonlayout.js */ \"../../packages/widgets/dist/singletonlayout.js\");\nvar splitlayout = __webpack_require__(/*! ./splitlayout.js */ \"../../packages/widgets/dist/splitlayout.js\");\nvar splitpanel = __webpack_require__(/*! ./splitpanel.js */ \"../../packages/widgets/dist/splitpanel.js\");\nvar stackedlayout = __webpack_require__(/*! ./stackedlayout.js */ \"../../packages/widgets/dist/stackedlayout.js\");\nvar stackedpanel = __webpack_require__(/*! ./stackedpanel.js */ \"../../packages/widgets/dist/stackedpanel.js\");\nvar tabpanel = __webpack_require__(/*! ./tabpanel.js */ \"../../packages/widgets/dist/tabpanel.js\");\n\n\n\nObject.defineProperty(exports, 'BoxEngine', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn boxengine.BoxEngine;\n\t}\n});\nexports.BoxSizer = boxengine.BoxSizer;\nexports.Title = title.Title;\nObject.defineProperty(exports, 'Widget', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn widget.Widget;\n\t}\n});\nObject.defineProperty(exports, 'Layout', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn layout.Layout;\n\t}\n});\nexports.LayoutItem = layout.LayoutItem;\nexports.PanelLayout = panellayout.PanelLayout;\nObject.defineProperty(exports, 'BoxLayout', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn boxlayout.BoxLayout;\n\t}\n});\nexports.Panel = panel.Panel;\nObject.defineProperty(exports, 'BoxPanel', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn boxpanel.BoxPanel;\n\t}\n});\nObject.defineProperty(exports, 'CommandPalette', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn commandpalette.CommandPalette;\n\t}\n});\nObject.defineProperty(exports, 'Menu', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn menu.Menu;\n\t}\n});\nexports.ContextMenu = contextmenu.ContextMenu;\nexports.DockLayout = docklayout.DockLayout;\nObject.defineProperty(exports, 'TabBar', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn tabbar.TabBar;\n\t}\n});\nObject.defineProperty(exports, 'DockPanel', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn dockpanel.DockPanel;\n\t}\n});\nexports.FocusTracker = focustracker.FocusTracker;\nObject.defineProperty(exports, 'GridLayout', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn gridlayout.GridLayout;\n\t}\n});\nObject.defineProperty(exports, 'MenuBar', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn menubar.MenuBar;\n\t}\n});\nexports.ScrollBar = scrollbar.ScrollBar;\nexports.SingletonLayout = singletonlayout.SingletonLayout;\nObject.defineProperty(exports, 'SplitLayout', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn splitlayout.SplitLayout;\n\t}\n});\nObject.defineProperty(exports, 'SplitPanel', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn splitpanel.SplitPanel;\n\t}\n});\nexports.StackedLayout = stackedlayout.StackedLayout;\nexports.StackedPanel = stackedpanel.StackedPanel;\nexports.TabPanel = tabpanel.TabPanel;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/index.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/layout.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/layout.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/layout.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * An abstract base class for creating lumino layouts.\n *\n * #### Notes\n * A layout is used to add widgets to a parent and to arrange those\n * widgets within the parent's DOM node.\n *\n * This class implements the base functionality which is required of\n * nearly all layouts. It must be subclassed in order to be useful.\n *\n * Notably, this class does not define a uniform interface for adding\n * widgets to the layout. A subclass should define that API in a way\n * which is meaningful for its intended use.\n */\nexports.Layout = /** @class */ (function () {\n /**\n * Construct a new layout.\n *\n * @param options - The options for initializing the layout.\n */\n function Layout(options) {\n if (options === void 0) { options = {}; }\n this._disposed = false;\n this._parent = null;\n this._fitPolicy = options.fitPolicy || 'set-min-size';\n }\n /**\n * Dispose of the resources held by the layout.\n *\n * #### Notes\n * This should be reimplemented to clear and dispose of the widgets.\n *\n * All reimplementations should call the superclass method.\n *\n * This method is called automatically when the parent is disposed.\n */\n Layout.prototype.dispose = function () {\n this._parent = null;\n this._disposed = true;\n signaling.Signal.clearData(this);\n properties.AttachedProperty.clearData(this);\n };\n Object.defineProperty(Layout.prototype, \"isDisposed\", {\n /**\n * Test whether the layout is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Layout.prototype, \"parent\", {\n /**\n * Get the parent widget of the layout.\n */\n get: function () {\n return this._parent;\n },\n /**\n * Set the parent widget of the layout.\n *\n * #### Notes\n * This is set automatically when installing the layout on the parent\n * widget. The parent widget should not be set directly by user code.\n */\n set: function (value) {\n if (this._parent === value) {\n return;\n }\n if (this._parent) {\n throw new Error('Cannot change parent widget.');\n }\n if (value.layout !== this) {\n throw new Error('Invalid parent widget.');\n }\n this._parent = value;\n this.init();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Layout.prototype, \"fitPolicy\", {\n /**\n * Get the fit policy for the layout.\n *\n * #### Notes\n * The fit policy controls the computed size constraints which are\n * applied to the parent widget by the layout.\n *\n * Some layout implementations may ignore the fit policy.\n */\n get: function () {\n return this._fitPolicy;\n },\n /**\n * Set the fit policy for the layout.\n *\n * #### Notes\n * The fit policy controls the computed size constraints which are\n * applied to the parent widget by the layout.\n *\n * Some layout implementations may ignore the fit policy.\n *\n * Changing the fit policy will clear the current size constraint\n * for the parent widget and then re-fit the parent.\n */\n set: function (value) {\n // Bail if the policy does not change\n if (this._fitPolicy === value) {\n return;\n }\n // Update the internal policy.\n this._fitPolicy = value;\n // Clear the size constraints and schedule a fit of the parent.\n if (this._parent) {\n var style = this._parent.node.style;\n style.minWidth = '';\n style.minHeight = '';\n style.maxWidth = '';\n style.maxHeight = '';\n this._parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Process a message sent to the parent widget.\n *\n * @param msg - The message sent to the parent widget.\n *\n * #### Notes\n * This method is called by the parent widget to process a message.\n *\n * Subclasses may reimplement this method as needed.\n */\n Layout.prototype.processParentMessage = function (msg) {\n switch (msg.type) {\n case 'resize':\n this.onResize(msg);\n break;\n case 'update-request':\n this.onUpdateRequest(msg);\n break;\n case 'fit-request':\n this.onFitRequest(msg);\n break;\n case 'before-show':\n this.onBeforeShow(msg);\n break;\n case 'after-show':\n this.onAfterShow(msg);\n break;\n case 'before-hide':\n this.onBeforeHide(msg);\n break;\n case 'after-hide':\n this.onAfterHide(msg);\n break;\n case 'before-attach':\n this.onBeforeAttach(msg);\n break;\n case 'after-attach':\n this.onAfterAttach(msg);\n break;\n case 'before-detach':\n this.onBeforeDetach(msg);\n break;\n case 'after-detach':\n this.onAfterDetach(msg);\n break;\n case 'child-removed':\n this.onChildRemoved(msg);\n break;\n case 'child-shown':\n this.onChildShown(msg);\n break;\n case 'child-hidden':\n this.onChildHidden(msg);\n break;\n }\n };\n /**\n * Perform layout initialization which requires the parent widget.\n *\n * #### Notes\n * This method is invoked immediately after the layout is installed\n * on the parent widget.\n *\n * The default implementation reparents all of the widgets to the\n * layout parent widget.\n *\n * Subclasses should reimplement this method and attach the child\n * widget nodes to the parent widget's node.\n */\n Layout.prototype.init = function () {\n var _this = this;\n algorithm.each(this, function (widget) {\n widget.parent = _this.parent;\n });\n };\n /**\n * A message handler invoked on a `'resize'` message.\n *\n * #### Notes\n * The layout should ensure that its widgets are resized according\n * to the specified layout space, and that they are sent a `'resize'`\n * message if appropriate.\n *\n * The default implementation of this method sends an `UnknownSize`\n * resize message to all widgets.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onResize = function (msg) {\n algorithm.each(this, function (widget$1) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.ResizeMessage.UnknownSize);\n });\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n *\n * #### Notes\n * The layout should ensure that its widgets are resized according\n * to the available layout space, and that they are sent a `'resize'`\n * message if appropriate.\n *\n * The default implementation of this method sends an `UnknownSize`\n * resize message to all widgets.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onUpdateRequest = function (msg) {\n algorithm.each(this, function (widget$1) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.ResizeMessage.UnknownSize);\n });\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onBeforeAttach = function (msg) {\n algorithm.each(this, function (widget) {\n messaging.MessageLoop.sendMessage(widget, msg);\n });\n };\n /**\n * A message handler invoked on an `'after-attach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onAfterAttach = function (msg) {\n algorithm.each(this, function (widget) {\n messaging.MessageLoop.sendMessage(widget, msg);\n });\n };\n /**\n * A message handler invoked on a `'before-detach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onBeforeDetach = function (msg) {\n algorithm.each(this, function (widget) {\n messaging.MessageLoop.sendMessage(widget, msg);\n });\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onAfterDetach = function (msg) {\n algorithm.each(this, function (widget) {\n messaging.MessageLoop.sendMessage(widget, msg);\n });\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onBeforeShow = function (msg) {\n algorithm.each(this, function (widget) {\n if (!widget.isHidden) {\n messaging.MessageLoop.sendMessage(widget, msg);\n }\n });\n };\n /**\n * A message handler invoked on an `'after-show'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onAfterShow = function (msg) {\n algorithm.each(this, function (widget) {\n if (!widget.isHidden) {\n messaging.MessageLoop.sendMessage(widget, msg);\n }\n });\n };\n /**\n * A message handler invoked on a `'before-hide'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onBeforeHide = function (msg) {\n algorithm.each(this, function (widget) {\n if (!widget.isHidden) {\n messaging.MessageLoop.sendMessage(widget, msg);\n }\n });\n };\n /**\n * A message handler invoked on an `'after-hide'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onAfterHide = function (msg) {\n algorithm.each(this, function (widget) {\n if (!widget.isHidden) {\n messaging.MessageLoop.sendMessage(widget, msg);\n }\n });\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n *\n * #### Notes\n * This will remove the child widget from the layout.\n *\n * Subclasses should **not** typically reimplement this method.\n */\n Layout.prototype.onChildRemoved = function (msg) {\n this.removeWidget(msg.child);\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Layout.prototype.onFitRequest = function (msg) { };\n /**\n * A message handler invoked on a `'child-shown'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Layout.prototype.onChildShown = function (msg) { };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Layout.prototype.onChildHidden = function (msg) { };\n return Layout;\n}());\n/**\n * The namespace for the `Layout` class statics.\n */\n(function (Layout) {\n /**\n * Get the horizontal alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The horizontal alignment for the widget.\n *\n * #### Notes\n * If the layout width allocated to a widget is larger than its max\n * width, the horizontal alignment controls how the widget is placed\n * within the extra horizontal space.\n *\n * If the allocated width is less than the widget's max width, the\n * horizontal alignment has no effect.\n *\n * Some layout implementations may ignore horizontal alignment.\n */\n function getHorizontalAlignment(widget) {\n return Private.horizontalAlignmentProperty.get(widget);\n }\n Layout.getHorizontalAlignment = getHorizontalAlignment;\n /**\n * Set the horizontal alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the horizontal alignment.\n *\n * #### Notes\n * If the layout width allocated to a widget is larger than its max\n * width, the horizontal alignment controls how the widget is placed\n * within the extra horizontal space.\n *\n * If the allocated width is less than the widget's max width, the\n * horizontal alignment has no effect.\n *\n * Some layout implementations may ignore horizontal alignment.\n *\n * Changing the horizontal alignment will post an `update-request`\n * message to widget's parent, provided the parent has a layout\n * installed.\n */\n function setHorizontalAlignment(widget, value) {\n Private.horizontalAlignmentProperty.set(widget, value);\n }\n Layout.setHorizontalAlignment = setHorizontalAlignment;\n /**\n * Get the vertical alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The vertical alignment for the widget.\n *\n * #### Notes\n * If the layout height allocated to a widget is larger than its max\n * height, the vertical alignment controls how the widget is placed\n * within the extra vertical space.\n *\n * If the allocated height is less than the widget's max height, the\n * vertical alignment has no effect.\n *\n * Some layout implementations may ignore vertical alignment.\n */\n function getVerticalAlignment(widget) {\n return Private.verticalAlignmentProperty.get(widget);\n }\n Layout.getVerticalAlignment = getVerticalAlignment;\n /**\n * Set the vertical alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the vertical alignment.\n *\n * #### Notes\n * If the layout height allocated to a widget is larger than its max\n * height, the vertical alignment controls how the widget is placed\n * within the extra vertical space.\n *\n * If the allocated height is less than the widget's max height, the\n * vertical alignment has no effect.\n *\n * Some layout implementations may ignore vertical alignment.\n *\n * Changing the horizontal alignment will post an `update-request`\n * message to widget's parent, provided the parent has a layout\n * installed.\n */\n function setVerticalAlignment(widget, value) {\n Private.verticalAlignmentProperty.set(widget, value);\n }\n Layout.setVerticalAlignment = setVerticalAlignment;\n})(exports.Layout || (exports.Layout = {}));\n/**\n * An object which assists in the absolute layout of widgets.\n *\n * #### Notes\n * This class is useful when implementing a layout which arranges its\n * widgets using absolute positioning.\n *\n * This class is used by nearly all of the built-in lumino layouts.\n */\nvar LayoutItem = /** @class */ (function () {\n /**\n * Construct a new layout item.\n *\n * @param widget - The widget to be managed by the item.\n *\n * #### Notes\n * The widget will be set to absolute positioning.\n */\n function LayoutItem(widget) {\n this._top = NaN;\n this._left = NaN;\n this._width = NaN;\n this._height = NaN;\n this._minWidth = 0;\n this._minHeight = 0;\n this._maxWidth = Infinity;\n this._maxHeight = Infinity;\n this._disposed = false;\n this.widget = widget;\n this.widget.node.style.position = 'absolute';\n }\n /**\n * Dispose of the the layout item.\n *\n * #### Notes\n * This will reset the positioning of the widget.\n */\n LayoutItem.prototype.dispose = function () {\n // Do nothing if the item is already disposed.\n if (this._disposed) {\n return;\n }\n // Mark the item as disposed.\n this._disposed = true;\n // Reset the widget style.\n var style = this.widget.node.style;\n style.position = '';\n style.top = '';\n style.left = '';\n style.width = '';\n style.height = '';\n };\n Object.defineProperty(LayoutItem.prototype, \"minWidth\", {\n /**\n * The computed minimum width of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get: function () {\n return this._minWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"minHeight\", {\n /**\n * The computed minimum height of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get: function () {\n return this._minHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"maxWidth\", {\n /**\n * The computed maximum width of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get: function () {\n return this._maxWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"maxHeight\", {\n /**\n * The computed maximum height of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get: function () {\n return this._maxHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"isDisposed\", {\n /**\n * Whether the layout item is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"isHidden\", {\n /**\n * Whether the managed widget is hidden.\n */\n get: function () {\n return this.widget.isHidden;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"isVisible\", {\n /**\n * Whether the managed widget is visible.\n */\n get: function () {\n return this.widget.isVisible;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"isAttached\", {\n /**\n * Whether the managed widget is attached.\n */\n get: function () {\n return this.widget.isAttached;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Update the computed size limits of the managed widget.\n */\n LayoutItem.prototype.fit = function () {\n var limits = domutils.ElementExt.sizeLimits(this.widget.node);\n this._minWidth = limits.minWidth;\n this._minHeight = limits.minHeight;\n this._maxWidth = limits.maxWidth;\n this._maxHeight = limits.maxHeight;\n };\n /**\n * Update the position and size of the managed widget.\n *\n * @param left - The left edge position of the layout box.\n *\n * @param top - The top edge position of the layout box.\n *\n * @param width - The width of the layout box.\n *\n * @param height - The height of the layout box.\n */\n LayoutItem.prototype.update = function (left, top, width, height) {\n // Clamp the size to the computed size limits.\n var clampW = Math.max(this._minWidth, Math.min(width, this._maxWidth));\n var clampH = Math.max(this._minHeight, Math.min(height, this._maxHeight));\n // Adjust the left edge for the horizontal alignment, if needed.\n if (clampW < width) {\n switch (exports.Layout.getHorizontalAlignment(this.widget)) {\n case 'left':\n break;\n case 'center':\n left += (width - clampW) / 2;\n break;\n case 'right':\n left += width - clampW;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Adjust the top edge for the vertical alignment, if needed.\n if (clampH < height) {\n switch (exports.Layout.getVerticalAlignment(this.widget)) {\n case 'top':\n break;\n case 'center':\n top += (height - clampH) / 2;\n break;\n case 'bottom':\n top += height - clampH;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Set up the resize variables.\n var resized = false;\n var style = this.widget.node.style;\n // Update the top edge of the widget if needed.\n if (this._top !== top) {\n this._top = top;\n style.top = top + \"px\";\n }\n // Update the left edge of the widget if needed.\n if (this._left !== left) {\n this._left = left;\n style.left = left + \"px\";\n }\n // Update the width of the widget if needed.\n if (this._width !== clampW) {\n resized = true;\n this._width = clampW;\n style.width = clampW + \"px\";\n }\n // Update the height of the widget if needed.\n if (this._height !== clampH) {\n resized = true;\n this._height = clampH;\n style.height = clampH + \"px\";\n }\n // Send a resize message to the widget if needed.\n if (resized) {\n var msg = new widget.Widget.ResizeMessage(clampW, clampH);\n messaging.MessageLoop.sendMessage(this.widget, msg);\n }\n };\n return LayoutItem;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The attached property for a widget horizontal alignment.\n */\n Private.horizontalAlignmentProperty = new properties.AttachedProperty({\n name: 'horizontalAlignment',\n create: function () { return 'center'; },\n changed: onAlignmentChanged\n });\n /**\n * The attached property for a widget vertical alignment.\n */\n Private.verticalAlignmentProperty = new properties.AttachedProperty({\n name: 'verticalAlignment',\n create: function () { return 'top'; },\n changed: onAlignmentChanged\n });\n /**\n * The change handler for the attached alignment properties.\n */\n function onAlignmentChanged(child) {\n if (child.parent && child.parent.layout) {\n child.parent.update();\n }\n }\n})(Private || (Private = {}));\n\nexports.LayoutItem = LayoutItem;\n//# sourceMappingURL=layout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/layout.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * An abstract base class for creating lumino layouts.\n *\n * #### Notes\n * A layout is used to add widgets to a parent and to arrange those\n * widgets within the parent's DOM node.\n *\n * This class implements the base functionality which is required of\n * nearly all layouts. It must be subclassed in order to be useful.\n *\n * Notably, this class does not define a uniform interface for adding\n * widgets to the layout. A subclass should define that API in a way\n * which is meaningful for its intended use.\n */\nexports.Layout = /** @class */ (function () {\n /**\n * Construct a new layout.\n *\n * @param options - The options for initializing the layout.\n */\n function Layout(options) {\n if (options === void 0) { options = {}; }\n this._disposed = false;\n this._parent = null;\n this._fitPolicy = options.fitPolicy || 'set-min-size';\n }\n /**\n * Dispose of the resources held by the layout.\n *\n * #### Notes\n * This should be reimplemented to clear and dispose of the widgets.\n *\n * All reimplementations should call the superclass method.\n *\n * This method is called automatically when the parent is disposed.\n */\n Layout.prototype.dispose = function () {\n this._parent = null;\n this._disposed = true;\n signaling.Signal.clearData(this);\n properties.AttachedProperty.clearData(this);\n };\n Object.defineProperty(Layout.prototype, \"isDisposed\", {\n /**\n * Test whether the layout is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Layout.prototype, \"parent\", {\n /**\n * Get the parent widget of the layout.\n */\n get: function () {\n return this._parent;\n },\n /**\n * Set the parent widget of the layout.\n *\n * #### Notes\n * This is set automatically when installing the layout on the parent\n * widget. The parent widget should not be set directly by user code.\n */\n set: function (value) {\n if (this._parent === value) {\n return;\n }\n if (this._parent) {\n throw new Error('Cannot change parent widget.');\n }\n if (value.layout !== this) {\n throw new Error('Invalid parent widget.');\n }\n this._parent = value;\n this.init();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Layout.prototype, \"fitPolicy\", {\n /**\n * Get the fit policy for the layout.\n *\n * #### Notes\n * The fit policy controls the computed size constraints which are\n * applied to the parent widget by the layout.\n *\n * Some layout implementations may ignore the fit policy.\n */\n get: function () {\n return this._fitPolicy;\n },\n /**\n * Set the fit policy for the layout.\n *\n * #### Notes\n * The fit policy controls the computed size constraints which are\n * applied to the parent widget by the layout.\n *\n * Some layout implementations may ignore the fit policy.\n *\n * Changing the fit policy will clear the current size constraint\n * for the parent widget and then re-fit the parent.\n */\n set: function (value) {\n // Bail if the policy does not change\n if (this._fitPolicy === value) {\n return;\n }\n // Update the internal policy.\n this._fitPolicy = value;\n // Clear the size constraints and schedule a fit of the parent.\n if (this._parent) {\n var style = this._parent.node.style;\n style.minWidth = '';\n style.minHeight = '';\n style.maxWidth = '';\n style.maxHeight = '';\n this._parent.fit();\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Process a message sent to the parent widget.\n *\n * @param msg - The message sent to the parent widget.\n *\n * #### Notes\n * This method is called by the parent widget to process a message.\n *\n * Subclasses may reimplement this method as needed.\n */\n Layout.prototype.processParentMessage = function (msg) {\n switch (msg.type) {\n case 'resize':\n this.onResize(msg);\n break;\n case 'update-request':\n this.onUpdateRequest(msg);\n break;\n case 'fit-request':\n this.onFitRequest(msg);\n break;\n case 'before-show':\n this.onBeforeShow(msg);\n break;\n case 'after-show':\n this.onAfterShow(msg);\n break;\n case 'before-hide':\n this.onBeforeHide(msg);\n break;\n case 'after-hide':\n this.onAfterHide(msg);\n break;\n case 'before-attach':\n this.onBeforeAttach(msg);\n break;\n case 'after-attach':\n this.onAfterAttach(msg);\n break;\n case 'before-detach':\n this.onBeforeDetach(msg);\n break;\n case 'after-detach':\n this.onAfterDetach(msg);\n break;\n case 'child-removed':\n this.onChildRemoved(msg);\n break;\n case 'child-shown':\n this.onChildShown(msg);\n break;\n case 'child-hidden':\n this.onChildHidden(msg);\n break;\n }\n };\n /**\n * Perform layout initialization which requires the parent widget.\n *\n * #### Notes\n * This method is invoked immediately after the layout is installed\n * on the parent widget.\n *\n * The default implementation reparents all of the widgets to the\n * layout parent widget.\n *\n * Subclasses should reimplement this method and attach the child\n * widget nodes to the parent widget's node.\n */\n Layout.prototype.init = function () {\n var _this = this;\n algorithm.each(this, function (widget) {\n widget.parent = _this.parent;\n });\n };\n /**\n * A message handler invoked on a `'resize'` message.\n *\n * #### Notes\n * The layout should ensure that its widgets are resized according\n * to the specified layout space, and that they are sent a `'resize'`\n * message if appropriate.\n *\n * The default implementation of this method sends an `UnknownSize`\n * resize message to all widgets.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onResize = function (msg) {\n algorithm.each(this, function (widget$1) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.ResizeMessage.UnknownSize);\n });\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n *\n * #### Notes\n * The layout should ensure that its widgets are resized according\n * to the available layout space, and that they are sent a `'resize'`\n * message if appropriate.\n *\n * The default implementation of this method sends an `UnknownSize`\n * resize message to all widgets.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onUpdateRequest = function (msg) {\n algorithm.each(this, function (widget$1) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.ResizeMessage.UnknownSize);\n });\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onBeforeAttach = function (msg) {\n algorithm.each(this, function (widget) {\n messaging.MessageLoop.sendMessage(widget, msg);\n });\n };\n /**\n * A message handler invoked on an `'after-attach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onAfterAttach = function (msg) {\n algorithm.each(this, function (widget) {\n messaging.MessageLoop.sendMessage(widget, msg);\n });\n };\n /**\n * A message handler invoked on a `'before-detach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onBeforeDetach = function (msg) {\n algorithm.each(this, function (widget) {\n messaging.MessageLoop.sendMessage(widget, msg);\n });\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message\n * to all widgets. It assumes all widget nodes are attached to the\n * parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onAfterDetach = function (msg) {\n algorithm.each(this, function (widget) {\n messaging.MessageLoop.sendMessage(widget, msg);\n });\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onBeforeShow = function (msg) {\n algorithm.each(this, function (widget) {\n if (!widget.isHidden) {\n messaging.MessageLoop.sendMessage(widget, msg);\n }\n });\n };\n /**\n * A message handler invoked on an `'after-show'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onAfterShow = function (msg) {\n algorithm.each(this, function (widget) {\n if (!widget.isHidden) {\n messaging.MessageLoop.sendMessage(widget, msg);\n }\n });\n };\n /**\n * A message handler invoked on a `'before-hide'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onBeforeHide = function (msg) {\n algorithm.each(this, function (widget) {\n if (!widget.isHidden) {\n messaging.MessageLoop.sendMessage(widget, msg);\n }\n });\n };\n /**\n * A message handler invoked on an `'after-hide'` message.\n *\n * #### Notes\n * The default implementation of this method forwards the message to\n * all non-hidden widgets. It assumes all widget nodes are attached\n * to the parent widget node.\n *\n * This may be reimplemented by subclasses as needed.\n */\n Layout.prototype.onAfterHide = function (msg) {\n algorithm.each(this, function (widget) {\n if (!widget.isHidden) {\n messaging.MessageLoop.sendMessage(widget, msg);\n }\n });\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n *\n * #### Notes\n * This will remove the child widget from the layout.\n *\n * Subclasses should **not** typically reimplement this method.\n */\n Layout.prototype.onChildRemoved = function (msg) {\n this.removeWidget(msg.child);\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Layout.prototype.onFitRequest = function (msg) { };\n /**\n * A message handler invoked on a `'child-shown'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Layout.prototype.onChildShown = function (msg) { };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Layout.prototype.onChildHidden = function (msg) { };\n return Layout;\n}());\n/**\n * The namespace for the `Layout` class statics.\n */\n(function (Layout) {\n /**\n * Get the horizontal alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The horizontal alignment for the widget.\n *\n * #### Notes\n * If the layout width allocated to a widget is larger than its max\n * width, the horizontal alignment controls how the widget is placed\n * within the extra horizontal space.\n *\n * If the allocated width is less than the widget's max width, the\n * horizontal alignment has no effect.\n *\n * Some layout implementations may ignore horizontal alignment.\n */\n function getHorizontalAlignment(widget) {\n return Private.horizontalAlignmentProperty.get(widget);\n }\n Layout.getHorizontalAlignment = getHorizontalAlignment;\n /**\n * Set the horizontal alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the horizontal alignment.\n *\n * #### Notes\n * If the layout width allocated to a widget is larger than its max\n * width, the horizontal alignment controls how the widget is placed\n * within the extra horizontal space.\n *\n * If the allocated width is less than the widget's max width, the\n * horizontal alignment has no effect.\n *\n * Some layout implementations may ignore horizontal alignment.\n *\n * Changing the horizontal alignment will post an `update-request`\n * message to widget's parent, provided the parent has a layout\n * installed.\n */\n function setHorizontalAlignment(widget, value) {\n Private.horizontalAlignmentProperty.set(widget, value);\n }\n Layout.setHorizontalAlignment = setHorizontalAlignment;\n /**\n * Get the vertical alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The vertical alignment for the widget.\n *\n * #### Notes\n * If the layout height allocated to a widget is larger than its max\n * height, the vertical alignment controls how the widget is placed\n * within the extra vertical space.\n *\n * If the allocated height is less than the widget's max height, the\n * vertical alignment has no effect.\n *\n * Some layout implementations may ignore vertical alignment.\n */\n function getVerticalAlignment(widget) {\n return Private.verticalAlignmentProperty.get(widget);\n }\n Layout.getVerticalAlignment = getVerticalAlignment;\n /**\n * Set the vertical alignment for a widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the vertical alignment.\n *\n * #### Notes\n * If the layout height allocated to a widget is larger than its max\n * height, the vertical alignment controls how the widget is placed\n * within the extra vertical space.\n *\n * If the allocated height is less than the widget's max height, the\n * vertical alignment has no effect.\n *\n * Some layout implementations may ignore vertical alignment.\n *\n * Changing the horizontal alignment will post an `update-request`\n * message to widget's parent, provided the parent has a layout\n * installed.\n */\n function setVerticalAlignment(widget, value) {\n Private.verticalAlignmentProperty.set(widget, value);\n }\n Layout.setVerticalAlignment = setVerticalAlignment;\n})(exports.Layout || (exports.Layout = {}));\n/**\n * An object which assists in the absolute layout of widgets.\n *\n * #### Notes\n * This class is useful when implementing a layout which arranges its\n * widgets using absolute positioning.\n *\n * This class is used by nearly all of the built-in lumino layouts.\n */\nvar LayoutItem = /** @class */ (function () {\n /**\n * Construct a new layout item.\n *\n * @param widget - The widget to be managed by the item.\n *\n * #### Notes\n * The widget will be set to absolute positioning.\n */\n function LayoutItem(widget) {\n this._top = NaN;\n this._left = NaN;\n this._width = NaN;\n this._height = NaN;\n this._minWidth = 0;\n this._minHeight = 0;\n this._maxWidth = Infinity;\n this._maxHeight = Infinity;\n this._disposed = false;\n this.widget = widget;\n this.widget.node.style.position = 'absolute';\n }\n /**\n * Dispose of the the layout item.\n *\n * #### Notes\n * This will reset the positioning of the widget.\n */\n LayoutItem.prototype.dispose = function () {\n // Do nothing if the item is already disposed.\n if (this._disposed) {\n return;\n }\n // Mark the item as disposed.\n this._disposed = true;\n // Reset the widget style.\n var style = this.widget.node.style;\n style.position = '';\n style.top = '';\n style.left = '';\n style.width = '';\n style.height = '';\n };\n Object.defineProperty(LayoutItem.prototype, \"minWidth\", {\n /**\n * The computed minimum width of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get: function () {\n return this._minWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"minHeight\", {\n /**\n * The computed minimum height of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get: function () {\n return this._minHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"maxWidth\", {\n /**\n * The computed maximum width of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get: function () {\n return this._maxWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"maxHeight\", {\n /**\n * The computed maximum height of the widget.\n *\n * #### Notes\n * This value can be updated by calling the `fit` method.\n */\n get: function () {\n return this._maxHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"isDisposed\", {\n /**\n * Whether the layout item is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"isHidden\", {\n /**\n * Whether the managed widget is hidden.\n */\n get: function () {\n return this.widget.isHidden;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"isVisible\", {\n /**\n * Whether the managed widget is visible.\n */\n get: function () {\n return this.widget.isVisible;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LayoutItem.prototype, \"isAttached\", {\n /**\n * Whether the managed widget is attached.\n */\n get: function () {\n return this.widget.isAttached;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Update the computed size limits of the managed widget.\n */\n LayoutItem.prototype.fit = function () {\n var limits = domutils.ElementExt.sizeLimits(this.widget.node);\n this._minWidth = limits.minWidth;\n this._minHeight = limits.minHeight;\n this._maxWidth = limits.maxWidth;\n this._maxHeight = limits.maxHeight;\n };\n /**\n * Update the position and size of the managed widget.\n *\n * @param left - The left edge position of the layout box.\n *\n * @param top - The top edge position of the layout box.\n *\n * @param width - The width of the layout box.\n *\n * @param height - The height of the layout box.\n */\n LayoutItem.prototype.update = function (left, top, width, height) {\n // Clamp the size to the computed size limits.\n var clampW = Math.max(this._minWidth, Math.min(width, this._maxWidth));\n var clampH = Math.max(this._minHeight, Math.min(height, this._maxHeight));\n // Adjust the left edge for the horizontal alignment, if needed.\n if (clampW < width) {\n switch (exports.Layout.getHorizontalAlignment(this.widget)) {\n case 'left':\n break;\n case 'center':\n left += (width - clampW) / 2;\n break;\n case 'right':\n left += width - clampW;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Adjust the top edge for the vertical alignment, if needed.\n if (clampH < height) {\n switch (exports.Layout.getVerticalAlignment(this.widget)) {\n case 'top':\n break;\n case 'center':\n top += (height - clampH) / 2;\n break;\n case 'bottom':\n top += height - clampH;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Set up the resize variables.\n var resized = false;\n var style = this.widget.node.style;\n // Update the top edge of the widget if needed.\n if (this._top !== top) {\n this._top = top;\n style.top = top + \"px\";\n }\n // Update the left edge of the widget if needed.\n if (this._left !== left) {\n this._left = left;\n style.left = left + \"px\";\n }\n // Update the width of the widget if needed.\n if (this._width !== clampW) {\n resized = true;\n this._width = clampW;\n style.width = clampW + \"px\";\n }\n // Update the height of the widget if needed.\n if (this._height !== clampH) {\n resized = true;\n this._height = clampH;\n style.height = clampH + \"px\";\n }\n // Send a resize message to the widget if needed.\n if (resized) {\n var msg = new widget.Widget.ResizeMessage(clampW, clampH);\n messaging.MessageLoop.sendMessage(this.widget, msg);\n }\n };\n return LayoutItem;\n}());\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The attached property for a widget horizontal alignment.\n */\n Private.horizontalAlignmentProperty = new properties.AttachedProperty({\n name: 'horizontalAlignment',\n create: function () { return 'center'; },\n changed: onAlignmentChanged\n });\n /**\n * The attached property for a widget vertical alignment.\n */\n Private.verticalAlignmentProperty = new properties.AttachedProperty({\n name: 'verticalAlignment',\n create: function () { return 'top'; },\n changed: onAlignmentChanged\n });\n /**\n * The change handler for the attached alignment properties.\n */\n function onAlignmentChanged(child) {\n if (child.parent && child.parent.layout) {\n child.parent.update();\n }\n }\n})(Private || (Private = {}));\n\nexports.LayoutItem = LayoutItem;\n//# sourceMappingURL=layout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/layout.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/menu.js": │ │ │ │ /*!****************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/menu.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/menu.js ***! │ │ │ │ \****************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar coreutils = __webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\nvar commands = __webpack_require__(/*! @lumino/commands */ \"../../packages/commands/dist/index.js\");\nvar virtualdom = __webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\n\n/**\n * A widget which displays items as a canonical menu.\n */\nexports.Menu = /** @class */ (function (_super) {\n tslib.__extends(Menu, _super);\n /**\n * Construct a new menu.\n *\n * @param options - The options for initializing the menu.\n */\n function Menu(options) {\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._childIndex = -1;\n _this._activeIndex = -1;\n _this._openTimerID = 0;\n _this._closeTimerID = 0;\n _this._items = [];\n _this._childMenu = null;\n _this._parentMenu = null;\n _this._aboutToClose = new signaling.Signal(_this);\n _this._menuRequested = new signaling.Signal(_this);\n _this.addClass('lm-Menu');\n /* */\n _this.addClass('p-Menu');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n _this.commands = options.commands;\n _this.renderer = options.renderer || Menu.defaultRenderer;\n return _this;\n }\n /**\n * Dispose of the resources held by the menu.\n */\n Menu.prototype.dispose = function () {\n this.close();\n this._items.length = 0;\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(Menu.prototype, \"aboutToClose\", {\n /**\n * A signal emitted just before the menu is closed.\n *\n * #### Notes\n * This signal is emitted when the menu receives a `'close-request'`\n * message, just before it removes itself from the DOM.\n *\n * This signal is not emitted if the menu is already detached from\n * the DOM when it receives the `'close-request'` message.\n */\n get: function () {\n return this._aboutToClose;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"menuRequested\", {\n /**\n * A signal emitted when a new menu is requested by the user.\n *\n * #### Notes\n * This signal is emitted whenever the user presses the right or left\n * arrow keys, and a submenu cannot be opened or closed in response.\n *\n * This signal is useful when implementing menu bars in order to open\n * the next or previous menu in response to a user key press.\n *\n * This signal is only emitted for the root menu in a hierarchy.\n */\n get: function () {\n return this._menuRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"parentMenu\", {\n /**\n * The parent menu of the menu.\n *\n * #### Notes\n * This is `null` unless the menu is an open submenu.\n */\n get: function () {\n return this._parentMenu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"childMenu\", {\n /**\n * The child menu of the menu.\n *\n * #### Notes\n * This is `null` unless the menu has an open submenu.\n */\n get: function () {\n return this._childMenu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"rootMenu\", {\n /**\n * The root menu of the menu hierarchy.\n */\n get: function () {\n var menu = this;\n while (menu._parentMenu) {\n menu = menu._parentMenu;\n }\n return menu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"leafMenu\", {\n /**\n * The leaf menu of the menu hierarchy.\n */\n get: function () {\n var menu = this;\n while (menu._childMenu) {\n menu = menu._childMenu;\n }\n return menu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"contentNode\", {\n /**\n * The menu content node.\n *\n * #### Notes\n * This is the node which holds the menu item nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-Menu-content')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"activeItem\", {\n /**\n * Get the currently active menu item.\n */\n get: function () {\n return this._items[this._activeIndex] || null;\n },\n /**\n * Set the currently active menu item.\n *\n * #### Notes\n * If the item cannot be activated, the item will be set to `null`.\n */\n set: function (value) {\n this.activeIndex = value ? this._items.indexOf(value) : -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"activeIndex\", {\n /**\n * Get the index of the currently active menu item.\n *\n * #### Notes\n * This will be `-1` if no menu item is active.\n */\n get: function () {\n return this._activeIndex;\n },\n /**\n * Set the index of the currently active menu item.\n *\n * #### Notes\n * If the item cannot be activated, the index will be set to `-1`.\n */\n set: function (value) {\n // Adjust the value for an out of range index.\n if (value < 0 || value >= this._items.length) {\n value = -1;\n }\n // Ensure the item can be activated.\n if (value !== -1 && !Private.canActivate(this._items[value])) {\n value = -1;\n }\n // Bail if the index will not change.\n if (this._activeIndex === value) {\n return;\n }\n // Update the active index.\n this._activeIndex = value;\n // schedule an update of the items.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"items\", {\n /**\n * A read-only array of the menu items in the menu.\n */\n get: function () {\n return this._items;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Activate the next selectable item in the menu.\n *\n * #### Notes\n * If no item is selectable, the index will be set to `-1`.\n */\n Menu.prototype.activateNextItem = function () {\n var n = this._items.length;\n var ai = this._activeIndex;\n var start = ai < n - 1 ? ai + 1 : 0;\n var stop = start === 0 ? n - 1 : start - 1;\n this.activeIndex = algorithm.ArrayExt.findFirstIndex(this._items, Private.canActivate, start, stop);\n };\n /**\n * Activate the previous selectable item in the menu.\n *\n * #### Notes\n * If no item is selectable, the index will be set to `-1`.\n */\n Menu.prototype.activatePreviousItem = function () {\n var n = this._items.length;\n var ai = this._activeIndex;\n var start = ai <= 0 ? n - 1 : ai - 1;\n var stop = start === n - 1 ? 0 : start + 1;\n this.activeIndex = algorithm.ArrayExt.findLastIndex(this._items, Private.canActivate, start, stop);\n };\n /**\n * Trigger the active menu item.\n *\n * #### Notes\n * If the active item is a submenu, it will be opened and the first\n * item will be activated.\n *\n * If the active item is a command, the command will be executed.\n *\n * If the menu is not attached, this is a no-op.\n *\n * If there is no active item, this is a no-op.\n */\n Menu.prototype.triggerActiveItem = function () {\n // Bail if the menu is not attached.\n if (!this.isAttached) {\n return;\n }\n // Bail if there is no active item.\n var item = this.activeItem;\n if (!item) {\n return;\n }\n // Cancel the pending timers.\n this._cancelOpenTimer();\n this._cancelCloseTimer();\n // If the item is a submenu, open it.\n if (item.type === 'submenu') {\n this._openChildMenu(true);\n return;\n }\n // Close the root menu before executing the command.\n this.rootMenu.close();\n // Execute the command for the item.\n var command = item.command, args = item.args;\n if (this.commands.isEnabled(command, args)) {\n this.commands.execute(command, args);\n }\n else {\n console.log(\"Command '\" + command + \"' is disabled.\");\n }\n };\n /**\n * Add a menu item to the end of the menu.\n *\n * @param options - The options for creating the menu item.\n *\n * @returns The menu item added to the menu.\n */\n Menu.prototype.addItem = function (options) {\n return this.insertItem(this._items.length, options);\n };\n /**\n * Insert a menu item into the menu at the specified index.\n *\n * @param index - The index at which to insert the item.\n *\n * @param options - The options for creating the menu item.\n *\n * @returns The menu item added to the menu.\n *\n * #### Notes\n * The index will be clamped to the bounds of the items.\n */\n Menu.prototype.insertItem = function (index, options) {\n // Close the menu if it's attached.\n if (this.isAttached) {\n this.close();\n }\n // Reset the active index.\n this.activeIndex = -1;\n // Clamp the insert index to the array bounds.\n var i = Math.max(0, Math.min(index, this._items.length));\n // Create the item for the options.\n var item = Private.createItem(this, options);\n // Insert the item into the array.\n algorithm.ArrayExt.insert(this._items, i, item);\n // Schedule an update of the items.\n this.update();\n // Return the item added to the menu.\n return item;\n };\n /**\n * Remove an item from the menu.\n *\n * @param item - The item to remove from the menu.\n *\n * #### Notes\n * This is a no-op if the item is not in the menu.\n */\n Menu.prototype.removeItem = function (item) {\n this.removeItemAt(this._items.indexOf(item));\n };\n /**\n * Remove the item at a given index from the menu.\n *\n * @param index - The index of the item to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n Menu.prototype.removeItemAt = function (index) {\n // Close the menu if it's attached.\n if (this.isAttached) {\n this.close();\n }\n // Reset the active index.\n this.activeIndex = -1;\n // Remove the item from the array.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n // Bail if the index is out of range.\n if (!item) {\n return;\n }\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Remove all menu items from the menu.\n */\n Menu.prototype.clearItems = function () {\n // Close the menu if it's attached.\n if (this.isAttached) {\n this.close();\n }\n // Reset the active index.\n this.activeIndex = -1;\n // Bail if there is nothing to remove.\n if (this._items.length === 0) {\n return;\n }\n // Clear the items.\n this._items.length = 0;\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Open the menu at the specified location.\n *\n * @param x - The client X coordinate of the menu location.\n *\n * @param y - The client Y coordinate of the menu location.\n *\n * @param options - The additional options for opening the menu.\n *\n * #### Notes\n * The menu will be opened at the given location unless it will not\n * fully fit on the screen. If it will not fit, it will be adjusted\n * to fit naturally on the screen.\n *\n * This is a no-op if the menu is already attached to the DOM.\n */\n Menu.prototype.open = function (x, y, options) {\n if (options === void 0) { options = {}; }\n // Bail early if the menu is already attached.\n if (this.isAttached) {\n return;\n }\n // Extract the position options.\n var forceX = options.forceX || false;\n var forceY = options.forceY || false;\n // Open the menu as a root menu.\n Private.openRootMenu(this, x, y, forceX, forceY);\n // Activate the menu to accept keyboard input.\n this.activate();\n };\n /**\n * Handle the DOM events for the menu.\n *\n * @param event - The DOM event sent to the menu.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the menu's DOM nodes. It should\n * not be called directly by user code.\n */\n Menu.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseenter':\n this._evtMouseEnter(event);\n break;\n case 'mouseleave':\n this._evtMouseLeave(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n Menu.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('keydown', this);\n this.node.addEventListener('mouseup', this);\n this.node.addEventListener('mousemove', this);\n this.node.addEventListener('mouseenter', this);\n this.node.addEventListener('mouseleave', this);\n this.node.addEventListener('contextmenu', this);\n document.addEventListener('mousedown', this, true);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n Menu.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('keydown', this);\n this.node.removeEventListener('mouseup', this);\n this.node.removeEventListener('mousemove', this);\n this.node.removeEventListener('mouseenter', this);\n this.node.removeEventListener('mouseleave', this);\n this.node.removeEventListener('contextmenu', this);\n document.removeEventListener('mousedown', this, true);\n };\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n Menu.prototype.onActivateRequest = function (msg) {\n if (this.isAttached) {\n this.node.focus();\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n Menu.prototype.onUpdateRequest = function (msg) {\n var items = this._items;\n var renderer = this.renderer;\n var activeIndex = this._activeIndex;\n var collapsedFlags = Private.computeCollapsed(items);\n var content = new Array(items.length);\n for (var i = 0, n = items.length; i < n; ++i) {\n var item = items[i];\n var active = i === activeIndex;\n var collapsed = collapsedFlags[i];\n content[i] = renderer.renderItem({ item: item, active: active, collapsed: collapsed });\n }\n virtualdom.VirtualDOM.render(content, this.contentNode);\n };\n /**\n * A message handler invoked on a `'close-request'` message.\n */\n Menu.prototype.onCloseRequest = function (msg) {\n // Cancel the pending timers.\n this._cancelOpenTimer();\n this._cancelCloseTimer();\n // Reset the active index.\n this.activeIndex = -1;\n // Close any open child menu.\n var childMenu = this._childMenu;\n if (childMenu) {\n this._childIndex = -1;\n this._childMenu = null;\n childMenu._parentMenu = null;\n childMenu.close();\n }\n // Remove this menu from its parent and activate the parent.\n var parentMenu = this._parentMenu;\n if (parentMenu) {\n this._parentMenu = null;\n parentMenu._childIndex = -1;\n parentMenu._childMenu = null;\n parentMenu.activate();\n }\n // Emit the `aboutToClose` signal if the menu is attached.\n if (this.isAttached) {\n this._aboutToClose.emit(undefined);\n }\n // Finish closing the menu.\n _super.prototype.onCloseRequest.call(this, msg);\n };\n /**\n * Handle the `'keydown'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtKeyDown = function (event) {\n // A menu handles all keydown events.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the key code for the event.\n var kc = event.keyCode;\n // Enter\n if (kc === 13) {\n this.triggerActiveItem();\n return;\n }\n // Escape\n if (kc === 27) {\n this.close();\n return;\n }\n // Left Arrow\n if (kc === 37) {\n if (this._parentMenu) {\n this.close();\n }\n else {\n this._menuRequested.emit('previous');\n }\n return;\n }\n // Up Arrow\n if (kc === 38) {\n this.activatePreviousItem();\n return;\n }\n // Right Arrow\n if (kc === 39) {\n var item = this.activeItem;\n if (item && item.type === 'submenu') {\n this.triggerActiveItem();\n }\n else {\n this.rootMenu._menuRequested.emit('next');\n }\n return;\n }\n // Down Arrow\n if (kc === 40) {\n this.activateNextItem();\n return;\n }\n // Get the pressed key character.\n var key = keyboard.getKeyboardLayout().keyForKeydownEvent(event);\n // Bail if the key is not valid.\n if (!key) {\n return;\n }\n // Search for the next best matching mnemonic item.\n var start = this._activeIndex + 1;\n var result = Private.findMnemonic(this._items, key, start);\n // Handle the requested mnemonic based on the search results.\n // If exactly one mnemonic is matched, that item is triggered.\n // Otherwise, the next mnemonic is activated if available,\n // followed by the auto mnemonic if available.\n if (result.index !== -1 && !result.multiple) {\n this.activeIndex = result.index;\n this.triggerActiveItem();\n }\n else if (result.index !== -1) {\n this.activeIndex = result.index;\n }\n else if (result.auto !== -1) {\n this.activeIndex = result.auto;\n }\n };\n /**\n * Handle the `'mouseup'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtMouseUp = function (event) {\n if (event.button !== 0) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.triggerActiveItem();\n };\n /**\n * Handle the `'mousemove'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtMouseMove = function (event) {\n // Hit test the item nodes for the item under the mouse.\n var index = algorithm.ArrayExt.findFirstIndex(this.contentNode.children, function (node) {\n return domutils.ElementExt.hitTest(node, event.clientX, event.clientY);\n });\n // Bail early if the mouse is already over the active index.\n if (index === this._activeIndex) {\n return;\n }\n // Update and coerce the active index.\n this.activeIndex = index;\n index = this.activeIndex;\n // If the index is the current child index, cancel the timers.\n if (index === this._childIndex) {\n this._cancelOpenTimer();\n this._cancelCloseTimer();\n return;\n }\n // If a child menu is currently open, start the close timer.\n if (this._childIndex !== -1) {\n this._startCloseTimer();\n }\n // Cancel the open timer to give a full delay for opening.\n this._cancelOpenTimer();\n // Bail if the active item is not a valid submenu item.\n var item = this.activeItem;\n if (!item || item.type !== 'submenu' || !item.submenu) {\n return;\n }\n // Start the open timer to open the active item submenu.\n this._startOpenTimer();\n };\n /**\n * Handle the `'mouseenter'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtMouseEnter = function (event) {\n // Synchronize the active ancestor items.\n for (var menu = this._parentMenu; menu; menu = menu._parentMenu) {\n menu._cancelOpenTimer();\n menu._cancelCloseTimer();\n menu.activeIndex = menu._childIndex;\n }\n };\n /**\n * Handle the `'mouseleave'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtMouseLeave = function (event) {\n // Cancel any pending submenu opening.\n this._cancelOpenTimer();\n // If there is no open child menu, just reset the active index.\n if (!this._childMenu) {\n this.activeIndex = -1;\n return;\n }\n // If the mouse is over the child menu, cancel the close timer.\n var clientX = event.clientX, clientY = event.clientY;\n if (domutils.ElementExt.hitTest(this._childMenu.node, clientX, clientY)) {\n this._cancelCloseTimer();\n return;\n }\n // Otherwise, reset the active index and start the close timer.\n this.activeIndex = -1;\n this._startCloseTimer();\n };\n /**\n * Handle the `'mousedown'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the document node.\n */\n Menu.prototype._evtMouseDown = function (event) {\n // Bail if the menu is not a root menu.\n if (this._parentMenu) {\n return;\n }\n // The mouse button which is pressed is irrelevant. If the press\n // is not on a menu, the entire hierarchy is closed and the event\n // is allowed to propagate. This allows other code to act on the\n // event, such as focusing the clicked element.\n if (Private.hitTestMenus(this, event.clientX, event.clientY)) {\n event.preventDefault();\n event.stopPropagation();\n }\n else {\n this.close();\n }\n };\n /**\n * Open the child menu at the active index immediately.\n *\n * If a different child menu is already open, it will be closed,\n * even if the active item is not a valid submenu.\n */\n Menu.prototype._openChildMenu = function (activateFirst) {\n if (activateFirst === void 0) { activateFirst = false; }\n // If the item is not a valid submenu, close the child menu.\n var item = this.activeItem;\n if (!item || item.type !== 'submenu' || !item.submenu) {\n this._closeChildMenu();\n return;\n }\n // Do nothing if the child menu will not change.\n var submenu = item.submenu;\n if (submenu === this._childMenu) {\n return;\n }\n // Ensure the current child menu is closed.\n this._closeChildMenu();\n // Update the private child state.\n this._childMenu = submenu;\n this._childIndex = this._activeIndex;\n // Set the parent menu reference for the child.\n submenu._parentMenu = this;\n // Ensure the menu is updated and lookup the item node.\n messaging.MessageLoop.sendMessage(this, widget.Widget.Msg.UpdateRequest);\n var itemNode = this.contentNode.children[this._activeIndex];\n // Open the submenu at the active node.\n Private.openSubmenu(submenu, itemNode);\n // Activate the first item if desired.\n if (activateFirst) {\n submenu.activeIndex = -1;\n submenu.activateNextItem();\n }\n // Activate the child menu.\n submenu.activate();\n };\n /**\n * Close the child menu immediately.\n *\n * This is a no-op if a child menu is not open.\n */\n Menu.prototype._closeChildMenu = function () {\n if (this._childMenu) {\n this._childMenu.close();\n }\n };\n /**\n * Start the open timer, unless it is already pending.\n */\n Menu.prototype._startOpenTimer = function () {\n var _this = this;\n if (this._openTimerID === 0) {\n this._openTimerID = window.setTimeout(function () {\n _this._openTimerID = 0;\n _this._openChildMenu();\n }, Private.TIMER_DELAY);\n }\n };\n /**\n * Start the close timer, unless it is already pending.\n */\n Menu.prototype._startCloseTimer = function () {\n var _this = this;\n if (this._closeTimerID === 0) {\n this._closeTimerID = window.setTimeout(function () {\n _this._closeTimerID = 0;\n _this._closeChildMenu();\n }, Private.TIMER_DELAY);\n }\n };\n /**\n * Cancel the open timer, if the timer is pending.\n */\n Menu.prototype._cancelOpenTimer = function () {\n if (this._openTimerID !== 0) {\n clearTimeout(this._openTimerID);\n this._openTimerID = 0;\n }\n };\n /**\n * Cancel the close timer, if the timer is pending.\n */\n Menu.prototype._cancelCloseTimer = function () {\n if (this._closeTimerID !== 0) {\n clearTimeout(this._closeTimerID);\n this._closeTimerID = 0;\n }\n };\n return Menu;\n}(widget.Widget));\n/**\n * The namespace for the `Menu` class statics.\n */\n(function (Menu) {\n /**\n * The default implementation of `IRenderer`.\n *\n * #### Notes\n * Subclasses are free to reimplement rendering methods as needed.\n */\n var Renderer = /** @class */ (function () {\n /**\n * Construct a new renderer.\n */\n function Renderer() {\n }\n /**\n * Render the virtual element for a menu item.\n *\n * @param data - The data to use for rendering the item.\n *\n * @returns A virtual element representing the item.\n */\n Renderer.prototype.renderItem = function (data) {\n var className = this.createItemClass(data);\n var dataset = this.createItemDataset(data);\n return (virtualdom.h.li({ className: className, dataset: dataset }, this.renderIcon(data), this.renderLabel(data), this.renderShortcut(data), this.renderSubmenu(data)));\n };\n /**\n * Render the icon element for a menu item.\n *\n * @param data - The data to use for rendering the icon.\n *\n * @returns A virtual element representing the item icon.\n */\n Renderer.prototype.renderIcon = function (data) {\n var className = this.createIconClass(data);\n /* */\n if (typeof data.item.icon === 'string') {\n return virtualdom.h.div({ className: className }, data.item.iconLabel);\n }\n /* */\n // if data.item.icon is undefined, it will be ignored\n return virtualdom.h.div({ className: className }, data.item.icon, data.item.iconLabel);\n };\n /**\n * Render the label element for a menu item.\n *\n * @param data - The data to use for rendering the label.\n *\n * @returns A virtual element representing the item label.\n */\n Renderer.prototype.renderLabel = function (data) {\n var content = this.formatLabel(data);\n return virtualdom.h.div({\n className: 'lm-Menu-itemLabel'\n /* */\n + ' p-Menu-itemLabel'\n /* */\n }, content);\n };\n /**\n * Render the shortcut element for a menu item.\n *\n * @param data - The data to use for rendering the shortcut.\n *\n * @returns A virtual element representing the item shortcut.\n */\n Renderer.prototype.renderShortcut = function (data) {\n var content = this.formatShortcut(data);\n return virtualdom.h.div({\n className: 'lm-Menu-itemShortcut'\n /* */\n + ' p-Menu-itemShortcut'\n /* */\n }, content);\n };\n /**\n * Render the submenu icon element for a menu item.\n *\n * @param data - The data to use for rendering the submenu icon.\n *\n * @returns A virtual element representing the submenu icon.\n */\n Renderer.prototype.renderSubmenu = function (data) {\n return virtualdom.h.div({\n className: 'lm-Menu-itemSubmenuIcon'\n /* */\n + ' p-Menu-itemSubmenuIcon'\n /* */\n });\n };\n /**\n * Create the class name for the menu item.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the menu item.\n */\n Renderer.prototype.createItemClass = function (data) {\n // Setup the initial class name.\n var name = 'lm-Menu-item';\n /* */\n name += ' p-Menu-item';\n /* */\n // Add the boolean state classes.\n if (!data.item.isEnabled) {\n name += ' lm-mod-disabled';\n /* */\n name += ' p-mod-disabled';\n /* */\n }\n if (data.item.isToggled) {\n name += ' lm-mod-toggled';\n /* */\n name += ' p-mod-toggled';\n /* */\n }\n if (!data.item.isVisible) {\n name += ' lm-mod-hidden';\n /* */\n name += ' p-mod-hidden';\n /* */\n }\n if (data.active) {\n name += ' lm-mod-active';\n /* */\n name += ' p-mod-active';\n /* */\n }\n if (data.collapsed) {\n name += ' lm-mod-collapsed';\n /* */\n name += ' p-mod-collapsed';\n /* */\n }\n // Add the extra class.\n var extra = data.item.className;\n if (extra) {\n name += \" \" + extra;\n }\n // Return the complete class name.\n return name;\n };\n /**\n * Create the dataset for the menu item.\n *\n * @param data - The data to use for creating the dataset.\n *\n * @returns The dataset for the menu item.\n */\n Renderer.prototype.createItemDataset = function (data) {\n var result;\n var _a = data.item, type = _a.type, command = _a.command, dataset = _a.dataset;\n if (type === 'command') {\n result = tslib.__assign(tslib.__assign({}, dataset), { type: type, command: command });\n }\n else {\n result = tslib.__assign(tslib.__assign({}, dataset), { type: type });\n }\n return result;\n };\n /**\n * Create the class name for the menu item icon.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the item icon.\n */\n Renderer.prototype.createIconClass = function (data) {\n var name = 'lm-Menu-itemIcon';\n /* */\n name += ' p-Menu-itemIcon';\n /* */\n var extra = data.item.iconClass;\n return extra ? name + \" \" + extra : name;\n };\n /**\n * Create the render content for the label node.\n *\n * @param data - The data to use for the label content.\n *\n * @returns The content to add to the label node.\n */\n Renderer.prototype.formatLabel = function (data) {\n // Fetch the label text and mnemonic index.\n var _a = data.item, label = _a.label, mnemonic = _a.mnemonic;\n // If the index is out of range, do not modify the label.\n if (mnemonic < 0 || mnemonic >= label.length) {\n return label;\n }\n // Split the label into parts.\n var prefix = label.slice(0, mnemonic);\n var suffix = label.slice(mnemonic + 1);\n var char = label[mnemonic];\n // Wrap the mnemonic character in a span.\n var span = virtualdom.h.span({\n className: 'lm-Menu-itemMnemonic'\n /* */\n + ' p-Menu-itemMnemonic'\n /* */\n }, char);\n // Return the content parts.\n return [prefix, span, suffix];\n };\n /**\n * Create the render content for the shortcut node.\n *\n * @param data - The data to use for the shortcut content.\n *\n * @returns The content to add to the shortcut node.\n */\n Renderer.prototype.formatShortcut = function (data) {\n var kb = data.item.keyBinding;\n return kb ? kb.keys.map(commands.CommandRegistry.formatKeystroke).join(', ') : null;\n };\n return Renderer;\n }());\n Menu.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n Menu.defaultRenderer = new Renderer();\n})(exports.Menu || (exports.Menu = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The ms delay for opening and closing a submenu.\n */\n Private.TIMER_DELAY = 300;\n /**\n * The horizontal pixel overlap for an open submenu.\n */\n Private.SUBMENU_OVERLAP = 3;\n /**\n * Create the DOM node for a menu.\n */\n function createNode() {\n var node = document.createElement('div');\n var content = document.createElement('ul');\n content.className = 'lm-Menu-content';\n /* */\n content.classList.add('p-Menu-content');\n /* */\n node.appendChild(content);\n node.tabIndex = -1;\n return node;\n }\n Private.createNode = createNode;\n /**\n * Test whether a menu item can be activated.\n */\n function canActivate(item) {\n return item.type !== 'separator' && item.isEnabled && item.isVisible;\n }\n Private.canActivate = canActivate;\n /**\n * Create a new menu item for an owner menu.\n */\n function createItem(owner, options) {\n return new MenuItem(owner.commands, options);\n }\n Private.createItem = createItem;\n /**\n * Hit test a menu hierarchy starting at the given root.\n */\n function hitTestMenus(menu, x, y) {\n for (var temp = menu; temp; temp = temp.childMenu) {\n if (domutils.ElementExt.hitTest(temp.node, x, y)) {\n return true;\n }\n }\n return false;\n }\n Private.hitTestMenus = hitTestMenus;\n /**\n * Compute which extra separator items should be collapsed.\n */\n function computeCollapsed(items) {\n // Allocate the return array and fill it with `false`.\n var result = new Array(items.length);\n algorithm.ArrayExt.fill(result, false);\n // Collapse the leading separators.\n var k1 = 0;\n var n = items.length;\n for (; k1 < n; ++k1) {\n var item = items[k1];\n if (!item.isVisible) {\n continue;\n }\n if (item.type !== 'separator') {\n break;\n }\n result[k1] = true;\n }\n // Hide the trailing separators.\n var k2 = n - 1;\n for (; k2 >= 0; --k2) {\n var item = items[k2];\n if (!item.isVisible) {\n continue;\n }\n if (item.type !== 'separator') {\n break;\n }\n result[k2] = true;\n }\n // Hide the remaining consecutive separators.\n var hide = false;\n while (++k1 < k2) {\n var item = items[k1];\n if (!item.isVisible) {\n continue;\n }\n if (item.type !== 'separator') {\n hide = false;\n }\n else if (hide) {\n result[k1] = true;\n }\n else {\n hide = true;\n }\n }\n // Return the resulting flags.\n return result;\n }\n Private.computeCollapsed = computeCollapsed;\n /**\n * Open a menu as a root menu at the target location.\n */\n function openRootMenu(menu, x, y, forceX, forceY) {\n // Ensure the menu is updated before attaching and measuring.\n messaging.MessageLoop.sendMessage(menu, widget.Widget.Msg.UpdateRequest);\n // Get the current position and size of the main viewport.\n var px = window.pageXOffset;\n var py = window.pageYOffset;\n var cw = document.documentElement.clientWidth;\n var ch = document.documentElement.clientHeight;\n // Compute the maximum allowed height for the menu.\n var maxHeight = ch - (forceY ? y : 0);\n // Fetch common variables.\n var node = menu.node;\n var style = node.style;\n // Clear the menu geometry and prepare it for measuring.\n style.top = '';\n style.left = '';\n style.width = '';\n style.height = '';\n style.visibility = 'hidden';\n style.maxHeight = maxHeight + \"px\";\n // Attach the menu to the document.\n widget.Widget.attach(menu, document.body);\n // Measure the size of the menu.\n var _a = node.getBoundingClientRect(), width = _a.width, height = _a.height;\n // Adjust the X position of the menu to fit on-screen.\n if (!forceX && (x + width > px + cw)) {\n x = px + cw - width;\n }\n // Adjust the Y position of the menu to fit on-screen.\n if (!forceY && (y + height > py + ch)) {\n if (y > py + ch) {\n y = py + ch - height;\n }\n else {\n y = y - height;\n }\n }\n // Update the position of the menu to the computed position.\n style.top = Math.max(0, y) + \"px\";\n style.left = Math.max(0, x) + \"px\";\n // Finally, make the menu visible on the screen.\n style.visibility = '';\n }\n Private.openRootMenu = openRootMenu;\n /**\n * Open a menu as a submenu using an item node for positioning.\n */\n function openSubmenu(submenu, itemNode) {\n // Ensure the menu is updated before opening.\n messaging.MessageLoop.sendMessage(submenu, widget.Widget.Msg.UpdateRequest);\n // Get the current position and size of the main viewport.\n var px = window.pageXOffset;\n var py = window.pageYOffset;\n var cw = document.documentElement.clientWidth;\n var ch = document.documentElement.clientHeight;\n // Compute the maximum allowed height for the menu.\n var maxHeight = ch;\n // Fetch common variables.\n var node = submenu.node;\n var style = node.style;\n // Clear the menu geometry and prepare it for measuring.\n style.top = '';\n style.left = '';\n style.width = '';\n style.height = '';\n style.visibility = 'hidden';\n style.maxHeight = maxHeight + \"px\";\n // Attach the menu to the document.\n widget.Widget.attach(submenu, document.body);\n // Measure the size of the menu.\n var _a = node.getBoundingClientRect(), width = _a.width, height = _a.height;\n // Compute the box sizing for the menu.\n var box = domutils.ElementExt.boxSizing(submenu.node);\n // Get the bounding rect for the target item node.\n var itemRect = itemNode.getBoundingClientRect();\n // Compute the target X position.\n var x = itemRect.right - Private.SUBMENU_OVERLAP;\n // Adjust the X position to fit on the screen.\n if (x + width > px + cw) {\n x = itemRect.left + Private.SUBMENU_OVERLAP - width;\n }\n // Compute the target Y position.\n var y = itemRect.top - box.borderTop - box.paddingTop;\n // Adjust the Y position to fit on the screen.\n if (y + height > py + ch) {\n y = itemRect.bottom + box.borderBottom + box.paddingBottom - height;\n }\n // Update the position of the menu to the computed position.\n style.top = Math.max(0, y) + \"px\";\n style.left = Math.max(0, x) + \"px\";\n // Finally, make the menu visible on the screen.\n style.visibility = '';\n }\n Private.openSubmenu = openSubmenu;\n /**\n * Find the best matching mnemonic item.\n *\n * The search starts at the given index and wraps around.\n */\n function findMnemonic(items, key, start) {\n // Setup the result variables.\n var index = -1;\n var auto = -1;\n var multiple = false;\n // Normalize the key to upper case.\n var upperKey = key.toUpperCase();\n // Search the items from the given start index.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Compute the wrapped index.\n var k = (i + start) % n;\n // Lookup the item\n var item = items[k];\n // Ignore items which cannot be activated.\n if (!canActivate(item)) {\n continue;\n }\n // Ignore items with an empty label.\n var label = item.label;\n if (label.length === 0) {\n continue;\n }\n // Lookup the mnemonic index for the label.\n var mn = item.mnemonic;\n // Handle a valid mnemonic index.\n if (mn >= 0 && mn < label.length) {\n if (label[mn].toUpperCase() === upperKey) {\n if (index === -1) {\n index = k;\n }\n else {\n multiple = true;\n }\n }\n continue;\n }\n // Finally, handle the auto index if possible.\n if (auto === -1 && label[0].toUpperCase() === upperKey) {\n auto = k;\n }\n }\n // Return the search results.\n return { index: index, multiple: multiple, auto: auto };\n }\n Private.findMnemonic = findMnemonic;\n /**\n * A concrete implementation of `Menu.IItem`.\n */\n var MenuItem = /** @class */ (function () {\n /**\n * Construct a new menu item.\n */\n function MenuItem(commands, options) {\n this._commands = commands;\n this.type = options.type || 'command';\n this.command = options.command || '';\n this.args = options.args || coreutils.JSONExt.emptyObject;\n this.submenu = options.submenu || null;\n }\n Object.defineProperty(MenuItem.prototype, \"label\", {\n /**\n * The display label for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.label(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.label;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"mnemonic\", {\n /**\n * The mnemonic index for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.mnemonic(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.mnemonic;\n }\n return -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"icon\", {\n /**\n * The icon renderer for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.icon(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.icon;\n }\n /* */\n // alias to icon class if not otherwise defined\n return this.iconClass;\n /* */\n /* \n return undefined;\n */\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"iconClass\", {\n /**\n * The icon class for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.iconClass(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.iconClass;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"iconLabel\", {\n /**\n * The icon label for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.iconLabel(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.iconLabel;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"caption\", {\n /**\n * The display caption for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.caption(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.caption;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"className\", {\n /**\n * The extra class name for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.className(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.className;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"dataset\", {\n /**\n * The dataset for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.dataset(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.dataset;\n }\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"isEnabled\", {\n /**\n * Whether the menu item is enabled.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.isEnabled(this.command, this.args);\n }\n if (this.type === 'submenu') {\n return this.submenu !== null;\n }\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"isToggled\", {\n /**\n * Whether the menu item is toggled.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.isToggled(this.command, this.args);\n }\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"isVisible\", {\n /**\n * Whether the menu item is visible.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.isVisible(this.command, this.args);\n }\n if (this.type === 'submenu') {\n return this.submenu !== null;\n }\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"keyBinding\", {\n /**\n * The key binding for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n var _a = this, command_1 = _a.command, args_1 = _a.args;\n return algorithm.ArrayExt.findLastValue(this._commands.keyBindings, function (kb) {\n return kb.command === command_1 && coreutils.JSONExt.deepEqual(kb.args, args_1);\n }) || null;\n }\n return null;\n },\n enumerable: false,\n configurable: true\n });\n return MenuItem;\n }());\n})(Private || (Private = {}));\n//# sourceMappingURL=menu.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/menu.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar coreutils = __webpack_require__(/*! @lumino/coreutils */ \"../../packages/coreutils/dist/index.js\");\nvar commands = __webpack_require__(/*! @lumino/commands */ \"../../packages/commands/dist/index.js\");\nvar virtualdom = __webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\n\n/**\n * A widget which displays items as a canonical menu.\n */\nexports.Menu = /** @class */ (function (_super) {\n tslib.__extends(Menu, _super);\n /**\n * Construct a new menu.\n *\n * @param options - The options for initializing the menu.\n */\n function Menu(options) {\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._childIndex = -1;\n _this._activeIndex = -1;\n _this._openTimerID = 0;\n _this._closeTimerID = 0;\n _this._items = [];\n _this._childMenu = null;\n _this._parentMenu = null;\n _this._aboutToClose = new signaling.Signal(_this);\n _this._menuRequested = new signaling.Signal(_this);\n _this.addClass('lm-Menu');\n /* */\n _this.addClass('p-Menu');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n _this.commands = options.commands;\n _this.renderer = options.renderer || Menu.defaultRenderer;\n return _this;\n }\n /**\n * Dispose of the resources held by the menu.\n */\n Menu.prototype.dispose = function () {\n this.close();\n this._items.length = 0;\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(Menu.prototype, \"aboutToClose\", {\n /**\n * A signal emitted just before the menu is closed.\n *\n * #### Notes\n * This signal is emitted when the menu receives a `'close-request'`\n * message, just before it removes itself from the DOM.\n *\n * This signal is not emitted if the menu is already detached from\n * the DOM when it receives the `'close-request'` message.\n */\n get: function () {\n return this._aboutToClose;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"menuRequested\", {\n /**\n * A signal emitted when a new menu is requested by the user.\n *\n * #### Notes\n * This signal is emitted whenever the user presses the right or left\n * arrow keys, and a submenu cannot be opened or closed in response.\n *\n * This signal is useful when implementing menu bars in order to open\n * the next or previous menu in response to a user key press.\n *\n * This signal is only emitted for the root menu in a hierarchy.\n */\n get: function () {\n return this._menuRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"parentMenu\", {\n /**\n * The parent menu of the menu.\n *\n * #### Notes\n * This is `null` unless the menu is an open submenu.\n */\n get: function () {\n return this._parentMenu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"childMenu\", {\n /**\n * The child menu of the menu.\n *\n * #### Notes\n * This is `null` unless the menu has an open submenu.\n */\n get: function () {\n return this._childMenu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"rootMenu\", {\n /**\n * The root menu of the menu hierarchy.\n */\n get: function () {\n var menu = this;\n while (menu._parentMenu) {\n menu = menu._parentMenu;\n }\n return menu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"leafMenu\", {\n /**\n * The leaf menu of the menu hierarchy.\n */\n get: function () {\n var menu = this;\n while (menu._childMenu) {\n menu = menu._childMenu;\n }\n return menu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"contentNode\", {\n /**\n * The menu content node.\n *\n * #### Notes\n * This is the node which holds the menu item nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-Menu-content')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"activeItem\", {\n /**\n * Get the currently active menu item.\n */\n get: function () {\n return this._items[this._activeIndex] || null;\n },\n /**\n * Set the currently active menu item.\n *\n * #### Notes\n * If the item cannot be activated, the item will be set to `null`.\n */\n set: function (value) {\n this.activeIndex = value ? this._items.indexOf(value) : -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"activeIndex\", {\n /**\n * Get the index of the currently active menu item.\n *\n * #### Notes\n * This will be `-1` if no menu item is active.\n */\n get: function () {\n return this._activeIndex;\n },\n /**\n * Set the index of the currently active menu item.\n *\n * #### Notes\n * If the item cannot be activated, the index will be set to `-1`.\n */\n set: function (value) {\n // Adjust the value for an out of range index.\n if (value < 0 || value >= this._items.length) {\n value = -1;\n }\n // Ensure the item can be activated.\n if (value !== -1 && !Private.canActivate(this._items[value])) {\n value = -1;\n }\n // Bail if the index will not change.\n if (this._activeIndex === value) {\n return;\n }\n // Update the active index.\n this._activeIndex = value;\n // schedule an update of the items.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Menu.prototype, \"items\", {\n /**\n * A read-only array of the menu items in the menu.\n */\n get: function () {\n return this._items;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Activate the next selectable item in the menu.\n *\n * #### Notes\n * If no item is selectable, the index will be set to `-1`.\n */\n Menu.prototype.activateNextItem = function () {\n var n = this._items.length;\n var ai = this._activeIndex;\n var start = ai < n - 1 ? ai + 1 : 0;\n var stop = start === 0 ? n - 1 : start - 1;\n this.activeIndex = algorithm.ArrayExt.findFirstIndex(this._items, Private.canActivate, start, stop);\n };\n /**\n * Activate the previous selectable item in the menu.\n *\n * #### Notes\n * If no item is selectable, the index will be set to `-1`.\n */\n Menu.prototype.activatePreviousItem = function () {\n var n = this._items.length;\n var ai = this._activeIndex;\n var start = ai <= 0 ? n - 1 : ai - 1;\n var stop = start === n - 1 ? 0 : start + 1;\n this.activeIndex = algorithm.ArrayExt.findLastIndex(this._items, Private.canActivate, start, stop);\n };\n /**\n * Trigger the active menu item.\n *\n * #### Notes\n * If the active item is a submenu, it will be opened and the first\n * item will be activated.\n *\n * If the active item is a command, the command will be executed.\n *\n * If the menu is not attached, this is a no-op.\n *\n * If there is no active item, this is a no-op.\n */\n Menu.prototype.triggerActiveItem = function () {\n // Bail if the menu is not attached.\n if (!this.isAttached) {\n return;\n }\n // Bail if there is no active item.\n var item = this.activeItem;\n if (!item) {\n return;\n }\n // Cancel the pending timers.\n this._cancelOpenTimer();\n this._cancelCloseTimer();\n // If the item is a submenu, open it.\n if (item.type === 'submenu') {\n this._openChildMenu(true);\n return;\n }\n // Close the root menu before executing the command.\n this.rootMenu.close();\n // Execute the command for the item.\n var command = item.command, args = item.args;\n if (this.commands.isEnabled(command, args)) {\n this.commands.execute(command, args);\n }\n else {\n console.log(\"Command '\" + command + \"' is disabled.\");\n }\n };\n /**\n * Add a menu item to the end of the menu.\n *\n * @param options - The options for creating the menu item.\n *\n * @returns The menu item added to the menu.\n */\n Menu.prototype.addItem = function (options) {\n return this.insertItem(this._items.length, options);\n };\n /**\n * Insert a menu item into the menu at the specified index.\n *\n * @param index - The index at which to insert the item.\n *\n * @param options - The options for creating the menu item.\n *\n * @returns The menu item added to the menu.\n *\n * #### Notes\n * The index will be clamped to the bounds of the items.\n */\n Menu.prototype.insertItem = function (index, options) {\n // Close the menu if it's attached.\n if (this.isAttached) {\n this.close();\n }\n // Reset the active index.\n this.activeIndex = -1;\n // Clamp the insert index to the array bounds.\n var i = Math.max(0, Math.min(index, this._items.length));\n // Create the item for the options.\n var item = Private.createItem(this, options);\n // Insert the item into the array.\n algorithm.ArrayExt.insert(this._items, i, item);\n // Schedule an update of the items.\n this.update();\n // Return the item added to the menu.\n return item;\n };\n /**\n * Remove an item from the menu.\n *\n * @param item - The item to remove from the menu.\n *\n * #### Notes\n * This is a no-op if the item is not in the menu.\n */\n Menu.prototype.removeItem = function (item) {\n this.removeItemAt(this._items.indexOf(item));\n };\n /**\n * Remove the item at a given index from the menu.\n *\n * @param index - The index of the item to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n Menu.prototype.removeItemAt = function (index) {\n // Close the menu if it's attached.\n if (this.isAttached) {\n this.close();\n }\n // Reset the active index.\n this.activeIndex = -1;\n // Remove the item from the array.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n // Bail if the index is out of range.\n if (!item) {\n return;\n }\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Remove all menu items from the menu.\n */\n Menu.prototype.clearItems = function () {\n // Close the menu if it's attached.\n if (this.isAttached) {\n this.close();\n }\n // Reset the active index.\n this.activeIndex = -1;\n // Bail if there is nothing to remove.\n if (this._items.length === 0) {\n return;\n }\n // Clear the items.\n this._items.length = 0;\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Open the menu at the specified location.\n *\n * @param x - The client X coordinate of the menu location.\n *\n * @param y - The client Y coordinate of the menu location.\n *\n * @param options - The additional options for opening the menu.\n *\n * #### Notes\n * The menu will be opened at the given location unless it will not\n * fully fit on the screen. If it will not fit, it will be adjusted\n * to fit naturally on the screen.\n *\n * This is a no-op if the menu is already attached to the DOM.\n */\n Menu.prototype.open = function (x, y, options) {\n if (options === void 0) { options = {}; }\n // Bail early if the menu is already attached.\n if (this.isAttached) {\n return;\n }\n // Extract the position options.\n var forceX = options.forceX || false;\n var forceY = options.forceY || false;\n // Open the menu as a root menu.\n Private.openRootMenu(this, x, y, forceX, forceY);\n // Activate the menu to accept keyboard input.\n this.activate();\n };\n /**\n * Handle the DOM events for the menu.\n *\n * @param event - The DOM event sent to the menu.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the menu's DOM nodes. It should\n * not be called directly by user code.\n */\n Menu.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseenter':\n this._evtMouseEnter(event);\n break;\n case 'mouseleave':\n this._evtMouseLeave(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n Menu.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('keydown', this);\n this.node.addEventListener('mouseup', this);\n this.node.addEventListener('mousemove', this);\n this.node.addEventListener('mouseenter', this);\n this.node.addEventListener('mouseleave', this);\n this.node.addEventListener('contextmenu', this);\n document.addEventListener('mousedown', this, true);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n Menu.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('keydown', this);\n this.node.removeEventListener('mouseup', this);\n this.node.removeEventListener('mousemove', this);\n this.node.removeEventListener('mouseenter', this);\n this.node.removeEventListener('mouseleave', this);\n this.node.removeEventListener('contextmenu', this);\n document.removeEventListener('mousedown', this, true);\n };\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n Menu.prototype.onActivateRequest = function (msg) {\n if (this.isAttached) {\n this.node.focus();\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n Menu.prototype.onUpdateRequest = function (msg) {\n var items = this._items;\n var renderer = this.renderer;\n var activeIndex = this._activeIndex;\n var collapsedFlags = Private.computeCollapsed(items);\n var content = new Array(items.length);\n for (var i = 0, n = items.length; i < n; ++i) {\n var item = items[i];\n var active = i === activeIndex;\n var collapsed = collapsedFlags[i];\n content[i] = renderer.renderItem({ item: item, active: active, collapsed: collapsed });\n }\n virtualdom.VirtualDOM.render(content, this.contentNode);\n };\n /**\n * A message handler invoked on a `'close-request'` message.\n */\n Menu.prototype.onCloseRequest = function (msg) {\n // Cancel the pending timers.\n this._cancelOpenTimer();\n this._cancelCloseTimer();\n // Reset the active index.\n this.activeIndex = -1;\n // Close any open child menu.\n var childMenu = this._childMenu;\n if (childMenu) {\n this._childIndex = -1;\n this._childMenu = null;\n childMenu._parentMenu = null;\n childMenu.close();\n }\n // Remove this menu from its parent and activate the parent.\n var parentMenu = this._parentMenu;\n if (parentMenu) {\n this._parentMenu = null;\n parentMenu._childIndex = -1;\n parentMenu._childMenu = null;\n parentMenu.activate();\n }\n // Emit the `aboutToClose` signal if the menu is attached.\n if (this.isAttached) {\n this._aboutToClose.emit(undefined);\n }\n // Finish closing the menu.\n _super.prototype.onCloseRequest.call(this, msg);\n };\n /**\n * Handle the `'keydown'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtKeyDown = function (event) {\n // A menu handles all keydown events.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the key code for the event.\n var kc = event.keyCode;\n // Enter\n if (kc === 13) {\n this.triggerActiveItem();\n return;\n }\n // Escape\n if (kc === 27) {\n this.close();\n return;\n }\n // Left Arrow\n if (kc === 37) {\n if (this._parentMenu) {\n this.close();\n }\n else {\n this._menuRequested.emit('previous');\n }\n return;\n }\n // Up Arrow\n if (kc === 38) {\n this.activatePreviousItem();\n return;\n }\n // Right Arrow\n if (kc === 39) {\n var item = this.activeItem;\n if (item && item.type === 'submenu') {\n this.triggerActiveItem();\n }\n else {\n this.rootMenu._menuRequested.emit('next');\n }\n return;\n }\n // Down Arrow\n if (kc === 40) {\n this.activateNextItem();\n return;\n }\n // Get the pressed key character.\n var key = keyboard.getKeyboardLayout().keyForKeydownEvent(event);\n // Bail if the key is not valid.\n if (!key) {\n return;\n }\n // Search for the next best matching mnemonic item.\n var start = this._activeIndex + 1;\n var result = Private.findMnemonic(this._items, key, start);\n // Handle the requested mnemonic based on the search results.\n // If exactly one mnemonic is matched, that item is triggered.\n // Otherwise, the next mnemonic is activated if available,\n // followed by the auto mnemonic if available.\n if (result.index !== -1 && !result.multiple) {\n this.activeIndex = result.index;\n this.triggerActiveItem();\n }\n else if (result.index !== -1) {\n this.activeIndex = result.index;\n }\n else if (result.auto !== -1) {\n this.activeIndex = result.auto;\n }\n };\n /**\n * Handle the `'mouseup'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtMouseUp = function (event) {\n if (event.button !== 0) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.triggerActiveItem();\n };\n /**\n * Handle the `'mousemove'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtMouseMove = function (event) {\n // Hit test the item nodes for the item under the mouse.\n var index = algorithm.ArrayExt.findFirstIndex(this.contentNode.children, function (node) {\n return domutils.ElementExt.hitTest(node, event.clientX, event.clientY);\n });\n // Bail early if the mouse is already over the active index.\n if (index === this._activeIndex) {\n return;\n }\n // Update and coerce the active index.\n this.activeIndex = index;\n index = this.activeIndex;\n // If the index is the current child index, cancel the timers.\n if (index === this._childIndex) {\n this._cancelOpenTimer();\n this._cancelCloseTimer();\n return;\n }\n // If a child menu is currently open, start the close timer.\n if (this._childIndex !== -1) {\n this._startCloseTimer();\n }\n // Cancel the open timer to give a full delay for opening.\n this._cancelOpenTimer();\n // Bail if the active item is not a valid submenu item.\n var item = this.activeItem;\n if (!item || item.type !== 'submenu' || !item.submenu) {\n return;\n }\n // Start the open timer to open the active item submenu.\n this._startOpenTimer();\n };\n /**\n * Handle the `'mouseenter'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtMouseEnter = function (event) {\n // Synchronize the active ancestor items.\n for (var menu = this._parentMenu; menu; menu = menu._parentMenu) {\n menu._cancelOpenTimer();\n menu._cancelCloseTimer();\n menu.activeIndex = menu._childIndex;\n }\n };\n /**\n * Handle the `'mouseleave'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the menu node.\n */\n Menu.prototype._evtMouseLeave = function (event) {\n // Cancel any pending submenu opening.\n this._cancelOpenTimer();\n // If there is no open child menu, just reset the active index.\n if (!this._childMenu) {\n this.activeIndex = -1;\n return;\n }\n // If the mouse is over the child menu, cancel the close timer.\n var clientX = event.clientX, clientY = event.clientY;\n if (domutils.ElementExt.hitTest(this._childMenu.node, clientX, clientY)) {\n this._cancelCloseTimer();\n return;\n }\n // Otherwise, reset the active index and start the close timer.\n this.activeIndex = -1;\n this._startCloseTimer();\n };\n /**\n * Handle the `'mousedown'` event for the menu.\n *\n * #### Notes\n * This listener is attached to the document node.\n */\n Menu.prototype._evtMouseDown = function (event) {\n // Bail if the menu is not a root menu.\n if (this._parentMenu) {\n return;\n }\n // The mouse button which is pressed is irrelevant. If the press\n // is not on a menu, the entire hierarchy is closed and the event\n // is allowed to propagate. This allows other code to act on the\n // event, such as focusing the clicked element.\n if (Private.hitTestMenus(this, event.clientX, event.clientY)) {\n event.preventDefault();\n event.stopPropagation();\n }\n else {\n this.close();\n }\n };\n /**\n * Open the child menu at the active index immediately.\n *\n * If a different child menu is already open, it will be closed,\n * even if the active item is not a valid submenu.\n */\n Menu.prototype._openChildMenu = function (activateFirst) {\n if (activateFirst === void 0) { activateFirst = false; }\n // If the item is not a valid submenu, close the child menu.\n var item = this.activeItem;\n if (!item || item.type !== 'submenu' || !item.submenu) {\n this._closeChildMenu();\n return;\n }\n // Do nothing if the child menu will not change.\n var submenu = item.submenu;\n if (submenu === this._childMenu) {\n return;\n }\n // Ensure the current child menu is closed.\n this._closeChildMenu();\n // Update the private child state.\n this._childMenu = submenu;\n this._childIndex = this._activeIndex;\n // Set the parent menu reference for the child.\n submenu._parentMenu = this;\n // Ensure the menu is updated and lookup the item node.\n messaging.MessageLoop.sendMessage(this, widget.Widget.Msg.UpdateRequest);\n var itemNode = this.contentNode.children[this._activeIndex];\n // Open the submenu at the active node.\n Private.openSubmenu(submenu, itemNode);\n // Activate the first item if desired.\n if (activateFirst) {\n submenu.activeIndex = -1;\n submenu.activateNextItem();\n }\n // Activate the child menu.\n submenu.activate();\n };\n /**\n * Close the child menu immediately.\n *\n * This is a no-op if a child menu is not open.\n */\n Menu.prototype._closeChildMenu = function () {\n if (this._childMenu) {\n this._childMenu.close();\n }\n };\n /**\n * Start the open timer, unless it is already pending.\n */\n Menu.prototype._startOpenTimer = function () {\n var _this = this;\n if (this._openTimerID === 0) {\n this._openTimerID = window.setTimeout(function () {\n _this._openTimerID = 0;\n _this._openChildMenu();\n }, Private.TIMER_DELAY);\n }\n };\n /**\n * Start the close timer, unless it is already pending.\n */\n Menu.prototype._startCloseTimer = function () {\n var _this = this;\n if (this._closeTimerID === 0) {\n this._closeTimerID = window.setTimeout(function () {\n _this._closeTimerID = 0;\n _this._closeChildMenu();\n }, Private.TIMER_DELAY);\n }\n };\n /**\n * Cancel the open timer, if the timer is pending.\n */\n Menu.prototype._cancelOpenTimer = function () {\n if (this._openTimerID !== 0) {\n clearTimeout(this._openTimerID);\n this._openTimerID = 0;\n }\n };\n /**\n * Cancel the close timer, if the timer is pending.\n */\n Menu.prototype._cancelCloseTimer = function () {\n if (this._closeTimerID !== 0) {\n clearTimeout(this._closeTimerID);\n this._closeTimerID = 0;\n }\n };\n return Menu;\n}(widget.Widget));\n/**\n * The namespace for the `Menu` class statics.\n */\n(function (Menu) {\n /**\n * The default implementation of `IRenderer`.\n *\n * #### Notes\n * Subclasses are free to reimplement rendering methods as needed.\n */\n var Renderer = /** @class */ (function () {\n /**\n * Construct a new renderer.\n */\n function Renderer() {\n }\n /**\n * Render the virtual element for a menu item.\n *\n * @param data - The data to use for rendering the item.\n *\n * @returns A virtual element representing the item.\n */\n Renderer.prototype.renderItem = function (data) {\n var className = this.createItemClass(data);\n var dataset = this.createItemDataset(data);\n return (virtualdom.h.li({ className: className, dataset: dataset }, this.renderIcon(data), this.renderLabel(data), this.renderShortcut(data), this.renderSubmenu(data)));\n };\n /**\n * Render the icon element for a menu item.\n *\n * @param data - The data to use for rendering the icon.\n *\n * @returns A virtual element representing the item icon.\n */\n Renderer.prototype.renderIcon = function (data) {\n var className = this.createIconClass(data);\n /* */\n if (typeof data.item.icon === 'string') {\n return virtualdom.h.div({ className: className }, data.item.iconLabel);\n }\n /* */\n // if data.item.icon is undefined, it will be ignored\n return virtualdom.h.div({ className: className }, data.item.icon, data.item.iconLabel);\n };\n /**\n * Render the label element for a menu item.\n *\n * @param data - The data to use for rendering the label.\n *\n * @returns A virtual element representing the item label.\n */\n Renderer.prototype.renderLabel = function (data) {\n var content = this.formatLabel(data);\n return virtualdom.h.div({\n className: 'lm-Menu-itemLabel'\n /* */\n + ' p-Menu-itemLabel'\n /* */\n }, content);\n };\n /**\n * Render the shortcut element for a menu item.\n *\n * @param data - The data to use for rendering the shortcut.\n *\n * @returns A virtual element representing the item shortcut.\n */\n Renderer.prototype.renderShortcut = function (data) {\n var content = this.formatShortcut(data);\n return virtualdom.h.div({\n className: 'lm-Menu-itemShortcut'\n /* */\n + ' p-Menu-itemShortcut'\n /* */\n }, content);\n };\n /**\n * Render the submenu icon element for a menu item.\n *\n * @param data - The data to use for rendering the submenu icon.\n *\n * @returns A virtual element representing the submenu icon.\n */\n Renderer.prototype.renderSubmenu = function (data) {\n return virtualdom.h.div({\n className: 'lm-Menu-itemSubmenuIcon'\n /* */\n + ' p-Menu-itemSubmenuIcon'\n /* */\n });\n };\n /**\n * Create the class name for the menu item.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the menu item.\n */\n Renderer.prototype.createItemClass = function (data) {\n // Setup the initial class name.\n var name = 'lm-Menu-item';\n /* */\n name += ' p-Menu-item';\n /* */\n // Add the boolean state classes.\n if (!data.item.isEnabled) {\n name += ' lm-mod-disabled';\n /* */\n name += ' p-mod-disabled';\n /* */\n }\n if (data.item.isToggled) {\n name += ' lm-mod-toggled';\n /* */\n name += ' p-mod-toggled';\n /* */\n }\n if (!data.item.isVisible) {\n name += ' lm-mod-hidden';\n /* */\n name += ' p-mod-hidden';\n /* */\n }\n if (data.active) {\n name += ' lm-mod-active';\n /* */\n name += ' p-mod-active';\n /* */\n }\n if (data.collapsed) {\n name += ' lm-mod-collapsed';\n /* */\n name += ' p-mod-collapsed';\n /* */\n }\n // Add the extra class.\n var extra = data.item.className;\n if (extra) {\n name += \" \" + extra;\n }\n // Return the complete class name.\n return name;\n };\n /**\n * Create the dataset for the menu item.\n *\n * @param data - The data to use for creating the dataset.\n *\n * @returns The dataset for the menu item.\n */\n Renderer.prototype.createItemDataset = function (data) {\n var result;\n var _a = data.item, type = _a.type, command = _a.command, dataset = _a.dataset;\n if (type === 'command') {\n result = tslib.__assign(tslib.__assign({}, dataset), { type: type, command: command });\n }\n else {\n result = tslib.__assign(tslib.__assign({}, dataset), { type: type });\n }\n return result;\n };\n /**\n * Create the class name for the menu item icon.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the item icon.\n */\n Renderer.prototype.createIconClass = function (data) {\n var name = 'lm-Menu-itemIcon';\n /* */\n name += ' p-Menu-itemIcon';\n /* */\n var extra = data.item.iconClass;\n return extra ? name + \" \" + extra : name;\n };\n /**\n * Create the render content for the label node.\n *\n * @param data - The data to use for the label content.\n *\n * @returns The content to add to the label node.\n */\n Renderer.prototype.formatLabel = function (data) {\n // Fetch the label text and mnemonic index.\n var _a = data.item, label = _a.label, mnemonic = _a.mnemonic;\n // If the index is out of range, do not modify the label.\n if (mnemonic < 0 || mnemonic >= label.length) {\n return label;\n }\n // Split the label into parts.\n var prefix = label.slice(0, mnemonic);\n var suffix = label.slice(mnemonic + 1);\n var char = label[mnemonic];\n // Wrap the mnemonic character in a span.\n var span = virtualdom.h.span({\n className: 'lm-Menu-itemMnemonic'\n /* */\n + ' p-Menu-itemMnemonic'\n /* */\n }, char);\n // Return the content parts.\n return [prefix, span, suffix];\n };\n /**\n * Create the render content for the shortcut node.\n *\n * @param data - The data to use for the shortcut content.\n *\n * @returns The content to add to the shortcut node.\n */\n Renderer.prototype.formatShortcut = function (data) {\n var kb = data.item.keyBinding;\n return kb ? kb.keys.map(commands.CommandRegistry.formatKeystroke).join(', ') : null;\n };\n return Renderer;\n }());\n Menu.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n Menu.defaultRenderer = new Renderer();\n})(exports.Menu || (exports.Menu = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The ms delay for opening and closing a submenu.\n */\n Private.TIMER_DELAY = 300;\n /**\n * The horizontal pixel overlap for an open submenu.\n */\n Private.SUBMENU_OVERLAP = 3;\n /**\n * Create the DOM node for a menu.\n */\n function createNode() {\n var node = document.createElement('div');\n var content = document.createElement('ul');\n content.className = 'lm-Menu-content';\n /* */\n content.classList.add('p-Menu-content');\n /* */\n node.appendChild(content);\n node.tabIndex = -1;\n return node;\n }\n Private.createNode = createNode;\n /**\n * Test whether a menu item can be activated.\n */\n function canActivate(item) {\n return item.type !== 'separator' && item.isEnabled && item.isVisible;\n }\n Private.canActivate = canActivate;\n /**\n * Create a new menu item for an owner menu.\n */\n function createItem(owner, options) {\n return new MenuItem(owner.commands, options);\n }\n Private.createItem = createItem;\n /**\n * Hit test a menu hierarchy starting at the given root.\n */\n function hitTestMenus(menu, x, y) {\n for (var temp = menu; temp; temp = temp.childMenu) {\n if (domutils.ElementExt.hitTest(temp.node, x, y)) {\n return true;\n }\n }\n return false;\n }\n Private.hitTestMenus = hitTestMenus;\n /**\n * Compute which extra separator items should be collapsed.\n */\n function computeCollapsed(items) {\n // Allocate the return array and fill it with `false`.\n var result = new Array(items.length);\n algorithm.ArrayExt.fill(result, false);\n // Collapse the leading separators.\n var k1 = 0;\n var n = items.length;\n for (; k1 < n; ++k1) {\n var item = items[k1];\n if (!item.isVisible) {\n continue;\n }\n if (item.type !== 'separator') {\n break;\n }\n result[k1] = true;\n }\n // Hide the trailing separators.\n var k2 = n - 1;\n for (; k2 >= 0; --k2) {\n var item = items[k2];\n if (!item.isVisible) {\n continue;\n }\n if (item.type !== 'separator') {\n break;\n }\n result[k2] = true;\n }\n // Hide the remaining consecutive separators.\n var hide = false;\n while (++k1 < k2) {\n var item = items[k1];\n if (!item.isVisible) {\n continue;\n }\n if (item.type !== 'separator') {\n hide = false;\n }\n else if (hide) {\n result[k1] = true;\n }\n else {\n hide = true;\n }\n }\n // Return the resulting flags.\n return result;\n }\n Private.computeCollapsed = computeCollapsed;\n /**\n * Open a menu as a root menu at the target location.\n */\n function openRootMenu(menu, x, y, forceX, forceY) {\n // Ensure the menu is updated before attaching and measuring.\n messaging.MessageLoop.sendMessage(menu, widget.Widget.Msg.UpdateRequest);\n // Get the current position and size of the main viewport.\n var px = window.pageXOffset;\n var py = window.pageYOffset;\n var cw = document.documentElement.clientWidth;\n var ch = document.documentElement.clientHeight;\n // Compute the maximum allowed height for the menu.\n var maxHeight = ch - (forceY ? y : 0);\n // Fetch common variables.\n var node = menu.node;\n var style = node.style;\n // Clear the menu geometry and prepare it for measuring.\n style.top = '';\n style.left = '';\n style.width = '';\n style.height = '';\n style.visibility = 'hidden';\n style.maxHeight = maxHeight + \"px\";\n // Attach the menu to the document.\n widget.Widget.attach(menu, document.body);\n // Measure the size of the menu.\n var _a = node.getBoundingClientRect(), width = _a.width, height = _a.height;\n // Adjust the X position of the menu to fit on-screen.\n if (!forceX && (x + width > px + cw)) {\n x = px + cw - width;\n }\n // Adjust the Y position of the menu to fit on-screen.\n if (!forceY && (y + height > py + ch)) {\n if (y > py + ch) {\n y = py + ch - height;\n }\n else {\n y = y - height;\n }\n }\n // Update the position of the menu to the computed position.\n style.top = Math.max(0, y) + \"px\";\n style.left = Math.max(0, x) + \"px\";\n // Finally, make the menu visible on the screen.\n style.visibility = '';\n }\n Private.openRootMenu = openRootMenu;\n /**\n * Open a menu as a submenu using an item node for positioning.\n */\n function openSubmenu(submenu, itemNode) {\n // Ensure the menu is updated before opening.\n messaging.MessageLoop.sendMessage(submenu, widget.Widget.Msg.UpdateRequest);\n // Get the current position and size of the main viewport.\n var px = window.pageXOffset;\n var py = window.pageYOffset;\n var cw = document.documentElement.clientWidth;\n var ch = document.documentElement.clientHeight;\n // Compute the maximum allowed height for the menu.\n var maxHeight = ch;\n // Fetch common variables.\n var node = submenu.node;\n var style = node.style;\n // Clear the menu geometry and prepare it for measuring.\n style.top = '';\n style.left = '';\n style.width = '';\n style.height = '';\n style.visibility = 'hidden';\n style.maxHeight = maxHeight + \"px\";\n // Attach the menu to the document.\n widget.Widget.attach(submenu, document.body);\n // Measure the size of the menu.\n var _a = node.getBoundingClientRect(), width = _a.width, height = _a.height;\n // Compute the box sizing for the menu.\n var box = domutils.ElementExt.boxSizing(submenu.node);\n // Get the bounding rect for the target item node.\n var itemRect = itemNode.getBoundingClientRect();\n // Compute the target X position.\n var x = itemRect.right - Private.SUBMENU_OVERLAP;\n // Adjust the X position to fit on the screen.\n if (x + width > px + cw) {\n x = itemRect.left + Private.SUBMENU_OVERLAP - width;\n }\n // Compute the target Y position.\n var y = itemRect.top - box.borderTop - box.paddingTop;\n // Adjust the Y position to fit on the screen.\n if (y + height > py + ch) {\n y = itemRect.bottom + box.borderBottom + box.paddingBottom - height;\n }\n // Update the position of the menu to the computed position.\n style.top = Math.max(0, y) + \"px\";\n style.left = Math.max(0, x) + \"px\";\n // Finally, make the menu visible on the screen.\n style.visibility = '';\n }\n Private.openSubmenu = openSubmenu;\n /**\n * Find the best matching mnemonic item.\n *\n * The search starts at the given index and wraps around.\n */\n function findMnemonic(items, key, start) {\n // Setup the result variables.\n var index = -1;\n var auto = -1;\n var multiple = false;\n // Normalize the key to upper case.\n var upperKey = key.toUpperCase();\n // Search the items from the given start index.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Compute the wrapped index.\n var k = (i + start) % n;\n // Lookup the item\n var item = items[k];\n // Ignore items which cannot be activated.\n if (!canActivate(item)) {\n continue;\n }\n // Ignore items with an empty label.\n var label = item.label;\n if (label.length === 0) {\n continue;\n }\n // Lookup the mnemonic index for the label.\n var mn = item.mnemonic;\n // Handle a valid mnemonic index.\n if (mn >= 0 && mn < label.length) {\n if (label[mn].toUpperCase() === upperKey) {\n if (index === -1) {\n index = k;\n }\n else {\n multiple = true;\n }\n }\n continue;\n }\n // Finally, handle the auto index if possible.\n if (auto === -1 && label[0].toUpperCase() === upperKey) {\n auto = k;\n }\n }\n // Return the search results.\n return { index: index, multiple: multiple, auto: auto };\n }\n Private.findMnemonic = findMnemonic;\n /**\n * A concrete implementation of `Menu.IItem`.\n */\n var MenuItem = /** @class */ (function () {\n /**\n * Construct a new menu item.\n */\n function MenuItem(commands, options) {\n this._commands = commands;\n this.type = options.type || 'command';\n this.command = options.command || '';\n this.args = options.args || coreutils.JSONExt.emptyObject;\n this.submenu = options.submenu || null;\n }\n Object.defineProperty(MenuItem.prototype, \"label\", {\n /**\n * The display label for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.label(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.label;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"mnemonic\", {\n /**\n * The mnemonic index for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.mnemonic(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.mnemonic;\n }\n return -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"icon\", {\n /**\n * The icon renderer for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.icon(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.icon;\n }\n /* */\n // alias to icon class if not otherwise defined\n return this.iconClass;\n /* */\n /* \n return undefined;\n */\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"iconClass\", {\n /**\n * The icon class for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.iconClass(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.iconClass;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"iconLabel\", {\n /**\n * The icon label for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.iconLabel(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.iconLabel;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"caption\", {\n /**\n * The display caption for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.caption(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.caption;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"className\", {\n /**\n * The extra class name for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.className(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.className;\n }\n return '';\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"dataset\", {\n /**\n * The dataset for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.dataset(this.command, this.args);\n }\n if (this.type === 'submenu' && this.submenu) {\n return this.submenu.title.dataset;\n }\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"isEnabled\", {\n /**\n * Whether the menu item is enabled.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.isEnabled(this.command, this.args);\n }\n if (this.type === 'submenu') {\n return this.submenu !== null;\n }\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"isToggled\", {\n /**\n * Whether the menu item is toggled.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.isToggled(this.command, this.args);\n }\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"isVisible\", {\n /**\n * Whether the menu item is visible.\n */\n get: function () {\n if (this.type === 'command') {\n return this._commands.isVisible(this.command, this.args);\n }\n if (this.type === 'submenu') {\n return this.submenu !== null;\n }\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"keyBinding\", {\n /**\n * The key binding for the menu item.\n */\n get: function () {\n if (this.type === 'command') {\n var _a = this, command_1 = _a.command, args_1 = _a.args;\n return algorithm.ArrayExt.findLastValue(this._commands.keyBindings, function (kb) {\n return kb.command === command_1 && coreutils.JSONExt.deepEqual(kb.args, args_1);\n }) || null;\n }\n return null;\n },\n enumerable: false,\n configurable: true\n });\n return MenuItem;\n }());\n})(Private || (Private = {}));\n//# sourceMappingURL=menu.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/menu.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/menubar.js": │ │ │ │ /*!*******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/menubar.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/menubar.js ***! │ │ │ │ \*******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar virtualdom = __webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\n\n/**\n * A widget which displays menus as a canonical menu bar.\n */\nexports.MenuBar = /** @class */ (function (_super) {\n tslib.__extends(MenuBar, _super);\n /**\n * Construct a new menu bar.\n *\n * @param options - The options for initializing the menu bar.\n */\n function MenuBar(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._activeIndex = -1;\n _this._menus = [];\n _this._childMenu = null;\n _this.addClass('lm-MenuBar');\n /* */\n _this.addClass('p-MenuBar');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n _this.renderer = options.renderer || MenuBar.defaultRenderer;\n return _this;\n }\n /**\n * Dispose of the resources held by the widget.\n */\n MenuBar.prototype.dispose = function () {\n this._closeChildMenu();\n this._menus.length = 0;\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(MenuBar.prototype, \"childMenu\", {\n /**\n * The child menu of the menu bar.\n *\n * #### Notes\n * This will be `null` if the menu bar does not have an open menu.\n */\n get: function () {\n return this._childMenu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuBar.prototype, \"contentNode\", {\n /**\n * Get the menu bar content node.\n *\n * #### Notes\n * This is the node which holds the menu title nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-MenuBar-content')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuBar.prototype, \"activeMenu\", {\n /**\n * Get the currently active menu.\n */\n get: function () {\n return this._menus[this._activeIndex] || null;\n },\n /**\n * Set the currently active menu.\n *\n * #### Notes\n * If the menu does not exist, the menu will be set to `null`.\n */\n set: function (value) {\n this.activeIndex = value ? this._menus.indexOf(value) : -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuBar.prototype, \"activeIndex\", {\n /**\n * Get the index of the currently active menu.\n *\n * #### Notes\n * This will be `-1` if no menu is active.\n */\n get: function () {\n return this._activeIndex;\n },\n /**\n * Set the index of the currently active menu.\n *\n * #### Notes\n * If the menu cannot be activated, the index will be set to `-1`.\n */\n set: function (value) {\n // Adjust the value for an out of range index.\n if (value < 0 || value >= this._menus.length) {\n value = -1;\n }\n // Bail early if the index will not change.\n if (this._activeIndex === value) {\n return;\n }\n // Update the active index.\n this._activeIndex = value;\n // Schedule an update of the items.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuBar.prototype, \"menus\", {\n /**\n * A read-only array of the menus in the menu bar.\n */\n get: function () {\n return this._menus;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Open the active menu and activate its first menu item.\n *\n * #### Notes\n * If there is no active menu, this is a no-op.\n */\n MenuBar.prototype.openActiveMenu = function () {\n // Bail early if there is no active item.\n if (this._activeIndex === -1) {\n return;\n }\n // Open the child menu.\n this._openChildMenu();\n // Activate the first item in the child menu.\n if (this._childMenu) {\n this._childMenu.activeIndex = -1;\n this._childMenu.activateNextItem();\n }\n };\n /**\n * Add a menu to the end of the menu bar.\n *\n * @param menu - The menu to add to the menu bar.\n *\n * #### Notes\n * If the menu is already added to the menu bar, it will be moved.\n */\n MenuBar.prototype.addMenu = function (menu) {\n this.insertMenu(this._menus.length, menu);\n };\n /**\n * Insert a menu into the menu bar at the specified index.\n *\n * @param index - The index at which to insert the menu.\n *\n * @param menu - The menu to insert into the menu bar.\n *\n * #### Notes\n * The index will be clamped to the bounds of the menus.\n *\n * If the menu is already added to the menu bar, it will be moved.\n */\n MenuBar.prototype.insertMenu = function (index, menu) {\n // Close the child menu before making changes.\n this._closeChildMenu();\n // Look up the index of the menu.\n var i = this._menus.indexOf(menu);\n // Clamp the insert index to the array bounds.\n var j = Math.max(0, Math.min(index, this._menus.length));\n // If the menu is not in the array, insert it.\n if (i === -1) {\n // Insert the menu into the array.\n algorithm.ArrayExt.insert(this._menus, j, menu);\n // Add the styling class to the menu.\n menu.addClass('lm-MenuBar-menu');\n /* */\n menu.addClass('p-MenuBar-menu');\n /* */\n // Connect to the menu signals.\n menu.aboutToClose.connect(this._onMenuAboutToClose, this);\n menu.menuRequested.connect(this._onMenuMenuRequested, this);\n menu.title.changed.connect(this._onTitleChanged, this);\n // Schedule an update of the items.\n this.update();\n // There is nothing more to do.\n return;\n }\n // Otherwise, the menu exists in the array and should be moved.\n // Adjust the index if the location is at the end of the array.\n if (j === this._menus.length) {\n j--;\n }\n // Bail if there is no effective move.\n if (i === j) {\n return;\n }\n // Move the menu to the new locations.\n algorithm.ArrayExt.move(this._menus, i, j);\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Remove a menu from the menu bar.\n *\n * @param menu - The menu to remove from the menu bar.\n *\n * #### Notes\n * This is a no-op if the menu is not in the menu bar.\n */\n MenuBar.prototype.removeMenu = function (menu) {\n this.removeMenuAt(this._menus.indexOf(menu));\n };\n /**\n * Remove the menu at a given index from the menu bar.\n *\n * @param index - The index of the menu to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n MenuBar.prototype.removeMenuAt = function (index) {\n // Close the child menu before making changes.\n this._closeChildMenu();\n // Remove the menu from the array.\n var menu = algorithm.ArrayExt.removeAt(this._menus, index);\n // Bail if the index is out of range.\n if (!menu) {\n return;\n }\n // Disconnect from the menu signals.\n menu.aboutToClose.disconnect(this._onMenuAboutToClose, this);\n menu.menuRequested.disconnect(this._onMenuMenuRequested, this);\n menu.title.changed.disconnect(this._onTitleChanged, this);\n // Remove the styling class from the menu.\n menu.removeClass('lm-MenuBar-menu');\n /* */\n menu.removeClass('p-MenuBar-menu');\n /* */\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Remove all menus from the menu bar.\n */\n MenuBar.prototype.clearMenus = function () {\n // Bail if there is nothing to remove.\n if (this._menus.length === 0) {\n return;\n }\n // Close the child menu before making changes.\n this._closeChildMenu();\n // Disconnect from the menu signals and remove the styling class.\n for (var _i = 0, _a = this._menus; _i < _a.length; _i++) {\n var menu = _a[_i];\n menu.aboutToClose.disconnect(this._onMenuAboutToClose, this);\n menu.menuRequested.disconnect(this._onMenuMenuRequested, this);\n menu.title.changed.disconnect(this._onTitleChanged, this);\n menu.removeClass('lm-MenuBar-menu');\n /* */\n menu.removeClass('p-MenuBar-menu');\n /* */\n }\n // Clear the menus array.\n this._menus.length = 0;\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Handle the DOM events for the menu bar.\n *\n * @param event - The DOM event sent to the menu bar.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the menu bar's DOM nodes. It\n * should not be called directly by user code.\n */\n MenuBar.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseleave':\n this._evtMouseLeave(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n MenuBar.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('keydown', this);\n this.node.addEventListener('mousedown', this);\n this.node.addEventListener('mousemove', this);\n this.node.addEventListener('mouseleave', this);\n this.node.addEventListener('contextmenu', this);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n MenuBar.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('keydown', this);\n this.node.removeEventListener('mousedown', this);\n this.node.removeEventListener('mousemove', this);\n this.node.removeEventListener('mouseleave', this);\n this.node.removeEventListener('contextmenu', this);\n this._closeChildMenu();\n };\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n MenuBar.prototype.onActivateRequest = function (msg) {\n if (this.isAttached) {\n this.node.focus();\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n MenuBar.prototype.onUpdateRequest = function (msg) {\n var menus = this._menus;\n var renderer = this.renderer;\n var activeIndex = this._activeIndex;\n var content = new Array(menus.length);\n for (var i = 0, n = menus.length; i < n; ++i) {\n var title = menus[i].title;\n var active = i === activeIndex;\n content[i] = renderer.renderItem({ title: title, active: active });\n }\n virtualdom.VirtualDOM.render(content, this.contentNode);\n };\n /**\n * Handle the `'keydown'` event for the menu bar.\n */\n MenuBar.prototype._evtKeyDown = function (event) {\n // A menu bar handles all keydown events.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the key code for the event.\n var kc = event.keyCode;\n // Enter, Up Arrow, Down Arrow\n if (kc === 13 || kc === 38 || kc === 40) {\n this.openActiveMenu();\n return;\n }\n // Escape\n if (kc === 27) {\n this._closeChildMenu();\n this.activeIndex = -1;\n this.node.blur();\n return;\n }\n // Left Arrow\n if (kc === 37) {\n var i = this._activeIndex;\n var n = this._menus.length;\n this.activeIndex = i === 0 ? n - 1 : i - 1;\n return;\n }\n // Right Arrow\n if (kc === 39) {\n var i = this._activeIndex;\n var n = this._menus.length;\n this.activeIndex = i === n - 1 ? 0 : i + 1;\n return;\n }\n // Get the pressed key character.\n var key = keyboard.getKeyboardLayout().keyForKeydownEvent(event);\n // Bail if the key is not valid.\n if (!key) {\n return;\n }\n // Search for the next best matching mnemonic item.\n var start = this._activeIndex + 1;\n var result = Private.findMnemonic(this._menus, key, start);\n // Handle the requested mnemonic based on the search results.\n // If exactly one mnemonic is matched, that menu is opened.\n // Otherwise, the next mnemonic is activated if available,\n // followed by the auto mnemonic if available.\n if (result.index !== -1 && !result.multiple) {\n this.activeIndex = result.index;\n this.openActiveMenu();\n }\n else if (result.index !== -1) {\n this.activeIndex = result.index;\n }\n else if (result.auto !== -1) {\n this.activeIndex = result.auto;\n }\n };\n /**\n * Handle the `'mousedown'` event for the menu bar.\n */\n MenuBar.prototype._evtMouseDown = function (event) {\n // Bail if the mouse press was not on the menu bar. This can occur\n // when the document listener is installed for an active menu bar.\n if (!domutils.ElementExt.hitTest(this.node, event.clientX, event.clientY)) {\n return;\n }\n // Stop the propagation of the event. Immediate propagation is\n // also stopped so that an open menu does not handle the event.\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n // Check if the mouse is over one of the menu items.\n var index = algorithm.ArrayExt.findFirstIndex(this.contentNode.children, function (node) {\n return domutils.ElementExt.hitTest(node, event.clientX, event.clientY);\n });\n // If the press was not on an item, close the child menu.\n if (index === -1) {\n this._closeChildMenu();\n return;\n }\n // If the press was not the left mouse button, do nothing further.\n if (event.button !== 0) {\n return;\n }\n // Otherwise, toggle the open state of the child menu.\n if (this._childMenu) {\n this._closeChildMenu();\n this.activeIndex = index;\n }\n else {\n this.activeIndex = index;\n this._openChildMenu();\n }\n };\n /**\n * Handle the `'mousemove'` event for the menu bar.\n */\n MenuBar.prototype._evtMouseMove = function (event) {\n // Check if the mouse is over one of the menu items.\n var index = algorithm.ArrayExt.findFirstIndex(this.contentNode.children, function (node) {\n return domutils.ElementExt.hitTest(node, event.clientX, event.clientY);\n });\n // Bail early if the active index will not change.\n if (index === this._activeIndex) {\n return;\n }\n // Bail early if a child menu is open and the mouse is not over\n // an item. This allows the child menu to be kept open when the\n // mouse is over the empty part of the menu bar.\n if (index === -1 && this._childMenu) {\n return;\n }\n // Update the active index to the hovered item.\n this.activeIndex = index;\n // Open the new menu if a menu is already open.\n if (this._childMenu) {\n this._openChildMenu();\n }\n };\n /**\n * Handle the `'mouseleave'` event for the menu bar.\n */\n MenuBar.prototype._evtMouseLeave = function (event) {\n // Reset the active index if there is no open menu.\n if (!this._childMenu) {\n this.activeIndex = -1;\n }\n };\n /**\n * Open the child menu at the active index immediately.\n *\n * If a different child menu is already open, it will be closed,\n * even if there is no active menu.\n */\n MenuBar.prototype._openChildMenu = function () {\n // If there is no active menu, close the current menu.\n var newMenu = this.activeMenu;\n if (!newMenu) {\n this._closeChildMenu();\n return;\n }\n // Bail if there is no effective menu change.\n var oldMenu = this._childMenu;\n if (oldMenu === newMenu) {\n return;\n }\n // Swap the internal menu reference.\n this._childMenu = newMenu;\n // Close the current menu, or setup for the new menu.\n if (oldMenu) {\n oldMenu.close();\n }\n else {\n this.addClass('lm-mod-active');\n /* */\n this.addClass('p-mod-active');\n /* */\n document.addEventListener('mousedown', this, true);\n }\n // Ensure the menu bar is updated and look up the item node.\n messaging.MessageLoop.sendMessage(this, widget.Widget.Msg.UpdateRequest);\n var itemNode = this.contentNode.children[this._activeIndex];\n // Get the positioning data for the new menu.\n var _a = itemNode.getBoundingClientRect(), left = _a.left, bottom = _a.bottom;\n // Open the new menu at the computed location.\n newMenu.open(left, bottom, { forceX: true, forceY: true });\n };\n /**\n * Close the child menu immediately.\n *\n * This is a no-op if a child menu is not open.\n */\n MenuBar.prototype._closeChildMenu = function () {\n // Bail if no child menu is open.\n if (!this._childMenu) {\n return;\n }\n // Remove the active class from the menu bar.\n this.removeClass('lm-mod-active');\n /* */\n this.removeClass('p-mod-active');\n /* */\n // Remove the document listeners.\n document.removeEventListener('mousedown', this, true);\n // Clear the internal menu reference.\n var menu = this._childMenu;\n this._childMenu = null;\n // Close the menu.\n menu.close();\n // Reset the active index.\n this.activeIndex = -1;\n };\n /**\n * Handle the `aboutToClose` signal of a menu.\n */\n MenuBar.prototype._onMenuAboutToClose = function (sender) {\n // Bail if the sender is not the child menu.\n if (sender !== this._childMenu) {\n return;\n }\n // Remove the active class from the menu bar.\n this.removeClass('lm-mod-active');\n /* */\n this.removeClass('p-mod-active');\n /* */\n // Remove the document listeners.\n document.removeEventListener('mousedown', this, true);\n // Clear the internal menu reference.\n this._childMenu = null;\n // Reset the active index.\n this.activeIndex = -1;\n };\n /**\n * Handle the `menuRequested` signal of a child menu.\n */\n MenuBar.prototype._onMenuMenuRequested = function (sender, args) {\n // Bail if the sender is not the child menu.\n if (sender !== this._childMenu) {\n return;\n }\n // Look up the active index and menu count.\n var i = this._activeIndex;\n var n = this._menus.length;\n // Active the next requested index.\n switch (args) {\n case 'next':\n this.activeIndex = i === n - 1 ? 0 : i + 1;\n break;\n case 'previous':\n this.activeIndex = i === 0 ? n - 1 : i - 1;\n break;\n }\n // Open the active menu.\n this.openActiveMenu();\n };\n /**\n * Handle the `changed` signal of a title object.\n */\n MenuBar.prototype._onTitleChanged = function () {\n this.update();\n };\n return MenuBar;\n}(widget.Widget));\n/**\n * The namespace for the `MenuBar` class statics.\n */\n(function (MenuBar) {\n /**\n * The default implementation of `IRenderer`.\n *\n * #### Notes\n * Subclasses are free to reimplement rendering methods as needed.\n */\n var Renderer = /** @class */ (function () {\n /**\n * Construct a new renderer.\n */\n function Renderer() {\n }\n /**\n * Render the virtual element for a menu bar item.\n *\n * @param data - The data to use for rendering the item.\n *\n * @returns A virtual element representing the item.\n */\n Renderer.prototype.renderItem = function (data) {\n var className = this.createItemClass(data);\n var dataset = this.createItemDataset(data);\n return (virtualdom.h.li({ className: className, dataset: dataset }, this.renderIcon(data), this.renderLabel(data)));\n };\n /**\n * Render the icon element for a menu bar item.\n *\n * @param data - The data to use for rendering the icon.\n *\n * @returns A virtual element representing the item icon.\n */\n Renderer.prototype.renderIcon = function (data) {\n var className = this.createIconClass(data);\n /* */\n if (typeof data.title.icon === 'string') {\n return virtualdom.h.div({ className: className }, data.title.iconLabel);\n }\n /* */\n // if data.title.icon is undefined, it will be ignored\n return virtualdom.h.div({ className: className }, data.title.icon, data.title.iconLabel);\n };\n /**\n * Render the label element for a menu item.\n *\n * @param data - The data to use for rendering the label.\n *\n * @returns A virtual element representing the item label.\n */\n Renderer.prototype.renderLabel = function (data) {\n var content = this.formatLabel(data);\n return virtualdom.h.div({ className: 'lm-MenuBar-itemLabel'\n /* */\n + ' p-MenuBar-itemLabel'\n /* */\n }, content);\n };\n /**\n * Create the class name for the menu bar item.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the menu item.\n */\n Renderer.prototype.createItemClass = function (data) {\n var name = 'lm-MenuBar-item';\n /* */\n name += ' p-MenuBar-item';\n /* */\n if (data.title.className) {\n name += \" \" + data.title.className;\n }\n if (data.active) {\n name += ' lm-mod-active';\n /* */\n name += ' p-mod-active';\n /* */\n }\n return name;\n };\n /**\n * Create the dataset for a menu bar item.\n *\n * @param data - The data to use for the item.\n *\n * @returns The dataset for the menu bar item.\n */\n Renderer.prototype.createItemDataset = function (data) {\n return data.title.dataset;\n };\n /**\n * Create the class name for the menu bar item icon.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the item icon.\n */\n Renderer.prototype.createIconClass = function (data) {\n var name = 'lm-MenuBar-itemIcon';\n /* */\n name += ' p-MenuBar-itemIcon';\n /* */\n var extra = data.title.iconClass;\n return extra ? name + \" \" + extra : name;\n };\n /**\n * Create the render content for the label node.\n *\n * @param data - The data to use for the label content.\n *\n * @returns The content to add to the label node.\n */\n Renderer.prototype.formatLabel = function (data) {\n // Fetch the label text and mnemonic index.\n var _a = data.title, label = _a.label, mnemonic = _a.mnemonic;\n // If the index is out of range, do not modify the label.\n if (mnemonic < 0 || mnemonic >= label.length) {\n return label;\n }\n // Split the label into parts.\n var prefix = label.slice(0, mnemonic);\n var suffix = label.slice(mnemonic + 1);\n var char = label[mnemonic];\n // Wrap the mnemonic character in a span.\n var span = virtualdom.h.span({\n className: 'lm-MenuBar-itemMnemonic'\n /* */\n + ' p-MenuBar-itemMnemonic'\n /* */\n }, char);\n // Return the content parts.\n return [prefix, span, suffix];\n };\n return Renderer;\n }());\n MenuBar.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n MenuBar.defaultRenderer = new Renderer();\n})(exports.MenuBar || (exports.MenuBar = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create the DOM node for a menu bar.\n */\n function createNode() {\n var node = document.createElement('div');\n var content = document.createElement('ul');\n content.className = 'lm-MenuBar-content';\n /* */\n content.classList.add('p-MenuBar-content');\n /* */\n node.appendChild(content);\n node.tabIndex = -1;\n return node;\n }\n Private.createNode = createNode;\n /**\n * Find the best matching mnemonic item.\n *\n * The search starts at the given index and wraps around.\n */\n function findMnemonic(menus, key, start) {\n // Setup the result variables.\n var index = -1;\n var auto = -1;\n var multiple = false;\n // Normalize the key to upper case.\n var upperKey = key.toUpperCase();\n // Search the items from the given start index.\n for (var i = 0, n = menus.length; i < n; ++i) {\n // Compute the wrapped index.\n var k = (i + start) % n;\n // Look up the menu title.\n var title = menus[k].title;\n // Ignore titles with an empty label.\n if (title.label.length === 0) {\n continue;\n }\n // Look up the mnemonic index for the label.\n var mn = title.mnemonic;\n // Handle a valid mnemonic index.\n if (mn >= 0 && mn < title.label.length) {\n if (title.label[mn].toUpperCase() === upperKey) {\n if (index === -1) {\n index = k;\n }\n else {\n multiple = true;\n }\n }\n continue;\n }\n // Finally, handle the auto index if possible.\n if (auto === -1 && title.label[0].toUpperCase() === upperKey) {\n auto = k;\n }\n }\n // Return the search results.\n return { index: index, multiple: multiple, auto: auto };\n }\n Private.findMnemonic = findMnemonic;\n})(Private || (Private = {}));\n//# sourceMappingURL=menubar.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/menubar.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar virtualdom = __webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar keyboard = __webpack_require__(/*! @lumino/keyboard */ \"../../packages/keyboard/dist/index.js\");\n\n/**\n * A widget which displays menus as a canonical menu bar.\n */\nexports.MenuBar = /** @class */ (function (_super) {\n tslib.__extends(MenuBar, _super);\n /**\n * Construct a new menu bar.\n *\n * @param options - The options for initializing the menu bar.\n */\n function MenuBar(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._activeIndex = -1;\n _this._menus = [];\n _this._childMenu = null;\n _this.addClass('lm-MenuBar');\n /* */\n _this.addClass('p-MenuBar');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n _this.renderer = options.renderer || MenuBar.defaultRenderer;\n return _this;\n }\n /**\n * Dispose of the resources held by the widget.\n */\n MenuBar.prototype.dispose = function () {\n this._closeChildMenu();\n this._menus.length = 0;\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(MenuBar.prototype, \"childMenu\", {\n /**\n * The child menu of the menu bar.\n *\n * #### Notes\n * This will be `null` if the menu bar does not have an open menu.\n */\n get: function () {\n return this._childMenu;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuBar.prototype, \"contentNode\", {\n /**\n * Get the menu bar content node.\n *\n * #### Notes\n * This is the node which holds the menu title nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-MenuBar-content')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuBar.prototype, \"activeMenu\", {\n /**\n * Get the currently active menu.\n */\n get: function () {\n return this._menus[this._activeIndex] || null;\n },\n /**\n * Set the currently active menu.\n *\n * #### Notes\n * If the menu does not exist, the menu will be set to `null`.\n */\n set: function (value) {\n this.activeIndex = value ? this._menus.indexOf(value) : -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuBar.prototype, \"activeIndex\", {\n /**\n * Get the index of the currently active menu.\n *\n * #### Notes\n * This will be `-1` if no menu is active.\n */\n get: function () {\n return this._activeIndex;\n },\n /**\n * Set the index of the currently active menu.\n *\n * #### Notes\n * If the menu cannot be activated, the index will be set to `-1`.\n */\n set: function (value) {\n // Adjust the value for an out of range index.\n if (value < 0 || value >= this._menus.length) {\n value = -1;\n }\n // Bail early if the index will not change.\n if (this._activeIndex === value) {\n return;\n }\n // Update the active index.\n this._activeIndex = value;\n // Schedule an update of the items.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuBar.prototype, \"menus\", {\n /**\n * A read-only array of the menus in the menu bar.\n */\n get: function () {\n return this._menus;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Open the active menu and activate its first menu item.\n *\n * #### Notes\n * If there is no active menu, this is a no-op.\n */\n MenuBar.prototype.openActiveMenu = function () {\n // Bail early if there is no active item.\n if (this._activeIndex === -1) {\n return;\n }\n // Open the child menu.\n this._openChildMenu();\n // Activate the first item in the child menu.\n if (this._childMenu) {\n this._childMenu.activeIndex = -1;\n this._childMenu.activateNextItem();\n }\n };\n /**\n * Add a menu to the end of the menu bar.\n *\n * @param menu - The menu to add to the menu bar.\n *\n * #### Notes\n * If the menu is already added to the menu bar, it will be moved.\n */\n MenuBar.prototype.addMenu = function (menu) {\n this.insertMenu(this._menus.length, menu);\n };\n /**\n * Insert a menu into the menu bar at the specified index.\n *\n * @param index - The index at which to insert the menu.\n *\n * @param menu - The menu to insert into the menu bar.\n *\n * #### Notes\n * The index will be clamped to the bounds of the menus.\n *\n * If the menu is already added to the menu bar, it will be moved.\n */\n MenuBar.prototype.insertMenu = function (index, menu) {\n // Close the child menu before making changes.\n this._closeChildMenu();\n // Look up the index of the menu.\n var i = this._menus.indexOf(menu);\n // Clamp the insert index to the array bounds.\n var j = Math.max(0, Math.min(index, this._menus.length));\n // If the menu is not in the array, insert it.\n if (i === -1) {\n // Insert the menu into the array.\n algorithm.ArrayExt.insert(this._menus, j, menu);\n // Add the styling class to the menu.\n menu.addClass('lm-MenuBar-menu');\n /* */\n menu.addClass('p-MenuBar-menu');\n /* */\n // Connect to the menu signals.\n menu.aboutToClose.connect(this._onMenuAboutToClose, this);\n menu.menuRequested.connect(this._onMenuMenuRequested, this);\n menu.title.changed.connect(this._onTitleChanged, this);\n // Schedule an update of the items.\n this.update();\n // There is nothing more to do.\n return;\n }\n // Otherwise, the menu exists in the array and should be moved.\n // Adjust the index if the location is at the end of the array.\n if (j === this._menus.length) {\n j--;\n }\n // Bail if there is no effective move.\n if (i === j) {\n return;\n }\n // Move the menu to the new locations.\n algorithm.ArrayExt.move(this._menus, i, j);\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Remove a menu from the menu bar.\n *\n * @param menu - The menu to remove from the menu bar.\n *\n * #### Notes\n * This is a no-op if the menu is not in the menu bar.\n */\n MenuBar.prototype.removeMenu = function (menu) {\n this.removeMenuAt(this._menus.indexOf(menu));\n };\n /**\n * Remove the menu at a given index from the menu bar.\n *\n * @param index - The index of the menu to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n MenuBar.prototype.removeMenuAt = function (index) {\n // Close the child menu before making changes.\n this._closeChildMenu();\n // Remove the menu from the array.\n var menu = algorithm.ArrayExt.removeAt(this._menus, index);\n // Bail if the index is out of range.\n if (!menu) {\n return;\n }\n // Disconnect from the menu signals.\n menu.aboutToClose.disconnect(this._onMenuAboutToClose, this);\n menu.menuRequested.disconnect(this._onMenuMenuRequested, this);\n menu.title.changed.disconnect(this._onTitleChanged, this);\n // Remove the styling class from the menu.\n menu.removeClass('lm-MenuBar-menu');\n /* */\n menu.removeClass('p-MenuBar-menu');\n /* */\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Remove all menus from the menu bar.\n */\n MenuBar.prototype.clearMenus = function () {\n // Bail if there is nothing to remove.\n if (this._menus.length === 0) {\n return;\n }\n // Close the child menu before making changes.\n this._closeChildMenu();\n // Disconnect from the menu signals and remove the styling class.\n for (var _i = 0, _a = this._menus; _i < _a.length; _i++) {\n var menu = _a[_i];\n menu.aboutToClose.disconnect(this._onMenuAboutToClose, this);\n menu.menuRequested.disconnect(this._onMenuMenuRequested, this);\n menu.title.changed.disconnect(this._onTitleChanged, this);\n menu.removeClass('lm-MenuBar-menu');\n /* */\n menu.removeClass('p-MenuBar-menu');\n /* */\n }\n // Clear the menus array.\n this._menus.length = 0;\n // Schedule an update of the items.\n this.update();\n };\n /**\n * Handle the DOM events for the menu bar.\n *\n * @param event - The DOM event sent to the menu bar.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the menu bar's DOM nodes. It\n * should not be called directly by user code.\n */\n MenuBar.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseleave':\n this._evtMouseLeave(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n MenuBar.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('keydown', this);\n this.node.addEventListener('mousedown', this);\n this.node.addEventListener('mousemove', this);\n this.node.addEventListener('mouseleave', this);\n this.node.addEventListener('contextmenu', this);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n MenuBar.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('keydown', this);\n this.node.removeEventListener('mousedown', this);\n this.node.removeEventListener('mousemove', this);\n this.node.removeEventListener('mouseleave', this);\n this.node.removeEventListener('contextmenu', this);\n this._closeChildMenu();\n };\n /**\n * A message handler invoked on an `'activate-request'` message.\n */\n MenuBar.prototype.onActivateRequest = function (msg) {\n if (this.isAttached) {\n this.node.focus();\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n MenuBar.prototype.onUpdateRequest = function (msg) {\n var menus = this._menus;\n var renderer = this.renderer;\n var activeIndex = this._activeIndex;\n var content = new Array(menus.length);\n for (var i = 0, n = menus.length; i < n; ++i) {\n var title = menus[i].title;\n var active = i === activeIndex;\n content[i] = renderer.renderItem({ title: title, active: active });\n }\n virtualdom.VirtualDOM.render(content, this.contentNode);\n };\n /**\n * Handle the `'keydown'` event for the menu bar.\n */\n MenuBar.prototype._evtKeyDown = function (event) {\n // A menu bar handles all keydown events.\n event.preventDefault();\n event.stopPropagation();\n // Fetch the key code for the event.\n var kc = event.keyCode;\n // Enter, Up Arrow, Down Arrow\n if (kc === 13 || kc === 38 || kc === 40) {\n this.openActiveMenu();\n return;\n }\n // Escape\n if (kc === 27) {\n this._closeChildMenu();\n this.activeIndex = -1;\n this.node.blur();\n return;\n }\n // Left Arrow\n if (kc === 37) {\n var i = this._activeIndex;\n var n = this._menus.length;\n this.activeIndex = i === 0 ? n - 1 : i - 1;\n return;\n }\n // Right Arrow\n if (kc === 39) {\n var i = this._activeIndex;\n var n = this._menus.length;\n this.activeIndex = i === n - 1 ? 0 : i + 1;\n return;\n }\n // Get the pressed key character.\n var key = keyboard.getKeyboardLayout().keyForKeydownEvent(event);\n // Bail if the key is not valid.\n if (!key) {\n return;\n }\n // Search for the next best matching mnemonic item.\n var start = this._activeIndex + 1;\n var result = Private.findMnemonic(this._menus, key, start);\n // Handle the requested mnemonic based on the search results.\n // If exactly one mnemonic is matched, that menu is opened.\n // Otherwise, the next mnemonic is activated if available,\n // followed by the auto mnemonic if available.\n if (result.index !== -1 && !result.multiple) {\n this.activeIndex = result.index;\n this.openActiveMenu();\n }\n else if (result.index !== -1) {\n this.activeIndex = result.index;\n }\n else if (result.auto !== -1) {\n this.activeIndex = result.auto;\n }\n };\n /**\n * Handle the `'mousedown'` event for the menu bar.\n */\n MenuBar.prototype._evtMouseDown = function (event) {\n // Bail if the mouse press was not on the menu bar. This can occur\n // when the document listener is installed for an active menu bar.\n if (!domutils.ElementExt.hitTest(this.node, event.clientX, event.clientY)) {\n return;\n }\n // Stop the propagation of the event. Immediate propagation is\n // also stopped so that an open menu does not handle the event.\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n // Check if the mouse is over one of the menu items.\n var index = algorithm.ArrayExt.findFirstIndex(this.contentNode.children, function (node) {\n return domutils.ElementExt.hitTest(node, event.clientX, event.clientY);\n });\n // If the press was not on an item, close the child menu.\n if (index === -1) {\n this._closeChildMenu();\n return;\n }\n // If the press was not the left mouse button, do nothing further.\n if (event.button !== 0) {\n return;\n }\n // Otherwise, toggle the open state of the child menu.\n if (this._childMenu) {\n this._closeChildMenu();\n this.activeIndex = index;\n }\n else {\n this.activeIndex = index;\n this._openChildMenu();\n }\n };\n /**\n * Handle the `'mousemove'` event for the menu bar.\n */\n MenuBar.prototype._evtMouseMove = function (event) {\n // Check if the mouse is over one of the menu items.\n var index = algorithm.ArrayExt.findFirstIndex(this.contentNode.children, function (node) {\n return domutils.ElementExt.hitTest(node, event.clientX, event.clientY);\n });\n // Bail early if the active index will not change.\n if (index === this._activeIndex) {\n return;\n }\n // Bail early if a child menu is open and the mouse is not over\n // an item. This allows the child menu to be kept open when the\n // mouse is over the empty part of the menu bar.\n if (index === -1 && this._childMenu) {\n return;\n }\n // Update the active index to the hovered item.\n this.activeIndex = index;\n // Open the new menu if a menu is already open.\n if (this._childMenu) {\n this._openChildMenu();\n }\n };\n /**\n * Handle the `'mouseleave'` event for the menu bar.\n */\n MenuBar.prototype._evtMouseLeave = function (event) {\n // Reset the active index if there is no open menu.\n if (!this._childMenu) {\n this.activeIndex = -1;\n }\n };\n /**\n * Open the child menu at the active index immediately.\n *\n * If a different child menu is already open, it will be closed,\n * even if there is no active menu.\n */\n MenuBar.prototype._openChildMenu = function () {\n // If there is no active menu, close the current menu.\n var newMenu = this.activeMenu;\n if (!newMenu) {\n this._closeChildMenu();\n return;\n }\n // Bail if there is no effective menu change.\n var oldMenu = this._childMenu;\n if (oldMenu === newMenu) {\n return;\n }\n // Swap the internal menu reference.\n this._childMenu = newMenu;\n // Close the current menu, or setup for the new menu.\n if (oldMenu) {\n oldMenu.close();\n }\n else {\n this.addClass('lm-mod-active');\n /* */\n this.addClass('p-mod-active');\n /* */\n document.addEventListener('mousedown', this, true);\n }\n // Ensure the menu bar is updated and look up the item node.\n messaging.MessageLoop.sendMessage(this, widget.Widget.Msg.UpdateRequest);\n var itemNode = this.contentNode.children[this._activeIndex];\n // Get the positioning data for the new menu.\n var _a = itemNode.getBoundingClientRect(), left = _a.left, bottom = _a.bottom;\n // Open the new menu at the computed location.\n newMenu.open(left, bottom, { forceX: true, forceY: true });\n };\n /**\n * Close the child menu immediately.\n *\n * This is a no-op if a child menu is not open.\n */\n MenuBar.prototype._closeChildMenu = function () {\n // Bail if no child menu is open.\n if (!this._childMenu) {\n return;\n }\n // Remove the active class from the menu bar.\n this.removeClass('lm-mod-active');\n /* */\n this.removeClass('p-mod-active');\n /* */\n // Remove the document listeners.\n document.removeEventListener('mousedown', this, true);\n // Clear the internal menu reference.\n var menu = this._childMenu;\n this._childMenu = null;\n // Close the menu.\n menu.close();\n // Reset the active index.\n this.activeIndex = -1;\n };\n /**\n * Handle the `aboutToClose` signal of a menu.\n */\n MenuBar.prototype._onMenuAboutToClose = function (sender) {\n // Bail if the sender is not the child menu.\n if (sender !== this._childMenu) {\n return;\n }\n // Remove the active class from the menu bar.\n this.removeClass('lm-mod-active');\n /* */\n this.removeClass('p-mod-active');\n /* */\n // Remove the document listeners.\n document.removeEventListener('mousedown', this, true);\n // Clear the internal menu reference.\n this._childMenu = null;\n // Reset the active index.\n this.activeIndex = -1;\n };\n /**\n * Handle the `menuRequested` signal of a child menu.\n */\n MenuBar.prototype._onMenuMenuRequested = function (sender, args) {\n // Bail if the sender is not the child menu.\n if (sender !== this._childMenu) {\n return;\n }\n // Look up the active index and menu count.\n var i = this._activeIndex;\n var n = this._menus.length;\n // Active the next requested index.\n switch (args) {\n case 'next':\n this.activeIndex = i === n - 1 ? 0 : i + 1;\n break;\n case 'previous':\n this.activeIndex = i === 0 ? n - 1 : i - 1;\n break;\n }\n // Open the active menu.\n this.openActiveMenu();\n };\n /**\n * Handle the `changed` signal of a title object.\n */\n MenuBar.prototype._onTitleChanged = function () {\n this.update();\n };\n return MenuBar;\n}(widget.Widget));\n/**\n * The namespace for the `MenuBar` class statics.\n */\n(function (MenuBar) {\n /**\n * The default implementation of `IRenderer`.\n *\n * #### Notes\n * Subclasses are free to reimplement rendering methods as needed.\n */\n var Renderer = /** @class */ (function () {\n /**\n * Construct a new renderer.\n */\n function Renderer() {\n }\n /**\n * Render the virtual element for a menu bar item.\n *\n * @param data - The data to use for rendering the item.\n *\n * @returns A virtual element representing the item.\n */\n Renderer.prototype.renderItem = function (data) {\n var className = this.createItemClass(data);\n var dataset = this.createItemDataset(data);\n return (virtualdom.h.li({ className: className, dataset: dataset }, this.renderIcon(data), this.renderLabel(data)));\n };\n /**\n * Render the icon element for a menu bar item.\n *\n * @param data - The data to use for rendering the icon.\n *\n * @returns A virtual element representing the item icon.\n */\n Renderer.prototype.renderIcon = function (data) {\n var className = this.createIconClass(data);\n /* */\n if (typeof data.title.icon === 'string') {\n return virtualdom.h.div({ className: className }, data.title.iconLabel);\n }\n /* */\n // if data.title.icon is undefined, it will be ignored\n return virtualdom.h.div({ className: className }, data.title.icon, data.title.iconLabel);\n };\n /**\n * Render the label element for a menu item.\n *\n * @param data - The data to use for rendering the label.\n *\n * @returns A virtual element representing the item label.\n */\n Renderer.prototype.renderLabel = function (data) {\n var content = this.formatLabel(data);\n return virtualdom.h.div({ className: 'lm-MenuBar-itemLabel'\n /* */\n + ' p-MenuBar-itemLabel'\n /* */\n }, content);\n };\n /**\n * Create the class name for the menu bar item.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the menu item.\n */\n Renderer.prototype.createItemClass = function (data) {\n var name = 'lm-MenuBar-item';\n /* */\n name += ' p-MenuBar-item';\n /* */\n if (data.title.className) {\n name += \" \" + data.title.className;\n }\n if (data.active) {\n name += ' lm-mod-active';\n /* */\n name += ' p-mod-active';\n /* */\n }\n return name;\n };\n /**\n * Create the dataset for a menu bar item.\n *\n * @param data - The data to use for the item.\n *\n * @returns The dataset for the menu bar item.\n */\n Renderer.prototype.createItemDataset = function (data) {\n return data.title.dataset;\n };\n /**\n * Create the class name for the menu bar item icon.\n *\n * @param data - The data to use for the class name.\n *\n * @returns The full class name for the item icon.\n */\n Renderer.prototype.createIconClass = function (data) {\n var name = 'lm-MenuBar-itemIcon';\n /* */\n name += ' p-MenuBar-itemIcon';\n /* */\n var extra = data.title.iconClass;\n return extra ? name + \" \" + extra : name;\n };\n /**\n * Create the render content for the label node.\n *\n * @param data - The data to use for the label content.\n *\n * @returns The content to add to the label node.\n */\n Renderer.prototype.formatLabel = function (data) {\n // Fetch the label text and mnemonic index.\n var _a = data.title, label = _a.label, mnemonic = _a.mnemonic;\n // If the index is out of range, do not modify the label.\n if (mnemonic < 0 || mnemonic >= label.length) {\n return label;\n }\n // Split the label into parts.\n var prefix = label.slice(0, mnemonic);\n var suffix = label.slice(mnemonic + 1);\n var char = label[mnemonic];\n // Wrap the mnemonic character in a span.\n var span = virtualdom.h.span({\n className: 'lm-MenuBar-itemMnemonic'\n /* */\n + ' p-MenuBar-itemMnemonic'\n /* */\n }, char);\n // Return the content parts.\n return [prefix, span, suffix];\n };\n return Renderer;\n }());\n MenuBar.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n MenuBar.defaultRenderer = new Renderer();\n})(exports.MenuBar || (exports.MenuBar = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create the DOM node for a menu bar.\n */\n function createNode() {\n var node = document.createElement('div');\n var content = document.createElement('ul');\n content.className = 'lm-MenuBar-content';\n /* */\n content.classList.add('p-MenuBar-content');\n /* */\n node.appendChild(content);\n node.tabIndex = -1;\n return node;\n }\n Private.createNode = createNode;\n /**\n * Find the best matching mnemonic item.\n *\n * The search starts at the given index and wraps around.\n */\n function findMnemonic(menus, key, start) {\n // Setup the result variables.\n var index = -1;\n var auto = -1;\n var multiple = false;\n // Normalize the key to upper case.\n var upperKey = key.toUpperCase();\n // Search the items from the given start index.\n for (var i = 0, n = menus.length; i < n; ++i) {\n // Compute the wrapped index.\n var k = (i + start) % n;\n // Look up the menu title.\n var title = menus[k].title;\n // Ignore titles with an empty label.\n if (title.label.length === 0) {\n continue;\n }\n // Look up the mnemonic index for the label.\n var mn = title.mnemonic;\n // Handle a valid mnemonic index.\n if (mn >= 0 && mn < title.label.length) {\n if (title.label[mn].toUpperCase() === upperKey) {\n if (index === -1) {\n index = k;\n }\n else {\n multiple = true;\n }\n }\n continue;\n }\n // Finally, handle the auto index if possible.\n if (auto === -1 && title.label[0].toUpperCase() === upperKey) {\n auto = k;\n }\n }\n // Return the search results.\n return { index: index, multiple: multiple, auto: auto };\n }\n Private.findMnemonic = findMnemonic;\n})(Private || (Private = {}));\n//# sourceMappingURL=menubar.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/menubar.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/panel.js": │ │ │ │ /*!*****************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/panel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/panel.js ***! │ │ │ │ \*****************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\n\n/**\n * A simple and convenient panel widget class.\n *\n * #### Notes\n * This class is suitable as a base class for implementing a variety of\n * convenience panel widgets, but can also be used directly with CSS to\n * arrange a collection of widgets.\n *\n * This class provides a convenience wrapper around a [[PanelLayout]].\n */\nvar Panel = /** @class */ (function (_super) {\n tslib.__extends(Panel, _super);\n /**\n * Construct a new panel.\n *\n * @param options - The options for initializing the panel.\n */\n function Panel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this.addClass('lm-Panel');\n /* */\n _this.addClass('p-Panel');\n /* */\n _this.layout = Private.createLayout(options);\n return _this;\n }\n Object.defineProperty(Panel.prototype, \"widgets\", {\n /**\n * A read-only array of the widgets in the panel.\n */\n get: function () {\n return this.layout.widgets;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add a widget to the end of the panel.\n *\n * @param widget - The widget to add to the panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n */\n Panel.prototype.addWidget = function (widget) {\n this.layout.addWidget(widget);\n };\n /**\n * Insert a widget at the specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into to the panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n */\n Panel.prototype.insertWidget = function (index, widget) {\n this.layout.insertWidget(index, widget);\n };\n return Panel;\n}(widget.Widget));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a panel layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new panellayout.PanelLayout();\n }\n Private.createLayout = createLayout;\n})(Private || (Private = {}));\n\nexports.Panel = Panel;\n//# sourceMappingURL=panel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/panel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\n\n/**\n * A simple and convenient panel widget class.\n *\n * #### Notes\n * This class is suitable as a base class for implementing a variety of\n * convenience panel widgets, but can also be used directly with CSS to\n * arrange a collection of widgets.\n *\n * This class provides a convenience wrapper around a [[PanelLayout]].\n */\nvar Panel = /** @class */ (function (_super) {\n tslib.__extends(Panel, _super);\n /**\n * Construct a new panel.\n *\n * @param options - The options for initializing the panel.\n */\n function Panel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this.addClass('lm-Panel');\n /* */\n _this.addClass('p-Panel');\n /* */\n _this.layout = Private.createLayout(options);\n return _this;\n }\n Object.defineProperty(Panel.prototype, \"widgets\", {\n /**\n * A read-only array of the widgets in the panel.\n */\n get: function () {\n return this.layout.widgets;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add a widget to the end of the panel.\n *\n * @param widget - The widget to add to the panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n */\n Panel.prototype.addWidget = function (widget) {\n this.layout.addWidget(widget);\n };\n /**\n * Insert a widget at the specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into to the panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n */\n Panel.prototype.insertWidget = function (index, widget) {\n this.layout.insertWidget(index, widget);\n };\n return Panel;\n}(widget.Widget));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a panel layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new panellayout.PanelLayout();\n }\n Private.createLayout = createLayout;\n})(Private || (Private = {}));\n\nexports.Panel = Panel;\n//# sourceMappingURL=panel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/panel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/panellayout.js": │ │ │ │ /*!***********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/panellayout.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/panellayout.js ***! │ │ │ │ \***********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n\n/**\n * A concrete layout implementation suitable for many use cases.\n *\n * #### Notes\n * This class is suitable as a base class for implementing a variety of\n * layouts, but can also be used directly with standard CSS to layout a\n * collection of widgets.\n */\nvar PanelLayout = /** @class */ (function (_super) {\n tslib.__extends(PanelLayout, _super);\n function PanelLayout() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._widgets = [];\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n *\n * #### Notes\n * This will clear and dispose all widgets in the layout.\n *\n * All reimplementations should call the superclass method.\n *\n * This method is called automatically when the parent is disposed.\n */\n PanelLayout.prototype.dispose = function () {\n while (this._widgets.length > 0) {\n this._widgets.pop().dispose();\n }\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(PanelLayout.prototype, \"widgets\", {\n /**\n * A read-only array of the widgets in the layout.\n */\n get: function () {\n return this._widgets;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n */\n PanelLayout.prototype.iter = function () {\n return algorithm.iter(this._widgets);\n };\n /**\n * Add a widget to the end of the layout.\n *\n * @param widget - The widget to add to the layout.\n *\n * #### Notes\n * If the widget is already contained in the layout, it will be moved.\n */\n PanelLayout.prototype.addWidget = function (widget) {\n this.insertWidget(this._widgets.length, widget);\n };\n /**\n * Insert a widget into the layout at the specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into the layout.\n *\n * #### Notes\n * The index will be clamped to the bounds of the widgets.\n *\n * If the widget is already added to the layout, it will be moved.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n */\n PanelLayout.prototype.insertWidget = function (index, widget) {\n // Remove the widget from its current parent. This is a no-op\n // if the widget's parent is already the layout parent widget.\n widget.parent = this.parent;\n // Look up the current index of the widget.\n var i = this._widgets.indexOf(widget);\n // Clamp the insert index to the array bounds.\n var j = Math.max(0, Math.min(index, this._widgets.length));\n // If the widget is not in the array, insert it.\n if (i === -1) {\n // Insert the widget into the array.\n algorithm.ArrayExt.insert(this._widgets, j, widget);\n // If the layout is parented, attach the widget to the DOM.\n if (this.parent) {\n this.attachWidget(j, widget);\n }\n // There is nothing more to do.\n return;\n }\n // Otherwise, the widget exists in the array and should be moved.\n // Adjust the index if the location is at the end of the array.\n if (j === this._widgets.length) {\n j--;\n }\n // Bail if there is no effective move.\n if (i === j) {\n return;\n }\n // Move the widget to the new location.\n algorithm.ArrayExt.move(this._widgets, i, j);\n // If the layout is parented, move the widget in the DOM.\n if (this.parent) {\n this.moveWidget(i, j, widget);\n }\n };\n /**\n * Remove a widget from the layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n PanelLayout.prototype.removeWidget = function (widget) {\n this.removeWidgetAt(this._widgets.indexOf(widget));\n };\n /**\n * Remove the widget at a given index from the layout.\n *\n * @param index - The index of the widget to remove.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n */\n PanelLayout.prototype.removeWidgetAt = function (index) {\n // Remove the widget from the array.\n var widget = algorithm.ArrayExt.removeAt(this._widgets, index);\n // If the layout is parented, detach the widget from the DOM.\n if (widget && this.parent) {\n this.detachWidget(index, widget);\n }\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n PanelLayout.prototype.init = function () {\n var _this = this;\n _super.prototype.init.call(this);\n algorithm.each(this, function (widget, index) {\n _this.attachWidget(index, widget);\n });\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This method is called automatically by the panel layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation adds the widgets's node to the parent's\n * node at the proper location, and sends the appropriate attach\n * messages to the widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is added to the parent's node.\n */\n PanelLayout.prototype.attachWidget = function (index, widget$1) {\n // Look up the next sibling reference node.\n var ref = this.parent.node.children[index];\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Insert the widget's node before the sibling.\n this.parent.node.insertBefore(widget$1.node, ref);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n };\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This method is called automatically by the panel layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation moves the widget's node to the proper\n * location in the parent's node and sends the appropriate attach and\n * detach messages to the widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is moved in the parent's node.\n */\n PanelLayout.prototype.moveWidget = function (fromIndex, toIndex, widget$1) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` and message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Look up the next sibling reference node.\n var ref = this.parent.node.children[toIndex];\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Insert the widget's node before the sibling.\n this.parent.node.insertBefore(widget$1.node, ref);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This method is called automatically by the panel layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation removes the widget's node from the\n * parent's node, and sends the appropriate detach messages to the\n * widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is removed from the parent's node.\n */\n PanelLayout.prototype.detachWidget = function (index, widget$1) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n };\n return PanelLayout;\n}(layout.Layout));\n\nexports.PanelLayout = PanelLayout;\n//# sourceMappingURL=panellayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/panellayout.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n\n/**\n * A concrete layout implementation suitable for many use cases.\n *\n * #### Notes\n * This class is suitable as a base class for implementing a variety of\n * layouts, but can also be used directly with standard CSS to layout a\n * collection of widgets.\n */\nvar PanelLayout = /** @class */ (function (_super) {\n tslib.__extends(PanelLayout, _super);\n function PanelLayout() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._widgets = [];\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n *\n * #### Notes\n * This will clear and dispose all widgets in the layout.\n *\n * All reimplementations should call the superclass method.\n *\n * This method is called automatically when the parent is disposed.\n */\n PanelLayout.prototype.dispose = function () {\n while (this._widgets.length > 0) {\n this._widgets.pop().dispose();\n }\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(PanelLayout.prototype, \"widgets\", {\n /**\n * A read-only array of the widgets in the layout.\n */\n get: function () {\n return this._widgets;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n */\n PanelLayout.prototype.iter = function () {\n return algorithm.iter(this._widgets);\n };\n /**\n * Add a widget to the end of the layout.\n *\n * @param widget - The widget to add to the layout.\n *\n * #### Notes\n * If the widget is already contained in the layout, it will be moved.\n */\n PanelLayout.prototype.addWidget = function (widget) {\n this.insertWidget(this._widgets.length, widget);\n };\n /**\n * Insert a widget into the layout at the specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into the layout.\n *\n * #### Notes\n * The index will be clamped to the bounds of the widgets.\n *\n * If the widget is already added to the layout, it will be moved.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n */\n PanelLayout.prototype.insertWidget = function (index, widget) {\n // Remove the widget from its current parent. This is a no-op\n // if the widget's parent is already the layout parent widget.\n widget.parent = this.parent;\n // Look up the current index of the widget.\n var i = this._widgets.indexOf(widget);\n // Clamp the insert index to the array bounds.\n var j = Math.max(0, Math.min(index, this._widgets.length));\n // If the widget is not in the array, insert it.\n if (i === -1) {\n // Insert the widget into the array.\n algorithm.ArrayExt.insert(this._widgets, j, widget);\n // If the layout is parented, attach the widget to the DOM.\n if (this.parent) {\n this.attachWidget(j, widget);\n }\n // There is nothing more to do.\n return;\n }\n // Otherwise, the widget exists in the array and should be moved.\n // Adjust the index if the location is at the end of the array.\n if (j === this._widgets.length) {\n j--;\n }\n // Bail if there is no effective move.\n if (i === j) {\n return;\n }\n // Move the widget to the new location.\n algorithm.ArrayExt.move(this._widgets, i, j);\n // If the layout is parented, move the widget in the DOM.\n if (this.parent) {\n this.moveWidget(i, j, widget);\n }\n };\n /**\n * Remove a widget from the layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n PanelLayout.prototype.removeWidget = function (widget) {\n this.removeWidgetAt(this._widgets.indexOf(widget));\n };\n /**\n * Remove the widget at a given index from the layout.\n *\n * @param index - The index of the widget to remove.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n *\n * #### Undefined Behavior\n * An `index` which is non-integral.\n */\n PanelLayout.prototype.removeWidgetAt = function (index) {\n // Remove the widget from the array.\n var widget = algorithm.ArrayExt.removeAt(this._widgets, index);\n // If the layout is parented, detach the widget from the DOM.\n if (widget && this.parent) {\n this.detachWidget(index, widget);\n }\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n PanelLayout.prototype.init = function () {\n var _this = this;\n _super.prototype.init.call(this);\n algorithm.each(this, function (widget, index) {\n _this.attachWidget(index, widget);\n });\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This method is called automatically by the panel layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation adds the widgets's node to the parent's\n * node at the proper location, and sends the appropriate attach\n * messages to the widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is added to the parent's node.\n */\n PanelLayout.prototype.attachWidget = function (index, widget$1) {\n // Look up the next sibling reference node.\n var ref = this.parent.node.children[index];\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Insert the widget's node before the sibling.\n this.parent.node.insertBefore(widget$1.node, ref);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n };\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This method is called automatically by the panel layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation moves the widget's node to the proper\n * location in the parent's node and sends the appropriate attach and\n * detach messages to the widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is moved in the parent's node.\n */\n PanelLayout.prototype.moveWidget = function (fromIndex, toIndex, widget$1) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` and message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Look up the next sibling reference node.\n var ref = this.parent.node.children[toIndex];\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Insert the widget's node before the sibling.\n this.parent.node.insertBefore(widget$1.node, ref);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This method is called automatically by the panel layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation removes the widget's node from the\n * parent's node, and sends the appropriate detach messages to the\n * widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is removed from the parent's node.\n */\n PanelLayout.prototype.detachWidget = function (index, widget$1) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n };\n return PanelLayout;\n}(layout.Layout));\n\nexports.PanelLayout = PanelLayout;\n//# sourceMappingURL=panellayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/panellayout.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/scrollbar.js": │ │ │ │ /*!*********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/scrollbar.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/scrollbar.js ***! │ │ │ │ \*********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\n\n/**\n * A widget which implements a canonical scroll bar.\n */\nvar ScrollBar = /** @class */ (function (_super) {\n tslib.__extends(ScrollBar, _super);\n /**\n * Construct a new scroll bar.\n *\n * @param options - The options for initializing the scroll bar.\n */\n function ScrollBar(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n /**\n * A timeout callback for repeating the mouse press.\n */\n _this._onRepeat = function () {\n // Clear the repeat timer id.\n _this._repeatTimer = -1;\n // Bail if the mouse has been released.\n if (!_this._pressData) {\n return;\n }\n // Look up the part that was pressed.\n var part = _this._pressData.part;\n // Bail if the thumb was pressed.\n if (part === 'thumb') {\n return;\n }\n // Schedule the timer for another repeat.\n _this._repeatTimer = window.setTimeout(_this._onRepeat, 20);\n // Get the current mouse position.\n var mouseX = _this._pressData.mouseX;\n var mouseY = _this._pressData.mouseY;\n // Handle a decrement button repeat.\n if (part === 'decrement') {\n // Bail if the mouse is not over the button.\n if (!domutils.ElementExt.hitTest(_this.decrementNode, mouseX, mouseY)) {\n return;\n }\n // Emit the step requested signal.\n _this._stepRequested.emit('decrement');\n // Finished.\n return;\n }\n // Handle an increment button repeat.\n if (part === 'increment') {\n // Bail if the mouse is not over the button.\n if (!domutils.ElementExt.hitTest(_this.incrementNode, mouseX, mouseY)) {\n return;\n }\n // Emit the step requested signal.\n _this._stepRequested.emit('increment');\n // Finished.\n return;\n }\n // Handle a track repeat.\n if (part === 'track') {\n // Bail if the mouse is not over the track.\n if (!domutils.ElementExt.hitTest(_this.trackNode, mouseX, mouseY)) {\n return;\n }\n // Fetch the thumb node.\n var thumbNode = _this.thumbNode;\n // Bail if the mouse is over the thumb.\n if (domutils.ElementExt.hitTest(thumbNode, mouseX, mouseY)) {\n return;\n }\n // Fetch the client rect for the thumb.\n var thumbRect = thumbNode.getBoundingClientRect();\n // Determine the direction for the page request.\n var dir = void 0;\n if (_this._orientation === 'horizontal') {\n dir = mouseX < thumbRect.left ? 'decrement' : 'increment';\n }\n else {\n dir = mouseY < thumbRect.top ? 'decrement' : 'increment';\n }\n // Emit the page requested signal.\n _this._pageRequested.emit(dir);\n // Finished.\n return;\n }\n };\n _this._value = 0;\n _this._page = 10;\n _this._maximum = 100;\n _this._repeatTimer = -1;\n _this._pressData = null;\n _this._thumbMoved = new signaling.Signal(_this);\n _this._stepRequested = new signaling.Signal(_this);\n _this._pageRequested = new signaling.Signal(_this);\n _this.addClass('lm-ScrollBar');\n /* */\n _this.addClass('p-ScrollBar');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n // Set the orientation.\n _this._orientation = options.orientation || 'vertical';\n _this.dataset['orientation'] = _this._orientation;\n // Parse the rest of the options.\n if (options.maximum !== undefined) {\n _this._maximum = Math.max(0, options.maximum);\n }\n if (options.page !== undefined) {\n _this._page = Math.max(0, options.page);\n }\n if (options.value !== undefined) {\n _this._value = Math.max(0, Math.min(options.value, _this._maximum));\n }\n return _this;\n }\n Object.defineProperty(ScrollBar.prototype, \"thumbMoved\", {\n /**\n * A signal emitted when the user moves the scroll thumb.\n *\n * #### Notes\n * The payload is the current value of the scroll bar.\n */\n get: function () {\n return this._thumbMoved;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"stepRequested\", {\n /**\n * A signal emitted when the user clicks a step button.\n *\n * #### Notes\n * The payload is whether a decrease or increase is requested.\n */\n get: function () {\n return this._stepRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"pageRequested\", {\n /**\n * A signal emitted when the user clicks the scroll track.\n *\n * #### Notes\n * The payload is whether a decrease or increase is requested.\n */\n get: function () {\n return this._pageRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"orientation\", {\n /**\n * Get the orientation of the scroll bar.\n */\n get: function () {\n return this._orientation;\n },\n /**\n * Set the orientation of the scroll bar.\n */\n set: function (value) {\n // Do nothing if the orientation does not change.\n if (this._orientation === value) {\n return;\n }\n // Release the mouse before making changes.\n this._releaseMouse();\n // Update the internal orientation.\n this._orientation = value;\n this.dataset['orientation'] = value;\n // Schedule an update the scroll bar.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"value\", {\n /**\n * Get the current value of the scroll bar.\n */\n get: function () {\n return this._value;\n },\n /**\n * Set the current value of the scroll bar.\n *\n * #### Notes\n * The value will be clamped to the range `[0, maximum]`.\n */\n set: function (value) {\n // Clamp the value to the allowable range.\n value = Math.max(0, Math.min(value, this._maximum));\n // Do nothing if the value does not change.\n if (this._value === value) {\n return;\n }\n // Update the internal value.\n this._value = value;\n // Schedule an update the scroll bar.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"page\", {\n /**\n * Get the page size of the scroll bar.\n *\n * #### Notes\n * The page size is the amount of visible content in the scrolled\n * region, expressed in data units. It determines the size of the\n * scroll bar thumb.\n */\n get: function () {\n return this._page;\n },\n /**\n * Set the page size of the scroll bar.\n *\n * #### Notes\n * The page size will be clamped to the range `[0, Infinity]`.\n */\n set: function (value) {\n // Clamp the page size to the allowable range.\n value = Math.max(0, value);\n // Do nothing if the value does not change.\n if (this._page === value) {\n return;\n }\n // Update the internal page size.\n this._page = value;\n // Schedule an update the scroll bar.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"maximum\", {\n /**\n * Get the maximum value of the scroll bar.\n */\n get: function () {\n return this._maximum;\n },\n /**\n * Set the maximum value of the scroll bar.\n *\n * #### Notes\n * The max size will be clamped to the range `[0, Infinity]`.\n */\n set: function (value) {\n // Clamp the value to the allowable range.\n value = Math.max(0, value);\n // Do nothing if the value does not change.\n if (this._maximum === value) {\n return;\n }\n // Update the internal values.\n this._maximum = value;\n // Clamp the current value to the new range.\n this._value = Math.min(this._value, value);\n // Schedule an update the scroll bar.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"decrementNode\", {\n /**\n * The scroll bar decrement button node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-ScrollBar-button')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"incrementNode\", {\n /**\n * The scroll bar increment button node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-ScrollBar-button')[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"trackNode\", {\n /**\n * The scroll bar track node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-ScrollBar-track')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"thumbNode\", {\n /**\n * The scroll bar thumb node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-ScrollBar-thumb')[0];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Handle the DOM events for the scroll bar.\n *\n * @param event - The DOM event sent to the scroll bar.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the scroll bar's DOM node.\n *\n * This should not be called directly by user code.\n */\n ScrollBar.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A method invoked on a 'before-attach' message.\n */\n ScrollBar.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('mousedown', this);\n this.update();\n };\n /**\n * A method invoked on an 'after-detach' message.\n */\n ScrollBar.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('mousedown', this);\n this._releaseMouse();\n };\n /**\n * A method invoked on an 'update-request' message.\n */\n ScrollBar.prototype.onUpdateRequest = function (msg) {\n // Convert the value and page into percentages.\n var value = this._value * 100 / this._maximum;\n var page = this._page * 100 / (this._page + this._maximum);\n // Clamp the value and page to the relevant range.\n value = Math.max(0, Math.min(value, 100));\n page = Math.max(0, Math.min(page, 100));\n // Fetch the thumb style.\n var thumbStyle = this.thumbNode.style;\n // Update the thumb style for the current orientation.\n if (this._orientation === 'horizontal') {\n thumbStyle.top = '';\n thumbStyle.height = '';\n thumbStyle.left = value + \"%\";\n thumbStyle.width = page + \"%\";\n thumbStyle.transform = \"translate(\" + -value + \"%, 0%)\";\n }\n else {\n thumbStyle.left = '';\n thumbStyle.width = '';\n thumbStyle.top = value + \"%\";\n thumbStyle.height = page + \"%\";\n thumbStyle.transform = \"translate(0%, \" + -value + \"%)\";\n }\n };\n /**\n * Handle the `'keydown'` event for the scroll bar.\n */\n ScrollBar.prototype._evtKeyDown = function (event) {\n // Stop all input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Ignore anything except the `Escape` key.\n if (event.keyCode !== 27) {\n return;\n }\n // Fetch the previous scroll value.\n var value = this._pressData ? this._pressData.value : -1;\n // Release the mouse.\n this._releaseMouse();\n // Restore the old scroll value if possible.\n if (value !== -1) {\n this._moveThumb(value);\n }\n };\n /**\n * Handle the `'mousedown'` event for the scroll bar.\n */\n ScrollBar.prototype._evtMouseDown = function (event) {\n // Do nothing if it's not a left mouse press.\n if (event.button !== 0) {\n return;\n }\n // Send an activate request to the scroll bar. This can be\n // used by message hooks to activate something relevant.\n this.activate();\n // Do nothing if the mouse is already captured.\n if (this._pressData) {\n return;\n }\n // Find the pressed scroll bar part.\n var part = Private.findPart(this, event.target);\n // Do nothing if the part is not of interest.\n if (!part) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Override the mouse cursor.\n var override = dragdrop.Drag.overrideCursor('default');\n // Set up the press data.\n this._pressData = {\n part: part, override: override,\n delta: -1, value: -1,\n mouseX: event.clientX,\n mouseY: event.clientY\n };\n // Add the extra event listeners.\n document.addEventListener('mousemove', this, true);\n document.addEventListener('mouseup', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('contextmenu', this, true);\n // Handle a thumb press.\n if (part === 'thumb') {\n // Fetch the thumb node.\n var thumbNode = this.thumbNode;\n // Fetch the client rect for the thumb.\n var thumbRect = thumbNode.getBoundingClientRect();\n // Update the press data delta for the current orientation.\n if (this._orientation === 'horizontal') {\n this._pressData.delta = event.clientX - thumbRect.left;\n }\n else {\n this._pressData.delta = event.clientY - thumbRect.top;\n }\n // Add the active class to the thumb node.\n thumbNode.classList.add('lm-mod-active');\n /* */\n thumbNode.classList.add('p-mod-active');\n /* */\n // Store the current value in the press data.\n this._pressData.value = this._value;\n // Finished.\n return;\n }\n // Handle a track press.\n if (part === 'track') {\n // Fetch the client rect for the thumb.\n var thumbRect = this.thumbNode.getBoundingClientRect();\n // Determine the direction for the page request.\n var dir = void 0;\n if (this._orientation === 'horizontal') {\n dir = event.clientX < thumbRect.left ? 'decrement' : 'increment';\n }\n else {\n dir = event.clientY < thumbRect.top ? 'decrement' : 'increment';\n }\n // Start the repeat timer.\n this._repeatTimer = window.setTimeout(this._onRepeat, 350);\n // Emit the page requested signal.\n this._pageRequested.emit(dir);\n // Finished.\n return;\n }\n // Handle a decrement button press.\n if (part === 'decrement') {\n // Add the active class to the decrement node.\n this.decrementNode.classList.add('lm-mod-active');\n /* */\n this.decrementNode.classList.add('p-mod-active');\n /* */\n // Start the repeat timer.\n this._repeatTimer = window.setTimeout(this._onRepeat, 350);\n // Emit the step requested signal.\n this._stepRequested.emit('decrement');\n // Finished.\n return;\n }\n // Handle an increment button press.\n if (part === 'increment') {\n // Add the active class to the increment node.\n this.incrementNode.classList.add('lm-mod-active');\n /* */\n this.incrementNode.classList.add('p-mod-active');\n /* */\n // Start the repeat timer.\n this._repeatTimer = window.setTimeout(this._onRepeat, 350);\n // Emit the step requested signal.\n this._stepRequested.emit('increment');\n // Finished.\n return;\n }\n };\n /**\n * Handle the `'mousemove'` event for the scroll bar.\n */\n ScrollBar.prototype._evtMouseMove = function (event) {\n // Do nothing if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Update the mouse position.\n this._pressData.mouseX = event.clientX;\n this._pressData.mouseY = event.clientY;\n // Bail if the thumb is not being dragged.\n if (this._pressData.part !== 'thumb') {\n return;\n }\n // Get the client rect for the thumb and track.\n var thumbRect = this.thumbNode.getBoundingClientRect();\n var trackRect = this.trackNode.getBoundingClientRect();\n // Fetch the scroll geometry based on the orientation.\n var trackPos;\n var trackSpan;\n if (this._orientation === 'horizontal') {\n trackPos = event.clientX - trackRect.left - this._pressData.delta;\n trackSpan = trackRect.width - thumbRect.width;\n }\n else {\n trackPos = event.clientY - trackRect.top - this._pressData.delta;\n trackSpan = trackRect.height - thumbRect.height;\n }\n // Compute the desired value from the scroll geometry.\n var value = trackSpan === 0 ? 0 : trackPos * this._maximum / trackSpan;\n // Move the thumb to the computed value.\n this._moveThumb(value);\n };\n /**\n * Handle the `'mouseup'` event for the scroll bar.\n */\n ScrollBar.prototype._evtMouseUp = function (event) {\n // Do nothing if it's not a left mouse release.\n if (event.button !== 0) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse.\n this._releaseMouse();\n };\n /**\n * Release the mouse and restore the node states.\n */\n ScrollBar.prototype._releaseMouse = function () {\n // Bail if there is no press data.\n if (!this._pressData) {\n return;\n }\n // Clear the repeat timer.\n clearTimeout(this._repeatTimer);\n this._repeatTimer = -1;\n // Clear the press data.\n this._pressData.override.dispose();\n this._pressData = null;\n // Remove the extra event listeners.\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('contextmenu', this, true);\n // Remove the active classes from the nodes.\n this.thumbNode.classList.remove('lm-mod-active');\n this.decrementNode.classList.remove('lm-mod-active');\n this.incrementNode.classList.remove('lm-mod-active');\n /* */\n this.thumbNode.classList.remove('p-mod-active');\n this.decrementNode.classList.remove('p-mod-active');\n this.incrementNode.classList.remove('p-mod-active');\n /* */\n };\n /**\n * Move the thumb to the specified position.\n */\n ScrollBar.prototype._moveThumb = function (value) {\n // Clamp the value to the allowed range.\n value = Math.max(0, Math.min(value, this._maximum));\n // Bail if the value does not change.\n if (this._value === value) {\n return;\n }\n // Update the internal value.\n this._value = value;\n // Schedule an update of the scroll bar.\n this.update();\n // Emit the thumb moved signal.\n this._thumbMoved.emit(value);\n };\n return ScrollBar;\n}(widget.Widget));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create the DOM node for a scroll bar.\n */\n function createNode() {\n var node = document.createElement('div');\n var decrement = document.createElement('div');\n var increment = document.createElement('div');\n var track = document.createElement('div');\n var thumb = document.createElement('div');\n decrement.className = 'lm-ScrollBar-button';\n increment.className = 'lm-ScrollBar-button';\n decrement.dataset['action'] = 'decrement';\n increment.dataset['action'] = 'increment';\n track.className = 'lm-ScrollBar-track';\n thumb.className = 'lm-ScrollBar-thumb';\n /* */\n decrement.classList.add('p-ScrollBar-button');\n increment.classList.add('p-ScrollBar-button');\n track.classList.add('p-ScrollBar-track');\n thumb.classList.add('p-ScrollBar-thumb');\n /* */\n track.appendChild(thumb);\n node.appendChild(decrement);\n node.appendChild(track);\n node.appendChild(increment);\n return node;\n }\n Private.createNode = createNode;\n /**\n * Find the scroll bar part which contains the given target.\n */\n function findPart(scrollBar, target) {\n // Test the thumb.\n if (scrollBar.thumbNode.contains(target)) {\n return 'thumb';\n }\n // Test the track.\n if (scrollBar.trackNode.contains(target)) {\n return 'track';\n }\n // Test the decrement button.\n if (scrollBar.decrementNode.contains(target)) {\n return 'decrement';\n }\n // Test the increment button.\n if (scrollBar.incrementNode.contains(target)) {\n return 'increment';\n }\n // Indicate no match.\n return null;\n }\n Private.findPart = findPart;\n})(Private || (Private = {}));\n\nexports.ScrollBar = ScrollBar;\n//# sourceMappingURL=scrollbar.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/scrollbar.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\n\n/**\n * A widget which implements a canonical scroll bar.\n */\nvar ScrollBar = /** @class */ (function (_super) {\n tslib.__extends(ScrollBar, _super);\n /**\n * Construct a new scroll bar.\n *\n * @param options - The options for initializing the scroll bar.\n */\n function ScrollBar(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n /**\n * A timeout callback for repeating the mouse press.\n */\n _this._onRepeat = function () {\n // Clear the repeat timer id.\n _this._repeatTimer = -1;\n // Bail if the mouse has been released.\n if (!_this._pressData) {\n return;\n }\n // Look up the part that was pressed.\n var part = _this._pressData.part;\n // Bail if the thumb was pressed.\n if (part === 'thumb') {\n return;\n }\n // Schedule the timer for another repeat.\n _this._repeatTimer = window.setTimeout(_this._onRepeat, 20);\n // Get the current mouse position.\n var mouseX = _this._pressData.mouseX;\n var mouseY = _this._pressData.mouseY;\n // Handle a decrement button repeat.\n if (part === 'decrement') {\n // Bail if the mouse is not over the button.\n if (!domutils.ElementExt.hitTest(_this.decrementNode, mouseX, mouseY)) {\n return;\n }\n // Emit the step requested signal.\n _this._stepRequested.emit('decrement');\n // Finished.\n return;\n }\n // Handle an increment button repeat.\n if (part === 'increment') {\n // Bail if the mouse is not over the button.\n if (!domutils.ElementExt.hitTest(_this.incrementNode, mouseX, mouseY)) {\n return;\n }\n // Emit the step requested signal.\n _this._stepRequested.emit('increment');\n // Finished.\n return;\n }\n // Handle a track repeat.\n if (part === 'track') {\n // Bail if the mouse is not over the track.\n if (!domutils.ElementExt.hitTest(_this.trackNode, mouseX, mouseY)) {\n return;\n }\n // Fetch the thumb node.\n var thumbNode = _this.thumbNode;\n // Bail if the mouse is over the thumb.\n if (domutils.ElementExt.hitTest(thumbNode, mouseX, mouseY)) {\n return;\n }\n // Fetch the client rect for the thumb.\n var thumbRect = thumbNode.getBoundingClientRect();\n // Determine the direction for the page request.\n var dir = void 0;\n if (_this._orientation === 'horizontal') {\n dir = mouseX < thumbRect.left ? 'decrement' : 'increment';\n }\n else {\n dir = mouseY < thumbRect.top ? 'decrement' : 'increment';\n }\n // Emit the page requested signal.\n _this._pageRequested.emit(dir);\n // Finished.\n return;\n }\n };\n _this._value = 0;\n _this._page = 10;\n _this._maximum = 100;\n _this._repeatTimer = -1;\n _this._pressData = null;\n _this._thumbMoved = new signaling.Signal(_this);\n _this._stepRequested = new signaling.Signal(_this);\n _this._pageRequested = new signaling.Signal(_this);\n _this.addClass('lm-ScrollBar');\n /* */\n _this.addClass('p-ScrollBar');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n // Set the orientation.\n _this._orientation = options.orientation || 'vertical';\n _this.dataset['orientation'] = _this._orientation;\n // Parse the rest of the options.\n if (options.maximum !== undefined) {\n _this._maximum = Math.max(0, options.maximum);\n }\n if (options.page !== undefined) {\n _this._page = Math.max(0, options.page);\n }\n if (options.value !== undefined) {\n _this._value = Math.max(0, Math.min(options.value, _this._maximum));\n }\n return _this;\n }\n Object.defineProperty(ScrollBar.prototype, \"thumbMoved\", {\n /**\n * A signal emitted when the user moves the scroll thumb.\n *\n * #### Notes\n * The payload is the current value of the scroll bar.\n */\n get: function () {\n return this._thumbMoved;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"stepRequested\", {\n /**\n * A signal emitted when the user clicks a step button.\n *\n * #### Notes\n * The payload is whether a decrease or increase is requested.\n */\n get: function () {\n return this._stepRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"pageRequested\", {\n /**\n * A signal emitted when the user clicks the scroll track.\n *\n * #### Notes\n * The payload is whether a decrease or increase is requested.\n */\n get: function () {\n return this._pageRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"orientation\", {\n /**\n * Get the orientation of the scroll bar.\n */\n get: function () {\n return this._orientation;\n },\n /**\n * Set the orientation of the scroll bar.\n */\n set: function (value) {\n // Do nothing if the orientation does not change.\n if (this._orientation === value) {\n return;\n }\n // Release the mouse before making changes.\n this._releaseMouse();\n // Update the internal orientation.\n this._orientation = value;\n this.dataset['orientation'] = value;\n // Schedule an update the scroll bar.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"value\", {\n /**\n * Get the current value of the scroll bar.\n */\n get: function () {\n return this._value;\n },\n /**\n * Set the current value of the scroll bar.\n *\n * #### Notes\n * The value will be clamped to the range `[0, maximum]`.\n */\n set: function (value) {\n // Clamp the value to the allowable range.\n value = Math.max(0, Math.min(value, this._maximum));\n // Do nothing if the value does not change.\n if (this._value === value) {\n return;\n }\n // Update the internal value.\n this._value = value;\n // Schedule an update the scroll bar.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"page\", {\n /**\n * Get the page size of the scroll bar.\n *\n * #### Notes\n * The page size is the amount of visible content in the scrolled\n * region, expressed in data units. It determines the size of the\n * scroll bar thumb.\n */\n get: function () {\n return this._page;\n },\n /**\n * Set the page size of the scroll bar.\n *\n * #### Notes\n * The page size will be clamped to the range `[0, Infinity]`.\n */\n set: function (value) {\n // Clamp the page size to the allowable range.\n value = Math.max(0, value);\n // Do nothing if the value does not change.\n if (this._page === value) {\n return;\n }\n // Update the internal page size.\n this._page = value;\n // Schedule an update the scroll bar.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"maximum\", {\n /**\n * Get the maximum value of the scroll bar.\n */\n get: function () {\n return this._maximum;\n },\n /**\n * Set the maximum value of the scroll bar.\n *\n * #### Notes\n * The max size will be clamped to the range `[0, Infinity]`.\n */\n set: function (value) {\n // Clamp the value to the allowable range.\n value = Math.max(0, value);\n // Do nothing if the value does not change.\n if (this._maximum === value) {\n return;\n }\n // Update the internal values.\n this._maximum = value;\n // Clamp the current value to the new range.\n this._value = Math.min(this._value, value);\n // Schedule an update the scroll bar.\n this.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"decrementNode\", {\n /**\n * The scroll bar decrement button node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-ScrollBar-button')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"incrementNode\", {\n /**\n * The scroll bar increment button node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-ScrollBar-button')[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"trackNode\", {\n /**\n * The scroll bar track node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-ScrollBar-track')[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ScrollBar.prototype, \"thumbNode\", {\n /**\n * The scroll bar thumb node.\n *\n * #### Notes\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-ScrollBar-thumb')[0];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Handle the DOM events for the scroll bar.\n *\n * @param event - The DOM event sent to the scroll bar.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the scroll bar's DOM node.\n *\n * This should not be called directly by user code.\n */\n ScrollBar.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A method invoked on a 'before-attach' message.\n */\n ScrollBar.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('mousedown', this);\n this.update();\n };\n /**\n * A method invoked on an 'after-detach' message.\n */\n ScrollBar.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('mousedown', this);\n this._releaseMouse();\n };\n /**\n * A method invoked on an 'update-request' message.\n */\n ScrollBar.prototype.onUpdateRequest = function (msg) {\n // Convert the value and page into percentages.\n var value = this._value * 100 / this._maximum;\n var page = this._page * 100 / (this._page + this._maximum);\n // Clamp the value and page to the relevant range.\n value = Math.max(0, Math.min(value, 100));\n page = Math.max(0, Math.min(page, 100));\n // Fetch the thumb style.\n var thumbStyle = this.thumbNode.style;\n // Update the thumb style for the current orientation.\n if (this._orientation === 'horizontal') {\n thumbStyle.top = '';\n thumbStyle.height = '';\n thumbStyle.left = value + \"%\";\n thumbStyle.width = page + \"%\";\n thumbStyle.transform = \"translate(\" + -value + \"%, 0%)\";\n }\n else {\n thumbStyle.left = '';\n thumbStyle.width = '';\n thumbStyle.top = value + \"%\";\n thumbStyle.height = page + \"%\";\n thumbStyle.transform = \"translate(0%, \" + -value + \"%)\";\n }\n };\n /**\n * Handle the `'keydown'` event for the scroll bar.\n */\n ScrollBar.prototype._evtKeyDown = function (event) {\n // Stop all input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Ignore anything except the `Escape` key.\n if (event.keyCode !== 27) {\n return;\n }\n // Fetch the previous scroll value.\n var value = this._pressData ? this._pressData.value : -1;\n // Release the mouse.\n this._releaseMouse();\n // Restore the old scroll value if possible.\n if (value !== -1) {\n this._moveThumb(value);\n }\n };\n /**\n * Handle the `'mousedown'` event for the scroll bar.\n */\n ScrollBar.prototype._evtMouseDown = function (event) {\n // Do nothing if it's not a left mouse press.\n if (event.button !== 0) {\n return;\n }\n // Send an activate request to the scroll bar. This can be\n // used by message hooks to activate something relevant.\n this.activate();\n // Do nothing if the mouse is already captured.\n if (this._pressData) {\n return;\n }\n // Find the pressed scroll bar part.\n var part = Private.findPart(this, event.target);\n // Do nothing if the part is not of interest.\n if (!part) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Override the mouse cursor.\n var override = dragdrop.Drag.overrideCursor('default');\n // Set up the press data.\n this._pressData = {\n part: part, override: override,\n delta: -1, value: -1,\n mouseX: event.clientX,\n mouseY: event.clientY\n };\n // Add the extra event listeners.\n document.addEventListener('mousemove', this, true);\n document.addEventListener('mouseup', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('contextmenu', this, true);\n // Handle a thumb press.\n if (part === 'thumb') {\n // Fetch the thumb node.\n var thumbNode = this.thumbNode;\n // Fetch the client rect for the thumb.\n var thumbRect = thumbNode.getBoundingClientRect();\n // Update the press data delta for the current orientation.\n if (this._orientation === 'horizontal') {\n this._pressData.delta = event.clientX - thumbRect.left;\n }\n else {\n this._pressData.delta = event.clientY - thumbRect.top;\n }\n // Add the active class to the thumb node.\n thumbNode.classList.add('lm-mod-active');\n /* */\n thumbNode.classList.add('p-mod-active');\n /* */\n // Store the current value in the press data.\n this._pressData.value = this._value;\n // Finished.\n return;\n }\n // Handle a track press.\n if (part === 'track') {\n // Fetch the client rect for the thumb.\n var thumbRect = this.thumbNode.getBoundingClientRect();\n // Determine the direction for the page request.\n var dir = void 0;\n if (this._orientation === 'horizontal') {\n dir = event.clientX < thumbRect.left ? 'decrement' : 'increment';\n }\n else {\n dir = event.clientY < thumbRect.top ? 'decrement' : 'increment';\n }\n // Start the repeat timer.\n this._repeatTimer = window.setTimeout(this._onRepeat, 350);\n // Emit the page requested signal.\n this._pageRequested.emit(dir);\n // Finished.\n return;\n }\n // Handle a decrement button press.\n if (part === 'decrement') {\n // Add the active class to the decrement node.\n this.decrementNode.classList.add('lm-mod-active');\n /* */\n this.decrementNode.classList.add('p-mod-active');\n /* */\n // Start the repeat timer.\n this._repeatTimer = window.setTimeout(this._onRepeat, 350);\n // Emit the step requested signal.\n this._stepRequested.emit('decrement');\n // Finished.\n return;\n }\n // Handle an increment button press.\n if (part === 'increment') {\n // Add the active class to the increment node.\n this.incrementNode.classList.add('lm-mod-active');\n /* */\n this.incrementNode.classList.add('p-mod-active');\n /* */\n // Start the repeat timer.\n this._repeatTimer = window.setTimeout(this._onRepeat, 350);\n // Emit the step requested signal.\n this._stepRequested.emit('increment');\n // Finished.\n return;\n }\n };\n /**\n * Handle the `'mousemove'` event for the scroll bar.\n */\n ScrollBar.prototype._evtMouseMove = function (event) {\n // Do nothing if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Update the mouse position.\n this._pressData.mouseX = event.clientX;\n this._pressData.mouseY = event.clientY;\n // Bail if the thumb is not being dragged.\n if (this._pressData.part !== 'thumb') {\n return;\n }\n // Get the client rect for the thumb and track.\n var thumbRect = this.thumbNode.getBoundingClientRect();\n var trackRect = this.trackNode.getBoundingClientRect();\n // Fetch the scroll geometry based on the orientation.\n var trackPos;\n var trackSpan;\n if (this._orientation === 'horizontal') {\n trackPos = event.clientX - trackRect.left - this._pressData.delta;\n trackSpan = trackRect.width - thumbRect.width;\n }\n else {\n trackPos = event.clientY - trackRect.top - this._pressData.delta;\n trackSpan = trackRect.height - thumbRect.height;\n }\n // Compute the desired value from the scroll geometry.\n var value = trackSpan === 0 ? 0 : trackPos * this._maximum / trackSpan;\n // Move the thumb to the computed value.\n this._moveThumb(value);\n };\n /**\n * Handle the `'mouseup'` event for the scroll bar.\n */\n ScrollBar.prototype._evtMouseUp = function (event) {\n // Do nothing if it's not a left mouse release.\n if (event.button !== 0) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse.\n this._releaseMouse();\n };\n /**\n * Release the mouse and restore the node states.\n */\n ScrollBar.prototype._releaseMouse = function () {\n // Bail if there is no press data.\n if (!this._pressData) {\n return;\n }\n // Clear the repeat timer.\n clearTimeout(this._repeatTimer);\n this._repeatTimer = -1;\n // Clear the press data.\n this._pressData.override.dispose();\n this._pressData = null;\n // Remove the extra event listeners.\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('contextmenu', this, true);\n // Remove the active classes from the nodes.\n this.thumbNode.classList.remove('lm-mod-active');\n this.decrementNode.classList.remove('lm-mod-active');\n this.incrementNode.classList.remove('lm-mod-active');\n /* */\n this.thumbNode.classList.remove('p-mod-active');\n this.decrementNode.classList.remove('p-mod-active');\n this.incrementNode.classList.remove('p-mod-active');\n /* */\n };\n /**\n * Move the thumb to the specified position.\n */\n ScrollBar.prototype._moveThumb = function (value) {\n // Clamp the value to the allowed range.\n value = Math.max(0, Math.min(value, this._maximum));\n // Bail if the value does not change.\n if (this._value === value) {\n return;\n }\n // Update the internal value.\n this._value = value;\n // Schedule an update of the scroll bar.\n this.update();\n // Emit the thumb moved signal.\n this._thumbMoved.emit(value);\n };\n return ScrollBar;\n}(widget.Widget));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create the DOM node for a scroll bar.\n */\n function createNode() {\n var node = document.createElement('div');\n var decrement = document.createElement('div');\n var increment = document.createElement('div');\n var track = document.createElement('div');\n var thumb = document.createElement('div');\n decrement.className = 'lm-ScrollBar-button';\n increment.className = 'lm-ScrollBar-button';\n decrement.dataset['action'] = 'decrement';\n increment.dataset['action'] = 'increment';\n track.className = 'lm-ScrollBar-track';\n thumb.className = 'lm-ScrollBar-thumb';\n /* */\n decrement.classList.add('p-ScrollBar-button');\n increment.classList.add('p-ScrollBar-button');\n track.classList.add('p-ScrollBar-track');\n thumb.classList.add('p-ScrollBar-thumb');\n /* */\n track.appendChild(thumb);\n node.appendChild(decrement);\n node.appendChild(track);\n node.appendChild(increment);\n return node;\n }\n Private.createNode = createNode;\n /**\n * Find the scroll bar part which contains the given target.\n */\n function findPart(scrollBar, target) {\n // Test the thumb.\n if (scrollBar.thumbNode.contains(target)) {\n return 'thumb';\n }\n // Test the track.\n if (scrollBar.trackNode.contains(target)) {\n return 'track';\n }\n // Test the decrement button.\n if (scrollBar.decrementNode.contains(target)) {\n return 'decrement';\n }\n // Test the increment button.\n if (scrollBar.incrementNode.contains(target)) {\n return 'increment';\n }\n // Indicate no match.\n return null;\n }\n Private.findPart = findPart;\n})(Private || (Private = {}));\n\nexports.ScrollBar = ScrollBar;\n//# sourceMappingURL=scrollbar.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/scrollbar.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/singletonlayout.js": │ │ │ │ /*!***************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/singletonlayout.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/singletonlayout.js ***! │ │ │ │ \***************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n\n/**\n * A concrete layout implementation which holds a single widget.\n *\n * #### Notes\n * This class is useful for creating simple container widgets which\n * hold a single child. The child should be positioned with CSS.\n */\nvar SingletonLayout = /** @class */ (function (_super) {\n tslib.__extends(SingletonLayout, _super);\n function SingletonLayout() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._widget = null;\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n SingletonLayout.prototype.dispose = function () {\n if (this._widget) {\n var widget = this._widget;\n this._widget = null;\n widget.dispose();\n }\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(SingletonLayout.prototype, \"widget\", {\n /**\n * Get the child widget for the layout.\n */\n get: function () {\n return this._widget;\n },\n /**\n * Set the child widget for the layout.\n *\n * #### Notes\n * Setting the child widget will cause the old child widget to be\n * automatically disposed. If that is not desired, set the parent\n * of the old child to `null` before assigning a new child.\n */\n set: function (widget) {\n // Remove the widget from its current parent. This is a no-op\n // if the widget's parent is already the layout parent widget.\n if (widget) {\n widget.parent = this.parent;\n }\n // Bail early if the widget does not change.\n if (this._widget === widget) {\n return;\n }\n // Dispose of the old child widget.\n if (this._widget) {\n this._widget.dispose();\n }\n // Update the internal widget.\n this._widget = widget;\n // Attach the new child widget if needed.\n if (this.parent && widget) {\n this.attachWidget(widget);\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n */\n SingletonLayout.prototype.iter = function () {\n return this._widget ? algorithm.once(this._widget) : algorithm.empty();\n };\n /**\n * Remove a widget from the layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n SingletonLayout.prototype.removeWidget = function (widget) {\n // Bail early if the widget does not exist in the layout.\n if (this._widget !== widget) {\n return;\n }\n // Clear the internal widget.\n this._widget = null;\n // If the layout is parented, detach the widget from the DOM.\n if (this.parent) {\n this.detachWidget(widget);\n }\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n SingletonLayout.prototype.init = function () {\n var _this = this;\n _super.prototype.init.call(this);\n algorithm.each(this, function (widget) { _this.attachWidget(widget); });\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This method is called automatically by the single layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation adds the widgets's node to the parent's\n * node at the proper location, and sends the appropriate attach\n * messages to the widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is added to the parent's node.\n */\n SingletonLayout.prototype.attachWidget = function (widget$1) {\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This method is called automatically by the single layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation removes the widget's node from the\n * parent's node, and sends the appropriate detach messages to the\n * widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is removed from the parent's node.\n */\n SingletonLayout.prototype.detachWidget = function (widget$1) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n };\n return SingletonLayout;\n}(layout.Layout));\n\nexports.SingletonLayout = SingletonLayout;\n//# sourceMappingURL=singletonlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/singletonlayout.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n\n/**\n * A concrete layout implementation which holds a single widget.\n *\n * #### Notes\n * This class is useful for creating simple container widgets which\n * hold a single child. The child should be positioned with CSS.\n */\nvar SingletonLayout = /** @class */ (function (_super) {\n tslib.__extends(SingletonLayout, _super);\n function SingletonLayout() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._widget = null;\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n SingletonLayout.prototype.dispose = function () {\n if (this._widget) {\n var widget = this._widget;\n this._widget = null;\n widget.dispose();\n }\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(SingletonLayout.prototype, \"widget\", {\n /**\n * Get the child widget for the layout.\n */\n get: function () {\n return this._widget;\n },\n /**\n * Set the child widget for the layout.\n *\n * #### Notes\n * Setting the child widget will cause the old child widget to be\n * automatically disposed. If that is not desired, set the parent\n * of the old child to `null` before assigning a new child.\n */\n set: function (widget) {\n // Remove the widget from its current parent. This is a no-op\n // if the widget's parent is already the layout parent widget.\n if (widget) {\n widget.parent = this.parent;\n }\n // Bail early if the widget does not change.\n if (this._widget === widget) {\n return;\n }\n // Dispose of the old child widget.\n if (this._widget) {\n this._widget.dispose();\n }\n // Update the internal widget.\n this._widget = widget;\n // Attach the new child widget if needed.\n if (this.parent && widget) {\n this.attachWidget(widget);\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the widgets in the layout.\n *\n * @returns A new iterator over the widgets in the layout.\n */\n SingletonLayout.prototype.iter = function () {\n return this._widget ? algorithm.once(this._widget) : algorithm.empty();\n };\n /**\n * Remove a widget from the layout.\n *\n * @param widget - The widget to remove from the layout.\n *\n * #### Notes\n * A widget is automatically removed from the layout when its `parent`\n * is set to `null`. This method should only be invoked directly when\n * removing a widget from a layout which has yet to be installed on a\n * parent widget.\n *\n * This method does *not* modify the widget's `parent`.\n */\n SingletonLayout.prototype.removeWidget = function (widget) {\n // Bail early if the widget does not exist in the layout.\n if (this._widget !== widget) {\n return;\n }\n // Clear the internal widget.\n this._widget = null;\n // If the layout is parented, detach the widget from the DOM.\n if (this.parent) {\n this.detachWidget(widget);\n }\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n SingletonLayout.prototype.init = function () {\n var _this = this;\n _super.prototype.init.call(this);\n algorithm.each(this, function (widget) { _this.attachWidget(widget); });\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This method is called automatically by the single layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation adds the widgets's node to the parent's\n * node at the proper location, and sends the appropriate attach\n * messages to the widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is added to the parent's node.\n */\n SingletonLayout.prototype.attachWidget = function (widget$1) {\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This method is called automatically by the single layout at the\n * appropriate time. It should not be called directly by user code.\n *\n * The default implementation removes the widget's node from the\n * parent's node, and sends the appropriate detach messages to the\n * widget if the parent is attached to the DOM.\n *\n * Subclasses may reimplement this method to control how the widget's\n * node is removed from the parent's node.\n */\n SingletonLayout.prototype.detachWidget = function (widget$1) {\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n };\n return SingletonLayout;\n}(layout.Layout));\n\nexports.SingletonLayout = SingletonLayout;\n//# sourceMappingURL=singletonlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/singletonlayout.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/splitlayout.js": │ │ │ │ /*!***********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/splitlayout.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/splitlayout.js ***! │ │ │ │ \***********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\n\n/**\n * A layout which arranges its widgets into resizable sections.\n */\nexports.SplitLayout = /** @class */ (function (_super) {\n tslib.__extends(SplitLayout, _super);\n /**\n * Construct a new split layout.\n *\n * @param options - The options for initializing the layout.\n */\n function SplitLayout(options) {\n var _this = _super.call(this) || this;\n _this._fixed = 0;\n _this._spacing = 4;\n _this._dirty = false;\n _this._hasNormedSizes = false;\n _this._sizers = [];\n _this._items = [];\n _this._handles = [];\n _this._box = null;\n _this._alignment = 'start';\n _this._orientation = 'horizontal';\n _this.renderer = options.renderer;\n if (options.orientation !== undefined) {\n _this._orientation = options.orientation;\n }\n if (options.alignment !== undefined) {\n _this._alignment = options.alignment;\n }\n if (options.spacing !== undefined) {\n _this._spacing = Private.clampSpacing(options.spacing);\n }\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n SplitLayout.prototype.dispose = function () {\n // Dispose of the layout items.\n algorithm.each(this._items, function (item) { item.dispose(); });\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n this._sizers.length = 0;\n this._handles.length = 0;\n // Dispose of the rest of the layout.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(SplitLayout.prototype, \"orientation\", {\n /**\n * Get the layout orientation for the split layout.\n */\n get: function () {\n return this._orientation;\n },\n /**\n * Set the layout orientation for the split layout.\n */\n set: function (value) {\n if (this._orientation === value) {\n return;\n }\n this._orientation = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['orientation'] = value;\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitLayout.prototype, \"alignment\", {\n /**\n * Get the content alignment for the split layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split layout.\n */\n get: function () {\n return this._alignment;\n },\n /**\n * Set the content alignment for the split layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split layout.\n */\n set: function (value) {\n if (this._alignment === value) {\n return;\n }\n this._alignment = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['alignment'] = value;\n this.parent.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitLayout.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the split layout.\n */\n get: function () {\n return this._spacing;\n },\n /**\n * Set the inter-element spacing for the split layout.\n */\n set: function (value) {\n value = Private.clampSpacing(value);\n if (this._spacing === value) {\n return;\n }\n this._spacing = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitLayout.prototype, \"handles\", {\n /**\n * A read-only array of the split handles in the layout.\n */\n get: function () {\n return this._handles;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the relative sizes of the widgets in the layout.\n *\n * @returns A new array of the relative sizes of the widgets.\n *\n * #### Notes\n * The returned sizes reflect the sizes of the widgets normalized\n * relative to their siblings.\n *\n * This method **does not** measure the DOM nodes.\n */\n SplitLayout.prototype.relativeSizes = function () {\n return Private.normalize(this._sizers.map(function (sizer) { return sizer.size; }));\n };\n /**\n * Set the relative sizes for the widgets in the layout.\n *\n * @param sizes - The relative sizes for the widgets in the panel.\n *\n * #### Notes\n * Extra values are ignored, too few will yield an undefined layout.\n *\n * The actual geometry of the DOM nodes is updated asynchronously.\n */\n SplitLayout.prototype.setRelativeSizes = function (sizes) {\n // Copy the sizes and pad with zeros as needed.\n var n = this._sizers.length;\n var temp = sizes.slice(0, n);\n while (temp.length < n) {\n temp.push(0);\n }\n // Normalize the padded sizes.\n var normed = Private.normalize(temp);\n // Apply the normalized sizes to the sizers.\n for (var i = 0; i < n; ++i) {\n var sizer = this._sizers[i];\n sizer.sizeHint = normed[i];\n sizer.size = normed[i];\n }\n // Set the flag indicating the sizes are normalized.\n this._hasNormedSizes = true;\n // Trigger an update of the parent widget.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Move the offset position of a split handle.\n *\n * @param index - The index of the handle of the interest.\n *\n * @param position - The desired offset position of the handle.\n *\n * #### Notes\n * The position is relative to the offset parent.\n *\n * This will move the handle as close as possible to the desired\n * position. The sibling widgets will be adjusted as necessary.\n */\n SplitLayout.prototype.moveHandle = function (index, position) {\n // Bail if the index is invalid or the handle is hidden.\n var handle = this._handles[index];\n if (!handle || handle.classList.contains('lm-mod-hidden')) {\n return;\n }\n // Compute the desired delta movement for the handle.\n var delta;\n if (this._orientation === 'horizontal') {\n delta = position - handle.offsetLeft;\n }\n else {\n delta = position - handle.offsetTop;\n }\n // Bail if there is no handle movement.\n if (delta === 0) {\n return;\n }\n // Prevent widget resizing unless needed.\n for (var _i = 0, _a = this._sizers; _i < _a.length; _i++) {\n var sizer = _a[_i];\n if (sizer.size > 0) {\n sizer.sizeHint = sizer.size;\n }\n }\n // Adjust the sizers to reflect the handle movement.\n boxengine.BoxEngine.adjust(this._sizers, index, delta);\n // Update the layout of the widgets.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n SplitLayout.prototype.init = function () {\n this.parent.dataset['orientation'] = this.orientation;\n this.parent.dataset['alignment'] = this.alignment;\n _super.prototype.init.call(this);\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n SplitLayout.prototype.attachWidget = function (index, widget$1) {\n // Create the item, handle, and sizer for the new widget.\n var item = new layout.LayoutItem(widget$1);\n var handle = Private.createHandle(this.renderer);\n var average = Private.averageSize(this._sizers);\n var sizer = Private.createSizer(average);\n // Insert the item, handle, and sizer into the internal arrays.\n algorithm.ArrayExt.insert(this._items, index, item);\n algorithm.ArrayExt.insert(this._sizers, index, sizer);\n algorithm.ArrayExt.insert(this._handles, index, handle);\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget and handle nodes to the parent.\n this.parent.node.appendChild(widget$1.node);\n this.parent.node.appendChild(handle);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n SplitLayout.prototype.moveWidget = function (fromIndex, toIndex, widget) {\n // Move the item, sizer, and handle for the widget.\n algorithm.ArrayExt.move(this._items, fromIndex, toIndex);\n algorithm.ArrayExt.move(this._sizers, fromIndex, toIndex);\n algorithm.ArrayExt.move(this._handles, fromIndex, toIndex);\n // Post a fit request to the parent to show/hide last handle.\n this.parent.fit();\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n SplitLayout.prototype.detachWidget = function (index, widget$1) {\n // Remove the item, handle, and sizer for the widget.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n var handle = algorithm.ArrayExt.removeAt(this._handles, index);\n algorithm.ArrayExt.removeAt(this._sizers, index);\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget and handle nodes from the parent.\n this.parent.node.removeChild(widget$1.node);\n this.parent.node.removeChild(handle);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Dispose of the layout item.\n item.dispose();\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n SplitLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n SplitLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n SplitLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n SplitLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n SplitLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n SplitLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n SplitLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n SplitLayout.prototype._fit = function () {\n // Update the handles and track the visible widget count.\n var nVisible = 0;\n var lastHandleIndex = -1;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n if (this._items[i].isHidden) {\n this._handles[i].classList.add('lm-mod-hidden');\n /* */\n this._handles[i].classList.add('p-mod-hidden');\n /* */\n }\n else {\n this._handles[i].classList.remove('lm-mod-hidden');\n /* */\n this._handles[i].classList.remove('p-mod-hidden');\n /* */\n lastHandleIndex = i;\n nVisible++;\n }\n }\n // Hide the handle for the last visible widget.\n if (lastHandleIndex !== -1) {\n this._handles[lastHandleIndex].classList.add('lm-mod-hidden');\n /* */\n this._handles[lastHandleIndex].classList.add('p-mod-hidden');\n /* */\n }\n // Update the fixed space for the visible items.\n this._fixed = this._spacing * Math.max(0, nVisible - 1);\n // Setup the computed minimum size.\n var horz = this._orientation === 'horizontal';\n var minW = horz ? this._fixed : 0;\n var minH = horz ? 0 : this._fixed;\n // Update the sizers and computed size limits.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item and corresponding box sizer.\n var item = this._items[i];\n var sizer = this._sizers[i];\n // Prevent resizing unless necessary.\n if (sizer.size > 0) {\n sizer.sizeHint = sizer.size;\n }\n // If the item is hidden, it should consume zero size.\n if (item.isHidden) {\n sizer.minSize = 0;\n sizer.maxSize = 0;\n continue;\n }\n // Update the size limits for the item.\n item.fit();\n // Update the stretch factor.\n sizer.stretch = SplitLayout.getStretch(item.widget);\n // Update the sizer limits and computed min size.\n if (horz) {\n sizer.minSize = item.minWidth;\n sizer.maxSize = item.maxWidth;\n minW += item.minWidth;\n minH = Math.max(minH, item.minHeight);\n }\n else {\n sizer.minSize = item.minHeight;\n sizer.maxSize = item.maxHeight;\n minH += item.minHeight;\n minW = Math.max(minW, item.minWidth);\n }\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n SplitLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Compute the visible item count.\n var nVisible = 0;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Bail early if there are no visible items to layout.\n if (nVisible === 0) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the actual layout bounds adjusted for border and padding.\n var top = this._box.paddingTop;\n var left = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Compute the adjusted layout space.\n var space;\n var horz = this._orientation === 'horizontal';\n if (horz) {\n space = Math.max(0, width - this._fixed);\n }\n else {\n space = Math.max(0, height - this._fixed);\n }\n // Scale the size hints if they are normalized.\n if (this._hasNormedSizes) {\n for (var _i = 0, _a = this._sizers; _i < _a.length; _i++) {\n var sizer = _a[_i];\n sizer.sizeHint *= space;\n }\n this._hasNormedSizes = false;\n }\n // Distribute the layout space to the box sizers.\n var delta = boxengine.BoxEngine.calc(this._sizers, space);\n // Set up the variables for justification and alignment offset.\n var extra = 0;\n var offset = 0;\n // Account for alignment if there is extra layout space.\n if (delta > 0) {\n switch (this._alignment) {\n case 'start':\n break;\n case 'center':\n extra = 0;\n offset = delta / 2;\n break;\n case 'end':\n extra = 0;\n offset = delta;\n break;\n case 'justify':\n extra = delta / nVisible;\n offset = 0;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Layout the items using the computed box sizes.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Fetch the computed size for the widget.\n var size = this._sizers[i].size;\n // Fetch the style for the handle.\n var handleStyle = this._handles[i].style;\n // Update the widget and handle, and advance the relevant edge.\n if (horz) {\n item.update(left + offset, top, size + extra, height);\n left += size + extra;\n handleStyle.top = top + \"px\";\n handleStyle.left = left + offset + \"px\";\n handleStyle.width = this._spacing + \"px\";\n handleStyle.height = height + \"px\";\n left += this._spacing;\n }\n else {\n item.update(left, top + offset, width, size + extra);\n top += size + extra;\n handleStyle.top = top + offset + \"px\";\n handleStyle.left = left + \"px\";\n handleStyle.width = width + \"px\";\n handleStyle.height = this._spacing + \"px\";\n top += this._spacing;\n }\n }\n };\n return SplitLayout;\n}(panellayout.PanelLayout));\n/**\n * The namespace for the `SplitLayout` class statics.\n */\n(function (SplitLayout) {\n /**\n * Get the split layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The split layout stretch factor for the widget.\n */\n function getStretch(widget) {\n return Private.stretchProperty.get(widget);\n }\n SplitLayout.getStretch = getStretch;\n /**\n * Set the split layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n Private.stretchProperty.set(widget, value);\n }\n SplitLayout.setStretch = setStretch;\n})(exports.SplitLayout || (exports.SplitLayout = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The property descriptor for a widget stretch factor.\n */\n Private.stretchProperty = new properties.AttachedProperty({\n name: 'stretch',\n create: function () { return 0; },\n coerce: function (owner, value) { return Math.max(0, Math.floor(value)); },\n changed: onChildSizingChanged\n });\n /**\n * Create a new box sizer with the given size hint.\n */\n function createSizer(size) {\n var sizer = new boxengine.BoxSizer();\n sizer.sizeHint = Math.floor(size);\n return sizer;\n }\n Private.createSizer = createSizer;\n /**\n * Create a new split handle node using the given renderer.\n */\n function createHandle(renderer) {\n var handle = renderer.createHandle();\n handle.style.position = 'absolute';\n return handle;\n }\n Private.createHandle = createHandle;\n /**\n * Clamp a spacing value to an integer >= 0.\n */\n function clampSpacing(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampSpacing = clampSpacing;\n /**\n * Compute the average size of an array of box sizers.\n */\n function averageSize(sizers) {\n return sizers.reduce(function (v, s) { return v + s.size; }, 0) / sizers.length || 0;\n }\n Private.averageSize = averageSize;\n /**\n * Normalize an array of values.\n */\n function normalize(values) {\n var n = values.length;\n if (n === 0) {\n return [];\n }\n var sum = values.reduce(function (a, b) { return a + Math.abs(b); }, 0);\n return sum === 0 ? values.map(function (v) { return 1 / n; }) : values.map(function (v) { return v / sum; });\n }\n Private.normalize = normalize;\n /**\n * The change handler for the attached sizing properties.\n */\n function onChildSizingChanged(child) {\n if (child.parent && child.parent.layout instanceof exports.SplitLayout) {\n child.parent.fit();\n }\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=splitlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/splitlayout.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar boxengine = __webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\n\n/**\n * A layout which arranges its widgets into resizable sections.\n */\nexports.SplitLayout = /** @class */ (function (_super) {\n tslib.__extends(SplitLayout, _super);\n /**\n * Construct a new split layout.\n *\n * @param options - The options for initializing the layout.\n */\n function SplitLayout(options) {\n var _this = _super.call(this) || this;\n _this._fixed = 0;\n _this._spacing = 4;\n _this._dirty = false;\n _this._hasNormedSizes = false;\n _this._sizers = [];\n _this._items = [];\n _this._handles = [];\n _this._box = null;\n _this._alignment = 'start';\n _this._orientation = 'horizontal';\n _this.renderer = options.renderer;\n if (options.orientation !== undefined) {\n _this._orientation = options.orientation;\n }\n if (options.alignment !== undefined) {\n _this._alignment = options.alignment;\n }\n if (options.spacing !== undefined) {\n _this._spacing = Private.clampSpacing(options.spacing);\n }\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n SplitLayout.prototype.dispose = function () {\n // Dispose of the layout items.\n algorithm.each(this._items, function (item) { item.dispose(); });\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n this._sizers.length = 0;\n this._handles.length = 0;\n // Dispose of the rest of the layout.\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(SplitLayout.prototype, \"orientation\", {\n /**\n * Get the layout orientation for the split layout.\n */\n get: function () {\n return this._orientation;\n },\n /**\n * Set the layout orientation for the split layout.\n */\n set: function (value) {\n if (this._orientation === value) {\n return;\n }\n this._orientation = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['orientation'] = value;\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitLayout.prototype, \"alignment\", {\n /**\n * Get the content alignment for the split layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split layout.\n */\n get: function () {\n return this._alignment;\n },\n /**\n * Set the content alignment for the split layout.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split layout.\n */\n set: function (value) {\n if (this._alignment === value) {\n return;\n }\n this._alignment = value;\n if (!this.parent) {\n return;\n }\n this.parent.dataset['alignment'] = value;\n this.parent.update();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitLayout.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the split layout.\n */\n get: function () {\n return this._spacing;\n },\n /**\n * Set the inter-element spacing for the split layout.\n */\n set: function (value) {\n value = Private.clampSpacing(value);\n if (this._spacing === value) {\n return;\n }\n this._spacing = value;\n if (!this.parent) {\n return;\n }\n this.parent.fit();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitLayout.prototype, \"handles\", {\n /**\n * A read-only array of the split handles in the layout.\n */\n get: function () {\n return this._handles;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the relative sizes of the widgets in the layout.\n *\n * @returns A new array of the relative sizes of the widgets.\n *\n * #### Notes\n * The returned sizes reflect the sizes of the widgets normalized\n * relative to their siblings.\n *\n * This method **does not** measure the DOM nodes.\n */\n SplitLayout.prototype.relativeSizes = function () {\n return Private.normalize(this._sizers.map(function (sizer) { return sizer.size; }));\n };\n /**\n * Set the relative sizes for the widgets in the layout.\n *\n * @param sizes - The relative sizes for the widgets in the panel.\n *\n * #### Notes\n * Extra values are ignored, too few will yield an undefined layout.\n *\n * The actual geometry of the DOM nodes is updated asynchronously.\n */\n SplitLayout.prototype.setRelativeSizes = function (sizes) {\n // Copy the sizes and pad with zeros as needed.\n var n = this._sizers.length;\n var temp = sizes.slice(0, n);\n while (temp.length < n) {\n temp.push(0);\n }\n // Normalize the padded sizes.\n var normed = Private.normalize(temp);\n // Apply the normalized sizes to the sizers.\n for (var i = 0; i < n; ++i) {\n var sizer = this._sizers[i];\n sizer.sizeHint = normed[i];\n sizer.size = normed[i];\n }\n // Set the flag indicating the sizes are normalized.\n this._hasNormedSizes = true;\n // Trigger an update of the parent widget.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Move the offset position of a split handle.\n *\n * @param index - The index of the handle of the interest.\n *\n * @param position - The desired offset position of the handle.\n *\n * #### Notes\n * The position is relative to the offset parent.\n *\n * This will move the handle as close as possible to the desired\n * position. The sibling widgets will be adjusted as necessary.\n */\n SplitLayout.prototype.moveHandle = function (index, position) {\n // Bail if the index is invalid or the handle is hidden.\n var handle = this._handles[index];\n if (!handle || handle.classList.contains('lm-mod-hidden')) {\n return;\n }\n // Compute the desired delta movement for the handle.\n var delta;\n if (this._orientation === 'horizontal') {\n delta = position - handle.offsetLeft;\n }\n else {\n delta = position - handle.offsetTop;\n }\n // Bail if there is no handle movement.\n if (delta === 0) {\n return;\n }\n // Prevent widget resizing unless needed.\n for (var _i = 0, _a = this._sizers; _i < _a.length; _i++) {\n var sizer = _a[_i];\n if (sizer.size > 0) {\n sizer.sizeHint = sizer.size;\n }\n }\n // Adjust the sizers to reflect the handle movement.\n boxengine.BoxEngine.adjust(this._sizers, index, delta);\n // Update the layout of the widgets.\n if (this.parent) {\n this.parent.update();\n }\n };\n /**\n * Perform layout initialization which requires the parent widget.\n */\n SplitLayout.prototype.init = function () {\n this.parent.dataset['orientation'] = this.orientation;\n this.parent.dataset['alignment'] = this.alignment;\n _super.prototype.init.call(this);\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n SplitLayout.prototype.attachWidget = function (index, widget$1) {\n // Create the item, handle, and sizer for the new widget.\n var item = new layout.LayoutItem(widget$1);\n var handle = Private.createHandle(this.renderer);\n var average = Private.averageSize(this._sizers);\n var sizer = Private.createSizer(average);\n // Insert the item, handle, and sizer into the internal arrays.\n algorithm.ArrayExt.insert(this._items, index, item);\n algorithm.ArrayExt.insert(this._sizers, index, sizer);\n algorithm.ArrayExt.insert(this._handles, index, handle);\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget and handle nodes to the parent.\n this.parent.node.appendChild(widget$1.node);\n this.parent.node.appendChild(handle);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n SplitLayout.prototype.moveWidget = function (fromIndex, toIndex, widget) {\n // Move the item, sizer, and handle for the widget.\n algorithm.ArrayExt.move(this._items, fromIndex, toIndex);\n algorithm.ArrayExt.move(this._sizers, fromIndex, toIndex);\n algorithm.ArrayExt.move(this._handles, fromIndex, toIndex);\n // Post a fit request to the parent to show/hide last handle.\n this.parent.fit();\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n SplitLayout.prototype.detachWidget = function (index, widget$1) {\n // Remove the item, handle, and sizer for the widget.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n var handle = algorithm.ArrayExt.removeAt(this._handles, index);\n algorithm.ArrayExt.removeAt(this._sizers, index);\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget and handle nodes from the parent.\n this.parent.node.removeChild(widget$1.node);\n this.parent.node.removeChild(handle);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Dispose of the layout item.\n item.dispose();\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n SplitLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n SplitLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n SplitLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n SplitLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n SplitLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n SplitLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n SplitLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n SplitLayout.prototype._fit = function () {\n // Update the handles and track the visible widget count.\n var nVisible = 0;\n var lastHandleIndex = -1;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n if (this._items[i].isHidden) {\n this._handles[i].classList.add('lm-mod-hidden');\n /* */\n this._handles[i].classList.add('p-mod-hidden');\n /* */\n }\n else {\n this._handles[i].classList.remove('lm-mod-hidden');\n /* */\n this._handles[i].classList.remove('p-mod-hidden');\n /* */\n lastHandleIndex = i;\n nVisible++;\n }\n }\n // Hide the handle for the last visible widget.\n if (lastHandleIndex !== -1) {\n this._handles[lastHandleIndex].classList.add('lm-mod-hidden');\n /* */\n this._handles[lastHandleIndex].classList.add('p-mod-hidden');\n /* */\n }\n // Update the fixed space for the visible items.\n this._fixed = this._spacing * Math.max(0, nVisible - 1);\n // Setup the computed minimum size.\n var horz = this._orientation === 'horizontal';\n var minW = horz ? this._fixed : 0;\n var minH = horz ? 0 : this._fixed;\n // Update the sizers and computed size limits.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item and corresponding box sizer.\n var item = this._items[i];\n var sizer = this._sizers[i];\n // Prevent resizing unless necessary.\n if (sizer.size > 0) {\n sizer.sizeHint = sizer.size;\n }\n // If the item is hidden, it should consume zero size.\n if (item.isHidden) {\n sizer.minSize = 0;\n sizer.maxSize = 0;\n continue;\n }\n // Update the size limits for the item.\n item.fit();\n // Update the stretch factor.\n sizer.stretch = SplitLayout.getStretch(item.widget);\n // Update the sizer limits and computed min size.\n if (horz) {\n sizer.minSize = item.minWidth;\n sizer.maxSize = item.maxWidth;\n minW += item.minWidth;\n minH = Math.max(minH, item.minHeight);\n }\n else {\n sizer.minSize = item.minHeight;\n sizer.maxSize = item.maxHeight;\n minH += item.minHeight;\n minW = Math.max(minW, item.minWidth);\n }\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n SplitLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Compute the visible item count.\n var nVisible = 0;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Bail early if there are no visible items to layout.\n if (nVisible === 0) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the actual layout bounds adjusted for border and padding.\n var top = this._box.paddingTop;\n var left = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Compute the adjusted layout space.\n var space;\n var horz = this._orientation === 'horizontal';\n if (horz) {\n space = Math.max(0, width - this._fixed);\n }\n else {\n space = Math.max(0, height - this._fixed);\n }\n // Scale the size hints if they are normalized.\n if (this._hasNormedSizes) {\n for (var _i = 0, _a = this._sizers; _i < _a.length; _i++) {\n var sizer = _a[_i];\n sizer.sizeHint *= space;\n }\n this._hasNormedSizes = false;\n }\n // Distribute the layout space to the box sizers.\n var delta = boxengine.BoxEngine.calc(this._sizers, space);\n // Set up the variables for justification and alignment offset.\n var extra = 0;\n var offset = 0;\n // Account for alignment if there is extra layout space.\n if (delta > 0) {\n switch (this._alignment) {\n case 'start':\n break;\n case 'center':\n extra = 0;\n offset = delta / 2;\n break;\n case 'end':\n extra = 0;\n offset = delta;\n break;\n case 'justify':\n extra = delta / nVisible;\n offset = 0;\n break;\n default:\n throw 'unreachable';\n }\n }\n // Layout the items using the computed box sizes.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Fetch the computed size for the widget.\n var size = this._sizers[i].size;\n // Fetch the style for the handle.\n var handleStyle = this._handles[i].style;\n // Update the widget and handle, and advance the relevant edge.\n if (horz) {\n item.update(left + offset, top, size + extra, height);\n left += size + extra;\n handleStyle.top = top + \"px\";\n handleStyle.left = left + offset + \"px\";\n handleStyle.width = this._spacing + \"px\";\n handleStyle.height = height + \"px\";\n left += this._spacing;\n }\n else {\n item.update(left, top + offset, width, size + extra);\n top += size + extra;\n handleStyle.top = top + offset + \"px\";\n handleStyle.left = left + \"px\";\n handleStyle.width = width + \"px\";\n handleStyle.height = this._spacing + \"px\";\n top += this._spacing;\n }\n }\n };\n return SplitLayout;\n}(panellayout.PanelLayout));\n/**\n * The namespace for the `SplitLayout` class statics.\n */\n(function (SplitLayout) {\n /**\n * Get the split layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The split layout stretch factor for the widget.\n */\n function getStretch(widget) {\n return Private.stretchProperty.get(widget);\n }\n SplitLayout.getStretch = getStretch;\n /**\n * Set the split layout stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n Private.stretchProperty.set(widget, value);\n }\n SplitLayout.setStretch = setStretch;\n})(exports.SplitLayout || (exports.SplitLayout = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The property descriptor for a widget stretch factor.\n */\n Private.stretchProperty = new properties.AttachedProperty({\n name: 'stretch',\n create: function () { return 0; },\n coerce: function (owner, value) { return Math.max(0, Math.floor(value)); },\n changed: onChildSizingChanged\n });\n /**\n * Create a new box sizer with the given size hint.\n */\n function createSizer(size) {\n var sizer = new boxengine.BoxSizer();\n sizer.sizeHint = Math.floor(size);\n return sizer;\n }\n Private.createSizer = createSizer;\n /**\n * Create a new split handle node using the given renderer.\n */\n function createHandle(renderer) {\n var handle = renderer.createHandle();\n handle.style.position = 'absolute';\n return handle;\n }\n Private.createHandle = createHandle;\n /**\n * Clamp a spacing value to an integer >= 0.\n */\n function clampSpacing(value) {\n return Math.max(0, Math.floor(value));\n }\n Private.clampSpacing = clampSpacing;\n /**\n * Compute the average size of an array of box sizers.\n */\n function averageSize(sizers) {\n return sizers.reduce(function (v, s) { return v + s.size; }, 0) / sizers.length || 0;\n }\n Private.averageSize = averageSize;\n /**\n * Normalize an array of values.\n */\n function normalize(values) {\n var n = values.length;\n if (n === 0) {\n return [];\n }\n var sum = values.reduce(function (a, b) { return a + Math.abs(b); }, 0);\n return sum === 0 ? values.map(function (v) { return 1 / n; }) : values.map(function (v) { return v / sum; });\n }\n Private.normalize = normalize;\n /**\n * The change handler for the attached sizing properties.\n */\n function onChildSizingChanged(child) {\n if (child.parent && child.parent.layout instanceof exports.SplitLayout) {\n child.parent.fit();\n }\n }\n})(Private || (Private = {}));\n//# sourceMappingURL=splitlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/splitlayout.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/splitpanel.js": │ │ │ │ /*!**********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/splitpanel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/splitpanel.js ***! │ │ │ │ \**********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n__webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n__webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar panel = __webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar splitlayout = __webpack_require__(/*! ./splitlayout.js */ \"../../packages/widgets/dist/splitlayout.js\");\n\n/**\n * A panel which arranges its widgets into resizable sections.\n *\n * #### Notes\n * This class provides a convenience wrapper around a [[SplitLayout]].\n */\nexports.SplitPanel = /** @class */ (function (_super) {\n tslib.__extends(SplitPanel, _super);\n /**\n * Construct a new split panel.\n *\n * @param options - The options for initializing the split panel.\n */\n function SplitPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { layout: Private.createLayout(options) }) || this;\n _this._pressData = null;\n _this.addClass('lm-SplitPanel');\n /* */\n _this.addClass('p-SplitPanel');\n return _this;\n /* */\n }\n /**\n * Dispose of the resources held by the panel.\n */\n SplitPanel.prototype.dispose = function () {\n this._releaseMouse();\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(SplitPanel.prototype, \"orientation\", {\n /**\n * Get the layout orientation for the split panel.\n */\n get: function () {\n return this.layout.orientation;\n },\n /**\n * Set the layout orientation for the split panel.\n */\n set: function (value) {\n this.layout.orientation = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitPanel.prototype, \"alignment\", {\n /**\n * Get the content alignment for the split panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split panel.\n */\n get: function () {\n return this.layout.alignment;\n },\n /**\n * Set the content alignment for the split panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split panel.\n */\n set: function (value) {\n this.layout.alignment = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitPanel.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the split panel.\n */\n get: function () {\n return this.layout.spacing;\n },\n /**\n * Set the inter-element spacing for the split panel.\n */\n set: function (value) {\n this.layout.spacing = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitPanel.prototype, \"renderer\", {\n /**\n * The renderer used by the split panel.\n */\n get: function () {\n return this.layout.renderer;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitPanel.prototype, \"handles\", {\n /**\n * A read-only array of the split handles in the panel.\n */\n get: function () {\n return this.layout.handles;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the relative sizes of the widgets in the panel.\n *\n * @returns A new array of the relative sizes of the widgets.\n *\n * #### Notes\n * The returned sizes reflect the sizes of the widgets normalized\n * relative to their siblings.\n *\n * This method **does not** measure the DOM nodes.\n */\n SplitPanel.prototype.relativeSizes = function () {\n return this.layout.relativeSizes();\n };\n /**\n * Set the relative sizes for the widgets in the panel.\n *\n * @param sizes - The relative sizes for the widgets in the panel.\n *\n * #### Notes\n * Extra values are ignored, too few will yield an undefined layout.\n *\n * The actual geometry of the DOM nodes is updated asynchronously.\n */\n SplitPanel.prototype.setRelativeSizes = function (sizes) {\n this.layout.setRelativeSizes(sizes);\n };\n /**\n * Handle the DOM events for the split panel.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the panel's DOM node. It should\n * not be called directly by user code.\n */\n SplitPanel.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n SplitPanel.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('mousedown', this);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n SplitPanel.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('mousedown', this);\n this._releaseMouse();\n };\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n SplitPanel.prototype.onChildAdded = function (msg) {\n msg.child.addClass('lm-SplitPanel-child');\n /* */\n msg.child.addClass('p-SplitPanel-child');\n /* */\n this._releaseMouse();\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n SplitPanel.prototype.onChildRemoved = function (msg) {\n msg.child.removeClass('lm-SplitPanel-child');\n /* */\n msg.child.removeClass('p-SplitPanel-child');\n /* */\n this._releaseMouse();\n };\n /**\n * Handle the `'keydown'` event for the split panel.\n */\n SplitPanel.prototype._evtKeyDown = function (event) {\n // Stop input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse if `Escape` is pressed.\n if (event.keyCode === 27) {\n this._releaseMouse();\n }\n };\n /**\n * Handle the `'mousedown'` event for the split panel.\n */\n SplitPanel.prototype._evtMouseDown = function (event) {\n // Do nothing if the left mouse button is not pressed.\n if (event.button !== 0) {\n return;\n }\n // Find the handle which contains the mouse target, if any.\n var layout = this.layout;\n var index = algorithm.ArrayExt.findFirstIndex(layout.handles, function (handle) {\n return handle.contains(event.target);\n });\n // Bail early if the mouse press was not on a handle.\n if (index === -1) {\n return;\n }\n // Stop the event when a split handle is pressed.\n event.preventDefault();\n event.stopPropagation();\n // Add the extra document listeners.\n document.addEventListener('mouseup', this, true);\n document.addEventListener('mousemove', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('contextmenu', this, true);\n // Compute the offset delta for the handle press.\n var delta;\n var handle = layout.handles[index];\n var rect = handle.getBoundingClientRect();\n if (layout.orientation === 'horizontal') {\n delta = event.clientX - rect.left;\n }\n else {\n delta = event.clientY - rect.top;\n }\n // Override the cursor and store the press data.\n var style = window.getComputedStyle(handle);\n var override = dragdrop.Drag.overrideCursor(style.cursor);\n this._pressData = { index: index, delta: delta, override: override };\n };\n /**\n * Handle the `'mousemove'` event for the split panel.\n */\n SplitPanel.prototype._evtMouseMove = function (event) {\n // Stop the event when dragging a split handle.\n event.preventDefault();\n event.stopPropagation();\n // Compute the desired offset position for the handle.\n var pos;\n var layout = this.layout;\n var rect = this.node.getBoundingClientRect();\n if (layout.orientation === 'horizontal') {\n pos = event.clientX - rect.left - this._pressData.delta;\n }\n else {\n pos = event.clientY - rect.top - this._pressData.delta;\n }\n // Move the handle as close to the desired position as possible.\n layout.moveHandle(this._pressData.index, pos);\n };\n /**\n * Handle the `'mouseup'` event for the split panel.\n */\n SplitPanel.prototype._evtMouseUp = function (event) {\n // Do nothing if the left mouse button is not released.\n if (event.button !== 0) {\n return;\n }\n // Stop the event when releasing a handle.\n event.preventDefault();\n event.stopPropagation();\n // Finalize the mouse release.\n this._releaseMouse();\n };\n /**\n * Release the mouse grab for the split panel.\n */\n SplitPanel.prototype._releaseMouse = function () {\n // Bail early if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Clear the override cursor.\n this._pressData.override.dispose();\n this._pressData = null;\n // Remove the extra document listeners.\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('contextmenu', this, true);\n };\n return SplitPanel;\n}(panel.Panel));\n/**\n * The namespace for the `SplitPanel` class statics.\n */\n(function (SplitPanel) {\n /**\n * The default implementation of `IRenderer`.\n */\n var Renderer = /** @class */ (function () {\n function Renderer() {\n }\n /**\n * Create a new handle for use with a split panel.\n *\n * @returns A new handle element for a split panel.\n */\n Renderer.prototype.createHandle = function () {\n var handle = document.createElement('div');\n handle.className = 'lm-SplitPanel-handle';\n /* */\n handle.classList.add('p-SplitPanel-handle');\n /* */\n return handle;\n };\n return Renderer;\n }());\n SplitPanel.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n SplitPanel.defaultRenderer = new Renderer();\n /**\n * Get the split panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The split panel stretch factor for the widget.\n */\n function getStretch(widget) {\n return splitlayout.SplitLayout.getStretch(widget);\n }\n SplitPanel.getStretch = getStretch;\n /**\n * Set the split panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n splitlayout.SplitLayout.setStretch(widget, value);\n }\n SplitPanel.setStretch = setStretch;\n})(exports.SplitPanel || (exports.SplitPanel = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a split layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new splitlayout.SplitLayout({\n renderer: options.renderer || exports.SplitPanel.defaultRenderer,\n orientation: options.orientation,\n alignment: options.alignment,\n spacing: options.spacing\n });\n }\n Private.createLayout = createLayout;\n})(Private || (Private = {}));\n//# sourceMappingURL=splitpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/splitpanel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n__webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n__webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar panel = __webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar splitlayout = __webpack_require__(/*! ./splitlayout.js */ \"../../packages/widgets/dist/splitlayout.js\");\n\n/**\n * A panel which arranges its widgets into resizable sections.\n *\n * #### Notes\n * This class provides a convenience wrapper around a [[SplitLayout]].\n */\nexports.SplitPanel = /** @class */ (function (_super) {\n tslib.__extends(SplitPanel, _super);\n /**\n * Construct a new split panel.\n *\n * @param options - The options for initializing the split panel.\n */\n function SplitPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { layout: Private.createLayout(options) }) || this;\n _this._pressData = null;\n _this.addClass('lm-SplitPanel');\n /* */\n _this.addClass('p-SplitPanel');\n return _this;\n /* */\n }\n /**\n * Dispose of the resources held by the panel.\n */\n SplitPanel.prototype.dispose = function () {\n this._releaseMouse();\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(SplitPanel.prototype, \"orientation\", {\n /**\n * Get the layout orientation for the split panel.\n */\n get: function () {\n return this.layout.orientation;\n },\n /**\n * Set the layout orientation for the split panel.\n */\n set: function (value) {\n this.layout.orientation = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitPanel.prototype, \"alignment\", {\n /**\n * Get the content alignment for the split panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split panel.\n */\n get: function () {\n return this.layout.alignment;\n },\n /**\n * Set the content alignment for the split panel.\n *\n * #### Notes\n * This is the alignment of the widgets in the layout direction.\n *\n * The alignment has no effect if the widgets can expand to fill the\n * entire split panel.\n */\n set: function (value) {\n this.layout.alignment = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitPanel.prototype, \"spacing\", {\n /**\n * Get the inter-element spacing for the split panel.\n */\n get: function () {\n return this.layout.spacing;\n },\n /**\n * Set the inter-element spacing for the split panel.\n */\n set: function (value) {\n this.layout.spacing = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitPanel.prototype, \"renderer\", {\n /**\n * The renderer used by the split panel.\n */\n get: function () {\n return this.layout.renderer;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SplitPanel.prototype, \"handles\", {\n /**\n * A read-only array of the split handles in the panel.\n */\n get: function () {\n return this.layout.handles;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the relative sizes of the widgets in the panel.\n *\n * @returns A new array of the relative sizes of the widgets.\n *\n * #### Notes\n * The returned sizes reflect the sizes of the widgets normalized\n * relative to their siblings.\n *\n * This method **does not** measure the DOM nodes.\n */\n SplitPanel.prototype.relativeSizes = function () {\n return this.layout.relativeSizes();\n };\n /**\n * Set the relative sizes for the widgets in the panel.\n *\n * @param sizes - The relative sizes for the widgets in the panel.\n *\n * #### Notes\n * Extra values are ignored, too few will yield an undefined layout.\n *\n * The actual geometry of the DOM nodes is updated asynchronously.\n */\n SplitPanel.prototype.setRelativeSizes = function (sizes) {\n this.layout.setRelativeSizes(sizes);\n };\n /**\n * Handle the DOM events for the split panel.\n *\n * @param event - The DOM event sent to the panel.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the panel's DOM node. It should\n * not be called directly by user code.\n */\n SplitPanel.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n SplitPanel.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('mousedown', this);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n SplitPanel.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('mousedown', this);\n this._releaseMouse();\n };\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n SplitPanel.prototype.onChildAdded = function (msg) {\n msg.child.addClass('lm-SplitPanel-child');\n /* */\n msg.child.addClass('p-SplitPanel-child');\n /* */\n this._releaseMouse();\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n SplitPanel.prototype.onChildRemoved = function (msg) {\n msg.child.removeClass('lm-SplitPanel-child');\n /* */\n msg.child.removeClass('p-SplitPanel-child');\n /* */\n this._releaseMouse();\n };\n /**\n * Handle the `'keydown'` event for the split panel.\n */\n SplitPanel.prototype._evtKeyDown = function (event) {\n // Stop input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse if `Escape` is pressed.\n if (event.keyCode === 27) {\n this._releaseMouse();\n }\n };\n /**\n * Handle the `'mousedown'` event for the split panel.\n */\n SplitPanel.prototype._evtMouseDown = function (event) {\n // Do nothing if the left mouse button is not pressed.\n if (event.button !== 0) {\n return;\n }\n // Find the handle which contains the mouse target, if any.\n var layout = this.layout;\n var index = algorithm.ArrayExt.findFirstIndex(layout.handles, function (handle) {\n return handle.contains(event.target);\n });\n // Bail early if the mouse press was not on a handle.\n if (index === -1) {\n return;\n }\n // Stop the event when a split handle is pressed.\n event.preventDefault();\n event.stopPropagation();\n // Add the extra document listeners.\n document.addEventListener('mouseup', this, true);\n document.addEventListener('mousemove', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('contextmenu', this, true);\n // Compute the offset delta for the handle press.\n var delta;\n var handle = layout.handles[index];\n var rect = handle.getBoundingClientRect();\n if (layout.orientation === 'horizontal') {\n delta = event.clientX - rect.left;\n }\n else {\n delta = event.clientY - rect.top;\n }\n // Override the cursor and store the press data.\n var style = window.getComputedStyle(handle);\n var override = dragdrop.Drag.overrideCursor(style.cursor);\n this._pressData = { index: index, delta: delta, override: override };\n };\n /**\n * Handle the `'mousemove'` event for the split panel.\n */\n SplitPanel.prototype._evtMouseMove = function (event) {\n // Stop the event when dragging a split handle.\n event.preventDefault();\n event.stopPropagation();\n // Compute the desired offset position for the handle.\n var pos;\n var layout = this.layout;\n var rect = this.node.getBoundingClientRect();\n if (layout.orientation === 'horizontal') {\n pos = event.clientX - rect.left - this._pressData.delta;\n }\n else {\n pos = event.clientY - rect.top - this._pressData.delta;\n }\n // Move the handle as close to the desired position as possible.\n layout.moveHandle(this._pressData.index, pos);\n };\n /**\n * Handle the `'mouseup'` event for the split panel.\n */\n SplitPanel.prototype._evtMouseUp = function (event) {\n // Do nothing if the left mouse button is not released.\n if (event.button !== 0) {\n return;\n }\n // Stop the event when releasing a handle.\n event.preventDefault();\n event.stopPropagation();\n // Finalize the mouse release.\n this._releaseMouse();\n };\n /**\n * Release the mouse grab for the split panel.\n */\n SplitPanel.prototype._releaseMouse = function () {\n // Bail early if no drag is in progress.\n if (!this._pressData) {\n return;\n }\n // Clear the override cursor.\n this._pressData.override.dispose();\n this._pressData = null;\n // Remove the extra document listeners.\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('contextmenu', this, true);\n };\n return SplitPanel;\n}(panel.Panel));\n/**\n * The namespace for the `SplitPanel` class statics.\n */\n(function (SplitPanel) {\n /**\n * The default implementation of `IRenderer`.\n */\n var Renderer = /** @class */ (function () {\n function Renderer() {\n }\n /**\n * Create a new handle for use with a split panel.\n *\n * @returns A new handle element for a split panel.\n */\n Renderer.prototype.createHandle = function () {\n var handle = document.createElement('div');\n handle.className = 'lm-SplitPanel-handle';\n /* */\n handle.classList.add('p-SplitPanel-handle');\n /* */\n return handle;\n };\n return Renderer;\n }());\n SplitPanel.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n SplitPanel.defaultRenderer = new Renderer();\n /**\n * Get the split panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @returns The split panel stretch factor for the widget.\n */\n function getStretch(widget) {\n return splitlayout.SplitLayout.getStretch(widget);\n }\n SplitPanel.getStretch = getStretch;\n /**\n * Set the split panel stretch factor for the given widget.\n *\n * @param widget - The widget of interest.\n *\n * @param value - The value for the stretch factor.\n */\n function setStretch(widget, value) {\n splitlayout.SplitLayout.setStretch(widget, value);\n }\n SplitPanel.setStretch = setStretch;\n})(exports.SplitPanel || (exports.SplitPanel = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a split layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new splitlayout.SplitLayout({\n renderer: options.renderer || exports.SplitPanel.defaultRenderer,\n orientation: options.orientation,\n alignment: options.alignment,\n spacing: options.spacing\n });\n }\n Private.createLayout = createLayout;\n})(Private || (Private = {}));\n//# sourceMappingURL=splitpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/splitpanel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/stackedlayout.js": │ │ │ │ /*!*************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/stackedlayout.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/stackedlayout.js ***! │ │ │ │ \*************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\n\n/**\n * A layout where visible widgets are stacked atop one another.\n *\n * #### Notes\n * The Z-order of the visible widgets follows their layout order.\n */\nvar StackedLayout = /** @class */ (function (_super) {\n tslib.__extends(StackedLayout, _super);\n function StackedLayout() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._dirty = false;\n _this._items = [];\n _this._box = null;\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n StackedLayout.prototype.dispose = function () {\n // Dispose of the layout items.\n algorithm.each(this._items, function (item) { item.dispose(); });\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n // Dispose of the rest of the layout.\n _super.prototype.dispose.call(this);\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n StackedLayout.prototype.attachWidget = function (index, widget$1) {\n // Create and add a new layout item for the widget.\n algorithm.ArrayExt.insert(this._items, index, new layout.LayoutItem(widget$1));\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n StackedLayout.prototype.moveWidget = function (fromIndex, toIndex, widget) {\n // Move the layout item for the widget.\n algorithm.ArrayExt.move(this._items, fromIndex, toIndex);\n // Post an update request for the parent widget.\n this.parent.update();\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n StackedLayout.prototype.detachWidget = function (index, widget$1) {\n // Remove the layout item for the widget.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Reset the z-index for the widget.\n item.widget.node.style.zIndex = '';\n // Dispose of the layout item.\n item.dispose();\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n StackedLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n StackedLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n StackedLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n StackedLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n StackedLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n StackedLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n StackedLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n StackedLayout.prototype._fit = function () {\n // Set up the computed minimum size.\n var minW = 0;\n var minH = 0;\n // Update the computed minimum size.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Update the size limits for the item.\n item.fit();\n // Update the computed minimum size.\n minW = Math.max(minW, item.minWidth);\n minH = Math.max(minH, item.minHeight);\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n StackedLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Compute the visible item count.\n var nVisible = 0;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Bail early if there are no visible items to layout.\n if (nVisible === 0) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the actual layout bounds adjusted for border and padding.\n var top = this._box.paddingTop;\n var left = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Update the widget stacking order and layout geometry.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Set the z-index for the widget.\n item.widget.node.style.zIndex = \"\" + i;\n // Update the item geometry.\n item.update(left, top, width, height);\n }\n };\n return StackedLayout;\n}(panellayout.PanelLayout));\n\nexports.StackedLayout = StackedLayout;\n//# sourceMappingURL=stackedlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/stackedlayout.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\n__webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar layout = __webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\nvar panellayout = __webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\n\n/**\n * A layout where visible widgets are stacked atop one another.\n *\n * #### Notes\n * The Z-order of the visible widgets follows their layout order.\n */\nvar StackedLayout = /** @class */ (function (_super) {\n tslib.__extends(StackedLayout, _super);\n function StackedLayout() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._dirty = false;\n _this._items = [];\n _this._box = null;\n return _this;\n }\n /**\n * Dispose of the resources held by the layout.\n */\n StackedLayout.prototype.dispose = function () {\n // Dispose of the layout items.\n algorithm.each(this._items, function (item) { item.dispose(); });\n // Clear the layout state.\n this._box = null;\n this._items.length = 0;\n // Dispose of the rest of the layout.\n _super.prototype.dispose.call(this);\n };\n /**\n * Attach a widget to the parent's DOM node.\n *\n * @param index - The current index of the widget in the layout.\n *\n * @param widget - The widget to attach to the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n StackedLayout.prototype.attachWidget = function (index, widget$1) {\n // Create and add a new layout item for the widget.\n algorithm.ArrayExt.insert(this._items, index, new layout.LayoutItem(widget$1));\n // Send a `'before-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeAttach);\n }\n // Add the widget's node to the parent.\n this.parent.node.appendChild(widget$1.node);\n // Send an `'after-attach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterAttach);\n }\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * Move a widget in the parent's DOM node.\n *\n * @param fromIndex - The previous index of the widget in the layout.\n *\n * @param toIndex - The current index of the widget in the layout.\n *\n * @param widget - The widget to move in the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n StackedLayout.prototype.moveWidget = function (fromIndex, toIndex, widget) {\n // Move the layout item for the widget.\n algorithm.ArrayExt.move(this._items, fromIndex, toIndex);\n // Post an update request for the parent widget.\n this.parent.update();\n };\n /**\n * Detach a widget from the parent's DOM node.\n *\n * @param index - The previous index of the widget in the layout.\n *\n * @param widget - The widget to detach from the parent.\n *\n * #### Notes\n * This is a reimplementation of the superclass method.\n */\n StackedLayout.prototype.detachWidget = function (index, widget$1) {\n // Remove the layout item for the widget.\n var item = algorithm.ArrayExt.removeAt(this._items, index);\n // Send a `'before-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.BeforeDetach);\n }\n // Remove the widget's node from the parent.\n this.parent.node.removeChild(widget$1.node);\n // Send an `'after-detach'` message if the parent is attached.\n if (this.parent.isAttached) {\n messaging.MessageLoop.sendMessage(widget$1, widget.Widget.Msg.AfterDetach);\n }\n // Reset the z-index for the widget.\n item.widget.node.style.zIndex = '';\n // Dispose of the layout item.\n item.dispose();\n // Post a fit request for the parent widget.\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'before-show'` message.\n */\n StackedLayout.prototype.onBeforeShow = function (msg) {\n _super.prototype.onBeforeShow.call(this, msg);\n this.parent.update();\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n StackedLayout.prototype.onBeforeAttach = function (msg) {\n _super.prototype.onBeforeAttach.call(this, msg);\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-shown'` message.\n */\n StackedLayout.prototype.onChildShown = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'child-hidden'` message.\n */\n StackedLayout.prototype.onChildHidden = function (msg) {\n this.parent.fit();\n };\n /**\n * A message handler invoked on a `'resize'` message.\n */\n StackedLayout.prototype.onResize = function (msg) {\n if (this.parent.isVisible) {\n this._update(msg.width, msg.height);\n }\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n StackedLayout.prototype.onUpdateRequest = function (msg) {\n if (this.parent.isVisible) {\n this._update(-1, -1);\n }\n };\n /**\n * A message handler invoked on a `'fit-request'` message.\n */\n StackedLayout.prototype.onFitRequest = function (msg) {\n if (this.parent.isAttached) {\n this._fit();\n }\n };\n /**\n * Fit the layout to the total size required by the widgets.\n */\n StackedLayout.prototype._fit = function () {\n // Set up the computed minimum size.\n var minW = 0;\n var minH = 0;\n // Update the computed minimum size.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Update the size limits for the item.\n item.fit();\n // Update the computed minimum size.\n minW = Math.max(minW, item.minWidth);\n minH = Math.max(minH, item.minHeight);\n }\n // Update the box sizing and add it to the computed min size.\n var box = this._box = domutils.ElementExt.boxSizing(this.parent.node);\n minW += box.horizontalSum;\n minH += box.verticalSum;\n // Update the parent's min size constraints.\n var style = this.parent.node.style;\n style.minWidth = minW + \"px\";\n style.minHeight = minH + \"px\";\n // Set the dirty flag to ensure only a single update occurs.\n this._dirty = true;\n // Notify the ancestor that it should fit immediately. This may\n // cause a resize of the parent, fulfilling the required update.\n if (this.parent.parent) {\n messaging.MessageLoop.sendMessage(this.parent.parent, widget.Widget.Msg.FitRequest);\n }\n // If the dirty flag is still set, the parent was not resized.\n // Trigger the required update on the parent widget immediately.\n if (this._dirty) {\n messaging.MessageLoop.sendMessage(this.parent, widget.Widget.Msg.UpdateRequest);\n }\n };\n /**\n * Update the layout position and size of the widgets.\n *\n * The parent offset dimensions should be `-1` if unknown.\n */\n StackedLayout.prototype._update = function (offsetWidth, offsetHeight) {\n // Clear the dirty flag to indicate the update occurred.\n this._dirty = false;\n // Compute the visible item count.\n var nVisible = 0;\n for (var i = 0, n = this._items.length; i < n; ++i) {\n nVisible += +!this._items[i].isHidden;\n }\n // Bail early if there are no visible items to layout.\n if (nVisible === 0) {\n return;\n }\n // Measure the parent if the offset dimensions are unknown.\n if (offsetWidth < 0) {\n offsetWidth = this.parent.node.offsetWidth;\n }\n if (offsetHeight < 0) {\n offsetHeight = this.parent.node.offsetHeight;\n }\n // Ensure the parent box sizing data is computed.\n if (!this._box) {\n this._box = domutils.ElementExt.boxSizing(this.parent.node);\n }\n // Compute the actual layout bounds adjusted for border and padding.\n var top = this._box.paddingTop;\n var left = this._box.paddingLeft;\n var width = offsetWidth - this._box.horizontalSum;\n var height = offsetHeight - this._box.verticalSum;\n // Update the widget stacking order and layout geometry.\n for (var i = 0, n = this._items.length; i < n; ++i) {\n // Fetch the item.\n var item = this._items[i];\n // Ignore hidden items.\n if (item.isHidden) {\n continue;\n }\n // Set the z-index for the widget.\n item.widget.node.style.zIndex = \"\" + i;\n // Update the item geometry.\n item.update(left, top, width, height);\n }\n };\n return StackedLayout;\n}(panellayout.PanelLayout));\n\nexports.StackedLayout = StackedLayout;\n//# sourceMappingURL=stackedlayout.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/stackedlayout.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/stackedpanel.js": │ │ │ │ /*!************************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/stackedpanel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/stackedpanel.js ***! │ │ │ │ \************************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n__webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n__webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar panel = __webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\nvar stackedlayout = __webpack_require__(/*! ./stackedlayout.js */ \"../../packages/widgets/dist/stackedlayout.js\");\n\n/**\n * A panel where visible widgets are stacked atop one another.\n *\n * #### Notes\n * This class provides a convenience wrapper around a [[StackedLayout]].\n */\nvar StackedPanel = /** @class */ (function (_super) {\n tslib.__extends(StackedPanel, _super);\n /**\n * Construct a new stacked panel.\n *\n * @param options - The options for initializing the panel.\n */\n function StackedPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { layout: Private.createLayout(options) }) || this;\n _this._widgetRemoved = new signaling.Signal(_this);\n _this.addClass('lm-StackedPanel');\n /* */\n _this.addClass('p-StackedPanel');\n return _this;\n /* */\n }\n Object.defineProperty(StackedPanel.prototype, \"widgetRemoved\", {\n /**\n * A signal emitted when a widget is removed from a stacked panel.\n */\n get: function () {\n return this._widgetRemoved;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n StackedPanel.prototype.onChildAdded = function (msg) {\n msg.child.addClass('lm-StackedPanel-child');\n /* */\n msg.child.addClass('p-StackedPanel-child');\n /* */\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n StackedPanel.prototype.onChildRemoved = function (msg) {\n msg.child.removeClass('lm-StackedPanel-child');\n /* */\n msg.child.removeClass('p-StackedPanel-child');\n /* */\n this._widgetRemoved.emit(msg.child);\n };\n return StackedPanel;\n}(panel.Panel));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a stacked layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new stackedlayout.StackedLayout();\n }\n Private.createLayout = createLayout;\n})(Private || (Private = {}));\n\nexports.StackedPanel = StackedPanel;\n//# sourceMappingURL=stackedpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/stackedpanel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\n__webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\n__webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n__webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n__webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar panel = __webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\nvar stackedlayout = __webpack_require__(/*! ./stackedlayout.js */ \"../../packages/widgets/dist/stackedlayout.js\");\n\n/**\n * A panel where visible widgets are stacked atop one another.\n *\n * #### Notes\n * This class provides a convenience wrapper around a [[StackedLayout]].\n */\nvar StackedPanel = /** @class */ (function (_super) {\n tslib.__extends(StackedPanel, _super);\n /**\n * Construct a new stacked panel.\n *\n * @param options - The options for initializing the panel.\n */\n function StackedPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { layout: Private.createLayout(options) }) || this;\n _this._widgetRemoved = new signaling.Signal(_this);\n _this.addClass('lm-StackedPanel');\n /* */\n _this.addClass('p-StackedPanel');\n return _this;\n /* */\n }\n Object.defineProperty(StackedPanel.prototype, \"widgetRemoved\", {\n /**\n * A signal emitted when a widget is removed from a stacked panel.\n */\n get: function () {\n return this._widgetRemoved;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A message handler invoked on a `'child-added'` message.\n */\n StackedPanel.prototype.onChildAdded = function (msg) {\n msg.child.addClass('lm-StackedPanel-child');\n /* */\n msg.child.addClass('p-StackedPanel-child');\n /* */\n };\n /**\n * A message handler invoked on a `'child-removed'` message.\n */\n StackedPanel.prototype.onChildRemoved = function (msg) {\n msg.child.removeClass('lm-StackedPanel-child');\n /* */\n msg.child.removeClass('p-StackedPanel-child');\n /* */\n this._widgetRemoved.emit(msg.child);\n };\n return StackedPanel;\n}(panel.Panel));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Create a stacked layout for the given panel options.\n */\n function createLayout(options) {\n return options.layout || new stackedlayout.StackedLayout();\n }\n Private.createLayout = createLayout;\n})(Private || (Private = {}));\n\nexports.StackedPanel = StackedPanel;\n//# sourceMappingURL=stackedpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/stackedpanel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/tabbar.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/tabbar.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/tabbar.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar title = __webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar virtualdom = __webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\n\n/**\n * A widget which displays titles as a single row or column of tabs.\n *\n * #### Notes\n * If CSS transforms are used to rotate nodes for vertically oriented\n * text, then tab dragging will not work correctly. The `tabsMovable`\n * property should be set to `false` when rotating nodes from CSS.\n */\nexports.TabBar = /** @class */ (function (_super) {\n tslib.__extends(TabBar, _super);\n /**\n * Construct a new tab bar.\n *\n * @param options - The options for initializing the tab bar.\n */\n function TabBar(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._currentIndex = -1;\n _this._titles = [];\n _this._titlesEditable = false;\n _this._previousTitle = null;\n _this._dragData = null;\n _this._tabMoved = new signaling.Signal(_this);\n _this._currentChanged = new signaling.Signal(_this);\n _this._tabCloseRequested = new signaling.Signal(_this);\n _this._tabDetachRequested = new signaling.Signal(_this);\n _this._tabActivateRequested = new signaling.Signal(_this);\n _this.addClass('lm-TabBar');\n /* */\n _this.addClass('p-TabBar');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n _this.tabsMovable = options.tabsMovable || false;\n _this.titlesEditable = options.titlesEditable || false;\n _this.allowDeselect = options.allowDeselect || false;\n _this.insertBehavior = options.insertBehavior || 'select-tab-if-needed';\n _this.removeBehavior = options.removeBehavior || 'select-tab-after';\n _this.renderer = options.renderer || TabBar.defaultRenderer;\n _this._orientation = options.orientation || 'horizontal';\n _this.dataset['orientation'] = _this._orientation;\n return _this;\n }\n /**\n * Dispose of the resources held by the widget.\n */\n TabBar.prototype.dispose = function () {\n this._releaseMouse();\n this._titles.length = 0;\n this._previousTitle = null;\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(TabBar.prototype, \"currentChanged\", {\n /**\n * A signal emitted when the current tab is changed.\n *\n * #### Notes\n * This signal is emitted when the currently selected tab is changed\n * either through user or programmatic interaction.\n *\n * Notably, this signal is not emitted when the index of the current\n * tab changes due to tabs being inserted, removed, or moved. It is\n * only emitted when the actual current tab node is changed.\n */\n get: function () {\n return this._currentChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"tabMoved\", {\n /**\n * A signal emitted when a tab is moved by the user.\n *\n * #### Notes\n * This signal is emitted when a tab is moved by user interaction.\n *\n * This signal is not emitted when a tab is moved programmatically.\n */\n get: function () {\n return this._tabMoved;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"tabActivateRequested\", {\n /**\n * A signal emitted when a tab is clicked by the user.\n *\n * #### Notes\n * If the clicked tab is not the current tab, the clicked tab will be\n * made current and the `currentChanged` signal will be emitted first.\n *\n * This signal is emitted even if the clicked tab is the current tab.\n */\n get: function () {\n return this._tabActivateRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"tabCloseRequested\", {\n /**\n * A signal emitted when a tab close icon is clicked.\n *\n * #### Notes\n * This signal is not emitted unless the tab title is `closable`.\n */\n get: function () {\n return this._tabCloseRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"tabDetachRequested\", {\n /**\n * A signal emitted when a tab is dragged beyond the detach threshold.\n *\n * #### Notes\n * This signal is emitted when the user drags a tab with the mouse,\n * and mouse is dragged beyond the detach threshold.\n *\n * The consumer of the signal should call `releaseMouse` and remove\n * the tab in order to complete the detach.\n *\n * This signal is only emitted once per drag cycle.\n */\n get: function () {\n return this._tabDetachRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"titlesEditable\", {\n /**\n * Whether the titles can be user-edited.\n *\n */\n get: function () {\n return this._titlesEditable;\n },\n /**\n * Set whether titles can be user edited.\n *\n */\n set: function (value) {\n this._titlesEditable = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"currentTitle\", {\n /**\n * Get the currently selected title.\n *\n * #### Notes\n * This will be `null` if no tab is selected.\n */\n get: function () {\n return this._titles[this._currentIndex] || null;\n },\n /**\n * Set the currently selected title.\n *\n * #### Notes\n * If the title does not exist, the title will be set to `null`.\n */\n set: function (value) {\n this.currentIndex = value ? this._titles.indexOf(value) : -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"currentIndex\", {\n /**\n * Get the index of the currently selected tab.\n *\n * #### Notes\n * This will be `-1` if no tab is selected.\n */\n get: function () {\n return this._currentIndex;\n },\n /**\n * Set the index of the currently selected tab.\n *\n * #### Notes\n * If the value is out of range, the index will be set to `-1`.\n */\n set: function (value) {\n // Adjust for an out of range index.\n if (value < 0 || value >= this._titles.length) {\n value = -1;\n }\n // Bail early if the index will not change.\n if (this._currentIndex === value) {\n return;\n }\n // Look up the previous index and title.\n var pi = this._currentIndex;\n var pt = this._titles[pi] || null;\n // Look up the current index and title.\n var ci = value;\n var ct = this._titles[ci] || null;\n // Update the current index and previous title.\n this._currentIndex = ci;\n this._previousTitle = pt;\n // Schedule an update of the tabs.\n this.update();\n // Emit the current changed signal.\n this._currentChanged.emit({\n previousIndex: pi, previousTitle: pt,\n currentIndex: ci, currentTitle: ct\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"orientation\", {\n /**\n * Get the orientation of the tab bar.\n *\n * #### Notes\n * This controls whether the tabs are arranged in a row or column.\n */\n get: function () {\n return this._orientation;\n },\n /**\n * Set the orientation of the tab bar.\n *\n * #### Notes\n * This controls whether the tabs are arranged in a row or column.\n */\n set: function (value) {\n // Do nothing if the orientation does not change.\n if (this._orientation === value) {\n return;\n }\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Toggle the orientation values.\n this._orientation = value;\n this.dataset['orientation'] = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"titles\", {\n /**\n * A read-only array of the titles in the tab bar.\n */\n get: function () {\n return this._titles;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"contentNode\", {\n /**\n * The tab bar content node.\n *\n * #### Notes\n * This is the node which holds the tab nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-TabBar-content')[0];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add a tab to the end of the tab bar.\n *\n * @param value - The title which holds the data for the tab,\n * or an options object to convert to a title.\n *\n * @returns The title object added to the tab bar.\n *\n * #### Notes\n * If the title is already added to the tab bar, it will be moved.\n */\n TabBar.prototype.addTab = function (value) {\n return this.insertTab(this._titles.length, value);\n };\n /**\n * Insert a tab into the tab bar at the specified index.\n *\n * @param index - The index at which to insert the tab.\n *\n * @param value - The title which holds the data for the tab,\n * or an options object to convert to a title.\n *\n * @returns The title object added to the tab bar.\n *\n * #### Notes\n * The index will be clamped to the bounds of the tabs.\n *\n * If the title is already added to the tab bar, it will be moved.\n */\n TabBar.prototype.insertTab = function (index, value) {\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Coerce the value to a title.\n var title = Private.asTitle(value);\n // Look up the index of the title.\n var i = this._titles.indexOf(title);\n // Clamp the insert index to the array bounds.\n var j = Math.max(0, Math.min(index, this._titles.length));\n // If the title is not in the array, insert it.\n if (i === -1) {\n // Insert the title into the array.\n algorithm.ArrayExt.insert(this._titles, j, title);\n // Connect to the title changed signal.\n title.changed.connect(this._onTitleChanged, this);\n // Schedule an update of the tabs.\n this.update();\n // Adjust the current index for the insert.\n this._adjustCurrentForInsert(j, title);\n // Return the title added to the tab bar.\n return title;\n }\n // Otherwise, the title exists in the array and should be moved.\n // Adjust the index if the location is at the end of the array.\n if (j === this._titles.length) {\n j--;\n }\n // Bail if there is no effective move.\n if (i === j) {\n return title;\n }\n // Move the title to the new location.\n algorithm.ArrayExt.move(this._titles, i, j);\n // Schedule an update of the tabs.\n this.update();\n // Adjust the current index for the move.\n this._adjustCurrentForMove(i, j);\n // Return the title added to the tab bar.\n return title;\n };\n /**\n * Remove a tab from the tab bar.\n *\n * @param title - The title for the tab to remove.\n *\n * #### Notes\n * This is a no-op if the title is not in the tab bar.\n */\n TabBar.prototype.removeTab = function (title) {\n this.removeTabAt(this._titles.indexOf(title));\n };\n /**\n * Remove the tab at a given index from the tab bar.\n *\n * @param index - The index of the tab to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n TabBar.prototype.removeTabAt = function (index) {\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Remove the title from the array.\n var title = algorithm.ArrayExt.removeAt(this._titles, index);\n // Bail if the index is out of range.\n if (!title) {\n return;\n }\n // Disconnect from the title changed signal.\n title.changed.disconnect(this._onTitleChanged, this);\n // Clear the previous title if it's being removed.\n if (title === this._previousTitle) {\n this._previousTitle = null;\n }\n // Schedule an update of the tabs.\n this.update();\n // Adjust the current index for the remove.\n this._adjustCurrentForRemove(index, title);\n };\n /**\n * Remove all tabs from the tab bar.\n */\n TabBar.prototype.clearTabs = function () {\n // Bail if there is nothing to remove.\n if (this._titles.length === 0) {\n return;\n }\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Disconnect from the title changed signals.\n for (var _i = 0, _a = this._titles; _i < _a.length; _i++) {\n var title = _a[_i];\n title.changed.disconnect(this._onTitleChanged, this);\n }\n // Get the current index and title.\n var pi = this.currentIndex;\n var pt = this.currentTitle;\n // Reset the current index and previous title.\n this._currentIndex = -1;\n this._previousTitle = null;\n // Clear the title array.\n this._titles.length = 0;\n // Schedule an update of the tabs.\n this.update();\n // If no tab was selected, there's nothing else to do.\n if (pi === -1) {\n return;\n }\n // Emit the current changed signal.\n this._currentChanged.emit({\n previousIndex: pi, previousTitle: pt,\n currentIndex: -1, currentTitle: null\n });\n };\n /**\n * Release the mouse and restore the non-dragged tab positions.\n *\n * #### Notes\n * This will cause the tab bar to stop handling mouse events and to\n * restore the tabs to their non-dragged positions.\n */\n TabBar.prototype.releaseMouse = function () {\n this._releaseMouse();\n };\n /**\n * Handle the DOM events for the tab bar.\n *\n * @param event - The DOM event sent to the tab bar.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the tab bar's DOM node.\n *\n * This should not be called directly by user code.\n */\n TabBar.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'dblclick':\n this._evtDblClick(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n TabBar.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('mousedown', this);\n this.node.addEventListener('dblclick', this);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n TabBar.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('mousedown', this);\n this.node.removeEventListener('dblclick', this);\n this._releaseMouse();\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n TabBar.prototype.onUpdateRequest = function (msg) {\n var titles = this._titles;\n var renderer = this.renderer;\n var currentTitle = this.currentTitle;\n var content = new Array(titles.length);\n for (var i = 0, n = titles.length; i < n; ++i) {\n var title = titles[i];\n var current = title === currentTitle;\n var zIndex = current ? n : n - i - 1;\n content[i] = renderer.renderTab({ title: title, current: current, zIndex: zIndex });\n }\n virtualdom.VirtualDOM.render(content, this.contentNode);\n };\n /**\n * Handle the `'dblclick'` event for the tab bar.\n */\n TabBar.prototype._evtDblClick = function (event) {\n // Do nothing if titles are not editable\n if (!this.titlesEditable) {\n return;\n }\n var tabs = this.contentNode.children;\n // Find the index of the released tab.\n var index = algorithm.ArrayExt.findFirstIndex(tabs, function (tab) {\n return domutils.ElementExt.hitTest(tab, event.clientX, event.clientY);\n });\n // Do nothing if the press is not on a tab.\n if (index === -1) {\n return;\n }\n var title = this.titles[index];\n var label = tabs[index].querySelector('.lm-TabBar-tabLabel');\n if (label && label.contains(event.target)) {\n var value = title.label || '';\n // Clear the label element\n var oldValue_1 = label.innerHTML;\n label.innerHTML = \"\";\n var input_1 = document.createElement('input');\n input_1.classList.add('lm-TabBar-tabInput');\n input_1.value = value;\n label.appendChild(input_1);\n var onblur_1 = function () {\n input_1.removeEventListener('blur', onblur_1);\n label.innerHTML = oldValue_1;\n };\n input_1.addEventListener('dblclick', function (event) { return event.stopPropagation(); });\n input_1.addEventListener('blur', onblur_1);\n input_1.addEventListener('keydown', function (event) {\n if (event.key === 'Enter') {\n if (input_1.value !== '') {\n title.label = title.caption = input_1.value;\n }\n onblur_1();\n }\n else if (event.key === 'Escape') {\n onblur_1();\n }\n });\n input_1.select();\n input_1.focus();\n if (label.children.length > 0) {\n label.children[0].focus();\n }\n }\n };\n /**\n * Handle the `'keydown'` event for the tab bar.\n */\n TabBar.prototype._evtKeyDown = function (event) {\n // Stop all input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse if `Escape` is pressed.\n if (event.keyCode === 27) {\n this._releaseMouse();\n }\n };\n /**\n * Handle the `'mousedown'` event for the tab bar.\n */\n TabBar.prototype._evtMouseDown = function (event) {\n // Do nothing if it's not a left or middle mouse press.\n if (event.button !== 0 && event.button !== 1) {\n return;\n }\n // Do nothing if a drag is in progress.\n if (this._dragData) {\n return;\n }\n // Lookup the tab nodes.\n var tabs = this.contentNode.children;\n // Find the index of the pressed tab.\n var index = algorithm.ArrayExt.findFirstIndex(tabs, function (tab) {\n return domutils.ElementExt.hitTest(tab, event.clientX, event.clientY);\n });\n // Do nothing if the press is not on a tab.\n if (index === -1) {\n return;\n }\n // Pressing on a tab stops the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Initialize the non-measured parts of the drag data.\n this._dragData = {\n tab: tabs[index],\n index: index,\n pressX: event.clientX,\n pressY: event.clientY,\n tabPos: -1,\n tabSize: -1,\n tabPressPos: -1,\n targetIndex: -1,\n tabLayout: null,\n contentRect: null,\n override: null,\n dragActive: false,\n dragAborted: false,\n detachRequested: false\n };\n // Add the document mouse up listener.\n document.addEventListener('mouseup', this, true);\n // Do nothing else if the middle button is clicked.\n if (event.button === 1) {\n return;\n }\n // Do nothing else if the close icon is clicked.\n var icon = tabs[index].querySelector(this.renderer.closeIconSelector);\n if (icon && icon.contains(event.target)) {\n return;\n }\n // Add the extra listeners if the tabs are movable.\n if (this.tabsMovable) {\n document.addEventListener('mousemove', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('contextmenu', this, true);\n }\n // Update the current index as appropriate.\n if (this.allowDeselect && this.currentIndex === index) {\n this.currentIndex = -1;\n }\n else {\n this.currentIndex = index;\n }\n // Do nothing else if there is no current tab.\n if (this.currentIndex === -1) {\n return;\n }\n // Emit the tab activate request signal.\n this._tabActivateRequested.emit({\n index: this.currentIndex,\n title: this.currentTitle\n });\n };\n /**\n * Handle the `'mousemove'` event for the tab bar.\n */\n TabBar.prototype._evtMouseMove = function (event) {\n // Do nothing if no drag is in progress.\n var data = this._dragData;\n if (!data) {\n return;\n }\n // Suppress the event during a drag.\n event.preventDefault();\n event.stopPropagation();\n // Lookup the tab nodes.\n var tabs = this.contentNode.children;\n // Bail early if the drag threshold has not been met.\n if (!data.dragActive && !Private.dragExceeded(data, event)) {\n return;\n }\n // Activate the drag if necessary.\n if (!data.dragActive) {\n // Fill in the rest of the drag data measurements.\n var tabRect = data.tab.getBoundingClientRect();\n if (this._orientation === 'horizontal') {\n data.tabPos = data.tab.offsetLeft;\n data.tabSize = tabRect.width;\n data.tabPressPos = data.pressX - tabRect.left;\n }\n else {\n data.tabPos = data.tab.offsetTop;\n data.tabSize = tabRect.height;\n data.tabPressPos = data.pressY - tabRect.top;\n }\n data.tabLayout = Private.snapTabLayout(tabs, this._orientation);\n data.contentRect = this.contentNode.getBoundingClientRect();\n data.override = dragdrop.Drag.overrideCursor('default');\n // Add the dragging style classes.\n data.tab.classList.add('lm-mod-dragging');\n this.addClass('lm-mod-dragging');\n /* */\n data.tab.classList.add('p-mod-dragging');\n this.addClass('p-mod-dragging');\n /* */\n // Mark the drag as active.\n data.dragActive = true;\n }\n // Emit the detach requested signal if the threshold is exceeded.\n if (!data.detachRequested && Private.detachExceeded(data, event)) {\n // Only emit the signal once per drag cycle.\n data.detachRequested = true;\n // Setup the arguments for the signal.\n var index = data.index;\n var clientX = event.clientX;\n var clientY = event.clientY;\n var tab = tabs[index];\n var title = this._titles[index];\n // Emit the tab detach requested signal.\n this._tabDetachRequested.emit({ index: index, title: title, tab: tab, clientX: clientX, clientY: clientY });\n // Bail if the signal handler aborted the drag.\n if (data.dragAborted) {\n return;\n }\n }\n // Update the positions of the tabs.\n Private.layoutTabs(tabs, data, event, this._orientation);\n };\n /**\n * Handle the `'mouseup'` event for the document.\n */\n TabBar.prototype._evtMouseUp = function (event) {\n var _this = this;\n // Do nothing if it's not a left or middle mouse release.\n if (event.button !== 0 && event.button !== 1) {\n return;\n }\n // Do nothing if no drag is in progress.\n var data = this._dragData;\n if (!data) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Remove the extra mouse event listeners.\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('contextmenu', this, true);\n // Handle a release when the drag is not active.\n if (!data.dragActive) {\n // Clear the drag data.\n this._dragData = null;\n // Lookup the tab nodes.\n var tabs = this.contentNode.children;\n // Find the index of the released tab.\n var index = algorithm.ArrayExt.findFirstIndex(tabs, function (tab) {\n return domutils.ElementExt.hitTest(tab, event.clientX, event.clientY);\n });\n // Do nothing if the release is not on the original pressed tab.\n if (index !== data.index) {\n return;\n }\n // Ignore the release if the title is not closable.\n var title = this._titles[index];\n if (!title.closable) {\n return;\n }\n // Emit the close requested signal if the middle button is released.\n if (event.button === 1) {\n this._tabCloseRequested.emit({ index: index, title: title });\n return;\n }\n // Emit the close requested signal if the close icon was released.\n var icon = tabs[index].querySelector(this.renderer.closeIconSelector);\n if (icon && icon.contains(event.target)) {\n this._tabCloseRequested.emit({ index: index, title: title });\n return;\n }\n // Otherwise, there is nothing left to do.\n return;\n }\n // Do nothing if the left button is not released.\n if (event.button !== 0) {\n return;\n }\n // Position the tab at its final resting position.\n Private.finalizeTabPosition(data, this._orientation);\n // Remove the dragging class from the tab so it can be transitioned.\n data.tab.classList.remove('lm-mod-dragging');\n /* */\n data.tab.classList.remove('p-mod-dragging');\n /* */\n // Parse the transition duration for releasing the tab.\n var duration = Private.parseTransitionDuration(data.tab);\n // Complete the release on a timer to allow the tab to transition.\n setTimeout(function () {\n // Do nothing if the drag has been aborted.\n if (data.dragAborted) {\n return;\n }\n // Clear the drag data reference.\n _this._dragData = null;\n // Reset the positions of the tabs.\n Private.resetTabPositions(_this.contentNode.children, _this._orientation);\n // Clear the cursor grab.\n data.override.dispose();\n // Remove the remaining dragging style.\n _this.removeClass('lm-mod-dragging');\n /* */\n _this.removeClass('p-mod-dragging');\n /* */\n // If the tab was not moved, there is nothing else to do.\n var i = data.index;\n var j = data.targetIndex;\n if (j === -1 || i === j) {\n return;\n }\n // Move the title to the new locations.\n algorithm.ArrayExt.move(_this._titles, i, j);\n // Adjust the current index for the move.\n _this._adjustCurrentForMove(i, j);\n // Emit the tab moved signal.\n _this._tabMoved.emit({\n fromIndex: i, toIndex: j, title: _this._titles[j]\n });\n // Update the tabs immediately to prevent flicker.\n messaging.MessageLoop.sendMessage(_this, widget.Widget.Msg.UpdateRequest);\n }, duration);\n };\n /**\n * Release the mouse and restore the non-dragged tab positions.\n */\n TabBar.prototype._releaseMouse = function () {\n // Do nothing if no drag is in progress.\n var data = this._dragData;\n if (!data) {\n return;\n }\n // Clear the drag data reference.\n this._dragData = null;\n // Remove the extra mouse listeners.\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('contextmenu', this, true);\n // Indicate the drag has been aborted. This allows the mouse\n // event handlers to return early when the drag is canceled.\n data.dragAborted = true;\n // If the drag is not active, there's nothing more to do.\n if (!data.dragActive) {\n return;\n }\n // Reset the tabs to their non-dragged positions.\n Private.resetTabPositions(this.contentNode.children, this._orientation);\n // Clear the cursor override.\n data.override.dispose();\n // Clear the dragging style classes.\n data.tab.classList.remove('lm-mod-dragging');\n this.removeClass('lm-mod-dragging');\n /* */\n data.tab.classList.remove('p-mod-dragging');\n this.removeClass('p-mod-dragging');\n /* */\n };\n /**\n * Adjust the current index for a tab insert operation.\n *\n * This method accounts for the tab bar's insertion behavior when\n * adjusting the current index and emitting the changed signal.\n */\n TabBar.prototype._adjustCurrentForInsert = function (i, title) {\n // Lookup commonly used variables.\n var ct = this.currentTitle;\n var ci = this._currentIndex;\n var bh = this.insertBehavior;\n // Handle the behavior where the new tab is always selected,\n // or the behavior where the new tab is selected if needed.\n if (bh === 'select-tab' || (bh === 'select-tab-if-needed' && ci === -1)) {\n this._currentIndex = i;\n this._previousTitle = ct;\n this._currentChanged.emit({\n previousIndex: ci, previousTitle: ct,\n currentIndex: i, currentTitle: title\n });\n return;\n }\n // Otherwise, silently adjust the current index if needed.\n if (ci >= i) {\n this._currentIndex++;\n }\n };\n /**\n * Adjust the current index for a tab move operation.\n *\n * This method will not cause the actual current tab to change.\n * It silently adjusts the index to account for the given move.\n */\n TabBar.prototype._adjustCurrentForMove = function (i, j) {\n if (this._currentIndex === i) {\n this._currentIndex = j;\n }\n else if (this._currentIndex < i && this._currentIndex >= j) {\n this._currentIndex++;\n }\n else if (this._currentIndex > i && this._currentIndex <= j) {\n this._currentIndex--;\n }\n };\n /**\n * Adjust the current index for a tab remove operation.\n *\n * This method accounts for the tab bar's remove behavior when\n * adjusting the current index and emitting the changed signal.\n */\n TabBar.prototype._adjustCurrentForRemove = function (i, title) {\n // Lookup commonly used variables.\n var ci = this._currentIndex;\n var bh = this.removeBehavior;\n // Silently adjust the index if the current tab is not removed.\n if (ci !== i) {\n if (ci > i) {\n this._currentIndex--;\n }\n return;\n }\n // No tab gets selected if the tab bar is empty.\n if (this._titles.length === 0) {\n this._currentIndex = -1;\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: -1, currentTitle: null\n });\n return;\n }\n // Handle behavior where the next sibling tab is selected.\n if (bh === 'select-tab-after') {\n this._currentIndex = Math.min(i, this._titles.length - 1);\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: this._currentIndex, currentTitle: this.currentTitle\n });\n return;\n }\n // Handle behavior where the previous sibling tab is selected.\n if (bh === 'select-tab-before') {\n this._currentIndex = Math.max(0, i - 1);\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: this._currentIndex, currentTitle: this.currentTitle\n });\n return;\n }\n // Handle behavior where the previous history tab is selected.\n if (bh === 'select-previous-tab') {\n if (this._previousTitle) {\n this._currentIndex = this._titles.indexOf(this._previousTitle);\n this._previousTitle = null;\n }\n else {\n this._currentIndex = Math.min(i, this._titles.length - 1);\n }\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: this._currentIndex, currentTitle: this.currentTitle\n });\n return;\n }\n // Otherwise, no tab gets selected.\n this._currentIndex = -1;\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: -1, currentTitle: null\n });\n };\n /**\n * Handle the `changed` signal of a title object.\n */\n TabBar.prototype._onTitleChanged = function (sender) {\n this.update();\n };\n return TabBar;\n}(widget.Widget));\n/**\n * The namespace for the `TabBar` class statics.\n */\n(function (TabBar) {\n /**\n * The default implementation of `IRenderer`.\n *\n * #### Notes\n * Subclasses are free to reimplement rendering methods as needed.\n */\n var Renderer = /** @class */ (function () {\n /**\n * Construct a new renderer.\n */\n function Renderer() {\n /**\n * A selector which matches the close icon node in a tab.\n */\n this.closeIconSelector = '.lm-TabBar-tabCloseIcon';\n this._tabID = 0;\n this._tabKeys = new WeakMap();\n }\n /**\n * Render the virtual element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab.\n */\n Renderer.prototype.renderTab = function (data) {\n var title = data.title.caption;\n var key = this.createTabKey(data);\n var style = this.createTabStyle(data);\n var className = this.createTabClass(data);\n var dataset = this.createTabDataset(data);\n return (virtualdom.h.li({ key: key, className: className, title: title, style: style, dataset: dataset }, this.renderIcon(data), this.renderLabel(data), this.renderCloseIcon(data)));\n };\n /**\n * Render the icon element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab icon.\n */\n Renderer.prototype.renderIcon = function (data) {\n var title = data.title;\n var className = this.createIconClass(data);\n /* */\n if (typeof title.icon === 'string') {\n return virtualdom.h.div({ className: className }, title.iconLabel);\n }\n /* */\n // if title.icon is undefined, it will be ignored\n return virtualdom.h.div({ className: className }, title.icon, title.iconLabel);\n };\n /**\n * Render the label element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab label.\n */\n Renderer.prototype.renderLabel = function (data) {\n return virtualdom.h.div({\n className: 'lm-TabBar-tabLabel'\n /* */\n + ' p-TabBar-tabLabel'\n /* */\n }, data.title.label);\n };\n /**\n * Render the close icon element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab close icon.\n */\n Renderer.prototype.renderCloseIcon = function (data) {\n return virtualdom.h.div({\n className: 'lm-TabBar-tabCloseIcon'\n /* */\n + ' p-TabBar-tabCloseIcon'\n /* */\n });\n };\n /**\n * Create a unique render key for the tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The unique render key for the tab.\n *\n * #### Notes\n * This method caches the key against the tab title the first time\n * the key is generated. This enables efficient rendering of moved\n * tabs and avoids subtle hover style artifacts.\n */\n Renderer.prototype.createTabKey = function (data) {\n var key = this._tabKeys.get(data.title);\n if (key === undefined) {\n key = \"tab-key-\" + this._tabID++;\n this._tabKeys.set(data.title, key);\n }\n return key;\n };\n /**\n * Create the inline style object for a tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The inline style data for the tab.\n */\n Renderer.prototype.createTabStyle = function (data) {\n return { zIndex: \"\" + data.zIndex };\n };\n /**\n * Create the class name for the tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The full class name for the tab.\n */\n Renderer.prototype.createTabClass = function (data) {\n var name = 'lm-TabBar-tab';\n /* */\n name += ' p-TabBar-tab';\n /* */\n if (data.title.className) {\n name += \" \" + data.title.className;\n }\n if (data.title.closable) {\n name += ' lm-mod-closable';\n /* */\n name += ' p-mod-closable';\n /* */\n }\n if (data.current) {\n name += ' lm-mod-current';\n /* */\n name += ' p-mod-current';\n /* */\n }\n return name;\n };\n /**\n * Create the dataset for a tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The dataset for the tab.\n */\n Renderer.prototype.createTabDataset = function (data) {\n return data.title.dataset;\n };\n /**\n * Create the class name for the tab icon.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The full class name for the tab icon.\n */\n Renderer.prototype.createIconClass = function (data) {\n var name = 'lm-TabBar-tabIcon';\n /* */\n name += ' p-TabBar-tabIcon';\n /* */\n var extra = data.title.iconClass;\n return extra ? name + \" \" + extra : name;\n };\n return Renderer;\n }());\n TabBar.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n TabBar.defaultRenderer = new Renderer();\n})(exports.TabBar || (exports.TabBar = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The start drag distance threshold.\n */\n Private.DRAG_THRESHOLD = 5;\n /**\n * The detach distance threshold.\n */\n Private.DETACH_THRESHOLD = 20;\n /**\n * Create the DOM node for a tab bar.\n */\n function createNode() {\n var node = document.createElement('div');\n var content = document.createElement('ul');\n content.className = 'lm-TabBar-content';\n /* */\n content.classList.add('p-TabBar-content');\n /* */\n node.appendChild(content);\n return node;\n }\n Private.createNode = createNode;\n /**\n * Coerce a title or options into a real title.\n */\n function asTitle(value) {\n return value instanceof title.Title ? value : new title.Title(value);\n }\n Private.asTitle = asTitle;\n /**\n * Parse the transition duration for a tab node.\n */\n function parseTransitionDuration(tab) {\n var style = window.getComputedStyle(tab);\n return 1000 * (parseFloat(style.transitionDuration) || 0);\n }\n Private.parseTransitionDuration = parseTransitionDuration;\n /**\n * Get a snapshot of the current tab layout values.\n */\n function snapTabLayout(tabs, orientation) {\n var layout = new Array(tabs.length);\n for (var i = 0, n = tabs.length; i < n; ++i) {\n var node = tabs[i];\n var style = window.getComputedStyle(node);\n if (orientation === 'horizontal') {\n layout[i] = {\n pos: node.offsetLeft,\n size: node.offsetWidth,\n margin: parseFloat(style.marginLeft) || 0\n };\n }\n else {\n layout[i] = {\n pos: node.offsetTop,\n size: node.offsetHeight,\n margin: parseFloat(style.marginTop) || 0\n };\n }\n }\n return layout;\n }\n Private.snapTabLayout = snapTabLayout;\n /**\n * Test if the event exceeds the drag threshold.\n */\n function dragExceeded(data, event) {\n var dx = Math.abs(event.clientX - data.pressX);\n var dy = Math.abs(event.clientY - data.pressY);\n return dx >= Private.DRAG_THRESHOLD || dy >= Private.DRAG_THRESHOLD;\n }\n Private.dragExceeded = dragExceeded;\n /**\n * Test if the event exceeds the drag detach threshold.\n */\n function detachExceeded(data, event) {\n var rect = data.contentRect;\n return ((event.clientX < rect.left - Private.DETACH_THRESHOLD) ||\n (event.clientX >= rect.right + Private.DETACH_THRESHOLD) ||\n (event.clientY < rect.top - Private.DETACH_THRESHOLD) ||\n (event.clientY >= rect.bottom + Private.DETACH_THRESHOLD));\n }\n Private.detachExceeded = detachExceeded;\n /**\n * Update the relative tab positions and computed target index.\n */\n function layoutTabs(tabs, data, event, orientation) {\n // Compute the orientation-sensitive values.\n var pressPos;\n var localPos;\n var clientPos;\n var clientSize;\n if (orientation === 'horizontal') {\n pressPos = data.pressX;\n localPos = event.clientX - data.contentRect.left;\n clientPos = event.clientX;\n clientSize = data.contentRect.width;\n }\n else {\n pressPos = data.pressY;\n localPos = event.clientY - data.contentRect.top;\n clientPos = event.clientY;\n clientSize = data.contentRect.height;\n }\n // Compute the target data.\n var targetIndex = data.index;\n var targetPos = localPos - data.tabPressPos;\n var targetEnd = targetPos + data.tabSize;\n // Update the relative tab positions.\n for (var i = 0, n = tabs.length; i < n; ++i) {\n var pxPos = void 0;\n var layout = data.tabLayout[i];\n var threshold = layout.pos + (layout.size >> 1);\n if (i < data.index && targetPos < threshold) {\n pxPos = data.tabSize + data.tabLayout[i + 1].margin + \"px\";\n targetIndex = Math.min(targetIndex, i);\n }\n else if (i > data.index && targetEnd > threshold) {\n pxPos = -data.tabSize - layout.margin + \"px\";\n targetIndex = Math.max(targetIndex, i);\n }\n else if (i === data.index) {\n var ideal = clientPos - pressPos;\n var limit = clientSize - (data.tabPos + data.tabSize);\n pxPos = Math.max(-data.tabPos, Math.min(ideal, limit)) + \"px\";\n }\n else {\n pxPos = '';\n }\n if (orientation === 'horizontal') {\n tabs[i].style.left = pxPos;\n }\n else {\n tabs[i].style.top = pxPos;\n }\n }\n // Update the computed target index.\n data.targetIndex = targetIndex;\n }\n Private.layoutTabs = layoutTabs;\n /**\n * Position the drag tab at its final resting relative position.\n */\n function finalizeTabPosition(data, orientation) {\n // Compute the orientation-sensitive client size.\n var clientSize;\n if (orientation === 'horizontal') {\n clientSize = data.contentRect.width;\n }\n else {\n clientSize = data.contentRect.height;\n }\n // Compute the ideal final tab position.\n var ideal;\n if (data.targetIndex === data.index) {\n ideal = 0;\n }\n else if (data.targetIndex > data.index) {\n var tgt = data.tabLayout[data.targetIndex];\n ideal = tgt.pos + tgt.size - data.tabSize - data.tabPos;\n }\n else {\n var tgt = data.tabLayout[data.targetIndex];\n ideal = tgt.pos - data.tabPos;\n }\n // Compute the tab position limit.\n var limit = clientSize - (data.tabPos + data.tabSize);\n var final = Math.max(-data.tabPos, Math.min(ideal, limit));\n // Set the final orientation-sensitive position.\n if (orientation === 'horizontal') {\n data.tab.style.left = final + \"px\";\n }\n else {\n data.tab.style.top = final + \"px\";\n }\n }\n Private.finalizeTabPosition = finalizeTabPosition;\n /**\n * Reset the relative positions of the given tabs.\n */\n function resetTabPositions(tabs, orientation) {\n algorithm.each(tabs, function (tab) {\n if (orientation === 'horizontal') {\n tab.style.left = '';\n }\n else {\n tab.style.top = '';\n }\n });\n }\n Private.resetTabPositions = resetTabPositions;\n})(Private || (Private = {}));\n//# sourceMappingURL=tabbar.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/tabbar.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar title = __webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\nvar virtualdom = __webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\nvar dragdrop = __webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\n\n/**\n * A widget which displays titles as a single row or column of tabs.\n *\n * #### Notes\n * If CSS transforms are used to rotate nodes for vertically oriented\n * text, then tab dragging will not work correctly. The `tabsMovable`\n * property should be set to `false` when rotating nodes from CSS.\n */\nexports.TabBar = /** @class */ (function (_super) {\n tslib.__extends(TabBar, _super);\n /**\n * Construct a new tab bar.\n *\n * @param options - The options for initializing the tab bar.\n */\n function TabBar(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, { node: Private.createNode() }) || this;\n _this._currentIndex = -1;\n _this._titles = [];\n _this._titlesEditable = false;\n _this._previousTitle = null;\n _this._dragData = null;\n _this._tabMoved = new signaling.Signal(_this);\n _this._currentChanged = new signaling.Signal(_this);\n _this._tabCloseRequested = new signaling.Signal(_this);\n _this._tabDetachRequested = new signaling.Signal(_this);\n _this._tabActivateRequested = new signaling.Signal(_this);\n _this.addClass('lm-TabBar');\n /* */\n _this.addClass('p-TabBar');\n /* */\n _this.setFlag(widget.Widget.Flag.DisallowLayout);\n _this.tabsMovable = options.tabsMovable || false;\n _this.titlesEditable = options.titlesEditable || false;\n _this.allowDeselect = options.allowDeselect || false;\n _this.insertBehavior = options.insertBehavior || 'select-tab-if-needed';\n _this.removeBehavior = options.removeBehavior || 'select-tab-after';\n _this.renderer = options.renderer || TabBar.defaultRenderer;\n _this._orientation = options.orientation || 'horizontal';\n _this.dataset['orientation'] = _this._orientation;\n return _this;\n }\n /**\n * Dispose of the resources held by the widget.\n */\n TabBar.prototype.dispose = function () {\n this._releaseMouse();\n this._titles.length = 0;\n this._previousTitle = null;\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(TabBar.prototype, \"currentChanged\", {\n /**\n * A signal emitted when the current tab is changed.\n *\n * #### Notes\n * This signal is emitted when the currently selected tab is changed\n * either through user or programmatic interaction.\n *\n * Notably, this signal is not emitted when the index of the current\n * tab changes due to tabs being inserted, removed, or moved. It is\n * only emitted when the actual current tab node is changed.\n */\n get: function () {\n return this._currentChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"tabMoved\", {\n /**\n * A signal emitted when a tab is moved by the user.\n *\n * #### Notes\n * This signal is emitted when a tab is moved by user interaction.\n *\n * This signal is not emitted when a tab is moved programmatically.\n */\n get: function () {\n return this._tabMoved;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"tabActivateRequested\", {\n /**\n * A signal emitted when a tab is clicked by the user.\n *\n * #### Notes\n * If the clicked tab is not the current tab, the clicked tab will be\n * made current and the `currentChanged` signal will be emitted first.\n *\n * This signal is emitted even if the clicked tab is the current tab.\n */\n get: function () {\n return this._tabActivateRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"tabCloseRequested\", {\n /**\n * A signal emitted when a tab close icon is clicked.\n *\n * #### Notes\n * This signal is not emitted unless the tab title is `closable`.\n */\n get: function () {\n return this._tabCloseRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"tabDetachRequested\", {\n /**\n * A signal emitted when a tab is dragged beyond the detach threshold.\n *\n * #### Notes\n * This signal is emitted when the user drags a tab with the mouse,\n * and mouse is dragged beyond the detach threshold.\n *\n * The consumer of the signal should call `releaseMouse` and remove\n * the tab in order to complete the detach.\n *\n * This signal is only emitted once per drag cycle.\n */\n get: function () {\n return this._tabDetachRequested;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"titlesEditable\", {\n /**\n * Whether the titles can be user-edited.\n *\n */\n get: function () {\n return this._titlesEditable;\n },\n /**\n * Set whether titles can be user edited.\n *\n */\n set: function (value) {\n this._titlesEditable = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"currentTitle\", {\n /**\n * Get the currently selected title.\n *\n * #### Notes\n * This will be `null` if no tab is selected.\n */\n get: function () {\n return this._titles[this._currentIndex] || null;\n },\n /**\n * Set the currently selected title.\n *\n * #### Notes\n * If the title does not exist, the title will be set to `null`.\n */\n set: function (value) {\n this.currentIndex = value ? this._titles.indexOf(value) : -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"currentIndex\", {\n /**\n * Get the index of the currently selected tab.\n *\n * #### Notes\n * This will be `-1` if no tab is selected.\n */\n get: function () {\n return this._currentIndex;\n },\n /**\n * Set the index of the currently selected tab.\n *\n * #### Notes\n * If the value is out of range, the index will be set to `-1`.\n */\n set: function (value) {\n // Adjust for an out of range index.\n if (value < 0 || value >= this._titles.length) {\n value = -1;\n }\n // Bail early if the index will not change.\n if (this._currentIndex === value) {\n return;\n }\n // Look up the previous index and title.\n var pi = this._currentIndex;\n var pt = this._titles[pi] || null;\n // Look up the current index and title.\n var ci = value;\n var ct = this._titles[ci] || null;\n // Update the current index and previous title.\n this._currentIndex = ci;\n this._previousTitle = pt;\n // Schedule an update of the tabs.\n this.update();\n // Emit the current changed signal.\n this._currentChanged.emit({\n previousIndex: pi, previousTitle: pt,\n currentIndex: ci, currentTitle: ct\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"orientation\", {\n /**\n * Get the orientation of the tab bar.\n *\n * #### Notes\n * This controls whether the tabs are arranged in a row or column.\n */\n get: function () {\n return this._orientation;\n },\n /**\n * Set the orientation of the tab bar.\n *\n * #### Notes\n * This controls whether the tabs are arranged in a row or column.\n */\n set: function (value) {\n // Do nothing if the orientation does not change.\n if (this._orientation === value) {\n return;\n }\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Toggle the orientation values.\n this._orientation = value;\n this.dataset['orientation'] = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"titles\", {\n /**\n * A read-only array of the titles in the tab bar.\n */\n get: function () {\n return this._titles;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabBar.prototype, \"contentNode\", {\n /**\n * The tab bar content node.\n *\n * #### Notes\n * This is the node which holds the tab nodes.\n *\n * Modifying this node directly can lead to undefined behavior.\n */\n get: function () {\n return this.node.getElementsByClassName('lm-TabBar-content')[0];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add a tab to the end of the tab bar.\n *\n * @param value - The title which holds the data for the tab,\n * or an options object to convert to a title.\n *\n * @returns The title object added to the tab bar.\n *\n * #### Notes\n * If the title is already added to the tab bar, it will be moved.\n */\n TabBar.prototype.addTab = function (value) {\n return this.insertTab(this._titles.length, value);\n };\n /**\n * Insert a tab into the tab bar at the specified index.\n *\n * @param index - The index at which to insert the tab.\n *\n * @param value - The title which holds the data for the tab,\n * or an options object to convert to a title.\n *\n * @returns The title object added to the tab bar.\n *\n * #### Notes\n * The index will be clamped to the bounds of the tabs.\n *\n * If the title is already added to the tab bar, it will be moved.\n */\n TabBar.prototype.insertTab = function (index, value) {\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Coerce the value to a title.\n var title = Private.asTitle(value);\n // Look up the index of the title.\n var i = this._titles.indexOf(title);\n // Clamp the insert index to the array bounds.\n var j = Math.max(0, Math.min(index, this._titles.length));\n // If the title is not in the array, insert it.\n if (i === -1) {\n // Insert the title into the array.\n algorithm.ArrayExt.insert(this._titles, j, title);\n // Connect to the title changed signal.\n title.changed.connect(this._onTitleChanged, this);\n // Schedule an update of the tabs.\n this.update();\n // Adjust the current index for the insert.\n this._adjustCurrentForInsert(j, title);\n // Return the title added to the tab bar.\n return title;\n }\n // Otherwise, the title exists in the array and should be moved.\n // Adjust the index if the location is at the end of the array.\n if (j === this._titles.length) {\n j--;\n }\n // Bail if there is no effective move.\n if (i === j) {\n return title;\n }\n // Move the title to the new location.\n algorithm.ArrayExt.move(this._titles, i, j);\n // Schedule an update of the tabs.\n this.update();\n // Adjust the current index for the move.\n this._adjustCurrentForMove(i, j);\n // Return the title added to the tab bar.\n return title;\n };\n /**\n * Remove a tab from the tab bar.\n *\n * @param title - The title for the tab to remove.\n *\n * #### Notes\n * This is a no-op if the title is not in the tab bar.\n */\n TabBar.prototype.removeTab = function (title) {\n this.removeTabAt(this._titles.indexOf(title));\n };\n /**\n * Remove the tab at a given index from the tab bar.\n *\n * @param index - The index of the tab to remove.\n *\n * #### Notes\n * This is a no-op if the index is out of range.\n */\n TabBar.prototype.removeTabAt = function (index) {\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Remove the title from the array.\n var title = algorithm.ArrayExt.removeAt(this._titles, index);\n // Bail if the index is out of range.\n if (!title) {\n return;\n }\n // Disconnect from the title changed signal.\n title.changed.disconnect(this._onTitleChanged, this);\n // Clear the previous title if it's being removed.\n if (title === this._previousTitle) {\n this._previousTitle = null;\n }\n // Schedule an update of the tabs.\n this.update();\n // Adjust the current index for the remove.\n this._adjustCurrentForRemove(index, title);\n };\n /**\n * Remove all tabs from the tab bar.\n */\n TabBar.prototype.clearTabs = function () {\n // Bail if there is nothing to remove.\n if (this._titles.length === 0) {\n return;\n }\n // Release the mouse before making any changes.\n this._releaseMouse();\n // Disconnect from the title changed signals.\n for (var _i = 0, _a = this._titles; _i < _a.length; _i++) {\n var title = _a[_i];\n title.changed.disconnect(this._onTitleChanged, this);\n }\n // Get the current index and title.\n var pi = this.currentIndex;\n var pt = this.currentTitle;\n // Reset the current index and previous title.\n this._currentIndex = -1;\n this._previousTitle = null;\n // Clear the title array.\n this._titles.length = 0;\n // Schedule an update of the tabs.\n this.update();\n // If no tab was selected, there's nothing else to do.\n if (pi === -1) {\n return;\n }\n // Emit the current changed signal.\n this._currentChanged.emit({\n previousIndex: pi, previousTitle: pt,\n currentIndex: -1, currentTitle: null\n });\n };\n /**\n * Release the mouse and restore the non-dragged tab positions.\n *\n * #### Notes\n * This will cause the tab bar to stop handling mouse events and to\n * restore the tabs to their non-dragged positions.\n */\n TabBar.prototype.releaseMouse = function () {\n this._releaseMouse();\n };\n /**\n * Handle the DOM events for the tab bar.\n *\n * @param event - The DOM event sent to the tab bar.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the tab bar's DOM node.\n *\n * This should not be called directly by user code.\n */\n TabBar.prototype.handleEvent = function (event) {\n switch (event.type) {\n case 'mousedown':\n this._evtMouseDown(event);\n break;\n case 'mousemove':\n this._evtMouseMove(event);\n break;\n case 'mouseup':\n this._evtMouseUp(event);\n break;\n case 'dblclick':\n this._evtDblClick(event);\n break;\n case 'keydown':\n this._evtKeyDown(event);\n break;\n case 'contextmenu':\n event.preventDefault();\n event.stopPropagation();\n break;\n }\n };\n /**\n * A message handler invoked on a `'before-attach'` message.\n */\n TabBar.prototype.onBeforeAttach = function (msg) {\n this.node.addEventListener('mousedown', this);\n this.node.addEventListener('dblclick', this);\n };\n /**\n * A message handler invoked on an `'after-detach'` message.\n */\n TabBar.prototype.onAfterDetach = function (msg) {\n this.node.removeEventListener('mousedown', this);\n this.node.removeEventListener('dblclick', this);\n this._releaseMouse();\n };\n /**\n * A message handler invoked on an `'update-request'` message.\n */\n TabBar.prototype.onUpdateRequest = function (msg) {\n var titles = this._titles;\n var renderer = this.renderer;\n var currentTitle = this.currentTitle;\n var content = new Array(titles.length);\n for (var i = 0, n = titles.length; i < n; ++i) {\n var title = titles[i];\n var current = title === currentTitle;\n var zIndex = current ? n : n - i - 1;\n content[i] = renderer.renderTab({ title: title, current: current, zIndex: zIndex });\n }\n virtualdom.VirtualDOM.render(content, this.contentNode);\n };\n /**\n * Handle the `'dblclick'` event for the tab bar.\n */\n TabBar.prototype._evtDblClick = function (event) {\n // Do nothing if titles are not editable\n if (!this.titlesEditable) {\n return;\n }\n var tabs = this.contentNode.children;\n // Find the index of the released tab.\n var index = algorithm.ArrayExt.findFirstIndex(tabs, function (tab) {\n return domutils.ElementExt.hitTest(tab, event.clientX, event.clientY);\n });\n // Do nothing if the press is not on a tab.\n if (index === -1) {\n return;\n }\n var title = this.titles[index];\n var label = tabs[index].querySelector('.lm-TabBar-tabLabel');\n if (label && label.contains(event.target)) {\n var value = title.label || '';\n // Clear the label element\n var oldValue_1 = label.innerHTML;\n label.innerHTML = \"\";\n var input_1 = document.createElement('input');\n input_1.classList.add('lm-TabBar-tabInput');\n input_1.value = value;\n label.appendChild(input_1);\n var onblur_1 = function () {\n input_1.removeEventListener('blur', onblur_1);\n label.innerHTML = oldValue_1;\n };\n input_1.addEventListener('dblclick', function (event) { return event.stopPropagation(); });\n input_1.addEventListener('blur', onblur_1);\n input_1.addEventListener('keydown', function (event) {\n if (event.key === 'Enter') {\n if (input_1.value !== '') {\n title.label = title.caption = input_1.value;\n }\n onblur_1();\n }\n else if (event.key === 'Escape') {\n onblur_1();\n }\n });\n input_1.select();\n input_1.focus();\n if (label.children.length > 0) {\n label.children[0].focus();\n }\n }\n };\n /**\n * Handle the `'keydown'` event for the tab bar.\n */\n TabBar.prototype._evtKeyDown = function (event) {\n // Stop all input events during drag.\n event.preventDefault();\n event.stopPropagation();\n // Release the mouse if `Escape` is pressed.\n if (event.keyCode === 27) {\n this._releaseMouse();\n }\n };\n /**\n * Handle the `'mousedown'` event for the tab bar.\n */\n TabBar.prototype._evtMouseDown = function (event) {\n // Do nothing if it's not a left or middle mouse press.\n if (event.button !== 0 && event.button !== 1) {\n return;\n }\n // Do nothing if a drag is in progress.\n if (this._dragData) {\n return;\n }\n // Lookup the tab nodes.\n var tabs = this.contentNode.children;\n // Find the index of the pressed tab.\n var index = algorithm.ArrayExt.findFirstIndex(tabs, function (tab) {\n return domutils.ElementExt.hitTest(tab, event.clientX, event.clientY);\n });\n // Do nothing if the press is not on a tab.\n if (index === -1) {\n return;\n }\n // Pressing on a tab stops the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Initialize the non-measured parts of the drag data.\n this._dragData = {\n tab: tabs[index],\n index: index,\n pressX: event.clientX,\n pressY: event.clientY,\n tabPos: -1,\n tabSize: -1,\n tabPressPos: -1,\n targetIndex: -1,\n tabLayout: null,\n contentRect: null,\n override: null,\n dragActive: false,\n dragAborted: false,\n detachRequested: false\n };\n // Add the document mouse up listener.\n document.addEventListener('mouseup', this, true);\n // Do nothing else if the middle button is clicked.\n if (event.button === 1) {\n return;\n }\n // Do nothing else if the close icon is clicked.\n var icon = tabs[index].querySelector(this.renderer.closeIconSelector);\n if (icon && icon.contains(event.target)) {\n return;\n }\n // Add the extra listeners if the tabs are movable.\n if (this.tabsMovable) {\n document.addEventListener('mousemove', this, true);\n document.addEventListener('keydown', this, true);\n document.addEventListener('contextmenu', this, true);\n }\n // Update the current index as appropriate.\n if (this.allowDeselect && this.currentIndex === index) {\n this.currentIndex = -1;\n }\n else {\n this.currentIndex = index;\n }\n // Do nothing else if there is no current tab.\n if (this.currentIndex === -1) {\n return;\n }\n // Emit the tab activate request signal.\n this._tabActivateRequested.emit({\n index: this.currentIndex,\n title: this.currentTitle\n });\n };\n /**\n * Handle the `'mousemove'` event for the tab bar.\n */\n TabBar.prototype._evtMouseMove = function (event) {\n // Do nothing if no drag is in progress.\n var data = this._dragData;\n if (!data) {\n return;\n }\n // Suppress the event during a drag.\n event.preventDefault();\n event.stopPropagation();\n // Lookup the tab nodes.\n var tabs = this.contentNode.children;\n // Bail early if the drag threshold has not been met.\n if (!data.dragActive && !Private.dragExceeded(data, event)) {\n return;\n }\n // Activate the drag if necessary.\n if (!data.dragActive) {\n // Fill in the rest of the drag data measurements.\n var tabRect = data.tab.getBoundingClientRect();\n if (this._orientation === 'horizontal') {\n data.tabPos = data.tab.offsetLeft;\n data.tabSize = tabRect.width;\n data.tabPressPos = data.pressX - tabRect.left;\n }\n else {\n data.tabPos = data.tab.offsetTop;\n data.tabSize = tabRect.height;\n data.tabPressPos = data.pressY - tabRect.top;\n }\n data.tabLayout = Private.snapTabLayout(tabs, this._orientation);\n data.contentRect = this.contentNode.getBoundingClientRect();\n data.override = dragdrop.Drag.overrideCursor('default');\n // Add the dragging style classes.\n data.tab.classList.add('lm-mod-dragging');\n this.addClass('lm-mod-dragging');\n /* */\n data.tab.classList.add('p-mod-dragging');\n this.addClass('p-mod-dragging');\n /* */\n // Mark the drag as active.\n data.dragActive = true;\n }\n // Emit the detach requested signal if the threshold is exceeded.\n if (!data.detachRequested && Private.detachExceeded(data, event)) {\n // Only emit the signal once per drag cycle.\n data.detachRequested = true;\n // Setup the arguments for the signal.\n var index = data.index;\n var clientX = event.clientX;\n var clientY = event.clientY;\n var tab = tabs[index];\n var title = this._titles[index];\n // Emit the tab detach requested signal.\n this._tabDetachRequested.emit({ index: index, title: title, tab: tab, clientX: clientX, clientY: clientY });\n // Bail if the signal handler aborted the drag.\n if (data.dragAborted) {\n return;\n }\n }\n // Update the positions of the tabs.\n Private.layoutTabs(tabs, data, event, this._orientation);\n };\n /**\n * Handle the `'mouseup'` event for the document.\n */\n TabBar.prototype._evtMouseUp = function (event) {\n var _this = this;\n // Do nothing if it's not a left or middle mouse release.\n if (event.button !== 0 && event.button !== 1) {\n return;\n }\n // Do nothing if no drag is in progress.\n var data = this._dragData;\n if (!data) {\n return;\n }\n // Stop the event propagation.\n event.preventDefault();\n event.stopPropagation();\n // Remove the extra mouse event listeners.\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('contextmenu', this, true);\n // Handle a release when the drag is not active.\n if (!data.dragActive) {\n // Clear the drag data.\n this._dragData = null;\n // Lookup the tab nodes.\n var tabs = this.contentNode.children;\n // Find the index of the released tab.\n var index = algorithm.ArrayExt.findFirstIndex(tabs, function (tab) {\n return domutils.ElementExt.hitTest(tab, event.clientX, event.clientY);\n });\n // Do nothing if the release is not on the original pressed tab.\n if (index !== data.index) {\n return;\n }\n // Ignore the release if the title is not closable.\n var title = this._titles[index];\n if (!title.closable) {\n return;\n }\n // Emit the close requested signal if the middle button is released.\n if (event.button === 1) {\n this._tabCloseRequested.emit({ index: index, title: title });\n return;\n }\n // Emit the close requested signal if the close icon was released.\n var icon = tabs[index].querySelector(this.renderer.closeIconSelector);\n if (icon && icon.contains(event.target)) {\n this._tabCloseRequested.emit({ index: index, title: title });\n return;\n }\n // Otherwise, there is nothing left to do.\n return;\n }\n // Do nothing if the left button is not released.\n if (event.button !== 0) {\n return;\n }\n // Position the tab at its final resting position.\n Private.finalizeTabPosition(data, this._orientation);\n // Remove the dragging class from the tab so it can be transitioned.\n data.tab.classList.remove('lm-mod-dragging');\n /* */\n data.tab.classList.remove('p-mod-dragging');\n /* */\n // Parse the transition duration for releasing the tab.\n var duration = Private.parseTransitionDuration(data.tab);\n // Complete the release on a timer to allow the tab to transition.\n setTimeout(function () {\n // Do nothing if the drag has been aborted.\n if (data.dragAborted) {\n return;\n }\n // Clear the drag data reference.\n _this._dragData = null;\n // Reset the positions of the tabs.\n Private.resetTabPositions(_this.contentNode.children, _this._orientation);\n // Clear the cursor grab.\n data.override.dispose();\n // Remove the remaining dragging style.\n _this.removeClass('lm-mod-dragging');\n /* */\n _this.removeClass('p-mod-dragging');\n /* */\n // If the tab was not moved, there is nothing else to do.\n var i = data.index;\n var j = data.targetIndex;\n if (j === -1 || i === j) {\n return;\n }\n // Move the title to the new locations.\n algorithm.ArrayExt.move(_this._titles, i, j);\n // Adjust the current index for the move.\n _this._adjustCurrentForMove(i, j);\n // Emit the tab moved signal.\n _this._tabMoved.emit({\n fromIndex: i, toIndex: j, title: _this._titles[j]\n });\n // Update the tabs immediately to prevent flicker.\n messaging.MessageLoop.sendMessage(_this, widget.Widget.Msg.UpdateRequest);\n }, duration);\n };\n /**\n * Release the mouse and restore the non-dragged tab positions.\n */\n TabBar.prototype._releaseMouse = function () {\n // Do nothing if no drag is in progress.\n var data = this._dragData;\n if (!data) {\n return;\n }\n // Clear the drag data reference.\n this._dragData = null;\n // Remove the extra mouse listeners.\n document.removeEventListener('mousemove', this, true);\n document.removeEventListener('mouseup', this, true);\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('contextmenu', this, true);\n // Indicate the drag has been aborted. This allows the mouse\n // event handlers to return early when the drag is canceled.\n data.dragAborted = true;\n // If the drag is not active, there's nothing more to do.\n if (!data.dragActive) {\n return;\n }\n // Reset the tabs to their non-dragged positions.\n Private.resetTabPositions(this.contentNode.children, this._orientation);\n // Clear the cursor override.\n data.override.dispose();\n // Clear the dragging style classes.\n data.tab.classList.remove('lm-mod-dragging');\n this.removeClass('lm-mod-dragging');\n /* */\n data.tab.classList.remove('p-mod-dragging');\n this.removeClass('p-mod-dragging');\n /* */\n };\n /**\n * Adjust the current index for a tab insert operation.\n *\n * This method accounts for the tab bar's insertion behavior when\n * adjusting the current index and emitting the changed signal.\n */\n TabBar.prototype._adjustCurrentForInsert = function (i, title) {\n // Lookup commonly used variables.\n var ct = this.currentTitle;\n var ci = this._currentIndex;\n var bh = this.insertBehavior;\n // Handle the behavior where the new tab is always selected,\n // or the behavior where the new tab is selected if needed.\n if (bh === 'select-tab' || (bh === 'select-tab-if-needed' && ci === -1)) {\n this._currentIndex = i;\n this._previousTitle = ct;\n this._currentChanged.emit({\n previousIndex: ci, previousTitle: ct,\n currentIndex: i, currentTitle: title\n });\n return;\n }\n // Otherwise, silently adjust the current index if needed.\n if (ci >= i) {\n this._currentIndex++;\n }\n };\n /**\n * Adjust the current index for a tab move operation.\n *\n * This method will not cause the actual current tab to change.\n * It silently adjusts the index to account for the given move.\n */\n TabBar.prototype._adjustCurrentForMove = function (i, j) {\n if (this._currentIndex === i) {\n this._currentIndex = j;\n }\n else if (this._currentIndex < i && this._currentIndex >= j) {\n this._currentIndex++;\n }\n else if (this._currentIndex > i && this._currentIndex <= j) {\n this._currentIndex--;\n }\n };\n /**\n * Adjust the current index for a tab remove operation.\n *\n * This method accounts for the tab bar's remove behavior when\n * adjusting the current index and emitting the changed signal.\n */\n TabBar.prototype._adjustCurrentForRemove = function (i, title) {\n // Lookup commonly used variables.\n var ci = this._currentIndex;\n var bh = this.removeBehavior;\n // Silently adjust the index if the current tab is not removed.\n if (ci !== i) {\n if (ci > i) {\n this._currentIndex--;\n }\n return;\n }\n // No tab gets selected if the tab bar is empty.\n if (this._titles.length === 0) {\n this._currentIndex = -1;\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: -1, currentTitle: null\n });\n return;\n }\n // Handle behavior where the next sibling tab is selected.\n if (bh === 'select-tab-after') {\n this._currentIndex = Math.min(i, this._titles.length - 1);\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: this._currentIndex, currentTitle: this.currentTitle\n });\n return;\n }\n // Handle behavior where the previous sibling tab is selected.\n if (bh === 'select-tab-before') {\n this._currentIndex = Math.max(0, i - 1);\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: this._currentIndex, currentTitle: this.currentTitle\n });\n return;\n }\n // Handle behavior where the previous history tab is selected.\n if (bh === 'select-previous-tab') {\n if (this._previousTitle) {\n this._currentIndex = this._titles.indexOf(this._previousTitle);\n this._previousTitle = null;\n }\n else {\n this._currentIndex = Math.min(i, this._titles.length - 1);\n }\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: this._currentIndex, currentTitle: this.currentTitle\n });\n return;\n }\n // Otherwise, no tab gets selected.\n this._currentIndex = -1;\n this._currentChanged.emit({\n previousIndex: i, previousTitle: title,\n currentIndex: -1, currentTitle: null\n });\n };\n /**\n * Handle the `changed` signal of a title object.\n */\n TabBar.prototype._onTitleChanged = function (sender) {\n this.update();\n };\n return TabBar;\n}(widget.Widget));\n/**\n * The namespace for the `TabBar` class statics.\n */\n(function (TabBar) {\n /**\n * The default implementation of `IRenderer`.\n *\n * #### Notes\n * Subclasses are free to reimplement rendering methods as needed.\n */\n var Renderer = /** @class */ (function () {\n /**\n * Construct a new renderer.\n */\n function Renderer() {\n /**\n * A selector which matches the close icon node in a tab.\n */\n this.closeIconSelector = '.lm-TabBar-tabCloseIcon';\n this._tabID = 0;\n this._tabKeys = new WeakMap();\n }\n /**\n * Render the virtual element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab.\n */\n Renderer.prototype.renderTab = function (data) {\n var title = data.title.caption;\n var key = this.createTabKey(data);\n var style = this.createTabStyle(data);\n var className = this.createTabClass(data);\n var dataset = this.createTabDataset(data);\n return (virtualdom.h.li({ key: key, className: className, title: title, style: style, dataset: dataset }, this.renderIcon(data), this.renderLabel(data), this.renderCloseIcon(data)));\n };\n /**\n * Render the icon element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab icon.\n */\n Renderer.prototype.renderIcon = function (data) {\n var title = data.title;\n var className = this.createIconClass(data);\n /* */\n if (typeof title.icon === 'string') {\n return virtualdom.h.div({ className: className }, title.iconLabel);\n }\n /* */\n // if title.icon is undefined, it will be ignored\n return virtualdom.h.div({ className: className }, title.icon, title.iconLabel);\n };\n /**\n * Render the label element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab label.\n */\n Renderer.prototype.renderLabel = function (data) {\n return virtualdom.h.div({\n className: 'lm-TabBar-tabLabel'\n /* */\n + ' p-TabBar-tabLabel'\n /* */\n }, data.title.label);\n };\n /**\n * Render the close icon element for a tab.\n *\n * @param data - The data to use for rendering the tab.\n *\n * @returns A virtual element representing the tab close icon.\n */\n Renderer.prototype.renderCloseIcon = function (data) {\n return virtualdom.h.div({\n className: 'lm-TabBar-tabCloseIcon'\n /* */\n + ' p-TabBar-tabCloseIcon'\n /* */\n });\n };\n /**\n * Create a unique render key for the tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The unique render key for the tab.\n *\n * #### Notes\n * This method caches the key against the tab title the first time\n * the key is generated. This enables efficient rendering of moved\n * tabs and avoids subtle hover style artifacts.\n */\n Renderer.prototype.createTabKey = function (data) {\n var key = this._tabKeys.get(data.title);\n if (key === undefined) {\n key = \"tab-key-\" + this._tabID++;\n this._tabKeys.set(data.title, key);\n }\n return key;\n };\n /**\n * Create the inline style object for a tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The inline style data for the tab.\n */\n Renderer.prototype.createTabStyle = function (data) {\n return { zIndex: \"\" + data.zIndex };\n };\n /**\n * Create the class name for the tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The full class name for the tab.\n */\n Renderer.prototype.createTabClass = function (data) {\n var name = 'lm-TabBar-tab';\n /* */\n name += ' p-TabBar-tab';\n /* */\n if (data.title.className) {\n name += \" \" + data.title.className;\n }\n if (data.title.closable) {\n name += ' lm-mod-closable';\n /* */\n name += ' p-mod-closable';\n /* */\n }\n if (data.current) {\n name += ' lm-mod-current';\n /* */\n name += ' p-mod-current';\n /* */\n }\n return name;\n };\n /**\n * Create the dataset for a tab.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The dataset for the tab.\n */\n Renderer.prototype.createTabDataset = function (data) {\n return data.title.dataset;\n };\n /**\n * Create the class name for the tab icon.\n *\n * @param data - The data to use for the tab.\n *\n * @returns The full class name for the tab icon.\n */\n Renderer.prototype.createIconClass = function (data) {\n var name = 'lm-TabBar-tabIcon';\n /* */\n name += ' p-TabBar-tabIcon';\n /* */\n var extra = data.title.iconClass;\n return extra ? name + \" \" + extra : name;\n };\n return Renderer;\n }());\n TabBar.Renderer = Renderer;\n /**\n * The default `Renderer` instance.\n */\n TabBar.defaultRenderer = new Renderer();\n})(exports.TabBar || (exports.TabBar = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * The start drag distance threshold.\n */\n Private.DRAG_THRESHOLD = 5;\n /**\n * The detach distance threshold.\n */\n Private.DETACH_THRESHOLD = 20;\n /**\n * Create the DOM node for a tab bar.\n */\n function createNode() {\n var node = document.createElement('div');\n var content = document.createElement('ul');\n content.className = 'lm-TabBar-content';\n /* */\n content.classList.add('p-TabBar-content');\n /* */\n node.appendChild(content);\n return node;\n }\n Private.createNode = createNode;\n /**\n * Coerce a title or options into a real title.\n */\n function asTitle(value) {\n return value instanceof title.Title ? value : new title.Title(value);\n }\n Private.asTitle = asTitle;\n /**\n * Parse the transition duration for a tab node.\n */\n function parseTransitionDuration(tab) {\n var style = window.getComputedStyle(tab);\n return 1000 * (parseFloat(style.transitionDuration) || 0);\n }\n Private.parseTransitionDuration = parseTransitionDuration;\n /**\n * Get a snapshot of the current tab layout values.\n */\n function snapTabLayout(tabs, orientation) {\n var layout = new Array(tabs.length);\n for (var i = 0, n = tabs.length; i < n; ++i) {\n var node = tabs[i];\n var style = window.getComputedStyle(node);\n if (orientation === 'horizontal') {\n layout[i] = {\n pos: node.offsetLeft,\n size: node.offsetWidth,\n margin: parseFloat(style.marginLeft) || 0\n };\n }\n else {\n layout[i] = {\n pos: node.offsetTop,\n size: node.offsetHeight,\n margin: parseFloat(style.marginTop) || 0\n };\n }\n }\n return layout;\n }\n Private.snapTabLayout = snapTabLayout;\n /**\n * Test if the event exceeds the drag threshold.\n */\n function dragExceeded(data, event) {\n var dx = Math.abs(event.clientX - data.pressX);\n var dy = Math.abs(event.clientY - data.pressY);\n return dx >= Private.DRAG_THRESHOLD || dy >= Private.DRAG_THRESHOLD;\n }\n Private.dragExceeded = dragExceeded;\n /**\n * Test if the event exceeds the drag detach threshold.\n */\n function detachExceeded(data, event) {\n var rect = data.contentRect;\n return ((event.clientX < rect.left - Private.DETACH_THRESHOLD) ||\n (event.clientX >= rect.right + Private.DETACH_THRESHOLD) ||\n (event.clientY < rect.top - Private.DETACH_THRESHOLD) ||\n (event.clientY >= rect.bottom + Private.DETACH_THRESHOLD));\n }\n Private.detachExceeded = detachExceeded;\n /**\n * Update the relative tab positions and computed target index.\n */\n function layoutTabs(tabs, data, event, orientation) {\n // Compute the orientation-sensitive values.\n var pressPos;\n var localPos;\n var clientPos;\n var clientSize;\n if (orientation === 'horizontal') {\n pressPos = data.pressX;\n localPos = event.clientX - data.contentRect.left;\n clientPos = event.clientX;\n clientSize = data.contentRect.width;\n }\n else {\n pressPos = data.pressY;\n localPos = event.clientY - data.contentRect.top;\n clientPos = event.clientY;\n clientSize = data.contentRect.height;\n }\n // Compute the target data.\n var targetIndex = data.index;\n var targetPos = localPos - data.tabPressPos;\n var targetEnd = targetPos + data.tabSize;\n // Update the relative tab positions.\n for (var i = 0, n = tabs.length; i < n; ++i) {\n var pxPos = void 0;\n var layout = data.tabLayout[i];\n var threshold = layout.pos + (layout.size >> 1);\n if (i < data.index && targetPos < threshold) {\n pxPos = data.tabSize + data.tabLayout[i + 1].margin + \"px\";\n targetIndex = Math.min(targetIndex, i);\n }\n else if (i > data.index && targetEnd > threshold) {\n pxPos = -data.tabSize - layout.margin + \"px\";\n targetIndex = Math.max(targetIndex, i);\n }\n else if (i === data.index) {\n var ideal = clientPos - pressPos;\n var limit = clientSize - (data.tabPos + data.tabSize);\n pxPos = Math.max(-data.tabPos, Math.min(ideal, limit)) + \"px\";\n }\n else {\n pxPos = '';\n }\n if (orientation === 'horizontal') {\n tabs[i].style.left = pxPos;\n }\n else {\n tabs[i].style.top = pxPos;\n }\n }\n // Update the computed target index.\n data.targetIndex = targetIndex;\n }\n Private.layoutTabs = layoutTabs;\n /**\n * Position the drag tab at its final resting relative position.\n */\n function finalizeTabPosition(data, orientation) {\n // Compute the orientation-sensitive client size.\n var clientSize;\n if (orientation === 'horizontal') {\n clientSize = data.contentRect.width;\n }\n else {\n clientSize = data.contentRect.height;\n }\n // Compute the ideal final tab position.\n var ideal;\n if (data.targetIndex === data.index) {\n ideal = 0;\n }\n else if (data.targetIndex > data.index) {\n var tgt = data.tabLayout[data.targetIndex];\n ideal = tgt.pos + tgt.size - data.tabSize - data.tabPos;\n }\n else {\n var tgt = data.tabLayout[data.targetIndex];\n ideal = tgt.pos - data.tabPos;\n }\n // Compute the tab position limit.\n var limit = clientSize - (data.tabPos + data.tabSize);\n var final = Math.max(-data.tabPos, Math.min(ideal, limit));\n // Set the final orientation-sensitive position.\n if (orientation === 'horizontal') {\n data.tab.style.left = final + \"px\";\n }\n else {\n data.tab.style.top = final + \"px\";\n }\n }\n Private.finalizeTabPosition = finalizeTabPosition;\n /**\n * Reset the relative positions of the given tabs.\n */\n function resetTabPositions(tabs, orientation) {\n algorithm.each(tabs, function (tab) {\n if (orientation === 'horizontal') {\n tab.style.left = '';\n }\n else {\n tab.style.top = '';\n }\n });\n }\n Private.resetTabPositions = resetTabPositions;\n})(Private || (Private = {}));\n//# sourceMappingURL=tabbar.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/tabbar.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/tabpanel.js": │ │ │ │ /*!********************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/tabpanel.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/tabpanel.js ***! │ │ │ │ \********************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n__webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar boxlayout = __webpack_require__(/*! ./boxlayout.js */ \"../../packages/widgets/dist/boxlayout.js\");\n__webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\n__webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\n__webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar tabbar = __webpack_require__(/*! ./tabbar.js */ \"../../packages/widgets/dist/tabbar.js\");\n__webpack_require__(/*! ./stackedlayout.js */ \"../../packages/widgets/dist/stackedlayout.js\");\nvar stackedpanel = __webpack_require__(/*! ./stackedpanel.js */ \"../../packages/widgets/dist/stackedpanel.js\");\n\n/**\n * A widget which combines a `TabBar` and a `StackedPanel`.\n *\n * #### Notes\n * This is a simple panel which handles the common case of a tab bar\n * placed next to a content area. The selected tab controls the widget\n * which is shown in the content area.\n *\n * For use cases which require more control than is provided by this\n * panel, the `TabBar` widget may be used independently.\n */\nvar TabPanel = /** @class */ (function (_super) {\n tslib.__extends(TabPanel, _super);\n /**\n * Construct a new tab panel.\n *\n * @param options - The options for initializing the tab panel.\n */\n function TabPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this._currentChanged = new signaling.Signal(_this);\n _this.addClass('lm-TabPanel');\n /* */\n _this.addClass('p-TabPanel');\n /* */\n // Create the tab bar and stacked panel.\n _this.tabBar = new tabbar.TabBar(options);\n _this.tabBar.addClass('lm-TabPanel-tabBar');\n _this.stackedPanel = new stackedpanel.StackedPanel();\n _this.stackedPanel.addClass('lm-TabPanel-stackedPanel');\n /* */\n _this.tabBar.addClass('p-TabPanel-tabBar');\n _this.stackedPanel.addClass('p-TabPanel-stackedPanel');\n /* */\n // Connect the tab bar signal handlers.\n _this.tabBar.tabMoved.connect(_this._onTabMoved, _this);\n _this.tabBar.currentChanged.connect(_this._onCurrentChanged, _this);\n _this.tabBar.tabCloseRequested.connect(_this._onTabCloseRequested, _this);\n _this.tabBar.tabActivateRequested.connect(_this._onTabActivateRequested, _this);\n // Connect the stacked panel signal handlers.\n _this.stackedPanel.widgetRemoved.connect(_this._onWidgetRemoved, _this);\n // Get the data related to the placement.\n _this._tabPlacement = options.tabPlacement || 'top';\n var direction = Private.directionFromPlacement(_this._tabPlacement);\n var orientation = Private.orientationFromPlacement(_this._tabPlacement);\n // Configure the tab bar for the placement.\n _this.tabBar.orientation = orientation;\n _this.tabBar.dataset['placement'] = _this._tabPlacement;\n // Create the box layout.\n var layout = new boxlayout.BoxLayout({ direction: direction, spacing: 0 });\n // Set the stretch factors for the child widgets.\n boxlayout.BoxLayout.setStretch(_this.tabBar, 0);\n boxlayout.BoxLayout.setStretch(_this.stackedPanel, 1);\n // Add the child widgets to the layout.\n layout.addWidget(_this.tabBar);\n layout.addWidget(_this.stackedPanel);\n // Install the layout on the tab panel.\n _this.layout = layout;\n return _this;\n }\n Object.defineProperty(TabPanel.prototype, \"currentChanged\", {\n /**\n * A signal emitted when the current tab is changed.\n *\n * #### Notes\n * This signal is emitted when the currently selected tab is changed\n * either through user or programmatic interaction.\n *\n * Notably, this signal is not emitted when the index of the current\n * tab changes due to tabs being inserted, removed, or moved. It is\n * only emitted when the actual current tab node is changed.\n */\n get: function () {\n return this._currentChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"currentIndex\", {\n /**\n * Get the index of the currently selected tab.\n *\n * #### Notes\n * This will be `-1` if no tab is selected.\n */\n get: function () {\n return this.tabBar.currentIndex;\n },\n /**\n * Set the index of the currently selected tab.\n *\n * #### Notes\n * If the index is out of range, it will be set to `-1`.\n */\n set: function (value) {\n this.tabBar.currentIndex = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"currentWidget\", {\n /**\n * Get the currently selected widget.\n *\n * #### Notes\n * This will be `null` if there is no selected tab.\n */\n get: function () {\n var title = this.tabBar.currentTitle;\n return title ? title.owner : null;\n },\n /**\n * Set the currently selected widget.\n *\n * #### Notes\n * If the widget is not in the panel, it will be set to `null`.\n */\n set: function (value) {\n this.tabBar.currentTitle = value ? value.title : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"tabsMovable\", {\n /**\n * Get the whether the tabs are movable by the user.\n *\n * #### Notes\n * Tabs can always be moved programmatically.\n */\n get: function () {\n return this.tabBar.tabsMovable;\n },\n /**\n * Set the whether the tabs are movable by the user.\n *\n * #### Notes\n * Tabs can always be moved programmatically.\n */\n set: function (value) {\n this.tabBar.tabsMovable = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"tabPlacement\", {\n /**\n * Get the tab placement for the tab panel.\n *\n * #### Notes\n * This controls the position of the tab bar relative to the content.\n */\n get: function () {\n return this._tabPlacement;\n },\n /**\n * Set the tab placement for the tab panel.\n *\n * #### Notes\n * This controls the position of the tab bar relative to the content.\n */\n set: function (value) {\n // Bail if the placement does not change.\n if (this._tabPlacement === value) {\n return;\n }\n // Update the internal value.\n this._tabPlacement = value;\n // Get the values related to the placement.\n var direction = Private.directionFromPlacement(value);\n var orientation = Private.orientationFromPlacement(value);\n // Configure the tab bar for the placement.\n this.tabBar.orientation = orientation;\n this.tabBar.dataset['placement'] = value;\n // Update the layout direction.\n this.layout.direction = direction;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"widgets\", {\n /**\n * A read-only array of the widgets in the panel.\n */\n get: function () {\n return this.stackedPanel.widgets;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add a widget to the end of the tab panel.\n *\n * @param widget - The widget to add to the tab panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n *\n * The widget's `title` is used to populate the tab.\n */\n TabPanel.prototype.addWidget = function (widget) {\n this.insertWidget(this.widgets.length, widget);\n };\n /**\n * Insert a widget into the tab panel at a specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into to the tab panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n *\n * The widget's `title` is used to populate the tab.\n */\n TabPanel.prototype.insertWidget = function (index, widget) {\n if (widget !== this.currentWidget) {\n widget.hide();\n }\n this.stackedPanel.insertWidget(index, widget);\n this.tabBar.insertTab(index, widget.title);\n };\n /**\n * Handle the `currentChanged` signal from the tab bar.\n */\n TabPanel.prototype._onCurrentChanged = function (sender, args) {\n // Extract the previous and current title from the args.\n var previousIndex = args.previousIndex, previousTitle = args.previousTitle, currentIndex = args.currentIndex, currentTitle = args.currentTitle;\n // Extract the widgets from the titles.\n var previousWidget = previousTitle ? previousTitle.owner : null;\n var currentWidget = currentTitle ? currentTitle.owner : null;\n // Hide the previous widget.\n if (previousWidget) {\n previousWidget.hide();\n }\n // Show the current widget.\n if (currentWidget) {\n currentWidget.show();\n }\n // Emit the `currentChanged` signal for the tab panel.\n this._currentChanged.emit({\n previousIndex: previousIndex, previousWidget: previousWidget, currentIndex: currentIndex, currentWidget: currentWidget\n });\n // Flush the message loop on IE and Edge to prevent flicker.\n if (domutils.Platform.IS_EDGE || domutils.Platform.IS_IE) {\n messaging.MessageLoop.flush();\n }\n };\n /**\n * Handle the `tabActivateRequested` signal from the tab bar.\n */\n TabPanel.prototype._onTabActivateRequested = function (sender, args) {\n args.title.owner.activate();\n };\n /**\n * Handle the `tabCloseRequested` signal from the tab bar.\n */\n TabPanel.prototype._onTabCloseRequested = function (sender, args) {\n args.title.owner.close();\n };\n /**\n * Handle the `tabMoved` signal from the tab bar.\n */\n TabPanel.prototype._onTabMoved = function (sender, args) {\n this.stackedPanel.insertWidget(args.toIndex, args.title.owner);\n };\n /**\n * Handle the `widgetRemoved` signal from the stacked panel.\n */\n TabPanel.prototype._onWidgetRemoved = function (sender, widget) {\n this.tabBar.removeTab(widget.title);\n };\n return TabPanel;\n}(widget.Widget));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Convert a tab placement to tab bar orientation.\n */\n function orientationFromPlacement(plc) {\n return placementToOrientationMap[plc];\n }\n Private.orientationFromPlacement = orientationFromPlacement;\n /**\n * Convert a tab placement to a box layout direction.\n */\n function directionFromPlacement(plc) {\n return placementToDirectionMap[plc];\n }\n Private.directionFromPlacement = directionFromPlacement;\n /**\n * A mapping of tab placement to tab bar orientation.\n */\n var placementToOrientationMap = {\n 'top': 'horizontal',\n 'left': 'vertical',\n 'right': 'vertical',\n 'bottom': 'horizontal'\n };\n /**\n * A mapping of tab placement to box layout direction.\n */\n var placementToDirectionMap = {\n 'top': 'top-to-bottom',\n 'left': 'left-to-right',\n 'right': 'right-to-left',\n 'bottom': 'bottom-to-top'\n };\n})(Private || (Private = {}));\n\nexports.TabPanel = TabPanel;\n//# sourceMappingURL=tabpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/tabpanel.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n__webpack_require__(/*! ./boxengine.js */ \"../../packages/widgets/dist/boxengine.js\");\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\n__webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar domutils = __webpack_require__(/*! @lumino/domutils */ \"../../packages/domutils/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\n__webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n__webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\nvar widget = __webpack_require__(/*! ./widget.js */ \"../../packages/widgets/dist/widget.js\");\n__webpack_require__(/*! ./layout.js */ \"../../packages/widgets/dist/layout.js\");\n__webpack_require__(/*! ./panellayout.js */ \"../../packages/widgets/dist/panellayout.js\");\nvar boxlayout = __webpack_require__(/*! ./boxlayout.js */ \"../../packages/widgets/dist/boxlayout.js\");\n__webpack_require__(/*! ./panel.js */ \"../../packages/widgets/dist/panel.js\");\n__webpack_require__(/*! @lumino/virtualdom */ \"../../packages/virtualdom/dist/index.js\");\n__webpack_require__(/*! @lumino/dragdrop */ \"../../packages/dragdrop/dist/index.js\");\nvar tabbar = __webpack_require__(/*! ./tabbar.js */ \"../../packages/widgets/dist/tabbar.js\");\n__webpack_require__(/*! ./stackedlayout.js */ \"../../packages/widgets/dist/stackedlayout.js\");\nvar stackedpanel = __webpack_require__(/*! ./stackedpanel.js */ \"../../packages/widgets/dist/stackedpanel.js\");\n\n/**\n * A widget which combines a `TabBar` and a `StackedPanel`.\n *\n * #### Notes\n * This is a simple panel which handles the common case of a tab bar\n * placed next to a content area. The selected tab controls the widget\n * which is shown in the content area.\n *\n * For use cases which require more control than is provided by this\n * panel, the `TabBar` widget may be used independently.\n */\nvar TabPanel = /** @class */ (function (_super) {\n tslib.__extends(TabPanel, _super);\n /**\n * Construct a new tab panel.\n *\n * @param options - The options for initializing the tab panel.\n */\n function TabPanel(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this) || this;\n _this._currentChanged = new signaling.Signal(_this);\n _this.addClass('lm-TabPanel');\n /* */\n _this.addClass('p-TabPanel');\n /* */\n // Create the tab bar and stacked panel.\n _this.tabBar = new tabbar.TabBar(options);\n _this.tabBar.addClass('lm-TabPanel-tabBar');\n _this.stackedPanel = new stackedpanel.StackedPanel();\n _this.stackedPanel.addClass('lm-TabPanel-stackedPanel');\n /* */\n _this.tabBar.addClass('p-TabPanel-tabBar');\n _this.stackedPanel.addClass('p-TabPanel-stackedPanel');\n /* */\n // Connect the tab bar signal handlers.\n _this.tabBar.tabMoved.connect(_this._onTabMoved, _this);\n _this.tabBar.currentChanged.connect(_this._onCurrentChanged, _this);\n _this.tabBar.tabCloseRequested.connect(_this._onTabCloseRequested, _this);\n _this.tabBar.tabActivateRequested.connect(_this._onTabActivateRequested, _this);\n // Connect the stacked panel signal handlers.\n _this.stackedPanel.widgetRemoved.connect(_this._onWidgetRemoved, _this);\n // Get the data related to the placement.\n _this._tabPlacement = options.tabPlacement || 'top';\n var direction = Private.directionFromPlacement(_this._tabPlacement);\n var orientation = Private.orientationFromPlacement(_this._tabPlacement);\n // Configure the tab bar for the placement.\n _this.tabBar.orientation = orientation;\n _this.tabBar.dataset['placement'] = _this._tabPlacement;\n // Create the box layout.\n var layout = new boxlayout.BoxLayout({ direction: direction, spacing: 0 });\n // Set the stretch factors for the child widgets.\n boxlayout.BoxLayout.setStretch(_this.tabBar, 0);\n boxlayout.BoxLayout.setStretch(_this.stackedPanel, 1);\n // Add the child widgets to the layout.\n layout.addWidget(_this.tabBar);\n layout.addWidget(_this.stackedPanel);\n // Install the layout on the tab panel.\n _this.layout = layout;\n return _this;\n }\n Object.defineProperty(TabPanel.prototype, \"currentChanged\", {\n /**\n * A signal emitted when the current tab is changed.\n *\n * #### Notes\n * This signal is emitted when the currently selected tab is changed\n * either through user or programmatic interaction.\n *\n * Notably, this signal is not emitted when the index of the current\n * tab changes due to tabs being inserted, removed, or moved. It is\n * only emitted when the actual current tab node is changed.\n */\n get: function () {\n return this._currentChanged;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"currentIndex\", {\n /**\n * Get the index of the currently selected tab.\n *\n * #### Notes\n * This will be `-1` if no tab is selected.\n */\n get: function () {\n return this.tabBar.currentIndex;\n },\n /**\n * Set the index of the currently selected tab.\n *\n * #### Notes\n * If the index is out of range, it will be set to `-1`.\n */\n set: function (value) {\n this.tabBar.currentIndex = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"currentWidget\", {\n /**\n * Get the currently selected widget.\n *\n * #### Notes\n * This will be `null` if there is no selected tab.\n */\n get: function () {\n var title = this.tabBar.currentTitle;\n return title ? title.owner : null;\n },\n /**\n * Set the currently selected widget.\n *\n * #### Notes\n * If the widget is not in the panel, it will be set to `null`.\n */\n set: function (value) {\n this.tabBar.currentTitle = value ? value.title : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"tabsMovable\", {\n /**\n * Get the whether the tabs are movable by the user.\n *\n * #### Notes\n * Tabs can always be moved programmatically.\n */\n get: function () {\n return this.tabBar.tabsMovable;\n },\n /**\n * Set the whether the tabs are movable by the user.\n *\n * #### Notes\n * Tabs can always be moved programmatically.\n */\n set: function (value) {\n this.tabBar.tabsMovable = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"tabPlacement\", {\n /**\n * Get the tab placement for the tab panel.\n *\n * #### Notes\n * This controls the position of the tab bar relative to the content.\n */\n get: function () {\n return this._tabPlacement;\n },\n /**\n * Set the tab placement for the tab panel.\n *\n * #### Notes\n * This controls the position of the tab bar relative to the content.\n */\n set: function (value) {\n // Bail if the placement does not change.\n if (this._tabPlacement === value) {\n return;\n }\n // Update the internal value.\n this._tabPlacement = value;\n // Get the values related to the placement.\n var direction = Private.directionFromPlacement(value);\n var orientation = Private.orientationFromPlacement(value);\n // Configure the tab bar for the placement.\n this.tabBar.orientation = orientation;\n this.tabBar.dataset['placement'] = value;\n // Update the layout direction.\n this.layout.direction = direction;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TabPanel.prototype, \"widgets\", {\n /**\n * A read-only array of the widgets in the panel.\n */\n get: function () {\n return this.stackedPanel.widgets;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add a widget to the end of the tab panel.\n *\n * @param widget - The widget to add to the tab panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n *\n * The widget's `title` is used to populate the tab.\n */\n TabPanel.prototype.addWidget = function (widget) {\n this.insertWidget(this.widgets.length, widget);\n };\n /**\n * Insert a widget into the tab panel at a specified index.\n *\n * @param index - The index at which to insert the widget.\n *\n * @param widget - The widget to insert into to the tab panel.\n *\n * #### Notes\n * If the widget is already contained in the panel, it will be moved.\n *\n * The widget's `title` is used to populate the tab.\n */\n TabPanel.prototype.insertWidget = function (index, widget) {\n if (widget !== this.currentWidget) {\n widget.hide();\n }\n this.stackedPanel.insertWidget(index, widget);\n this.tabBar.insertTab(index, widget.title);\n };\n /**\n * Handle the `currentChanged` signal from the tab bar.\n */\n TabPanel.prototype._onCurrentChanged = function (sender, args) {\n // Extract the previous and current title from the args.\n var previousIndex = args.previousIndex, previousTitle = args.previousTitle, currentIndex = args.currentIndex, currentTitle = args.currentTitle;\n // Extract the widgets from the titles.\n var previousWidget = previousTitle ? previousTitle.owner : null;\n var currentWidget = currentTitle ? currentTitle.owner : null;\n // Hide the previous widget.\n if (previousWidget) {\n previousWidget.hide();\n }\n // Show the current widget.\n if (currentWidget) {\n currentWidget.show();\n }\n // Emit the `currentChanged` signal for the tab panel.\n this._currentChanged.emit({\n previousIndex: previousIndex, previousWidget: previousWidget, currentIndex: currentIndex, currentWidget: currentWidget\n });\n // Flush the message loop on IE and Edge to prevent flicker.\n if (domutils.Platform.IS_EDGE || domutils.Platform.IS_IE) {\n messaging.MessageLoop.flush();\n }\n };\n /**\n * Handle the `tabActivateRequested` signal from the tab bar.\n */\n TabPanel.prototype._onTabActivateRequested = function (sender, args) {\n args.title.owner.activate();\n };\n /**\n * Handle the `tabCloseRequested` signal from the tab bar.\n */\n TabPanel.prototype._onTabCloseRequested = function (sender, args) {\n args.title.owner.close();\n };\n /**\n * Handle the `tabMoved` signal from the tab bar.\n */\n TabPanel.prototype._onTabMoved = function (sender, args) {\n this.stackedPanel.insertWidget(args.toIndex, args.title.owner);\n };\n /**\n * Handle the `widgetRemoved` signal from the stacked panel.\n */\n TabPanel.prototype._onWidgetRemoved = function (sender, widget) {\n this.tabBar.removeTab(widget.title);\n };\n return TabPanel;\n}(widget.Widget));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * Convert a tab placement to tab bar orientation.\n */\n function orientationFromPlacement(plc) {\n return placementToOrientationMap[plc];\n }\n Private.orientationFromPlacement = orientationFromPlacement;\n /**\n * Convert a tab placement to a box layout direction.\n */\n function directionFromPlacement(plc) {\n return placementToDirectionMap[plc];\n }\n Private.directionFromPlacement = directionFromPlacement;\n /**\n * A mapping of tab placement to tab bar orientation.\n */\n var placementToOrientationMap = {\n 'top': 'horizontal',\n 'left': 'vertical',\n 'right': 'vertical',\n 'bottom': 'horizontal'\n };\n /**\n * A mapping of tab placement to box layout direction.\n */\n var placementToDirectionMap = {\n 'top': 'top-to-bottom',\n 'left': 'left-to-right',\n 'right': 'right-to-left',\n 'bottom': 'bottom-to-top'\n };\n})(Private || (Private = {}));\n\nexports.TabPanel = TabPanel;\n//# sourceMappingURL=tabpanel.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/tabpanel.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/title.js": │ │ │ │ /*!*****************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/title.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/title.js ***! │ │ │ │ \*****************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * An object which holds data related to an object's title.\n *\n * #### Notes\n * A title object is intended to hold the data necessary to display a\n * header for a particular object. A common example is the `TabPanel`,\n * which uses the widget title to populate the tab for a child widget.\n */\nvar Title = /** @class */ (function () {\n /**\n * Construct a new title.\n *\n * @param options - The options for initializing the title.\n */\n function Title(options) {\n this._label = '';\n this._caption = '';\n this._mnemonic = -1;\n this._iconClass = '';\n this._iconLabel = '';\n this._className = '';\n this._closable = false;\n this._changed = new signaling.Signal(this);\n this.owner = options.owner;\n if (options.label !== undefined) {\n this._label = options.label;\n }\n if (options.mnemonic !== undefined) {\n this._mnemonic = options.mnemonic;\n }\n if (options.icon !== undefined) {\n /* */\n if (typeof options.icon === \"string\") {\n // when ._icon is null, the .icon getter will alias .iconClass\n this._icon = null;\n this._iconClass = options.icon;\n }\n else {\n /* */\n this._icon = options.icon;\n /* */\n }\n /* */\n }\n /* */\n else {\n // if unset, default to aliasing .iconClass\n this._icon = null;\n }\n /* */\n if (options.iconClass !== undefined) {\n this._iconClass = options.iconClass;\n }\n if (options.iconLabel !== undefined) {\n this._iconLabel = options.iconLabel;\n }\n if (options.iconRenderer !== undefined) {\n this._icon = options.iconRenderer;\n }\n if (options.caption !== undefined) {\n this._caption = options.caption;\n }\n if (options.className !== undefined) {\n this._className = options.className;\n }\n if (options.closable !== undefined) {\n this._closable = options.closable;\n }\n this._dataset = options.dataset || {};\n }\n Object.defineProperty(Title.prototype, \"changed\", {\n /**\n * A signal emitted when the state of the title changes.\n */\n get: function () {\n return this._changed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"label\", {\n /**\n * Get the label for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._label;\n },\n /**\n * Set the label for the title.\n */\n set: function (value) {\n if (this._label === value) {\n return;\n }\n this._label = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"mnemonic\", {\n /**\n * Get the mnemonic index for the title.\n *\n * #### Notes\n * The default value is `-1`.\n */\n get: function () {\n return this._mnemonic;\n },\n /**\n * Set the mnemonic index for the title.\n */\n set: function (value) {\n if (this._mnemonic === value) {\n return;\n }\n this._mnemonic = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"icon\", {\n /**\n * Get the icon renderer for the title.\n *\n * #### Notes\n * The default value is undefined.\n *\n * DEPRECATED: if set to a string value, the .icon field will function as\n * an alias for the .iconClass field, for backwards compatibility\n */\n get: function () {\n /* */\n if (this._icon === null) {\n // only alias .iconClass if ._icon has been explicitly nulled\n return this.iconClass;\n }\n /* */\n return this._icon;\n },\n /**\n * Set the icon renderer for the title.\n *\n * #### Notes\n * A renderer is an object that supplies a render and unrender function.\n *\n * DEPRECATED: if set to a string value, the .icon field will function as\n * an alias for the .iconClass field, for backwards compatibility\n */\n set: function (value /* */) {\n /* */\n if (typeof value === \"string\") {\n // when ._icon is null, the .icon getter will alias .iconClass\n this._icon = null;\n this.iconClass = value;\n }\n else {\n /* */\n if (this._icon === value) {\n return;\n }\n this._icon = value;\n this._changed.emit(undefined);\n /* */\n }\n /* */\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"iconClass\", {\n /**\n * Get the icon class name for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._iconClass;\n },\n /**\n * Set the icon class name for the title.\n *\n * #### Notes\n * Multiple class names can be separated with whitespace.\n */\n set: function (value) {\n if (this._iconClass === value) {\n return;\n }\n this._iconClass = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"iconLabel\", {\n /**\n * Get the icon label for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._iconLabel;\n },\n /**\n * Set the icon label for the title.\n *\n * #### Notes\n * Multiple class names can be separated with whitespace.\n */\n set: function (value) {\n if (this._iconLabel === value) {\n return;\n }\n this._iconLabel = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"iconRenderer\", {\n /**\n * @deprecated Use `icon` instead.\n */\n get: function () {\n return this._icon || undefined;\n },\n /**\n * @deprecated Use `icon` instead.\n */\n set: function (value) {\n this.icon = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"caption\", {\n /**\n * Get the caption for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._caption;\n },\n /**\n * Set the caption for the title.\n */\n set: function (value) {\n if (this._caption === value) {\n return;\n }\n this._caption = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"className\", {\n /**\n * Get the extra class name for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._className;\n },\n /**\n * Set the extra class name for the title.\n *\n * #### Notes\n * Multiple class names can be separated with whitespace.\n */\n set: function (value) {\n if (this._className === value) {\n return;\n }\n this._className = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"closable\", {\n /**\n * Get the closable state for the title.\n *\n * #### Notes\n * The default value is `false`.\n */\n get: function () {\n return this._closable;\n },\n /**\n * Set the closable state for the title.\n *\n * #### Notes\n * This controls the presence of a close icon when applicable.\n */\n set: function (value) {\n if (this._closable === value) {\n return;\n }\n this._closable = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"dataset\", {\n /**\n * Get the dataset for the title.\n *\n * #### Notes\n * The default value is an empty dataset.\n */\n get: function () {\n return this._dataset;\n },\n /**\n * Set the dataset for the title.\n *\n * #### Notes\n * This controls the data attributes when applicable.\n */\n set: function (value) {\n if (this._dataset === value) {\n return;\n }\n this._dataset = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n return Title;\n}());\n\nexports.Title = Title;\n//# sourceMappingURL=title.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/title.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\n\n// Copyright (c) Jupyter Development Team.\n/**\n * An object which holds data related to an object's title.\n *\n * #### Notes\n * A title object is intended to hold the data necessary to display a\n * header for a particular object. A common example is the `TabPanel`,\n * which uses the widget title to populate the tab for a child widget.\n */\nvar Title = /** @class */ (function () {\n /**\n * Construct a new title.\n *\n * @param options - The options for initializing the title.\n */\n function Title(options) {\n this._label = '';\n this._caption = '';\n this._mnemonic = -1;\n this._iconClass = '';\n this._iconLabel = '';\n this._className = '';\n this._closable = false;\n this._changed = new signaling.Signal(this);\n this.owner = options.owner;\n if (options.label !== undefined) {\n this._label = options.label;\n }\n if (options.mnemonic !== undefined) {\n this._mnemonic = options.mnemonic;\n }\n if (options.icon !== undefined) {\n /* */\n if (typeof options.icon === \"string\") {\n // when ._icon is null, the .icon getter will alias .iconClass\n this._icon = null;\n this._iconClass = options.icon;\n }\n else {\n /* */\n this._icon = options.icon;\n /* */\n }\n /* */\n }\n /* */\n else {\n // if unset, default to aliasing .iconClass\n this._icon = null;\n }\n /* */\n if (options.iconClass !== undefined) {\n this._iconClass = options.iconClass;\n }\n if (options.iconLabel !== undefined) {\n this._iconLabel = options.iconLabel;\n }\n if (options.iconRenderer !== undefined) {\n this._icon = options.iconRenderer;\n }\n if (options.caption !== undefined) {\n this._caption = options.caption;\n }\n if (options.className !== undefined) {\n this._className = options.className;\n }\n if (options.closable !== undefined) {\n this._closable = options.closable;\n }\n this._dataset = options.dataset || {};\n }\n Object.defineProperty(Title.prototype, \"changed\", {\n /**\n * A signal emitted when the state of the title changes.\n */\n get: function () {\n return this._changed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"label\", {\n /**\n * Get the label for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._label;\n },\n /**\n * Set the label for the title.\n */\n set: function (value) {\n if (this._label === value) {\n return;\n }\n this._label = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"mnemonic\", {\n /**\n * Get the mnemonic index for the title.\n *\n * #### Notes\n * The default value is `-1`.\n */\n get: function () {\n return this._mnemonic;\n },\n /**\n * Set the mnemonic index for the title.\n */\n set: function (value) {\n if (this._mnemonic === value) {\n return;\n }\n this._mnemonic = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"icon\", {\n /**\n * Get the icon renderer for the title.\n *\n * #### Notes\n * The default value is undefined.\n *\n * DEPRECATED: if set to a string value, the .icon field will function as\n * an alias for the .iconClass field, for backwards compatibility\n */\n get: function () {\n /* */\n if (this._icon === null) {\n // only alias .iconClass if ._icon has been explicitly nulled\n return this.iconClass;\n }\n /* */\n return this._icon;\n },\n /**\n * Set the icon renderer for the title.\n *\n * #### Notes\n * A renderer is an object that supplies a render and unrender function.\n *\n * DEPRECATED: if set to a string value, the .icon field will function as\n * an alias for the .iconClass field, for backwards compatibility\n */\n set: function (value /* */) {\n /* */\n if (typeof value === \"string\") {\n // when ._icon is null, the .icon getter will alias .iconClass\n this._icon = null;\n this.iconClass = value;\n }\n else {\n /* */\n if (this._icon === value) {\n return;\n }\n this._icon = value;\n this._changed.emit(undefined);\n /* */\n }\n /* */\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"iconClass\", {\n /**\n * Get the icon class name for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._iconClass;\n },\n /**\n * Set the icon class name for the title.\n *\n * #### Notes\n * Multiple class names can be separated with whitespace.\n */\n set: function (value) {\n if (this._iconClass === value) {\n return;\n }\n this._iconClass = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"iconLabel\", {\n /**\n * Get the icon label for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._iconLabel;\n },\n /**\n * Set the icon label for the title.\n *\n * #### Notes\n * Multiple class names can be separated with whitespace.\n */\n set: function (value) {\n if (this._iconLabel === value) {\n return;\n }\n this._iconLabel = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"iconRenderer\", {\n /**\n * @deprecated Use `icon` instead.\n */\n get: function () {\n return this._icon || undefined;\n },\n /**\n * @deprecated Use `icon` instead.\n */\n set: function (value) {\n this.icon = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"caption\", {\n /**\n * Get the caption for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._caption;\n },\n /**\n * Set the caption for the title.\n */\n set: function (value) {\n if (this._caption === value) {\n return;\n }\n this._caption = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"className\", {\n /**\n * Get the extra class name for the title.\n *\n * #### Notes\n * The default value is an empty string.\n */\n get: function () {\n return this._className;\n },\n /**\n * Set the extra class name for the title.\n *\n * #### Notes\n * Multiple class names can be separated with whitespace.\n */\n set: function (value) {\n if (this._className === value) {\n return;\n }\n this._className = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"closable\", {\n /**\n * Get the closable state for the title.\n *\n * #### Notes\n * The default value is `false`.\n */\n get: function () {\n return this._closable;\n },\n /**\n * Set the closable state for the title.\n *\n * #### Notes\n * This controls the presence of a close icon when applicable.\n */\n set: function (value) {\n if (this._closable === value) {\n return;\n }\n this._closable = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Title.prototype, \"dataset\", {\n /**\n * Get the dataset for the title.\n *\n * #### Notes\n * The default value is an empty dataset.\n */\n get: function () {\n return this._dataset;\n },\n /**\n * Set the dataset for the title.\n *\n * #### Notes\n * This controls the data attributes when applicable.\n */\n set: function (value) {\n if (this._dataset === value) {\n return;\n }\n this._dataset = value;\n this._changed.emit(undefined);\n },\n enumerable: false,\n configurable: true\n });\n return Title;\n}());\n\nexports.Title = Title;\n//# sourceMappingURL=title.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/title.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "../../packages/widgets/dist/widget.js": │ │ │ │ /*!******************************************************************************************!*\ │ │ │ │ - !*** /build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/widget.js ***! │ │ │ │ + !*** /build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/widget.js ***! │ │ │ │ \******************************************************************************************/ │ │ │ │ /*! no static exports found */ │ │ │ │ /***/ │ │ │ │ (function(module, exports, __webpack_require__) { │ │ │ │ │ │ │ │ "use strict"; │ │ │ │ - eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar title = __webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n\n/**\n * The base class of the lumino widget hierarchy.\n *\n * #### Notes\n * This class will typically be subclassed in order to create a useful\n * widget. However, it can be used directly to host externally created\n * content.\n */\nexports.Widget = /** @class */ (function () {\n /**\n * Construct a new widget.\n *\n * @param options - The options for initializing the widget.\n */\n function Widget(options) {\n if (options === void 0) { options = {}; }\n this._flags = 0;\n this._layout = null;\n this._parent = null;\n this._disposed = new signaling.Signal(this);\n this.node = Private.createNode(options);\n this.addClass('lm-Widget');\n /* */\n this.addClass('p-Widget');\n /* */\n }\n /**\n * Dispose of the widget and its descendant widgets.\n *\n * #### Notes\n * It is unsafe to use the widget after it has been disposed.\n *\n * All calls made to this method after the first are a no-op.\n */\n Widget.prototype.dispose = function () {\n // Do nothing if the widget is already disposed.\n if (this.isDisposed) {\n return;\n }\n // Set the disposed flag and emit the disposed signal.\n this.setFlag(Widget.Flag.IsDisposed);\n this._disposed.emit(undefined);\n // Remove or detach the widget if necessary.\n if (this.parent) {\n this.parent = null;\n }\n else if (this.isAttached) {\n Widget.detach(this);\n }\n // Dispose of the widget layout.\n if (this._layout) {\n this._layout.dispose();\n this._layout = null;\n }\n // Clear the extra data associated with the widget.\n signaling.Signal.clearData(this);\n messaging.MessageLoop.clearData(this);\n properties.AttachedProperty.clearData(this);\n };\n Object.defineProperty(Widget.prototype, \"disposed\", {\n /**\n * A signal emitted when the widget is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"isDisposed\", {\n /**\n * Test whether the widget has been disposed.\n */\n get: function () {\n return this.testFlag(Widget.Flag.IsDisposed);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"isAttached\", {\n /**\n * Test whether the widget's node is attached to the DOM.\n */\n get: function () {\n return this.testFlag(Widget.Flag.IsAttached);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"isHidden\", {\n /**\n * Test whether the widget is explicitly hidden.\n */\n get: function () {\n return this.testFlag(Widget.Flag.IsHidden);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"isVisible\", {\n /**\n * Test whether the widget is visible.\n *\n * #### Notes\n * A widget is visible when it is attached to the DOM, is not\n * explicitly hidden, and has no explicitly hidden ancestors.\n */\n get: function () {\n return this.testFlag(Widget.Flag.IsVisible);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"title\", {\n /**\n * The title object for the widget.\n *\n * #### Notes\n * The title object is used by some container widgets when displaying\n * the widget alongside some title, such as a tab panel or side bar.\n *\n * Since not all widgets will use the title, it is created on demand.\n *\n * The `owner` property of the title is set to this widget.\n */\n get: function () {\n return Private.titleProperty.get(this);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"id\", {\n /**\n * Get the id of the widget's DOM node.\n */\n get: function () {\n return this.node.id;\n },\n /**\n * Set the id of the widget's DOM node.\n */\n set: function (value) {\n this.node.id = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"dataset\", {\n /**\n * The dataset for the widget's DOM node.\n */\n get: function () {\n return this.node.dataset;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"parent\", {\n /**\n * Get the parent of the widget.\n */\n get: function () {\n return this._parent;\n },\n /**\n * Set the parent of the widget.\n *\n * #### Notes\n * Children are typically added to a widget by using a layout, which\n * means user code will not normally set the parent widget directly.\n *\n * The widget will be automatically removed from its old parent.\n *\n * This is a no-op if there is no effective parent change.\n */\n set: function (value) {\n if (this._parent === value) {\n return;\n }\n if (value && this.contains(value)) {\n throw new Error('Invalid parent widget.');\n }\n if (this._parent && !this._parent.isDisposed) {\n var msg = new Widget.ChildMessage('child-removed', this);\n messaging.MessageLoop.sendMessage(this._parent, msg);\n }\n this._parent = value;\n if (this._parent && !this._parent.isDisposed) {\n var msg = new Widget.ChildMessage('child-added', this);\n messaging.MessageLoop.sendMessage(this._parent, msg);\n }\n if (!this.isDisposed) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.ParentChanged);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"layout\", {\n /**\n * Get the layout for the widget.\n */\n get: function () {\n return this._layout;\n },\n /**\n * Set the layout for the widget.\n *\n * #### Notes\n * The layout is single-use only. It cannot be changed after the\n * first assignment.\n *\n * The layout is disposed automatically when the widget is disposed.\n */\n set: function (value) {\n if (this._layout === value) {\n return;\n }\n if (this.testFlag(Widget.Flag.DisallowLayout)) {\n throw new Error('Cannot set widget layout.');\n }\n if (this._layout) {\n throw new Error('Cannot change widget layout.');\n }\n if (value.parent) {\n throw new Error('Cannot change layout parent.');\n }\n this._layout = value;\n value.parent = this;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the widget's children.\n *\n * @returns A new iterator over the children of the widget.\n *\n * #### Notes\n * The widget must have a populated layout in order to have children.\n *\n * If a layout is not installed, the returned iterator will be empty.\n */\n Widget.prototype.children = function () {\n return this._layout ? this._layout.iter() : algorithm.empty();\n };\n /**\n * Test whether a widget is a descendant of this widget.\n *\n * @param widget - The descendant widget of interest.\n *\n * @returns `true` if the widget is a descendant, `false` otherwise.\n */\n Widget.prototype.contains = function (widget) {\n for (var value = widget; value; value = value._parent) {\n if (value === this) {\n return true;\n }\n }\n return false;\n };\n /**\n * Test whether the widget's DOM node has the given class name.\n *\n * @param name - The class name of interest.\n *\n * @returns `true` if the node has the class, `false` otherwise.\n */\n Widget.prototype.hasClass = function (name) {\n return this.node.classList.contains(name);\n };\n /**\n * Add a class name to the widget's DOM node.\n *\n * @param name - The class name to add to the node.\n *\n * #### Notes\n * If the class name is already added to the node, this is a no-op.\n *\n * The class name must not contain whitespace.\n */\n Widget.prototype.addClass = function (name) {\n this.node.classList.add(name);\n };\n /**\n * Remove a class name from the widget's DOM node.\n *\n * @param name - The class name to remove from the node.\n *\n * #### Notes\n * If the class name is not yet added to the node, this is a no-op.\n *\n * The class name must not contain whitespace.\n */\n Widget.prototype.removeClass = function (name) {\n this.node.classList.remove(name);\n };\n /**\n * Toggle a class name on the widget's DOM node.\n *\n * @param name - The class name to toggle on the node.\n *\n * @param force - Whether to force add the class (`true`) or force\n * remove the class (`false`). If not provided, the presence of\n * the class will be toggled from its current state.\n *\n * @returns `true` if the class is now present, `false` otherwise.\n *\n * #### Notes\n * The class name must not contain whitespace.\n */\n Widget.prototype.toggleClass = function (name, force) {\n if (force === true) {\n this.node.classList.add(name);\n return true;\n }\n if (force === false) {\n this.node.classList.remove(name);\n return false;\n }\n return this.node.classList.toggle(name);\n };\n /**\n * Post an `'update-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for posting the message.\n */\n Widget.prototype.update = function () {\n messaging.MessageLoop.postMessage(this, Widget.Msg.UpdateRequest);\n };\n /**\n * Post a `'fit-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for posting the message.\n */\n Widget.prototype.fit = function () {\n messaging.MessageLoop.postMessage(this, Widget.Msg.FitRequest);\n };\n /**\n * Post an `'activate-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for posting the message.\n */\n Widget.prototype.activate = function () {\n messaging.MessageLoop.postMessage(this, Widget.Msg.ActivateRequest);\n };\n /**\n * Send a `'close-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for sending the message.\n */\n Widget.prototype.close = function () {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.CloseRequest);\n };\n /**\n * Show the widget and make it visible to its parent widget.\n *\n * #### Notes\n * This causes the [[isHidden]] property to be `false`.\n *\n * If the widget is not explicitly hidden, this is a no-op.\n */\n Widget.prototype.show = function () {\n if (!this.testFlag(Widget.Flag.IsHidden)) {\n return;\n }\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.BeforeShow);\n }\n this.clearFlag(Widget.Flag.IsHidden);\n this.removeClass('lm-mod-hidden');\n /* */\n this.removeClass('p-mod-hidden');\n /* */\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.AfterShow);\n }\n if (this.parent) {\n var msg = new Widget.ChildMessage('child-shown', this);\n messaging.MessageLoop.sendMessage(this.parent, msg);\n }\n };\n /**\n * Hide the widget and make it hidden to its parent widget.\n *\n * #### Notes\n * This causes the [[isHidden]] property to be `true`.\n *\n * If the widget is explicitly hidden, this is a no-op.\n */\n Widget.prototype.hide = function () {\n if (this.testFlag(Widget.Flag.IsHidden)) {\n return;\n }\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.BeforeHide);\n }\n this.setFlag(Widget.Flag.IsHidden);\n this.addClass('lm-mod-hidden');\n /* */\n this.addClass('p-mod-hidden');\n /* */\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.AfterHide);\n }\n if (this.parent) {\n var msg = new Widget.ChildMessage('child-hidden', this);\n messaging.MessageLoop.sendMessage(this.parent, msg);\n }\n };\n /**\n * Show or hide the widget according to a boolean value.\n *\n * @param hidden - `true` to hide the widget, or `false` to show it.\n *\n * #### Notes\n * This is a convenience method for `hide()` and `show()`.\n */\n Widget.prototype.setHidden = function (hidden) {\n if (hidden) {\n this.hide();\n }\n else {\n this.show();\n }\n };\n /**\n * Test whether the given widget flag is set.\n *\n * #### Notes\n * This will not typically be called directly by user code.\n */\n Widget.prototype.testFlag = function (flag) {\n return (this._flags & flag) !== 0;\n };\n /**\n * Set the given widget flag.\n *\n * #### Notes\n * This will not typically be called directly by user code.\n */\n Widget.prototype.setFlag = function (flag) {\n this._flags |= flag;\n };\n /**\n * Clear the given widget flag.\n *\n * #### Notes\n * This will not typically be called directly by user code.\n */\n Widget.prototype.clearFlag = function (flag) {\n this._flags &= ~flag;\n };\n /**\n * Process a message sent to the widget.\n *\n * @param msg - The message sent to the widget.\n *\n * #### Notes\n * Subclasses may reimplement this method as needed.\n */\n Widget.prototype.processMessage = function (msg) {\n switch (msg.type) {\n case 'resize':\n this.notifyLayout(msg);\n this.onResize(msg);\n break;\n case 'update-request':\n this.notifyLayout(msg);\n this.onUpdateRequest(msg);\n break;\n case 'fit-request':\n this.notifyLayout(msg);\n this.onFitRequest(msg);\n break;\n case 'before-show':\n this.notifyLayout(msg);\n this.onBeforeShow(msg);\n break;\n case 'after-show':\n this.setFlag(Widget.Flag.IsVisible);\n this.notifyLayout(msg);\n this.onAfterShow(msg);\n break;\n case 'before-hide':\n this.notifyLayout(msg);\n this.onBeforeHide(msg);\n break;\n case 'after-hide':\n this.clearFlag(Widget.Flag.IsVisible);\n this.notifyLayout(msg);\n this.onAfterHide(msg);\n break;\n case 'before-attach':\n this.notifyLayout(msg);\n this.onBeforeAttach(msg);\n break;\n case 'after-attach':\n if (!this.isHidden && (!this.parent || this.parent.isVisible)) {\n this.setFlag(Widget.Flag.IsVisible);\n }\n this.setFlag(Widget.Flag.IsAttached);\n this.notifyLayout(msg);\n this.onAfterAttach(msg);\n break;\n case 'before-detach':\n this.notifyLayout(msg);\n this.onBeforeDetach(msg);\n break;\n case 'after-detach':\n this.clearFlag(Widget.Flag.IsVisible);\n this.clearFlag(Widget.Flag.IsAttached);\n this.notifyLayout(msg);\n this.onAfterDetach(msg);\n break;\n case 'activate-request':\n this.notifyLayout(msg);\n this.onActivateRequest(msg);\n break;\n case 'close-request':\n this.notifyLayout(msg);\n this.onCloseRequest(msg);\n break;\n case 'child-added':\n this.notifyLayout(msg);\n this.onChildAdded(msg);\n break;\n case 'child-removed':\n this.notifyLayout(msg);\n this.onChildRemoved(msg);\n break;\n default:\n this.notifyLayout(msg);\n break;\n }\n };\n /**\n * Invoke the message processing routine of the widget's layout.\n *\n * @param msg - The message to dispatch to the layout.\n *\n * #### Notes\n * This is a no-op if the widget does not have a layout.\n *\n * This will not typically be called directly by user code.\n */\n Widget.prototype.notifyLayout = function (msg) {\n if (this._layout) {\n this._layout.processParentMessage(msg);\n }\n };\n /**\n * A message handler invoked on a `'close-request'` message.\n *\n * #### Notes\n * The default implementation unparents or detaches the widget.\n */\n Widget.prototype.onCloseRequest = function (msg) {\n if (this.parent) {\n this.parent = null;\n }\n else if (this.isAttached) {\n Widget.detach(this);\n }\n };\n /**\n * A message handler invoked on a `'resize'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onResize = function (msg) { };\n /**\n * A message handler invoked on an `'update-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onUpdateRequest = function (msg) { };\n /**\n * A message handler invoked on a `'fit-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onFitRequest = function (msg) { };\n /**\n * A message handler invoked on an `'activate-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onActivateRequest = function (msg) { };\n /**\n * A message handler invoked on a `'before-show'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onBeforeShow = function (msg) { };\n /**\n * A message handler invoked on an `'after-show'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onAfterShow = function (msg) { };\n /**\n * A message handler invoked on a `'before-hide'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onBeforeHide = function (msg) { };\n /**\n * A message handler invoked on an `'after-hide'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onAfterHide = function (msg) { };\n /**\n * A message handler invoked on a `'before-attach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onBeforeAttach = function (msg) { };\n /**\n * A message handler invoked on an `'after-attach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onAfterAttach = function (msg) { };\n /**\n * A message handler invoked on a `'before-detach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onBeforeDetach = function (msg) { };\n /**\n * A message handler invoked on an `'after-detach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onAfterDetach = function (msg) { };\n /**\n * A message handler invoked on a `'child-added'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onChildAdded = function (msg) { };\n /**\n * A message handler invoked on a `'child-removed'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onChildRemoved = function (msg) { };\n return Widget;\n}());\n/**\n * The namespace for the `Widget` class statics.\n */\n(function (Widget) {\n /**\n * An enum of widget bit flags.\n */\n var Flag;\n (function (Flag) {\n /**\n * The widget has been disposed.\n */\n Flag[Flag[\"IsDisposed\"] = 1] = \"IsDisposed\";\n /**\n * The widget is attached to the DOM.\n */\n Flag[Flag[\"IsAttached\"] = 2] = \"IsAttached\";\n /**\n * The widget is hidden.\n */\n Flag[Flag[\"IsHidden\"] = 4] = \"IsHidden\";\n /**\n * The widget is visible.\n */\n Flag[Flag[\"IsVisible\"] = 8] = \"IsVisible\";\n /**\n * A layout cannot be set on the widget.\n */\n Flag[Flag[\"DisallowLayout\"] = 16] = \"DisallowLayout\";\n })(Flag = Widget.Flag || (Widget.Flag = {}));\n /**\n * A collection of stateless messages related to widgets.\n */\n var Msg;\n (function (Msg) {\n /**\n * A singleton `'before-show'` message.\n *\n * #### Notes\n * This message is sent to a widget before it becomes visible.\n *\n * This message is **not** sent when the widget is being attached.\n */\n Msg.BeforeShow = new messaging.Message('before-show');\n /**\n * A singleton `'after-show'` message.\n *\n * #### Notes\n * This message is sent to a widget after it becomes visible.\n *\n * This message is **not** sent when the widget is being attached.\n */\n Msg.AfterShow = new messaging.Message('after-show');\n /**\n * A singleton `'before-hide'` message.\n *\n * #### Notes\n * This message is sent to a widget before it becomes not-visible.\n *\n * This message is **not** sent when the widget is being detached.\n */\n Msg.BeforeHide = new messaging.Message('before-hide');\n /**\n * A singleton `'after-hide'` message.\n *\n * #### Notes\n * This message is sent to a widget after it becomes not-visible.\n *\n * This message is **not** sent when the widget is being detached.\n */\n Msg.AfterHide = new messaging.Message('after-hide');\n /**\n * A singleton `'before-attach'` message.\n *\n * #### Notes\n * This message is sent to a widget before it is attached.\n */\n Msg.BeforeAttach = new messaging.Message('before-attach');\n /**\n * A singleton `'after-attach'` message.\n *\n * #### Notes\n * This message is sent to a widget after it is attached.\n */\n Msg.AfterAttach = new messaging.Message('after-attach');\n /**\n * A singleton `'before-detach'` message.\n *\n * #### Notes\n * This message is sent to a widget before it is detached.\n */\n Msg.BeforeDetach = new messaging.Message('before-detach');\n /**\n * A singleton `'after-detach'` message.\n *\n * #### Notes\n * This message is sent to a widget after it is detached.\n */\n Msg.AfterDetach = new messaging.Message('after-detach');\n /**\n * A singleton `'parent-changed'` message.\n *\n * #### Notes\n * This message is sent to a widget when its parent has changed.\n */\n Msg.ParentChanged = new messaging.Message('parent-changed');\n /**\n * A singleton conflatable `'update-request'` message.\n *\n * #### Notes\n * This message can be dispatched to supporting widgets in order to\n * update their content based on the current widget state. Not all\n * widgets will respond to messages of this type.\n *\n * For widgets with a layout, this message will inform the layout to\n * update the position and size of its child widgets.\n */\n Msg.UpdateRequest = new messaging.ConflatableMessage('update-request');\n /**\n * A singleton conflatable `'fit-request'` message.\n *\n * #### Notes\n * For widgets with a layout, this message will inform the layout to\n * recalculate its size constraints to fit the space requirements of\n * its child widgets, and to update their position and size. Not all\n * layouts will respond to messages of this type.\n */\n Msg.FitRequest = new messaging.ConflatableMessage('fit-request');\n /**\n * A singleton conflatable `'activate-request'` message.\n *\n * #### Notes\n * This message should be dispatched to a widget when it should\n * perform the actions necessary to activate the widget, which\n * may include focusing its node or descendant node.\n */\n Msg.ActivateRequest = new messaging.ConflatableMessage('activate-request');\n /**\n * A singleton conflatable `'close-request'` message.\n *\n * #### Notes\n * This message should be dispatched to a widget when it should close\n * and remove itself from the widget hierarchy.\n */\n Msg.CloseRequest = new messaging.ConflatableMessage('close-request');\n })(Msg = Widget.Msg || (Widget.Msg = {}));\n /**\n * A message class for child related messages.\n */\n var ChildMessage = /** @class */ (function (_super) {\n tslib.__extends(ChildMessage, _super);\n /**\n * Construct a new child message.\n *\n * @param type - The message type.\n *\n * @param child - The child widget for the message.\n */\n function ChildMessage(type, child) {\n var _this = _super.call(this, type) || this;\n _this.child = child;\n return _this;\n }\n return ChildMessage;\n }(messaging.Message));\n Widget.ChildMessage = ChildMessage;\n /**\n * A message class for `'resize'` messages.\n */\n var ResizeMessage = /** @class */ (function (_super) {\n tslib.__extends(ResizeMessage, _super);\n /**\n * Construct a new resize message.\n *\n * @param width - The **offset width** of the widget, or `-1` if\n * the width is not known.\n *\n * @param height - The **offset height** of the widget, or `-1` if\n * the height is not known.\n */\n function ResizeMessage(width, height) {\n var _this = _super.call(this, 'resize') || this;\n _this.width = width;\n _this.height = height;\n return _this;\n }\n return ResizeMessage;\n }(messaging.Message));\n Widget.ResizeMessage = ResizeMessage;\n /**\n * The namespace for the `ResizeMessage` class statics.\n */\n (function (ResizeMessage) {\n /**\n * A singleton `'resize'` message with an unknown size.\n */\n ResizeMessage.UnknownSize = new ResizeMessage(-1, -1);\n })(ResizeMessage = Widget.ResizeMessage || (Widget.ResizeMessage = {}));\n /**\n * Attach a widget to a host DOM node.\n *\n * @param widget - The widget of interest.\n *\n * @param host - The DOM node to use as the widget's host.\n *\n * @param ref - The child of `host` to use as the reference element.\n * If this is provided, the widget will be inserted before this\n * node in the host. The default is `null`, which will cause the\n * widget to be added as the last child of the host.\n *\n * #### Notes\n * This will throw an error if the widget is not a root widget, if\n * the widget is already attached, or if the host is not attached\n * to the DOM.\n */\n function attach(widget, host, ref) {\n if (ref === void 0) { ref = null; }\n if (widget.parent) {\n throw new Error('Cannot attach a child widget.');\n }\n if (widget.isAttached || document.body.contains(widget.node)) {\n throw new Error('Widget is already attached.');\n }\n if (!document.body.contains(host)) {\n throw new Error('Host is not attached.');\n }\n messaging.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n host.insertBefore(widget.node, ref);\n messaging.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n Widget.attach = attach;\n /**\n * Detach the widget from its host DOM node.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * This will throw an error if the widget is not a root widget,\n * or if the widget is not attached to the DOM.\n */\n function detach(widget) {\n if (widget.parent) {\n throw new Error('Cannot detach a child widget.');\n }\n if (!widget.isAttached || !document.body.contains(widget.node)) {\n throw new Error('Widget is not attached.');\n }\n messaging.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n widget.node.parentNode.removeChild(widget.node);\n messaging.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n Widget.detach = detach;\n})(exports.Widget || (exports.Widget = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * An attached property for the widget title object.\n */\n Private.titleProperty = new properties.AttachedProperty({\n name: 'title',\n create: function (owner) { return new title.Title({ owner: owner }); },\n });\n /**\n * Create a DOM node for the given widget options.\n */\n function createNode(options) {\n return options.node || document.createElement('div');\n }\n Private.createNode = createNode;\n})(Private || (Private = {}));\n//# sourceMappingURL=widget.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0~20200824+git93880412/packages/widgets/dist/widget.js?"); │ │ │ │ + eval("\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = __webpack_require__(/*! tslib */ \"../../../../../usr/share/nodejs/tslib/tslib.es6.js\");\nvar algorithm = __webpack_require__(/*! @lumino/algorithm */ \"../../packages/algorithm/dist/index.js\");\nvar messaging = __webpack_require__(/*! @lumino/messaging */ \"../../packages/messaging/dist/index.js\");\nvar properties = __webpack_require__(/*! @lumino/properties */ \"../../packages/properties/dist/index.js\");\nvar signaling = __webpack_require__(/*! @lumino/signaling */ \"../../packages/signaling/dist/index.js\");\nvar title = __webpack_require__(/*! ./title.js */ \"../../packages/widgets/dist/title.js\");\n\n/**\n * The base class of the lumino widget hierarchy.\n *\n * #### Notes\n * This class will typically be subclassed in order to create a useful\n * widget. However, it can be used directly to host externally created\n * content.\n */\nexports.Widget = /** @class */ (function () {\n /**\n * Construct a new widget.\n *\n * @param options - The options for initializing the widget.\n */\n function Widget(options) {\n if (options === void 0) { options = {}; }\n this._flags = 0;\n this._layout = null;\n this._parent = null;\n this._disposed = new signaling.Signal(this);\n this.node = Private.createNode(options);\n this.addClass('lm-Widget');\n /* */\n this.addClass('p-Widget');\n /* */\n }\n /**\n * Dispose of the widget and its descendant widgets.\n *\n * #### Notes\n * It is unsafe to use the widget after it has been disposed.\n *\n * All calls made to this method after the first are a no-op.\n */\n Widget.prototype.dispose = function () {\n // Do nothing if the widget is already disposed.\n if (this.isDisposed) {\n return;\n }\n // Set the disposed flag and emit the disposed signal.\n this.setFlag(Widget.Flag.IsDisposed);\n this._disposed.emit(undefined);\n // Remove or detach the widget if necessary.\n if (this.parent) {\n this.parent = null;\n }\n else if (this.isAttached) {\n Widget.detach(this);\n }\n // Dispose of the widget layout.\n if (this._layout) {\n this._layout.dispose();\n this._layout = null;\n }\n // Clear the extra data associated with the widget.\n signaling.Signal.clearData(this);\n messaging.MessageLoop.clearData(this);\n properties.AttachedProperty.clearData(this);\n };\n Object.defineProperty(Widget.prototype, \"disposed\", {\n /**\n * A signal emitted when the widget is disposed.\n */\n get: function () {\n return this._disposed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"isDisposed\", {\n /**\n * Test whether the widget has been disposed.\n */\n get: function () {\n return this.testFlag(Widget.Flag.IsDisposed);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"isAttached\", {\n /**\n * Test whether the widget's node is attached to the DOM.\n */\n get: function () {\n return this.testFlag(Widget.Flag.IsAttached);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"isHidden\", {\n /**\n * Test whether the widget is explicitly hidden.\n */\n get: function () {\n return this.testFlag(Widget.Flag.IsHidden);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"isVisible\", {\n /**\n * Test whether the widget is visible.\n *\n * #### Notes\n * A widget is visible when it is attached to the DOM, is not\n * explicitly hidden, and has no explicitly hidden ancestors.\n */\n get: function () {\n return this.testFlag(Widget.Flag.IsVisible);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"title\", {\n /**\n * The title object for the widget.\n *\n * #### Notes\n * The title object is used by some container widgets when displaying\n * the widget alongside some title, such as a tab panel or side bar.\n *\n * Since not all widgets will use the title, it is created on demand.\n *\n * The `owner` property of the title is set to this widget.\n */\n get: function () {\n return Private.titleProperty.get(this);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"id\", {\n /**\n * Get the id of the widget's DOM node.\n */\n get: function () {\n return this.node.id;\n },\n /**\n * Set the id of the widget's DOM node.\n */\n set: function (value) {\n this.node.id = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"dataset\", {\n /**\n * The dataset for the widget's DOM node.\n */\n get: function () {\n return this.node.dataset;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"parent\", {\n /**\n * Get the parent of the widget.\n */\n get: function () {\n return this._parent;\n },\n /**\n * Set the parent of the widget.\n *\n * #### Notes\n * Children are typically added to a widget by using a layout, which\n * means user code will not normally set the parent widget directly.\n *\n * The widget will be automatically removed from its old parent.\n *\n * This is a no-op if there is no effective parent change.\n */\n set: function (value) {\n if (this._parent === value) {\n return;\n }\n if (value && this.contains(value)) {\n throw new Error('Invalid parent widget.');\n }\n if (this._parent && !this._parent.isDisposed) {\n var msg = new Widget.ChildMessage('child-removed', this);\n messaging.MessageLoop.sendMessage(this._parent, msg);\n }\n this._parent = value;\n if (this._parent && !this._parent.isDisposed) {\n var msg = new Widget.ChildMessage('child-added', this);\n messaging.MessageLoop.sendMessage(this._parent, msg);\n }\n if (!this.isDisposed) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.ParentChanged);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Widget.prototype, \"layout\", {\n /**\n * Get the layout for the widget.\n */\n get: function () {\n return this._layout;\n },\n /**\n * Set the layout for the widget.\n *\n * #### Notes\n * The layout is single-use only. It cannot be changed after the\n * first assignment.\n *\n * The layout is disposed automatically when the widget is disposed.\n */\n set: function (value) {\n if (this._layout === value) {\n return;\n }\n if (this.testFlag(Widget.Flag.DisallowLayout)) {\n throw new Error('Cannot set widget layout.');\n }\n if (this._layout) {\n throw new Error('Cannot change widget layout.');\n }\n if (value.parent) {\n throw new Error('Cannot change layout parent.');\n }\n this._layout = value;\n value.parent = this;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Create an iterator over the widget's children.\n *\n * @returns A new iterator over the children of the widget.\n *\n * #### Notes\n * The widget must have a populated layout in order to have children.\n *\n * If a layout is not installed, the returned iterator will be empty.\n */\n Widget.prototype.children = function () {\n return this._layout ? this._layout.iter() : algorithm.empty();\n };\n /**\n * Test whether a widget is a descendant of this widget.\n *\n * @param widget - The descendant widget of interest.\n *\n * @returns `true` if the widget is a descendant, `false` otherwise.\n */\n Widget.prototype.contains = function (widget) {\n for (var value = widget; value; value = value._parent) {\n if (value === this) {\n return true;\n }\n }\n return false;\n };\n /**\n * Test whether the widget's DOM node has the given class name.\n *\n * @param name - The class name of interest.\n *\n * @returns `true` if the node has the class, `false` otherwise.\n */\n Widget.prototype.hasClass = function (name) {\n return this.node.classList.contains(name);\n };\n /**\n * Add a class name to the widget's DOM node.\n *\n * @param name - The class name to add to the node.\n *\n * #### Notes\n * If the class name is already added to the node, this is a no-op.\n *\n * The class name must not contain whitespace.\n */\n Widget.prototype.addClass = function (name) {\n this.node.classList.add(name);\n };\n /**\n * Remove a class name from the widget's DOM node.\n *\n * @param name - The class name to remove from the node.\n *\n * #### Notes\n * If the class name is not yet added to the node, this is a no-op.\n *\n * The class name must not contain whitespace.\n */\n Widget.prototype.removeClass = function (name) {\n this.node.classList.remove(name);\n };\n /**\n * Toggle a class name on the widget's DOM node.\n *\n * @param name - The class name to toggle on the node.\n *\n * @param force - Whether to force add the class (`true`) or force\n * remove the class (`false`). If not provided, the presence of\n * the class will be toggled from its current state.\n *\n * @returns `true` if the class is now present, `false` otherwise.\n *\n * #### Notes\n * The class name must not contain whitespace.\n */\n Widget.prototype.toggleClass = function (name, force) {\n if (force === true) {\n this.node.classList.add(name);\n return true;\n }\n if (force === false) {\n this.node.classList.remove(name);\n return false;\n }\n return this.node.classList.toggle(name);\n };\n /**\n * Post an `'update-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for posting the message.\n */\n Widget.prototype.update = function () {\n messaging.MessageLoop.postMessage(this, Widget.Msg.UpdateRequest);\n };\n /**\n * Post a `'fit-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for posting the message.\n */\n Widget.prototype.fit = function () {\n messaging.MessageLoop.postMessage(this, Widget.Msg.FitRequest);\n };\n /**\n * Post an `'activate-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for posting the message.\n */\n Widget.prototype.activate = function () {\n messaging.MessageLoop.postMessage(this, Widget.Msg.ActivateRequest);\n };\n /**\n * Send a `'close-request'` message to the widget.\n *\n * #### Notes\n * This is a simple convenience method for sending the message.\n */\n Widget.prototype.close = function () {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.CloseRequest);\n };\n /**\n * Show the widget and make it visible to its parent widget.\n *\n * #### Notes\n * This causes the [[isHidden]] property to be `false`.\n *\n * If the widget is not explicitly hidden, this is a no-op.\n */\n Widget.prototype.show = function () {\n if (!this.testFlag(Widget.Flag.IsHidden)) {\n return;\n }\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.BeforeShow);\n }\n this.clearFlag(Widget.Flag.IsHidden);\n this.removeClass('lm-mod-hidden');\n /* */\n this.removeClass('p-mod-hidden');\n /* */\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.AfterShow);\n }\n if (this.parent) {\n var msg = new Widget.ChildMessage('child-shown', this);\n messaging.MessageLoop.sendMessage(this.parent, msg);\n }\n };\n /**\n * Hide the widget and make it hidden to its parent widget.\n *\n * #### Notes\n * This causes the [[isHidden]] property to be `true`.\n *\n * If the widget is explicitly hidden, this is a no-op.\n */\n Widget.prototype.hide = function () {\n if (this.testFlag(Widget.Flag.IsHidden)) {\n return;\n }\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.BeforeHide);\n }\n this.setFlag(Widget.Flag.IsHidden);\n this.addClass('lm-mod-hidden');\n /* */\n this.addClass('p-mod-hidden');\n /* */\n if (this.isAttached && (!this.parent || this.parent.isVisible)) {\n messaging.MessageLoop.sendMessage(this, Widget.Msg.AfterHide);\n }\n if (this.parent) {\n var msg = new Widget.ChildMessage('child-hidden', this);\n messaging.MessageLoop.sendMessage(this.parent, msg);\n }\n };\n /**\n * Show or hide the widget according to a boolean value.\n *\n * @param hidden - `true` to hide the widget, or `false` to show it.\n *\n * #### Notes\n * This is a convenience method for `hide()` and `show()`.\n */\n Widget.prototype.setHidden = function (hidden) {\n if (hidden) {\n this.hide();\n }\n else {\n this.show();\n }\n };\n /**\n * Test whether the given widget flag is set.\n *\n * #### Notes\n * This will not typically be called directly by user code.\n */\n Widget.prototype.testFlag = function (flag) {\n return (this._flags & flag) !== 0;\n };\n /**\n * Set the given widget flag.\n *\n * #### Notes\n * This will not typically be called directly by user code.\n */\n Widget.prototype.setFlag = function (flag) {\n this._flags |= flag;\n };\n /**\n * Clear the given widget flag.\n *\n * #### Notes\n * This will not typically be called directly by user code.\n */\n Widget.prototype.clearFlag = function (flag) {\n this._flags &= ~flag;\n };\n /**\n * Process a message sent to the widget.\n *\n * @param msg - The message sent to the widget.\n *\n * #### Notes\n * Subclasses may reimplement this method as needed.\n */\n Widget.prototype.processMessage = function (msg) {\n switch (msg.type) {\n case 'resize':\n this.notifyLayout(msg);\n this.onResize(msg);\n break;\n case 'update-request':\n this.notifyLayout(msg);\n this.onUpdateRequest(msg);\n break;\n case 'fit-request':\n this.notifyLayout(msg);\n this.onFitRequest(msg);\n break;\n case 'before-show':\n this.notifyLayout(msg);\n this.onBeforeShow(msg);\n break;\n case 'after-show':\n this.setFlag(Widget.Flag.IsVisible);\n this.notifyLayout(msg);\n this.onAfterShow(msg);\n break;\n case 'before-hide':\n this.notifyLayout(msg);\n this.onBeforeHide(msg);\n break;\n case 'after-hide':\n this.clearFlag(Widget.Flag.IsVisible);\n this.notifyLayout(msg);\n this.onAfterHide(msg);\n break;\n case 'before-attach':\n this.notifyLayout(msg);\n this.onBeforeAttach(msg);\n break;\n case 'after-attach':\n if (!this.isHidden && (!this.parent || this.parent.isVisible)) {\n this.setFlag(Widget.Flag.IsVisible);\n }\n this.setFlag(Widget.Flag.IsAttached);\n this.notifyLayout(msg);\n this.onAfterAttach(msg);\n break;\n case 'before-detach':\n this.notifyLayout(msg);\n this.onBeforeDetach(msg);\n break;\n case 'after-detach':\n this.clearFlag(Widget.Flag.IsVisible);\n this.clearFlag(Widget.Flag.IsAttached);\n this.notifyLayout(msg);\n this.onAfterDetach(msg);\n break;\n case 'activate-request':\n this.notifyLayout(msg);\n this.onActivateRequest(msg);\n break;\n case 'close-request':\n this.notifyLayout(msg);\n this.onCloseRequest(msg);\n break;\n case 'child-added':\n this.notifyLayout(msg);\n this.onChildAdded(msg);\n break;\n case 'child-removed':\n this.notifyLayout(msg);\n this.onChildRemoved(msg);\n break;\n default:\n this.notifyLayout(msg);\n break;\n }\n };\n /**\n * Invoke the message processing routine of the widget's layout.\n *\n * @param msg - The message to dispatch to the layout.\n *\n * #### Notes\n * This is a no-op if the widget does not have a layout.\n *\n * This will not typically be called directly by user code.\n */\n Widget.prototype.notifyLayout = function (msg) {\n if (this._layout) {\n this._layout.processParentMessage(msg);\n }\n };\n /**\n * A message handler invoked on a `'close-request'` message.\n *\n * #### Notes\n * The default implementation unparents or detaches the widget.\n */\n Widget.prototype.onCloseRequest = function (msg) {\n if (this.parent) {\n this.parent = null;\n }\n else if (this.isAttached) {\n Widget.detach(this);\n }\n };\n /**\n * A message handler invoked on a `'resize'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onResize = function (msg) { };\n /**\n * A message handler invoked on an `'update-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onUpdateRequest = function (msg) { };\n /**\n * A message handler invoked on a `'fit-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onFitRequest = function (msg) { };\n /**\n * A message handler invoked on an `'activate-request'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onActivateRequest = function (msg) { };\n /**\n * A message handler invoked on a `'before-show'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onBeforeShow = function (msg) { };\n /**\n * A message handler invoked on an `'after-show'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onAfterShow = function (msg) { };\n /**\n * A message handler invoked on a `'before-hide'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onBeforeHide = function (msg) { };\n /**\n * A message handler invoked on an `'after-hide'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onAfterHide = function (msg) { };\n /**\n * A message handler invoked on a `'before-attach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onBeforeAttach = function (msg) { };\n /**\n * A message handler invoked on an `'after-attach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onAfterAttach = function (msg) { };\n /**\n * A message handler invoked on a `'before-detach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onBeforeDetach = function (msg) { };\n /**\n * A message handler invoked on an `'after-detach'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onAfterDetach = function (msg) { };\n /**\n * A message handler invoked on a `'child-added'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onChildAdded = function (msg) { };\n /**\n * A message handler invoked on a `'child-removed'` message.\n *\n * #### Notes\n * The default implementation of this handler is a no-op.\n */\n Widget.prototype.onChildRemoved = function (msg) { };\n return Widget;\n}());\n/**\n * The namespace for the `Widget` class statics.\n */\n(function (Widget) {\n /**\n * An enum of widget bit flags.\n */\n var Flag;\n (function (Flag) {\n /**\n * The widget has been disposed.\n */\n Flag[Flag[\"IsDisposed\"] = 1] = \"IsDisposed\";\n /**\n * The widget is attached to the DOM.\n */\n Flag[Flag[\"IsAttached\"] = 2] = \"IsAttached\";\n /**\n * The widget is hidden.\n */\n Flag[Flag[\"IsHidden\"] = 4] = \"IsHidden\";\n /**\n * The widget is visible.\n */\n Flag[Flag[\"IsVisible\"] = 8] = \"IsVisible\";\n /**\n * A layout cannot be set on the widget.\n */\n Flag[Flag[\"DisallowLayout\"] = 16] = \"DisallowLayout\";\n })(Flag = Widget.Flag || (Widget.Flag = {}));\n /**\n * A collection of stateless messages related to widgets.\n */\n var Msg;\n (function (Msg) {\n /**\n * A singleton `'before-show'` message.\n *\n * #### Notes\n * This message is sent to a widget before it becomes visible.\n *\n * This message is **not** sent when the widget is being attached.\n */\n Msg.BeforeShow = new messaging.Message('before-show');\n /**\n * A singleton `'after-show'` message.\n *\n * #### Notes\n * This message is sent to a widget after it becomes visible.\n *\n * This message is **not** sent when the widget is being attached.\n */\n Msg.AfterShow = new messaging.Message('after-show');\n /**\n * A singleton `'before-hide'` message.\n *\n * #### Notes\n * This message is sent to a widget before it becomes not-visible.\n *\n * This message is **not** sent when the widget is being detached.\n */\n Msg.BeforeHide = new messaging.Message('before-hide');\n /**\n * A singleton `'after-hide'` message.\n *\n * #### Notes\n * This message is sent to a widget after it becomes not-visible.\n *\n * This message is **not** sent when the widget is being detached.\n */\n Msg.AfterHide = new messaging.Message('after-hide');\n /**\n * A singleton `'before-attach'` message.\n *\n * #### Notes\n * This message is sent to a widget before it is attached.\n */\n Msg.BeforeAttach = new messaging.Message('before-attach');\n /**\n * A singleton `'after-attach'` message.\n *\n * #### Notes\n * This message is sent to a widget after it is attached.\n */\n Msg.AfterAttach = new messaging.Message('after-attach');\n /**\n * A singleton `'before-detach'` message.\n *\n * #### Notes\n * This message is sent to a widget before it is detached.\n */\n Msg.BeforeDetach = new messaging.Message('before-detach');\n /**\n * A singleton `'after-detach'` message.\n *\n * #### Notes\n * This message is sent to a widget after it is detached.\n */\n Msg.AfterDetach = new messaging.Message('after-detach');\n /**\n * A singleton `'parent-changed'` message.\n *\n * #### Notes\n * This message is sent to a widget when its parent has changed.\n */\n Msg.ParentChanged = new messaging.Message('parent-changed');\n /**\n * A singleton conflatable `'update-request'` message.\n *\n * #### Notes\n * This message can be dispatched to supporting widgets in order to\n * update their content based on the current widget state. Not all\n * widgets will respond to messages of this type.\n *\n * For widgets with a layout, this message will inform the layout to\n * update the position and size of its child widgets.\n */\n Msg.UpdateRequest = new messaging.ConflatableMessage('update-request');\n /**\n * A singleton conflatable `'fit-request'` message.\n *\n * #### Notes\n * For widgets with a layout, this message will inform the layout to\n * recalculate its size constraints to fit the space requirements of\n * its child widgets, and to update their position and size. Not all\n * layouts will respond to messages of this type.\n */\n Msg.FitRequest = new messaging.ConflatableMessage('fit-request');\n /**\n * A singleton conflatable `'activate-request'` message.\n *\n * #### Notes\n * This message should be dispatched to a widget when it should\n * perform the actions necessary to activate the widget, which\n * may include focusing its node or descendant node.\n */\n Msg.ActivateRequest = new messaging.ConflatableMessage('activate-request');\n /**\n * A singleton conflatable `'close-request'` message.\n *\n * #### Notes\n * This message should be dispatched to a widget when it should close\n * and remove itself from the widget hierarchy.\n */\n Msg.CloseRequest = new messaging.ConflatableMessage('close-request');\n })(Msg = Widget.Msg || (Widget.Msg = {}));\n /**\n * A message class for child related messages.\n */\n var ChildMessage = /** @class */ (function (_super) {\n tslib.__extends(ChildMessage, _super);\n /**\n * Construct a new child message.\n *\n * @param type - The message type.\n *\n * @param child - The child widget for the message.\n */\n function ChildMessage(type, child) {\n var _this = _super.call(this, type) || this;\n _this.child = child;\n return _this;\n }\n return ChildMessage;\n }(messaging.Message));\n Widget.ChildMessage = ChildMessage;\n /**\n * A message class for `'resize'` messages.\n */\n var ResizeMessage = /** @class */ (function (_super) {\n tslib.__extends(ResizeMessage, _super);\n /**\n * Construct a new resize message.\n *\n * @param width - The **offset width** of the widget, or `-1` if\n * the width is not known.\n *\n * @param height - The **offset height** of the widget, or `-1` if\n * the height is not known.\n */\n function ResizeMessage(width, height) {\n var _this = _super.call(this, 'resize') || this;\n _this.width = width;\n _this.height = height;\n return _this;\n }\n return ResizeMessage;\n }(messaging.Message));\n Widget.ResizeMessage = ResizeMessage;\n /**\n * The namespace for the `ResizeMessage` class statics.\n */\n (function (ResizeMessage) {\n /**\n * A singleton `'resize'` message with an unknown size.\n */\n ResizeMessage.UnknownSize = new ResizeMessage(-1, -1);\n })(ResizeMessage = Widget.ResizeMessage || (Widget.ResizeMessage = {}));\n /**\n * Attach a widget to a host DOM node.\n *\n * @param widget - The widget of interest.\n *\n * @param host - The DOM node to use as the widget's host.\n *\n * @param ref - The child of `host` to use as the reference element.\n * If this is provided, the widget will be inserted before this\n * node in the host. The default is `null`, which will cause the\n * widget to be added as the last child of the host.\n *\n * #### Notes\n * This will throw an error if the widget is not a root widget, if\n * the widget is already attached, or if the host is not attached\n * to the DOM.\n */\n function attach(widget, host, ref) {\n if (ref === void 0) { ref = null; }\n if (widget.parent) {\n throw new Error('Cannot attach a child widget.');\n }\n if (widget.isAttached || document.body.contains(widget.node)) {\n throw new Error('Widget is already attached.');\n }\n if (!document.body.contains(host)) {\n throw new Error('Host is not attached.');\n }\n messaging.MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);\n host.insertBefore(widget.node, ref);\n messaging.MessageLoop.sendMessage(widget, Widget.Msg.AfterAttach);\n }\n Widget.attach = attach;\n /**\n * Detach the widget from its host DOM node.\n *\n * @param widget - The widget of interest.\n *\n * #### Notes\n * This will throw an error if the widget is not a root widget,\n * or if the widget is not attached to the DOM.\n */\n function detach(widget) {\n if (widget.parent) {\n throw new Error('Cannot detach a child widget.');\n }\n if (!widget.isAttached || !document.body.contains(widget.node)) {\n throw new Error('Widget is not attached.');\n }\n messaging.MessageLoop.sendMessage(widget, Widget.Msg.BeforeDetach);\n widget.node.parentNode.removeChild(widget.node);\n messaging.MessageLoop.sendMessage(widget, Widget.Msg.AfterDetach);\n }\n Widget.detach = detach;\n})(exports.Widget || (exports.Widget = {}));\n/**\n * The namespace for the module implementation details.\n */\nvar Private;\n(function (Private) {\n /**\n * An attached property for the widget title object.\n */\n Private.titleProperty = new properties.AttachedProperty({\n name: 'title',\n create: function (owner) { return new title.Title({ owner: owner }); },\n });\n /**\n * Create a DOM node for the given widget options.\n */\n function createNode(options) {\n return options.node || document.createElement('div');\n }\n Private.createNode = createNode;\n})(Private || (Private = {}));\n//# sourceMappingURL=widget.js.map\n\n\n//# sourceURL=webpack:////build/lumino-XwS9kv/lumino-0-20200824+git93880412/packages/widgets/dist/widget.js?"); │ │ │ │ │ │ │ │ /***/ │ │ │ │ }), │ │ │ │ │ │ │ │ /***/ │ │ │ │ "./build/index.js": │ │ │ │ /*!************************!*\