streamlit-nightly 1.39.1.dev20241020__py2.py3-none-any.whl → 1.39.1.dev20241022__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/__init__.py +1 -0
- streamlit/elements/arrow.py +1 -1
- streamlit/elements/widgets/button_group.py +257 -62
- streamlit/proto/ButtonGroup_pb2.py +3 -3
- streamlit/proto/ButtonGroup_pb2.pyi +2 -2
- streamlit/static/asset-manifest.json +19 -17
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/1086.93ecee4c.chunk.js +5 -0
- streamlit/static/static/js/223.2359dae5.chunk.js +1 -0
- streamlit/static/static/js/{245.1eea9c21.chunk.js → 245.f99a075b.chunk.js} +1 -1
- streamlit/static/static/js/3224.86a6ba35.chunk.js +1 -0
- streamlit/static/static/js/3861.867f8617.chunk.js +1 -0
- streamlit/static/static/js/4827.bf6d34b0.chunk.js +1 -0
- streamlit/static/static/js/5625.a2d9a416.chunk.js +1 -0
- streamlit/static/static/js/{6088.125b23a1.chunk.js → 6088.cf24e25c.chunk.js} +1 -1
- streamlit/static/static/js/7809.4b5ac1e5.chunk.js +1 -0
- streamlit/static/static/js/8237.9d947ccb.chunk.js +1 -0
- streamlit/static/static/js/8460.38082ffb.chunk.js +1 -0
- streamlit/static/static/js/9114.37a044b5.chunk.js +1 -0
- streamlit/static/static/js/9528.a58c0ad2.chunk.js +1 -0
- streamlit/static/static/js/9943.54dc52f7.chunk.js +1 -0
- streamlit/static/static/js/main.b154eb39.js +28 -0
- streamlit/static/static/media/rocket.add69fb2c850b62fa60077e3a5a06d28.svg +5 -0
- streamlit/static/static/media/snowflake.187cb4ca5fd443488e5b4bfc9c4d2b52.svg +11 -0
- streamlit/static/static/media/streamlit-mark-color.e5952193e5f735a3afb01a78a4dd4b41.svg +5 -0
- {streamlit_nightly-1.39.1.dev20241020.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.39.1.dev20241020.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/RECORD +32 -30
- streamlit/static/static/js/1086.fba3f8f8.chunk.js +0 -5
- streamlit/static/static/js/223.8bd97055.chunk.js +0 -1
- streamlit/static/static/js/3224.fb4ce2a4.chunk.js +0 -1
- streamlit/static/static/js/3861.5aea56b8.chunk.js +0 -1
- streamlit/static/static/js/4827.70332470.chunk.js +0 -1
- streamlit/static/static/js/5625.c56e64cd.chunk.js +0 -1
- streamlit/static/static/js/7809.304e2c99.chunk.js +0 -1
- streamlit/static/static/js/8237.72e42692.chunk.js +0 -1
- streamlit/static/static/js/8460.05092ce1.chunk.js +0 -1
- streamlit/static/static/js/9114.11dd8c48.chunk.js +0 -1
- streamlit/static/static/js/9528.746f7a0e.chunk.js +0 -1
- streamlit/static/static/js/9943.0d8cd50b.chunk.js +0 -1
- streamlit/static/static/js/main.f85d22ce.js +0 -28
- streamlit/static/static/media/rocket.b75b17d2b0a063c6cea230d1a9d77f1e.svg +0 -9
- /streamlit/static/static/js/{main.f85d22ce.js.LICENSE.txt → main.b154eb39.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.39.1.dev20241020.data → streamlit_nightly-1.39.1.dev20241022.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.39.1.dev20241020.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.39.1.dev20241020.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.39.1.dev20241020.dist-info → streamlit_nightly-1.39.1.dev20241022.dist-info}/top_level.txt +0 -0
streamlit/__init__.py
CHANGED
@@ -214,6 +214,7 @@ radio = _main.radio
|
|
214
214
|
scatter_chart = _main.scatter_chart
|
215
215
|
selectbox = _main.selectbox
|
216
216
|
select_slider = _main.select_slider
|
217
|
+
segmented_control = _main.segmented_control
|
217
218
|
slider = _main.slider
|
218
219
|
snow = _main.snow
|
219
220
|
subheader = _main.subheader
|
streamlit/elements/arrow.py
CHANGED
@@ -402,7 +402,7 @@ class ArrowMixin:
|
|
402
402
|
In this case, ``st.dataframe`` will return the selection data
|
403
403
|
as a dictionary.
|
404
404
|
|
405
|
-
selection_mode : "single-row", "multi-row", single-column", \
|
405
|
+
selection_mode : "single-row", "multi-row", "single-column", \
|
406
406
|
"multi-column", or Iterable of these
|
407
407
|
The types of selections Streamlit should allow. This can be one of
|
408
408
|
the following:
|
@@ -86,7 +86,7 @@ _STAR_ICON: Final = ":material/star:"
|
|
86
86
|
# in base64 format and send it over the wire as an image.
|
87
87
|
_SELECTED_STAR_ICON: Final = ":material/star_filled:"
|
88
88
|
|
89
|
-
SelectionMode: TypeAlias = Literal["single", "
|
89
|
+
SelectionMode: TypeAlias = Literal["single", "multi"]
|
90
90
|
|
91
91
|
|
92
92
|
class SingleSelectSerde(Generic[T]):
|
@@ -137,7 +137,7 @@ class SingleOrMultiSelectSerde(Generic[T]):
|
|
137
137
|
self,
|
138
138
|
options: Sequence[T],
|
139
139
|
default_values: list[int],
|
140
|
-
type: Literal["single", "
|
140
|
+
type: Literal["single", "multi"],
|
141
141
|
):
|
142
142
|
self.options = options
|
143
143
|
self.default_values = default_values
|
@@ -196,7 +196,7 @@ def _build_proto(
|
|
196
196
|
selection_visualization: ButtonGroupProto.SelectionVisualization.ValueType = (
|
197
197
|
ButtonGroupProto.SelectionVisualization.ONLY_SELECTED
|
198
198
|
),
|
199
|
-
style: Literal["
|
199
|
+
style: Literal["borderless", "pills", "segmented_control"] = "pills",
|
200
200
|
label: str | None = None,
|
201
201
|
label_visibility: LabelVisibility = "visible",
|
202
202
|
help: str | None = None,
|
@@ -227,9 +227,9 @@ def _build_proto(
|
|
227
227
|
|
228
228
|
def _maybe_raise_selection_mode_warning(selection_mode: SelectionMode):
|
229
229
|
"""Check if the selection_mode value is valid or raise exception otherwise."""
|
230
|
-
if selection_mode not in ["single", "
|
230
|
+
if selection_mode not in ["single", "multi"]:
|
231
231
|
raise StreamlitAPIException(
|
232
|
-
"The selection_mode argument must be one of ['single', '
|
232
|
+
"The selection_mode argument must be one of ['single', 'multi']. "
|
233
233
|
f"The argument passed was '{selection_mode}'."
|
234
234
|
)
|
235
235
|
|
@@ -387,13 +387,47 @@ class ButtonGroupMixin:
|
|
387
387
|
)
|
388
388
|
return sentiment.value
|
389
389
|
|
390
|
+
@overload
|
391
|
+
def pills(
|
392
|
+
self,
|
393
|
+
label: str,
|
394
|
+
options: OptionSequence[V],
|
395
|
+
*,
|
396
|
+
selection_mode: Literal["single"],
|
397
|
+
default: V | None = None,
|
398
|
+
format_func: Callable[[Any], str] | None = None,
|
399
|
+
key: Key | None = None,
|
400
|
+
help: str | None = None,
|
401
|
+
on_change: WidgetCallback | None = None,
|
402
|
+
args: WidgetArgs | None = None,
|
403
|
+
kwargs: WidgetKwargs | None = None,
|
404
|
+
disabled: bool = False,
|
405
|
+
label_visibility: LabelVisibility = "visible",
|
406
|
+
) -> V | None: ...
|
407
|
+
@overload
|
408
|
+
def pills(
|
409
|
+
self,
|
410
|
+
label: str,
|
411
|
+
options: OptionSequence[V],
|
412
|
+
*,
|
413
|
+
selection_mode: Literal["multi"] = "multi",
|
414
|
+
default: Sequence[V] | V | None = None,
|
415
|
+
format_func: Callable[[Any], str] | None = None,
|
416
|
+
key: Key | None = None,
|
417
|
+
help: str | None = None,
|
418
|
+
on_change: WidgetCallback | None = None,
|
419
|
+
args: WidgetArgs | None = None,
|
420
|
+
kwargs: WidgetKwargs | None = None,
|
421
|
+
disabled: bool = False,
|
422
|
+
label_visibility: LabelVisibility = "visible",
|
423
|
+
) -> list[V]: ...
|
390
424
|
@gather_metrics("pills")
|
391
425
|
def pills(
|
392
426
|
self,
|
393
427
|
label: str,
|
394
428
|
options: OptionSequence[V],
|
395
429
|
*,
|
396
|
-
selection_mode: Literal["single", "
|
430
|
+
selection_mode: Literal["single", "multi"] = "single",
|
397
431
|
default: Sequence[V] | V | None = None,
|
398
432
|
format_func: Callable[[Any], str] | None = None,
|
399
433
|
key: Key | None = None,
|
@@ -432,9 +466,9 @@ class ButtonGroupMixin:
|
|
432
466
|
.. |st.markdown| replace:: ``st.markdown``
|
433
467
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
434
468
|
|
435
|
-
selection_mode: "single" or "
|
469
|
+
selection_mode: "single" or "multi"
|
436
470
|
The selection mode for the widget. If "single", only one option can be
|
437
|
-
selected. If "
|
471
|
+
selected. If "multi", multiple options can be selected.
|
438
472
|
|
439
473
|
options: Iterable of V
|
440
474
|
Labels for the select options in an ``Iterable``. This can be a
|
@@ -486,7 +520,7 @@ class ButtonGroupMixin:
|
|
486
520
|
-------
|
487
521
|
list of V or V or None
|
488
522
|
A list of selected options or an empty list if the ``selection_mode`` is
|
489
|
-
"
|
523
|
+
"multi".
|
490
524
|
If the "selection_mode" is "single", the return value is the selected option
|
491
525
|
or None.
|
492
526
|
|
@@ -498,7 +532,7 @@ class ButtonGroupMixin:
|
|
498
532
|
>>>
|
499
533
|
>>> options = ["one", "two", "three", "four", "five"]
|
500
534
|
>>> selection = st.pills(label="Numbered pills",
|
501
|
-
options, selection_mode="
|
535
|
+
options, selection_mode="multi")
|
502
536
|
>>> st.markdown(f"You selected option: '{selection}'.")
|
503
537
|
|
504
538
|
.. output ::
|
@@ -527,62 +561,213 @@ class ButtonGroupMixin:
|
|
527
561
|
TBD
|
528
562
|
|
529
563
|
"""
|
564
|
+
return self._internal_button_group(
|
565
|
+
options,
|
566
|
+
label=label,
|
567
|
+
selection_mode=selection_mode,
|
568
|
+
default=default,
|
569
|
+
format_func=format_func,
|
570
|
+
key=key,
|
571
|
+
help=help,
|
572
|
+
style="pills",
|
573
|
+
on_change=on_change,
|
574
|
+
args=args,
|
575
|
+
kwargs=kwargs,
|
576
|
+
disabled=disabled,
|
577
|
+
label_visibility=label_visibility,
|
578
|
+
)
|
530
579
|
|
531
|
-
|
580
|
+
@overload
|
581
|
+
def segmented_control(
|
582
|
+
self,
|
583
|
+
label: str,
|
584
|
+
options: OptionSequence[V],
|
585
|
+
*,
|
586
|
+
selection_mode: Literal["single"],
|
587
|
+
default: V | None = None,
|
588
|
+
format_func: Callable[[Any], str] | None = None,
|
589
|
+
key: str | int | None = None,
|
590
|
+
help: str | None = None,
|
591
|
+
on_change: WidgetCallback | None = None,
|
592
|
+
args: WidgetArgs | None = None,
|
593
|
+
kwargs: WidgetKwargs | None = None,
|
594
|
+
disabled: bool = False,
|
595
|
+
label_visibility: LabelVisibility = "visible",
|
596
|
+
) -> V | None: ...
|
597
|
+
@overload
|
598
|
+
def segmented_control(
|
599
|
+
self,
|
600
|
+
label: str,
|
601
|
+
options: OptionSequence[V],
|
602
|
+
*,
|
603
|
+
selection_mode: Literal["multi"] = "multi",
|
604
|
+
default: Sequence[V] | V | None = None,
|
605
|
+
format_func: Callable[[Any], str] | None = None,
|
606
|
+
key: str | int | None = None,
|
607
|
+
help: str | None = None,
|
608
|
+
on_change: WidgetCallback | None = None,
|
609
|
+
args: WidgetArgs | None = None,
|
610
|
+
kwargs: WidgetKwargs | None = None,
|
611
|
+
disabled: bool = False,
|
612
|
+
label_visibility: LabelVisibility = "visible",
|
613
|
+
) -> list[V]: ...
|
532
614
|
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
pass
|
552
|
-
return ButtonGroupProto.Option(
|
553
|
-
content=transformed,
|
554
|
-
content_icon=icon,
|
555
|
-
)
|
615
|
+
@gather_metrics("segmented_control")
|
616
|
+
def segmented_control(
|
617
|
+
self,
|
618
|
+
label: str,
|
619
|
+
options: OptionSequence[V],
|
620
|
+
*,
|
621
|
+
selection_mode: Literal["single", "multi"] = "single",
|
622
|
+
default: Sequence[V] | V | None = None,
|
623
|
+
format_func: Callable[[Any], str] | None = None,
|
624
|
+
key: str | int | None = None,
|
625
|
+
help: str | None = None,
|
626
|
+
on_change: WidgetCallback | None = None,
|
627
|
+
args: WidgetArgs | None = None,
|
628
|
+
kwargs: WidgetKwargs | None = None,
|
629
|
+
disabled: bool = False,
|
630
|
+
label_visibility: LabelVisibility = "visible",
|
631
|
+
) -> list[V] | V | None:
|
632
|
+
r"""Display a segmented control widget.
|
556
633
|
|
557
|
-
|
558
|
-
|
634
|
+
A segmented control widget is a linear set of segments where each of the passed
|
635
|
+
``options`` functions as a button.
|
559
636
|
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
637
|
+
Parameters
|
638
|
+
----------
|
639
|
+
label : str
|
640
|
+
A short label explaining to the user what this widget is for.
|
641
|
+
The label can optionally contain GitHub-flavored Markdown of the
|
642
|
+
following types: Bold, Italics, Strikethroughs, Inline Code, and
|
643
|
+
Links.
|
644
|
+
|
645
|
+
Unsupported Markdown elements are unwrapped so only their children
|
646
|
+
(text contents) render. Display unsupported elements as literal
|
647
|
+
characters by backslash-escaping them. E.g.,
|
648
|
+
``"1\. Not an ordered list"``.
|
649
|
+
|
650
|
+
See the ``body`` parameter of |st.markdown|_ for additional,
|
651
|
+
supported Markdown directives.
|
652
|
+
|
653
|
+
For accessibility reasons, you should never set an empty label (label="")
|
654
|
+
but hide it with label_visibility if needed. In the future, we may disallow
|
655
|
+
empty labels by raising an exception.
|
656
|
+
|
657
|
+
.. |st.markdown| replace:: ``st.markdown``
|
658
|
+
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
659
|
+
|
660
|
+
selection_mode: "single" or "multi"
|
661
|
+
The selection mode for the widget. If "single", only one option can be
|
662
|
+
selected. If "multi", multiple options can be selected.
|
663
|
+
|
664
|
+
options: Iterable of V
|
665
|
+
Labels for the select options in an ``Iterable``. This can be a
|
666
|
+
``list``, ``set``, or anything supported by ``st.dataframe``. If
|
667
|
+
``options`` is dataframe-like, the first column will be used. Each
|
668
|
+
label will be cast to ``str`` internally by default.
|
669
|
+
|
670
|
+
default: Iterable of V, V, or None
|
671
|
+
List of default value or a single value. If the ``selection_mode``
|
672
|
+
is "single", only a single value is allowed to be passed.
|
673
|
+
|
674
|
+
format_func : function
|
675
|
+
Function to modify the display of the options. It receives
|
676
|
+
the raw option as an argument and should output the label to be
|
677
|
+
shown for that option. This has no impact on the return value of
|
678
|
+
the command.
|
679
|
+
|
680
|
+
key : str or int
|
681
|
+
An optional string or integer to use as the unique key for the widget.
|
682
|
+
If this is omitted, a key will be generated for the widget
|
683
|
+
based on its content. Multiple widgets of the same type may
|
684
|
+
not share the same key.
|
685
|
+
|
686
|
+
help : str
|
687
|
+
An optional tooltip that gets displayed next to the multiselect.
|
688
|
+
|
689
|
+
on_change : callable
|
690
|
+
An optional callback invoked when this feedback widget's value
|
691
|
+
changes.
|
692
|
+
|
693
|
+
args : tuple
|
694
|
+
An optional tuple of args to pass to the callback.
|
695
|
+
|
696
|
+
kwargs : dict
|
697
|
+
An optional dict of kwargs to pass to the callback.
|
698
|
+
|
699
|
+
disabled : bool
|
700
|
+
An optional boolean, which disables the widget if set
|
701
|
+
to True. The default is False. This argument can only be supplied
|
702
|
+
by keyword.
|
703
|
+
|
704
|
+
label_visibility : "visible", "hidden", or "collapsed"
|
705
|
+
The visibility of the label. If "hidden", the label doesn't show but there
|
706
|
+
is still empty space for it above the widget (equivalent to label="").
|
707
|
+
If "collapsed", both the label and the space are removed. Default is
|
708
|
+
"visible".
|
709
|
+
|
710
|
+
Returns
|
711
|
+
-------
|
712
|
+
list of V or V or None
|
713
|
+
A list of selected options or an empty list if the ``selection_mode`` is
|
714
|
+
"multi".
|
715
|
+
If the "selection_mode" is "single", the return value is the selected option
|
716
|
+
or None.
|
717
|
+
|
718
|
+
Examples
|
719
|
+
--------
|
720
|
+
Display a segmented control widget with multi select, and show the option:
|
721
|
+
|
722
|
+
>>> import streamlit as st
|
723
|
+
>>>
|
724
|
+
>>> options = ["North", "East", "South", "West"]
|
725
|
+
>>> selection = st.segmented_control(label="Directions",
|
726
|
+
options, selection_mode="multi")
|
727
|
+
>>> st.markdown(f"You selected options: '{selection}'.")
|
728
|
+
|
729
|
+
.. output ::
|
730
|
+
TBD
|
731
|
+
|
732
|
+
|
733
|
+
Display a segmented control widget that renders icons-only:
|
734
|
+
|
735
|
+
>>> import streamlit as st
|
736
|
+
>>>
|
737
|
+
>>> option_to_icon_map = {
|
738
|
+
>>> 0: ":material/add:",
|
739
|
+
>>> 1: ":material/zoom_in:",
|
740
|
+
>>> 2: ":material/zoom_out:",
|
741
|
+
>>> 3: ":material/zoom_out_map:",
|
742
|
+
>>> }
|
743
|
+
>>> selection = st.segmented_control(
|
744
|
+
>>> "Icon-only segmented control",
|
745
|
+
>>> options=option_to_icon_map.keys(),
|
746
|
+
>>> format_func=lambda option: option_to_icon_map[option],
|
747
|
+
>>> selection_mode="single",
|
748
|
+
>>> )
|
749
|
+
>>> st.write(f"Single selection: {selection}")
|
750
|
+
|
751
|
+
.. output ::
|
752
|
+
TBD
|
753
|
+
|
754
|
+
"""
|
755
|
+
return self._internal_button_group(
|
756
|
+
options,
|
757
|
+
label=label,
|
567
758
|
selection_mode=selection_mode,
|
568
|
-
|
569
|
-
format_func=
|
570
|
-
|
571
|
-
|
759
|
+
default=default,
|
760
|
+
format_func=format_func,
|
761
|
+
key=key,
|
762
|
+
help=help,
|
763
|
+
style="segmented_control",
|
572
764
|
on_change=on_change,
|
573
765
|
args=args,
|
574
766
|
kwargs=kwargs,
|
575
|
-
|
576
|
-
label=label,
|
767
|
+
disabled=disabled,
|
577
768
|
label_visibility=label_visibility,
|
578
|
-
help=help,
|
579
769
|
)
|
580
770
|
|
581
|
-
if selection_mode == "multiple":
|
582
|
-
return res.value
|
583
|
-
|
584
|
-
return res.value
|
585
|
-
|
586
771
|
@gather_metrics("_internal_button_group")
|
587
772
|
def _internal_button_group(
|
588
773
|
self,
|
@@ -590,14 +775,19 @@ class ButtonGroupMixin:
|
|
590
775
|
*,
|
591
776
|
key: Key | None = None,
|
592
777
|
default: Sequence[V] | V | None = None,
|
593
|
-
selection_mode: Literal["single", "
|
778
|
+
selection_mode: Literal["single", "multi"] = "single",
|
594
779
|
disabled: bool = False,
|
595
780
|
format_func: Callable[[Any], str] | None = None,
|
596
|
-
style: Literal["
|
781
|
+
style: Literal["pills", "segmented_control"] = "segmented_control",
|
597
782
|
on_change: WidgetCallback | None = None,
|
598
783
|
args: WidgetArgs | None = None,
|
599
784
|
kwargs: WidgetKwargs | None = None,
|
785
|
+
label: str | None = None,
|
786
|
+
label_visibility: LabelVisibility = "visible",
|
787
|
+
help: str | None = None,
|
600
788
|
) -> list[V] | V | None:
|
789
|
+
maybe_raise_label_warnings(label, label_visibility)
|
790
|
+
|
601
791
|
def _transformed_format_func(option: V) -> ButtonGroupProto.Option:
|
602
792
|
"""If option starts with a material icon or an emoji, we extract it to send
|
603
793
|
it parsed to the frontend."""
|
@@ -631,20 +821,23 @@ class ButtonGroupMixin:
|
|
631
821
|
|
632
822
|
res = self._button_group(
|
633
823
|
indexable_options,
|
634
|
-
key=key,
|
635
824
|
default=default_values,
|
636
825
|
selection_mode=selection_mode,
|
637
826
|
disabled=disabled,
|
638
827
|
format_func=_transformed_format_func,
|
828
|
+
key=key,
|
829
|
+
help=help,
|
639
830
|
style=style,
|
640
831
|
serializer=serde.serialize,
|
641
832
|
deserializer=serde.deserialize,
|
642
833
|
on_change=on_change,
|
643
834
|
args=args,
|
644
835
|
kwargs=kwargs,
|
836
|
+
label=label,
|
837
|
+
label_visibility=label_visibility,
|
645
838
|
)
|
646
839
|
|
647
|
-
if selection_mode == "
|
840
|
+
if selection_mode == "multi":
|
648
841
|
return res.value
|
649
842
|
|
650
843
|
return res.value
|
@@ -657,7 +850,9 @@ class ButtonGroupMixin:
|
|
657
850
|
default: list[int] | None = None,
|
658
851
|
selection_mode: SelectionMode = "single",
|
659
852
|
disabled: bool = False,
|
660
|
-
style: Literal[
|
853
|
+
style: Literal[
|
854
|
+
"borderless", "pills", "segmented_control"
|
855
|
+
] = "segmented_control",
|
661
856
|
format_func: Callable[[V], ButtonGroupProto.Option] | None = None,
|
662
857
|
deserializer: WidgetDeserializer[T],
|
663
858
|
serializer: WidgetSerializer[T],
|
@@ -693,9 +888,9 @@ class ButtonGroupMixin:
|
|
693
888
|
"`selection_mode='single'`."
|
694
889
|
)
|
695
890
|
|
696
|
-
if style not in ["
|
891
|
+
if style not in ["borderless", "pills", "segmented_control"]:
|
697
892
|
raise StreamlitAPIException(
|
698
|
-
"The style argument must be one of ['
|
893
|
+
"The style argument must be one of ['borderless', 'pills', 'segmented_control']. "
|
699
894
|
f"The argument passed was '{style}'."
|
700
895
|
)
|
701
896
|
|
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
|
|
15
15
|
from streamlit.proto import LabelVisibilityMessage_pb2 as streamlit_dot_proto_dot_LabelVisibilityMessage__pb2
|
16
16
|
|
17
17
|
|
18
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!streamlit/proto/ButtonGroup.proto\x1a,streamlit/proto/LabelVisibilityMessage.proto\"\
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!streamlit/proto/ButtonGroup.proto\x1a,streamlit/proto/LabelVisibilityMessage.proto\"\xf4\x05\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\x12!\n\x05style\x18\n \x01(\x0e\x32\x12.ButtonGroup.Style\x12\r\n\x05label\x18\x0b \x01(\t\x12\x31\n\x10label_visibility\x18\x0c \x01(\x0b\x32\x17.LabelVisibilityMessage\x12\x11\n\x04help\x18\r \x01(\tH\x00\x88\x01\x01\x1a\xb7\x01\n\x06Option\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x1d\n\x10selected_content\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x63ontent_icon\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\"\n\x15selected_content_icon\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\x13\n\x11_selected_contentB\x0f\n\r_content_iconB\x18\n\x16_selected_content_icon\"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\"9\n\x05Style\x12\x15\n\x11SEGMENTED_CONTROL\x10\x00\x12\t\n\x05PILLS\x10\x01\x12\x0e\n\nBORDERLESS\x10\x02\x42\x07\n\x05_helpB0\n\x1c\x63om.snowflake.apps.streamlitB\x10\x42uttonGroupProtob\x06proto3')
|
19
19
|
|
20
20
|
_globals = globals()
|
21
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -24,7 +24,7 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
24
24
|
_globals['DESCRIPTOR']._loaded_options = None
|
25
25
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\020ButtonGroupProto'
|
26
26
|
_globals['_BUTTONGROUP']._serialized_start=84
|
27
|
-
_globals['_BUTTONGROUP']._serialized_end=
|
27
|
+
_globals['_BUTTONGROUP']._serialized_end=840
|
28
28
|
_globals['_BUTTONGROUP_OPTION']._serialized_start=470
|
29
29
|
_globals['_BUTTONGROUP_OPTION']._serialized_end=653
|
30
30
|
_globals['_BUTTONGROUP_CLICKMODE']._serialized_start=655
|
@@ -32,5 +32,5 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
32
32
|
_globals['_BUTTONGROUP_SELECTIONVISUALIZATION']._serialized_start=705
|
33
33
|
_globals['_BUTTONGROUP_SELECTIONVISUALIZATION']._serialized_end=772
|
34
34
|
_globals['_BUTTONGROUP_STYLE']._serialized_start=774
|
35
|
-
_globals['_BUTTONGROUP_STYLE']._serialized_end=
|
35
|
+
_globals['_BUTTONGROUP_STYLE']._serialized_end=831
|
36
36
|
# @@protoc_insertion_point(module_scope)
|
@@ -70,12 +70,12 @@ class ButtonGroup(google.protobuf.message.Message):
|
|
70
70
|
|
71
71
|
class _StyleEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ButtonGroup._Style.ValueType], builtins.type):
|
72
72
|
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
73
|
-
|
73
|
+
SEGMENTED_CONTROL: ButtonGroup._Style.ValueType # 0
|
74
74
|
PILLS: ButtonGroup._Style.ValueType # 1
|
75
75
|
BORDERLESS: ButtonGroup._Style.ValueType # 2
|
76
76
|
|
77
77
|
class Style(_Style, metaclass=_StyleEnumTypeWrapper): ...
|
78
|
-
|
78
|
+
SEGMENTED_CONTROL: ButtonGroup.Style.ValueType # 0
|
79
79
|
PILLS: ButtonGroup.Style.ValueType # 1
|
80
80
|
BORDERLESS: ButtonGroup.Style.ValueType # 2
|
81
81
|
|
@@ -1,40 +1,40 @@
|
|
1
1
|
{
|
2
2
|
"files": {
|
3
3
|
"main.css": "./static/css/main.5513bd04.css",
|
4
|
-
"main.js": "./static/js/main.
|
4
|
+
"main.js": "./static/js/main.b154eb39.js",
|
5
5
|
"static/js/6679.265ca09c.chunk.js": "./static/js/6679.265ca09c.chunk.js",
|
6
6
|
"static/js/9464.7e9a3c0a.chunk.js": "./static/js/9464.7e9a3c0a.chunk.js",
|
7
7
|
"static/js/9077.721329d6.chunk.js": "./static/js/9077.721329d6.chunk.js",
|
8
8
|
"static/js/3391.7aba08a0.chunk.js": "./static/js/3391.7aba08a0.chunk.js",
|
9
9
|
"static/css/9943.d452238e.chunk.css": "./static/css/9943.d452238e.chunk.css",
|
10
|
-
"static/js/9943.
|
11
|
-
"static/js/8460.
|
12
|
-
"static/js/3861.
|
10
|
+
"static/js/9943.54dc52f7.chunk.js": "./static/js/9943.54dc52f7.chunk.js",
|
11
|
+
"static/js/8460.38082ffb.chunk.js": "./static/js/8460.38082ffb.chunk.js",
|
12
|
+
"static/js/3861.867f8617.chunk.js": "./static/js/3861.867f8617.chunk.js",
|
13
13
|
"static/js/8642.58110d15.chunk.js": "./static/js/8642.58110d15.chunk.js",
|
14
|
-
"static/js/223.
|
14
|
+
"static/js/223.2359dae5.chunk.js": "./static/js/223.2359dae5.chunk.js",
|
15
15
|
"static/js/8148.5521cded.chunk.js": "./static/js/8148.5521cded.chunk.js",
|
16
16
|
"static/js/84.414fa87b.chunk.js": "./static/js/84.414fa87b.chunk.js",
|
17
17
|
"static/js/9923.2bb9616f.chunk.js": "./static/js/9923.2bb9616f.chunk.js",
|
18
18
|
"static/js/583.61ac7fde.chunk.js": "./static/js/583.61ac7fde.chunk.js",
|
19
|
-
"static/js/4827.
|
20
|
-
"static/js/8237.
|
19
|
+
"static/js/4827.bf6d34b0.chunk.js": "./static/js/4827.bf6d34b0.chunk.js",
|
20
|
+
"static/js/8237.9d947ccb.chunk.js": "./static/js/8237.9d947ccb.chunk.js",
|
21
21
|
"static/js/5828.f8572ba4.chunk.js": "./static/js/5828.f8572ba4.chunk.js",
|
22
|
-
"static/js/3224.
|
22
|
+
"static/js/3224.86a6ba35.chunk.js": "./static/js/3224.86a6ba35.chunk.js",
|
23
23
|
"static/js/9060.1ec8dc2b.chunk.js": "./static/js/9060.1ec8dc2b.chunk.js",
|
24
|
-
"static/js/5625.
|
24
|
+
"static/js/5625.a2d9a416.chunk.js": "./static/js/5625.a2d9a416.chunk.js",
|
25
25
|
"static/js/6141.d2879825.chunk.js": "./static/js/6141.d2879825.chunk.js",
|
26
26
|
"static/js/4103.a5610a9d.chunk.js": "./static/js/4103.a5610a9d.chunk.js",
|
27
|
-
"static/js/1086.
|
28
|
-
"static/js/245.
|
27
|
+
"static/js/1086.93ecee4c.chunk.js": "./static/js/1086.93ecee4c.chunk.js",
|
28
|
+
"static/js/245.f99a075b.chunk.js": "./static/js/245.f99a075b.chunk.js",
|
29
29
|
"static/js/7193.629fc6fe.chunk.js": "./static/js/7193.629fc6fe.chunk.js",
|
30
30
|
"static/js/6360.172f2b06.chunk.js": "./static/js/6360.172f2b06.chunk.js",
|
31
31
|
"static/js/8790.0b98f286.chunk.js": "./static/js/8790.0b98f286.chunk.js",
|
32
32
|
"static/js/8815.92ce1b4a.chunk.js": "./static/js/8815.92ce1b4a.chunk.js",
|
33
|
-
"static/js/9528.
|
34
|
-
"static/js/7809.
|
35
|
-
"static/js/6088.
|
33
|
+
"static/js/9528.a58c0ad2.chunk.js": "./static/js/9528.a58c0ad2.chunk.js",
|
34
|
+
"static/js/7809.4b5ac1e5.chunk.js": "./static/js/7809.4b5ac1e5.chunk.js",
|
35
|
+
"static/js/6088.cf24e25c.chunk.js": "./static/js/6088.cf24e25c.chunk.js",
|
36
36
|
"static/js/8166.094f1288.chunk.js": "./static/js/8166.094f1288.chunk.js",
|
37
|
-
"static/js/9114.
|
37
|
+
"static/js/9114.37a044b5.chunk.js": "./static/js/9114.37a044b5.chunk.js",
|
38
38
|
"static/js/5281.5e3aa7c6.chunk.js": "./static/js/5281.5e3aa7c6.chunk.js",
|
39
39
|
"static/js/5618.2d933cb5.chunk.js": "./static/js/5618.2d933cb5.chunk.js",
|
40
40
|
"static/js/1260.dc193a5e.chunk.js": "./static/js/1260.dc193a5e.chunk.js",
|
@@ -86,7 +86,6 @@
|
|
86
86
|
"static/media/SourceSansPro-Italic.woff2": "./static/media/SourceSansPro-Italic.8a9bfea74d43927d6eec.woff2",
|
87
87
|
"static/media/SourceSansPro-BoldItalic.woff2": "./static/media/SourceSansPro-BoldItalic.1d664be59d2eb5fef029.woff2",
|
88
88
|
"static/media/SourceSansPro-SemiBoldItalic.woff2": "./static/media/SourceSansPro-SemiBoldItalic.befb0a2824eabc5ce36b.woff2",
|
89
|
-
"static/media/rocket.svg": "./static/media/rocket.b75b17d2b0a063c6cea230d1a9d77f1e.svg",
|
90
89
|
"static/media/KaTeX_Main-Italic.ttf": "./static/media/KaTeX_Main-Italic.fa675e5e4bec9eb250b6.ttf",
|
91
90
|
"static/media/KaTeX_AMS-Regular.woff": "./static/media/KaTeX_AMS-Regular.d562e886c52f12660a41.woff",
|
92
91
|
"static/media/KaTeX_Main-BoldItalic.ttf": "./static/media/KaTeX_Main-BoldItalic.828abcb200061cffbaae.ttf",
|
@@ -137,6 +136,7 @@
|
|
137
136
|
"static/media/KaTeX_Caligraphic-Bold.woff": "./static/media/KaTeX_Caligraphic-Bold.d757c535a2e5902f1325.woff",
|
138
137
|
"static/media/KaTeX_Caligraphic-Regular.woff": "./static/media/KaTeX_Caligraphic-Regular.db074fa22cf224af93d7.woff",
|
139
138
|
"static/media/KaTeX_Size3-Regular.ttf": "./static/media/KaTeX_Size3-Regular.8d6b6822586eea3d3b20.ttf",
|
139
|
+
"static/media/snowflake.svg": "./static/media/snowflake.187cb4ca5fd443488e5b4bfc9c4d2b52.svg",
|
140
140
|
"static/media/KaTeX_Caligraphic-Bold.woff2": "./static/media/KaTeX_Caligraphic-Bold.a1abf90dfd72792a577a.woff2",
|
141
141
|
"static/media/KaTeX_Caligraphic-Regular.woff2": "./static/media/KaTeX_Caligraphic-Regular.d6484fce1ef428d5bd94.woff2",
|
142
142
|
"static/media/KaTeX_Size1-Regular.woff": "./static/media/KaTeX_Size1-Regular.0108e89c9003e8c14ea3.woff",
|
@@ -147,12 +147,14 @@
|
|
147
147
|
"static/media/KaTeX_Size4-Regular.woff2": "./static/media/KaTeX_Size4-Regular.e418bf257af1052628d8.woff2",
|
148
148
|
"static/media/KaTeX_Size3-Regular.woff": "./static/media/KaTeX_Size3-Regular.7947224e8a9914fa332b.woff",
|
149
149
|
"static/media/KaTeX_Size3-Regular.woff2": "./static/media/KaTeX_Size3-Regular.e1951519f6f0596f7356.woff2",
|
150
|
+
"static/media/rocket.svg": "./static/media/rocket.add69fb2c850b62fa60077e3a5a06d28.svg",
|
151
|
+
"static/media/streamlit-mark-color.svg": "./static/media/streamlit-mark-color.e5952193e5f735a3afb01a78a4dd4b41.svg",
|
150
152
|
"static/media/logo.svg": "./static/media/logo.83ae4f2fb87e38be7cbb8a5d2beb64d2.svg",
|
151
153
|
"index.html": "./index.html",
|
152
154
|
"static/media/checkmark.svg": "./static/media/checkmark.29851c8e9e6ef0c3d6c1e4efe3c1bb9e.svg"
|
153
155
|
},
|
154
156
|
"entrypoints": [
|
155
157
|
"static/css/main.5513bd04.css",
|
156
|
-
"static/js/main.
|
158
|
+
"static/js/main.b154eb39.js"
|
157
159
|
]
|
158
160
|
}
|
streamlit/static/index.html
CHANGED
@@ -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.
|
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.b154eb39.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1086],{68035:(e,t,r)=>{r.d(t,{A:()=>c});r(58878);var n=r(25571),o=r(78286),i=r(89653);const a=r(60667).i7`
|
2
|
+
50% {
|
3
|
+
color: rgba(0, 0, 0, 0);
|
4
|
+
}
|
5
|
+
`,s=(0,i.A)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:`0 ${n.spacing.twoXS}`}}:{},...r?{color:n.colors.red,animationName:`${a}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(90782);const c=e=>{let{dirty:t,value:r,inForm:i,maxLength:a,className:c,type:u="single",allowEnterToSubmit:d=!0}=e;const p=[],f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p.push((0,l.jsx)(s,{includeDot:p.length>0,shouldBlink:t,children:e},p.length))};if(d){const e=i?"submit form":"apply";if("multiline"===u){f(`Press ${(0,n.u_)()?"\u2318":"Ctrl"}+Enter to ${e}`)}else"single"===u&&f(`Press Enter to ${e}`)}return a&&("chat"!==u||t)&&f(`${r.length}/${a}`,t&&r.length>=a),(0,l.jsx)(o.tp,{"data-testid":"InputInstructions",className:c,children:p})}},1086:(e,t,r)=>{r.r(t),r.d(t,{default:()=>v});var n=r(58878),o=r(8151),i=r(68102),a=r(68622),s=n.forwardRef((function(e,t){return n.createElement(a.I,(0,i.A)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var l=r(94928),c=r(64611),u=r(68035),d=r(16795),p=r(89653);const f=(0,p.A)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.default,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:`${n}px`}}),""),h=(0,p.A)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.default,display:"flex",alignItems:"center"}}),""),y=(0,p.A)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.iq)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?"0":t.radii.default,borderTopLeftRadius:n?t.radii.default:"0",borderBottomRightRadius:t.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),g=(0,p.A)("div",{target:"e1d2x3se1"})({name:"1v03qtz",styles:"display:flex;align-items:flex-end;height:100%;position:absolute;right:0;pointer-events:none"}),b=(0,p.A)("div",{target:"e1d2x3se0"})((e=>{let{theme:t}=e;return{position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`}}),"");var m=r(90782);const v=function(e){let{width:t,element:r,widgetMgr:i,fragmentId:a}=e;const p=(0,o.u)(),[v,x]=(0,n.useState)(!1),[w,O]=(0,n.useState)(r.default),[j,C]=(0,n.useState)(0),S=(0,n.useRef)(null),$=(0,n.useRef)({minHeight:0,maxHeight:0}),A=()=>{S.current&&S.current.focus(),w&&(i.setStringTriggerValue(r,w,{fromUi:!0},a),x(!1),O(""),C(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";O(e),x(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(S.current){const{offsetHeight:e}=S.current;$.current.minHeight=e,$.current.maxHeight=6.5*e}}),[S]);const{disabled:k,placeholder:P,maxChars:R}=r,E=(0,d.iq)(p),{minHeight:I,maxHeight:T}=$.current,z=E?p.colors.gray70:p.colors.gray80,B=!!(j>0&&S.current)&&Math.abs(j-I)>1;return(0,m.jsx)(f,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,m.jsxs)(h,{children:[(0,m.jsx)(l.A,{inputRef:S,value:w,placeholder:P,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(x(""!==t),O(t),C((()=>{let e=0;const{current:t}=S;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),A())},"aria-label":P,disabled:k,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",backgroundColor:p.colors.transparent,borderLeftWidth:p.sizes.borderWidth,borderRightWidth:p.sizes.borderWidth,borderTopWidth:p.sizes.borderWidth,borderBottomWidth:p.sizes.borderWidth,width:`${t}px`}},InputContainer:{style:{backgroundColor:p.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,backgroundColor:p.colors.transparent,"::placeholder":{color:z},height:B?`${j+1}px`:"auto",maxHeight:T?`${T}px`:"none",paddingLeft:p.spacing.sm,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,paddingRight:`calc(${p.iconSizes.xl} + 2 * ${p.spacing.sm} + ${p.spacing.sm})`}}}}),t>p.breakpoints.hideWidgetDetails&&(0,m.jsx)(b,{children:(0,m.jsx)(u.A,{dirty:v,value:w,maxLength:R,type:"chat",inForm:!1})}),(0,m.jsx)(g,{children:(0,m.jsx)(y,{onClick:A,disabled:!v||k,extended:B,"data-testid":"stChatInputSubmitButton",children:(0,m.jsx)(c.A,{content:s,size:"xl",color:"inherit"})})})]})})}},94928:(e,t,r)=>{r.d(t,{A:()=>$});var n=r(58878),o=r(35331),i=r(18648),a=r(92850),s=r(57224),l=r(81301);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,s.I4)("div",(function(e){return u(u({},(0,l.vt)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.I4)("div",(function(e){return(0,l.EO)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.I4)("textarea",(function(e){return u(u({},(0,l.n)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="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},y(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(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 r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var 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&&x(e,t)}(c,e);var t,r,s,l=w(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o._O)(t.Root,p),2),s=r[0],l=r[1],c=(0,o.Qp)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.A,g({},this.props,{type:a.GT.textarea,overrides:c,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(n.Component);C(S,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:a.SK.default});const $=S}}]);
|