streamlit-nightly 1.44.1.dev20250325__py3-none-any.whl → 1.44.1.dev20250327__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.
- streamlit/config.py +1 -1
- streamlit/elements/lib/options_selector_utils.py +26 -5
- streamlit/elements/widgets/button_group.py +42 -11
- streamlit/elements/widgets/multiselect.py +166 -26
- streamlit/elements/widgets/selectbox.py +182 -38
- streamlit/proto/MetricsEvent_pb2.py +1 -1
- streamlit/proto/MetricsEvent_pb2.pyi +10 -10
- streamlit/proto/MultiSelect_pb2.py +4 -2
- streamlit/proto/MultiSelect_pb2.pyi +14 -2
- streamlit/proto/Selectbox_pb2.py +4 -2
- streamlit/proto/Selectbox_pb2.pyi +15 -2
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.B-UWWWdT.js → FileDownload.esm.jX-9l2Ep.js} +1 -1
- streamlit/static/static/js/{FileHelper.DRtEaIrj.js → FileHelper.aCeQQwv9.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.B_xJLRtH.js → FormClearHelper.CWUgHOqb.js} +1 -1
- streamlit/static/static/js/{Hooks.DtzWH7N2.js → Hooks.z6bpnOa4.js} +1 -1
- streamlit/static/static/js/{InputInstructions.CkYMcz8B.js → InputInstructions.CxNXqmaa.js} +1 -1
- streamlit/static/static/js/{ProgressBar.Drx8XNKv.js → ProgressBar.DeJx_v03.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.BSkIOPqr.js → RenderInPortalIfExists.BzVEnQEP.js} +1 -1
- streamlit/static/static/js/{Toolbar.2r5jAJur.js → Toolbar.Buaxb3gQ.js} +1 -1
- streamlit/static/static/js/{base-input.CV_PJtfn.js → base-input.B02pchZb.js} +1 -1
- streamlit/static/static/js/{checkbox.CZjCrRM6.js → checkbox.BNevNWhL.js} +1 -1
- streamlit/static/static/js/{createSuper.wNbYZKaS.js → createSuper.HF1JI-bK.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CxDiXQOm.js → data-grid-overlay-editor.DHpEpsQ_.js} +1 -1
- streamlit/static/static/js/{downloader.BKhc9vo-.js → downloader.B32k91dq.js} +1 -1
- streamlit/static/static/js/{es6.DMMA5jEp.js → es6.j4L3xv_m.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.rU5g5dG9.js → iframeResizer.contentWindow.DQOV--zq.js} +1 -1
- streamlit/static/static/js/{index.C8fLs5OO.js → index.1tdxODWC.js} +1 -1
- streamlit/static/static/js/{index.CdUwInkp.js → index.B2-yUxP6.js} +1 -1
- streamlit/static/static/js/{index.Ci8MtnNW.js → index.B28jf8c_.js} +15 -15
- streamlit/static/static/js/{index.CLpTIY8k.js → index.BBHrAwbG.js} +1 -1
- streamlit/static/static/js/{index.BxcYwJga.js → index.BDIF1v3E.js} +1 -1
- streamlit/static/static/js/{index.YSxp_z0H.js → index.BRDvEQpe.js} +1 -1
- streamlit/static/static/js/{index.hYp-Io20.js → index.BT-PT2u0.js} +1 -1
- streamlit/static/static/js/{index.CcHn1Jbf.js → index.BTG2J5Pk.js} +1 -1
- streamlit/static/static/js/{index.PUoEdeCj.js → index.BUz0sS-V.js} +1 -1
- streamlit/static/static/js/{index.60o7QeO8.js → index.BeuGcxG8.js} +1 -1
- streamlit/static/static/js/{index.wpF1efVn.js → index.BnYJb__c.js} +1 -1
- streamlit/static/static/js/{index.DkHRVwYA.js → index.C-GJaT09.js} +12 -12
- streamlit/static/static/js/{index.BnFXM4vg.js → index.C1B9TyzK.js} +1 -1
- streamlit/static/static/js/{index.B5181i5i.js → index.CDMGlkYx.js} +1 -1
- streamlit/static/static/js/{index.poiWcDhd.js → index.CExICAHy.js} +1 -1
- streamlit/static/static/js/{index.C7Pn7DNY.js → index.CKYXxi_d.js} +1 -1
- streamlit/static/static/js/index.CPMy5pwd.js +1 -0
- streamlit/static/static/js/{index.aJaKE3aW.js → index.CTgHTp02.js} +1 -1
- streamlit/static/static/js/{index.BGHyjPoE.js → index.CTwaWONb.js} +1 -1
- streamlit/static/static/js/{index.CjiDtsfR.js → index.CcMFXZBL.js} +1 -1
- streamlit/static/static/js/index.ChvqDLgw.js +1 -0
- streamlit/static/static/js/{index.lLHaP-WG.js → index.ClfebD_T.js} +1 -1
- streamlit/static/static/js/{index.COu5ow_u.js → index.CpDe9l-f.js} +1 -1
- streamlit/static/static/js/{index.Dh-GaoLL.js → index.Cq_L2WtW.js} +1 -1
- streamlit/static/static/js/{index.Cj6d-zQP.js → index.DBEif7dq.js} +2 -2
- streamlit/static/static/js/{index.BW1ps7Ve.js → index.DNURUtUa.js} +2 -2
- streamlit/static/static/js/{index.6LeN9cCn.js → index.DTDyF8nE.js} +1 -1
- streamlit/static/static/js/{index.B_lGEToe.js → index.DaJw5fna.js} +1 -1
- streamlit/static/static/js/{index.CY2a3G5f.js → index.DbqewZ6W.js} +1 -1
- streamlit/static/static/js/{index.C5tuUwoV.js → index.DfvKnm4Q.js} +1 -1
- streamlit/static/static/js/{index.BvR3oAAg.js → index.DsRxnb2z.js} +1 -1
- streamlit/static/static/js/index.Nb8G9oM-.js +1 -0
- streamlit/static/static/js/{index.B5pjbkNu.js → index.R8Go3XlF.js} +1 -1
- streamlit/static/static/js/{index.DmhhLL_7.js → index.Uid-bSyh.js} +1 -1
- streamlit/static/static/js/{index.BDnhO8N2.js → index.V3D0L00K.js} +1 -1
- streamlit/static/static/js/{index.C5x1XZ52.js → index.m0rRkw04.js} +1 -1
- streamlit/static/static/js/{index.qaTnk5v5.js → index.qkhdJyyt.js} +6 -6
- streamlit/static/static/js/{input.hfihv8cy.js → input.DogdK8Cg.js} +1 -1
- streamlit/static/static/js/{memory.CwFUs_rm.js → memory.B_1d0kyG.js} +1 -1
- streamlit/static/static/js/{mergeWith.NipycHTn.js → mergeWith.9h0p6sC_.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BOZydn7S.js → number-overlay-editor.yRe6Yodu.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.BegGyJAz.js → possibleConstructorReturn.C73_6grg.js} +1 -1
- streamlit/static/static/js/{sandbox.UTLHU4Ul.js → sandbox.2u3nOS5d.js} +1 -1
- streamlit/static/static/js/{textarea.dlySzlub.js → textarea.DFCEFjUj.js} +1 -1
- streamlit/static/static/js/{timepicker.QFZeHTS5.js → timepicker.GuNna1EN.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.D1_QwNnQ.js → toConsumableArray.DARzcvE5.js} +1 -1
- streamlit/static/static/js/{uniqueId.DrcTmetR.js → uniqueId.fceb1ayN.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.jMbeuIfG.js → useBasicWidgetState.D6255-xX.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CsqSzHwu.js → useOnInputChange.BjnOKne4.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.Cnlc3o1n.js → withFullScreenWrapper.B7h9p1kI.js} +1 -1
- streamlit/testing/v1/element_tree.py +8 -3
- {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/RECORD +84 -84
- streamlit/static/static/js/index.BKHYl8ma.js +0 -1
- streamlit/static/static/js/index.CEK_kfj1.js +0 -1
- streamlit/static/static/js/index.DMOnosvH.js +0 -1
- {streamlit_nightly-1.44.1.dev20250325.data → streamlit_nightly-1.44.1.dev20250327.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.44.1.dev20250325.dist-info → streamlit_nightly-1.44.1.dev20250327.dist-info}/top_level.txt +0 -0
@@ -13,13 +13,16 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
from __future__ import annotations
|
15
15
|
|
16
|
-
from dataclasses import dataclass
|
17
16
|
from textwrap import dedent
|
18
|
-
from typing import TYPE_CHECKING, Any, Callable, Generic, cast, overload
|
17
|
+
from typing import TYPE_CHECKING, Any, Callable, Generic, Literal, cast, overload
|
19
18
|
|
20
19
|
from streamlit.dataframe_util import OptionSequence, convert_anything_to_list
|
21
20
|
from streamlit.elements.lib.form_utils import current_form_id
|
22
|
-
from streamlit.elements.lib.options_selector_utils import
|
21
|
+
from streamlit.elements.lib.options_selector_utils import (
|
22
|
+
create_mappings,
|
23
|
+
index_,
|
24
|
+
maybe_coerce_enum,
|
25
|
+
)
|
23
26
|
from streamlit.elements.lib.policies import (
|
24
27
|
check_widget_policies,
|
25
28
|
maybe_raise_label_warnings,
|
@@ -54,25 +57,80 @@ if TYPE_CHECKING:
|
|
54
57
|
from streamlit.delta_generator import DeltaGenerator
|
55
58
|
|
56
59
|
|
57
|
-
@dataclass
|
58
60
|
class SelectboxSerde(Generic[T]):
|
59
61
|
options: Sequence[T]
|
60
|
-
|
62
|
+
formatted_options: list[str]
|
63
|
+
formatted_option_to_option_index: dict[str, int]
|
64
|
+
default_option_index: int | None
|
65
|
+
|
66
|
+
def __init__(
|
67
|
+
self,
|
68
|
+
options: Sequence[T],
|
69
|
+
*,
|
70
|
+
formatted_options: list[str],
|
71
|
+
formatted_option_to_option_index: dict[str, int],
|
72
|
+
default_option_index: int | None = None,
|
73
|
+
):
|
74
|
+
"""Initialize the SelectboxSerde.
|
61
75
|
|
62
|
-
|
76
|
+
We do not store an option_to_formatted_option mapping because the generic
|
77
|
+
options might not be hashable, which would raise a RuntimeError. So we do
|
78
|
+
two lookups: option -> index -> formatted_option[index].
|
79
|
+
|
80
|
+
|
81
|
+
Parameters
|
82
|
+
----------
|
83
|
+
options : Sequence[T]
|
84
|
+
The sequence of selectable options.
|
85
|
+
formatted_options : list[str]
|
86
|
+
The string representations of each option. The formatted_options correspond
|
87
|
+
to the options sequence by index.
|
88
|
+
formatted_option_to_option_index : dict[str, int]
|
89
|
+
A mapping from formatted option strings to their corresponding indices in
|
90
|
+
the options sequence.
|
91
|
+
default_option_index : int or None, optional
|
92
|
+
The index of the default option to use when no selection is made.
|
93
|
+
If None, no default option is selected.
|
94
|
+
"""
|
95
|
+
|
96
|
+
self.options = options
|
97
|
+
self.formatted_options = formatted_options
|
98
|
+
self.formatted_option_to_option_index = formatted_option_to_option_index
|
99
|
+
self.default_option_index = default_option_index
|
100
|
+
|
101
|
+
def serialize(self, v: T | str | None) -> str | None:
|
63
102
|
if v is None:
|
64
103
|
return None
|
65
104
|
if len(self.options) == 0:
|
66
|
-
return
|
67
|
-
|
105
|
+
return ""
|
106
|
+
|
107
|
+
# we don't check for isinstance(v, str) because this could lead to wrong
|
108
|
+
# results if v is a string that is part of the options itself as it would
|
109
|
+
# skip formatting in that case
|
110
|
+
try:
|
111
|
+
option_index = index_(self.options, v)
|
112
|
+
return self.formatted_options[option_index]
|
113
|
+
except ValueError:
|
114
|
+
# we know that v is a string, otherwise it would have been found in the
|
115
|
+
# options
|
116
|
+
return cast("str", v)
|
68
117
|
|
69
118
|
def deserialize(
|
70
119
|
self,
|
71
|
-
ui_value:
|
120
|
+
ui_value: str | None,
|
72
121
|
widget_id: str = "",
|
73
|
-
) -> T | None:
|
74
|
-
|
75
|
-
|
122
|
+
) -> T | str | None:
|
123
|
+
# check if the option is pointing to a generic option type T,
|
124
|
+
# otherwise return the option itself
|
125
|
+
if ui_value is None:
|
126
|
+
return (
|
127
|
+
self.options[self.default_option_index]
|
128
|
+
if self.default_option_index is not None and len(self.options) > 0
|
129
|
+
else None
|
130
|
+
)
|
131
|
+
|
132
|
+
option_index = self.formatted_option_to_option_index.get(ui_value)
|
133
|
+
return self.options[option_index] if option_index is not None else ui_value
|
76
134
|
|
77
135
|
|
78
136
|
class SelectboxMixin:
|
@@ -82,53 +140,113 @@ class SelectboxMixin:
|
|
82
140
|
label: str,
|
83
141
|
options: OptionSequence[T],
|
84
142
|
index: int = 0,
|
85
|
-
format_func: Callable[[Any],
|
143
|
+
format_func: Callable[[Any], str] = str,
|
86
144
|
key: Key | None = None,
|
87
145
|
help: str | None = None,
|
88
146
|
on_change: WidgetCallback | None = None,
|
89
147
|
args: WidgetArgs | None = None,
|
90
148
|
kwargs: WidgetKwargs | None = None,
|
91
149
|
*, # keyword-only arguments:
|
92
|
-
placeholder: str
|
150
|
+
placeholder: str | None = None,
|
93
151
|
disabled: bool = False,
|
94
152
|
label_visibility: LabelVisibility = "visible",
|
153
|
+
accept_new_options: Literal[False] = False,
|
95
154
|
) -> T: ...
|
96
155
|
|
156
|
+
@overload
|
157
|
+
def selectbox(
|
158
|
+
self,
|
159
|
+
label: str,
|
160
|
+
options: OptionSequence[T],
|
161
|
+
index: int = 0,
|
162
|
+
format_func: Callable[[Any], str] = str,
|
163
|
+
key: Key | None = None,
|
164
|
+
help: str | None = None,
|
165
|
+
on_change: WidgetCallback | None = None,
|
166
|
+
args: WidgetArgs | None = None,
|
167
|
+
kwargs: WidgetKwargs | None = None,
|
168
|
+
*, # keyword-only arguments:
|
169
|
+
placeholder: str | None = None,
|
170
|
+
disabled: bool = False,
|
171
|
+
label_visibility: LabelVisibility = "visible",
|
172
|
+
accept_new_options: Literal[True] = True,
|
173
|
+
) -> T | str: ...
|
174
|
+
|
97
175
|
@overload
|
98
176
|
def selectbox(
|
99
177
|
self,
|
100
178
|
label: str,
|
101
179
|
options: OptionSequence[T],
|
102
180
|
index: None,
|
103
|
-
format_func: Callable[[Any],
|
181
|
+
format_func: Callable[[Any], str] = str,
|
104
182
|
key: Key | None = None,
|
105
183
|
help: str | None = None,
|
106
184
|
on_change: WidgetCallback | None = None,
|
107
185
|
args: WidgetArgs | None = None,
|
108
186
|
kwargs: WidgetKwargs | None = None,
|
109
187
|
*, # keyword-only arguments:
|
110
|
-
placeholder: str
|
188
|
+
placeholder: str | None = None,
|
111
189
|
disabled: bool = False,
|
112
190
|
label_visibility: LabelVisibility = "visible",
|
191
|
+
accept_new_options: Literal[False] = False,
|
113
192
|
) -> T | None: ...
|
114
193
|
|
194
|
+
@overload
|
195
|
+
def selectbox(
|
196
|
+
self,
|
197
|
+
label: str,
|
198
|
+
options: OptionSequence[T],
|
199
|
+
index: None,
|
200
|
+
format_func: Callable[[Any], str] = str,
|
201
|
+
key: Key | None = None,
|
202
|
+
help: str | None = None,
|
203
|
+
on_change: WidgetCallback | None = None,
|
204
|
+
args: WidgetArgs | None = None,
|
205
|
+
kwargs: WidgetKwargs | None = None,
|
206
|
+
*, # keyword-only arguments:
|
207
|
+
placeholder: str | None = None,
|
208
|
+
disabled: bool = False,
|
209
|
+
label_visibility: LabelVisibility = "visible",
|
210
|
+
accept_new_options: Literal[True] = True,
|
211
|
+
) -> T | str | None: ...
|
212
|
+
|
213
|
+
@overload
|
214
|
+
def selectbox(
|
215
|
+
self,
|
216
|
+
label: str,
|
217
|
+
options: OptionSequence[T],
|
218
|
+
index: int | None = 0,
|
219
|
+
format_func: Callable[[Any], str] = str,
|
220
|
+
key: Key | None = None,
|
221
|
+
help: str | None = None,
|
222
|
+
on_change: WidgetCallback | None = None,
|
223
|
+
args: WidgetArgs | None = None,
|
224
|
+
kwargs: WidgetKwargs | None = None,
|
225
|
+
*, # keyword-only arguments:
|
226
|
+
placeholder: str | None = None,
|
227
|
+
disabled: bool = False,
|
228
|
+
label_visibility: LabelVisibility = "visible",
|
229
|
+
accept_new_options: bool = False,
|
230
|
+
) -> T | str | None: ...
|
231
|
+
|
115
232
|
@gather_metrics("selectbox")
|
116
233
|
def selectbox(
|
117
234
|
self,
|
118
235
|
label: str,
|
119
236
|
options: OptionSequence[T],
|
120
237
|
index: int | None = 0,
|
121
|
-
format_func: Callable[[Any],
|
238
|
+
format_func: Callable[[Any], str] = str,
|
122
239
|
key: Key | None = None,
|
123
240
|
help: str | None = None,
|
124
241
|
on_change: WidgetCallback | None = None,
|
125
242
|
args: WidgetArgs | None = None,
|
126
243
|
kwargs: WidgetKwargs | None = None,
|
127
244
|
*, # keyword-only arguments:
|
128
|
-
placeholder: str
|
245
|
+
placeholder: str | None = None,
|
129
246
|
disabled: bool = False,
|
130
247
|
label_visibility: LabelVisibility = "visible",
|
131
|
-
|
248
|
+
accept_new_options: bool = False,
|
249
|
+
) -> T | str | None:
|
132
250
|
r"""Display a select widget.
|
133
251
|
|
134
252
|
Parameters
|
@@ -197,7 +315,8 @@ class SelectboxMixin:
|
|
197
315
|
|
198
316
|
placeholder : str
|
199
317
|
A string to display when no options are selected.
|
200
|
-
Defaults to "Choose an option"
|
318
|
+
Defaults to "Choose an option." or, if
|
319
|
+
``accept_new_options`` is set to ``True``, to "Choose or add an option".
|
201
320
|
|
202
321
|
disabled : bool
|
203
322
|
An optional boolean that disables the selectbox if set to ``True``.
|
@@ -209,6 +328,11 @@ class SelectboxMixin:
|
|
209
328
|
label, which can help keep the widget alligned with other widgets.
|
210
329
|
If this is ``"collapsed"``, Streamlit displays no label or spacer.
|
211
330
|
|
331
|
+
accept_new_options : bool
|
332
|
+
If ``True``, the user can enter a new option in the UI that is not part of
|
333
|
+
passed the options. The newly entered option gets selected.
|
334
|
+
The default is ``False``.
|
335
|
+
|
212
336
|
Returns
|
213
337
|
-------
|
214
338
|
any
|
@@ -261,6 +385,7 @@ class SelectboxMixin:
|
|
261
385
|
placeholder=placeholder,
|
262
386
|
disabled=disabled,
|
263
387
|
label_visibility=label_visibility,
|
388
|
+
accept_new_options=accept_new_options,
|
264
389
|
ctx=ctx,
|
265
390
|
)
|
266
391
|
|
@@ -276,11 +401,12 @@ class SelectboxMixin:
|
|
276
401
|
args: WidgetArgs | None = None,
|
277
402
|
kwargs: WidgetKwargs | None = None,
|
278
403
|
*, # keyword-only arguments:
|
279
|
-
placeholder: str
|
404
|
+
placeholder: str | None = None,
|
280
405
|
disabled: bool = False,
|
281
406
|
label_visibility: LabelVisibility = "visible",
|
407
|
+
accept_new_options: bool = False,
|
282
408
|
ctx: ScriptRunContext | None = None,
|
283
|
-
) -> T | None:
|
409
|
+
) -> T | str | None:
|
284
410
|
key = to_key(key)
|
285
411
|
|
286
412
|
check_widget_policies(
|
@@ -294,27 +420,40 @@ class SelectboxMixin:
|
|
294
420
|
opt = convert_anything_to_list(options)
|
295
421
|
check_python_comparable(opt)
|
296
422
|
|
423
|
+
if not isinstance(index, int) and index is not None:
|
424
|
+
raise StreamlitAPIException(
|
425
|
+
"Selectbox Value has invalid type: %s" % type(index).__name__
|
426
|
+
)
|
427
|
+
|
428
|
+
if index is not None and len(opt) > 0 and not 0 <= index < len(opt):
|
429
|
+
raise StreamlitAPIException(
|
430
|
+
"Selectbox index must be greater than or equal to 0 "
|
431
|
+
"and less than the length of options."
|
432
|
+
)
|
433
|
+
|
434
|
+
if placeholder is None:
|
435
|
+
placeholder = (
|
436
|
+
"Choose an option"
|
437
|
+
if not accept_new_options
|
438
|
+
else "Choose or add an option"
|
439
|
+
)
|
440
|
+
|
441
|
+
formatted_options, formatted_option_to_option_index = create_mappings(
|
442
|
+
opt, format_func
|
443
|
+
)
|
444
|
+
|
297
445
|
element_id = compute_and_register_element_id(
|
298
446
|
"selectbox",
|
299
447
|
user_key=key,
|
300
448
|
form_id=current_form_id(self.dg),
|
301
449
|
label=label,
|
302
|
-
options=
|
450
|
+
options=formatted_options,
|
303
451
|
index=index,
|
304
452
|
help=help,
|
305
453
|
placeholder=placeholder,
|
454
|
+
accept_new_options=accept_new_options,
|
306
455
|
)
|
307
456
|
|
308
|
-
if not isinstance(index, int) and index is not None:
|
309
|
-
raise StreamlitAPIException(
|
310
|
-
"Selectbox Value has invalid type: %s" % type(index).__name__
|
311
|
-
)
|
312
|
-
|
313
|
-
if index is not None and len(opt) > 0 and not 0 <= index < len(opt):
|
314
|
-
raise StreamlitAPIException(
|
315
|
-
"Selectbox index must be greater than or equal to 0 and less than the length of options."
|
316
|
-
)
|
317
|
-
|
318
457
|
session_state = get_session_state().filtered_state
|
319
458
|
if key is not None and key in session_state and session_state[key] is None:
|
320
459
|
index = None
|
@@ -324,19 +463,24 @@ class SelectboxMixin:
|
|
324
463
|
selectbox_proto.label = label
|
325
464
|
if index is not None:
|
326
465
|
selectbox_proto.default = index
|
327
|
-
selectbox_proto.options[:] =
|
466
|
+
selectbox_proto.options[:] = formatted_options
|
328
467
|
selectbox_proto.form_id = current_form_id(self.dg)
|
329
468
|
selectbox_proto.placeholder = placeholder
|
330
469
|
selectbox_proto.disabled = disabled
|
331
470
|
selectbox_proto.label_visibility.value = get_label_visibility_proto_value(
|
332
471
|
label_visibility
|
333
472
|
)
|
473
|
+
selectbox_proto.accept_new_options = accept_new_options
|
334
474
|
|
335
475
|
if help is not None:
|
336
476
|
selectbox_proto.help = dedent(help)
|
337
477
|
|
338
|
-
serde = SelectboxSerde(
|
339
|
-
|
478
|
+
serde = SelectboxSerde(
|
479
|
+
opt,
|
480
|
+
formatted_options=formatted_options,
|
481
|
+
formatted_option_to_option_index=formatted_option_to_option_index,
|
482
|
+
default_option_index=index,
|
483
|
+
)
|
340
484
|
widget_state = register_widget(
|
341
485
|
selectbox_proto.id,
|
342
486
|
on_change_handler=on_change,
|
@@ -345,14 +489,14 @@ class SelectboxMixin:
|
|
345
489
|
deserializer=serde.deserialize,
|
346
490
|
serializer=serde.serialize,
|
347
491
|
ctx=ctx,
|
348
|
-
value_type="
|
492
|
+
value_type="string_value",
|
349
493
|
)
|
350
494
|
widget_state = maybe_coerce_enum(widget_state, options, opt)
|
351
495
|
|
352
496
|
if widget_state.value_changed:
|
353
497
|
serialized_value = serde.serialize(widget_state.value)
|
354
498
|
if serialized_value is not None:
|
355
|
-
selectbox_proto.
|
499
|
+
selectbox_proto.raw_value = serialized_value
|
356
500
|
selectbox_proto.set_value = True
|
357
501
|
|
358
502
|
if ctx:
|
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
|
|
15
15
|
from streamlit.proto import PageProfile_pb2 as streamlit_dot_proto_dot_PageProfile__pb2
|
16
16
|
|
17
17
|
|
18
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"streamlit/proto/MetricsEvent.proto\x1a!streamlit/proto/PageProfile.proto\"\xea\x06\n\x0cMetricsEvent\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x14\n\x0c\x61nonymous_id\x18\x02 \x01(\t\x12\x15\n\rmachine_id_v3\x18\x03 \x01(\t\x12\x13\n\x0breport_hash\x18\x04 \x01(\t\x12\x0b\n\x03\x64\x65v\x18\x05 \x01(\x08\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x19\n\x11streamlit_version\x18\x07 \x01(\t\x12\x10\n\x08is_hello\x18\x08 \x01(\x08\x12\x11\n\thosted_at\x18\t \x01(\t\x12\r\n\x05owner\x18\n \x01(\t\x12\x0c\n\x04repo\x18\x0b \x01(\t\x12\x0e\n\x06\x62ranch\x18\x0c \x01(\t\x12\x13\n\x0bmain_module\x18\r \x01(\t\x12\x12\n\ncreator_id\x18\x0e \x01(\t\x12\x18\n\x10\x63ontext_page_url\x18\x0f \x01(\t\x12\x1a\n\x12\x63ontext_page_title\x18\x10 \x01(\t\x12\x19\n\x11\x63ontext_page_path\x18\x11 \x01(\t\x12\x1d\n\x15\x63ontext_page_referrer\x18\x12 \x01(\t\x12\x1b\n\x13\x63ontext_page_search\x18\x13 \x01(\t\x12\x16\n\x0e\x63ontext_locale\x18\x14 \x01(\t\x12\x1a\n\x12\x63ontext_user_agent\x18\x15 \x01(\t\x12\r\n\x05label\x18\x16 \x01(\t\x12\x1a\n\x08\x63ommands\x18\x17 \x03(\x0b\x32\x08.Command\x12\x11\n\texec_time\x18\x18 \x01(\x03\x12\x11\n\tprep_time\x18\x19 \x01(\x03\x12\x0e\n\x06\x63onfig\x18\x1a \x03(\t\x12\x1a\n\x12uncaught_exception\x18\x1b \x01(\t\x12\x14\n\x0c\x61ttributions\x18\x1c \x03(\t\x12\n\n\x02os\x18\x1d \x01(\t\x12\x10\n\x08timezone\x18\x1e \x01(\t\x12\x10\n\x08headless\x18\x1f \x01(\x08\x12\x17\n\x0fis_fragment_run\x18 \x01(\x08\x12\
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"streamlit/proto/MetricsEvent.proto\x1a!streamlit/proto/PageProfile.proto\"\xea\x06\n\x0cMetricsEvent\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x14\n\x0c\x61nonymous_id\x18\x02 \x01(\t\x12\x15\n\rmachine_id_v3\x18\x03 \x01(\t\x12\x13\n\x0breport_hash\x18\x04 \x01(\t\x12\x0b\n\x03\x64\x65v\x18\x05 \x01(\x08\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x19\n\x11streamlit_version\x18\x07 \x01(\t\x12\x10\n\x08is_hello\x18\x08 \x01(\x08\x12\x0e\n\x06\x61pp_id\x18! \x01(\t\x12\x12\n\nsession_id\x18# \x01(\t\x12\x16\n\x0epython_version\x18$ \x01(\t\x12\x11\n\thosted_at\x18\t \x01(\t\x12\r\n\x05owner\x18\n \x01(\t\x12\x0c\n\x04repo\x18\x0b \x01(\t\x12\x0e\n\x06\x62ranch\x18\x0c \x01(\t\x12\x13\n\x0bmain_module\x18\r \x01(\t\x12\x12\n\ncreator_id\x18\x0e \x01(\t\x12\x18\n\x10\x63ontext_page_url\x18\x0f \x01(\t\x12\x1a\n\x12\x63ontext_page_title\x18\x10 \x01(\t\x12\x19\n\x11\x63ontext_page_path\x18\x11 \x01(\t\x12\x1d\n\x15\x63ontext_page_referrer\x18\x12 \x01(\t\x12\x1b\n\x13\x63ontext_page_search\x18\x13 \x01(\t\x12\x16\n\x0e\x63ontext_locale\x18\x14 \x01(\t\x12\x1a\n\x12\x63ontext_user_agent\x18\x15 \x01(\t\x12\r\n\x05label\x18\x16 \x01(\t\x12\x1a\n\x08\x63ommands\x18\x17 \x03(\x0b\x32\x08.Command\x12\x11\n\texec_time\x18\x18 \x01(\x03\x12\x11\n\tprep_time\x18\x19 \x01(\x03\x12\x0e\n\x06\x63onfig\x18\x1a \x03(\t\x12\x1a\n\x12uncaught_exception\x18\x1b \x01(\t\x12\x14\n\x0c\x61ttributions\x18\x1c \x03(\t\x12\n\n\x02os\x18\x1d \x01(\t\x12\x10\n\x08timezone\x18\x1e \x01(\t\x12\x10\n\x08headless\x18\x1f \x01(\x08\x12\x17\n\x0fis_fragment_run\x18 \x01(\x08\x12\x10\n\x08numPages\x18\" \x01(\x03\x12\x18\n\x10page_script_hash\x18% \x01(\t\x12\x14\n\x0c\x61\x63tive_theme\x18& \x01(\t\x12\x17\n\x0ftotal_load_time\x18\' \x01(\x03\x12\"\n\x0c\x62rowser_info\x18( \x01(\x0b\x32\x0c.BrowserInfo\"]\n\x0b\x42rowserInfo\x12\x14\n\x0c\x62rowser_name\x18\x01 \x01(\t\x12\x17\n\x0f\x62rowser_version\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x03 \x01(\t\x12\n\n\x02os\x18\x04 \x01(\tB1\n\x1c\x63om.snowflake.apps.streamlitB\x11MetricsEventProtob\x06proto3')
|
19
19
|
|
20
20
|
_globals = globals()
|
21
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -41,6 +41,9 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
41
41
|
SOURCE_FIELD_NUMBER: builtins.int
|
42
42
|
STREAMLIT_VERSION_FIELD_NUMBER: builtins.int
|
43
43
|
IS_HELLO_FIELD_NUMBER: builtins.int
|
44
|
+
APP_ID_FIELD_NUMBER: builtins.int
|
45
|
+
SESSION_ID_FIELD_NUMBER: builtins.int
|
46
|
+
PYTHON_VERSION_FIELD_NUMBER: builtins.int
|
44
47
|
HOSTED_AT_FIELD_NUMBER: builtins.int
|
45
48
|
OWNER_FIELD_NUMBER: builtins.int
|
46
49
|
REPO_FIELD_NUMBER: builtins.int
|
@@ -65,10 +68,7 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
65
68
|
TIMEZONE_FIELD_NUMBER: builtins.int
|
66
69
|
HEADLESS_FIELD_NUMBER: builtins.int
|
67
70
|
IS_FRAGMENT_RUN_FIELD_NUMBER: builtins.int
|
68
|
-
APP_ID_FIELD_NUMBER: builtins.int
|
69
71
|
NUMPAGES_FIELD_NUMBER: builtins.int
|
70
|
-
SESSION_ID_FIELD_NUMBER: builtins.int
|
71
|
-
PYTHON_VERSION_FIELD_NUMBER: builtins.int
|
72
72
|
PAGE_SCRIPT_HASH_FIELD_NUMBER: builtins.int
|
73
73
|
ACTIVE_THEME_FIELD_NUMBER: builtins.int
|
74
74
|
TOTAL_LOAD_TIME_FIELD_NUMBER: builtins.int
|
@@ -82,6 +82,9 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
82
82
|
source: builtins.str
|
83
83
|
streamlit_version: builtins.str
|
84
84
|
is_hello: builtins.bool
|
85
|
+
app_id: builtins.str
|
86
|
+
session_id: builtins.str
|
87
|
+
python_version: builtins.str
|
85
88
|
hosted_at: builtins.str
|
86
89
|
"""Host tracking fields:"""
|
87
90
|
owner: builtins.str
|
@@ -106,11 +109,8 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
106
109
|
timezone: builtins.str
|
107
110
|
headless: builtins.bool
|
108
111
|
is_fragment_run: builtins.bool
|
109
|
-
app_id: builtins.str
|
110
|
-
"""Addtl for page profile metrics"""
|
111
112
|
numPages: builtins.int
|
112
|
-
|
113
|
-
python_version: builtins.str
|
113
|
+
"""Addtl for page profile metrics"""
|
114
114
|
page_script_hash: builtins.str
|
115
115
|
active_theme: builtins.str
|
116
116
|
total_load_time: builtins.int
|
@@ -137,6 +137,9 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
137
137
|
source: builtins.str = ...,
|
138
138
|
streamlit_version: builtins.str = ...,
|
139
139
|
is_hello: builtins.bool = ...,
|
140
|
+
app_id: builtins.str = ...,
|
141
|
+
session_id: builtins.str = ...,
|
142
|
+
python_version: builtins.str = ...,
|
140
143
|
hosted_at: builtins.str = ...,
|
141
144
|
owner: builtins.str = ...,
|
142
145
|
repo: builtins.str = ...,
|
@@ -161,10 +164,7 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
161
164
|
timezone: builtins.str = ...,
|
162
165
|
headless: builtins.bool = ...,
|
163
166
|
is_fragment_run: builtins.bool = ...,
|
164
|
-
app_id: builtins.str = ...,
|
165
167
|
numPages: builtins.int = ...,
|
166
|
-
session_id: builtins.str = ...,
|
167
|
-
python_version: builtins.str = ...,
|
168
168
|
page_script_hash: builtins.str = ...,
|
169
169
|
active_theme: builtins.str = ...,
|
170
170
|
total_load_time: builtins.int = ...,
|
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
|
|
15
15
|
from streamlit.proto import LabelVisibilityMessage_pb2 as streamlit_dot_proto_dot_LabelVisibilityMessage__pb2
|
16
16
|
|
17
17
|
|
18
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!streamlit/proto/MultiSelect.proto\x1a,streamlit/proto/LabelVisibilityMessage.proto\"\
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!streamlit/proto/MultiSelect.proto\x1a,streamlit/proto/LabelVisibilityMessage.proto\"\xcd\x02\n\x0bMultiSelect\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x03 \x03(\x05\x12\x0f\n\x07options\x18\x04 \x03(\t\x12\x0c\n\x04help\x18\x05 \x01(\t\x12\x0f\n\x07\x66orm_id\x18\x06 \x01(\t\x12\x11\n\x05value\x18\x07 \x03(\x05\x42\x02\x18\x01\x12\x12\n\nraw_values\x18\x0e \x03(\t\x12\x11\n\tset_value\x18\x08 \x01(\x08\x12\x10\n\x08\x64isabled\x18\t \x01(\x08\x12\x31\n\x10label_visibility\x18\n \x01(\x0b\x32\x17.LabelVisibilityMessage\x12\x16\n\x0emax_selections\x18\x0b \x01(\x05\x12\x13\n\x0bplaceholder\x18\x0c \x01(\t\x12\x1f\n\x12\x61\x63\x63\x65pt_new_options\x18\r \x01(\x08H\x00\x88\x01\x01\x42\x15\n\x13_accept_new_optionsB0\n\x1c\x63om.snowflake.apps.streamlitB\x10MultiSelectProtob\x06proto3')
|
19
19
|
|
20
20
|
_globals = globals()
|
21
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -23,6 +23,8 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.MultiSelect
|
|
23
23
|
if not _descriptor._USE_C_DESCRIPTORS:
|
24
24
|
_globals['DESCRIPTOR']._loaded_options = None
|
25
25
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\020MultiSelectProto'
|
26
|
+
_globals['_MULTISELECT'].fields_by_name['value']._loaded_options = None
|
27
|
+
_globals['_MULTISELECT'].fields_by_name['value']._serialized_options = b'\030\001'
|
26
28
|
_globals['_MULTISELECT']._serialized_start=84
|
27
|
-
_globals['_MULTISELECT']._serialized_end=
|
29
|
+
_globals['_MULTISELECT']._serialized_end=417
|
28
30
|
# @@protoc_insertion_point(module_scope)
|
@@ -38,11 +38,13 @@ class MultiSelect(google.protobuf.message.Message):
|
|
38
38
|
HELP_FIELD_NUMBER: builtins.int
|
39
39
|
FORM_ID_FIELD_NUMBER: builtins.int
|
40
40
|
VALUE_FIELD_NUMBER: builtins.int
|
41
|
+
RAW_VALUES_FIELD_NUMBER: builtins.int
|
41
42
|
SET_VALUE_FIELD_NUMBER: builtins.int
|
42
43
|
DISABLED_FIELD_NUMBER: builtins.int
|
43
44
|
LABEL_VISIBILITY_FIELD_NUMBER: builtins.int
|
44
45
|
MAX_SELECTIONS_FIELD_NUMBER: builtins.int
|
45
46
|
PLACEHOLDER_FIELD_NUMBER: builtins.int
|
47
|
+
ACCEPT_NEW_OPTIONS_FIELD_NUMBER: builtins.int
|
46
48
|
id: builtins.str
|
47
49
|
label: builtins.str
|
48
50
|
help: builtins.str
|
@@ -51,12 +53,19 @@ class MultiSelect(google.protobuf.message.Message):
|
|
51
53
|
disabled: builtins.bool
|
52
54
|
max_selections: builtins.int
|
53
55
|
placeholder: builtins.str
|
56
|
+
accept_new_options: builtins.bool
|
54
57
|
@property
|
55
58
|
def default(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ...
|
56
59
|
@property
|
57
60
|
def options(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
58
61
|
@property
|
59
62
|
def value(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ...
|
63
|
+
@property
|
64
|
+
def raw_values(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
|
65
|
+
"""after we introduced accept_new_options, we send the option as a string
|
66
|
+
instead of an index to keep it simple.
|
67
|
+
"""
|
68
|
+
|
60
69
|
@property
|
61
70
|
def label_visibility(self) -> streamlit.proto.LabelVisibilityMessage_pb2.LabelVisibilityMessage: ...
|
62
71
|
def __init__(
|
@@ -69,13 +78,16 @@ class MultiSelect(google.protobuf.message.Message):
|
|
69
78
|
help: builtins.str = ...,
|
70
79
|
form_id: builtins.str = ...,
|
71
80
|
value: collections.abc.Iterable[builtins.int] | None = ...,
|
81
|
+
raw_values: collections.abc.Iterable[builtins.str] | None = ...,
|
72
82
|
set_value: builtins.bool = ...,
|
73
83
|
disabled: builtins.bool = ...,
|
74
84
|
label_visibility: streamlit.proto.LabelVisibilityMessage_pb2.LabelVisibilityMessage | None = ...,
|
75
85
|
max_selections: builtins.int = ...,
|
76
86
|
placeholder: builtins.str = ...,
|
87
|
+
accept_new_options: builtins.bool | None = ...,
|
77
88
|
) -> None: ...
|
78
|
-
def HasField(self, field_name: typing.Literal["label_visibility", b"label_visibility"]) -> builtins.bool: ...
|
79
|
-
def ClearField(self, field_name: typing.Literal["default", b"default", "disabled", b"disabled", "form_id", b"form_id", "help", b"help", "id", b"id", "label", b"label", "label_visibility", b"label_visibility", "max_selections", b"max_selections", "options", b"options", "placeholder", b"placeholder", "set_value", b"set_value", "value", b"value"]) -> None: ...
|
89
|
+
def HasField(self, field_name: typing.Literal["_accept_new_options", b"_accept_new_options", "accept_new_options", b"accept_new_options", "label_visibility", b"label_visibility"]) -> builtins.bool: ...
|
90
|
+
def ClearField(self, field_name: typing.Literal["_accept_new_options", b"_accept_new_options", "accept_new_options", b"accept_new_options", "default", b"default", "disabled", b"disabled", "form_id", b"form_id", "help", b"help", "id", b"id", "label", b"label", "label_visibility", b"label_visibility", "max_selections", b"max_selections", "options", b"options", "placeholder", b"placeholder", "raw_values", b"raw_values", "set_value", b"set_value", "value", b"value"]) -> None: ...
|
91
|
+
def WhichOneof(self, oneof_group: typing.Literal["_accept_new_options", b"_accept_new_options"]) -> typing.Literal["accept_new_options"] | None: ...
|
80
92
|
|
81
93
|
global___MultiSelect = MultiSelect
|
streamlit/proto/Selectbox_pb2.py
CHANGED
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
|
|
15
15
|
from streamlit.proto import LabelVisibilityMessage_pb2 as streamlit_dot_proto_dot_LabelVisibilityMessage__pb2
|
16
16
|
|
17
17
|
|
18
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/Selectbox.proto\x1a,streamlit/proto/LabelVisibilityMessage.proto\"\
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/Selectbox.proto\x1a,streamlit/proto/LabelVisibilityMessage.proto\"\xe5\x02\n\tSelectbox\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x14\n\x07\x64\x65\x66\x61ult\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x0f\n\x07options\x18\x04 \x03(\t\x12\x0c\n\x04help\x18\x05 \x01(\t\x12\x0f\n\x07\x66orm_id\x18\x06 \x01(\t\x12\x16\n\x05value\x18\x07 \x01(\x05\x42\x02\x18\x01H\x01\x88\x01\x01\x12\x16\n\traw_value\x18\r \x01(\tH\x02\x88\x01\x01\x12\x11\n\tset_value\x18\x08 \x01(\x08\x12\x10\n\x08\x64isabled\x18\t \x01(\x08\x12\x31\n\x10label_visibility\x18\n \x01(\x0b\x32\x17.LabelVisibilityMessage\x12\x13\n\x0bplaceholder\x18\x0b \x01(\t\x12\x1f\n\x12\x61\x63\x63\x65pt_new_options\x18\x0c \x01(\x08H\x03\x88\x01\x01\x42\n\n\x08_defaultB\x08\n\x06_valueB\x0c\n\n_raw_valueB\x15\n\x13_accept_new_optionsB.\n\x1c\x63om.snowflake.apps.streamlitB\x0eSelectboxProtob\x06proto3')
|
19
19
|
|
20
20
|
_globals = globals()
|
21
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -23,6 +23,8 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Selectbox_p
|
|
23
23
|
if not _descriptor._USE_C_DESCRIPTORS:
|
24
24
|
_globals['DESCRIPTOR']._loaded_options = None
|
25
25
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\016SelectboxProto'
|
26
|
+
_globals['_SELECTBOX'].fields_by_name['value']._loaded_options = None
|
27
|
+
_globals['_SELECTBOX'].fields_by_name['value']._serialized_options = b'\030\001'
|
26
28
|
_globals['_SELECTBOX']._serialized_start=82
|
27
|
-
_globals['_SELECTBOX']._serialized_end=
|
29
|
+
_globals['_SELECTBOX']._serialized_end=439
|
28
30
|
# @@protoc_insertion_point(module_scope)
|
@@ -38,19 +38,26 @@ class Selectbox(google.protobuf.message.Message):
|
|
38
38
|
HELP_FIELD_NUMBER: builtins.int
|
39
39
|
FORM_ID_FIELD_NUMBER: builtins.int
|
40
40
|
VALUE_FIELD_NUMBER: builtins.int
|
41
|
+
RAW_VALUE_FIELD_NUMBER: builtins.int
|
41
42
|
SET_VALUE_FIELD_NUMBER: builtins.int
|
42
43
|
DISABLED_FIELD_NUMBER: builtins.int
|
43
44
|
LABEL_VISIBILITY_FIELD_NUMBER: builtins.int
|
44
45
|
PLACEHOLDER_FIELD_NUMBER: builtins.int
|
46
|
+
ACCEPT_NEW_OPTIONS_FIELD_NUMBER: builtins.int
|
45
47
|
id: builtins.str
|
46
48
|
label: builtins.str
|
47
49
|
default: builtins.int
|
48
50
|
help: builtins.str
|
49
51
|
form_id: builtins.str
|
50
52
|
value: builtins.int
|
53
|
+
raw_value: builtins.str
|
54
|
+
"""after we introduced accept_new_options, we send the option as a string
|
55
|
+
instead of an index to keep it simple.
|
56
|
+
"""
|
51
57
|
set_value: builtins.bool
|
52
58
|
disabled: builtins.bool
|
53
59
|
placeholder: builtins.str
|
60
|
+
accept_new_options: builtins.bool
|
54
61
|
@property
|
55
62
|
def options(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
56
63
|
@property
|
@@ -65,16 +72,22 @@ class Selectbox(google.protobuf.message.Message):
|
|
65
72
|
help: builtins.str = ...,
|
66
73
|
form_id: builtins.str = ...,
|
67
74
|
value: builtins.int | None = ...,
|
75
|
+
raw_value: builtins.str | None = ...,
|
68
76
|
set_value: builtins.bool = ...,
|
69
77
|
disabled: builtins.bool = ...,
|
70
78
|
label_visibility: streamlit.proto.LabelVisibilityMessage_pb2.LabelVisibilityMessage | None = ...,
|
71
79
|
placeholder: builtins.str = ...,
|
80
|
+
accept_new_options: builtins.bool | None = ...,
|
72
81
|
) -> None: ...
|
73
|
-
def HasField(self, field_name: typing.Literal["_default", b"_default", "_value", b"_value", "default", b"default", "label_visibility", b"label_visibility", "value", b"value"]) -> builtins.bool: ...
|
74
|
-
def ClearField(self, field_name: typing.Literal["_default", b"_default", "_value", b"_value", "default", b"default", "disabled", b"disabled", "form_id", b"form_id", "help", b"help", "id", b"id", "label", b"label", "label_visibility", b"label_visibility", "options", b"options", "placeholder", b"placeholder", "set_value", b"set_value", "value", b"value"]) -> None: ...
|
82
|
+
def HasField(self, field_name: typing.Literal["_accept_new_options", b"_accept_new_options", "_default", b"_default", "_raw_value", b"_raw_value", "_value", b"_value", "accept_new_options", b"accept_new_options", "default", b"default", "label_visibility", b"label_visibility", "raw_value", b"raw_value", "value", b"value"]) -> builtins.bool: ...
|
83
|
+
def ClearField(self, field_name: typing.Literal["_accept_new_options", b"_accept_new_options", "_default", b"_default", "_raw_value", b"_raw_value", "_value", b"_value", "accept_new_options", b"accept_new_options", "default", b"default", "disabled", b"disabled", "form_id", b"form_id", "help", b"help", "id", b"id", "label", b"label", "label_visibility", b"label_visibility", "options", b"options", "placeholder", b"placeholder", "raw_value", b"raw_value", "set_value", b"set_value", "value", b"value"]) -> None: ...
|
84
|
+
@typing.overload
|
85
|
+
def WhichOneof(self, oneof_group: typing.Literal["_accept_new_options", b"_accept_new_options"]) -> typing.Literal["accept_new_options"] | None: ...
|
75
86
|
@typing.overload
|
76
87
|
def WhichOneof(self, oneof_group: typing.Literal["_default", b"_default"]) -> typing.Literal["default"] | None: ...
|
77
88
|
@typing.overload
|
89
|
+
def WhichOneof(self, oneof_group: typing.Literal["_raw_value", b"_raw_value"]) -> typing.Literal["raw_value"] | None: ...
|
90
|
+
@typing.overload
|
78
91
|
def WhichOneof(self, oneof_group: typing.Literal["_value", b"_value"]) -> typing.Literal["value"] | None: ...
|
79
92
|
|
80
93
|
global___Selectbox = Selectbox
|
streamlit/static/index.html
CHANGED
@@ -51,7 +51,7 @@
|
|
51
51
|
<script>
|
52
52
|
window.prerenderReady = false
|
53
53
|
</script>
|
54
|
-
<script type="module" crossorigin src="./static/js/index.
|
54
|
+
<script type="module" crossorigin src="./static/js/index.B28jf8c_.js"></script>
|
55
55
|
<link rel="stylesheet" crossorigin href="./static/css/index.DKr_zoDj.css">
|
56
56
|
</head>
|
57
57
|
<body>
|
@@ -1 +1 @@
|
|
1
|
-
import{r as e,E as n,_ as a}from"./index.
|
1
|
+
import{r as e,E as n,_ as a}from"./index.B28jf8c_.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};
|