instaui 0.2.1__py2.py3-none-any.whl → 0.2.2__py2.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.
instaui/ui/__init__.py CHANGED
@@ -50,6 +50,8 @@ __all__ = [
50
50
  "context",
51
51
  "row",
52
52
  "grid",
53
+ "container",
54
+ "heading",
53
55
  "js",
54
56
  "watch",
55
57
  "vue_watch",
@@ -103,6 +105,8 @@ from instaui.components.element import Element as element
103
105
  from instaui.components.row import Row as row
104
106
  from instaui.components.column import Column as column
105
107
  from instaui.components.grid import Grid as grid
108
+ from instaui.components.container import Container as container
109
+ from instaui.components.heading import Heading as heading
106
110
  from instaui.components.directive import Directive as directive
107
111
  from instaui.components.vfor import VFor as vfor
108
112
  from instaui.components.vif import VIf as vif
instaui/ui/__init__.pyi CHANGED
@@ -50,6 +50,8 @@ __all__ = [
50
50
  "context",
51
51
  "row",
52
52
  "grid",
53
+ "container",
54
+ "heading",
53
55
  "js",
54
56
  "watch",
55
57
  "vue_watch",
@@ -103,6 +105,8 @@ from instaui.components.element import Element as element
103
105
  from instaui.components.row import Row as row
104
106
  from instaui.components.column import Column as column
105
107
  from instaui.components.grid import Grid as grid
108
+ from instaui.components.container import Container as container
109
+ from instaui.components.heading import Heading as heading
106
110
  from instaui.components.directive import Directive as directive
107
111
  from instaui.components.vfor import VFor as vfor
108
112
  from instaui.components.vif import VIf as vif
@@ -0,0 +1,6 @@
1
+ from typing import Literal
2
+
3
+
4
+ TSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]
5
+ TWeight = Literal["light", "regular", "medium", "bold"]
6
+ TAlign = Literal["left", "center", "right"]
@@ -1,4 +1,5 @@
1
1
  from abc import ABC, abstractmethod
2
+ from typing import Sequence
2
3
 
3
4
 
4
5
  class CanInputMixin(ABC):
@@ -11,3 +12,9 @@ class CanOutputMixin(ABC):
11
12
  @abstractmethod
12
13
  def _to_output_config(self):
13
14
  pass
15
+
16
+
17
+ def _assert_outputs_be_can_output_mixin(outputs: Sequence):
18
+ for output in outputs:
19
+ if not isinstance(output, CanOutputMixin):
20
+ raise TypeError("The outputs parameter must be a `ui.state`")
@@ -9,7 +9,10 @@ from instaui.common.jsonable import Jsonable
9
9
  from instaui.runtime._app import get_app_slot, get_current_scope
10
10
  from instaui.handlers import watch_handler
11
11
 
12
- from instaui.vars.mixin_types.py_binding import CanOutputMixin
12
+ from instaui.vars.mixin_types.py_binding import (
13
+ CanOutputMixin,
14
+ _assert_outputs_be_can_output_mixin,
15
+ )
13
16
  from instaui.vars.mixin_types.common_type import TObservableInput
14
17
  from instaui._helper import observable_helper
15
18
  from instaui import pre_setup as _pre_setup
@@ -36,6 +39,11 @@ class WebWatch(Jsonable, typing.Generic[P, R]):
36
39
  ) -> None:
37
40
  if pre_setup:
38
41
  _pre_setup._check_args(pre_setup)
42
+
43
+ outputs = [] if outputs is None else outputs
44
+
45
+ _assert_outputs_be_can_output_mixin(outputs)
46
+
39
47
  inputs = observable_helper.auto_made_inputs_to_slient(inputs, outputs)
40
48
 
41
49
  get_current_scope().register_web_watch(self)
@@ -44,7 +52,7 @@ class WebWatch(Jsonable, typing.Generic[P, R]):
44
52
  observable_helper.analyze_observable_inputs(list(inputs or []))
45
53
  )
46
54
 
47
- self._outputs = [output._to_output_config() for output in outputs or []]
55
+ self._outputs = [output._to_output_config() for output in outputs]
48
56
  self._fn = func
49
57
  self._immediate = immediate
50
58
  self._deep = deep
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: instaui
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: insta-ui is a Python-based UI library for rapidly building user interfaces.
5
5
  Author-email: CrystalWindSnake <568166495@qq.com>
6
6
  License-Expression: MIT
@@ -9,6 +9,7 @@ instaui/patch_update.py,sha256=btyiuUHdYv-U_7931HRACnFMw-ZBdg_RTVZFWogR6G4,1871
9
9
  instaui/pre_setup.py,sha256=oSwbkOkxkjLS1qP7mU4nY4S7UPXPk0Tdik2tY6WGnZY,1350
10
10
  instaui/response.py,sha256=ByRHHY3tDAzOKLWK1ZJbBbGbsGnjnKSawt_ozOrBzso,1704
11
11
  instaui/skip.py,sha256=uqhqusgeChVoivKFMoZd-XePYrlSoLvUzRZDBcUgFmA,149
12
+ instaui/ui_system_var_type.py,sha256=UkSw1I_GPtBsLionaY9iXNGWkQvNUEWT6vACrwmU7Gk,196
12
13
  instaui/version.py,sha256=to8l16EjNe4jmzK316s5ZIotjv554tqF0VfwA1tBhQk,87
13
14
  instaui/_helper/observable_helper.py,sha256=U30PmA8jZ9q48GI_FMNPRYUTKNdl4SsMTAFoq94eRFs,1447
14
15
  instaui/action/__init__.py,sha256=YJQlCwJhQ4py5hAsfsgVUgfa9V2jNnu0pLlMFr5zXY0,219
@@ -109,10 +110,12 @@ instaui/common/jsonable.py,sha256=efzn_IvfrsaNKjc3B3UzshoMvsqSsB-jnD2Aia8YMYM,90
109
110
  instaui/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
110
111
  instaui/components/column.py,sha256=t_kDAelb-5_aqx4hv19sOm8zcQpRmn-slTMcwZfMOLk,848
111
112
  instaui/components/component.py,sha256=JRL-v9nGA6RwJhyXZ1G7rKiEovWjNHPxT5EJefHVjaQ,1293
113
+ instaui/components/container.py,sha256=wuzTyhqtbJwArBqiSwX0GKvFvCpPFwjixaGlGwuCueU,1203
112
114
  instaui/components/content.py,sha256=f6dm0GukYJk4RRNJzuvOGqBrStLWkJQbLkV7M5fJ63k,1094
113
115
  instaui/components/directive.py,sha256=bHSOWXNhzWRVNqLXwhc_hY3R3g-JAQ5DWIqpZkI6_wI,1411
114
116
  instaui/components/element.py,sha256=HfxRTg4s5K2IzaUaPvUCWMogXUHjfFGG4TDuJxTCKyw,17167
115
117
  instaui/components/grid.py,sha256=h9Lzxqiw4HB-8VG2JGHVz-KGn4bHTtsibtUb8UCgHO4,7529
118
+ instaui/components/heading.py,sha256=TeOUK-ipQDmjtqjqGolj2l2P4-9wMdeHBu5posF3L30,1941
116
119
  instaui/components/label.py,sha256=Fp7malMB2i6MjJjZnxdIl2tg6rb33-1PdgxEhGecoTM,118
117
120
  instaui/components/match.py,sha256=B8g80ujc8WtZeMChXNkYIFPdz2_JKkLqIyuOPh7vkJ4,2784
118
121
  instaui/components/mixins.py,sha256=a_IX0TIYKkWdcuTjb90ENM7KlidxXcBgsTV67TvGLOw,544
@@ -167,7 +170,7 @@ instaui/dependencies/plugin_dependency.py,sha256=6u562ihKbiL3DE4hBrGjauS2nzYEC2g
167
170
  instaui/event/event_mixin.py,sha256=cN0Wh95e1wX183mGnGFm8BK_aEHWJ8WNx3Upy75mU_4,286
168
171
  instaui/event/js_event.py,sha256=CGegLXP3QldJp0jN-lNY0XSG8fLuaitFqKkgGEfI7yE,2868
169
172
  instaui/event/vue_event.py,sha256=NRwEcAromivjyPtgMq5SEqHqx8GEc1OJZsRL2Nj43RY,2187
170
- instaui/event/web_event.py,sha256=PyqOqp8DFf5qf6OJ-qPEHiwTvKQ6qDhg4WFSlM_4YGo,4452
173
+ instaui/event/web_event.py,sha256=QEtB_EfMQC0RQahbF8eeg7SSP5sSHcqjUMtW4exnsNk,4566
171
174
  instaui/experimental/__init__.py,sha256=nKvudMaBaDsxflSZQ00ck8Cc4hmrF0f6Xzs4mhIYa08,75
172
175
  instaui/experimental/debug.py,sha256=UGUWgNZ3ShanpuxfuPdx52TgQrkO9hByABYMnPZEIiE,1325
173
176
  instaui/extra_libs/_echarts.py,sha256=HCF4mxmzVyKRtxHuehiqf7kmBq7G14_dc2m9XQEM-fQ,78
@@ -212,10 +215,10 @@ instaui/spa_router/_router_output.py,sha256=Nc6N8yO_9IrUbaYbPZMkOX_9VlwBKzyXMaha
212
215
  instaui/spa_router/_router_param_var.py,sha256=KCy54xBZxGMqLO3Zlbzr6XV8ts-M6jCOKunL2gz5IUc,1455
213
216
  instaui/spa_router/_types.py,sha256=KuGuv5C6qivwllfdmV5qrvM0S_GWJ6u8OOTkCNmJImU,81
214
217
  instaui/spa_router/templates/page_routes,sha256=8VjM_8f6pjFb01QbU9z5HNqpcNRdCiX3X0OqNHLq8fo,1355
215
- instaui/static/insta-ui.css,sha256=EFA-_5bytZzwbe9w_kaAskE-bpdtwKbBRAyS4iw7NvU,292
216
- instaui/static/insta-ui.esm-browser.prod.js,sha256=O_xMSzWgCfZpuaKDraJsgMTqADrPZjKv-8kk0UjRWpI,110423
218
+ instaui/static/insta-ui.css,sha256=tzRSCerW6bTeXW18g1fA1ndU743yENblDEPzQ3o6uRU,6375
219
+ instaui/static/insta-ui.esm-browser.prod.js,sha256=Wa5KzmnG0CxaPDrdBjL0eGosgsg2PiRxlEh_wdEInjo,111151
217
220
  instaui/static/insta-ui.ico,sha256=08FJg4qWolvOjfodoh8IJLStslrvd8sDyuRcTUDq5ak,1150
218
- instaui/static/insta-ui.js.map,sha256=0SseMn_3-DXjl5FxdDYURIgP8AnWxiz1shqJxoyo5mc,665032
221
+ instaui/static/insta-ui.js.map,sha256=5PMTmzW-d_teWLlFv_G8Ape5I9_f2CbQnx6mNwYT4hw,667612
219
222
  instaui/static/instaui-tools-browser.js,sha256=cLHKNXYaYMZriMxV-yKGAHTrHSdNRUlDVZmv6uc6mMw,14455
220
223
  instaui/static/vue.esm-browser.prod.js,sha256=vwQkXANuVYQuEFc0VgiokJdhNyMmvxMKyb1FmrYrNb4,162662
221
224
  instaui/static/vue.global.prod.js,sha256=YO-UVLcXWjFOKfGU2uRrIMYpliGY2y48OmEjV464Z7M,157933
@@ -240,8 +243,8 @@ instaui/template/env.py,sha256=ZqVsqpfSY1mupbgpBSkvOJytNui8xfNR5kNNC9rv4Ps,150
240
243
  instaui/template/web_template.py,sha256=AAdxFBmJl7_ofVrDGWcRsBLB2cth3SNffL2ZNhr6fdo,1621
241
244
  instaui/template/webview_template.py,sha256=8NhsfWDqtX4EjA92aTilKT-1vMrlgp95sV3svRAHzco,1575
242
245
  instaui/template/zero_template.py,sha256=5WKIJ23RFXPN9rR_L6DLxZ-i2ZBBcJKmjjc1CitiRXM,3532
243
- instaui/ui/__init__.py,sha256=wjV_9KqwPsjvrMVRpLaHYhSrBLfVafQrr0Gv_XYxi5Y,5043
244
- instaui/ui/__init__.pyi,sha256=3UlTbATEPzmV5tExpszSCNQ6eh81BvrVvqyGFMQWXlk,5009
246
+ instaui/ui/__init__.py,sha256=u5kdFGbz8LCP0V4lWgHg_-dNCaYIZ8oqznRammc1fQA,5201
247
+ instaui/ui/__init__.pyi,sha256=oiTMg7t_OjM91efhlxTj-wN4s3mjFeBJNX3FIBeT2WM,5167
245
248
  instaui/ui/events.py,sha256=lfhiINwn-Kh0MezsSeLJPttWm6G1aWiwyk3TRo0NrlA,809
246
249
  instaui/ui_functions/input_slient_data.py,sha256=0A5DegIt_MqdZgbj1RiVFNmB_RUqgov9FYtkw6VX0DE,511
247
250
  instaui/ui_functions/server.py,sha256=thMkBT2BDOd18FIz4ilfIgO6EJGD19l0sumlOnYbzIM,914
@@ -267,14 +270,14 @@ instaui/vars/mixin_types/common_type.py,sha256=4KduANLCUCeGTA1ClEsbFzEzd8Mgve369
267
270
  instaui/vars/mixin_types/element_binding.py,sha256=KUJY7s-Qem6Cwd_g0nC7A3RWwbMqt56EdB70OQpupj8,345
268
271
  instaui/vars/mixin_types/observable.py,sha256=jWT4xeL2NMQ4iLGsV141gcC9_ZMbt6nJVm9ztxuw6h4,143
269
272
  instaui/vars/mixin_types/pathable.py,sha256=40H5f1gCDtKs4Qor0C-moB821T7Df8DOgUcntjxgums,302
270
- instaui/vars/mixin_types/py_binding.py,sha256=VIVSrHrjcltsP5ADKHtMSZBpi2qKyameXqoEevdfqk8,237
273
+ instaui/vars/mixin_types/py_binding.py,sha256=8FTSYJfPVianxolYEKBqs0QxVpX3cAHWL6RMPqUn0Ho,486
271
274
  instaui/vars/mixin_types/str_format_binding.py,sha256=i2jXm1RKddPnGrCxEyz0tkDrBU2FfjR0EviQ0RKZsbY,257
272
275
  instaui/vars/mixin_types/var_type.py,sha256=FQj1TEkjT7HopDPztt0-J6eQVGHjem3KBFsjZwvcvYg,57
273
276
  instaui/watch/_types.py,sha256=HJ_eAID0NsEJ_S8PhcYWxpVWhYLjjqKlbNWwqdqS4IU,73
274
277
  instaui/watch/_utils.py,sha256=mTITHG8hp0pyfQXUERQKXMDna5Au02bhuASCV32eXHI,124
275
278
  instaui/watch/js_watch.py,sha256=8lVINBauHBRiDX3-F1V6V5_1CN9j1EMCROjcD9LRCD8,4230
276
279
  instaui/watch/vue_watch.py,sha256=Vd3nsRyf9ufrXLFTjaSvglwnkoWyE32fOV0qOogWPt4,2013
277
- instaui/watch/web_watch.py,sha256=CgiDoHsMmJChrYViRRuhl2zQ9Ij6Avc4ZaVzbXjWJ_c,6578
280
+ instaui/watch/web_watch.py,sha256=XFT7dP1p8Vwjqr_vsWmq8fe3zRffo0GP47iCLtpRg8Q,6739
278
281
  instaui/webview/__init__.py,sha256=_L8B0Ym7i1Q8eonQ81fC54EXn7oZuc6zE1KqeAEPHEg,65
279
282
  instaui/webview/_utils.py,sha256=pqARVv37h-8p7CLOpvqLV8O_az4EV2VD9G-beUVqjD8,172
280
283
  instaui/webview/api.py,sha256=_d5Sr5oJMvpuefKPPxrVjqY60CVNjDosFvlNgsiovCE,1493
@@ -283,7 +286,7 @@ instaui/webview/resource.py,sha256=AEYoMQG-k1JX6h2SDLeVuCgyKk03iq27V-S_oO9GxDA,5
283
286
  instaui/zero/__init__.py,sha256=N0LuRUAcaurxHSspcEDuwZg62W2S3qL4VtrMKxOivBE,49
284
287
  instaui/zero/func.py,sha256=O0tZnlahKhp8pQ9plMicQtjp3itHA6lliZwMmfDbLnc,3668
285
288
  instaui/zero/scope.py,sha256=HGohYOqnpRGVkkoz_gvR6-DgCc48AtJAcDwbOnnGHLM,3753
286
- instaui-0.2.1.dist-info/METADATA,sha256=LkB0S31Uz-WY_2SAarbm_tjKitUsxrYGZXy-YDO8Qvk,3650
287
- instaui-0.2.1.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
288
- instaui-0.2.1.dist-info/licenses/LICENSE,sha256=_JjnAWrikJ6qkwT7PazeFNRlcIu8q_RH3mYcHTxEF5c,1094
289
- instaui-0.2.1.dist-info/RECORD,,
289
+ instaui-0.2.2.dist-info/METADATA,sha256=4bCxQEvr3bpXx_VNmLKke7bnJamFB-wxlVdnAA71nZ0,3650
290
+ instaui-0.2.2.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
291
+ instaui-0.2.2.dist-info/licenses/LICENSE,sha256=_JjnAWrikJ6qkwT7PazeFNRlcIu8q_RH3mYcHTxEF5c,1094
292
+ instaui-0.2.2.dist-info/RECORD,,