flet 0.70.0.dev5774__py3-none-any.whl → 0.70.0.dev5835__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.
Potentially problematic release.
This version of flet might be problematic. Click here for more details.
- flet/__init__.py +32 -4
- flet/components/__init__.py +0 -0
- flet/components/component.py +346 -0
- flet/components/component_decorator.py +24 -0
- flet/components/component_owned.py +22 -0
- flet/components/hooks/__init__.py +0 -0
- flet/components/hooks/hook.py +12 -0
- flet/components/hooks/use_callback.py +28 -0
- flet/components/hooks/use_context.py +91 -0
- flet/components/hooks/use_effect.py +104 -0
- flet/components/hooks/use_memo.py +52 -0
- flet/components/hooks/use_state.py +58 -0
- flet/components/memo.py +34 -0
- flet/components/observable.py +269 -0
- flet/components/public_utils.py +10 -0
- flet/components/utils.py +85 -0
- flet/controls/base_control.py +34 -10
- flet/controls/base_page.py +44 -40
- flet/controls/context.py +22 -1
- flet/controls/control.py +12 -6
- flet/controls/control_event.py +19 -2
- flet/controls/core/animated_switcher.py +3 -2
- flet/controls/core/autofill_group.py +6 -2
- flet/controls/core/column.py +5 -0
- flet/controls/core/dismissible.py +12 -10
- flet/controls/core/drag_target.py +20 -10
- flet/controls/core/draggable.py +9 -9
- flet/controls/core/icon.py +16 -12
- flet/controls/core/interactive_viewer.py +24 -23
- flet/controls/core/pagelet.py +3 -2
- flet/controls/core/reorderable_draggable.py +3 -2
- flet/controls/core/row.py +5 -0
- flet/controls/core/safe_area.py +3 -2
- flet/controls/core/text_span.py +5 -3
- flet/controls/core/view.py +6 -6
- flet/controls/core/window_drag_area.py +3 -2
- flet/controls/cupertino/cupertino_action_sheet.py +10 -5
- flet/controls/cupertino/cupertino_action_sheet_action.py +3 -4
- flet/controls/cupertino/cupertino_activity_indicator.py +4 -3
- flet/controls/cupertino/cupertino_alert_dialog.py +6 -3
- flet/controls/cupertino/cupertino_button.py +6 -5
- flet/controls/cupertino/cupertino_context_menu.py +8 -4
- flet/controls/cupertino/cupertino_context_menu_action.py +3 -4
- flet/controls/cupertino/cupertino_date_picker.py +44 -28
- flet/controls/cupertino/cupertino_dialog_action.py +3 -4
- flet/controls/cupertino/cupertino_list_tile.py +3 -4
- flet/controls/cupertino/cupertino_navigation_bar.py +6 -5
- flet/controls/cupertino/cupertino_picker.py +14 -10
- flet/controls/cupertino/cupertino_segmented_button.py +6 -5
- flet/controls/cupertino/cupertino_slider.py +16 -12
- flet/controls/cupertino/cupertino_sliding_segmented_button.py +6 -5
- flet/controls/cupertino/cupertino_timer_picker.py +38 -31
- flet/controls/id_counter.py +24 -0
- flet/controls/material/alert_dialog.py +6 -5
- flet/controls/material/app_bar.py +17 -14
- flet/controls/material/banner.py +13 -11
- flet/controls/material/bottom_app_bar.py +5 -4
- flet/controls/material/bottom_sheet.py +5 -4
- flet/controls/material/button.py +12 -4
- flet/controls/material/chip.py +13 -12
- flet/controls/material/circle_avatar.py +17 -13
- flet/controls/material/datatable.py +48 -41
- flet/controls/material/divider.py +30 -14
- flet/controls/material/dropdown.py +5 -3
- flet/controls/material/expansion_tile.py +11 -22
- flet/controls/material/floating_action_button.py +32 -23
- flet/controls/material/icon_button.py +7 -3
- flet/controls/material/navigation_rail.py +14 -11
- flet/controls/material/outlined_button.py +7 -3
- flet/controls/material/progress_bar.py +18 -10
- flet/controls/material/radio_group.py +5 -1
- flet/controls/material/range_slider.py +13 -13
- flet/controls/material/segmented_button.py +21 -17
- flet/controls/material/selection_area.py +3 -2
- flet/controls/material/slider.py +16 -12
- flet/controls/material/snack_bar.py +18 -10
- flet/controls/material/switch.py +6 -5
- flet/controls/material/tabs.py +18 -14
- flet/controls/material/textfield.py +32 -15
- flet/controls/material/vertical_divider.py +20 -12
- flet/controls/object_patch.py +434 -197
- flet/controls/page.py +205 -85
- flet/controls/services/haptic_feedback.py +0 -3
- flet/controls/services/shake_detector.py +0 -3
- flet/messaging/flet_socket_server.py +13 -6
- flet/messaging/session.py +103 -10
- flet/{controls/session_storage.py → messaging/session_store.py} +2 -2
- flet/version.py +1 -1
- {flet-0.70.0.dev5774.dist-info → flet-0.70.0.dev5835.dist-info}/METADATA +5 -5
- {flet-0.70.0.dev5774.dist-info → flet-0.70.0.dev5835.dist-info}/RECORD +93 -80
- flet/controls/cache.py +0 -87
- flet/controls/control_id.py +0 -22
- flet/controls/core/state_view.py +0 -60
- {flet-0.70.0.dev5774.dist-info → flet-0.70.0.dev5835.dist-info}/WHEEL +0 -0
- {flet-0.70.0.dev5774.dist-info → flet-0.70.0.dev5835.dist-info}/entry_points.txt +0 -0
- {flet-0.70.0.dev5774.dist-info → flet-0.70.0.dev5835.dist-info}/top_level.txt +0 -0
|
@@ -3,7 +3,7 @@ from enum import Enum
|
|
|
3
3
|
from typing import Optional, Union
|
|
4
4
|
|
|
5
5
|
from flet.controls.adaptive_control import AdaptiveControl
|
|
6
|
-
from flet.controls.base_control import control
|
|
6
|
+
from flet.controls.base_control import BaseControl, control
|
|
7
7
|
from flet.controls.control_event import ControlEventHandler
|
|
8
8
|
from flet.controls.core.autofill_group import AutofillHint
|
|
9
9
|
from flet.controls.material.form_field_control import FormFieldControl
|
|
@@ -133,6 +133,12 @@ class TextField(FormFieldControl, AdaptiveControl):
|
|
|
133
133
|
"""
|
|
134
134
|
A text field lets the user enter text, either with hardware keyboard or with an
|
|
135
135
|
onscreen keyboard.
|
|
136
|
+
|
|
137
|
+
Raises:
|
|
138
|
+
ValueError: If [`min_lines`][(c).] is not positive.
|
|
139
|
+
ValueError: If [`max_lines`][(c).] is not positive.
|
|
140
|
+
ValueError: If [`min_lines`][(c).] is greater than [`max_lines`][(c).].
|
|
141
|
+
ValueError: If [`max_length`][(c).] is not -1 or positive.
|
|
136
142
|
"""
|
|
137
143
|
|
|
138
144
|
value: str = ""
|
|
@@ -418,22 +424,33 @@ class TextField(FormFieldControl, AdaptiveControl):
|
|
|
418
424
|
TBD
|
|
419
425
|
"""
|
|
420
426
|
|
|
427
|
+
def _migrate_state(self, other: BaseControl):
|
|
428
|
+
super()._migrate_state(other)
|
|
429
|
+
if (
|
|
430
|
+
isinstance(other, TextField)
|
|
431
|
+
and self.value is None
|
|
432
|
+
and self.value != other.value
|
|
433
|
+
):
|
|
434
|
+
self.value = other.value
|
|
435
|
+
|
|
421
436
|
def before_update(self):
|
|
422
437
|
super().before_update()
|
|
423
|
-
|
|
424
|
-
"min_lines must be greater than 0"
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
self.
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
438
|
+
if self.min_lines is not None and self.min_lines <= 0:
|
|
439
|
+
raise ValueError("min_lines must be greater than 0")
|
|
440
|
+
if self.max_lines is not None and self.max_lines <= 0:
|
|
441
|
+
raise ValueError("max_lines must be greater than 0")
|
|
442
|
+
if (
|
|
443
|
+
self.max_lines is not None
|
|
444
|
+
and self.min_lines is not None
|
|
445
|
+
and self.min_lines > self.max_lines
|
|
446
|
+
):
|
|
447
|
+
raise ValueError("min_lines can't be greater than max_lines")
|
|
448
|
+
if (
|
|
449
|
+
self.max_length is not None
|
|
450
|
+
and self.max_length != -1
|
|
451
|
+
and self.max_length <= 0
|
|
452
|
+
):
|
|
453
|
+
raise ValueError("max_length must be either equal to -1 or greater than 0")
|
|
437
454
|
if (
|
|
438
455
|
self.bgcolor is not None
|
|
439
456
|
or self.fill_color is not None
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
|
|
3
3
|
from flet.controls.base_control import control
|
|
4
|
+
from flet.controls.border_radius import BorderRadiusValue
|
|
4
5
|
from flet.controls.control import Control
|
|
5
6
|
from flet.controls.types import ColorValue, Number
|
|
6
7
|
|
|
@@ -13,6 +14,12 @@ class VerticalDivider(Control):
|
|
|
13
14
|
A thin vertical line, with padding on either side.
|
|
14
15
|
|
|
15
16
|
In the material design language, this represents a divider.
|
|
17
|
+
|
|
18
|
+
Raises:
|
|
19
|
+
ValueError: If [`width`][(c).] is negative.
|
|
20
|
+
ValueError: If [`thickness`][(c).] is negative.
|
|
21
|
+
ValueError: If [`leading_indent`][(c).] is negative.
|
|
22
|
+
ValueError: If [`trailing_indent`][(c).] is negative.
|
|
16
23
|
"""
|
|
17
24
|
|
|
18
25
|
width: Optional[Number] = None
|
|
@@ -61,17 +68,18 @@ class VerticalDivider(Control):
|
|
|
61
68
|
If that's is also `None`, defaults to `0.0`.
|
|
62
69
|
"""
|
|
63
70
|
|
|
71
|
+
radius: Optional[BorderRadiusValue] = None
|
|
72
|
+
"""
|
|
73
|
+
The border radius of the divider.
|
|
74
|
+
"""
|
|
75
|
+
|
|
64
76
|
def before_update(self):
|
|
65
77
|
super().before_update()
|
|
66
|
-
|
|
67
|
-
"width must be greater than or equal to 0"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
)
|
|
75
|
-
assert self.trailing_indent is None or self.trailing_indent >= 0, (
|
|
76
|
-
"trailing_indent must be greater than or equal to 0"
|
|
77
|
-
)
|
|
78
|
+
if self.width is not None and self.width < 0:
|
|
79
|
+
raise ValueError("width must be greater than or equal to 0")
|
|
80
|
+
if self.thickness is not None and self.thickness < 0:
|
|
81
|
+
raise ValueError("thickness must be greater than or equal to 0")
|
|
82
|
+
if self.leading_indent is not None and self.leading_indent < 0:
|
|
83
|
+
raise ValueError("leading_indent must be greater than or equal to 0")
|
|
84
|
+
if self.trailing_indent is not None and self.trailing_indent < 0:
|
|
85
|
+
raise ValueError("trailing_indent must be greater than or equal to 0")
|