instaui 0.1.15__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.
Files changed (283) hide show
  1. instaui/__init__.py +9 -0
  2. instaui/_helper/observable_helper.py +45 -0
  3. instaui/arco/__init__.py +191 -0
  4. instaui/arco/_settings.py +25 -0
  5. instaui/arco/_use_tools/locale.py +50 -0
  6. instaui/arco/component_types.py +1019 -0
  7. instaui/arco/components/_utils.py +22 -0
  8. instaui/arco/components/affix.py +29 -0
  9. instaui/arco/components/alert.py +42 -0
  10. instaui/arco/components/anchor.py +42 -0
  11. instaui/arco/components/auto_complete.py +96 -0
  12. instaui/arco/components/avatar.py +55 -0
  13. instaui/arco/components/back_top.py +14 -0
  14. instaui/arco/components/badge.py +14 -0
  15. instaui/arco/components/breadcrumb.py +14 -0
  16. instaui/arco/components/button.py +43 -0
  17. instaui/arco/components/calendar.py +47 -0
  18. instaui/arco/components/card.py +14 -0
  19. instaui/arco/components/carousel.py +33 -0
  20. instaui/arco/components/cascader.py +111 -0
  21. instaui/arco/components/checkbox.py +32 -0
  22. instaui/arco/components/collapse.py +31 -0
  23. instaui/arco/components/color_picker.py +45 -0
  24. instaui/arco/components/comment.py +14 -0
  25. instaui/arco/components/config_provider.py +13 -0
  26. instaui/arco/components/date_picker.py +111 -0
  27. instaui/arco/components/descriptions.py +14 -0
  28. instaui/arco/components/divider.py +13 -0
  29. instaui/arco/components/drawer.py +98 -0
  30. instaui/arco/components/dropdown.py +45 -0
  31. instaui/arco/components/empty.py +14 -0
  32. instaui/arco/components/form.py +55 -0
  33. instaui/arco/components/icon.py +17 -0
  34. instaui/arco/components/image.py +33 -0
  35. instaui/arco/components/input.py +102 -0
  36. instaui/arco/components/input_number.py +97 -0
  37. instaui/arco/components/input_password.py +38 -0
  38. instaui/arco/components/input_search.py +37 -0
  39. instaui/arco/components/input_tag.py +110 -0
  40. instaui/arco/components/layout.py +13 -0
  41. instaui/arco/components/layout_content.py +6 -0
  42. instaui/arco/components/layout_footer.py +6 -0
  43. instaui/arco/components/layout_header.py +6 -0
  44. instaui/arco/components/layout_sider.py +53 -0
  45. instaui/arco/components/link.py +36 -0
  46. instaui/arco/components/list.py +68 -0
  47. instaui/arco/components/mention.py +97 -0
  48. instaui/arco/components/menu.py +88 -0
  49. instaui/arco/components/modal.py +97 -0
  50. instaui/arco/components/overflow_list.py +29 -0
  51. instaui/arco/components/page_header.py +29 -0
  52. instaui/arco/components/pagination.py +45 -0
  53. instaui/arco/components/pop_confirm.py +58 -0
  54. instaui/arco/components/popover.py +32 -0
  55. instaui/arco/components/progress.py +14 -0
  56. instaui/arco/components/radio.py +40 -0
  57. instaui/arco/components/radio_group.py +42 -0
  58. instaui/arco/components/rate.py +45 -0
  59. instaui/arco/components/resize_box.py +62 -0
  60. instaui/arco/components/result.py +14 -0
  61. instaui/arco/components/select.py +182 -0
  62. instaui/arco/components/skeleton.py +14 -0
  63. instaui/arco/components/slider.py +38 -0
  64. instaui/arco/components/space.py +14 -0
  65. instaui/arco/components/spin.py +14 -0
  66. instaui/arco/components/split.py +76 -0
  67. instaui/arco/components/statistic.py +14 -0
  68. instaui/arco/components/steps.py +32 -0
  69. instaui/arco/components/switch.py +57 -0
  70. instaui/arco/components/tab_pane.py +12 -0
  71. instaui/arco/components/table.py +276 -0
  72. instaui/arco/components/tabs.py +101 -0
  73. instaui/arco/components/tag.py +42 -0
  74. instaui/arco/components/textarea.py +84 -0
  75. instaui/arco/components/time_picker.py +76 -0
  76. instaui/arco/components/timeline.py +14 -0
  77. instaui/arco/components/tooltip.py +29 -0
  78. instaui/arco/components/transfer.py +58 -0
  79. instaui/arco/components/tree.py +120 -0
  80. instaui/arco/components/tree_select.py +86 -0
  81. instaui/arco/components/trigger.py +58 -0
  82. instaui/arco/components/typography.py +142 -0
  83. instaui/arco/components/upload.py +71 -0
  84. instaui/arco/components/verification_code.py +58 -0
  85. instaui/arco/components/watermark.py +14 -0
  86. instaui/arco/locales/__init__.py +4 -0
  87. instaui/arco/locales/_index.py +31 -0
  88. instaui/arco/locales/en_us.py +227 -0
  89. instaui/arco/locales/zh_cn.py +224 -0
  90. instaui/arco/setup.py +36 -0
  91. instaui/arco/static/instaui-arco.css +1 -0
  92. instaui/arco/static/instaui-arco.js +55771 -0
  93. instaui/arco/types.py +24 -0
  94. instaui/boot_info.py +43 -0
  95. instaui/common/jsonable.py +37 -0
  96. instaui/components/__init__.py +0 -0
  97. instaui/components/column.py +26 -0
  98. instaui/components/component.py +47 -0
  99. instaui/components/content.py +34 -0
  100. instaui/components/directive.py +55 -0
  101. instaui/components/element.py +573 -0
  102. instaui/components/grid.py +213 -0
  103. instaui/components/html/__init__.py +49 -0
  104. instaui/components/html/_mixins.py +34 -0
  105. instaui/components/html/_preset.py +4 -0
  106. instaui/components/html/button.py +38 -0
  107. instaui/components/html/checkbox.py +35 -0
  108. instaui/components/html/date.py +28 -0
  109. instaui/components/html/div.py +7 -0
  110. instaui/components/html/form.py +7 -0
  111. instaui/components/html/heading.py +51 -0
  112. instaui/components/html/input.py +28 -0
  113. instaui/components/html/label.py +21 -0
  114. instaui/components/html/li.py +17 -0
  115. instaui/components/html/link.py +31 -0
  116. instaui/components/html/number.py +34 -0
  117. instaui/components/html/paragraph.py +29 -0
  118. instaui/components/html/range.py +48 -0
  119. instaui/components/html/select.py +69 -0
  120. instaui/components/html/span.py +19 -0
  121. instaui/components/html/table.py +36 -0
  122. instaui/components/html/textarea.py +28 -0
  123. instaui/components/html/ul.py +20 -0
  124. instaui/components/label.py +5 -0
  125. instaui/components/markdown/markdown.js +33 -0
  126. instaui/components/markdown/markdown.py +41 -0
  127. instaui/components/markdown/static/github-markdown.css +12 -0
  128. instaui/components/markdown/static/marked.esm.js +2579 -0
  129. instaui/components/match.py +108 -0
  130. instaui/components/row.py +17 -0
  131. instaui/components/shiki_code/shiki_code.js +126 -0
  132. instaui/components/shiki_code/shiki_code.py +99 -0
  133. instaui/components/shiki_code/static/langs/css.mjs +5 -0
  134. instaui/components/shiki_code/static/langs/markdown.mjs +5 -0
  135. instaui/components/shiki_code/static/langs/python.mjs +5 -0
  136. instaui/components/shiki_code/static/langs/shell.mjs +2 -0
  137. instaui/components/shiki_code/static/langs/shellscript.mjs +5 -0
  138. instaui/components/shiki_code/static/shiki-core.js +5784 -0
  139. instaui/components/shiki_code/static/shiki-style.css +179 -0
  140. instaui/components/shiki_code/static/shiki-transformers.js +461 -0
  141. instaui/components/shiki_code/static/themes/vitesse-dark.mjs +2 -0
  142. instaui/components/shiki_code/static/themes/vitesse-light.mjs +2 -0
  143. instaui/components/slot.py +81 -0
  144. instaui/components/transition_group.py +9 -0
  145. instaui/components/value_element.py +52 -0
  146. instaui/components/vfor.py +142 -0
  147. instaui/components/vif.py +42 -0
  148. instaui/consts.py +23 -0
  149. instaui/dependencies/component_dependency.py +22 -0
  150. instaui/dependencies/plugin_dependency.py +28 -0
  151. instaui/event/event_mixin.py +12 -0
  152. instaui/event/js_event.py +82 -0
  153. instaui/event/vue_event.py +66 -0
  154. instaui/event/web_event.py +123 -0
  155. instaui/experimental/__init__.py +3 -0
  156. instaui/experimental/debug.py +48 -0
  157. instaui/extra_libs/_echarts.py +3 -0
  158. instaui/extra_libs/_import_error.py +9 -0
  159. instaui/extra_libs/_mermaid.py +3 -0
  160. instaui/extra_libs/_shiki_code.py +3 -0
  161. instaui/fastapi_server/_utils.py +42 -0
  162. instaui/fastapi_server/_uvicorn.py +37 -0
  163. instaui/fastapi_server/debug_mode_router.py +60 -0
  164. instaui/fastapi_server/dependency_router.py +28 -0
  165. instaui/fastapi_server/event_router.py +58 -0
  166. instaui/fastapi_server/middlewares.py +19 -0
  167. instaui/fastapi_server/request_context.py +19 -0
  168. instaui/fastapi_server/resource.py +30 -0
  169. instaui/fastapi_server/server.py +308 -0
  170. instaui/fastapi_server/watch_router.py +53 -0
  171. instaui/handlers/_utils.py +88 -0
  172. instaui/handlers/event_handler.py +60 -0
  173. instaui/handlers/watch_handler.py +61 -0
  174. instaui/html_tools.py +94 -0
  175. instaui/inject.py +33 -0
  176. instaui/js/__init__.py +4 -0
  177. instaui/js/js_output.py +15 -0
  178. instaui/js/lambda_func.py +35 -0
  179. instaui/launch_collector.py +52 -0
  180. instaui/page_info.py +13 -0
  181. instaui/runtime/__init__.py +29 -0
  182. instaui/runtime/_app.py +234 -0
  183. instaui/runtime/_inner_helper.py +9 -0
  184. instaui/runtime/_link_manager.py +89 -0
  185. instaui/runtime/context.py +47 -0
  186. instaui/runtime/dataclass.py +30 -0
  187. instaui/runtime/resource.py +65 -0
  188. instaui/runtime/scope.py +133 -0
  189. instaui/runtime/ui_state_scope.py +15 -0
  190. instaui/settings/__init__.py +4 -0
  191. instaui/settings/__settings.py +13 -0
  192. instaui/shadcn_classless/_index.py +42 -0
  193. instaui/shadcn_classless/static/shadcn-classless.css +403 -0
  194. instaui/skip.py +12 -0
  195. instaui/spa_router/__init__.py +26 -0
  196. instaui/spa_router/_components.py +35 -0
  197. instaui/spa_router/_file_base_utils.py +273 -0
  198. instaui/spa_router/_functions.py +122 -0
  199. instaui/spa_router/_install.py +11 -0
  200. instaui/spa_router/_route_model.py +117 -0
  201. instaui/spa_router/_router_box.py +40 -0
  202. instaui/spa_router/_router_output.py +22 -0
  203. instaui/spa_router/_router_param_var.py +51 -0
  204. instaui/spa_router/_types.py +4 -0
  205. instaui/spa_router/templates/page_routes +60 -0
  206. instaui/static/insta-ui.css +1 -0
  207. instaui/static/insta-ui.esm-browser.prod.js +3717 -0
  208. instaui/static/insta-ui.ico +0 -0
  209. instaui/static/insta-ui.js.map +1 -0
  210. instaui/static/instaui-tools-browser.js +511 -0
  211. instaui/static/templates/debug/sse.html +117 -0
  212. instaui/static/templates/web.html +74 -0
  213. instaui/static/templates/webview.html +78 -0
  214. instaui/static/templates/zero.html +71 -0
  215. instaui/static/vue.esm-browser.prod.js +9 -0
  216. instaui/static/vue.global.prod.js +9 -0
  217. instaui/static/vue.runtime.esm-browser.prod.js +5 -0
  218. instaui/systems/file_system.py +6 -0
  219. instaui/systems/func_system.py +119 -0
  220. instaui/systems/js_system.py +22 -0
  221. instaui/systems/module_system.py +46 -0
  222. instaui/systems/pydantic_system.py +27 -0
  223. instaui/systems/string_system.py +10 -0
  224. instaui/tailwind/__init__.py +6 -0
  225. instaui/tailwind/_index.py +24 -0
  226. instaui/tailwind/static/tailwindcss-v3.min.js +62 -0
  227. instaui/tailwind/static/tailwindcss-v4.min.js +8 -0
  228. instaui/template/__init__.py +4 -0
  229. instaui/template/_utils.py +23 -0
  230. instaui/template/env.py +7 -0
  231. instaui/template/web_template.py +49 -0
  232. instaui/template/webview_template.py +48 -0
  233. instaui/template/zero_template.py +105 -0
  234. instaui/ui/__init__.py +144 -0
  235. instaui/ui/__init__.pyi +149 -0
  236. instaui/ui/events.py +25 -0
  237. instaui/ui_functions/input_slient_data.py +16 -0
  238. instaui/ui_functions/server.py +15 -0
  239. instaui/ui_functions/str_format.py +36 -0
  240. instaui/ui_functions/ui_page.py +16 -0
  241. instaui/ui_functions/ui_types.py +13 -0
  242. instaui/ui_functions/url_location.py +33 -0
  243. instaui/vars/_types.py +8 -0
  244. instaui/vars/data.py +68 -0
  245. instaui/vars/element_ref.py +40 -0
  246. instaui/vars/event_context.py +49 -0
  247. instaui/vars/event_extend.py +0 -0
  248. instaui/vars/js_computed.py +117 -0
  249. instaui/vars/mixin_types/common_type.py +5 -0
  250. instaui/vars/mixin_types/element_binding.py +16 -0
  251. instaui/vars/mixin_types/observable.py +7 -0
  252. instaui/vars/mixin_types/pathable.py +14 -0
  253. instaui/vars/mixin_types/py_binding.py +13 -0
  254. instaui/vars/mixin_types/str_format_binding.py +8 -0
  255. instaui/vars/mixin_types/var_type.py +5 -0
  256. instaui/vars/path_var.py +90 -0
  257. instaui/vars/ref.py +103 -0
  258. instaui/vars/slot_prop.py +46 -0
  259. instaui/vars/state.py +97 -0
  260. instaui/vars/types.py +24 -0
  261. instaui/vars/vfor_item.py +204 -0
  262. instaui/vars/vue_computed.py +81 -0
  263. instaui/vars/web_computed.py +209 -0
  264. instaui/vars/web_view_computed.py +1 -0
  265. instaui/version.py +3 -0
  266. instaui/watch/_types.py +4 -0
  267. instaui/watch/_utils.py +3 -0
  268. instaui/watch/js_watch.py +110 -0
  269. instaui/watch/vue_watch.py +77 -0
  270. instaui/watch/web_watch.py +181 -0
  271. instaui/webview/__init__.py +2 -0
  272. instaui/webview/_utils.py +8 -0
  273. instaui/webview/api.py +72 -0
  274. instaui/webview/func.py +114 -0
  275. instaui/webview/index.py +161 -0
  276. instaui/webview/resource.py +172 -0
  277. instaui/zero/__init__.py +3 -0
  278. instaui/zero/func.py +123 -0
  279. instaui/zero/scope.py +109 -0
  280. instaui-0.1.15.dist-info/METADATA +152 -0
  281. instaui-0.1.15.dist-info/RECORD +283 -0
  282. instaui-0.1.15.dist-info/WHEEL +5 -0
  283. instaui-0.1.15.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,22 @@
1
+ from typing import Dict
2
+ from instaui.components.element import Element
3
+ from instaui.vars.mixin_types.element_binding import ElementBindingMixin
4
+
5
+
6
+ def handle_props(props: Dict):
7
+ return {k.replace("_", "-"): v for k, v in props.items()}
8
+
9
+
10
+ def try_setup_vmodel(
11
+ element: Element,
12
+ value,
13
+ *,
14
+ prop_name: str = "value",
15
+ ):
16
+ if value is None:
17
+ return
18
+ if isinstance(value, ElementBindingMixin):
19
+ element.vmodel(value, prop_name=prop_name)
20
+ return
21
+
22
+ element.props({prop_name: value})
@@ -0,0 +1,29 @@
1
+ import typing
2
+ from typing_extensions import Unpack
3
+ from instaui.components.element import Element
4
+ from instaui.arco import component_types
5
+ from instaui.event.event_mixin import EventMixin
6
+ from ._utils import handle_props
7
+
8
+
9
+ class Affix(Element):
10
+ def __init__(
11
+ self,
12
+ **kwargs: Unpack[component_types.TAffix],
13
+ ):
14
+ super().__init__("a-affix")
15
+
16
+ self.props(handle_props(kwargs)) # type: ignore
17
+
18
+ def on_change(
19
+ self,
20
+ handler: EventMixin,
21
+ *,
22
+ extends: typing.Optional[typing.List] = None,
23
+ ):
24
+ self.on(
25
+ "change",
26
+ handler,
27
+ extends=extends,
28
+ )
29
+ return self
@@ -0,0 +1,42 @@
1
+ import typing
2
+ from typing_extensions import Unpack
3
+ from instaui.components.element import Element
4
+ from instaui.arco import component_types
5
+ from instaui.event.event_mixin import EventMixin
6
+ from ._utils import handle_props
7
+
8
+
9
+ class Alert(Element):
10
+ def __init__(
11
+ self,
12
+ **kwargs: Unpack[component_types.TAlert],
13
+ ):
14
+ super().__init__("a-alert")
15
+
16
+ self.props(handle_props(kwargs)) # type: ignore
17
+
18
+ def on_close(
19
+ self,
20
+ handler: EventMixin,
21
+ *,
22
+ extends: typing.Optional[typing.List] = None,
23
+ ):
24
+ self.on(
25
+ "close",
26
+ handler,
27
+ extends=extends,
28
+ )
29
+ return self
30
+
31
+ def on_after_close(
32
+ self,
33
+ handler: EventMixin,
34
+ *,
35
+ extends: typing.Optional[typing.List] = None,
36
+ ):
37
+ self.on(
38
+ "after-close",
39
+ handler,
40
+ extends=extends,
41
+ )
42
+ return self
@@ -0,0 +1,42 @@
1
+ import typing
2
+ from typing_extensions import Unpack
3
+ from instaui.components.element import Element
4
+ from instaui.arco import component_types
5
+ from instaui.event.event_mixin import EventMixin
6
+ from ._utils import handle_props
7
+
8
+
9
+ class Anchor(Element):
10
+ def __init__(
11
+ self,
12
+ **kwargs: Unpack[component_types.TAnchor],
13
+ ):
14
+ super().__init__("a-anchor")
15
+
16
+ self.props(handle_props(kwargs)) # type: ignore
17
+
18
+ def on_select(
19
+ self,
20
+ handler: EventMixin,
21
+ *,
22
+ extends: typing.Optional[typing.List] = None,
23
+ ):
24
+ self.on(
25
+ "select",
26
+ handler,
27
+ extends=extends,
28
+ )
29
+ return self
30
+
31
+ def on_change(
32
+ self,
33
+ handler: EventMixin,
34
+ *,
35
+ extends: typing.Optional[typing.List] = None,
36
+ ):
37
+ self.on(
38
+ "change",
39
+ handler,
40
+ extends=extends,
41
+ )
42
+ return self
@@ -0,0 +1,96 @@
1
+ import typing
2
+ from typing_extensions import Unpack
3
+ from instaui.vars.types import TMaybeRef
4
+ from instaui.components.element import Element
5
+ from instaui.arco import component_types
6
+ from instaui.event.event_mixin import EventMixin
7
+ from ._utils import handle_props, try_setup_vmodel
8
+
9
+
10
+ class AutoComplete(Element):
11
+ def __init__(
12
+ self,
13
+ value: typing.Optional[TMaybeRef[str]] = None,
14
+ **kwargs: Unpack[component_types.TAutocomplete],
15
+ ):
16
+ super().__init__("a-auto-complete")
17
+ try_setup_vmodel(self, value)
18
+ self.props(handle_props(kwargs)) # type: ignore
19
+
20
+ def on_change(
21
+ self,
22
+ handler: EventMixin,
23
+ *,
24
+ extends: typing.Optional[typing.List] = None,
25
+ ):
26
+ self.on(
27
+ "change",
28
+ handler,
29
+ extends=extends,
30
+ )
31
+ return self
32
+
33
+ def on_search(
34
+ self,
35
+ handler: EventMixin,
36
+ *,
37
+ extends: typing.Optional[typing.List] = None,
38
+ ):
39
+ self.on(
40
+ "search",
41
+ handler,
42
+ extends=extends,
43
+ )
44
+ return self
45
+
46
+ def on_select(
47
+ self,
48
+ handler: EventMixin,
49
+ *,
50
+ extends: typing.Optional[typing.List] = None,
51
+ ):
52
+ self.on(
53
+ "select",
54
+ handler,
55
+ extends=extends,
56
+ )
57
+ return self
58
+
59
+ def on_clear(
60
+ self,
61
+ handler: EventMixin,
62
+ *,
63
+ extends: typing.Optional[typing.List] = None,
64
+ ):
65
+ self.on(
66
+ "clear",
67
+ handler,
68
+ extends=extends,
69
+ )
70
+ return self
71
+
72
+ def on_dropdown_scroll(
73
+ self,
74
+ handler: EventMixin,
75
+ *,
76
+ extends: typing.Optional[typing.List] = None,
77
+ ):
78
+ self.on(
79
+ "dropdown-scroll",
80
+ handler,
81
+ extends=extends,
82
+ )
83
+ return self
84
+
85
+ def on_dropdown_reach_bottom(
86
+ self,
87
+ handler: EventMixin,
88
+ *,
89
+ extends: typing.Optional[typing.List] = None,
90
+ ):
91
+ self.on(
92
+ "dropdown-reach-bottom",
93
+ handler,
94
+ extends=extends,
95
+ )
96
+ return self
@@ -0,0 +1,55 @@
1
+ import typing
2
+ from typing_extensions import Unpack
3
+ from instaui.components.element import Element
4
+ from instaui.arco import component_types
5
+ from instaui.event.event_mixin import EventMixin
6
+ from ._utils import handle_props
7
+
8
+
9
+ class Avatar(Element):
10
+ def __init__(
11
+ self,
12
+ **kwargs: Unpack[component_types.TAvatar],
13
+ ):
14
+ super().__init__("a-avatar")
15
+
16
+ self.props(handle_props(kwargs)) # type: ignore
17
+
18
+ def on_click(
19
+ self,
20
+ handler: EventMixin,
21
+ *,
22
+ extends: typing.Optional[typing.List] = None,
23
+ ):
24
+ self.on(
25
+ "click",
26
+ handler,
27
+ extends=extends,
28
+ )
29
+ return self
30
+
31
+ def on_error(
32
+ self,
33
+ handler: EventMixin,
34
+ *,
35
+ extends: typing.Optional[typing.List] = None,
36
+ ):
37
+ self.on(
38
+ "error",
39
+ handler,
40
+ extends=extends,
41
+ )
42
+ return self
43
+
44
+ def on_load(
45
+ self,
46
+ handler: EventMixin,
47
+ *,
48
+ extends: typing.Optional[typing.List] = None,
49
+ ):
50
+ self.on(
51
+ "load",
52
+ handler,
53
+ extends=extends,
54
+ )
55
+ return self
@@ -0,0 +1,14 @@
1
+ from typing_extensions import Unpack
2
+ from instaui.components.element import Element
3
+ from instaui.arco import component_types
4
+ from ._utils import handle_props
5
+
6
+
7
+ class BackTop(Element):
8
+ def __init__(
9
+ self,
10
+ **kwargs: Unpack[component_types.TBacktop],
11
+ ):
12
+ super().__init__("a-back-top")
13
+
14
+ self.props(handle_props(kwargs)) # type: ignore
@@ -0,0 +1,14 @@
1
+ from typing_extensions import Unpack
2
+ from instaui.components.element import Element
3
+ from instaui.arco import component_types
4
+ from ._utils import handle_props
5
+
6
+
7
+ class Badge(Element):
8
+ def __init__(
9
+ self,
10
+ **kwargs: Unpack[component_types.TBadge],
11
+ ):
12
+ super().__init__("a-badge")
13
+
14
+ self.props(handle_props(kwargs)) # type: ignore
@@ -0,0 +1,14 @@
1
+ from typing_extensions import Unpack
2
+ from instaui.components.element import Element
3
+ from instaui.arco import component_types
4
+ from ._utils import handle_props
5
+
6
+
7
+ class Breadcrumb(Element):
8
+ def __init__(
9
+ self,
10
+ **kwargs: Unpack[component_types.TBreadcrumb],
11
+ ):
12
+ super().__init__("a-breadcrumb")
13
+
14
+ self.props(handle_props(kwargs)) # type: ignore
@@ -0,0 +1,43 @@
1
+ from __future__ import annotations
2
+ import typing
3
+ from typing_extensions import Unpack
4
+ from instaui.vars.types import TMaybeRef
5
+ from instaui.components.element import Element
6
+ from instaui.components.content import Content
7
+ from instaui.arco import component_types
8
+ from instaui.event.event_mixin import EventMixin
9
+ from ._utils import handle_props
10
+
11
+
12
+ class Button(Element):
13
+ def __init__(
14
+ self,
15
+ label: typing.Optional[TMaybeRef[str]] = None,
16
+ **kwargs: Unpack[component_types.TButton],
17
+ ):
18
+ """Create a button element.
19
+
20
+ Args:
21
+ text (Optional[TMaybeRef[str]], optional): _description_. Defaults to None.
22
+ """
23
+
24
+ super().__init__("a-button")
25
+
26
+ if label is not None:
27
+ with self:
28
+ Content(label)
29
+
30
+ self.props(handle_props(kwargs)) # type: ignore
31
+
32
+ def on_click(
33
+ self,
34
+ handler: EventMixin,
35
+ *,
36
+ extends: typing.Optional[typing.List] = None,
37
+ ):
38
+ self.on(
39
+ "click",
40
+ handler,
41
+ extends=extends,
42
+ )
43
+ return self
@@ -0,0 +1,47 @@
1
+ from __future__ import annotations
2
+ import datetime
3
+ import typing
4
+ from typing_extensions import Unpack
5
+ from instaui.components.element import Element
6
+ from instaui.vars.types import TMaybeRef
7
+ from instaui.arco import component_types
8
+ from instaui.event.event_mixin import EventMixin
9
+ from ._utils import handle_props, try_setup_vmodel
10
+
11
+
12
+ class Calendar(Element):
13
+ def __init__(
14
+ self,
15
+ value: typing.Optional[TMaybeRef[datetime.date]] = None,
16
+ **kwargs: Unpack[component_types.TCalendar],
17
+ ):
18
+ super().__init__("a-calendar")
19
+
20
+ try_setup_vmodel(self, value)
21
+ self.props(handle_props(kwargs)) # type: ignore
22
+
23
+ def on_change(
24
+ self,
25
+ handler: EventMixin,
26
+ *,
27
+ extends: typing.Optional[typing.List] = None,
28
+ ):
29
+ self.on(
30
+ "change",
31
+ handler,
32
+ extends=extends,
33
+ )
34
+ return self
35
+
36
+ def on_panel_change(
37
+ self,
38
+ handler: EventMixin,
39
+ *,
40
+ extends: typing.Optional[typing.List] = None,
41
+ ):
42
+ self.on(
43
+ "panel-change",
44
+ handler,
45
+ extends=extends,
46
+ )
47
+ return self
@@ -0,0 +1,14 @@
1
+ from typing_extensions import Unpack
2
+ from instaui.components.element import Element
3
+ from instaui.arco import component_types
4
+ from ._utils import handle_props
5
+
6
+
7
+ class Card(Element):
8
+ def __init__(
9
+ self,
10
+ **kwargs: Unpack[component_types.TCard],
11
+ ):
12
+ super().__init__("a-card")
13
+
14
+ self.props(handle_props(kwargs)) # type: ignore
@@ -0,0 +1,33 @@
1
+ from __future__ import annotations
2
+ import typing
3
+ from typing_extensions import Unpack
4
+ from instaui.vars.types import TMaybeRef
5
+ from instaui.components.element import Element
6
+ from instaui.arco import component_types
7
+ from instaui.event.event_mixin import EventMixin
8
+ from ._utils import handle_props, try_setup_vmodel
9
+
10
+
11
+ class Carousel(Element):
12
+ def __init__(
13
+ self,
14
+ current_value: typing.Optional[TMaybeRef[int]] = None,
15
+ **kwargs: Unpack[component_types.TCarousel],
16
+ ):
17
+ super().__init__("a-carousel")
18
+
19
+ try_setup_vmodel(self, current_value, prop_name="current")
20
+ self.props(handle_props(kwargs)) # type: ignore
21
+
22
+ def on_change(
23
+ self,
24
+ handler: EventMixin,
25
+ *,
26
+ extends: typing.Optional[typing.List] = None,
27
+ ):
28
+ self.on(
29
+ "change",
30
+ handler,
31
+ extends=extends,
32
+ )
33
+ return self
@@ -0,0 +1,111 @@
1
+ import typing
2
+ from typing_extensions import Unpack
3
+ from instaui.components.element import Element
4
+ from instaui.vars.types import TMaybeRef
5
+ from instaui.arco import component_types
6
+ from instaui.event.event_mixin import EventMixin
7
+ from ._utils import handle_props, try_setup_vmodel
8
+
9
+
10
+ class Cascader(Element):
11
+ def __init__(
12
+ self,
13
+ options: TMaybeRef[typing.List[typing.Dict]],
14
+ value: typing.Optional[TMaybeRef[str]] = None,
15
+ **kwargs: Unpack[component_types.TCascader],
16
+ ):
17
+ super().__init__("a-cascader")
18
+ self.props({"options": options})
19
+ try_setup_vmodel(self, value)
20
+ self.props(handle_props(kwargs)) # type: ignore
21
+
22
+ def on_change(
23
+ self,
24
+ handler: EventMixin,
25
+ *,
26
+ extends: typing.Optional[typing.List] = None,
27
+ ):
28
+ self.on(
29
+ "change",
30
+ handler,
31
+ extends=extends,
32
+ )
33
+ return self
34
+
35
+ def on_input_value_change(
36
+ self,
37
+ handler: EventMixin,
38
+ *,
39
+ extends: typing.Optional[typing.List] = None,
40
+ ):
41
+ self.on(
42
+ "input-value-change",
43
+ handler,
44
+ extends=extends,
45
+ )
46
+ return self
47
+
48
+ def on_clear(
49
+ self,
50
+ handler: EventMixin,
51
+ *,
52
+ extends: typing.Optional[typing.List] = None,
53
+ ):
54
+ self.on(
55
+ "clear",
56
+ handler,
57
+ extends=extends,
58
+ )
59
+ return self
60
+
61
+ def on_search(
62
+ self,
63
+ handler: EventMixin,
64
+ *,
65
+ extends: typing.Optional[typing.List] = None,
66
+ ):
67
+ self.on(
68
+ "search",
69
+ handler,
70
+ extends=extends,
71
+ )
72
+ return self
73
+
74
+ def on_popup_visible_change(
75
+ self,
76
+ handler: EventMixin,
77
+ *,
78
+ extends: typing.Optional[typing.List] = None,
79
+ ):
80
+ self.on(
81
+ "popup-visible-change",
82
+ handler,
83
+ extends=extends,
84
+ )
85
+ return self
86
+
87
+ def on_focus(
88
+ self,
89
+ handler: EventMixin,
90
+ *,
91
+ extends: typing.Optional[typing.List] = None,
92
+ ):
93
+ self.on(
94
+ "focus",
95
+ handler,
96
+ extends=extends,
97
+ )
98
+ return self
99
+
100
+ def on_blur(
101
+ self,
102
+ handler: EventMixin,
103
+ *,
104
+ extends: typing.Optional[typing.List] = None,
105
+ ):
106
+ self.on(
107
+ "blur",
108
+ handler,
109
+ extends=extends,
110
+ )
111
+ return self
@@ -0,0 +1,32 @@
1
+ import typing
2
+ from typing_extensions import Unpack
3
+ from instaui.vars.types import TMaybeRef
4
+ from instaui.components.element import Element
5
+ from instaui.arco import component_types
6
+ from instaui.event.event_mixin import EventMixin
7
+ from ._utils import handle_props, try_setup_vmodel
8
+
9
+
10
+ class Checkbox(Element):
11
+ def __init__(
12
+ self,
13
+ value: typing.Optional[TMaybeRef[typing.Union[str, int, bool]]] = None,
14
+ **kwargs: Unpack[component_types.TCheckbox],
15
+ ):
16
+ super().__init__("a-checkbox")
17
+
18
+ try_setup_vmodel(self, value)
19
+ self.props(handle_props(kwargs)) # type: ignore
20
+
21
+ def on_change(
22
+ self,
23
+ handler: EventMixin,
24
+ *,
25
+ extends: typing.Optional[typing.List] = None,
26
+ ):
27
+ self.on(
28
+ "change",
29
+ handler,
30
+ extends=extends,
31
+ )
32
+ return self
@@ -0,0 +1,31 @@
1
+ import typing
2
+ from typing_extensions import Unpack
3
+ from instaui.components.element import Element
4
+ from instaui.arco import component_types
5
+ from instaui.event.event_mixin import EventMixin
6
+ from ._utils import handle_props, try_setup_vmodel
7
+
8
+
9
+ class Collapse(Element):
10
+ def __init__(
11
+ self,
12
+ active_key_value: typing.Optional[typing.List[typing.Union[str, int]]] = None,
13
+ **kwargs: Unpack[component_types.TCollapse],
14
+ ):
15
+ super().__init__("a-collapse")
16
+
17
+ try_setup_vmodel(self, active_key_value, prop_name="active-key")
18
+ self.props(handle_props(kwargs)) # type: ignore
19
+
20
+ def on_change(
21
+ self,
22
+ handler: EventMixin,
23
+ *,
24
+ extends: typing.Optional[typing.List] = None,
25
+ ):
26
+ self.on(
27
+ "change",
28
+ handler,
29
+ extends=extends,
30
+ )
31
+ return self
@@ -0,0 +1,45 @@
1
+ import typing
2
+ from typing_extensions import Unpack
3
+ from instaui.vars.types import TMaybeRef
4
+ from instaui.components.element import Element
5
+ from instaui.arco import component_types
6
+ from instaui.event.event_mixin import EventMixin
7
+ from ._utils import handle_props, try_setup_vmodel
8
+
9
+
10
+ class ColorPicker(Element):
11
+ def __init__(
12
+ self,
13
+ value: typing.Optional[TMaybeRef[str]] = None,
14
+ **kwargs: Unpack[component_types.TColorpicker],
15
+ ):
16
+ super().__init__("a-color-picker")
17
+
18
+ try_setup_vmodel(self, value)
19
+ self.props(handle_props(kwargs)) # type: ignore
20
+
21
+ def on_change(
22
+ self,
23
+ handler: EventMixin,
24
+ *,
25
+ extends: typing.Optional[typing.List] = None,
26
+ ):
27
+ self.on(
28
+ "change",
29
+ handler,
30
+ extends=extends,
31
+ )
32
+ return self
33
+
34
+ def on_popup_visible_change(
35
+ self,
36
+ handler: EventMixin,
37
+ *,
38
+ extends: typing.Optional[typing.List] = None,
39
+ ):
40
+ self.on(
41
+ "popup-visible-change",
42
+ handler,
43
+ extends=extends,
44
+ )
45
+ return self