flet-datatable2 0.1.0.dev1__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 flet-datatable2 might be problematic. Click here for more details.
- flet_datatable2-0.1.0.dev1/PKG-INFO +38 -0
- flet_datatable2-0.1.0.dev1/README.md +25 -0
- flet_datatable2-0.1.0.dev1/pyproject.toml +42 -0
- flet_datatable2-0.1.0.dev1/setup.cfg +4 -0
- flet_datatable2-0.1.0.dev1/src/flet_datatable2/__init__.py +5 -0
- flet_datatable2-0.1.0.dev1/src/flet_datatable2/datacolumn2.py +173 -0
- flet_datatable2-0.1.0.dev1/src/flet_datatable2/datarow2.py +220 -0
- flet_datatable2-0.1.0.dev1/src/flet_datatable2/datatable2.py +864 -0
- flet_datatable2-0.1.0.dev1/src/flet_datatable2.egg-info/PKG-INFO +38 -0
- flet_datatable2-0.1.0.dev1/src/flet_datatable2.egg-info/SOURCES.txt +20 -0
- flet_datatable2-0.1.0.dev1/src/flet_datatable2.egg-info/dependency_links.txt +1 -0
- flet_datatable2-0.1.0.dev1/src/flet_datatable2.egg-info/requires.txt +1 -0
- flet_datatable2-0.1.0.dev1/src/flet_datatable2.egg-info/top_level.txt +2 -0
- flet_datatable2-0.1.0.dev1/src/flutter/flet_datatable2/CHANGELOG.md +3 -0
- flet_datatable2-0.1.0.dev1/src/flutter/flet_datatable2/LICENSE +1 -0
- flet_datatable2-0.1.0.dev1/src/flutter/flet_datatable2/README.md +6 -0
- flet_datatable2-0.1.0.dev1/src/flutter/flet_datatable2/lib/flet_datatable2.dart +3 -0
- flet_datatable2-0.1.0.dev1/src/flutter/flet_datatable2/lib/src/create_control.dart +22 -0
- flet_datatable2-0.1.0.dev1/src/flutter/flet_datatable2/lib/src/data_sources.dart +692 -0
- flet_datatable2-0.1.0.dev1/src/flutter/flet_datatable2/lib/src/datatable2.dart +309 -0
- flet_datatable2-0.1.0.dev1/src/flutter/flet_datatable2/pubspec.lock +751 -0
- flet_datatable2-0.1.0.dev1/src/flutter/flet_datatable2/pubspec.yaml +17 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: flet-datatable2
|
|
3
|
+
Version: 0.1.0.dev1
|
|
4
|
+
Summary: DataTable2 control for Flet
|
|
5
|
+
Author-email: Flet contributors <you@example.com>
|
|
6
|
+
Project-URL: Homepage, https://mydomain.dev
|
|
7
|
+
Project-URL: Documentation, https://github.com/MyGithubAccount/flet-datatable2
|
|
8
|
+
Project-URL: Repository, https://github.com/MyGithubAccount/flet-datatable2
|
|
9
|
+
Project-URL: Issues, https://github.com/MyGithubAccount/flet-datatable2/issues
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: flet>=0.27.3
|
|
13
|
+
|
|
14
|
+
# Flet DataTable2
|
|
15
|
+
|
|
16
|
+
DataTable2 Control for Flet based on [DataTable2 package](https://pub.dev/packages/data_table_2) for Flutter.
|
|
17
|
+
|
|
18
|
+
DataTable2 features fixed/sticky header/top rows and left columns and many other useful features additionally to all the properties of built-in Flet [DataTable](https://flet.dev/docs/controls/datatable).
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
Add dependency to `pyproject.toml` of your Flet app:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
dependencies = [
|
|
26
|
+
"flet-datatable2 @ git+https://github.com/flet-dev/flet_datatable2.git",
|
|
27
|
+
"flet>=0.27.4",
|
|
28
|
+
]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Build your app:
|
|
32
|
+
```
|
|
33
|
+
flet build macos -v
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Documentation
|
|
37
|
+
|
|
38
|
+
https://flet-dev.github.io/flet-datatable2/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Flet DataTable2
|
|
2
|
+
|
|
3
|
+
DataTable2 Control for Flet based on [DataTable2 package](https://pub.dev/packages/data_table_2) for Flutter.
|
|
4
|
+
|
|
5
|
+
DataTable2 features fixed/sticky header/top rows and left columns and many other useful features additionally to all the properties of built-in Flet [DataTable](https://flet.dev/docs/controls/datatable).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add dependency to `pyproject.toml` of your Flet app:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
dependencies = [
|
|
13
|
+
"flet-datatable2 @ git+https://github.com/flet-dev/flet_datatable2.git",
|
|
14
|
+
"flet>=0.27.4",
|
|
15
|
+
]
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Build your app:
|
|
19
|
+
```
|
|
20
|
+
flet build macos -v
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Documentation
|
|
24
|
+
|
|
25
|
+
https://flet-dev.github.io/flet-datatable2/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "flet-datatable2"
|
|
3
|
+
version = "0.1.0.dev1"
|
|
4
|
+
description = "DataTable2 control for Flet"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.9"
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "Flet contributors", email = "you@example.com" }
|
|
9
|
+
]
|
|
10
|
+
dependencies = [
|
|
11
|
+
"flet>=0.27.3",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[project.urls]
|
|
15
|
+
Homepage = "https://mydomain.dev"
|
|
16
|
+
Documentation = "https://github.com/MyGithubAccount/flet-datatable2"
|
|
17
|
+
Repository = "https://github.com/MyGithubAccount/flet-datatable2"
|
|
18
|
+
Issues = "https://github.com/MyGithubAccount/flet-datatable2/issues"
|
|
19
|
+
|
|
20
|
+
[tool.setuptools.package-data]
|
|
21
|
+
"flutter.flet_datatable2" = ["**/*"]
|
|
22
|
+
|
|
23
|
+
[tool.uv]
|
|
24
|
+
dev-dependencies = [
|
|
25
|
+
"flet[all]==0.27.3",
|
|
26
|
+
"mkdocs",
|
|
27
|
+
"mkdocs-material",
|
|
28
|
+
"mkdocstrings[python]"
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[tool.poetry.group.dev.dependencies]
|
|
32
|
+
flet = {extras = ["all"], version = "0.27.3"}
|
|
33
|
+
mkdocs = "^1.0"
|
|
34
|
+
mkdocstrings = { extras = ["python"], version = "^0.10" }
|
|
35
|
+
mkdocs-material = "^8.0"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools]
|
|
38
|
+
license-files = []
|
|
39
|
+
|
|
40
|
+
[build-system]
|
|
41
|
+
requires = ["setuptools"]
|
|
42
|
+
build-backend = "setuptools.build_meta"
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import Any, Optional
|
|
4
|
+
|
|
5
|
+
from flet.core.control import Control, OptionalNumber
|
|
6
|
+
from flet.core.control_event import ControlEvent
|
|
7
|
+
from flet.core.event_handler import EventHandler
|
|
8
|
+
from flet.core.types import MainAxisAlignment, OptionalEventCallable
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Size(Enum):
|
|
12
|
+
"""Relative size of a column determines the share of total table width allocated to each individual column.
|
|
13
|
+
|
|
14
|
+
When determining column widths, ratios between `S`, `M` and `L` columns are kept (i.e. Large columns are set to 1.2x width of Medium ones).
|
|
15
|
+
See `DataTable2.smRatio`, `DataTable2.lmRatio`. Default S/M ratio is 0.67, L/M ratio is 1.2.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
S = "s"
|
|
19
|
+
M = "m"
|
|
20
|
+
L = "l"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class DataColumnSortEvent(ControlEvent):
|
|
24
|
+
def __init__(self, e: ControlEvent):
|
|
25
|
+
super().__init__(e.target, e.name, e.data, e.control, e.page)
|
|
26
|
+
d = json.loads(e.data)
|
|
27
|
+
self.column_index: int = d.get("i")
|
|
28
|
+
self.ascending: bool = d.get("a")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class DataColumn2(Control):
|
|
32
|
+
"""Column configuration for a [DataTable2](datatable2.md).
|
|
33
|
+
|
|
34
|
+
One column configuration must be provided for each column to display in the table.
|
|
35
|
+
|
|
36
|
+
Additional to Flet [DataColumn](https://flet.dev/docs/controls/datatable/#datacolumn), adds the capability to set relative column size via size property.
|
|
37
|
+
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
def __init__(
|
|
41
|
+
self,
|
|
42
|
+
label: Control,
|
|
43
|
+
size: Optional[Size] = None,
|
|
44
|
+
numeric: Optional[bool] = None,
|
|
45
|
+
tooltip: Optional[str] = None,
|
|
46
|
+
fixed_width: OptionalNumber = None,
|
|
47
|
+
heading_row_alignment: Optional[MainAxisAlignment] = None,
|
|
48
|
+
on_sort: OptionalEventCallable[DataColumnSortEvent] = None,
|
|
49
|
+
#
|
|
50
|
+
# Control
|
|
51
|
+
#
|
|
52
|
+
ref=None,
|
|
53
|
+
visible: Optional[bool] = None,
|
|
54
|
+
disabled: Optional[bool] = None,
|
|
55
|
+
data: Any = None,
|
|
56
|
+
):
|
|
57
|
+
Control.__init__(self, ref=ref, visible=visible, disabled=disabled, data=data)
|
|
58
|
+
|
|
59
|
+
self.__on_sort = EventHandler(lambda e: DataColumnSortEvent(e))
|
|
60
|
+
self._add_event_handler("sort", self.__on_sort.get_handler())
|
|
61
|
+
|
|
62
|
+
self.label = label
|
|
63
|
+
self.size = size
|
|
64
|
+
self.fixed_width = fixed_width
|
|
65
|
+
self.numeric = numeric
|
|
66
|
+
self.tooltip = tooltip
|
|
67
|
+
self.heading_row_alignment = heading_row_alignment
|
|
68
|
+
self.on_sort = on_sort
|
|
69
|
+
|
|
70
|
+
def _get_control_name(self):
|
|
71
|
+
return "datacolumn2"
|
|
72
|
+
|
|
73
|
+
def _get_children(self):
|
|
74
|
+
self.__label._set_attr_internal("n", "label")
|
|
75
|
+
return [self.__label]
|
|
76
|
+
|
|
77
|
+
def before_update(self):
|
|
78
|
+
super().before_update()
|
|
79
|
+
assert self.__label.visible, "label must be visible"
|
|
80
|
+
|
|
81
|
+
# label
|
|
82
|
+
@property
|
|
83
|
+
def label(self) -> Control:
|
|
84
|
+
"""
|
|
85
|
+
See DataColumn [label](https://flet.dev/docs/controls/datatable#label).
|
|
86
|
+
"""
|
|
87
|
+
return self.__label
|
|
88
|
+
|
|
89
|
+
@label.setter
|
|
90
|
+
def label(self, value: Control):
|
|
91
|
+
self.__label = value
|
|
92
|
+
|
|
93
|
+
# size
|
|
94
|
+
@property
|
|
95
|
+
def size(self) -> Optional[Size]:
|
|
96
|
+
"""
|
|
97
|
+
**NEW**
|
|
98
|
+
|
|
99
|
+
Column sizes are determined based on available width by distributing it to individual columns accounting for their relative sizes.
|
|
100
|
+
|
|
101
|
+
Value is of type `Size` and defaults to `Size.S`.
|
|
102
|
+
"""
|
|
103
|
+
return self.__size
|
|
104
|
+
|
|
105
|
+
@size.setter
|
|
106
|
+
def size(self, value: Optional[Size]):
|
|
107
|
+
self.__size = value
|
|
108
|
+
self._set_enum_attr("size", value, Size)
|
|
109
|
+
|
|
110
|
+
# numeric
|
|
111
|
+
@property
|
|
112
|
+
def numeric(self) -> bool:
|
|
113
|
+
"""
|
|
114
|
+
See DataColumn [numeric](https://flet.dev/docs/controls/datatable#numeric).
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
return self._get_attr("numeric", data_type="bool", def_value=False)
|
|
118
|
+
|
|
119
|
+
@numeric.setter
|
|
120
|
+
def numeric(self, value: Optional[bool]):
|
|
121
|
+
self._set_attr("numeric", value)
|
|
122
|
+
|
|
123
|
+
# fixed_width
|
|
124
|
+
@property
|
|
125
|
+
def fixed_width(self) -> OptionalNumber:
|
|
126
|
+
"""
|
|
127
|
+
**NEW**
|
|
128
|
+
|
|
129
|
+
Defines absolute width of the column in pixel (as opposed to relative `size` used by default).
|
|
130
|
+
"""
|
|
131
|
+
return self._get_attr("fixedWidth")
|
|
132
|
+
|
|
133
|
+
@fixed_width.setter
|
|
134
|
+
def fixed_width(self, value: OptionalNumber):
|
|
135
|
+
self._set_attr("fixedWidth", value)
|
|
136
|
+
|
|
137
|
+
# tooltip
|
|
138
|
+
@property
|
|
139
|
+
def tooltip(self) -> Optional[str]:
|
|
140
|
+
"""
|
|
141
|
+
See DataColumn [tooltip](https://flet.dev/docs/controls/datatable#tooltip).
|
|
142
|
+
"""
|
|
143
|
+
return self._get_attr("tooltip")
|
|
144
|
+
|
|
145
|
+
@tooltip.setter
|
|
146
|
+
def tooltip(self, value: Optional[str]):
|
|
147
|
+
self._set_attr("tooltip", value)
|
|
148
|
+
|
|
149
|
+
# heading_row_alignment
|
|
150
|
+
@property
|
|
151
|
+
def heading_row_alignment(self) -> Optional[MainAxisAlignment]:
|
|
152
|
+
"""
|
|
153
|
+
See DataColumn [heading_row_alignment](https://flet.dev/docs/controls/datatable#heading_row_alignment).
|
|
154
|
+
"""
|
|
155
|
+
return self.__heading_row_alignment
|
|
156
|
+
|
|
157
|
+
@heading_row_alignment.setter
|
|
158
|
+
def heading_row_alignment(self, value: Optional[MainAxisAlignment]):
|
|
159
|
+
self.__heading_row_alignment = value
|
|
160
|
+
self._set_enum_attr("headingRowAlignment", value, MainAxisAlignment)
|
|
161
|
+
|
|
162
|
+
# on_sort
|
|
163
|
+
@property
|
|
164
|
+
def on_sort(self) -> OptionalEventCallable["DataColumnSortEvent"]:
|
|
165
|
+
"""
|
|
166
|
+
See DataColumn [on_sort](https://flet.dev/docs/controls/datatable#on_sort).
|
|
167
|
+
"""
|
|
168
|
+
return self.__on_sort.handler
|
|
169
|
+
|
|
170
|
+
@on_sort.setter
|
|
171
|
+
def on_sort(self, handler: OptionalEventCallable["DataColumnSortEvent"]):
|
|
172
|
+
self.__on_sort.handler = handler
|
|
173
|
+
self._set_attr("onSort", True if handler is not None else None)
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
from typing import Any, List, Optional
|
|
2
|
+
|
|
3
|
+
from flet.core.box import BoxDecoration
|
|
4
|
+
from flet.core.control import Control, OptionalNumber
|
|
5
|
+
from flet.core.datatable import DataCell
|
|
6
|
+
from flet.core.types import ColorValue, ControlStateValue, OptionalControlEventCallable
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DataRow2(Control):
|
|
10
|
+
"""
|
|
11
|
+
Extension of [DataRow](https://flet.dev/docs/controls/datatable#datarow).
|
|
12
|
+
|
|
13
|
+
Adds row level `tap` events. There are also `onSecondaryTap` and `onSecondaryTapDown` which are not available in DataCells and which can be useful in Desktop settings when a reaction to the right click is required.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
cells: List[DataCell],
|
|
19
|
+
color: ControlStateValue[ColorValue] = None,
|
|
20
|
+
decoration: Optional[BoxDecoration] = None,
|
|
21
|
+
specific_row_height: OptionalNumber = None,
|
|
22
|
+
selected: Optional[bool] = None,
|
|
23
|
+
on_long_press: OptionalControlEventCallable = None,
|
|
24
|
+
on_select_changed: OptionalControlEventCallable = None,
|
|
25
|
+
on_double_tap: OptionalControlEventCallable = None,
|
|
26
|
+
on_secondary_tap: OptionalControlEventCallable = None,
|
|
27
|
+
on_secondary_tap_down: OptionalControlEventCallable = None,
|
|
28
|
+
on_tap: OptionalControlEventCallable = None,
|
|
29
|
+
#
|
|
30
|
+
# Control
|
|
31
|
+
#
|
|
32
|
+
ref=None,
|
|
33
|
+
visible: Optional[bool] = None,
|
|
34
|
+
disabled: Optional[bool] = None,
|
|
35
|
+
data: Any = None,
|
|
36
|
+
):
|
|
37
|
+
Control.__init__(self, ref=ref, visible=visible, disabled=disabled, data=data)
|
|
38
|
+
|
|
39
|
+
self.cells = cells
|
|
40
|
+
self.color = color
|
|
41
|
+
self.decoration = decoration
|
|
42
|
+
self.specific_row_height = specific_row_height
|
|
43
|
+
self.selected = selected
|
|
44
|
+
self.on_long_press = on_long_press
|
|
45
|
+
self.on_select_changed = on_select_changed
|
|
46
|
+
self.on_double_tap = on_double_tap
|
|
47
|
+
self.on_secondary_tap = on_secondary_tap
|
|
48
|
+
self.on_secondary_tap_down = on_secondary_tap_down
|
|
49
|
+
self.on_tap = on_tap
|
|
50
|
+
|
|
51
|
+
def _get_control_name(self):
|
|
52
|
+
return "datarow2"
|
|
53
|
+
|
|
54
|
+
def __contains__(self, item):
|
|
55
|
+
return item in self.__cells
|
|
56
|
+
|
|
57
|
+
def before_update(self):
|
|
58
|
+
super().before_update()
|
|
59
|
+
assert any(
|
|
60
|
+
cell.visible for cell in self.__cells
|
|
61
|
+
), "cells must contain at minimum one visible DataCell"
|
|
62
|
+
self._set_attr_json("color", self.__color, wrap_attr_dict=True)
|
|
63
|
+
self._set_attr_json("decoration", self.__decoration)
|
|
64
|
+
|
|
65
|
+
def _get_children(self):
|
|
66
|
+
return self.__cells
|
|
67
|
+
|
|
68
|
+
# cells
|
|
69
|
+
@property
|
|
70
|
+
def cells(self) -> List[DataCell]:
|
|
71
|
+
"""
|
|
72
|
+
See DataRow [cells](https://flet.dev/docs/controls/datatable#cells).
|
|
73
|
+
"""
|
|
74
|
+
return self.__cells
|
|
75
|
+
|
|
76
|
+
@cells.setter
|
|
77
|
+
def cells(self, value: List[DataCell]):
|
|
78
|
+
# assert all(
|
|
79
|
+
# isinstance(cell, DataCell) for cell in value
|
|
80
|
+
# ), "cells must contain only DataCell instances"
|
|
81
|
+
self.__cells = value
|
|
82
|
+
|
|
83
|
+
# color
|
|
84
|
+
@property
|
|
85
|
+
def color(self) -> ControlStateValue[str]:
|
|
86
|
+
"""
|
|
87
|
+
See DataRow [color](https://flet.dev/docs/controls/datatable#color).
|
|
88
|
+
"""
|
|
89
|
+
return self.__color
|
|
90
|
+
|
|
91
|
+
@color.setter
|
|
92
|
+
def color(self, value: ControlStateValue[str]):
|
|
93
|
+
self.__color = value
|
|
94
|
+
|
|
95
|
+
# decoration
|
|
96
|
+
@property
|
|
97
|
+
def decoration(self) -> Optional[BoxDecoration]:
|
|
98
|
+
"""
|
|
99
|
+
**NEW**
|
|
100
|
+
|
|
101
|
+
Decoration to be applied to the given row. Value is an instance of [BoxDecoration](https://flet.dev/docs/reference/types/boxdecoration).
|
|
102
|
+
When applied, it `divider_thickness` won't take effect.
|
|
103
|
+
"""
|
|
104
|
+
return self.__decoration
|
|
105
|
+
|
|
106
|
+
@decoration.setter
|
|
107
|
+
def decoration(self, value: Optional[BoxDecoration]):
|
|
108
|
+
self.__decoration = value
|
|
109
|
+
|
|
110
|
+
# specific_row_height
|
|
111
|
+
@property
|
|
112
|
+
def specific_row_height(self) -> OptionalNumber:
|
|
113
|
+
"""
|
|
114
|
+
**NEW**
|
|
115
|
+
|
|
116
|
+
Specific row height. If not provided, `data_row_height` will be applied.
|
|
117
|
+
"""
|
|
118
|
+
return self._get_attr("specificRowHeight")
|
|
119
|
+
|
|
120
|
+
@specific_row_height.setter
|
|
121
|
+
def specific_row_height(self, value: OptionalNumber):
|
|
122
|
+
self._set_attr("specificRowHeight", value)
|
|
123
|
+
|
|
124
|
+
# selected
|
|
125
|
+
@property
|
|
126
|
+
def selected(self) -> bool:
|
|
127
|
+
"""
|
|
128
|
+
See DataRow [selected](https://flet.dev/docs/controls/datatable#selected).
|
|
129
|
+
"""
|
|
130
|
+
return self._get_attr("selected", data_type="bool", def_value=False)
|
|
131
|
+
|
|
132
|
+
@selected.setter
|
|
133
|
+
def selected(self, value: Optional[bool]):
|
|
134
|
+
self._set_attr("selected", value)
|
|
135
|
+
|
|
136
|
+
# on_long_press
|
|
137
|
+
@property
|
|
138
|
+
def on_long_press(self) -> OptionalControlEventCallable:
|
|
139
|
+
"""
|
|
140
|
+
See DataRow [on_long_press](https://flet.dev/docs/controls/datatable#on_long_press).
|
|
141
|
+
"""
|
|
142
|
+
return self._get_event_handler("long_press")
|
|
143
|
+
|
|
144
|
+
@on_long_press.setter
|
|
145
|
+
def on_long_press(self, handler: OptionalControlEventCallable):
|
|
146
|
+
self._add_event_handler("long_press", handler)
|
|
147
|
+
self._set_attr("onLongPress", True if handler is not None else None)
|
|
148
|
+
|
|
149
|
+
# on_tap
|
|
150
|
+
@property
|
|
151
|
+
def on_tap(self) -> OptionalControlEventCallable:
|
|
152
|
+
"""
|
|
153
|
+
**NEW**
|
|
154
|
+
|
|
155
|
+
Row tap handler. Won't be called if tapped cell has `tap` event handler.
|
|
156
|
+
"""
|
|
157
|
+
return self._get_event_handler("tap")
|
|
158
|
+
|
|
159
|
+
@on_tap.setter
|
|
160
|
+
def on_tap(self, handler: OptionalControlEventCallable):
|
|
161
|
+
self._add_event_handler("tap", handler)
|
|
162
|
+
self._set_attr("onTap", True if handler is not None else None)
|
|
163
|
+
|
|
164
|
+
# on_double_tap
|
|
165
|
+
@property
|
|
166
|
+
def on_double_tap(self) -> OptionalControlEventCallable:
|
|
167
|
+
"""
|
|
168
|
+
**NEW**
|
|
169
|
+
|
|
170
|
+
Row double tap handler. Won't be called if tapped cell has `tap` event handler.
|
|
171
|
+
"""
|
|
172
|
+
return self._get_event_handler("double_tap")
|
|
173
|
+
|
|
174
|
+
@on_double_tap.setter
|
|
175
|
+
def on_double_tap(self, handler: OptionalControlEventCallable):
|
|
176
|
+
self._add_event_handler("double_tap", handler)
|
|
177
|
+
self._set_attr("onDoubleTap", True if handler is not None else None)
|
|
178
|
+
|
|
179
|
+
# on_secondary_tap
|
|
180
|
+
@property
|
|
181
|
+
def on_secondary_tap(self) -> OptionalControlEventCallable:
|
|
182
|
+
"""
|
|
183
|
+
**NEW**
|
|
184
|
+
|
|
185
|
+
Row right click handler. Won't be called if tapped cell has `tap` event.
|
|
186
|
+
"""
|
|
187
|
+
return self._get_event_handler("secondary_tap")
|
|
188
|
+
|
|
189
|
+
@on_secondary_tap.setter
|
|
190
|
+
def on_secondary_tap(self, handler: OptionalControlEventCallable):
|
|
191
|
+
self._add_event_handler("secondary_tap", handler)
|
|
192
|
+
self._set_attr("onSecondaryTap", True if handler is not None else None)
|
|
193
|
+
|
|
194
|
+
# on_secondary_tap_down
|
|
195
|
+
@property
|
|
196
|
+
def on_secondary_tap_down(self) -> OptionalControlEventCallable:
|
|
197
|
+
"""
|
|
198
|
+
**NEW**
|
|
199
|
+
|
|
200
|
+
Row right mouse down handler. Won't be called if tapped cell has `tap` event handler.
|
|
201
|
+
"""
|
|
202
|
+
return self._get_event_handler("secondary_tap_down")
|
|
203
|
+
|
|
204
|
+
@on_secondary_tap_down.setter
|
|
205
|
+
def on_secondary_tap_down(self, handler: OptionalControlEventCallable):
|
|
206
|
+
self._add_event_handler("secondary_tap_down", handler)
|
|
207
|
+
self._set_attr("onSecondaryTapDown", True if handler is not None else None)
|
|
208
|
+
|
|
209
|
+
# on_select_changed
|
|
210
|
+
@property
|
|
211
|
+
def on_select_changed(self) -> OptionalControlEventCallable:
|
|
212
|
+
"""
|
|
213
|
+
See DataRow [on_select_changed](https://flet.dev/docs/controls/datatable#on_select_changed).
|
|
214
|
+
"""
|
|
215
|
+
return self._get_event_handler("select_changed")
|
|
216
|
+
|
|
217
|
+
@on_select_changed.setter
|
|
218
|
+
def on_select_changed(self, handler: OptionalControlEventCallable):
|
|
219
|
+
self._add_event_handler("select_changed", handler)
|
|
220
|
+
self._set_attr("onSelectChanged", True if handler is not None else None)
|