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.
- instaui/arco/__init__.py +191 -0
- instaui/arco/_settings.py +25 -0
- instaui/arco/_use_tools/locale.py +50 -0
- instaui/arco/component_types.py +1019 -0
- instaui/arco/components/_utils.py +22 -0
- instaui/arco/components/affix.py +29 -0
- instaui/arco/components/alert.py +42 -0
- instaui/arco/components/anchor.py +42 -0
- instaui/arco/components/auto_complete.py +96 -0
- instaui/arco/components/avatar.py +55 -0
- instaui/arco/components/back_top.py +14 -0
- instaui/arco/components/badge.py +14 -0
- instaui/arco/components/breadcrumb.py +14 -0
- instaui/arco/components/button.py +43 -0
- instaui/arco/components/calendar.py +47 -0
- instaui/arco/components/card.py +14 -0
- instaui/arco/components/carousel.py +33 -0
- instaui/arco/components/cascader.py +111 -0
- instaui/arco/components/checkbox.py +32 -0
- instaui/arco/components/collapse.py +31 -0
- instaui/arco/components/color_picker.py +45 -0
- instaui/arco/components/comment.py +14 -0
- instaui/arco/components/config_provider.py +13 -0
- instaui/arco/components/date_picker.py +111 -0
- instaui/arco/components/descriptions.py +14 -0
- instaui/arco/components/divider.py +13 -0
- instaui/arco/components/drawer.py +98 -0
- instaui/arco/components/dropdown.py +45 -0
- instaui/arco/components/empty.py +14 -0
- instaui/arco/components/form.py +55 -0
- instaui/arco/components/icon.py +17 -0
- instaui/arco/components/image.py +33 -0
- instaui/arco/components/input.py +102 -0
- instaui/arco/components/input_number.py +97 -0
- instaui/arco/components/input_password.py +38 -0
- instaui/arco/components/input_search.py +37 -0
- instaui/arco/components/input_tag.py +110 -0
- instaui/arco/components/layout.py +13 -0
- instaui/arco/components/layout_content.py +6 -0
- instaui/arco/components/layout_footer.py +6 -0
- instaui/arco/components/layout_header.py +6 -0
- instaui/arco/components/layout_sider.py +53 -0
- instaui/arco/components/link.py +36 -0
- instaui/arco/components/list.py +68 -0
- instaui/arco/components/mention.py +97 -0
- instaui/arco/components/menu.py +88 -0
- instaui/arco/components/modal.py +97 -0
- instaui/arco/components/overflow_list.py +29 -0
- instaui/arco/components/page_header.py +29 -0
- instaui/arco/components/pagination.py +45 -0
- instaui/arco/components/pop_confirm.py +58 -0
- instaui/arco/components/popover.py +32 -0
- instaui/arco/components/progress.py +14 -0
- instaui/arco/components/radio.py +40 -0
- instaui/arco/components/radio_group.py +42 -0
- instaui/arco/components/rate.py +45 -0
- instaui/arco/components/resize_box.py +62 -0
- instaui/arco/components/result.py +14 -0
- instaui/arco/components/select.py +179 -0
- instaui/arco/components/skeleton.py +14 -0
- instaui/arco/components/slider.py +38 -0
- instaui/arco/components/space.py +14 -0
- instaui/arco/components/spin.py +14 -0
- instaui/arco/components/split.py +76 -0
- instaui/arco/components/statistic.py +14 -0
- instaui/arco/components/steps.py +32 -0
- instaui/arco/components/switch.py +57 -0
- instaui/arco/components/tab_pane.py +12 -0
- instaui/arco/components/table.py +276 -0
- instaui/arco/components/tabs.py +101 -0
- instaui/arco/components/tag.py +42 -0
- instaui/arco/components/textarea.py +84 -0
- instaui/arco/components/time_picker.py +76 -0
- instaui/arco/components/timeline.py +14 -0
- instaui/arco/components/tooltip.py +29 -0
- instaui/arco/components/transfer.py +58 -0
- instaui/arco/components/tree.py +120 -0
- instaui/arco/components/tree_select.py +86 -0
- instaui/arco/components/trigger.py +58 -0
- instaui/arco/components/typography.py +142 -0
- instaui/arco/components/upload.py +71 -0
- instaui/arco/components/verification_code.py +58 -0
- instaui/arco/components/watermark.py +14 -0
- instaui/arco/locales/__init__.py +4 -0
- instaui/arco/locales/_index.py +31 -0
- instaui/arco/locales/en_us.py +227 -0
- instaui/arco/locales/zh_cn.py +224 -0
- instaui/arco/setup.py +36 -0
- instaui/arco/static/instaui-arco.css +1 -0
- instaui/arco/static/instaui-arco.js +55771 -0
- instaui/arco/types.py +24 -0
- instaui/components/column.py +10 -2
- instaui/components/element.py +0 -2
- instaui/components/grid.py +81 -0
- instaui/components/markdown/static/github-markdown.css +1 -1
- instaui/components/row.py +8 -7
- instaui/components/shiki_code/static/shiki-style.css +179 -175
- instaui/experimental/link_sql/__init__.py +3 -0
- instaui/experimental/link_sql/_base.py +23 -0
- instaui/experimental/link_sql/_duckdb.py +221 -0
- instaui/experimental/link_sql/_types.py +15 -0
- instaui/experimental/link_sql/data_source.js +50 -0
- instaui/fastapi_server/debug_mode_router.py +1 -1
- instaui/html_tools.py +2 -3
- instaui/runtime/scope.py +28 -7
- instaui/static/insta-ui.css +1 -1
- instaui/static/insta-ui.esm-browser.prod.js +3663 -3719
- instaui/static/insta-ui.js.map +1 -1
- instaui/static/templates/debug/sse.html +1 -1
- instaui/tailwind/_index.py +2 -2
- instaui/ui_functions/ui_page.py +1 -1
- instaui/vars/data.py +7 -7
- instaui/vars/element_ref.py +2 -4
- instaui/vars/js_computed.py +6 -8
- instaui/vars/ref.py +6 -6
- instaui/vars/vue_computed.py +6 -7
- instaui/vars/web_computed.py +2 -3
- instaui/watch/vue_watch.py +23 -7
- instaui/zero/scope.py +3 -20
- {instaui-0.1.5.dist-info → instaui-0.1.6.dist-info}/METADATA +5 -4
- {instaui-0.1.5.dist-info → instaui-0.1.6.dist-info}/RECORD +123 -36
- instaui/daisyui/__init__.py +0 -26
- instaui/daisyui/_index.py +0 -20
- instaui/daisyui/button.py +0 -38
- instaui/daisyui/checkbox.py +0 -17
- instaui/daisyui/static/daisyui.css +0 -1
- instaui/daisyui/static/themes.css +0 -1
- instaui/daisyui/table.py +0 -35
- instaui/ui/__build_init.py +0 -73
- instaui/vars/_utils.py +0 -12
- {instaui-0.1.5.dist-info → instaui-0.1.6.dist-info}/LICENSE +0 -0
- {instaui-0.1.5.dist-info → instaui-0.1.6.dist-info}/WHEEL +0 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
import typing
|
2
|
+
from typing_extensions import Unpack
|
3
|
+
from instaui.vars.types import TMaybeRef
|
4
|
+
from instaui.arco import component_types
|
5
|
+
from instaui.event.event_mixin import EventMixin
|
6
|
+
from .input import Input
|
7
|
+
|
8
|
+
|
9
|
+
class TInputSearch(component_types.TInput):
|
10
|
+
search_button: bool
|
11
|
+
loading: bool
|
12
|
+
disabled: bool
|
13
|
+
size: typing.Literal["mini", "small", "medium", "large"]
|
14
|
+
button_text: str
|
15
|
+
button_props: typing.Dict[str, typing.Any]
|
16
|
+
|
17
|
+
|
18
|
+
class InputSearch(Input, exten_name="search"):
|
19
|
+
def __init__(
|
20
|
+
self,
|
21
|
+
value: typing.Optional[TMaybeRef[str]] = None,
|
22
|
+
**kwargs: Unpack[TInputSearch],
|
23
|
+
):
|
24
|
+
super().__init__(value=value, **kwargs)
|
25
|
+
|
26
|
+
def on_search(
|
27
|
+
self,
|
28
|
+
handler: EventMixin,
|
29
|
+
*,
|
30
|
+
extends: typing.Optional[typing.List] = None,
|
31
|
+
):
|
32
|
+
self.on(
|
33
|
+
"search",
|
34
|
+
handler,
|
35
|
+
extends=extends,
|
36
|
+
)
|
37
|
+
return self
|
@@ -0,0 +1,110 @@
|
|
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 InputTag(Element):
|
11
|
+
def __init__(
|
12
|
+
self,
|
13
|
+
value: typing.Optional[TMaybeRef[str]] = None,
|
14
|
+
**kwargs: Unpack[component_types.TInputtag],
|
15
|
+
):
|
16
|
+
super().__init__("a-input-tag")
|
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_input_value_change(
|
35
|
+
self,
|
36
|
+
handler: EventMixin,
|
37
|
+
*,
|
38
|
+
extends: typing.Optional[typing.List] = None,
|
39
|
+
):
|
40
|
+
self.on(
|
41
|
+
"input-value-change",
|
42
|
+
handler,
|
43
|
+
extends=extends,
|
44
|
+
)
|
45
|
+
return self
|
46
|
+
|
47
|
+
def on_press_enter(
|
48
|
+
self,
|
49
|
+
handler: EventMixin,
|
50
|
+
*,
|
51
|
+
extends: typing.Optional[typing.List] = None,
|
52
|
+
):
|
53
|
+
self.on(
|
54
|
+
"press-enter",
|
55
|
+
handler,
|
56
|
+
extends=extends,
|
57
|
+
)
|
58
|
+
return self
|
59
|
+
|
60
|
+
def on_remove(
|
61
|
+
self,
|
62
|
+
handler: EventMixin,
|
63
|
+
*,
|
64
|
+
extends: typing.Optional[typing.List] = None,
|
65
|
+
):
|
66
|
+
self.on(
|
67
|
+
"remove",
|
68
|
+
handler,
|
69
|
+
extends=extends,
|
70
|
+
)
|
71
|
+
return self
|
72
|
+
|
73
|
+
def on_clear(
|
74
|
+
self,
|
75
|
+
handler: EventMixin,
|
76
|
+
*,
|
77
|
+
extends: typing.Optional[typing.List] = None,
|
78
|
+
):
|
79
|
+
self.on(
|
80
|
+
"clear",
|
81
|
+
handler,
|
82
|
+
extends=extends,
|
83
|
+
)
|
84
|
+
return self
|
85
|
+
|
86
|
+
def on_focus(
|
87
|
+
self,
|
88
|
+
handler: EventMixin,
|
89
|
+
*,
|
90
|
+
extends: typing.Optional[typing.List] = None,
|
91
|
+
):
|
92
|
+
self.on(
|
93
|
+
"focus",
|
94
|
+
handler,
|
95
|
+
extends=extends,
|
96
|
+
)
|
97
|
+
return self
|
98
|
+
|
99
|
+
def on_blur(
|
100
|
+
self,
|
101
|
+
handler: EventMixin,
|
102
|
+
*,
|
103
|
+
extends: typing.Optional[typing.List] = None,
|
104
|
+
):
|
105
|
+
self.on(
|
106
|
+
"blur",
|
107
|
+
handler,
|
108
|
+
extends=extends,
|
109
|
+
)
|
110
|
+
return self
|
@@ -0,0 +1,13 @@
|
|
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 Layout(Element):
|
8
|
+
def __init__(
|
9
|
+
self,
|
10
|
+
**kwargs: Unpack[component_types.TLayout],
|
11
|
+
):
|
12
|
+
super().__init__("a-layout")
|
13
|
+
self.props(handle_props(kwargs)) # type: ignore
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import typing
|
2
|
+
from typing_extensions import TypedDict, Unpack
|
3
|
+
from instaui.components.element import Element
|
4
|
+
from instaui.event.event_mixin import EventMixin
|
5
|
+
from ._utils import handle_props
|
6
|
+
|
7
|
+
|
8
|
+
class TLayoutSider(TypedDict, total=False):
|
9
|
+
theme: typing.Literal["dark", "light"]
|
10
|
+
collapsed: bool
|
11
|
+
default_collapsed: bool
|
12
|
+
collapsible: bool
|
13
|
+
width: int
|
14
|
+
collapsed_width: int
|
15
|
+
reverse_arrow: bool
|
16
|
+
breakpoint: typing.Literal["xxl", "xl", "lg", "md", "sm", "xs"]
|
17
|
+
resize_directions: typing.List[typing.Literal["left", "right", "top", "bottom"]]
|
18
|
+
hide_trigger: bool
|
19
|
+
|
20
|
+
|
21
|
+
class LayoutSider(Element):
|
22
|
+
def __init__(
|
23
|
+
self,
|
24
|
+
**kwargs: Unpack[TLayoutSider],
|
25
|
+
):
|
26
|
+
super().__init__("a-layout-sider")
|
27
|
+
self.props(handle_props(kwargs)) # type: ignore
|
28
|
+
|
29
|
+
def on_collapse(
|
30
|
+
self,
|
31
|
+
handler: EventMixin,
|
32
|
+
*,
|
33
|
+
extends: typing.Optional[typing.List] = None,
|
34
|
+
):
|
35
|
+
self.on(
|
36
|
+
"collapse",
|
37
|
+
handler,
|
38
|
+
extends=extends,
|
39
|
+
)
|
40
|
+
return self
|
41
|
+
|
42
|
+
def on_breakpoint(
|
43
|
+
self,
|
44
|
+
handler: EventMixin,
|
45
|
+
*,
|
46
|
+
extends: typing.Optional[typing.List] = None,
|
47
|
+
):
|
48
|
+
self.on(
|
49
|
+
"breakpoint",
|
50
|
+
handler,
|
51
|
+
extends=extends,
|
52
|
+
)
|
53
|
+
return self
|
@@ -0,0 +1,36 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
from typing import List, Optional
|
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
|
9
|
+
|
10
|
+
|
11
|
+
class Link(Element):
|
12
|
+
def __init__(
|
13
|
+
self,
|
14
|
+
text: Optional[TMaybeRef[str]] = None,
|
15
|
+
**kwargs: Unpack[component_types.TLink],
|
16
|
+
):
|
17
|
+
super().__init__("a-link")
|
18
|
+
|
19
|
+
if text is not None:
|
20
|
+
self.props({"text": text})
|
21
|
+
|
22
|
+
self.props(handle_props(kwargs)) # type: ignore
|
23
|
+
|
24
|
+
def on_click(
|
25
|
+
self,
|
26
|
+
handler: EventMixin,
|
27
|
+
*,
|
28
|
+
extends: Optional[List] = None,
|
29
|
+
key: Optional[str] = None,
|
30
|
+
):
|
31
|
+
self.on(
|
32
|
+
"click",
|
33
|
+
handler,
|
34
|
+
extends=extends,
|
35
|
+
)
|
36
|
+
return self
|
@@ -0,0 +1,68 @@
|
|
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 List(Element):
|
10
|
+
def __init__(
|
11
|
+
self,
|
12
|
+
**kwargs: Unpack[component_types.TList],
|
13
|
+
):
|
14
|
+
super().__init__("a-list")
|
15
|
+
|
16
|
+
self.props(handle_props(kwargs)) # type: ignore
|
17
|
+
|
18
|
+
def on_scroll(
|
19
|
+
self,
|
20
|
+
handler: EventMixin,
|
21
|
+
*,
|
22
|
+
extends: typing.Optional[typing.List] = None,
|
23
|
+
):
|
24
|
+
self.on(
|
25
|
+
"scroll",
|
26
|
+
handler,
|
27
|
+
extends=extends,
|
28
|
+
)
|
29
|
+
return self
|
30
|
+
|
31
|
+
def on_reach_bottom(
|
32
|
+
self,
|
33
|
+
handler: EventMixin,
|
34
|
+
*,
|
35
|
+
extends: typing.Optional[typing.List] = None,
|
36
|
+
):
|
37
|
+
self.on(
|
38
|
+
"reach-bottom",
|
39
|
+
handler,
|
40
|
+
extends=extends,
|
41
|
+
)
|
42
|
+
return self
|
43
|
+
|
44
|
+
def on_page_change(
|
45
|
+
self,
|
46
|
+
handler: EventMixin,
|
47
|
+
*,
|
48
|
+
extends: typing.Optional[typing.List] = None,
|
49
|
+
):
|
50
|
+
self.on(
|
51
|
+
"page-change",
|
52
|
+
handler,
|
53
|
+
extends=extends,
|
54
|
+
)
|
55
|
+
return self
|
56
|
+
|
57
|
+
def on_page_size_change(
|
58
|
+
self,
|
59
|
+
handler: EventMixin,
|
60
|
+
*,
|
61
|
+
extends: typing.Optional[typing.List] = None,
|
62
|
+
):
|
63
|
+
self.on(
|
64
|
+
"page-size-change",
|
65
|
+
handler,
|
66
|
+
extends=extends,
|
67
|
+
)
|
68
|
+
return self
|
@@ -0,0 +1,97 @@
|
|
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 Mention(Element):
|
11
|
+
def __init__(
|
12
|
+
self,
|
13
|
+
value: typing.Optional[TMaybeRef[str]] = None,
|
14
|
+
**kwargs: Unpack[component_types.TMention],
|
15
|
+
):
|
16
|
+
super().__init__("a-mention")
|
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_search(
|
35
|
+
self,
|
36
|
+
handler: EventMixin,
|
37
|
+
*,
|
38
|
+
extends: typing.Optional[typing.List] = None,
|
39
|
+
):
|
40
|
+
self.on(
|
41
|
+
"search",
|
42
|
+
handler,
|
43
|
+
extends=extends,
|
44
|
+
)
|
45
|
+
return self
|
46
|
+
|
47
|
+
def on_select(
|
48
|
+
self,
|
49
|
+
handler: EventMixin,
|
50
|
+
*,
|
51
|
+
extends: typing.Optional[typing.List] = None,
|
52
|
+
):
|
53
|
+
self.on(
|
54
|
+
"select",
|
55
|
+
handler,
|
56
|
+
extends=extends,
|
57
|
+
)
|
58
|
+
return self
|
59
|
+
|
60
|
+
def on_clear(
|
61
|
+
self,
|
62
|
+
handler: EventMixin,
|
63
|
+
*,
|
64
|
+
extends: typing.Optional[typing.List] = None,
|
65
|
+
):
|
66
|
+
self.on(
|
67
|
+
"clear",
|
68
|
+
handler,
|
69
|
+
extends=extends,
|
70
|
+
)
|
71
|
+
return self
|
72
|
+
|
73
|
+
def on_focus(
|
74
|
+
self,
|
75
|
+
handler: EventMixin,
|
76
|
+
*,
|
77
|
+
extends: typing.Optional[typing.List] = None,
|
78
|
+
):
|
79
|
+
self.on(
|
80
|
+
"focus",
|
81
|
+
handler,
|
82
|
+
extends=extends,
|
83
|
+
)
|
84
|
+
return self
|
85
|
+
|
86
|
+
def on_blur(
|
87
|
+
self,
|
88
|
+
handler: EventMixin,
|
89
|
+
*,
|
90
|
+
extends: typing.Optional[typing.List] = None,
|
91
|
+
):
|
92
|
+
self.on(
|
93
|
+
"blur",
|
94
|
+
handler,
|
95
|
+
extends=extends,
|
96
|
+
)
|
97
|
+
return self
|
@@ -0,0 +1,88 @@
|
|
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.components.content import Content
|
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 Menu(Element):
|
12
|
+
def __init__(
|
13
|
+
self,
|
14
|
+
collapsed_value: typing.Optional[TMaybeRef[bool]] = None,
|
15
|
+
**kwargs: Unpack[component_types.TMenu],
|
16
|
+
):
|
17
|
+
super().__init__("a-menu")
|
18
|
+
|
19
|
+
try_setup_vmodel(self, collapsed_value, prop_name="collapsed")
|
20
|
+
self.props(handle_props(kwargs)) # type: ignore
|
21
|
+
|
22
|
+
def on_collapse(
|
23
|
+
self,
|
24
|
+
handler: EventMixin,
|
25
|
+
*,
|
26
|
+
extends: typing.Optional[typing.List] = None,
|
27
|
+
):
|
28
|
+
self.on(
|
29
|
+
"collapse",
|
30
|
+
handler,
|
31
|
+
extends=extends,
|
32
|
+
)
|
33
|
+
return self
|
34
|
+
|
35
|
+
def on_menu_item_click(
|
36
|
+
self,
|
37
|
+
handler: EventMixin,
|
38
|
+
*,
|
39
|
+
extends: typing.Optional[typing.List] = None,
|
40
|
+
):
|
41
|
+
self.on(
|
42
|
+
"menu-item-click",
|
43
|
+
handler,
|
44
|
+
extends=extends,
|
45
|
+
)
|
46
|
+
return self
|
47
|
+
|
48
|
+
def on_sub_menu_click(
|
49
|
+
self,
|
50
|
+
handler: EventMixin,
|
51
|
+
*,
|
52
|
+
extends: typing.Optional[typing.List] = None,
|
53
|
+
):
|
54
|
+
self.on(
|
55
|
+
"sub-menu-click",
|
56
|
+
handler,
|
57
|
+
extends=extends,
|
58
|
+
)
|
59
|
+
return self
|
60
|
+
|
61
|
+
|
62
|
+
class MenuItem(Element):
|
63
|
+
def __init__(self, title: typing.Optional[TMaybeRef[str]] = None):
|
64
|
+
super().__init__("a-menu-item")
|
65
|
+
|
66
|
+
if title is not None:
|
67
|
+
with self:
|
68
|
+
Content(title)
|
69
|
+
|
70
|
+
def icon_slot(self):
|
71
|
+
return self.add_slot("icon")
|
72
|
+
|
73
|
+
|
74
|
+
class SubMenu(Element):
|
75
|
+
def __init__(
|
76
|
+
self,
|
77
|
+
title: typing.Optional[TMaybeRef[str]] = None,
|
78
|
+
):
|
79
|
+
super().__init__("a-sub-menu")
|
80
|
+
if title is not None:
|
81
|
+
with self.title_slot():
|
82
|
+
Content(title)
|
83
|
+
|
84
|
+
def icon_slot(self):
|
85
|
+
return self.add_slot("icon")
|
86
|
+
|
87
|
+
def title_slot(self):
|
88
|
+
return self.add_slot("title")
|
@@ -0,0 +1,97 @@
|
|
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 Modal(Element):
|
11
|
+
def __init__(
|
12
|
+
self,
|
13
|
+
visible_value: typing.Optional[TMaybeRef[bool]] = None,
|
14
|
+
**kwargs: Unpack[component_types.TModal],
|
15
|
+
):
|
16
|
+
super().__init__("a-modal")
|
17
|
+
|
18
|
+
try_setup_vmodel(self, visible_value, prop_name="visible")
|
19
|
+
self.props(handle_props(kwargs)) # type: ignore
|
20
|
+
|
21
|
+
def on_ok(
|
22
|
+
self,
|
23
|
+
handler: EventMixin,
|
24
|
+
*,
|
25
|
+
extends: typing.Optional[typing.List] = None,
|
26
|
+
):
|
27
|
+
self.on(
|
28
|
+
"ok",
|
29
|
+
handler,
|
30
|
+
extends=extends,
|
31
|
+
)
|
32
|
+
return self
|
33
|
+
|
34
|
+
def on_cancel(
|
35
|
+
self,
|
36
|
+
handler: EventMixin,
|
37
|
+
*,
|
38
|
+
extends: typing.Optional[typing.List] = None,
|
39
|
+
):
|
40
|
+
self.on(
|
41
|
+
"cancel",
|
42
|
+
handler,
|
43
|
+
extends=extends,
|
44
|
+
)
|
45
|
+
return self
|
46
|
+
|
47
|
+
def on_open(
|
48
|
+
self,
|
49
|
+
handler: EventMixin,
|
50
|
+
*,
|
51
|
+
extends: typing.Optional[typing.List] = None,
|
52
|
+
):
|
53
|
+
self.on(
|
54
|
+
"open",
|
55
|
+
handler,
|
56
|
+
extends=extends,
|
57
|
+
)
|
58
|
+
return self
|
59
|
+
|
60
|
+
def on_close(
|
61
|
+
self,
|
62
|
+
handler: EventMixin,
|
63
|
+
*,
|
64
|
+
extends: typing.Optional[typing.List] = None,
|
65
|
+
):
|
66
|
+
self.on(
|
67
|
+
"close",
|
68
|
+
handler,
|
69
|
+
extends=extends,
|
70
|
+
)
|
71
|
+
return self
|
72
|
+
|
73
|
+
def on_before_open(
|
74
|
+
self,
|
75
|
+
handler: EventMixin,
|
76
|
+
*,
|
77
|
+
extends: typing.Optional[typing.List] = None,
|
78
|
+
):
|
79
|
+
self.on(
|
80
|
+
"before-open",
|
81
|
+
handler,
|
82
|
+
extends=extends,
|
83
|
+
)
|
84
|
+
return self
|
85
|
+
|
86
|
+
def on_before_close(
|
87
|
+
self,
|
88
|
+
handler: EventMixin,
|
89
|
+
*,
|
90
|
+
extends: typing.Optional[typing.List] = None,
|
91
|
+
):
|
92
|
+
self.on(
|
93
|
+
"before-close",
|
94
|
+
handler,
|
95
|
+
extends=extends,
|
96
|
+
)
|
97
|
+
return self
|
@@ -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 OverflowList(Element):
|
10
|
+
def __init__(
|
11
|
+
self,
|
12
|
+
**kwargs: Unpack[component_types.TOverflowlist],
|
13
|
+
):
|
14
|
+
super().__init__("a-overflow-list")
|
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,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 PageHeader(Element):
|
10
|
+
def __init__(
|
11
|
+
self,
|
12
|
+
**kwargs: Unpack[component_types.TPageheader],
|
13
|
+
):
|
14
|
+
super().__init__("a-page-header")
|
15
|
+
|
16
|
+
self.props(handle_props(kwargs)) # type: ignore
|
17
|
+
|
18
|
+
def on_back(
|
19
|
+
self,
|
20
|
+
handler: EventMixin,
|
21
|
+
*,
|
22
|
+
extends: typing.Optional[typing.List] = None,
|
23
|
+
):
|
24
|
+
self.on(
|
25
|
+
"back",
|
26
|
+
handler,
|
27
|
+
extends=extends,
|
28
|
+
)
|
29
|
+
return self
|