instaui 0.1.5__py3-none-any.whl → 0.1.7__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.7.dist-info}/METADATA +8 -5
- {instaui-0.1.5.dist-info → instaui-0.1.7.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.7.dist-info}/LICENSE +0 -0
- {instaui-0.1.5.dist-info → instaui-0.1.7.dist-info}/WHEEL +0 -0
@@ -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 Comment(Element):
|
8
|
+
def __init__(
|
9
|
+
self,
|
10
|
+
**kwargs: Unpack[component_types.TComment],
|
11
|
+
):
|
12
|
+
super().__init__("a-comment")
|
13
|
+
|
14
|
+
self.props(handle_props(kwargs)) # type: ignore
|
@@ -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 ConfigProvider(Element):
|
8
|
+
def __init__(
|
9
|
+
self,
|
10
|
+
**kwargs: Unpack[component_types.TConfigprovider],
|
11
|
+
):
|
12
|
+
super().__init__("a-config-provider")
|
13
|
+
self.props(handle_props(kwargs)) # type: ignore
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import typing
|
2
|
+
from typing_extensions import Unpack
|
3
|
+
import datetime
|
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 DatePicker(Element):
|
12
|
+
def __init__(
|
13
|
+
self,
|
14
|
+
value: typing.Optional[TMaybeRef[datetime.datetime]] = None,
|
15
|
+
**kwargs: Unpack[component_types.TDatepicker],
|
16
|
+
):
|
17
|
+
super().__init__("a-date-picker")
|
18
|
+
|
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_select(
|
36
|
+
self,
|
37
|
+
handler: EventMixin,
|
38
|
+
*,
|
39
|
+
extends: typing.Optional[typing.List] = None,
|
40
|
+
):
|
41
|
+
self.on(
|
42
|
+
"select",
|
43
|
+
handler,
|
44
|
+
extends=extends,
|
45
|
+
)
|
46
|
+
return self
|
47
|
+
|
48
|
+
def on_popup_visible_change(
|
49
|
+
self,
|
50
|
+
handler: EventMixin,
|
51
|
+
*,
|
52
|
+
extends: typing.Optional[typing.List] = None,
|
53
|
+
):
|
54
|
+
self.on(
|
55
|
+
"popup-visible-change",
|
56
|
+
handler,
|
57
|
+
extends=extends,
|
58
|
+
)
|
59
|
+
return self
|
60
|
+
|
61
|
+
def on_ok(
|
62
|
+
self,
|
63
|
+
handler: EventMixin,
|
64
|
+
*,
|
65
|
+
extends: typing.Optional[typing.List] = None,
|
66
|
+
):
|
67
|
+
self.on(
|
68
|
+
"ok",
|
69
|
+
handler,
|
70
|
+
extends=extends,
|
71
|
+
)
|
72
|
+
return self
|
73
|
+
|
74
|
+
def on_clear(
|
75
|
+
self,
|
76
|
+
handler: EventMixin,
|
77
|
+
*,
|
78
|
+
extends: typing.Optional[typing.List] = None,
|
79
|
+
):
|
80
|
+
self.on(
|
81
|
+
"clear",
|
82
|
+
handler,
|
83
|
+
extends=extends,
|
84
|
+
)
|
85
|
+
return self
|
86
|
+
|
87
|
+
def on_select_shortcut(
|
88
|
+
self,
|
89
|
+
handler: EventMixin,
|
90
|
+
*,
|
91
|
+
extends: typing.Optional[typing.List] = None,
|
92
|
+
):
|
93
|
+
self.on(
|
94
|
+
"select-shortcut",
|
95
|
+
handler,
|
96
|
+
extends=extends,
|
97
|
+
)
|
98
|
+
return self
|
99
|
+
|
100
|
+
def on_picker_value_change(
|
101
|
+
self,
|
102
|
+
handler: EventMixin,
|
103
|
+
*,
|
104
|
+
extends: typing.Optional[typing.List] = None,
|
105
|
+
):
|
106
|
+
self.on(
|
107
|
+
"picker-value-change",
|
108
|
+
handler,
|
109
|
+
extends=extends,
|
110
|
+
)
|
111
|
+
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 Descriptions(Element):
|
8
|
+
def __init__(
|
9
|
+
self,
|
10
|
+
**kwargs: Unpack[component_types.TDescriptions],
|
11
|
+
):
|
12
|
+
super().__init__("a-descriptions")
|
13
|
+
|
14
|
+
self.props(handle_props(kwargs)) # type: ignore
|
@@ -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 Divider(Element):
|
8
|
+
def __init__(
|
9
|
+
self,
|
10
|
+
**kwargs: Unpack[component_types.TDivider],
|
11
|
+
):
|
12
|
+
super().__init__("a-divider")
|
13
|
+
self.props(handle_props(kwargs)) # type: ignore
|
@@ -0,0 +1,98 @@
|
|
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 ._utils import handle_props, try_setup_vmodel
|
7
|
+
|
8
|
+
from instaui.event.event_mixin import EventMixin
|
9
|
+
|
10
|
+
|
11
|
+
class Drawer(Element):
|
12
|
+
def __init__(
|
13
|
+
self,
|
14
|
+
visible_value: typing.Optional[TMaybeRef[bool]] = None,
|
15
|
+
**kwargs: Unpack[component_types.TDrawer],
|
16
|
+
):
|
17
|
+
super().__init__("a-drawer")
|
18
|
+
|
19
|
+
try_setup_vmodel(self, visible_value, prop_name="visible")
|
20
|
+
self.props(handle_props(kwargs)) # type: ignore
|
21
|
+
|
22
|
+
def on_ok(
|
23
|
+
self,
|
24
|
+
handler: EventMixin,
|
25
|
+
*,
|
26
|
+
extends: typing.Optional[typing.List] = None,
|
27
|
+
):
|
28
|
+
self.on(
|
29
|
+
"ok",
|
30
|
+
handler,
|
31
|
+
extends=extends,
|
32
|
+
)
|
33
|
+
return self
|
34
|
+
|
35
|
+
def on_cancel(
|
36
|
+
self,
|
37
|
+
handler: EventMixin,
|
38
|
+
*,
|
39
|
+
extends: typing.Optional[typing.List] = None,
|
40
|
+
):
|
41
|
+
self.on(
|
42
|
+
"cancel",
|
43
|
+
handler,
|
44
|
+
extends=extends,
|
45
|
+
)
|
46
|
+
return self
|
47
|
+
|
48
|
+
def on_open(
|
49
|
+
self,
|
50
|
+
handler: EventMixin,
|
51
|
+
*,
|
52
|
+
extends: typing.Optional[typing.List] = None,
|
53
|
+
):
|
54
|
+
self.on(
|
55
|
+
"open",
|
56
|
+
handler,
|
57
|
+
extends=extends,
|
58
|
+
)
|
59
|
+
return self
|
60
|
+
|
61
|
+
def on_close(
|
62
|
+
self,
|
63
|
+
handler: EventMixin,
|
64
|
+
*,
|
65
|
+
extends: typing.Optional[typing.List] = None,
|
66
|
+
):
|
67
|
+
self.on(
|
68
|
+
"close",
|
69
|
+
handler,
|
70
|
+
extends=extends,
|
71
|
+
)
|
72
|
+
return self
|
73
|
+
|
74
|
+
def on_before_open(
|
75
|
+
self,
|
76
|
+
handler: EventMixin,
|
77
|
+
*,
|
78
|
+
extends: typing.Optional[typing.List] = None,
|
79
|
+
):
|
80
|
+
self.on(
|
81
|
+
"before-open",
|
82
|
+
handler,
|
83
|
+
extends=extends,
|
84
|
+
)
|
85
|
+
return self
|
86
|
+
|
87
|
+
def on_before_close(
|
88
|
+
self,
|
89
|
+
handler: EventMixin,
|
90
|
+
*,
|
91
|
+
extends: typing.Optional[typing.List] = None,
|
92
|
+
):
|
93
|
+
self.on(
|
94
|
+
"before-close",
|
95
|
+
handler,
|
96
|
+
extends=extends,
|
97
|
+
)
|
98
|
+
return self
|
@@ -0,0 +1,45 @@
|
|
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 Dropdown(Element):
|
11
|
+
def __init__(
|
12
|
+
self,
|
13
|
+
visible_value: typing.Optional[TMaybeRef[bool]] = None,
|
14
|
+
**kwargs: Unpack[component_types.TDropdown],
|
15
|
+
):
|
16
|
+
super().__init__("a-dropdown")
|
17
|
+
|
18
|
+
try_setup_vmodel(self, visible_value, prop_name="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_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
|
@@ -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 Empty(Element):
|
8
|
+
def __init__(
|
9
|
+
self,
|
10
|
+
**kwargs: Unpack[component_types.TEmpty],
|
11
|
+
):
|
12
|
+
super().__init__("a-empty")
|
13
|
+
|
14
|
+
self.props(handle_props(kwargs)) # type: ignore
|
@@ -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 Form(Element):
|
10
|
+
def __init__(
|
11
|
+
self,
|
12
|
+
**kwargs: Unpack[component_types.TForm],
|
13
|
+
):
|
14
|
+
super().__init__("a-form")
|
15
|
+
|
16
|
+
self.props(handle_props(kwargs)) # type: ignore
|
17
|
+
|
18
|
+
def on_submit(
|
19
|
+
self,
|
20
|
+
handler: EventMixin,
|
21
|
+
*,
|
22
|
+
extends: typing.Optional[typing.List] = None,
|
23
|
+
):
|
24
|
+
self.on(
|
25
|
+
"submit",
|
26
|
+
handler,
|
27
|
+
extends=extends,
|
28
|
+
)
|
29
|
+
return self
|
30
|
+
|
31
|
+
def on_submit_success(
|
32
|
+
self,
|
33
|
+
handler: EventMixin,
|
34
|
+
*,
|
35
|
+
extends: typing.Optional[typing.List] = None,
|
36
|
+
):
|
37
|
+
self.on(
|
38
|
+
"submit-success",
|
39
|
+
handler,
|
40
|
+
extends=extends,
|
41
|
+
)
|
42
|
+
return self
|
43
|
+
|
44
|
+
def on_submit_failed(
|
45
|
+
self,
|
46
|
+
handler: EventMixin,
|
47
|
+
*,
|
48
|
+
extends: typing.Optional[typing.List] = None,
|
49
|
+
):
|
50
|
+
self.on(
|
51
|
+
"submit-failed",
|
52
|
+
handler,
|
53
|
+
extends=extends,
|
54
|
+
)
|
55
|
+
return self
|
@@ -0,0 +1,17 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
import typing
|
3
|
+
from instaui import ui
|
4
|
+
from instaui.vars.types import TMaybeRef
|
5
|
+
from instaui.components.element import Element
|
6
|
+
from instaui.vars.mixin_types.element_binding import ElementBindingMixin
|
7
|
+
|
8
|
+
|
9
|
+
class Icon(Element):
|
10
|
+
def __init__(self, name: typing.Optional[TMaybeRef[str]] = None):
|
11
|
+
if isinstance(name, ElementBindingMixin):
|
12
|
+
name = ui.str_format(r"a-icon-{}", name)
|
13
|
+
|
14
|
+
else:
|
15
|
+
name = f"a-icon-{name}"
|
16
|
+
|
17
|
+
super().__init__(name)
|
@@ -0,0 +1,33 @@
|
|
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 Image(Element):
|
11
|
+
def __init__(
|
12
|
+
self,
|
13
|
+
*,
|
14
|
+
preview_visible_value: typing.Optional[TMaybeRef[bool]] = None,
|
15
|
+
**kwargs: Unpack[component_types.TImage],
|
16
|
+
):
|
17
|
+
super().__init__("a-image")
|
18
|
+
|
19
|
+
try_setup_vmodel(self, preview_visible_value, prop_name="preview-visible")
|
20
|
+
self.props(handle_props(kwargs)) # type: ignore
|
21
|
+
|
22
|
+
def on_preview_visible_change(
|
23
|
+
self,
|
24
|
+
handler: EventMixin,
|
25
|
+
*,
|
26
|
+
extends: typing.Optional[typing.List] = None,
|
27
|
+
):
|
28
|
+
self.on(
|
29
|
+
"preview-visible-change",
|
30
|
+
handler,
|
31
|
+
extends=extends,
|
32
|
+
)
|
33
|
+
return self
|
@@ -0,0 +1,102 @@
|
|
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 Input(Element):
|
11
|
+
_exten_name: typing.ClassVar[typing.Optional[str]] = None
|
12
|
+
|
13
|
+
def __init__(
|
14
|
+
self,
|
15
|
+
value: typing.Optional[TMaybeRef[str]] = None,
|
16
|
+
**kwargs: Unpack[component_types.TInput],
|
17
|
+
):
|
18
|
+
tag = f"a-input{'-'+ self._exten_name if self._exten_name else ''}"
|
19
|
+
super().__init__(tag)
|
20
|
+
try_setup_vmodel(self, value)
|
21
|
+
self.props(handle_props(kwargs)) # type: ignore
|
22
|
+
|
23
|
+
def __init_subclass__(cls, *, exten_name: str = "") -> None:
|
24
|
+
cls._exten_name = exten_name
|
25
|
+
|
26
|
+
def on_input(
|
27
|
+
self,
|
28
|
+
handler: EventMixin,
|
29
|
+
*,
|
30
|
+
extends: typing.Optional[typing.List] = None,
|
31
|
+
):
|
32
|
+
self.on(
|
33
|
+
"input",
|
34
|
+
handler,
|
35
|
+
extends=extends,
|
36
|
+
)
|
37
|
+
return self
|
38
|
+
|
39
|
+
def on_change(
|
40
|
+
self,
|
41
|
+
handler: EventMixin,
|
42
|
+
*,
|
43
|
+
extends: typing.Optional[typing.List] = None,
|
44
|
+
):
|
45
|
+
self.on(
|
46
|
+
"change",
|
47
|
+
handler,
|
48
|
+
extends=extends,
|
49
|
+
)
|
50
|
+
return self
|
51
|
+
|
52
|
+
def on_press_enter(
|
53
|
+
self,
|
54
|
+
handler: EventMixin,
|
55
|
+
*,
|
56
|
+
extends: typing.Optional[typing.List] = None,
|
57
|
+
):
|
58
|
+
self.on(
|
59
|
+
"press-enter",
|
60
|
+
handler,
|
61
|
+
extends=extends,
|
62
|
+
)
|
63
|
+
return self
|
64
|
+
|
65
|
+
def on_clear(
|
66
|
+
self,
|
67
|
+
handler: EventMixin,
|
68
|
+
*,
|
69
|
+
extends: typing.Optional[typing.List] = None,
|
70
|
+
):
|
71
|
+
self.on(
|
72
|
+
"clear",
|
73
|
+
handler,
|
74
|
+
extends=extends,
|
75
|
+
)
|
76
|
+
return self
|
77
|
+
|
78
|
+
def on_focus(
|
79
|
+
self,
|
80
|
+
handler: EventMixin,
|
81
|
+
*,
|
82
|
+
extends: typing.Optional[typing.List] = None,
|
83
|
+
):
|
84
|
+
self.on(
|
85
|
+
"focus",
|
86
|
+
handler,
|
87
|
+
extends=extends,
|
88
|
+
)
|
89
|
+
return self
|
90
|
+
|
91
|
+
def on_blur(
|
92
|
+
self,
|
93
|
+
handler: EventMixin,
|
94
|
+
*,
|
95
|
+
extends: typing.Optional[typing.List] = None,
|
96
|
+
):
|
97
|
+
self.on(
|
98
|
+
"blur",
|
99
|
+
handler,
|
100
|
+
extends=extends,
|
101
|
+
)
|
102
|
+
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 InputNumber(Element):
|
11
|
+
def __init__(
|
12
|
+
self,
|
13
|
+
value: typing.Optional[TMaybeRef[typing.Union[int, float]]] = None,
|
14
|
+
**kwargs: Unpack[component_types.TInputnumber],
|
15
|
+
):
|
16
|
+
super().__init__("a-input-number")
|
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_focus(
|
35
|
+
self,
|
36
|
+
handler: EventMixin,
|
37
|
+
*,
|
38
|
+
extends: typing.Optional[typing.List] = None,
|
39
|
+
):
|
40
|
+
self.on(
|
41
|
+
"focus",
|
42
|
+
handler,
|
43
|
+
extends=extends,
|
44
|
+
)
|
45
|
+
return self
|
46
|
+
|
47
|
+
def on_blur(
|
48
|
+
self,
|
49
|
+
handler: EventMixin,
|
50
|
+
*,
|
51
|
+
extends: typing.Optional[typing.List] = None,
|
52
|
+
):
|
53
|
+
self.on(
|
54
|
+
"blur",
|
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_input(
|
74
|
+
self,
|
75
|
+
handler: EventMixin,
|
76
|
+
*,
|
77
|
+
extends: typing.Optional[typing.List] = None,
|
78
|
+
):
|
79
|
+
self.on(
|
80
|
+
"input",
|
81
|
+
handler,
|
82
|
+
extends=extends,
|
83
|
+
)
|
84
|
+
return self
|
85
|
+
|
86
|
+
def on_keydown(
|
87
|
+
self,
|
88
|
+
handler: EventMixin,
|
89
|
+
*,
|
90
|
+
extends: typing.Optional[typing.List] = None,
|
91
|
+
):
|
92
|
+
self.on(
|
93
|
+
"keydown",
|
94
|
+
handler,
|
95
|
+
extends=extends,
|
96
|
+
)
|
97
|
+
return self
|
@@ -0,0 +1,38 @@
|
|
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
|
+
from ._utils import try_setup_vmodel
|
8
|
+
|
9
|
+
|
10
|
+
class TInputPassword(component_types.TInput, total=False):
|
11
|
+
model_visibility: bool
|
12
|
+
default_visibility: bool
|
13
|
+
invisible_button: bool
|
14
|
+
|
15
|
+
|
16
|
+
class InputPassword(Input, exten_name="password"):
|
17
|
+
def __init__(
|
18
|
+
self,
|
19
|
+
value: typing.Optional[TMaybeRef[str]] = None,
|
20
|
+
*,
|
21
|
+
visibility_value: typing.Optional[TMaybeRef[bool]] = None,
|
22
|
+
**kwargs: Unpack[TInputPassword],
|
23
|
+
):
|
24
|
+
super().__init__(value=value, **kwargs)
|
25
|
+
try_setup_vmodel(self, visibility_value, prop_name="visibility")
|
26
|
+
|
27
|
+
def on_visibility_change(
|
28
|
+
self,
|
29
|
+
handler: EventMixin,
|
30
|
+
*,
|
31
|
+
extends: typing.Optional[typing.List] = None,
|
32
|
+
):
|
33
|
+
self.on(
|
34
|
+
"visibility-change",
|
35
|
+
handler,
|
36
|
+
extends=extends,
|
37
|
+
)
|
38
|
+
return self
|