reflex 0.2.5a1__tar.gz → 0.2.6__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.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- {reflex-0.2.5a1 → reflex-0.2.6}/PKG-INFO +2 -1
- {reflex-0.2.5a1 → reflex-0.2.6}/pyproject.toml +2 -1
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/index.js.jinja2 +0 -6
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/compiler/utils.py +0 -5
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/datatable.py +2 -2
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/editable.py +25 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/input.py +6 -2
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/slider.py +3 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/textarea.py +6 -2
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/model.py +3 -6
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/vars.py +11 -2
- {reflex-0.2.5a1 → reflex-0.2.6}/LICENSE +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/README.md +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/apps/counter/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/apps/counter/counter.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/apps/default/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/apps/default/default.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/assets/favicon.ico +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/app/rxconfig.py.jinja2 +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/_document.js.jinja2 +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/base_page.js.jinja2 +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/custom_component.js.jinja2 +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/utils.js.jinja2 +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/tailwind.config.js.jinja2 +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/utils/context.js.jinja2 +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/utils/theme.js.jinja2 +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/.gitignore +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/bun.lockb +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/jsconfig.json +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/next.config.js +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/package.json +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/pages/404.js +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/pages/_app.js +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/postcss.config.js +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/styles/code/prism.js +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/styles/tailwind.css +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/utils/state.js +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/__main__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/admin.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/app.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/base.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/compiler/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/compiler/compiler.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/compiler/templates.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/bare.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/body.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/document.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/head.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/link.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/meta.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/script.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/component.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/badge.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/code.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/divider.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/keyboard_key.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/list.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/stat.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/table.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/tag.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/accordion.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/tabs.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/transition.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/visuallyhidden.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/alert.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/circularprogress.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/progress.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/skeleton.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/spinner.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/button.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/checkbox.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/colormodeswitch.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/copytoclipboard.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/date_picker.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/date_time_picker.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/debounce.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/email.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/form.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/iconbutton.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/multiselect.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/numberinput.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/password.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/pininput.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/radio.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/rangeslider.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/select.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/switch.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/upload.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/graphing/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/graphing/plotly.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/graphing/victory.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/aspect_ratio.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/box.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/card.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/center.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/cond.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/container.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/flex.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/foreach.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/fragment.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/grid.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/html.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/responsive.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/spacer.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/stack.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/wrap.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/libs/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/libs/chakra.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/libs/react_player.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/audio.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/avatar.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/icon.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/image.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/video.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/breadcrumb.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/link.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/linkoverlay.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/nextlink.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/stepper.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/alertdialog.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/banner.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/drawer.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/menu.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/modal.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/popover.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/tooltip.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/cond_tag.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/iter_tag.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/tag.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/tagless.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/heading.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/highlight.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/markdown.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/span.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/text.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/config.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/constants.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/constants/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/constants/html.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/constants/react.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/constants/reflex.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/element.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/elements/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/precompile.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/event.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/middleware/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/middleware/hydrate_middleware.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/middleware/middleware.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/page.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/py.typed +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/reflex.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/route.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/state.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/style.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/testing.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/__init__.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/build.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/console.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/exec.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/format.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/imports.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/path_ops.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/prerequisites.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/processes.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/telemetry.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/types.py +0 -0
- {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/watch.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: reflex
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Web apps in pure Python.
|
|
5
5
|
Home-page: https://reflex.dev
|
|
6
6
|
License: Apache-2.0
|
|
@@ -28,6 +28,7 @@ Requires-Dist: platformdirs (>=3.10.0,<4.0.0)
|
|
|
28
28
|
Requires-Dist: plotly (>=5.13.0,<6.0.0)
|
|
29
29
|
Requires-Dist: psutil (>=5.9.4,<6.0.0)
|
|
30
30
|
Requires-Dist: pydantic (>=1.10.2,<2.0.0)
|
|
31
|
+
Requires-Dist: python-engineio (!=4.6.0)
|
|
31
32
|
Requires-Dist: python-multipart (>=0.0.5,<0.0.6)
|
|
32
33
|
Requires-Dist: python-socketio (>=5.7.0,<6.0.0)
|
|
33
34
|
Requires-Dist: redis (>=4.3.5,<5.0.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "reflex"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.6"
|
|
4
4
|
description = "Web apps in pure Python."
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
authors = [
|
|
@@ -47,6 +47,7 @@ importlib-metadata = {version = "^6.7.0", python = ">=3.7, <3.8"}
|
|
|
47
47
|
alembic = "^1.11.1"
|
|
48
48
|
platformdirs = "^3.10.0"
|
|
49
49
|
distro = {version = "^1.8.0", platform = "linux"}
|
|
50
|
+
python-engineio = "!=4.6.0"
|
|
50
51
|
|
|
51
52
|
[tool.poetry.group.dev.dependencies]
|
|
52
53
|
pytest = "^7.1.2"
|
|
@@ -13,12 +13,6 @@ export default function Component() {
|
|
|
13
13
|
const { {{const.color_mode}}, {{const.toggle_color_mode}} } = {{const.use_color_mode}}()
|
|
14
14
|
const focusRef = useRef();
|
|
15
15
|
|
|
16
|
-
// Function to add new files to be uploaded.
|
|
17
|
-
const File = files => {{state_name|react_setter}}(state => ({
|
|
18
|
-
...state,
|
|
19
|
-
files,
|
|
20
|
-
}))
|
|
21
|
-
|
|
22
16
|
// Main event loop.
|
|
23
17
|
const [Event, notConnected] = useContext(EventLoopContext)
|
|
24
18
|
|
|
@@ -126,11 +126,6 @@ def compile_state(state: Type[State]) -> Dict:
|
|
|
126
126
|
initial_state = state().dict()
|
|
127
127
|
except Exception:
|
|
128
128
|
initial_state = state().dict(include_computed=False)
|
|
129
|
-
initial_state.update(
|
|
130
|
-
{
|
|
131
|
-
"files": [],
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
129
|
return format.format_state(initial_state)
|
|
135
130
|
|
|
136
131
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Table components."""
|
|
2
2
|
|
|
3
|
-
from typing import Any, List
|
|
3
|
+
from typing import Any, Dict, List, Union
|
|
4
4
|
|
|
5
5
|
from reflex.components.component import Component
|
|
6
6
|
from reflex.components.tags import Tag
|
|
@@ -38,7 +38,7 @@ class DataTable(Gridjs):
|
|
|
38
38
|
resizable: Var[bool]
|
|
39
39
|
|
|
40
40
|
# Enable pagination.
|
|
41
|
-
pagination: Var[bool]
|
|
41
|
+
pagination: Var[Union[bool, Dict]]
|
|
42
42
|
|
|
43
43
|
@classmethod
|
|
44
44
|
def create(cls, *children, **props):
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from typing import Dict
|
|
4
4
|
|
|
5
|
+
from reflex.components.component import Component
|
|
6
|
+
from reflex.components.forms.debounce import DebounceInput
|
|
5
7
|
from reflex.components.libs.chakra import ChakraComponent
|
|
6
8
|
from reflex.event import EVENT_ARG
|
|
7
9
|
from reflex.vars import Var
|
|
@@ -36,6 +38,29 @@ class Editable(ChakraComponent):
|
|
|
36
38
|
# The initial value of the Editable in both edit and preview mode.
|
|
37
39
|
default_value: Var[str]
|
|
38
40
|
|
|
41
|
+
@classmethod
|
|
42
|
+
def create(cls, *children, **props) -> Component:
|
|
43
|
+
"""Create an Editable component.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
children: The children of the component.
|
|
47
|
+
props: The properties of the component.
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
The component.
|
|
51
|
+
"""
|
|
52
|
+
if (
|
|
53
|
+
isinstance(props.get("value"), Var) and props.get("on_change")
|
|
54
|
+
) or "debounce_timeout" in props:
|
|
55
|
+
# Create a debounced input if the user requests full control to avoid typing jank
|
|
56
|
+
# Currently default to 50ms, which appears to be a good balance
|
|
57
|
+
debounce_timeout = props.pop("debounce_timeout", 50)
|
|
58
|
+
return DebounceInput.create(
|
|
59
|
+
super().create(*children, **props),
|
|
60
|
+
debounce_timeout=debounce_timeout,
|
|
61
|
+
)
|
|
62
|
+
return super().create(*children, **props)
|
|
63
|
+
|
|
39
64
|
def get_controlled_triggers(self) -> Dict[str, Var]:
|
|
40
65
|
"""Get the event triggers that pass the component's value to the handler.
|
|
41
66
|
|
|
@@ -81,10 +81,14 @@ class Input(ChakraComponent):
|
|
|
81
81
|
Returns:
|
|
82
82
|
The component.
|
|
83
83
|
"""
|
|
84
|
-
if
|
|
84
|
+
if (
|
|
85
|
+
isinstance(props.get("value"), Var) and props.get("on_change")
|
|
86
|
+
) or "debounce_timeout" in props:
|
|
87
|
+
# Currently default to 50ms, which appears to be a good balance
|
|
88
|
+
debounce_timeout = props.pop("debounce_timeout", 50)
|
|
85
89
|
# create a debounced input if the user requests full control to avoid typing jank
|
|
86
90
|
return DebounceInput.create(
|
|
87
|
-
super().create(*children, **props), debounce_timeout=
|
|
91
|
+
super().create(*children, **props), debounce_timeout=debounce_timeout
|
|
88
92
|
)
|
|
89
93
|
return super().create(*children, **props)
|
|
90
94
|
|
|
@@ -43,6 +43,9 @@ class Slider(ChakraComponent):
|
|
|
43
43
|
# The maximum value of the slider.
|
|
44
44
|
max_: Var[int]
|
|
45
45
|
|
|
46
|
+
# The step in which increments/decrements have to be made
|
|
47
|
+
step: Var[int]
|
|
48
|
+
|
|
46
49
|
# The minimum distance between slider thumbs. Useful for preventing the thumbs from being too close together.
|
|
47
50
|
min_steps_between_thumbs: Var[int]
|
|
48
51
|
|
|
@@ -68,9 +68,13 @@ class TextArea(ChakraComponent):
|
|
|
68
68
|
Returns:
|
|
69
69
|
The component.
|
|
70
70
|
"""
|
|
71
|
-
if
|
|
71
|
+
if (
|
|
72
|
+
isinstance(props.get("value"), Var) and props.get("on_change")
|
|
73
|
+
) or "debounce_timeout" in props:
|
|
74
|
+
# Currently default to 50ms, which appears to be a good balance
|
|
75
|
+
debounce_timeout = props.pop("debounce_timeout", 50)
|
|
72
76
|
# create a debounced input if the user requests full control to avoid typing jank
|
|
73
77
|
return DebounceInput.create(
|
|
74
|
-
super().create(*children, **props), debounce_timeout=
|
|
78
|
+
super().create(*children, **props), debounce_timeout=debounce_timeout
|
|
75
79
|
)
|
|
76
80
|
return super().create(*children, **props)
|
|
@@ -43,12 +43,9 @@ def get_engine(url: Optional[str] = None):
|
|
|
43
43
|
)
|
|
44
44
|
# Print the SQL queries if the log level is INFO or lower.
|
|
45
45
|
echo_db_query = os.environ.get("SQLALCHEMY_ECHO") == "True"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# Needed for the admin dash.
|
|
50
|
-
connect_args={"check_same_thread": False},
|
|
51
|
-
)
|
|
46
|
+
# Needed for the admin dash on sqlite.
|
|
47
|
+
connect_args = {"check_same_thread": False} if url.startswith("sqlite") else {}
|
|
48
|
+
return sqlmodel.create_engine(url, echo=echo_db_query, connect_args=connect_args)
|
|
52
49
|
|
|
53
50
|
|
|
54
51
|
class Model(Base, sqlmodel.SQLModel):
|
|
@@ -30,7 +30,7 @@ from pydantic.fields import ModelField
|
|
|
30
30
|
|
|
31
31
|
from reflex import constants
|
|
32
32
|
from reflex.base import Base
|
|
33
|
-
from reflex.utils import format, types
|
|
33
|
+
from reflex.utils import console, format, types
|
|
34
34
|
|
|
35
35
|
if TYPE_CHECKING:
|
|
36
36
|
from reflex.state import State
|
|
@@ -831,7 +831,16 @@ class BaseVar(Var, Base):
|
|
|
831
831
|
state: The state within which we add the setter function.
|
|
832
832
|
value: The value to set.
|
|
833
833
|
"""
|
|
834
|
-
|
|
834
|
+
if self.type_ in [int, float]:
|
|
835
|
+
try:
|
|
836
|
+
value = self.type_(value)
|
|
837
|
+
setattr(state, self.name, value)
|
|
838
|
+
except ValueError:
|
|
839
|
+
console.warn(
|
|
840
|
+
f"{self.name}: Failed conversion of {value} to '{self.type_.__name__}'. Value not set.",
|
|
841
|
+
)
|
|
842
|
+
else:
|
|
843
|
+
setattr(state, self.name, value)
|
|
835
844
|
|
|
836
845
|
setter.__qualname__ = self.get_setter_name()
|
|
837
846
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/custom_component.js.jinja2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|