ex4nicegui 0.2.17__tar.gz → 0.2.18__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.
Files changed (78) hide show
  1. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/PKG-INFO +1 -1
  2. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/__init__.py +1 -1
  3. ex4nicegui-0.2.18/ex4nicegui/layout/__init__.py +2 -0
  4. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/layout/gridFlex/gridFlex.py +1 -1
  5. ex4nicegui-0.2.18/ex4nicegui/layout/rxFlex/__init__.py +1 -0
  6. ex4nicegui-0.2.18/ex4nicegui/layout/rxFlex/index.py +121 -0
  7. ex4nicegui-0.2.18/ex4nicegui/layout/rxFlex/types.py +80 -0
  8. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui.egg-info/PKG-INFO +1 -1
  9. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui.egg-info/SOURCES.txt +3 -1
  10. ex4nicegui-0.2.17/ex4nicegui/layout/__init__.py +0 -2
  11. ex4nicegui-0.2.17/ex4nicegui/layout/_gridbox.py +0 -87
  12. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/LICENSE +0 -0
  13. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/README.md +0 -0
  14. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/experimental_/__init__.py +0 -0
  15. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/experimental_/gridLayout/__init__.py +0 -0
  16. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/experimental_/gridLayout/index.py +0 -0
  17. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/layout/gridFlex/GridFlex.js +0 -0
  18. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/layout/gridFlex/__init__.py +0 -0
  19. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/layout/gridFlex/utils.py +0 -0
  20. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/EChartsComponent/ECharts.js +0 -0
  21. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/EChartsComponent/ECharts.py +0 -0
  22. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/EChartsComponent/__init__.py +0 -0
  23. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/UseDraggable/UseDraggable.js +0 -0
  24. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/UseDraggable/UseDraggable.py +0 -0
  25. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/UseDraggable/__init__.py +0 -0
  26. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/__index.py +0 -0
  27. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/__init__.py +0 -0
  28. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/drawer.py +0 -0
  29. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/dropZone/__init__.py +0 -0
  30. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/dropZone/dropZone.js +0 -0
  31. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/dropZone/dropZone.py +0 -0
  32. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/fileWatcher.py +0 -0
  33. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/local_file_picker.py +0 -0
  34. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/__init__.py +0 -0
  35. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/aggrid.py +0 -0
  36. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/base.py +0 -0
  37. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/button.py +0 -0
  38. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/card.py +0 -0
  39. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/checkbox.py +0 -0
  40. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/color_picker.py +0 -0
  41. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/column.py +0 -0
  42. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/date.py +0 -0
  43. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/drawer.py +0 -0
  44. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/echarts.py +0 -0
  45. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/expansion.py +0 -0
  46. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/grid.py +0 -0
  47. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/html.py +0 -0
  48. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/icon.py +0 -0
  49. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/image.py +0 -0
  50. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/input.py +0 -0
  51. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/label.py +0 -0
  52. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/number.py +0 -0
  53. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/radio.py +0 -0
  54. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/row.py +0 -0
  55. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/select.py +0 -0
  56. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/slider.py +0 -0
  57. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/switch.py +0 -0
  58. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/table.py +0 -0
  59. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/textarea.py +0 -0
  60. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/upload.py +0 -0
  61. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/officials/utils.py +0 -0
  62. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/q_pagination.py +0 -0
  63. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/rxui.py +0 -0
  64. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/useMouse/UseMouse.js +0 -0
  65. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/useMouse/UseMouse.py +0 -0
  66. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/useMouse/__init__.py +0 -0
  67. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/reactive/usePagination.py +0 -0
  68. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/tools/__init__.py +0 -0
  69. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/tools/debug.py +0 -0
  70. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/utils/__init__.py +0 -0
  71. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/utils/common.py +0 -0
  72. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui/utils/signals.py +0 -0
  73. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui.egg-info/dependency_links.txt +0 -0
  74. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui.egg-info/not-zip-safe +0 -0
  75. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui.egg-info/requires.txt +0 -0
  76. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/ex4nicegui.egg-info/top_level.txt +0 -0
  77. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/setup.cfg +0 -0
  78. {ex4nicegui-0.2.17 → ex4nicegui-0.2.18}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ex4nicegui
3
- Version: 0.2.17
3
+ Version: 0.2.18
4
4
  Summary: ...
5
5
  Home-page:
6
6
  Author: carson_jia
@@ -16,4 +16,4 @@ from signe import batch
16
16
  from ex4nicegui.experimental_ import gridLayout as exp_ui
17
17
 
18
18
 
19
- __version__ = "0.2.17"
19
+ __version__ = "0.2.18"
@@ -0,0 +1,2 @@
1
+ from .gridFlex import *
2
+ from .rxFlex import *
@@ -147,7 +147,7 @@ class GridFlex(Element, component="GridFlex.js"):
147
147
  break_point: Optional[TBreakpoint] = None,
148
148
  **kws,
149
149
  ):
150
- if area is not None:
150
+ if area is not None and area.strip() != "":
151
151
  areas_list = utils.areas_str2array(area)
152
152
  area = utils.areas_array2str(areas_list)
153
153
  areas_cols_len = max(map(len, areas_list))
@@ -0,0 +1 @@
1
+ from .index import rx_column, rx_row
@@ -0,0 +1,121 @@
1
+ from typing import Callable, List, Optional, Union, TypeVar, Generic
2
+ from typing_extensions import Literal
3
+
4
+ from ex4nicegui.layout import grid_box, mark_area
5
+ from nicegui import ui, app
6
+ from .types import *
7
+
8
+ _T_itemWraper_add_var = TypeVar("_T_itemWraper_add_var")
9
+
10
+
11
+ class ItemWraper:
12
+ def __init__(self, fn: Callable[[ui.element], ui.element]):
13
+ self.fn = fn
14
+
15
+ def __radd__(self, other: _T_itemWraper_add_var) -> _T_itemWraper_add_var:
16
+ return self.fn(other) # type: ignore
17
+
18
+
19
+ class rx_flex_box(ui.element):
20
+ def space(self):
21
+ return ui.element("q-space")
22
+
23
+ def gap(self, value: Union[int, float, str]):
24
+ if isinstance(value, (int, float)):
25
+ value = f"{value}rem"
26
+ self._style["gap"] = str(value)
27
+ self.update()
28
+ return self
29
+
30
+ def all_items_grow(self):
31
+ self._props["ex4ng-rx-flex-auto-grow"] = ""
32
+ return self
33
+
34
+
35
+ def _q_space():
36
+ return ui.element("q-space")
37
+
38
+
39
+ class rx_column(ui.column, rx_flex_box):
40
+ def __init__(
41
+ self,
42
+ horizontal: TColumn_Horizontal = "left",
43
+ vertical: TColumn_Vertical = "top",
44
+ ) -> None:
45
+ super().__init__()
46
+ self.tailwind.align_items
47
+ self.horizontal(horizontal)
48
+ self.vertical(vertical)
49
+
50
+ self._props["ex4ng-rx-column"] = ""
51
+
52
+ def item_horizontal(self, value: TColumn_Item_Horizontal):
53
+ def fn(ele: ui.element):
54
+ ele._style["align-self"] = Column_Item_Horizontal_map.get(value, value)
55
+ # ele.update()
56
+ return ele
57
+
58
+ return ItemWraper(fn)
59
+
60
+ def horizontal(self, value: TColumn_Horizontal):
61
+ self._style["align-items"] = Column_Horizontal_map.get(value, value)
62
+ self.update()
63
+ return self
64
+
65
+ def vertical(self, value: TColumn_Vertical):
66
+ self._style["justify-content"] = Column_Vertical_map.get(value, value)
67
+ self.update()
68
+ return self
69
+
70
+ def space(self):
71
+ return _q_space()
72
+
73
+
74
+ class rx_row(ui.row, rx_flex_box):
75
+ def __init__(
76
+ self,
77
+ horizontal: TRow_Horizontal = "left",
78
+ vertical: TRow_Vertical = "top",
79
+ ) -> None:
80
+ super().__init__()
81
+ self.horizontal(horizontal)
82
+ self.vertical(vertical)
83
+ self._props["ex4ng-rx-row"] = ""
84
+
85
+ def item_vertical(self, value: TRow_Item_Vertical):
86
+ def fn(ele: ui.element):
87
+ ele._style["align-self"] = Row_Vertical_map.get(value, value)
88
+ return ele
89
+
90
+ return ItemWraper(fn)
91
+
92
+ def horizontal(self, value: TRow_Horizontal):
93
+ self._style["justify-content"] = Row_Horizontal_map.get(value, value)
94
+ self.update()
95
+ return self
96
+
97
+ def vertical(self, value: TRow_Vertical):
98
+ self._style["align-items"] = Row_Vertical_map.get(value, value)
99
+ self.update()
100
+ return
101
+
102
+ def space(self):
103
+ return _q_space()
104
+
105
+
106
+ class page_view(rx_column):
107
+ def __init__(
108
+ self,
109
+ horizontal: TColumn_Horizontal = "left",
110
+ vertical: TColumn_Vertical = "top",
111
+ ) -> None:
112
+ super().__init__(horizontal, vertical)
113
+ self.classes("w-full h-full no-wrap")
114
+ ui.query("main.q-page").classes("flex")
115
+ ui.query(".nicegui-content").classes("grow p-0")
116
+
117
+ def all_center(self):
118
+ return self.horizontal("center").vertical("center")
119
+
120
+ def full_screen(self):
121
+ return self.classes("fullscreen")
@@ -0,0 +1,80 @@
1
+ # region type
2
+
3
+ from typing_extensions import Literal
4
+
5
+
6
+ Space_map = {
7
+ "between": "space-between",
8
+ "around": "space-around",
9
+ "evenly": "space-evenly",
10
+ }
11
+
12
+ TColumn_Item_Horizontal = Literal[
13
+ "auto",
14
+ "left",
15
+ "right",
16
+ "center",
17
+ "stretch",
18
+ "baseline",
19
+ ]
20
+ Column_Item_Horizontal_map = {"left": "flex-start", "right": "flex-end"}
21
+
22
+
23
+ TColumn_Horizontal = Literal[
24
+ "left",
25
+ "right",
26
+ "center",
27
+ "baseline",
28
+ "stretch",
29
+ ]
30
+
31
+ Column_Horizontal_map = {"left": "flex-start", "right": "flex-end"}
32
+
33
+ TColumn_Vertical = Literal[
34
+ "normal",
35
+ "top",
36
+ "bottom",
37
+ "center",
38
+ "between",
39
+ "around",
40
+ "evenly",
41
+ "stretch",
42
+ ]
43
+
44
+ Column_Vertical_map = {"top": "flex-start", "bottom": "flex-end", **Space_map}
45
+
46
+
47
+ TRow_Horizontal = Literal[
48
+ "normal",
49
+ "left",
50
+ "right",
51
+ "center",
52
+ "between",
53
+ "around",
54
+ "evenly",
55
+ "stretch",
56
+ ]
57
+
58
+ Row_Horizontal_map = {"left": "flex-start", "right": "flex-end", **Space_map}
59
+
60
+ TRow_Vertical = Literal[
61
+ "top",
62
+ "bottom",
63
+ "center",
64
+ "baseline",
65
+ "stretch",
66
+ ]
67
+
68
+ Row_Vertical_map = {"top": "flex-start", "bottom": "flex-end"}
69
+
70
+
71
+ TRow_Item_Vertical = Literal[
72
+ "auto",
73
+ "top",
74
+ "bottom",
75
+ "center",
76
+ "stretch",
77
+ "baseline",
78
+ ]
79
+ TRow_Item_Vertical_map = {"top": "flex-start", "bottom": "flex-end"}
80
+ # endregion
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ex4nicegui
3
- Version: 0.2.17
3
+ Version: 0.2.18
4
4
  Summary: ...
5
5
  Home-page:
6
6
  Author: carson_jia
@@ -12,11 +12,13 @@ ex4nicegui/experimental_/__init__.py
12
12
  ex4nicegui/experimental_/gridLayout/__init__.py
13
13
  ex4nicegui/experimental_/gridLayout/index.py
14
14
  ex4nicegui/layout/__init__.py
15
- ex4nicegui/layout/_gridbox.py
16
15
  ex4nicegui/layout/gridFlex/GridFlex.js
17
16
  ex4nicegui/layout/gridFlex/__init__.py
18
17
  ex4nicegui/layout/gridFlex/gridFlex.py
19
18
  ex4nicegui/layout/gridFlex/utils.py
19
+ ex4nicegui/layout/rxFlex/__init__.py
20
+ ex4nicegui/layout/rxFlex/index.py
21
+ ex4nicegui/layout/rxFlex/types.py
20
22
  ex4nicegui/reactive/__index.py
21
23
  ex4nicegui/reactive/__init__.py
22
24
  ex4nicegui/reactive/drawer.py
@@ -1,2 +0,0 @@
1
- # from .gridbox import grid_box
2
- from .gridFlex import *
@@ -1,87 +0,0 @@
1
- from typing import List, Optional, Union, cast
2
- from nicegui.client import Client
3
- from nicegui.element import Element
4
- from ex4nicegui.reactive.officials.base import BindableUi
5
-
6
-
7
- def _areas_str2array(areas: str) -> List[List[str]]:
8
- """
9
- >>> input='''
10
- sc1 sc2
11
- sc3
12
- table table table table
13
- '''
14
- >>> areas_str2array(input)
15
- >>> [
16
- ["sc1", "sc2"],
17
- ["sc3"],
18
- ["table", "table", "table", "table"]
19
- ]
20
- """
21
- pass
22
-
23
- lines = (line.strip() for line in areas.splitlines())
24
- remove_empty_rows = (line for line in lines if len(line) > 0)
25
- splie_space = (line.split() for line in remove_empty_rows)
26
- return list(splie_space)
27
-
28
-
29
- def _areas_array2str(areas_array: List[List[str]]):
30
- """
31
- >>> input = [
32
- ["sc1", "sc2"],
33
- ["sc3"],
34
- ["table"] * 4
35
- ]
36
- >>> areas_array2str(input)
37
- >>> '"sc1 sc2 . ." "sc3 . . ." "table table table table"'
38
- """
39
- max_len = max(map(len, areas_array))
40
-
41
- fix_empty = (
42
- [*line, *(["."] * (max_len - len(line)))] if len(line) < max_len else line
43
- for line in areas_array
44
- )
45
-
46
- line2str = (f'"{" ".join(line)}"' for line in fix_empty)
47
- return " ".join(line2str)
48
-
49
-
50
- class grid_box(Element):
51
- def __init__(
52
- self,
53
- areas_text: str,
54
- template_columns: Optional[str] = None,
55
- template_rows: Optional[str] = None,
56
- *,
57
- _client: Optional[Client] = None,
58
- ) -> None:
59
- super().__init__("div", _client=_client)
60
-
61
- areas_list = _areas_str2array(areas_text)
62
-
63
- areas = _areas_array2str(areas_list)
64
-
65
- areas_cols_len = max(map(len, areas_list))
66
- areas_rows_len = len(areas_list)
67
-
68
- template_columns = template_columns or f"repeat({areas_cols_len}, 1fr)"
69
- template_rows = template_rows or f"repeat({areas_rows_len}, 1fr)"
70
-
71
- self.style(
72
- f"""
73
- grid-template-areas: {areas};
74
- display: grid;
75
- grid-template-columns: {template_columns};
76
- grid-template-rows:{template_rows};"""
77
- )
78
-
79
- def areas_mark(self, element: Union[Element, BindableUi], mark: str):
80
- if isinstance(element, BindableUi):
81
- element = element.element
82
- element = cast(Element, element)
83
- element.style(self.mark_style(mark))
84
- return element
85
-
86
- def mark_style(self, mark: str):
87
- return f"grid-area:{mark}"
File without changes
File without changes
File without changes
File without changes