streamlit-nightly 1.45.2.dev20250520__py3-none-any.whl → 1.45.2.dev20250522__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/config.py +18 -5
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.CYnuXr-f.js → ErrorOutline.esm.CudC4cnG.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.CjkhjFuL.js → FileDownload.esm.qn_AyTtU.js} +1 -1
- streamlit/static/static/js/{FileHelper.CvjfDg2R.js → FileHelper.BWuvkxif.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.DieF97Af.js → FormClearHelper.CHYZBZGR.js} +1 -1
- streamlit/static/static/js/{Hooks.B1Hx6FYs.js → Hooks.aQtyO1Es.js} +1 -1
- streamlit/static/static/js/{InputInstructions.B8AIK0e4.js → InputInstructions.u4jPRzPB.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BVxh16au.js → ProgressBar.CG44OwiE.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.DRyuwMyI.js → RenderInPortalIfExists.VXXdANh0.js} +1 -1
- streamlit/static/static/js/{Toolbar.3K8i84rX.js → Toolbar.e8AKFI20.js} +1 -1
- streamlit/static/static/js/{base-input.C1EhHiwL.js → base-input.D7ucWcOg.js} +1 -1
- streamlit/static/static/js/{checkbox.DQdrfkU_.js → checkbox.B9R-wnB7.js} +1 -1
- streamlit/static/static/js/{createSuper.DTmFPsVr.js → createSuper.C1ofFeAG.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CPiIqh8K.js → data-grid-overlay-editor.DtdlN29o.js} +1 -1
- streamlit/static/static/js/{downloader.C4KaNzxK.js → downloader.amlkJvLF.js} +1 -1
- streamlit/static/static/js/{es6.2nWKWyMO.js → es6.Bx1hXnS0.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DOVaChyF.js → iframeResizer.contentWindow.DgHMAYbI.js} +1 -1
- streamlit/static/static/js/{index.BPnbqXpq.js → index.1mfAtb9U.js} +1 -1
- streamlit/static/static/js/{index.Bcm9abjs.js → index.7CBT51EL.js} +1 -1
- streamlit/static/static/js/{index.tW6ORFdt.js → index.B8eTe00V.js} +1 -1
- streamlit/static/static/js/{index.DZ1uB38i.js → index.BD_oIhGF.js} +1 -1
- streamlit/static/static/js/{index.mFs4Hj36.js → index.BWuE2_HE.js} +1 -1
- streamlit/static/static/js/{index.Csqhk1Jf.js → index.BaaFPBjg.js} +1 -1
- streamlit/static/static/js/{index.BzBFnPX6.js → index.BdDyuQmj.js} +1 -1
- streamlit/static/static/js/{index.InQfrcIt.js → index.Bdy3ZPdq.js} +1 -1
- streamlit/static/static/js/{index.CoUTSHXm.js → index.BgTPKzvI.js} +1 -1
- streamlit/static/static/js/{index.BZrvTwVD.js → index.BmoykTHR.js} +1 -1
- streamlit/static/static/js/{index.BT_313OI.js → index.Bn5K9Bd_.js} +1 -1
- streamlit/static/static/js/{index.CxAOY3A6.js → index.Bna1CU8i.js} +1 -1
- streamlit/static/static/js/{index.BNYIeVmg.js → index.Bon8EwWL.js} +1 -1
- streamlit/static/static/js/{index.C9p4my_G.js → index.BqEJFCLf.js} +1 -1
- streamlit/static/static/js/{index.VSUuNjWj.js → index.BtNqOUEO.js} +1 -1
- streamlit/static/static/js/{index.DSTk15fA.js → index.C0T_M4GD.js} +1 -1
- streamlit/static/static/js/{index.23pPuDjr.js → index.C3vs9CpH.js} +1 -1
- streamlit/static/static/js/{index.C6IpjREC.js → index.CMLTPeKt.js} +5 -5
- streamlit/static/static/js/index.CNh3_B-b.js +2 -0
- streamlit/static/static/js/{index.B-40SN8a.js → index.CQRM5-Cg.js} +1 -1
- streamlit/static/static/js/{index.DSqmiAEF.js → index.CYHkBSAi.js} +1 -1
- streamlit/static/static/js/{index.Cz7YuCRg.js → index.D08mj5Od.js} +1 -1
- streamlit/static/static/js/{index.CR5G6E_h.js → index.D5GJYvYX.js} +1 -1
- streamlit/static/static/js/{index.C5QL_Xc_.js → index.D97xl78q.js} +4 -4
- streamlit/static/static/js/{index.D-7j7tdp.js → index.DE1gGOzc.js} +1 -1
- streamlit/static/static/js/{index.Bh-zaqn6.js → index.DN4Mx7FE.js} +1 -1
- streamlit/static/static/js/{index.Bu_wWseL.js → index.DNwNuLWE.js} +1 -1
- streamlit/static/static/js/{index.DerK8bdM.js → index.DQ5EXoB_.js} +1 -1
- streamlit/static/static/js/{index.DucZyI7j.js → index.DUennCN8.js} +1 -1
- streamlit/static/static/js/{index.DBp4KGpt.js → index.DZf_kpi0.js} +1 -1
- streamlit/static/static/js/{index.DxkI2mS0.js → index.DiBs3xkT.js} +1 -1
- streamlit/static/static/js/{index.Cz8OuaJg.js → index.DlKdkJEq.js} +1 -1
- streamlit/static/static/js/{index.Dh4ndZnq.js → index.DxHtKYyS.js} +2 -2
- streamlit/static/static/js/{index.B0p5dBNu.js → index.N0sZYfFM.js} +1 -1
- streamlit/static/static/js/{index.jOftLS0z.js → index.Or4BfcX_.js} +1 -1
- streamlit/static/static/js/{index.CO8q3_vh.js → index.VzRep4kY.js} +1 -1
- streamlit/static/static/js/{index.BUb9IRAO.js → index.Yu7J_Dze.js} +1 -1
- streamlit/static/static/js/{input.ut_XFtNH.js → input.CRcaB9oP.js} +1 -1
- streamlit/static/static/js/{memory.DSoAMmQE.js → memory.F9D6Oyjj.js} +1 -1
- streamlit/static/static/js/{mergeWith.BY-TWxsL.js → mergeWith.BYtZfcmi.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.D5sSj_3j.js → number-overlay-editor.ClWmQbhW.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.BNBjNW5N.js → possibleConstructorReturn.BHxvTsgt.js} +1 -1
- streamlit/static/static/js/{sandbox.BXmhoUqL.js → sandbox.9HJbznr2.js} +1 -1
- streamlit/static/static/js/{textarea.qz8i3H9z.js → textarea.MC6GQYce.js} +1 -1
- streamlit/static/static/js/{timepicker.CZROecqL.js → timepicker.BJLSDuQc.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.BoolbIbO.js → toConsumableArray.BxOYujrG.js} +1 -1
- streamlit/static/static/js/{uniqueId.DFKK3fms.js → uniqueId.nweXvThW.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.QKx5EFIj.js → useBasicWidgetState.ByOGmtKn.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CpgAX3wz.js → useOnInputChange.oE3yUL9n.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.DrAgwq5e.js → withFullScreenWrapper.Cg-VqiDm.js} +1 -1
- streamlit/web/server/__init__.py +6 -2
- streamlit/web/server/component_request_handler.py +6 -2
- streamlit/web/server/media_file_handler.py +10 -4
- streamlit/web/server/routes.py +18 -8
- streamlit/web/server/server_util.py +10 -1
- streamlit/web/server/stats_request_handler.py +5 -3
- streamlit/web/server/upload_file_request_handler.py +4 -2
- {streamlit_nightly-1.45.2.dev20250520.dist-info → streamlit_nightly-1.45.2.dev20250522.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.45.2.dev20250520.dist-info → streamlit_nightly-1.45.2.dev20250522.dist-info}/RECORD +81 -81
- streamlit/static/static/js/index.C9oHDNvg.js +0 -2
- {streamlit_nightly-1.45.2.dev20250520.data → streamlit_nightly-1.45.2.dev20250522.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.45.2.dev20250520.dist-info → streamlit_nightly-1.45.2.dev20250522.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.45.2.dev20250520.dist-info → streamlit_nightly-1.45.2.dev20250522.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.45.2.dev20250520.dist-info → streamlit_nightly-1.45.2.dev20250522.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,2 @@
|
|
1
|
+
import{n as Vt,r as gt,j as lt,F as $t}from"./index.D97xl78q.js";/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:At,setPrototypeOf:ct,isFrozen:qt,getPrototypeOf:Kt,getOwnPropertyDescriptor:Zt}=Object;let{freeze:S,seal:y,create:ht}=Object,{apply:we,construct:xe}=typeof Reflect<"u"&&Reflect;S||(S=function(n){return n});y||(y=function(n){return n});we||(we=function(n,s,l){return n.apply(s,l)});xe||(xe=function(n,s){return new n(...s)});const le=R(Array.prototype.forEach),Jt=R(Array.prototype.lastIndexOf),ft=R(Array.prototype.pop),$=R(Array.prototype.push),Qt=R(Array.prototype.splice),fe=R(String.prototype.toLowerCase),De=R(String.prototype.toString),ut=R(String.prototype.match),q=R(String.prototype.replace),en=R(String.prototype.indexOf),tn=R(String.prototype.trim),L=R(Object.prototype.hasOwnProperty),h=R(RegExp.prototype.test),K=nn(TypeError);function R(a){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var s=arguments.length,l=new Array(s>1?s-1:0),T=1;T<s;T++)l[T-1]=arguments[T];return we(a,n,l)}}function nn(a){return function(){for(var n=arguments.length,s=new Array(n),l=0;l<n;l++)s[l]=arguments[l];return xe(a,s)}}function r(a,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fe;ct&&ct(a,null);let l=n.length;for(;l--;){let T=n[l];if(typeof T=="string"){const D=s(T);D!==T&&(qt(n)||(n[l]=D),T=D)}a[T]=!0}return a}function on(a){for(let n=0;n<a.length;n++)L(a,n)||(a[n]=null);return a}function C(a){const n=ht(null);for(const[s,l]of At(a))L(a,s)&&(Array.isArray(l)?n[s]=on(l):l&&typeof l=="object"&&l.constructor===Object?n[s]=C(l):n[s]=l);return n}function Z(a,n){for(;a!==null;){const l=Zt(a,n);if(l){if(l.get)return R(l.get);if(typeof l.value=="function")return R(l.value)}a=Kt(a)}function s(){return null}return s}const mt=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ne=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ie=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),an=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Me=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),rn=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pt=S(["#text"]),dt=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ce=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Tt=S(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ce=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sn=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ln=y(/<%[\w\W]*|[\w\W]*%>/gm),cn=y(/\$\{[\w\W]*/gm),fn=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),un=y(/^aria-[\-\w]+$/),St=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mn=y(/^(?:\w+script|data):/i),pn=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rt=y(/^html$/i),dn=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var _t=Object.freeze({__proto__:null,ARIA_ATTR:un,ATTR_WHITESPACE:pn,CUSTOM_ELEMENT:dn,DATA_ATTR:fn,DOCTYPE_NAME:Rt,ERB_EXPR:ln,IS_ALLOWED_URI:St,IS_SCRIPT_OR_DATA:mn,MUSTACHE_EXPR:sn,TMPLIT_EXPR:cn});const J={element:1,text:3,progressingInstruction:7,comment:8,document:9},Tn=function(){return typeof window>"u"?null:window},_n=function(n,s){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let l=null;const T="data-tt-policy-suffix";s&&s.hasAttribute(T)&&(l=s.getAttribute(T));const D="dompurify"+(l?"#"+l:"");try{return n.createPolicy(D,{createHTML(x){return x},createScriptURL(x){return x}})}catch{return console.warn("TrustedTypes policy "+D+" could not be created."),null}},Et=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ot(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tn();const n=i=>Ot(i);if(n.version="3.2.6",n.removed=[],!a||!a.document||a.document.nodeType!==J.document||!a.Element)return n.isSupported=!1,n;let{document:s}=a;const l=s,T=l.currentScript,{DocumentFragment:D,HTMLTemplateElement:x,Node:ue,Element:ve,NodeFilter:G,NamedNodeMap:yt=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:Lt,DOMParser:bt,trustedTypes:Q}=a,W=ve.prototype,Dt=Z(W,"cloneNode"),Nt=Z(W,"remove"),It=Z(W,"nextSibling"),Mt=Z(W,"childNodes"),ee=Z(W,"parentNode");if(typeof x=="function"){const i=s.createElement("template");i.content&&i.content.ownerDocument&&(s=i.content.ownerDocument)}let g,B="";const{implementation:me,createNodeIterator:Ct,createDocumentFragment:wt,getElementsByTagName:xt}=s,{importNode:Pt}=l;let A=Et();n.isSupported=typeof At=="function"&&typeof ee=="function"&&me&&me.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:pe,ERB_EXPR:de,TMPLIT_EXPR:Te,DATA_ATTR:kt,ARIA_ATTR:vt,IS_SCRIPT_OR_DATA:Ut,ATTR_WHITESPACE:Ue,CUSTOM_ELEMENT:Ft}=_t;let{IS_ALLOWED_URI:Fe}=_t,m=null;const He=r({},[...mt,...Ne,...Ie,...Me,...pt]);let d=null;const ze=r({},[...dt,...Ce,...Tt,...ce]);let f=Object.seal(ht(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,_e=null,Ge=!0,Ee=!0,We=!1,Be=!0,P=!1,te=!0,w=!1,ge=!1,Ae=!1,k=!1,ne=!1,oe=!1,Ye=!0,Xe=!1;const Ht="user-content-";let he=!0,X=!1,v={},U=null;const je=r({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const $e=r({},["audio","video","img","source","image","track"]);let Se=null;const qe=r({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ie="http://www.w3.org/1998/Math/MathML",ae="http://www.w3.org/2000/svg",N="http://www.w3.org/1999/xhtml";let F=N,Re=!1,Oe=null;const zt=r({},[ie,ae,N],De);let re=r({},["mi","mo","mn","ms","mtext"]),se=r({},["annotation-xml"]);const Gt=r({},["title","style","font","a","script"]);let j=null;const Wt=["application/xhtml+xml","text/html"],Bt="text/html";let p=null,H=null;const Yt=s.createElement("form"),Ke=function(e){return e instanceof RegExp||e instanceof Function},ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===e)){if((!e||typeof e!="object")&&(e={}),e=C(e),j=Wt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Bt:e.PARSER_MEDIA_TYPE,p=j==="application/xhtml+xml"?De:fe,m=L(e,"ALLOWED_TAGS")?r({},e.ALLOWED_TAGS,p):He,d=L(e,"ALLOWED_ATTR")?r({},e.ALLOWED_ATTR,p):ze,Oe=L(e,"ALLOWED_NAMESPACES")?r({},e.ALLOWED_NAMESPACES,De):zt,Se=L(e,"ADD_URI_SAFE_ATTR")?r(C(qe),e.ADD_URI_SAFE_ATTR,p):qe,Ve=L(e,"ADD_DATA_URI_TAGS")?r(C($e),e.ADD_DATA_URI_TAGS,p):$e,U=L(e,"FORBID_CONTENTS")?r({},e.FORBID_CONTENTS,p):je,Y=L(e,"FORBID_TAGS")?r({},e.FORBID_TAGS,p):C({}),_e=L(e,"FORBID_ATTR")?r({},e.FORBID_ATTR,p):C({}),v=L(e,"USE_PROFILES")?e.USE_PROFILES:!1,Ge=e.ALLOW_ARIA_ATTR!==!1,Ee=e.ALLOW_DATA_ATTR!==!1,We=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Be=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,te=e.SAFE_FOR_XML!==!1,w=e.WHOLE_DOCUMENT||!1,k=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,oe=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Ye=e.SANITIZE_DOM!==!1,Xe=e.SANITIZE_NAMED_PROPS||!1,he=e.KEEP_CONTENT!==!1,X=e.IN_PLACE||!1,Fe=e.ALLOWED_URI_REGEXP||St,F=e.NAMESPACE||N,re=e.MATHML_TEXT_INTEGRATION_POINTS||re,se=e.HTML_INTEGRATION_POINTS||se,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ke(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ke(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(Ee=!1),ne&&(k=!0),v&&(m=r({},pt),d=[],v.html===!0&&(r(m,mt),r(d,dt)),v.svg===!0&&(r(m,Ne),r(d,Ce),r(d,ce)),v.svgFilters===!0&&(r(m,Ie),r(d,Ce),r(d,ce)),v.mathMl===!0&&(r(m,Me),r(d,Tt),r(d,ce))),e.ADD_TAGS&&(m===He&&(m=C(m)),r(m,e.ADD_TAGS,p)),e.ADD_ATTR&&(d===ze&&(d=C(d)),r(d,e.ADD_ATTR,p)),e.ADD_URI_SAFE_ATTR&&r(Se,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(U===je&&(U=C(U)),r(U,e.FORBID_CONTENTS,p)),he&&(m["#text"]=!0),w&&r(m,["html","head","body"]),m.table&&(r(m,["tbody"]),delete Y.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=e.TRUSTED_TYPES_POLICY,B=g.createHTML("")}else g===void 0&&(g=_n(Q,T)),g!==null&&typeof B=="string"&&(B=g.createHTML(""));S&&S(e),H=e}},Ze=r({},[...Ne,...Ie,...an]),Je=r({},[...Me,...rn]),Xt=function(e){let t=ee(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const o=fe(e.tagName),c=fe(t.tagName);return Oe[e.namespaceURI]?e.namespaceURI===ae?t.namespaceURI===N?o==="svg":t.namespaceURI===ie?o==="svg"&&(c==="annotation-xml"||re[c]):!!Ze[o]:e.namespaceURI===ie?t.namespaceURI===N?o==="math":t.namespaceURI===ae?o==="math"&&se[c]:!!Je[o]:e.namespaceURI===N?t.namespaceURI===ae&&!se[c]||t.namespaceURI===ie&&!re[c]?!1:!Je[o]&&(Gt[o]||!Ze[o]):!!(j==="application/xhtml+xml"&&Oe[e.namespaceURI]):!1},b=function(e){$(n.removed,{element:e});try{ee(e).removeChild(e)}catch{Nt(e)}},z=function(e,t){try{$(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{$(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(k||ne)try{b(t)}catch{}else try{t.setAttribute(e,"")}catch{}},Qe=function(e){let t=null,o=null;if(Ae)e="<remove></remove>"+e;else{const u=ut(e,/^[\r\n\t ]+/);o=u&&u[0]}j==="application/xhtml+xml"&&F===N&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=g?g.createHTML(e):e;if(F===N)try{t=new bt().parseFromString(c,j)}catch{}if(!t||!t.documentElement){t=me.createDocument(F,"template",null);try{t.documentElement.innerHTML=Re?B:c}catch{}}const _=t.body||t.documentElement;return e&&o&&_.insertBefore(s.createTextNode(o),_.childNodes[0]||null),F===N?xt.call(t,w?"html":"body")[0]:w?t.documentElement:_},et=function(e){return Ct.call(e.ownerDocument||e,e,G.SHOW_ELEMENT|G.SHOW_COMMENT|G.SHOW_TEXT|G.SHOW_PROCESSING_INSTRUCTION|G.SHOW_CDATA_SECTION,null)},Le=function(e){return e instanceof Lt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof yt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},tt=function(e){return typeof ue=="function"&&e instanceof ue};function I(i,e,t){le(i,o=>{o.call(n,e,t,H)})}const nt=function(e){let t=null;if(I(A.beforeSanitizeElements,e,null),Le(e))return b(e),!0;const o=p(e.nodeName);if(I(A.uponSanitizeElement,e,{tagName:o,allowedTags:m}),te&&e.hasChildNodes()&&!tt(e.firstElementChild)&&h(/<[/\w!]/g,e.innerHTML)&&h(/<[/\w!]/g,e.textContent)||e.nodeType===J.progressingInstruction||te&&e.nodeType===J.comment&&h(/<[/\w]/g,e.data))return b(e),!0;if(!m[o]||Y[o]){if(!Y[o]&&it(o)&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,o)||f.tagNameCheck instanceof Function&&f.tagNameCheck(o)))return!1;if(he&&!U[o]){const c=ee(e)||e.parentNode,_=Mt(e)||e.childNodes;if(_&&c){const u=_.length;for(let O=u-1;O>=0;--O){const M=Dt(_[O],!0);M.__removalCount=(e.__removalCount||0)+1,c.insertBefore(M,It(e))}}}return b(e),!0}return e instanceof ve&&!Xt(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&h(/<\/no(script|embed|frames)/i,e.innerHTML)?(b(e),!0):(P&&e.nodeType===J.text&&(t=e.textContent,le([pe,de,Te],c=>{t=q(t,c," ")}),e.textContent!==t&&($(n.removed,{element:e.cloneNode()}),e.textContent=t)),I(A.afterSanitizeElements,e,null),!1)},ot=function(e,t,o){if(Ye&&(t==="id"||t==="name")&&(o in s||o in Yt))return!1;if(!(Ee&&!_e[t]&&h(kt,t))){if(!(Ge&&h(vt,t))){if(!d[t]||_e[t]){if(!(it(e)&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&h(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,o)||f.tagNameCheck instanceof Function&&f.tagNameCheck(o))))return!1}else if(!Se[t]){if(!h(Fe,q(o,Ue,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&en(o,"data:")===0&&Ve[e])){if(!(We&&!h(Ut,q(o,Ue,"")))){if(o)return!1}}}}}}return!0},it=function(e){return e!=="annotation-xml"&&ut(e,Ft)},at=function(e){I(A.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Le(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d,forceKeepAttr:void 0};let c=t.length;for(;c--;){const _=t[c],{name:u,namespaceURI:O,value:M}=_,V=p(u),be=M;let E=u==="value"?be:tn(be);if(o.attrName=V,o.attrValue=E,o.keepAttr=!0,o.forceKeepAttr=void 0,I(A.uponSanitizeAttribute,e,o),E=o.attrValue,Xe&&(V==="id"||V==="name")&&(z(u,e),E=Ht+E),te&&h(/((--!?|])>)|<\/(style|title)/i,E)){z(u,e);continue}if(o.forceKeepAttr)continue;if(!o.keepAttr){z(u,e);continue}if(!Be&&h(/\/>/i,E)){z(u,e);continue}P&&le([pe,de,Te],st=>{E=q(E,st," ")});const rt=p(e.nodeName);if(!ot(rt,V,E)){z(u,e);continue}if(g&&typeof Q=="object"&&typeof Q.getAttributeType=="function"&&!O)switch(Q.getAttributeType(rt,V)){case"TrustedHTML":{E=g.createHTML(E);break}case"TrustedScriptURL":{E=g.createScriptURL(E);break}}if(E!==be)try{O?e.setAttributeNS(O,u,E):e.setAttribute(u,E),Le(e)?b(e):ft(n.removed)}catch{z(u,e)}}I(A.afterSanitizeAttributes,e,null)},jt=function i(e){let t=null;const o=et(e);for(I(A.beforeSanitizeShadowDOM,e,null);t=o.nextNode();)I(A.uponSanitizeShadowNode,t,null),nt(t),at(t),t.content instanceof D&&i(t.content);I(A.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,o=null,c=null,_=null;if(Re=!i,Re&&(i="<!-->"),typeof i!="string"&&!tt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw K("dirty is not a string, aborting")}else throw K("toString is not a function");if(!n.isSupported)return i;if(ge||ye(e),n.removed=[],typeof i=="string"&&(X=!1),X){if(i.nodeName){const M=p(i.nodeName);if(!m[M]||Y[M])throw K("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof ue)t=Qe("<!---->"),o=t.ownerDocument.importNode(i,!0),o.nodeType===J.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?t=o:t.appendChild(o);else{if(!k&&!P&&!w&&i.indexOf("<")===-1)return g&&oe?g.createHTML(i):i;if(t=Qe(i),!t)return k?null:oe?B:""}t&&Ae&&b(t.firstChild);const u=et(X?i:t);for(;c=u.nextNode();)nt(c),at(c),c.content instanceof D&&jt(c.content);if(X)return i;if(k){if(ne)for(_=wt.call(t.ownerDocument);t.firstChild;)_.appendChild(t.firstChild);else _=t;return(d.shadowroot||d.shadowrootmode)&&(_=Pt.call(l,_,!0)),_}let O=w?t.outerHTML:t.innerHTML;return w&&m["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&h(Rt,t.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
2
|
+
`+O),P&&le([pe,de,Te],M=>{O=q(O,M," ")}),g&&oe?g.createHTML(O):O},n.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ye(i),ge=!0},n.clearConfig=function(){H=null,ge=!1},n.isValidAttribute=function(i,e,t){H||ye({});const o=p(i),c=p(e);return ot(o,c,t)},n.addHook=function(i,e){typeof e=="function"&&$(A[i],e)},n.removeHook=function(i,e){if(e!==void 0){const t=Jt(A[i],e);return t===-1?void 0:Qt(A[i],t,1)[0]}return ft(A[i])},n.removeHooks=function(i){A[i]=[]},n.removeAllHooks=function(){A=Et()},n}var ke=Ot();const En=Vt("div",{target:"ez8s6cm0"})({width:"100%"}),Pe="data-temp-href-target";ke.addHook("beforeSanitizeAttributes",function(a){a instanceof HTMLElement&&a.hasAttribute("target")&&a.getAttribute("target")==="_blank"&&a.setAttribute(Pe,"_blank")});ke.addHook("afterSanitizeAttributes",function(a){a instanceof HTMLElement&&a.hasAttribute(Pe)&&(a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer"),a.removeAttribute(Pe))});const gn=a=>{const n={USE_PROFILES:{html:!0},FORCE_BODY:!0};return ke.sanitize(a,n)};function An({element:a}){const{body:n}=a,s=gt.useMemo(()=>gn(n),[n]);return lt($t,{children:s&<(En,{className:"stHtml","data-testid":"stHtml",dangerouslySetInnerHTML:{__html:s}})})}const Sn=gt.memo(An);export{Sn as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as c,E as C,_ as b,n as d,H as X,C as g,j as a,bl as m,bm as F,a$ as O,b0 as S,cn as _,co as q,be as G,F as K,bB as Y,aA as J,bg as Q,M as h,b as f,bi as Z,bh as ee,bo as te,bC as ie,bp as se,b5 as le,bq as ne}from"./index.C5QL_Xc_.js";import{U as w,a as I}from"./UploadFileInfo.0DCkpDDf.js";import{F as ae}from"./FormClearHelper.DieF97Af.js";import{g as M,F as y,b as oe,D as re,I as de,C as ce,a as pe,s as ge}from"./FileHelper.CvjfDg2R.js";import{S as ue,P as he}from"./ProgressBar.BVxh16au.js";import{u as me}from"./Hooks.B1Hx6FYs.js";var B=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});B.displayName="CloudUpload";var D=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.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"}))});D.displayName="Error";const V=d("section",{target:"e16xj5sw0"})(({isDisabled:e,theme:s})=>({display:"flex",alignItems:"center",padding:s.spacing.lg,backgroundColor:s.colors.secondaryBg,borderRadius:s.radii.default,border:s.colors.widgetBorderColor?`${s.sizes.borderWidth} solid ${s.colors.widgetBorderColor}`:void 0,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${s.colors.primary}`},color:e?s.colors.gray:s.colors.bodyText})),P=d("div",{target:"e16xj5sw1"})({marginRight:"auto",alignItems:"center",display:"flex"}),L=d("span",{target:"e16xj5sw2"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg})),fe=d("span",{target:"e16xj5sw3"})(({theme:e})=>({marginBottom:e.spacing.twoXS})),Fe=d("div",{target:"e16xj5sw4"})({display:"flex",flexDirection:"column"}),j=d("div",{target:"e16xj5sw5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),Se=d("ul",{target:"e16xj5sw6"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),E=d("li",{target:"e16xj5sw7"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),A=d("div",{target:"e16xj5sw8"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),W=d("div",{target:"e16xj5sw9"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),k=d("div",{target:"e16xj5sw10"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),ye=d("span",{target:"e16xj5sw11"})(({theme:e})=>({marginRight:e.spacing.twoXS})),xe=d("div",{target:"e16xj5sw12"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100})),H=d("small",{target:"e16xj5sw13"})(({theme:e})=>({color:e.colors.red,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),N=d("span",{target:"e16xj5sw14"})({}),we=e=>({[V]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[P]:{marginBottom:e.spacing.lg},[L]:{display:"none"},[j]:{paddingRight:e.spacing.lg},[k]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[W]:{width:e.sizes.full},[A]:{flexDirection:"column"},[H]:{height:"auto",whiteSpace:"initial"},[N]:{display:"none"},[E]:{margin:e.spacing.none,padding:e.spacing.none}}),Ue=d("div",{target:"e16xj5sw15"})(({theme:e,width:s})=>{if(s<X("23rem"))return we(e)});var v;(function(e){e.DANGER="danger"})(v||(v={}));const U=d("small",{target:"ejh2rmr0"})(({kind:e,theme:s})=>{const{danger:t,fadedText60:i}=s.colors;return{color:e==="danger"?t:i,fontSize:s.fontSizes.sm,lineHeight:s.lineHeights.tight}}),Ie=({multiple:e,acceptedExtensions:s,maxSizeBytes:t})=>g(P,{"data-testid":"stFileUploaderDropzoneInstructions",children:[a(L,{children:a(m,{content:B,size:"threeXL"})}),g(Fe,{children:[g(fe,{children:["Drag and drop file",e?"s":""," here"]}),g(U,{children:[`Limit ${M(t,y.Byte,0)} per file`,s.length?` • ${s.map(i=>i.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),ve=c.memo(Ie),ze=({onDrop:e,multiple:s,acceptedExtensions:t,maxSizeBytes:i,disabled:l,label:o})=>a(re,{onDrop:e,multiple:s,accept:oe(t),maxSize:i,disabled:l,useFsAccessApi:!1,children:({getRootProps:n,getInputProps:r})=>g(V,{...n(),"data-testid":"stFileUploaderDropzone",isDisabled:l,"aria-label":o,children:[a("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),a(ve,{multiple:s,acceptedExtensions:t,maxSizeBytes:i}),a(F,{kind:S.SECONDARY,disabled:l,size:O.SMALL,children:"Browse files"})]})}),Ce=c.memo(ze),be=d("div",{target:"egc9vxm0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),Me=d("div",{target:"egc9vxm1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),Be=({currentPage:e,totalPages:s,onNext:t,onPrevious:i})=>g(be,{"data-testid":"stFileUploaderPagination",children:[a(U,{children:`Showing page ${e} of ${s}`}),g(Me,{children:[a(F,{onClick:i,kind:S.MINIMAL,children:a(m,{content:_,size:"xl"})}),a(F,{onClick:t,kind:S.MINIMAL,children:a(m,{content:q,size:"xl"})})]})]}),De=c.memo(Be),z=(e,s)=>Math.ceil(e.length/s),Ve=e=>G(({pageSize:t,items:i,resetOnAdd:l,...o})=>{const[n,r]=c.useState(0),[p,x]=c.useState(()=>z(i,t)),u=me(i);c.useEffect(()=>{u&&u.length!==i.length&&x(z(i,t)),u&&u.length<i.length?l&&r(0):n+1>=p&&r(p-1)},[i,n,t,u,l,p]);const T=()=>{r(Math.min(n+1,p-1))},R=()=>{r(Math.max(0,n-1))},$=i.slice(n*t,n*t+t);return g(K,{children:[a(e,{items:$,...o}),i.length>t?a(De,{pageSize:t,totalPages:p,currentPage:n+1,onNext:T,onPrevious:R}):null]})},e),Pe=({fileInfo:e})=>e.status.type==="uploading"?a(he,{value:e.status.progress,size:ue.SMALL}):e.status.type==="error"?g(H,{children:[a(ye,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),a(N,{children:a(m,{content:D,size:"lg"})})]}):e.status.type==="uploaded"?a(U,{children:M(e.size,y.Byte)}):null,Le=({fileInfo:e,onDelete:s})=>g(k,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[a(xe,{children:a(m,{content:de,size:"twoXL"})}),g(A,{className:"stFileUploaderFileData",children:[a(W,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),a(Pe,{fileInfo:e})]}),a("div",{"data-testid":"stFileUploaderDeleteBtn",children:a(F,{onClick:()=>s(e.id),kind:S.MINIMAL,children:a(m,{content:ce,size:"lg"})})})]}),je=c.memo(Le),Ee=({items:e,onDelete:s})=>a(Se,{children:e.map(t=>a(E,{children:a(je,{fileInfo:t,onDelete:s})},t.id))}),Ae=Ve(Ee),We=e=>a(j,{children:a(Ae,{...e})}),ke=c.memo(We);class He extends c.PureComponent{constructor(s){super(s),this.formClearHelper=new ae,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:i,widgetMgr:l,fragmentId:o}=this.props,n=l.getFileUploaderStateValue(i);J(t,n)||l.setFileUploaderStateValue(i,t,{fromUi:!0},o)},this.dropHandler=(t,i)=>{const{element:l}=this.props,{multipleFiles:o}=l;if(!o&&t.length===0&&i.length>1){const n=i.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");n>=0&&(t.push(i[n].file),i.splice(n,1))}if(this.props.uploadClient.fetchFileURLs(t).then(n=>{if(!o&&t.length>0){const r=this.state.files.find(p=>p.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}Q(n,t).forEach(([r,p])=>{this.uploadFile(r,p)})}).catch(n=>{this.addFiles(t.map(r=>new w(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:n})))}),i.length>0){const n=i.map(r=>pe(r,this.nextLocalFileId(),this.maxUploadSizeInBytes));this.addFiles(n)}},this.uploadFile=(t,i)=>{const l=I.CancelToken.source(),o=new w(i.name,i.size,this.nextLocalFileId(),{type:"uploading",cancelToken:l,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,i,n=>this.onUploadProgress(n,o.id),l.token).then(()=>this.onUploadComplete(o.id,t)).catch(n=>{I.isCancel(n)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:n?n.toString():"Unknown error"}))})},this.onUploadComplete=(t,i)=>{const l=this.getFile(t);h(l)||l.status.type!=="uploading"||this.updateFile(l.id,l.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}))},this.deleteFile=t=>{const i=this.getFile(t);h(i)||(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(i.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,t]}))})},this.addFiles=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,...t]}))})},this.removeFile=t=>{f.flushSync(()=>{this.setState(i=>({files:i.files.filter(l=>l.id!==t)}))})},this.getFile=t=>this.state.files.find(i=>i.id===t),this.updateFile=(t,i)=>{f.flushSync(()=>{this.setState(l=>({files:l.files.map(o=>o.id===t?i:o)}))})},this.onUploadProgress=(t,i)=>{const l=this.getFile(i);if(h(l)||l.status.type!=="uploading")return;const o=Math.round(t.loaded*100/t.total);l.status.progress!==o&&this.updateFile(i,l.setStatus({type:"uploading",cancelToken:l.status.cancelToken,progress:o}))},this.onFormCleared=()=>{f.flushSync(()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(h(t))return;const{widgetMgr:i,element:l,fragmentId:o}=this.props;i.setFileUploaderStateValue(l,t,{fromUi:!0},o)})})},this.state=this.initialValue}get initialValue(){const s={files:[]},{widgetMgr:t,element:i}=this.props,l=t.getFileUploaderStateValue(i);if(h(l))return s;const{uploadedFileInfo:o}=l;return h(o)||o.length===0?s:{files:o.map(n=>{const r=n.name,p=n.size,x=n.fileId,u=n.fileUrls;return new w(r,p,this.nextLocalFileId(),{type:"uploaded",fileId:x,fileUrls:u})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const s=this.props.element.maxUploadSizeMb;return ge(s,y.Megabyte,y.Byte)}get status(){const s=t=>t.status.type==="uploading";return this.state.files.some(s)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const s=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:l}=this.props;i.getFileUploaderStateValue(t)===void 0&&i.setFileUploaderStateValue(t,s,{fromUi:!1},l)}createWidgetValue(){const s=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:i,size:l,status:o}=t,{fileId:n,fileUrls:r}=o;return new Z({fileId:n,fileUrls:r,name:i,size:l})});return new ee({uploadedFileInfo:s})}render(){var p;const{files:s}=this.state,{element:t,disabled:i,widgetMgr:l,width:o}=this.props,n=t.type;this.formClearHelper.manageFormClearListener(l,t.formId,this.onFormCleared);const r=s.slice().reverse();return g(Ue,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[a(ne,{label:t.label,disabled:i,labelVisibility:te((p=t.labelVisibility)==null?void 0:p.value),children:t.help&&a(ie,{children:a(se,{content:t.help,placement:le.TOP_RIGHT})})}),a(Ce,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:n,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:i}),r.length>0&&a(ke,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const _e=Y(c.memo(He));export{_e as default};
|
1
|
+
import{r as c,E as C,_ as b,n as d,H as X,C as g,j as a,bl as m,bm as F,a$ as O,b0 as S,cn as _,co as q,be as G,F as K,bB as Y,aA as J,bg as Q,M as h,b as f,bi as Z,bh as ee,bo as te,bC as ie,bp as se,b5 as le,bq as ne}from"./index.D97xl78q.js";import{U as w,a as I}from"./UploadFileInfo.0DCkpDDf.js";import{F as ae}from"./FormClearHelper.CHYZBZGR.js";import{g as M,F as y,b as oe,D as re,I as de,C as ce,a as pe,s as ge}from"./FileHelper.BWuvkxif.js";import{S as ue,P as he}from"./ProgressBar.CG44OwiE.js";import{u as me}from"./Hooks.aQtyO1Es.js";var B=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});B.displayName="CloudUpload";var D=c.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),c.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"}))});D.displayName="Error";const V=d("section",{target:"e16xj5sw0"})(({isDisabled:e,theme:s})=>({display:"flex",alignItems:"center",padding:s.spacing.lg,backgroundColor:s.colors.secondaryBg,borderRadius:s.radii.default,border:s.colors.widgetBorderColor?`${s.sizes.borderWidth} solid ${s.colors.widgetBorderColor}`:void 0,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${s.colors.primary}`},color:e?s.colors.gray:s.colors.bodyText})),P=d("div",{target:"e16xj5sw1"})({marginRight:"auto",alignItems:"center",display:"flex"}),L=d("span",{target:"e16xj5sw2"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg})),fe=d("span",{target:"e16xj5sw3"})(({theme:e})=>({marginBottom:e.spacing.twoXS})),Fe=d("div",{target:"e16xj5sw4"})({display:"flex",flexDirection:"column"}),j=d("div",{target:"e16xj5sw5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),Se=d("ul",{target:"e16xj5sw6"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),E=d("li",{target:"e16xj5sw7"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),A=d("div",{target:"e16xj5sw8"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),W=d("div",{target:"e16xj5sw9"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),k=d("div",{target:"e16xj5sw10"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),ye=d("span",{target:"e16xj5sw11"})(({theme:e})=>({marginRight:e.spacing.twoXS})),xe=d("div",{target:"e16xj5sw12"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100})),H=d("small",{target:"e16xj5sw13"})(({theme:e})=>({color:e.colors.red,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),N=d("span",{target:"e16xj5sw14"})({}),we=e=>({[V]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[P]:{marginBottom:e.spacing.lg},[L]:{display:"none"},[j]:{paddingRight:e.spacing.lg},[k]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[W]:{width:e.sizes.full},[A]:{flexDirection:"column"},[H]:{height:"auto",whiteSpace:"initial"},[N]:{display:"none"},[E]:{margin:e.spacing.none,padding:e.spacing.none}}),Ue=d("div",{target:"e16xj5sw15"})(({theme:e,width:s})=>{if(s<X("23rem"))return we(e)});var v;(function(e){e.DANGER="danger"})(v||(v={}));const U=d("small",{target:"ejh2rmr0"})(({kind:e,theme:s})=>{const{danger:t,fadedText60:i}=s.colors;return{color:e==="danger"?t:i,fontSize:s.fontSizes.sm,lineHeight:s.lineHeights.tight}}),Ie=({multiple:e,acceptedExtensions:s,maxSizeBytes:t})=>g(P,{"data-testid":"stFileUploaderDropzoneInstructions",children:[a(L,{children:a(m,{content:B,size:"threeXL"})}),g(Fe,{children:[g(fe,{children:["Drag and drop file",e?"s":""," here"]}),g(U,{children:[`Limit ${M(t,y.Byte,0)} per file`,s.length?` • ${s.map(i=>i.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),ve=c.memo(Ie),ze=({onDrop:e,multiple:s,acceptedExtensions:t,maxSizeBytes:i,disabled:l,label:o})=>a(re,{onDrop:e,multiple:s,accept:oe(t),maxSize:i,disabled:l,useFsAccessApi:!1,children:({getRootProps:n,getInputProps:r})=>g(V,{...n(),"data-testid":"stFileUploaderDropzone",isDisabled:l,"aria-label":o,children:[a("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),a(ve,{multiple:s,acceptedExtensions:t,maxSizeBytes:i}),a(F,{kind:S.SECONDARY,disabled:l,size:O.SMALL,children:"Browse files"})]})}),Ce=c.memo(ze),be=d("div",{target:"egc9vxm0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),Me=d("div",{target:"egc9vxm1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),Be=({currentPage:e,totalPages:s,onNext:t,onPrevious:i})=>g(be,{"data-testid":"stFileUploaderPagination",children:[a(U,{children:`Showing page ${e} of ${s}`}),g(Me,{children:[a(F,{onClick:i,kind:S.MINIMAL,children:a(m,{content:_,size:"xl"})}),a(F,{onClick:t,kind:S.MINIMAL,children:a(m,{content:q,size:"xl"})})]})]}),De=c.memo(Be),z=(e,s)=>Math.ceil(e.length/s),Ve=e=>G(({pageSize:t,items:i,resetOnAdd:l,...o})=>{const[n,r]=c.useState(0),[p,x]=c.useState(()=>z(i,t)),u=me(i);c.useEffect(()=>{u&&u.length!==i.length&&x(z(i,t)),u&&u.length<i.length?l&&r(0):n+1>=p&&r(p-1)},[i,n,t,u,l,p]);const T=()=>{r(Math.min(n+1,p-1))},R=()=>{r(Math.max(0,n-1))},$=i.slice(n*t,n*t+t);return g(K,{children:[a(e,{items:$,...o}),i.length>t?a(De,{pageSize:t,totalPages:p,currentPage:n+1,onNext:T,onPrevious:R}):null]})},e),Pe=({fileInfo:e})=>e.status.type==="uploading"?a(he,{value:e.status.progress,size:ue.SMALL}):e.status.type==="error"?g(H,{children:[a(ye,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),a(N,{children:a(m,{content:D,size:"lg"})})]}):e.status.type==="uploaded"?a(U,{children:M(e.size,y.Byte)}):null,Le=({fileInfo:e,onDelete:s})=>g(k,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[a(xe,{children:a(m,{content:de,size:"twoXL"})}),g(A,{className:"stFileUploaderFileData",children:[a(W,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),a(Pe,{fileInfo:e})]}),a("div",{"data-testid":"stFileUploaderDeleteBtn",children:a(F,{onClick:()=>s(e.id),kind:S.MINIMAL,children:a(m,{content:ce,size:"lg"})})})]}),je=c.memo(Le),Ee=({items:e,onDelete:s})=>a(Se,{children:e.map(t=>a(E,{children:a(je,{fileInfo:t,onDelete:s})},t.id))}),Ae=Ve(Ee),We=e=>a(j,{children:a(Ae,{...e})}),ke=c.memo(We);class He extends c.PureComponent{constructor(s){super(s),this.formClearHelper=new ae,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:i,widgetMgr:l,fragmentId:o}=this.props,n=l.getFileUploaderStateValue(i);J(t,n)||l.setFileUploaderStateValue(i,t,{fromUi:!0},o)},this.dropHandler=(t,i)=>{const{element:l}=this.props,{multipleFiles:o}=l;if(!o&&t.length===0&&i.length>1){const n=i.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");n>=0&&(t.push(i[n].file),i.splice(n,1))}if(this.props.uploadClient.fetchFileURLs(t).then(n=>{if(!o&&t.length>0){const r=this.state.files.find(p=>p.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}Q(n,t).forEach(([r,p])=>{this.uploadFile(r,p)})}).catch(n=>{this.addFiles(t.map(r=>new w(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:n})))}),i.length>0){const n=i.map(r=>pe(r,this.nextLocalFileId(),this.maxUploadSizeInBytes));this.addFiles(n)}},this.uploadFile=(t,i)=>{const l=I.CancelToken.source(),o=new w(i.name,i.size,this.nextLocalFileId(),{type:"uploading",cancelToken:l,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,i,n=>this.onUploadProgress(n,o.id),l.token).then(()=>this.onUploadComplete(o.id,t)).catch(n=>{I.isCancel(n)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:n?n.toString():"Unknown error"}))})},this.onUploadComplete=(t,i)=>{const l=this.getFile(t);h(l)||l.status.type!=="uploading"||this.updateFile(l.id,l.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}))},this.deleteFile=t=>{const i=this.getFile(t);h(i)||(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(i.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,t]}))})},this.addFiles=t=>{f.flushSync(()=>{this.setState(i=>({files:[...i.files,...t]}))})},this.removeFile=t=>{f.flushSync(()=>{this.setState(i=>({files:i.files.filter(l=>l.id!==t)}))})},this.getFile=t=>this.state.files.find(i=>i.id===t),this.updateFile=(t,i)=>{f.flushSync(()=>{this.setState(l=>({files:l.files.map(o=>o.id===t?i:o)}))})},this.onUploadProgress=(t,i)=>{const l=this.getFile(i);if(h(l)||l.status.type!=="uploading")return;const o=Math.round(t.loaded*100/t.total);l.status.progress!==o&&this.updateFile(i,l.setStatus({type:"uploading",cancelToken:l.status.cancelToken,progress:o}))},this.onFormCleared=()=>{f.flushSync(()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(h(t))return;const{widgetMgr:i,element:l,fragmentId:o}=this.props;i.setFileUploaderStateValue(l,t,{fromUi:!0},o)})})},this.state=this.initialValue}get initialValue(){const s={files:[]},{widgetMgr:t,element:i}=this.props,l=t.getFileUploaderStateValue(i);if(h(l))return s;const{uploadedFileInfo:o}=l;return h(o)||o.length===0?s:{files:o.map(n=>{const r=n.name,p=n.size,x=n.fileId,u=n.fileUrls;return new w(r,p,this.nextLocalFileId(),{type:"uploaded",fileId:x,fileUrls:u})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const s=this.props.element.maxUploadSizeMb;return ge(s,y.Megabyte,y.Byte)}get status(){const s=t=>t.status.type==="uploading";return this.state.files.some(s)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const s=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:l}=this.props;i.getFileUploaderStateValue(t)===void 0&&i.setFileUploaderStateValue(t,s,{fromUi:!1},l)}createWidgetValue(){const s=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:i,size:l,status:o}=t,{fileId:n,fileUrls:r}=o;return new Z({fileId:n,fileUrls:r,name:i,size:l})});return new ee({uploadedFileInfo:s})}render(){var p;const{files:s}=this.state,{element:t,disabled:i,widgetMgr:l,width:o}=this.props,n=t.type;this.formClearHelper.manageFormClearListener(l,t.formId,this.onFormCleared);const r=s.slice().reverse();return g(Ue,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[a(ne,{label:t.label,disabled:i,labelVisibility:te((p=t.labelVisibility)==null?void 0:p.value),children:t.help&&a(ie,{children:a(se,{content:t.help,placement:le.TOP_RIGHT})})}),a(Ce,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:n,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:i}),r.length>0&&a(ke,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const _e=Y(c.memo(He));export{_e as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as l,a_ as v,J as u,a$ as n,r as b,b0 as s,j as i,b1 as B,b2 as k,b3 as S}from"./index.
|
1
|
+
import{n as l,a_ as v,J as u,a$ as n,r as b,b0 as s,j as i,b1 as B,b2 as k,b3 as S}from"./index.D97xl78q.js";function x(o,r){switch(o){case n.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case n.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case n.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const e=l("a",{target:"e2m15hl0"})(({containerWidth:o,size:r,theme:a})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:a.fontWeights.normal,padding:`${a.spacing.xs} ${a.spacing.md}`,borderRadius:a.radii.default,minHeight:a.sizes.minElementHeight,margin:0,lineHeight:a.lineHeights.base,color:a.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:a.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${u(a.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...x(r,a)})),$=l(e,{target:"e2m15hl1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:v(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),L=l(e,{target:"e2m15hl2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),w=l(e,{target:"e2m15hl3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${u(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:a,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:C}){let d=$;return o===s.SECONDARY?d=L:o===s.TERTIARY&&(d=w),i(d,{kind:o,size:r||n.MEDIUM,containerWidth:t||!1,disabled:a||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:C,tabIndex:a?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const z=b.memo(T);function R(o){const{element:r}=o;let a=s.SECONDARY;r.type==="primary"?a=s.PRIMARY:r.type==="tertiary"&&(a=s.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return i(S,{className:"stLinkButton","data-testid":"stLinkButton",children:i(B,{help:r.help,containerWidth:r.useContainerWidth,children:i(z,{kind:a,size:n.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:i(k,{icon:r.icon,label:r.label})})})})}const W=b.memo(R);export{W 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.
|
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.D97xl78q.js";import{a as v}from"./useBasicWidgetState.ByOGmtKn.js";import{a as H,L as X,S as p}from"./checkbox.B9R-wnB7.js";import"./FormClearHelper.CHYZBZGR.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};
|