From a6dd8df120771dd3ca7b8078ea0a340c11c06ba0 Mon Sep 17 00:00:00 2001 From: Zerline Date: Fri, 10 Jan 2020 15:30:19 +0100 Subject: [PATCH 01/24] Styling buttons. --- ipywidgets/widgets/widget_button.py | 6 ++ packages/controls/src/widget_button.ts | 30 +++++++ tests/test_buttonstyle.ipynb | 108 +++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 tests/test_buttonstyle.ipynb diff --git a/ipywidgets/widgets/widget_button.py b/ipywidgets/widgets/widget_button.py index e2fb3387ac..8e90a68e1a 100644 --- a/ipywidgets/widgets/widget_button.py +++ b/ipywidgets/widgets/widget_button.py @@ -22,7 +22,13 @@ class ButtonStyle(Style, CoreWidget): """Button style widget.""" _model_name = Unicode('ButtonStyleModel').tag(sync=True) button_color = Color(None, allow_none=True, help="Color of the button").tag(sync=True) + font_family = Unicode(help="Button text font family.").tag(sync=True) + font_size = Unicode(help="Button text font size.").tag(sync=True) + font_style = Unicode(help="Button text font style.").tag(sync=True) + font_variant = Unicode(help="Button text font variant.").tag(sync=True) font_weight = Unicode(help="Button text font weight.").tag(sync=True) + text_color = Unicode(help="Button text color.").tag(sync=True) + text_decoration = Unicode(help="Button text decoration.").tag(sync=True) @register diff --git a/packages/controls/src/widget_button.ts b/packages/controls/src/widget_button.ts index 69b1156538..70874ee7ed 100644 --- a/packages/controls/src/widget_button.ts +++ b/packages/controls/src/widget_button.ts @@ -32,10 +32,40 @@ class ButtonStyleModel extends StyleModel { attribute: 'background-color', default: null as any }, + font_family: { + selector: '', + attribute: 'font-family', + default: '' + }, + font_size: { + selector: '', + attribute: 'font-size', + default: '' + }, + font_style: { + selector: '', + attribute: 'font-style', + default: '' + }, + font_variant: { + selector: '', + attribute: 'font-variant', + default: '' + }, font_weight: { selector: '', attribute: 'font-weight', default: '' + }, + text_color: { + selector: '', + attribute: 'color', + default: '' + }, + text_decoration: { + selector: '', + attribute: 'text-decoration', + default: '' } }; } diff --git a/tests/test_buttonstyle.ipynb b/tests/test_buttonstyle.ipynb new file mode 100644 index 0000000000..967b74faf8 --- /dev/null +++ b/tests/test_buttonstyle.ipynb @@ -0,0 +1,108 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Button\n", + "b = Button(description=\"Button\")\n", + "b" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.button_color = \"linen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.text_color = \"darkgreen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_style = \"italic\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_weight = \"bold\" " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_variant = \"small-caps\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.text_decoration = \"underline\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_size = \"1.2em\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_family = \"bitstream\"" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From fa92769411c53f428c9b0f94e7399b5be24946bc Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 14:58:50 +0100 Subject: [PATCH 02/24] Generate schema and remove test file. --- packages/schema/jupyterwidgetmodels.latest.md | 6 + tests/test_buttonstyle.ipynb | 108 ------------------ 2 files changed, 6 insertions(+), 108 deletions(-) delete mode 100644 tests/test_buttonstyle.ipynb diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index a8b3b56937..da9caf47ab 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -189,7 +189,13 @@ Attribute | Type | Default | Help `_view_module_version` | string | `'1.2.0'` | `_view_name` | string | `'StyleView'` | `button_color` | `null` or string | `null` | Color of the button +`font_family` | string | `''` | Button text font family. +`font_size` | string | `''` | Button text font size. +`font_style` | string | `''` | Button text font style. +`font_variant` | string | `''` | Button text font variant. `font_weight` | string | `''` | Button text font weight. +`text_color` | string | `''` | Button text color. +`text_decoration` | string | `''` | Button text decoration. ### CheckboxModel (@jupyter-widgets/controls, 1.5.0); CheckboxView (@jupyter-widgets/controls, 1.5.0) diff --git a/tests/test_buttonstyle.ipynb b/tests/test_buttonstyle.ipynb deleted file mode 100644 index 967b74faf8..0000000000 --- a/tests/test_buttonstyle.ipynb +++ /dev/null @@ -1,108 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from ipywidgets import Button\n", - "b = Button(description=\"Button\")\n", - "b" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.button_color = \"linen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.text_color = \"darkgreen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_style = \"italic\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_weight = \"bold\" " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_variant = \"small-caps\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.text_decoration = \"underline\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_size = \"1.2em\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_family = \"bitstream\"" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From d2c55bf3cb444e306e0d7063de941b9eef4ba43c Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 11:51:24 +0100 Subject: [PATCH 03/24] BoolStyle, ToggleButtonStyle. --- ipywidgets/widgets/widget_bool.py | 25 ++- packages/controls/src/widget_bool.ts | 75 ++++++++- packages/schema/jupyterwidgetmodels.latest.md | 37 ++++- tests/test_boolstyle.ipynb | 151 ++++++++++++++++++ 4 files changed, 282 insertions(+), 6 deletions(-) create mode 100644 tests/test_boolstyle.ipynb diff --git a/ipywidgets/widgets/widget_bool.py b/ipywidgets/widgets/widget_bool.py index e6ecede30b..e7fe5e994b 100644 --- a/ipywidgets/widgets/widget_bool.py +++ b/ipywidgets/widgets/widget_bool.py @@ -8,15 +8,37 @@ from .widget_description import DescriptionWidget from .widget_core import CoreWidget +from .widget_style import Style from .valuewidget import ValueWidget -from .widget import register +from .widget import register, widget_serialization +from .trait_types import Color, InstanceDict + from traitlets import Unicode, Bool, CaselessStrEnum +class _BoolStyle(Style, CoreWidget): + """_Bool widget style.""" + _model_name = Unicode('BoolStyleModel').tag(sync=True) + background_color = Color(None, allow_none=True, help="Background color").tag(sync=True) + +@register +class ToggleButtonStyle(_BoolStyle, CoreWidget): + """ToggleButton widget style.""" + _model_name = Unicode('ToggleButtonStyleModel').tag(sync=True) + font_family = Unicode(help="Button text font family.").tag(sync=True) + font_size = Unicode(help="Button text font size.").tag(sync=True) + font_style = Unicode(help="Button text font style.").tag(sync=True) + font_variant = Unicode(help="Button text font variant.").tag(sync=True) + font_weight = Unicode(help="Button text font weight.").tag(sync=True) + text_color = Color(None, allow_none=True, help="Text color").tag(sync=True) + text_decoration = Unicode(help="Text decoration").tag(sync=True) + + class _Bool(DescriptionWidget, ValueWidget, CoreWidget): """A base class for creating widgets that represent booleans.""" value = Bool(False, help="Bool value").tag(sync=True) disabled = Bool(False, help="Enable or disable user changes.").tag(sync=True) + style = InstanceDict(_BoolStyle, help="Styling customizations").tag(sync=True, **widget_serialization) def __init__(self, value=None, **kwargs): if value is not None: @@ -65,6 +87,7 @@ class ToggleButton(_Bool): button_style = CaselessStrEnum( values=['primary', 'success', 'info', 'warning', 'danger', ''], default_value='', help="""Use a predefined styling for the button.""").tag(sync=True) + style = InstanceDict(ToggleButtonStyle, help="Styling customizations").tag(sync=True, **widget_serialization) @register diff --git a/packages/controls/src/widget_bool.ts b/packages/controls/src/widget_bool.ts index eba145bab1..78b1506e44 100644 --- a/packages/controls/src/widget_bool.ts +++ b/packages/controls/src/widget_bool.ts @@ -6,17 +6,86 @@ import { } from './widget_core'; import { - DescriptionView + DescriptionStyleModel, DescriptionView } from './widget_description'; import { DOMWidgetView } from '@jupyter-widgets/base'; +import { + JUPYTER_CONTROLS_VERSION +} from './version'; + import * as _ from 'underscore'; +export +class BoolStyleModel extends DescriptionStyleModel { + defaults(): Backbone.ObjectHash { + return _.extend(super.defaults(), { + _model_name: 'BoolStyleModel', + _model_module: '@jupyter-widgets/controls', + _model_module_version: JUPYTER_CONTROLS_VERSION, + }); + } + + public static styleProperties = { + ...DescriptionStyleModel.styleProperties, + background_color: { + selector: '', + attribute: 'background-color', + default: null as any + } + }; +} +export +class ToggleButtonStyleModel extends BoolStyleModel { + defaults(): Backbone.ObjectHash { + return _.extend(super.defaults(), { + _model_name: 'ToggleButtonStyleModel', + }); + } + public static styleProperties = { + ...BoolStyleModel.styleProperties, + font_family: { + selector: '', + attribute: 'font-family', + default: '' + }, + font_size: { + selector: '', + attribute: 'font-size', + default: '' + }, + font_style: { + selector: '', + attribute: 'font-style', + default: '' + }, + font_variant: { + selector: '', + attribute: 'font-variant', + default: '' + }, + font_weight: { + selector: '', + attribute: 'font-weight', + default: '' + }, + text_color: { + selector: '', + attribute: 'color', + default: '' + }, + text_decoration: { + selector: '', + attribute: 'text-decoration', + default: '' + } + }; + } export class BoolModel extends CoreDescriptionModel { @@ -24,6 +93,7 @@ class BoolModel extends CoreDescriptionModel { return _.extend(super.defaults(), { value: false, disabled: false, + style: null, _model_name: 'BoolModel' }); } @@ -190,7 +260,8 @@ class ToggleButtonModel extends BoolModel { _model_name: 'ToggleButtonModel', tooltip: '', icon: '', - button_style: '' + button_style: '', + style: null }); } } diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index a8b3b56937..8372cef1a9 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -206,7 +206,7 @@ Attribute | Type | Default | Help `disabled` | boolean | `false` | Enable or disable user changes. `indent` | boolean | `true` | Indent the control to align with other controls with a description. `layout` | reference to Layout widget | reference to new instance | -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to _BoolStyle widget | reference to new instance | Styling customizations `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | boolean | `false` | Bool value @@ -1031,11 +1031,30 @@ Attribute | Type | Default | Help `disabled` | boolean | `false` | Enable or disable user changes. `icon` | string | `''` | Font-awesome icon. `layout` | reference to Layout widget | reference to new instance | -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to ToggleButtonStyle widget | reference to new instance | Styling customizations `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | boolean | `false` | Bool value +### ToggleButtonStyleModel (@jupyter-widgets/controls, 1.5.0); StyleView (@jupyter-widgets/base, 1.2.0) + +Attribute | Type | Default | Help +-----------------|------------------|------------------|---- +`_model_module` | string | `'@jupyter-widgets/controls'` | +`_model_module_version` | string | `'1.5.0'` | +`_model_name` | string | `'ToggleButtonStyleModel'` | +`_view_module` | string | `'@jupyter-widgets/base'` | +`_view_module_version` | string | `'1.2.0'` | +`_view_name` | string | `'StyleView'` | +`background_color` | `null` or string | `null` | Background color +`font_family` | string | `''` | Button text font family. +`font_size` | string | `''` | Button text font size. +`font_style` | string | `''` | Button text font style. +`font_variant` | string | `''` | Button text font variant. +`font_weight` | string | `''` | Button text font weight. +`text_color` | `null` or string | `null` | Text color +`text_decoration` | `null` or string | `null` | Text decoration + ### ToggleButtonsModel (@jupyter-widgets/controls, 1.5.0); ToggleButtonsView (@jupyter-widgets/controls, 1.5.0) Attribute | Type | Default | Help @@ -1105,7 +1124,7 @@ Attribute | Type | Default | Help `disabled` | boolean | `false` | Enable or disable user changes. `layout` | reference to Layout widget | reference to new instance | `readout` | string | `'Invalid'` | Message displayed when the value is False -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to _BoolStyle widget | reference to new instance | Styling customizations `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | boolean | `false` | Bool value @@ -1149,3 +1168,15 @@ Attribute | Type | Default | Help `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. +### o (_, B); S (o, l) + +Attribute | Type | Default | Help +-----------------|------------------|------------------|---- +`_model_module` | string | `'@jupyter-widgets/controls'` | +`_model_module_version` | string | `'1.5.0'` | +`_model_name` | string | `'BoolStyleModel'` | +`_view_module` | string | `'@jupyter-widgets/base'` | +`_view_module_version` | string | `'1.2.0'` | +`_view_name` | string | `'StyleView'` | +`background_color` | `null` or string | `null` | Background color + diff --git a/tests/test_boolstyle.ipynb b/tests/test_boolstyle.ipynb new file mode 100644 index 0000000000..e58d68ef7a --- /dev/null +++ b/tests/test_boolstyle.ipynb @@ -0,0 +1,151 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Checkbox, ToggleButton, Valid\n", + "tb = ToggleButton(description=\"ToggleButton\")\n", + "tb" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.background_color = \"linen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.text_color = \"darkgreen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_style = \"italic\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_weight = \"bold\" " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_variant = \"small-caps\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.text_decoration = \"underline\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_size = \"1.2em\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_family = \"bitstream\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "v = Valid(True)\n", + "v.style.background_color = \"palegoldenrod\"\n", + "v" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "v.value = False" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "c = Checkbox(description=\"Chekbox\")\n", + "c" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "c.style.background_color = \"azure\"\n", + "c.layout.width = \"150px\"\n", + "c.layout.padding = \"0px\"\n", + "c.layout.border = \"1px solid black\"\n", + "c.style.description_width = \"5px\"" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From bb9db91935971f39acfc145f8cb7c3f9c86504d5 Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 16:17:51 +0100 Subject: [PATCH 04/24] Remove test file. --- tests/test_boolstyle.ipynb | 151 ------------------------------------- 1 file changed, 151 deletions(-) delete mode 100644 tests/test_boolstyle.ipynb diff --git a/tests/test_boolstyle.ipynb b/tests/test_boolstyle.ipynb deleted file mode 100644 index e58d68ef7a..0000000000 --- a/tests/test_boolstyle.ipynb +++ /dev/null @@ -1,151 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from ipywidgets import Checkbox, ToggleButton, Valid\n", - "tb = ToggleButton(description=\"ToggleButton\")\n", - "tb" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.background_color = \"linen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.text_color = \"darkgreen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_style = \"italic\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_weight = \"bold\" " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_variant = \"small-caps\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.text_decoration = \"underline\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_size = \"1.2em\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_family = \"bitstream\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "v = Valid(True)\n", - "v.style.background_color = \"palegoldenrod\"\n", - "v" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "v.value = False" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "c = Checkbox(description=\"Chekbox\")\n", - "c" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "c.style.background_color = \"azure\"\n", - "c.layout.width = \"150px\"\n", - "c.layout.padding = \"0px\"\n", - "c.layout.border = \"1px solid black\"\n", - "c.style.description_width = \"5px\"" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 2d1ac7d5c4a01ba7b63384133f8e9b2b102faae1 Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 16:29:11 +0100 Subject: [PATCH 05/24] typo. --- packages/schema/jupyterwidgetmodels.latest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 8372cef1a9..b9d1208975 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -1053,7 +1053,7 @@ Attribute | Type | Default | Help `font_variant` | string | `''` | Button text font variant. `font_weight` | string | `''` | Button text font weight. `text_color` | `null` or string | `null` | Text color -`text_decoration` | `null` or string | `null` | Text decoration +`text_decoration` | string | `''` | Text decoration ### ToggleButtonsModel (@jupyter-widgets/controls, 1.5.0); ToggleButtonsView (@jupyter-widgets/controls, 1.5.0) From 0881e1008f03b66fa9a17cc3b4ec24dd66500c43 Mon Sep 17 00:00:00 2001 From: Zerline Date: Fri, 10 Jan 2020 15:30:19 +0100 Subject: [PATCH 06/24] Styling buttons. --- ipywidgets/widgets/widget_button.py | 6 ++ packages/controls/src/widget_button.ts | 30 +++++++ tests/test_buttonstyle.ipynb | 108 +++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 tests/test_buttonstyle.ipynb diff --git a/ipywidgets/widgets/widget_button.py b/ipywidgets/widgets/widget_button.py index e2fb3387ac..8e90a68e1a 100644 --- a/ipywidgets/widgets/widget_button.py +++ b/ipywidgets/widgets/widget_button.py @@ -22,7 +22,13 @@ class ButtonStyle(Style, CoreWidget): """Button style widget.""" _model_name = Unicode('ButtonStyleModel').tag(sync=True) button_color = Color(None, allow_none=True, help="Color of the button").tag(sync=True) + font_family = Unicode(help="Button text font family.").tag(sync=True) + font_size = Unicode(help="Button text font size.").tag(sync=True) + font_style = Unicode(help="Button text font style.").tag(sync=True) + font_variant = Unicode(help="Button text font variant.").tag(sync=True) font_weight = Unicode(help="Button text font weight.").tag(sync=True) + text_color = Unicode(help="Button text color.").tag(sync=True) + text_decoration = Unicode(help="Button text decoration.").tag(sync=True) @register diff --git a/packages/controls/src/widget_button.ts b/packages/controls/src/widget_button.ts index 69b1156538..70874ee7ed 100644 --- a/packages/controls/src/widget_button.ts +++ b/packages/controls/src/widget_button.ts @@ -32,10 +32,40 @@ class ButtonStyleModel extends StyleModel { attribute: 'background-color', default: null as any }, + font_family: { + selector: '', + attribute: 'font-family', + default: '' + }, + font_size: { + selector: '', + attribute: 'font-size', + default: '' + }, + font_style: { + selector: '', + attribute: 'font-style', + default: '' + }, + font_variant: { + selector: '', + attribute: 'font-variant', + default: '' + }, font_weight: { selector: '', attribute: 'font-weight', default: '' + }, + text_color: { + selector: '', + attribute: 'color', + default: '' + }, + text_decoration: { + selector: '', + attribute: 'text-decoration', + default: '' } }; } diff --git a/tests/test_buttonstyle.ipynb b/tests/test_buttonstyle.ipynb new file mode 100644 index 0000000000..967b74faf8 --- /dev/null +++ b/tests/test_buttonstyle.ipynb @@ -0,0 +1,108 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Button\n", + "b = Button(description=\"Button\")\n", + "b" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.button_color = \"linen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.text_color = \"darkgreen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_style = \"italic\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_weight = \"bold\" " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_variant = \"small-caps\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.text_decoration = \"underline\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_size = \"1.2em\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_family = \"bitstream\"" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 9f1018762624a9c90ee328ed77b47d897a7a8288 Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 14:58:50 +0100 Subject: [PATCH 07/24] Generate schema and remove test file. --- packages/schema/jupyterwidgetmodels.latest.md | 6 + tests/test_buttonstyle.ipynb | 108 ------------------ 2 files changed, 6 insertions(+), 108 deletions(-) delete mode 100644 tests/test_buttonstyle.ipynb diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 56b0c60df8..7f7938f7bc 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -196,7 +196,13 @@ Attribute | Type | Default | Help `_view_module_version` | string | `'1.2.0'` | `_view_name` | string | `'StyleView'` | `button_color` | `null` or string | `null` | Color of the button +`font_family` | string | `''` | Button text font family. +`font_size` | string | `''` | Button text font size. +`font_style` | string | `''` | Button text font style. +`font_variant` | string | `''` | Button text font variant. `font_weight` | string | `''` | Button text font weight. +`text_color` | string | `''` | Button text color. +`text_decoration` | string | `''` | Button text decoration. ### CheckboxModel (@jupyter-widgets/controls, 1.5.0); CheckboxView (@jupyter-widgets/controls, 1.5.0) diff --git a/tests/test_buttonstyle.ipynb b/tests/test_buttonstyle.ipynb deleted file mode 100644 index 967b74faf8..0000000000 --- a/tests/test_buttonstyle.ipynb +++ /dev/null @@ -1,108 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from ipywidgets import Button\n", - "b = Button(description=\"Button\")\n", - "b" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.button_color = \"linen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.text_color = \"darkgreen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_style = \"italic\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_weight = \"bold\" " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_variant = \"small-caps\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.text_decoration = \"underline\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_size = \"1.2em\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_family = \"bitstream\"" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From d8a5106624d14426d2637473589ee1b6a7e4f0e3 Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 11:51:24 +0100 Subject: [PATCH 08/24] BoolStyle, ToggleButtonStyle. --- ipywidgets/widgets/widget_bool.py | 25 ++- packages/controls/src/widget_bool.ts | 75 ++++++++- packages/schema/jupyterwidgetmodels.latest.md | 37 ++++- tests/test_boolstyle.ipynb | 151 ++++++++++++++++++ 4 files changed, 282 insertions(+), 6 deletions(-) create mode 100644 tests/test_boolstyle.ipynb diff --git a/ipywidgets/widgets/widget_bool.py b/ipywidgets/widgets/widget_bool.py index e6ecede30b..e7fe5e994b 100644 --- a/ipywidgets/widgets/widget_bool.py +++ b/ipywidgets/widgets/widget_bool.py @@ -8,15 +8,37 @@ from .widget_description import DescriptionWidget from .widget_core import CoreWidget +from .widget_style import Style from .valuewidget import ValueWidget -from .widget import register +from .widget import register, widget_serialization +from .trait_types import Color, InstanceDict + from traitlets import Unicode, Bool, CaselessStrEnum +class _BoolStyle(Style, CoreWidget): + """_Bool widget style.""" + _model_name = Unicode('BoolStyleModel').tag(sync=True) + background_color = Color(None, allow_none=True, help="Background color").tag(sync=True) + +@register +class ToggleButtonStyle(_BoolStyle, CoreWidget): + """ToggleButton widget style.""" + _model_name = Unicode('ToggleButtonStyleModel').tag(sync=True) + font_family = Unicode(help="Button text font family.").tag(sync=True) + font_size = Unicode(help="Button text font size.").tag(sync=True) + font_style = Unicode(help="Button text font style.").tag(sync=True) + font_variant = Unicode(help="Button text font variant.").tag(sync=True) + font_weight = Unicode(help="Button text font weight.").tag(sync=True) + text_color = Color(None, allow_none=True, help="Text color").tag(sync=True) + text_decoration = Unicode(help="Text decoration").tag(sync=True) + + class _Bool(DescriptionWidget, ValueWidget, CoreWidget): """A base class for creating widgets that represent booleans.""" value = Bool(False, help="Bool value").tag(sync=True) disabled = Bool(False, help="Enable or disable user changes.").tag(sync=True) + style = InstanceDict(_BoolStyle, help="Styling customizations").tag(sync=True, **widget_serialization) def __init__(self, value=None, **kwargs): if value is not None: @@ -65,6 +87,7 @@ class ToggleButton(_Bool): button_style = CaselessStrEnum( values=['primary', 'success', 'info', 'warning', 'danger', ''], default_value='', help="""Use a predefined styling for the button.""").tag(sync=True) + style = InstanceDict(ToggleButtonStyle, help="Styling customizations").tag(sync=True, **widget_serialization) @register diff --git a/packages/controls/src/widget_bool.ts b/packages/controls/src/widget_bool.ts index eba145bab1..78b1506e44 100644 --- a/packages/controls/src/widget_bool.ts +++ b/packages/controls/src/widget_bool.ts @@ -6,17 +6,86 @@ import { } from './widget_core'; import { - DescriptionView + DescriptionStyleModel, DescriptionView } from './widget_description'; import { DOMWidgetView } from '@jupyter-widgets/base'; +import { + JUPYTER_CONTROLS_VERSION +} from './version'; + import * as _ from 'underscore'; +export +class BoolStyleModel extends DescriptionStyleModel { + defaults(): Backbone.ObjectHash { + return _.extend(super.defaults(), { + _model_name: 'BoolStyleModel', + _model_module: '@jupyter-widgets/controls', + _model_module_version: JUPYTER_CONTROLS_VERSION, + }); + } + + public static styleProperties = { + ...DescriptionStyleModel.styleProperties, + background_color: { + selector: '', + attribute: 'background-color', + default: null as any + } + }; +} +export +class ToggleButtonStyleModel extends BoolStyleModel { + defaults(): Backbone.ObjectHash { + return _.extend(super.defaults(), { + _model_name: 'ToggleButtonStyleModel', + }); + } + public static styleProperties = { + ...BoolStyleModel.styleProperties, + font_family: { + selector: '', + attribute: 'font-family', + default: '' + }, + font_size: { + selector: '', + attribute: 'font-size', + default: '' + }, + font_style: { + selector: '', + attribute: 'font-style', + default: '' + }, + font_variant: { + selector: '', + attribute: 'font-variant', + default: '' + }, + font_weight: { + selector: '', + attribute: 'font-weight', + default: '' + }, + text_color: { + selector: '', + attribute: 'color', + default: '' + }, + text_decoration: { + selector: '', + attribute: 'text-decoration', + default: '' + } + }; + } export class BoolModel extends CoreDescriptionModel { @@ -24,6 +93,7 @@ class BoolModel extends CoreDescriptionModel { return _.extend(super.defaults(), { value: false, disabled: false, + style: null, _model_name: 'BoolModel' }); } @@ -190,7 +260,8 @@ class ToggleButtonModel extends BoolModel { _model_name: 'ToggleButtonModel', tooltip: '', icon: '', - button_style: '' + button_style: '', + style: null }); } } diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 56b0c60df8..313db5c560 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -213,7 +213,7 @@ Attribute | Type | Default | Help `disabled` | boolean | `false` | Enable or disable user changes. `indent` | boolean | `true` | Indent the control to align with other controls with a description. `layout` | reference to Layout widget | reference to new instance | -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to _BoolStyle widget | reference to new instance | Styling customizations `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | boolean | `false` | Bool value @@ -1038,11 +1038,30 @@ Attribute | Type | Default | Help `disabled` | boolean | `false` | Enable or disable user changes. `icon` | string | `''` | Font-awesome icon. `layout` | reference to Layout widget | reference to new instance | -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to ToggleButtonStyle widget | reference to new instance | Styling customizations `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | boolean | `false` | Bool value +### ToggleButtonStyleModel (@jupyter-widgets/controls, 1.5.0); StyleView (@jupyter-widgets/base, 1.2.0) + +Attribute | Type | Default | Help +-----------------|------------------|------------------|---- +`_model_module` | string | `'@jupyter-widgets/controls'` | +`_model_module_version` | string | `'1.5.0'` | +`_model_name` | string | `'ToggleButtonStyleModel'` | +`_view_module` | string | `'@jupyter-widgets/base'` | +`_view_module_version` | string | `'1.2.0'` | +`_view_name` | string | `'StyleView'` | +`background_color` | `null` or string | `null` | Background color +`font_family` | string | `''` | Button text font family. +`font_size` | string | `''` | Button text font size. +`font_style` | string | `''` | Button text font style. +`font_variant` | string | `''` | Button text font variant. +`font_weight` | string | `''` | Button text font weight. +`text_color` | `null` or string | `null` | Text color +`text_decoration` | `null` or string | `null` | Text decoration + ### ToggleButtonsModel (@jupyter-widgets/controls, 1.5.0); ToggleButtonsView (@jupyter-widgets/controls, 1.5.0) Attribute | Type | Default | Help @@ -1112,7 +1131,7 @@ Attribute | Type | Default | Help `disabled` | boolean | `false` | Enable or disable user changes. `layout` | reference to Layout widget | reference to new instance | `readout` | string | `'Invalid'` | Message displayed when the value is False -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to _BoolStyle widget | reference to new instance | Styling customizations `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | boolean | `false` | Bool value @@ -1156,3 +1175,15 @@ Attribute | Type | Default | Help `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. +### o (_, B); S (o, l) + +Attribute | Type | Default | Help +-----------------|------------------|------------------|---- +`_model_module` | string | `'@jupyter-widgets/controls'` | +`_model_module_version` | string | `'1.5.0'` | +`_model_name` | string | `'BoolStyleModel'` | +`_view_module` | string | `'@jupyter-widgets/base'` | +`_view_module_version` | string | `'1.2.0'` | +`_view_name` | string | `'StyleView'` | +`background_color` | `null` or string | `null` | Background color + diff --git a/tests/test_boolstyle.ipynb b/tests/test_boolstyle.ipynb new file mode 100644 index 0000000000..e58d68ef7a --- /dev/null +++ b/tests/test_boolstyle.ipynb @@ -0,0 +1,151 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Checkbox, ToggleButton, Valid\n", + "tb = ToggleButton(description=\"ToggleButton\")\n", + "tb" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.background_color = \"linen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.text_color = \"darkgreen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_style = \"italic\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_weight = \"bold\" " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_variant = \"small-caps\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.text_decoration = \"underline\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_size = \"1.2em\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_family = \"bitstream\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "v = Valid(True)\n", + "v.style.background_color = \"palegoldenrod\"\n", + "v" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "v.value = False" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "c = Checkbox(description=\"Chekbox\")\n", + "c" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "c.style.background_color = \"azure\"\n", + "c.layout.width = \"150px\"\n", + "c.layout.padding = \"0px\"\n", + "c.layout.border = \"1px solid black\"\n", + "c.style.description_width = \"5px\"" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From d7f25e8849446dc489bd98837aeacc271fabf097 Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 16:17:51 +0100 Subject: [PATCH 09/24] Remove test file. --- tests/test_boolstyle.ipynb | 151 ------------------------------------- 1 file changed, 151 deletions(-) delete mode 100644 tests/test_boolstyle.ipynb diff --git a/tests/test_boolstyle.ipynb b/tests/test_boolstyle.ipynb deleted file mode 100644 index e58d68ef7a..0000000000 --- a/tests/test_boolstyle.ipynb +++ /dev/null @@ -1,151 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from ipywidgets import Checkbox, ToggleButton, Valid\n", - "tb = ToggleButton(description=\"ToggleButton\")\n", - "tb" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.background_color = \"linen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.text_color = \"darkgreen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_style = \"italic\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_weight = \"bold\" " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_variant = \"small-caps\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.text_decoration = \"underline\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_size = \"1.2em\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_family = \"bitstream\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "v = Valid(True)\n", - "v.style.background_color = \"palegoldenrod\"\n", - "v" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "v.value = False" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "c = Checkbox(description=\"Chekbox\")\n", - "c" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "c.style.background_color = \"azure\"\n", - "c.layout.width = \"150px\"\n", - "c.layout.padding = \"0px\"\n", - "c.layout.border = \"1px solid black\"\n", - "c.style.description_width = \"5px\"" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From afe3e795e64d57c5191b80676e73b74bd9373715 Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 16:29:11 +0100 Subject: [PATCH 10/24] typo. --- packages/schema/jupyterwidgetmodels.latest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 313db5c560..cf65006b06 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -1060,7 +1060,7 @@ Attribute | Type | Default | Help `font_variant` | string | `''` | Button text font variant. `font_weight` | string | `''` | Button text font weight. `text_color` | `null` or string | `null` | Text color -`text_decoration` | `null` or string | `null` | Text decoration +`text_decoration` | string | `''` | Text decoration ### ToggleButtonsModel (@jupyter-widgets/controls, 1.5.0); ToggleButtonsView (@jupyter-widgets/controls, 1.5.0) From f10d1ffeaab96d4c5a44013da2e30a3ece46e70c Mon Sep 17 00:00:00 2001 From: Zerline Date: Fri, 10 Jan 2020 15:30:19 +0100 Subject: [PATCH 11/24] Styling buttons. --- ipywidgets/widgets/widget_button.py | 6 ++ packages/controls/src/widget_button.ts | 30 +++++++ tests/test_buttonstyle.ipynb | 108 +++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 tests/test_buttonstyle.ipynb diff --git a/ipywidgets/widgets/widget_button.py b/ipywidgets/widgets/widget_button.py index e2fb3387ac..8e90a68e1a 100644 --- a/ipywidgets/widgets/widget_button.py +++ b/ipywidgets/widgets/widget_button.py @@ -22,7 +22,13 @@ class ButtonStyle(Style, CoreWidget): """Button style widget.""" _model_name = Unicode('ButtonStyleModel').tag(sync=True) button_color = Color(None, allow_none=True, help="Color of the button").tag(sync=True) + font_family = Unicode(help="Button text font family.").tag(sync=True) + font_size = Unicode(help="Button text font size.").tag(sync=True) + font_style = Unicode(help="Button text font style.").tag(sync=True) + font_variant = Unicode(help="Button text font variant.").tag(sync=True) font_weight = Unicode(help="Button text font weight.").tag(sync=True) + text_color = Unicode(help="Button text color.").tag(sync=True) + text_decoration = Unicode(help="Button text decoration.").tag(sync=True) @register diff --git a/packages/controls/src/widget_button.ts b/packages/controls/src/widget_button.ts index 9efee0e5d5..49bf6a30b9 100644 --- a/packages/controls/src/widget_button.ts +++ b/packages/controls/src/widget_button.ts @@ -23,10 +23,40 @@ export class ButtonStyleModel extends StyleModel { attribute: 'background-color', default: null as any }, + font_family: { + selector: '', + attribute: 'font-family', + default: '' + }, + font_size: { + selector: '', + attribute: 'font-size', + default: '' + }, + font_style: { + selector: '', + attribute: 'font-style', + default: '' + }, + font_variant: { + selector: '', + attribute: 'font-variant', + default: '' + }, font_weight: { selector: '', attribute: 'font-weight', default: '' + }, + text_color: { + selector: '', + attribute: 'color', + default: '' + }, + text_decoration: { + selector: '', + attribute: 'text-decoration', + default: '' } }; } diff --git a/tests/test_buttonstyle.ipynb b/tests/test_buttonstyle.ipynb new file mode 100644 index 0000000000..967b74faf8 --- /dev/null +++ b/tests/test_buttonstyle.ipynb @@ -0,0 +1,108 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Button\n", + "b = Button(description=\"Button\")\n", + "b" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.button_color = \"linen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.text_color = \"darkgreen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_style = \"italic\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_weight = \"bold\" " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_variant = \"small-caps\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.text_decoration = \"underline\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_size = \"1.2em\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_family = \"bitstream\"" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 9421ae731ae9a7e693e2a88167f88b571f9b71dc Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 14:58:50 +0100 Subject: [PATCH 12/24] Generate schema and remove test file. --- packages/schema/jupyterwidgetmodels.latest.md | 6 + tests/test_buttonstyle.ipynb | 108 ------------------ 2 files changed, 6 insertions(+), 108 deletions(-) delete mode 100644 tests/test_buttonstyle.ipynb diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 4b75dd3c52..434d9e808f 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -196,7 +196,13 @@ Attribute | Type | Default | Help `_view_module_version` | string | `'1.2.0'` | `_view_name` | string | `'StyleView'` | `button_color` | `null` or string | `null` | Color of the button +`font_family` | string | `''` | Button text font family. +`font_size` | string | `''` | Button text font size. +`font_style` | string | `''` | Button text font style. +`font_variant` | string | `''` | Button text font variant. `font_weight` | string | `''` | Button text font weight. +`text_color` | string | `''` | Button text color. +`text_decoration` | string | `''` | Button text decoration. ### CheckboxModel (@jupyter-widgets/controls, 1.5.0); CheckboxView (@jupyter-widgets/controls, 1.5.0) diff --git a/tests/test_buttonstyle.ipynb b/tests/test_buttonstyle.ipynb deleted file mode 100644 index 967b74faf8..0000000000 --- a/tests/test_buttonstyle.ipynb +++ /dev/null @@ -1,108 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from ipywidgets import Button\n", - "b = Button(description=\"Button\")\n", - "b" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.button_color = \"linen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.text_color = \"darkgreen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_style = \"italic\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_weight = \"bold\" " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_variant = \"small-caps\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.text_decoration = \"underline\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_size = \"1.2em\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_family = \"bitstream\"" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 944a945700c64df8858e02d22118f9d4a1f7abb8 Mon Sep 17 00:00:00 2001 From: Zerline Date: Sat, 18 Jan 2020 11:12:28 +0100 Subject: [PATCH 13/24] Confusion while merging. --- packages/controls/src/widget_button.ts | 44 +------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/packages/controls/src/widget_button.ts b/packages/controls/src/widget_button.ts index 117e64a6bd..49bf6a30b9 100644 --- a/packages/controls/src/widget_button.ts +++ b/packages/controls/src/widget_button.ts @@ -58,49 +58,7 @@ export class ButtonStyleModel extends StyleModel { attribute: 'text-decoration', default: '' } - - public static styleProperties = { - button_color: { - selector: '', - attribute: 'background-color', - default: null as any - }, - font_family: { - selector: '', - attribute: 'font-family', - default: '' - }, - font_size: { - selector: '', - attribute: 'font-size', - default: '' - }, - font_style: { - selector: '', - attribute: 'font-style', - default: '' - }, - font_variant: { - selector: '', - attribute: 'font-variant', - default: '' - }, - font_weight: { - selector: '', - attribute: 'font-weight', - default: '' - }, - text_color: { - selector: '', - attribute: 'color', - default: '' - }, - text_decoration: { - selector: '', - attribute: 'text-decoration', - default: '' - } - }; + }; } export class ButtonModel extends CoreDOMWidgetModel { From 06172eee6f11abd56fc17b5024c650e1ddad3157 Mon Sep 17 00:00:00 2001 From: Zerline Date: Sat, 18 Jan 2020 17:32:32 +0100 Subject: [PATCH 14/24] Using booleans ('italic') instead of strings ('text-style'). --- ipywidgets/widgets/widget_button.py | 14 +- packages/base/src/widget_style.ts | 4 + packages/controls/src/widget_button.ts | 74 +- .../schema/jupyterwidgetmodels.latest.json | 1774 ++++++++++++----- packages/schema/jupyterwidgetmodels.latest.md | 9 +- 5 files changed, 1373 insertions(+), 502 deletions(-) diff --git a/ipywidgets/widgets/widget_button.py b/ipywidgets/widgets/widget_button.py index 8e90a68e1a..b40cce68b9 100644 --- a/ipywidgets/widgets/widget_button.py +++ b/ipywidgets/widgets/widget_button.py @@ -12,6 +12,7 @@ from .widget_core import CoreWidget from .widget_style import Style from .trait_types import Color, InstanceDict +from .._version import __jupyter_widgets_controls_version__ from traitlets import Unicode, Bool, CaselessStrEnum, Instance, validate, default import warnings @@ -21,14 +22,17 @@ class ButtonStyle(Style, CoreWidget): """Button style widget.""" _model_name = Unicode('ButtonStyleModel').tag(sync=True) + _view_name = Unicode('ButtonStyleView').tag(sync=True) + _view_module = Unicode('@jupyter-widgets/controls').tag(sync=True) + _view_module_version = Unicode(__jupyter_widgets_controls_version__).tag(sync=True) + bold = Bool(None, allow_none=True, help="Button text bold.").tag(sync=True) button_color = Color(None, allow_none=True, help="Color of the button").tag(sync=True) - font_family = Unicode(help="Button text font family.").tag(sync=True) + font_family = Unicode(None, allow_none=True, help="Button text font family.").tag(sync=True) font_size = Unicode(help="Button text font size.").tag(sync=True) - font_style = Unicode(help="Button text font style.").tag(sync=True) - font_variant = Unicode(help="Button text font variant.").tag(sync=True) - font_weight = Unicode(help="Button text font weight.").tag(sync=True) + font_variant = Unicode(None, allow_none=True, help="Button text font variant.").tag(sync=True) + italic = Bool(None, allow_none=True, help="Button text italic.").tag(sync=True) text_color = Unicode(help="Button text color.").tag(sync=True) - text_decoration = Unicode(help="Button text decoration.").tag(sync=True) + underline = Bool(None, allow_none=True, help="Button text underline.").tag(sync=True) @register diff --git a/packages/base/src/widget_style.ts b/packages/base/src/widget_style.ts index ceb26e39c8..c51d44403d 100644 --- a/packages/base/src/widget_style.ts +++ b/packages/base/src/widget_style.ts @@ -124,5 +124,9 @@ export class StyleView extends WidgetView { }, this); } + get_traitNames(): string[] { + return this._traitNames; + } + private _traitNames: string[]; } diff --git a/packages/controls/src/widget_button.ts b/packages/controls/src/widget_button.ts index 49bf6a30b9..1a430c27ae 100644 --- a/packages/controls/src/widget_button.ts +++ b/packages/controls/src/widget_button.ts @@ -1,23 +1,49 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -import { DOMWidgetView, StyleModel } from '@jupyter-widgets/base'; +import { DOMWidgetView, StyleModel, StyleView } from '@jupyter-widgets/base'; import { CoreDOMWidgetModel } from './widget_core'; import { JUPYTER_CONTROLS_VERSION } from './version'; +export function bold_to_weight(value: boolean): string | null { + if (value == true) return 'bold'; + if (value == false) return 'normal'; + return null; +} + +export function italic_to_style(value: boolean): string | null { + if (value == true) return 'italic'; + if (value == false) return 'normal'; + return null; +} + +export function underline_to_decoration(value: boolean): string | null { + if (value == true) return 'underline'; + if (value == false) return 'none'; + return null; +} + export class ButtonStyleModel extends StyleModel { defaults(): Backbone.ObjectHash { return { ...super.defaults(), _model_name: 'ButtonStyleModel', _model_module: '@jupyter-widgets/controls', - _model_module_version: JUPYTER_CONTROLS_VERSION + _model_module_version: JUPYTER_CONTROLS_VERSION, + _view_name: 'ButtonStyleView', + _view_module: '@jupyter-widgets/controls', + _view_module_version: JUPYTER_CONTROLS_VERSION }; } public static styleProperties = { + bold: { + selector: '', + attribute: 'font-weight', + default: '' + }, button_color: { selector: '', attribute: 'background-color', @@ -33,7 +59,7 @@ export class ButtonStyleModel extends StyleModel { attribute: 'font-size', default: '' }, - font_style: { + italic: { selector: '', attribute: 'font-style', default: '' @@ -43,17 +69,12 @@ export class ButtonStyleModel extends StyleModel { attribute: 'font-variant', default: '' }, - font_weight: { - selector: '', - attribute: 'font-weight', - default: '' - }, text_color: { selector: '', attribute: 'color', default: '' }, - text_decoration: { + underline: { selector: '', attribute: 'text-decoration', default: '' @@ -61,6 +82,41 @@ export class ButtonStyleModel extends StyleModel { }; } +export class ButtonStyleView extends StyleView { + /** + * Handles when a trait value changes + */ + handleChange(trait: string, value: any): void { + // should be synchronous so that we can measure later. + const parent = this.options.parent as DOMWidgetView; + if (parent) { + const ModelType = this.model.constructor as typeof StyleModel; + const styleProperties = ModelType.styleProperties; + const attribute = styleProperties[trait].attribute; + const selector = styleProperties[trait].selector; + const elements = selector + ? parent.el.querySelectorAll(selector) + : [parent.el]; + let transform = undefined; + if (trait == 'bold') transform = bold_to_weight; + if (trait == 'italic') transform = italic_to_style; + if (trait == 'underline') transform = underline_to_decoration; + if (transform !== undefined) value = transform(value); + if (value === null) { + for (let i = 0; i !== elements.length; ++i) { + elements[i].style.removeProperty(attribute); + } + } else { + for (let i = 0; i !== elements.length; ++i) { + elements[i].style.setProperty(attribute, value); + } + } + } else { + console.warn('Style not applied because a parent view does not exist'); + } + } +} + export class ButtonModel extends CoreDOMWidgetModel { defaults(): Backbone.ObjectHash { return { diff --git a/packages/schema/jupyterwidgetmodels.latest.json b/packages/schema/jupyterwidgetmodels.latest.json index d84d7c19f3..259a0e76a2 100644 --- a/packages/schema/jupyterwidgetmodels.latest.json +++ b/packages/schema/jupyterwidgetmodels.latest.json @@ -8,7 +8,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "A semver requirement for namespace version containing the model.", "name": "_model_module_version", "type": "string" @@ -26,7 +26,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -229,6 +229,21 @@ "name": "justify_content", "type": "string" }, + { + "allow_none": true, + "default": null, + "enum": [ + "flex-start", + "flex-end", + "center", + "inherit", + "initial", + "unset" + ], + "help": "The justify-items CSS attribute.", + "name": "justify_items", + "type": "string" + }, { "allow_none": true, "default": null, @@ -274,56 +289,30 @@ { "allow_none": true, "default": null, - "help": "The order CSS attribute.", - "name": "order", + "enum": ["contain", "cover", "fill", "scale-down", "none"], + "help": "The object-fit CSS attribute.", + "name": "object_fit", "type": "string" }, { "allow_none": true, "default": null, - "enum": [ - "visible", - "hidden", - "scroll", - "auto", - "inherit", - "initial", - "unset" - ], - "help": "The overflow CSS attribute.", - "name": "overflow", + "help": "The object-position CSS attribute.", + "name": "object_position", "type": "string" }, { "allow_none": true, "default": null, - "enum": [ - "visible", - "hidden", - "scroll", - "auto", - "inherit", - "initial", - "unset" - ], - "help": "The overflow-x CSS attribute.", - "name": "overflow_x", + "help": "The order CSS attribute.", + "name": "order", "type": "string" }, { "allow_none": true, "default": null, - "enum": [ - "visible", - "hidden", - "scroll", - "auto", - "inherit", - "initial", - "unset" - ], - "help": "The overflow-y CSS attribute.", - "name": "overflow_y", + "help": "The overflow CSS attribute.", + "name": "overflow", "type": "string" }, { @@ -366,12 +355,12 @@ "model": { "module": "@jupyter-widgets/base", "name": "LayoutModel", - "version": "1.1.0" + "version": "1.2.0" }, "view": { "module": "@jupyter-widgets/base", "name": "LayoutView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -392,7 +381,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -416,7 +405,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -457,17 +446,31 @@ "help": "The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected.", "name": "selected_index", "type": "int" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "AccordionModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "AccordionView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -488,7 +491,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -506,7 +509,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -548,9 +551,23 @@ "name": "loop", "type": "bool" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "b''", - "help": "The media data as a byte string.", + "help": "The media data as a memory view of bytes.", "name": "value", "type": "bytes" } @@ -558,12 +575,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "AudioModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "AudioView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -584,7 +601,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -602,7 +619,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -625,13 +642,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -671,6 +681,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "Float value", @@ -681,12 +705,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "BoundedFloatTextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatTextView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -707,7 +731,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -725,7 +749,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -748,13 +772,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -793,6 +810,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -803,12 +834,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "BoundedIntTextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "IntTextView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -829,7 +860,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -847,7 +878,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -881,17 +912,31 @@ "name": "layout", "type": "reference", "widget": "Layout" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "BoxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "BoxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -912,7 +957,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -930,7 +975,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -962,7 +1007,7 @@ }, { "default": "", - "help": "Font-awesome icon name, without the 'fa-' prefix.", + "help": "Font-awesome icon names, without the 'fa-' prefix.", "name": "icon", "type": "string" }, @@ -981,8 +1026,16 @@ "widget": "ButtonStyle" }, { - "default": "", - "help": "Tooltip caption of the button.", + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", "name": "tooltip", "type": "string" } @@ -990,12 +1043,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ButtonModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ButtonView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1007,7 +1060,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1025,7 +1078,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1043,22 +1096,55 @@ "name": "button_color", "type": "string" }, + { + "allow_none": true, + "default": null, + "help": "Button text font family.", + "name": "font_family", + "type": "string" + }, { "default": "", - "help": "Button text font weight.", - "name": "font_weight", + "help": "Button text font size.", + "name": "font_size", "type": "string" + }, + { + "allow_none": true, + "default": null, + "help": "Button text font variant.", + "name": "font_variant", + "type": "string" + }, + { + "default": false, + "help": "Button text italic.", + "name": "italic", + "type": "bool" + }, + { + "default": "", + "help": "Button text color.", + "name": "text_color", + "type": "string" + }, + { + "allow_none": true, + "default": null, + "help": "Button text underline.", + "name": "underline", + "type": "bool" } ], "model": { "module": "@jupyter-widgets/controls", "name": "ButtonStyleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -1079,7 +1165,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1097,7 +1183,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1114,13 +1200,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -1147,6 +1226,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": false, "help": "Bool value", @@ -1157,12 +1250,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "CheckboxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "CheckboxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1183,7 +1276,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1201,7 +1294,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1224,13 +1317,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -1251,6 +1337,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "black", "help": "The color value.", @@ -1261,12 +1361,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ColorPickerModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ColorPickerView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1287,7 +1387,139 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", + "help": "", + "name": "_model_module_version", + "type": "string" + }, + { + "default": "ComboboxModel", + "help": "", + "name": "_model_name", + "type": "string" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_view_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_view_module_version", + "type": "string" + }, + { + "default": "ComboboxView", + "help": "", + "name": "_view_name", + "type": "string" + }, + { + "default": true, + "help": "Update the value as the user types. If False, update on submission, e.g., pressing Enter or navigating away.", + "name": "continuous_update", + "type": "bool" + }, + { + "default": "", + "help": "Description of the control.", + "name": "description", + "type": "string" + }, + { + "default": false, + "help": "Enable or disable user changes", + "name": "disabled", + "type": "bool" + }, + { + "default": false, + "help": "If set, ensure value is in options. Implies continuous_update=False.", + "name": "ensure_option", + "type": "bool" + }, + { + "default": "reference to new instance", + "help": "", + "name": "layout", + "type": "reference", + "widget": "Layout" + }, + { + "default": [], + "help": "Dropdown options for the combobox", + "items": { + "type": "string" + }, + "name": "options", + "type": "array" + }, + { + "default": "\u200b", + "help": "Placeholder text to display when nothing has been typed", + "name": "placeholder", + "type": "string" + }, + { + "default": "reference to new instance", + "help": "Styling customizations", + "name": "style", + "type": "reference", + "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, + { + "default": "", + "help": "String value", + "name": "value", + "type": "string" + } + ], + "model": { + "module": "@jupyter-widgets/controls", + "name": "ComboboxModel", + "version": "1.5.0" + }, + "view": { + "module": "@jupyter-widgets/controls", + "name": "ComboboxView", + "version": "1.5.0" + } + }, + { + "attributes": [ + { + "default": [], + "help": "CSS classes applied to widget DOM element", + "items": { + "type": "string" + }, + "name": "_dom_classes", + "type": "array" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_model_module", + "type": "string" + }, + { + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1305,7 +1537,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1323,6 +1555,20 @@ "type": "reference", "widget": "Layout" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "The value of the axis.", @@ -1333,12 +1579,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ControllerAxisModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ControllerAxisView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1359,7 +1605,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1377,7 +1623,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1401,6 +1647,20 @@ "name": "pressed", "type": "bool" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "The value of the button.", @@ -1411,12 +1671,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ControllerButtonModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ControllerButtonView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1437,7 +1697,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1455,7 +1715,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1517,22 +1777,36 @@ "name": "name", "type": "string" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, { "default": 0.0, "help": "The last time the data from this gamepad was updated.", "name": "timestamp", "type": "float" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "ControllerModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ControllerView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1553,7 +1827,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1571,7 +1845,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1590,9 +1864,23 @@ "type": "reference", "widget": "Layout" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "b''", - "help": "The media data as a byte string.", + "help": "The media data as a memory view of bytes.", "name": "value", "type": "bytes" } @@ -1600,12 +1888,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "DOMWidgetModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": null, - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1626,7 +1914,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1644,7 +1932,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1661,13 +1949,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -1688,6 +1969,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "allow_none": true, "default": null, @@ -1699,12 +1994,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "DatePickerModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "DatePickerView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1716,7 +2011,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1734,7 +2029,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1755,12 +2050,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "DescriptionStyleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -1772,7 +2067,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1790,7 +2085,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1818,12 +2113,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "DirectionalLinkModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": null, - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1844,7 +2139,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1871,7 +2166,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1888,13 +2183,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -1921,17 +2209,167 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "DropdownModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "DropdownView", - "version": "1.4.0" + "version": "1.5.0" + } + }, + { + "attributes": [ + { + "default": [], + "help": "CSS classes applied to widget DOM element", + "items": { + "type": "string" + }, + "name": "_dom_classes", + "type": "array" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_model_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_model_module_version", + "type": "string" + }, + { + "default": "FileUploadModel", + "help": "", + "name": "_model_name", + "type": "string" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_view_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_view_module_version", + "type": "string" + }, + { + "default": "FileUploadView", + "help": "", + "name": "_view_name", + "type": "string" + }, + { + "default": "", + "help": "File types to accept, empty string for all", + "name": "accept", + "type": "string" + }, + { + "default": "", + "enum": ["primary", "success", "info", "warning", "danger", ""], + "help": "Use a predefined styling for the button.", + "name": "button_style", + "type": "string" + }, + { + "default": "", + "help": "Description of the control.", + "name": "description", + "type": "string" + }, + { + "default": false, + "help": "Enable or disable button", + "name": "disabled", + "type": "bool" + }, + { + "default": "", + "help": "Error message", + "name": "error", + "type": "string" + }, + { + "default": "upload", + "help": "Font-awesome icon name, without the 'fa-' prefix.", + "name": "icon", + "type": "string" + }, + { + "default": "reference to new instance", + "help": "", + "name": "layout", + "type": "reference", + "widget": "Layout" + }, + { + "default": false, + "help": "If True, allow for multiple files upload", + "name": "multiple", + "type": "bool" + }, + { + "default": "reference to new instance", + "help": "", + "name": "style", + "type": "reference", + "widget": "ButtonStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, + { + "default": [], + "help": "The file upload value", + "name": "value", + "type": "array" + } + ], + "model": { + "module": "@jupyter-widgets/controls", + "name": "FileUploadModel", + "version": "1.5.0" + }, + "view": { + "module": "@jupyter-widgets/controls", + "name": "FileUploadView", + "version": "1.5.0" } }, { @@ -1952,7 +2390,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1970,7 +2408,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1999,13 +2437,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -2063,6 +2494,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 1.0, "help": "Float value", @@ -2073,12 +2518,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatLogSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatLogSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2099,7 +2544,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2117,7 +2562,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2142,13 +2587,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -2182,6 +2620,20 @@ "type": "reference", "widget": "ProgressStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "Float value", @@ -2192,12 +2644,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatProgressModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ProgressView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2218,7 +2670,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2236,7 +2688,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2259,13 +2711,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -2323,6 +2768,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": [0.0, 1.0], "help": "Tuple of (lower, upper) bounds", @@ -2333,12 +2792,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatRangeSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatRangeSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2359,7 +2818,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2377,7 +2836,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2400,13 +2859,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -2464,6 +2916,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "Float value", @@ -2474,12 +2940,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2500,7 +2966,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2518,7 +2984,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2535,17 +3001,10 @@ "name": "continuous_update", "type": "bool" }, - { - "default": "", - "help": "Description of the control.", - "name": "description", - "type": "string" - }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", + { + "default": "", + "help": "Description of the control.", + "name": "description", "type": "string" }, { @@ -2575,6 +3034,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "Float value", @@ -2585,12 +3058,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatTextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatTextView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2611,7 +3084,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2629,7 +3102,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2663,17 +3136,31 @@ "name": "layout", "type": "reference", "widget": "Layout" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "GridBoxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "GridBoxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2694,7 +3181,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2712,7 +3199,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2746,17 +3233,31 @@ "name": "layout", "type": "reference", "widget": "Layout" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "HBoxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "HBoxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2777,7 +3278,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2795,7 +3296,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2812,13 +3313,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -2839,6 +3333,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "", "help": "String value", @@ -2849,12 +3357,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "HTMLMathModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "HTMLMathView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2875,7 +3383,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2893,7 +3401,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2910,13 +3418,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -2937,6 +3438,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "", "help": "String value", @@ -2947,12 +3462,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "HTMLModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "HTMLView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2973,7 +3488,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2991,7 +3506,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3010,7 +3525,7 @@ }, { "default": "", - "help": "Height of the image in pixels.", + "help": "Height of the image in pixels. Use layout.height for styling the widget.", "name": "height", "type": "string" }, @@ -3021,15 +3536,29 @@ "type": "reference", "widget": "Layout" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "b''", - "help": "The media data as a byte string.", + "help": "The media data as a memory view of bytes.", "name": "value", "type": "bytes" }, { "default": "", - "help": "Width of the image in pixels.", + "help": "Width of the image in pixels. Use layout.width for styling the widget.", "name": "width", "type": "string" } @@ -3037,12 +3566,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ImageModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ImageView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3063,7 +3592,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3081,7 +3610,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3105,13 +3634,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -3145,6 +3667,20 @@ "type": "reference", "widget": "ProgressStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -3155,12 +3691,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "IntProgressModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ProgressView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3181,7 +3717,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3199,7 +3735,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3222,13 +3758,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3286,6 +3815,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": [0, 1], "help": "Tuple of (lower, upper) bounds", @@ -3296,12 +3839,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "IntRangeSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "IntRangeSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3322,7 +3865,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3340,7 +3883,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3363,13 +3906,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3427,6 +3963,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -3437,12 +3987,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "IntSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "IntSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3463,7 +4013,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3481,7 +4031,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3504,13 +4054,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3537,6 +4080,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -3547,12 +4104,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "IntTextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "IntTextView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3573,7 +4130,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3591,7 +4148,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3608,13 +4165,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -3635,6 +4185,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "", "help": "String value", @@ -3645,12 +4209,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "LabelModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "LabelView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3662,7 +4226,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3680,7 +4244,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3708,12 +4272,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "LinkModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": null, - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3734,7 +4298,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3752,7 +4316,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3775,13 +4339,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3808,6 +4365,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "", "help": "String value", @@ -3818,12 +4389,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "PasswordModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "PasswordView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3844,7 +4415,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3855,18 +4426,6 @@ "name": "_model_name", "type": "string" }, - { - "default": false, - "help": "Whether the control is currently playing.", - "name": "_playing", - "type": "bool" - }, - { - "default": false, - "help": "Whether the control will repeat in a continous loop.", - "name": "_repeat", - "type": "bool" - }, { "default": "@jupyter-widgets/controls", "help": "", @@ -3874,7 +4433,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3891,13 +4450,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3906,7 +4458,7 @@ }, { "default": 100, - "help": "The maximum value for the play control.", + "help": "The time between two animation steps (ms).", "name": "interval", "type": "int" }, @@ -3929,6 +4481,18 @@ "name": "min", "type": "int" }, + { + "default": false, + "help": "Whether the control is currently playing.", + "name": "playing", + "type": "bool" + }, + { + "default": false, + "help": "Whether the control will repeat in a continous loop.", + "name": "repeat", + "type": "bool" + }, { "default": true, "help": "Show the repeat toggle button in the widget.", @@ -3948,6 +4512,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -3958,12 +4536,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "PlayModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "PlayView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3975,7 +4553,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3993,7 +4571,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4021,12 +4599,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ProgressStyleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -4047,7 +4625,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4074,7 +4652,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4091,13 +4669,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4124,17 +4695,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "RadioButtonsModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "RadioButtonsView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4155,7 +4740,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4182,7 +4767,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4199,13 +4784,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4238,17 +4816,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "SelectModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "SelectView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4269,7 +4861,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4296,7 +4888,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4313,13 +4905,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4354,17 +4939,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "SelectMultipleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "SelectMultipleView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4385,7 +4984,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4412,7 +5011,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4435,13 +5034,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4480,17 +5072,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "SelectionRangeSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "SelectionRangeSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4511,7 +5117,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4538,7 +5144,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4561,13 +5167,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4606,17 +5205,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "SelectionSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "SelectionSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4628,7 +5241,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4646,7 +5259,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4674,12 +5287,122 @@ "model": { "module": "@jupyter-widgets/controls", "name": "SliderStyleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" + } + }, + { + "attributes": [ + { + "default": [], + "help": "CSS classes applied to widget DOM element", + "items": { + "type": "string" + }, + "name": "_dom_classes", + "type": "array" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_model_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_model_module_version", + "type": "string" + }, + { + "default": "StackedModel", + "help": "", + "name": "_model_name", + "type": "string" + }, + { + "default": {}, + "help": "Titles of the pages", + "name": "_titles", + "type": "object" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_view_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_view_module_version", + "type": "string" + }, + { + "default": "StackedView", + "help": "", + "name": "_view_name", + "type": "string" + }, + { + "default": "", + "enum": ["success", "info", "warning", "danger", ""], + "help": "Use a predefined styling for the box.", + "name": "box_style", + "type": "string" + }, + { + "default": [], + "help": "List of widget children", + "items": { + "type": "reference", + "widget": "Widget" + }, + "name": "children", + "type": "array" + }, + { + "default": "reference to new instance", + "help": "", + "name": "layout", + "type": "reference", + "widget": "Layout" + }, + { + "allow_none": true, + "default": 0, + "help": "The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected.", + "name": "selected_index", + "type": "int" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + } + ], + "model": { + "module": "@jupyter-widgets/controls", + "name": "StackedModel", + "version": "1.5.0" + }, + "view": { + "module": "@jupyter-widgets/controls", + "name": "StackedView", + "version": "1.5.0" } }, { @@ -4700,7 +5423,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4724,7 +5447,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4765,17 +5488,31 @@ "help": "The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected.", "name": "selected_index", "type": "int" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "TabModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "TabView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4796,7 +5533,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4814,7 +5551,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4837,13 +5574,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4870,6 +5600,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "", "help": "String value", @@ -4880,12 +5624,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "TextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "TextView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4906,7 +5650,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4924,7 +5668,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4947,13 +5691,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4987,6 +5724,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "", "help": "String value", @@ -4997,12 +5748,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "TextareaModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "TextareaView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5023,7 +5774,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5041,7 +5792,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5065,13 +5816,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -5099,8 +5843,16 @@ "widget": "DescriptionStyle" }, { - "default": "", - "help": "Tooltip caption of the toggle button.", + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", "name": "tooltip", "type": "string" }, @@ -5114,12 +5866,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5140,7 +5892,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5167,7 +5919,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5192,13 +5944,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -5235,6 +5980,20 @@ "type": "reference", "widget": "ToggleButtonsStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": [], "help": "Tooltips for each button.", @@ -5248,12 +6007,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonsModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonsView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5265,7 +6024,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5283,7 +6042,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5316,12 +6075,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonsStyleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -5342,7 +6101,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5360,7 +6119,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5394,17 +6153,31 @@ "name": "layout", "type": "reference", "widget": "Layout" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "VBoxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "VBoxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5425,7 +6198,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5443,7 +6216,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5460,13 +6233,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -5493,6 +6259,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": false, "help": "Bool value", @@ -5503,12 +6283,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ValidModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ValidView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5529,7 +6309,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5547,7 +6327,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5595,9 +6375,23 @@ "name": "loop", "type": "bool" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "b''", - "help": "The media data as a byte string.", + "help": "The media data as a memory view of bytes.", "name": "value", "type": "bytes" }, @@ -5611,12 +6405,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "VideoModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "VideoView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5687,6 +6481,20 @@ }, "name": "outputs", "type": "array" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 434d9e808f..159dfc62bc 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -196,13 +196,12 @@ Attribute | Type | Default | Help `_view_module_version` | string | `'1.2.0'` | `_view_name` | string | `'StyleView'` | `button_color` | `null` or string | `null` | Color of the button -`font_family` | string | `''` | Button text font family. +`font_family` | `null` or string | `null` | Button text font family. `font_size` | string | `''` | Button text font size. -`font_style` | string | `''` | Button text font style. -`font_variant` | string | `''` | Button text font variant. -`font_weight` | string | `''` | Button text font weight. +`font_variant` | `null` or string | `null` | Button text font variant. +`italic` | boolean | `false` | Button text italic. `text_color` | string | `''` | Button text color. -`text_decoration` | string | `''` | Button text decoration. +`underline` | `null` or boolean | `null` | Button text underline. ### CheckboxModel (@jupyter-widgets/controls, 1.5.0); CheckboxView (@jupyter-widgets/controls, 1.5.0) From bff07dbdcd7d310490cc38cd71e764b27a07c241 Mon Sep 17 00:00:00 2001 From: Zerline Date: Sun, 19 Jan 2020 00:05:07 +0100 Subject: [PATCH 15/24] Final schema. --- .../schema/jupyterwidgetmodels.latest.json | 22 +++++++++++++------ packages/schema/jupyterwidgetmodels.latest.md | 11 +++++----- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/packages/schema/jupyterwidgetmodels.latest.json b/packages/schema/jupyterwidgetmodels.latest.json index 259a0e76a2..1f7faa2937 100644 --- a/packages/schema/jupyterwidgetmodels.latest.json +++ b/packages/schema/jupyterwidgetmodels.latest.json @@ -1072,23 +1072,30 @@ "type": "string" }, { - "default": "@jupyter-widgets/base", + "default": "@jupyter-widgets/controls", "help": "", "name": "_view_module", "type": "string" }, { - "default": "1.2.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" }, { - "default": "StyleView", + "default": "ButtonStyleView", "help": "", "name": "_view_name", "type": "string" }, + { + "allow_none": true, + "default": null, + "help": "Button text bold.", + "name": "bold", + "type": "bool" + }, { "allow_none": true, "default": null, @@ -1117,7 +1124,8 @@ "type": "string" }, { - "default": false, + "allow_none": true, + "default": null, "help": "Button text italic.", "name": "italic", "type": "bool" @@ -1142,9 +1150,9 @@ "version": "1.5.0" }, "view": { - "module": "@jupyter-widgets/base", - "name": "StyleView", - "version": "1.2.0" + "module": "@jupyter-widgets/controls", + "name": "ButtonStyleView", + "version": "1.5.0" } }, { diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 159dfc62bc..95210ba05d 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -185,21 +185,22 @@ Attribute | Type | Default | Help `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. -### ButtonStyleModel (@jupyter-widgets/controls, 1.5.0); StyleView (@jupyter-widgets/base, 1.2.0) +### ButtonStyleModel (@jupyter-widgets/controls, 1.5.0); ButtonStyleView (@jupyter-widgets/controls, 1.5.0) Attribute | Type | Default | Help -----------------|------------------|------------------|---- `_model_module` | string | `'@jupyter-widgets/controls'` | `_model_module_version` | string | `'1.5.0'` | `_model_name` | string | `'ButtonStyleModel'` | -`_view_module` | string | `'@jupyter-widgets/base'` | -`_view_module_version` | string | `'1.2.0'` | -`_view_name` | string | `'StyleView'` | +`_view_module` | string | `'@jupyter-widgets/controls'` | +`_view_module_version` | string | `'1.5.0'` | +`_view_name` | string | `'ButtonStyleView'` | +`bold` | `null` or boolean | `null` | Button text bold. `button_color` | `null` or string | `null` | Color of the button `font_family` | `null` or string | `null` | Button text font family. `font_size` | string | `''` | Button text font size. `font_variant` | `null` or string | `null` | Button text font variant. -`italic` | boolean | `false` | Button text italic. +`italic` | `null` or boolean | `null` | Button text italic. `text_color` | string | `''` | Button text color. `underline` | `null` or boolean | `null` | Button text underline. From 2c746b49c1683b74b634230b8648d14951759c28 Mon Sep 17 00:00:00 2001 From: Zerline Date: Sun, 19 Jan 2020 00:14:52 +0100 Subject: [PATCH 16/24] This is not needed. --- packages/base/src/widget_style.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/base/src/widget_style.ts b/packages/base/src/widget_style.ts index c51d44403d..ceb26e39c8 100644 --- a/packages/base/src/widget_style.ts +++ b/packages/base/src/widget_style.ts @@ -124,9 +124,5 @@ export class StyleView extends WidgetView { }, this); } - get_traitNames(): string[] { - return this._traitNames; - } - private _traitNames: string[]; } From 966578d1a471b321957f1b70a5bf5eea247d4c49 Mon Sep 17 00:00:00 2001 From: Zerline Date: Fri, 10 Jan 2020 17:23:29 +0100 Subject: [PATCH 17/24] String widgets styling. New formatting to comply with master. --- ipywidgets/widgets/widget_string.py | 39 ++++++- packages/controls/src/widget_string.ts | 106 ++++++++++++++++- tests/test_textstyle.ipynb | 155 +++++++++++++++++++++++++ 3 files changed, 295 insertions(+), 5 deletions(-) create mode 100644 tests/test_textstyle.ipynb diff --git a/ipywidgets/widgets/widget_string.py b/ipywidgets/widgets/widget_string.py index 8c54cfcb01..8a53e78abf 100644 --- a/ipywidgets/widgets/widget_string.py +++ b/ipywidgets/widgets/widget_string.py @@ -6,15 +6,41 @@ Represents a unicode string using a widget. """ -from .widget_description import DescriptionWidget +from .widget_description import DescriptionStyle, DescriptionWidget from .valuewidget import ValueWidget -from .widget import CallbackDispatcher, register +from .widget import CallbackDispatcher, register, widget_serialization from .widget_core import CoreWidget -from .trait_types import TypedTuple +from .trait_types import Color, InstanceDict, TypedTuple from traitlets import Unicode, Bool, Int from warnings import warn +@register +class _StringStyle(DescriptionStyle, CoreWidget): + """Text input style widget.""" + _model_name = Unicode('StringStyleModel').tag(sync=True) + background_color = Color(None, allow_none=True, help="Background color").tag(sync=True) + font_size = Unicode(help="Text font size.").tag(sync=True) + text_color = Color(None, allow_none=True, help="Text color").tag(sync=True) + + +@register +class LabelStyle(_StringStyle, CoreWidget): + """Label style widget.""" + _model_name = Unicode('LabelStyleModel').tag(sync=True) + font_family = Unicode(help="Label text font family.").tag(sync=True) + font_style = Unicode(help="Label text font style.").tag(sync=True) + font_variant = Unicode(help="Label text font variant.").tag(sync=True) + font_weight = Unicode(help="Label text font weight.").tag(sync=True) + text_decoration = Unicode(help="Label text decoration.").tag(sync=True) + + +@register +class TextStyle(_StringStyle, CoreWidget): + """Text input style widget.""" + _model_name = Unicode('TextStyleModel').tag(sync=True) + + class _String(DescriptionWidget, ValueWidget, CoreWidget): """Base class used to create widgets that represent a string.""" @@ -24,7 +50,7 @@ class _String(DescriptionWidget, ValueWidget, CoreWidget): # the text, not the bottom margin. See the last paragraph of # https://www.w3.org/TR/CSS2/visudet.html#leading placeholder = Unicode('\u200b', help="Placeholder text to display when nothing has been typed").tag(sync=True) - + style = InstanceDict(_StringStyle).tag(sync=True, **widget_serialization) def __init__(self, value=None, **kwargs): if value is not None: @@ -40,6 +66,7 @@ class HTML(_String): _view_name = Unicode('HTMLView').tag(sync=True) _model_name = Unicode('HTMLModel').tag(sync=True) + @register class HTMLMath(_String): """Renders the string `value` as HTML, and render mathematics.""" @@ -56,6 +83,7 @@ class Label(_String): """ _view_name = Unicode('LabelView').tag(sync=True) _model_name = Unicode('LabelModel').tag(sync=True) + style = InstanceDict(LabelStyle).tag(sync=True, **widget_serialization) @register @@ -66,6 +94,8 @@ class Textarea(_String): rows = Int(None, allow_none=True, help="The number of rows to display.").tag(sync=True) disabled = Bool(False, help="Enable or disable user changes").tag(sync=True) continuous_update = Bool(True, help="Update the value as the user types. If False, update on submission, e.g., pressing Enter or navigating away.").tag(sync=True) + style = InstanceDict(TextStyle).tag(sync=True, **widget_serialization) + @register class Text(_String): @@ -74,6 +104,7 @@ class Text(_String): _model_name = Unicode('TextModel').tag(sync=True) disabled = Bool(False, help="Enable or disable user changes").tag(sync=True) continuous_update = Bool(True, help="Update the value as the user types. If False, update on submission, e.g., pressing Enter or navigating away.").tag(sync=True) + style = InstanceDict(TextStyle).tag(sync=True, **widget_serialization) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/packages/controls/src/widget_string.ts b/packages/controls/src/widget_string.ts index ec59eab997..c2fc039c2e 100644 --- a/packages/controls/src/widget_string.ts +++ b/packages/controls/src/widget_string.ts @@ -3,15 +3,117 @@ import { CoreDescriptionModel } from './widget_core'; -import { DescriptionView } from './widget_description'; +import { DescriptionStyleModel, DescriptionView } from './widget_description'; import { uuid } from './utils'; +import { JUPYTER_CONTROLS_VERSION } from './version'; + /** * Class name for a combobox with an invlid value. */ const INVALID_VALUE_CLASS = 'jpwidgets-invalidComboValue'; +export class StringStyleModel extends DescriptionStyleModel { + defaults(): Backbone.ObjectHash { + return { + ...super.defaults(), + _model_name: 'StringStyleModel', + _model_module: '@jupyter-widgets/controls', + _model_module_version: JUPYTER_CONTROLS_VERSION + }; + } + + public static styleProperties = { + ...DescriptionStyleModel.styleProperties, + background_color: { + selector: '', + attribute: 'background-color', + default: null as any + }, + font_size: { + selector: '', + attribute: 'font-size', + default: '' + }, + text_color: { + selector: '', + attribute: 'color', + default: '' + } + }; +} + +export class LabelStyleModel extends StringStyleModel { + defaults(): Backbone.ObjectHash { + return { + ...super.defaults(), + _model_name: 'LabelStyleModel', + _model_module: '@jupyter-widgets/controls', + _model_module_version: JUPYTER_CONTROLS_VERSION + }; + } + + public static styleProperties = { + ...StringStyleModel.styleProperties, + font_family: { + selector: '', + attribute: 'font-family', + default: '' + }, + font_style: { + selector: '', + attribute: 'font-style', + default: '' + }, + font_variant: { + selector: '', + attribute: 'font-variant', + default: '' + }, + font_weight: { + selector: '', + attribute: 'font-weight', + default: '' + }, + text_decoration: { + selector: '', + attribute: 'text-decoration', + default: '' + } + }; +} + +export class TextStyleModel extends DescriptionStyleModel { + defaults(): Backbone.ObjectHash { + return { + ...super.defaults(), + _model_name: 'TextStyleModel', + _model_module: '@jupyter-widgets/controls', + _model_module_version: JUPYTER_CONTROLS_VERSION + }; + } + + public static styleProperties = { + ...DescriptionStyleModel.styleProperties, + background_color: { + selector: '.widget-input', + attribute: 'background-color', + default: null as any + }, + font_size: { + selector: '.widget-input', + attribute: 'font-size', + default: '' + }, + text_color: { + selector: '.widget-input', + attribute: 'color', + default: '' + } + }; +} + export class StringModel extends CoreDescriptionModel { defaults(): Backbone.ObjectHash { return { @@ -193,6 +295,7 @@ export class TextareaView extends StringView { this.textbox = document.createElement('textarea'); this.textbox.setAttribute('rows', '5'); this.textbox.id = this.label.htmlFor = uuid(); + this.textbox.classList.add('widget-input'); this.el.appendChild(this.textbox); this.update(); // Set defaults. @@ -338,6 +441,7 @@ export class TextView extends StringView { this.textbox = document.createElement('input'); this.textbox.setAttribute('type', this.inputType); this.textbox.id = this.label.htmlFor = uuid(); + this.textbox.classList.add('widget-input'); this.el.appendChild(this.textbox); this.update(); // Set defaults. diff --git a/tests/test_textstyle.ipynb b/tests/test_textstyle.ipynb new file mode 100644 index 0000000000..e563f630a3 --- /dev/null +++ b/tests/test_textstyle.ipynb @@ -0,0 +1,155 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Label, HTML, Text, Textarea, Combobox, VBox" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l = Label(\"Label\")\n", + "h = HTML(\"

HTML Paragraph

\")\n", + "t = Text(\"Text input\")\n", + "ta = Textarea(\"Text area\")\n", + "c = Combobox(options=[\"First\", \"Second\"])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "VBox((l, h, t, ta, c))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l.style.background_color = \"azure\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l.style.text_color = \"midnightblue\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l.style.font_style = \"italic\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l.style.font_variant = \"small-caps\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l.style.text_decoration = \"underline\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "h.style.background_color = \"lawngreen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "t.style.text_color = \"red\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "t.style.background_color = \"lightgray\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ta.style.background_color = \"linen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ta.style.font_size = \"1.5em\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "c.style.text_color = \"purple\"" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 56c6a2f16335890f7b22dd80f08c2919722c81a7 Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 13 Jan 2020 15:00:17 +0100 Subject: [PATCH 18/24] Generate schema and remove test file. --- packages/schema/jupyterwidgetmodels.latest.md | 64 +++++++- tests/test_textstyle.ipynb | 155 ------------------ 2 files changed, 57 insertions(+), 162 deletions(-) delete mode 100644 tests/test_textstyle.ipynb diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 4b75dd3c52..308217de6b 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -256,7 +256,7 @@ Attribute | Type | Default | Help `layout` | reference to Layout widget | reference to new instance | `options` | array of string | `[]` | Dropdown options for the combobox `placeholder` | string | `'\u200b'` | Placeholder text to display when nothing has been typed -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to TextStyle widget | reference to new instance | `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | string | `''` | String value @@ -590,7 +590,7 @@ Attribute | Type | Default | Help `description` | string | `''` | Description of the control. `layout` | reference to Layout widget | reference to new instance | `placeholder` | string | `'\u200b'` | Placeholder text to display when nothing has been typed -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to _StringStyle widget | reference to new instance | `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | string | `''` | String value @@ -609,7 +609,7 @@ Attribute | Type | Default | Help `description` | string | `''` | Description of the control. `layout` | reference to Layout widget | reference to new instance | `placeholder` | string | `'\u200b'` | Placeholder text to display when nothing has been typed -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to _StringStyle widget | reference to new instance | `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | string | `''` | String value @@ -742,11 +742,31 @@ Attribute | Type | Default | Help `description` | string | `''` | Description of the control. `layout` | reference to Layout widget | reference to new instance | `placeholder` | string | `'\u200b'` | Placeholder text to display when nothing has been typed -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to LabelStyle widget | reference to new instance | `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | string | `''` | String value +### LabelStyleModel (@jupyter-widgets/controls, 1.5.0); StyleView (@jupyter-widgets/base, 1.2.0) + +Attribute | Type | Default | Help +-----------------|------------------|------------------|---- +`_model_module` | string | `'@jupyter-widgets/controls'` | +`_model_module_version` | string | `'1.5.0'` | +`_model_name` | string | `'LabelStyleModel'` | +`_view_module` | string | `'@jupyter-widgets/base'` | +`_view_module_version` | string | `'1.2.0'` | +`_view_name` | string | `'StyleView'` | +`background_color` | `null` or string | `null` | Background color +`description_width` | string | `''` | Width of the description to the side of the control. +`font_family` | string | `''` | Label text font family. +`font_size` | string | `''` | Text font size. +`font_style` | string | `''` | Label text font style. +`font_variant` | string | `''` | Label text font variant. +`font_weight` | string | `''` | Label text font weight. +`text_color` | `null` or string | `null` | Text color +`text_decoration` | string | `''` | Label text decoration. + ### LinkModel (@jupyter-widgets/controls, 1.5.0); None (@jupyter-widgets/controls, 1.5.0) Attribute | Type | Default | Help @@ -776,7 +796,7 @@ Attribute | Type | Default | Help `disabled` | boolean | `false` | Enable or disable user changes `layout` | reference to Layout widget | reference to new instance | `placeholder` | string | `'\u200b'` | Placeholder text to display when nothing has been typed -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to TextStyle widget | reference to new instance | `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | string | `''` | String value @@ -960,6 +980,21 @@ Attribute | Type | Default | Help `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. +### StringStyleModel (@jupyter-widgets/controls, 1.5.0); StyleView (@jupyter-widgets/base, 1.2.0) + +Attribute | Type | Default | Help +-----------------|------------------|------------------|---- +`_model_module` | string | `'@jupyter-widgets/controls'` | +`_model_module_version` | string | `'1.5.0'` | +`_model_name` | string | `'StringStyleModel'` | +`_view_module` | string | `'@jupyter-widgets/base'` | +`_view_module_version` | string | `'1.2.0'` | +`_view_name` | string | `'StyleView'` | +`background_color` | `null` or string | `null` | Background color +`description_width` | string | `''` | Width of the description to the side of the control. +`font_size` | string | `''` | Text font size. +`text_color` | `null` or string | `null` | Text color + ### TabModel (@jupyter-widgets/controls, 1.5.0); TabView (@jupyter-widgets/controls, 1.5.0) Attribute | Type | Default | Help @@ -995,11 +1030,26 @@ Attribute | Type | Default | Help `disabled` | boolean | `false` | Enable or disable user changes `layout` | reference to Layout widget | reference to new instance | `placeholder` | string | `'\u200b'` | Placeholder text to display when nothing has been typed -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to TextStyle widget | reference to new instance | `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | string | `''` | String value +### TextStyleModel (@jupyter-widgets/controls, 1.5.0); StyleView (@jupyter-widgets/base, 1.2.0) + +Attribute | Type | Default | Help +-----------------|------------------|------------------|---- +`_model_module` | string | `'@jupyter-widgets/controls'` | +`_model_module_version` | string | `'1.5.0'` | +`_model_name` | string | `'TextStyleModel'` | +`_view_module` | string | `'@jupyter-widgets/base'` | +`_view_module_version` | string | `'1.2.0'` | +`_view_name` | string | `'StyleView'` | +`background_color` | `null` or string | `null` | Background color +`description_width` | string | `''` | Width of the description to the side of the control. +`font_size` | string | `''` | Text font size. +`text_color` | `null` or string | `null` | Text color + ### TextareaModel (@jupyter-widgets/controls, 1.5.0); TextareaView (@jupyter-widgets/controls, 1.5.0) Attribute | Type | Default | Help @@ -1017,7 +1067,7 @@ Attribute | Type | Default | Help `layout` | reference to Layout widget | reference to new instance | `placeholder` | string | `'\u200b'` | Placeholder text to display when nothing has been typed `rows` | `null` or number (integer) | `null` | The number of rows to display. -`style` | reference to DescriptionStyle widget | reference to new instance | Styling customizations +`style` | reference to TextStyle widget | reference to new instance | `tabbable` | `null` or boolean | `null` | Is widget tabbable? `tooltip` | `null` or string | `null` | A tooltip caption. `value` | string | `''` | String value diff --git a/tests/test_textstyle.ipynb b/tests/test_textstyle.ipynb deleted file mode 100644 index e563f630a3..0000000000 --- a/tests/test_textstyle.ipynb +++ /dev/null @@ -1,155 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from ipywidgets import Label, HTML, Text, Textarea, Combobox, VBox" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l = Label(\"Label\")\n", - "h = HTML(\"

HTML Paragraph

\")\n", - "t = Text(\"Text input\")\n", - "ta = Textarea(\"Text area\")\n", - "c = Combobox(options=[\"First\", \"Second\"])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "VBox((l, h, t, ta, c))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l.style.background_color = \"azure\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l.style.text_color = \"midnightblue\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l.style.font_style = \"italic\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l.style.font_variant = \"small-caps\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l.style.text_decoration = \"underline\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "h.style.background_color = \"lawngreen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "t.style.text_color = \"red\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "t.style.background_color = \"lightgray\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ta.style.background_color = \"linen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ta.style.font_size = \"1.5em\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "c.style.text_color = \"purple\"" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 00809f315085bb3b1f9e3de596fa08573d2a8af5 Mon Sep 17 00:00:00 2001 From: Zerline Date: Tue, 21 Jan 2020 19:37:06 +0100 Subject: [PATCH 19/24] Removing font-variant. Not sure what to do. --- ipywidgets/widgets/widget_button.py | 1 - packages/controls/src/widget_button.ts | 5 ----- packages/schema/jupyterwidgetmodels.latest.json | 7 ------- packages/schema/jupyterwidgetmodels.latest.md | 1 - 4 files changed, 14 deletions(-) diff --git a/ipywidgets/widgets/widget_button.py b/ipywidgets/widgets/widget_button.py index b40cce68b9..0403077195 100644 --- a/ipywidgets/widgets/widget_button.py +++ b/ipywidgets/widgets/widget_button.py @@ -29,7 +29,6 @@ class ButtonStyle(Style, CoreWidget): button_color = Color(None, allow_none=True, help="Color of the button").tag(sync=True) font_family = Unicode(None, allow_none=True, help="Button text font family.").tag(sync=True) font_size = Unicode(help="Button text font size.").tag(sync=True) - font_variant = Unicode(None, allow_none=True, help="Button text font variant.").tag(sync=True) italic = Bool(None, allow_none=True, help="Button text italic.").tag(sync=True) text_color = Unicode(help="Button text color.").tag(sync=True) underline = Bool(None, allow_none=True, help="Button text underline.").tag(sync=True) diff --git a/packages/controls/src/widget_button.ts b/packages/controls/src/widget_button.ts index 1a430c27ae..be93691a02 100644 --- a/packages/controls/src/widget_button.ts +++ b/packages/controls/src/widget_button.ts @@ -64,11 +64,6 @@ export class ButtonStyleModel extends StyleModel { attribute: 'font-style', default: '' }, - font_variant: { - selector: '', - attribute: 'font-variant', - default: '' - }, text_color: { selector: '', attribute: 'color', diff --git a/packages/schema/jupyterwidgetmodels.latest.json b/packages/schema/jupyterwidgetmodels.latest.json index 1f7faa2937..26190cd75c 100644 --- a/packages/schema/jupyterwidgetmodels.latest.json +++ b/packages/schema/jupyterwidgetmodels.latest.json @@ -1116,13 +1116,6 @@ "name": "font_size", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Button text font variant.", - "name": "font_variant", - "type": "string" - }, { "allow_none": true, "default": null, diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 95210ba05d..6688115c46 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -199,7 +199,6 @@ Attribute | Type | Default | Help `button_color` | `null` or string | `null` | Color of the button `font_family` | `null` or string | `null` | Button text font family. `font_size` | string | `''` | Button text font size. -`font_variant` | `null` or string | `null` | Button text font variant. `italic` | `null` or boolean | `null` | Button text italic. `text_color` | string | `''` | Button text color. `underline` | `null` or boolean | `null` | Button text underline. From f88ad8791f911128371a9d147a2046ce6abc3146 Mon Sep 17 00:00:00 2001 From: Zerline Date: Wed, 22 Jan 2020 20:18:59 +0100 Subject: [PATCH 20/24] Our 3 CSS adapting functions better located in widget_style. --- packages/base/src/widget_style.ts | 20 +++++++++++++++++++ packages/controls/src/widget_button.ts | 27 ++++++++------------------ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/packages/base/src/widget_style.ts b/packages/base/src/widget_style.ts index ceb26e39c8..8d5c749aa4 100644 --- a/packages/base/src/widget_style.ts +++ b/packages/base/src/widget_style.ts @@ -5,6 +5,26 @@ import { assign } from './utils'; import { WidgetModel, WidgetView, DOMWidgetView } from './widget'; +/** + * Three functions to deal with some CSS attributes + * to make them easier to use. + */ +export function bold_to_weight(value: boolean): string | null { + if (value == true) return 'bold'; + if (value == false) return 'normal'; + return null; +} +export function italic_to_style(value: boolean): string | null { + if (value == true) return 'italic'; + if (value == false) return 'normal'; + return null; +} +export function underline_to_decoration(value: boolean): string | null { + if (value == true) return 'underline'; + if (value == false) return 'none'; + return null; +} + export class StyleModel extends WidgetModel { defaults(): Backbone.ObjectHash { const Derived = this.constructor as typeof StyleModel; diff --git a/packages/controls/src/widget_button.ts b/packages/controls/src/widget_button.ts index be93691a02..53c9dd9fa1 100644 --- a/packages/controls/src/widget_button.ts +++ b/packages/controls/src/widget_button.ts @@ -1,30 +1,19 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -import { DOMWidgetView, StyleModel, StyleView } from '@jupyter-widgets/base'; +import { + DOMWidgetView, + StyleModel, + StyleView, + bold_to_weight, + italic_to_style, + underline_to_decoration +} from '@jupyter-widgets/base'; import { CoreDOMWidgetModel } from './widget_core'; import { JUPYTER_CONTROLS_VERSION } from './version'; -export function bold_to_weight(value: boolean): string | null { - if (value == true) return 'bold'; - if (value == false) return 'normal'; - return null; -} - -export function italic_to_style(value: boolean): string | null { - if (value == true) return 'italic'; - if (value == false) return 'normal'; - return null; -} - -export function underline_to_decoration(value: boolean): string | null { - if (value == true) return 'underline'; - if (value == false) return 'none'; - return null; -} - export class ButtonStyleModel extends StyleModel { defaults(): Backbone.ObjectHash { return { From 063ad4fc6d75471711f5dd4754f68add0f7438f0 Mon Sep 17 00:00:00 2001 From: Zerline Date: Wed, 22 Jan 2020 20:45:29 +0100 Subject: [PATCH 21/24] Use 'bold', 'italic' and 'underline' booleans. --- ipywidgets/widgets/widget_string.py | 11 +- packages/base/src/widget_style.ts | 19 + packages/controls/src/widget_string.ts | 68 +- .../schema/jupyterwidgetmodels.latest.json | 2146 ++++++++++++----- packages/schema/jupyterwidgetmodels.latest.md | 15 +- tests/test_textstyle.ipynb | 146 ++ 6 files changed, 1822 insertions(+), 583 deletions(-) create mode 100644 tests/test_textstyle.ipynb diff --git a/ipywidgets/widgets/widget_string.py b/ipywidgets/widgets/widget_string.py index 8a53e78abf..4060c9d343 100644 --- a/ipywidgets/widgets/widget_string.py +++ b/ipywidgets/widgets/widget_string.py @@ -11,6 +11,7 @@ from .widget import CallbackDispatcher, register, widget_serialization from .widget_core import CoreWidget from .trait_types import Color, InstanceDict, TypedTuple +from .._version import __jupyter_widgets_controls_version__ from traitlets import Unicode, Bool, Int from warnings import warn @@ -28,11 +29,13 @@ class _StringStyle(DescriptionStyle, CoreWidget): class LabelStyle(_StringStyle, CoreWidget): """Label style widget.""" _model_name = Unicode('LabelStyleModel').tag(sync=True) + _view_name = Unicode('LabelStyleView').tag(sync=True) + _view_module = Unicode('@jupyter-widgets/controls').tag(sync=True) + _view_module_version = Unicode(__jupyter_widgets_controls_version__).tag(sync=True) + bold = Bool(None, allow_none=True, help="Label text bold.").tag(sync=True) font_family = Unicode(help="Label text font family.").tag(sync=True) - font_style = Unicode(help="Label text font style.").tag(sync=True) - font_variant = Unicode(help="Label text font variant.").tag(sync=True) - font_weight = Unicode(help="Label text font weight.").tag(sync=True) - text_decoration = Unicode(help="Label text decoration.").tag(sync=True) + italic = Bool(None, allow_none=True, help="Label text italic.").tag(sync=True) + underline = Bool(None, allow_none=True, help="Label text underline.").tag(sync=True) @register diff --git a/packages/base/src/widget_style.ts b/packages/base/src/widget_style.ts index ceb26e39c8..8ecf26f3ef 100644 --- a/packages/base/src/widget_style.ts +++ b/packages/base/src/widget_style.ts @@ -5,6 +5,25 @@ import { assign } from './utils'; import { WidgetModel, WidgetView, DOMWidgetView } from './widget'; +/** + * Three functions to adapt CSS attributes and make them easier to use. + */ +export function bold_to_weight(value: boolean): string | null { + if (value == true) return 'bold'; + if (value == false) return 'normal'; + return null; +} +export function italic_to_style(value: boolean): string | null { + if (value == true) return 'italic'; + if (value == false) return 'normal'; + return null; +} +export function underline_to_decoration(value: boolean): string | null { + if (value == true) return 'underline'; + if (value == false) return 'none'; + return null; +} + export class StyleModel extends WidgetModel { defaults(): Backbone.ObjectHash { const Derived = this.constructor as typeof StyleModel; diff --git a/packages/controls/src/widget_string.ts b/packages/controls/src/widget_string.ts index c2fc039c2e..941ac5bbe4 100644 --- a/packages/controls/src/widget_string.ts +++ b/packages/controls/src/widget_string.ts @@ -3,6 +3,15 @@ import { CoreDescriptionModel } from './widget_core'; +import { + DOMWidgetView, + StyleModel, + StyleView, + bold_to_weight, + italic_to_style, + underline_to_decoration +} from '@jupyter-widgets/base'; + import { DescriptionStyleModel, DescriptionView } from './widget_description'; import { uuid } from './utils'; @@ -50,33 +59,31 @@ export class LabelStyleModel extends StringStyleModel { ...super.defaults(), _model_name: 'LabelStyleModel', _model_module: '@jupyter-widgets/controls', - _model_module_version: JUPYTER_CONTROLS_VERSION + _model_module_version: JUPYTER_CONTROLS_VERSION, + _view_name: 'LabelStyleView', + _view_module: '@jupyter-widgets/controls', + _view_module_version: JUPYTER_CONTROLS_VERSION }; } public static styleProperties = { ...StringStyleModel.styleProperties, - font_family: { - selector: '', - attribute: 'font-family', - default: '' - }, - font_style: { + bold: { selector: '', - attribute: 'font-style', + attribute: 'font-weight', default: '' }, - font_variant: { + font_family: { selector: '', - attribute: 'font-variant', + attribute: 'font-family', default: '' }, - font_weight: { + italic: { selector: '', - attribute: 'font-weight', + attribute: 'font-style', default: '' }, - text_decoration: { + underline: { selector: '', attribute: 'text-decoration', default: '' @@ -84,6 +91,41 @@ export class LabelStyleModel extends StringStyleModel { }; } +export class LabelStyleView extends StyleView { + /** + * Handles when a trait value changes + */ + handleChange(trait: string, value: any): void { + // should be synchronous so that we can measure later. + const parent = this.options.parent as DOMWidgetView; + if (parent) { + const ModelType = this.model.constructor as typeof StyleModel; + const styleProperties = ModelType.styleProperties; + const attribute = styleProperties[trait].attribute; + const selector = styleProperties[trait].selector; + const elements = selector + ? parent.el.querySelectorAll(selector) + : [parent.el]; + let adapter = undefined; + if (trait == 'bold') adapter = bold_to_weight; + if (trait == 'italic') adapter = italic_to_style; + if (trait == 'underline') adapter = underline_to_decoration; + if (adapter !== undefined) value = adapter(value); + if (value === null) { + for (let i = 0; i !== elements.length; ++i) { + elements[i].style.removeProperty(attribute); + } + } else { + for (let i = 0; i !== elements.length; ++i) { + elements[i].style.setProperty(attribute, value); + } + } + } else { + console.warn('Style not applied because a parent view does not exist'); + } + } +} + export class TextStyleModel extends DescriptionStyleModel { defaults(): Backbone.ObjectHash { return { diff --git a/packages/schema/jupyterwidgetmodels.latest.json b/packages/schema/jupyterwidgetmodels.latest.json index d84d7c19f3..e9e2f454a0 100644 --- a/packages/schema/jupyterwidgetmodels.latest.json +++ b/packages/schema/jupyterwidgetmodels.latest.json @@ -8,7 +8,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "A semver requirement for namespace version containing the model.", "name": "_model_module_version", "type": "string" @@ -26,7 +26,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -229,6 +229,21 @@ "name": "justify_content", "type": "string" }, + { + "allow_none": true, + "default": null, + "enum": [ + "flex-start", + "flex-end", + "center", + "inherit", + "initial", + "unset" + ], + "help": "The justify-items CSS attribute.", + "name": "justify_items", + "type": "string" + }, { "allow_none": true, "default": null, @@ -274,56 +289,30 @@ { "allow_none": true, "default": null, - "help": "The order CSS attribute.", - "name": "order", + "enum": ["contain", "cover", "fill", "scale-down", "none"], + "help": "The object-fit CSS attribute.", + "name": "object_fit", "type": "string" }, { "allow_none": true, "default": null, - "enum": [ - "visible", - "hidden", - "scroll", - "auto", - "inherit", - "initial", - "unset" - ], - "help": "The overflow CSS attribute.", - "name": "overflow", + "help": "The object-position CSS attribute.", + "name": "object_position", "type": "string" }, { "allow_none": true, "default": null, - "enum": [ - "visible", - "hidden", - "scroll", - "auto", - "inherit", - "initial", - "unset" - ], - "help": "The overflow-x CSS attribute.", - "name": "overflow_x", + "help": "The order CSS attribute.", + "name": "order", "type": "string" }, { "allow_none": true, "default": null, - "enum": [ - "visible", - "hidden", - "scroll", - "auto", - "inherit", - "initial", - "unset" - ], - "help": "The overflow-y CSS attribute.", - "name": "overflow_y", + "help": "The overflow CSS attribute.", + "name": "overflow", "type": "string" }, { @@ -366,12 +355,12 @@ "model": { "module": "@jupyter-widgets/base", "name": "LayoutModel", - "version": "1.1.0" + "version": "1.2.0" }, "view": { "module": "@jupyter-widgets/base", "name": "LayoutView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -392,7 +381,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -416,7 +405,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -457,17 +446,31 @@ "help": "The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected.", "name": "selected_index", "type": "int" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "AccordionModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "AccordionView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -488,7 +491,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -506,7 +509,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -548,9 +551,23 @@ "name": "loop", "type": "bool" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "b''", - "help": "The media data as a byte string.", + "help": "The media data as a memory view of bytes.", "name": "value", "type": "bytes" } @@ -558,12 +575,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "AudioModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "AudioView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -584,7 +601,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -602,7 +619,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -625,13 +642,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -671,6 +681,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "Float value", @@ -681,12 +705,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "BoundedFloatTextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatTextView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -707,7 +731,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -725,7 +749,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -748,13 +772,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -793,6 +810,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -803,12 +834,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "BoundedIntTextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "IntTextView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -829,7 +860,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -847,7 +878,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -881,17 +912,31 @@ "name": "layout", "type": "reference", "widget": "Layout" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "BoxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "BoxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -912,7 +957,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -930,7 +975,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -962,7 +1007,7 @@ }, { "default": "", - "help": "Font-awesome icon name, without the 'fa-' prefix.", + "help": "Font-awesome icon names, without the 'fa-' prefix.", "name": "icon", "type": "string" }, @@ -981,8 +1026,16 @@ "widget": "ButtonStyle" }, { - "default": "", - "help": "Tooltip caption of the button.", + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", "name": "tooltip", "type": "string" } @@ -990,12 +1043,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ButtonModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ButtonView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1007,7 +1060,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1025,7 +1078,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1053,12 +1106,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ButtonStyleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -1079,7 +1132,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1097,7 +1150,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1114,13 +1167,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -1147,6 +1193,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": false, "help": "Bool value", @@ -1157,12 +1217,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "CheckboxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "CheckboxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1183,7 +1243,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1201,7 +1261,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1224,13 +1284,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -1251,6 +1304,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "black", "help": "The color value.", @@ -1261,12 +1328,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ColorPickerModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ColorPickerView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1287,13 +1354,13 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" }, { - "default": "ControllerAxisModel", + "default": "ComboboxModel", "help": "", "name": "_model_name", "type": "string" @@ -1305,17 +1372,41 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" }, { - "default": "ControllerAxisView", + "default": "ComboboxView", "help": "", "name": "_view_name", "type": "string" }, + { + "default": true, + "help": "Update the value as the user types. If False, update on submission, e.g., pressing Enter or navigating away.", + "name": "continuous_update", + "type": "bool" + }, + { + "default": "", + "help": "Description of the control.", + "name": "description", + "type": "string" + }, + { + "default": false, + "help": "Enable or disable user changes", + "name": "disabled", + "type": "bool" + }, + { + "default": false, + "help": "If set, ensure value is in options. Implies continuous_update=False.", + "name": "ensure_option", + "type": "bool" + }, { "default": "reference to new instance", "help": "", @@ -1324,21 +1415,57 @@ "widget": "Layout" }, { - "default": 0.0, - "help": "The value of the axis.", + "default": [], + "help": "Dropdown options for the combobox", + "items": { + "type": "string" + }, + "name": "options", + "type": "array" + }, + { + "default": "\u200b", + "help": "Placeholder text to display when nothing has been typed", + "name": "placeholder", + "type": "string" + }, + { + "default": "reference to new instance", + "help": "", + "name": "style", + "type": "reference", + "widget": "TextStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, + { + "default": "", + "help": "String value", "name": "value", - "type": "float" + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", - "name": "ControllerAxisModel", - "version": "1.4.0" + "name": "ComboboxModel", + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", - "name": "ControllerAxisView", - "version": "1.4.0" + "name": "ComboboxView", + "version": "1.5.0" } }, { @@ -1359,13 +1486,13 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" }, { - "default": "ControllerButtonModel", + "default": "ControllerAxisModel", "help": "", "name": "_model_name", "type": "string" @@ -1377,13 +1504,13 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" }, { - "default": "ControllerButtonView", + "default": "ControllerAxisView", "help": "", "name": "_view_name", "type": "string" @@ -1396,27 +1523,35 @@ "widget": "Layout" }, { - "default": false, - "help": "Whether the button is pressed.", - "name": "pressed", + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", "type": "bool" }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, - "help": "The value of the button.", + "help": "The value of the axis.", "name": "value", "type": "float" } ], "model": { "module": "@jupyter-widgets/controls", - "name": "ControllerButtonModel", - "version": "1.4.0" + "name": "ControllerAxisModel", + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", - "name": "ControllerButtonView", - "version": "1.4.0" + "name": "ControllerAxisView", + "version": "1.5.0" } }, { @@ -1437,13 +1572,13 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" }, { - "default": "ControllerModel", + "default": "ControllerButtonModel", "help": "", "name": "_model_name", "type": "string" @@ -1455,40 +1590,132 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" }, { - "default": "ControllerView", + "default": "ControllerButtonView", "help": "", "name": "_view_name", "type": "string" }, { - "default": [], - "help": "The axes on the gamepad.", - "items": { - "type": "reference", - "widget": "Axis" - }, - "name": "axes", - "type": "array" - }, - { - "default": [], - "help": "The buttons on the gamepad.", - "items": { - "type": "reference", - "widget": "Button" - }, - "name": "buttons", - "type": "array" + "default": "reference to new instance", + "help": "", + "name": "layout", + "type": "reference", + "widget": "Layout" }, { "default": false, - "help": "Whether the gamepad is connected.", + "help": "Whether the button is pressed.", + "name": "pressed", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, + { + "default": 0.0, + "help": "The value of the button.", + "name": "value", + "type": "float" + } + ], + "model": { + "module": "@jupyter-widgets/controls", + "name": "ControllerButtonModel", + "version": "1.5.0" + }, + "view": { + "module": "@jupyter-widgets/controls", + "name": "ControllerButtonView", + "version": "1.5.0" + } + }, + { + "attributes": [ + { + "default": [], + "help": "CSS classes applied to widget DOM element", + "items": { + "type": "string" + }, + "name": "_dom_classes", + "type": "array" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_model_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_model_module_version", + "type": "string" + }, + { + "default": "ControllerModel", + "help": "", + "name": "_model_name", + "type": "string" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_view_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_view_module_version", + "type": "string" + }, + { + "default": "ControllerView", + "help": "", + "name": "_view_name", + "type": "string" + }, + { + "default": [], + "help": "The axes on the gamepad.", + "items": { + "type": "reference", + "widget": "Axis" + }, + "name": "axes", + "type": "array" + }, + { + "default": [], + "help": "The buttons on the gamepad.", + "items": { + "type": "reference", + "widget": "Button" + }, + "name": "buttons", + "type": "array" + }, + { + "default": false, + "help": "Whether the gamepad is connected.", "name": "connected", "type": "bool" }, @@ -1517,22 +1744,36 @@ "name": "name", "type": "string" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, { "default": 0.0, "help": "The last time the data from this gamepad was updated.", "name": "timestamp", "type": "float" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "ControllerModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ControllerView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1553,7 +1794,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1571,7 +1812,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1590,9 +1831,23 @@ "type": "reference", "widget": "Layout" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "b''", - "help": "The media data as a byte string.", + "help": "The media data as a memory view of bytes.", "name": "value", "type": "bytes" } @@ -1600,12 +1855,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "DOMWidgetModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": null, - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1626,7 +1881,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1644,7 +1899,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1661,13 +1916,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -1688,6 +1936,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "allow_none": true, "default": null, @@ -1699,12 +1961,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "DatePickerModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "DatePickerView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1716,7 +1978,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1734,7 +1996,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1755,12 +2017,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "DescriptionStyleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -1772,7 +2034,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1790,7 +2052,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1818,12 +2080,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "DirectionalLinkModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": null, - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1844,7 +2106,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1871,7 +2133,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1888,13 +2150,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -1921,17 +2176,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "DropdownModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "DropdownView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -1952,7 +2221,143 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", + "help": "", + "name": "_model_module_version", + "type": "string" + }, + { + "default": "FileUploadModel", + "help": "", + "name": "_model_name", + "type": "string" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_view_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_view_module_version", + "type": "string" + }, + { + "default": "FileUploadView", + "help": "", + "name": "_view_name", + "type": "string" + }, + { + "default": "", + "help": "File types to accept, empty string for all", + "name": "accept", + "type": "string" + }, + { + "default": "", + "enum": ["primary", "success", "info", "warning", "danger", ""], + "help": "Use a predefined styling for the button.", + "name": "button_style", + "type": "string" + }, + { + "default": "", + "help": "Description of the control.", + "name": "description", + "type": "string" + }, + { + "default": false, + "help": "Enable or disable button", + "name": "disabled", + "type": "bool" + }, + { + "default": "", + "help": "Error message", + "name": "error", + "type": "string" + }, + { + "default": "upload", + "help": "Font-awesome icon name, without the 'fa-' prefix.", + "name": "icon", + "type": "string" + }, + { + "default": "reference to new instance", + "help": "", + "name": "layout", + "type": "reference", + "widget": "Layout" + }, + { + "default": false, + "help": "If True, allow for multiple files upload", + "name": "multiple", + "type": "bool" + }, + { + "default": "reference to new instance", + "help": "", + "name": "style", + "type": "reference", + "widget": "ButtonStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, + { + "default": [], + "help": "The file upload value", + "name": "value", + "type": "array" + } + ], + "model": { + "module": "@jupyter-widgets/controls", + "name": "FileUploadModel", + "version": "1.5.0" + }, + "view": { + "module": "@jupyter-widgets/controls", + "name": "FileUploadView", + "version": "1.5.0" + } + }, + { + "attributes": [ + { + "default": [], + "help": "CSS classes applied to widget DOM element", + "items": { + "type": "string" + }, + "name": "_dom_classes", + "type": "array" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_model_module", + "type": "string" + }, + { + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -1970,7 +2375,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -1999,13 +2404,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -2063,6 +2461,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 1.0, "help": "Float value", @@ -2073,12 +2485,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatLogSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatLogSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2099,7 +2511,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2117,7 +2529,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2142,13 +2554,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -2182,6 +2587,20 @@ "type": "reference", "widget": "ProgressStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "Float value", @@ -2192,12 +2611,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatProgressModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ProgressView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2218,7 +2637,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2236,7 +2655,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2259,13 +2678,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -2323,6 +2735,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": [0.0, 1.0], "help": "Tuple of (lower, upper) bounds", @@ -2333,12 +2759,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatRangeSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatRangeSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2359,7 +2785,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2377,7 +2803,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2400,13 +2826,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -2464,6 +2883,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "Float value", @@ -2474,12 +2907,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2500,7 +2933,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2518,7 +2951,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2541,13 +2974,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -2575,6 +3001,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0.0, "help": "Float value", @@ -2585,12 +3025,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "FloatTextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "FloatTextView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2611,7 +3051,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2629,7 +3069,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2663,17 +3103,31 @@ "name": "layout", "type": "reference", "widget": "Layout" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "GridBoxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "GridBoxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2694,7 +3148,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2712,7 +3166,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2741,22 +3195,36 @@ "type": "array" }, { - "default": "reference to new instance", - "help": "", - "name": "layout", - "type": "reference", - "widget": "Layout" + "default": "reference to new instance", + "help": "", + "name": "layout", + "type": "reference", + "widget": "Layout" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "HBoxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "HBoxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2777,7 +3245,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2795,7 +3263,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2812,13 +3280,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -2834,10 +3295,24 @@ }, { "default": "reference to new instance", - "help": "Styling customizations", + "help": "", "name": "style", "type": "reference", - "widget": "DescriptionStyle" + "widget": "_StringStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" }, { "default": "", @@ -2849,12 +3324,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "HTMLMathModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "HTMLMathView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2875,7 +3350,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2893,7 +3368,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -2910,13 +3385,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -2932,10 +3400,24 @@ }, { "default": "reference to new instance", - "help": "Styling customizations", + "help": "", "name": "style", "type": "reference", - "widget": "DescriptionStyle" + "widget": "_StringStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" }, { "default": "", @@ -2947,12 +3429,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "HTMLModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "HTMLView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -2973,7 +3455,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -2991,7 +3473,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3010,7 +3492,7 @@ }, { "default": "", - "help": "Height of the image in pixels.", + "help": "Height of the image in pixels. Use layout.height for styling the widget.", "name": "height", "type": "string" }, @@ -3021,15 +3503,29 @@ "type": "reference", "widget": "Layout" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "b''", - "help": "The media data as a byte string.", + "help": "The media data as a memory view of bytes.", "name": "value", "type": "bytes" }, { "default": "", - "help": "Width of the image in pixels.", + "help": "Width of the image in pixels. Use layout.width for styling the widget.", "name": "width", "type": "string" } @@ -3037,12 +3533,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ImageModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ImageView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3063,7 +3559,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3081,7 +3577,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3105,13 +3601,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -3145,6 +3634,20 @@ "type": "reference", "widget": "ProgressStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -3155,12 +3658,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "IntProgressModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ProgressView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3181,7 +3684,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3199,7 +3702,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3222,13 +3725,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3286,6 +3782,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": [0, 1], "help": "Tuple of (lower, upper) bounds", @@ -3296,12 +3806,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "IntRangeSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "IntRangeSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3322,7 +3832,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3340,7 +3850,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3363,13 +3873,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3427,6 +3930,20 @@ "type": "reference", "widget": "SliderStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -3437,12 +3954,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "IntSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "IntSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3463,7 +3980,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3481,7 +3998,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3504,13 +4021,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3537,6 +4047,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -3547,12 +4071,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "IntTextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "IntTextView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3573,7 +4097,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3591,7 +4115,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3608,13 +4132,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": "reference to new instance", "help": "", @@ -3630,10 +4147,24 @@ }, { "default": "reference to new instance", - "help": "Styling customizations", + "help": "", "name": "style", "type": "reference", - "widget": "DescriptionStyle" + "widget": "LabelStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" }, { "default": "", @@ -3645,12 +4176,115 @@ "model": { "module": "@jupyter-widgets/controls", "name": "LabelModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "LabelView", - "version": "1.4.0" + "version": "1.5.0" + } + }, + { + "attributes": [ + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_model_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_model_module_version", + "type": "string" + }, + { + "default": "LabelStyleModel", + "help": "", + "name": "_model_name", + "type": "string" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_view_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_view_module_version", + "type": "string" + }, + { + "default": "LabelStyleView", + "help": "", + "name": "_view_name", + "type": "string" + }, + { + "allow_none": true, + "default": null, + "help": "Background color", + "name": "background_color", + "type": "string" + }, + { + "allow_none": true, + "default": null, + "help": "Label text bold.", + "name": "bold", + "type": "bool" + }, + { + "default": "", + "help": "Width of the description to the side of the control.", + "name": "description_width", + "type": "string" + }, + { + "default": "", + "help": "Label text font family.", + "name": "font_family", + "type": "string" + }, + { + "default": "", + "help": "Text font size.", + "name": "font_size", + "type": "string" + }, + { + "allow_none": true, + "default": null, + "help": "Label text italic.", + "name": "italic", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "Text color", + "name": "text_color", + "type": "string" + }, + { + "allow_none": true, + "default": null, + "help": "Label text underline.", + "name": "underline", + "type": "bool" + } + ], + "model": { + "module": "@jupyter-widgets/controls", + "name": "LabelStyleModel", + "version": "1.5.0" + }, + "view": { + "module": "@jupyter-widgets/controls", + "name": "LabelStyleView", + "version": "1.5.0" } }, { @@ -3662,7 +4296,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3680,7 +4314,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3708,12 +4342,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "LinkModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": null, - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3734,7 +4368,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3752,7 +4386,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3775,13 +4409,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3803,10 +4430,24 @@ }, { "default": "reference to new instance", - "help": "Styling customizations", + "help": "", "name": "style", "type": "reference", - "widget": "DescriptionStyle" + "widget": "TextStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" }, { "default": "", @@ -3818,12 +4459,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "PasswordModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "PasswordView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3844,28 +4485,16 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" }, { - "default": "PlayModel", - "help": "", - "name": "_model_name", - "type": "string" - }, - { - "default": false, - "help": "Whether the control is currently playing.", - "name": "_playing", - "type": "bool" - }, - { - "default": false, - "help": "Whether the control will repeat in a continous loop.", - "name": "_repeat", - "type": "bool" + "default": "PlayModel", + "help": "", + "name": "_model_name", + "type": "string" }, { "default": "@jupyter-widgets/controls", @@ -3874,7 +4503,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -3891,13 +4520,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -3906,7 +4528,7 @@ }, { "default": 100, - "help": "The maximum value for the play control.", + "help": "The time between two animation steps (ms).", "name": "interval", "type": "int" }, @@ -3929,6 +4551,18 @@ "name": "min", "type": "int" }, + { + "default": false, + "help": "Whether the control is currently playing.", + "name": "playing", + "type": "bool" + }, + { + "default": false, + "help": "Whether the control will repeat in a continous loop.", + "name": "repeat", + "type": "bool" + }, { "default": true, "help": "Show the repeat toggle button in the widget.", @@ -3948,6 +4582,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": 0, "help": "Int value", @@ -3958,12 +4606,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "PlayModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "PlayView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -3975,7 +4623,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -3993,7 +4641,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4021,12 +4669,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ProgressStyleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -4047,7 +4695,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4074,7 +4722,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4091,13 +4739,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4124,17 +4765,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "RadioButtonsModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "RadioButtonsView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4155,7 +4810,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4182,7 +4837,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4199,13 +4854,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4238,17 +4886,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "SelectModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "SelectView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4269,7 +4931,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4296,7 +4958,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4313,13 +4975,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4354,17 +5009,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "SelectMultipleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "SelectMultipleView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4385,7 +5054,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4412,7 +5081,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4435,13 +5104,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4480,17 +5142,31 @@ "name": "style", "type": "reference", "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "SelectionRangeSliderModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "SelectionRangeSliderView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4511,7 +5187,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4538,7 +5214,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4562,23 +5238,202 @@ "type": "string" }, { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", + "default": false, + "help": "Enable or disable user changes", + "name": "disabled", + "type": "bool" + }, + { + "default": 0, + "help": "Selected index", + "name": "index", + "type": "int" + }, + { + "default": "reference to new instance", + "help": "", + "name": "layout", + "type": "reference", + "widget": "Layout" + }, + { + "default": "horizontal", + "enum": ["horizontal", "vertical"], + "help": "Vertical or horizontal.", + "name": "orientation", + "type": "string" + }, + { + "default": true, + "help": "Display the current selected label next to the slider", + "name": "readout", + "type": "bool" + }, + { + "default": "reference to new instance", + "help": "Styling customizations", + "name": "style", + "type": "reference", + "widget": "DescriptionStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + } + ], + "model": { + "module": "@jupyter-widgets/controls", + "name": "SelectionSliderModel", + "version": "1.5.0" + }, + "view": { + "module": "@jupyter-widgets/controls", + "name": "SelectionSliderView", + "version": "1.5.0" + } + }, + { + "attributes": [ + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_model_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_model_module_version", + "type": "string" + }, + { + "default": "SliderStyleModel", + "help": "", + "name": "_model_name", + "type": "string" + }, + { + "default": "@jupyter-widgets/base", + "help": "", + "name": "_view_module", + "type": "string" + }, + { + "default": "1.2.0", + "help": "", + "name": "_view_module_version", + "type": "string" + }, + { + "default": "StyleView", + "help": "", + "name": "_view_name", + "type": "string" + }, + { + "default": "", + "help": "Width of the description to the side of the control.", + "name": "description_width", + "type": "string" + }, + { + "allow_none": true, + "default": null, + "help": "Color of the slider handle.", + "name": "handle_color", + "type": "string" + } + ], + "model": { + "module": "@jupyter-widgets/controls", + "name": "SliderStyleModel", + "version": "1.5.0" + }, + "view": { + "module": "@jupyter-widgets/base", + "name": "StyleView", + "version": "1.2.0" + } + }, + { + "attributes": [ + { + "default": [], + "help": "CSS classes applied to widget DOM element", + "items": { + "type": "string" + }, + "name": "_dom_classes", + "type": "array" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_model_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_model_module_version", + "type": "string" + }, + { + "default": "StackedModel", + "help": "", + "name": "_model_name", + "type": "string" + }, + { + "default": {}, + "help": "Titles of the pages", + "name": "_titles", + "type": "object" + }, + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_view_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_view_module_version", + "type": "string" + }, + { + "default": "StackedView", + "help": "", + "name": "_view_name", "type": "string" }, { - "default": false, - "help": "Enable or disable user changes", - "name": "disabled", - "type": "bool" + "default": "", + "enum": ["success", "info", "warning", "danger", ""], + "help": "Use a predefined styling for the box.", + "name": "box_style", + "type": "string" }, { - "default": 0, - "help": "Selected index", - "name": "index", - "type": "int" + "default": [], + "help": "List of widget children", + "items": { + "type": "reference", + "widget": "Widget" + }, + "name": "children", + "type": "array" }, { "default": "reference to new instance", @@ -4588,35 +5443,36 @@ "widget": "Layout" }, { - "default": "horizontal", - "enum": ["horizontal", "vertical"], - "help": "Vertical or horizontal.", - "name": "orientation", - "type": "string" + "allow_none": true, + "default": 0, + "help": "The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected.", + "name": "selected_index", + "type": "int" }, { - "default": true, - "help": "Display the current selected label next to the slider", - "name": "readout", + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", "type": "bool" }, { - "default": "reference to new instance", - "help": "Styling customizations", - "name": "style", - "type": "reference", - "widget": "DescriptionStyle" + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", - "name": "SelectionSliderModel", - "version": "1.4.0" + "name": "StackedModel", + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", - "name": "SelectionSliderView", - "version": "1.4.0" + "name": "StackedView", + "version": "1.5.0" } }, { @@ -4628,13 +5484,13 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" }, { - "default": "SliderStyleModel", + "default": "StringStyleModel", "help": "", "name": "_model_name", "type": "string" @@ -4646,7 +5502,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4657,29 +5513,42 @@ "name": "_view_name", "type": "string" }, + { + "allow_none": true, + "default": null, + "help": "Background color", + "name": "background_color", + "type": "string" + }, { "default": "", "help": "Width of the description to the side of the control.", "name": "description_width", "type": "string" }, + { + "default": "", + "help": "Text font size.", + "name": "font_size", + "type": "string" + }, { "allow_none": true, "default": null, - "help": "Color of the slider handle.", - "name": "handle_color", + "help": "Text color", + "name": "text_color", "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", - "name": "SliderStyleModel", - "version": "1.4.0" + "name": "StringStyleModel", + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -4700,7 +5569,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4724,7 +5593,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4765,17 +5634,31 @@ "help": "The index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected.", "name": "selected_index", "type": "int" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "TabModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "TabView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -4796,7 +5679,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4814,7 +5697,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4837,13 +5720,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4865,10 +5741,24 @@ }, { "default": "reference to new instance", - "help": "Styling customizations", + "help": "", "name": "style", "type": "reference", - "widget": "DescriptionStyle" + "widget": "TextStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" }, { "default": "", @@ -4880,12 +5770,88 @@ "model": { "module": "@jupyter-widgets/controls", "name": "TextModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "TextView", - "version": "1.4.0" + "version": "1.5.0" + } + }, + { + "attributes": [ + { + "default": "@jupyter-widgets/controls", + "help": "", + "name": "_model_module", + "type": "string" + }, + { + "default": "1.5.0", + "help": "", + "name": "_model_module_version", + "type": "string" + }, + { + "default": "TextStyleModel", + "help": "", + "name": "_model_name", + "type": "string" + }, + { + "default": "@jupyter-widgets/base", + "help": "", + "name": "_view_module", + "type": "string" + }, + { + "default": "1.2.0", + "help": "", + "name": "_view_module_version", + "type": "string" + }, + { + "default": "StyleView", + "help": "", + "name": "_view_name", + "type": "string" + }, + { + "allow_none": true, + "default": null, + "help": "Background color", + "name": "background_color", + "type": "string" + }, + { + "default": "", + "help": "Width of the description to the side of the control.", + "name": "description_width", + "type": "string" + }, + { + "default": "", + "help": "Text font size.", + "name": "font_size", + "type": "string" + }, + { + "allow_none": true, + "default": null, + "help": "Text color", + "name": "text_color", + "type": "string" + } + ], + "model": { + "module": "@jupyter-widgets/controls", + "name": "TextStyleModel", + "version": "1.5.0" + }, + "view": { + "module": "@jupyter-widgets/base", + "name": "StyleView", + "version": "1.2.0" } }, { @@ -4906,7 +5872,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -4924,7 +5890,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -4947,13 +5913,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -4982,10 +5941,24 @@ }, { "default": "reference to new instance", - "help": "Styling customizations", + "help": "", "name": "style", "type": "reference", - "widget": "DescriptionStyle" + "widget": "TextStyle" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" }, { "default": "", @@ -4997,12 +5970,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "TextareaModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "TextareaView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5023,7 +5996,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5041,7 +6014,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5065,13 +6038,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -5099,8 +6065,16 @@ "widget": "DescriptionStyle" }, { - "default": "", - "help": "Tooltip caption of the toggle button.", + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", "name": "tooltip", "type": "string" }, @@ -5114,12 +6088,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5140,7 +6114,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5167,7 +6141,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5192,13 +6166,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes", @@ -5235,6 +6202,20 @@ "type": "reference", "widget": "ToggleButtonsStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": [], "help": "Tooltips for each button.", @@ -5248,12 +6229,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonsModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonsView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5265,7 +6246,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5283,7 +6264,7 @@ "type": "string" }, { - "default": "1.1.0", + "default": "1.2.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5316,12 +6297,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ToggleButtonsStyleModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/base", "name": "StyleView", - "version": "1.1.0" + "version": "1.2.0" } }, { @@ -5342,7 +6323,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5360,7 +6341,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5394,17 +6375,31 @@ "name": "layout", "type": "reference", "widget": "Layout" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { "module": "@jupyter-widgets/controls", "name": "VBoxModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "VBoxView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5425,7 +6420,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5443,7 +6438,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5460,13 +6455,6 @@ "name": "description", "type": "string" }, - { - "allow_none": true, - "default": null, - "help": "Tooltip for the description (defaults to description).", - "name": "description_tooltip", - "type": "string" - }, { "default": false, "help": "Enable or disable user changes.", @@ -5493,6 +6481,20 @@ "type": "reference", "widget": "DescriptionStyle" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": false, "help": "Bool value", @@ -5503,12 +6505,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "ValidModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "ValidView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5529,7 +6531,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_model_module_version", "type": "string" @@ -5547,7 +6549,7 @@ "type": "string" }, { - "default": "1.4.0", + "default": "1.5.0", "help": "", "name": "_view_module_version", "type": "string" @@ -5595,9 +6597,23 @@ "name": "loop", "type": "bool" }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" + }, { "default": "b''", - "help": "The media data as a byte string.", + "help": "The media data as a memory view of bytes.", "name": "value", "type": "bytes" }, @@ -5611,12 +6627,12 @@ "model": { "module": "@jupyter-widgets/controls", "name": "VideoModel", - "version": "1.4.0" + "version": "1.5.0" }, "view": { "module": "@jupyter-widgets/controls", "name": "VideoView", - "version": "1.4.0" + "version": "1.5.0" } }, { @@ -5687,6 +6703,20 @@ }, "name": "outputs", "type": "array" + }, + { + "allow_none": true, + "default": null, + "help": "Is widget tabbable?", + "name": "tabbable", + "type": "bool" + }, + { + "allow_none": true, + "default": null, + "help": "A tooltip caption.", + "name": "tooltip", + "type": "string" } ], "model": { diff --git a/packages/schema/jupyterwidgetmodels.latest.md b/packages/schema/jupyterwidgetmodels.latest.md index 308217de6b..2a4d8c6ca2 100644 --- a/packages/schema/jupyterwidgetmodels.latest.md +++ b/packages/schema/jupyterwidgetmodels.latest.md @@ -747,25 +747,24 @@ Attribute | Type | Default | Help `tooltip` | `null` or string | `null` | A tooltip caption. `value` | string | `''` | String value -### LabelStyleModel (@jupyter-widgets/controls, 1.5.0); StyleView (@jupyter-widgets/base, 1.2.0) +### LabelStyleModel (@jupyter-widgets/controls, 1.5.0); LabelStyleView (@jupyter-widgets/controls, 1.5.0) Attribute | Type | Default | Help -----------------|------------------|------------------|---- `_model_module` | string | `'@jupyter-widgets/controls'` | `_model_module_version` | string | `'1.5.0'` | `_model_name` | string | `'LabelStyleModel'` | -`_view_module` | string | `'@jupyter-widgets/base'` | -`_view_module_version` | string | `'1.2.0'` | -`_view_name` | string | `'StyleView'` | +`_view_module` | string | `'@jupyter-widgets/controls'` | +`_view_module_version` | string | `'1.5.0'` | +`_view_name` | string | `'LabelStyleView'` | `background_color` | `null` or string | `null` | Background color +`bold` | `null` or boolean | `null` | Label text bold. `description_width` | string | `''` | Width of the description to the side of the control. `font_family` | string | `''` | Label text font family. `font_size` | string | `''` | Text font size. -`font_style` | string | `''` | Label text font style. -`font_variant` | string | `''` | Label text font variant. -`font_weight` | string | `''` | Label text font weight. +`italic` | `null` or boolean | `null` | Label text italic. `text_color` | `null` or string | `null` | Text color -`text_decoration` | string | `''` | Label text decoration. +`underline` | `null` or boolean | `null` | Label text underline. ### LinkModel (@jupyter-widgets/controls, 1.5.0); None (@jupyter-widgets/controls, 1.5.0) diff --git a/tests/test_textstyle.ipynb b/tests/test_textstyle.ipynb new file mode 100644 index 0000000000..aa34fce9b6 --- /dev/null +++ b/tests/test_textstyle.ipynb @@ -0,0 +1,146 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Label, HTML, Text, Textarea, Combobox, VBox" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l = Label(\"Label\")\n", + "h = HTML(\"

HTML Paragraph

\")\n", + "t = Text(\"Text input\")\n", + "ta = Textarea(\"Text area\")\n", + "c = Combobox(options=[\"First\", \"Second\"])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "VBox((l, h, t, ta, c))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l.style.background_color = \"azure\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l.style.text_color = \"midnightblue\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l.style.italic = True" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "l.style.underline = True" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "h.style.background_color = \"lawngreen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "t.style.text_color = \"red\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "t.style.background_color = \"lightgray\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ta.style.background_color = \"linen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ta.style.font_size = \"1.5em\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "c.style.text_color = \"purple\"" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 5dc1a7129ffab49dbc744bb79cb0e49a76fea2fe Mon Sep 17 00:00:00 2001 From: Zerline Date: Wed, 22 Jan 2020 21:32:43 +0100 Subject: [PATCH 22/24] Use 'bold', 'italic' and 'underline' booleans. --- ipywidgets/widgets/widget_bool.py | 20 ++-- packages/base/src/widget_style.ts | 3 +- packages/controls/src/widget_bool.ts | 120 +++++++++++++++++++++- tests/test_boolstyle.ipynb | 142 +++++++++++++++++++++++++++ 4 files changed, 272 insertions(+), 13 deletions(-) create mode 100644 tests/test_boolstyle.ipynb diff --git a/ipywidgets/widgets/widget_bool.py b/ipywidgets/widgets/widget_bool.py index e7fe5e994b..dc4cd4ef8b 100644 --- a/ipywidgets/widgets/widget_bool.py +++ b/ipywidgets/widgets/widget_bool.py @@ -6,32 +6,36 @@ Represents a boolean using a widget. """ -from .widget_description import DescriptionWidget +from .widget_description import DescriptionStyle, DescriptionWidget from .widget_core import CoreWidget -from .widget_style import Style from .valuewidget import ValueWidget from .widget import register, widget_serialization from .trait_types import Color, InstanceDict +from .._version import __jupyter_widgets_controls_version__ from traitlets import Unicode, Bool, CaselessStrEnum -class _BoolStyle(Style, CoreWidget): +class _BoolStyle(DescriptionStyle, CoreWidget): """_Bool widget style.""" _model_name = Unicode('BoolStyleModel').tag(sync=True) background_color = Color(None, allow_none=True, help="Background color").tag(sync=True) + @register class ToggleButtonStyle(_BoolStyle, CoreWidget): """ToggleButton widget style.""" _model_name = Unicode('ToggleButtonStyleModel').tag(sync=True) - font_family = Unicode(help="Button text font family.").tag(sync=True) + _view_name = Unicode('ToggleButtonStyleView').tag(sync=True) + _view_module = Unicode('@jupyter-widgets/controls').tag(sync=True) + _view_module_version = Unicode(__jupyter_widgets_controls_version__).tag(sync=True) + bold = Bool(None, allow_none=True, help="Toggle button text bold.").tag(sync=True) + button_color = Color(None, allow_none=True, help="Background color").tag(sync=True) + font_family = Unicode(help="Toggle button text font family.").tag(sync=True) font_size = Unicode(help="Button text font size.").tag(sync=True) - font_style = Unicode(help="Button text font style.").tag(sync=True) - font_variant = Unicode(help="Button text font variant.").tag(sync=True) - font_weight = Unicode(help="Button text font weight.").tag(sync=True) + italic = Bool(None, allow_none=True, help="Toggle button text italic.").tag(sync=True) + underline = Bool(None, allow_none=True, help="Toggle button text underline.").tag(sync=True) text_color = Color(None, allow_none=True, help="Text color").tag(sync=True) - text_decoration = Unicode(help="Text decoration").tag(sync=True) class _Bool(DescriptionWidget, ValueWidget, CoreWidget): diff --git a/packages/base/src/widget_style.ts b/packages/base/src/widget_style.ts index 8d5c749aa4..86f71aee36 100644 --- a/packages/base/src/widget_style.ts +++ b/packages/base/src/widget_style.ts @@ -6,8 +6,7 @@ import { assign } from './utils'; import { WidgetModel, WidgetView, DOMWidgetView } from './widget'; /** - * Three functions to deal with some CSS attributes - * to make them easier to use. + * Three functions to adapt some CSS attributes and make them easier to use. */ export function bold_to_weight(value: boolean): string | null { if (value == true) return 'bold'; diff --git a/packages/controls/src/widget_bool.ts b/packages/controls/src/widget_bool.ts index d63f5ebaa7..9f70db4fe3 100644 --- a/packages/controls/src/widget_bool.ts +++ b/packages/controls/src/widget_bool.ts @@ -1,20 +1,134 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -import { CoreDescriptionModel } from './widget_core'; +import { + DOMWidgetView, + StyleModel, + StyleView, + bold_to_weight, + italic_to_style, + underline_to_decoration +} from '@jupyter-widgets/base'; -import { DescriptionView } from './widget_description'; +import { CoreDescriptionModel } from './widget_core'; -import { DOMWidgetView } from '@jupyter-widgets/base'; +import { DescriptionStyleModel, DescriptionView } from './widget_description'; import { JUPYTER_CONTROLS_VERSION } from './version'; +export class BoolStyleModel extends DescriptionStyleModel { + defaults(): Backbone.ObjectHash { + return { + ...super.defaults(), + _model_name: 'BoolStyleModel', + _model_module: '@jupyter-widgets/controls', + _model_module_version: JUPYTER_CONTROLS_VERSION + }; + } + + public static styleProperties = { + ...DescriptionStyleModel.styleProperties, + background_color: { + selector: '', + attribute: 'background-color', + default: null as any + } + }; +} + +export class ToggleButtonStyleModel extends BoolStyleModel { + defaults(): Backbone.ObjectHash { + return { + ...super.defaults(), + _model_name: 'ToggleButtonStyleModel', + _view_name: 'ToggleButtonStyleView', + _view_module: '@jupyter-widgets/controls', + _view_module_version: JUPYTER_CONTROLS_VERSION + }; + } + + public static styleProperties = { + ...BoolStyleModel.styleProperties, + bold: { + selector: '', + attribute: 'font-weight', + default: '' + }, + button_color: { + selector: '', + attribute: 'background-color', + default: null as any + }, + font_family: { + selector: '', + attribute: 'font-family', + default: '' + }, + font_size: { + selector: '', + attribute: 'font-size', + default: '' + }, + italic: { + selector: '', + attribute: 'font-style', + default: '' + }, + text_color: { + selector: '', + attribute: 'color', + default: '' + }, + underline: { + selector: '', + attribute: 'text-decoration', + default: '' + } + }; +} + +export class ToggleButtonStyleView extends StyleView { + /** + * Handles when a trait value changes + */ + handleChange(trait: string, value: any): void { + // should be synchronous so that we can measure later. + const parent = this.options.parent as DOMWidgetView; + if (parent) { + const ModelType = this.model.constructor as typeof StyleModel; + const styleProperties = ModelType.styleProperties; + const attribute = styleProperties[trait].attribute; + const selector = styleProperties[trait].selector; + const elements = selector + ? parent.el.querySelectorAll(selector) + : [parent.el]; + let transform = undefined; + if (trait == 'bold') transform = bold_to_weight; + if (trait == 'italic') transform = italic_to_style; + if (trait == 'underline') transform = underline_to_decoration; + if (transform !== undefined) value = transform(value); + if (value === null) { + for (let i = 0; i !== elements.length; ++i) { + elements[i].style.removeProperty(attribute); + } + } else { + for (let i = 0; i !== elements.length; ++i) { + elements[i].style.setProperty(attribute, value); + } + } + } else { + console.warn('Style not applied because a parent view does not exist'); + } + } +} + export class BoolModel extends CoreDescriptionModel { defaults(): Backbone.ObjectHash { return { ...super.defaults(), value: false, disabled: false, + style: null, _model_name: 'BoolModel' }; } diff --git a/tests/test_boolstyle.ipynb b/tests/test_boolstyle.ipynb new file mode 100644 index 0000000000..f34f0af99f --- /dev/null +++ b/tests/test_boolstyle.ipynb @@ -0,0 +1,142 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Checkbox, ToggleButton, Valid\n", + "tb = ToggleButton(description=\"ToggleButton\")\n", + "tb" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.background_color = \"linen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.text_color = \"darkgreen\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.italic = True" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.bold = True " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.underline = True" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_size = \"1.2em\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tb.style.font_family = \"bitstream\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "v = Valid(True)\n", + "v.style.background_color = \"palegoldenrod\"\n", + "v" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "v.value = False" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "c = Checkbox(description=\"Chekbox\")\n", + "c" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "c.style.background_color = \"azure\"\n", + "c.layout.width = \"150px\"\n", + "c.layout.padding = \"0px\"\n", + "c.layout.border = \"1px solid black\"\n", + "c.style.description_width = \"5px\"" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 8336fbffeec9a4c5bdb5d611fae22cefe6817d78 Mon Sep 17 00:00:00 2001 From: Zerline Date: Wed, 22 Jan 2020 21:47:14 +0100 Subject: [PATCH 23/24] Adding test_buttonstyle NB. --- tests/test_buttonstyle.ipynb | 131 +++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 tests/test_buttonstyle.ipynb diff --git a/tests/test_buttonstyle.ipynb b/tests/test_buttonstyle.ipynb new file mode 100644 index 0000000000..3a9798ae8a --- /dev/null +++ b/tests/test_buttonstyle.ipynb @@ -0,0 +1,131 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "f73229b142e84283a458b04e4293bfee", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Button(description='Button', style=ButtonStyle())" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from ipywidgets import Button\n", + "b = Button(description=\"Button\")\n", + "b" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.button_color = \"linen\"" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.text_color = \"darkgreen\"" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.italic = True" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.bold = True " + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_variant = \"small-caps\"" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.underline = True" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_size = \"1.2em\"" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "b.style.font_family = \"bitstream\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 0cf44aac711bc79cc824b81317ce62d63ca06f12 Mon Sep 17 00:00:00 2001 From: Zerline Date: Wed, 22 Jan 2020 21:56:53 +0100 Subject: [PATCH 24/24] Remove test files. --- tests/test_boolstyle.ipynb | 142 ---------------------------------- tests/test_buttonstyle.ipynb | 131 ------------------------------- tests/test_textstyle.ipynb | 146 ----------------------------------- 3 files changed, 419 deletions(-) delete mode 100644 tests/test_boolstyle.ipynb delete mode 100644 tests/test_buttonstyle.ipynb delete mode 100644 tests/test_textstyle.ipynb diff --git a/tests/test_boolstyle.ipynb b/tests/test_boolstyle.ipynb deleted file mode 100644 index f34f0af99f..0000000000 --- a/tests/test_boolstyle.ipynb +++ /dev/null @@ -1,142 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from ipywidgets import Checkbox, ToggleButton, Valid\n", - "tb = ToggleButton(description=\"ToggleButton\")\n", - "tb" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.background_color = \"linen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.text_color = \"darkgreen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.italic = True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.bold = True " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.underline = True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_size = \"1.2em\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "tb.style.font_family = \"bitstream\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "v = Valid(True)\n", - "v.style.background_color = \"palegoldenrod\"\n", - "v" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "v.value = False" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "c = Checkbox(description=\"Chekbox\")\n", - "c" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "c.style.background_color = \"azure\"\n", - "c.layout.width = \"150px\"\n", - "c.layout.padding = \"0px\"\n", - "c.layout.border = \"1px solid black\"\n", - "c.style.description_width = \"5px\"" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/tests/test_buttonstyle.ipynb b/tests/test_buttonstyle.ipynb deleted file mode 100644 index 3a9798ae8a..0000000000 --- a/tests/test_buttonstyle.ipynb +++ /dev/null @@ -1,131 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "f73229b142e84283a458b04e4293bfee", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Button(description='Button', style=ButtonStyle())" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from ipywidgets import Button\n", - "b = Button(description=\"Button\")\n", - "b" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.button_color = \"linen\"" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.text_color = \"darkgreen\"" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.italic = True" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.bold = True " - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_variant = \"small-caps\"" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.underline = True" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_size = \"1.2em\"" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [], - "source": [ - "b.style.font_family = \"bitstream\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/tests/test_textstyle.ipynb b/tests/test_textstyle.ipynb deleted file mode 100644 index aa34fce9b6..0000000000 --- a/tests/test_textstyle.ipynb +++ /dev/null @@ -1,146 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from ipywidgets import Label, HTML, Text, Textarea, Combobox, VBox" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l = Label(\"Label\")\n", - "h = HTML(\"

HTML Paragraph

\")\n", - "t = Text(\"Text input\")\n", - "ta = Textarea(\"Text area\")\n", - "c = Combobox(options=[\"First\", \"Second\"])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "VBox((l, h, t, ta, c))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l.style.background_color = \"azure\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l.style.text_color = \"midnightblue\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l.style.italic = True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "l.style.underline = True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "h.style.background_color = \"lawngreen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "t.style.text_color = \"red\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "t.style.background_color = \"lightgray\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ta.style.background_color = \"linen\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ta.style.font_size = \"1.5em\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "c.style.text_color = \"purple\"" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -}