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
instaui/arco/__init__.py
ADDED
@@ -0,0 +1,191 @@
|
|
1
|
+
"""
|
2
|
+
Easy to use arco.design for InstaUI.
|
3
|
+
|
4
|
+
Examples:
|
5
|
+
.. code-block:: python
|
6
|
+
from instaui import ui, arco
|
7
|
+
|
8
|
+
arco.use()
|
9
|
+
|
10
|
+
@ui.page("/")
|
11
|
+
def index_page():
|
12
|
+
arco.input(placeholder="input")
|
13
|
+
"""
|
14
|
+
|
15
|
+
__all__ = [
|
16
|
+
"use",
|
17
|
+
"layout_header",
|
18
|
+
"layout_footer",
|
19
|
+
"layout_content",
|
20
|
+
"layout_sider",
|
21
|
+
"button",
|
22
|
+
"icon",
|
23
|
+
"link",
|
24
|
+
"typography",
|
25
|
+
"typography_title",
|
26
|
+
"typography_paragraph",
|
27
|
+
"divider",
|
28
|
+
"layout",
|
29
|
+
"space",
|
30
|
+
"avatar",
|
31
|
+
"badge",
|
32
|
+
"calendar",
|
33
|
+
"card",
|
34
|
+
"carousel",
|
35
|
+
"collapse",
|
36
|
+
"comment",
|
37
|
+
"descriptions",
|
38
|
+
"empty",
|
39
|
+
"image",
|
40
|
+
"list",
|
41
|
+
"popover",
|
42
|
+
"statistic",
|
43
|
+
"table",
|
44
|
+
"tabs",
|
45
|
+
"tag",
|
46
|
+
"timeline",
|
47
|
+
"tooltip",
|
48
|
+
"tree",
|
49
|
+
"auto_complete",
|
50
|
+
"cascader",
|
51
|
+
"checkbox",
|
52
|
+
"color_picker",
|
53
|
+
"date_picker",
|
54
|
+
"form",
|
55
|
+
"input",
|
56
|
+
"input_password",
|
57
|
+
"input_search",
|
58
|
+
"input_number",
|
59
|
+
"verification_code",
|
60
|
+
"input_tag",
|
61
|
+
"mention",
|
62
|
+
"radio",
|
63
|
+
"rate",
|
64
|
+
"select",
|
65
|
+
"slider",
|
66
|
+
"switch",
|
67
|
+
"textarea",
|
68
|
+
"time_picker",
|
69
|
+
"transfer",
|
70
|
+
"tree_select",
|
71
|
+
"upload",
|
72
|
+
"alert",
|
73
|
+
"drawer",
|
74
|
+
"modal",
|
75
|
+
"pop_confirm",
|
76
|
+
"progress",
|
77
|
+
"result",
|
78
|
+
"spin",
|
79
|
+
"skeleton",
|
80
|
+
"breadcrumb",
|
81
|
+
"dropdown",
|
82
|
+
"menu",
|
83
|
+
"menu_item",
|
84
|
+
"sub_menu",
|
85
|
+
"page_header",
|
86
|
+
"pagination",
|
87
|
+
"steps",
|
88
|
+
"affix",
|
89
|
+
"anchor",
|
90
|
+
"back_top",
|
91
|
+
"resize_box",
|
92
|
+
"trigger",
|
93
|
+
"split",
|
94
|
+
"overflow_list",
|
95
|
+
"watermark",
|
96
|
+
"radio_group",
|
97
|
+
"tab_pane",
|
98
|
+
"config_provider",
|
99
|
+
"use_locale",
|
100
|
+
]
|
101
|
+
|
102
|
+
|
103
|
+
from .setup import use
|
104
|
+
from .components.button import Button as button
|
105
|
+
from .components.icon import Icon as icon
|
106
|
+
from .components.link import Link as link
|
107
|
+
from .components.typography import (
|
108
|
+
Typography as typography,
|
109
|
+
TypographyTitle as typography_title,
|
110
|
+
TypographyParagraph as typography_paragraph,
|
111
|
+
)
|
112
|
+
from .components.divider import Divider as divider
|
113
|
+
from .components.layout import Layout as layout
|
114
|
+
from .components.space import Space as space
|
115
|
+
from .components.avatar import Avatar as avatar
|
116
|
+
from .components.badge import Badge as badge
|
117
|
+
from .components.calendar import Calendar as calendar
|
118
|
+
from .components.card import Card as card
|
119
|
+
from .components.carousel import Carousel as carousel
|
120
|
+
from .components.collapse import Collapse as collapse
|
121
|
+
from .components.comment import Comment as comment
|
122
|
+
from .components.descriptions import Descriptions as descriptions
|
123
|
+
from .components.empty import Empty as empty
|
124
|
+
from .components.image import Image as image
|
125
|
+
from .components.list import List as list
|
126
|
+
from .components.popover import Popover as popover
|
127
|
+
from .components.statistic import Statistic as statistic
|
128
|
+
from .components.table import Table as table
|
129
|
+
from .components.tabs import Tabs as tabs
|
130
|
+
from .components.tag import Tag as tag
|
131
|
+
from .components.timeline import Timeline as timeline
|
132
|
+
from .components.tooltip import Tooltip as tooltip
|
133
|
+
from .components.tree import Tree as tree
|
134
|
+
from .components.auto_complete import AutoComplete as auto_complete
|
135
|
+
from .components.cascader import Cascader as cascader
|
136
|
+
from .components.checkbox import Checkbox as checkbox
|
137
|
+
from .components.color_picker import ColorPicker as color_picker
|
138
|
+
from .components.date_picker import DatePicker as date_picker
|
139
|
+
from .components.form import Form as form
|
140
|
+
from .components.input import Input as input
|
141
|
+
from .components.input_password import InputPassword as input_password
|
142
|
+
from .components.input_search import InputSearch as input_search
|
143
|
+
from .components.input_number import InputNumber as input_number
|
144
|
+
from .components.verification_code import VerificationCode as verification_code
|
145
|
+
from .components.input_tag import InputTag as input_tag
|
146
|
+
from .components.mention import Mention as mention
|
147
|
+
from .components.radio import Radio as radio
|
148
|
+
from .components.rate import Rate as rate
|
149
|
+
from .components.select import Select as select
|
150
|
+
from .components.slider import Slider as slider
|
151
|
+
from .components.switch import Switch as switch
|
152
|
+
from .components.textarea import Textarea as textarea
|
153
|
+
from .components.time_picker import TimePicker as time_picker
|
154
|
+
from .components.transfer import Transfer as transfer
|
155
|
+
from .components.tree_select import TreeSelect as tree_select
|
156
|
+
from .components.upload import Upload as upload
|
157
|
+
from .components.alert import Alert as alert
|
158
|
+
from .components.drawer import Drawer as drawer
|
159
|
+
from .components.modal import Modal as modal
|
160
|
+
from .components.pop_confirm import PopConfirm as pop_confirm
|
161
|
+
from .components.progress import Progress as progress
|
162
|
+
from .components.result import Result as result
|
163
|
+
from .components.spin import Spin as spin
|
164
|
+
from .components.skeleton import Skeleton as skeleton
|
165
|
+
from .components.breadcrumb import Breadcrumb as breadcrumb
|
166
|
+
from .components.dropdown import Dropdown as dropdown
|
167
|
+
from .components.menu import (
|
168
|
+
Menu as menu,
|
169
|
+
MenuItem as menu_item,
|
170
|
+
SubMenu as sub_menu,
|
171
|
+
)
|
172
|
+
from .components.page_header import PageHeader as page_header
|
173
|
+
from .components.pagination import Pagination as pagination
|
174
|
+
from .components.steps import Steps as steps
|
175
|
+
from .components.affix import Affix as affix
|
176
|
+
from .components.anchor import Anchor as anchor
|
177
|
+
from .components.back_top import BackTop as back_top
|
178
|
+
from .components.config_provider import ConfigProvider as config_provider
|
179
|
+
from .components.resize_box import ResizeBox as resize_box
|
180
|
+
from .components.trigger import Trigger as trigger
|
181
|
+
from .components.split import Split as split
|
182
|
+
from .components.overflow_list import OverflowList as overflow_list
|
183
|
+
from .components.watermark import Watermark as watermark
|
184
|
+
|
185
|
+
from .components.layout_header import LayoutHeader as layout_header
|
186
|
+
from .components.layout_footer import LayoutFooter as layout_footer
|
187
|
+
from .components.layout_content import LayoutContent as layout_content
|
188
|
+
from .components.layout_sider import LayoutSider as layout_sider
|
189
|
+
from .components.radio_group import RadioGroup as radio_group
|
190
|
+
from .components.tab_pane import TabPane as tab_pane
|
191
|
+
from ._use_tools.locale import use_locale
|
@@ -0,0 +1,25 @@
|
|
1
|
+
from typing import Callable, Dict, Optional, Union, cast
|
2
|
+
from instaui import ui
|
3
|
+
from instaui.arco.types import TLocale, TCustomizeLocale
|
4
|
+
from instaui.arco.components.config_provider import ConfigProvider
|
5
|
+
from instaui.arco.locales import get_locale
|
6
|
+
|
7
|
+
|
8
|
+
_STOP_LIFESPAN: Optional[Callable] = None
|
9
|
+
|
10
|
+
|
11
|
+
def configure(*, locale: ui.TMaybeRef[Union[TLocale, TCustomizeLocale]]):
|
12
|
+
global _STOP_LIFESPAN
|
13
|
+
|
14
|
+
if isinstance(locale, str):
|
15
|
+
locale = get_locale(locale)
|
16
|
+
|
17
|
+
def add_config_provider_lifespan():
|
18
|
+
with ConfigProvider(locale=cast(Dict, locale)):
|
19
|
+
yield
|
20
|
+
|
21
|
+
if _STOP_LIFESPAN is not None:
|
22
|
+
_STOP_LIFESPAN()
|
23
|
+
del _STOP_LIFESPAN
|
24
|
+
|
25
|
+
_STOP_LIFESPAN = ui.on_page_request_lifespan(add_config_provider_lifespan)
|
@@ -0,0 +1,50 @@
|
|
1
|
+
from typing import get_args
|
2
|
+
from instaui import ui
|
3
|
+
from instaui.arco.types import TLocale
|
4
|
+
from instaui.arco.locales import get_locale
|
5
|
+
|
6
|
+
|
7
|
+
class Locale:
|
8
|
+
def __init__(self, locale: TLocale):
|
9
|
+
self._names = get_args(TLocale)
|
10
|
+
self._current_name = ui.state(locale)
|
11
|
+
|
12
|
+
@ui.computed(inputs=[self._current_name])
|
13
|
+
def locale_data(name: TLocale):
|
14
|
+
return get_locale(name)
|
15
|
+
|
16
|
+
self._current_data = locale_data
|
17
|
+
|
18
|
+
@property
|
19
|
+
def all_names(self):
|
20
|
+
return self._names
|
21
|
+
|
22
|
+
@property
|
23
|
+
def current_name(self):
|
24
|
+
return self._current_name
|
25
|
+
|
26
|
+
@property
|
27
|
+
def current(self):
|
28
|
+
return self._current_data
|
29
|
+
|
30
|
+
|
31
|
+
def use_locale(locale_name: TLocale):
|
32
|
+
"""Reactive language settings.
|
33
|
+
|
34
|
+
Args:
|
35
|
+
locale_name (TLocale): The language name of the locale.
|
36
|
+
|
37
|
+
Example:
|
38
|
+
.. code-block:: python
|
39
|
+
@ui.page("/")
|
40
|
+
def index():
|
41
|
+
locale = arco.use_locale("zh-CN")
|
42
|
+
arco.select(locale.all_names, locale.current_name)
|
43
|
+
|
44
|
+
with arco.config_provider(locale=locale.current):
|
45
|
+
arco.pagination(
|
46
|
+
total=50, show_total=True, show_jumper=True, show_page_size=True
|
47
|
+
)
|
48
|
+
|
49
|
+
"""
|
50
|
+
return Locale(locale_name)
|