streamlit-nightly 1.35.1.dev20240611__py2.py3-none-any.whl → 1.35.1.dev20240613__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.
streamlit/config.py CHANGED
@@ -465,9 +465,6 @@ _create_option(
465
465
  visibility="hidden",
466
466
  type_=bool,
467
467
  scriptable=True,
468
- deprecated=True,
469
- deprecation_text="logger.enableRich has been deprecated and will be removed in a future version. Exception formatting via rich will be automatically used if rich is enable.",
470
- expiration_date="2024-09-10",
471
468
  )
472
469
 
473
470
  # Config Section: Client #
@@ -21,6 +21,7 @@ from typing_extensions import TypeAlias
21
21
  from streamlit.errors import StreamlitAPIException
22
22
  from streamlit.proto.Block_pb2 import Block as BlockProto
23
23
  from streamlit.runtime.metrics_util import gather_metrics
24
+ from streamlit.string_util import validate_icon_or_emoji
24
25
 
25
26
  if TYPE_CHECKING:
26
27
  from streamlit.delta_generator import DeltaGenerator
@@ -130,6 +131,7 @@ class LayoutsMixin:
130
131
  block_proto = BlockProto()
131
132
  block_proto.allow_empty = False
132
133
  block_proto.vertical.border = border or False
134
+
133
135
  if height:
134
136
  # Activate scrolling container behavior:
135
137
  block_proto.allow_empty = True
@@ -144,7 +146,11 @@ class LayoutsMixin:
144
146
 
145
147
  @gather_metrics("columns")
146
148
  def columns(
147
- self, spec: SpecType, *, gap: str | None = "small"
149
+ self,
150
+ spec: SpecType,
151
+ *,
152
+ gap: Literal["small", "medium", "large"] = "small",
153
+ vertical_alignment: Literal["top", "center", "bottom"] = "top",
148
154
  ) -> list[DeltaGenerator]:
149
155
  """Insert containers laid out as side-by-side columns.
150
156
 
@@ -176,6 +182,9 @@ class LayoutsMixin:
176
182
  gap : "small", "medium", or "large"
177
183
  The size of the gap between the columns. Defaults to "small".
178
184
 
185
+ vertical_alignment : "top", "center", or "bottom"
186
+ The vertical alignment of the content inside the columns. Defaults to "top".
187
+
179
188
  Returns
180
189
  -------
181
190
  list of containers
@@ -225,13 +234,6 @@ class LayoutsMixin:
225
234
 
226
235
  """
227
236
  weights = spec
228
- weights_exception = StreamlitAPIException(
229
- "The input argument to st.columns must be either a "
230
- "positive integer or a list of positive numeric weights. "
231
- "See [documentation](https://docs.streamlit.io/library/api-reference/layout/st.columns) "
232
- "for more information."
233
- )
234
-
235
237
  if isinstance(weights, int):
236
238
  # If the user provided a single number, expand into equal weights.
237
239
  # E.g. (1,) * 3 => (1, 1, 1)
@@ -239,7 +241,26 @@ class LayoutsMixin:
239
241
  weights = (1,) * weights
240
242
 
241
243
  if len(weights) == 0 or any(weight <= 0 for weight in weights):
242
- raise weights_exception
244
+ raise StreamlitAPIException(
245
+ "The input argument to st.columns must be either a "
246
+ "positive integer or a list of positive numeric weights. "
247
+ "See [documentation](https://docs.streamlit.io/library/api-reference/layout/st.columns) "
248
+ "for more information."
249
+ )
250
+
251
+ vertical_alignment_mapping: dict[
252
+ str, BlockProto.Column.VerticalAlignment.ValueType
253
+ ] = {
254
+ "top": BlockProto.Column.VerticalAlignment.TOP,
255
+ "center": BlockProto.Column.VerticalAlignment.CENTER,
256
+ "bottom": BlockProto.Column.VerticalAlignment.BOTTOM,
257
+ }
258
+
259
+ if vertical_alignment not in vertical_alignment_mapping:
260
+ raise StreamlitAPIException(
261
+ 'The `vertical_alignment` argument to st.columns must be "top", "center", or "bottom". \n'
262
+ f"The argument passed was {vertical_alignment}."
263
+ )
243
264
 
244
265
  def column_gap(gap):
245
266
  if isinstance(gap, str):
@@ -260,6 +281,9 @@ class LayoutsMixin:
260
281
  col_proto = BlockProto()
261
282
  col_proto.column.weight = normalized_weight
262
283
  col_proto.column.gap = gap_size
284
+ col_proto.column.vertical_alignment = vertical_alignment_mapping[
285
+ vertical_alignment
286
+ ]
263
287
  col_proto.allow_empty = True
264
288
  return col_proto
265
289
 
@@ -385,7 +409,13 @@ class LayoutsMixin:
385
409
  return tuple(tab_container._block(tab_proto(tab_label)) for tab_label in tabs)
386
410
 
387
411
  @gather_metrics("expander")
388
- def expander(self, label: str, expanded: bool = False) -> DeltaGenerator:
412
+ def expander(
413
+ self,
414
+ label: str,
415
+ expanded: bool = False,
416
+ *,
417
+ icon: str | None = None,
418
+ ) -> DeltaGenerator:
389
419
  r"""Insert a multi-element container that can be expanded/collapsed.
390
420
 
391
421
  Inserts a container into your app that can be used to hold multiple elements
@@ -429,6 +459,22 @@ class LayoutsMixin:
429
459
  expanded : bool
430
460
  If True, initializes the expander in "expanded" state. Defaults to
431
461
  False (collapsed).
462
+ icon : str, None
463
+ An optional emoji or icon to display next to the expander label. If ``icon``
464
+ is ``None`` (default), no icon is displayed. If ``icon`` is a
465
+ string, the following options are valid:
466
+
467
+ * A single-character emoji. For example, you can set ``icon="🚨"``
468
+ or ``icon="🔥"``. Emoji short codes are not supported.
469
+
470
+ * An icon from the Material Symbols library (outlined style) in the
471
+ format ``":material/icon_name:"`` where "icon_name" is the name
472
+ of the icon in snake case.
473
+
474
+ For example, ``icon=":material/thumb_up:"`` will display the
475
+ Thumb Up icon. Find additional icons in the `Material Symbols \
476
+ <https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Outlined>`_
477
+ font library.
432
478
 
433
479
  Examples
434
480
  --------
@@ -475,6 +521,8 @@ class LayoutsMixin:
475
521
  expandable_proto = BlockProto.Expandable()
476
522
  expandable_proto.expanded = expanded
477
523
  expandable_proto.label = label
524
+ if icon is not None:
525
+ expandable_proto.icon = validate_icon_or_emoji(icon)
478
526
 
479
527
  block_proto = BlockProto()
480
528
  block_proto.allow_empty = False
@@ -71,7 +71,8 @@ class AddRowsMetadata:
71
71
 
72
72
  class ChartType(Enum):
73
73
  AREA = {"mark_type": "area", "command": "area_chart"}
74
- BAR = {"mark_type": "bar", "command": "bar_chart"}
74
+ VERTICAL_BAR = {"mark_type": "bar", "command": "bar_chart", "horizontal": False}
75
+ HORIZONTAL_BAR = {"mark_type": "bar", "command": "bar_chart", "horizontal": True}
75
76
  LINE = {"mark_type": "line", "command": "line_chart"}
76
77
  SCATTER = {"mark_type": "circle", "command": "scatter_chart"}
77
78
 
@@ -165,6 +166,22 @@ def generate_chart(
165
166
 
166
167
  # At this point, x_column is only None if user did not provide one AND df is empty.
167
168
 
169
+ if chart_type == ChartType.HORIZONTAL_BAR:
170
+ # Handle horizontal bar chart - switches x and y data:
171
+ x_encoding = _get_x_encoding(
172
+ df, y_column, y_from_user, x_axis_label, chart_type
173
+ )
174
+ y_encoding = _get_y_encoding(
175
+ df, x_column, x_from_user, y_axis_label, chart_type
176
+ )
177
+ else:
178
+ x_encoding = _get_x_encoding(
179
+ df, x_column, x_from_user, x_axis_label, chart_type
180
+ )
181
+ y_encoding = _get_y_encoding(
182
+ df, y_column, y_from_user, y_axis_label, chart_type
183
+ )
184
+
168
185
  # Create a Chart with x and y encodings.
169
186
  chart = alt.Chart(
170
187
  data=df,
@@ -172,8 +189,8 @@ def generate_chart(
172
189
  width=width or 0,
173
190
  height=height or 0,
174
191
  ).encode(
175
- x=_get_x_encoding(df, x_column, x_from_user, x_axis_label, chart_type),
176
- y=_get_y_encoding(df, y_column, y_from_user, y_axis_label),
192
+ x=x_encoding,
193
+ y=y_encoding,
177
194
  )
178
195
 
179
196
  # Set up opacity encoding.
@@ -620,7 +637,7 @@ def _maybe_melt(
620
637
  def _get_x_encoding(
621
638
  df: pd.DataFrame,
622
639
  x_column: str | None,
623
- x_from_user: str | None,
640
+ x_from_user: str | Sequence[str] | None,
624
641
  x_axis_label: str | None,
625
642
  chart_type: ChartType,
626
643
  ) -> alt.X:
@@ -653,12 +670,15 @@ def _get_x_encoding(
653
670
  if x_axis_label is not None:
654
671
  x_title = x_axis_label
655
672
 
673
+ # grid lines on x axis for horizontal bar charts only
674
+ grid = True if chart_type == ChartType.HORIZONTAL_BAR else False
675
+
656
676
  return alt.X(
657
677
  x_field,
658
678
  title=x_title,
659
679
  type=_get_x_encoding_type(df, chart_type, x_column),
660
680
  scale=alt.Scale(),
661
- axis=_get_axis_config(df, x_column, grid=False),
681
+ axis=_get_axis_config(df, x_column, grid=grid),
662
682
  )
663
683
 
664
684
 
@@ -667,6 +687,7 @@ def _get_y_encoding(
667
687
  y_column: str | None,
668
688
  y_from_user: str | Sequence[str] | None,
669
689
  y_axis_label: str | None,
690
+ chart_type: ChartType,
670
691
  ) -> alt.Y:
671
692
  import altair as alt
672
693
 
@@ -697,12 +718,15 @@ def _get_y_encoding(
697
718
  if y_axis_label is not None:
698
719
  y_title = y_axis_label
699
720
 
721
+ # grid lines on y axis for all charts except horizontal bar charts
722
+ grid = False if chart_type == ChartType.HORIZONTAL_BAR else True
723
+
700
724
  return alt.Y(
701
725
  field=y_field,
702
726
  title=y_title,
703
- type=_get_y_encoding_type(df, y_column),
727
+ type=_get_y_encoding_type(df, chart_type, y_column),
704
728
  scale=alt.Scale(),
705
- axis=_get_axis_config(df, y_column, grid=True),
729
+ axis=_get_axis_config(df, y_column, grid=grid),
706
730
  )
707
731
 
708
732
 
@@ -877,17 +901,21 @@ def _get_x_encoding_type(
877
901
  if x_column is None:
878
902
  return "quantitative" # Anything. If None, Vega-Lite may hide the axis.
879
903
 
880
- # Bar charts should have a discrete (ordinal) x-axis, UNLESS type is date/time
904
+ # Vertical bar charts should have a discrete (ordinal) x-axis, UNLESS type is date/time
881
905
  # https://github.com/streamlit/streamlit/pull/2097#issuecomment-714802475
882
- if chart_type == ChartType.BAR and not _is_date_column(df, x_column):
906
+ if chart_type == ChartType.VERTICAL_BAR and not _is_date_column(df, x_column):
883
907
  return "ordinal"
884
908
 
885
909
  return type_util.infer_vegalite_type(df[x_column])
886
910
 
887
911
 
888
912
  def _get_y_encoding_type(
889
- df: pd.DataFrame, y_column: str | None
913
+ df: pd.DataFrame, chart_type: ChartType, y_column: str | None
890
914
  ) -> type_util.VegaLiteType:
915
+ # Horizontal bar charts should have a discrete (ordinal) y-axis, UNLESS type is date/time
916
+ if chart_type == ChartType.HORIZONTAL_BAR and not _is_date_column(df, y_column):
917
+ return "ordinal"
918
+
891
919
  if y_column:
892
920
  return type_util.infer_vegalite_type(df[y_column])
893
921
 
@@ -47,9 +47,9 @@ class StatusContainer(DeltaGenerator):
47
47
  if state == "running":
48
48
  expandable_proto.icon = "spinner"
49
49
  elif state == "complete":
50
- expandable_proto.icon = "check"
50
+ expandable_proto.icon = ":material/check:"
51
51
  elif state == "error":
52
- expandable_proto.icon = "error"
52
+ expandable_proto.icon = ":material/error:"
53
53
  else:
54
54
  raise StreamlitAPIException(
55
55
  f"Unknown state ({state}). Must be one of 'running', 'complete', or 'error'."
@@ -140,9 +140,9 @@ class StatusContainer(DeltaGenerator):
140
140
  if state == "running":
141
141
  msg.delta.add_block.expandable.icon = "spinner"
142
142
  elif state == "complete":
143
- msg.delta.add_block.expandable.icon = "check"
143
+ msg.delta.add_block.expandable.icon = ":material/check:"
144
144
  elif state == "error":
145
- msg.delta.add_block.expandable.icon = "error"
145
+ msg.delta.add_block.expandable.icon = ":material/error:"
146
146
  else:
147
147
  raise StreamlitAPIException(
148
148
  f"Unknown state ({state}). Must be one of 'running', 'complete', or 'error'."
@@ -936,6 +936,7 @@ class VegaChartsMixin:
936
936
  x_label: str | None = None,
937
937
  y_label: str | None = None,
938
938
  color: str | Color | list[Color] | None = None,
939
+ horizontal: bool = False,
939
940
  width: int | None = None,
940
941
  height: int | None = None,
941
942
  use_container_width: bool = True,
@@ -1010,6 +1011,11 @@ class VegaChartsMixin:
1010
1011
  as the number of y values (e.g. ``color=["#fd0", "#f0f", "#04f"]``
1011
1012
  for three lines).
1012
1013
 
1014
+ horizontal : bool
1015
+ Determines the orientation of the chart:
1016
+ * True: Displays the chart horizontally, with the x-axis and y-axis swapped.
1017
+ * False: Displays the chart vertically (default).
1018
+
1013
1019
  width : int or None
1014
1020
  Desired width of the chart expressed in pixels. If ``width`` is
1015
1021
  ``None`` (default), Streamlit sets the width of the chart to fit
@@ -1090,8 +1096,12 @@ class VegaChartsMixin:
1090
1096
 
1091
1097
  """
1092
1098
 
1099
+ bar_chart_type = (
1100
+ ChartType.HORIZONTAL_BAR if horizontal else ChartType.VERTICAL_BAR
1101
+ )
1102
+
1093
1103
  chart, add_rows_metadata = generate_chart(
1094
- chart_type=ChartType.BAR,
1104
+ chart_type=bar_chart_type,
1095
1105
  data=data,
1096
1106
  x_from_user=x,
1097
1107
  y_from_user=y,
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
14
14
 
15
15
 
16
16
 
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Block.proto\"\xbe\x08\n\x05\x42lock\x12#\n\x08vertical\x18\x01 \x01(\x0b\x32\x0f.Block.VerticalH\x00\x12\'\n\nhorizontal\x18\x02 \x01(\x0b\x32\x11.Block.HorizontalH\x00\x12\x1f\n\x06\x63olumn\x18\x03 \x01(\x0b\x32\r.Block.ColumnH\x00\x12\'\n\nexpandable\x18\x04 \x01(\x0b\x32\x11.Block.ExpandableH\x00\x12\x1b\n\x04\x66orm\x18\x05 \x01(\x0b\x32\x0b.Block.FormH\x00\x12,\n\rtab_container\x18\x06 \x01(\x0b\x32\x13.Block.TabContainerH\x00\x12\x19\n\x03tab\x18\x07 \x01(\x0b\x32\n.Block.TabH\x00\x12*\n\x0c\x63hat_message\x18\t \x01(\x0b\x32\x12.Block.ChatMessageH\x00\x12!\n\x07popover\x18\n \x01(\x0b\x32\x0e.Block.PopoverH\x00\x12\x1f\n\x06\x64ialog\x18\x0b \x01(\x0b\x32\r.Block.DialogH\x00\x12\x13\n\x0b\x61llow_empty\x18\x08 \x01(\x08\x1a*\n\x08Vertical\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12\x0e\n\x06height\x18\x02 \x01(\r\x1a\x19\n\nHorizontal\x12\x0b\n\x03gap\x18\x01 \x01(\t\x1a%\n\x06\x43olumn\x12\x0e\n\x06weight\x18\x01 \x01(\x01\x12\x0b\n\x03gap\x18\x02 \x01(\t\x1aM\n\nExpandable\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\x08\x65xpanded\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04icon\x18\x03 \x01(\tB\x0b\n\t_expanded\x1a\x9d\x01\n\x06\x44ialog\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64ismissible\x18\x02 \x01(\x08\x12(\n\x05width\x18\x03 \x01(\x0e\x32\x19.Block.Dialog.DialogWidth\x12\x14\n\x07is_open\x18\x04 \x01(\x08H\x00\x88\x01\x01\"#\n\x0b\x44ialogWidth\x12\t\n\x05SMALL\x10\x00\x12\t\n\x05LARGE\x10\x01\x42\n\n\x08_is_open\x1a@\n\x04\x46orm\x12\x0f\n\x07\x66orm_id\x18\x01 \x01(\t\x12\x17\n\x0f\x63lear_on_submit\x18\x02 \x01(\x08\x12\x0e\n\x06\x62order\x18\x03 \x01(\x08\x1a\x0e\n\x0cTabContainer\x1a\x14\n\x03Tab\x12\r\n\x05label\x18\x01 \x01(\t\x1aU\n\x07Popover\x12\r\n\x05label\x18\x01 \x01(\t\x12\x1b\n\x13use_container_width\x18\x02 \x01(\x08\x12\x0c\n\x04help\x18\x03 \x01(\t\x12\x10\n\x08\x64isabled\x18\x04 \x01(\x08\x1a\x8d\x01\n\x0b\x43hatMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x61vatar\x18\x02 \x01(\t\x12\x32\n\x0b\x61vatar_type\x18\x03 \x01(\x0e\x32\x1d.Block.ChatMessage.AvatarType\",\n\nAvatarType\x12\t\n\x05IMAGE\x10\x00\x12\t\n\x05\x45MOJI\x10\x01\x12\x08\n\x04ICON\x10\x02\x42\x06\n\x04typeB*\n\x1c\x63om.snowflake.apps.streamlitB\nBlockProtob\x06proto3')
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Block.proto\"\xb2\t\n\x05\x42lock\x12#\n\x08vertical\x18\x01 \x01(\x0b\x32\x0f.Block.VerticalH\x00\x12\'\n\nhorizontal\x18\x02 \x01(\x0b\x32\x11.Block.HorizontalH\x00\x12\x1f\n\x06\x63olumn\x18\x03 \x01(\x0b\x32\r.Block.ColumnH\x00\x12\'\n\nexpandable\x18\x04 \x01(\x0b\x32\x11.Block.ExpandableH\x00\x12\x1b\n\x04\x66orm\x18\x05 \x01(\x0b\x32\x0b.Block.FormH\x00\x12,\n\rtab_container\x18\x06 \x01(\x0b\x32\x13.Block.TabContainerH\x00\x12\x19\n\x03tab\x18\x07 \x01(\x0b\x32\n.Block.TabH\x00\x12*\n\x0c\x63hat_message\x18\t \x01(\x0b\x32\x12.Block.ChatMessageH\x00\x12!\n\x07popover\x18\n \x01(\x0b\x32\x0e.Block.PopoverH\x00\x12\x1f\n\x06\x64ialog\x18\x0b \x01(\x0b\x32\r.Block.DialogH\x00\x12\x13\n\x0b\x61llow_empty\x18\x08 \x01(\x08\x1a*\n\x08Vertical\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12\x0e\n\x06height\x18\x02 \x01(\r\x1a\x19\n\nHorizontal\x12\x0b\n\x03gap\x18\x01 \x01(\t\x1a\x98\x01\n\x06\x43olumn\x12\x0e\n\x06weight\x18\x01 \x01(\x01\x12\x0b\n\x03gap\x18\x02 \x01(\t\x12;\n\x12vertical_alignment\x18\x03 \x01(\x0e\x32\x1f.Block.Column.VerticalAlignment\"4\n\x11VerticalAlignment\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x43\x45NTER\x10\x01\x12\n\n\x06\x42OTTOM\x10\x02\x1aM\n\nExpandable\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\x08\x65xpanded\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04icon\x18\x03 \x01(\tB\x0b\n\t_expanded\x1a\x9d\x01\n\x06\x44ialog\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64ismissible\x18\x02 \x01(\x08\x12(\n\x05width\x18\x03 \x01(\x0e\x32\x19.Block.Dialog.DialogWidth\x12\x14\n\x07is_open\x18\x04 \x01(\x08H\x00\x88\x01\x01\"#\n\x0b\x44ialogWidth\x12\t\n\x05SMALL\x10\x00\x12\t\n\x05LARGE\x10\x01\x42\n\n\x08_is_open\x1a@\n\x04\x46orm\x12\x0f\n\x07\x66orm_id\x18\x01 \x01(\t\x12\x17\n\x0f\x63lear_on_submit\x18\x02 \x01(\x08\x12\x0e\n\x06\x62order\x18\x03 \x01(\x08\x1a\x0e\n\x0cTabContainer\x1a\x14\n\x03Tab\x12\r\n\x05label\x18\x01 \x01(\t\x1aU\n\x07Popover\x12\r\n\x05label\x18\x01 \x01(\t\x12\x1b\n\x13use_container_width\x18\x02 \x01(\x08\x12\x0c\n\x04help\x18\x03 \x01(\t\x12\x10\n\x08\x64isabled\x18\x04 \x01(\x08\x1a\x8d\x01\n\x0b\x43hatMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x61vatar\x18\x02 \x01(\t\x12\x32\n\x0b\x61vatar_type\x18\x03 \x01(\x0e\x32\x1d.Block.ChatMessage.AvatarType\",\n\nAvatarType\x12\t\n\x05IMAGE\x10\x00\x12\t\n\x05\x45MOJI\x10\x01\x12\x08\n\x04ICON\x10\x02\x42\x06\n\x04typeB*\n\x1c\x63om.snowflake.apps.streamlitB\nBlockProtob\x06proto3')
18
18
 
19
19
  _globals = globals()
20
20
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -23,29 +23,31 @@ if not _descriptor._USE_C_DESCRIPTORS:
23
23
  _globals['DESCRIPTOR']._loaded_options = None
24
24
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\nBlockProto'
25
25
  _globals['_BLOCK']._serialized_start=32
26
- _globals['_BLOCK']._serialized_end=1118
26
+ _globals['_BLOCK']._serialized_end=1234
27
27
  _globals['_BLOCK_VERTICAL']._serialized_start=428
28
28
  _globals['_BLOCK_VERTICAL']._serialized_end=470
29
29
  _globals['_BLOCK_HORIZONTAL']._serialized_start=472
30
30
  _globals['_BLOCK_HORIZONTAL']._serialized_end=497
31
- _globals['_BLOCK_COLUMN']._serialized_start=499
32
- _globals['_BLOCK_COLUMN']._serialized_end=536
33
- _globals['_BLOCK_EXPANDABLE']._serialized_start=538
34
- _globals['_BLOCK_EXPANDABLE']._serialized_end=615
35
- _globals['_BLOCK_DIALOG']._serialized_start=618
36
- _globals['_BLOCK_DIALOG']._serialized_end=775
37
- _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_start=728
38
- _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_end=763
39
- _globals['_BLOCK_FORM']._serialized_start=777
40
- _globals['_BLOCK_FORM']._serialized_end=841
41
- _globals['_BLOCK_TABCONTAINER']._serialized_start=843
42
- _globals['_BLOCK_TABCONTAINER']._serialized_end=857
43
- _globals['_BLOCK_TAB']._serialized_start=859
44
- _globals['_BLOCK_TAB']._serialized_end=879
45
- _globals['_BLOCK_POPOVER']._serialized_start=881
46
- _globals['_BLOCK_POPOVER']._serialized_end=966
47
- _globals['_BLOCK_CHATMESSAGE']._serialized_start=969
48
- _globals['_BLOCK_CHATMESSAGE']._serialized_end=1110
49
- _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_start=1066
50
- _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_end=1110
31
+ _globals['_BLOCK_COLUMN']._serialized_start=500
32
+ _globals['_BLOCK_COLUMN']._serialized_end=652
33
+ _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_start=600
34
+ _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_end=652
35
+ _globals['_BLOCK_EXPANDABLE']._serialized_start=654
36
+ _globals['_BLOCK_EXPANDABLE']._serialized_end=731
37
+ _globals['_BLOCK_DIALOG']._serialized_start=734
38
+ _globals['_BLOCK_DIALOG']._serialized_end=891
39
+ _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_start=844
40
+ _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_end=879
41
+ _globals['_BLOCK_FORM']._serialized_start=893
42
+ _globals['_BLOCK_FORM']._serialized_end=957
43
+ _globals['_BLOCK_TABCONTAINER']._serialized_start=959
44
+ _globals['_BLOCK_TABCONTAINER']._serialized_end=973
45
+ _globals['_BLOCK_TAB']._serialized_start=975
46
+ _globals['_BLOCK_TAB']._serialized_end=995
47
+ _globals['_BLOCK_POPOVER']._serialized_start=997
48
+ _globals['_BLOCK_POPOVER']._serialized_end=1082
49
+ _globals['_BLOCK_CHATMESSAGE']._serialized_start=1085
50
+ _globals['_BLOCK_CHATMESSAGE']._serialized_end=1226
51
+ _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_start=1182
52
+ _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_end=1226
51
53
  # @@protoc_insertion_point(module_scope)
@@ -69,17 +69,35 @@ class Block(google.protobuf.message.Message):
69
69
  class Column(google.protobuf.message.Message):
70
70
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
71
71
 
72
+ class _VerticalAlignment:
73
+ ValueType = typing.NewType("ValueType", builtins.int)
74
+ V: typing_extensions.TypeAlias = ValueType
75
+
76
+ class _VerticalAlignmentEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Block.Column._VerticalAlignment.ValueType], builtins.type):
77
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
78
+ TOP: Block.Column._VerticalAlignment.ValueType # 0
79
+ CENTER: Block.Column._VerticalAlignment.ValueType # 1
80
+ BOTTOM: Block.Column._VerticalAlignment.ValueType # 2
81
+
82
+ class VerticalAlignment(_VerticalAlignment, metaclass=_VerticalAlignmentEnumTypeWrapper): ...
83
+ TOP: Block.Column.VerticalAlignment.ValueType # 0
84
+ CENTER: Block.Column.VerticalAlignment.ValueType # 1
85
+ BOTTOM: Block.Column.VerticalAlignment.ValueType # 2
86
+
72
87
  WEIGHT_FIELD_NUMBER: builtins.int
73
88
  GAP_FIELD_NUMBER: builtins.int
89
+ VERTICAL_ALIGNMENT_FIELD_NUMBER: builtins.int
74
90
  weight: builtins.float
75
91
  gap: builtins.str
92
+ vertical_alignment: global___Block.Column.VerticalAlignment.ValueType
76
93
  def __init__(
77
94
  self,
78
95
  *,
79
96
  weight: builtins.float = ...,
80
97
  gap: builtins.str = ...,
98
+ vertical_alignment: global___Block.Column.VerticalAlignment.ValueType = ...,
81
99
  ) -> None: ...
82
- def ClearField(self, field_name: typing.Literal["gap", b"gap", "weight", b"weight"]) -> None: ...
100
+ def ClearField(self, field_name: typing.Literal["gap", b"gap", "vertical_alignment", b"vertical_alignment", "weight", b"weight"]) -> None: ...
83
101
 
84
102
  @typing.final
85
103
  class Expandable(google.protobuf.message.Message):
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.3aaaea00.css",
4
- "main.js": "./static/js/main.dc75074b.js",
4
+ "main.js": "./static/js/main.d4bbfd37.js",
5
5
  "static/js/9336.3e046ad7.chunk.js": "./static/js/9336.3e046ad7.chunk.js",
6
6
  "static/js/9330.2b4c99e0.chunk.js": "./static/js/9330.2b4c99e0.chunk.js",
7
7
  "static/js/2736.4336e2b9.chunk.js": "./static/js/2736.4336e2b9.chunk.js",
@@ -24,7 +24,7 @@
24
24
  "static/js/3513.7dedbda2.chunk.js": "./static/js/3513.7dedbda2.chunk.js",
25
25
  "static/js/7602.a20a999b.chunk.js": "./static/js/7602.a20a999b.chunk.js",
26
26
  "static/js/6013.f6083314.chunk.js": "./static/js/6013.f6083314.chunk.js",
27
- "static/js/8492.8ad745d1.chunk.js": "./static/js/8492.8ad745d1.chunk.js",
27
+ "static/js/4335.f27a4b4a.chunk.js": "./static/js/4335.f27a4b4a.chunk.js",
28
28
  "static/js/4177.69f9f18d.chunk.js": "./static/js/4177.69f9f18d.chunk.js",
29
29
  "static/js/1451.229b62c4.chunk.js": "./static/js/1451.229b62c4.chunk.js",
30
30
  "static/js/2634.1249dc7a.chunk.js": "./static/js/2634.1249dc7a.chunk.js",
@@ -151,6 +151,6 @@
151
151
  },
152
152
  "entrypoints": [
153
153
  "static/css/main.3aaaea00.css",
154
- "static/js/main.dc75074b.js"
154
+ "static/js/main.d4bbfd37.js"
155
155
  ]
156
156
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.dc75074b.js"></script><link href="./static/css/main.3aaaea00.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.d4bbfd37.js"></script><link href="./static/css/main.3aaaea00.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8492],{28492:(e,t,o)=>{o.r(t),o.d(t,{default:()=>N});var r=o(66845),i=o(25621),n=o(50641),a=o(80318),l=o(80745);function s(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function c(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){d(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function d(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function u(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function p(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var h=(0,l.zo)("label",(function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:"top"===o||"bottom"===o?"column":"row",display:"flex",alignItems:"top"===o||"bottom"===o?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));h.displayName="Root",h.displayName="Root";var m=(0,l.zo)("span",(function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,s=n.animation,c=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,d=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(c,'"/>\n </svg>\n ')),p=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(c,'"/>\n </svg>\n ')),h=n.borders.checkboxBorderRadius,m=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:s.timing200,transitionTimingFunction:s.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:m,borderRightColor:m,borderTopColor:m,borderBottomColor:m,borderTopLeftRadius:h,borderTopRightRadius:h,borderBottomRightRadius:h,borderBottomLeftRadius:h,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(d,"');"):t?"url('data:image/svg+xml,".concat(p,"');"):null,backgroundColor:u(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));m.displayName="Checkmark",m.displayName="Checkmark";var g=(0,l.zo)("div",(function(e){var t=e.$theme.typography;return c(c(c({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),d({},"padding".concat(t),n)}(e)),{},{color:p(e)},t.LabelMedium),{},{lineHeight:"24px"})}));g.displayName="Label",g.displayName="Label";var b=(0,l.zo)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});b.displayName="Input",b.displayName="Input";var f=(0,l.zo)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));f.displayName="Toggle",f.displayName="Toggle";var v=(0,l.zo)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));v.displayName="ToggleTrack",v.displayName="ToggleTrack";var y=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),k=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),$=o(17964);function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},F.apply(this,arguments)}function x(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function C(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=L(e);if(t){var i=L(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===w(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}(this,o)}}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function O(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var S=function(e){return e.stopPropagation()},P=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(l,e);var t,o,i,n=C(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return O(T(e=n.call.apply(n,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),O(T(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),O(T(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),O(T(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),O(T(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),O(T(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,$.E)(t)&&e.setState({isFocusVisible:!0})})),O(T(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,i=e.onChange,n=e.labelPlacement,l=void 0===n?this.props.checkmarkType===y.toggle?"left":"right":n,s=e.inputRef,c=e.isIndeterminate,d=e.error,u=e.disabled,p=e.value,k=e.name,$=e.type,w=e.checked,x=e.children,R=e.required,C=e.title,T=o.Root,L=o.Checkmark,O=o.Label,P=o.Input,M=o.Toggle,j=o.ToggleTrack,B=(0,a.XG)(T)||h,E=(0,a.XG)(L)||m,H=(0,a.XG)(O)||g,I=(0,a.XG)(P)||b,V=(0,a.XG)(M)||f,W=(0,a.XG)(j)||v,z={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},D={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},A={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:w,$isIndeterminate:c,$required:R,$disabled:u,$value:p},U=x&&r.createElement(H,F({$labelPlacement:l},A,(0,a.ch)(O)),this.props.containsInteractiveElement?r.createElement("div",{onClick:function(e){return e.preventDefault()}},x):x);return r.createElement(B,F({"data-baseweb":"checkbox",title:C||null,$labelPlacement:l},A,D,(0,a.ch)(T)),("top"===l||"left"===l)&&U,this.props.checkmarkType===y.toggle?r.createElement(W,F({},A,(0,a.ch)(j)),r.createElement(V,F({},A,(0,a.ch)(M)))):r.createElement(E,F({},A,(0,a.ch)(L))),r.createElement(I,F({value:p,name:k,checked:w,required:R,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":c?"mixed":w,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":R||null,disabled:u,type:$,ref:s,onClick:S},A,z,(0,a.ch)(P))),("bottom"===l||"right"===l)&&U)}}])&&x(t.prototype,o),i&&x(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.Component);O(P,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:r.createRef(),error:!1,type:"checkbox",checkmarkType:y.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const M=P;var j=o(16295),B=o(35704),E=o(87814),H=o(27466),I=o(8879),V=o(68411),W=o(86659),z=o(63730);const D=(0,o(1515).Z)("div",{target:"edwcd610"})((e=>{let{visibility:t}=e;return{display:t===n.Ws.Collapsed?"none":"flex",visibility:t===n.Ws.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}}),"");var A=o(40864);class U extends r.PureComponent{constructor(){super(...arguments),this.formClearHelper=new E.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:o,fragmentId:r}=this.props;t.setBoolValue(o,this.state.value,e,r)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{const t=e.target.checked;this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){const e=this.props.widgetMgr.getBoolValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{theme:t,width:o,element:r,disabled:i,widgetMgr:a}=this.props,{colors:l,spacing:s,sizes:c}=t,d=(0,H.Iy)(t),u={width:o},p=i?l.fadedText40:l.bodyText;return this.formClearHelper.manageFormClearListener(a,r.formId,this.onFormCleared),(0,A.jsx)("div",{className:"row-widget stCheckbox","data-testid":"stCheckbox",style:u,children:(0,A.jsx)(M,{checked:this.state.value,disabled:i,onChange:this.onChange,"aria-label":r.label,checkmarkType:r.type===j.XZ.StyleType.TOGGLE?y.toggle:y.default,labelPlacement:k.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,paddingRight:s.twoThirdsSmFont,backgroundColor:t?l.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:t}=e,o=d?l.bgColor:l.bodyText;return i&&(o=d?l.gray70:l.gray90),{width:"12px",height:"12px",transform:t?"translateX(16px)":"",backgroundColor:o,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:o,$isHovered:r}=e,n=l.fadedText40;return r&&!i&&(n=l.fadedText20),o&&!i&&(n=l.primary),{marginRight:0,marginLeft:0,paddingLeft:"2px",paddingRight:"2px",width:"32px",minWidth:"32px",height:"16px",minHeight:"16px",borderBottomLeftRadius:t.radii.lg,borderTopLeftRadius:t.radii.lg,borderBottomRightRadius:t.radii.lg,borderTopRightRadius:t.radii.lg,backgroundColor:n}}},Checkmark:{style:e=>{let{$isFocusVisible:t,$checked:o}=e;const r=o&&!i?l.primary:l.fadedText40;return{outline:0,width:"1rem",height:"1rem",marginTop:"0.30rem",marginLeft:0,boxShadow:t&&o?"0 0 0 0.2rem ".concat((0,B.DZ)(l.primary,.5)):"",borderLeftWidth:c.borderWidth,borderRightWidth:c.borderWidth,borderTopWidth:c.borderWidth,borderBottomWidth:c.borderWidth,borderLeftColor:r,borderRightColor:r,borderTopColor:r,borderBottomColor:r}}},Label:{style:{position:"relative",top:"1px",color:p}}},children:(0,A.jsxs)(D,{visibility:(0,n.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),"data-testid":"stWidgetLabel",children:[(0,A.jsx)(z.ZP,{source:r.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),r.help&&(0,A.jsx)(W.Hp,{color:p,children:(0,A.jsx)(I.Z,{content:r.help,placement:V.u.TOP_RIGHT})})]})})})}}const N=(0,i.b)(U)},87814:(e,t,o)=>{o.d(t,{K:()=>i});var r=o(50641);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,r.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4335],{94335:(e,t,o)=>{o.r(t),o.d(t,{default:()=>N});var r=o(66845),i=o(25621),n=o(50641),a=o(80318),l=o(80745);function s(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function c(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){d(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function d(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function u(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function p(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var h=(0,l.zo)("label",(function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:"top"===o||"bottom"===o?"column":"row",display:"flex",alignItems:"top"===o||"bottom"===o?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));h.displayName="Root",h.displayName="Root";var m=(0,l.zo)("span",(function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,s=n.animation,c=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,d=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(c,'"/>\n </svg>\n ')),p=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(c,'"/>\n </svg>\n ')),h=n.borders.checkboxBorderRadius,m=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:s.timing200,transitionTimingFunction:s.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:m,borderRightColor:m,borderTopColor:m,borderBottomColor:m,borderTopLeftRadius:h,borderTopRightRadius:h,borderBottomRightRadius:h,borderBottomLeftRadius:h,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(d,"');"):t?"url('data:image/svg+xml,".concat(p,"');"):null,backgroundColor:u(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));m.displayName="Checkmark",m.displayName="Checkmark";var g=(0,l.zo)("div",(function(e){var t=e.$theme.typography;return c(c(c({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),d({},"padding".concat(t),n)}(e)),{},{color:p(e)},t.LabelMedium),{},{lineHeight:"24px"})}));g.displayName="Label",g.displayName="Label";var b=(0,l.zo)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});b.displayName="Input",b.displayName="Input";var f=(0,l.zo)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));f.displayName="Toggle",f.displayName="Toggle";var v=(0,l.zo)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));v.displayName="ToggleTrack",v.displayName="ToggleTrack";var y=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),k=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),$=o(17964);function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},F.apply(this,arguments)}function x(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function T(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=L(e);if(t){var i=L(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===w(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return C(e)}(this,o)}}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function O(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var P=function(e){return e.stopPropagation()},S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(l,e);var t,o,i,n=T(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return O(C(e=n.call.apply(n,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),O(C(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),O(C(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),O(C(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),O(C(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),O(C(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,$.E)(t)&&e.setState({isFocusVisible:!0})})),O(C(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,i=e.onChange,n=e.labelPlacement,l=void 0===n?this.props.checkmarkType===y.toggle?"left":"right":n,s=e.inputRef,c=e.isIndeterminate,d=e.error,u=e.disabled,p=e.value,k=e.name,$=e.type,w=e.checked,x=e.children,R=e.required,T=e.title,C=o.Root,L=o.Checkmark,O=o.Label,S=o.Input,M=o.Toggle,j=o.ToggleTrack,B=(0,a.XG)(C)||h,E=(0,a.XG)(L)||m,H=(0,a.XG)(O)||g,V=(0,a.XG)(S)||b,z=(0,a.XG)(M)||f,I=(0,a.XG)(j)||v,W={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},D={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},U={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:w,$isIndeterminate:c,$required:R,$disabled:u,$value:p},A=x&&r.createElement(H,F({$labelPlacement:l},U,(0,a.ch)(O)),this.props.containsInteractiveElement?r.createElement("div",{onClick:function(e){return e.preventDefault()}},x):x);return r.createElement(B,F({"data-baseweb":"checkbox",title:T||null,$labelPlacement:l},U,D,(0,a.ch)(C)),("top"===l||"left"===l)&&A,this.props.checkmarkType===y.toggle?r.createElement(I,F({},U,(0,a.ch)(j)),r.createElement(z,F({},U,(0,a.ch)(M)))):r.createElement(E,F({},U,(0,a.ch)(L))),r.createElement(V,F({value:p,name:k,checked:w,required:R,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":c?"mixed":w,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":R||null,disabled:u,type:$,ref:s,onClick:P},U,W,(0,a.ch)(S))),("bottom"===l||"right"===l)&&A)}}])&&x(t.prototype,o),i&&x(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.Component);O(S,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:r.createRef(),error:!1,type:"checkbox",checkmarkType:y.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const M=S;var j=o(16295),B=o(35704),E=o(87814),H=o(27466),V=o(8879),z=o(68411),I=o(86659),W=o(63730),D=o(86977),U=o(40864);class A extends r.PureComponent{constructor(){super(...arguments),this.formClearHelper=new E.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:o,fragmentId:r}=this.props;t.setBoolValue(o,this.state.value,e,r)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{const t=e.target.checked;this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){const e=this.props.widgetMgr.getBoolValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{theme:t,width:o,element:r,disabled:i,widgetMgr:a}=this.props,{colors:l,spacing:s,sizes:c}=t,d=(0,H.Iy)(t),u=i?l.fadedText40:l.bodyText;return this.formClearHelper.manageFormClearListener(a,r.formId,this.onFormCleared),(0,U.jsx)(D.P,{className:"row-widget stCheckbox","data-testid":"stCheckbox",width:o,children:(0,U.jsx)(M,{checked:this.state.value,disabled:i,onChange:this.onChange,"aria-label":r.label,checkmarkType:r.type===j.XZ.StyleType.TOGGLE?y.toggle:y.default,labelPlacement:k.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,paddingRight:s.twoThirdsSmFont,backgroundColor:t?l.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:t}=e,o=d?l.bgColor:l.bodyText;return i&&(o=d?l.gray70:l.gray90),{width:"12px",height:"12px",transform:t?"translateX(16px)":"",backgroundColor:o,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:o,$isHovered:r}=e,n=l.fadedText40;return r&&!i&&(n=l.fadedText20),o&&!i&&(n=l.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:"0.25rem",paddingLeft:"2px",paddingRight:"2px",width:"32px",minWidth:"32px",height:"16px",minHeight:"16px",borderBottomLeftRadius:t.radii.lg,borderTopLeftRadius:t.radii.lg,borderBottomRightRadius:t.radii.lg,borderTopRightRadius:t.radii.lg,backgroundColor:n}}},Checkmark:{style:e=>{let{$isFocusVisible:t,$checked:o}=e;const r=o&&!i?l.primary:l.fadedText40;return{outline:0,width:"1rem",height:"1rem",marginTop:"0.25rem",marginLeft:0,marginBottom:0,boxShadow:t&&o?"0 0 0 0.2rem ".concat((0,B.DZ)(l.primary,.5)):"",borderLeftWidth:c.borderWidth,borderRightWidth:c.borderWidth,borderTopWidth:c.borderWidth,borderBottomWidth:c.borderWidth,borderLeftColor:r,borderRightColor:r,borderTopColor:r,borderBottomColor:r}}},Label:{style:{position:"relative",color:u}}},children:(0,U.jsxs)(D.H,{visibility:(0,n.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),"data-testid":"stWidgetLabel",children:[(0,U.jsx)(W.ZP,{source:r.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),r.help&&(0,U.jsx)(I.Hp,{color:u,children:(0,U.jsx)(V.Z,{content:r.help,placement:z.u.TOP_RIGHT})})]})})})}}const N=(0,i.b)(A)},87814:(e,t,o)=>{o.d(t,{K:()=>i});var r=o(50641);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,r.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);