dara-core 1.21.16__py3-none-any.whl → 1.21.17__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.
- dara/core/auth/base.py +5 -5
- dara/core/auth/basic.py +3 -3
- dara/core/auth/definitions.py +13 -14
- dara/core/auth/routes.py +7 -5
- dara/core/auth/utils.py +11 -10
- dara/core/base_definitions.py +30 -36
- dara/core/cli.py +7 -8
- dara/core/configuration.py +51 -58
- dara/core/css.py +2 -2
- dara/core/data_utils.py +12 -17
- dara/core/defaults.py +3 -3
- dara/core/definitions.py +58 -63
- dara/core/http.py +4 -4
- dara/core/interactivity/actions.py +34 -42
- dara/core/interactivity/any_data_variable.py +1 -1
- dara/core/interactivity/any_variable.py +6 -5
- dara/core/interactivity/client_variable.py +1 -2
- dara/core/interactivity/condition.py +2 -2
- dara/core/interactivity/data_variable.py +2 -4
- dara/core/interactivity/derived_data_variable.py +7 -10
- dara/core/interactivity/derived_variable.py +45 -51
- dara/core/interactivity/filtering.py +19 -19
- dara/core/interactivity/loop_variable.py +2 -4
- dara/core/interactivity/non_data_variable.py +1 -1
- dara/core/interactivity/plain_variable.py +21 -18
- dara/core/interactivity/server_variable.py +13 -15
- dara/core/interactivity/state_variable.py +4 -5
- dara/core/interactivity/switch_variable.py +16 -16
- dara/core/interactivity/tabular_variable.py +3 -3
- dara/core/interactivity/url_variable.py +3 -3
- dara/core/internal/cache_store/cache_store.py +6 -6
- dara/core/internal/cache_store/keep_all.py +3 -3
- dara/core/internal/cache_store/lru.py +8 -8
- dara/core/internal/cache_store/ttl.py +4 -4
- dara/core/internal/custom_response.py +3 -3
- dara/core/internal/dependency_resolution.py +6 -10
- dara/core/internal/devtools.py +2 -3
- dara/core/internal/download.py +5 -6
- dara/core/internal/encoder_registry.py +7 -11
- dara/core/internal/execute_action.py +5 -5
- dara/core/internal/hashing.py +1 -2
- dara/core/internal/import_discovery.py +7 -9
- dara/core/internal/normalization.py +12 -15
- dara/core/internal/pandas_utils.py +6 -6
- dara/core/internal/pool/channel.py +3 -4
- dara/core/internal/pool/definitions.py +9 -9
- dara/core/internal/pool/task_pool.py +8 -8
- dara/core/internal/pool/utils.py +4 -3
- dara/core/internal/pool/worker.py +3 -3
- dara/core/internal/registries.py +4 -4
- dara/core/internal/registry.py +3 -3
- dara/core/internal/registry_lookup.py +4 -4
- dara/core/internal/routing.py +23 -22
- dara/core/internal/scheduler.py +8 -8
- dara/core/internal/settings.py +1 -2
- dara/core/internal/store.py +9 -9
- dara/core/internal/tasks.py +30 -30
- dara/core/internal/utils.py +9 -15
- dara/core/internal/websocket.py +18 -18
- dara/core/js_tooling/js_utils.py +19 -19
- dara/core/logging.py +13 -13
- dara/core/main.py +4 -5
- dara/core/metrics/cache.py +2 -4
- dara/core/persistence.py +19 -25
- dara/core/router/compat.py +1 -3
- dara/core/router/components.py +10 -10
- dara/core/router/dependency_graph.py +2 -4
- dara/core/router/router.py +43 -42
- dara/core/visual/components/dynamic_component.py +1 -3
- dara/core/visual/components/fallback.py +3 -3
- dara/core/visual/components/for_cmp.py +5 -5
- dara/core/visual/components/menu.py +1 -3
- dara/core/visual/components/router_content.py +1 -3
- dara/core/visual/components/sidebar_frame.py +8 -10
- dara/core/visual/components/theme_provider.py +3 -3
- dara/core/visual/components/topbar_frame.py +8 -10
- dara/core/visual/css/__init__.py +277 -277
- dara/core/visual/dynamic_component.py +18 -22
- dara/core/visual/progress_updater.py +1 -1
- dara/core/visual/template.py +10 -12
- dara/core/visual/themes/definitions.py +46 -46
- {dara_core-1.21.16.dist-info → dara_core-1.21.17.dist-info}/METADATA +12 -13
- dara_core-1.21.17.dist-info/RECORD +127 -0
- dara_core-1.21.16.dist-info/RECORD +0 -127
- {dara_core-1.21.16.dist-info → dara_core-1.21.17.dist-info}/LICENSE +0 -0
- {dara_core-1.21.16.dist-info → dara_core-1.21.17.dist-info}/WHEEL +0 -0
- {dara_core-1.21.16.dist-info → dara_core-1.21.17.dist-info}/entry_points.txt +0 -0
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Dict
|
|
2
|
-
|
|
3
1
|
from pydantic import BaseModel, Field, SerializeAsAny
|
|
4
2
|
|
|
5
3
|
from dara.core.definitions import ComponentInstance
|
|
@@ -12,12 +10,12 @@ class DependencyGraph(BaseModel):
|
|
|
12
10
|
Data structure representing dependencies for derived state on a page
|
|
13
11
|
"""
|
|
14
12
|
|
|
15
|
-
derived_variables: SerializeAsAny[
|
|
13
|
+
derived_variables: SerializeAsAny[dict[str, DerivedVariable]] = Field(default_factory=dict)
|
|
16
14
|
"""
|
|
17
15
|
Map of DerivedVariable instances
|
|
18
16
|
"""
|
|
19
17
|
|
|
20
|
-
py_components: SerializeAsAny[
|
|
18
|
+
py_components: SerializeAsAny[dict[str, PyComponentInstance]] = Field(default_factory=dict)
|
|
21
19
|
"""
|
|
22
20
|
Map of PyComponentInstance instances
|
|
23
21
|
"""
|
dara/core/router/router.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
import re
|
|
3
3
|
from abc import abstractmethod
|
|
4
|
-
from
|
|
4
|
+
from collections.abc import Callable
|
|
5
|
+
from typing import Any, Literal, Optional, TypedDict
|
|
5
6
|
from urllib.parse import quote
|
|
6
7
|
from uuid import uuid4
|
|
7
8
|
|
|
@@ -29,7 +30,7 @@ PARAM_REGEX = re.compile(r':([\w-]+)\??')
|
|
|
29
30
|
STAR_REGEX = re.compile(r'\*$')
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
def find_patterns(path: str) ->
|
|
33
|
+
def find_patterns(path: str) -> list[str]:
|
|
33
34
|
"""
|
|
34
35
|
Extract param names from a React-Router-style path.
|
|
35
36
|
|
|
@@ -85,10 +86,10 @@ class RouteData(BaseModel):
|
|
|
85
86
|
Data structure representing a route in the router
|
|
86
87
|
"""
|
|
87
88
|
|
|
88
|
-
content:
|
|
89
|
-
on_load:
|
|
89
|
+
content: ComponentInstance | None = None
|
|
90
|
+
on_load: Action | None = None
|
|
90
91
|
definition: Optional['BaseRoute'] = None
|
|
91
|
-
dependency_graph:
|
|
92
|
+
dependency_graph: DependencyGraph | None = Field(default=None, exclude=True)
|
|
92
93
|
|
|
93
94
|
|
|
94
95
|
class BaseRoute(BaseModel):
|
|
@@ -101,13 +102,13 @@ class BaseRoute(BaseModel):
|
|
|
101
102
|
Whether the route is case sensitive
|
|
102
103
|
"""
|
|
103
104
|
|
|
104
|
-
id:
|
|
105
|
+
id: str | None = Field(default=None, pattern=r'^[a-zA-Z0-9-_]+$')
|
|
105
106
|
"""
|
|
106
107
|
Unique identifier for the route.
|
|
107
108
|
Must only contain alphanumeric characters, dashes and underscores.
|
|
108
109
|
"""
|
|
109
110
|
|
|
110
|
-
name:
|
|
111
|
+
name: str | None = None
|
|
111
112
|
"""
|
|
112
113
|
Name of the route, used for window.title display. If not set, defaults to
|
|
113
114
|
the route path.
|
|
@@ -118,7 +119,7 @@ class BaseRoute(BaseModel):
|
|
|
118
119
|
Metadata for the route. This is used to store arbitrary data that can be used by the application.
|
|
119
120
|
"""
|
|
120
121
|
|
|
121
|
-
fallback: SerializeAsAny[
|
|
122
|
+
fallback: SerializeAsAny[ComponentInstance | None] = Field(default=None)
|
|
122
123
|
"""
|
|
123
124
|
Fallback component to render while `on_load` is running.
|
|
124
125
|
If not set, Dara will wait until `on_load` completes before completing the navigation.
|
|
@@ -131,7 +132,7 @@ class BaseRoute(BaseModel):
|
|
|
131
132
|
if it's desirable to navigate to the other route immediately.
|
|
132
133
|
"""
|
|
133
134
|
|
|
134
|
-
on_load: SerializeAsAny[
|
|
135
|
+
on_load: SerializeAsAny[Action | None] = Field(default=None)
|
|
135
136
|
"""
|
|
136
137
|
Action to execute when the route is loaded.
|
|
137
138
|
Guaranteed to be executed before the route content is rendered.
|
|
@@ -142,7 +143,7 @@ class BaseRoute(BaseModel):
|
|
|
142
143
|
Internal unique identifier for the route
|
|
143
144
|
"""
|
|
144
145
|
|
|
145
|
-
compiled_data:
|
|
146
|
+
compiled_data: RouteData | None = Field(default=None, exclude=True, repr=False)
|
|
146
147
|
"""
|
|
147
148
|
Internal compiled data for the route
|
|
148
149
|
"""
|
|
@@ -235,7 +236,7 @@ class BaseRoute(BaseModel):
|
|
|
235
236
|
return self.compiled_data
|
|
236
237
|
|
|
237
238
|
@property
|
|
238
|
-
def full_path(self) ->
|
|
239
|
+
def full_path(self) -> str | None:
|
|
239
240
|
"""
|
|
240
241
|
Compute the full path from root to this route.
|
|
241
242
|
Returns None if route is not attached to a router.
|
|
@@ -279,7 +280,7 @@ class HasChildRoutes(BaseModel):
|
|
|
279
280
|
Mixin class for objects that can have child routes.
|
|
280
281
|
"""
|
|
281
282
|
|
|
282
|
-
children: SerializeAsAny[
|
|
283
|
+
children: SerializeAsAny[list['BaseRoute']] = Field(default_factory=list)
|
|
283
284
|
"""
|
|
284
285
|
List of child routes.
|
|
285
286
|
Should not be set directly. Use `set_children` or one of the `add_*` methods instead.
|
|
@@ -310,13 +311,13 @@ class HasChildRoutes(BaseModel):
|
|
|
310
311
|
self,
|
|
311
312
|
*,
|
|
312
313
|
path: str,
|
|
313
|
-
content:
|
|
314
|
+
content: Callable[..., ComponentInstance] | ComponentInstance,
|
|
314
315
|
case_sensitive: bool = False,
|
|
315
|
-
name:
|
|
316
|
-
id:
|
|
317
|
-
metadata:
|
|
318
|
-
on_load:
|
|
319
|
-
fallback:
|
|
316
|
+
name: str | None = None,
|
|
317
|
+
id: str | None = None,
|
|
318
|
+
metadata: dict | None = None,
|
|
319
|
+
on_load: Action | None = None,
|
|
320
|
+
fallback: ComponentInstance | None = None,
|
|
320
321
|
):
|
|
321
322
|
"""
|
|
322
323
|
Standard route with a unique URL segment and content to render
|
|
@@ -350,12 +351,12 @@ class HasChildRoutes(BaseModel):
|
|
|
350
351
|
def add_layout(
|
|
351
352
|
self,
|
|
352
353
|
*,
|
|
353
|
-
content:
|
|
354
|
+
content: Callable[..., ComponentInstance] | ComponentInstance,
|
|
354
355
|
case_sensitive: bool = False,
|
|
355
|
-
id:
|
|
356
|
-
metadata:
|
|
357
|
-
on_load:
|
|
358
|
-
fallback:
|
|
356
|
+
id: str | None = None,
|
|
357
|
+
metadata: dict | None = None,
|
|
358
|
+
on_load: Action | None = None,
|
|
359
|
+
fallback: ComponentInstance | None = None,
|
|
359
360
|
):
|
|
360
361
|
"""
|
|
361
362
|
Layout route creates a route with a layout component to render without adding any segments to the URL
|
|
@@ -409,10 +410,10 @@ class HasChildRoutes(BaseModel):
|
|
|
409
410
|
*,
|
|
410
411
|
path: str,
|
|
411
412
|
case_sensitive: bool = False,
|
|
412
|
-
id:
|
|
413
|
-
metadata:
|
|
414
|
-
on_load:
|
|
415
|
-
fallback:
|
|
413
|
+
id: str | None = None,
|
|
414
|
+
metadata: dict | None = None,
|
|
415
|
+
on_load: Action | None = None,
|
|
416
|
+
fallback: ComponentInstance | None = None,
|
|
416
417
|
):
|
|
417
418
|
"""
|
|
418
419
|
Prefix route creates a group of routes with a common prefix without a specific component to render
|
|
@@ -450,13 +451,13 @@ class HasChildRoutes(BaseModel):
|
|
|
450
451
|
def add_index(
|
|
451
452
|
self,
|
|
452
453
|
*,
|
|
453
|
-
content:
|
|
454
|
+
content: Callable[..., ComponentInstance] | ComponentInstance,
|
|
454
455
|
case_sensitive: bool = False,
|
|
455
|
-
name:
|
|
456
|
-
id:
|
|
457
|
-
metadata:
|
|
458
|
-
on_load:
|
|
459
|
-
fallback:
|
|
456
|
+
name: str | None = None,
|
|
457
|
+
id: str | None = None,
|
|
458
|
+
metadata: dict | None = None,
|
|
459
|
+
on_load: Action | None = None,
|
|
460
|
+
fallback: ComponentInstance | None = None,
|
|
460
461
|
):
|
|
461
462
|
"""
|
|
462
463
|
Index routes render into their parent's Outlet() at their parent URL (like a default child route).
|
|
@@ -518,7 +519,7 @@ class IndexRoute(BaseRoute):
|
|
|
518
519
|
"""
|
|
519
520
|
|
|
520
521
|
index: Literal[True] = True
|
|
521
|
-
content:
|
|
522
|
+
content: Callable[..., ComponentInstance] | ComponentInstance = Field(exclude=True)
|
|
522
523
|
|
|
523
524
|
def compile(self):
|
|
524
525
|
super().compile()
|
|
@@ -538,7 +539,7 @@ class PageRoute(BaseRoute, HasChildRoutes):
|
|
|
538
539
|
"""
|
|
539
540
|
|
|
540
541
|
path: str
|
|
541
|
-
content:
|
|
542
|
+
content: Callable[..., ComponentInstance] | ComponentInstance = Field(exclude=True)
|
|
542
543
|
|
|
543
544
|
def __init__(self, *children: BaseRoute, **kwargs):
|
|
544
545
|
routes = list(children)
|
|
@@ -588,7 +589,7 @@ class LayoutRoute(BaseRoute, HasChildRoutes):
|
|
|
588
589
|
- Project and EditProject will be rendered into the ProjectLayout outlet while ProjectsHome will not.
|
|
589
590
|
"""
|
|
590
591
|
|
|
591
|
-
content:
|
|
592
|
+
content: Callable[..., ComponentInstance] | ComponentInstance = Field(exclude=True)
|
|
592
593
|
|
|
593
594
|
def __init__(self, *children: BaseRoute, **kwargs):
|
|
594
595
|
routes = list(children)
|
|
@@ -723,11 +724,11 @@ class Router(HasChildRoutes):
|
|
|
723
724
|
for child in self.children:
|
|
724
725
|
child.compile()
|
|
725
726
|
|
|
726
|
-
def to_route_map(self) ->
|
|
727
|
+
def to_route_map(self) -> dict[str, RouteData]:
|
|
727
728
|
"""
|
|
728
729
|
Convert the route tree into a dictionary of route data keyed by unique route identifiers.
|
|
729
730
|
"""
|
|
730
|
-
routes:
|
|
731
|
+
routes: dict[str, RouteData] = {}
|
|
731
732
|
|
|
732
733
|
def _walk(route: BaseRoute):
|
|
733
734
|
identifier = route.get_identifier()
|
|
@@ -749,7 +750,7 @@ class Router(HasChildRoutes):
|
|
|
749
750
|
id: str
|
|
750
751
|
metadata: dict
|
|
751
752
|
|
|
752
|
-
def get_navigable_routes(self) ->
|
|
753
|
+
def get_navigable_routes(self) -> list[NavigableRoute]:
|
|
753
754
|
"""
|
|
754
755
|
Get a flattened list of all navigable routes (PageRoute and IndexRoute only).
|
|
755
756
|
|
|
@@ -810,10 +811,10 @@ class Router(HasChildRoutes):
|
|
|
810
811
|
print('Router')
|
|
811
812
|
self._print_routes(self.children, prefix='')
|
|
812
813
|
|
|
813
|
-
def _print_routes(self, routes:
|
|
814
|
+
def _print_routes(self, routes: list['BaseRoute'], prefix: str = ''):
|
|
814
815
|
"""Helper method to recursively print route tree structure"""
|
|
815
816
|
|
|
816
|
-
def _format_content(content:
|
|
817
|
+
def _format_content(content: Callable[..., ComponentInstance] | ComponentInstance):
|
|
817
818
|
if isinstance(content, ComponentInstance):
|
|
818
819
|
return content.__class__.__name__
|
|
819
820
|
return content.__name__
|
|
@@ -870,7 +871,7 @@ class Router(HasChildRoutes):
|
|
|
870
871
|
|
|
871
872
|
|
|
872
873
|
def _execute_route_func(
|
|
873
|
-
content:
|
|
874
|
+
content: Callable[..., ComponentInstance] | ComponentInstance, path: str | None
|
|
874
875
|
) -> ComponentInstance:
|
|
875
876
|
"""
|
|
876
877
|
Executes a route function or returns a ComponentInstance directly.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Union
|
|
2
|
-
|
|
3
1
|
from dara.core.definitions import ComponentInstance, JsComponentDef
|
|
4
2
|
|
|
5
3
|
DynamicComponentDef = JsComponentDef(name='DynamicComponent', js_module='@darajs/core', py_module='dara.core')
|
|
@@ -14,4 +12,4 @@ class DynamicComponent(ComponentInstance):
|
|
|
14
12
|
:param component: A Dara component instance or a dictionary representing a Dara component.
|
|
15
13
|
"""
|
|
16
14
|
|
|
17
|
-
component:
|
|
15
|
+
component: ComponentInstance | dict
|
|
@@ -48,7 +48,7 @@ class Fallback:
|
|
|
48
48
|
but will suspend and show a fallback UI after the given timeout if the new state is not ready.
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
|
-
py_component: ClassVar[
|
|
51
|
+
py_component: ClassVar[str | None] = 'DefaultFallback'
|
|
52
52
|
|
|
53
53
|
class Row(BaseFallback):
|
|
54
54
|
"""
|
|
@@ -73,7 +73,7 @@ class Fallback:
|
|
|
73
73
|
but will suspend and show a fallback UI after the given timeout if the new state is not ready.
|
|
74
74
|
"""
|
|
75
75
|
|
|
76
|
-
py_component: ClassVar[
|
|
76
|
+
py_component: ClassVar[str | None] = 'RowFallback'
|
|
77
77
|
|
|
78
78
|
class Custom(BaseFallback):
|
|
79
79
|
"""
|
|
@@ -97,5 +97,5 @@ class Fallback:
|
|
|
97
97
|
but will suspend and show a fallback UI after the given timeout if the new state is not ready.
|
|
98
98
|
"""
|
|
99
99
|
|
|
100
|
-
py_component: ClassVar[
|
|
100
|
+
py_component: ClassVar[str | None] = 'CustomFallback'
|
|
101
101
|
component: StyledComponentInstance
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Literal
|
|
1
|
+
from typing import Literal
|
|
2
2
|
|
|
3
3
|
from pydantic import Field
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ ForDef = JsComponentDef(name='For', js_module='@darajs/core', py_module='dara.co
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class VirtualizationConfig(DaraBaseModel):
|
|
13
|
-
size:
|
|
13
|
+
size: str | float | None = None
|
|
14
14
|
"""
|
|
15
15
|
The size of each element in the virtualized list.
|
|
16
16
|
If a number is provided, it will be treated as a fixed size.
|
|
@@ -148,6 +148,6 @@ class For(ComponentInstance):
|
|
|
148
148
|
|
|
149
149
|
items: AnyVariable
|
|
150
150
|
renderer: ComponentInstance
|
|
151
|
-
placeholder:
|
|
152
|
-
key_accessor:
|
|
153
|
-
virtualization:
|
|
151
|
+
placeholder: ComponentInstance | None = None
|
|
152
|
+
key_accessor: str | None = None
|
|
153
|
+
virtualization: VirtualizationConfig | None = None
|
|
@@ -15,8 +15,6 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
|
-
from typing import List
|
|
19
|
-
|
|
20
18
|
from pydantic import ConfigDict
|
|
21
19
|
from typing_extensions import deprecated
|
|
22
20
|
|
|
@@ -29,5 +27,5 @@ MenuDef = JsComponentDef(name='Menu', js_module='@darajs/core', py_module='dara.
|
|
|
29
27
|
'Legacy component used with templates and config.add_page API. Use dara.core.visual.components.MenuLink or NavLink instead.'
|
|
30
28
|
)
|
|
31
29
|
class Menu(ComponentInstance):
|
|
32
|
-
routes:
|
|
30
|
+
routes: list[TemplateRouterLink]
|
|
33
31
|
model_config = ConfigDict(extra='forbid')
|
|
@@ -15,8 +15,6 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
|
-
from typing import List
|
|
19
|
-
|
|
20
18
|
from pydantic import ConfigDict
|
|
21
19
|
|
|
22
20
|
from dara.core.definitions import (
|
|
@@ -29,5 +27,5 @@ RouterContentDef = JsComponentDef(name='RouterContent', js_module='@darajs/core'
|
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
class RouterContent(ComponentInstance):
|
|
32
|
-
routes:
|
|
30
|
+
routes: list[TemplateRouterContent]
|
|
33
31
|
model_config = ConfigDict(extra='forbid')
|
|
@@ -15,8 +15,6 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
|
-
from typing import Optional
|
|
19
|
-
|
|
20
18
|
from pydantic import ConfigDict
|
|
21
19
|
|
|
22
20
|
from dara.core.definitions import ComponentInstance, JsComponentDef
|
|
@@ -26,13 +24,13 @@ SideBarFrameDef = JsComponentDef(name='SideBarFrame', js_module='@darajs/core',
|
|
|
26
24
|
|
|
27
25
|
class SideBarFrame(ComponentInstance):
|
|
28
26
|
content: ComponentInstance
|
|
29
|
-
hide_logo:
|
|
30
|
-
logo_width:
|
|
31
|
-
logo_path:
|
|
32
|
-
logo_position:
|
|
27
|
+
hide_logo: bool | None = False
|
|
28
|
+
logo_width: str | None = '80%'
|
|
29
|
+
logo_path: str | None = None
|
|
30
|
+
logo_position: str | None = None
|
|
33
31
|
side_bar: ComponentInstance
|
|
34
|
-
side_bar_padding:
|
|
35
|
-
side_bar_position:
|
|
36
|
-
side_bar_width:
|
|
37
|
-
powered_by_causalens:
|
|
32
|
+
side_bar_padding: str | None = None
|
|
33
|
+
side_bar_position: str | None = None
|
|
34
|
+
side_bar_width: str | None = None
|
|
35
|
+
powered_by_causalens: bool | None = False
|
|
38
36
|
model_config = ConfigDict(extra='forbid')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Literal
|
|
1
|
+
from typing import Literal
|
|
2
2
|
|
|
3
3
|
from dara.core.definitions import ComponentInstance, JsComponentDef, StyledComponentInstance
|
|
4
4
|
from dara.core.interactivity.client_variable import ClientVariable
|
|
@@ -34,8 +34,8 @@ class ThemeProvider(StyledComponentInstance):
|
|
|
34
34
|
config.router.add_page(path='theme', content=ThemePage)
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
|
-
theme:
|
|
38
|
-
base:
|
|
37
|
+
theme: ThemeDef | ClientVariable | Literal['light', 'dark']
|
|
38
|
+
base: ClientVariable | Literal['light', 'dark'] = 'light'
|
|
39
39
|
|
|
40
40
|
def __init__(self, *children: ComponentInstance, **kwargs):
|
|
41
41
|
components = list(children)
|
|
@@ -15,8 +15,6 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
|
-
from typing import Optional
|
|
19
|
-
|
|
20
18
|
from pydantic import ConfigDict
|
|
21
19
|
|
|
22
20
|
from dara.core.definitions import ComponentInstance, JsComponentDef
|
|
@@ -26,12 +24,12 @@ TopBarFrameDef = JsComponentDef(name='TopBarFrame', js_module='@darajs/core', py
|
|
|
26
24
|
|
|
27
25
|
class TopBarFrame(ComponentInstance):
|
|
28
26
|
content: ComponentInstance
|
|
29
|
-
hide_logo:
|
|
30
|
-
logo_width:
|
|
31
|
-
logo_path:
|
|
32
|
-
logo_position:
|
|
33
|
-
top_bar:
|
|
34
|
-
top_bar_padding:
|
|
35
|
-
top_bar_position:
|
|
36
|
-
top_bar_height:
|
|
27
|
+
hide_logo: bool | None = False
|
|
28
|
+
logo_width: str | None = '10rem'
|
|
29
|
+
logo_path: str | None = None
|
|
30
|
+
logo_position: str | None = None
|
|
31
|
+
top_bar: ComponentInstance | None = None
|
|
32
|
+
top_bar_padding: str | None = None
|
|
33
|
+
top_bar_position: str | None = None
|
|
34
|
+
top_bar_height: str | None = None
|
|
37
35
|
model_config = ConfigDict(extra='forbid')
|