streamlit-nightly 1.46.2.dev20250709__py3-none-any.whl → 1.46.2.dev20250710__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/static/index.html +1 -1
- streamlit/static/manifest.json +218 -218
- streamlit/static/static/js/{ErrorOutline.esm.CQd6KUc-.js → ErrorOutline.esm.DcxmqjUD.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.DViLqD3l.js → FileDownload.esm.jHGWeFoc.js} +1 -1
- streamlit/static/static/js/{FileHelper.C4kAiX-d.js → FileHelper.Zrnryqu0.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.3-U9496x.js → FormClearHelper.BYxFNamA.js} +1 -1
- streamlit/static/static/js/{Hooks.rP-qI29F.js → Hooks.Bf489OB5.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BbLQarVh.js → InputInstructions.BOAAgTvb.js} +1 -1
- streamlit/static/static/js/{ProgressBar.XjFCBQue.js → ProgressBar.CHyAN4g4.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.BjvT0tcH.js → RenderInPortalIfExists.BnEeVRFq.js} +1 -1
- streamlit/static/static/js/{Toolbar.CI7e539m.js → Toolbar.CXl8zpFb.js} +1 -1
- streamlit/static/static/js/{base-input.BwJuQKxC.js → base-input.Df0b6Qry.js} +1 -1
- streamlit/static/static/js/{checkbox.YcCb7In-.js → checkbox._czeraZi.js} +1 -1
- streamlit/static/static/js/{createSuper.fMnDQXwy.js → createSuper.ZqMAxMzx.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DispNmCy.js → data-grid-overlay-editor.Bok03B1i.js} +1 -1
- streamlit/static/static/js/{downloader._vfB-j-e.js → downloader.C4jTgaKc.js} +1 -1
- streamlit/static/static/js/{es6.DIYMfE-r.js → es6.Do-e8HO9.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CXpyzNXN.js → iframeResizer.contentWindow.mWYZgJrl.js} +1 -1
- streamlit/static/static/js/{index.Dga_qPJ0.js → index.-qN84VXE.js} +1 -1
- streamlit/static/static/js/{index.Jr-tvRTy.js → index.35y_AzR4.js} +1 -1
- streamlit/static/static/js/{index.Dgd7wAuk.js → index.B1l9OvXj.js} +1 -1
- streamlit/static/static/js/index.BF_sb0WL.js +73 -0
- streamlit/static/static/js/{index.D958aGV_.js → index.BIEGVO6Q.js} +5 -5
- streamlit/static/static/js/{index.DG9Ir4m4.js → index.BPbIttLy.js} +1 -1
- streamlit/static/static/js/{index.5oEU0Akm.js → index.BVdmv4f9.js} +1 -1
- streamlit/static/static/js/{index.DfriPCJP.js → index.BnBtCCi7.js} +1 -1
- streamlit/static/static/js/{index.BYrFjIUs.js → index.Bys870gz.js} +1 -1
- streamlit/static/static/js/{index.c5gLd5mL.js → index.BzF3lrfB.js} +1 -1
- streamlit/static/static/js/{index.LbtilNNP.js → index.C3rroFP9.js} +1 -1
- streamlit/static/static/js/{index.4cT3qV4n.js → index.CF7mP-ZJ.js} +1 -1
- streamlit/static/static/js/{index.BgUl4InR.js → index.Ca2H30nP.js} +1 -1
- streamlit/static/static/js/{index.B1xRrJhO.js → index.Ci7nbB2g.js} +1 -1
- streamlit/static/static/js/{index.E56AjTPB.js → index.CjIM7ERG.js} +1 -1
- streamlit/static/static/js/{index.DQXpaPor.js → index.CoYJofEx.js} +1 -1
- streamlit/static/static/js/{index.CQayRGxD.js → index.CqLB334S.js} +1 -1
- streamlit/static/static/js/{index.D2-Y5_wx.js → index.DFXciakO.js} +1 -1
- streamlit/static/static/js/{index.D8bLiwaV.js → index.DGHrEEt1.js} +1 -1
- streamlit/static/static/js/{index.Cx24fujh.js → index.DHdGt5Y8.js} +1 -1
- streamlit/static/static/js/{index.atasR7_f.js → index.DLiM-whD.js} +1 -1
- streamlit/static/static/js/{index.ColMLoRT.js → index.DTxuG-7x.js} +1 -1
- streamlit/static/static/js/{index.BIU1Hwtm.js → index.D_0R5OBc.js} +3 -3
- streamlit/static/static/js/{index.Dy7h795S.js → index.DcO57awd.js} +1 -1
- streamlit/static/static/js/{index.BNjHNjlf.js → index.DmGoE186.js} +1 -1
- streamlit/static/static/js/{index.BqJEh5EN.js → index.DmjIEMLZ.js} +1 -1
- streamlit/static/static/js/{index.BQVB466_.js → index.DsGIFS7a.js} +1 -1
- streamlit/static/static/js/{index.Cfv4QyQX.js → index.GgXBejJs.js} +1 -1
- streamlit/static/static/js/{index.BdEa6sZz.js → index.MiKM7bk8.js} +1 -1
- streamlit/static/static/js/{index.D1VFO1GM.js → index.QaE_KRXJ.js} +1 -1
- streamlit/static/static/js/{index.Chkl1asR.js → index.dGEV5Rcv.js} +1 -1
- streamlit/static/static/js/{index.D9GxqhKH.js → index.eyf91ITY.js} +1 -1
- streamlit/static/static/js/{index.BJLFstQK.js → index.fAtLaEj3.js} +1 -1
- streamlit/static/static/js/{index.D4qwHqKM.js → index.kBQMwU6d.js} +1 -1
- streamlit/static/static/js/{index.Bo8tNSYW.js → index.mvbBbK3q.js} +1 -1
- streamlit/static/static/js/{index.Bqhfg7Oa.js → index.rOGHN7Ug.js} +1 -1
- streamlit/static/static/js/{index.BIsGWvbq.js → index.rvtw60Rz.js} +1 -1
- streamlit/static/static/js/{input.Dudaq2DP.js → input.CbSNLKWI.js} +1 -1
- streamlit/static/static/js/{memory.DIuUp1Sn.js → memory.jXCvhbgc.js} +1 -1
- streamlit/static/static/js/{mergeWith.D9D0WgL_.js → mergeWith.DrPpfkW2.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DUBtvgiU.js → number-overlay-editor.DcUxabQJ.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.ql9j_wzC.js → possibleConstructorReturn.CzPR4xGM.js} +1 -1
- streamlit/static/static/js/{sandbox.D_vlGgEg.js → sandbox.Bd0m3BOh.js} +1 -1
- streamlit/static/static/js/{timepicker.DtFPFwb0.js → timepicker.CpLBXuBk.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DMsseOni.js → toConsumableArray.D_piEkI9.js} +1 -1
- streamlit/static/static/js/{uniqueId.BkUMU8CT.js → uniqueId.wDqRFq8o.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Cp78gjjh.js → useBasicWidgetState.rpbnEZqG.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CHkjh73V.js → useOnInputChange.DLCh37tX.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.CE_GiZ0L.js → useTextInputAutoExpand.Ba7vlWvW.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.CplO1PK6.js → withFullScreenWrapper.Cqo3BmOl.js} +1 -1
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/RECORD +74 -74
- streamlit/static/static/js/index.CUirymUQ.js +0 -73
- {streamlit_nightly-1.46.2.dev20250709.data → streamlit_nightly-1.46.2.dev20250710.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{s as p,r as s,z as S,C as y,j as i,D as v,aG as w,aT as r,F as h,B as m,aU as L,aV as R}from"./index.
|
1
|
+
import{s as p,r as s,z as S,C as y,j as i,D as v,aG as w,aT as r,F as h,B as m,aU as L,aV as R}from"./index.D_0R5OBc.js";const B=p("button",{target:"ee3yv4c0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),C=p("div",{target:"ee3yv4c1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),k=p("div",{target:"ee3yv4c2"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function z(o){const a=m(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:a?o.colors.gray10:o.colors.gray90,color:o.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:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function E(o){if(o.length>104){let t=o.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return o}function D({body:o,icon:a}){const t=S(),n=E(o),d=o!==n,[e,x]=s.useState(!d),[u,b]=s.useState(0),f=s.useCallback(()=>{x(!e)},[e]),c=s.useMemo(()=>z(t),[t]),l=s.useMemo(()=>y(C,{expanded:e,children:[a&&i(v,{iconValue:a,size:"xl",testid:"stToastDynamicIcon"}),y(k,{children:[i(w,{source:e?o:n,allowHTML:!1,isToast:!0}),d&&i(B,{"data-testid":"stToastViewButton",onClick:f,children:e?"view less":"view more"})]})]}),[d,e,o,a,n,f]);s.useEffect(()=>{if(t.inSidebar)return;const g=r.info(l,{overrides:{...c}});return b(g),()=>{r.update(g,{overrides:{Body:{style:{display:"none"}}}}),r.clear(g)}},[]),s.useEffect(()=>{r.update(u,{children:l,overrides:{...c}})},[u,l,c]);const T=i(R,{kind:L.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(h,{children:t.inSidebar&&T})}const I=s.memo(D);export{I as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as l,j as n,br as c,bR as g}from"./index.
|
1
|
+
import{r as l,j as n,br as c,bR as g}from"./index.D_0R5OBc.js";import{a as b}from"./useBasicWidgetState.rpbnEZqG.js";import"./FormClearHelper.BYxFNamA.js";const m=(t,e)=>t.getStringValue(e),f=t=>t.default??null,p=t=>t.value??null,C=(t,e,r,o)=>{e.setStringValue(t,r.value,{fromUi:r.fromUi},o)},d=({element:t,disabled:e,widgetMgr:r,fragmentId:o})=>{const[i,a]=b({getStateFromWidgetMgr:m,getDefaultStateFromProto:f,getCurrStateFromProto:p,updateWidgetMgrState:C,element:t,widgetMgr:r,fragmentId:o}),s=l.useCallback(u=>{a({value:u,fromUi:!0})},[a]);return n(g,{label:t.label,labelVisibility:c(t.labelVisibility?.value),help:t.help,onChange:s,disabled:e,value:i})},h=l.memo(d);export{h as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{s as a,r as t,O as i,j as d,b0 as c,b1 as e,M as l}from"./index.
|
1
|
+
import{s as a,r as t,O as i,j as d,b0 as c,b1 as e,M as l}from"./index.D_0R5OBc.js";const g=a("iframe",{target:"e3tg43n0"})(({theme:o,disableScrolling:r})=>({width:"100%",colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:r?"hidden":void 0}));function s(o){return l(o)||o===""?void 0:o}function I({element:o}){const r=s(o.src),n=i(r)?void 0:s(o.srcdoc);return d(g,{className:"stIFrame","data-testid":"stIFrame",allow:e,disableScrolling:!o.scrolling,src:r,srcDoc:n,height:o.height,scrolling:o.scrolling?"auto":"no",sandbox:c,title:"st.iframe",tabIndex:o.tabIndex??void 0})}const m=t.memo(I);export{m as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{s as c,r as s,aI as f,b8 as b,z as x,j as a,b5 as k,b9 as C,C as L,D as v,aG as h}from"./index.
|
1
|
+
import{s as c,r as s,aI as f,b8 as b,z as x,j as a,b5 as k,b9 as C,C as L,D as v,aG as h}from"./index.D_0R5OBc.js";const T=c("div",{target:"e1ghu24d0"})(({containerWidth:r})=>({display:"flex",flexDirection:"column",width:r?"100%":"fit-content"})),w=c("a",{target:"e1ghu24d1"})(({disabled:r,isCurrentPage:e,containerWidth:i,theme:o})=>({textDecoration:"none",width:i?"100%":"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:o.spacing.sm,borderRadius:o.radii.button,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,marginTop:o.spacing.threeXS,marginBottom:o.spacing.threeXS,lineHeight:o.lineHeights.menuItem,backgroundColor:e?o.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:e?o.colors.darkenedBgMix25:o.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"@media print":{paddingLeft:o.spacing.none},...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed","&:hover":{color:o.colors.fadedText40,backgroundColor:o.colors.transparent}}:{}})),y=c("span",{target:"e1ghu24d2"})(({disabled:r,theme:e})=>({color:e.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"}:{}}));function S(r,e){return r===null&&e?!0:r===null&&!e?!1:r===!0}function P(r){const{onPageChange:e,currentPageScriptHash:i}=s.useContext(f),o=s.useContext(b),{colors:d}=x(),{disabled:t,element:n}=r,l=S(n.useContainerWidth,o),g=i===n.pageScriptHash,p=u=>{n.external?t&&u.preventDefault():(u.preventDefault(),t||e(n.pageScriptHash))};return a("div",{className:"stPageLink","data-testid":"stPageLink",children:a(k,{help:n.help,placement:C.TOP_RIGHT,containerWidth:l,children:a(T,{containerWidth:l,children:L(w,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:g,containerWidth:l,href:n.page,target:n.external?"_blank":"",rel:"noreferrer",onClick:p,children:[n.icon&&a(v,{size:"lg",color:t?d.fadedText40:d.bodyText,iconValue:n.icon}),a(y,{disabled:t,children:a(h,{source:n.label,allowHTML:!1,isLabel:!0,boldLabel:g,largerLabel:!0,disableLinks:!0})})]})})})})}const B=s.memo(P);export{B as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{s as w,br as T,ct as O,r as s,aP as _,z as q,cu as H,C as G,j as u,bH as K,bs as $,b9 as N,bt as J}from"./index.
|
1
|
+
import{s as w,br as T,ct as O,r as s,aP as _,z as q,cu as H,C as G,j as u,bH as K,bs as $,b9 as N,bt as J}from"./index.D_0R5OBc.js";import{u as M}from"./uniqueId.wDqRFq8o.js";import{u as Q,a as X,b as Y}from"./useOnInputChange.DLCh37tX.js";import{I as Z}from"./InputInstructions.BOAAgTvb.js";import{a as tt}from"./useBasicWidgetState.rpbnEZqG.js";import{u as et,T as it}from"./useTextInputAutoExpand.Ba7vlWvW.js";import"./inputUtils.CptNuJwn.js";import"./FormClearHelper.BYxFNamA.js";import"./base-input.Df0b6Qry.js";const at=w("div",{target:"e1r0q00f0"})({height:"100%",display:"flex",flexDirection:"column"}),st=(e,t)=>{let a="auto";if(e.heightConfig?.useStretch)a="100%";else if(e.heightConfig?.pixelHeight&&e.heightConfig.pixelHeight>0){const o=T(t.labelVisibility?.value)===O.Collapsed?2:30;a=`${e.heightConfig.pixelHeight-o}px`}return a},S=(e,t)=>e.getStringValue(t)??t.default??null,ot=e=>e.default??null,rt=e=>e.value??null,lt=(e,t,a,o)=>{t.setStringValue(e,a.value,{fromUi:a.fromUi},o)},nt=({disabled:e,element:t,widgetMgr:a,fragmentId:o,outerElement:d})=>{const m=s.useRef(M("text_area_")).current,[W,y]=_(),[r,c]=s.useState(!1),[I,b]=s.useState(!1),l=d.heightConfig?.useContent??!1,V=d.heightConfig?.useStretch??!1,v=st(d,t),x=s.useRef(null),[n,h]=s.useState(()=>S(a,t)??null),A=s.useCallback(()=>{h(t.default??null),c(!0)},[t]),[F,g]=tt({getStateFromWidgetMgr:S,getDefaultStateFromProto:ot,getCurrStateFromProto:rt,updateWidgetMgrState:lt,element:t,widgetMgr:a,fragmentId:o,onFormCleared:A});Q(F,n,h,r);const i=q(),{height:R,maxHeight:z,updateScrollHeight:C}=et({textareaRef:x,dependencies:[t.placeholder]}),p=s.useCallback(()=>{c(!1),g({value:n,fromUi:!0})},[n,g]),P=s.useCallback(()=>{r&&p(),b(!1)},[r,p]),k=s.useCallback(()=>{b(!0)},[]),E=s.useCallback(()=>{l&&C()},[l,C]),L=X({formId:t.formId,maxChars:t.maxChars,setDirty:c,setUiValue:h,setValueWithSource:g,additionalAction:E}),U=Y(t.formId,p,r,a,o,!0),{placeholder:D,formId:f}=t,B=H({formId:f})?a.allowFormEnterToSubmit(f):r,j=I&&W>i.breakpoints.hideWidgetDetails;return G(at,{className:"stTextArea","data-testid":"stTextArea",ref:y,children:[u(J,{label:t.label,disabled:e,labelVisibility:T(t.labelVisibility?.value),htmlFor:m,children:t.help&&u(K,{children:u($,{content:t.help,placement:N.TOP_RIGHT})})}),u(it,{inputRef:l?x:void 0,value:n??"",placeholder:D,onBlur:P,onFocus:k,onChange:L,onKeyDown:U,"aria-label":t.label,disabled:e,id:m,overrides:{Input:{style:{fontWeight:i.fontWeights.normal,lineHeight:i.lineHeights.inputWidget,height:l?R:v,maxHeight:l?z:"",minHeight:i.sizes.largestElementHeight,resize:V?"none":"vertical",paddingRight:i.spacing.md,paddingLeft:i.spacing.md,paddingBottom:i.spacing.md,paddingTop:i.spacing.md,"::placeholder":{color:i.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,flexGrow:1}}}}),j&&u(Z,{dirty:r,value:n??"",maxLength:t.maxChars,type:"multiline",inForm:H({formId:f}),allowEnterToSubmit:B})]})},xt=s.memo(nt);export{xt as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{s as W,r,z as C,b8 as I,c3 as V,c4 as H,c5 as O,C as $,j as n,br as L,bH as P,bs as k,b9 as B,bt as E,c2 as F,c6 as N,b_ as D,c7 as A,bD as U}from"./index.
|
1
|
+
import{s as W,r,z as C,b8 as I,c3 as V,c4 as H,c5 as O,C as $,j as n,br as L,bH as P,bs as k,b9 as B,bt as E,c2 as F,c6 as N,b_ as D,c7 as A,bD as U}from"./index.D_0R5OBc.js";import{a as j}from"./useBasicWidgetState.rpbnEZqG.js";import"./FormClearHelper.BYxFNamA.js";const G=W("div",{target:"euzcfsp0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),K=(s,t)=>s.getStringArrayValue(t),Y=s=>s.default.map(t=>s.options[t])??null,_=s=>s.rawValues??null,X=(s,t,a,c)=>{t.setStringArrayValue(s,a.value,{fromUi:a.fromUi},c)},q=s=>{const{element:t,widgetMgr:a,fragmentId:c}=s,e=C(),h=r.useContext(I),[i,p]=j({getStateFromWidgetMgr:K,getDefaultStateFromProto:Y,getCurrStateFromProto:_,updateWidgetMgrState:X,element:t,widgetMgr:a,fragmentId:c}),g=t.maxSelections>0&&i.length>=t.maxSelections,b=r.useMemo(()=>{if(t.maxSelections===0)return"No results";if(i.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,i.length]),S=r.useMemo(()=>i.map(o=>({value:o,label:o})),[i]),m=r.useCallback(o=>{switch(o.type){case"remove":return V(i,o.option?.value);case"clear":return[];case"select":return i.concat([o.option?.value]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[i]),f=r.useCallback(o=>{t.maxSelections&&o.type==="select"&&i.length>=t.maxSelections||p({value:m(o),fromUi:!0})},[t.maxSelections,m,p,i.length]),y=r.useCallback((o,l)=>{if(g)return[];const R=o.filter(T=>!i.includes(T.value));return H(R,l)},[g,i]),{options:d}=t,{placeholder:x,shouldDisable:v}=O(t.placeholder,d,t.acceptNewOptions??!1,!0),u=s.disabled||v,z=d.map((o,l)=>({label:o,value:o,id:`${o}_${l}`})),w=d.length>10,M=r.useMemo(()=>{const o=e.fontSizes.baseFontSize*1.6+14;return`${Math.round(o*4.25)}px`},[e.fontSizes.baseFontSize]);return $("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[n(E,{label:t.label,disabled:u,labelVisibility:L(t.labelVisibility?.value),children:t.help&&n(P,{children:n(k,{content:t.help,placement:B.TOP_RIGHT})})}),n(G,{children:n(F,{creatable:t.acceptNewOptions??!1,options:z,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:x,type:A.select,multi:!0,onChange:f,value:S,disabled:u,size:"compact",noResultsMsg:b,filterOptions:y,closeOnSelect:!1,ignoreCase:!1,overrides:{Popover:{props:{ignoreBoundary:h,overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:D,props:{style:{cursor:"pointer"},overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{maxHeight:M,minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",color:u?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{style:()=>({overflowY:"auto",paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{fontWeight:e.fontWeights.normal,borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:U()&&w===!1?"readonly":null}},Dropdown:{component:N}}})})]})},ee=r.memo(q);export{ee as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as p,z as k,B as T,j as n,C,br as y,aG as L,bz as S,bs as W,b9 as B,bL as w,J as R,bM as E,bN as $}from"./index.
|
1
|
+
import{r as p,z as k,B as T,j as n,C,br as y,aG as L,bz as S,bs as W,b9 as B,bL as w,J as R,bM as E,bN as $}from"./index.D_0R5OBc.js";import{a as P}from"./useBasicWidgetState.rpbnEZqG.js";import{a as v,L as M,S as m}from"./checkbox._czeraZi.js";import"./FormClearHelper.BYxFNamA.js";function X({element:e,disabled:a,widgetMgr:s,fragmentId:d}){const[f,g]=P({getStateFromWidgetMgr:H,getDefaultStateFromProto:V,getCurrStateFromProto:z,updateWidgetMgrState:G,element:e,widgetMgr:s,fragmentId:d}),x=p.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=k(),{colors:o,spacing:h,sizes:r}=t,b=T(t),u=a?o.fadedText40:o.bodyText;return n($,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(v,{checked:f,disabled:a,onChange:x,"aria-label":e.label,checkmarkType:e.type===E.StyleType.TOGGLE?m.toggle:m.default,labelPlacement:M.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 ${R(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:C(w,{visibility:y(e.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[n(L,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&n(S,{color:u,children:n(W,{content:e.help,placement:B.TOP_RIGHT})})]})})})}function H(e,a){return e.getBoolValue(a)}function V(e){return e.default??null}function z(e){return e.value??null}function G(e,a,s,d){a.setBoolValue(e,s.value,{fromUi:s.fromUi},d)}const U=p.memo(X);export{U as default};
|