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.

Files changed (181) hide show
  1. {reflex-0.2.5a1 → reflex-0.2.6}/PKG-INFO +2 -1
  2. {reflex-0.2.5a1 → reflex-0.2.6}/pyproject.toml +2 -1
  3. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/index.js.jinja2 +0 -6
  4. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/compiler/utils.py +0 -5
  5. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/datatable.py +2 -2
  6. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/editable.py +25 -0
  7. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/input.py +6 -2
  8. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/slider.py +3 -0
  9. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/textarea.py +6 -2
  10. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/model.py +3 -6
  11. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/vars.py +11 -2
  12. {reflex-0.2.5a1 → reflex-0.2.6}/LICENSE +0 -0
  13. {reflex-0.2.5a1 → reflex-0.2.6}/README.md +0 -0
  14. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/apps/counter/__init__.py +0 -0
  15. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/apps/counter/counter.py +0 -0
  16. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/apps/default/__init__.py +0 -0
  17. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/apps/default/default.py +0 -0
  18. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/assets/favicon.ico +0 -0
  19. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/app/rxconfig.py.jinja2 +0 -0
  20. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/_document.js.jinja2 +0 -0
  21. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/base_page.js.jinja2 +0 -0
  22. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/custom_component.js.jinja2 +0 -0
  23. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/pages/utils.js.jinja2 +0 -0
  24. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/tailwind.config.js.jinja2 +0 -0
  25. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/utils/context.js.jinja2 +0 -0
  26. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/jinja/web/utils/theme.js.jinja2 +0 -0
  27. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/.gitignore +0 -0
  28. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/bun.lockb +0 -0
  29. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/jsconfig.json +0 -0
  30. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/next.config.js +0 -0
  31. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/package.json +0 -0
  32. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/pages/404.js +0 -0
  33. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/pages/_app.js +0 -0
  34. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/postcss.config.js +0 -0
  35. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/styles/code/prism.js +0 -0
  36. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/styles/tailwind.css +0 -0
  37. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/.templates/web/utils/state.js +0 -0
  38. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/__init__.py +0 -0
  39. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/__main__.py +0 -0
  40. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/admin.py +0 -0
  41. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/app.py +0 -0
  42. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/base.py +0 -0
  43. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/compiler/__init__.py +0 -0
  44. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/compiler/compiler.py +0 -0
  45. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/compiler/templates.py +0 -0
  46. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/__init__.py +0 -0
  47. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/__init__.py +0 -0
  48. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/bare.py +0 -0
  49. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/body.py +0 -0
  50. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/document.py +0 -0
  51. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/head.py +0 -0
  52. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/link.py +0 -0
  53. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/meta.py +0 -0
  54. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/base/script.py +0 -0
  55. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/component.py +0 -0
  56. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/__init__.py +0 -0
  57. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/badge.py +0 -0
  58. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/code.py +0 -0
  59. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/divider.py +0 -0
  60. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/keyboard_key.py +0 -0
  61. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/list.py +0 -0
  62. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/stat.py +0 -0
  63. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/table.py +0 -0
  64. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/datadisplay/tag.py +0 -0
  65. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/__init__.py +0 -0
  66. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/accordion.py +0 -0
  67. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/tabs.py +0 -0
  68. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/transition.py +0 -0
  69. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/disclosure/visuallyhidden.py +0 -0
  70. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/__init__.py +0 -0
  71. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/alert.py +0 -0
  72. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/circularprogress.py +0 -0
  73. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/progress.py +0 -0
  74. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/skeleton.py +0 -0
  75. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/feedback/spinner.py +0 -0
  76. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/__init__.py +0 -0
  77. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/button.py +0 -0
  78. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/checkbox.py +0 -0
  79. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/colormodeswitch.py +0 -0
  80. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/copytoclipboard.py +0 -0
  81. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/date_picker.py +0 -0
  82. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/date_time_picker.py +0 -0
  83. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/debounce.py +0 -0
  84. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/email.py +0 -0
  85. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/form.py +0 -0
  86. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/iconbutton.py +0 -0
  87. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/multiselect.py +0 -0
  88. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/numberinput.py +0 -0
  89. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/password.py +0 -0
  90. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/pininput.py +0 -0
  91. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/radio.py +0 -0
  92. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/rangeslider.py +0 -0
  93. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/select.py +0 -0
  94. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/switch.py +0 -0
  95. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/forms/upload.py +0 -0
  96. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/graphing/__init__.py +0 -0
  97. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/graphing/plotly.py +0 -0
  98. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/graphing/victory.py +0 -0
  99. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/__init__.py +0 -0
  100. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/aspect_ratio.py +0 -0
  101. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/box.py +0 -0
  102. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/card.py +0 -0
  103. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/center.py +0 -0
  104. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/cond.py +0 -0
  105. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/container.py +0 -0
  106. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/flex.py +0 -0
  107. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/foreach.py +0 -0
  108. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/fragment.py +0 -0
  109. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/grid.py +0 -0
  110. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/html.py +0 -0
  111. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/responsive.py +0 -0
  112. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/spacer.py +0 -0
  113. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/stack.py +0 -0
  114. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/layout/wrap.py +0 -0
  115. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/libs/__init__.py +0 -0
  116. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/libs/chakra.py +0 -0
  117. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/libs/react_player.py +0 -0
  118. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/__init__.py +0 -0
  119. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/audio.py +0 -0
  120. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/avatar.py +0 -0
  121. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/icon.py +0 -0
  122. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/image.py +0 -0
  123. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/media/video.py +0 -0
  124. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/__init__.py +0 -0
  125. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/breadcrumb.py +0 -0
  126. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/link.py +0 -0
  127. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/linkoverlay.py +0 -0
  128. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/nextlink.py +0 -0
  129. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/navigation/stepper.py +0 -0
  130. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/__init__.py +0 -0
  131. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/alertdialog.py +0 -0
  132. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/banner.py +0 -0
  133. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/drawer.py +0 -0
  134. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/menu.py +0 -0
  135. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/modal.py +0 -0
  136. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/popover.py +0 -0
  137. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/overlay/tooltip.py +0 -0
  138. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/__init__.py +0 -0
  139. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/cond_tag.py +0 -0
  140. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/iter_tag.py +0 -0
  141. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/tag.py +0 -0
  142. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/tags/tagless.py +0 -0
  143. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/__init__.py +0 -0
  144. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/heading.py +0 -0
  145. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/highlight.py +0 -0
  146. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/markdown.py +0 -0
  147. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/span.py +0 -0
  148. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/components/typography/text.py +0 -0
  149. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/config.py +0 -0
  150. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/constants.py +0 -0
  151. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/__init__.py +0 -0
  152. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/constants/__init__.py +0 -0
  153. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/constants/html.py +0 -0
  154. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/constants/react.py +0 -0
  155. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/constants/reflex.py +0 -0
  156. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/element.py +0 -0
  157. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/elements/__init__.py +0 -0
  158. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/el/precompile.py +0 -0
  159. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/event.py +0 -0
  160. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/middleware/__init__.py +0 -0
  161. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/middleware/hydrate_middleware.py +0 -0
  162. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/middleware/middleware.py +0 -0
  163. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/page.py +0 -0
  164. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/py.typed +0 -0
  165. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/reflex.py +0 -0
  166. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/route.py +0 -0
  167. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/state.py +0 -0
  168. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/style.py +0 -0
  169. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/testing.py +0 -0
  170. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/__init__.py +0 -0
  171. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/build.py +0 -0
  172. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/console.py +0 -0
  173. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/exec.py +0 -0
  174. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/format.py +0 -0
  175. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/imports.py +0 -0
  176. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/path_ops.py +0 -0
  177. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/prerequisites.py +0 -0
  178. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/processes.py +0 -0
  179. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/telemetry.py +0 -0
  180. {reflex-0.2.5a1 → reflex-0.2.6}/reflex/utils/types.py +0 -0
  181. {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.5a1
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.5a1"
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 isinstance(props.get("value"), Var) and props.get("on_change"):
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=0
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 isinstance(props.get("value"), Var) and props.get("on_change"):
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=0
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
- return sqlmodel.create_engine(
47
- url,
48
- echo=echo_db_query,
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
- setattr(state, self.name, value)
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
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