ex4nicegui 0.4.0__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/PKG-INFO +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/__init__.py +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/text.py +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/__index.py +1 -2
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/drawer.py +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/mermaid/mermaid.js +7 -2
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/aggrid.py +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/base.py +30 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/button.py +5 -17
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/checkbox.py +5 -3
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/color_picker.py +2 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/date.py +2 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/drawer.py +2 -6
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/echarts.py +2 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/html.py +2 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/icon.py +2 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/image.py +5 -2
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/input.py +6 -3
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/label.py +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/number.py +2 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/radio.py +2 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/select.py +2 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/slider.py +7 -3
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/switch.py +2 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/table.py +1 -2
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/textarea.py +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/q_pagination.py +2 -5
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/utils/signals.py +8 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui.egg-info/PKG-INFO +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui.egg-info/requires.txt +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/setup.py +1 -1
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/LICENSE +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/README.md +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/dataSource.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/dataSourceFacade.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/containers.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/layouts.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/models.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/ui_aggrid.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/ui_date_picker.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/ui_date_picker.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/ui_echarts.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/ui_radio.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/ui_range.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/ui_select.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/elements/ui_slider.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/index.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/protocols.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/bi/types.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/experimental_/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/experimental_/gridLayout/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/experimental_/gridLayout/index.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/layout/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/layout/gridFlex/GridFlex.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/layout/gridFlex/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/layout/gridFlex/gridFlex.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/layout/gridFlex/utils.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/layout/rxFlex/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/layout/rxFlex/index.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/layout/rxFlex/types.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/EChartsComponent/ECharts.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/EChartsComponent/ECharts.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/EChartsComponent/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/UseDraggable/UseDraggable.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/UseDraggable/UseDraggable.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/UseDraggable/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/dropZone/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/dropZone/dropZone.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/dropZone/dropZone.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/fileWatcher.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/d3-color.ems.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/d3-dispatch.ems.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/d3-drag.ems.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/d3-ease.ems.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/d3-interpolate.ems.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/d3-selection.ems.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/d3-timer.ems.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/d3-transition.ems.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/libs/d3/d3-zoom.ems.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/local_file_picker.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/mermaid/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/mermaid/mermaid.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/card.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/column.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/expansion.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/grid.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/row.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/upload.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/officials/utils.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/rxui.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/useMouse/UseMouse.js +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/useMouse/UseMouse.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/useMouse/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/reactive/usePagination.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/tools/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/tools/debug.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/utils/__init__.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/utils/clientScope.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui/utils/common.py +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui.egg-info/SOURCES.txt +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui.egg-info/dependency_links.txt +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui.egg-info/not-zip-safe +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/ex4nicegui.egg-info/top_level.txt +0 -0
- {ex4nicegui-0.4.0 → ex4nicegui-0.4.2}/setup.cfg +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
from .officials import *
|
|
2
2
|
from .q_pagination import QPagination as q_pagination
|
|
3
3
|
from .local_file_picker import local_file_picker
|
|
4
|
-
from ex4nicegui.utils.signals import ref_computed
|
|
5
|
-
from signe import effect
|
|
4
|
+
from ex4nicegui.utils.signals import ref_computed, effect
|
|
6
5
|
from .UseDraggable.UseDraggable import use_draggable
|
|
7
6
|
from .useMouse.UseMouse import use_mouse
|
|
8
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing_extensions import Literal
|
|
2
2
|
from nicegui import ui
|
|
3
3
|
from ex4nicegui.reactive.officials import DrawerBindableUi
|
|
4
|
-
from
|
|
4
|
+
from ex4nicegui.utils.signals import effect
|
|
5
5
|
from typing import Union, Optional
|
|
6
6
|
|
|
7
7
|
_TDrawerSide = Literal["left", "right"]
|
|
@@ -27,12 +27,17 @@ export default {
|
|
|
27
27
|
window[actionCallback] = (nodeId) => {
|
|
28
28
|
this.$emit('onNodeClick', { nodeId })
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
this.actionCallback = actionCallback
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
this.update(content);
|
|
33
35
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
unmounted() {
|
|
37
|
+
if (this.actionCallback && window[this.actionCallback]) {
|
|
38
|
+
delete window[this.actionCallback]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
36
41
|
methods: {
|
|
37
42
|
async update(content) {
|
|
38
43
|
if (this.last_content === content) return;
|
|
@@ -11,13 +11,13 @@ from typing import (
|
|
|
11
11
|
overload,
|
|
12
12
|
)
|
|
13
13
|
from typing_extensions import Self
|
|
14
|
-
from signe import effect
|
|
15
14
|
from ex4nicegui.utils.signals import (
|
|
16
15
|
ReadonlyRef,
|
|
17
16
|
Ref,
|
|
18
17
|
to_ref,
|
|
19
18
|
ref_computed,
|
|
20
19
|
_TMaybeRef as TMaybeRef,
|
|
20
|
+
effect,
|
|
21
21
|
)
|
|
22
22
|
from nicegui import Tailwind, ui
|
|
23
23
|
from nicegui.elements.mixins.color_elements import (
|
|
@@ -162,6 +162,35 @@ class SingleValueBindableUi(BindableUi[TWidget], Generic[T, TWidget]):
|
|
|
162
162
|
return self
|
|
163
163
|
|
|
164
164
|
|
|
165
|
+
from nicegui.elements.mixins.disableable_element import DisableableElement
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
_T_DisableableBinder = TypeVar("_T_DisableableBinder", bound=DisableableElement)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class DisableableBindableUi(BindableUi[_T_DisableableBinder]):
|
|
172
|
+
def __init__(self, element: _T_DisableableBinder) -> None:
|
|
173
|
+
super().__init__(element)
|
|
174
|
+
|
|
175
|
+
def bind_enabled(self, ref_ui: ReadonlyRef[bool]):
|
|
176
|
+
@effect
|
|
177
|
+
def _():
|
|
178
|
+
value = ref_ui.value
|
|
179
|
+
self.element.set_enabled(value)
|
|
180
|
+
self.element._handle_enabled_change(value)
|
|
181
|
+
|
|
182
|
+
return self
|
|
183
|
+
|
|
184
|
+
def bind_disable(self, ref_ui: ReadonlyRef[bool]):
|
|
185
|
+
@effect
|
|
186
|
+
def _():
|
|
187
|
+
value = not ref_ui.value
|
|
188
|
+
self.element.set_enabled(value)
|
|
189
|
+
self.element._handle_enabled_change(value)
|
|
190
|
+
|
|
191
|
+
return self
|
|
192
|
+
|
|
193
|
+
|
|
165
194
|
def _bind_color(bindable_ui: SingleValueBindableUi, ref_ui: ReadonlyRef):
|
|
166
195
|
@effect
|
|
167
196
|
def _():
|
|
@@ -3,18 +3,20 @@ from typing import (
|
|
|
3
3
|
Callable,
|
|
4
4
|
Optional,
|
|
5
5
|
)
|
|
6
|
-
from signe import effect
|
|
7
6
|
from ex4nicegui.utils.signals import (
|
|
8
7
|
ReadonlyRef,
|
|
9
8
|
is_ref,
|
|
10
9
|
_TMaybeRef as TMaybeRef,
|
|
10
|
+
effect,
|
|
11
11
|
)
|
|
12
12
|
from nicegui import ui
|
|
13
|
-
from .base import SingleValueBindableUi, _bind_color
|
|
13
|
+
from .base import SingleValueBindableUi, _bind_color, DisableableBindableUi
|
|
14
14
|
from .utils import _convert_kws_ref2value
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
class ButtonBindableUi(
|
|
17
|
+
class ButtonBindableUi(
|
|
18
|
+
SingleValueBindableUi[str, ui.button], DisableableBindableUi[ui.button]
|
|
19
|
+
):
|
|
18
20
|
def __init__(
|
|
19
21
|
self,
|
|
20
22
|
text: TMaybeRef[str] = "",
|
|
@@ -70,17 +72,3 @@ class ButtonBindableUi(SingleValueBindableUi[str, ui.button]):
|
|
|
70
72
|
ele.update()
|
|
71
73
|
|
|
72
74
|
return self
|
|
73
|
-
|
|
74
|
-
def bind_enabled(self, ref_ui: ReadonlyRef[bool]):
|
|
75
|
-
@effect
|
|
76
|
-
def _():
|
|
77
|
-
self.element.on_enabled_change(ref_ui.value)
|
|
78
|
-
|
|
79
|
-
return self
|
|
80
|
-
|
|
81
|
-
def bind_disable(self, ref_ui: ReadonlyRef[bool]):
|
|
82
|
-
@effect
|
|
83
|
-
def _():
|
|
84
|
-
self.element.on_enabled_change(not ref_ui.value)
|
|
85
|
-
|
|
86
|
-
return self
|
|
@@ -5,21 +5,23 @@ from typing import (
|
|
|
5
5
|
TypeVar,
|
|
6
6
|
cast,
|
|
7
7
|
)
|
|
8
|
-
from signe import effect
|
|
9
8
|
from ex4nicegui.utils.signals import (
|
|
10
9
|
ReadonlyRef,
|
|
11
10
|
is_ref,
|
|
12
11
|
_TMaybeRef as TMaybeRef,
|
|
12
|
+
effect,
|
|
13
13
|
)
|
|
14
14
|
from nicegui import ui
|
|
15
15
|
from nicegui.elements.mixins.value_element import ValueElement
|
|
16
|
-
from .base import SingleValueBindableUi
|
|
16
|
+
from .base import SingleValueBindableUi, DisableableBindableUi
|
|
17
17
|
from .utils import _convert_kws_ref2value
|
|
18
18
|
|
|
19
19
|
T = TypeVar("T")
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
class CheckboxBindableUi(
|
|
22
|
+
class CheckboxBindableUi(
|
|
23
|
+
SingleValueBindableUi[bool, ui.checkbox], DisableableBindableUi[ui.checkbox]
|
|
24
|
+
):
|
|
23
25
|
@staticmethod
|
|
24
26
|
def _setup_(binder: "CheckboxBindableUi"):
|
|
25
27
|
ele = cast(ValueElement, binder.element)
|
|
@@ -4,11 +4,12 @@ from typing import (
|
|
|
4
4
|
Optional,
|
|
5
5
|
Union,
|
|
6
6
|
)
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
from ex4nicegui.utils.signals import (
|
|
9
9
|
ReadonlyRef,
|
|
10
10
|
is_ref,
|
|
11
11
|
_TMaybeRef as TMaybeRef,
|
|
12
|
+
effect,
|
|
12
13
|
)
|
|
13
14
|
from nicegui import ui
|
|
14
15
|
from .base import SingleValueBindableUi
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
from typing import Any, Callable, List, Optional, TypeVar, cast
|
|
2
2
|
from typing_extensions import TypedDict
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
from ex4nicegui.utils.signals import (
|
|
5
5
|
ReadonlyRef,
|
|
6
6
|
is_ref,
|
|
7
7
|
_TMaybeRef as TMaybeRef,
|
|
8
|
+
effect,
|
|
8
9
|
)
|
|
9
10
|
from nicegui import ui
|
|
10
11
|
from .base import SingleValueBindableUi
|
|
@@ -2,12 +2,8 @@ from typing import (
|
|
|
2
2
|
Any,
|
|
3
3
|
)
|
|
4
4
|
from typing_extensions import Literal
|
|
5
|
-
|
|
6
|
-
from ex4nicegui.utils.signals import
|
|
7
|
-
to_value,
|
|
8
|
-
is_ref,
|
|
9
|
-
_TMaybeRef as TMaybeRef,
|
|
10
|
-
)
|
|
5
|
+
|
|
6
|
+
from ex4nicegui.utils.signals import to_value, is_ref, _TMaybeRef as TMaybeRef, effect
|
|
11
7
|
from nicegui import ui
|
|
12
8
|
from nicegui.page_layout import Drawer
|
|
13
9
|
from .base import SingleValueBindableUi
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
from typing import Any, Callable, Dict, List, Union, cast, Optional
|
|
2
2
|
from typing_extensions import Literal
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
from ex4nicegui.utils.signals import (
|
|
5
5
|
ReadonlyRef,
|
|
6
6
|
is_ref,
|
|
7
7
|
ref_computed,
|
|
8
8
|
_TMaybeRef as TMaybeRef,
|
|
9
9
|
to_ref,
|
|
10
|
+
effect,
|
|
10
11
|
)
|
|
11
12
|
from .base import BindableUi
|
|
12
13
|
from .utils import _convert_kws_ref2value
|
|
@@ -2,11 +2,12 @@ from typing import (
|
|
|
2
2
|
Optional,
|
|
3
3
|
cast,
|
|
4
4
|
)
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
from ex4nicegui.utils.signals import (
|
|
7
7
|
ReadonlyRef,
|
|
8
8
|
is_ref,
|
|
9
9
|
_TMaybeRef as TMaybeRef,
|
|
10
|
+
effect,
|
|
10
11
|
)
|
|
11
12
|
from nicegui import ui
|
|
12
13
|
from nicegui.elements.mixins.color_elements import (
|
|
@@ -2,11 +2,12 @@ from pathlib import Path
|
|
|
2
2
|
from typing import (
|
|
3
3
|
Union,
|
|
4
4
|
)
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
from ex4nicegui.utils.signals import (
|
|
7
7
|
ReadonlyRef,
|
|
8
8
|
is_ref,
|
|
9
9
|
_TMaybeRef as TMaybeRef,
|
|
10
|
+
effect,
|
|
10
11
|
)
|
|
11
12
|
from nicegui import ui
|
|
12
13
|
from .base import SingleValueBindableUi
|
|
@@ -18,7 +19,9 @@ class ImageBindableUi(SingleValueBindableUi[Union[str, Path], ui.image]):
|
|
|
18
19
|
def _setup_(binder: "ImageBindableUi"):
|
|
19
20
|
@effect
|
|
20
21
|
def _():
|
|
21
|
-
binder.
|
|
22
|
+
value = binder.value
|
|
23
|
+
binder.element.set_source(value)
|
|
24
|
+
binder.element._handle_source_change(value)
|
|
22
25
|
|
|
23
26
|
def __init__(
|
|
24
27
|
self,
|
|
@@ -5,18 +5,21 @@ from typing import (
|
|
|
5
5
|
Optional,
|
|
6
6
|
Dict,
|
|
7
7
|
)
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
from ex4nicegui.utils.signals import (
|
|
10
10
|
ReadonlyRef,
|
|
11
11
|
is_ref,
|
|
12
12
|
_TMaybeRef as TMaybeRef,
|
|
13
|
+
effect,
|
|
13
14
|
)
|
|
14
15
|
from nicegui import ui
|
|
15
|
-
from .base import SingleValueBindableUi
|
|
16
|
+
from .base import SingleValueBindableUi, DisableableBindableUi
|
|
16
17
|
from .utils import _convert_kws_ref2value
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
class InputBindableUi(
|
|
20
|
+
class InputBindableUi(
|
|
21
|
+
SingleValueBindableUi[str, ui.input], DisableableBindableUi[ui.input]
|
|
22
|
+
):
|
|
20
23
|
def __init__(
|
|
21
24
|
self,
|
|
22
25
|
label: Optional[TMaybeRef[str]] = None,
|
|
@@ -8,11 +8,12 @@ from typing import (
|
|
|
8
8
|
Dict,
|
|
9
9
|
Union,
|
|
10
10
|
)
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
from ex4nicegui.utils.signals import (
|
|
13
13
|
ReadonlyRef,
|
|
14
14
|
is_ref,
|
|
15
15
|
_TMaybeRef as TMaybeRef,
|
|
16
|
+
effect,
|
|
16
17
|
)
|
|
17
18
|
from nicegui import ui
|
|
18
19
|
from nicegui.elements.mixins.value_element import ValueElement
|
|
@@ -8,11 +8,12 @@ from typing import (
|
|
|
8
8
|
Dict,
|
|
9
9
|
Union,
|
|
10
10
|
)
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
from ex4nicegui.utils.signals import (
|
|
13
13
|
ReadonlyRef,
|
|
14
14
|
is_ref,
|
|
15
15
|
_TMaybeRef as TMaybeRef,
|
|
16
|
+
effect,
|
|
16
17
|
)
|
|
17
18
|
from nicegui import ui
|
|
18
19
|
from nicegui.elements.mixins.value_element import ValueElement
|
|
@@ -4,21 +4,25 @@ from typing import (
|
|
|
4
4
|
Optional,
|
|
5
5
|
TypeVar,
|
|
6
6
|
)
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
from ex4nicegui.utils.signals import (
|
|
9
9
|
ReadonlyRef,
|
|
10
10
|
is_ref,
|
|
11
11
|
_TMaybeRef as TMaybeRef,
|
|
12
|
+
effect,
|
|
12
13
|
)
|
|
13
14
|
from nicegui import ui
|
|
14
|
-
from .base import SingleValueBindableUi
|
|
15
|
+
from .base import SingleValueBindableUi, DisableableBindableUi
|
|
15
16
|
from .utils import _convert_kws_ref2value
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
_TSliderValue = TypeVar("_TSliderValue", float, int, None)
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
class SliderBindableUi(
|
|
22
|
+
class SliderBindableUi(
|
|
23
|
+
SingleValueBindableUi[Optional[_TSliderValue], ui.slider],
|
|
24
|
+
DisableableBindableUi[ui.slider],
|
|
25
|
+
):
|
|
22
26
|
def __init__(
|
|
23
27
|
self,
|
|
24
28
|
min: TMaybeRef[_TSliderValue],
|
|
@@ -5,11 +5,12 @@ from typing import (
|
|
|
5
5
|
TypeVar,
|
|
6
6
|
cast,
|
|
7
7
|
)
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
from ex4nicegui.utils.signals import (
|
|
10
10
|
ReadonlyRef,
|
|
11
11
|
is_ref,
|
|
12
12
|
_TMaybeRef as TMaybeRef,
|
|
13
|
+
effect,
|
|
13
14
|
)
|
|
14
15
|
from nicegui import ui
|
|
15
16
|
from nicegui.elements.mixins.value_element import ValueElement
|
|
@@ -8,13 +8,12 @@ from typing import (
|
|
|
8
8
|
)
|
|
9
9
|
from typing_extensions import Literal
|
|
10
10
|
import ex4nicegui.utils.common as utils_common
|
|
11
|
-
from signe import effect
|
|
12
11
|
from ex4nicegui.utils.signals import (
|
|
13
12
|
ReadonlyRef,
|
|
14
13
|
is_ref,
|
|
15
14
|
ref_computed,
|
|
16
15
|
to_ref,
|
|
17
|
-
|
|
16
|
+
effect,
|
|
18
17
|
_TMaybeRef as TMaybeRef,
|
|
19
18
|
)
|
|
20
19
|
from nicegui import ui
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
from typing import
|
|
1
|
+
from typing import cast
|
|
2
2
|
from nicegui.element import Element
|
|
3
|
-
from signe import effect
|
|
4
3
|
from ex4nicegui.utils.signals import (
|
|
5
4
|
Ref,
|
|
6
|
-
|
|
7
|
-
to_ref,
|
|
8
|
-
is_ref,
|
|
5
|
+
effect,
|
|
9
6
|
to_value,
|
|
10
7
|
_TMaybeRef as TMaybeRef,
|
|
11
8
|
)
|
|
@@ -247,14 +247,21 @@ class effect_refreshable:
|
|
|
247
247
|
|
|
248
248
|
def on(
|
|
249
249
|
refs: Union[ReadonlyRef, Sequence[ReadonlyRef]],
|
|
250
|
+
onchanges=False,
|
|
251
|
+
priority_level=1,
|
|
250
252
|
effect_kws: Optional[Dict[str, Any]] = None,
|
|
251
253
|
):
|
|
254
|
+
effect_kws = effect_kws or {}
|
|
252
255
|
if not isinstance(refs, Sequence):
|
|
253
256
|
refs = [refs]
|
|
254
257
|
|
|
255
258
|
getters = [getattr(r, "_ReadonlyRef___getter") for r in refs]
|
|
256
259
|
|
|
260
|
+
effect_kws.update(
|
|
261
|
+
{"scope": _CLIENT_SCOPE_MANAGER.get_scope(), "priority_level": priority_level}
|
|
262
|
+
)
|
|
263
|
+
|
|
257
264
|
def wrap(fn: Callable):
|
|
258
|
-
return signe_on(getters, fn, effect_kws=effect_kws)
|
|
265
|
+
return signe_on(getters, fn, onchanges=onchanges, effect_kws=effect_kws)
|
|
259
266
|
|
|
260
267
|
return wrap
|
|
@@ -21,7 +21,7 @@ def get_data_files(base):
|
|
|
21
21
|
with open("README.md", encoding="utf8") as readme_file:
|
|
22
22
|
readme = readme_file.read()
|
|
23
23
|
|
|
24
|
-
requirements = ["signe>=0.2.
|
|
24
|
+
requirements = ["signe>=0.2.5", "nicegui>=1.4.0", "typing_extensions"]
|
|
25
25
|
|
|
26
26
|
test_requirements = ["pytest>=3", "playwright", "pandas"]
|
|
27
27
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|