streamlit-nightly 1.41.2.dev20241213__py2.py3-none-any.whl → 1.41.2.dev20241215__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.
Files changed (69) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/static/js/{FileDownload.esm.pXJom3_u.js → FileDownload.esm.DEy54Lj0.js} +1 -1
  3. streamlit/static/static/js/{FormClearHelper.BAxbbA6O.js → FormClearHelper.Be8Owlxq.js} +1 -1
  4. streamlit/static/static/js/{Hooks.CpB5Hmn1.js → Hooks.C15JRXAW.js} +1 -1
  5. streamlit/static/static/js/{InputInstructions.BIXDCXN1.js → InputInstructions.DV7O0pwg.js} +1 -1
  6. streamlit/static/static/js/{ProgressBar.Z0ifQ3xC.js → ProgressBar.DUTshGI0.js} +1 -1
  7. streamlit/static/static/js/{RenderInPortalIfExists.CpWJBpEX.js → RenderInPortalIfExists.KvrpOyLS.js} +1 -1
  8. streamlit/static/static/js/{Toolbar.BKefZoqy.js → Toolbar.DvlwBkCK.js} +1 -1
  9. streamlit/static/static/js/{base-input.gGbbuGFL.js → base-input.DrKqvuVC.js} +1 -1
  10. streamlit/static/static/js/{createSuper.D7hstdKy.js → createSuper.DQtXGZRh.js} +1 -1
  11. streamlit/static/static/js/{data-grid-overlay-editor.D4hawJSU.js → data-grid-overlay-editor.BX4VuPqS.js} +1 -1
  12. streamlit/static/static/js/{downloader.Bv8YsAgv.js → downloader.D7res8rv.js} +1 -1
  13. streamlit/static/static/js/{es6.CpAaZo4p.js → es6.BhUnagUb.js} +2 -2
  14. streamlit/static/static/js/{getPrototypeOf.BUuN2pm3.js → getPrototypeOf.Dxa9R7TL.js} +1 -1
  15. streamlit/static/static/js/{iframeResizer.contentWindow.BZcnckuF.js → iframeResizer.contentWindow.CbiEp18-.js} +1 -1
  16. streamlit/static/static/js/{index.CLHTE9K8.js → index.BAzfO7bi.js} +1 -1
  17. streamlit/static/static/js/{index.CEFw6DKA.js → index.BJ9Swnjg.js} +1 -1
  18. streamlit/static/static/js/{index.DLGFVkmJ.js → index.BL0XPgpi.js} +1 -1
  19. streamlit/static/static/js/{index.BYZb5lEV.js → index.BP0JM0Gi.js} +1 -1
  20. streamlit/static/static/js/{index.BLcggoqB.js → index.BPoPrFmc.js} +1 -1
  21. streamlit/static/static/js/{index.DYWYKswm.js → index.BRBxgNBm.js} +1 -1
  22. streamlit/static/static/js/{index.DdNdsuE9.js → index.BUzVYWlH.js} +1 -1
  23. streamlit/static/static/js/{index.CXZo9Oda.js → index.BZUBnj4I.js} +1 -1
  24. streamlit/static/static/js/{index.BtTejfOF.js → index.BaK_d_F_.js} +1 -1
  25. streamlit/static/static/js/{index.V4AGkXqd.js → index.BhCp_b-T.js} +1 -1
  26. streamlit/static/static/js/{index.D8qfi0xs.js → index.Bte89q_q.js} +4 -4
  27. streamlit/static/static/js/{index.DN-yJOlX.js → index.C-nBZgu1.js} +1 -1
  28. streamlit/static/static/js/{index.DzyViyEq.js → index.C7vOm1iu.js} +1 -1
  29. streamlit/static/static/js/{index.B_EOk8H0.js → index.CCuFCyWL.js} +1 -1
  30. streamlit/static/static/js/{index.DD_EO0sM.js → index.CKG6wl5I.js} +1 -1
  31. streamlit/static/static/js/{index.ofRDmVnU.js → index.CYC_EzXg.js} +1 -1
  32. streamlit/static/static/js/{index.B35E9abV.js → index.Chmhb0qY.js} +1 -1
  33. streamlit/static/static/js/{index.BtrscBaG.js → index.Cthlj19A.js} +1 -1
  34. streamlit/static/static/js/{index.DkKZMv1d.js → index.CvUznUh2.js} +1 -1
  35. streamlit/static/static/js/{index.rNGJqkZ8.js → index.DEtCBzzJ.js} +1 -1
  36. streamlit/static/static/js/{index.CblnHMp1.js → index.DM6f0FLw.js} +1 -1
  37. streamlit/static/static/js/{index.DExi7qmy.js → index.DOiNn6ja.js} +1 -1
  38. streamlit/static/static/js/{index.CeNw8UNG.js → index.DPSp33Rc.js} +1 -1
  39. streamlit/static/static/js/{index.C_3vi3IE.js → index.DiNFgbEQ.js} +5 -5
  40. streamlit/static/static/js/{index.BMizrOC3.js → index.DjD5n_h_.js} +1 -1
  41. streamlit/static/static/js/{index.DNVGztrJ.js → index.DuWcRENt.js} +1 -1
  42. streamlit/static/static/js/{index.BNk7Eatk.js → index.Dv3OlQNw.js} +1 -1
  43. streamlit/static/static/js/{index.DBXQ0dAy.js → index.Gv6EXPUi.js} +1 -1
  44. streamlit/static/static/js/{index.BOQq4Sjc.js → index.W75zUzI9.js} +1 -1
  45. streamlit/static/static/js/{index.DjgzMgAc.js → index.dsMx8rCW.js} +1 -1
  46. streamlit/static/static/js/{index.HL94kHI6.js → index.fU69JX5g.js} +1 -1
  47. streamlit/static/static/js/{index.DtakMKXe.js → index.fthRqOKc.js} +1 -1
  48. streamlit/static/static/js/{index.BDuIxN6Q.js → index.jyheOdRj.js} +1 -1
  49. streamlit/static/static/js/{index.B1-oGS4Z.js → index.mLTOGCvP.js} +1 -1
  50. streamlit/static/static/js/{index.CYc9OBVB.js → index.nt7eFh2G.js} +1 -1
  51. streamlit/static/static/js/{index.DZBJpGrb.js → index.vGhFyxhq.js} +1 -1
  52. streamlit/static/static/js/{index._Md78V1s.js → index.xuqkuM2s.js} +1 -1
  53. streamlit/static/static/js/{input.BupwCsfn.js → input.BU9nvdLI.js} +1 -1
  54. streamlit/static/static/js/{memory.BPH2Uj95.js → memory.wXya4JLT.js} +1 -1
  55. streamlit/static/static/js/{number-overlay-editor.BFaxOLPv.js → number-overlay-editor.Cgh-x0GC.js} +1 -1
  56. streamlit/static/static/js/{sandbox.fpqDCQZe.js → sandbox.HMw2S2RS.js} +1 -1
  57. streamlit/static/static/js/{slicedToArray.DzTZiAJg.js → slicedToArray.DMRNFvHL.js} +1 -1
  58. streamlit/static/static/js/{textarea.QewQOy0j.js → textarea.B_ZoEItX.js} +1 -1
  59. streamlit/static/static/js/{timepicker.CZhg_v9e.js → timepicker.CxnROZk5.js} +1 -1
  60. streamlit/static/static/js/{uniqueId.Bh94HGoQ.js → uniqueId.CMKreETJ.js} +1 -1
  61. streamlit/static/static/js/{useBasicWidgetState.CVo4i0A2.js → useBasicWidgetState.Dy1XFlOJ.js} +1 -1
  62. streamlit/static/static/js/{useOnInputChange.b_AWb4dD.js → useOnInputChange.CmfJ1w9u.js} +1 -1
  63. streamlit/static/static/js/{withFullScreenWrapper.BpeIAeXL.js → withFullScreenWrapper.C8VqR588.js} +1 -1
  64. {streamlit_nightly-1.41.2.dev20241213.dist-info → streamlit_nightly-1.41.2.dev20241215.dist-info}/METADATA +1 -1
  65. {streamlit_nightly-1.41.2.dev20241213.dist-info → streamlit_nightly-1.41.2.dev20241215.dist-info}/RECORD +69 -69
  66. {streamlit_nightly-1.41.2.dev20241213.data → streamlit_nightly-1.41.2.dev20241215.data}/scripts/streamlit.cmd +0 -0
  67. {streamlit_nightly-1.41.2.dev20241213.dist-info → streamlit_nightly-1.41.2.dev20241215.dist-info}/WHEEL +0 -0
  68. {streamlit_nightly-1.41.2.dev20241213.dist-info → streamlit_nightly-1.41.2.dev20241215.dist-info}/entry_points.txt +0 -0
  69. {streamlit_nightly-1.41.2.dev20241213.dist-info → streamlit_nightly-1.41.2.dev20241215.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{R as B,a6 as h,aG as i,j as e,aH as p,aY as w,aF as D,aI as b}from"./index.D8qfi0xs.js";import{c as k}from"./createDownloadLinkElement.DZMwyjvU.js";function R(n,a,t){return k({enforceDownloadInNewTab:t,url:n.buildMediaURL(a),filename:""})}function y(n){const{disabled:a,element:t,widgetMgr:s,width:l,endpoints:d,fragmentId:r}=n,c={width:l},{libConfig:{enforceDownloadInNewTab:u=!1}}=B.useContext(h);let o=i.SECONDARY;t.type==="primary"?o=i.PRIMARY:t.type==="tertiary"&&(o=i.TERTIARY);const f=()=>{s.setTriggerValue(t,{fromUi:!0},r),R(d,t.url,u).click()},m=t.help?l:!0;return e("div",{className:"stDownloadButton","data-testid":"stDownloadButton",style:c,children:e(p,{help:t.help,children:e(w,{kind:o,size:D.SMALL,disabled:a,onClick:f,fluidWidth:t.useContainerWidth?m:!1,children:e(b,{icon:t.icon,label:t.label})})})})}export{y as default};
1
+ import{R as B,a6 as h,aG as i,j as e,aH as p,aY as w,aF as D,aI as b}from"./index.Bte89q_q.js";import{c as k}from"./createDownloadLinkElement.DZMwyjvU.js";function R(n,a,t){return k({enforceDownloadInNewTab:t,url:n.buildMediaURL(a),filename:""})}function y(n){const{disabled:a,element:t,widgetMgr:s,width:l,endpoints:d,fragmentId:r}=n,c={width:l},{libConfig:{enforceDownloadInNewTab:u=!1}}=B.useContext(h);let o=i.SECONDARY;t.type==="primary"?o=i.PRIMARY:t.type==="tertiary"&&(o=i.TERTIARY);const f=()=>{s.setTriggerValue(t,{fromUi:!0},r),R(d,t.url,u).click()},m=t.help?l:!0;return e("div",{className:"stDownloadButton","data-testid":"stDownloadButton",style:c,children:e(p,{help:t.help,children:e(w,{kind:o,size:D.SMALL,disabled:a,onClick:f,fluidWidth:t.useContainerWidth?m:!1,children:e(b,{icon:t.icon,label:t.label})})})})}export{y as default};
@@ -1 +1 @@
1
- import{r as s,A as d,j as S,a_ as x,bB as U}from"./index.D8qfi0xs.js";import{a as V}from"./useBasicWidgetState.CVo4i0A2.js";import"./FormClearHelper.BAxbbA6O.js";const v=(t,e)=>t.getIntValue(e),h=t=>t.default??null,C=t=>t.value??null,F=(t,e,o,a)=>{e.setIntValue(t,o.value,{fromUi:o.fromUi},a)},I=({disabled:t,element:e,widgetMgr:o,width:a,fragmentId:u})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:m}=e,[f,l]=V({getStateFromWidgetMgr:v,getDefaultStateFromProto:h,getCurrStateFromProto:C,updateWidgetMgrState:F,element:e,widgetMgr:o,fragmentId:u}),g=s.useCallback(b=>{l({value:b,fromUi:!0})},[l]),p=d(e.default)&&!t;return S(U,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,width:a,onChange:g,value:f,help:c,placeholder:m,clearable:p})},B=s.memo(I);export{B as default};
1
+ import{r as s,A as d,j as S,a_ as x,bB as U}from"./index.Bte89q_q.js";import{a as V}from"./useBasicWidgetState.Dy1XFlOJ.js";import"./FormClearHelper.Be8Owlxq.js";const v=(t,e)=>t.getIntValue(e),h=t=>t.default??null,C=t=>t.value??null,F=(t,e,o,a)=>{e.setIntValue(t,o.value,{fromUi:o.fromUi},a)},I=({disabled:t,element:e,widgetMgr:o,width:a,fragmentId:u})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:m}=e,[f,l]=V({getStateFromWidgetMgr:v,getDefaultStateFromProto:h,getCurrStateFromProto:C,updateWidgetMgrState:F,element:e,widgetMgr:o,fragmentId:u}),g=s.useCallback(b=>{l({value:b,fromUi:!0})},[l]),p=d(e.default)&&!t;return S(U,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,width:a,onChange:g,value:f,help:c,placeholder:m,clearable:p})},B=s.memo(I);export{B as default};
@@ -1 +1 @@
1
- import{n as U,r as s,aR as V,j as l}from"./index.D8qfi0xs.js";const b=U("iframe",{target:"e1iolsnz0"})(({theme:a})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,width:"100%",aspectRatio:"16 / 9"})),P=528;function w({element:a,width:f,endpoints:m,elementMgr:c}){const i=s.useRef(null),{type:E,url:p,startTime:n,subtitles:v,endTime:d,loop:u,autoplay:T,muted:h}=a,S=s.useMemo(()=>{if(!a.id)return!0;const e=c.getElementState(a.id,"preventAutoplay");return e||c.setElementState(a.id,"preventAutoplay",!0),e??!1},[a.id,c]);s.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),s.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=a.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[a]),s.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const o=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",o),()=>{e&&d>0&&e.removeEventListener("timeupdate",o)}},[d,u,n]),s.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const g=e=>{const{startTime:t,endTime:o,loop:L,autoplay:N,muted:R}=a,r=new URL(e);if(t&&!isNaN(t)&&r.searchParams.append("start",t.toString()),o&&!isNaN(o)&&r.searchParams.append("end",o.toString()),L){r.searchParams.append("loop","1");const y=r.pathname.split("/").pop();y&&r.searchParams.append("playlist",y)}return N&&r.searchParams.append("autoplay","1"),R&&r.searchParams.append("mute","1"),r.toString()};return E===V.Type.YOUTUBE_IFRAME?l(b,{className:"stVideo","data-testid":"stVideo",title:p,src:g(p),allow:"autoplay; encrypted-media",allowFullScreen:!0}):l("video",{className:"stVideo","data-testid":"stVideo",ref:i,controls:!0,muted:h,autoPlay:T&&!S,src:m.buildMediaURL(p),style:{width:f,height:f===0?P:void 0},crossOrigin:void 0,children:v&&v.map((e,t)=>l("track",{kind:"captions",src:m.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0},t))})}export{w as default};
1
+ import{n as U,r as s,aR as V,j as l}from"./index.Bte89q_q.js";const b=U("iframe",{target:"e1iolsnz0"})(({theme:a})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,width:"100%",aspectRatio:"16 / 9"})),P=528;function w({element:a,width:f,endpoints:m,elementMgr:c}){const i=s.useRef(null),{type:E,url:p,startTime:n,subtitles:v,endTime:d,loop:u,autoplay:T,muted:h}=a,S=s.useMemo(()=>{if(!a.id)return!0;const e=c.getElementState(a.id,"preventAutoplay");return e||c.setElementState(a.id,"preventAutoplay",!0),e??!1},[a.id,c]);s.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),s.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=a.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[a]),s.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const o=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",o),()=>{e&&d>0&&e.removeEventListener("timeupdate",o)}},[d,u,n]),s.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const g=e=>{const{startTime:t,endTime:o,loop:L,autoplay:N,muted:R}=a,r=new URL(e);if(t&&!isNaN(t)&&r.searchParams.append("start",t.toString()),o&&!isNaN(o)&&r.searchParams.append("end",o.toString()),L){r.searchParams.append("loop","1");const y=r.pathname.split("/").pop();y&&r.searchParams.append("playlist",y)}return N&&r.searchParams.append("autoplay","1"),R&&r.searchParams.append("mute","1"),r.toString()};return E===V.Type.YOUTUBE_IFRAME?l(b,{className:"stVideo","data-testid":"stVideo",title:p,src:g(p),allow:"autoplay; encrypted-media",allowFullScreen:!0}):l("video",{className:"stVideo","data-testid":"stVideo",ref:i,controls:!0,muted:h,autoPlay:T&&!S,src:m.buildMediaURL(p),style:{width:f,height:f===0?P:void 0},crossOrigin:void 0,children:v&&v.map((e,t)=>l("track",{kind:"captions",src:m.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0},t))})}export{w as default};
@@ -1 +1 @@
1
- import{r as o,E as M,_ as q,n as x,al as lt,bY as ut,D as Y,c6 as I,A as f,a8 as z,j as u,a_ as ct,bb as dt,a$ as pt,aK as ft,b0 as bt,aX as K}from"./index.D8qfi0xs.js";import{s as mt}from"./sprintf.C-r3gIuM.js";import{u as yt}from"./uniqueId.Bh94HGoQ.js";import{u as gt}from"./FormClearHelper.BAxbbA6O.js";import{I as It}from"./InputInstructions.BIXDCXN1.js";import{I as ht}from"./input.BupwCsfn.js";import"./base-input.gGbbuGFL.js";var J=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(M,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M0 3v2h8V3H0z"}))});J.displayName="Minus";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(M,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Q.displayName="Plus";const Ct=x("div",{target:"e6j74ky0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor||t.colors.widgetBackgroundColor||t.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Tt=x("div",{target:"e6j74ky1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),X=x("button",{target:"e6j74ky2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.widgetBackgroundColor||t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),wt=x("div",{target:"e6j74ky3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`}));function kt(t){return f(t)||t===""?void 0:t}const St=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,G=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),W=({value:t,format:e,step:r,dataType:h})=>{if(f(t))return null;let a=kt(e);if(f(a)&&Y(r)){const c=r.toString();h===I.DataType.FLOAT&&r!==0&&c.includes(".")&&(a=`%0.${c.split(".")[1].length}f`)}if(f(a))return t.toString();try{return mt.sprintf(a,t)}catch{return String(t)}},Vt=(t,e,r)=>f(t)?!1:t-e>=r,vt=(t,e,r)=>f(t)?!1:t+e<=r,xt=({disabled:t,element:e,widgetMgr:r,width:h,theme:a,fragmentId:c})=>{var $;const{dataType:w,id:D,formId:p,default:B,format:A}=e,b=e.hasMin?e.min:-1/0,m=e.hasMax?e.max:1/0,[s,Z]=o.useState(G(e)),U=St({element:e,widgetMgr:r}),[y,C]=o.useState(!1),[i,T]=o.useState(U),[H,k]=o.useState(W({value:U,...e,step:s})),[P,j]=o.useState(!1),R=o.useRef(null),L=o.useRef(yt("number_input_")),S=Vt(i,s,b),V=vt(i,s,m),O=ut({formId:p}),tt=O?r.allowFormEnterToSubmit(p):y,et=P&&h>a.breakpoints.hideWidgetDetails;o.useEffect(()=>{Z(G({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const l=o.useCallback(({value:n,source:d})=>{var g;if(Y(n)&&(b>n||n>m))(g=R.current)==null||g.reportValidity();else{const v=n??B??null;switch(w){case I.DataType.INT:r.setIntValue({id:D,formId:p},v,d,c);break;case I.DataType.FLOAT:r.setDoubleValue({id:D,formId:p},v,d,c);break;default:throw new Error("Invalid data type")}C(!1),T(v),k(W({value:v,dataType:w,format:A,step:s}))}},[b,m,R,r,c,s,w,D,p,B,A]),ot=o.useCallback(()=>{y&&l({value:i,source:{fromUi:!0}}),j(!1)},[y,i,l]),rt=o.useCallback(()=>{j(!0)},[]),_=o.useCallback(()=>{const{value:n}=e;e.setValue=!1,T(n??null),k(W({value:n??null,...e,step:s})),l({value:n??null,source:{fromUi:!1}})},[e,s,l]);o.useEffect(()=>{e.setValue?_():l({value:i,source:{fromUi:!1}})},[]),e.setValue&&_();const N=f(e.default)&&!t,nt=o.useCallback(()=>{const n=e.default??null;T(n),l({value:n,source:{fromUi:!0}})},[e]);gt({element:e,widgetMgr:r,onFormCleared:nt});const at=n=>{const{value:d}=n.target;if(d==="")C(!0),T(null),k(null);else{let g;e.dataType===I.DataType.INT?g=parseInt(d,10):g=parseFloat(d),C(!0),T(g),k(d)}},F=o.useCallback(()=>{V&&(C(!0),l({value:(i??b)+s,source:{fromUi:!0}}))},[i,b,s,V]),E=o.useCallback(()=>{S&&(C(!0),l({value:(i??m)-s,source:{fromUi:!0}}))},[i,m,s,S]),st=o.useCallback(n=>{const{key:d}=n;switch(d){case"ArrowUp":n.preventDefault(),F();break;case"ArrowDown":n.preventDefault(),E();break}},[F,E]),it=o.useCallback(n=>{n.key==="Enter"&&(y&&l({value:i,source:{fromUi:!0}}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,c))},[y,i,l,r,p,c]);return z("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:h},children:[u(bt,{label:e.label,disabled:t,labelVisibility:ct(($=e.labelVisibility)==null?void 0:$.value),htmlFor:L.current,children:e.help&&u(dt,{children:u(pt,{content:e.help,placement:ft.TOP_RIGHT})})}),z(Ct,{className:P?"focused":"","data-testid":"stNumberInputContainer",children:[u(ht,{type:"number",inputRef:R,value:H??"",placeholder:e.placeholder,onBlur:ot,onFocus:rt,onChange:at,onKeyPress:it,onKeyDown:st,clearable:N,clearOnEscape:N,disabled:t,"aria-label":e.label,id:L.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,padding:a.spacing.threeXS,height:a.sizes.clearIconSize,width:a.sizes.clearIconSize,":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:b,max:m,type:"number",inputMode:""},style:{lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),h>a.breakpoints.hideNumberInputControls&&z(Tt,{children:[u(X,{"data-testid":"stNumberInputStepDown",onClick:E,disabled:!S||t,tabIndex:-1,children:u(K,{content:J,size:"xs",color:S?"inherit":"disabled"})}),u(X,{"data-testid":"stNumberInputStepUp",onClick:F,disabled:!V||t,tabIndex:-1,children:u(K,{content:Q,size:"xs",color:V?"inherit":"disabled"})})]})]}),et&&u(wt,{clearable:N,children:u(It,{dirty:y,value:H??"",inForm:O,allowEnterToSubmit:tt})})]})},Bt=lt(xt);export{Bt as default};
1
+ import{r as o,E as M,_ as q,n as x,al as lt,bY as ut,D as Y,c6 as I,A as f,a8 as z,j as u,a_ as ct,bb as dt,a$ as pt,aK as ft,b0 as bt,aX as K}from"./index.Bte89q_q.js";import{s as mt}from"./sprintf.C-r3gIuM.js";import{u as yt}from"./uniqueId.CMKreETJ.js";import{u as gt}from"./FormClearHelper.Be8Owlxq.js";import{I as It}from"./InputInstructions.DV7O0pwg.js";import{I as ht}from"./input.BU9nvdLI.js";import"./base-input.DrKqvuVC.js";var J=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(M,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M0 3v2h8V3H0z"}))});J.displayName="Minus";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(M,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Q.displayName="Plus";const Ct=x("div",{target:"e6j74ky0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor||t.colors.widgetBackgroundColor||t.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Tt=x("div",{target:"e6j74ky1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),X=x("button",{target:"e6j74ky2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.widgetBackgroundColor||t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),wt=x("div",{target:"e6j74ky3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`}));function kt(t){return f(t)||t===""?void 0:t}const St=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,G=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),W=({value:t,format:e,step:r,dataType:h})=>{if(f(t))return null;let a=kt(e);if(f(a)&&Y(r)){const c=r.toString();h===I.DataType.FLOAT&&r!==0&&c.includes(".")&&(a=`%0.${c.split(".")[1].length}f`)}if(f(a))return t.toString();try{return mt.sprintf(a,t)}catch{return String(t)}},Vt=(t,e,r)=>f(t)?!1:t-e>=r,vt=(t,e,r)=>f(t)?!1:t+e<=r,xt=({disabled:t,element:e,widgetMgr:r,width:h,theme:a,fragmentId:c})=>{var $;const{dataType:w,id:D,formId:p,default:B,format:A}=e,b=e.hasMin?e.min:-1/0,m=e.hasMax?e.max:1/0,[s,Z]=o.useState(G(e)),U=St({element:e,widgetMgr:r}),[y,C]=o.useState(!1),[i,T]=o.useState(U),[H,k]=o.useState(W({value:U,...e,step:s})),[P,j]=o.useState(!1),R=o.useRef(null),L=o.useRef(yt("number_input_")),S=Vt(i,s,b),V=vt(i,s,m),O=ut({formId:p}),tt=O?r.allowFormEnterToSubmit(p):y,et=P&&h>a.breakpoints.hideWidgetDetails;o.useEffect(()=>{Z(G({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const l=o.useCallback(({value:n,source:d})=>{var g;if(Y(n)&&(b>n||n>m))(g=R.current)==null||g.reportValidity();else{const v=n??B??null;switch(w){case I.DataType.INT:r.setIntValue({id:D,formId:p},v,d,c);break;case I.DataType.FLOAT:r.setDoubleValue({id:D,formId:p},v,d,c);break;default:throw new Error("Invalid data type")}C(!1),T(v),k(W({value:v,dataType:w,format:A,step:s}))}},[b,m,R,r,c,s,w,D,p,B,A]),ot=o.useCallback(()=>{y&&l({value:i,source:{fromUi:!0}}),j(!1)},[y,i,l]),rt=o.useCallback(()=>{j(!0)},[]),_=o.useCallback(()=>{const{value:n}=e;e.setValue=!1,T(n??null),k(W({value:n??null,...e,step:s})),l({value:n??null,source:{fromUi:!1}})},[e,s,l]);o.useEffect(()=>{e.setValue?_():l({value:i,source:{fromUi:!1}})},[]),e.setValue&&_();const N=f(e.default)&&!t,nt=o.useCallback(()=>{const n=e.default??null;T(n),l({value:n,source:{fromUi:!0}})},[e]);gt({element:e,widgetMgr:r,onFormCleared:nt});const at=n=>{const{value:d}=n.target;if(d==="")C(!0),T(null),k(null);else{let g;e.dataType===I.DataType.INT?g=parseInt(d,10):g=parseFloat(d),C(!0),T(g),k(d)}},F=o.useCallback(()=>{V&&(C(!0),l({value:(i??b)+s,source:{fromUi:!0}}))},[i,b,s,V]),E=o.useCallback(()=>{S&&(C(!0),l({value:(i??m)-s,source:{fromUi:!0}}))},[i,m,s,S]),st=o.useCallback(n=>{const{key:d}=n;switch(d){case"ArrowUp":n.preventDefault(),F();break;case"ArrowDown":n.preventDefault(),E();break}},[F,E]),it=o.useCallback(n=>{n.key==="Enter"&&(y&&l({value:i,source:{fromUi:!0}}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,c))},[y,i,l,r,p,c]);return z("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:h},children:[u(bt,{label:e.label,disabled:t,labelVisibility:ct(($=e.labelVisibility)==null?void 0:$.value),htmlFor:L.current,children:e.help&&u(dt,{children:u(pt,{content:e.help,placement:ft.TOP_RIGHT})})}),z(Ct,{className:P?"focused":"","data-testid":"stNumberInputContainer",children:[u(ht,{type:"number",inputRef:R,value:H??"",placeholder:e.placeholder,onBlur:ot,onFocus:rt,onChange:at,onKeyPress:it,onKeyDown:st,clearable:N,clearOnEscape:N,disabled:t,"aria-label":e.label,id:L.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,padding:a.spacing.threeXS,height:a.sizes.clearIconSize,width:a.sizes.clearIconSize,":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:b,max:m,type:"number",inputMode:""},style:{lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),h>a.breakpoints.hideNumberInputControls&&z(Tt,{children:[u(X,{"data-testid":"stNumberInputStepDown",onClick:E,disabled:!S||t,tabIndex:-1,children:u(K,{content:J,size:"xs",color:S?"inherit":"disabled"})}),u(X,{"data-testid":"stNumberInputStepUp",onClick:F,disabled:!V||t,tabIndex:-1,children:u(K,{content:Q,size:"xs",color:V?"inherit":"disabled"})})]})]}),et&&u(wt,{clearable:N,children:u(It,{dirty:y,value:H??"",inForm:O,allowEnterToSubmit:tt})})]})},Bt=lt(xt);export{Bt as default};
@@ -1 +1 @@
1
- import{n as t,D as d,j as c,aC as l,aD as g,A as e}from"./index.D8qfi0xs.js";const f=t("iframe",{target:"etgi5ab0"})(({theme:o,disableScrolling:i})=>({colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:i?"hidden":void 0}));function F({element:o,width:i}){const s=o.hasWidth?o.width:i,n=r(o.src),a=d(n)?void 0:r(o.srcdoc);return c(f,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!o.scrolling,src:n,srcDoc:a,width:s,height:o.height,scrolling:o.scrolling?"auto":"no",sandbox:g,title:"st.iframe"})}function r(o){return e(o)||o===""?void 0:o}export{F as default};
1
+ import{n as t,D as d,j as c,aC as l,aD as g,A as e}from"./index.Bte89q_q.js";const f=t("iframe",{target:"etgi5ab0"})(({theme:o,disableScrolling:i})=>({colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:i?"hidden":void 0}));function F({element:o,width:i}){const s=o.hasWidth?o.width:i,n=r(o.src),a=d(n)?void 0:r(o.srcdoc);return c(f,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!o.scrolling,src:n,srcDoc:a,width:s,height:o.height,scrolling:o.scrolling?"auto":"no",sandbox:g,title:"st.iframe"})}function r(o){return e(o)||o===""?void 0:o}export{F as default};