streamlit-nightly 1.42.3.dev20250222__py2.py3-none-any.whl → 1.42.3.dev20250224__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/dataframe_util.py +6 -1
- streamlit/elements/bokeh_chart.py +6 -0
- streamlit/elements/markdown.py +2 -0
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.B1kyp21I.js → FileDownload.esm.Db6P60XC.js} +1 -1
- streamlit/static/static/js/FileHelper.LHDgAkEu.js +5 -0
- streamlit/static/static/js/{FormClearHelper.CEl0YyS3.js → FormClearHelper.BkPbs0OF.js} +1 -1
- streamlit/static/static/js/{Hooks.B_-0sclb.js → Hooks.CW1Ujj-E.js} +1 -1
- streamlit/static/static/js/{InputInstructions.M8GsfWtP.js → InputInstructions.CHpHVupe.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DDliFXvs.js → ProgressBar.CSZV-k_M.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.DON5no2j.js → RenderInPortalIfExists.CrI9B0Qh.js} +1 -1
- streamlit/static/static/js/{Toolbar.DGwjBtCI.js → Toolbar.CfNF-56q.js} +1 -1
- streamlit/static/static/js/{base-input.Dz6cKnV_.js → base-input.BBFJwxWO.js} +4 -4
- streamlit/static/static/js/{createSuper.bXxYJzro.js → createSuper.rz8EjYR0.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BrHDbHOn.js → data-grid-overlay-editor.DUagmDpG.js} +1 -1
- streamlit/static/static/js/{downloader.BUh1naKp.js → downloader.DEY2_Oao.js} +1 -1
- streamlit/static/static/js/{es6.C8XVTTHj.js → es6.Cbt8Qb0v.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DGWt48-l.js → iframeResizer.contentWindow.DlY1zPt7.js} +1 -1
- streamlit/static/static/js/{index.6zGrdP7S.js → index.7HEH_7fJ.js} +15 -15
- streamlit/static/static/js/{index.DvUg88R_.js → index.8pg9ijwI.js} +1 -1
- streamlit/static/static/js/{index.jSEMrPEJ.js → index.B5Q1lb1E.js} +1 -1
- streamlit/static/static/js/{index.DgCaLwAb.js → index.BFFhpOhV.js} +1 -1
- streamlit/static/static/js/{index.DU4gaNU_.js → index.BcIDRdbw.js} +1 -1
- streamlit/static/static/js/index.Bhf5i-o4.js +1 -0
- streamlit/static/static/js/{index.DcA_kXA1.js → index.BtBNIxWC.js} +2 -2
- streamlit/static/static/js/{index.BhKdTR4z.js → index.Bv1JbhEf.js} +1 -1
- streamlit/static/static/js/index.C29vTftb.js +3865 -0
- streamlit/static/static/js/{index.94WymsOx.js → index.C3FZ8TOb.js} +3 -3
- streamlit/static/static/js/index.C41AtD-D.js +1 -0
- streamlit/static/static/js/{index.C5zcxetk.js → index.C9kvqGu0.js} +1 -1
- streamlit/static/static/js/{index.DO1Rv491.js → index.CIDueoC2.js} +1 -1
- streamlit/static/static/js/{index.C2skmlN3.js → index.CUFUpykP.js} +2 -2
- streamlit/static/static/js/index.CUWXxL_C.js +1 -0
- streamlit/static/static/js/{index.BBotNZr-.js → index.CUepHEom.js} +1 -1
- streamlit/static/static/js/index.C_SUbLL7.js +1 -0
- streamlit/static/static/js/index.CdiPATR3.js +197 -0
- streamlit/static/static/js/index.CgZ_3VRU.js +1 -0
- streamlit/static/static/js/{index.BiCX2JZK.js → index.CjN5S59O.js} +1 -1
- streamlit/static/static/js/{index.B66JaJi3.js → index.Con6tiNg.js} +1 -1
- streamlit/static/static/js/{index.D-4pSvTG.js → index.D1sfL1bE.js} +1 -1
- streamlit/static/static/js/{index.CNDCHhth.js → index.D2PC_wwi.js} +1 -1
- streamlit/static/static/js/index.D8mp5ppE.js +201 -0
- streamlit/static/static/js/{index.C2VChsA1.js → index.DEz7mrAp.js} +1 -1
- streamlit/static/static/js/{index.BrXMfzqp.js → index.DPZJrrNj.js} +1 -1
- streamlit/static/static/js/{index.DB9G9YYY.js → index.Df3vkO_v.js} +1 -1
- streamlit/static/static/js/{index.BXFE-6NA.js → index.DuUcgXrv.js} +1 -1
- streamlit/static/static/js/{index.lCzpOFcS.js → index.DxvQWdtj.js} +1 -1
- streamlit/static/static/js/{index.D_tVZ0u0.js → index.DymllY6d.js} +2 -2
- streamlit/static/static/js/{index.Da7VTJGp.js → index.G1PSqufB.js} +2 -2
- streamlit/static/static/js/{index.B1Y_k9Fh.js → index.I2Ij_yHL.js} +1 -1
- streamlit/static/static/js/{index.NifETEVc.js → index.InwDjRN5.js} +1 -1
- streamlit/static/static/js/{index.iYzAfcLx.js → index.LmMDdxLh.js} +1 -1
- streamlit/static/static/js/{index.C9nK-VoQ.js → index.LypQPPkP.js} +3 -3
- streamlit/static/static/js/index.RDHMaPCV.js +1 -0
- streamlit/static/static/js/index.jj20zRA4.js +1 -0
- streamlit/static/static/js/{input.DqK048_c.js → input.QeLiGsyn.js} +2 -2
- streamlit/static/static/js/{memory.BYwXutbg.js → memory.0fYVo8Wx.js} +1 -1
- streamlit/static/static/js/{mergeWith.CwfhUp-s.js → mergeWith.AOqADio_.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.B-1TJraW.js → number-overlay-editor.DAvAckzz.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CCjgmGB4.js → possibleConstructorReturn.C4RsC1R8.js} +1 -1
- streamlit/static/static/js/{sandbox.CzVH3fBX.js → sandbox.DT2p3KTe.js} +1 -1
- streamlit/static/static/js/{textarea.D47OO5VD.js → textarea.DQh9RYKV.js} +2 -2
- streamlit/static/static/js/{timepicker.Dq2FqiYO.js → timepicker.Br_cR0hi.js} +4 -4
- streamlit/static/static/js/{toConsumableArray.7OyX1dIj.js → toConsumableArray.CzYSWELu.js} +1 -1
- streamlit/static/static/js/{uniqueId.naIyoATl.js → uniqueId.BdUnRe3-.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.DH0ClB0l.js → useBasicWidgetState.6R32QW2v.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.3GZT2mEx.js → useOnInputChange.C4OiWI1_.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.BLeP_b5i.js +1 -0
- streamlit/user_info.py +8 -2
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/RECORD +75 -75
- streamlit/static/static/js/FileDropzone.uWzTac7M.js +0 -5
- streamlit/static/static/js/index.BUnE-2Mi.js +0 -201
- streamlit/static/static/js/index.BxBwZJQr.js +0 -1
- streamlit/static/static/js/index.CNYNhiEk.js +0 -1
- streamlit/static/static/js/index.CUKOkOB2.js +0 -197
- streamlit/static/static/js/index.Ceuq3IzZ.js +0 -1
- streamlit/static/static/js/index.ChSsIvr7.js +0 -3865
- streamlit/static/static/js/index.DKFH0WYB.js +0 -1
- streamlit/static/static/js/index.DQT0NMTW.js +0 -1
- streamlit/static/static/js/index.DiXeiIyQ.js +0 -1
- streamlit/static/static/js/index.Dl_RyApM.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.HzikaPlG.js +0 -1
- {streamlit_nightly-1.42.3.dev20250222.data → streamlit_nightly-1.42.3.dev20250224.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
import{r as p,E as V,_ as z,n as I,C as u,j as r,b4 as U,bo as g,co as E,bp as y,cp as L,aY as B,F as k,bh as W,R as N,az as T,bj as D,K as h,bl as H,bk as A,br as R,bE as $,bs as O,b9 as X,bt as _}from"./index.6zGrdP7S.js";import{a as S}from"./index.DW_MHI2K.js";import{F as K}from"./FormClearHelper.CEl0YyS3.js";import{S as x,I as j,b as q,c as G,d as Y,C as J,e as Q,f as Z,h as ee,i as te,g as b,F as f,j as se,k as ie,l as le,s as ae,m as re,n as ne}from"./FileDropzone.uWzTac7M.js";import{S as oe,P as de}from"./ProgressBar.DDliFXvs.js";import{u as ce}from"./Hooks.B_-0sclb.js";import{U as m}from"./UploadFileInfo.C-jY39rj.js";var C=p.forwardRef(function(l,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(V,z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},l,{ref:o}),p.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});C.displayName="Error";const pe=I("div",{target:"egc9vxm0"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:l.spacing.twoXS,marginBottom:l.spacing.twoXS})),ue=I("div",{target:"egc9vxm1"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"center",color:l.colors.fadedText40})),he=({currentPage:l,totalPages:o,onNext:e,onPrevious:t})=>u(pe,{"data-testid":"stFileUploaderPagination",children:[r(x,{children:`Showing page ${l} of ${o}`}),u(ue,{children:[r(y,{onClick:t,kind:U.MINIMAL,children:r(g,{content:E,size:"xl"})}),r(y,{onClick:e,kind:U.MINIMAL,children:r(g,{content:L,size:"xl"})})]})]}),w=(l,o)=>Math.ceil(l.length/o),ge=l=>B(({pageSize:e,items:t,resetOnAdd:s,...a})=>{const[i,n]=p.useState(0),[d,F]=p.useState(w(t,e)),c=ce(t);p.useEffect(()=>{c&&c.length!==t.length&&F(w(t,e)),c&&c.length<t.length?s&&n(0):i+1>=d&&n(d-1)},[t,i,e,c,s,d]);const v=()=>{n(Math.min(i+1,d-1))},M=()=>{n(Math.max(0,i-1))},P=t.slice(i*e,i*e+e);return u(k,{children:[r(l,{items:P,...a}),t.length>e?r(he,{pageSize:e,totalPages:d,currentPage:i+1,onNext:v,onPrevious:M}):null]})},l),me=({fileInfo:l})=>l.status.type==="uploading"?r(de,{value:l.status.progress,size:oe.SMALL}):l.status.type==="error"?u(te,{children:[r(Z,{"data-testid":"stFileUploaderFileErrorMessage",children:l.status.errorMessage}),r(ee,{children:r(g,{content:C,size:"lg"})})]}):l.status.type==="uploaded"?r(x,{children:b(l.size,f.Byte)}):null,fe=({fileInfo:l,onDelete:o})=>u(Q,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[r(q,{children:r(g,{content:j,size:"twoXL"})}),u(G,{className:"stFileUploaderFileData",children:[r(Y,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:l.name,children:l.name}),r(me,{fileInfo:l})]}),r("div",{"data-testid":"stFileUploaderDeleteBtn",children:r(y,{onClick:()=>o(l.id),kind:U.MINIMAL,children:r(g,{content:J,size:"lg"})})})]}),Fe=({items:l,onDelete:o})=>r(le,{children:l.map(e=>r(ie,{children:r(fe,{fileInfo:e,onDelete:o})},e.id))}),Ue=ge(Fe),ye=l=>r(se,{children:r(Ue,{...l})});class Se extends N.PureComponent{constructor(o){super(o),this.formClearHelper=new K,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:a}=this.props,i=s.getFileUploaderStateValue(t);T(e,i)||s.setFileUploaderStateValue(t,e,{fromUi:!0},a)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(e,t)=>{const{element:s}=this.props,{multipleFiles:a}=s;if(!a&&e.length===0&&t.length>1){const i=t.findIndex(n=>n.errors.length===1&&n.errors[0].code==="too-many-files");i>=0&&(e.push(t[i].file),t.splice(i,1))}if(this.props.uploadClient.fetchFileURLs(e).then(i=>{if(!a&&e.length>0){const n=this.state.files.find(d=>d.status.type!=="error");n&&(this.forceUpdatingStatus=!0,this.deleteFile(n.id),this.forceUpdatingStatus=!1)}D(i,e).forEach(([n,d])=>{this.uploadFile(n,d)})}).catch(i=>{this.addFiles(e.map(n=>new m(n.name,n.size,this.nextLocalFileId(),{type:"error",errorMessage:i})))}),t.length>0){const i=t.map(n=>{const{file:d}=n;return new m(d.name,d.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(n.errors[0].code,n.file)})});this.addFiles(i)}},this.uploadFile=(e,t)=>{const s=S.CancelToken.source(),a=new m(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,i=>this.onUploadProgress(i,a.id),s.token).then(()=>this.onUploadComplete(a.id,e)).catch(i=>{S.isCancel(i)||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:i?i.toString():"Unknown error"}))})},this.onUploadComplete=(e,t)=>{const s=this.getFile(e);h(s)||s.status.type!=="uploading"||this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.getErrorMessage=(e,t)=>{switch(e){case"file-too-large":return`File must be ${b(this.maxUploadSizeInBytes,f.Byte)} or smaller.`;case"file-invalid-type":return`${t.type} files are not allowed.`;case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},this.deleteFile=e=>{const t=this.getFile(e);h(t)||(t.status.type==="uploading"&&t.status.cancelToken.cancel(),t.status.type==="uploaded"&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(t=>({files:[...t.files,e]}))},this.addFiles=e=>{this.setState(t=>({files:[...t.files,...e]}))},this.removeFile=e=>{this.setState(t=>({files:t.files.filter(s=>s.id!==e)}))},this.getFile=e=>this.state.files.find(t=>t.id===e),this.updateFile=(e,t)=>{this.setState(s=>({files:s.files.map(a=>a.id===e?t:a)}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(h(s)||s.status.type!=="uploading")return;const a=Math.round(e.loaded*100/e.total);s.status.progress!==a&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:a}))},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(h(e))return;const{widgetMgr:t,element:s,fragmentId:a}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},a)})},this.state=this.initialValue}get initialValue(){const o={files:[],newestServerFileId:0},{widgetMgr:e,element:t}=this.props,s=e.getFileUploaderStateValue(t);if(h(s))return o;const{uploadedFileInfo:a}=s;return h(a)||a.length===0?o:{files:a.map(i=>{const n=i.name,d=i.size,F=i.fileId,c=i.fileUrls;return new m(n,d,this.nextLocalFileId(),{type:"uploaded",fileId:F,fileUrls:c})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const o=this.props.element.maxUploadSizeMb;return ae(o,f.Megabyte,f.Byte)}get status(){const o=e=>e.status.type==="uploading";return this.state.files.some(o)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const o=this.createWidgetValue(),{element:e,widgetMgr:t,fragmentId:s}=this.props;t.getFileUploaderStateValue(e)===void 0&&t.setFileUploaderStateValue(e,o,{fromUi:!1},s)}createWidgetValue(){const o=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:t,size:s,status:a}=e,{fileId:i,fileUrls:n}=a;return new H({fileId:i,fileUrls:n,name:t,size:s})});return new A({uploadedFileInfo:o})}render(){var d;const{files:o}=this.state,{element:e,disabled:t,widgetMgr:s,width:a}=this.props,i=e.type;this.formClearHelper.manageFormClearListener(s,e.formId,this.onFormCleared);const n=o.slice().reverse();return u(ne,{className:"stFileUploader","data-testid":"stFileUploader",width:a,children:[r(_,{label:e.label,disabled:t,labelVisibility:R((d=e.labelVisibility)==null?void 0:d.value),children:e.help&&r($,{children:r(O,{content:e.help,placement:X.TOP_RIGHT})})}),r(re,{onDrop:this.dropHandler,multiple:e.multipleFiles,acceptedExtensions:i,maxSizeBytes:this.maxUploadSizeInBytes,label:e.label,disabled:t}),n.length>0&&r(ye,{items:n,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Pe=W(p.memo(Se));export{Pe as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as s,E as N,_ as $,n as u,D as ht,y as Y,j as n,b9 as J,bu as ft,C as S,bp as Q,b4 as Z,bo as U,a_ as mt,bF as yt,bj as vt,bG as I,bs as wt,F as tt,bg as Ct,bH as It,K as B,bl as bt,bk as xt}from"./index.6zGrdP7S.js";import{g as St,F as zt,C as Ft,I as Et,E as Ut,u as Ht,a as Tt}from"./FileDropzone.uWzTac7M.js";import{I as Dt}from"./InputInstructions.M8GsfWtP.js";import{i as kt}from"./inputUtils.CQWz5UKz.js";import{a as G}from"./index.DW_MHI2K.js";import{U as V}from"./UploadFileInfo.C-jY39rj.js";import{T as Bt}from"./textarea.D47OO5VD.js";import"./base-input.Dz6cKnV_.js";var et=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.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"}))});et.displayName="AttachFile";var ot=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.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"}))});ot.displayName="ErrorOutline";var nt=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.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"}))});nt.displayName="Send";const Rt=u("div",{target:"e1djkbjp0"})("border:none;position:relative;display:flex;"),Lt=u("div",{target:"e1djkbjp1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor: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}})),Mt=u("button",{target:"e1djkbjp2"})(({theme:t,disabled:e,extended:l})=>{const d=ht(t),[f,g]=d?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.chatInput,borderTopLeftRadius:l?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:g,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:d?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"}}}),Vt=u("div",{target:"e1djkbjp3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),Nt=u("div",{target:"e1djkbjp4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),$t=u("div",{target:"ewqvugz0"})(({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})),At=u("div",{target:"ewqvugz1"})(({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})),Wt=u("div",{target:"ewqvugz2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),qt=u("div",{target:"ewqvugz3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),Pt=u("div",{target:"ewqvugz4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),jt=u("div",{target:"ewqvugz5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Kt=u("div",{target:"ewqvugz6"})(({})=>({display:"flex"})),Ot=u("div",{target:"ewqvugz7"})(({})=>({flex:"0 0 auto"})),_t=u("div",{target:"ewqvugz8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Xt=u("div",{target:"ewqvugz9"})(({theme:t})=>({color:t.colors.fadedText60})),Gt=u("div",{target:"ewqvugz10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Yt=u("div",{target:"ewqvugz11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Jt=u("small",{target:"ewqvugz12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Qt({children:t,content:e}){const l=Y();return n(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${l.sizes.minElementHeight}`}}},children:t})}const Zt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return n(yt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(Qt,{content:t.status.errorMessage,children:n(U,{content:ot,size:"lg"})});case"uploaded":return n(U,{content:Et,size:"lg"});default:return mt(e),null}},te=({fileInfo:t,onDelete:e})=>S(_t,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(Xt,{children:n(Zt,{fileInfo:t})}),n(Gt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(Yt,{children:St(t.size,zt.Byte)}),n(Jt,{"data-testid":"stChatInputDeleteBtn",children:n(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:n(U,{content:Ft,size:"lg"})})})]}),ee=({items:t,onDelete:e})=>n(jt,{"data-testid":"stChatUploadedFiles",children:n(Kt,{children:t.map(l=>n(Ot,{children:n(te,{fileInfo:l,onDelete:e})},l.id))})}),oe=({getNextLocalFileId:t,addFiles:e,updateFile:l,uploadClient:d,element:f,onUploadProgress:g,onUploadComplete:m})=>(v,h)=>{const y=G.CancelToken.source(),c=new V(h.name,h.size,t(),{type:"uploading",cancelToken:y,progress:1});e([c]),d.uploadFile({formId:"",...f},v.uploadUrl,h,p=>g(p,c.id),y.token).then(()=>m(c.id,v)).catch(p=>{G.isCancel(p)||l(c.id,c.setStatus({type:"error",errorMessage:p?p.toString():"Unknown error"}))})},ne=({acceptMultipleFiles:t,uploadClient:e,uploadFile:l,addFiles:d,getNextLocalFileId:f,deleteExistingFiles:g,onUploadComplete:m})=>(v,h)=>{if(!t&&v.length===0&&h.length>1){const y=h.findIndex(c=>{var p;return((p=c.errors)==null?void 0:p[0].code)===Ut.TooManyFiles});y>=0&&(v.push(h[y].file),h.splice(y,1))}if(!t&&v.length>0&&g(),e.fetchFileURLs(v).then(y=>{vt(y,v).forEach(([c,p])=>{l(c,p)})}).catch(y=>{d(v.map(c=>new V(c.name,c.size,f(),{type:"error",errorMessage:y})))}),h.length>0){const y=h.map(c=>new V(c.file.name,c.file.size,f(),{type:"error",errorMessage:c.errors.map(p=>p.message).filter(p=>!!p).join(", ")}));d(y)}m()},re=({getRootProps:t,getInputProps:e,acceptFile:l,disabled:d,theme:f})=>S(Wt,{disabled:d,children:[S(qt,{"data-testid":"stChatInputFileUploadButton",disabled:d,...t(),children:[n("input",{...e()}),n(wt,{content:`Upload or drag and drop ${l===I.Multiple?"files":"a file"}`,placement:J.TOP,onMouseEnterDelay:500,children:n(Q,{kind:Z.MINIMAL,disabled:d,children:n(U,{content:et,size:"lg",color:d?f.colors.fadedText40:f.colors.fadedText60})})})]}),n(Pt,{})]}),ae=({getRootProps:t,getInputProps:e,acceptFile:l,inputHeight:d})=>S(tt,{children:[n($t,{height:d,...t(),children:n("input",{...e()})}),n(At,{height:d,children:`Drag and drop ${l===I.Multiple?"files":"a file"} here`})]}),ie=6.5,R=1,L=(t,e,l)=>l.map(d=>d.id===t?e:d),M=(t,e)=>e.find(l=>l.id===t);function se({disabled:t,element:e,widgetMgr:l,fragmentId:d,uploadClient:f}){const g=Y(),m=s.useRef(null),v=s.useRef(0),h=s.useRef({minHeight:0,maxHeight:0}),{values:[y],elementRef:c}=Ct(s.useMemo(()=>["width"],[])),[p,T]=s.useState(!1),[z,D]=s.useState(e.default),[F,A]=s.useState(0),[H,rt]=s.useState(!1),[b,x]=s.useState([]),[E,k]=s.useState(!1),C=It(e.acceptFile),W=s.useCallback(o=>x(r=>[...r,...o]),[]),q=s.useCallback(o=>{x(r=>{const i=M(o,r);return B(i)?r:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&f.deleteFile(i.status.fileUrls.deleteUrl),r.filter(a=>a.id!==o))})},[f]),at=()=>{const o=b.filter(r=>r.status.type==="uploaded").map(r=>{const{name:i,size:a,status:w}=r,{fileId:ut,fileUrls:gt}=w;return new bt({fileId:ut,fileUrls:gt,name:i,size:a})});return new xt({uploadedFileInfo:o})},P=()=>v.current++,it=ne({acceptMultipleFiles:C===I.Multiple,uploadClient:f,uploadFile:oe({getNextLocalFileId:P,addFiles:W,updateFile:(o,r)=>{x(i=>L(o,r,i))},uploadClient:f,element:e,onUploadProgress:(o,r)=>{x(i=>{const a=M(r,i);if(B(a)||a.status.type!=="uploading")return i;const w=Math.round(o.loaded*100/o.total);return a.status.progress===w?i:L(r,a.setStatus({type:"uploading",cancelToken:a.status.cancelToken,progress:w}),i)})},onUploadComplete:(o,r)=>{x(i=>{const a=M(o,i);return B(a)||a.status.type!=="uploading"?i:L(a.id,a.setStatus({type:"uploaded",fileId:r.fileId,fileUrls:r}),i)})}}),addFiles:W,getNextLocalFileId:P,deleteExistingFiles:()=>b.forEach(o=>q(o.id)),onUploadComplete:()=>{m.current&&m.current.focus()}}),{getRootProps:j,getInputProps:K}=Ht({onDrop:it,multiple:C===I.Multiple,accept:Tt(e.fileType)}),st=()=>{let o=0;const{current:r}=m;if(r){const i=r.placeholder;r.placeholder="",r.style.height="auto",o=r.scrollHeight,r.placeholder=i,r.style.height=""}return o},O=()=>{if(m.current&&m.current.focus(),!p||t)return;const o={data:z,fileUploaderState:at()};l.setChatInputValue(e,o,{fromUi:!0},d),T(!1),x([]),D(""),A(0)},lt=o=>{const{metaKey:r,ctrlKey:i,shiftKey:a}=o;kt(o)&&!a&&!i&&!r&&(o.preventDefault(),O())},dt=o=>{const{value:r}=o.target,{maxChars:i}=e;i!==0&&r.length>i||(D(r),A(st()))};s.useEffect(()=>b.some(o=>o.status.type==="uploading")?T(!1):T(z!==""||b.length>0),[b,z]),s.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";D(o)}},[e]),s.useEffect(()=>{if(m.current){const{offsetHeight:o}=m.current;h.current.minHeight=o,h.current.maxHeight=o*ie}},[m]),s.useEffect(()=>{const o=a=>{var w;a.preventDefault(),a.stopPropagation(),!E&&((w=a.dataTransfer)!=null&&w.types.includes("Files"))&&k(!0)},r=a=>{a.preventDefault(),a.stopPropagation(),E&&(a.clientX<=0&&a.clientY<=0||a.clientX>=window.innerWidth&&a.clientY>=window.innerHeight)&&k(!1)},i=a=>{a.preventDefault(),a.stopPropagation(),E&&k(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",r),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",r)}},[E]),s.useEffect(()=>{const{minHeight:o}=h.current;rt(F>0&&m.current?Math.abs(F-o)>R:!1)},[F]);const{placeholder:_,maxChars:ct}=e,{maxHeight:X}=h.current,pt=C!==I.None&&E;return S(tt,{children:[C===I.None?null:n(ee,{items:[...b],onDelete:q}),n(Rt,{className:"stChatInput","data-testid":"stChatInput",ref:c,children:pt?n(ae,{getRootProps:j,getInputProps:K,acceptFile:C,inputHeight:H?`${F+R}px`:g.sizes.minElementHeight}):S(Lt,{extended:H,children:[C===I.None?null:n(re,{getRootProps:j,getInputProps:K,acceptFile:C,disabled:t,theme:g}),n(Bt,{inputRef:m,value:z,placeholder:_,onChange:dt,onKeyDown:lt,"aria-label":_,disabled:t,rows:1,overrides:{Root:{style:{minHeight:g.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:g.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:H?`${F+R}px`:"auto",maxHeight:X?`${X}px`:"none",paddingLeft:g.spacing.none,paddingBottom:g.spacing.sm,paddingTop:g.spacing.sm,paddingRight:`calc(${g.iconSizes.xl} + 2 * ${g.spacing.sm} + ${g.spacing.sm})`}}}}),y>g.breakpoints.hideWidgetDetails&&n(Nt,{children:n(Dt,{dirty:p,value:z,maxLength:ct,type:"chat",inForm:!1})}),n(Vt,{children:n(Mt,{onClick:O,disabled:!p||t,extended:H,"data-testid":"stChatInputSubmitButton",children:n(U,{content:nt,size:"xl",color:"inherit"})})})]})})]})}const me=s.memo(se);export{me as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as s,bg as U,y as k,cq as x,C as A,j as l,br as L,bE as P,bs as B,b9 as D,bt as j}from"./index.6zGrdP7S.js";import{u as w}from"./uniqueId.naIyoATl.js";import{u as O,a as _,b as q}from"./useOnInputChange.3GZT2mEx.js";import{I as K}from"./InputInstructions.M8GsfWtP.js";import{a as $}from"./useBasicWidgetState.DH0ClB0l.js";import{T as G}from"./textarea.D47OO5VD.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.CEl0YyS3.js";import"./base-input.Dz6cKnV_.js";const T=(a,t)=>a.getStringValue(t)??t.default??null,N=a=>a.default??null,J=a=>a.value??null,M=(a,t,o,u)=>{t.setStringValue(a,o.value,{fromUi:o.fromUi},u)},Q=({disabled:a,element:t,widgetMgr:o,fragmentId:u})=>{var f;const h=s.useRef(w("text_area_")).current,{values:[W],elementRef:S}=U(s.useMemo(()=>["width"],[])),[r,n]=s.useState(!1),[y,b]=s.useState(!1),[i,d]=s.useState(T(o,t)??null),I=s.useCallback(()=>{d(t.default??null),n(!0)},[t]),[C,c]=$({getStateFromWidgetMgr:T,getDefaultStateFromProto:N,getCurrStateFromProto:J,updateWidgetMgrState:M,element:t,widgetMgr:o,fragmentId:u,onFormCleared:I});O(C,i,d,r);const e=k(),m=s.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),V=s.useCallback(()=>{r&&m(),b(!1)},[r,m]),v=s.useCallback(()=>{b(!0)},[]),F=_({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),E=q(t.formId,m,r,o,u,!0),{height:g,placeholder:R,formId:p}=t,z=x({formId:p})?o.allowFormEnterToSubmit(p):r,H=y&&W>e.breakpoints.hideWidgetDetails;return A("div",{className:"stTextArea","data-testid":"stTextArea",ref:S,children:[l(j,{label:t.label,disabled:a,labelVisibility:L((f=t.labelVisibility)==null?void 0:f.value),htmlFor:h,children:t.help&&l(P,{children:l(B,{content:t.help,placement:D.TOP_RIGHT})})}),l(G,{value:i??"",placeholder:R,onBlur:V,onFocus:v,onChange:F,onKeyDown:E,"aria-label":t.label,disabled:a,id:h,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:g?`${g}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:e.spacing.lg,paddingLeft:e.spacing.lg,paddingBottom:e.spacing.lg,paddingTop:e.spacing.lg}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),H&&l(K,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:x({formId:p}),allowEnterToSubmit:z})]})},it=s.memo(Q);export{it as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as o,E as G,_ as X,n as x,y as ut,bg as ct,cq as dt,M as J,cA as I,K as b,C as N,j as u,br as pt,bE as ft,bs as bt,b9 as mt,bt as gt,bo as M,aq as ht}from"./index.6zGrdP7S.js";import{s as yt}from"./sprintf.D7DtBTRn.js";import{u as It}from"./uniqueId.naIyoATl.js";import{u as Tt}from"./FormClearHelper.CEl0YyS3.js";import{I as wt}from"./InputInstructions.M8GsfWtP.js";import{I as Ct}from"./input.DqK048_c.js";import"./base-input.Dz6cKnV_.js";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(G,X({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Y=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(G,X({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const vt=x("div",{target:"e5tuigk0"})(({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.secondaryBg,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}}})),St=x("div",{target:"e5tuigk1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),q=x("button",{target:"e5tuigk2"})(({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.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}})),Vt=x("div",{target:"e5tuigk3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),kt=ht.getLogger("NumberInput");function xt(t){return b(t)||t===""?void 0:t}const Rt=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,K=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),z=({value:t,format:e,step:r,dataType:f})=>{if(b(t))return null;let n=xt(e);if(b(n)&&J(r)){const d=r.toString();f===I.DataType.FLOAT&&r!==0&&d.includes(".")&&(n=`%0.${d.split(".")[1].length}f`)}if(b(n))return t.toString();try{return yt.sprintf(n,t)}catch(d){return kt.warn(`Error in sprintf(${n}, ${t}): ${d}`),String(t)}},Dt=(t,e,r)=>b(t)?!1:t-e>=r,Et=(t,e,r)=>b(t)?!1:t+e<=r,Ft=({disabled:t,element:e,widgetMgr:r,fragmentId:f})=>{var j;const n=ut(),{dataType:d,id:C,formId:p,default:W,format:B}=e,m=e.hasMin?e.min:-1/0,g=e.hasMax?e.max:1/0,{values:[A],elementRef:Z}=ct(o.useMemo(()=>["width"],[])),[s,tt]=o.useState(K(e)),H=Rt({element:e,widgetMgr:r}),[h,T]=o.useState(!1),[i,w]=o.useState(H),[P,v]=o.useState(z({value:H,...e,step:s})),[L,U]=o.useState(!1),R=o.useRef(null),$=o.useRef(It("number_input_")),S=Dt(i,s,m),V=Et(i,s,g),O=dt({formId:p}),et=O?r.allowFormEnterToSubmit(p):h,ot=L&&A>n.breakpoints.hideWidgetDetails;o.useEffect(()=>{tt(K({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const l=o.useCallback(({value:a,source:c})=>{var y;if(J(a)&&(m>a||a>g))(y=R.current)==null||y.reportValidity();else{const k=a??W??null;switch(d){case I.DataType.INT:r.setIntValue({id:C,formId:p},k,c,f);break;case I.DataType.FLOAT:r.setDoubleValue({id:C,formId:p},k,c,f);break;default:throw new Error("Invalid data type")}T(!1),w(k),v(z({value:k,dataType:d,format:B,step:s}))}},[m,g,R,r,f,s,d,C,p,W,B]),rt=o.useCallback(()=>{h&&l({value:i,source:{fromUi:!0}}),U(!1)},[h,i,l]),nt=o.useCallback(()=>{U(!0)},[]),_=o.useCallback(()=>{const{value:a}=e;e.setValue=!1,w(a??null),v(z({value:a??null,...e,step:s})),l({value:a??null,source:{fromUi:!1}})},[e,s,l]);o.useEffect(()=>{e.setValue?_():l({value:i,source:{fromUi:!1}})},[]),e.setValue&&_();const D=b(e.default)&&!t,at=o.useCallback(()=>{const a=e.default??null;w(a),l({value:a,source:{fromUi:!0}})},[e]);Tt({element:e,widgetMgr:r,onFormCleared:at});const st=a=>{const{value:c}=a.target;if(c==="")T(!0),w(null),v(null);else{let y;e.dataType===I.DataType.INT?y=parseInt(c,10):y=parseFloat(c),T(!0),w(y),v(c)}},E=o.useCallback(()=>{V&&(T(!0),l({value:(i??m)+s,source:{fromUi:!0}}))},[i,m,s,V]),F=o.useCallback(()=>{S&&(T(!0),l({value:(i??g)-s,source:{fromUi:!0}}))},[i,g,s,S]),it=o.useCallback(a=>{const{key:c}=a;switch(c){case"ArrowUp":a.preventDefault(),E();break;case"ArrowDown":a.preventDefault(),F();break}},[E,F]),lt=o.useCallback(a=>{a.key==="Enter"&&(h&&l({value:i,source:{fromUi:!0}}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,f))},[h,i,l,r,p,f]);return N("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Z,children:[u(gt,{label:e.label,disabled:t,labelVisibility:pt((j=e.labelVisibility)==null?void 0:j.value),htmlFor:$.current,children:e.help&&u(ft,{children:u(bt,{content:e.help,placement:mt.TOP_RIGHT})})}),N(vt,{className:L?"focused":"","data-testid":"stNumberInputContainer",children:[u(Ct,{type:"number",inputRef:R,value:P??"",placeholder:e.placeholder,onBlur:rt,onFocus:nt,onChange:st,onKeyPress:lt,onKeyDown:it,clearable:D,clearOnEscape:D,disabled:t,"aria-label":e.label,id:$.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:n.colors.darkGray,padding:n.spacing.threeXS,height:n.sizes.clearIconSize,width:n.sizes.clearIconSize,":hover":{fill:n.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:m,max:g,type:"number",inputMode:""},style:{lineHeight:n.lineHeights.inputWidget,paddingRight:n.spacing.sm,paddingLeft:n.spacing.sm,paddingBottom:n.spacing.sm,paddingTop:n.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),A>n.breakpoints.hideNumberInputControls&&N(St,{children:[u(q,{"data-testid":"stNumberInputStepDown",onClick:F,disabled:!S||t,tabIndex:-1,children:u(M,{content:Q,size:"xs",color:S?"inherit":n.colors.disabled})}),u(q,{"data-testid":"stNumberInputStepUp",onClick:E,disabled:!V||t,tabIndex:-1,children:u(M,{content:Y,size:"xs",color:V?"inherit":n.colors.disabled})})]})]}),ot&&u(Vt,{clearable:D,children:u(wt,{dirty:h,value:P??"",inForm:O,allowEnterToSubmit:et})})]})},Lt=o.memo(Ft);export{Lt as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as p,r as n,aC as x,bf as y,y as h,bg as C,j as i,aY as w}from"./index.6zGrdP7S.js";const b=p("div",{target:"ek8upll0"})(({theme:e,isExpanded:t})=>({width:"100%",...t?{position:"fixed",top:0,left:0,bottom:0,right:0,background:e.colors.bgColor,zIndex:e.zIndices.fullscreenWrapper,padding:e.spacing.md,paddingTop:e.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}})),f=n.createContext(null);f.displayName="ElementFullscreenContext";const v=e=>{const t=n.useContext(e);if(t==null)throw new Error(`useRequiredContext: ${e.displayName??"context"} not found`);return t},g=()=>{const{setFullScreen:e}=n.useContext(x),[t,u]=n.useState(!1),{fullHeight:s,fullWidth:c}=v(y),o=n.useCallback(a=>{u(a),e(a)},[e]),d=n.useCallback(()=>{document.body.style.overflow="hidden",o(!0)},[o]),l=n.useCallback(()=>{document.body.style.overflow="unset",o(!1)},[o]),r=n.useCallback(a=>{a.keyCode===27&&t&&l()},[l,t]);return n.useEffect(()=>(document.addEventListener("keydown",r,!1),()=>{document.removeEventListener("keydown",r,!1)}),[r]),n.useMemo(()=>({expanded:t,zoomIn:d,zoomOut:l,fullHeight:s,fullWidth:c}),[t,d,l,s,c])},F=({children:e,height:t})=>{const u=h(),{expanded:s,fullHeight:c,fullWidth:o,zoomIn:d,zoomOut:l}=g(),{values:[r],elementRef:a}=C(n.useMemo(()=>["width"],[])),m=n.useMemo(()=>({width:s?o:r,height:s?c:t,expanded:s,expand:d,collapse:l}),[s,c,o,t,r,d,l]);return i(f.Provider,{value:m,children:i(b,{ref:a,isExpanded:s,"data-testid":"stFullScreenFrame",theme:u,children:e})})};function E(e){const t=u=>i(F,{children:i(e,{...u})});return t.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,w(t,e)}export{f as E,v as u,E as w};
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|