ex4nicegui 0.8.8__py3-none-any.whl → 0.8.10__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/__init__.py CHANGED
@@ -25,6 +25,7 @@ from ex4nicegui.utils.signals import (
25
25
  )
26
26
  from ex4nicegui.utils.asyncComputed import async_computed
27
27
  from ex4nicegui.utils.clientScope import new_scope
28
+ from ex4nicegui.reactive.EChartsComponent.ECharts import reset_echarts_dependencies
28
29
  from .version import __version__
29
30
 
30
31
  __all__ = [
@@ -51,5 +52,6 @@ __all__ = [
51
52
  "is_setter_ref",
52
53
  "new_scope",
53
54
  "next_tick",
55
+ "reset_echarts_dependencies",
54
56
  "__version__",
55
57
  ]
@@ -136,3 +136,24 @@ class echarts(Element, component="ECharts.js", dependencies=libraries): # type:
136
136
  *args,
137
137
  timeout=timeout,
138
138
  )
139
+
140
+
141
+ def reset_echarts_dependencies(echarts_js_file: Union[str, Path]):
142
+ """
143
+ Reset the echarts dependencies to use a custom echarts.min.js file.
144
+
145
+ :param echarts_js_file: path to the custom echarts.min.js file
146
+
147
+ Usage:
148
+ .. code-block:: python
149
+
150
+ from ex4nicegui import reset_echarts_dependencies
151
+ reset_echarts_dependencies("path/to/echarts.min.js")
152
+ """
153
+
154
+ global echarts
155
+
156
+ class _Echarts(echarts, component="ECharts.js", dependencies=[echarts_js_file]):
157
+ pass
158
+
159
+ echarts = _Echarts
@@ -11,7 +11,7 @@ from ex4nicegui.utils.signals import (
11
11
  _TMaybeRef as TMaybeRef,
12
12
  )
13
13
  from nicegui import ui
14
- from nicegui.page_layout import Drawer
14
+ from nicegui.elements.drawer import Drawer
15
15
  from .base import BindableUi
16
16
 
17
17
  _TDrawerSide = Literal["left", "right"]
@@ -1,4 +1,5 @@
1
1
  from datetime import date, datetime
2
+ import inspect
2
3
  import signe
3
4
  from signe.core.scope import Scope
4
5
  from .clientScope import _CLIENT_SCOPE_MANAGER
@@ -13,6 +14,7 @@ from typing import (
13
14
  Sequence,
14
15
  )
15
16
  from nicegui import ui
17
+ from nicegui.functions.refreshable import RefreshableContainer
16
18
  from .effect import effect
17
19
  from .scheduler import get_uiScheduler
18
20
  from .types import (
@@ -168,6 +170,9 @@ class effect_refreshable:
168
170
  def warp(
169
171
  fn: Callable,
170
172
  ):
173
+ if inspect.iscoroutinefunction(fn):
174
+ return async_effect_refreshable(refs)(fn)
175
+
171
176
  return effect_refreshable(fn, refs)
172
177
 
173
178
  return warp
@@ -194,6 +199,27 @@ class effect_refreshable:
194
199
  return runner
195
200
 
196
201
 
202
+ def async_effect_refreshable(source: _T_effect_refreshable_refs):
203
+ def wrapper(fn: Callable[[], Any]):
204
+ @on(source, onchanges=False)
205
+ async def on_source_changed():
206
+ with temp_box:
207
+ await fn()
208
+
209
+ container.clear()
210
+
211
+ for child in list(temp_box):
212
+ child.move(container)
213
+
214
+ temp_box.clear()
215
+
216
+ # 临时容器做中转,避免异步等待时,页面内容空白的问题
217
+ temp_box = RefreshableContainer()
218
+ container = RefreshableContainer()
219
+
220
+ return wrapper
221
+
222
+
197
223
  def on(
198
224
  refs: Union[TGetterOrReadonlyRef, RefWrapper, Sequence[TGetterOrReadonlyRef], Any],
199
225
  onchanges=False,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ex4nicegui
3
- Version: 0.8.8
3
+ Version: 0.8.10
4
4
  Summary: Extension library based on nicegui, providing data responsive,BI functionality modules
5
5
  License: MIT
6
6
  Keywords: nicegui,ex4nicegui,webui
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
18
  Requires-Dist: executing (>=2.0.1,<3.0.0)
19
- Requires-Dist: nicegui (>=2.0.0,<3.0.0)
19
+ Requires-Dist: nicegui (>=2.21.1,<3.0.0)
20
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
@@ -1,4 +1,4 @@
1
- ex4nicegui/__init__.py,sha256=olowSWbRsHGj1uoL28cZ5697vwXUzgJzusMVFe7adfg,1116
1
+ ex4nicegui/__init__.py,sha256=uLZbmhk7iRVcT61bKRDjOZ00XMwffPaiEjzOpGiqo6U,1236
2
2
  ex4nicegui/bi/__init__.py,sha256=eu-2CuzzrcHCyKQOfoo87v6C9nSwFDdeLhjY0cRV13M,315
3
3
  ex4nicegui/bi/dataSource.py,sha256=hOOUN4PpSfPx4Vp1sg9Sfxi5K-wROw9C22Z-mmNXs6w,7644
4
4
  ex4nicegui/bi/dataSourceFacade.py,sha256=6p4gXxEd8pGHoM8w4h8Ojy-_ZxIUqlJHIdbGwdNdh5U,8248
@@ -76,7 +76,7 @@ ex4nicegui/reactive/deferredTask.py,sha256=g78TTG1EIkBxjPih01xmrCZw9OxQG93veSVSE
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=Dhsfzlio9zO2T3LhK5cI7IdPXHtWhbBXMdlL3uvkU24,4110
79
- ex4nicegui/reactive/EChartsComponent/ECharts.py,sha256=NjJocWIEF4xzvRQVbkTQSaB2fF_GIVf2_QaMKjln9hU,4359
79
+ ex4nicegui/reactive/EChartsComponent/ECharts.py,sha256=AwUvuAMHtzK4iXPG2TqmNUvppkEAlY_axDl9nh1lqTA,4907
80
80
  ex4nicegui/reactive/EChartsComponent/events.py,sha256=ln10cNw5ODiSmdKVi6KBZ6JMR3YIZ6itYZcMgNAlKhA,741
81
81
  ex4nicegui/reactive/EChartsComponent/types.py,sha256=_7AekG0IyzRpDEBZMtKRiZ3o3dUCcn6btegBk8c9Fig,1001
82
82
  ex4nicegui/reactive/EChartsComponent/utils.py,sha256=YqxodbGD_lk_Bp-K8s8XvgqSXRf_CIHmzeubrqFRuVM,1013
@@ -104,7 +104,7 @@ ex4nicegui/reactive/officials/color_picker.py,sha256=tA6qZxGt_cs4WaQaeZYH6eE7LFz
104
104
  ex4nicegui/reactive/officials/column.py,sha256=fllKknMEUw7uNhmP7w4pgBT7HTDbpkN-dqwHOldahzs,1406
105
105
  ex4nicegui/reactive/officials/date.py,sha256=lRiJNrgs_oNo9AZTfTX_66dYL7az4co5rfRyIzvGAIo,2440
106
106
  ex4nicegui/reactive/officials/dialog.py,sha256=3dyrvsUwM1Q7jr_PgLKt92KDA6Hris0DH90-sKamfFE,1297
107
- ex4nicegui/reactive/officials/drawer.py,sha256=_Ro6stOh8U3igYMeDwI4omBgi1nld5berrAk9Dv5RVw,2346
107
+ ex4nicegui/reactive/officials/drawer.py,sha256=-SCkFsNzSODT6mL0ALGXz73K8UycoECvvKJW6yNOyGU,2350
108
108
  ex4nicegui/reactive/officials/echarts.py,sha256=ANI74NjGFLF7LoABbc8x9L2Z5nLOguptoK4iUIoSizY,12288
109
109
  ex4nicegui/reactive/officials/element.py,sha256=-qsHcxfF3fMfU0sJlKtTksX_wYPMIPJ_AgFcZbbI754,412
110
110
  ex4nicegui/reactive/officials/expansion.py,sha256=8xwJa0SpsVhFxbYwYRZtf1ul9m4oYTjgmtrRI_lqF_0,1822
@@ -183,10 +183,10 @@ ex4nicegui/utils/proxy/utils.py,sha256=8LawrZ8KmzP64iCmweFJh4kmwEvRxOp7MwV7AsnEM
183
183
  ex4nicegui/utils/refComputed.py,sha256=Vb7fyi0wNieFeLfCjXl6wSzpws3i6_aeCka1s9dsc8E,4232
184
184
  ex4nicegui/utils/refWrapper.py,sha256=gX5sdfC1P4UXmMYM6FwdImfLD39y02kq7Af6dIMDrZ8,1472
185
185
  ex4nicegui/utils/scheduler.py,sha256=1gyq7Y2BkbwmPK_Q9kpRpc1MOC9H7xcpxuix-RZhN9k,1787
186
- ex4nicegui/utils/signals.py,sha256=Jz0jKFPrJIRV0Gye62Bgk2kGgod1KBvDhnF-W3lRm04,7373
186
+ ex4nicegui/utils/signals.py,sha256=rQW96b6WcJxXRrxkbSgf1r29RSt-nY5qW_FGrglydxQ,8155
187
187
  ex4nicegui/utils/types.py,sha256=pE5WOSbcTHxaAhnT24FaZEd1B2Z_lTcsd46w0OKiMyc,359
188
188
  ex4nicegui/version.py,sha256=NE7u1piESstg3xCtf5hhV4iedGs2qJQw9SiC3ZSpiio,90
189
- ex4nicegui-0.8.8.dist-info/LICENSE,sha256=0KDDElS2dl-HIsWvbpy8ywbLzJMBFzXLev57LnMIZXs,1094
190
- ex4nicegui-0.8.8.dist-info/METADATA,sha256=F65K1T5Q-aq5j43kfUik17A08SdSUBNJnAsPWLLjTQk,46832
191
- ex4nicegui-0.8.8.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
192
- ex4nicegui-0.8.8.dist-info/RECORD,,
189
+ ex4nicegui-0.8.10.dist-info/LICENSE,sha256=0KDDElS2dl-HIsWvbpy8ywbLzJMBFzXLev57LnMIZXs,1094
190
+ ex4nicegui-0.8.10.dist-info/METADATA,sha256=Xu91UiZHZ6gemCwKXGXbPjmjyiypP-LjopE9PhkS7sQ,46834
191
+ ex4nicegui-0.8.10.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
192
+ ex4nicegui-0.8.10.dist-info/RECORD,,