streamlit-nightly 1.34.1.dev20240507__py2.py3-none-any.whl → 1.34.1.dev20240509__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/elements/vega_charts.py +117 -9
- streamlit/elements/widgets/button.py +18 -7
- streamlit/static/asset-manifest.json +4 -4
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/4113.99983645.chunk.js +1 -0
- streamlit/static/static/js/6013.4ba2d616.chunk.js +1 -0
- streamlit/static/static/js/{main.b84b6de2.js → main.5a6e0ded.js} +2 -2
- streamlit/type_util.py +51 -4
- {streamlit_nightly-1.34.1.dev20240507.dist-info → streamlit_nightly-1.34.1.dev20240509.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.34.1.dev20240507.dist-info → streamlit_nightly-1.34.1.dev20240509.dist-info}/RECORD +15 -15
- streamlit/static/static/js/4113.9b2db2e3.chunk.js +0 -1
- streamlit/static/static/js/6013.64cd6d28.chunk.js +0 -1
- /streamlit/static/static/js/{main.b84b6de2.js.LICENSE.txt → main.5a6e0ded.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.34.1.dev20240507.data → streamlit_nightly-1.34.1.dev20240509.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.34.1.dev20240507.dist-info → streamlit_nightly-1.34.1.dev20240509.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.34.1.dev20240507.dist-info → streamlit_nightly-1.34.1.dev20240509.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.34.1.dev20240507.dist-info → streamlit_nightly-1.34.1.dev20240509.dist-info}/top_level.txt +0 -0
streamlit/type_util.py
CHANGED
@@ -741,7 +741,7 @@ def ensure_indexable(obj: OptionSequence[V_co]) -> Sequence[V_co]:
|
|
741
741
|
# This is an imperfect check because there is no guarantee that an `index`
|
742
742
|
# function actually does the thing we want.
|
743
743
|
index_fn = getattr(it, "index", None)
|
744
|
-
if callable(index_fn):
|
744
|
+
if callable(index_fn) and type(it) != EnumMeta:
|
745
745
|
# We return a shallow copy of the Sequence here because the return value of
|
746
746
|
# this function is saved in a widget serde class instance to be used in later
|
747
747
|
# script runs, and we don't want mutations to the options object passed to a
|
@@ -782,11 +782,15 @@ def is_pandas_version_less_than(v: str) -> bool:
|
|
782
782
|
-------
|
783
783
|
bool
|
784
784
|
|
785
|
+
|
786
|
+
Raises
|
787
|
+
------
|
788
|
+
InvalidVersion
|
789
|
+
If the version strings are not valid.
|
785
790
|
"""
|
786
791
|
import pandas as pd
|
787
|
-
from packaging import version
|
788
792
|
|
789
|
-
return
|
793
|
+
return is_version_less_than(pd.__version__, v)
|
790
794
|
|
791
795
|
|
792
796
|
def is_pyarrow_version_less_than(v: str) -> bool:
|
@@ -801,11 +805,54 @@ def is_pyarrow_version_less_than(v: str) -> bool:
|
|
801
805
|
-------
|
802
806
|
bool
|
803
807
|
|
808
|
+
|
809
|
+
Raises
|
810
|
+
------
|
811
|
+
InvalidVersion
|
812
|
+
If the version strings are not valid.
|
813
|
+
|
804
814
|
"""
|
805
815
|
import pyarrow as pa
|
816
|
+
|
817
|
+
return is_version_less_than(pa.__version__, v)
|
818
|
+
|
819
|
+
|
820
|
+
def is_altair_version_less_than(v: str) -> bool:
|
821
|
+
"""Return True if the current Altair version is less than the input version.
|
822
|
+
|
823
|
+
Parameters
|
824
|
+
----------
|
825
|
+
v : str
|
826
|
+
Version string, e.g. "0.25.0"
|
827
|
+
|
828
|
+
Returns
|
829
|
+
-------
|
830
|
+
bool
|
831
|
+
|
832
|
+
|
833
|
+
Raises
|
834
|
+
------
|
835
|
+
InvalidVersion
|
836
|
+
If the version strings are not valid.
|
837
|
+
|
838
|
+
"""
|
839
|
+
import altair as alt
|
840
|
+
|
841
|
+
return is_version_less_than(alt.__version__, v)
|
842
|
+
|
843
|
+
|
844
|
+
def is_version_less_than(v1: str, v2: str) -> bool:
|
845
|
+
"""Return True if the v1 version string is less than the v2 version string
|
846
|
+
based on semantic versioning.
|
847
|
+
|
848
|
+
Raises
|
849
|
+
------
|
850
|
+
InvalidVersion
|
851
|
+
If the version strings are not valid.
|
852
|
+
"""
|
806
853
|
from packaging import version
|
807
854
|
|
808
|
-
return version.parse(
|
855
|
+
return version.parse(v1) < version.parse(v2)
|
809
856
|
|
810
857
|
|
811
858
|
def _maybe_truncate_table(
|
@@ -31,7 +31,7 @@ streamlit/source_util.py,sha256=21c98etHrDfg_MyLMohG7ByrEC52THuUP-E7pkCcmiE,5749
|
|
31
31
|
streamlit/string_util.py,sha256=syhyJoC_QNwSU1wYcnGOsYwT5OX2uHDggXkzFNCjWQo,6347
|
32
32
|
streamlit/temporary_directory.py,sha256=eBv5q0CR9GApa-itZBaGtqQKMl248H0HojEVKzkS9cc,1627
|
33
33
|
streamlit/time_util.py,sha256=IoZTYEqz1qX_vzieLeuyjHhF5fpDmqc49DYFK4Gsy4w,2844
|
34
|
-
streamlit/type_util.py,sha256=
|
34
|
+
streamlit/type_util.py,sha256=y7RffGHw88vzS3-c4bRt-NwFRq2oe0eb_u_qYKB1OIc,48389
|
35
35
|
streamlit/url_util.py,sha256=iU1lpZhzW4ZjhjBhSdw39OzixnThIsxhXpDP-ZIgUT8,3019
|
36
36
|
streamlit/user_info.py,sha256=dqNEEanUVJDLhn4cTmeFG1iUfSQFDWuMQjjQHmDtE6I,3472
|
37
37
|
streamlit/util.py,sha256=5fna6hGM_WBZugMjzIXqqFD41JrFL3QBicfcAmjyefw,6379
|
@@ -89,7 +89,7 @@ streamlit/elements/spinner.py,sha256=ZMJlO-J77lpQZbRPvqJ80ur9u11dBUwJr6JgDct8TLY
|
|
89
89
|
streamlit/elements/text.py,sha256=-g2LYiJpP2OAdllpd7Df9rhTehIOEuiZN7-u1jwKEio,1856
|
90
90
|
streamlit/elements/toast.py,sha256=pqA14fzEE9rJM4rBgUpXPsu6AeX3XyC5LCHBxXYHQvk,4336
|
91
91
|
streamlit/elements/utils.py,sha256=Eo8X2KAa_Pkp7QOfFPKoMRNZ01oYt2DbZuHuqhosZv4,8085
|
92
|
-
streamlit/elements/vega_charts.py,sha256=
|
92
|
+
streamlit/elements/vega_charts.py,sha256=I3mkRQErbVUkpotGrXbfGCMDv-frGR2yCv33t3uFWRM,43912
|
93
93
|
streamlit/elements/write.py,sha256=XYR20zqRcDJ8BQVE3s4mrY6gyWatr9ikXfkFqAod900,20804
|
94
94
|
streamlit/elements/lib/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
|
95
95
|
streamlit/elements/lib/built_in_chart_utils.py,sha256=_9zHVXvXtW1MF3GXU3eZm5aqe_IxwnDGu4idfV4fmJI,30666
|
@@ -103,7 +103,7 @@ streamlit/elements/lib/pandas_styler_utils.py,sha256=KXaslcPlLdIVk6GgMILHqYc2AY3
|
|
103
103
|
streamlit/elements/lib/streamlit_plotly_theme.py,sha256=DgMP_PWTfFO5J__q8bGxoT3ey5z727582wDD_u3UaPU,8307
|
104
104
|
streamlit/elements/lib/subtitle_utils.py,sha256=eYfsTAKub-55nx0kik9T6nJ8dTyeUazPbMNfkIP-BNg,6246
|
105
105
|
streamlit/elements/widgets/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
|
106
|
-
streamlit/elements/widgets/button.py,sha256=
|
106
|
+
streamlit/elements/widgets/button.py,sha256=zka2by3X2MfxkBEkKO3apNfUbnPXi-dD37cC_aBQ9Iw,32860
|
107
107
|
streamlit/elements/widgets/camera_input.py,sha256=XD5FUepJsOP1l48qTRyKZUklIoorPv95QuTg_R6SZZQ,9141
|
108
108
|
streamlit/elements/widgets/chat.py,sha256=eQcR35Mpyp8JCrHZ46wx3bKzVSTI0__PTDlIzml7FTE,14320
|
109
109
|
streamlit/elements/widgets/checkbox.py,sha256=fhAZaZQE1b5Cq1bRO5D77ZN43_osxMjPX109ANy3txk,12573
|
@@ -331,9 +331,9 @@ streamlit/runtime/state/safe_session_state.py,sha256=StGh9V-tm7MCfohgw5FFfwz8tDw
|
|
331
331
|
streamlit/runtime/state/session_state.py,sha256=jOIrZD94Cn1wrLdPZIcMYPxiGK1gbus1pD4FXSYp4Q4,27500
|
332
332
|
streamlit/runtime/state/session_state_proxy.py,sha256=vg1w054kfdO77fZUgPcHz4A47ghy6hZdp_c6A4ExNIs,5469
|
333
333
|
streamlit/runtime/state/widgets.py,sha256=lOiEnfBQ1X5_zP9fFB4szOBFCjGHjBzTTQYQOR8rl_g,11263
|
334
|
-
streamlit/static/asset-manifest.json,sha256=
|
334
|
+
streamlit/static/asset-manifest.json,sha256=wy0IanOOHeRWLODLM1PGzSvJFdN0rhjsHFq4SKH_eZk,14509
|
335
335
|
streamlit/static/favicon.png,sha256=if5cVgw7azxKOvV5FpGixga7JLn23rfnHcy1CdWI1-E,1019
|
336
|
-
streamlit/static/index.html,sha256=
|
336
|
+
streamlit/static/index.html,sha256=p0k5AAPEfi71D0toIB6RNvjE8V1KgLjSWMAbj0cWffg,891
|
337
337
|
streamlit/static/static/css/3092.95a45cfe.chunk.css,sha256=QE-zWROIblgpsp6h00VK9cgGrvagmJ8gBzSbnADMOG0,12090
|
338
338
|
streamlit/static/static/css/3466.8b8f33d6.chunk.css,sha256=4m2lbj1eVFXSaGCRBHZNhqyRz-4Ce9KogjJPxIq6On8,33275
|
339
339
|
streamlit/static/static/css/5441.e3b876c5.chunk.css,sha256=XExLUUHInaWJp_m8TtBWhQ88SUuxZl6Jnnw5NA6rwI4,2633
|
@@ -361,7 +361,7 @@ streamlit/static/static/js/3466.05d62820.chunk.js,sha256=m_N-3P_55iGreOsYeHE5byo
|
|
361
361
|
streamlit/static/static/js/3466.05d62820.chunk.js.LICENSE.txt,sha256=PeHoWwanyVMJhSSZY5mBxJ_ViM-rFeBoTg9klHLMtdE,1219
|
362
362
|
streamlit/static/static/js/3513.ebc278c4.chunk.js,sha256=OMzoJTga2HbAUCIXxfJfVoqtCKL8DUT7Hu5w6dgz80g,930
|
363
363
|
streamlit/static/static/js/3631.be5c35fa.chunk.js,sha256=OzF7d8fqPR2XqRzc2JgG-HilB9pW5XQvav0qNal78lg,5288
|
364
|
-
streamlit/static/static/js/4113.
|
364
|
+
streamlit/static/static/js/4113.99983645.chunk.js,sha256=lSuWiYq2xuTjv47dPase8_rtmY24R_Seef8vIzSU9Fo,2610
|
365
365
|
streamlit/static/static/js/4132.49bf3f2c.chunk.js,sha256=7VSP_20CCc0ynooZRtZBcr9g-afnXpGmrqlUpK6c0p8,9226
|
366
366
|
streamlit/static/static/js/4132.49bf3f2c.chunk.js.LICENSE.txt,sha256=426lVBKMW2FKu5BqnSDpZnhms1QqJZ-nDvqwC62w-Z8,479
|
367
367
|
streamlit/static/static/js/4177.69f9f18d.chunk.js,sha256=BEIcTqNGD5WEz9IlGOGHKQhCxm1pBaesg0hIlvDvH2w,2178
|
@@ -377,7 +377,7 @@ streamlit/static/static/js/5345.65c91ee7.chunk.js,sha256=tIPHPVcIHGQMIy3_4CrO5vb
|
|
377
377
|
streamlit/static/static/js/5379.6571574f.chunk.js,sha256=g19Qe0ubL35F_bDHl42_p7sl_786ddUsysjhbJoERuw,10874
|
378
378
|
streamlit/static/static/js/5441.5bacdeda.chunk.js,sha256=CAYHhOuQHS9j1hGJn6gONGHSbylTmS8mZdtwfLgh56w,12231
|
379
379
|
streamlit/static/static/js/5791.9a42fb4b.chunk.js,sha256=6j7S1fDfB321ibbChH0lWkP3W2iNCCdJEPhtC-S9STM,107585
|
380
|
-
streamlit/static/static/js/6013.
|
380
|
+
streamlit/static/static/js/6013.4ba2d616.chunk.js,sha256=7hh155iz4ajC_ZbHQ1Vp2bkElHoDMdb9PeF-DIY-hWc,11449
|
381
381
|
streamlit/static/static/js/6405.ac5a6f23.chunk.js,sha256=u7b4I7WVspIbm8eKcgMs2L0aTG3f414AHrJtDsHfwSU,13239
|
382
382
|
streamlit/static/static/js/6718.802da17e.chunk.js,sha256=RhbHOhX-Uk28eSUtfqK_O0TkBhdM0JXUUy8fXc_qmkA,24494
|
383
383
|
streamlit/static/static/js/6853.93dd1c4c.chunk.js,sha256=z1kvBUQY-7P7Hh7q0QQUiMCRmBbiW7n0ZfV1p9Yo0Ok,1372
|
@@ -403,8 +403,8 @@ streamlit/static/static/js/937.a1248039.chunk.js.LICENSE.txt,sha256=KAhbcQ1jd_N8
|
|
403
403
|
streamlit/static/static/js/9656.8c935274.chunk.js,sha256=3VB6NT0EQErJUX2SYLQpmNAp19sWI45AbNOQLVjcvII,22113
|
404
404
|
streamlit/static/static/js/9758.6e6d8662.chunk.js,sha256=3Gtwgkru2xQTl1mCxFjILQ_Ppb8DMKySHY5YVhm9ihY,2119
|
405
405
|
streamlit/static/static/js/9865.fd93213d.chunk.js,sha256=Ul2N951ZrAXpJOWo4SV4AKlymjMMNPJxpea3uRt8B_Y,4011
|
406
|
-
streamlit/static/static/js/main.
|
407
|
-
streamlit/static/static/js/main.
|
406
|
+
streamlit/static/static/js/main.5a6e0ded.js,sha256=Nc5MRgTKad7GO5RJg5H_T_FMKnKhtZCkaRrP1Ip6a9M,4401921
|
407
|
+
streamlit/static/static/js/main.5a6e0ded.js.LICENSE.txt,sha256=YTeqT7R6idssTgnyi3gf0tRiq18-LiPeDOpsWcnbi34,3184
|
408
408
|
streamlit/static/static/media/KaTeX_AMS-Regular.73ea273a72f4aca30ca5.woff2,sha256=DN04fJWQoan5eUVgAi27WWVKfYbxh6oMgUla1C06cwg,28076
|
409
409
|
streamlit/static/static/media/KaTeX_AMS-Regular.853be92419a6c3766b9a.ttf,sha256=aFNIQLz90r_7bw6N60hoTdAefwTqKBMmdXevuQbeHRM,63632
|
410
410
|
streamlit/static/static/media/KaTeX_AMS-Regular.d562e886c52f12660a41.woff,sha256=MNqR6EyJP4deJSaJ-uvcWQsocRReitx_mp1NvYzgslE,33516
|
@@ -523,9 +523,9 @@ streamlit/web/server/server_util.py,sha256=FptUF-CjFh78VjeTQDi3R78m7E64MDe3wcklg
|
|
523
523
|
streamlit/web/server/stats_request_handler.py,sha256=cL__KbJFIhdhf1Zt6skbLehUqT-jo56x1HARxogZDOI,3680
|
524
524
|
streamlit/web/server/upload_file_request_handler.py,sha256=YPDmKWUnaGH9d4QNcMEsY5k1YIz_q-xW1K5fmgHaDzc,4966
|
525
525
|
streamlit/web/server/websocket_headers.py,sha256=07SkWLcOxbyldl7UcBzrMKY9ZojypCQACiKoh5FcH7Y,1870
|
526
|
-
streamlit_nightly-1.34.1.
|
527
|
-
streamlit_nightly-1.34.1.
|
528
|
-
streamlit_nightly-1.34.1.
|
529
|
-
streamlit_nightly-1.34.1.
|
530
|
-
streamlit_nightly-1.34.1.
|
531
|
-
streamlit_nightly-1.34.1.
|
526
|
+
streamlit_nightly-1.34.1.dev20240509.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
|
527
|
+
streamlit_nightly-1.34.1.dev20240509.dist-info/METADATA,sha256=cKjXZUMg_PmAS5fMTqFNbm17GKs_duTPEetkxnqwVYo,8528
|
528
|
+
streamlit_nightly-1.34.1.dev20240509.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
529
|
+
streamlit_nightly-1.34.1.dev20240509.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
|
530
|
+
streamlit_nightly-1.34.1.dev20240509.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
|
531
|
+
streamlit_nightly-1.34.1.dev20240509.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4113],{34113:(e,r,t)=>{t.r(r),t.d(r,{default:()=>f});var o=t(66845),a=t(46927),n=t(68411),l=t(27446),i=t(63730),s=t(66694),d=t(84457),c=t(1515);const g=(0,c.Z)("div",{target:"e11k5jya2"})((e=>{let{}=e;return{display:"flex",flexDirection:"column"}}),""),p=(0,c.Z)("a",{target:"e11k5jya1"})((e=>{let{disabled:r,isCurrentPage:t,fluidWidth:o,theme:a}=e;return{textDecoration:"none",width:"number"==typeof o?"".concat(o,"px"):"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:a.spacing.sm,borderRadius:a.spacing.twoXS,paddingLeft:a.spacing.sm,paddingRight:a.spacing.sm,marginTop:a.spacing.threeXS,marginBottom:a.spacing.threeXS,lineHeight:a.lineHeights.menuItem,backgroundColor:t?a.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:t?a.colors.darkenedBgMix25:a.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:a.colors.darkenedBgMix15},"@media print":{paddingLeft:a.spacing.none},...r?{borderColor:a.colors.fadedText10,backgroundColor:a.colors.transparent,color:a.colors.fadedText40,cursor:"not-allowed","&:hover":{color:a.colors.fadedText40,backgroundColor:a.colors.transparent}}:{}}}),""),u=(0,c.Z)("span",{target:"e11k5jya0"})((e=>{let{disabled:r,theme:t}=e;return{color:t.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:t.colors.fadedText10,backgroundColor:t.colors.transparent,color:t.colors.fadedText40,cursor:"not-allowed"}:{}}}),"");var h=t(40864);const f=function(e){const{onPageChange:r,currentPageScriptHash:t}=o.useContext(s.E),c=o.useContext(d.Z),{disabled:f,element:x,width:b}=e,k={width:b},m=function(e,r){return!(null!==e||!r)||!(null===e&&!r)&&!0===e}(x.useContainerWidth,c),C=t===x.pageScriptHash;return(0,h.jsx)("div",{className:"row-widget stPageLink","data-testid":"stPageLink",style:k,children:(0,h.jsx)(l.t,{help:x.help,placement:n.u.TOP_RIGHT,children:(0,h.jsx)(g,{children:(0,h.jsxs)(p,{"data-testid":"stPageLink-NavLink",disabled:f,isCurrentPage:C,fluidWidth:!!m&&b,href:x.page,target:x.external?"_blank":"",rel:"noreferrer",onClick:e=>{x.external?f&&e.preventDefault():(e.preventDefault(),f||r(x.pageScriptHash))},children:[x.icon&&(0,h.jsx)(a.S,{size:"lg",children:x.icon}),(0,h.jsx)(u,{disabled:f,children:(0,h.jsx)(i.ZP,{source:x.label,allowHTML:!1,isLabel:!0,boldLabel:C,largerLabel:!0,disableLinks:!0})})]})})})})}}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6013],{79986:(e,t,r)=>{r.d(t,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),a=r(50669),s=r(1515);const l=(0,r(7865).F4)(n||(n=(0,a.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),c=(0,s.Z)("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 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var u=r(40864);const d=e=>{let{dirty:t,value:r,maxLength:n,className:a,type:s="single",inForm:l}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,u.jsx)(c,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=l?"submit form":"apply";if("multiline"===s){const t=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(t,"+Enter to ").concat(e))}else"single"===s&&p("Press Enter to ".concat(e))}return n&&("chat"!==s||t)&&p("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,u.jsx)(i.X7,{"data-testid":"InputInstructions",className:a,children:d})}},46013:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var n=r(66845),o=r(25621),i=r(25773),a=r(69),s=n.forwardRef((function(e,t){return n.createElement(a.D,(0,i.Z)({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(118),c=r(46927),u=r(79986),d=r(27466),p=r(48266),f=r(1515);const h=(0,f.Z)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.lg,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:"".concat(n,"px")}}),""),y=(0,f.Z)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.lg,display:"flex",alignItems:"center"}}),""),g=(0,f.Z)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.Iy)(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?t.radii.none:t.radii.lg,borderTopLeftRadius:n?t.radii.lg:t.radii.none,borderBottomRightRadius:t.radii.lg,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,margin:0,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}}}),""),b=(0,f.Z)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),m=(0,f.Z)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var v=r(40864);const x=function(e){let{width:t,element:r,widgetMgr:i,fragmentId:a}=e;const f=(0,o.u)(),[x,w]=(0,n.useState)(!1),[O,j]=(0,n.useState)(r.default),[C,S]=(0,n.useState)(0),P=(0,n.useRef)(null),R=(0,n.useRef)({minHeight:0,maxHeight:0}),k=()=>{O&&(i.setStringTriggerValue(r,O,{fromUi:!0},a),w(!1),j(""),S(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";j(e),w(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(P.current){const{offsetHeight:e}=P.current;R.current.minHeight=e,R.current.maxHeight=6.5*e}}),[P]);const{disabled:I,placeholder:E,maxChars:B}=r,T=(0,d.Iy)(f),{minHeight:F,maxHeight:Z}=R.current,z=T?f.colors.gray70:f.colors.gray80,A=!!(C>0&&P.current)&&Math.abs(C-F)>1;return(0,v.jsx)(h,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,v.jsxs)(y,{children:[(0,v.jsx)(l.Z,{inputRef:P,value:O,placeholder:E,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(w(""!==t),j(t),S((()=>{let e=0;const{current:t}=P;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(),k())},"aria-label":E,disabled:I,rows:1,overrides:{Root:{style:{outline:"none",backgroundColor:f.colors.transparent,borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",width:"".concat(t,"px")}},InputContainer:{style:{backgroundColor:f.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:"1.4",backgroundColor:f.colors.transparent,"::placeholder":{color:z},height:A?"".concat(C+1,"px"):"auto",maxHeight:Z?"".concat(Z,"px"):"none",paddingRight:"3rem",paddingLeft:f.spacing.sm,paddingBottom:f.spacing.sm,paddingTop:f.spacing.sm}}}}),t>p.A.hideWidgetDetails&&(0,v.jsx)(m,{children:(0,v.jsx)(u.Z,{dirty:x,value:O,maxLength:B,type:"chat",inForm:!1})}),(0,v.jsx)(b,{children:(0,v.jsx)(g,{onClick:k,disabled:!x||I,extended:A,"data-testid":"stChatInputSubmitButton",children:(0,v.jsx)(c.Z,{content:s,size:"xl",color:"inherit"})})})]})})}},118:(e,t,r)=>{r.d(t,{Z:()=>P});var n=r(66845),o=r(80318),i=r(9656),a=r(38254),s=r(80745),l=r(98479);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.zo)("div",(function(e){return u(u({},(0,l.d5)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.zo)("div",(function(e){return(0,l.hB)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.zo)("textarea",(function(e){return u(u({},(0,l.Hx)(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.jb)(t.Root,p),2),s=r[0],l=r[1],c=(0,o.aO)({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.Z,g({},this.props,{type:a.iB.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.NO.default});const P=S}}]);
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|