instaui 0.1.8__py3-none-any.whl → 0.1.10__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/_helper/observable_helper.py +11 -1
- instaui/arco/components/select.py +4 -1
- instaui/arco/static/instaui-arco.css +1 -1
- instaui/arco/static/instaui-arco.js +55771 -55771
- instaui/components/echarts/echarts.js +7 -5
- instaui/components/echarts/echarts.py +1 -1
- instaui/components/element.py +12 -22
- instaui/components/grid.py +63 -11
- instaui/components/html/paragraph.py +10 -0
- instaui/components/html/select.py +0 -5
- instaui/components/html/table.py +1 -1
- instaui/components/label.py +5 -0
- instaui/components/row.py +0 -3
- instaui/components/shiki_code/static/shiki-style.css +179 -179
- instaui/event/js_event.py +24 -0
- instaui/event/vue_event.py +66 -0
- instaui/event/web_event.py +36 -25
- instaui/experimental/__init__.py +1 -2
- instaui/handlers/_utils.py +27 -5
- instaui/shadcn_classless/static/shadcn-classless.css +403 -403
- instaui/spa_router/_file_base_utils.py +20 -16
- instaui/static/insta-ui.css +1 -1
- instaui/static/insta-ui.esm-browser.prod.js +3683 -3663
- instaui/static/insta-ui.js.map +1 -1
- instaui/systems/func_system.py +15 -0
- instaui/template/webview_template.py +0 -2
- instaui/ui/__init__.py +5 -1
- instaui/ui/__init__.pyi +5 -1
- instaui/ui_functions/ui_page.py +3 -3
- instaui/vars/js_computed.py +25 -1
- instaui/vars/state.py +15 -0
- instaui/vars/web_computed.py +42 -0
- instaui/watch/js_watch.py +37 -1
- instaui/watch/web_watch.py +53 -0
- instaui/webview/__init__.py +1 -0
- instaui/webview/index.py +0 -1
- instaui-0.1.10.dist-info/METADATA +153 -0
- {instaui-0.1.8.dist-info → instaui-0.1.10.dist-info}/RECORD +70 -73
- {instaui-0.1.8.dist-info → instaui-0.1.10.dist-info}/WHEEL +1 -1
- instaui/experimental/link_sql/__init__.py +0 -3
- instaui/experimental/link_sql/_base.py +0 -23
- instaui/experimental/link_sql/_duckdb.py +0 -221
- instaui/experimental/link_sql/_types.py +0 -15
- instaui/experimental/link_sql/data_source.js +0 -50
- instaui-0.1.8.dist-info/METADATA +0 -160
- {instaui-0.1.8.dist-info → instaui-0.1.10.dist-info/licenses}/LICENSE +0 -0
@@ -1,9 +1,19 @@
|
|
1
1
|
instaui/__init__.py,sha256=AUc9WcEoBimqYCunwNghawZKuhup_qYd1bor5Go1qmA,161
|
2
|
-
instaui/
|
2
|
+
instaui/boot_info.py,sha256=2uIkRaNhuUCG6Jbyl2Gb0_1IbVxtfJ8s2j6X1XXdSk0,905
|
3
|
+
instaui/consts.py,sha256=3le1YZTV2PM_jXgvEDWlBeGEJz8QIZ2StvA9MZpem_g,967
|
4
|
+
instaui/html_tools.py,sha256=VJDnOdPPDzXi_u6bMj5_fqdFjGXG3-HgXQsvD0gfauc,2577
|
5
|
+
instaui/inject.py,sha256=NeTcsxoPdo12kZCvGjFU9NNHsVWnsPJfIcNY5_sPGYc,727
|
6
|
+
instaui/launch_collector.py,sha256=_YmF3hsNWe-ZxMp_amqUBHkhB6fOuTPfX16BVwn25xg,1731
|
7
|
+
instaui/page_info.py,sha256=aJtfLp2h05tCuLzxk2pZ6a9ztyxSdI-g3NBRxbqpS6E,269
|
8
|
+
instaui/skip.py,sha256=uqhqusgeChVoivKFMoZd-XePYrlSoLvUzRZDBcUgFmA,149
|
9
|
+
instaui/version.py,sha256=to8l16EjNe4jmzK316s5ZIotjv554tqF0VfwA1tBhQk,87
|
10
|
+
instaui/_helper/observable_helper.py,sha256=U30PmA8jZ9q48GI_FMNPRYUTKNdl4SsMTAFoq94eRFs,1447
|
3
11
|
instaui/arco/__init__.py,sha256=_QuzxGbuQKuq9hjem65NKqYwiKDAP_3ZVPHy75Idw_s,6155
|
4
12
|
instaui/arco/_settings.py,sha256=iuWQb-sGNlw4fBxf-Ufj-YGnBXaGVJIDMgPuVg9ZJ38,771
|
5
|
-
instaui/arco/_use_tools/locale.py,sha256=30-3dYbTV0aIoA3cMAH-TWreDZA94bf0LrKbJl5vCzk,1295
|
6
13
|
instaui/arco/component_types.py,sha256=wAJvOw4SGbf8bcC3QTdJonsWk5SsRVui-imsKdg-Nzo,39397
|
14
|
+
instaui/arco/setup.py,sha256=iKyb7oDXSkpPUmYNF_4H4wzIG-dZMWjOys97wr6EsG4,996
|
15
|
+
instaui/arco/types.py,sha256=3p55fBzYbpw633WmyFS7WdMcosBLme39VT4C1fbtQcg,341
|
16
|
+
instaui/arco/_use_tools/locale.py,sha256=30-3dYbTV0aIoA3cMAH-TWreDZA94bf0LrKbJl5vCzk,1295
|
7
17
|
instaui/arco/components/_utils.py,sha256=JpofPvCwVJYw_LbN3ZTFOFqT16mj4mF5pS3lgkr_gR4,547
|
8
18
|
instaui/arco/components/affix.py,sha256=IHst2isiW4Ujwb5YeLJA7L4GQ2jEI-gGKD0hw6y4t-w,711
|
9
19
|
instaui/arco/components/alert.py,sha256=Q8To4MtXMBwU2z6pL8s4Sto0fQVkheoFT8ZeOSAacB4,986
|
@@ -58,7 +68,7 @@ instaui/arco/components/radio_group.py,sha256=3LhRaljmD83cR5KAy0492zy62hRde6TTQF
|
|
58
68
|
instaui/arco/components/rate.py,sha256=GLALtLZ1-1xklnnGKZf02KOLJga-IWVB-l_XSrQoQMs,1163
|
59
69
|
instaui/arco/components/resize_box.py,sha256=imq3YgcLtaeFChZFvC-jflCaJxq0hY_cnK4TCN7s3j4,1678
|
60
70
|
instaui/arco/components/result.py,sha256=QEkQeTujw4P9GtsAziUHDT3UqoRjCcVS2MdZDtT2a8U,382
|
61
|
-
instaui/arco/components/select.py,sha256=
|
71
|
+
instaui/arco/components/select.py,sha256=vTCbEPSIuJzt825Bqq9kh7zes5qsVkfPlIG7yL0AkeQ,4598
|
62
72
|
instaui/arco/components/skeleton.py,sha256=08wkK25eBAn5i_j97WcfipJ2Z15ovQ7G0pp92vAbu3s,388
|
63
73
|
instaui/arco/components/slider.py,sha256=A2R9Nj_BBG7rZhfOdD8eeHslyYpFVeiWFNuP4F8zNRI,1037
|
64
74
|
instaui/arco/components/space.py,sha256=Ml-bWxzMYET0TctKRz_SYE9JIuezD0avTE2KqAZLo68,379
|
@@ -87,22 +97,27 @@ instaui/arco/locales/__init__.py,sha256=I4wf2qQymrPU_E_EXKni4_me0m2KSr7Sfx9ZbRR1
|
|
87
97
|
instaui/arco/locales/_index.py,sha256=cZXwVTBWqM5vASvMnlTHjdWfF5eAdCXT53K_JFhEpEU,806
|
88
98
|
instaui/arco/locales/en_us.py,sha256=pIU4zBIhoWj5y0PhKoKjSAPZ6y3VSUfIcCGyhce5o08,8294
|
89
99
|
instaui/arco/locales/zh_cn.py,sha256=Zeyvm-kh7fhPGe5KZMo_qt8I1s6MkveOk5mMfAYso0k,8182
|
90
|
-
instaui/arco/
|
91
|
-
instaui/arco/static/instaui-arco.
|
92
|
-
instaui/arco/static/instaui-arco.js,sha256=Rf9xrkCK6lD2cUED6pd15Ge-SFmX_SByOzaC2kBqDTE,1609202
|
93
|
-
instaui/arco/types.py,sha256=3p55fBzYbpw633WmyFS7WdMcosBLme39VT4C1fbtQcg,341
|
94
|
-
instaui/boot_info.py,sha256=2uIkRaNhuUCG6Jbyl2Gb0_1IbVxtfJ8s2j6X1XXdSk0,905
|
100
|
+
instaui/arco/static/instaui-arco.css,sha256=PRnu2GBck04qO-PjCQMoNdETxBlDcxGjA7zHrdBBUfU,399577
|
101
|
+
instaui/arco/static/instaui-arco.js,sha256=PktbvZE6yids2NyfSKo81g--fCo-AiNEdOgvv8gmUB8,1664973
|
95
102
|
instaui/common/jsonable.py,sha256=efzn_IvfrsaNKjc3B3UzshoMvsqSsB-jnD2Aia8YMYM,902
|
96
103
|
instaui/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
97
104
|
instaui/components/column.py,sha256=t_kDAelb-5_aqx4hv19sOm8zcQpRmn-slTMcwZfMOLk,848
|
98
105
|
instaui/components/component.py,sha256=cfKWlhxATdvERSzsVzvLtm61f72_gblhLJXIrXLGQrk,1284
|
99
106
|
instaui/components/content.py,sha256=f6dm0GukYJk4RRNJzuvOGqBrStLWkJQbLkV7M5fJ63k,1094
|
100
107
|
instaui/components/directive.py,sha256=bHSOWXNhzWRVNqLXwhc_hY3R3g-JAQ5DWIqpZkI6_wI,1411
|
101
|
-
instaui/components/
|
102
|
-
instaui/components/
|
108
|
+
instaui/components/element.py,sha256=PYvIRFhfY3gh05vwj_TGB4Cknm8XtVzHwV1DN4gJ1V8,17373
|
109
|
+
instaui/components/grid.py,sha256=h9Lzxqiw4HB-8VG2JGHVz-KGn4bHTtsibtUb8UCgHO4,7529
|
110
|
+
instaui/components/label.py,sha256=Fp7malMB2i6MjJjZnxdIl2tg6rb33-1PdgxEhGecoTM,118
|
111
|
+
instaui/components/match.py,sha256=B3wV1h-SkvYnX8RiMObdM2tfJb8nW2gjFxXQvNeZWWM,2774
|
112
|
+
instaui/components/row.py,sha256=c0dxJwt955EF7PXlrFpqIoQNZ59tJm-UvZlx_zjeuBg,570
|
113
|
+
instaui/components/slot.py,sha256=RT0eU7wH7ffFDkl5ucfrNXB1nbsKDq688Hp920TZaoo,2287
|
114
|
+
instaui/components/transition_group.py,sha256=H9zx9NTlCoQnBArWfmxmh7CMKb5hZn8vKrFe4OFxPrE,201
|
115
|
+
instaui/components/value_element.py,sha256=wRIAaR3_Cq9qLNJw2KPhWt7dJmclj1mrttzlGpb01Y0,1412
|
116
|
+
instaui/components/vfor.py,sha256=A6hvCpmY-5oNZLnIs2yvfQ12C1-GggKVAthqhi5E4lY,4031
|
117
|
+
instaui/components/vif.py,sha256=2E62-8J9NIlZDhvgIOuDwz0tLLb6VoJ1ji1K4okrapw,1165
|
118
|
+
instaui/components/echarts/echarts.js,sha256=pHkcgHJQOS1oHCumDvRNX9FIC55bl67x9NlIKJB5UdE,2734
|
119
|
+
instaui/components/echarts/echarts.py,sha256=Up70IWBVLdW0_MZpV4GxM2-YFTe7u5ZWDoXHWaZVcEQ,5457
|
103
120
|
instaui/components/echarts/static/echarts.esm.min.js,sha256=KN8OVRa4kTlat9NIfArzA3rtGcYfyrkcwjFBy_07vu8,1033915
|
104
|
-
instaui/components/element.py,sha256=7kxQTSx-JbJ1ndSpEjSnUwYXIajxaR5kPYNP3kkDk9U,17698
|
105
|
-
instaui/components/grid.py,sha256=9agGF1JtMi7k453nSynIAhN4T1ssa7WE7zXHbq9ift4,5569
|
106
121
|
instaui/components/html/__init__.py,sha256=9bO1ai0aQCWwj80NKqDeq_3zwMg5gf17mE40a1IESAk,1088
|
107
122
|
instaui/components/html/_mixins.py,sha256=5dcSM9h1PswIKL6_eiqUxqW4H2OCuyNeCuRZq3gDGOc,876
|
108
123
|
instaui/components/html/_preset.py,sha256=c5rTj3r8W7UP0UHFLUW-ZSPedIa-gzrsU1goi60l20Q,94
|
@@ -117,49 +132,37 @@ instaui/components/html/label.py,sha256=HAH0pGhRdyRG3YwTM4qM8lyF8O3yAfmEyPHj0fQn
|
|
117
132
|
instaui/components/html/li.py,sha256=2IS8eudUX4McHjyxT1SOu91xviC2D1NNdYKLjznZ-IA,416
|
118
133
|
instaui/components/html/link.py,sha256=eNC2f-twFZUhw_rL-Ggff2Lo8NRU33oF8CfWW_9-ktI,670
|
119
134
|
instaui/components/html/number.py,sha256=Y2oIzTMHKWMWpufG55tFz0npEoEFvLhTWpZbMJ8J07s,1069
|
120
|
-
instaui/components/html/paragraph.py,sha256=
|
135
|
+
instaui/components/html/paragraph.py,sha256=TNMtI9dyQb6hYKE5vGAsSXiOiEqkx7BM6CEoJrg6nz8,914
|
121
136
|
instaui/components/html/range.py,sha256=cLGoo3QaARG9YDnh6g3UYtc1yueI5dfMa9-4e-feSn4,1644
|
122
|
-
instaui/components/html/select.py,sha256=
|
137
|
+
instaui/components/html/select.py,sha256=Bq6mwyKa1qAk7bZiHK0uOg65W2twz4QkcJQTjvFNDP4,2029
|
123
138
|
instaui/components/html/span.py,sha256=RJnccwnYEh8PUZ36VTBCKzBNV74M3SMohAejb0ck0UI,440
|
124
|
-
instaui/components/html/table.py,sha256=
|
139
|
+
instaui/components/html/table.py,sha256=1n46pPOMKkFfEsHB0Qwep-ELShm-jeeCSOfznfY1mSc,1492
|
125
140
|
instaui/components/html/textarea.py,sha256=EsVir5nOQDlf5hlmfdWfdfGv-owk-ajPJYOGCbzWVu4,900
|
126
141
|
instaui/components/html/ul.py,sha256=YbP2kH0Utlwr194uvVlCNQk1Xfl-5O24nVsDHSM0dqg,545
|
127
142
|
instaui/components/markdown/markdown.js,sha256=ZlwxvQJ_0Fq1R-j-unfQTWMRswJ8GsYgLvd-wxVISGc,682
|
128
143
|
instaui/components/markdown/markdown.py,sha256=2_ECsZPJ2P5hdP5-Kna0KwoFtHEzk8hgtTZ9rPX5Mds,978
|
129
144
|
instaui/components/markdown/static/github-markdown.css,sha256=_uphCFXVa_Hhwyfs7ps-wcpBuzA7_RhkiX7DuxuLIzI,42536
|
130
145
|
instaui/components/markdown/static/marked.esm.js,sha256=mgAILO5RXoifHq_HxqoWQ6qcMn_Xw8jYuNHdgoIV-xw,99306
|
131
|
-
instaui/components/match.py,sha256=B3wV1h-SkvYnX8RiMObdM2tfJb8nW2gjFxXQvNeZWWM,2774
|
132
|
-
instaui/components/row.py,sha256=luiBNCgGOMhMZlN6AYaS4qyXV0MNQQSiyshUWui4Je8,609
|
133
146
|
instaui/components/shiki_code/shiki_code.js,sha256=b4Z_yfKAnZsma7T51aDUljXn45Jd-AJH-Z1vRO1zaQg,3137
|
134
147
|
instaui/components/shiki_code/shiki_code.py,sha256=0FonvKvFKrGfz-xWlJJqGZt0TDSkZQr-4u3E9_CEbDk,3100
|
148
|
+
instaui/components/shiki_code/static/shiki-core.js,sha256=UL04NBlHkWnjncUOLsNx5mMHCXUUh2t9hVLJPpSOAqs,787821
|
149
|
+
instaui/components/shiki_code/static/shiki-style.css,sha256=K4EIv7kBzwf1t6WoqwKrxJDqBVgz1DhzCuEfQGDFUBE,6432
|
150
|
+
instaui/components/shiki_code/static/shiki-transformers.js,sha256=JtWn48oj_ppT2-RDbbLnmBjtIvnBRHkgwFcO4hj0yx0,12744
|
135
151
|
instaui/components/shiki_code/static/langs/css.mjs,sha256=vCN8-QsQSqpj1kE5F9whUvBr39IsRtC3Ql7RxIGfw2Y,52249
|
136
152
|
instaui/components/shiki_code/static/langs/markdown.mjs,sha256=wTkMkPZpF-xRGxiQDtoNHk0KUzYM1nheKGOlyX4P2Sw,61684
|
137
153
|
instaui/components/shiki_code/static/langs/python.mjs,sha256=h9AiQgl4T1pP_s9xgMSdTp7UjPs1hpHruOQOqvIGFIQ,77213
|
138
154
|
instaui/components/shiki_code/static/langs/shell.mjs,sha256=tFnepW_2H4k-TKg0X2a5eFxSVUu69tvLsBACE8CppPk,91
|
139
155
|
instaui/components/shiki_code/static/langs/shellscript.mjs,sha256=hUZDCGMkHhsWI8d8RJwqC5DENXuUoJgFmrgJFnuN_Gw,45548
|
140
|
-
instaui/components/shiki_code/static/shiki-core.js,sha256=UL04NBlHkWnjncUOLsNx5mMHCXUUh2t9hVLJPpSOAqs,787821
|
141
|
-
instaui/components/shiki_code/static/shiki-style.css,sha256=Nvj4q_pjgisJJ1bmC0BVgdeYZIOPfvKrboCMjQ9a8bs,6253
|
142
|
-
instaui/components/shiki_code/static/shiki-transformers.js,sha256=JtWn48oj_ppT2-RDbbLnmBjtIvnBRHkgwFcO4hj0yx0,12744
|
143
156
|
instaui/components/shiki_code/static/themes/vitesse-dark.mjs,sha256=OqDIbeBNg40dGoy2Ef02zM7aS7QTcC3bah6ZzvtkpbA,15326
|
144
157
|
instaui/components/shiki_code/static/themes/vitesse-light.mjs,sha256=RWgJuEHtO93_BSyNYuenSW6O_x1fv01aiGRO0ZF_qdo,15176
|
145
|
-
instaui/components/slot.py,sha256=RT0eU7wH7ffFDkl5ucfrNXB1nbsKDq688Hp920TZaoo,2287
|
146
|
-
instaui/components/transition_group.py,sha256=H9zx9NTlCoQnBArWfmxmh7CMKb5hZn8vKrFe4OFxPrE,201
|
147
|
-
instaui/components/value_element.py,sha256=wRIAaR3_Cq9qLNJw2KPhWt7dJmclj1mrttzlGpb01Y0,1412
|
148
|
-
instaui/components/vfor.py,sha256=A6hvCpmY-5oNZLnIs2yvfQ12C1-GggKVAthqhi5E4lY,4031
|
149
|
-
instaui/components/vif.py,sha256=2E62-8J9NIlZDhvgIOuDwz0tLLb6VoJ1ji1K4okrapw,1165
|
150
|
-
instaui/consts.py,sha256=3le1YZTV2PM_jXgvEDWlBeGEJz8QIZ2StvA9MZpem_g,967
|
151
158
|
instaui/dependencies/component_dependency.py,sha256=V9L9YmM0_d1bQFMea3aH8qYG_mvGsAVPhmz0UHZa3PQ,672
|
152
159
|
instaui/dependencies/plugin_dependency.py,sha256=6u562ihKbiL3DE4hBrGjauS2nzYEC2glOVN0fwEVNVc,806
|
153
160
|
instaui/event/event_mixin.py,sha256=cN0Wh95e1wX183mGnGFm8BK_aEHWJ8WNx3Upy75mU_4,286
|
154
|
-
instaui/event/js_event.py,sha256=
|
155
|
-
instaui/event/
|
156
|
-
instaui/
|
161
|
+
instaui/event/js_event.py,sha256=CGegLXP3QldJp0jN-lNY0XSG8fLuaitFqKkgGEfI7yE,2868
|
162
|
+
instaui/event/vue_event.py,sha256=NRwEcAromivjyPtgMq5SEqHqx8GEc1OJZsRL2Nj43RY,2187
|
163
|
+
instaui/event/web_event.py,sha256=sojugqfXyF0q4gDCQsVjcfdBcuELVGeucZveFTDno10,3607
|
164
|
+
instaui/experimental/__init__.py,sha256=nKvudMaBaDsxflSZQ00ck8Cc4hmrF0f6Xzs4mhIYa08,75
|
157
165
|
instaui/experimental/debug.py,sha256=UGUWgNZ3ShanpuxfuPdx52TgQrkO9hByABYMnPZEIiE,1325
|
158
|
-
instaui/experimental/link_sql/__init__.py,sha256=Us-KAILRDR19LrV8aCl0t4LFxtGxnctPwlYY82pjxwM,64
|
159
|
-
instaui/experimental/link_sql/_base.py,sha256=p94z9k3MelA24Ibl9STqnySWF-efha9Qjibg17yaXTI,556
|
160
|
-
instaui/experimental/link_sql/_duckdb.py,sha256=DnX2nWJnGBbt1BKncChxDT5zW5S3zJxE668tWdC_jvc,7284
|
161
|
-
instaui/experimental/link_sql/_types.py,sha256=KkGWUVE1WI36NA-z78FdjQvOCzzNwLUFDYrgHcWdCm8,262
|
162
|
-
instaui/experimental/link_sql/data_source.js,sha256=rFuEfKO3ajE-Xt_DHtGOmmZDxanXaBbss8UWk3H3kmo,1193
|
163
166
|
instaui/fastapi_server/_utils.py,sha256=MCqbebS4UkBOV8fp3Oy415Tvxnqi2mnMl5Eqe6yJogg,1177
|
164
167
|
instaui/fastapi_server/_uvicorn.py,sha256=n-es5ajWepXb6xF9EP0ft2lrEbsyLGWMUE7uVqpkUAs,1174
|
165
168
|
instaui/fastapi_server/debug_mode_router.py,sha256=EcYtPxI4FMnUqZcn-CZhZiMLgciHVNZpSRfiSIDRChc,1547
|
@@ -170,16 +173,12 @@ instaui/fastapi_server/request_context.py,sha256=EV5ZG4zgI_NPlTxinqO4AIREj6rbb1-
|
|
170
173
|
instaui/fastapi_server/resource.py,sha256=2788yiuRjE3GRLqyukuL-x6qN0TSUNzNCm6S51ulNTk,887
|
171
174
|
instaui/fastapi_server/server.py,sha256=6NvpWg6CkCjGK21-Pj1WDLI3YjA0nBBNS2v2_vPPiyc,9892
|
172
175
|
instaui/fastapi_server/watch_router.py,sha256=KC8AbGNpH2x11PHQMPgc9N5WOlqW05i6r0PTU5A35rI,1599
|
173
|
-
instaui/handlers/_utils.py,sha256=
|
176
|
+
instaui/handlers/_utils.py,sha256=uO7WgbNhrykJwDwSEXQxsqsuCR37nx8ehL_urXm-Tks,2830
|
174
177
|
instaui/handlers/event_handler.py,sha256=hjxi_nDh0yjk9EmRgew1USXk-Egd4pR8YnUiOcJbbnc,1761
|
175
178
|
instaui/handlers/watch_handler.py,sha256=Ay4lubEdRnZcWSqWLwxQyS_uWiF0gu-E9PrNGCAHvL0,1600
|
176
|
-
instaui/html_tools.py,sha256=VJDnOdPPDzXi_u6bMj5_fqdFjGXG3-HgXQsvD0gfauc,2577
|
177
|
-
instaui/inject.py,sha256=NeTcsxoPdo12kZCvGjFU9NNHsVWnsPJfIcNY5_sPGYc,727
|
178
179
|
instaui/js/__init__.py,sha256=oIYLPskHpQf8a4SWHLX4DyKjrlDrqWaqbNksIQsLBoA,69
|
179
180
|
instaui/js/js_output.py,sha256=a4tZ99P19oen4510qI9LWX6pX0-lH5y37v8va6UY62Y,382
|
180
181
|
instaui/js/lambda_func.py,sha256=ulCJ1lzF4h3jGihVTwltS3xEDPbTegjzIN8Al7U4Ank,1004
|
181
|
-
instaui/launch_collector.py,sha256=_YmF3hsNWe-ZxMp_amqUBHkhB6fOuTPfX16BVwn25xg,1731
|
182
|
-
instaui/page_info.py,sha256=aJtfLp2h05tCuLzxk2pZ6a9ztyxSdI-g3NBRxbqpS6E,269
|
183
182
|
instaui/runtime/__init__.py,sha256=4aYTDsKaloRMQns8ttdfSx5xLmcN0Ot6tMqELbjIDZg,667
|
184
183
|
instaui/runtime/_app.py,sha256=tF2rb_4SC6cMYTriDYUKRfroAK6tn5PFLEEXyogClmI,7340
|
185
184
|
instaui/runtime/_inner_helper.py,sha256=Aw7S_KtCuOlpd8NP2RuQvNTL1GJtpxQGLsKdc3VXQFY,326
|
@@ -192,11 +191,10 @@ instaui/runtime/ui_state_scope.py,sha256=g48VpQj0BboooUrPr5VIWvcQoJe0bIQARMwRyVE
|
|
192
191
|
instaui/settings/__init__.py,sha256=nK_xDrlq7CPjm9x3EKsKUW5qWBg_1d-xbqAp_i5G8cc,70
|
193
192
|
instaui/settings/__settings.py,sha256=DWzRvs9bBqjoNA2MvGAyz3GRrSV8H6lMLF1H3iJyoyA,385
|
194
193
|
instaui/shadcn_classless/_index.py,sha256=8gjLIh4J1ezFsQr3hvqS76gY_nhdgiNpexY-ENgfReY,1088
|
195
|
-
instaui/shadcn_classless/static/shadcn-classless.css,sha256=
|
196
|
-
instaui/skip.py,sha256=uqhqusgeChVoivKFMoZd-XePYrlSoLvUzRZDBcUgFmA,149
|
194
|
+
instaui/shadcn_classless/static/shadcn-classless.css,sha256=ThJK_nVoBTOoyuz2I-w7dgUgXyZRI_HIupHgaz5Pl0Q,10876
|
197
195
|
instaui/spa_router/__init__.py,sha256=DGSf0YD6wZFj22kmPSyJWUmm_Lx3_YFg32iOa096T7Y,519
|
198
196
|
instaui/spa_router/_components.py,sha256=vPo4JuRtbD_5ll0LkGwU1p8l_pxNfCSdFLDzMXsoEpw,896
|
199
|
-
instaui/spa_router/_file_base_utils.py,sha256=
|
197
|
+
instaui/spa_router/_file_base_utils.py,sha256=fdZJxi8h9oEf9olks4m-0rTe9Fqn7lq3uIDyFFt07xU,8805
|
200
198
|
instaui/spa_router/_functions.py,sha256=6EDwXLHnmRrB_CUcbRNPblfOUPF8orob9PXrWm2RfSI,3227
|
201
199
|
instaui/spa_router/_install.py,sha256=X9p7wtuGxo6B5F47UTY4ndOSRzENXkoK1XdkNo3F_YA,291
|
202
200
|
instaui/spa_router/_route_model.py,sha256=x54tqunkVQSbBKpELiSwcDdBDUzDXFbJl_o6eSu7M7A,4057
|
@@ -205,20 +203,20 @@ instaui/spa_router/_router_output.py,sha256=Nc6N8yO_9IrUbaYbPZMkOX_9VlwBKzyXMaha
|
|
205
203
|
instaui/spa_router/_router_param_var.py,sha256=KCy54xBZxGMqLO3Zlbzr6XV8ts-M6jCOKunL2gz5IUc,1455
|
206
204
|
instaui/spa_router/_types.py,sha256=KuGuv5C6qivwllfdmV5qrvM0S_GWJ6u8OOTkCNmJImU,81
|
207
205
|
instaui/spa_router/templates/page_routes,sha256=8VjM_8f6pjFb01QbU9z5HNqpcNRdCiX3X0OqNHLq8fo,1355
|
208
|
-
instaui/static/insta-ui.css,sha256=
|
209
|
-
instaui/static/insta-ui.esm-browser.prod.js,sha256=
|
206
|
+
instaui/static/insta-ui.css,sha256=nVwKBfzSg887seRBCa4tkHoj_02rrhZqwNJBdvstI8A,293
|
207
|
+
instaui/static/insta-ui.esm-browser.prod.js,sha256=A2y-kesfN4UcumpggMzxnl54yXiqtkHRM6Xl9EhCaOI,108944
|
210
208
|
instaui/static/insta-ui.ico,sha256=08FJg4qWolvOjfodoh8IJLStslrvd8sDyuRcTUDq5ak,1150
|
211
|
-
instaui/static/insta-ui.js.map,sha256=
|
209
|
+
instaui/static/insta-ui.js.map,sha256=v_YoQ6-ued7aRxRsTlvg9u7WuUD-VZLr-t0q3wt-OhI,659984
|
212
210
|
instaui/static/instaui-tools-browser.js,sha256=cLHKNXYaYMZriMxV-yKGAHTrHSdNRUlDVZmv6uc6mMw,14455
|
213
|
-
instaui/static/templates/debug/sse.html,sha256=qw5pzfjbU_XM-hA_SJCt2F8Imbvp17tW5l2dwoSZYjY,3391
|
214
|
-
instaui/static/templates/web.html,sha256=pCHoQIPUO03GX_aZ5zNjRYQC9b0GPFtoYE9P8eo5pHc,1789
|
215
|
-
instaui/static/templates/webview.html,sha256=9zQB7wkYKSgHh866Dk3xqSYbcWhCMCaVuh9iM8TFnhg,1862
|
216
|
-
instaui/static/templates/zero.html,sha256=_PHhx6uYD__tlt_bXG4j1WoZGnMBXIs2w2sU6-1zvH4,1684
|
217
211
|
instaui/static/vue.esm-browser.prod.js,sha256=vwQkXANuVYQuEFc0VgiokJdhNyMmvxMKyb1FmrYrNb4,162662
|
218
212
|
instaui/static/vue.global.prod.js,sha256=xFm6fMjbZcmCWJ-l1kx_9HiHfo5bD9dWgyB87GpOieg,157924
|
219
213
|
instaui/static/vue.runtime.esm-browser.prod.js,sha256=74FfP_s9pycfQXWAiGWx6SbjV_oJvMwZLFBkEXeW1Ek,102024
|
214
|
+
instaui/static/templates/web.html,sha256=pCHoQIPUO03GX_aZ5zNjRYQC9b0GPFtoYE9P8eo5pHc,1789
|
215
|
+
instaui/static/templates/webview.html,sha256=9zQB7wkYKSgHh866Dk3xqSYbcWhCMCaVuh9iM8TFnhg,1862
|
216
|
+
instaui/static/templates/zero.html,sha256=_PHhx6uYD__tlt_bXG4j1WoZGnMBXIs2w2sU6-1zvH4,1684
|
217
|
+
instaui/static/templates/debug/sse.html,sha256=qw5pzfjbU_XM-hA_SJCt2F8Imbvp17tW5l2dwoSZYjY,3391
|
220
218
|
instaui/systems/file_system.py,sha256=q8k_mSHhldkSRYXT73T9s8zvERZZo9HL1U2-4mwau-I,163
|
221
|
-
instaui/systems/func_system.py,sha256=
|
219
|
+
instaui/systems/func_system.py,sha256=CER3Qm5luetdskMNVhJslvZK-QKbLe_n1aIGCe_i6Lc,3174
|
222
220
|
instaui/systems/js_system.py,sha256=t_r7SFPmfvTiIrxzuf1YgHyi_Oi_81W0UH_kkC5MwmM,685
|
223
221
|
instaui/systems/module_system.py,sha256=6qeR1K1vxocezBGPX5yecLVygqjzHNeDtlJTwJO9Szs,937
|
224
222
|
instaui/systems/pydantic_system.py,sha256=qibHh4QqjLNPBzyrCkJVJwCk1dC_H8gEDYYf8Sb-5ps,691
|
@@ -231,15 +229,15 @@ instaui/template/__init__.py,sha256=fuua3uCOCmhWb7Q6Sc6pUxfwlxYJTXkdWB1V2fubyyc,
|
|
231
229
|
instaui/template/_utils.py,sha256=wNIGDWr3z2PpmKsgShYISbCnII4AbKfsLIX_DRWlRbU,670
|
232
230
|
instaui/template/env.py,sha256=ZqVsqpfSY1mupbgpBSkvOJytNui8xfNR5kNNC9rv4Ps,150
|
233
231
|
instaui/template/web_template.py,sha256=BmZY13q4E_ZP4YVgfBKbbXvPHcGZfOl2f54wp_0DjJA,1603
|
234
|
-
instaui/template/webview_template.py,sha256=
|
232
|
+
instaui/template/webview_template.py,sha256=rd51iPi600QOPQ9PMjgYk61oIxn3L2p3_sJ3eBPG_24,1557
|
235
233
|
instaui/template/zero_template.py,sha256=E88VGsyjb1qbHFJlMW-xmLRFkwUXZA7VDoZ_Jd8YubA,3514
|
236
|
-
instaui/ui/__init__.py,sha256=
|
237
|
-
instaui/ui/__init__.pyi,sha256=
|
234
|
+
instaui/ui/__init__.py,sha256=G0Zg9hqyO4RQ-izbES_qkYZb6SCv3lLTy4Etewhs8vo,4284
|
235
|
+
instaui/ui/__init__.pyi,sha256=qH14avUiYgVNhQ5G8TFc8FT23NNCL6xFpicBKXUJkF8,4188
|
238
236
|
instaui/ui/events.py,sha256=lfhiINwn-Kh0MezsSeLJPttWm6G1aWiwyk3TRo0NrlA,809
|
239
237
|
instaui/ui_functions/input_slient_data.py,sha256=0A5DegIt_MqdZgbj1RiVFNmB_RUqgov9FYtkw6VX0DE,511
|
240
238
|
instaui/ui_functions/server.py,sha256=B4w8KwBUMGStY19uUG8E4vRG7-L4cedttLkh35xr698,357
|
241
239
|
instaui/ui_functions/str_format.py,sha256=ECWttA4LlNHlvdT_73wGF_I68soWNEXTP_Hosmxt-m4,1139
|
242
|
-
instaui/ui_functions/ui_page.py,sha256=
|
240
|
+
instaui/ui_functions/ui_page.py,sha256=WVm1qoQ9IxE3kWKKnAU8WVI8drsqxxlLucYKfEZ712s,367
|
243
241
|
instaui/ui_functions/ui_types.py,sha256=J5tqFFkoZJMuoLeTqU52KNgw3kdB_IfcrhaBmyI6NAA,505
|
244
242
|
instaui/ui_functions/url_location.py,sha256=zyTAJpA-3GBBe7WAiP2IDKQxeQhu0LNgBOxwEzcDaDk,823
|
245
243
|
instaui/vars/_types.py,sha256=wthCk1fcxj1SZ5y6b84W9gFpoi8j2PYnfmaPj4Am72s,308
|
@@ -247,39 +245,38 @@ instaui/vars/data.py,sha256=uxDN-Xa5wO-_QFZYkiYOACnb9Ve8yODSFNIUs-S_E0I,1768
|
|
247
245
|
instaui/vars/element_ref.py,sha256=qC-Kb1hBGz_Y6WKjKxRvYR8jdvWW4VeAAGzJ2wSrGgI,1059
|
248
246
|
instaui/vars/event_context.py,sha256=3ML6nyF6Q1hbFvdeu6E2QVOIVcWe1P9FtlCR0dgBGjo,1308
|
249
247
|
instaui/vars/event_extend.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
250
|
-
instaui/vars/js_computed.py,sha256=
|
251
|
-
instaui/vars/mixin_types/common_type.py,sha256=4KduANLCUCeGTA1ClEsbFzEzd8Mgve3693Wxf9H7Gmw,176
|
252
|
-
instaui/vars/mixin_types/element_binding.py,sha256=4suqqLT3zn5y7LvqVo2QrEgI1uUFS_5sv8vtTUCzkTc,235
|
253
|
-
instaui/vars/mixin_types/observable.py,sha256=h2cox7BwQtLOWqCTaWnNU0TsgYJKuoNUuuEqwj-KXpU,141
|
254
|
-
instaui/vars/mixin_types/pathable.py,sha256=40H5f1gCDtKs4Qor0C-moB821T7Df8DOgUcntjxgums,302
|
255
|
-
instaui/vars/mixin_types/py_binding.py,sha256=VIVSrHrjcltsP5ADKHtMSZBpi2qKyameXqoEevdfqk8,237
|
256
|
-
instaui/vars/mixin_types/str_format_binding.py,sha256=i2jXm1RKddPnGrCxEyz0tkDrBU2FfjR0EviQ0RKZsbY,257
|
257
|
-
instaui/vars/mixin_types/var_type.py,sha256=FQj1TEkjT7HopDPztt0-J6eQVGHjem3KBFsjZwvcvYg,57
|
248
|
+
instaui/vars/js_computed.py,sha256=CYCSR21Je1nTKfFh4camDne7TCHol6JHVZySDT4lCrk,3643
|
258
249
|
instaui/vars/path_var.py,sha256=DOgYHoajWKcMHMKYMSBiEOA99mmHIaMH-HRDvAKTZyE,2820
|
259
250
|
instaui/vars/ref.py,sha256=iMwKRYI8ygy2cOpXJgqUYJCpzJCQskDl4lRYTACZWnA,2567
|
260
251
|
instaui/vars/slot_prop.py,sha256=qBVQ0Ze0T8-Wsy__8qEuqVESIrLX69Bmy21Kuxrg_GQ,1198
|
261
|
-
instaui/vars/state.py,sha256=
|
252
|
+
instaui/vars/state.py,sha256=MuiCzR9n348P1J7qdCfFXXratwuOOGELLzg8pu9G6kE,3074
|
262
253
|
instaui/vars/types.py,sha256=K0QTajlzHaDvFoVMCHAhY_rVvrBm3FsC92BFPOgdBog,511
|
263
254
|
instaui/vars/vfor_item.py,sha256=cVrpErh8OrycYjDLm7PTuE2kIcC2M6ThAQlwvTXG8x0,5490
|
264
255
|
instaui/vars/vue_computed.py,sha256=6ZpxCQc2TJfh0vxTxcj6yNPjTVPo3CmsHq028xtiv8Y,2416
|
265
|
-
instaui/vars/web_computed.py,sha256=
|
256
|
+
instaui/vars/web_computed.py,sha256=BlK06i2KOV-KQZYQdiDIY8rwPYTY3rC6ntLQdNlyS3E,6062
|
266
257
|
instaui/vars/web_view_computed.py,sha256=bFFVE9jRKczNy4HhmegWoC6KOL_Nrej-ag37DAIDzaA,36
|
267
|
-
instaui/
|
258
|
+
instaui/vars/mixin_types/common_type.py,sha256=4KduANLCUCeGTA1ClEsbFzEzd8Mgve3693Wxf9H7Gmw,176
|
259
|
+
instaui/vars/mixin_types/element_binding.py,sha256=4suqqLT3zn5y7LvqVo2QrEgI1uUFS_5sv8vtTUCzkTc,235
|
260
|
+
instaui/vars/mixin_types/observable.py,sha256=h2cox7BwQtLOWqCTaWnNU0TsgYJKuoNUuuEqwj-KXpU,141
|
261
|
+
instaui/vars/mixin_types/pathable.py,sha256=40H5f1gCDtKs4Qor0C-moB821T7Df8DOgUcntjxgums,302
|
262
|
+
instaui/vars/mixin_types/py_binding.py,sha256=VIVSrHrjcltsP5ADKHtMSZBpi2qKyameXqoEevdfqk8,237
|
263
|
+
instaui/vars/mixin_types/str_format_binding.py,sha256=i2jXm1RKddPnGrCxEyz0tkDrBU2FfjR0EviQ0RKZsbY,257
|
264
|
+
instaui/vars/mixin_types/var_type.py,sha256=FQj1TEkjT7HopDPztt0-J6eQVGHjem3KBFsjZwvcvYg,57
|
268
265
|
instaui/watch/_types.py,sha256=HJ_eAID0NsEJ_S8PhcYWxpVWhYLjjqKlbNWwqdqS4IU,73
|
269
266
|
instaui/watch/_utils.py,sha256=mTITHG8hp0pyfQXUERQKXMDna5Au02bhuASCV32eXHI,124
|
270
|
-
instaui/watch/js_watch.py,sha256=
|
267
|
+
instaui/watch/js_watch.py,sha256=8lVINBauHBRiDX3-F1V6V5_1CN9j1EMCROjcD9LRCD8,4230
|
271
268
|
instaui/watch/vue_watch.py,sha256=Vd3nsRyf9ufrXLFTjaSvglwnkoWyE32fOV0qOogWPt4,2013
|
272
|
-
instaui/watch/web_watch.py,sha256=
|
273
|
-
instaui/webview/__init__.py,sha256=
|
269
|
+
instaui/watch/web_watch.py,sha256=Z0xevG6Zwp-9yPSGBZFlbwtd0yP4j29F0GV-yksZVV0,6031
|
270
|
+
instaui/webview/__init__.py,sha256=_L8B0Ym7i1Q8eonQ81fC54EXn7oZuc6zE1KqeAEPHEg,65
|
274
271
|
instaui/webview/_utils.py,sha256=pqARVv37h-8p7CLOpvqLV8O_az4EV2VD9G-beUVqjD8,172
|
275
272
|
instaui/webview/api.py,sha256=9xuG3EKpmOOy1dvIrS9C9z9ukQDRnIdZLrGFD5FLyvU,2071
|
276
273
|
instaui/webview/func.py,sha256=Igrf7U5qL5jJvhwIRJ3JqRjXxX_S2O_nQ9oy1HLFtYo,3422
|
277
|
-
instaui/webview/index.py,sha256=
|
274
|
+
instaui/webview/index.py,sha256=u-Q8ved3aPMyX_bDiGCq5HIafq80h4JP8Vd5__zP6-M,5806
|
278
275
|
instaui/webview/resource.py,sha256=kFT6N5UZK5GLE0KmW3TrEYDNlViw9DL2OshRh41wBXs,5566
|
279
276
|
instaui/zero/__init__.py,sha256=N0LuRUAcaurxHSspcEDuwZg62W2S3qL4VtrMKxOivBE,49
|
280
277
|
instaui/zero/func.py,sha256=8cA_wJMtRmoAARjWY8yY5MmLXDAQ7hyVW6f1Vbejtoc,3576
|
281
278
|
instaui/zero/scope.py,sha256=HGohYOqnpRGVkkoz_gvR6-DgCc48AtJAcDwbOnnGHLM,3753
|
282
|
-
instaui-0.1.
|
283
|
-
instaui-0.1.
|
284
|
-
instaui-0.1.
|
285
|
-
instaui-0.1.
|
279
|
+
instaui-0.1.10.dist-info/METADATA,sha256=lb1uK1JEJfD0Lw_TOI2I0sKQMlC4ndT3lz7NzNZU5zo,3591
|
280
|
+
instaui-0.1.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
281
|
+
instaui-0.1.10.dist-info/licenses/LICENSE,sha256=_JjnAWrikJ6qkwT7PazeFNRlcIu8q_RH3mYcHTxEF5c,1094
|
282
|
+
instaui-0.1.10.dist-info/RECORD,,
|
@@ -1,23 +0,0 @@
|
|
1
|
-
from instaui import ui
|
2
|
-
from ._types import TFilters
|
3
|
-
|
4
|
-
|
5
|
-
class DataSourceElement(ui.element, esm="./data_source.js"):
|
6
|
-
def __init__(
|
7
|
-
self,
|
8
|
-
):
|
9
|
-
super().__init__()
|
10
|
-
|
11
|
-
self._ele_ref = ui.element_ref()
|
12
|
-
self.element_ref(self._ele_ref)
|
13
|
-
|
14
|
-
self.filters: TFilters = ui.state({})
|
15
|
-
|
16
|
-
self.on(
|
17
|
-
"filter-changed",
|
18
|
-
ui.js_event(
|
19
|
-
inputs=[ui.event_context.e()],
|
20
|
-
outputs=[self.filters],
|
21
|
-
code="v=> v.filters",
|
22
|
-
),
|
23
|
-
)
|
@@ -1,221 +0,0 @@
|
|
1
|
-
from pathlib import Path
|
2
|
-
from typing import Dict, TypeVar
|
3
|
-
import itertools
|
4
|
-
from instaui import ui, arco
|
5
|
-
from ._base import DataSourceElement
|
6
|
-
from ._types import TFilters, TQueryStrInfo
|
7
|
-
|
8
|
-
try:
|
9
|
-
import pandas
|
10
|
-
import duckdb
|
11
|
-
except ImportError as e:
|
12
|
-
raise e
|
13
|
-
|
14
|
-
|
15
|
-
TElementClass = TypeVar("TElementClass", bound=ui.element)
|
16
|
-
|
17
|
-
|
18
|
-
class DuckdbDataFrameSource:
|
19
|
-
QUERY_ID: int = 0
|
20
|
-
|
21
|
-
def __init__(
|
22
|
-
self,
|
23
|
-
table_name: str,
|
24
|
-
):
|
25
|
-
super().__init__()
|
26
|
-
|
27
|
-
self._element = DataSourceElement()
|
28
|
-
self._conn = duckdb.connect(":default:", read_only=False)
|
29
|
-
self._table_name = table_name
|
30
|
-
|
31
|
-
def _generate_query_id(self):
|
32
|
-
self.QUERY_ID += 1
|
33
|
-
return self.QUERY_ID
|
34
|
-
|
35
|
-
def __getitem__(self, field: str):
|
36
|
-
def use_fn(cls: type[TElementClass]) -> TElementClass:
|
37
|
-
if issubclass(cls, arco.select):
|
38
|
-
return self.__apply_select(field)(cls)
|
39
|
-
|
40
|
-
if issubclass(cls, arco.input):
|
41
|
-
return self.__apply_input(field)(cls)
|
42
|
-
|
43
|
-
raise NotImplementedError(f"Not supported component:{cls.__name__}")
|
44
|
-
|
45
|
-
return use_fn
|
46
|
-
|
47
|
-
def __query_distinct_field_values(
|
48
|
-
self, field: str, query_id: int, order_sql: str = ""
|
49
|
-
):
|
50
|
-
@ui.computed(inputs=[self.__query_str_info(field, query_id), field, order_sql])
|
51
|
-
def query_distinct_field_values_computed(
|
52
|
-
with_filters_info: TQueryStrInfo, field: str, order_sql: str
|
53
|
-
):
|
54
|
-
sql = f"with cte as ({with_filters_info['sql']}) select distinct {field} from cte {order_sql}"
|
55
|
-
|
56
|
-
local_con = self._conn.cursor()
|
57
|
-
|
58
|
-
query = local_con.sql(sql, params=with_filters_info["params"])
|
59
|
-
return list(itertools.chain(*query.fetchall()))
|
60
|
-
|
61
|
-
return query_distinct_field_values_computed
|
62
|
-
|
63
|
-
def __apply_select(self, field: str):
|
64
|
-
def use_fn(cls: type[arco.select]) -> arco.select:
|
65
|
-
query_id = self._generate_query_id()
|
66
|
-
element = cls(
|
67
|
-
self.__query_distinct_field_values(
|
68
|
-
field=field, query_id=query_id, order_sql=f"order by {field}"
|
69
|
-
)
|
70
|
-
)
|
71
|
-
|
72
|
-
on_change = ui.js_event(
|
73
|
-
inputs=[ui.event_context.e(), field, query_id],
|
74
|
-
outputs=[self._element._ele_ref],
|
75
|
-
code=r"""(value,field,query_id) => {
|
76
|
-
if (value) {
|
77
|
-
return {method: 'addFilter', args:[{field, expr: `${field}= ?`,value,query_id}]};
|
78
|
-
}
|
79
|
-
|
80
|
-
return {method:'removeFilter', args:[{field,query_id}]};
|
81
|
-
}""",
|
82
|
-
)
|
83
|
-
|
84
|
-
element.on_change(on_change)
|
85
|
-
|
86
|
-
return element
|
87
|
-
|
88
|
-
return use_fn
|
89
|
-
|
90
|
-
def __apply_input(self, field: str):
|
91
|
-
def use_fn(cls: type[arco.input]) -> arco.input:
|
92
|
-
query_id = self._generate_query_id()
|
93
|
-
element = cls()
|
94
|
-
|
95
|
-
on_change = ui.js_event(
|
96
|
-
inputs=[ui.event_context.e(), field, query_id],
|
97
|
-
outputs=[self._element._ele_ref],
|
98
|
-
code=r"""(value,field,query_id) => {
|
99
|
-
if (value) {
|
100
|
-
value = `%${value.trim()}%`
|
101
|
-
return {method: 'addFilter', args:[{field, expr: `${field} like ?`,value,replace:true,query_id}]};
|
102
|
-
}
|
103
|
-
|
104
|
-
return {method:'removeFilter', args:[{field,query_id}]};
|
105
|
-
}""",
|
106
|
-
)
|
107
|
-
|
108
|
-
element.on_input(on_change)
|
109
|
-
|
110
|
-
return element
|
111
|
-
|
112
|
-
return use_fn
|
113
|
-
|
114
|
-
def __query_str_info(self, target_field: str = "", query_id: int = -1):
|
115
|
-
@ui.computed(inputs=[self._element.filters, target_field, query_id])
|
116
|
-
def query_str_computed(filters: TFilters, target_field: str, query_id: int):
|
117
|
-
if not filters:
|
118
|
-
return {
|
119
|
-
"sql": f"select * from {self._table_name}",
|
120
|
-
"params": [],
|
121
|
-
}
|
122
|
-
else:
|
123
|
-
filter_exprs = []
|
124
|
-
|
125
|
-
if target_field:
|
126
|
-
target_key = f"{target_field}-{query_id}"
|
127
|
-
without_target_exprs = (
|
128
|
-
exprs for key, exprs in filters.items() if key != target_key
|
129
|
-
)
|
130
|
-
filter_exprs = list(itertools.chain(*without_target_exprs))
|
131
|
-
else:
|
132
|
-
filter_exprs = list(itertools.chain(*filters.values()))
|
133
|
-
|
134
|
-
where_stem = " and ".join(info["expr"] for info in filter_exprs)
|
135
|
-
if where_stem:
|
136
|
-
where_stem = f" where {where_stem}"
|
137
|
-
return {
|
138
|
-
"sql": f"select * from {self._table_name}{where_stem}",
|
139
|
-
"params": [info["value"] for info in filter_exprs],
|
140
|
-
}
|
141
|
-
|
142
|
-
return query_str_computed
|
143
|
-
|
144
|
-
def query_str(self):
|
145
|
-
return ui.js_computed(
|
146
|
-
inputs=[self.__query_str_info()],
|
147
|
-
code=r"""info=>{
|
148
|
-
const {sql,params} = info;
|
149
|
-
let currentIndex = 0;
|
150
|
-
return sql.replace(/\?/g, function () {
|
151
|
-
if (currentIndex >= params.length) {
|
152
|
-
throw new Error('Not enough parameters provided for the SQL statement.');
|
153
|
-
}
|
154
|
-
return JSON.stringify(params[currentIndex++]);
|
155
|
-
});
|
156
|
-
}""",
|
157
|
-
)
|
158
|
-
|
159
|
-
def filters(self):
|
160
|
-
return self._element.filters
|
161
|
-
|
162
|
-
def __apply_table(self, *, sql: str):
|
163
|
-
def use_fn(cls: type[arco.table]) -> arco.table:
|
164
|
-
@ui.computed(inputs=[self.__query_str_info(), sql])
|
165
|
-
def table_query(with_filters_into: TQueryStrInfo, sql: str):
|
166
|
-
sql = f"with cte as ({with_filters_into['sql']}) {sql}"
|
167
|
-
|
168
|
-
local_con = self._conn.cursor()
|
169
|
-
|
170
|
-
query = local_con.sql(sql, params=with_filters_into["params"])
|
171
|
-
columns = query.columns
|
172
|
-
values = query.fetchall()
|
173
|
-
|
174
|
-
real_cols = [{"title": col, "dataIndex": col} for col in columns]
|
175
|
-
|
176
|
-
real_values = [
|
177
|
-
{col: val for col, val in zip(columns, row)} for row in values
|
178
|
-
]
|
179
|
-
|
180
|
-
return {
|
181
|
-
"columns": real_cols,
|
182
|
-
"data": real_values,
|
183
|
-
}
|
184
|
-
|
185
|
-
element = cls(
|
186
|
-
data=ui.js_computed(inputs=[table_query], code=r"v=> v ? v.data : []"),
|
187
|
-
columns=ui.js_computed(
|
188
|
-
inputs=[table_query], code=r"v=> v ? v.columns : []"
|
189
|
-
),
|
190
|
-
)
|
191
|
-
|
192
|
-
return element
|
193
|
-
|
194
|
-
return use_fn
|
195
|
-
|
196
|
-
def __call__(self, cls: type[arco.table], *, sql: str = "select * from cte"):
|
197
|
-
return self.__apply_table(sql=sql)(cls)
|
198
|
-
|
199
|
-
def query_table(self, *, sql: str):
|
200
|
-
return self.__apply_table(sql=sql)
|
201
|
-
|
202
|
-
|
203
|
-
class Facade:
|
204
|
-
def __call__(self, db: Path):
|
205
|
-
self.db = db
|
206
|
-
raise NotImplementedError()
|
207
|
-
|
208
|
-
@classmethod
|
209
|
-
def from_pandas(
|
210
|
-
cls, dataframe: "pandas.DataFrame", *, table_name: str = "df"
|
211
|
-
) -> DuckdbDataFrameSource:
|
212
|
-
ds = DuckdbDataFrameSource(table_name)
|
213
|
-
|
214
|
-
cursor = ds._conn.cursor()
|
215
|
-
cursor.execute(
|
216
|
-
f"create table if not exists {table_name} as select * from dataframe"
|
217
|
-
)
|
218
|
-
return ds
|
219
|
-
|
220
|
-
|
221
|
-
_facade = Facade()
|
@@ -1,15 +0,0 @@
|
|
1
|
-
from typing import Any, Dict, List
|
2
|
-
from typing_extensions import TypedDict
|
3
|
-
|
4
|
-
|
5
|
-
class TFilterInfo(TypedDict):
|
6
|
-
expr: str
|
7
|
-
value: Any
|
8
|
-
|
9
|
-
|
10
|
-
TFilters = Dict[str, List[TFilterInfo]]
|
11
|
-
|
12
|
-
|
13
|
-
class TQueryStrInfo(TypedDict):
|
14
|
-
sql: str
|
15
|
-
params: List[Any]
|
@@ -1,50 +0,0 @@
|
|
1
|
-
|
2
|
-
export default {
|
3
|
-
props: [],
|
4
|
-
|
5
|
-
setup(props, { emit, expose }) {
|
6
|
-
const filters = new Map()
|
7
|
-
|
8
|
-
function addFilter(filter) {
|
9
|
-
const { field, expr, value, replace = true, query_id } = filter
|
10
|
-
const key = `${field}-${query_id}`
|
11
|
-
|
12
|
-
if (!filters.has(key)) {
|
13
|
-
filters.set(key, [])
|
14
|
-
}
|
15
|
-
|
16
|
-
const info = { expr, value }
|
17
|
-
|
18
|
-
if (replace) {
|
19
|
-
filters.set(key, [info])
|
20
|
-
} else {
|
21
|
-
filters.get(key).push(info)
|
22
|
-
}
|
23
|
-
emit("filter-changed", { filters: Object.fromEntries(filters.entries()), target: field, query_id })
|
24
|
-
}
|
25
|
-
|
26
|
-
function removeFilter(info) {
|
27
|
-
const { field, query_id } = info
|
28
|
-
const key = `${field}-${query_id}`
|
29
|
-
|
30
|
-
filters.delete(key)
|
31
|
-
emit("filter-changed", { filters: Object.fromEntries(filters.entries()), target: field, query_id })
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
function test(count) {
|
37
|
-
console.log('test', count)
|
38
|
-
}
|
39
|
-
|
40
|
-
expose({
|
41
|
-
test,
|
42
|
-
addFilter,
|
43
|
-
removeFilter,
|
44
|
-
})
|
45
|
-
|
46
|
-
|
47
|
-
},
|
48
|
-
|
49
|
-
|
50
|
-
}
|