streamlit-nightly 1.45.2.dev20250515__py3-none-any.whl → 1.45.2.dev20250517__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.
Files changed (73) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/static/js/{ErrorOutline.esm.DZL6W-d3.js → ErrorOutline.esm.NoyWdcXX.js} +1 -1
  3. streamlit/static/static/js/{FileDownload.esm.BTdAw4zC.js → FileDownload.esm.swCXF6kF.js} +1 -1
  4. streamlit/static/static/js/{FileHelper.Beb1sf3m.js → FileHelper.Dx5K4a9E.js} +1 -1
  5. streamlit/static/static/js/{FormClearHelper.BJursVXh.js → FormClearHelper.BOuxElPh.js} +1 -1
  6. streamlit/static/static/js/{Hooks.C9-XVXXu.js → Hooks.C-dTwIN4.js} +1 -1
  7. streamlit/static/static/js/{InputInstructions.DFH2wY93.js → InputInstructions.DGm-30R7.js} +1 -1
  8. streamlit/static/static/js/{ProgressBar.6M24tsRk.js → ProgressBar.BhDlWZOq.js} +1 -1
  9. streamlit/static/static/js/{RenderInPortalIfExists.BjKKk4eZ.js → RenderInPortalIfExists.B1fTBW4u.js} +1 -1
  10. streamlit/static/static/js/{Toolbar.AcZDbsfk.js → Toolbar.BFnK5L1F.js} +1 -1
  11. streamlit/static/static/js/{base-input.DbRAJnqp.js → base-input.-TX15L8w.js} +1 -1
  12. streamlit/static/static/js/{checkbox.0qSLqyAl.js → checkbox.DTBzWBar.js} +1 -1
  13. streamlit/static/static/js/{createSuper.BVzb0XXY.js → createSuper.CYbmN691.js} +1 -1
  14. streamlit/static/static/js/{data-grid-overlay-editor.veQYOXpb.js → data-grid-overlay-editor.B7iyFRkb.js} +1 -1
  15. streamlit/static/static/js/{downloader.C_vYtX1r.js → downloader.0M4t3MS8.js} +1 -1
  16. streamlit/static/static/js/{es6.DlS5aK2H.js → es6.CnBJxoS-.js} +2 -2
  17. streamlit/static/static/js/{iframeResizer.contentWindow.DYLRAnnn.js → iframeResizer.contentWindow.B1Cm-yCx.js} +1 -1
  18. streamlit/static/static/js/{index.ChCdyltc.js → index.-CAfcaTJ.js} +1 -1
  19. streamlit/static/static/js/{index.CsMycx_g.js → index.B-w5NlhA.js} +1 -1
  20. streamlit/static/static/js/{index.BNNdZZ73.js → index.B15kcUzJ.js} +1 -1
  21. streamlit/static/static/js/{index.DgKQMQQ-.js → index.B6FtB0_2.js} +1 -1
  22. streamlit/static/static/js/{index.B7lVUFiI.js → index.B9RXX8pn.js} +1 -1
  23. streamlit/static/static/js/{index.DI4lQWQ9.js → index.BH6BVmJz.js} +1 -1
  24. streamlit/static/static/js/{index.C8AfWtJ-.js → index.BHpD_hOw.js} +1 -1
  25. streamlit/static/static/js/{index.KEBclOiy.js → index.BNVMahIE.js} +1 -1
  26. streamlit/static/static/js/{index.DOZrTqtO.js → index.BTKNtQ5e.js} +1 -1
  27. streamlit/static/static/js/{index.7-HGyLk8.js → index.BaXjHhfo.js} +1 -1
  28. streamlit/static/static/js/{index.bbxNeuVP.js → index.Bcq_Dqng.js} +1 -1
  29. streamlit/static/static/js/{index.D_NeaxbH.js → index.BpDSKaO3.js} +1 -1
  30. streamlit/static/static/js/{index.D6vjCnF6.js → index.C-JknFAL.js} +1 -1
  31. streamlit/static/static/js/{index.Dx0WWCBs.js → index.C5dNjck1.js} +5 -5
  32. streamlit/static/static/js/{index.CqJn4aNa.js → index.CEWd5P5L.js} +1 -1
  33. streamlit/static/static/js/{index.CzjlNese.js → index.CZFbePOv.js} +1 -1
  34. streamlit/static/static/js/{index.CpBBbkiT.js → index.C_JbdxeV.js} +1 -1
  35. streamlit/static/static/js/{index.vXLfHXtB.js → index.CfBT3VZM.js} +1 -1
  36. streamlit/static/static/js/{index.COQpmMRs.js → index.CmTFJnyq.js} +1 -1
  37. streamlit/static/static/js/{index.CVpOBIPc.js → index.Cn2Htof5.js} +1 -1
  38. streamlit/static/static/js/{index.DQoQce-F.js → index.CvIS8mbe.js} +6 -6
  39. streamlit/static/static/js/{index.CdJve-c-.js → index.D1sNm3Y-.js} +1 -1
  40. streamlit/static/static/js/{index.B4jkkFu1.js → index.D46OlHvo.js} +1 -1
  41. streamlit/static/static/js/{index.BA7OvX6X.js → index.DF-_4n5K.js} +1 -1
  42. streamlit/static/static/js/{index.DawYHwts.js → index.DFqEbTqh.js} +1 -1
  43. streamlit/static/static/js/{index.CZ_7kbSY.js → index.DK6vs4Di.js} +1 -1
  44. streamlit/static/static/js/{index.C-SVYz-x.js → index.DOMm5x54.js} +1 -1
  45. streamlit/static/static/js/{index.CEN6fgTl.js → index.DTuHVhBz.js} +1 -1
  46. streamlit/static/static/js/{index.pKO-QKd7.js → index.DZYh8f7_.js} +1 -1
  47. streamlit/static/static/js/{index.SG-0kuQk.js → index.DajYErBx.js} +1 -1
  48. streamlit/static/static/js/{index.Bs42fx1x.js → index.DiqYkNBc.js} +1 -1
  49. streamlit/static/static/js/{index.CnuHgtvi.js → index.DyD4Uz_R.js} +1 -1
  50. streamlit/static/static/js/{index.TZA6glxs.js → index.DzFtbI0B.js} +1 -1
  51. streamlit/static/static/js/{index.DvaGxMeZ.js → index.K58oz6IJ.js} +1 -1
  52. streamlit/static/static/js/{index.qHLLYZv1.js → index.oE_T3Dq1.js} +1 -1
  53. streamlit/static/static/js/{index.Dh9pGVkc.js → index.rQxcH6vP.js} +1 -1
  54. streamlit/static/static/js/{index.DU1Hm4Vy.js → index.v-rD-Hng.js} +1 -1
  55. streamlit/static/static/js/{input.4UlvIkvl.js → input.qzQht_jN.js} +1 -1
  56. streamlit/static/static/js/{memory.CjAKg4CS.js → memory.CyBxDLiR.js} +1 -1
  57. streamlit/static/static/js/{mergeWith.Bnn9a11J.js → mergeWith.DmD-T2-i.js} +1 -1
  58. streamlit/static/static/js/{number-overlay-editor.BGyA8GbD.js → number-overlay-editor.Dt5fG9N0.js} +1 -1
  59. streamlit/static/static/js/{possibleConstructorReturn.Cu-FTKlF.js → possibleConstructorReturn.CRudR7k5.js} +1 -1
  60. streamlit/static/static/js/{sandbox.D4Wf-7jE.js → sandbox.CHQGgKVf.js} +1 -1
  61. streamlit/static/static/js/{textarea.B0_fGlpz.js → textarea.CH313Ypj.js} +1 -1
  62. streamlit/static/static/js/{timepicker._IYyhmJr.js → timepicker.BhjK2nDc.js} +1 -1
  63. streamlit/static/static/js/{toConsumableArray.BRgjiMf8.js → toConsumableArray.3iVpQ6Sl.js} +1 -1
  64. streamlit/static/static/js/{uniqueId.DWtxcoYp.js → uniqueId.DHpRy8Eo.js} +1 -1
  65. streamlit/static/static/js/{useBasicWidgetState.CJa4vrfr.js → useBasicWidgetState.ChmMQiYn.js} +1 -1
  66. streamlit/static/static/js/{useOnInputChange.DXDP3ow3.js → useOnInputChange.yXh9wSmS.js} +1 -1
  67. streamlit/static/static/js/{withFullScreenWrapper.BYUNeZvy.js → withFullScreenWrapper.Bv9KCRY5.js} +1 -1
  68. {streamlit_nightly-1.45.2.dev20250515.dist-info → streamlit_nightly-1.45.2.dev20250517.dist-info}/METADATA +1 -1
  69. {streamlit_nightly-1.45.2.dev20250515.dist-info → streamlit_nightly-1.45.2.dev20250517.dist-info}/RECORD +73 -73
  70. {streamlit_nightly-1.45.2.dev20250515.data → streamlit_nightly-1.45.2.dev20250517.data}/scripts/streamlit.cmd +0 -0
  71. {streamlit_nightly-1.45.2.dev20250515.dist-info → streamlit_nightly-1.45.2.dev20250517.dist-info}/WHEEL +0 -0
  72. {streamlit_nightly-1.45.2.dev20250515.dist-info → streamlit_nightly-1.45.2.dev20250517.dist-info}/entry_points.txt +0 -0
  73. {streamlit_nightly-1.45.2.dev20250515.dist-info → streamlit_nightly-1.45.2.dev20250517.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{n as k,r as s,bd as H,z as B,cp as W,C as j,j as r,bo as q,bC as O,bp as _,b5 as w,bq as K,D as $,cq as A}from"./index.DQoQce-F.js";import{u as G}from"./uniqueId.DWtxcoYp.js";import{u as N,a as J,b as M}from"./useOnInputChange.DXDP3ow3.js";import{a as Q}from"./useBasicWidgetState.CJa4vrfr.js";import{I as X}from"./InputInstructions.DFH2wY93.js";import{I as Y}from"./input.4UlvIkvl.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.BJursVXh.js";import"./base-input.DbRAJnqp.js";const Z=k("div",{target:"e1o1zy6o0"})("position:relative;");function tt({disabled:a,element:t,widgetMgr:o,fragmentId:d}){var I;const[l,c]=s.useState(()=>y(o,t)??null),[T,x]=H(),[i,p]=s.useState(!1),C=s.useCallback(()=>{c(t.default??null),p(!0)},[t.default]),[V,m]=Q({getStateFromWidgetMgr:y,getDefaultStateFromProto:et,getCurrStateFromProto:at,updateWidgetMgrState:st,element:t,widgetMgr:o,fragmentId:d,onFormCleared:C});N(V,l,c,i);const[F,g]=s.useState(!1),e=B(),[b]=s.useState(()=>G("text_input_")),{placeholder:z,formId:u,icon:n,maxChars:f}=t,h=s.useCallback(()=>{p(!1),m({value:l,fromUi:!0})},[l,m]),v=W({formId:u})?o.allowFormEnterToSubmit(u):i,E=F&&T>e.breakpoints.hideWidgetDetails,R=s.useCallback(()=>{i&&h(),g(!1)},[i,h]),L=s.useCallback(()=>{g(!0)},[]),P=J({formId:u,maxChars:f,setDirty:p,setUiValue:c,setValueWithSource:m}),D=M(u,h,i,o,d),S=n==null?void 0:n.startsWith(":material"),U=S?"lg":"base";return j(Z,{className:"stTextInput","data-testid":"stTextInput",ref:x,children:[r(K,{label:t.label,disabled:a,labelVisibility:q((I=t.labelVisibility)==null?void 0:I.value),htmlFor:b,children:t.help&&r(O,{children:r(_,{content:t.help,placement:w.TOP_RIGHT})})}),r(Y,{value:l??"",placeholder:z,onBlur:R,onFocus:L,onChange:P,onKeyPress:D,"aria-label":t.label,disabled:a,id:b,type:ot(t),autoComplete:t.autocomplete,startEnhancer:n&&r($,{"data-testid":"stTextInputIcon",iconValue:n,size:U}),overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:e.spacing.md,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,paddingLeft:n?e.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:e.iconSizes.lg,color:S?e.colors.fadedText60:"inherit"}}}}),E&&r(X,{dirty:i,value:l??"",maxLength:f,inForm:W({formId:u}),allowEnterToSubmit:v})]})}function y(a,t){return a.getStringValue(t)??null}function et(a){return a.default??null}function at(a){return a.value??null}function st(a,t,o,d){t.setStringValue(a,o.value,{fromUi:o.fromUi},d)}function ot(a){return a.type===A.Type.PASSWORD?"password":"text"}const ht=s.memo(tt);export{ht as default};
1
+ import{n as k,r as s,bd as H,z as B,cp as W,C as j,j as r,bo as q,bC as O,bp as _,b5 as w,bq as K,D as $,cq as A}from"./index.CvIS8mbe.js";import{u as G}from"./uniqueId.DHpRy8Eo.js";import{u as N,a as J,b as M}from"./useOnInputChange.yXh9wSmS.js";import{a as Q}from"./useBasicWidgetState.ChmMQiYn.js";import{I as X}from"./InputInstructions.DGm-30R7.js";import{I as Y}from"./input.qzQht_jN.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.BOuxElPh.js";import"./base-input.-TX15L8w.js";const Z=k("div",{target:"e1o1zy6o0"})("position:relative;");function tt({disabled:a,element:t,widgetMgr:o,fragmentId:d}){var I;const[l,c]=s.useState(()=>y(o,t)??null),[T,x]=H(),[i,p]=s.useState(!1),C=s.useCallback(()=>{c(t.default??null),p(!0)},[t.default]),[V,m]=Q({getStateFromWidgetMgr:y,getDefaultStateFromProto:et,getCurrStateFromProto:at,updateWidgetMgrState:st,element:t,widgetMgr:o,fragmentId:d,onFormCleared:C});N(V,l,c,i);const[F,g]=s.useState(!1),e=B(),[b]=s.useState(()=>G("text_input_")),{placeholder:z,formId:u,icon:n,maxChars:f}=t,h=s.useCallback(()=>{p(!1),m({value:l,fromUi:!0})},[l,m]),v=W({formId:u})?o.allowFormEnterToSubmit(u):i,E=F&&T>e.breakpoints.hideWidgetDetails,R=s.useCallback(()=>{i&&h(),g(!1)},[i,h]),L=s.useCallback(()=>{g(!0)},[]),P=J({formId:u,maxChars:f,setDirty:p,setUiValue:c,setValueWithSource:m}),D=M(u,h,i,o,d),S=n==null?void 0:n.startsWith(":material"),U=S?"lg":"base";return j(Z,{className:"stTextInput","data-testid":"stTextInput",ref:x,children:[r(K,{label:t.label,disabled:a,labelVisibility:q((I=t.labelVisibility)==null?void 0:I.value),htmlFor:b,children:t.help&&r(O,{children:r(_,{content:t.help,placement:w.TOP_RIGHT})})}),r(Y,{value:l??"",placeholder:z,onBlur:R,onFocus:L,onChange:P,onKeyPress:D,"aria-label":t.label,disabled:a,id:b,type:ot(t),autoComplete:t.autocomplete,startEnhancer:n&&r($,{"data-testid":"stTextInputIcon",iconValue:n,size:U}),overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:e.spacing.md,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,paddingLeft:n?e.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:e.iconSizes.lg,color:S?e.colors.fadedText60:"inherit"}}}}),E&&r(X,{dirty:i,value:l??"",maxLength:f,inForm:W({formId:u}),allowEnterToSubmit:v})]})}function y(a,t){return a.getStringValue(t)??null}function et(a){return a.default??null}function at(a){return a.value??null}function st(a,t,o,d){t.setStringValue(a,o.value,{fromUi:o.fromUi},d)}function ot(a){return a.type===A.Type.PASSWORD?"password":"text"}const ht=s.memo(tt);export{ht as default};
@@ -1 +1 @@
1
- import{n as o,bj as S,i as f,r as l,j as r,C as g,c2 as u,aC as $}from"./index.DQoQce-F.js";const m=o(S,{shouldForwardProp:f,target:"e12gfcky0"})(({theme:e})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:e.colors.secondary,flexGrow:0,flexShrink:0})),x=o("div",{target:"e12gfcky1"})(({theme:e,cache:s})=>({...s?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),y=o("div",{target:"e12gfcky2"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),T=o("div",{target:"e12gfcky3"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"})),h=e=>{const s=Math.floor(e/3600),n=Math.floor(e%3600/60),t=e%60;if(s===0&&n===0)return`(${t.toFixed(1)} seconds)`;if(s===0){const d=`${n} minute${n===1?"":"s"}`,p=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${d}${p})`}const i=`${s} hour${s===1?"":"s"}`,a=n===0?"":`, ${n} minute${n===1?"":"s"}`,c=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${i}${a}${c})`};function C({element:e}){const{cache:s,showTime:n}=e,[t,i]=l.useState(0);return l.useEffect(()=>{if(!n)return;const a=setInterval(()=>{i(c=>c+.1)},100);return()=>clearInterval(a)},[n]),r(x,{className:u({stSpinner:!0,stCacheSpinner:s}),"data-testid":"stSpinner",cache:s,children:g(T,{children:[r(m,{}),r($,{source:e.text,allowHTML:!1}),n&&r(y,{children:h(t)})]})})}const z=l.memo(C);export{z as default};
1
+ import{n as o,bj as S,i as f,r as l,j as r,C as g,c2 as u,aC as $}from"./index.CvIS8mbe.js";const m=o(S,{shouldForwardProp:f,target:"e12gfcky0"})(({theme:e})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:e.colors.secondary,flexGrow:0,flexShrink:0})),x=o("div",{target:"e12gfcky1"})(({theme:e,cache:s})=>({...s?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),y=o("div",{target:"e12gfcky2"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),T=o("div",{target:"e12gfcky3"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"})),h=e=>{const s=Math.floor(e/3600),n=Math.floor(e%3600/60),t=e%60;if(s===0&&n===0)return`(${t.toFixed(1)} seconds)`;if(s===0){const d=`${n} minute${n===1?"":"s"}`,p=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${d}${p})`}const i=`${s} hour${s===1?"":"s"}`,a=n===0?"":`, ${n} minute${n===1?"":"s"}`,c=t===0?"":`, ${t.toFixed(1)} seconds`;return`(${i}${a}${c})`};function C({element:e}){const{cache:s,showTime:n}=e,[t,i]=l.useState(0);return l.useEffect(()=>{if(!n)return;const a=setInterval(()=>{i(c=>c+.1)},100);return()=>clearInterval(a)},[n]),r(x,{className:u({stSpinner:!0,stCacheSpinner:s}),"data-testid":"stSpinner",cache:s,children:g(T,{children:[r(m,{}),r($,{source:e.text,allowHTML:!1}),n&&r(y,{children:h(t)})]})})}const z=l.memo(C);export{z as default};
@@ -1 +1 @@
1
- import{r as l,M as u,j as d,bo as x,c4 as V}from"./index.DQoQce-F.js";import{a as h}from"./useBasicWidgetState.CJa4vrfr.js";import"./FormClearHelper.BJursVXh.js";const U=(t,o)=>t.getStringValue(o),v=t=>t.options.length===0||u(t.default)?null:t.options[t.default],C=t=>t.rawValue??null,F=(t,o,e,a)=>{o.setStringValue(t,e.value,{fromUi:e.fromUi},a)},M=({disabled:t,element:o,widgetMgr:e,fragmentId:a})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:g,acceptNewOptions:p}=o,[f,s]=h({getStateFromWidgetMgr:U,getDefaultStateFromProto:v,getCurrStateFromProto:C,updateWidgetMgrState:F,element:o,widgetMgr:e,fragmentId:a}),m=l.useCallback(b=>{s({value:b,fromUi:!0})},[s]),S=u(o.default)&&!t;return d(V,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,onChange:m,value:f,help:c,placeholder:g,clearable:S,acceptNewOptions:p})},w=l.memo(M);export{w as default};
1
+ import{r as l,M as u,j as d,bo as x,c4 as V}from"./index.CvIS8mbe.js";import{a as h}from"./useBasicWidgetState.ChmMQiYn.js";import"./FormClearHelper.BOuxElPh.js";const U=(t,o)=>t.getStringValue(o),v=t=>t.options.length===0||u(t.default)?null:t.options[t.default],C=t=>t.rawValue??null,F=(t,o,e,a)=>{o.setStringValue(t,e.value,{fromUi:e.fromUi},a)},M=({disabled:t,element:o,widgetMgr:e,fragmentId:a})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:g,acceptNewOptions:p}=o,[f,s]=h({getStateFromWidgetMgr:U,getDefaultStateFromProto:v,getCurrStateFromProto:C,updateWidgetMgrState:F,element:o,widgetMgr:e,fragmentId:a}),m=l.useCallback(b=>{s({value:b,fromUi:!0})},[s]),S=u(o.default)&&!t;return d(V,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,onChange:m,value:f,help:c,placeholder:g,clearable:S,acceptNewOptions:p})},w=l.memo(M);export{w as default};
@@ -1,2 +1,2 @@
1
- import{bs as Z,bt as J,r as f,bu as Q,z as Y,bv as s,j as S,C as ee,bo as te,bw as re,bp as ne,b5 as oe,bx as ie,bq as ae,bm as ue,b0 as C,a$ as W,b2 as le}from"./index.DQoQce-F.js";import{a as ce}from"./useBasicWidgetState.CJa4vrfr.js";import"./FormClearHelper.BJursVXh.js";var se={secondary:"secondary"},G={default:"default"},fe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=Z("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}function M(){return M=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},M.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t){return he(e)||me(e,t)||be(e,t)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{bs as Z,bt as J,r as f,bu as Q,z as Y,bv as s,j as S,C as ee,bo as te,bw as re,bp as ne,b5 as oe,bx as ie,bq as ae,bm as ue,b0 as C,a$ as W,b2 as le}from"./index.CvIS8mbe.js";import{a as ce}from"./useBasicWidgetState.ChmMQiYn.js";import"./FormClearHelper.BOuxElPh.js";var se={secondary:"secondary"},G={default:"default"},fe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=Z("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}function M(){return M=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},M.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t){return he(e)||me(e,t)||be(e,t)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function be(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function me(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,p;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,p=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw p}}return n}}function he(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(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 Se(e,t,r){return t&&ve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oe(e,t){if(typeof t!="function"&&t!==null)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&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(e,t)}function Ee(e){var t=we();return function(){var n=I(e),o;if(t){var i=I(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return _e(this,o)}}function _e(e,t){if(t&&(j(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K(e)}function K(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function we(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Le(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var F=function(e){Oe(r,e);var t=Ee(r);function r(){var n;ge(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),N(K(n),"childRefs",{}),n}return Se(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,p=a===void 0?{}:a,c=i.mode,P=c===void 0?k.checkbox:c,d=i.children,y=i.selected,m=i.disabled,l=i.onClick,_=i.kind,h=i.shape,w=i.size,T=J(p.Root,z),O=de(T,2),E=O[0],L=O[1],H=this.props["aria-label"]||this.props.ariaLabel,g=P===k.radio,V=f.Children.count(d);return f.createElement(Q.Consumer,null,function(q){return f.createElement(E,M({"aria-label":H||q.buttongroup.ariaLabel,"data-baseweb":"button-group",role:g?"radiogroup":"group",$shape:h,$length:d.length},L),f.Children.map(d,function(b,R){if(!f.isValidElement(b))return null;var A=b.props.isSelected?b.props.isSelected:Le(y,R);return g&&(o.childRefs[R]=f.createRef()),f.cloneElement(b,{disabled:m||b.props.disabled,isSelected:A,ref:g?o.childRefs[R]:void 0,tabIndex:!g||A||g&&(!y||y===-1)&&R===0?0:-1,onKeyDown:function(u){if(g){var v=Number(y)?Number(y):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var B=v-1<0?V-1:v-1;l&&l(u,B),o.childRefs[B].current&&o.childRefs[B].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var D=v+1>V-1?0:v+1;l&&l(u,D),o.childRefs[D].current&&o.childRefs[D].current.focus()}}},kind:_,onClick:function(u){m||(b.props.onClick&&b.props.onClick(u),l&&l(u,R))},shape:h,size:w,overrides:pe({BaseButton:{style:function(u){var v=u.$theme;return d.length===1?{}:h!==G.default?{marginLeft:v.sizing.scale100,marginRight:v.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":A,role:g?"radio":"checkbox"}}},b.props.overrides)})}))})}}]),r}(f.Component);N(F,"defaultProps",{disabled:!1,onClick:function(){},shape:G.default,size:fe.default,kind:se.secondary});function Re(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Ce(e,t,r){return e==s.ClickMode.MULTI_SELECT?Re(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function Pe(e){return e.length===0?-1:e[0]}function ke(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ie(e,t,r){const n=r===s.Style.PILLS?C.PILLS:r===s.Style.BORDERLESS?C.BORDERLESS_ICON:C.SEGMENTED_CONTROL,o=r===s.Style.BORDERLESS?W.XSMALL:W.MEDIUM,i=n===C.PILLS||n===C.SEGMENTED_CONTROL,a=r===s.Style.BORDERLESS?"lg":"base";return{element:S(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Te(e,t,r,n){return r.indexOf(n)>-1?!0:t!==s.ClickMode.SINGLE_SELECT||e!==s.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function Ae(e,t){return e&&(t=`${t}Active`),t}function Be(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case s.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case s.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case s.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}function De(e,t,r,n,o,i){const a=Te(r,n,o,t);let p=e.content,c=e.contentIcon;return a&&(p=e.selectedContent?e.selectedContent:p,c=e.selectedContentIcon?e.selectedContentIcon:c),f.forwardRef(function(d,y){const{element:m,kind:l,size:_}=Ie(p??"",c??void 0,i),h=Ae(!!(a&&!e.selectedContent&&!e.selectedContentIcon),l);return S(ue,{...d,size:_,kind:h,children:m})})}function je(e,t){return e.getIntArrayValue(t)}function Me(e){return e.default??null}function $e(e){return e.value??null}function Ge(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:i,options:a,selectionVisualization:p,style:c,label:P,labelVisibility:d,help:y}=r,m=Y(),[l,_]=ce({getStateFromWidgetMgr:je,getDefaultStateFromProto:Me,getCurrStateFromProto:$e,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),h=(O,E)=>{const L=Ce(i,E,l);_({value:L,fromUi:!0})};let w;i===s.ClickMode.SINGLE_SELECT?w=k.radio:i===s.ClickMode.MULTI_SELECT&&(w=k.checkbox);const T=f.useMemo(()=>a.map((O,E)=>{const L=De(O,E,p,i,l,c);return S(L,{},`${O.content}-${E}`)}),[i,a,p,c,l]);return ee("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[S(ae,{label:P,disabled:t,labelVisibility:te((d==null?void 0:d.value)??ie.LabelVisibilityOptions.COLLAPSED),children:y&&S(re,{children:S(ne,{content:y,placement:oe.TOP})})}),S(F,{disabled:t,mode:w,onClick:h,selected:i===s.ClickMode.MULTI_SELECT?l:Pe(l),overrides:{Root:{style:f.useCallback(()=>Be(c,m.spacing),[c,m.spacing])}},children:T})]})}const Ue=f.memo(Ge);export{Ue as default};
@@ -1 +1 @@
1
- import{r as f,z as T,B as C,j as n,C as y,bo as S,aC as L,bw as W,bp as B,b5 as w,bG as R,J as $,bH as E,bI as P}from"./index.DQoQce-F.js";import{a as v}from"./useBasicWidgetState.CJa4vrfr.js";import{a as H,L as X,S as p}from"./checkbox.0qSLqyAl.js";import"./FormClearHelper.BJursVXh.js";function M({element:e,disabled:a,widgetMgr:s,fragmentId:d}){var m;const[x,g]=v({getStateFromWidgetMgr:V,getDefaultStateFromProto:I,getCurrStateFromProto:G,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(H,{checked:x,disabled:a,onChange:k,"aria-label":e.label,checkmarkType:e.type===E.StyleType.TOGGLE?p.toggle:p.default,labelPlacement:X.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:S((m=e.labelVisibility)==null?void 0:m.value),"data-testid":"stWidgetLabel",children:[n(L,{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 I(e){return e.default??null}function G(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
+ import{r as f,z as T,B as C,j as n,C as y,bo as S,aC as L,bw as W,bp as B,b5 as w,bG as R,J as $,bH as E,bI as P}from"./index.CvIS8mbe.js";import{a as v}from"./useBasicWidgetState.ChmMQiYn.js";import{a as H,L as X,S as p}from"./checkbox.DTBzWBar.js";import"./FormClearHelper.BOuxElPh.js";function M({element:e,disabled:a,widgetMgr:s,fragmentId:d}){var m;const[x,g]=v({getStateFromWidgetMgr:V,getDefaultStateFromProto:I,getCurrStateFromProto:G,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(H,{checked:x,disabled:a,onChange:k,"aria-label":e.label,checkmarkType:e.type===E.StyleType.TOGGLE?p.toggle:p.default,labelPlacement:X.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:S((m=e.labelVisibility)==null?void 0:m.value),"data-testid":"stWidgetLabel",children:[n(L,{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 I(e){return e.default??null}function G(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};