instaui 0.1.5__py3-none-any.whl → 0.1.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.
Files changed (132) hide show
  1. instaui/arco/__init__.py +191 -0
  2. instaui/arco/_settings.py +25 -0
  3. instaui/arco/_use_tools/locale.py +50 -0
  4. instaui/arco/component_types.py +1019 -0
  5. instaui/arco/components/_utils.py +22 -0
  6. instaui/arco/components/affix.py +29 -0
  7. instaui/arco/components/alert.py +42 -0
  8. instaui/arco/components/anchor.py +42 -0
  9. instaui/arco/components/auto_complete.py +96 -0
  10. instaui/arco/components/avatar.py +55 -0
  11. instaui/arco/components/back_top.py +14 -0
  12. instaui/arco/components/badge.py +14 -0
  13. instaui/arco/components/breadcrumb.py +14 -0
  14. instaui/arco/components/button.py +43 -0
  15. instaui/arco/components/calendar.py +47 -0
  16. instaui/arco/components/card.py +14 -0
  17. instaui/arco/components/carousel.py +33 -0
  18. instaui/arco/components/cascader.py +111 -0
  19. instaui/arco/components/checkbox.py +32 -0
  20. instaui/arco/components/collapse.py +31 -0
  21. instaui/arco/components/color_picker.py +45 -0
  22. instaui/arco/components/comment.py +14 -0
  23. instaui/arco/components/config_provider.py +13 -0
  24. instaui/arco/components/date_picker.py +111 -0
  25. instaui/arco/components/descriptions.py +14 -0
  26. instaui/arco/components/divider.py +13 -0
  27. instaui/arco/components/drawer.py +98 -0
  28. instaui/arco/components/dropdown.py +45 -0
  29. instaui/arco/components/empty.py +14 -0
  30. instaui/arco/components/form.py +55 -0
  31. instaui/arco/components/icon.py +17 -0
  32. instaui/arco/components/image.py +33 -0
  33. instaui/arco/components/input.py +102 -0
  34. instaui/arco/components/input_number.py +97 -0
  35. instaui/arco/components/input_password.py +38 -0
  36. instaui/arco/components/input_search.py +37 -0
  37. instaui/arco/components/input_tag.py +110 -0
  38. instaui/arco/components/layout.py +13 -0
  39. instaui/arco/components/layout_content.py +6 -0
  40. instaui/arco/components/layout_footer.py +6 -0
  41. instaui/arco/components/layout_header.py +6 -0
  42. instaui/arco/components/layout_sider.py +53 -0
  43. instaui/arco/components/link.py +36 -0
  44. instaui/arco/components/list.py +68 -0
  45. instaui/arco/components/mention.py +97 -0
  46. instaui/arco/components/menu.py +88 -0
  47. instaui/arco/components/modal.py +97 -0
  48. instaui/arco/components/overflow_list.py +29 -0
  49. instaui/arco/components/page_header.py +29 -0
  50. instaui/arco/components/pagination.py +45 -0
  51. instaui/arco/components/pop_confirm.py +58 -0
  52. instaui/arco/components/popover.py +32 -0
  53. instaui/arco/components/progress.py +14 -0
  54. instaui/arco/components/radio.py +40 -0
  55. instaui/arco/components/radio_group.py +42 -0
  56. instaui/arco/components/rate.py +45 -0
  57. instaui/arco/components/resize_box.py +62 -0
  58. instaui/arco/components/result.py +14 -0
  59. instaui/arco/components/select.py +179 -0
  60. instaui/arco/components/skeleton.py +14 -0
  61. instaui/arco/components/slider.py +38 -0
  62. instaui/arco/components/space.py +14 -0
  63. instaui/arco/components/spin.py +14 -0
  64. instaui/arco/components/split.py +76 -0
  65. instaui/arco/components/statistic.py +14 -0
  66. instaui/arco/components/steps.py +32 -0
  67. instaui/arco/components/switch.py +57 -0
  68. instaui/arco/components/tab_pane.py +12 -0
  69. instaui/arco/components/table.py +276 -0
  70. instaui/arco/components/tabs.py +101 -0
  71. instaui/arco/components/tag.py +42 -0
  72. instaui/arco/components/textarea.py +84 -0
  73. instaui/arco/components/time_picker.py +76 -0
  74. instaui/arco/components/timeline.py +14 -0
  75. instaui/arco/components/tooltip.py +29 -0
  76. instaui/arco/components/transfer.py +58 -0
  77. instaui/arco/components/tree.py +120 -0
  78. instaui/arco/components/tree_select.py +86 -0
  79. instaui/arco/components/trigger.py +58 -0
  80. instaui/arco/components/typography.py +142 -0
  81. instaui/arco/components/upload.py +71 -0
  82. instaui/arco/components/verification_code.py +58 -0
  83. instaui/arco/components/watermark.py +14 -0
  84. instaui/arco/locales/__init__.py +4 -0
  85. instaui/arco/locales/_index.py +31 -0
  86. instaui/arco/locales/en_us.py +227 -0
  87. instaui/arco/locales/zh_cn.py +224 -0
  88. instaui/arco/setup.py +36 -0
  89. instaui/arco/static/instaui-arco.css +1 -0
  90. instaui/arco/static/instaui-arco.js +55771 -0
  91. instaui/arco/types.py +24 -0
  92. instaui/components/column.py +10 -2
  93. instaui/components/element.py +0 -2
  94. instaui/components/grid.py +81 -0
  95. instaui/components/markdown/static/github-markdown.css +1 -1
  96. instaui/components/row.py +8 -7
  97. instaui/components/shiki_code/static/shiki-style.css +179 -175
  98. instaui/experimental/link_sql/__init__.py +3 -0
  99. instaui/experimental/link_sql/_base.py +23 -0
  100. instaui/experimental/link_sql/_duckdb.py +221 -0
  101. instaui/experimental/link_sql/_types.py +15 -0
  102. instaui/experimental/link_sql/data_source.js +50 -0
  103. instaui/fastapi_server/debug_mode_router.py +1 -1
  104. instaui/html_tools.py +2 -3
  105. instaui/runtime/scope.py +28 -7
  106. instaui/static/insta-ui.css +1 -1
  107. instaui/static/insta-ui.esm-browser.prod.js +3663 -3719
  108. instaui/static/insta-ui.js.map +1 -1
  109. instaui/static/templates/debug/sse.html +1 -1
  110. instaui/tailwind/_index.py +2 -2
  111. instaui/ui_functions/ui_page.py +1 -1
  112. instaui/vars/data.py +7 -7
  113. instaui/vars/element_ref.py +2 -4
  114. instaui/vars/js_computed.py +6 -8
  115. instaui/vars/ref.py +6 -6
  116. instaui/vars/vue_computed.py +6 -7
  117. instaui/vars/web_computed.py +2 -3
  118. instaui/watch/vue_watch.py +23 -7
  119. instaui/zero/scope.py +3 -20
  120. {instaui-0.1.5.dist-info → instaui-0.1.6.dist-info}/METADATA +5 -4
  121. {instaui-0.1.5.dist-info → instaui-0.1.6.dist-info}/RECORD +123 -36
  122. instaui/daisyui/__init__.py +0 -26
  123. instaui/daisyui/_index.py +0 -20
  124. instaui/daisyui/button.py +0 -38
  125. instaui/daisyui/checkbox.py +0 -17
  126. instaui/daisyui/static/daisyui.css +0 -1
  127. instaui/daisyui/static/themes.css +0 -1
  128. instaui/daisyui/table.py +0 -35
  129. instaui/ui/__build_init.py +0 -73
  130. instaui/vars/_utils.py +0 -12
  131. {instaui-0.1.5.dist-info → instaui-0.1.6.dist-info}/LICENSE +0 -0
  132. {instaui-0.1.5.dist-info → instaui-0.1.6.dist-info}/WHEEL +0 -0
@@ -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 Tooltip(Element):
10
+ def __init__(
11
+ self,
12
+ **kwargs: Unpack[component_types.TTooltip],
13
+ ):
14
+ super().__init__("a-tooltip")
15
+
16
+ self.props(handle_props(kwargs)) # type: ignore
17
+
18
+ def on_popup_visible_change(
19
+ self,
20
+ handler: EventMixin,
21
+ *,
22
+ extends: typing.Optional[typing.List] = None,
23
+ ):
24
+ self.on(
25
+ "popup-visible-change",
26
+ handler,
27
+ extends=extends,
28
+ )
29
+ return self
@@ -0,0 +1,58 @@
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 Transfer(Element):
11
+ def __init__(
12
+ self,
13
+ value: typing.Optional[TMaybeRef[typing.List[str]]] = None,
14
+ **kwargs: Unpack[component_types.TTransfer],
15
+ ):
16
+ super().__init__("a-transfer")
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_select(
35
+ self,
36
+ handler: EventMixin,
37
+ *,
38
+ extends: typing.Optional[typing.List] = None,
39
+ ):
40
+ self.on(
41
+ "select",
42
+ handler,
43
+ extends=extends,
44
+ )
45
+ return self
46
+
47
+ def on_search(
48
+ self,
49
+ handler: EventMixin,
50
+ *,
51
+ extends: typing.Optional[typing.List] = None,
52
+ ):
53
+ self.on(
54
+ "search",
55
+ handler,
56
+ extends=extends,
57
+ )
58
+ return self
@@ -0,0 +1,120 @@
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 Tree(Element):
10
+ def __init__(
11
+ self,
12
+ **kwargs: Unpack[component_types.TTree],
13
+ ):
14
+ super().__init__("a-tree")
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_check(
32
+ self,
33
+ handler: EventMixin,
34
+ *,
35
+ extends: typing.Optional[typing.List] = None,
36
+ ):
37
+ self.on(
38
+ "check",
39
+ handler,
40
+ extends=extends,
41
+ )
42
+ return self
43
+
44
+ def on_expand(
45
+ self,
46
+ handler: EventMixin,
47
+ *,
48
+ extends: typing.Optional[typing.List] = None,
49
+ ):
50
+ self.on(
51
+ "expand",
52
+ handler,
53
+ extends=extends,
54
+ )
55
+ return self
56
+
57
+ def on_drag_start(
58
+ self,
59
+ handler: EventMixin,
60
+ *,
61
+ extends: typing.Optional[typing.List] = None,
62
+ ):
63
+ self.on(
64
+ "drag-start",
65
+ handler,
66
+ extends=extends,
67
+ )
68
+ return self
69
+
70
+ def on_drag_end(
71
+ self,
72
+ handler: EventMixin,
73
+ *,
74
+ extends: typing.Optional[typing.List] = None,
75
+ ):
76
+ self.on(
77
+ "drag-end",
78
+ handler,
79
+ extends=extends,
80
+ )
81
+ return self
82
+
83
+ def on_drag_over(
84
+ self,
85
+ handler: EventMixin,
86
+ *,
87
+ extends: typing.Optional[typing.List] = None,
88
+ ):
89
+ self.on(
90
+ "drag-over",
91
+ handler,
92
+ extends=extends,
93
+ )
94
+ return self
95
+
96
+ def on_drag_leave(
97
+ self,
98
+ handler: EventMixin,
99
+ *,
100
+ extends: typing.Optional[typing.List] = None,
101
+ ):
102
+ self.on(
103
+ "drag-leave",
104
+ handler,
105
+ extends=extends,
106
+ )
107
+ return self
108
+
109
+ def on_drop(
110
+ self,
111
+ handler: EventMixin,
112
+ *,
113
+ extends: typing.Optional[typing.List] = None,
114
+ ):
115
+ self.on(
116
+ "drop",
117
+ handler,
118
+ extends=extends,
119
+ )
120
+ return self
@@ -0,0 +1,86 @@
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
+ _TTreeSelectValue = typing.Union[str, int, typing.List[typing.Union[str, int]]]
10
+
11
+
12
+ class TreeSelect(Element):
13
+ def __init__(
14
+ self,
15
+ value: typing.Optional[TMaybeRef[_TTreeSelectValue]] = None,
16
+ **kwargs: Unpack[component_types.TTreeselect],
17
+ ):
18
+ super().__init__("a-tree-select")
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_popup_visible_change(
37
+ self,
38
+ handler: EventMixin,
39
+ *,
40
+ extends: typing.Optional[typing.List] = None,
41
+ ):
42
+ self.on(
43
+ "popup-visible-change",
44
+ handler,
45
+ extends=extends,
46
+ )
47
+ return self
48
+
49
+ def on_search(
50
+ self,
51
+ handler: EventMixin,
52
+ *,
53
+ extends: typing.Optional[typing.List] = None,
54
+ ):
55
+ self.on(
56
+ "search",
57
+ handler,
58
+ extends=extends,
59
+ )
60
+ return self
61
+
62
+ def on_clear(
63
+ self,
64
+ handler: EventMixin,
65
+ *,
66
+ extends: typing.Optional[typing.List] = None,
67
+ ):
68
+ self.on(
69
+ "clear",
70
+ handler,
71
+ extends=extends,
72
+ )
73
+ return self
74
+
75
+ def on_input_value_change(
76
+ self,
77
+ handler: EventMixin,
78
+ *,
79
+ extends: typing.Optional[typing.List] = None,
80
+ ):
81
+ self.on(
82
+ "input-value-change",
83
+ handler,
84
+ extends=extends,
85
+ )
86
+ return self
@@ -0,0 +1,58 @@
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 Trigger(Element):
11
+ def __init__(
12
+ self,
13
+ popup_visible_value: typing.Optional[TMaybeRef[bool]] = None,
14
+ **kwargs: Unpack[component_types.TTrigger],
15
+ ):
16
+ super().__init__("a-trigger")
17
+
18
+ try_setup_vmodel(self, popup_visible_value, prop_name="popup-visible")
19
+ self.props(handle_props(kwargs)) # type: ignore
20
+
21
+ def on_popup_visible_change(
22
+ self,
23
+ handler: EventMixin,
24
+ *,
25
+ extends: typing.Optional[typing.List] = None,
26
+ ):
27
+ self.on(
28
+ "popup-visible-change",
29
+ handler,
30
+ extends=extends,
31
+ )
32
+ return self
33
+
34
+ def on_show(
35
+ self,
36
+ handler: EventMixin,
37
+ *,
38
+ extends: typing.Optional[typing.List] = None,
39
+ ):
40
+ self.on(
41
+ "show",
42
+ handler,
43
+ extends=extends,
44
+ )
45
+ return self
46
+
47
+ def on_hide(
48
+ self,
49
+ handler: EventMixin,
50
+ *,
51
+ extends: typing.Optional[typing.List] = None,
52
+ ):
53
+ self.on(
54
+ "hide",
55
+ handler,
56
+ extends=extends,
57
+ )
58
+ return self
@@ -0,0 +1,142 @@
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 Typography(Element):
13
+ _exten_name: typing.ClassVar[typing.Optional[str]] = None
14
+
15
+ def __init__(
16
+ self,
17
+ text: typing.Optional[TMaybeRef[str]] = None,
18
+ **kwargs: Unpack[component_types.TTypography],
19
+ ):
20
+ tag = f"a-typography{'-'+ self._exten_name if self._exten_name else ''}"
21
+ super().__init__(tag)
22
+
23
+ if text is not None:
24
+ with self:
25
+ Content(text)
26
+
27
+ self.props(handle_props(kwargs)) # type: ignore
28
+
29
+ def __init_subclass__(cls, *, exten_name: str = "") -> None:
30
+ cls._exten_name = exten_name
31
+
32
+ def on_edit_start(
33
+ self,
34
+ handler: EventMixin,
35
+ *,
36
+ extends: typing.Optional[typing.List] = None,
37
+ ):
38
+ self.on(
39
+ "edit-start",
40
+ handler,
41
+ extends=extends,
42
+ )
43
+ return self
44
+
45
+ def on_change(
46
+ self,
47
+ handler: EventMixin,
48
+ *,
49
+ extends: typing.Optional[typing.List] = None,
50
+ ):
51
+ self.on(
52
+ "change",
53
+ handler,
54
+ extends=extends,
55
+ )
56
+ return self
57
+
58
+ def on_edit_end(
59
+ self,
60
+ handler: EventMixin,
61
+ *,
62
+ extends: typing.Optional[typing.List] = None,
63
+ ):
64
+ self.on(
65
+ "edit-end",
66
+ handler,
67
+ extends=extends,
68
+ )
69
+ return self
70
+
71
+ def on_copy(
72
+ self,
73
+ handler: EventMixin,
74
+ *,
75
+ extends: typing.Optional[typing.List] = None,
76
+ ):
77
+ self.on(
78
+ "copy",
79
+ handler,
80
+ extends=extends,
81
+ )
82
+ return self
83
+
84
+ def on_ellipsis(
85
+ self,
86
+ handler: EventMixin,
87
+ *,
88
+ extends: typing.Optional[typing.List] = None,
89
+ ):
90
+ self.on(
91
+ "ellipsis",
92
+ handler,
93
+ extends=extends,
94
+ )
95
+ return self
96
+
97
+ def on_expand(
98
+ self,
99
+ handler: EventMixin,
100
+ *,
101
+ extends: typing.Optional[typing.List] = None,
102
+ ):
103
+ self.on(
104
+ "expand",
105
+ handler,
106
+ extends=extends,
107
+ )
108
+ return self
109
+
110
+
111
+ class TypographyTitle(Typography, exten_name="title"):
112
+ def __init__(
113
+ self,
114
+ text: typing.Optional[TMaybeRef[str]] = None,
115
+ *,
116
+ heading: typing.Optional[
117
+ TMaybeRef[typing.Literal["1", "2", "3", "4", "5", "6"]]
118
+ ] = None,
119
+ **kwargs: Unpack[component_types.TTypography],
120
+ ):
121
+ super().__init__(text=text, **kwargs)
122
+
123
+ if heading is not None:
124
+ self.props({"heading": heading})
125
+
126
+
127
+ class TypographyParagraph(Typography, exten_name="paragraph"):
128
+ def __init__(
129
+ self,
130
+ text: typing.Optional[TMaybeRef[str]] = None,
131
+ *,
132
+ blockquote: typing.Optional[TMaybeRef[bool]] = None,
133
+ spacing: typing.Optional[TMaybeRef[typing.Literal["default", "close"]]] = None,
134
+ **kwargs: Unpack[component_types.TTypography],
135
+ ):
136
+ super().__init__(text=text, **kwargs)
137
+
138
+ if blockquote is not None:
139
+ self.props({"blockquote": blockquote})
140
+
141
+ if spacing is not None:
142
+ self.props({"spacing": spacing})
@@ -0,0 +1,71 @@
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 Upload(Element):
11
+ def __init__(
12
+ self,
13
+ value: typing.Optional[TMaybeRef[typing.Any]] = None,
14
+ **kwargs: Unpack[component_types.TUpload],
15
+ ):
16
+ super().__init__("a-upload")
17
+
18
+ try_setup_vmodel(self, value)
19
+ self.props(handle_props(kwargs)) # type: ignore
20
+
21
+ def on_submit(
22
+ self,
23
+ handler: EventMixin,
24
+ *,
25
+ extends: typing.Optional[typing.List] = None,
26
+ ):
27
+ self.on(
28
+ "submit",
29
+ handler,
30
+ extends=extends,
31
+ )
32
+ return self
33
+
34
+ def on_abort(
35
+ self,
36
+ handler: EventMixin,
37
+ *,
38
+ extends: typing.Optional[typing.List] = None,
39
+ ):
40
+ self.on(
41
+ "abort",
42
+ handler,
43
+ extends=extends,
44
+ )
45
+ return self
46
+
47
+ def on_update_file(
48
+ self,
49
+ handler: EventMixin,
50
+ *,
51
+ extends: typing.Optional[typing.List] = None,
52
+ ):
53
+ self.on(
54
+ "updateFile",
55
+ handler,
56
+ extends=extends,
57
+ )
58
+ return self
59
+
60
+ def on_upload(
61
+ self,
62
+ handler: EventMixin,
63
+ *,
64
+ extends: typing.Optional[typing.List] = None,
65
+ ):
66
+ self.on(
67
+ "upload",
68
+ handler,
69
+ extends=extends,
70
+ )
71
+ return self
@@ -0,0 +1,58 @@
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 VerificationCode(Element):
11
+ def __init__(
12
+ self,
13
+ value: typing.Optional[TMaybeRef[str]] = None,
14
+ **kwargs: Unpack[component_types.TVerificationcode],
15
+ ):
16
+ super().__init__("a-verification-code")
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_finish(
35
+ self,
36
+ handler: EventMixin,
37
+ *,
38
+ extends: typing.Optional[typing.List] = None,
39
+ ):
40
+ self.on(
41
+ "finish",
42
+ handler,
43
+ extends=extends,
44
+ )
45
+ return self
46
+
47
+ def on_input(
48
+ self,
49
+ handler: EventMixin,
50
+ *,
51
+ extends: typing.Optional[typing.List] = None,
52
+ ):
53
+ self.on(
54
+ "input",
55
+ handler,
56
+ extends=extends,
57
+ )
58
+ 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 Watermark(Element):
8
+ def __init__(
9
+ self,
10
+ **kwargs: Unpack[component_types.TWatermark],
11
+ ):
12
+ super().__init__("a-watermark")
13
+
14
+ self.props(handle_props(kwargs)) # type: ignore
@@ -0,0 +1,4 @@
1
+ from ._index import get_locale
2
+
3
+
4
+ __all__ = ["get_locale"]
@@ -0,0 +1,31 @@
1
+ import importlib
2
+ from typing import Dict
3
+ from instaui.arco.types import TLocale
4
+
5
+
6
+ class LazyLocaleDict:
7
+ def __init__(self):
8
+ self._locale_map = {}
9
+
10
+ def get(self, key: str):
11
+ key = key.lower().replace("-", "_")
12
+
13
+ if key not in self._locale_map:
14
+ self._locale_map[key] = self._load_locale(key)
15
+ return self._locale_map[key]
16
+
17
+ def _load_locale(self, key: str):
18
+ module_name = key
19
+ try:
20
+ module = importlib.import_module(f"instaui.arco.locales.{module_name}")
21
+ return module.locale
22
+
23
+ except ImportError:
24
+ raise ImportError(f"Cannot import module {module_name}")
25
+
26
+
27
+ _locale_dict = LazyLocaleDict()
28
+
29
+
30
+ def get_locale(locale: TLocale) -> Dict:
31
+ return _locale_dict.get(locale)