streamlit-nightly 1.36.1.dev20240709__py2.py3-none-any.whl → 1.36.1.dev20240711__py2.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.
Files changed (27) hide show
  1. streamlit/__init__.py +1 -0
  2. streamlit/delta_generator.py +2 -0
  3. streamlit/elements/lib/options_selector_utils.py +76 -0
  4. streamlit/elements/widgets/button.py +9 -1
  5. streamlit/elements/widgets/button_group.py +411 -0
  6. streamlit/elements/widgets/multiselect.py +88 -115
  7. streamlit/file_util.py +3 -4
  8. streamlit/proto/ButtonGroup_pb2.py +33 -0
  9. streamlit/proto/ButtonGroup_pb2.pyi +122 -0
  10. streamlit/proto/Element_pb2.py +4 -3
  11. streamlit/proto/Element_pb2.pyi +9 -4
  12. streamlit/runtime/state/common.py +2 -0
  13. streamlit/runtime/state/widgets.py +1 -0
  14. streamlit/static/asset-manifest.json +3 -2
  15. streamlit/static/index.html +1 -1
  16. streamlit/static/static/js/1116.841caf48.chunk.js +1 -0
  17. streamlit/static/static/js/main.917a5920.js +2 -0
  18. streamlit/testing/v1/app_test.py +5 -0
  19. streamlit/testing/v1/element_tree.py +92 -0
  20. {streamlit_nightly-1.36.1.dev20240709.dist-info → streamlit_nightly-1.36.1.dev20240711.dist-info}/METADATA +1 -1
  21. {streamlit_nightly-1.36.1.dev20240709.dist-info → streamlit_nightly-1.36.1.dev20240711.dist-info}/RECORD +26 -21
  22. streamlit/static/static/js/main.2bfed63a.js +0 -2
  23. /streamlit/static/static/js/{main.2bfed63a.js.LICENSE.txt → main.917a5920.js.LICENSE.txt} +0 -0
  24. {streamlit_nightly-1.36.1.dev20240709.data → streamlit_nightly-1.36.1.dev20240711.data}/scripts/streamlit.cmd +0 -0
  25. {streamlit_nightly-1.36.1.dev20240709.dist-info → streamlit_nightly-1.36.1.dev20240711.dist-info}/WHEEL +0 -0
  26. {streamlit_nightly-1.36.1.dev20240709.dist-info → streamlit_nightly-1.36.1.dev20240711.dist-info}/entry_points.txt +0 -0
  27. {streamlit_nightly-1.36.1.dev20240709.dist-info → streamlit_nightly-1.36.1.dev20240711.dist-info}/top_level.txt +0 -0
@@ -14,12 +14,17 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- from dataclasses import dataclass
17
+ from dataclasses import dataclass, field
18
18
  from textwrap import dedent
19
- from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, cast, overload
19
+ from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, cast
20
20
 
21
- from streamlit.dataframe_util import OptionSequence, convert_anything_to_sequence
21
+ from streamlit.dataframe_util import OptionSequence
22
22
  from streamlit.elements.form import current_form_id
23
+ from streamlit.elements.lib.options_selector_utils import (
24
+ check_and_convert_to_indices,
25
+ convert_to_sequence_and_check_comparable,
26
+ get_default_indices,
27
+ )
23
28
  from streamlit.elements.lib.policies import (
24
29
  check_widget_policies,
25
30
  maybe_raise_label_warnings,
@@ -35,75 +40,41 @@ from streamlit.errors import StreamlitAPIException
35
40
  from streamlit.proto.MultiSelect_pb2 import MultiSelect as MultiSelectProto
36
41
  from streamlit.runtime.metrics_util import gather_metrics
37
42
  from streamlit.runtime.scriptrunner import ScriptRunContext, get_script_run_ctx
38
- from streamlit.runtime.state import (
39
- WidgetArgs,
40
- WidgetCallback,
41
- WidgetKwargs,
42
- register_widget,
43
- )
43
+ from streamlit.runtime.state import register_widget
44
44
  from streamlit.runtime.state.common import compute_widget_id, save_for_app_testing
45
45
  from streamlit.type_util import (
46
46
  T,
47
- check_python_comparable,
48
47
  is_iterable,
49
- is_type,
50
48
  )
51
49
 
52
50
  if TYPE_CHECKING:
51
+ from streamlit.dataframe_util import OptionSequence
53
52
  from streamlit.delta_generator import DeltaGenerator
53
+ from streamlit.runtime.state import (
54
+ WidgetArgs,
55
+ WidgetCallback,
56
+ WidgetKwargs,
57
+ )
54
58
 
55
59
 
56
- @overload
57
- def _check_and_convert_to_indices( # type: ignore[misc]
58
- opt: Sequence[Any], default_values: None
59
- ) -> list[int] | None: ...
60
-
61
-
62
- @overload
63
- def _check_and_convert_to_indices(
64
- opt: Sequence[Any], default_values: Sequence[Any] | Any
65
- ) -> list[int]: ...
66
-
67
-
68
- def _check_and_convert_to_indices(
69
- opt: Sequence[Any], default_values: Sequence[Any] | Any | None
70
- ) -> list[int] | None:
71
- """Perform validation checks and return indices based on the default values."""
72
- if default_values is None and None not in opt:
73
- return None
74
-
75
- if not isinstance(default_values, list):
76
- # This if is done before others because calling if not x (done
77
- # right below) when x is of type pd.Series() or np.array() throws a
78
- # ValueError exception.
79
- if is_type(default_values, "numpy.ndarray") or is_type(
80
- default_values, "pandas.core.series.Series"
81
- ):
82
- default_values = list(cast(Sequence[Any], default_values))
83
- elif (
84
- isinstance(default_values, (tuple, set))
85
- or default_values
86
- and default_values not in opt
87
- ):
88
- default_values = list(default_values)
89
- else:
90
- default_values = [default_values]
91
- for value in default_values:
92
- if value not in opt:
93
- raise StreamlitAPIException(
94
- f"The default value '{value}' is part of the options. "
95
- "Please make sure that every default values also exists in the options."
96
- )
97
-
98
- return [opt.index(value) for value in default_values]
60
+ @dataclass
61
+ class MultiSelectSerde(Generic[T]):
62
+ options: Sequence[T]
63
+ default_value: list[int] = field(default_factory=list)
99
64
 
65
+ def serialize(self, value: list[T]) -> list[int]:
66
+ indices = check_and_convert_to_indices(self.options, value)
67
+ return indices if indices is not None else []
100
68
 
101
- def _get_default_count(default: Sequence[Any] | Any | None) -> int:
102
- if default is None:
103
- return 0
104
- if not is_iterable(default):
105
- return 1
106
- return len(cast(Sequence[Any], default))
69
+ def deserialize(
70
+ self,
71
+ ui_value: list[int] | None,
72
+ widget_id: str = "",
73
+ ) -> list[T]:
74
+ current_value: list[int] = (
75
+ ui_value if ui_value is not None else self.default_value
76
+ )
77
+ return [self.options[i] for i in current_value]
107
78
 
108
79
 
109
80
  def _get_over_max_options_message(current_selections: int, max_selections: int):
@@ -118,23 +89,25 @@ Please select at most {max_selections} {max_selections_noun}.
118
89
  """
119
90
 
120
91
 
121
- @dataclass
122
- class MultiSelectSerde(Generic[T]):
123
- options: Sequence[T]
124
- default_value: list[int]
92
+ def _get_default_count(default: Sequence[Any] | Any | None) -> int:
93
+ if default is None:
94
+ return 0
95
+ if not is_iterable(default):
96
+ return 1
97
+ return len(cast(Sequence[Any], default))
125
98
 
126
- def serialize(self, value: list[T]) -> list[int]:
127
- return _check_and_convert_to_indices(self.options, value)
128
99
 
129
- def deserialize(
130
- self,
131
- ui_value: list[int] | None,
132
- widget_id: str = "",
133
- ) -> list[T]:
134
- current_value: list[int] = (
135
- ui_value if ui_value is not None else self.default_value
100
+ def _check_max_selections(
101
+ selections: Sequence[Any] | Any | None, max_selections: int | None
102
+ ):
103
+ if max_selections is None:
104
+ return
105
+
106
+ default_count = _get_default_count(selections)
107
+ if default_count > max_selections:
108
+ raise StreamlitAPIException(
109
+ _get_over_max_options_message(default_count, max_selections)
136
110
  )
137
- return [self.options[i] for i in current_value]
138
111
 
139
112
 
140
113
  class MultiSelectMixin:
@@ -177,14 +150,15 @@ class MultiSelectMixin:
177
150
  at https://katex.org/docs/supported.html.
178
151
 
179
152
  * Colored text and background colors for text, using the syntax
180
- ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
181
- respectively. ``color`` must be replaced with any of the following
153
+ ``:color[text to be colored]`` and
154
+ ``:color-background[text to be colored]``, respectively.
155
+ ``color`` must be replaced with any of the following
182
156
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
183
157
  For example, you can use ``:orange[your text here]`` or
184
158
  ``:blue-background[your text here]``.
185
159
 
186
- Unsupported elements are unwrapped so only their children (text contents) render.
187
- Display unsupported elements as literal characters by
160
+ Unsupported elements are unwrapped so only their children (text contents)
161
+ render. Display unsupported elements as literal characters by
188
162
  backslash-escaping them. E.g. ``1\. Not an ordered list``.
189
163
 
190
164
  For accessibility reasons, you should never set an empty label (label="")
@@ -218,7 +192,8 @@ class MultiSelectMixin:
218
192
  max_selections : int
219
193
  The max selections that can be selected at a time.
220
194
  placeholder : str
221
- A string to display when no options are selected. Defaults to 'Choose an option'.
195
+ A string to display when no options are selected.
196
+ Defaults to 'Choose an option'.
222
197
  disabled : bool
223
198
  An optional boolean, which disables the multiselect widget if set
224
199
  to True. The default is False. This argument can only be supplied
@@ -289,6 +264,7 @@ class MultiSelectMixin:
289
264
  ) -> list[T]:
290
265
  key = to_key(key)
291
266
 
267
+ widget_name = "multiselect"
292
268
  check_widget_policies(
293
269
  self.dg,
294
270
  key,
@@ -297,48 +273,44 @@ class MultiSelectMixin:
297
273
  )
298
274
  maybe_raise_label_warnings(label, label_visibility)
299
275
 
300
- opt = convert_anything_to_sequence(options)
301
- check_python_comparable(opt)
302
-
303
- indices = _check_and_convert_to_indices(opt, default)
276
+ indexable_options = convert_to_sequence_and_check_comparable(options)
277
+ formatted_options = [format_func(option) for option in indexable_options]
278
+ default_values = get_default_indices(indexable_options, default)
304
279
 
305
- id = compute_widget_id(
306
- "multiselect",
280
+ form_id = current_form_id(self.dg)
281
+ widget_id = compute_widget_id(
282
+ widget_name,
307
283
  user_key=key,
308
284
  label=label,
309
- options=[str(format_func(option)) for option in opt],
310
- default=indices,
285
+ options=formatted_options,
286
+ default=default_values,
311
287
  key=key,
312
288
  help=help,
313
289
  max_selections=max_selections,
314
290
  placeholder=placeholder,
315
- form_id=current_form_id(self.dg),
291
+ form_id=form_id,
316
292
  page=ctx.active_script_hash if ctx else None,
317
293
  )
318
294
 
319
- default_value: list[int] = [] if indices is None else indices
320
-
321
- multiselect_proto = MultiSelectProto()
322
- multiselect_proto.id = id
323
- multiselect_proto.label = label
324
- multiselect_proto.default[:] = default_value
325
- multiselect_proto.options[:] = [str(format_func(option)) for option in opt]
326
- multiselect_proto.form_id = current_form_id(self.dg)
327
- multiselect_proto.max_selections = max_selections or 0
328
- multiselect_proto.placeholder = placeholder
329
- multiselect_proto.disabled = disabled
330
- multiselect_proto.label_visibility.value = get_label_visibility_proto_value(
295
+ proto = MultiSelectProto()
296
+ proto.id = widget_id
297
+ proto.default[:] = default_values
298
+ proto.form_id = form_id
299
+ proto.disabled = disabled
300
+ proto.label = label
301
+ proto.max_selections = max_selections or 0
302
+ proto.placeholder = placeholder
303
+ proto.label_visibility.value = get_label_visibility_proto_value(
331
304
  label_visibility
332
305
  )
333
-
306
+ proto.options[:] = formatted_options
334
307
  if help is not None:
335
- multiselect_proto.help = dedent(help)
336
-
337
- serde = MultiSelectSerde(opt, default_value)
308
+ proto.help = dedent(help)
338
309
 
310
+ serde = MultiSelectSerde(indexable_options, default_values)
339
311
  widget_state = register_widget(
340
312
  "multiselect",
341
- multiselect_proto,
313
+ proto,
342
314
  user_key=key,
343
315
  on_change_handler=on_change,
344
316
  args=args,
@@ -347,20 +319,21 @@ class MultiSelectMixin:
347
319
  serializer=serde.serialize,
348
320
  ctx=ctx,
349
321
  )
350
- default_count = _get_default_count(widget_state.value)
351
- if max_selections and default_count > max_selections:
352
- raise StreamlitAPIException(
353
- _get_over_max_options_message(default_count, max_selections)
354
- )
355
- widget_state = maybe_coerce_enum_sequence(widget_state, options, opt)
322
+
323
+ _check_max_selections(widget_state.value, max_selections)
324
+ widget_state = maybe_coerce_enum_sequence(
325
+ widget_state, options, indexable_options
326
+ )
356
327
 
357
328
  if widget_state.value_changed:
358
- multiselect_proto.value[:] = serde.serialize(widget_state.value)
359
- multiselect_proto.set_value = True
329
+ proto.value[:] = serde.serialize(widget_state.value)
330
+ proto.set_value = True
360
331
 
361
332
  if ctx:
362
- save_for_app_testing(ctx, id, format_func)
363
- self.dg._enqueue("multiselect", multiselect_proto)
333
+ save_for_app_testing(ctx, widget_id, format_func)
334
+
335
+ self.dg._enqueue(widget_name, proto)
336
+
364
337
  return widget_state.value
365
338
 
366
339
  @property
streamlit/file_util.py CHANGED
@@ -136,12 +136,11 @@ def get_streamlit_file_path(*filepath) -> str:
136
136
 
137
137
  This doesn't guarantee that the file (or its directory) exists.
138
138
  """
139
- # os.path.expanduser works on OSX, Linux and Windows
140
- home = os.path.expanduser("~")
139
+ home = Path.home()
141
140
  if home is None:
142
141
  raise RuntimeError("No home directory.")
143
142
 
144
- return os.path.join(home, CONFIG_FOLDER_NAME, *filepath)
143
+ return str(home / CONFIG_FOLDER_NAME / Path(*filepath))
145
144
 
146
145
 
147
146
  def get_project_streamlit_file_path(*filepath):
@@ -149,7 +148,7 @@ def get_project_streamlit_file_path(*filepath):
149
148
 
150
149
  This doesn't guarantee that the file (or its directory) exists.
151
150
  """
152
- return os.path.join(os.getcwd(), CONFIG_FOLDER_NAME, *filepath)
151
+ return str(Path.cwd() / CONFIG_FOLDER_NAME / Path(*filepath))
153
152
 
154
153
 
155
154
  def file_is_in_folder_glob(filepath: str, folderpath_glob: str) -> bool:
@@ -0,0 +1,33 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: streamlit/proto/ButtonGroup.proto
4
+ # Protobuf Python Version: 5.26.1
5
+ """Generated protocol buffer code."""
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
10
+ # @@protoc_insertion_point(imports)
11
+
12
+ _sym_db = _symbol_database.Default()
13
+
14
+
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!streamlit/proto/ButtonGroup.proto\"\xb3\x03\n\x0b\x42uttonGroup\x12\n\n\x02id\x18\x01 \x01(\t\x12$\n\x07options\x18\x02 \x03(\x0b\x32\x13.ButtonGroup.Option\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x03 \x03(\r\x12\x10\n\x08\x64isabled\x18\x04 \x01(\x08\x12*\n\nclick_mode\x18\x05 \x01(\x0e\x32\x16.ButtonGroup.ClickMode\x12\x0f\n\x07\x66orm_id\x18\x06 \x01(\t\x12\r\n\x05value\x18\x07 \x03(\r\x12\x11\n\tset_value\x18\x08 \x01(\x08\x12\x44\n\x17selection_visualization\x18\t \x01(\x0e\x32#.ButtonGroup.SelectionVisualization\x1a\x33\n\x06Option\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x18\n\x10selected_content\x18\x02 \x01(\t\"0\n\tClickMode\x12\x11\n\rSINGLE_SELECT\x10\x00\x12\x10\n\x0cMULTI_SELECT\x10\x01\"C\n\x16SelectionVisualization\x12\x11\n\rONLY_SELECTED\x10\x00\x12\x16\n\x12\x41LL_UP_TO_SELECTED\x10\x01\x42\x30\n\x1c\x63om.snowflake.apps.streamlitB\x10\x42uttonGroupProtob\x06proto3')
18
+
19
+ _globals = globals()
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.ButtonGroup_pb2', _globals)
22
+ if not _descriptor._USE_C_DESCRIPTORS:
23
+ _globals['DESCRIPTOR']._loaded_options = None
24
+ _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\020ButtonGroupProto'
25
+ _globals['_BUTTONGROUP']._serialized_start=38
26
+ _globals['_BUTTONGROUP']._serialized_end=473
27
+ _globals['_BUTTONGROUP_OPTION']._serialized_start=303
28
+ _globals['_BUTTONGROUP_OPTION']._serialized_end=354
29
+ _globals['_BUTTONGROUP_CLICKMODE']._serialized_start=356
30
+ _globals['_BUTTONGROUP_CLICKMODE']._serialized_end=404
31
+ _globals['_BUTTONGROUP_SELECTIONVISUALIZATION']._serialized_start=406
32
+ _globals['_BUTTONGROUP_SELECTIONVISUALIZATION']._serialized_end=473
33
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,122 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ *!
5
+ Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+ """
19
+
20
+ import builtins
21
+ import collections.abc
22
+ import google.protobuf.descriptor
23
+ import google.protobuf.internal.containers
24
+ import google.protobuf.internal.enum_type_wrapper
25
+ import google.protobuf.message
26
+ import sys
27
+ import typing
28
+
29
+ if sys.version_info >= (3, 10):
30
+ import typing as typing_extensions
31
+ else:
32
+ import typing_extensions
33
+
34
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
35
+
36
+ @typing.final
37
+ class ButtonGroup(google.protobuf.message.Message):
38
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
39
+
40
+ class _ClickMode:
41
+ ValueType = typing.NewType("ValueType", builtins.int)
42
+ V: typing_extensions.TypeAlias = ValueType
43
+
44
+ class _ClickModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ButtonGroup._ClickMode.ValueType], builtins.type):
45
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
46
+ SINGLE_SELECT: ButtonGroup._ClickMode.ValueType # 0
47
+ MULTI_SELECT: ButtonGroup._ClickMode.ValueType # 1
48
+
49
+ class ClickMode(_ClickMode, metaclass=_ClickModeEnumTypeWrapper): ...
50
+ SINGLE_SELECT: ButtonGroup.ClickMode.ValueType # 0
51
+ MULTI_SELECT: ButtonGroup.ClickMode.ValueType # 1
52
+
53
+ class _SelectionVisualization:
54
+ ValueType = typing.NewType("ValueType", builtins.int)
55
+ V: typing_extensions.TypeAlias = ValueType
56
+
57
+ class _SelectionVisualizationEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ButtonGroup._SelectionVisualization.ValueType], builtins.type):
58
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
59
+ ONLY_SELECTED: ButtonGroup._SelectionVisualization.ValueType # 0
60
+ ALL_UP_TO_SELECTED: ButtonGroup._SelectionVisualization.ValueType # 1
61
+
62
+ class SelectionVisualization(_SelectionVisualization, metaclass=_SelectionVisualizationEnumTypeWrapper): ...
63
+ ONLY_SELECTED: ButtonGroup.SelectionVisualization.ValueType # 0
64
+ ALL_UP_TO_SELECTED: ButtonGroup.SelectionVisualization.ValueType # 1
65
+
66
+ @typing.final
67
+ class Option(google.protobuf.message.Message):
68
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
69
+
70
+ CONTENT_FIELD_NUMBER: builtins.int
71
+ SELECTED_CONTENT_FIELD_NUMBER: builtins.int
72
+ content: builtins.str
73
+ selected_content: builtins.str
74
+ def __init__(
75
+ self,
76
+ *,
77
+ content: builtins.str = ...,
78
+ selected_content: builtins.str = ...,
79
+ ) -> None: ...
80
+ def ClearField(self, field_name: typing.Literal["content", b"content", "selected_content", b"selected_content"]) -> None: ...
81
+
82
+ ID_FIELD_NUMBER: builtins.int
83
+ OPTIONS_FIELD_NUMBER: builtins.int
84
+ DEFAULT_FIELD_NUMBER: builtins.int
85
+ DISABLED_FIELD_NUMBER: builtins.int
86
+ CLICK_MODE_FIELD_NUMBER: builtins.int
87
+ FORM_ID_FIELD_NUMBER: builtins.int
88
+ VALUE_FIELD_NUMBER: builtins.int
89
+ SET_VALUE_FIELD_NUMBER: builtins.int
90
+ SELECTION_VISUALIZATION_FIELD_NUMBER: builtins.int
91
+ id: builtins.str
92
+ disabled: builtins.bool
93
+ click_mode: global___ButtonGroup.ClickMode.ValueType
94
+ form_id: builtins.str
95
+ set_value: builtins.bool
96
+ selection_visualization: global___ButtonGroup.SelectionVisualization.ValueType
97
+ @property
98
+ def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ButtonGroup.Option]: ...
99
+ @property
100
+ def default(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
101
+ """default is an array of indexes that are selected by default"""
102
+
103
+ @property
104
+ def value(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
105
+ """value passed by the backend"""
106
+
107
+ def __init__(
108
+ self,
109
+ *,
110
+ id: builtins.str = ...,
111
+ options: collections.abc.Iterable[global___ButtonGroup.Option] | None = ...,
112
+ default: collections.abc.Iterable[builtins.int] | None = ...,
113
+ disabled: builtins.bool = ...,
114
+ click_mode: global___ButtonGroup.ClickMode.ValueType = ...,
115
+ form_id: builtins.str = ...,
116
+ value: collections.abc.Iterable[builtins.int] | None = ...,
117
+ set_value: builtins.bool = ...,
118
+ selection_visualization: global___ButtonGroup.SelectionVisualization.ValueType = ...,
119
+ ) -> None: ...
120
+ def ClearField(self, field_name: typing.Literal["click_mode", b"click_mode", "default", b"default", "disabled", b"disabled", "form_id", b"form_id", "id", b"id", "options", b"options", "selection_visualization", b"selection_visualization", "set_value", b"set_value", "value", b"value"]) -> None: ...
121
+
122
+ global___ButtonGroup = ButtonGroup
@@ -19,6 +19,7 @@ from streamlit.proto import Balloons_pb2 as streamlit_dot_proto_dot_Balloons__pb
19
19
  from streamlit.proto import ArrowVegaLiteChart_pb2 as streamlit_dot_proto_dot_ArrowVegaLiteChart__pb2
20
20
  from streamlit.proto import BokehChart_pb2 as streamlit_dot_proto_dot_BokehChart__pb2
21
21
  from streamlit.proto import Button_pb2 as streamlit_dot_proto_dot_Button__pb2
22
+ from streamlit.proto import ButtonGroup_pb2 as streamlit_dot_proto_dot_ButtonGroup__pb2
22
23
  from streamlit.proto import DownloadButton_pb2 as streamlit_dot_proto_dot_DownloadButton__pb2
23
24
  from streamlit.proto import CameraInput_pb2 as streamlit_dot_proto_dot_CameraInput__pb2
24
25
  from streamlit.proto import ChatInput_pb2 as streamlit_dot_proto_dot_ChatInput__pb2
@@ -63,7 +64,7 @@ from streamlit.proto import Video_pb2 as streamlit_dot_proto_dot_Video__pb2
63
64
  from streamlit.proto import Heading_pb2 as streamlit_dot_proto_dot_Heading__pb2
64
65
 
65
66
 
66
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dstreamlit/proto/Element.proto\x1a\x1bstreamlit/proto/Alert.proto\x1a\x1bstreamlit/proto/Arrow.proto\x1a\x1bstreamlit/proto/Audio.proto\x1a\x1estreamlit/proto/Balloons.proto\x1a(streamlit/proto/ArrowVegaLiteChart.proto\x1a streamlit/proto/BokehChart.proto\x1a\x1cstreamlit/proto/Button.proto\x1a$streamlit/proto/DownloadButton.proto\x1a!streamlit/proto/CameraInput.proto\x1a\x1fstreamlit/proto/ChatInput.proto\x1a\x1estreamlit/proto/Checkbox.proto\x1a\x1astreamlit/proto/Code.proto\x1a!streamlit/proto/ColorPicker.proto\x1a\x1fstreamlit/proto/DataFrame.proto\x1a\x1fstreamlit/proto/DateInput.proto\x1a%streamlit/proto/DeckGlJsonChart.proto\x1a\x1fstreamlit/proto/DocString.proto\x1a\x1bstreamlit/proto/Empty.proto\x1a\x1fstreamlit/proto/Exception.proto\x1a\x1dstreamlit/proto/Favicon.proto\x1a\"streamlit/proto/FileUploader.proto\x1a#streamlit/proto/GraphVizChart.proto\x1a\x1astreamlit/proto/Html.proto\x1a\x1cstreamlit/proto/IFrame.proto\x1a\x1bstreamlit/proto/Image.proto\x1a\x1astreamlit/proto/Json.proto\x1a streamlit/proto/LinkButton.proto\x1a!streamlit/proto/NumberInput.proto\x1a\x1estreamlit/proto/Markdown.proto\x1a\x1cstreamlit/proto/Metric.proto\x1a!streamlit/proto/MultiSelect.proto\x1a\x1estreamlit/proto/PageLink.proto\x1a!streamlit/proto/PlotlyChart.proto\x1a streamlit/proto/Components.proto\x1a\x1estreamlit/proto/Progress.proto\x1a\x1astreamlit/proto/Snow.proto\x1a\x1dstreamlit/proto/Spinner.proto\x1a\x1bstreamlit/proto/Radio.proto\x1a\x1fstreamlit/proto/Selectbox.proto\x1a\x1estreamlit/proto/Skeleton.proto\x1a\x1cstreamlit/proto/Slider.proto\x1a\x1astreamlit/proto/Text.proto\x1a\x1estreamlit/proto/TextArea.proto\x1a\x1fstreamlit/proto/TextInput.proto\x1a\x1fstreamlit/proto/TimeInput.proto\x1a\x1bstreamlit/proto/Toast.proto\x1a#streamlit/proto/VegaLiteChart.proto\x1a\x1bstreamlit/proto/Video.proto\x1a\x1dstreamlit/proto/Heading.proto\"\x8e\r\n\x07\x45lement\x12\x17\n\x05\x61lert\x18\x1e \x01(\x0b\x32\x06.AlertH\x00\x12\"\n\x10\x61rrow_data_frame\x18( \x01(\x0b\x32\x06.ArrowH\x00\x12\x1d\n\x0b\x61rrow_table\x18\' \x01(\x0b\x32\x06.ArrowH\x00\x12\x34\n\x15\x61rrow_vega_lite_chart\x18) \x01(\x0b\x32\x13.ArrowVegaLiteChartH\x00\x12\x17\n\x05\x61udio\x18\r \x01(\x0b\x32\x06.AudioH\x00\x12\x1d\n\x08\x62\x61lloons\x18\x0c \x01(\x0b\x32\t.BalloonsH\x00\x12\"\n\x0b\x62okeh_chart\x18\x11 \x01(\x0b\x32\x0b.BokehChartH\x00\x12\x19\n\x06\x62utton\x18\x13 \x01(\x0b\x32\x07.ButtonH\x00\x12*\n\x0f\x64ownload_button\x18+ \x01(\x0b\x32\x0f.DownloadButtonH\x00\x12$\n\x0c\x63\x61mera_input\x18- \x01(\x0b\x32\x0c.CameraInputH\x00\x12 \n\nchat_input\x18\x31 \x01(\x0b\x32\n.ChatInputH\x00\x12\x1d\n\x08\x63heckbox\x18\x14 \x01(\x0b\x32\t.CheckboxH\x00\x12$\n\x0c\x63olor_picker\x18# \x01(\x0b\x32\x0c.ColorPickerH\x00\x12\x30\n\x12\x63omponent_instance\x18% \x01(\x0b\x32\x12.ComponentInstanceH\x00\x12 \n\ndata_frame\x18\x03 \x01(\x0b\x32\n.DataFrameH\x00\x12\x1b\n\x05table\x18\x0b \x01(\x0b\x32\n.DataFrameH\x00\x12 \n\ndate_input\x18\x1b \x01(\x0b\x32\n.DateInputH\x00\x12.\n\x12\x64\x65\x63k_gl_json_chart\x18\" \x01(\x0b\x32\x10.DeckGlJsonChartH\x00\x12 \n\ndoc_string\x18\x07 \x01(\x0b\x32\n.DocStringH\x00\x12\x17\n\x05\x65mpty\x18\x02 \x01(\x0b\x32\x06.EmptyH\x00\x12\x1f\n\texception\x18\x08 \x01(\x0b\x32\n.ExceptionH\x00\x12\x1b\n\x07\x66\x61vicon\x18$ \x01(\x0b\x32\x08.FaviconH\x00\x12&\n\rfile_uploader\x18! \x01(\x0b\x32\r.FileUploaderH\x00\x12(\n\x0egraphviz_chart\x18\x12 \x01(\x0b\x32\x0e.GraphVizChartH\x00\x12\x15\n\x04html\x18\x36 \x01(\x0b\x32\x05.HtmlH\x00\x12\x19\n\x06iframe\x18& \x01(\x0b\x32\x07.IFrameH\x00\x12\x1a\n\x04imgs\x18\x06 \x01(\x0b\x32\n.ImageListH\x00\x12\x15\n\x04json\x18\x1f \x01(\x0b\x32\x05.JsonH\x00\x12\"\n\x0blink_button\x18\x33 \x01(\x0b\x32\x0b.LinkButtonH\x00\x12\x1d\n\x08markdown\x18\x1d \x01(\x0b\x32\t.MarkdownH\x00\x12\x19\n\x06metric\x18* \x01(\x0b\x32\x07.MetricH\x00\x12#\n\x0bmultiselect\x18\x1c \x01(\x0b\x32\x0c.MultiSelectH\x00\x12$\n\x0cnumber_input\x18 \x01(\x0b\x32\x0c.NumberInputH\x00\x12\x1e\n\tpage_link\x18\x35 \x01(\x0b\x32\t.PageLinkH\x00\x12$\n\x0cplotly_chart\x18\x10 \x01(\x0b\x32\x0c.PlotlyChartH\x00\x12\x1d\n\x08progress\x18\x05 \x01(\x0b\x32\t.ProgressH\x00\x12\x17\n\x05radio\x18\x17 \x01(\x0b\x32\x06.RadioH\x00\x12\x1f\n\tselectbox\x18\x19 \x01(\x0b\x32\n.SelectboxH\x00\x12\x1d\n\x08skeleton\x18\x34 \x01(\x0b\x32\t.SkeletonH\x00\x12\x19\n\x06slider\x18\x15 \x01(\x0b\x32\x07.SliderH\x00\x12\x15\n\x04snow\x18. \x01(\x0b\x32\x05.SnowH\x00\x12\x1b\n\x07spinner\x18, \x01(\x0b\x32\x08.SpinnerH\x00\x12\x15\n\x04text\x18\x01 \x01(\x0b\x32\x05.TextH\x00\x12\x1e\n\ttext_area\x18\x16 \x01(\x0b\x32\t.TextAreaH\x00\x12 \n\ntext_input\x18\x18 \x01(\x0b\x32\n.TextInputH\x00\x12 \n\ntime_input\x18\x1a \x01(\x0b\x32\n.TimeInputH\x00\x12\x17\n\x05toast\x18\x32 \x01(\x0b\x32\x06.ToastH\x00\x12)\n\x0fvega_lite_chart\x18\n \x01(\x0b\x32\x0e.VegaLiteChartH\x00\x12\x17\n\x05video\x18\x0e \x01(\x0b\x32\x06.VideoH\x00\x12\x1b\n\x07heading\x18/ \x01(\x0b\x32\x08.HeadingH\x00\x12\x15\n\x04\x63ode\x18\x30 \x01(\x0b\x32\x05.CodeH\x00\x42\x06\n\x04typeJ\x04\x08\t\x10\nB,\n\x1c\x63om.snowflake.apps.streamlitB\x0c\x45lementProtob\x06proto3')
67
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dstreamlit/proto/Element.proto\x1a\x1bstreamlit/proto/Alert.proto\x1a\x1bstreamlit/proto/Arrow.proto\x1a\x1bstreamlit/proto/Audio.proto\x1a\x1estreamlit/proto/Balloons.proto\x1a(streamlit/proto/ArrowVegaLiteChart.proto\x1a streamlit/proto/BokehChart.proto\x1a\x1cstreamlit/proto/Button.proto\x1a!streamlit/proto/ButtonGroup.proto\x1a$streamlit/proto/DownloadButton.proto\x1a!streamlit/proto/CameraInput.proto\x1a\x1fstreamlit/proto/ChatInput.proto\x1a\x1estreamlit/proto/Checkbox.proto\x1a\x1astreamlit/proto/Code.proto\x1a!streamlit/proto/ColorPicker.proto\x1a\x1fstreamlit/proto/DataFrame.proto\x1a\x1fstreamlit/proto/DateInput.proto\x1a%streamlit/proto/DeckGlJsonChart.proto\x1a\x1fstreamlit/proto/DocString.proto\x1a\x1bstreamlit/proto/Empty.proto\x1a\x1fstreamlit/proto/Exception.proto\x1a\x1dstreamlit/proto/Favicon.proto\x1a\"streamlit/proto/FileUploader.proto\x1a#streamlit/proto/GraphVizChart.proto\x1a\x1astreamlit/proto/Html.proto\x1a\x1cstreamlit/proto/IFrame.proto\x1a\x1bstreamlit/proto/Image.proto\x1a\x1astreamlit/proto/Json.proto\x1a streamlit/proto/LinkButton.proto\x1a!streamlit/proto/NumberInput.proto\x1a\x1estreamlit/proto/Markdown.proto\x1a\x1cstreamlit/proto/Metric.proto\x1a!streamlit/proto/MultiSelect.proto\x1a\x1estreamlit/proto/PageLink.proto\x1a!streamlit/proto/PlotlyChart.proto\x1a streamlit/proto/Components.proto\x1a\x1estreamlit/proto/Progress.proto\x1a\x1astreamlit/proto/Snow.proto\x1a\x1dstreamlit/proto/Spinner.proto\x1a\x1bstreamlit/proto/Radio.proto\x1a\x1fstreamlit/proto/Selectbox.proto\x1a\x1estreamlit/proto/Skeleton.proto\x1a\x1cstreamlit/proto/Slider.proto\x1a\x1astreamlit/proto/Text.proto\x1a\x1estreamlit/proto/TextArea.proto\x1a\x1fstreamlit/proto/TextInput.proto\x1a\x1fstreamlit/proto/TimeInput.proto\x1a\x1bstreamlit/proto/Toast.proto\x1a#streamlit/proto/VegaLiteChart.proto\x1a\x1bstreamlit/proto/Video.proto\x1a\x1dstreamlit/proto/Heading.proto\"\xb4\r\n\x07\x45lement\x12\x17\n\x05\x61lert\x18\x1e \x01(\x0b\x32\x06.AlertH\x00\x12\"\n\x10\x61rrow_data_frame\x18( \x01(\x0b\x32\x06.ArrowH\x00\x12\x1d\n\x0b\x61rrow_table\x18\' \x01(\x0b\x32\x06.ArrowH\x00\x12\x34\n\x15\x61rrow_vega_lite_chart\x18) \x01(\x0b\x32\x13.ArrowVegaLiteChartH\x00\x12\x17\n\x05\x61udio\x18\r \x01(\x0b\x32\x06.AudioH\x00\x12\x1d\n\x08\x62\x61lloons\x18\x0c \x01(\x0b\x32\t.BalloonsH\x00\x12\"\n\x0b\x62okeh_chart\x18\x11 \x01(\x0b\x32\x0b.BokehChartH\x00\x12\x19\n\x06\x62utton\x18\x13 \x01(\x0b\x32\x07.ButtonH\x00\x12$\n\x0c\x62utton_group\x18\x37 \x01(\x0b\x32\x0c.ButtonGroupH\x00\x12*\n\x0f\x64ownload_button\x18+ \x01(\x0b\x32\x0f.DownloadButtonH\x00\x12$\n\x0c\x63\x61mera_input\x18- \x01(\x0b\x32\x0c.CameraInputH\x00\x12 \n\nchat_input\x18\x31 \x01(\x0b\x32\n.ChatInputH\x00\x12\x1d\n\x08\x63heckbox\x18\x14 \x01(\x0b\x32\t.CheckboxH\x00\x12$\n\x0c\x63olor_picker\x18# \x01(\x0b\x32\x0c.ColorPickerH\x00\x12\x30\n\x12\x63omponent_instance\x18% \x01(\x0b\x32\x12.ComponentInstanceH\x00\x12 \n\ndata_frame\x18\x03 \x01(\x0b\x32\n.DataFrameH\x00\x12\x1b\n\x05table\x18\x0b \x01(\x0b\x32\n.DataFrameH\x00\x12 \n\ndate_input\x18\x1b \x01(\x0b\x32\n.DateInputH\x00\x12.\n\x12\x64\x65\x63k_gl_json_chart\x18\" \x01(\x0b\x32\x10.DeckGlJsonChartH\x00\x12 \n\ndoc_string\x18\x07 \x01(\x0b\x32\n.DocStringH\x00\x12\x17\n\x05\x65mpty\x18\x02 \x01(\x0b\x32\x06.EmptyH\x00\x12\x1f\n\texception\x18\x08 \x01(\x0b\x32\n.ExceptionH\x00\x12\x1b\n\x07\x66\x61vicon\x18$ \x01(\x0b\x32\x08.FaviconH\x00\x12&\n\rfile_uploader\x18! \x01(\x0b\x32\r.FileUploaderH\x00\x12(\n\x0egraphviz_chart\x18\x12 \x01(\x0b\x32\x0e.GraphVizChartH\x00\x12\x15\n\x04html\x18\x36 \x01(\x0b\x32\x05.HtmlH\x00\x12\x19\n\x06iframe\x18& \x01(\x0b\x32\x07.IFrameH\x00\x12\x1a\n\x04imgs\x18\x06 \x01(\x0b\x32\n.ImageListH\x00\x12\x15\n\x04json\x18\x1f \x01(\x0b\x32\x05.JsonH\x00\x12\"\n\x0blink_button\x18\x33 \x01(\x0b\x32\x0b.LinkButtonH\x00\x12\x1d\n\x08markdown\x18\x1d \x01(\x0b\x32\t.MarkdownH\x00\x12\x19\n\x06metric\x18* \x01(\x0b\x32\x07.MetricH\x00\x12#\n\x0bmultiselect\x18\x1c \x01(\x0b\x32\x0c.MultiSelectH\x00\x12$\n\x0cnumber_input\x18 \x01(\x0b\x32\x0c.NumberInputH\x00\x12\x1e\n\tpage_link\x18\x35 \x01(\x0b\x32\t.PageLinkH\x00\x12$\n\x0cplotly_chart\x18\x10 \x01(\x0b\x32\x0c.PlotlyChartH\x00\x12\x1d\n\x08progress\x18\x05 \x01(\x0b\x32\t.ProgressH\x00\x12\x17\n\x05radio\x18\x17 \x01(\x0b\x32\x06.RadioH\x00\x12\x1f\n\tselectbox\x18\x19 \x01(\x0b\x32\n.SelectboxH\x00\x12\x1d\n\x08skeleton\x18\x34 \x01(\x0b\x32\t.SkeletonH\x00\x12\x19\n\x06slider\x18\x15 \x01(\x0b\x32\x07.SliderH\x00\x12\x15\n\x04snow\x18. \x01(\x0b\x32\x05.SnowH\x00\x12\x1b\n\x07spinner\x18, \x01(\x0b\x32\x08.SpinnerH\x00\x12\x15\n\x04text\x18\x01 \x01(\x0b\x32\x05.TextH\x00\x12\x1e\n\ttext_area\x18\x16 \x01(\x0b\x32\t.TextAreaH\x00\x12 \n\ntext_input\x18\x18 \x01(\x0b\x32\n.TextInputH\x00\x12 \n\ntime_input\x18\x1a \x01(\x0b\x32\n.TimeInputH\x00\x12\x17\n\x05toast\x18\x32 \x01(\x0b\x32\x06.ToastH\x00\x12)\n\x0fvega_lite_chart\x18\n \x01(\x0b\x32\x0e.VegaLiteChartH\x00\x12\x17\n\x05video\x18\x0e \x01(\x0b\x32\x06.VideoH\x00\x12\x1b\n\x07heading\x18/ \x01(\x0b\x32\x08.HeadingH\x00\x12\x15\n\x04\x63ode\x18\x30 \x01(\x0b\x32\x05.CodeH\x00\x42\x06\n\x04typeJ\x04\x08\t\x10\nB,\n\x1c\x63om.snowflake.apps.streamlitB\x0c\x45lementProtob\x06proto3')
67
68
 
68
69
  _globals = globals()
69
70
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -71,6 +72,6 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Element_pb2
71
72
  if not _descriptor._USE_C_DESCRIPTORS:
72
73
  _globals['DESCRIPTOR']._loaded_options = None
73
74
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\014ElementProto'
74
- _globals['_ELEMENT']._serialized_start=1613
75
- _globals['_ELEMENT']._serialized_end=3291
75
+ _globals['_ELEMENT']._serialized_start=1648
76
+ _globals['_ELEMENT']._serialized_end=3364
76
77
  # @@protoc_insertion_point(module_scope)
@@ -26,6 +26,7 @@ import streamlit.proto.Arrow_pb2
26
26
  import streamlit.proto.Audio_pb2
27
27
  import streamlit.proto.Balloons_pb2
28
28
  import streamlit.proto.BokehChart_pb2
29
+ import streamlit.proto.ButtonGroup_pb2
29
30
  import streamlit.proto.Button_pb2
30
31
  import streamlit.proto.CameraInput_pb2
31
32
  import streamlit.proto.ChatInput_pb2
@@ -87,6 +88,7 @@ class Element(google.protobuf.message.Message):
87
88
  BALLOONS_FIELD_NUMBER: builtins.int
88
89
  BOKEH_CHART_FIELD_NUMBER: builtins.int
89
90
  BUTTON_FIELD_NUMBER: builtins.int
91
+ BUTTON_GROUP_FIELD_NUMBER: builtins.int
90
92
  DOWNLOAD_BUTTON_FIELD_NUMBER: builtins.int
91
93
  CAMERA_INPUT_FIELD_NUMBER: builtins.int
92
94
  CHAT_INPUT_FIELD_NUMBER: builtins.int
@@ -147,6 +149,8 @@ class Element(google.protobuf.message.Message):
147
149
  @property
148
150
  def button(self) -> streamlit.proto.Button_pb2.Button: ...
149
151
  @property
152
+ def button_group(self) -> streamlit.proto.ButtonGroup_pb2.ButtonGroup: ...
153
+ @property
150
154
  def download_button(self) -> streamlit.proto.DownloadButton_pb2.DownloadButton: ...
151
155
  @property
152
156
  def camera_input(self) -> streamlit.proto.CameraInput_pb2.CameraInput: ...
@@ -238,7 +242,7 @@ class Element(google.protobuf.message.Message):
238
242
  def heading(self) -> streamlit.proto.Heading_pb2.Heading: ...
239
243
  @property
240
244
  def code(self) -> streamlit.proto.Code_pb2.Code:
241
- """Next ID: 55"""
245
+ """Next ID: 56"""
242
246
 
243
247
  def __init__(
244
248
  self,
@@ -251,6 +255,7 @@ class Element(google.protobuf.message.Message):
251
255
  balloons: streamlit.proto.Balloons_pb2.Balloons | None = ...,
252
256
  bokeh_chart: streamlit.proto.BokehChart_pb2.BokehChart | None = ...,
253
257
  button: streamlit.proto.Button_pb2.Button | None = ...,
258
+ button_group: streamlit.proto.ButtonGroup_pb2.ButtonGroup | None = ...,
254
259
  download_button: streamlit.proto.DownloadButton_pb2.DownloadButton | None = ...,
255
260
  camera_input: streamlit.proto.CameraInput_pb2.CameraInput | None = ...,
256
261
  chat_input: streamlit.proto.ChatInput_pb2.ChatInput | None = ...,
@@ -295,8 +300,8 @@ class Element(google.protobuf.message.Message):
295
300
  heading: streamlit.proto.Heading_pb2.Heading | None = ...,
296
301
  code: streamlit.proto.Code_pb2.Code | None = ...,
297
302
  ) -> None: ...
298
- def HasField(self, field_name: typing.Literal["alert", b"alert", "arrow_data_frame", b"arrow_data_frame", "arrow_table", b"arrow_table", "arrow_vega_lite_chart", b"arrow_vega_lite_chart", "audio", b"audio", "balloons", b"balloons", "bokeh_chart", b"bokeh_chart", "button", b"button", "camera_input", b"camera_input", "chat_input", b"chat_input", "checkbox", b"checkbox", "code", b"code", "color_picker", b"color_picker", "component_instance", b"component_instance", "data_frame", b"data_frame", "date_input", b"date_input", "deck_gl_json_chart", b"deck_gl_json_chart", "doc_string", b"doc_string", "download_button", b"download_button", "empty", b"empty", "exception", b"exception", "favicon", b"favicon", "file_uploader", b"file_uploader", "graphviz_chart", b"graphviz_chart", "heading", b"heading", "html", b"html", "iframe", b"iframe", "imgs", b"imgs", "json", b"json", "link_button", b"link_button", "markdown", b"markdown", "metric", b"metric", "multiselect", b"multiselect", "number_input", b"number_input", "page_link", b"page_link", "plotly_chart", b"plotly_chart", "progress", b"progress", "radio", b"radio", "selectbox", b"selectbox", "skeleton", b"skeleton", "slider", b"slider", "snow", b"snow", "spinner", b"spinner", "table", b"table", "text", b"text", "text_area", b"text_area", "text_input", b"text_input", "time_input", b"time_input", "toast", b"toast", "type", b"type", "vega_lite_chart", b"vega_lite_chart", "video", b"video"]) -> builtins.bool: ...
299
- def ClearField(self, field_name: typing.Literal["alert", b"alert", "arrow_data_frame", b"arrow_data_frame", "arrow_table", b"arrow_table", "arrow_vega_lite_chart", b"arrow_vega_lite_chart", "audio", b"audio", "balloons", b"balloons", "bokeh_chart", b"bokeh_chart", "button", b"button", "camera_input", b"camera_input", "chat_input", b"chat_input", "checkbox", b"checkbox", "code", b"code", "color_picker", b"color_picker", "component_instance", b"component_instance", "data_frame", b"data_frame", "date_input", b"date_input", "deck_gl_json_chart", b"deck_gl_json_chart", "doc_string", b"doc_string", "download_button", b"download_button", "empty", b"empty", "exception", b"exception", "favicon", b"favicon", "file_uploader", b"file_uploader", "graphviz_chart", b"graphviz_chart", "heading", b"heading", "html", b"html", "iframe", b"iframe", "imgs", b"imgs", "json", b"json", "link_button", b"link_button", "markdown", b"markdown", "metric", b"metric", "multiselect", b"multiselect", "number_input", b"number_input", "page_link", b"page_link", "plotly_chart", b"plotly_chart", "progress", b"progress", "radio", b"radio", "selectbox", b"selectbox", "skeleton", b"skeleton", "slider", b"slider", "snow", b"snow", "spinner", b"spinner", "table", b"table", "text", b"text", "text_area", b"text_area", "text_input", b"text_input", "time_input", b"time_input", "toast", b"toast", "type", b"type", "vega_lite_chart", b"vega_lite_chart", "video", b"video"]) -> None: ...
300
- def WhichOneof(self, oneof_group: typing.Literal["type", b"type"]) -> typing.Literal["alert", "arrow_data_frame", "arrow_table", "arrow_vega_lite_chart", "audio", "balloons", "bokeh_chart", "button", "download_button", "camera_input", "chat_input", "checkbox", "color_picker", "component_instance", "data_frame", "table", "date_input", "deck_gl_json_chart", "doc_string", "empty", "exception", "favicon", "file_uploader", "graphviz_chart", "html", "iframe", "imgs", "json", "link_button", "markdown", "metric", "multiselect", "number_input", "page_link", "plotly_chart", "progress", "radio", "selectbox", "skeleton", "slider", "snow", "spinner", "text", "text_area", "text_input", "time_input", "toast", "vega_lite_chart", "video", "heading", "code"] | None: ...
303
+ def HasField(self, field_name: typing.Literal["alert", b"alert", "arrow_data_frame", b"arrow_data_frame", "arrow_table", b"arrow_table", "arrow_vega_lite_chart", b"arrow_vega_lite_chart", "audio", b"audio", "balloons", b"balloons", "bokeh_chart", b"bokeh_chart", "button", b"button", "button_group", b"button_group", "camera_input", b"camera_input", "chat_input", b"chat_input", "checkbox", b"checkbox", "code", b"code", "color_picker", b"color_picker", "component_instance", b"component_instance", "data_frame", b"data_frame", "date_input", b"date_input", "deck_gl_json_chart", b"deck_gl_json_chart", "doc_string", b"doc_string", "download_button", b"download_button", "empty", b"empty", "exception", b"exception", "favicon", b"favicon", "file_uploader", b"file_uploader", "graphviz_chart", b"graphviz_chart", "heading", b"heading", "html", b"html", "iframe", b"iframe", "imgs", b"imgs", "json", b"json", "link_button", b"link_button", "markdown", b"markdown", "metric", b"metric", "multiselect", b"multiselect", "number_input", b"number_input", "page_link", b"page_link", "plotly_chart", b"plotly_chart", "progress", b"progress", "radio", b"radio", "selectbox", b"selectbox", "skeleton", b"skeleton", "slider", b"slider", "snow", b"snow", "spinner", b"spinner", "table", b"table", "text", b"text", "text_area", b"text_area", "text_input", b"text_input", "time_input", b"time_input", "toast", b"toast", "type", b"type", "vega_lite_chart", b"vega_lite_chart", "video", b"video"]) -> builtins.bool: ...
304
+ def ClearField(self, field_name: typing.Literal["alert", b"alert", "arrow_data_frame", b"arrow_data_frame", "arrow_table", b"arrow_table", "arrow_vega_lite_chart", b"arrow_vega_lite_chart", "audio", b"audio", "balloons", b"balloons", "bokeh_chart", b"bokeh_chart", "button", b"button", "button_group", b"button_group", "camera_input", b"camera_input", "chat_input", b"chat_input", "checkbox", b"checkbox", "code", b"code", "color_picker", b"color_picker", "component_instance", b"component_instance", "data_frame", b"data_frame", "date_input", b"date_input", "deck_gl_json_chart", b"deck_gl_json_chart", "doc_string", b"doc_string", "download_button", b"download_button", "empty", b"empty", "exception", b"exception", "favicon", b"favicon", "file_uploader", b"file_uploader", "graphviz_chart", b"graphviz_chart", "heading", b"heading", "html", b"html", "iframe", b"iframe", "imgs", b"imgs", "json", b"json", "link_button", b"link_button", "markdown", b"markdown", "metric", b"metric", "multiselect", b"multiselect", "number_input", b"number_input", "page_link", b"page_link", "plotly_chart", b"plotly_chart", "progress", b"progress", "radio", b"radio", "selectbox", b"selectbox", "skeleton", b"skeleton", "slider", b"slider", "snow", b"snow", "spinner", b"spinner", "table", b"table", "text", b"text", "text_area", b"text_area", "text_input", b"text_input", "time_input", b"time_input", "toast", b"toast", "type", b"type", "vega_lite_chart", b"vega_lite_chart", "video", b"video"]) -> None: ...
305
+ def WhichOneof(self, oneof_group: typing.Literal["type", b"type"]) -> typing.Literal["alert", "arrow_data_frame", "arrow_table", "arrow_vega_lite_chart", "audio", "balloons", "bokeh_chart", "button", "button_group", "download_button", "camera_input", "chat_input", "checkbox", "color_picker", "component_instance", "data_frame", "table", "date_input", "deck_gl_json_chart", "doc_string", "empty", "exception", "favicon", "file_uploader", "graphviz_chart", "html", "iframe", "imgs", "json", "link_button", "markdown", "metric", "multiselect", "number_input", "page_link", "plotly_chart", "progress", "radio", "selectbox", "skeleton", "slider", "snow", "spinner", "text", "text_area", "text_input", "time_input", "toast", "vega_lite_chart", "video", "heading", "code"] | None: ...
301
306
 
302
307
  global___Element = Element
@@ -43,6 +43,7 @@ from streamlit.errors import StreamlitAPIException
43
43
  from streamlit.proto.Arrow_pb2 import Arrow
44
44
  from streamlit.proto.ArrowVegaLiteChart_pb2 import ArrowVegaLiteChart
45
45
  from streamlit.proto.Button_pb2 import Button
46
+ from streamlit.proto.ButtonGroup_pb2 import ButtonGroup
46
47
  from streamlit.proto.CameraInput_pb2 import CameraInput
47
48
  from streamlit.proto.ChatInput_pb2 import ChatInput
48
49
  from streamlit.proto.Checkbox_pb2 import Checkbox
@@ -74,6 +75,7 @@ WidgetProto: TypeAlias = Union[
74
75
  Arrow,
75
76
  ArrowVegaLiteChart,
76
77
  Button,
78
+ ButtonGroup,
77
79
  CameraInput,
78
80
  ChatInput,
79
81
  Checkbox,
@@ -52,6 +52,7 @@ ELEMENT_TYPE_TO_VALUE_TYPE: Final[Mapping[ElementType, ValueFieldName]] = (
52
52
  MappingProxyType(
53
53
  {
54
54
  "button": "trigger_value",
55
+ "button_group": "int_array_value",
55
56
  "camera_input": "file_uploader_state_value",
56
57
  "checkbox": "bool_value",
57
58
  "chat_input": "string_trigger_value",