instaui 0.2.2__tar.gz → 0.3.0__tar.gz
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-0.2.2 → instaui-0.3.0}/PKG-INFO +1 -1
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/select.py +2 -1
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/component.py +3 -1
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/element.py +1 -4
- instaui-0.3.0/instaui/components/match.py +42 -0
- instaui-0.3.0/instaui/components/slot.py +115 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/vfor.py +39 -44
- instaui-0.3.0/instaui/components/vif.py +28 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/event/js_event.py +10 -8
- {instaui-0.2.2 → instaui-0.3.0}/instaui/event/vue_event.py +14 -16
- {instaui-0.2.2 → instaui-0.3.0}/instaui/event/web_event.py +4 -7
- {instaui-0.2.2 → instaui-0.3.0}/instaui/html_tools.py +8 -2
- {instaui-0.2.2 → instaui-0.3.0}/instaui/js/fn.py +13 -10
- {instaui-0.2.2 → instaui-0.3.0}/instaui/runtime/__init__.py +2 -2
- {instaui-0.2.2 → instaui-0.3.0}/instaui/runtime/_app.py +43 -35
- {instaui-0.2.2 → instaui-0.3.0}/instaui/runtime/scope.py +117 -33
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/_functions.py +4 -4
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/_route_model.py +6 -7
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/_router_output.py +5 -1
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/_router_param_var.py +4 -9
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/insta-ui.css +1 -1
- instaui-0.3.0/instaui/static/insta-ui.esm-browser.prod.js +3701 -0
- instaui-0.3.0/instaui/static/insta-ui.js.map +1 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/ui/__init__.py +3 -2
- {instaui-0.2.2 → instaui-0.3.0}/instaui/ui/__init__.pyi +3 -2
- {instaui-0.2.2 → instaui-0.3.0}/instaui/ui_functions/input_slient_data.py +4 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/_types.py +14 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/data.py +7 -4
- instaui-0.3.0/instaui/vars/element_ref.py +43 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/event_context.py +7 -3
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/js_computed.py +4 -4
- instaui-0.3.0/instaui/vars/mixin_types/py_binding.py +53 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/path_var.py +7 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/ref.py +7 -2
- instaui-0.3.0/instaui/vars/slot_prop.py +54 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/state.py +23 -12
- instaui-0.3.0/instaui/vars/vfor_item.py +302 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/vue_computed.py +4 -4
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/web_computed.py +10 -6
- {instaui-0.2.2 → instaui-0.3.0}/instaui/watch/js_watch.py +6 -6
- {instaui-0.2.2 → instaui-0.3.0}/instaui/watch/vue_watch.py +25 -2
- {instaui-0.2.2 → instaui-0.3.0}/instaui/watch/web_watch.py +6 -5
- {instaui-0.2.2 → instaui-0.3.0}/pyproject.toml +4 -1
- instaui-0.2.2/instaui/components/match.py +0 -106
- instaui-0.2.2/instaui/components/slot.py +0 -81
- instaui-0.2.2/instaui/components/vif.py +0 -40
- instaui-0.2.2/instaui/static/insta-ui.esm-browser.prod.js +0 -3785
- instaui-0.2.2/instaui/static/insta-ui.js.map +0 -1
- instaui-0.2.2/instaui/vars/element_ref.py +0 -40
- instaui-0.2.2/instaui/vars/mixin_types/py_binding.py +0 -20
- instaui-0.2.2/instaui/vars/slot_prop.py +0 -46
- instaui-0.2.2/instaui/vars/vfor_item.py +0 -204
- {instaui-0.2.2 → instaui-0.3.0}/.gitignore +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/LICENSE +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/README.md +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/_helper/observable_helper.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/action/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/action/cookie.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/action/url_location.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/_settings.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/_use_tools/locale.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/component_types.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/_utils.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/affix.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/alert.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/anchor.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/auto_complete.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/avatar.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/back_top.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/badge.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/breadcrumb.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/button.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/calendar.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/card.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/carousel.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/cascader.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/checkbox.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/collapse.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/color_picker.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/comment.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/config_provider.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/date_picker.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/descriptions.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/divider.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/drawer.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/dropdown.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/empty.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/form.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/icon.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/image.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/input.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/input_number.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/input_password.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/input_search.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/input_tag.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/layout.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/layout_content.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/layout_footer.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/layout_header.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/layout_sider.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/link.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/list.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/mention.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/menu.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/modal.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/overflow_list.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/page_header.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/pagination.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/pop_confirm.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/popover.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/progress.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/radio.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/radio_group.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/rate.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/resize_box.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/result.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/skeleton.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/slider.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/space.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/spin.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/split.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/statistic.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/steps.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/switch.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/tab_pane.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/table.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/tabs.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/tag.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/textarea.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/time_picker.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/timeline.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/tooltip.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/transfer.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/tree.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/tree_select.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/trigger.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/typography.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/upload.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/verification_code.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/components/watermark.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/locales/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/locales/_index.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/locales/en_us.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/locales/zh_cn.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/setup.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/static/instaui-arco.css +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/static/instaui-arco.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/arco/types.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/boot_info.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/common/jsonable.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/column.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/container.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/content.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/directive.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/grid.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/heading.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/_mixins.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/_preset.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/button.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/checkbox.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/date.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/div.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/form.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/heading.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/input.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/label.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/li.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/link.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/number.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/paragraph.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/radio.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/range.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/select.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/span.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/table.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/textarea.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/html/ul.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/label.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/markdown/markdown.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/markdown/markdown.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/markdown/static/github-markdown.css +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/markdown/static/marked.esm.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/mixins.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/row.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/shiki_code.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/shiki_code.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/langs/css.mjs +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/langs/markdown.mjs +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/langs/python.mjs +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/langs/shell.mjs +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/langs/shellscript.mjs +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/shiki-core.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/shiki-style.css +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/shiki-transformers.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/themes/vitesse-dark.mjs +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/shiki_code/static/themes/vitesse-light.mjs +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/timer/timer.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/timer/timer.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/transition_group.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/components/value_element.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/consts.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/dependencies/component_dependency.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/dependencies/plugin_dependency.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/event/event_mixin.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/experimental/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/experimental/debug.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/extra_libs/_echarts.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/extra_libs/_import_error.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/extra_libs/_mermaid.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/extra_libs/_shiki_code.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/_utils.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/_uvicorn.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/debug_mode_router.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/dependency_router.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/event_router.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/middlewares.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/request_context.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/resource.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/server.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/fastapi_server/watch_router.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/handlers/_utils.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/handlers/event_handler.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/handlers/watch_handler.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/inject.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/launch_collector.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/page_info.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/patch_update.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/pre_setup.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/response.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/runtime/_inner_helper.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/runtime/_link_manager.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/runtime/context.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/runtime/dataclass.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/runtime/resource.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/runtime/ui_state_scope.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/settings/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/settings/__settings.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/shadcn_classless/_index.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/shadcn_classless/static/shadcn-classless.css +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/skip.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/_components.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/_file_base_utils.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/_install.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/_router_box.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/_types.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/spa_router/templates/page_routes +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/insta-ui.ico +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/instaui-tools-browser.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/templates/debug/sse.html +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/templates/web.html +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/templates/webview.html +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/templates/zero.html +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/vue.esm-browser.prod.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/vue.global.prod.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/static/vue.runtime.esm-browser.prod.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/systems/file_system.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/systems/func_system.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/systems/js_system.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/systems/module_system.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/systems/pydantic_system.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/systems/string_system.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/tailwind/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/tailwind/_index.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/tailwind/static/tailwindcss-v3.min.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/tailwind/static/tailwindcss-v4.min.js +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/template/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/template/_utils.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/template/env.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/template/web_template.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/template/webview_template.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/template/zero_template.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/ui/events.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/ui_functions/server.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/ui_functions/str_format.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/ui_functions/ui_page.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/ui_functions/ui_types.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/ui_system_var_type.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/event_extend.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/mixin_types/common_type.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/mixin_types/element_binding.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/mixin_types/observable.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/mixin_types/pathable.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/mixin_types/str_format_binding.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/mixin_types/var_type.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/types.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/vars/web_view_computed.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/version.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/watch/_types.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/watch/_utils.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/webview/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/webview/_utils.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/webview/api.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/webview/index.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/webview/resource.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/zero/__init__.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/zero/func.py +0 -0
- {instaui-0.2.2 → instaui-0.3.0}/instaui/zero/scope.py +0 -0
@@ -45,7 +45,8 @@ class Select(Element):
|
|
45
45
|
)
|
46
46
|
|
47
47
|
with self.add_slot("default"):
|
48
|
-
with ui.vfor
|
48
|
+
with ui.vfor(options) as item:
|
49
|
+
item = ui.iter_info(item)
|
49
50
|
Select.Option(item.dict_value).props(
|
50
51
|
{"value": item.dict_key, "label": item.dict_value}
|
51
52
|
)
|
@@ -23,7 +23,6 @@ from typing import (
|
|
23
23
|
from typing_extensions import Self
|
24
24
|
from collections import defaultdict
|
25
25
|
from instaui.runtime._app import get_app_slot
|
26
|
-
from instaui.runtime._app import get_current_scope
|
27
26
|
from instaui.vars.element_ref import ElementRef
|
28
27
|
from instaui.vars.vfor_item import VForItem
|
29
28
|
from instaui.components.directive import Directive
|
@@ -468,9 +467,7 @@ class Element(Component):
|
|
468
467
|
)
|
469
468
|
|
470
469
|
if self.__element_ref:
|
471
|
-
|
472
|
-
data["eRef"] = self.__element_ref._to_element_config()
|
473
|
-
scope.register_element_ref(self.__element_ref)
|
470
|
+
data["eRef"] = self.__element_ref._to_element_binding_config()
|
474
471
|
|
475
472
|
return data
|
476
473
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
import typing
|
4
|
+
from instaui.components.component import Component
|
5
|
+
|
6
|
+
from instaui.vars.mixin_types.element_binding import ElementBindingProtocol
|
7
|
+
|
8
|
+
|
9
|
+
class Match(Component):
|
10
|
+
def __init__(self, on: ElementBindingProtocol):
|
11
|
+
super().__init__("match")
|
12
|
+
self._on = on
|
13
|
+
self.cass_id_count = -1
|
14
|
+
self._case_values = []
|
15
|
+
|
16
|
+
def case(self, value: typing.Any):
|
17
|
+
self.cass_id_count += 1
|
18
|
+
self._case_values.append(value)
|
19
|
+
return self._slot_manager.get_slot(str(self.cass_id_count))
|
20
|
+
|
21
|
+
def default(self):
|
22
|
+
return self._slot_manager.get_slot(":default")
|
23
|
+
|
24
|
+
def _to_json_dict(self):
|
25
|
+
data = super()._to_json_dict()
|
26
|
+
data["on"] = self._on._to_element_binding_config()
|
27
|
+
data["caseValues"] = self._case_values
|
28
|
+
|
29
|
+
data["slots"] = {
|
30
|
+
name: slot
|
31
|
+
for name, slot in self._slot_manager._slots.items()
|
32
|
+
if name != ":"
|
33
|
+
}
|
34
|
+
|
35
|
+
default_slot = self._slot_manager.get_slot(
|
36
|
+
"default"
|
37
|
+
)._to_items_container_config()
|
38
|
+
|
39
|
+
if "sid" in default_slot:
|
40
|
+
data["sid"] = default_slot["sid"]
|
41
|
+
|
42
|
+
return data
|
@@ -0,0 +1,115 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from typing import TYPE_CHECKING, Dict, List, Optional
|
4
|
+
from instaui.common.jsonable import Jsonable
|
5
|
+
from instaui.runtime import get_slot_stacks, pop_slot
|
6
|
+
from instaui.runtime._app import ready_scope
|
7
|
+
from instaui.vars.slot_prop import BindingSlotPropItem
|
8
|
+
|
9
|
+
if TYPE_CHECKING:
|
10
|
+
from instaui.components.component import Component
|
11
|
+
|
12
|
+
_DEFAULT_SLOT_NAME = ":"
|
13
|
+
|
14
|
+
|
15
|
+
class SlotManager(Jsonable):
|
16
|
+
def __init__(self) -> None:
|
17
|
+
super().__init__()
|
18
|
+
self._slots: Dict[str, Slot] = {}
|
19
|
+
|
20
|
+
def get_slot(self, name: str) -> Slot:
|
21
|
+
name = _DEFAULT_SLOT_NAME if name == "default" else name
|
22
|
+
|
23
|
+
if name not in self._slots:
|
24
|
+
self._slots[name] = Slot(name)
|
25
|
+
|
26
|
+
return self._slots[name]
|
27
|
+
|
28
|
+
@property
|
29
|
+
def default(self):
|
30
|
+
return self.get_slot(_DEFAULT_SLOT_NAME)
|
31
|
+
|
32
|
+
def _to_json_dict(self):
|
33
|
+
return {name: slot._to_json_dict() for name, slot in self._slots.items()}
|
34
|
+
|
35
|
+
def has_slot(self) -> bool:
|
36
|
+
return len(self._slots) > 0
|
37
|
+
|
38
|
+
|
39
|
+
class Slot(Jsonable):
|
40
|
+
def __init__(self, name: str) -> None:
|
41
|
+
super().__init__()
|
42
|
+
|
43
|
+
self._id: Optional[str] = None
|
44
|
+
self._name = name
|
45
|
+
self._children: List[Component] = []
|
46
|
+
self._use_slot_props: bool = False
|
47
|
+
self._scope_wrapper = ready_scope()
|
48
|
+
self._slot_prop_info = SlotPropInfo(self._scope_wrapper)
|
49
|
+
|
50
|
+
def props(self, name: str):
|
51
|
+
self._use_slot_props = True
|
52
|
+
self._slot_prop_info.setup()
|
53
|
+
|
54
|
+
item = BindingSlotPropItem(
|
55
|
+
name, self._slot_prop_info.sid, self._slot_prop_info.var_id
|
56
|
+
)
|
57
|
+
|
58
|
+
return item[name]
|
59
|
+
|
60
|
+
def __enter__(self):
|
61
|
+
get_slot_stacks().append(self)
|
62
|
+
self._scope_wrapper.enter()
|
63
|
+
|
64
|
+
return self
|
65
|
+
|
66
|
+
def __exit__(self, *_):
|
67
|
+
self._scope_wrapper.exit()
|
68
|
+
pop_slot()
|
69
|
+
|
70
|
+
def _to_json_dict(self):
|
71
|
+
data = super()._to_json_dict()
|
72
|
+
|
73
|
+
if self._children:
|
74
|
+
data["items"] = self._children
|
75
|
+
|
76
|
+
if self._use_slot_props:
|
77
|
+
data["use_prop"] = 1
|
78
|
+
|
79
|
+
if self._scope_wrapper.used and self._scope_wrapper.scope.has_registered_task:
|
80
|
+
data["sid"] = self._scope_wrapper.scope_id
|
81
|
+
|
82
|
+
return data
|
83
|
+
|
84
|
+
def _to_items_container_config(self) -> Dict:
|
85
|
+
data = self._to_json_dict()
|
86
|
+
|
87
|
+
return {k: v for k, v in data.items() if k in ("items", "sid")}
|
88
|
+
|
89
|
+
|
90
|
+
class SlotPropInfo(Jsonable):
|
91
|
+
def __init__(self, scope_wrapper: ready_scope):
|
92
|
+
pass
|
93
|
+
|
94
|
+
self._scope_wrapper = scope_wrapper
|
95
|
+
self.__register_info = None
|
96
|
+
|
97
|
+
def setup(self):
|
98
|
+
if self.__register_info is not None:
|
99
|
+
return
|
100
|
+
scope = self._scope_wrapper.scope
|
101
|
+
self.__register_info = scope.register_slot_prop_info_task(self)
|
102
|
+
|
103
|
+
@property
|
104
|
+
def sid(self) -> str:
|
105
|
+
return self.__register_info.scope_id # type: ignore
|
106
|
+
|
107
|
+
@property
|
108
|
+
def var_id(self) -> str:
|
109
|
+
return self.__register_info.var_id # type: ignore
|
110
|
+
|
111
|
+
def _to_json_dict(self):
|
112
|
+
return {
|
113
|
+
"sid": self.sid,
|
114
|
+
"id": self.var_id,
|
115
|
+
}
|
@@ -2,19 +2,18 @@ from __future__ import annotations
|
|
2
2
|
from typing import (
|
3
3
|
Dict,
|
4
4
|
Literal,
|
5
|
-
Mapping,
|
6
5
|
Optional,
|
7
6
|
Union,
|
8
7
|
Sequence,
|
9
8
|
Generic,
|
10
9
|
TypeVar,
|
10
|
+
cast,
|
11
11
|
overload,
|
12
12
|
)
|
13
|
-
import
|
13
|
+
from enum import Enum
|
14
14
|
|
15
15
|
from instaui.components.component import Component
|
16
|
-
from instaui.vars.vfor_item import VForItem
|
17
|
-
from instaui.runtime._app import get_app_slot, new_scope
|
16
|
+
from instaui.vars.vfor_item import VForItem
|
18
17
|
|
19
18
|
from instaui.vars.mixin_types.element_binding import (
|
20
19
|
ElementBindingMixin,
|
@@ -24,10 +23,16 @@ from instaui.vars.mixin_types.element_binding import (
|
|
24
23
|
_T = TypeVar("_T")
|
25
24
|
|
26
25
|
|
26
|
+
class VForArrayTypeEnum(Enum):
|
27
|
+
CONST = "c"
|
28
|
+
REF = "r"
|
29
|
+
RANGE = "n"
|
30
|
+
|
31
|
+
|
27
32
|
class VFor(Component, Generic[_T]):
|
28
33
|
def __init__(
|
29
34
|
self,
|
30
|
-
data: Union[Sequence[_T], ElementBindingProtocol],
|
35
|
+
data: Union[Sequence[_T], ElementBindingProtocol, Dict[str, _T], _T],
|
31
36
|
*,
|
32
37
|
key: Union[Literal["item", "index"], str] = "index",
|
33
38
|
):
|
@@ -53,20 +58,12 @@ class VFor(Component, Generic[_T]):
|
|
53
58
|
super().__init__("vfor")
|
54
59
|
self._data = data
|
55
60
|
self._key = key
|
56
|
-
self._fid = get_app_slot().generate_vfor_id()
|
57
|
-
self.__scope_manager = new_scope()
|
58
|
-
self.__scope = None
|
59
61
|
self._num = None
|
60
62
|
self._transition_group_setting = None
|
61
63
|
|
62
64
|
def __enter__(self) -> _T:
|
63
|
-
self.__scope = self.__scope_manager.__enter__()
|
64
65
|
super().__enter__()
|
65
|
-
return VForItem(
|
66
|
-
|
67
|
-
def __exit__(self, *_) -> None:
|
68
|
-
self.__scope_manager.__exit__(*_)
|
69
|
-
return super().__exit__(*_)
|
66
|
+
return cast(_T, VForItem())
|
70
67
|
|
71
68
|
def _set_num(self, num):
|
72
69
|
self._num = num
|
@@ -75,41 +72,41 @@ class VFor(Component, Generic[_T]):
|
|
75
72
|
self._transition_group_setting = {"name": name, "tag": tag}
|
76
73
|
return self
|
77
74
|
|
78
|
-
@property
|
79
|
-
def current(self):
|
80
|
-
return VForItem(self)
|
81
|
-
|
82
|
-
def with_index(self):
|
83
|
-
return VForWithIndex(self)
|
84
|
-
|
85
75
|
def _to_json_dict(self):
|
86
76
|
data = super()._to_json_dict()
|
87
|
-
data["props"] = {"fid": self._fid}
|
88
77
|
|
89
|
-
props: Dict = data["props"]
|
90
78
|
if self._key is not None and self._key != "index":
|
91
|
-
|
92
|
-
|
93
|
-
if self._data is not None:
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
79
|
+
data["fkey"] = self._key
|
80
|
+
|
81
|
+
if self._data is not None or self._num is not None:
|
82
|
+
array_type = (
|
83
|
+
VForArrayTypeEnum.REF
|
84
|
+
if isinstance(self._data, ElementBindingMixin)
|
85
|
+
else VForArrayTypeEnum.RANGE
|
86
|
+
if self._num is not None
|
87
|
+
else VForArrayTypeEnum.CONST
|
88
|
+
)
|
89
|
+
|
90
|
+
array_value = (
|
91
|
+
self._data._to_element_binding_config()
|
92
|
+
if isinstance(self._data, ElementBindingMixin)
|
93
|
+
else self._num
|
94
|
+
if self._num is not None
|
95
|
+
else self._data
|
96
|
+
)
|
97
|
+
|
98
|
+
data["array"] = {"type": array_type, "value": array_value}
|
101
99
|
|
102
100
|
if self._transition_group_setting is not None:
|
103
|
-
|
101
|
+
data["tsGroup"] = {
|
104
102
|
k: v for k, v in self._transition_group_setting.items() if v is not None
|
105
103
|
}
|
106
104
|
|
107
|
-
props["scopeId"] = self.__scope.id # type: ignore
|
108
|
-
|
109
105
|
if self._slot_manager.has_slot():
|
110
|
-
|
111
|
-
|
112
|
-
|
106
|
+
slot_data = self._slot_manager.get_slot(
|
107
|
+
"default"
|
108
|
+
)._to_items_container_config()
|
109
|
+
data.update(slot_data)
|
113
110
|
|
114
111
|
return data
|
115
112
|
|
@@ -135,8 +132,6 @@ class VFor(Component, Generic[_T]):
|
|
135
132
|
|
136
133
|
return obj # type: ignore
|
137
134
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
):
|
142
|
-
return VForDict(VFor(data)) # type: ignore
|
135
|
+
|
136
|
+
def iter_info(item: _T) -> VForItem[_T]:
|
137
|
+
return cast(VForItem[_T], item)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
from typing import cast
|
3
|
+
from instaui.components.component import Component
|
4
|
+
from instaui.vars.mixin_types.element_binding import ElementBindingMixin
|
5
|
+
from instaui.vars.types import TMaybeRef
|
6
|
+
|
7
|
+
|
8
|
+
class VIf(Component):
|
9
|
+
def __init__(self, on: TMaybeRef[bool]):
|
10
|
+
super().__init__("vif")
|
11
|
+
self._on = cast(ElementBindingMixin, on)
|
12
|
+
|
13
|
+
def _to_json_dict(self):
|
14
|
+
data = super()._to_json_dict()
|
15
|
+
|
16
|
+
data["on"] = (
|
17
|
+
self._on
|
18
|
+
if isinstance(self._on, bool)
|
19
|
+
else self._on._to_element_binding_config()
|
20
|
+
)
|
21
|
+
|
22
|
+
if self._slot_manager.has_slot():
|
23
|
+
slot_data = self._slot_manager.get_slot(
|
24
|
+
"default"
|
25
|
+
)._to_items_container_config()
|
26
|
+
data.update(slot_data)
|
27
|
+
|
28
|
+
return data
|
@@ -1,5 +1,10 @@
|
|
1
1
|
import typing
|
2
|
-
from instaui.vars.mixin_types.py_binding import
|
2
|
+
from instaui.vars.mixin_types.py_binding import (
|
3
|
+
CanInputMixin,
|
4
|
+
CanOutputMixin,
|
5
|
+
inputs_to_config,
|
6
|
+
outputs_to_config,
|
7
|
+
)
|
3
8
|
from instaui.common.jsonable import Jsonable
|
4
9
|
from .event_mixin import EventMixin
|
5
10
|
|
@@ -16,11 +21,8 @@ class JsEvent(Jsonable, EventMixin):
|
|
16
21
|
]
|
17
22
|
self._org_inputs = list(inputs or [])
|
18
23
|
self._org_outputs = list(outputs or [])
|
19
|
-
self._inputs = [
|
20
|
-
|
21
|
-
for input in inputs or []
|
22
|
-
]
|
23
|
-
self._outputs = [output._to_output_config() for output in outputs or []]
|
24
|
+
self._inputs = inputs or []
|
25
|
+
self._outputs = outputs or []
|
24
26
|
self.code = code
|
25
27
|
|
26
28
|
def _to_json_dict(self):
|
@@ -28,10 +30,10 @@ class JsEvent(Jsonable, EventMixin):
|
|
28
30
|
data["type"] = self.event_type()
|
29
31
|
|
30
32
|
if self._inputs:
|
31
|
-
data["inputs"] = self._inputs
|
33
|
+
data["inputs"] = inputs_to_config(self._inputs)
|
32
34
|
|
33
35
|
if self._outputs:
|
34
|
-
data["
|
36
|
+
data["sets"] = outputs_to_config(self._outputs)
|
35
37
|
|
36
38
|
if sum(self._is_const_data) > 0:
|
37
39
|
data["data"] = self._is_const_data
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import typing
|
2
2
|
from instaui.common.jsonable import Jsonable
|
3
|
-
from instaui.vars.mixin_types.
|
3
|
+
from instaui.vars.mixin_types.py_binding import CanInputMixin
|
4
|
+
from instaui.vars._types import InputBindingType
|
4
5
|
from .event_mixin import EventMixin
|
5
6
|
|
6
7
|
|
@@ -36,21 +37,6 @@ class VueEvent(Jsonable, EventMixin):
|
|
36
37
|
self.code = code
|
37
38
|
self._bindings = bindings
|
38
39
|
|
39
|
-
if bindings:
|
40
|
-
bindData = [
|
41
|
-
int(not isinstance(v, ObservableMixin)) for v in bindings.values()
|
42
|
-
]
|
43
|
-
|
44
|
-
if sum(bindData) > 0:
|
45
|
-
self.bindData = bindData
|
46
|
-
|
47
|
-
self.bind = {
|
48
|
-
k: typing.cast(ObservableMixin, v)._to_observable_config()
|
49
|
-
if isinstance(v, ObservableMixin)
|
50
|
-
else v
|
51
|
-
for k, v in bindings.items()
|
52
|
-
}
|
53
|
-
|
54
40
|
def copy_with_extends(self, extends: typing.Dict):
|
55
41
|
raise NotImplementedError("VueEvent does not support extends")
|
56
42
|
|
@@ -60,6 +46,18 @@ class VueEvent(Jsonable, EventMixin):
|
|
60
46
|
def _to_json_dict(self):
|
61
47
|
data = super()._to_json_dict()
|
62
48
|
data["type"] = self.event_type()
|
49
|
+
if self._bindings:
|
50
|
+
data["inputs"] = {
|
51
|
+
name: {
|
52
|
+
"value": v._to_input_config()
|
53
|
+
if isinstance(v, CanInputMixin)
|
54
|
+
else v,
|
55
|
+
"type": v._to_event_input_type().value
|
56
|
+
if isinstance(v, CanInputMixin)
|
57
|
+
else InputBindingType.Data,
|
58
|
+
}
|
59
|
+
for name, v in self._bindings.items()
|
60
|
+
}
|
63
61
|
return data
|
64
62
|
|
65
63
|
|
@@ -7,6 +7,8 @@ from instaui.vars.mixin_types.py_binding import (
|
|
7
7
|
CanInputMixin,
|
8
8
|
CanOutputMixin,
|
9
9
|
_assert_outputs_be_can_output_mixin,
|
10
|
+
inputs_to_config,
|
11
|
+
outputs_to_config,
|
10
12
|
)
|
11
13
|
from instaui.handlers import event_handler
|
12
14
|
from instaui import pre_setup as _pre_setup
|
@@ -74,15 +76,10 @@ class WebEvent(Jsonable, EventMixin, typing.Generic[P, R]):
|
|
74
76
|
data["sid"] = self._sid
|
75
77
|
|
76
78
|
if self._inputs:
|
77
|
-
data["
|
78
|
-
binding._to_input_config()
|
79
|
-
if isinstance(binding, CanInputMixin)
|
80
|
-
else binding
|
81
|
-
for binding in self._inputs
|
82
|
-
]
|
79
|
+
data["inputs"] = inputs_to_config(self._inputs)
|
83
80
|
|
84
81
|
if self._outputs:
|
85
|
-
data["
|
82
|
+
data["sets"] = outputs_to_config(self._outputs)
|
86
83
|
|
87
84
|
if self._pre_setup:
|
88
85
|
data["preSetup"] = _pre_setup.convert_config(self._pre_setup)
|
@@ -87,8 +87,14 @@ def add_vue_app_use(name: str):
|
|
87
87
|
|
88
88
|
|
89
89
|
def to_config_data() -> Dict:
|
90
|
-
|
90
|
+
app = get_app_slot()
|
91
|
+
data = dumps2dict(app)
|
92
|
+
|
93
|
+
# Exclude scopes that contain only the id field.
|
94
|
+
scopes = [s for s in dumps2dict(app._scopes) if len(s) > 1]
|
95
|
+
data["scopes"] = scopes
|
96
|
+
return data
|
91
97
|
|
92
98
|
|
93
99
|
def to_json(indent=False):
|
94
|
-
return dumps(
|
100
|
+
return dumps(to_config_data(), indent=indent)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from instaui.common.jsonable import Jsonable
|
2
|
+
from instaui.vars._types import InputBindingType
|
2
3
|
from instaui.vars.mixin_types.py_binding import CanInputMixin
|
3
|
-
from instaui.runtime._app import get_app_slot
|
4
|
+
from instaui.runtime._app import get_app_slot, get_current_scope
|
4
5
|
|
5
6
|
|
6
7
|
class JsFn(Jsonable, CanInputMixin):
|
@@ -21,26 +22,28 @@ class JsFn(Jsonable, CanInputMixin):
|
|
21
22
|
ui.label(result)
|
22
23
|
"""
|
23
24
|
|
24
|
-
def __init__(self, code: str, *, execute_immediately=False):
|
25
|
+
def __init__(self, code: str, *, execute_immediately=False, global_scope=False):
|
25
26
|
self.code = code
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
|
28
|
+
scope = get_app_slot().top_scope if global_scope else get_current_scope()
|
29
|
+
self.__register_info = scope.register_js_fn_task(self)
|
30
|
+
|
30
31
|
self._execute_immediately = execute_immediately
|
31
32
|
|
32
33
|
def _to_input_config(self):
|
33
34
|
return {
|
34
|
-
"
|
35
|
-
"id": self.
|
35
|
+
"sid": self.__register_info.scope_id,
|
36
|
+
"id": self.__register_info.var_id,
|
36
37
|
}
|
37
38
|
|
38
39
|
def _to_json_dict(self):
|
39
40
|
data = super()._to_json_dict()
|
40
|
-
data["
|
41
|
-
data["id"] = self.__id
|
41
|
+
data["id"] = self.__register_info.var_id
|
42
42
|
|
43
43
|
if self._execute_immediately is True:
|
44
44
|
data["immediately"] = 1
|
45
45
|
|
46
46
|
return data
|
47
|
+
|
48
|
+
def _to_event_input_type(self) -> InputBindingType:
|
49
|
+
return InputBindingType.JsFn
|
@@ -6,7 +6,7 @@ from ._app import (
|
|
6
6
|
get_slot_stacks,
|
7
7
|
pop_slot,
|
8
8
|
get_current_scope,
|
9
|
-
|
9
|
+
ready_scope,
|
10
10
|
check_default_app_slot_or_error,
|
11
11
|
in_default_app_slot,
|
12
12
|
)
|
@@ -15,7 +15,7 @@ from .resource import HtmlResource
|
|
15
15
|
|
16
16
|
__all__ = [
|
17
17
|
"get_slot_stacks",
|
18
|
-
"
|
18
|
+
"ready_scope",
|
19
19
|
"get_current_scope",
|
20
20
|
"get_app_slot",
|
21
21
|
"reset_app_slot",
|