3
3
import typing # noqa: F401
4
4
import numbers # noqa: F401
5
5
from typing_extensions import TypedDict , NotRequired , Literal # noqa: F401
6
- from dash .development .base_component import ComponentType # noqa: F401
7
6
from dash .development .base_component import Component , _explicitize_args
7
+ try :
8
+ from dash .development .base_component import ComponentType # noqa: F401
9
+ except ImportError :
10
+ ComponentType = typing .TypeVar ("ComponentType" , bound = Component )
8
11
9
12
10
13
class Table (Component ):
@@ -97,7 +100,7 @@ class Table(Component):
97
100
OptionalObjectWithExactAndNestedDescriptionFigure = TypedDict (
98
101
"OptionalObjectWithExactAndNestedDescriptionFigure" ,
99
102
{
100
- "data" : NotRequired [typing .Union [ typing . Sequence [dict ], typing . Tuple ]],
103
+ "data" : NotRequired [typing .Sequence [dict ]],
101
104
"layout" : NotRequired [dict ]
102
105
}
103
106
)
@@ -114,7 +117,7 @@ class Table(Component):
114
117
OptionalObjectWithShapeAndNestedDescriptionFigure = TypedDict (
115
118
"OptionalObjectWithShapeAndNestedDescriptionFigure" ,
116
119
{
117
- "data" : NotRequired [typing .Union [ typing . Sequence [dict ], typing . Tuple ]],
120
+ "data" : NotRequired [typing .Sequence [dict ]],
118
121
"layout" : NotRequired [dict ]
119
122
}
120
123
)
@@ -132,7 +135,7 @@ class Table(Component):
132
135
def __init__ (
133
136
self ,
134
137
children : typing .Optional [typing .Union [str , int , float , ComponentType , typing .Sequence [typing .Union [str , int , float , ComponentType ]]]] = None ,
135
- optionalArray : typing .Optional [typing .Union [ typing . Sequence , typing . Tuple ] ] = None ,
138
+ optionalArray : typing .Optional [typing .Sequence ] = None ,
136
139
optionalBool : typing .Optional [bool ] = None ,
137
140
optionalFunc : typing .Optional [typing .Any ] = None ,
138
141
optionalNumber : typing .Optional [typing .Union [int , float , numbers .Number ]] = None ,
@@ -144,13 +147,13 @@ def __init__(
144
147
optionalMessage : typing .Optional [typing .Any ] = None ,
145
148
optionalEnum : typing .Optional [Literal ["News" , "Photos" ]] = None ,
146
149
optionalUnion : typing .Optional [typing .Union [str , typing .Union [int , float , numbers .Number ], typing .Any ]] = None ,
147
- optionalArrayOf : typing .Optional [typing .Union [ typing . Sequence [typing .Union [int , float , numbers .Number ]], typing . Tuple ]] = None ,
150
+ optionalArrayOf : typing .Optional [typing .Sequence [typing .Union [int , float , numbers .Number ]]] = None ,
148
151
optionalObjectOf : typing .Optional [typing .Dict [typing .Union [str , float , int ], typing .Union [int , float , numbers .Number ]]] = None ,
149
152
optionalObjectWithExactAndNestedDescription : typing .Optional ["OptionalObjectWithExactAndNestedDescription" ] = None ,
150
153
optionalObjectWithShapeAndNestedDescription : typing .Optional ["OptionalObjectWithShapeAndNestedDescription" ] = None ,
151
154
optionalAny : typing .Optional [typing .Any ] = None ,
152
155
customProp : typing .Optional [typing .Any ] = None ,
153
- customArrayProp : typing .Optional [typing .Union [ typing . Sequence [typing .Any ], typing . Tuple ]] = None ,
156
+ customArrayProp : typing .Optional [typing .Sequence [typing .Any ]] = None ,
154
157
id : typing .Optional [str ] = None ,
155
158
** kwargs
156
159
):
0 commit comments