FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnative/src/pythonnative/components/__init__.py at main · pythonnative/pythonnative · GitHub
pythonnative
/
pythonnative
Public
Notifications
You must be signed in to change notification settings
Fork
23
Star
131
Code
Issues
11
Pull requests
4
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnative
/
src
/
pythonnative
/
components
/
__init__.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
135 lines (127 loc) · 3.32 KB
Breadcrumbs
pythonnative
/
src
/
pythonnative
/
components
/
__init__.py
Copy path
File metadata and controls
135 lines (127 loc) · 3.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
"""Built-in element factories.
Each factory function (``Text``, ``Button``, …) is a fully-typed thin
wrapper that builds an [`Element`][pythonnative.Element] through the
shared ``_make_element`` helper, so style resolution, ``ref``
attachment, ``None``-default dropping, and forced overrides (e.g.
``Column``'s fixed ``flex_direction``) live in exactly one place. The
factory signatures themselves are the canonical prop schemas: editors
and type checkers validate calls directly against them.
The factories are grouped by concern into submodules (``text``,
``media``, ``controls``, ``layout``, ``pressable``, ``overlays``,
``structural``, ``lists``); everything public is re-exported here, so
``from pythonnative.components import Text`` keeps working.
Example:
```python
import pythonnative as pn
pn.Column(
pn.Text("Hello", style=pn.style(font_size=18)),
pn.Button("Tap", on_press=lambda: print("tapped")),
style=pn.style(gap=12, padding=16),
)
```
"""
from
.
_base
import
_SPAN_STYLE_KEYS
,
_flatten_text_spans
,
_make_element
# noqa: F401
from
.
controls
import
(
ActivityIndicator
,
Checkbox
,
DatePicker
,
Picker
,
ProgressBar
,
RefreshControl
,
SegmentedControl
,
Slider
,
StatusBar
,
Switch
,
)
from
.
events
import
(
ContentSizeEvent
,
ImageLoadEvent
,
KeyPressEvent
,
LayoutEvent
,
ScrollEvent
,
SelectionEvent
,
WebNavigationEvent
,
)
from
.
graphics
import
BlurType
,
BlurView
,
LinearGradient
,
PreserveAspectRatio
,
Svg
from
.
layout
import
(
# noqa: F401
_SAFE_AREA_EDGES
,
Column
,
KeyboardAvoidingView
,
Row
,
SafeAreaView
,
ScrollView
,
Spacer
,
View
,
_KeyboardAvoidingContainer
,
_numeric_edge_padding
,
_SafeAreaContainer
,
)
from
.
lists
import
(
# noqa: F401
_DEFAULT_ROW_EXTENT
,
FlatList
,
ListController
,
SectionList
,
_NativeList
,
_RowSpec
,
)
from
.
media
import
Image
,
ImageBackground
,
ImageSource
,
WebView
from
.
overlays
import
Modal
,
Portal
from
.
pressable
import
Pressable
,
PressState
,
Ripple
,
TouchableOpacity
,
_StatefulPressable
# noqa: F401
from
.
structural
import
ErrorBoundary
,
Fragment
,
Suspense
from
.
text
import
Button
,
EllipsizeMode
,
KeyboardAppearance
,
Text
,
TextInput
__all__
=
[
"ActivityIndicator"
,
"BlurType"
,
"BlurView"
,
"Button"
,
"Checkbox"
,
"Column"
,
"ContentSizeEvent"
,
"DatePicker"
,
"EllipsizeMode"
,
"ErrorBoundary"
,
"FlatList"
,
"Fragment"
,
"Image"
,
"ImageBackground"
,
"ImageLoadEvent"
,
"ImageSource"
,
"KeyPressEvent"
,
"KeyboardAppearance"
,
"KeyboardAvoidingView"
,
"LayoutEvent"
,
"LinearGradient"
,
"ListController"
,
"Modal"
,
"Picker"
,
"Portal"
,
"PreserveAspectRatio"
,
"PressState"
,
"Pressable"
,
"ProgressBar"
,
"RefreshControl"
,
"Ripple"
,
"Row"
,
"SafeAreaView"
,
"ScrollEvent"
,
"ScrollView"
,
"SectionList"
,
"SegmentedControl"
,
"SelectionEvent"
,
"Slider"
,
"Spacer"
,
"StatusBar"
,
"Suspense"
,
"Svg"
,
"Switch"
,
"Text"
,
"TextInput"
,
"TouchableOpacity"
,
"View"
,
"WebNavigationEvent"
,
"WebView"
,
]
# Factories are the single source for Python signatures and native contracts.
from
..
sdk
.
builtins
import
install
as
_install_native_contracts
_install_native_contracts
(
globals
())
del
_install_native_contracts
Back
|
FazBrowse Home
|
New Git URL