nova-trame 0.16.0__py3-none-any.whl → 0.17.1__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.
@@ -70,7 +70,7 @@ class InputField:
70
70
  "rules": (f"[(v) => trigger('validate_pydantic_field', ['{field}', v, index])]",),
71
71
  }
72
72
 
73
- if field_type == "select" and issubclass(field_info.annotation, Enum):
73
+ if field_type in ["autocomplete", "combobox", "select"] and issubclass(field_info.annotation, Enum):
74
74
  args |= {"items": str([option.value for option in field_info.annotation])}
75
75
 
76
76
  if debounce > 0 and throttle > 0:
@@ -123,25 +123,39 @@ class InputField:
123
123
  Number of milliseconds to wait after the last user interaction with this field before attempting to update
124
124
  the Trame state. If set to 0, then no debouncing will occur. If set to -1, then the environment variable
125
125
  `NOVA_TRAME_DEFAULT_DEBOUNCE` will be used to set this (defaults to 0). See the `Lodash Docs
126
- <https://lodash.com/docs/4.17.15#debounce>`_ for details.
126
+ <https://lodash.com/docs/4.17.15#debounce>`__ for details.
127
127
  throttle : int
128
128
  Number of milliseconds to wait between updates to the Trame state when the user is interacting with this
129
129
  field. If set to 0, then no throttling will occur. If set to -1, then the environment variable
130
130
  `NOVA_TRAME_DEFAULT_THROTTLE` will be used to set this (defaults to 0). See the `Lodash Docs
131
- <https://lodash.com/docs/4.17.15#throttle>`_ for details.
131
+ <https://lodash.com/docs/4.17.15#throttle>`__ for details.
132
132
  type : str
133
133
  The type of input to create. This can be any of the following:
134
134
 
135
- - autocomplete
136
- - autoscroll (produces a textarea that automatically scrolls to the bottom as new content is added)
135
+ - autocomplete - Produces a dropdown menu that supports autocompletion as the user types. Items can be \
136
+ automatically populated (see select option for details).
137
+ - autoscroll - Produces a textarea that automatically scrolls to the bottom as new content is added.
137
138
  - checkbox
138
- - combobox
139
+ - combobox - Produces a dropdown menu that supports autocompletion as the user types and allows users to \
140
+ add new items. Items can be automatically populated (see select option for details).
139
141
  - file
140
142
  - input
141
143
  - otp
142
144
  - radio
143
145
  - range-slider
144
- - select
146
+ - select - Produces a dropdown menu. This menu can have items automatically populated if the v_model is \
147
+ connected to a Pydantic field that uses an Enum type. Otherwise, you must specify the items parameter \
148
+ to `InputField`.
149
+
150
+ .. literalinclude:: ../tests/test_input_field.py
151
+ :start-after: items autopopulation start
152
+ :end-before: items autopopulation end
153
+ :dedent:
154
+
155
+ .. code-block:: python
156
+
157
+ InputField(v_model="dropdown.enum_field", type="select")
158
+
145
159
  - slider
146
160
  - switch
147
161
  - textarea
@@ -203,7 +217,6 @@ class InputField:
203
217
  items = kwargs.pop("items", None)
204
218
  if isinstance(items, str):
205
219
  items = (items,)
206
-
207
220
  input = vuetify.VSelect(items=items, **kwargs)
208
221
  case "slider":
209
222
  input = vuetify.VSlider(**kwargs)
@@ -275,7 +275,7 @@ class MatplotlibFigure(matplotlib.Figure):
275
275
  ready_%(port)d(
276
276
  function() {
277
277
  var websocket_type = mpl.get_websocket_type();
278
- var websocket = new websocket_type(`ws://${window.location.host}/mpl/%(port)d`);
278
+ var websocket = new websocket_type('mpl/%(port)d');
279
279
 
280
280
  var fig = new mpl.figure(
281
281
  // A unique numeric identifier for the figure
@@ -42,6 +42,12 @@ html {
42
42
  border-radius: 4px;
43
43
  }
44
44
 
45
+ .v-tab.v-btn {
46
+ height: 30px !important;
47
+ min-width: fit-content !important;
48
+ padding: 10px !important;
49
+ }
50
+
45
51
  .v-card-title,
46
52
  .v-list-item-title,
47
53
  .v-toolbar-title {
@@ -58,13 +64,25 @@ html {
58
64
  text-transform: none;
59
65
  }
60
66
 
67
+
61
68
  .v-label {
62
69
  font-size: 0.75rem;
63
70
  }
64
71
 
65
- .v-tab {
66
- height: 30px !important;
67
- min-width: fit-content !important;
68
- padding: 10px !important;
72
+ .v-field__input {
73
+ min-height: 30px;
74
+ padding: 5px;
75
+ }
76
+
77
+ .v-field {
78
+ margin: 8px 4px 8px 4px;
79
+ }
80
+
81
+ .v-field--active .v-label {
82
+ color: green;
83
+ }
84
+
85
+ .d-grid {
86
+ align-items:center;
69
87
  }
70
88
  }
@@ -158,9 +158,19 @@
158
158
  "VBtn": {
159
159
  "size": "small"
160
160
  },
161
+ "VFileInput": {
162
+ "variant": "outlined"
163
+ },
164
+ "VSelect": {
165
+ "variant": "outlined"
166
+ },
167
+ "VTextarea": {
168
+ "variant": "outlined"
169
+ },
161
170
  "VTextField": {
162
171
  "VBtn": {
163
- "size": "small"
172
+ "size": "small",
173
+ "variant": "outlined"
164
174
  }
165
175
  }
166
176
  },
@@ -178,4 +188,4 @@
178
188
  "lighten": 5
179
189
  }
180
190
  }
181
- }
191
+ }
@@ -31,13 +31,6 @@ class ThemedApp:
31
31
  """Automatically injects theming into your Trame application.
32
32
 
33
33
  You should always inherit from this class when you define your Trame application.
34
-
35
- Currently, it supports two themes:
36
-
37
- 1. ModernTheme - The recommended theme for most applications. Leverages ORNL brand colors and a typical Vuetify \
38
- appearance.
39
- 2. CompactTheme - Similar to ModernTheme but with a smaller global font size and reduced margins and paddings on \
40
- all components.
41
34
  """
42
35
 
43
36
  def __init__(
@@ -151,7 +144,10 @@ class ThemedApp:
151
144
  Parameters
152
145
  ----------
153
146
  theme : str, optional
154
- The new theme to use. If the theme is not found, the default theme will be used.
147
+ The new theme to use. If the theme is not found, the default theme will be used. The available options are:
148
+
149
+ 1. ModernTheme (default) - Leverages ORNL brand colors and a typical Vuetify appearance.
150
+ 2. CompactTheme - Similar to ModernTheme but with a smaller global font size and increased density.
155
151
  force : bool, optional
156
152
  If True, the theme will be set even if the theme selection menu is disabled.
157
153
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: nova-trame
3
- Version: 0.16.0
3
+ Version: 0.17.1
4
4
  Summary: A Python Package for injecting curated themes and custom components into Trame applications
5
5
  License: MIT
6
6
  Keywords: NDIP,Python,Trame,Vuetify
@@ -2,27 +2,27 @@ 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=8q18MyegDl0ni2Wpb6TwvTJ4UYoKSNINq9TilE5EnbE,14956
5
+ nova/trame/view/components/input_field.py,sha256=ncVVSzdJwH_-KP24I2rCqcb6v3J2hPhNTXr8Lb1EZ_U,15931
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=reqkkbhD5uSksHHlhVMy1qNUCwSekS5HlXk6wCREYxU,152
8
8
  nova/trame/view/components/visualization/interactive_2d_plot.py,sha256=foZCMoqbuahT5dtqIQvm8C4ZJcY9P211eJEcpQJltmM,3421
9
- nova/trame/view/components/visualization/matplotlib_figure.py,sha256=yop7Kd_MylUiCwEial2jOYESbvchrYhrpSmRowUhePY,12003
9
+ nova/trame/view/components/visualization/matplotlib_figure.py,sha256=xxgEAE2boc-sIFEIsbJxQZQ5biBMBXT0U8Il5299VNc,11974
10
10
  nova/trame/view/layouts/__init__.py,sha256=cMrlB5YMUoK8EGB83b34UU0kPTVrH8AxsYvKRtpUNEc,141
11
11
  nova/trame/view/layouts/grid.py,sha256=k-QHuH31XeAVDuMKUMoAMVnAM-Yavq7kdLYOC1ZrGTQ,5021
12
12
  nova/trame/view/layouts/hbox.py,sha256=r5irhFX6YWTWN4V4NwNQx6mheyM8p6PVcJbrbhvOAwo,2625
13
13
  nova/trame/view/layouts/vbox.py,sha256=Q4EvrtGJORyNF6AnCLGXToy8XU6yofiO5_kt7hK-AYs,2626
14
14
  nova/trame/view/theme/__init__.py,sha256=70_marDlTigIcPEOGiJb2JTs-8b2sGM5SlY7XBPtBDM,54
15
- nova/trame/view/theme/assets/core_style.scss,sha256=_RUO_WnxsteRXftfLQiql0TLh_9Vx93bxLeUBu8Xp3M,1284
15
+ nova/trame/view/theme/assets/core_style.scss,sha256=zZj7klB_iieNNTdh3WADpRbCA6WII0-nG86MKFEBYWY,1533
16
16
  nova/trame/view/theme/assets/favicon.png,sha256=Xbp1nUmhcBDeObjsebEbEAraPDZ_M163M_ZLtm5AbQc,1927
17
17
  nova/trame/view/theme/assets/js/delay_manager.js,sha256=vmb34DZ5YCQIlRW9Tf2M_uvJW6HFCmtlKZ5e_TPR8yg,536
18
18
  nova/trame/view/theme/assets/js/lodash.debounce.min.js,sha256=GLzlQH04WDUNYN7i39ttHHejSdu-CpAvfWgDgKDn-OY,4448
19
19
  nova/trame/view/theme/assets/js/lodash.throttle.min.js,sha256=9csqjX-M-LVGJnF3z4ha1R_36O5AfkFE8rPHkxmt3tE,4677
20
- nova/trame/view/theme/assets/vuetify_config.json,sha256=SQOPcwuAYTgYfkhyC1eB1TA8VtnMWZe7-P2ItJkOrX0,4736
21
- nova/trame/view/theme/theme.py,sha256=18tHChrB1_qosjIiiLxMwWYRDTdXfgxEP4-4yJ8E3Cw,11893
20
+ nova/trame/view/theme/assets/vuetify_config.json,sha256=B4uXKIj3hdinN483PrLQBiaveVfEqskuAYFRFGHrWus,5099
21
+ nova/trame/view/theme/theme.py,sha256=yBaHOvugzxh9vsBOGlOpp2IVMuLj922P6MSXoSz7tk0,11820
22
22
  nova/trame/view/utilities/local_storage.py,sha256=vD8f2VZIpxhIKjZwEaD7siiPCTZO4cw9AfhwdawwYLY,3218
23
23
  nova/trame/view_model/remote_file_input.py,sha256=WHWCQkZBGeKLe1aTPbtVNI8tn-PDt64mi1-561uuBpQ,3320
24
- nova_trame-0.16.0.dist-info/LICENSE,sha256=Iu5QiDbwNbREg75iYaxIJ_V-zppuv4QFuBhAW-qiAlM,1061
25
- nova_trame-0.16.0.dist-info/METADATA,sha256=-lnKJubLE96B49GZ567TOGxbxeNwqYX_R9KLaBo0FuY,1345
26
- nova_trame-0.16.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
27
- nova_trame-0.16.0.dist-info/entry_points.txt,sha256=J2AmeSwiTYZ4ZqHHp9HO6v4MaYQTTBPbNh6WtoqOT58,42
28
- nova_trame-0.16.0.dist-info/RECORD,,
24
+ nova_trame-0.17.1.dist-info/LICENSE,sha256=Iu5QiDbwNbREg75iYaxIJ_V-zppuv4QFuBhAW-qiAlM,1061
25
+ nova_trame-0.17.1.dist-info/METADATA,sha256=kk0lQjk9QG4NBNMLflO_b9fCnNBR459-OkHAhZ4K7Hg,1345
26
+ nova_trame-0.17.1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
27
+ nova_trame-0.17.1.dist-info/entry_points.txt,sha256=J2AmeSwiTYZ4ZqHHp9HO6v4MaYQTTBPbNh6WtoqOT58,42
28
+ nova_trame-0.17.1.dist-info/RECORD,,