terra_ui_components 0.0.102__py3-none-any.whl → 0.0.103__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.
Potentially problematic release.
This version of terra_ui_components might be problematic. Click here for more details.
- terra_ui_components/base.py +2 -2
- terra_ui_components/login/login.py +28 -18
- {terra_ui_components-0.0.102.dist-info → terra_ui_components-0.0.103.dist-info}/METADATA +1 -1
- {terra_ui_components-0.0.102.dist-info → terra_ui_components-0.0.103.dist-info}/RECORD +6 -6
- {terra_ui_components-0.0.102.dist-info → terra_ui_components-0.0.103.dist-info}/WHEEL +0 -0
- {terra_ui_components-0.0.102.dist-info → terra_ui_components-0.0.103.dist-info}/licenses/LICENSE.md +0 -0
terra_ui_components/base.py
CHANGED
|
@@ -16,12 +16,12 @@ class TerraBaseWidget(anywidget.AnyWidget):
|
|
|
16
16
|
return f"""
|
|
17
17
|
const terraStyles = document.createElement('link')
|
|
18
18
|
terraStyles.rel = 'stylesheet'
|
|
19
|
-
terraStyles.href = 'https://cdn.jsdelivr.net/npm/@nasa-terra/components@0.0.
|
|
19
|
+
terraStyles.href = 'https://cdn.jsdelivr.net/npm/@nasa-terra/components@0.0.103/cdn/themes/horizon.css'
|
|
20
20
|
//terraStyles.href = "https://localhost:4000/dist/themes/horizon.css"
|
|
21
21
|
document.head.appendChild(terraStyles)
|
|
22
22
|
|
|
23
23
|
const terraAutoloader = document.createElement('script')
|
|
24
|
-
terraAutoloader.src = "https://cdn.jsdelivr.net/npm/@nasa-terra/components@0.0.
|
|
24
|
+
terraAutoloader.src = "https://cdn.jsdelivr.net/npm/@nasa-terra/components@0.0.103/cdn/terra-ui-components-autoloader.js"
|
|
25
25
|
//terraAutoloader.src = "https://localhost:4000/dist/terra-ui-components-autoloader.js"
|
|
26
26
|
terraAutoloader.type = 'module'
|
|
27
27
|
document.head.appendChild(terraAutoloader)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import importlib.metadata
|
|
2
|
+
import traitlets
|
|
2
3
|
from ..base import TerraBaseWidget
|
|
3
4
|
|
|
4
5
|
try:
|
|
@@ -8,20 +9,21 @@ except importlib.metadata.PackageNotFoundError:
|
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class TerraLogin(TerraBaseWidget):
|
|
11
|
-
_esm = (
|
|
12
|
-
TerraBaseWidget.get_autoloader()
|
|
13
|
-
+ """
|
|
12
|
+
_esm = TerraBaseWidget.get_autoloader() + """
|
|
14
13
|
function render({ model, el }) {
|
|
15
14
|
// create an instance of the component
|
|
16
15
|
let component = document.createElement('terra-login')
|
|
17
|
-
|
|
16
|
+
|
|
18
17
|
/**
|
|
19
18
|
* Set initial property values
|
|
20
19
|
* NOTE: In reality, we won't need to have the ability to set EVERY property in a Jupyter Notebook, feel free to remove the ones that don't make sense
|
|
21
20
|
*
|
|
22
21
|
* model.get() pulls from the Jupyter notebooks state. We'll use the state to set the initial value for each property
|
|
23
22
|
*/
|
|
24
|
-
component.
|
|
23
|
+
component.buttonLabel = model.get('buttonLabel')
|
|
24
|
+
component.loggedInMessage = model.get('loggedInMessage')
|
|
25
|
+
component.loggedOutMessage = model.get('loggedOutMessage')
|
|
26
|
+
component.loadingMessage = model.get('loadingMessage')
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* add the component to the cell
|
|
@@ -34,24 +36,32 @@ class TerraLogin(TerraBaseWidget):
|
|
|
34
36
|
* Set up property change handlers
|
|
35
37
|
* This way if someone in the Jupyter Notebook changes the property externally, we reflect the change
|
|
36
38
|
* back to the component.
|
|
37
|
-
*
|
|
39
|
+
*
|
|
38
40
|
* If this isn't here, the component can't be changed after it's initial render
|
|
39
41
|
*/
|
|
40
|
-
model.on('change:
|
|
41
|
-
component.
|
|
42
|
+
model.on('change:buttonLabel', () => {
|
|
43
|
+
component.buttonLabel = model.get('buttonLabel')
|
|
42
44
|
})
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
model.
|
|
51
|
-
model.save_changes()
|
|
45
|
+
model.on('change:loggedInMessage', () => {
|
|
46
|
+
component.loggedInMessage = model.get('loggedInMessage')
|
|
47
|
+
})
|
|
48
|
+
model.on('change:loggedOutMessage', () => {
|
|
49
|
+
component.loggedOutMessage = model.get('loggedOutMessage')
|
|
50
|
+
})
|
|
51
|
+
model.on('change:loadingMessage', () => {
|
|
52
|
+
component.loadingMessage = model.get('loadingMessage')
|
|
52
53
|
})
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
export default { render };
|
|
56
57
|
"""
|
|
57
|
-
|
|
58
|
+
|
|
59
|
+
# Component properties
|
|
60
|
+
# While we have properties in the component, we also need to tell Python about them as well.
|
|
61
|
+
# Again, you don't technically need all these. If Jupyter Notebooks don't need access to them, you can remove them from here
|
|
62
|
+
buttonLabel = traitlets.Unicode('').tag(sync=True)
|
|
63
|
+
loggedInMessage = traitlets.Unicode(
|
|
64
|
+
'You are logged in as {username}').tag(sync=True)
|
|
65
|
+
loggedOutMessage = traitlets.Unicode('').tag(sync=True)
|
|
66
|
+
loadingMessage = traitlets.Unicode(
|
|
67
|
+
'Please wait while we check if you are logged in...').tag(sync=True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
terra_ui_components/README.md,sha256=lBRXP8aio8W0AqDiXL9hkgGlPKfPTELiXZflujVT6BY,198
|
|
2
2
|
terra_ui_components/__init__.py,sha256=Af9Hf6jOQBv2IBFJX8ZUVTKmzpAKCcz0oT3XIF7yCN8,757
|
|
3
|
-
terra_ui_components/base.py,sha256=
|
|
3
|
+
terra_ui_components/base.py,sha256=6Ibaqda0xzPDOdMcMMUNnjubyI2fJLEIxfFiNw_QZg0,1226
|
|
4
4
|
terra_ui_components/accordion/__init__.py,sha256=xruOtrVmmzFKacs2B_lKpEnDh2PbBq-HUKCdceRNboU,67
|
|
5
5
|
terra_ui_components/accordion/accordion.py,sha256=3duUmiJ5DTMYfzMJmra8pt0CXXcOkcbY-aAb7-PVCIs,1789
|
|
6
6
|
terra_ui_components/browse_variables/__init__.py,sha256=JfrTDLSbAecttohBx_OuEC1qT-LoqGO4egStvlJY1Os,86
|
|
@@ -18,7 +18,7 @@ terra_ui_components/date_range_slider/date_range_slider.py,sha256=kE3vMFV-CZ45n8
|
|
|
18
18
|
terra_ui_components/dialog/__init__.py,sha256=6H2fOO3FawjPtowliaCxyneITsS4MXZy1YJYWgVKFCY,58
|
|
19
19
|
terra_ui_components/dialog/dialog.py,sha256=GRKktKwUpkSAE7gl8-ivZ5O18iK9oHEb2m7vKjxJIR0,1780
|
|
20
20
|
terra_ui_components/login/__init__.py,sha256=R9Rn-D770XK5bIsVdQ4EwiafuISYUxYpq15zxJeyk-A,55
|
|
21
|
-
terra_ui_components/login/login.py,sha256=
|
|
21
|
+
terra_ui_components/login/login.py,sha256=VkFUwoLKsoPq6yab5pF2Dir_NBh3oETQlnkFFCTAGyo,2682
|
|
22
22
|
terra_ui_components/plot_toolbar/__init__.py,sha256=rlk9bxXuNo75bIfZu91dDJupiFVOUpPzuUrMJZ5318E,74
|
|
23
23
|
terra_ui_components/plot_toolbar/plot_toolbar.py,sha256=VCKKZi3hD0qDAG6-exoU1hasWyG4r3A2yPo3TQ8PVoI,1797
|
|
24
24
|
terra_ui_components/time_average_map/__init__.py,sha256=l3UBuLYIj-5-HQcugO8pRtTynkhLTD1ZlxM_Gf84t5o,84
|
|
@@ -27,7 +27,7 @@ terra_ui_components/time_series/__init__.py,sha256=uXQun39vOajxJjfOIPC4W-909Sb8Q
|
|
|
27
27
|
terra_ui_components/time_series/time_series.py,sha256=M29nbYf-wmsxyu7WgeQu-pejF598zXuBd9MwAEIW704,3833
|
|
28
28
|
terra_ui_components/variable_keyword_search/__init__.py,sha256=yjNToGluREKDD4UbkIOROSdlCC4jO6sgHA741OEwVdk,107
|
|
29
29
|
terra_ui_components/variable_keyword_search/variable_keyword_search.py,sha256=D_jT-FAu0fubKsC0ttK_XF80ExehLnwLyvSLpVVik_o,3677
|
|
30
|
-
terra_ui_components-0.0.
|
|
31
|
-
terra_ui_components-0.0.
|
|
32
|
-
terra_ui_components-0.0.
|
|
33
|
-
terra_ui_components-0.0.
|
|
30
|
+
terra_ui_components-0.0.103.dist-info/METADATA,sha256=BT5nYCtmrM8XOzdPwwk-lnhD3wgvz-_jqfUCsjCUQ1Y,3091
|
|
31
|
+
terra_ui_components-0.0.103.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
32
|
+
terra_ui_components-0.0.103.dist-info/licenses/LICENSE.md,sha256=rJ_6y_yHe29CU6SBs8DtutDAGaw1BqO1FBWzNvSgwFQ,1065
|
|
33
|
+
terra_ui_components-0.0.103.dist-info/RECORD,,
|
|
File without changes
|
{terra_ui_components-0.0.102.dist-info → terra_ui_components-0.0.103.dist-info}/licenses/LICENSE.md
RENAMED
|
File without changes
|