nova-trame 0.14.1__py3-none-any.whl → 0.15.0__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.
- nova/trame/view/components/input_field.py +6 -2
- nova/trame/view/theme/assets/core_style.scss +5 -0
- nova/trame/view/theme/assets/js/delay_manager.js +4 -4
- nova/trame/view/theme/theme.py +1 -1
- {nova_trame-0.14.1.dist-info → nova_trame-0.15.0.dist-info}/LICENSE +1 -1
- {nova_trame-0.14.1.dist-info → nova_trame-0.15.0.dist-info}/METADATA +1 -1
- {nova_trame-0.14.1.dist-info → nova_trame-0.15.0.dist-info}/RECORD +9 -9
- {nova_trame-0.14.1.dist-info → nova_trame-0.15.0.dist-info}/WHEEL +1 -1
- {nova_trame-0.14.1.dist-info → nova_trame-0.15.0.dist-info}/entry_points.txt +0 -0
@@ -3,6 +3,7 @@
|
|
3
3
|
import logging
|
4
4
|
import os
|
5
5
|
import re
|
6
|
+
from enum import Enum
|
6
7
|
from typing import Any, Dict, Optional, Union
|
7
8
|
|
8
9
|
from trame.app import get_server
|
@@ -22,7 +23,7 @@ class InputField:
|
|
22
23
|
|
23
24
|
@staticmethod
|
24
25
|
def create_boilerplate_properties(
|
25
|
-
v_model: Optional[Union[tuple[str, Any], str]], debounce: int, throttle: int
|
26
|
+
v_model: Optional[Union[tuple[str, Any], str]], field_type: str, debounce: int, throttle: int
|
26
27
|
) -> dict:
|
27
28
|
if debounce == -1:
|
28
29
|
debounce = int(os.environ.get("NOVA_TRAME_DEFAULT_DEBOUNCE", 0))
|
@@ -69,6 +70,9 @@ class InputField:
|
|
69
70
|
"rules": (f"[(v) => trigger('validate_pydantic_field', ['{field}', v, index])]",),
|
70
71
|
}
|
71
72
|
|
73
|
+
if field_type == "select" and issubclass(field_info.annotation, Enum):
|
74
|
+
args |= {"items": str([option.value for option in field_info.annotation])}
|
75
|
+
|
72
76
|
if debounce > 0 and throttle > 0:
|
73
77
|
raise ValueError("debounce and throttle cannot be used together")
|
74
78
|
|
@@ -161,7 +165,7 @@ class InputField:
|
|
161
165
|
"""
|
162
166
|
server = get_server(None, client_type="vue3")
|
163
167
|
|
164
|
-
kwargs = {**cls.create_boilerplate_properties(v_model, debounce, throttle), **kwargs}
|
168
|
+
kwargs = {**cls.create_boilerplate_properties(v_model, type, debounce, throttle), **kwargs}
|
165
169
|
|
166
170
|
if "__events" not in kwargs or kwargs["__events"] is None:
|
167
171
|
kwargs["__events"] = []
|
@@ -4,20 +4,20 @@ class DelayManager {
|
|
4
4
|
this.throttles = {}
|
5
5
|
}
|
6
6
|
|
7
|
-
debounce(id, func, wait) {
|
7
|
+
debounce(id, func, wait, ...args) {
|
8
8
|
if (!(id in this.debounces)) {
|
9
9
|
this.debounces[id] = window.debounce(func, wait)
|
10
10
|
}
|
11
11
|
|
12
|
-
this.debounces[id]()
|
12
|
+
this.debounces[id](...args)
|
13
13
|
}
|
14
14
|
|
15
|
-
throttle(id, func, wait) {
|
15
|
+
throttle(id, func, wait, ...args) {
|
16
16
|
if (!(id in this.throttles)) {
|
17
17
|
this.throttles[id] = window.throttle(func, wait)
|
18
18
|
}
|
19
19
|
|
20
|
-
this.throttles[id]()
|
20
|
+
this.throttles[id](...args)
|
21
21
|
}
|
22
22
|
}
|
23
23
|
|
nova/trame/view/theme/theme.py
CHANGED
@@ -265,7 +265,7 @@ class ThemedApp:
|
|
265
265
|
footer.add_child(
|
266
266
|
'<a href="https://www.ornl.gov/" '
|
267
267
|
'class="text-grey-lighten-1 text-caption text-decoration-none" '
|
268
|
-
'target="_blank">©
|
268
|
+
'target="_blank">© {{ new Date().getFullYear() }} ORNL</a>'
|
269
269
|
)
|
270
270
|
|
271
271
|
@self.server.controller.trigger("validate_pydantic_field")
|
@@ -2,7 +2,7 @@ nova/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,65
|
|
2
2
|
nova/trame/__init__.py,sha256=gFrAg1qva5PIqR5TjvPzAxLx103IKipJLqp3XXvrQL8,59
|
3
3
|
nova/trame/model/remote_file_input.py,sha256=9KAf31ZHzpsh_aXUrNcF81Q5jvUZDWCzW1QATKls-Jk,3675
|
4
4
|
nova/trame/view/components/__init__.py,sha256=fopr6mVqcpDcVYK9ue7SLUHyswgvRPcFESTq86mu1R8,128
|
5
|
-
nova/trame/view/components/input_field.py,sha256=
|
5
|
+
nova/trame/view/components/input_field.py,sha256=8q18MyegDl0ni2Wpb6TwvTJ4UYoKSNINq9TilE5EnbE,14956
|
6
6
|
nova/trame/view/components/remote_file_input.py,sha256=k2yrwkell_g0sGnWR9XLL1LxkmFLr8-AGhduo8E-N4A,8669
|
7
7
|
nova/trame/view/components/visualization/__init__.py,sha256=kDX1fkbtAgXSGlqhlMNhYYoYrq-hfS636smjgLsh6gg,84
|
8
8
|
nova/trame/view/components/visualization/interactive_2d_plot.py,sha256=foZCMoqbuahT5dtqIQvm8C4ZJcY9P211eJEcpQJltmM,3421
|
@@ -11,17 +11,17 @@ nova/trame/view/layouts/grid.py,sha256=k-QHuH31XeAVDuMKUMoAMVnAM-Yavq7kdLYOC1ZrG
|
|
11
11
|
nova/trame/view/layouts/hbox.py,sha256=r5irhFX6YWTWN4V4NwNQx6mheyM8p6PVcJbrbhvOAwo,2625
|
12
12
|
nova/trame/view/layouts/vbox.py,sha256=Q4EvrtGJORyNF6AnCLGXToy8XU6yofiO5_kt7hK-AYs,2626
|
13
13
|
nova/trame/view/theme/__init__.py,sha256=70_marDlTigIcPEOGiJb2JTs-8b2sGM5SlY7XBPtBDM,54
|
14
|
-
nova/trame/view/theme/assets/core_style.scss,sha256=
|
14
|
+
nova/trame/view/theme/assets/core_style.scss,sha256=vr5L55sKj-eWeom4NaO3sYKtPgtM5O-KlYk1k15uI3Q,586
|
15
15
|
nova/trame/view/theme/assets/favicon.png,sha256=Xbp1nUmhcBDeObjsebEbEAraPDZ_M163M_ZLtm5AbQc,1927
|
16
|
-
nova/trame/view/theme/assets/js/delay_manager.js,sha256=
|
16
|
+
nova/trame/view/theme/assets/js/delay_manager.js,sha256=vmb34DZ5YCQIlRW9Tf2M_uvJW6HFCmtlKZ5e_TPR8yg,536
|
17
17
|
nova/trame/view/theme/assets/js/lodash.debounce.min.js,sha256=GLzlQH04WDUNYN7i39ttHHejSdu-CpAvfWgDgKDn-OY,4448
|
18
18
|
nova/trame/view/theme/assets/js/lodash.throttle.min.js,sha256=9csqjX-M-LVGJnF3z4ha1R_36O5AfkFE8rPHkxmt3tE,4677
|
19
19
|
nova/trame/view/theme/assets/vuetify_config.json,sha256=7WGV6rO7hv2sapGsX9yy1d-dINshYFXRNX99D9I3dKQ,4780
|
20
|
-
nova/trame/view/theme/theme.py,sha256=
|
20
|
+
nova/trame/view/theme/theme.py,sha256=18tHChrB1_qosjIiiLxMwWYRDTdXfgxEP4-4yJ8E3Cw,11893
|
21
21
|
nova/trame/view/utilities/local_storage.py,sha256=vD8f2VZIpxhIKjZwEaD7siiPCTZO4cw9AfhwdawwYLY,3218
|
22
22
|
nova/trame/view_model/remote_file_input.py,sha256=WHWCQkZBGeKLe1aTPbtVNI8tn-PDt64mi1-561uuBpQ,3320
|
23
|
-
nova_trame-0.
|
24
|
-
nova_trame-0.
|
25
|
-
nova_trame-0.
|
26
|
-
nova_trame-0.
|
27
|
-
nova_trame-0.
|
23
|
+
nova_trame-0.15.0.dist-info/LICENSE,sha256=Iu5QiDbwNbREg75iYaxIJ_V-zppuv4QFuBhAW-qiAlM,1061
|
24
|
+
nova_trame-0.15.0.dist-info/METADATA,sha256=Acdlyzs80ZpAlhUnCw5iFfw7N2zgGRu7B1eR1g9ZLlI,1240
|
25
|
+
nova_trame-0.15.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
26
|
+
nova_trame-0.15.0.dist-info/entry_points.txt,sha256=J2AmeSwiTYZ4ZqHHp9HO6v4MaYQTTBPbNh6WtoqOT58,42
|
27
|
+
nova_trame-0.15.0.dist-info/RECORD,,
|
File without changes
|