streamlit-nightly 1.43.3.dev20250323__py3-none-any.whl → 1.44.1.dev20250325__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 +69 -24
- streamlit/elements/exception.py +8 -0
- streamlit/elements/markdown.py +35 -21
- streamlit/elements/widgets/number_input.py +41 -11
- streamlit/elements/widgets/slider.py +17 -5
- streamlit/material_icon_names.py +1 -1
- streamlit/proto/NumberInput_pb2.py +4 -4
- streamlit/proto/NumberInput_pb2.pyi +4 -1
- streamlit/runtime/context.py +21 -1
- streamlit/static/index.html +2 -2
- streamlit/static/static/css/{index.BOl9eq08.css → index.DKr_zoDj.css} +1 -1
- streamlit/static/static/js/{FileDownload.esm.BQODA0kT.js → FileDownload.esm.B-UWWWdT.js} +1 -1
- streamlit/static/static/js/{FileHelper.Cd1NC1sj.js → FileHelper.DRtEaIrj.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.t3Y3brxz.js → FormClearHelper.B_xJLRtH.js} +1 -1
- streamlit/static/static/js/{Hooks.CVhAgsX9.js → Hooks.DtzWH7N2.js} +1 -1
- streamlit/static/static/js/{InputInstructions.CY0iaCAH.js → InputInstructions.CkYMcz8B.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BsUYMROy.js → ProgressBar.Drx8XNKv.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.DY-eA855.js → RenderInPortalIfExists.BSkIOPqr.js} +1 -1
- streamlit/static/static/js/{Toolbar.B4w5KGXT.js → Toolbar.2r5jAJur.js} +1 -1
- streamlit/static/static/js/{base-input.DBVZTUu3.js → base-input.CV_PJtfn.js} +1 -1
- streamlit/static/static/js/{checkbox.JQMF-1O8.js → checkbox.CZjCrRM6.js} +1 -1
- streamlit/static/static/js/{createSuper.D9POSiaD.js → createSuper.wNbYZKaS.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DtRjA_2u.js → data-grid-overlay-editor.CxDiXQOm.js} +1 -1
- streamlit/static/static/js/{downloader.DoWSr1Wv.js → downloader.BKhc9vo-.js} +1 -1
- streamlit/static/static/js/{es6.1WEohfAS.js → es6.DMMA5jEp.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.Cvg5l91o.js → iframeResizer.contentWindow.rU5g5dG9.js} +1 -1
- streamlit/static/static/js/{index.tob7mjfs.js → index.60o7QeO8.js} +106 -106
- streamlit/static/static/js/index.6LeN9cCn.js +1 -0
- streamlit/static/static/js/{index.DxnPo6ts.js → index.B5181i5i.js} +1 -1
- streamlit/static/static/js/{index.CWCekiqc.js → index.B5pjbkNu.js} +1 -1
- streamlit/static/static/js/{index.CVHkuXW-.js → index.BDnhO8N2.js} +1 -1
- streamlit/static/static/js/index.BGHyjPoE.js +1 -0
- streamlit/static/static/js/index.BKHYl8ma.js +1 -0
- streamlit/static/static/js/{index.KS80Jqcr.js → index.BW1ps7Ve.js} +1 -1
- streamlit/static/static/js/{index.TIhv6y57.js → index.B_lGEToe.js} +2 -2
- streamlit/static/static/js/{index.u6AcjnZ7.js → index.BnFXM4vg.js} +1 -1
- streamlit/static/static/js/{index.yDsW8OSl.js → index.BvR3oAAg.js} +1 -1
- streamlit/static/static/js/{index.CbsyIVuK.js → index.BxcYwJga.js} +1 -1
- streamlit/static/static/js/{index.QthdDCoR.js → index.C5tuUwoV.js} +1 -1
- streamlit/static/static/js/{index.ZPl-HR8t.js → index.C5x1XZ52.js} +1 -1
- streamlit/static/static/js/{index.CqFs_RV7.js → index.C7Pn7DNY.js} +1 -1
- streamlit/static/static/js/{index.C6kAgSN4.js → index.C8fLs5OO.js} +1 -1
- streamlit/static/static/js/{index.BGnNI-8W.js → index.CEK_kfj1.js} +1 -1
- streamlit/static/static/js/{index.BLrbLqQH.js → index.CLpTIY8k.js} +1 -1
- streamlit/static/static/js/{index.CM19fnJb.js → index.COu5ow_u.js} +1 -1
- streamlit/static/static/js/{index.TDz7M2Mf.js → index.CY2a3G5f.js} +1 -1
- streamlit/static/static/js/index.CcHn1Jbf.js +1 -0
- streamlit/static/static/js/{index.C2tYobH0.js → index.CdUwInkp.js} +1 -1
- streamlit/static/static/js/{index.CSu8uGcy.js → index.Ci8MtnNW.js} +9 -9
- streamlit/static/static/js/{index.Dm7Igyrl.js → index.Cj6d-zQP.js} +1 -1
- streamlit/static/static/js/{index.DBtMVdzG.js → index.CjiDtsfR.js} +1 -1
- streamlit/static/static/js/{index.C7mtJOo5.js → index.DMOnosvH.js} +1 -1
- streamlit/static/static/js/{index.DelVBbuJ.js → index.Dh-GaoLL.js} +1 -1
- streamlit/static/static/js/{index.GXpLCsb-.js → index.DkHRVwYA.js} +8 -8
- streamlit/static/static/js/{index.D4xt261U.js → index.DmhhLL_7.js} +1 -1
- streamlit/static/static/js/index.PUoEdeCj.js +1 -0
- streamlit/static/static/js/{index.DCnMWZnR.js → index.YSxp_z0H.js} +1 -1
- streamlit/static/static/js/{index.BZkaPg7D.js → index.aJaKE3aW.js} +1 -1
- streamlit/static/static/js/{index.XgC4xRfH.js → index.hYp-Io20.js} +1 -1
- streamlit/static/static/js/{index.Du3BwWO7.js → index.lLHaP-WG.js} +1 -1
- streamlit/static/static/js/{index.CTYaWMIL.js → index.poiWcDhd.js} +1 -1
- streamlit/static/static/js/{index.B3VEOweF.js → index.qaTnk5v5.js} +7 -7
- streamlit/static/static/js/{index.CXWWimKv.js → index.wpF1efVn.js} +1 -1
- streamlit/static/static/js/{input.CO7BKD8r.js → input.hfihv8cy.js} +1 -1
- streamlit/static/static/js/{memory.BemPMzyI.js → memory.CwFUs_rm.js} +1 -1
- streamlit/static/static/js/{mergeWith.DP8mfmL6.js → mergeWith.NipycHTn.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.ginZOZcu.js → number-overlay-editor.BOZydn7S.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DBNJUrmv.js → possibleConstructorReturn.BegGyJAz.js} +1 -1
- streamlit/static/static/js/{sandbox.jDcIxry_.js → sandbox.UTLHU4Ul.js} +1 -1
- streamlit/static/static/js/{textarea.BtBLwbqz.js → textarea.dlySzlub.js} +1 -1
- streamlit/static/static/js/{timepicker.qTjYkAuk.js → timepicker.QFZeHTS5.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.CAEOgwcy.js → toConsumableArray.D1_QwNnQ.js} +1 -1
- streamlit/static/static/js/{uniqueId.BR7o9Ap9.js → uniqueId.DrcTmetR.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Dl0fFJUN.js → useBasicWidgetState.jMbeuIfG.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.B20T1pKy.js → useOnInputChange.CsqSzHwu.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.DI_yRwBc.js → withFullScreenWrapper.Cnlc3o1n.js} +1 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.C21bROXx.woff2 +0 -0
- streamlit/watcher/util.py +6 -6
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/RECORD +84 -84
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/WHEEL +1 -1
- streamlit/static/static/js/index.BEsq7fPh.js +0 -1
- streamlit/static/static/js/index.Cgs75YoN.js +0 -1
- streamlit/static/static/js/index.Czpau2RI.js +0 -1
- streamlit/static/static/js/index.Dln3BV86.js +0 -1
- streamlit/static/static/js/index.aC7qpPWU.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.BFCIvovZ.woff2 +0 -0
- {streamlit_nightly-1.43.3.dev20250323.data → streamlit_nightly-1.44.1.dev20250325.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
import{r,E as k,_ as V,n as u,B as ft,z as N,j as n,ba as J,bu as mt,C as F,bp as Q,b5 as Z,bo as U,a$ as yt,bG as Ct,bj as vt,bH as x,bs as It,F as tt,bh as xt,bI as wt,M as D,bl as bt,bk as St}from"./index.Ci8MtnNW.js";import{g as Ft,F as $,C as zt,I as Et,E as Ut,a as Ht,s as Tt,u as Bt,b as Dt}from"./FileHelper.DRtEaIrj.js";import{I as Lt}from"./InputInstructions.CkYMcz8B.js";import{i as Mt}from"./inputUtils.CQWz5UKz.js";import{a as q}from"./index.t--hEgTQ.js";import{U as et}from"./UploadFileInfo.C-jY39rj.js";import{T as Rt}from"./textarea.dlySzlub.js";import"./base-input.CV_PJtfn.js";var ot=r.forwardRef(function(t,e){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(k,V({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});ot.displayName="AttachFile";var nt=r.forwardRef(function(t,e){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(k,V({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});nt.displayName="ErrorOutline";var at=r.forwardRef(function(t,e){var i={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(k,V({iconAttrs:i,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.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"}))});at.displayName="Send";const $t=u("div",{target:"e1togvvn0"})("border:none;position:relative;display:flex;"),kt=u("div",{target:"e1togvvn1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),Vt=u("button",{target:"e1togvvn2"})(({theme:t,disabled:e,extended:i})=>{const c=ft(t),[f,p]=c?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:i?"0":t.radii.chatInput,borderTopLeftRadius:i?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?f:p,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:c?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray,cursor:"not-allowed"}}}),Nt=u("div",{target:"e1togvvn3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),Wt=u("div",{target:"e1togvvn4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),At=u("div",{target:"e15560op0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),Pt=u("div",{target:"e15560op1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Kt=u("div",{target:"e15560op2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),Ot=u("div",{target:"e15560op3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),_t=u("div",{target:"e15560op4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Xt=u("div",{target:"e15560op5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Gt=u("div",{target:"e15560op6"})({display:"flex"}),jt=u("div",{target:"e15560op7"})({flex:"0 0 auto"}),Yt=u("div",{target:"e15560op8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),qt=u("div",{target:"e15560op9"})(({theme:t})=>({color:t.colors.fadedText60})),Jt=u("div",{target:"e15560op10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Qt=u("div",{target:"e15560op11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Zt=u("small",{target:"e15560op12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function te({children:t,content:e}){const i=N();return n(mt,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${i.sizes.minElementHeight}`}}},children:t})}const ee=({fileInfo:t})=>{const e=N(),{type:i}=t.status;switch(i){case"uploading":return n(Ct,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(te,{content:t.status.errorMessage,children:n(U,{color:e.colors.red,content:nt,size:"lg"})});case"uploaded":return n(U,{content:Et,size:"lg"});default:return yt(i),null}},oe=({fileInfo:t,onDelete:e})=>F(Yt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(qt,{children:n(ee,{fileInfo:t})}),n(Jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(Qt,{children:Ft(t.size,$.Byte)}),n(Zt,{"data-testid":"stChatInputDeleteBtn",children:n(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:n(U,{content:zt,size:"lg"})})})]}),ne=r.memo(oe),ae=({items:t,onDelete:e})=>n(Xt,{"data-testid":"stChatUploadedFiles",children:n(Gt,{children:t.map(i=>n(jt,{children:n(ne,{fileInfo:i,onDelete:e})},i.id))})}),re=r.memo(ae),ie=({getNextLocalFileId:t,addFiles:e,updateFile:i,uploadClient:c,element:f,onUploadProgress:p,onUploadComplete:m})=>(w,h)=>{const y=q.CancelToken.source(),g=new et(h.name,h.size,t(),{type:"uploading",cancelToken:y,progress:1});e([g]),c.uploadFile({formId:"",...f},w.uploadUrl,h,d=>p(d,g.id),y.token).then(()=>m(g.id,w)).catch(d=>{q.isCancel(d)||i(g.id,g.setStatus({type:"error",errorMessage:d?d.toString():"Unknown error"}))})},se=({acceptMultipleFiles:t,maxFileSize:e,uploadClient:i,uploadFile:c,addFiles:f,getNextLocalFileId:p,deleteExistingFiles:m,onUploadComplete:w})=>(h,y)=>{if(!t&&h.length===0&&y.length>1){const g=y.findIndex(d=>{var C;return((C=d.errors)==null?void 0:C[0].code)===Ut.TooManyFiles});g>=0&&(h.push(y[g].file),y.splice(g,1))}if(!t&&h.length>0&&m(),i.fetchFileURLs(h).then(g=>{vt(g,h).forEach(([d,C])=>{c(d,C)})}).catch(g=>{f(h.map(d=>new et(d.name,d.size,p(),{type:"error",errorMessage:g})))}),y.length>0){const g=y.map(d=>Ht(d,p(),e));f(g)}w()},le=({getRootProps:t,getInputProps:e,acceptFile:i,disabled:c,theme:f})=>F(Kt,{disabled:c,children:[F(Ot,{"data-testid":"stChatInputFileUploadButton",disabled:c,...t(),children:[n("input",{...e()}),n(It,{content:`Upload or drag and drop ${i===x.Multiple?"files":"a file"}`,placement:J.TOP,onMouseEnterDelay:500,children:n(Q,{kind:Z.MINIMAL,disabled:c,children:n(U,{content:ot,size:"lg",color:c?f.colors.fadedText40:f.colors.fadedText60})})})]}),n(_t,{})]}),de=r.memo(le),ce=({getRootProps:t,getInputProps:e,acceptFile:i,inputHeight:c})=>F(tt,{children:[n(At,{height:c,...t(),children:n("input",{...e()})}),n(Pt,{height:c,children:`Drag and drop ${i===x.Multiple?"files":"a file"} here`})]}),pe=r.memo(ce),ue=6.5,L=1,M=(t,e,i)=>i.map(c=>c.id===t?e:c),R=(t,e)=>e.find(i=>i.id===t);function ge({disabled:t,element:e,widgetMgr:i,fragmentId:c,uploadClient:f}){const p=N(),m=r.useRef(null),w=r.useRef(0),h=r.useRef({minHeight:0,maxHeight:0}),[y,g]=xt(),[d,C]=r.useState(e.default),[z,W]=r.useState(0),[H,rt]=r.useState(!1),[b,S]=r.useState([]),[E,T]=r.useState(!1),B=r.useMemo(()=>b.some(o=>o.status.type==="uploading")?!1:d!==""||b.length>0,[b,d]),I=wt(e.acceptFile),A=Tt(e.maxUploadSizeMb,$.Megabyte,$.Byte),P=r.useCallback(o=>S(a=>[...a,...o]),[]),K=r.useCallback(o=>{S(a=>{const l=R(o,a);return D(l)?a:(l.status.type==="uploading"&&l.status.cancelToken.cancel(),l.status.type==="uploaded"&&l.status.fileUrls.deleteUrl&&f.deleteFile(l.status.fileUrls.deleteUrl),a.filter(s=>s.id!==o))})},[f]),it=()=>{const o=b.filter(a=>a.status.type==="uploaded").map(a=>{const{name:l,size:s,status:v}=a,{fileId:gt,fileUrls:ht}=v;return new bt({fileId:gt,fileUrls:ht,name:l,size:s})});return new St({uploadedFileInfo:o})},O=()=>w.current++,st=se({acceptMultipleFiles:I===x.Multiple,maxFileSize:A,uploadClient:f,uploadFile:ie({getNextLocalFileId:O,addFiles:P,updateFile:(o,a)=>{S(l=>M(o,a,l))},uploadClient:f,element:e,onUploadProgress:(o,a)=>{S(l=>{const s=R(a,l);if(D(s)||s.status.type!=="uploading")return l;const v=Math.round(o.loaded*100/o.total);return s.status.progress===v?l:M(a,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:v}),l)})},onUploadComplete:(o,a)=>{S(l=>{const s=R(o,l);return D(s)||s.status.type!=="uploading"?l:M(s.id,s.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}),l)})}}),addFiles:P,getNextLocalFileId:O,deleteExistingFiles:()=>b.forEach(o=>K(o.id)),onUploadComplete:()=>{m.current&&m.current.focus()}}),{getRootProps:_,getInputProps:X}=Bt({onDrop:st,multiple:I===x.Multiple,accept:Dt(e.fileType),maxSize:A}),lt=()=>{let o=0;const{current:a}=m;if(a){const l=a.placeholder;a.placeholder="",a.style.height="auto",o=a.scrollHeight,a.placeholder=l,a.style.height=""}return o},G=()=>{if(m.current&&m.current.focus(),!B||t)return;const o={data:d,fileUploaderState:it()};i.setChatInputValue(e,o,{fromUi:!0},c),S([]),C(""),W(0)},dt=o=>{const{metaKey:a,ctrlKey:l,shiftKey:s}=o;Mt(o)&&!s&&!l&&!a&&(o.preventDefault(),G())},ct=o=>{const{value:a}=o.target,{maxChars:l}=e;l!==0&&a.length>l||(C(a),W(lt()))};r.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";C(o)}},[e]),r.useLayoutEffect(()=>{if(m.current){const{offsetHeight:o}=m.current;h.current.minHeight=o,h.current.maxHeight=o*ue}},[m]),r.useEffect(()=>{const o=s=>{var v;s.preventDefault(),s.stopPropagation(),!E&&((v=s.dataTransfer)!=null&&v.types.includes("Files"))&&T(!0)},a=s=>{s.preventDefault(),s.stopPropagation(),E&&(s.clientX<=0&&s.clientY<=0||s.clientX>=window.innerWidth&&s.clientY>=window.innerHeight)&&T(!1)},l=s=>{s.preventDefault(),s.stopPropagation(),E&&T(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",l),window.addEventListener("dragleave",a),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",l),window.removeEventListener("dragleave",a)}},[E]),r.useLayoutEffect(()=>{const{minHeight:o}=h.current;rt(z>0&&m.current?Math.abs(z-o)>L:!1)},[z]);const{placeholder:j,maxChars:pt}=e,{maxHeight:Y}=h.current,ut=I!==x.None&&E;return F(tt,{children:[I===x.None?null:n(re,{items:[...b],onDelete:K}),n($t,{className:"stChatInput","data-testid":"stChatInput",ref:g,children:ut?n(pe,{getRootProps:_,getInputProps:X,acceptFile:I,inputHeight:H?`${z+L}px`:p.sizes.minElementHeight}):F(kt,{extended:H,children:[I===x.None?null:n(de,{getRootProps:_,getInputProps:X,acceptFile:I,disabled:t,theme:p}),n(Rt,{inputRef:m,value:d,placeholder:j,onChange:ct,onKeyDown:dt,"aria-label":j,disabled:t,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:H?`${z+L}px`:"auto",maxHeight:Y?`${Y}px`:"none",paddingLeft:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,paddingRight:`calc(${p.iconSizes.xl} + 2 * ${p.spacing.sm} + ${p.spacing.sm})`}}}}),y>p.breakpoints.hideWidgetDetails&&n(Wt,{children:n(Lt,{dirty:B,value:d,maxLength:pt,type:"chat",inForm:!1})}),n(Nt,{children:n(Vt,{onClick:G,disabled:!B||t,extended:H,"data-testid":"stChatInputSubmitButton",children:n(U,{content:at,size:"xl",color:"inherit"})})})]})})]})}const we=r.memo(ge);export{we as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as f,z as T,B as C,j as n,C as y,br as L,aC as S,bz as W,bs as B,ba as w,bJ as R,J as $,bK as E,bL as P}from"./index.
|
1
|
+
import{r as f,z as T,B as C,j as n,C as y,br as L,aC as S,bz as W,bs as B,ba as w,bJ as R,J as $,bK as E,bL as P}from"./index.Ci8MtnNW.js";import{a as v}from"./useBasicWidgetState.jMbeuIfG.js";import{a as X,L as H,S as p}from"./checkbox.CZjCrRM6.js";import"./FormClearHelper.B_xJLRtH.js";function M({element:e,disabled:a,widgetMgr:s,fragmentId:d}){var m;const[x,g]=v({getStateFromWidgetMgr:V,getDefaultStateFromProto:z,getCurrStateFromProto:I,updateWidgetMgrState:j,element:e,widgetMgr:s,fragmentId:d}),k=f.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=T(),{colors:o,spacing:h,sizes:r}=t,b=C(t),u=a?o.fadedText40:o.bodyText;return n(P,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(X,{checked:x,disabled:a,onChange:k,"aria-label":e.label,checkmarkType:e.type===E.StyleType.TOGGLE?p.toggle:p.default,labelPlacement:H.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=b?o.bgColor:o.bodyText;return a&&(c=b?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${t.spacing.twoXS})`,height:`calc(${r.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=o.fadedText40;return c&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?`0 0 0 0.2rem ${$(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:u}}},children:y(R,{visibility:L((m=e.labelVisibility)==null?void 0:m.value),"data-testid":"stWidgetLabel",children:[n(S,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&n(W,{color:u,children:n(B,{content:e.help,placement:w.TOP_RIGHT})})]})})})}function V(e,a){return e.getBoolValue(a)}function z(e){return e.default??null}function I(e){return e.value??null}function j(e,a,s,d){a.setBoolValue(e,s.value,{fromUi:s.fromUi},d)}const A=f.memo(M);export{A as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as s,r as f,R as u,aD as x,b9 as b,z as k,j as a,b6 as C,ba as L,C as v,D as T,aC as h}from"./index.
|
1
|
+
import{n as s,r as f,R as u,aD as x,b9 as b,z as k,j as a,b6 as C,ba as L,C as v,D as T,aC as h}from"./index.Ci8MtnNW.js";const w=s("div",{target:"e12r95n60"})(({containerWidth:r})=>({display:"flex",flexDirection:"column",width:r?"100%":"fit-content"})),S=s("a",{target:"e12r95n61"})(({disabled:r,isCurrentPage:o,containerWidth:l,theme:e})=>({textDecoration:"none",width:l?"100%":"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),y=s("span",{target:"e12r95n62"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function D(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function P(r){const{onPageChange:o,currentPageScriptHash:l}=u.useContext(x),e=u.useContext(b),{colors:c}=k(),{disabled:t,element:n}=r,i=D(n.useContainerWidth,e),d=l===n.pageScriptHash,p=g=>{n.external?t&&g.preventDefault():(g.preventDefault(),t||o(n.pageScriptHash))};return a("div",{className:"stPageLink","data-testid":"stPageLink",children:a(C,{help:n.help,placement:L.TOP_RIGHT,containerWidth:i,children:a(w,{containerWidth:i,children:v(S,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:d,containerWidth:i,href:n.page,target:n.external?"_blank":"",rel:"noreferrer",onClick:p,children:[n.icon&&a(T,{size:"lg",color:t?c.fadedText40:c.bodyText,iconValue:n.icon}),a(y,{disabled:t,children:a(h,{source:n.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}const H=f.memo(P);export{H as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as l,b5 as a,j as e,b6 as d,bp as u,b4 as c,b7 as B,b8 as b}from"./index.
|
1
|
+
import{r as l,b5 as a,j as e,b6 as d,bp as u,b4 as c,b7 as B,b8 as b}from"./index.Ci8MtnNW.js";function m(i){const{disabled:o,element:t,widgetMgr:s,fragmentId:r}=i;let n=a.SECONDARY;return t.type==="primary"?n=a.PRIMARY:t.type==="tertiary"&&(n=a.TERTIARY),e(b,{className:"stButton","data-testid":"stButton",children:e(d,{help:t.help,containerWidth:t.useContainerWidth,children:e(u,{kind:n,size:c.SMALL,disabled:o,containerWidth:t.useContainerWidth,onClick:()=>s.setTriggerValue(t,{fromUi:!0},r),children:e(B,{icon:t.icon,label:t.label})})})})}const h=l.memo(m);export{h as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as p,r as s,z as T,C as x,j as i,D as w,aC as h,aP as r,aQ as v,aR as m,F as k,B as z}from"./index.
|
1
|
+
import{n as p,r as s,z as T,C as x,j as i,D as w,aC as h,aP as r,aQ as v,aR as m,F as k,B as z}from"./index.Ci8MtnNW.js";const R=p("button",{target:"e1rpgzpk0"})(({theme:t})=>({fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base,color:t.colors.fadedText60,backgroundColor:t.colors.transparent,fontFamily:"inherit",margin:t.spacing.none,border:"none",boxShadow:"none",padding:t.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:t.colors.primary}})),C=p("div",{target:"e1rpgzpk1"})(({theme:t})=>({display:"flex",flexDirection:"row",gap:t.spacing.lg,"> span":{marginTop:t.spacing.twoXS}})),L=p("div",{target:"e1rpgzpk3"})(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base,div:{display:"inline-flex"}}));function B(t){const a=z(t);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:t.spacing.md,width:t.sizes.toastWidth,marginTop:t.spacing.sm,borderTopLeftRadius:t.radii.default,borderTopRightRadius:t.radii.default,borderBottomLeftRadius:t.radii.default,borderBottomRightRadius:t.radii.default,paddingTop:t.spacing.lg,paddingBottom:t.spacing.lg,paddingLeft:t.spacing.twoXL,paddingRight:t.spacing.twoXL,backgroundColor:a?t.colors.gray10:t.colors.gray90,color:t.colors.bodyText,boxShadow:a?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:t.colors.fadedText40,width:t.fontSizes.lg,height:t.fontSizes.lg,marginRight:`calc(-1 * ${t.spacing.lg} / 2)`,":hover":{color:t.colors.bodyText}}}}}function E(t){if(t.length>104){let o=t.replace(/^(.{104}[^\s]*).*/,"$1");return o.length>104&&(o=o.substring(0,104).split(" ").slice(0,-1).join(" ")),o.trim()}return t}function D({body:t,icon:a}){const o=T(),n=E(t),d=t!==n,[e,y]=s.useState(!d),[u,b]=s.useState(0),f=s.useCallback(()=>{y(!e)},[e]),c=s.useMemo(()=>B(o),[o]),l=s.useMemo(()=>x(C,{expanded:e,children:[a&&i(w,{iconValue:a,size:"xl",testid:"stToastDynamicIcon"}),x(L,{children:[i(h,{source:e?t:n,allowHTML:!1,isToast:!0}),d&&i(R,{"data-testid":"stToastViewButton",onClick:f,children:e?"view less":"view more"})]})]}),[d,e,t,a,n,f]);s.useEffect(()=>{if(o.inSidebar)return;const g=r.info(l,{overrides:{...c}});return b(g),()=>{r.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),r.clear(g)}},[]),s.useEffect(()=>{r.update(u,{children:l,overrides:{...c}})},[u,l,c]);const S=i(m,{kind:v.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return i(k,{children:o.inSidebar&&S})}const I=s.memo(D);export{I as default};
|