pyglove 0.4.5.dev202411060809__py3-none-any.whl → 0.4.5.dev202411070808__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 pyglove might be problematic. Click here for more details.
- pyglove/core/views/html/controls/label.py +6 -0
- pyglove/core/views/html/controls/tab.py +8 -8
- pyglove/core/views/html/controls/tab_test.py +6 -4
- {pyglove-0.4.5.dev202411060809.dist-info → pyglove-0.4.5.dev202411070808.dist-info}/METADATA +1 -1
- {pyglove-0.4.5.dev202411060809.dist-info → pyglove-0.4.5.dev202411070808.dist-info}/RECORD +8 -8
- {pyglove-0.4.5.dev202411060809.dist-info → pyglove-0.4.5.dev202411070808.dist-info}/LICENSE +0 -0
- {pyglove-0.4.5.dev202411060809.dist-info → pyglove-0.4.5.dev202411070808.dist-info}/WHEEL +0 -0
- {pyglove-0.4.5.dev202411060809.dist-info → pyglove-0.4.5.dev202411070808.dist-info}/top_level.txt +0 -0
@@ -46,6 +46,11 @@ class Label(HtmlControl):
|
|
46
46
|
'(Optional) The URL for the link of the label.'
|
47
47
|
] = None
|
48
48
|
|
49
|
+
target: Annotated[
|
50
|
+
Optional[str],
|
51
|
+
'(Optional) The target for the link of the label.'
|
52
|
+
] = None
|
53
|
+
|
49
54
|
def _on_bound(self):
|
50
55
|
super()._on_bound()
|
51
56
|
if self.tooltip is not None:
|
@@ -75,6 +80,7 @@ class Label(HtmlControl):
|
|
75
80
|
href=self.link,
|
76
81
|
css_classes=['label'] + self.css_classes,
|
77
82
|
styles=self.styles,
|
83
|
+
target=self.target,
|
78
84
|
)
|
79
85
|
if self.tooltip is None:
|
80
86
|
return text_elem
|
@@ -78,7 +78,7 @@ class TabControl(HtmlControl):
|
|
78
78
|
'selected' if i == self.selected else None
|
79
79
|
],
|
80
80
|
onclick=(
|
81
|
-
f"openTab(event, '{self.element_id(str(i))}')"
|
81
|
+
f"""openTab(event, '{self.element_id()}', '{self.element_id(str(i))}')"""
|
82
82
|
)
|
83
83
|
) for i, tab in enumerate(self.tabs)
|
84
84
|
],
|
@@ -98,16 +98,16 @@ class TabControl(HtmlControl):
|
|
98
98
|
) for i, tab in enumerate(self.tabs)
|
99
99
|
],
|
100
100
|
css_classes=['tab-control', self.tab_position] + self.css_classes,
|
101
|
-
id=self.
|
101
|
+
id=self.element_id(),
|
102
102
|
styles=self.styles,
|
103
103
|
).add_script(
|
104
104
|
"""
|
105
|
-
function openTab(event, tabId) {
|
106
|
-
const tabButtons = document.
|
105
|
+
function openTab(event, controlId, tabId) {
|
106
|
+
const tabButtons = document.querySelectorAll('#' + controlId + '> .tab-button-group > .tab-button');
|
107
107
|
for (let i = 0; i < tabButtons.length; i++) {
|
108
108
|
tabButtons[i].classList.remove('selected');
|
109
109
|
}
|
110
|
-
const tabContents = document.
|
110
|
+
const tabContents = document.querySelectorAll('#' + controlId + '> .tab-content');
|
111
111
|
for (let i = 0; i < tabContents.length; i++) {
|
112
112
|
tabContents[i].style.display = 'none';
|
113
113
|
}
|
@@ -120,15 +120,15 @@ class TabControl(HtmlControl):
|
|
120
120
|
"""
|
121
121
|
.top .tab-button-group {
|
122
122
|
overflow-x: hidden;
|
123
|
-
border-bottom: 1px solid #
|
123
|
+
border-bottom: 1px solid #EEE;
|
124
124
|
}
|
125
125
|
.left .tab-button-group {
|
126
126
|
float: left;
|
127
127
|
top: 0;
|
128
128
|
}
|
129
129
|
.tab-button {
|
130
|
-
background-color: #
|
131
|
-
border: 1px solid #
|
130
|
+
background-color: #EEE;
|
131
|
+
border: 1px solid #EEE;
|
132
132
|
outline: none;
|
133
133
|
cursor: pointer;
|
134
134
|
transition: 0.3s;
|
@@ -36,11 +36,13 @@ class TabControlTest(unittest.TestCase):
|
|
36
36
|
self.assert_html_content(
|
37
37
|
tab,
|
38
38
|
(
|
39
|
-
'<div class="tab-control top"
|
40
|
-
'<button class="tab-button selected" '
|
41
|
-
f'''onclick="openTab(event, '{tab.element_id(
|
39
|
+
f'<div class="tab-control top" id="{tab.element_id()}">'
|
40
|
+
'<div class="tab-button-group"><button class="tab-button selected" '
|
41
|
+
f'''onclick="openTab(event, '{tab.element_id()}', '''
|
42
|
+
f''''{tab.element_id(str(0))}')">'''
|
42
43
|
'<a class="label">foo</a></button><button class="tab-button" '
|
43
|
-
f'''onclick="openTab(event, '{tab.element_id(
|
44
|
+
f'''onclick="openTab(event, '{tab.element_id()}', '''
|
45
|
+
f''''{tab.element_id(str(1))}')">'''
|
44
46
|
'<a class="label">bar</a></button></div>'
|
45
47
|
'<div class="tab-content" style="display:block;" '
|
46
48
|
f'id="{tab.element_id(str(0))}"><h1>foo</h1></div>'
|
@@ -149,12 +149,12 @@ pyglove/core/views/html/tree_view.py,sha256=3Db0aOke-A7Inp-vgqebsDMwJ0Wvaznithkw
|
|
149
149
|
pyglove/core/views/html/tree_view_test.py,sha256=whUorrw0eiDaZsEzGB2B3EN3wx0vLFuNEe2RBU03GeU,74707
|
150
150
|
pyglove/core/views/html/controls/__init__.py,sha256=61qs5pnJPCTECCGBtkbNfIV3KcCu7cxfVNBEtIg1lMo,1318
|
151
151
|
pyglove/core/views/html/controls/base.py,sha256=eTUB2iJSBtD0sbkWE_LaVT1e4Sir6Q61HJ2j5OZxAsU,6615
|
152
|
-
pyglove/core/views/html/controls/label.py,sha256=
|
152
|
+
pyglove/core/views/html/controls/label.py,sha256=JggkrD3j6Z_zAl2B8HRACC1pExDJUeIHY5E51yKMarw,5202
|
153
153
|
pyglove/core/views/html/controls/label_test.py,sha256=3ekn3aBO1O8iG_wHpZ7487wY2YRA6wyKeDN7275iR4U,4544
|
154
154
|
pyglove/core/views/html/controls/progress_bar.py,sha256=kLdY3JQLCOv00ShldnQg3Qs8l1j_pDk148FoKfrZB64,5275
|
155
155
|
pyglove/core/views/html/controls/progress_bar_test.py,sha256=6u1A6kAV8GY_vUMD6PSl7HuuOkVMELYqU32YEVx6qz8,3500
|
156
|
-
pyglove/core/views/html/controls/tab.py,sha256=
|
157
|
-
pyglove/core/views/html/controls/tab_test.py,sha256=
|
156
|
+
pyglove/core/views/html/controls/tab.py,sha256=4m4pALSIQoIwVVz7hoMjQs1dgY3cOzyzJjT8ZikBNbQ,4958
|
157
|
+
pyglove/core/views/html/controls/tab_test.py,sha256=j54nyN9BJjS0sXJlxA45RQDSmPY2HDP5ttxc4sqkGpw,2121
|
158
158
|
pyglove/core/views/html/controls/tooltip.py,sha256=01BbpuM1twf3FYMUT09_Ck5JSSONe8QE9RmyA9nhCnU,3092
|
159
159
|
pyglove/core/views/html/controls/tooltip_test.py,sha256=17BY-WmZKpz9tCbySPcwG6KJyfeE_MeMyKxtfxorBQ0,3194
|
160
160
|
pyglove/ext/__init__.py,sha256=3jp8cJvKW6PENOZlmVAbT0w-GBRn_kjhc0wDX3XjpOE,755
|
@@ -196,8 +196,8 @@ pyglove/ext/scalars/randoms.py,sha256=LkMIIx7lOq_lvJvVS3BrgWGuWl7Pi91-lA-O8x_gZs
|
|
196
196
|
pyglove/ext/scalars/randoms_test.py,sha256=nEhiqarg8l_5EOucp59CYrpO2uKxS1pe0hmBdZUzRNM,2000
|
197
197
|
pyglove/ext/scalars/step_wise.py,sha256=IDw3tuTpv0KVh7AN44W43zqm1-E0HWPUlytWOQC9w3Y,3789
|
198
198
|
pyglove/ext/scalars/step_wise_test.py,sha256=TL1vJ19xVx2t5HKuyIzGoogF7N3Rm8YhLE6JF7i0iy8,2540
|
199
|
-
pyglove-0.4.5.
|
200
|
-
pyglove-0.4.5.
|
201
|
-
pyglove-0.4.5.
|
202
|
-
pyglove-0.4.5.
|
203
|
-
pyglove-0.4.5.
|
199
|
+
pyglove-0.4.5.dev202411070808.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
200
|
+
pyglove-0.4.5.dev202411070808.dist-info/METADATA,sha256=HCIZCRdPtyOx74IKdF6J4e3Aoy37DfLabPoEaYdQoQ0,6666
|
201
|
+
pyglove-0.4.5.dev202411070808.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
202
|
+
pyglove-0.4.5.dev202411070808.dist-info/top_level.txt,sha256=wITzJSKcj8GZUkbq-MvUQnFadkiuAv_qv5qQMw0fIow,8
|
203
|
+
pyglove-0.4.5.dev202411070808.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{pyglove-0.4.5.dev202411060809.dist-info → pyglove-0.4.5.dev202411070808.dist-info}/top_level.txt
RENAMED
File without changes
|