ex4nicegui 0.8.4__py3-none-any.whl → 0.8.6__py3-none-any.whl
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/reactive/EChartsComponent/events.py +11 -10
- ex4nicegui/reactive/EChartsComponent/utils.py +1 -14
- ex4nicegui/reactive/__init__.py +6 -1
- ex4nicegui/reactive/officials/grid.py +43 -3
- ex4nicegui/reactive/officials/input.py +23 -0
- ex4nicegui/reactive/officials/radio.py +13 -2
- ex4nicegui/reactive/officials/range.py +42 -0
- ex4nicegui/reactive/officials/select.py +1 -3
- ex4nicegui/reactive/officials/spinner.py +43 -0
- ex4nicegui/reactive/officials/toggle.py +5 -3
- ex4nicegui/reactive/officials/tree.py +86 -0
- ex4nicegui/reactive/systems/reactive_system.py +13 -2
- ex4nicegui/toolbox/__init__.py +5 -0
- ex4nicegui/toolbox/core/VueUse.js +2031 -0
- ex4nicegui/toolbox/core/vue_use.py +32 -0
- ex4nicegui/toolbox/functions/breakpoint.py +114 -0
- ex4nicegui/toolbox/functions/dark.py +97 -0
- ex4nicegui/toolbox/functions/qr_code.py +83 -0
- ex4nicegui/utils/asyncComputed.py +3 -0
- ex4nicegui/utils/proxy/dict.py +0 -1
- {ex4nicegui-0.8.4.dist-info → ex4nicegui-0.8.6.dist-info}/METADATA +89 -2
- {ex4nicegui-0.8.4.dist-info → ex4nicegui-0.8.6.dist-info}/RECORD +24 -16
- {ex4nicegui-0.8.4.dist-info → ex4nicegui-0.8.6.dist-info}/LICENSE +0 -0
- {ex4nicegui-0.8.4.dist-info → ex4nicegui-0.8.6.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from typing import Any, Callable, Dict, List, Optional
|
|
2
|
+
from nicegui.element import Element
|
|
3
|
+
from collections import defaultdict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class VueUse(Element, component="VueUse.js"):
|
|
7
|
+
def __init__(
|
|
8
|
+
self,
|
|
9
|
+
method: str,
|
|
10
|
+
args: Optional[List[Any]] = None,
|
|
11
|
+
) -> None:
|
|
12
|
+
super().__init__()
|
|
13
|
+
|
|
14
|
+
self._props["method"] = method
|
|
15
|
+
self._props["args"] = args
|
|
16
|
+
|
|
17
|
+
self.__on_events: defaultdict[str, List[Callable]] = defaultdict(list)
|
|
18
|
+
|
|
19
|
+
def on_change(e):
|
|
20
|
+
event_name = e.args["eventName"]
|
|
21
|
+
value = e.args["value"]
|
|
22
|
+
|
|
23
|
+
self.trigger_event(event_name, value)
|
|
24
|
+
|
|
25
|
+
self.on("change", on_change)
|
|
26
|
+
|
|
27
|
+
def on_event(self, event_name: str, callback: Callable) -> None:
|
|
28
|
+
self.__on_events[event_name].append(callback)
|
|
29
|
+
|
|
30
|
+
def trigger_event(self, event_name: str, value: Any) -> None:
|
|
31
|
+
for callback in self.__on_events[event_name]:
|
|
32
|
+
callback(value)
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import Callable, Dict, List, Optional
|
|
3
|
+
from ex4nicegui.utils.signals import to_ref, ref_computed
|
|
4
|
+
from ex4nicegui.utils.types import ReadonlyRef
|
|
5
|
+
from ex4nicegui.toolbox.core.vue_use import VueUse
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
_QUASAR_BREAKPOINTS = {"xs": 0, "sm": 600, "md": 1024, "lg": 1440, "xl": 1920}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class UseBreakpoints:
|
|
12
|
+
def __init__(
|
|
13
|
+
self,
|
|
14
|
+
options: Optional[Dict] = None,
|
|
15
|
+
*,
|
|
16
|
+
on_active_change: Optional[Callable[[str], None]] = None,
|
|
17
|
+
):
|
|
18
|
+
"""monitor viewport breakpoints.
|
|
19
|
+
|
|
20
|
+
@see - https://github.com/CrystalWindSnake/ex4nicegui/blob/main/README.en.md#use_breakpoints
|
|
21
|
+
|
|
22
|
+
@中文文档 - https://gitee.com/carson_add/ex4nicegui/tree/main/#use_breakpoints
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
options (Optional[Dict], optional): the configuration for each breakpoint. The default is the configuration from Quasar v3. Defaults to None.
|
|
26
|
+
on_active_change (Optional[Callable[[str], None]], optional): callback function to be called when the breakpoint changes. Defaults to None.
|
|
27
|
+
|
|
28
|
+
Example:
|
|
29
|
+
.. code-block:: python
|
|
30
|
+
from ex4nicegui import toolbox as tb
|
|
31
|
+
|
|
32
|
+
options = {"mobile": 0, "tablet": 640, "laptop": 1024, "desktop": 1280}
|
|
33
|
+
tb.use_breakpoints(options, on_active_change=lambda breakpoint: print(breakpoint))
|
|
34
|
+
|
|
35
|
+
"""
|
|
36
|
+
self.__options = (options or _QUASAR_BREAKPOINTS).copy()
|
|
37
|
+
|
|
38
|
+
self.__vue_use = VueUse("useBreakpoints", args=[self.__options])
|
|
39
|
+
|
|
40
|
+
self.__active_value = ""
|
|
41
|
+
|
|
42
|
+
def mouted(value: str):
|
|
43
|
+
self.__active_value = value
|
|
44
|
+
|
|
45
|
+
self.__active_ref: Optional[ReadonlyRef[str]] = None
|
|
46
|
+
self.__on_active_change_with_mounted(mouted)
|
|
47
|
+
|
|
48
|
+
if on_active_change:
|
|
49
|
+
self.on_active_change(on_active_change)
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def active_value(self) -> str:
|
|
53
|
+
"""the current breakpoint value."""
|
|
54
|
+
return self.__active_value
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def active(self):
|
|
58
|
+
"""the current breakpoint value as a ref."""
|
|
59
|
+
if self.__active_ref is None:
|
|
60
|
+
active = to_ref(self.__active_value)
|
|
61
|
+
|
|
62
|
+
self.__on_active_change_with_mounted(lambda value: active.set_value(value))
|
|
63
|
+
self.__active_ref = ref_computed(lambda: active.value)
|
|
64
|
+
|
|
65
|
+
return self.__active_ref
|
|
66
|
+
|
|
67
|
+
def between(self, start: str, end: str) -> ReadonlyRef[bool]:
|
|
68
|
+
"""whether the current breakpoint is between the start and end values."""
|
|
69
|
+
|
|
70
|
+
@ref_computed
|
|
71
|
+
def between_result():
|
|
72
|
+
return _Utils.is_between(
|
|
73
|
+
list(self.__options.keys()), self.active.value, start, end
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
return between_result
|
|
77
|
+
|
|
78
|
+
def is_between(self, start: str, end: str) -> bool:
|
|
79
|
+
"""whether the current breakpoint is between the start and end values.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
start (str): Detect the start value of the range.
|
|
83
|
+
end (str): Detect the end value of the range. not including.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
bool: True or False
|
|
87
|
+
"""
|
|
88
|
+
return _Utils.is_between(
|
|
89
|
+
list(self.__options.keys()), self.active_value, start, end
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def on_active_change(self, callback: Callable[[str], None]):
|
|
93
|
+
"""register a callback function to be called when the breakpoint changes.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
callback (Callable[[str], None]): the callback function to be called.
|
|
97
|
+
"""
|
|
98
|
+
self.__vue_use.on_event("active", callback)
|
|
99
|
+
|
|
100
|
+
def __on_active_change_with_mounted(self, callback: Callable[[str], None]):
|
|
101
|
+
self.__vue_use.on_event("activeWithMounted", callback)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class _Utils:
|
|
105
|
+
@staticmethod
|
|
106
|
+
def is_between(ranges: List[str], current: str, start: str, end: str) -> bool:
|
|
107
|
+
try:
|
|
108
|
+
current_index = ranges.index(current)
|
|
109
|
+
start_index = ranges.index(start)
|
|
110
|
+
end_index = ranges.index(end)
|
|
111
|
+
|
|
112
|
+
return start_index <= current_index < end_index
|
|
113
|
+
except ValueError:
|
|
114
|
+
return False
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import Callable, Optional, TypedDict
|
|
3
|
+
from ex4nicegui.toolbox.core.vue_use import VueUse
|
|
4
|
+
from ex4nicegui.utils.signals import to_ref, ref_computed
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
_QUASAR_DARK_OPTIONS: UseDarkOptions = {
|
|
8
|
+
"selector": "body",
|
|
9
|
+
"attribute": "class",
|
|
10
|
+
"valueDark": "body--dark dark",
|
|
11
|
+
"valueLight": "body--light",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class UseDarkOptions(TypedDict):
|
|
16
|
+
selector: str
|
|
17
|
+
attribute: str
|
|
18
|
+
valueDark: str
|
|
19
|
+
valueLight: str
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class UseDark:
|
|
23
|
+
def __init__(
|
|
24
|
+
self,
|
|
25
|
+
value: bool = True,
|
|
26
|
+
*,
|
|
27
|
+
options: Optional[UseDarkOptions] = None,
|
|
28
|
+
on_value_change: Optional[Callable[[bool], None]] = None,
|
|
29
|
+
):
|
|
30
|
+
"""Dark mode manager
|
|
31
|
+
|
|
32
|
+
@see - https://github.com/CrystalWindSnake/ex4nicegui/blob/main/README.en.md#use_dark
|
|
33
|
+
|
|
34
|
+
@中文文档 - https://gitee.com/carson_add/ex4nicegui/tree/main/#use_dark
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
value (bool, optional): Dark mode value. Defaults to True.
|
|
38
|
+
options (Optional[UseDarkOptions], optional): Options for dark mode manager. Defaults from Quasar dark mode manager.
|
|
39
|
+
on_value_change (Optional[Callable[[bool], None]], optional): Callback function when dark mode value changes. Defaults to None.
|
|
40
|
+
|
|
41
|
+
Example:
|
|
42
|
+
.. code-block:: python
|
|
43
|
+
from ex4nicegui import rxui, toolbox as tb
|
|
44
|
+
from nicegui import ui
|
|
45
|
+
|
|
46
|
+
dark = tb.use_dark()
|
|
47
|
+
|
|
48
|
+
rxui.label(lambda: f"Dark mode: {dark.value}")
|
|
49
|
+
rxui.button(
|
|
50
|
+
icon=lambda: "sunny" if dark.value else "dark_mode",
|
|
51
|
+
color=lambda: "red" if dark.value else "blue",
|
|
52
|
+
on_click=dark.toggle,
|
|
53
|
+
).props("flat round")
|
|
54
|
+
|
|
55
|
+
"""
|
|
56
|
+
options = options or _QUASAR_DARK_OPTIONS
|
|
57
|
+
|
|
58
|
+
self.__vue_use = VueUse("useDark", args=[options, value])
|
|
59
|
+
|
|
60
|
+
if on_value_change:
|
|
61
|
+
self.on_value_change(on_value_change)
|
|
62
|
+
|
|
63
|
+
self.__is_dark = to_ref(value)
|
|
64
|
+
self.__is_dark_computed = ref_computed(lambda: self.__is_dark.value)
|
|
65
|
+
|
|
66
|
+
@self.__on_value_change_with_mounted
|
|
67
|
+
def _(is_dark: bool):
|
|
68
|
+
self.__is_dark.value = is_dark
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def is_dark(self):
|
|
72
|
+
"""Dark mode value computed property."""
|
|
73
|
+
return self.__is_dark_computed
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def value(self) -> bool:
|
|
77
|
+
"""Dark mode value"""
|
|
78
|
+
return self.__is_dark.value
|
|
79
|
+
|
|
80
|
+
def on_value_change(self, callback: Callable[[bool], None]):
|
|
81
|
+
"""Callback function when dark mode value changes
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
callback (Callable[[bool], None]): Callback function.
|
|
85
|
+
"""
|
|
86
|
+
self.__vue_use.on_event("isDark", callback)
|
|
87
|
+
|
|
88
|
+
def toggle(self, value: Optional[bool] = None):
|
|
89
|
+
"""Toggle dark mode
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
value (Optional[bool], optional): Dark mode value. Defaults to None.
|
|
93
|
+
"""
|
|
94
|
+
self.__vue_use.run_method("toggleDark", value)
|
|
95
|
+
|
|
96
|
+
def __on_value_change_with_mounted(self, callback: Callable[[bool], None]):
|
|
97
|
+
self.__vue_use.on_event("isDarkWithMounted", callback)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from typing import Callable, Optional
|
|
2
|
+
from ex4nicegui.toolbox.core.vue_use import VueUse
|
|
3
|
+
from ex4nicegui.utils.signals import (
|
|
4
|
+
to_value,
|
|
5
|
+
TMaybeRef,
|
|
6
|
+
is_ref,
|
|
7
|
+
on,
|
|
8
|
+
to_ref,
|
|
9
|
+
ref_computed,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class UseQRCode:
|
|
14
|
+
def __init__(
|
|
15
|
+
self,
|
|
16
|
+
text: TMaybeRef[str],
|
|
17
|
+
*,
|
|
18
|
+
on_data_change: Optional[Callable[[str], None]] = None,
|
|
19
|
+
):
|
|
20
|
+
"""Create a QR code.
|
|
21
|
+
|
|
22
|
+
@see - https://github.com/CrystalWindSnake/ex4nicegui/blob/main/README.en.md#use_qr_code
|
|
23
|
+
|
|
24
|
+
@中文文档 - https://gitee.com/carson_add/ex4nicegui/tree/main/#use_qr_code
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
text (TMaybeRef[str]): The text to be encoded in the QR code.
|
|
28
|
+
on_data_change (Optional[Callable[[str], None]], optional): Callback function when qr code changes. Defaults to None.
|
|
29
|
+
|
|
30
|
+
Example:
|
|
31
|
+
.. code-block:: python
|
|
32
|
+
from ex4nicegui import rxui, to_ref, toolbox as tb
|
|
33
|
+
from nicegui import ui
|
|
34
|
+
|
|
35
|
+
text = to_ref("ex4nicegui")
|
|
36
|
+
qr_code = tb.use_qr_code(text)
|
|
37
|
+
|
|
38
|
+
rxui.input(value=text)
|
|
39
|
+
rxui.image(qr_code.code).classes("w-20 h-20").props("no-transition")
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
self.__vue_use = VueUse("useQRCode", args=[to_value(text)])
|
|
43
|
+
|
|
44
|
+
if on_data_change:
|
|
45
|
+
self.on_data_change(on_data_change)
|
|
46
|
+
|
|
47
|
+
self.__text = text
|
|
48
|
+
self.__qr_code = to_ref("")
|
|
49
|
+
self.code = ref_computed(lambda: self.__qr_code.value)
|
|
50
|
+
|
|
51
|
+
if is_ref(self.__text):
|
|
52
|
+
|
|
53
|
+
@on(self.__text, onchanges=True)
|
|
54
|
+
def _():
|
|
55
|
+
self.update_text(to_value(self.__text))
|
|
56
|
+
|
|
57
|
+
@self.on_data_change
|
|
58
|
+
def _on_data_change(data: str):
|
|
59
|
+
self.__qr_code.value = data
|
|
60
|
+
|
|
61
|
+
async def get_qr_code(self) -> str:
|
|
62
|
+
"""Get the QR code data.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
str: The QR code data.
|
|
66
|
+
"""
|
|
67
|
+
return await self.__vue_use.run_method("getQRCode")
|
|
68
|
+
|
|
69
|
+
def update_text(self, text: str):
|
|
70
|
+
"""Update the text to be encoded in the QR code.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
text (str): The new text to be encoded in the QR code.
|
|
74
|
+
"""
|
|
75
|
+
self.__vue_use.run_method("updateText", text)
|
|
76
|
+
|
|
77
|
+
def on_data_change(self, callback: Callable[[str], None]):
|
|
78
|
+
"""Callback function when qr code changes.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
callback (Callable[[bool], None]): Callback function.
|
|
82
|
+
"""
|
|
83
|
+
self.__vue_use.on_event("qrcode", callback)
|
|
@@ -21,6 +21,7 @@ def async_computed(
|
|
|
21
21
|
*,
|
|
22
22
|
init: Optional[_T] = None,
|
|
23
23
|
evaluating: Optional[TRef[bool]] = None,
|
|
24
|
+
onchanges=True,
|
|
24
25
|
debug_trigger: Optional[Callable] = None,
|
|
25
26
|
debug_name: Optional[str] = None,
|
|
26
27
|
):
|
|
@@ -34,12 +35,14 @@ def async_computed(
|
|
|
34
35
|
refs (Union[TGetterOrReadonlyRef, Sequence[TGetterOrReadonlyRef]]): _description_
|
|
35
36
|
init (Optional[_T], optional): The initial state, used until the first evaluation finishes. Defaults to None.
|
|
36
37
|
evaluating (Optional[TRef[bool]], optional): Ref passed to receive the updated of async evaluation. Defaults to None.
|
|
38
|
+
onchanges (bool, optional): If set to `False`, it will trigger an immediate computation. Defaults to True.
|
|
37
39
|
|
|
38
40
|
"""
|
|
39
41
|
return signe.async_computed(
|
|
40
42
|
refs,
|
|
41
43
|
init=init,
|
|
42
44
|
evaluating=evaluating,
|
|
45
|
+
onchanges=onchanges,
|
|
43
46
|
debug_name=debug_name,
|
|
44
47
|
debug_trigger=debug_trigger,
|
|
45
48
|
scope=_CLIENT_SCOPE_MANAGER.get_current_scope(),
|
ex4nicegui/utils/proxy/dict.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ex4nicegui
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.6
|
|
4
4
|
Summary: Extension library based on nicegui, providing data responsive,BI functionality modules
|
|
5
5
|
Home-page: https://github.com/CrystalWindSnake/ex4nicegui
|
|
6
6
|
License: MIT
|
|
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Requires-Dist: executing (>=2.0.1,<3.0.0)
|
|
19
19
|
Requires-Dist: nicegui (>=2.0.0,<3.0.0)
|
|
20
|
-
Requires-Dist: signe (>=0.4.
|
|
20
|
+
Requires-Dist: signe (>=0.4.22,<0.5.0)
|
|
21
21
|
Project-URL: Repository, https://github.com/CrystalWindSnake/ex4nicegui
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
|
|
@@ -466,6 +466,10 @@ class MyApp(rxui.ViewModel):
|
|
|
466
466
|
- [ui\_select](#ui_select)
|
|
467
467
|
- [ui\_table](#ui_table)
|
|
468
468
|
- [ui\_aggrid](#ui_aggrid)
|
|
469
|
+
- [toolbox](#toolbox)
|
|
470
|
+
- [use\_dark](#use_dark)
|
|
471
|
+
- [use\_breakpoints](#use_breakpoints)
|
|
472
|
+
- [use\_qr\_code](#use_qr_code)
|
|
469
473
|
|
|
470
474
|
---
|
|
471
475
|
|
|
@@ -1799,3 +1803,86 @@ source.ui_aggrid(
|
|
|
1799
1803
|
|
|
1800
1804
|
|
|
1801
1805
|
|
|
1806
|
+
|
|
1807
|
+
### toolbox
|
|
1808
|
+
|
|
1809
|
+
`toolbox` 模块提供了一些常用的工具函数。
|
|
1810
|
+
|
|
1811
|
+
```python
|
|
1812
|
+
from ex4nicegui import toolbox
|
|
1813
|
+
```
|
|
1814
|
+
|
|
1815
|
+
#### use_dark
|
|
1816
|
+
|
|
1817
|
+
切换暗模式
|
|
1818
|
+
|
|
1819
|
+
```python
|
|
1820
|
+
from ex4nicegui import rxui, toolbox as tb
|
|
1821
|
+
from nicegui import ui
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
dark = tb.use_dark(False)
|
|
1825
|
+
|
|
1826
|
+
rxui.label(lambda: f"暗模式: {dark.value}")
|
|
1827
|
+
rxui.button(
|
|
1828
|
+
icon=lambda: "sunny" if dark.value else "dark_mode",
|
|
1829
|
+
color=lambda: "red" if dark.value else "blue",
|
|
1830
|
+
on_click=dark.toggle,
|
|
1831
|
+
).props("flat round")
|
|
1832
|
+
|
|
1833
|
+
```
|
|
1834
|
+
|
|
1835
|
+
#### use_breakpoints
|
|
1836
|
+
|
|
1837
|
+
响应式断点
|
|
1838
|
+
|
|
1839
|
+
```python
|
|
1840
|
+
from ex4nicegui import rxui, toolbox as tb
|
|
1841
|
+
from nicegui import ui
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
options = {"手机": 0, "平板": 640, "笔记本": 1024, "桌面": 1280}
|
|
1845
|
+
bp = tb.use_breakpoints(options)
|
|
1846
|
+
active = bp.active
|
|
1847
|
+
is_between = bp.between("手机", "笔记本")
|
|
1848
|
+
|
|
1849
|
+
with ui.card():
|
|
1850
|
+
rxui.label(lambda: f"当前断点: {active.value}")
|
|
1851
|
+
rxui.label(lambda: f"是否在手机-笔记本(不含)之间: {is_between.value}").bind_classes(
|
|
1852
|
+
{"text-red-500": is_between}
|
|
1853
|
+
)
|
|
1854
|
+
|
|
1855
|
+
rxui.label(lambda: f'手机(0px - 640px): {active.value == "手机"}').bind_classes(
|
|
1856
|
+
{"bg-red-300": lambda: active.value == "手机"}
|
|
1857
|
+
)
|
|
1858
|
+
rxui.label(lambda: f'平板(640px - 1024px): {active.value == "平板"}').bind_classes(
|
|
1859
|
+
{"bg-red-300": lambda: active.value == "平板"}
|
|
1860
|
+
)
|
|
1861
|
+
rxui.label(
|
|
1862
|
+
lambda: f'笔记本(1024px - 1280px): {active.value == "笔记本"}'
|
|
1863
|
+
).bind_classes({"bg-red-300": lambda: active.value == "笔记本"})
|
|
1864
|
+
rxui.label(lambda: f'桌面(1280px+): {active.value == "桌面"}').bind_classes(
|
|
1865
|
+
{"bg-red-300": lambda: active.value == "桌面"}
|
|
1866
|
+
)
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
```
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+
#### use_qr_code
|
|
1873
|
+
|
|
1874
|
+
生成二维码
|
|
1875
|
+
|
|
1876
|
+
```python
|
|
1877
|
+
from ex4nicegui import rxui, to_ref, toolbox as tb
|
|
1878
|
+
from nicegui import ui
|
|
1879
|
+
|
|
1880
|
+
|
|
1881
|
+
text = to_ref("ex4nicegui")
|
|
1882
|
+
qr_code = tb.use_qr_code(text)
|
|
1883
|
+
|
|
1884
|
+
rxui.input(value=text)
|
|
1885
|
+
rxui.image(qr_code.code).classes("w-20 h-20").props("no-transition")
|
|
1886
|
+
```
|
|
1887
|
+
|
|
1888
|
+
|
|
@@ -70,16 +70,16 @@ ex4nicegui/libs/gsap/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
70
70
|
ex4nicegui/libs/gsap/utils/matrix.js,sha256=77scrxbQZXx4ex5HkvnT9IkhMG1rQoDNp4TSYgUeYVk,15235
|
|
71
71
|
ex4nicegui/libs/gsap/utils/paths.js,sha256=2SPaRHQ7zgba9cH8hGhkTYPCZdrrEhE2qhh6ECAEvSA,49314
|
|
72
72
|
ex4nicegui/libs/gsap/utils/strings.js,sha256=47G9slz5ltG9mDSwrfQDtWzzdV5QJ-AIMLRMNK0VSiM,10472
|
|
73
|
-
ex4nicegui/reactive/__init__.py,sha256=
|
|
73
|
+
ex4nicegui/reactive/__init__.py,sha256=I5GhhBCPBIVj3vhLE7Zf_UpjIK7ZOwCFFCC3YNPE4Rs,4668
|
|
74
74
|
ex4nicegui/reactive/base.py,sha256=CQmWhrKHNMF2ql7O6VOKEOBdEcc3-yagOcERpnUPYus,16323
|
|
75
75
|
ex4nicegui/reactive/deferredTask.py,sha256=g78TTG1EIkBxjPih01xmrCZw9OxQG93veSVSELWKfcU,987
|
|
76
76
|
ex4nicegui/reactive/dropZone/dropZone.js,sha256=7rSpFJX-Fk_W_NGZhOTyuEw0bzR-YUc8ZYPzQG9KzE0,2713
|
|
77
77
|
ex4nicegui/reactive/dropZone/dropZone.py,sha256=hg9UKTayff8v8Ek-n38h_3wX1Qmiotvdyv1Hsqilh5Y,2590
|
|
78
78
|
ex4nicegui/reactive/EChartsComponent/ECharts.js,sha256=K9sX34SMnghwDMCkl-IA7WsntxyryeRsboihkIwDb84,3852
|
|
79
79
|
ex4nicegui/reactive/EChartsComponent/ECharts.py,sha256=jLRdKqJWCtKHzNlFAX9ePAmzP1WSXRzBQAO0KHHkfBA,4258
|
|
80
|
-
ex4nicegui/reactive/EChartsComponent/events.py,sha256=
|
|
80
|
+
ex4nicegui/reactive/EChartsComponent/events.py,sha256=ln10cNw5ODiSmdKVi6KBZ6JMR3YIZ6itYZcMgNAlKhA,741
|
|
81
81
|
ex4nicegui/reactive/EChartsComponent/types.py,sha256=_7AekG0IyzRpDEBZMtKRiZ3o3dUCcn6btegBk8c9Fig,1001
|
|
82
|
-
ex4nicegui/reactive/EChartsComponent/utils.py,sha256=
|
|
82
|
+
ex4nicegui/reactive/EChartsComponent/utils.py,sha256=YqxodbGD_lk_Bp-K8s8XvgqSXRf_CIHmzeubrqFRuVM,1013
|
|
83
83
|
ex4nicegui/reactive/empty.js,sha256=Y-caS4CN8jUq59LgGgcvgfkndze-RgWF_ZMmAcxOrbw,50
|
|
84
84
|
ex4nicegui/reactive/empty.py,sha256=kB851B12V1_VCNsFKW6OmjcdIiuZqGEGjLgA6k6yug8,132
|
|
85
85
|
ex4nicegui/reactive/fileWatcher.py,sha256=gjeZhgar02f-qGQa47Tj5SMaCP_ftRtSU898XUmXl1U,1472
|
|
@@ -108,21 +108,22 @@ ex4nicegui/reactive/officials/drawer.py,sha256=_Ro6stOh8U3igYMeDwI4omBgi1nld5ber
|
|
|
108
108
|
ex4nicegui/reactive/officials/echarts.py,sha256=xRBKVbcCUwUGA8n7bw2eJj9FBQIayL4t_rzXZrjD3Pc,10895
|
|
109
109
|
ex4nicegui/reactive/officials/element.py,sha256=-qsHcxfF3fMfU0sJlKtTksX_wYPMIPJ_AgFcZbbI754,412
|
|
110
110
|
ex4nicegui/reactive/officials/expansion.py,sha256=8xwJa0SpsVhFxbYwYRZtf1ul9m4oYTjgmtrRI_lqF_0,1822
|
|
111
|
-
ex4nicegui/reactive/officials/grid.py,sha256=
|
|
111
|
+
ex4nicegui/reactive/officials/grid.py,sha256=0vLLJOe7t_b351TsYOWpnrPsWKaqV_bG_010Xp-_BfY,2012
|
|
112
112
|
ex4nicegui/reactive/officials/html.js,sha256=lyvRAdMKZGOc7MPEapeU6WbOzq_MVzqzUJEhKuC8zWc,119
|
|
113
113
|
ex4nicegui/reactive/officials/html.py,sha256=XrOpGoAJDo8dtTnZVLSmi7H5iHffmYpeZ94lXxHjBwI,629
|
|
114
114
|
ex4nicegui/reactive/officials/icon.py,sha256=Um1yS681pcbsZ4o7GU_2w1NCfwFVXNu1a4asB2hzYUg,1374
|
|
115
115
|
ex4nicegui/reactive/officials/image.py,sha256=ySu2gqVQIuLMUTItcp233Iqnx86P0q0MU8EVq07yuMk,1141
|
|
116
|
-
ex4nicegui/reactive/officials/input.py,sha256=
|
|
116
|
+
ex4nicegui/reactive/officials/input.py,sha256=IWjtWg3qxgnMw4CG1RztKHM6P-_Kb7xCYT9BEaJ9WNc,4816
|
|
117
117
|
ex4nicegui/reactive/officials/knob.py,sha256=TPKrquOBD9fBI9aBipE0qYy22dQJCcX9wNZQGplRs8M,2227
|
|
118
118
|
ex4nicegui/reactive/officials/label.py,sha256=kCair4NpFB7bvsPukMFcDBqDXk2BxOLzBQXSNx5EWuw,1428
|
|
119
119
|
ex4nicegui/reactive/officials/linear_progress.py,sha256=T-z8_68FxSwdFH0hBFMA2X0JEeLoVFpJyya5RHlf7U8,2045
|
|
120
120
|
ex4nicegui/reactive/officials/number.py,sha256=L_uMY-t5SONENI3b44DjSi7JwcdfYAldGZCvqX1h6Dw,2796
|
|
121
|
-
ex4nicegui/reactive/officials/radio.py,sha256=
|
|
122
|
-
ex4nicegui/reactive/officials/range.py,sha256=
|
|
121
|
+
ex4nicegui/reactive/officials/radio.py,sha256=QutXtEwtwqhWc3GKuBUotmpt0cbo3bEPHS4LMG2ORtM,2249
|
|
122
|
+
ex4nicegui/reactive/officials/range.py,sha256=cyyJNRZEpUo4nanBS_0wDH7Kt5riDbDbu9EENYUuq80,3166
|
|
123
123
|
ex4nicegui/reactive/officials/row.py,sha256=ZWJnb6nC9XMfmRmzeVKnHwUnxrCpbxaEBJ3lSVj5m5s,1384
|
|
124
|
-
ex4nicegui/reactive/officials/select.py,sha256=
|
|
124
|
+
ex4nicegui/reactive/officials/select.py,sha256=HqaltQJ9cqhWpXkI2d5Yi9h8cqOGYTZB9hHU7RiitrE,3035
|
|
125
125
|
ex4nicegui/reactive/officials/slider.py,sha256=9pA7CHlfkKY-kLQGWn4VOnMa2-tXHI04R1YA4xENIWI,2871
|
|
126
|
+
ex4nicegui/reactive/officials/spinner.py,sha256=OULF1DWK3vHE87NPV128HJXX2Rpo7jS1vutmO9Z1Vnk,1373
|
|
126
127
|
ex4nicegui/reactive/officials/switch.py,sha256=XMUdOVP357gGVNU_tjrBtxw5Xuk5MyhLhHI-6sTtCcc,1456
|
|
127
128
|
ex4nicegui/reactive/officials/tab.py,sha256=nyB7Ksc_tWG-RaAXiu3TTIJvkNeSa9AZdwHXuL2SsOE,1433
|
|
128
129
|
ex4nicegui/reactive/officials/tab_panel.py,sha256=yRgQBSCbrkcw59M8HlIWc2GaXhqC4awRQlYug0AkBtE,2501
|
|
@@ -130,8 +131,9 @@ ex4nicegui/reactive/officials/tab_panels.py,sha256=dN5anN03DlpDvkUP_QiY047i4mO7K
|
|
|
130
131
|
ex4nicegui/reactive/officials/table.py,sha256=B_nX19UxwyxGKsxLuu2x4UNwxsapjTBw70RMBWDI8w0,6206
|
|
131
132
|
ex4nicegui/reactive/officials/tabs.py,sha256=kvAXeZkgi8USCyxislvjPmmWofZ31DMfiHqEObANpYU,1247
|
|
132
133
|
ex4nicegui/reactive/officials/textarea.py,sha256=_N6eDW_Cbn4Z4OEcjC4koHt0kEEaFEjDrLZ9Ju2NpsQ,3000
|
|
133
|
-
ex4nicegui/reactive/officials/toggle.py,sha256=
|
|
134
|
+
ex4nicegui/reactive/officials/toggle.py,sha256=qpTcoQHZ0Uw2OGRU6XIYP1SHJgXqB7giPQdMkd8jTNQ,2820
|
|
134
135
|
ex4nicegui/reactive/officials/tooltip.py,sha256=lkDOf5Z6vpDsO9Y-nsRRwdhmYVFb9YrWv7lQUNY4_Ho,1136
|
|
136
|
+
ex4nicegui/reactive/officials/tree.py,sha256=qNgAU8rPfORXlz432wZihWEEtuLrWp8SaBZKZJsYIU4,3684
|
|
135
137
|
ex4nicegui/reactive/officials/upload.py,sha256=5SX2CFkf3s_4bPcnx0bmKRA4eYVlm0S8RBeQ7qHnqck,2395
|
|
136
138
|
ex4nicegui/reactive/q_pagination.py,sha256=nUszZ4fvCf4leQ1DpS70laCDf40RprbOex7SISbAEek,1555
|
|
137
139
|
ex4nicegui/reactive/rxui.py,sha256=gZ8ZEjGuJFKcedEZhcm4PIZguNkY-Wv5yQx80QnsBKI,31
|
|
@@ -141,7 +143,7 @@ ex4nicegui/reactive/services/pandas_service.py,sha256=XOoy6tZr4TpTyhewAH59eiSwVF
|
|
|
141
143
|
ex4nicegui/reactive/services/reactive_service.py,sha256=FT8tWCC_aMD1YK6V4jQreyGmQAbcWzKbaGGZ4ME-bKw,3659
|
|
142
144
|
ex4nicegui/reactive/systems/color_system.py,sha256=qXRTczxfILduHAVlNJqLSed-0x-LN6TyBSegYwW9vfk,4352
|
|
143
145
|
ex4nicegui/reactive/systems/object_system.py,sha256=bja9YNb4v5fVZl5gJvVA4HbwRssRp-2yFy3JBzNeKxA,752
|
|
144
|
-
ex4nicegui/reactive/systems/reactive_system.py,sha256=
|
|
146
|
+
ex4nicegui/reactive/systems/reactive_system.py,sha256=s4mOfaMD0Dzv_-HjzzTMcqeo5YWMF4NSDN8hIbhPAoM,973
|
|
145
147
|
ex4nicegui/reactive/transitionGroup.js,sha256=rbfNU3Jrz9WFDQih3BgZOgC1MBr6j9cODZ9XggMAaTs,898
|
|
146
148
|
ex4nicegui/reactive/transitionGroup.py,sha256=VWyYL3QUfX6YQXuxwBFF4sJ4P5VP1S-bCjLKUr28KEY,597
|
|
147
149
|
ex4nicegui/reactive/UseDraggable/UseDraggable.js,sha256=xZm_g_L2lamxAjiAeGPDR0CNmjlvgzuiJ6gH77pNrg4,5473
|
|
@@ -153,11 +155,17 @@ ex4nicegui/reactive/vfor.js,sha256=sCy3KR5Aeyx68yh9VI6I9Vj7bnVuir_LUYKZBe_ePTg,9
|
|
|
153
155
|
ex4nicegui/reactive/vfor.py,sha256=SSu3X2DLZeCveTrcLANYNMNpLv34cJonLCp_9W0HFlY,7931
|
|
154
156
|
ex4nicegui/reactive/view_model.py,sha256=1V5s_uBx9N_Iv2b0tJLsRA_7LNBi6ySlge-rbyQkCC8,8792
|
|
155
157
|
ex4nicegui/reactive/vmodel.py,sha256=ymrUpC_68jaHF76ivKmgz-C4Xl6i65c_41uMc0ffEhY,5936
|
|
158
|
+
ex4nicegui/toolbox/__init__.py,sha256=Q5pIvMJX5Ugf2dLcffU4wK6DFQW_qsKV5iTJPoALvTQ,235
|
|
159
|
+
ex4nicegui/toolbox/core/vue_use.py,sha256=0wzNJTDuZ08BNEVs0ibXiinje8SQIpeqEJIoug25iwg,969
|
|
160
|
+
ex4nicegui/toolbox/core/VueUse.js,sha256=TUpTJEygebNLgn-JvTf1rVQL0Ro-vw6Ej28_YxKRCTc,51127
|
|
161
|
+
ex4nicegui/toolbox/functions/breakpoint.py,sha256=mBFBmLCJrzxV6h9jzVrMfcHdA7QiM8EC7y2y0T39uAQ,4059
|
|
162
|
+
ex4nicegui/toolbox/functions/dark.py,sha256=XqvTqu2CCEQZrpYVou1G1wOWysqmowRNoFBHpcPxaNw,3141
|
|
163
|
+
ex4nicegui/toolbox/functions/qr_code.py,sha256=4DQkjFczU9D4SFYx1Wj4VHROsUm3hbVUkqMVNQTgHbE,2502
|
|
156
164
|
ex4nicegui/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
157
165
|
ex4nicegui/tools/debug.py,sha256=h9iYHxw7jWWvmiExSpGi2hQl1PfhPZgC2KNS_GTuHSw,4868
|
|
158
166
|
ex4nicegui/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
159
167
|
ex4nicegui/utils/apiEffect.py,sha256=uwIi-R4Q0MaGSVmvhEFIL0O8pjBWobB_8brGAe19Qm4,2645
|
|
160
|
-
ex4nicegui/utils/asyncComputed.py,sha256
|
|
168
|
+
ex4nicegui/utils/asyncComputed.py,sha256=LPb4ytvzsUEV4sKQ9bQASJn2VPB_pjZzeKcHVwcvb_c,1672
|
|
161
169
|
ex4nicegui/utils/clientScope.py,sha256=AM5GQLXSIrLALnzz72ZmplykhKVhRjRxQdHdAeR7g7k,1719
|
|
162
170
|
ex4nicegui/utils/common.py,sha256=7P0vboDadLun6EMxNi3br9rKJgKt0QT4sy_66cHEwb4,994
|
|
163
171
|
ex4nicegui/utils/effect.py,sha256=LTtPTxx8-sP4VtZaFQjERB-ef3L2y5hu95GvTdj-nLo,2400
|
|
@@ -166,7 +174,7 @@ ex4nicegui/utils/proxy/base.py,sha256=g_7308xGAB3bB3EiEf_-0JKfUzImwt5_T9XVyT7zJJ
|
|
|
166
174
|
ex4nicegui/utils/proxy/bool.py,sha256=KQ2Sp2r4nLScif9DhupDmkpRhbsuXdpXTkxSrtFYtDE,1774
|
|
167
175
|
ex4nicegui/utils/proxy/date.py,sha256=wS0M4nfGVQ7A1u9tJkPqilEhDwcMKBjtTC9VjUsOqac,2356
|
|
168
176
|
ex4nicegui/utils/proxy/descriptor.py,sha256=VuPBXAE7mHbJ3EUAsftr3mettDvju79bR-SlwczRrAs,4594
|
|
169
|
-
ex4nicegui/utils/proxy/dict.py,sha256=
|
|
177
|
+
ex4nicegui/utils/proxy/dict.py,sha256=MPtx-09ylf_bHXnkr1c7PmJeaq2KpDp-_Shyw5YjOLU,3046
|
|
170
178
|
ex4nicegui/utils/proxy/float.py,sha256=fdMUS7_xwypdDNscuZaUn3NA0vx8LGswAOc9kw0jK0c,5271
|
|
171
179
|
ex4nicegui/utils/proxy/int.py,sha256=0Y7L924Zzq6LWRZEmaTmoXf0J6kC0o5EtW--2Lk7SNw,7381
|
|
172
180
|
ex4nicegui/utils/proxy/list.py,sha256=bmjBMlO8UfJekL1nfGypMO21RKraIj1jw46-8QwfptE,4913
|
|
@@ -178,7 +186,7 @@ ex4nicegui/utils/scheduler.py,sha256=1gyq7Y2BkbwmPK_Q9kpRpc1MOC9H7xcpxuix-RZhN9k
|
|
|
178
186
|
ex4nicegui/utils/signals.py,sha256=Jz0jKFPrJIRV0Gye62Bgk2kGgod1KBvDhnF-W3lRm04,7373
|
|
179
187
|
ex4nicegui/utils/types.py,sha256=pE5WOSbcTHxaAhnT24FaZEd1B2Z_lTcsd46w0OKiMyc,359
|
|
180
188
|
ex4nicegui/version.py,sha256=NE7u1piESstg3xCtf5hhV4iedGs2qJQw9SiC3ZSpiio,90
|
|
181
|
-
ex4nicegui-0.8.
|
|
182
|
-
ex4nicegui-0.8.
|
|
183
|
-
ex4nicegui-0.8.
|
|
184
|
-
ex4nicegui-0.8.
|
|
189
|
+
ex4nicegui-0.8.6.dist-info/LICENSE,sha256=0KDDElS2dl-HIsWvbpy8ywbLzJMBFzXLev57LnMIZXs,1094
|
|
190
|
+
ex4nicegui-0.8.6.dist-info/METADATA,sha256=_cFoYls_MNIYvzX1RQEo_95byNPo0WgBbj7hKZiG3c8,46125
|
|
191
|
+
ex4nicegui-0.8.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
192
|
+
ex4nicegui-0.8.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|