pgwidgets-js 0.4.3__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/PKG-INFO +1 -1
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/WhatsNew.rst +14 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/widgets/layout.rst +71 -2
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/package.json +1 -1
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/defs.py +7 -2
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/TabWidget.js +255 -33
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js.egg-info/PKG-INFO +1 -1
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js.egg-info/SOURCES.txt +2 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js.egg-info/scm_file_list.json +2 -0
- pgwidgets_js-0.5.0/pgwidgets_js.egg-info/scm_version.json +8 -0
- pgwidgets_js-0.5.0/tests/tabwidget_dnd.mjs +318 -0
- pgwidgets_js-0.5.0/tests/test_tabwidget_dnd.py +26 -0
- pgwidgets_js-0.4.3/pgwidgets_js.egg-info/scm_version.json +0 -8
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/.flake8 +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/.github/workflows/tests.yml +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/.gitignore +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/.readthedocs.yaml +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/LICENSE.md +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/MANIFEST.in +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/README.md +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/Widgets.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/Widgets.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/Makefile +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/callbacks.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/conf.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/electron.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/external-widgets.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/for-developers.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/frameworks.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/getting-started.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/index.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/pyodide.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/remote.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/styling.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/widgets/controls.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/widgets/dialogs.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/widgets/display.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/widgets/index.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/widgets/menus.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/widgets/nonvisual.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/docs/widgets/text.rst +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/all_widgets.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/all_widgets_pyodide.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/all_widgets_pyodide.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/all_widgets_pyscript.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/all_widgets_pyscript.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/box.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/button.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/canvas.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/checkbox.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/colordialog.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/combobox.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/debug_spinbox.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/dial.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/dialog.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/electron/.gitignore +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/electron/.npmrc +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/electron/index.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/electron/main.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/electron/package.json +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/expander.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/external_widgets.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/fixedlayout.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/frame.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/gridbox.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/htmlview.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/image.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/label.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/mdi_widget.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/menu.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/progressbar.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/pyodide_demo.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/pyscript.toml +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/radiobutton.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/remote.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/remote_demo.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/remote_demo_async.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/scroll_area.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/scrollable.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/scrollbar.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/slider.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/spinbox.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/splitter.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/tab_widget.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/tableview.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/text_entry.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/textarea.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/textentryset.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/textsource.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/togglebutton.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/toolbar.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/treeview.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/examples/videowidget.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/__init__.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/pyodide/__init__.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/pyodide/log.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/pyodide/widget.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/Widgets.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/Widgets.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/AbstractScrollArea.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Box.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Button.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/CheckBox.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/ColorDialog.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/ComboBox.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Dial.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Dialog.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Expander.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/ExternalWidget.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/FixedLayout.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Frame.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/GridBox.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/HtmlView.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Image.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Label.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/MDIWidget.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Menu.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/ProgressBar.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/RadioButton.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/ScrollArea.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/ScrollBar.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Slider.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/SpinBox.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Splitter.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/StatusBar.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/TabWidget.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Text.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/TextArea.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/TextEntrySet.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/TextSource.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/ToggleButton.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/ToolBar.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/TopLevel.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/TreeView.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/VideoWidget.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/Widget.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/css/WindowMenu.css +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/icons/file.svg +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/icons/folder.svg +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/icons/hdots.svg +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/icons/pgicon.svg +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/icons/pgwidgets-logo.png +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/icons/pgwidgets-logo.svg +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/icons/vdots.svg +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/AbstractScrollArea.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Box.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Button.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Callback.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Canvas.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/CheckBox.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ColorDialog.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ColorWidget.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ComboBox.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ComboBoxNative.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Dial.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Dialog.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Expander.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ExternalWidget.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/FileDialog.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/FixedLayout.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Frame.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/GridBox.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/HtmlView.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Image.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Label.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/MDIWidget.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Menu.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/MenuAction.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/MenuBar.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Page.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ProgressBar.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/RadioButton.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/RemoteInterface.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ScrollArea.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ScrollBar.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Separator.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Slider.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/SpinBox.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Splitter.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/StatusBar.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/TableView.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/TextArea.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/TextEntry.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/TextEntrySet.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/TextSource.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/TextWidget.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Timer.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ToggleButton.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ToolBar.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/ToolBarAction.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/TopLevel.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/TreeView.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/VideoWidget.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/Widget.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/modules/WindowMenu.js +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js/static/remote.html +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js.egg-info/dependency_links.txt +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js.egg-info/requires.txt +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pgwidgets_js.egg-info/top_level.txt +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/pyproject.toml +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/setup.cfg +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/setup.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/__init__.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/test_consistency.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/test_defs.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/test_recent_additions.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/test_static_assets.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/test_treeview_diff.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/test_treeview_resize.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/test_treeview_select.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/test_treeview_sort.py +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/treeview_diff.mjs +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/treeview_resize.mjs +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/treeview_select.mjs +0 -0
- {pgwidgets_js-0.4.3 → pgwidgets_js-0.5.0}/tests/treeview_sort.mjs +0 -0
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
What's New
|
|
2
2
|
==========
|
|
3
3
|
|
|
4
|
+
Recent changes — since ``v0.4.3``
|
|
5
|
+
---------------------------------
|
|
6
|
+
|
|
7
|
+
* TabWidget: new ``movable``, ``detachable`` and ``group`` options.
|
|
8
|
+
Tabs can be dragged between movable TabWidgets of the same group, and
|
|
9
|
+
dropped on the page background to detach them (``page-detach``); see
|
|
10
|
+
:ref:`tab-dragging`.
|
|
11
|
+
* TabWidget: new ``insert_widget()``, ``move_tab()`` and
|
|
12
|
+
``move_tab_from()`` methods, and ``page-move``/``page-reorder``
|
|
13
|
+
callbacks reporting tabs the user dragged. A drag-reorder used to go
|
|
14
|
+
unreported.
|
|
15
|
+
* TabWidget: closing a tab that isn't the current one no longer switches
|
|
16
|
+
to another tab, nor fails.
|
|
17
|
+
|
|
4
18
|
Recent changes — since ``v0.4.2``
|
|
5
19
|
---------------------------------
|
|
6
20
|
|
|
@@ -375,12 +375,18 @@ TabWidget
|
|
|
375
375
|
|
|
376
376
|
Tabbed container with switchable pages.
|
|
377
377
|
|
|
378
|
-
**Constructor:** ``new Widgets.TabWidget({closable, reorderable, tab_position})``
|
|
378
|
+
**Constructor:** ``new Widgets.TabWidget({closable, reorderable, movable, detachable, group, tab_position})``
|
|
379
379
|
|
|
380
380
|
**Options:**
|
|
381
381
|
|
|
382
382
|
- ``closable`` -- show close buttons on tabs
|
|
383
|
-
- ``reorderable`` --
|
|
383
|
+
- ``reorderable`` -- a tab can be dragged to another position in the tab bar
|
|
384
|
+
- ``movable`` -- a tab can be dragged to another movable TabWidget of the
|
|
385
|
+
same ``group`` (see :ref:`tab-dragging`)
|
|
386
|
+
- ``detachable`` -- a tab can be dropped on the page background (see
|
|
387
|
+
:ref:`tab-dragging`)
|
|
388
|
+
- ``group`` -- tabs move only between TabWidgets with the same group
|
|
389
|
+
(default ``0``)
|
|
384
390
|
- ``tab_position`` -- tab bar position (``"top"``, ``"bottom"``, ``"left"``, ``"right"``)
|
|
385
391
|
|
|
386
392
|
**Methods:**
|
|
@@ -393,6 +399,13 @@ Tabbed container with switchable pages.
|
|
|
393
399
|
- Description
|
|
394
400
|
* - ``add_widget(child, options)``
|
|
395
401
|
- Add a tab. *options* can include ``{title: "..."}``
|
|
402
|
+
* - ``insert_widget(index, child, options)``
|
|
403
|
+
- Insert a tab at position *index* (``-1`` appends).
|
|
404
|
+
* - ``move_tab(child, index)``
|
|
405
|
+
- Move the tab of *child* to position *index* and show it.
|
|
406
|
+
* - ``move_tab_from(src, child, index)``
|
|
407
|
+
- Move the tab of *child* from TabWidget *src* to position *index*
|
|
408
|
+
here (``-1`` appends) and show it.
|
|
396
409
|
* - ``show_widget(child)``
|
|
397
410
|
- Switch to the tab containing *child*.
|
|
398
411
|
* - ``close_widget(child)``
|
|
@@ -417,6 +430,17 @@ Tabbed container with switchable pages.
|
|
|
417
430
|
- ``child-added``, ``child-removed`` -- container child events.
|
|
418
431
|
- ``page-switch`` -- fired when the active tab changes. Handler receives ``(widget, child, index)``.
|
|
419
432
|
- ``page-close`` -- fired when a tab close button is clicked.
|
|
433
|
+
- ``page-move`` -- fired on the destination after the user dragged a tab
|
|
434
|
+
here from another TabWidget. Handler receives ``(widget, src, child, index)``.
|
|
435
|
+
- ``page-reorder`` -- fired after the user dragged a tab to a new
|
|
436
|
+
position in the same TabWidget. Handler receives ``(widget, child, index)``.
|
|
437
|
+
- ``page-detach`` -- fired when the user drops a tab on the page
|
|
438
|
+
background. Handler receives ``(widget, child, x, y)``, the page
|
|
439
|
+
position of the drop. The tab is *not* removed: the handler decides
|
|
440
|
+
what to do with it.
|
|
441
|
+
|
|
442
|
+
The ``move_tab*`` methods and ``insert_widget`` fire no ``page-*``
|
|
443
|
+
callbacks; those report what the user did.
|
|
420
444
|
|
|
421
445
|
.. code-block:: javascript
|
|
422
446
|
|
|
@@ -425,6 +449,51 @@ Tabbed container with switchable pages.
|
|
|
425
449
|
tabs.add_widget(page2, {title: "Second"});
|
|
426
450
|
tabs.add_callback('page-switch', (w) => console.log("switched"));
|
|
427
451
|
|
|
452
|
+
.. _tab-dragging:
|
|
453
|
+
|
|
454
|
+
Dragging tabs
|
|
455
|
+
~~~~~~~~~~~~~
|
|
456
|
+
|
|
457
|
+
Three independent options say what the user can do by dragging a tab:
|
|
458
|
+
|
|
459
|
+
- ``reorderable`` -- drop it elsewhere on its own tab bar to change its
|
|
460
|
+
position (``page-reorder``).
|
|
461
|
+
- ``movable`` -- drop it on another TabWidget with ``movable`` set and the
|
|
462
|
+
same ``group``: on its tab bar, to put it at that position, or on its
|
|
463
|
+
page, to add it at the end (``page-move``). Both TabWidgets must be
|
|
464
|
+
movable. A tab can't be dropped into a TabWidget inside of itself.
|
|
465
|
+
- ``detachable`` -- drop it on the page background, outside of any
|
|
466
|
+
window (``page-detach``). This is the browser's counterpart of
|
|
467
|
+
dragging a tab out of an application onto the desktop. A tab can only
|
|
468
|
+
be dropped there if something has registered for ``page-detach``.
|
|
469
|
+
|
|
470
|
+
A drop anywhere else -- on a TabWidget of another group, on some other
|
|
471
|
+
widget, or outside of the browser window -- cancels the drag. If the
|
|
472
|
+
TabWidget under the pointer won't take the tab, an enclosing TabWidget
|
|
473
|
+
that would is offered it instead.
|
|
474
|
+
|
|
475
|
+
Moves and reorders are made by the TabWidget itself. A detached tab
|
|
476
|
+
has to be given a new home by the ``page-detach`` handler, typically a
|
|
477
|
+
TabWidget (configured like the source) in a new ``TopLevel`` placed at
|
|
478
|
+
the drop position:
|
|
479
|
+
|
|
480
|
+
.. code-block:: javascript
|
|
481
|
+
|
|
482
|
+
let left = new Widgets.TabWidget({movable: true, detachable: true, group: 1});
|
|
483
|
+
let right = new Widgets.TabWidget({movable: true, detachable: true, group: 1});
|
|
484
|
+
// tabs can now be dragged between left and right
|
|
485
|
+
|
|
486
|
+
left.add_callback('page-detach', (w, child, x, y) => {
|
|
487
|
+
let tabs = new Widgets.TabWidget({movable: true, detachable: true,
|
|
488
|
+
group: 1});
|
|
489
|
+
let top = new Widgets.TopLevel({title: "Detached", resizable: true});
|
|
490
|
+
top.set_widget(tabs);
|
|
491
|
+
w.remove(child);
|
|
492
|
+
tabs.add_widget(child, {title: "Detached"});
|
|
493
|
+
top.set_position(x, y);
|
|
494
|
+
top.show();
|
|
495
|
+
});
|
|
496
|
+
|
|
428
497
|
.. _widget-stackwidget:
|
|
429
498
|
|
|
430
499
|
StackWidget
|
|
@@ -246,9 +246,13 @@ WIDGETS = {
|
|
|
246
246
|
"TabWidget": {
|
|
247
247
|
"base": "container",
|
|
248
248
|
"args": [],
|
|
249
|
-
"options": ["closable", "reorderable", "
|
|
249
|
+
"options": ["closable", "reorderable", "movable", "detachable",
|
|
250
|
+
"group", "tab_position"],
|
|
250
251
|
"methods": {
|
|
251
252
|
"add_widget": ["child", "options"],
|
|
253
|
+
"insert_widget": ["index", "child", "options"],
|
|
254
|
+
"move_tab": ["child", "index"],
|
|
255
|
+
"move_tab_from": ["src", "child", "index"],
|
|
252
256
|
"show_widget": ["child"],
|
|
253
257
|
"close_widget": ["child"],
|
|
254
258
|
"set_index": ["index"],
|
|
@@ -260,7 +264,8 @@ WIDGETS = {
|
|
|
260
264
|
"highlight_tab": ["child", "bgcolor"],
|
|
261
265
|
"set_tab_position": ["tabpos"],
|
|
262
266
|
},
|
|
263
|
-
"callbacks": [*CONTAINER_CALLBACKS, "page-switch", "page-close"
|
|
267
|
+
"callbacks": [*CONTAINER_CALLBACKS, "page-switch", "page-close",
|
|
268
|
+
"page-move", "page-reorder", "page-detach"],
|
|
264
269
|
},
|
|
265
270
|
|
|
266
271
|
"StackWidget": {
|
|
@@ -2,6 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
import {ContainerWidget} from "./Widget.js";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* MIME type under which a tab drag carries its (JSON) description.
|
|
7
|
+
* Only drags within the same page are acted on; the description leaves
|
|
8
|
+
* room for drags between pages in the future.
|
|
9
|
+
*/
|
|
10
|
+
const TAB_MIME_TYPE = 'application/x-pgwidgets-tab';
|
|
11
|
+
|
|
12
|
+
// the tab being dragged, if any: {src, tab_id, child}. The browser
|
|
13
|
+
// hides the dragged data until the drop, so the drop targets look here
|
|
14
|
+
// to decide whether they would accept it.
|
|
15
|
+
let _tabDrag = null;
|
|
16
|
+
|
|
17
|
+
// the drop handlers for the "desktop" (the page background), which
|
|
18
|
+
// take tabs that are detached from their TabWidget
|
|
19
|
+
let _desktopInstalled = false;
|
|
20
|
+
|
|
21
|
+
function _isDesktop(target) {
|
|
22
|
+
return (target === document.body || target === document.documentElement);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _canDetach(drag) {
|
|
26
|
+
const src = drag.src;
|
|
27
|
+
const cbs = src.cb['page-detach'];
|
|
28
|
+
return src.detachable && cbs !== undefined && cbs.length > 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function _installDesktop() {
|
|
32
|
+
if (_desktopInstalled) return;
|
|
33
|
+
_desktopInstalled = true;
|
|
34
|
+
document.addEventListener('dragover', (event) => {
|
|
35
|
+
if (_tabDrag !== null && _isDesktop(event.target)
|
|
36
|
+
&& _canDetach(_tabDrag)) {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
event.dataTransfer.dropEffect = 'move';
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
document.addEventListener('drop', (event) => {
|
|
42
|
+
if (_tabDrag !== null && _isDesktop(event.target)
|
|
43
|
+
&& _canDetach(_tabDrag)) {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
const drag = _tabDrag;
|
|
46
|
+
_tabDrag = null;
|
|
47
|
+
drag.src.make_callback('page-detach', drag.child,
|
|
48
|
+
event.pageX, event.pageY);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
5
53
|
/**
|
|
6
54
|
* A tabbed container widget similar to Qt's QTabWidget.
|
|
7
55
|
* Displays child widgets as selectable tabs with support for closable tabs,
|
|
@@ -11,6 +59,22 @@ import {ContainerWidget} from "./Widget.js";
|
|
|
11
59
|
* Callbacks:
|
|
12
60
|
* - 'page-switch': fired when the active tab changes.
|
|
13
61
|
* - 'page-close': fired when a tab close button is clicked.
|
|
62
|
+
* - 'page-move' (src, child, index): fired on the destination after a
|
|
63
|
+
* tab has been dragged here from TabWidget `src` and inserted at
|
|
64
|
+
* `index`.
|
|
65
|
+
* - 'page-reorder' (child, index): fired after a tab has been dragged
|
|
66
|
+
* to position `index` within this widget.
|
|
67
|
+
* - 'page-detach' (child, x, y): fired when a tab is dropped on the page
|
|
68
|
+
* background at page position x, y. The tab is NOT removed: it is up
|
|
69
|
+
* to the handler to give it a new home (e.g. a TabWidget in a new
|
|
70
|
+
* TopLevel). A tab can be dropped there only if someone handles this.
|
|
71
|
+
*
|
|
72
|
+
* Dragging tabs:
|
|
73
|
+
* - `reorderable`: a tab can be dragged to another position in the tab bar
|
|
74
|
+
* - `movable`: a tab can be dragged to another movable TabWidget having
|
|
75
|
+
* the same `group`; it can be dropped on that widget's tab bar or page
|
|
76
|
+
* - `detachable`: a tab can be dropped on the page background
|
|
77
|
+
* A drop anywhere else cancels the drag.
|
|
14
78
|
*/
|
|
15
79
|
class TabWidget extends ContainerWidget {
|
|
16
80
|
|
|
@@ -19,6 +83,9 @@ class TabWidget extends ContainerWidget {
|
|
|
19
83
|
* @param {Object} [options] - Configuration options.
|
|
20
84
|
* @param {boolean} [options.closable=false] - Whether tabs have close buttons.
|
|
21
85
|
* @param {boolean} [options.reorderable=false] - Whether tabs can be reordered by dragging.
|
|
86
|
+
* @param {boolean} [options.movable=false] - Whether tabs can be dragged to another TabWidget of the same group.
|
|
87
|
+
* @param {boolean} [options.detachable=false] - Whether tabs can be dropped on the page background.
|
|
88
|
+
* @param {number} [options.group=0] - Tabs move only between TabWidgets of the same group.
|
|
22
89
|
* @param {string} [options.tab_position='top'] - Position of tabs: 'top', 'bottom', 'left', 'right', or 'none'.
|
|
23
90
|
* @param {HTMLElement} [options.element=null] - Optional pre-existing DOM element to use.
|
|
24
91
|
*/
|
|
@@ -36,6 +103,9 @@ class TabWidget extends ContainerWidget {
|
|
|
36
103
|
this.closable = false;
|
|
37
104
|
this.closable = this.get_option(options, 'closable', false);
|
|
38
105
|
this.reorderable = this.get_option(options, 'reorderable', false);
|
|
106
|
+
this.movable = this.get_option(options, 'movable', false);
|
|
107
|
+
this.detachable = this.get_option(options, 'detachable', false);
|
|
108
|
+
this.group = this.get_option(options, 'group', 0);
|
|
39
109
|
this.tabPos = this.get_option(options, 'tab_position', 'top');
|
|
40
110
|
|
|
41
111
|
this.tabContentContainer = document.createElement('div');
|
|
@@ -48,9 +118,18 @@ class TabWidget extends ContainerWidget {
|
|
|
48
118
|
|
|
49
119
|
this.set_tab_position(this.tabPos);
|
|
50
120
|
|
|
51
|
-
for (let name of ['page-switch', 'page-close'
|
|
121
|
+
for (let name of ['page-switch', 'page-close', 'page-move',
|
|
122
|
+
'page-reorder', 'page-detach']) {
|
|
52
123
|
this.enable_callback(name);
|
|
53
124
|
}
|
|
125
|
+
|
|
126
|
+
// tabs dragged from another TabWidget can be dropped anywhere
|
|
127
|
+
// on this one
|
|
128
|
+
this.element.addEventListener('dragover', this._handleDragOver);
|
|
129
|
+
this.element.addEventListener('drop', this._handleDrop);
|
|
130
|
+
if (this.detachable) {
|
|
131
|
+
_installDesktop();
|
|
132
|
+
}
|
|
54
133
|
}
|
|
55
134
|
|
|
56
135
|
/**
|
|
@@ -81,8 +160,10 @@ class TabWidget extends ContainerWidget {
|
|
|
81
160
|
return null;
|
|
82
161
|
}
|
|
83
162
|
|
|
84
|
-
_addTab(title, child) {
|
|
85
|
-
|
|
163
|
+
_addTab(title, child, index = -1) {
|
|
164
|
+
if (index < 0 || index > this.tabs.length) {
|
|
165
|
+
index = this.tabs.length;
|
|
166
|
+
}
|
|
86
167
|
const tab_id = `tab_${this.tab_id_counter++}`;
|
|
87
168
|
let tabButton = null;
|
|
88
169
|
let content = child.get_element();
|
|
@@ -106,26 +187,31 @@ class TabWidget extends ContainerWidget {
|
|
|
106
187
|
tabButton.appendChild(closeButton);
|
|
107
188
|
}
|
|
108
189
|
|
|
109
|
-
if (this.reorderable) {
|
|
190
|
+
if (this.reorderable || this.movable || this.detachable) {
|
|
110
191
|
tabButton.setAttribute('draggable', true);
|
|
111
192
|
tabButton.classList.add('draggable');
|
|
112
|
-
tabButton.addEventListener('dragstart', (event) => this.
|
|
113
|
-
tabButton.addEventListener('
|
|
114
|
-
tabButton.addEventListener('drop', this.handleDrop);
|
|
193
|
+
tabButton.addEventListener('dragstart', (event) => this._handleDragStart(event, tab_id));
|
|
194
|
+
tabButton.addEventListener('dragend', this._handleDragEnd);
|
|
115
195
|
}
|
|
116
196
|
|
|
117
197
|
tabButton.addEventListener('click', () => this._showTab(tab_id));
|
|
118
|
-
|
|
119
|
-
this.
|
|
198
|
+
|
|
199
|
+
if (index < this.tabs.length) {
|
|
200
|
+
const before = this.tab_info.get(this.tabs[index]).tabButton;
|
|
201
|
+
this.tabHeader.insertBefore(tabButton, before);
|
|
202
|
+
} else {
|
|
203
|
+
this.tabHeader.appendChild(tabButton);
|
|
204
|
+
}
|
|
120
205
|
}
|
|
121
206
|
|
|
122
207
|
let tab_rec = { title, content, tabButton, child };
|
|
123
208
|
this.tab_info.set(tab_id, tab_rec);
|
|
124
|
-
this.tabs.
|
|
209
|
+
this.tabs.splice(index, 0, tab_id);
|
|
125
210
|
|
|
126
|
-
if (
|
|
211
|
+
if (this.tabs.length === 1) {
|
|
127
212
|
this._showTab(tab_id);
|
|
128
213
|
}
|
|
214
|
+
return tab_id;
|
|
129
215
|
}
|
|
130
216
|
|
|
131
217
|
_showTab(tab_id) {
|
|
@@ -153,7 +239,8 @@ class TabWidget extends ContainerWidget {
|
|
|
153
239
|
_closeTab(tab_id) {
|
|
154
240
|
const tab_rec = this.tab_info.get(tab_id);
|
|
155
241
|
if (tab_rec) {
|
|
156
|
-
|
|
242
|
+
const was_current = (tab_id === this.current_tab_id);
|
|
243
|
+
if (was_current) {
|
|
157
244
|
this.current_tab_id = -1;
|
|
158
245
|
}
|
|
159
246
|
|
|
@@ -163,11 +250,15 @@ class TabWidget extends ContainerWidget {
|
|
|
163
250
|
if (tab_rec.tabButton !== null) {
|
|
164
251
|
this.tabHeader.removeChild(tab_rec.tabButton);
|
|
165
252
|
}
|
|
166
|
-
|
|
253
|
+
// only the current tab's content is in the container
|
|
254
|
+
if (tab_rec.content.parentNode === this.tabContentContainer) {
|
|
255
|
+
this.tabContentContainer.removeChild(tab_rec.content);
|
|
256
|
+
}
|
|
167
257
|
this.tab_info.delete(tab_id);
|
|
168
258
|
|
|
169
|
-
// if there are any tabs left
|
|
170
|
-
|
|
259
|
+
// if the current tab was closed and there are any tabs left
|
|
260
|
+
// to show, show one
|
|
261
|
+
if (was_current && this.tabs.length > 0) {
|
|
171
262
|
const new_index = Math.min(index, this.tabs.length - 1);
|
|
172
263
|
let new_tab_id = this.tabs[new_index];
|
|
173
264
|
this._showTab(new_tab_id);
|
|
@@ -175,30 +266,146 @@ class TabWidget extends ContainerWidget {
|
|
|
175
266
|
}
|
|
176
267
|
}
|
|
177
268
|
|
|
178
|
-
|
|
179
|
-
|
|
269
|
+
// --- dragging tabs ---
|
|
270
|
+
|
|
271
|
+
_handleDragStart(event, tab_id) {
|
|
272
|
+
const tab_rec = this.tab_info.get(tab_id);
|
|
273
|
+
if (!tab_rec) return;
|
|
274
|
+
_tabDrag = { src: this, tab_id: tab_id, child: tab_rec.child };
|
|
275
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
276
|
+
event.dataTransfer.setData(TAB_MIME_TYPE, JSON.stringify(
|
|
277
|
+
{ group: this.group, title: tab_rec.title,
|
|
278
|
+
index: this.tabs.indexOf(tab_id) }));
|
|
180
279
|
event.target.classList.add('dragging');
|
|
280
|
+
if (this.detachable) {
|
|
281
|
+
_installDesktop();
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
_handleDragEnd = (event) => {
|
|
286
|
+
event.target.classList.remove('dragging');
|
|
287
|
+
_tabDrag = null;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* True if this widget would take the tab being dragged, if it were
|
|
292
|
+
* dropped on `target` (a DOM element in this widget).
|
|
293
|
+
*/
|
|
294
|
+
_acceptsDrag(drag, target) {
|
|
295
|
+
if (drag.src === this) {
|
|
296
|
+
// only a reorder, within the tab bar
|
|
297
|
+
return (this.reorderable && this.tabHeader !== undefined
|
|
298
|
+
&& this.tabHeader.contains(target));
|
|
299
|
+
}
|
|
300
|
+
if (!(this.movable && drag.src.movable
|
|
301
|
+
&& drag.src.group === this.group)) {
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
if (drag.src.get_tab_id(drag.child) !== drag.tab_id) {
|
|
305
|
+
return false; // no longer there
|
|
306
|
+
}
|
|
307
|
+
// a tab can't be dropped into a widget inside of itself
|
|
308
|
+
return !drag.child.get_element().contains(this.element);
|
|
181
309
|
}
|
|
182
310
|
|
|
183
|
-
|
|
311
|
+
/** The index at which a tab dropped at (x, y) would be inserted. */
|
|
312
|
+
_dropIndex(x, y) {
|
|
313
|
+
const vertical = (this.tabPos === 'left' || this.tabPos === 'right');
|
|
314
|
+
for (let i = 0; i < this.tabs.length; i++) {
|
|
315
|
+
const btn = this.tab_info.get(this.tabs[i]).tabButton;
|
|
316
|
+
if (btn === null) continue;
|
|
317
|
+
const r = btn.getBoundingClientRect();
|
|
318
|
+
if (vertical ? (y < r.top + r.height / 2)
|
|
319
|
+
: (x < r.left + r.width / 2)) {
|
|
320
|
+
return i;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return this.tabs.length;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
_handleDragOver = (event) => {
|
|
327
|
+
if (_tabDrag === null || !this._acceptsDrag(_tabDrag, event.target)) {
|
|
328
|
+
// let an enclosing widget, or the desktop, consider it
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
184
331
|
event.preventDefault();
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
332
|
+
event.stopPropagation();
|
|
333
|
+
event.dataTransfer.dropEffect = 'move';
|
|
334
|
+
}
|
|
188
335
|
|
|
189
|
-
|
|
190
|
-
if (
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
336
|
+
_handleDrop = (event) => {
|
|
337
|
+
if (_tabDrag === null || !this._acceptsDrag(_tabDrag, event.target)) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
event.preventDefault();
|
|
341
|
+
event.stopPropagation();
|
|
342
|
+
const drag = _tabDrag;
|
|
343
|
+
_tabDrag = null;
|
|
344
|
+
|
|
345
|
+
let index = this.tabs.length;
|
|
346
|
+
if (this.tabHeader !== undefined
|
|
347
|
+
&& this.tabHeader.contains(event.target)) {
|
|
348
|
+
index = this._dropIndex(event.clientX, event.clientY);
|
|
349
|
+
}
|
|
350
|
+
if (drag.src === this) {
|
|
351
|
+
const old_index = this.tabs.indexOf(drag.tab_id);
|
|
352
|
+
if (index > old_index) {
|
|
353
|
+
index -= 1; // allow for the tab leaving its old place
|
|
354
|
+
}
|
|
355
|
+
if (index !== old_index) {
|
|
356
|
+
this.move_tab(drag.child, index);
|
|
357
|
+
this.make_callback('page-reorder', drag.child, index);
|
|
358
|
+
}
|
|
359
|
+
} else {
|
|
360
|
+
this.move_tab_from(drag.src, drag.child, index);
|
|
361
|
+
this.make_callback('page-move', drag.src, drag.child,
|
|
362
|
+
this.index_of(drag.child));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
194
365
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
366
|
+
/**
|
|
367
|
+
* Moves the tab holding `child` to position `index` in this widget
|
|
368
|
+
* and makes it the current tab. Fires no callbacks.
|
|
369
|
+
* @param {Widget} child - The child widget whose tab to move.
|
|
370
|
+
* @param {number} index - Its new 0-based position.
|
|
371
|
+
*/
|
|
372
|
+
move_tab(child, index) {
|
|
373
|
+
const tab_id = this.get_tab_id(child);
|
|
374
|
+
if (tab_id === null) return;
|
|
375
|
+
const old_index = this.tabs.indexOf(tab_id);
|
|
376
|
+
index = Math.max(0, Math.min(index, this.tabs.length - 1));
|
|
377
|
+
this.tabs.splice(old_index, 1);
|
|
378
|
+
this.tabs.splice(index, 0, tab_id);
|
|
379
|
+
const btn = this.tab_info.get(tab_id).tabButton;
|
|
380
|
+
if (btn !== null) {
|
|
381
|
+
const next = (index + 1 < this.tabs.length)
|
|
382
|
+
? this.tab_info.get(this.tabs[index + 1]).tabButton : null;
|
|
383
|
+
this.tabHeader.insertBefore(btn, next);
|
|
384
|
+
}
|
|
385
|
+
// keep the children in tab order
|
|
386
|
+
const idx = this.children.indexOf(child);
|
|
387
|
+
if (idx > -1) {
|
|
388
|
+
this.children.splice(idx, 1);
|
|
389
|
+
this.children.splice(index, 0, child);
|
|
199
390
|
}
|
|
391
|
+
this._showTab(tab_id);
|
|
392
|
+
}
|
|
200
393
|
|
|
201
|
-
|
|
394
|
+
/**
|
|
395
|
+
* Moves the tab holding `child` from TabWidget `src` to position
|
|
396
|
+
* `index` in this widget (appended if -1) and makes it the current
|
|
397
|
+
* tab. Fires no 'page-move' callback.
|
|
398
|
+
* @param {TabWidget} src - The TabWidget the tab is in.
|
|
399
|
+
* @param {Widget} child - The child widget whose tab to move.
|
|
400
|
+
* @param {number} [index=-1] - Its position in this widget.
|
|
401
|
+
*/
|
|
402
|
+
move_tab_from(src, child, index = -1) {
|
|
403
|
+
const tab_id = src.get_tab_id(child);
|
|
404
|
+
if (tab_id === null) return;
|
|
405
|
+
const title = src.tab_info.get(tab_id).title;
|
|
406
|
+
src.remove(child);
|
|
407
|
+
this.insert_widget(index, child, { title: title });
|
|
408
|
+
this.show_widget(child);
|
|
202
409
|
}
|
|
203
410
|
|
|
204
411
|
/**
|
|
@@ -219,8 +426,23 @@ class TabWidget extends ContainerWidget {
|
|
|
219
426
|
* @param {string} [options.title=''] - The title shown on the tab header.
|
|
220
427
|
*/
|
|
221
428
|
add_widget(child, options = { title: "" }) {
|
|
222
|
-
|
|
223
|
-
|
|
429
|
+
this.insert_widget(-1, child, options);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Inserts a child widget as a new tab at the given position.
|
|
434
|
+
* @param {number} index - The 0-based position; -1 appends.
|
|
435
|
+
* @param {Widget} child - The widget to add.
|
|
436
|
+
* @param {Object} [options] - Tab options.
|
|
437
|
+
* @param {string} [options.title=''] - The title shown on the tab header.
|
|
438
|
+
*/
|
|
439
|
+
insert_widget(index, child, options = { title: "" }) {
|
|
440
|
+
if (index < 0 || index > this.tabs.length) {
|
|
441
|
+
index = this.tabs.length;
|
|
442
|
+
}
|
|
443
|
+
const title = (options && options.title) ? options.title : "";
|
|
444
|
+
this._addTab(title, child, index);
|
|
445
|
+
this.children.splice(index, 0, child);
|
|
224
446
|
this.make_callback('child-added', child);
|
|
225
447
|
}
|
|
226
448
|
|
|
@@ -196,10 +196,12 @@ pgwidgets_js/static/modules/VideoWidget.js
|
|
|
196
196
|
pgwidgets_js/static/modules/Widget.js
|
|
197
197
|
pgwidgets_js/static/modules/WindowMenu.js
|
|
198
198
|
tests/__init__.py
|
|
199
|
+
tests/tabwidget_dnd.mjs
|
|
199
200
|
tests/test_consistency.py
|
|
200
201
|
tests/test_defs.py
|
|
201
202
|
tests/test_recent_additions.py
|
|
202
203
|
tests/test_static_assets.py
|
|
204
|
+
tests/test_tabwidget_dnd.py
|
|
203
205
|
tests/test_treeview_diff.py
|
|
204
206
|
tests/test_treeview_resize.py
|
|
205
207
|
tests/test_treeview_select.py
|
|
@@ -191,10 +191,12 @@
|
|
|
191
191
|
"pyproject.toml",
|
|
192
192
|
"setup.py",
|
|
193
193
|
"tests/__init__.py",
|
|
194
|
+
"tests/tabwidget_dnd.mjs",
|
|
194
195
|
"tests/test_consistency.py",
|
|
195
196
|
"tests/test_defs.py",
|
|
196
197
|
"tests/test_recent_additions.py",
|
|
197
198
|
"tests/test_static_assets.py",
|
|
199
|
+
"tests/test_tabwidget_dnd.py",
|
|
198
200
|
"tests/test_treeview_diff.py",
|
|
199
201
|
"tests/test_treeview_resize.py",
|
|
200
202
|
"tests/test_treeview_select.py",
|