streamlit-nightly 1.53.2.dev20260127__py3-none-any.whl → 1.53.2.dev20260128__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 +11 -0
- streamlit/proto/NewSession_pb2.py +24 -22
- streamlit/proto/NewSession_pb2.pyi +23 -1
- streamlit/runtime/app_session.py +19 -0
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +296 -296
- streamlit/static/static/js/{ErrorOutline.esm.DiaGWPsE.js → ErrorOutline.esm.D71F8ziR.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.D-Qgpk5d.js → FileDownload.esm.yTkppsJy.js} +1 -1
- streamlit/static/static/js/{FileHelper.DmtDDGp0.js → FileHelper.hUOqtbwa.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.BM3uDLnU.js → FormClearHelper.DN8D_YXO.js} +1 -1
- streamlit/static/static/js/{InputInstructions.B2YZ5Lle.js → InputInstructions.DbssY6d4.js} +1 -1
- streamlit/static/static/js/{Particles.BzfZrl-0.js → Particles.BznyVdfo.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DWErD3j3.js → ProgressBar.C5uBOtcx.js} +1 -1
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.DB31rUPf.js → StreamlitSyntaxHighlighter.Nf1895x-.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.D3oUYYYd.js → TableChart.esm.DHKzVs3a.js} +1 -1
- streamlit/static/static/js/{Toolbar.CPyjMABY.js → Toolbar.CQsWYXer.js} +1 -1
- streamlit/static/static/js/{WidgetLabelHelpIconInline.C1NBCx-y.js → WidgetLabelHelpIconInline.6xCU76OE.js} +1 -1
- streamlit/static/static/js/{base-input.C_CrNgNd.js → base-input.Cs-E6S71.js} +1 -1
- streamlit/static/static/js/{checkbox.S6O8DPFl.js → checkbox.OTGupu18.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.B-5tIJBw.js → createDownloadLinkElement.DnBEQQbK.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BW5aAEJN.js → data-grid-overlay-editor.COiiMi5r.js} +1 -1
- streamlit/static/static/js/{downloader.BswLlj7p.js → downloader.K0GUNeuj.js} +1 -1
- streamlit/static/static/js/{embed.QjYZXbaW.js → embed.o8HvK3mH.js} +1 -1
- streamlit/static/static/js/{es6.Dm_kl6Cp.js → es6.BHy5pqTP.js} +2 -2
- streamlit/static/static/js/{formatNumber.CH39oSMw.js → formatNumber.BK7h0k2z.js} +1 -1
- streamlit/static/static/js/{iconPosition.Dp9f2jam.js → iconPosition.2YynQUxu.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.DOprY46-.js → iframeResizer.contentWindow.D5h3hQuU.js} +1 -1
- streamlit/static/static/js/{index.DypwtfIh.js → index.5zqfJ-in.js} +1 -1
- streamlit/static/static/js/{index.BNsCI-Q1.js → index.6c-qDsD7.js} +1 -1
- streamlit/static/static/js/{index.BFxjXeYb.js → index.8MlRyIxN.js} +1 -1
- streamlit/static/static/js/{index.DoRYpzHm.js → index.BIqcOZ_u.js} +1 -1
- streamlit/static/static/js/{index.BQu5Qf_i.js → index.BPdmXoYW.js} +1 -1
- streamlit/static/static/js/{index.DK9Im19R.js → index.BZ-GJVxB.js} +1 -1
- streamlit/static/static/js/{index.TTO_Lb69.js → index.BfMPq234.js} +1 -1
- streamlit/static/static/js/{index.OI2eh_me.js → index.Bfo1cXfC.js} +1 -1
- streamlit/static/static/js/{index.X1r5cenD.js → index.Bgf49D1Z.js} +1 -1
- streamlit/static/static/js/{index.CfXTal6g.js → index.Bqmx23jK.js} +1 -1
- streamlit/static/static/js/{index.BaKZ4ira.js → index.BtRWcqZV.js} +1 -1
- streamlit/static/static/js/{index.6OwBTJdz.js → index.BtuskCwg.js} +1 -1
- streamlit/static/static/js/{index.Bwaj-9Zv.js → index.BzTVI_BY.js} +1 -1
- streamlit/static/static/js/{index.BxtweGcn.js → index.C2EoeVjP.js} +1 -1
- streamlit/static/static/js/{index.CuJ82OKQ.js → index.C65jHNhe.js} +1 -1
- streamlit/static/static/js/{index.DsZNm1_D.js → index.C6wyTXhz.js} +1 -1
- streamlit/static/static/js/{index.C57ViuAX.js → index.C7wst9Tm.js} +1 -1
- streamlit/static/static/js/{index.BcUwq6kI.js → index.COh5V_89.js} +1 -1
- streamlit/static/static/js/{index.DTUAvbJ0.js → index.CSPY26T2.js} +1 -1
- streamlit/static/static/js/{index.6iOQDEVC.js → index.CUkhn-vu.js} +1 -1
- streamlit/static/static/js/{index.B6Sk5Jwr.js → index.CX0KdFyR.js} +1 -1
- streamlit/static/static/js/{index.Cw5Xlisw.js → index.CYhhEdja.js} +1 -1
- streamlit/static/static/js/{index.JKOtpaMf.js → index.CZf7Go1Z.js} +1 -1
- streamlit/static/static/js/{index.s9zpEF8P.js → index.Cb03y5I8.js} +1 -1
- streamlit/static/static/js/{index.CivdhE_9.js → index.CdsyTabv.js} +1 -1
- streamlit/static/static/js/{index.CYxcFtYt.js → index.CgVv04GM.js} +1 -1
- streamlit/static/static/js/{index.B0Wcvg8a.js → index.CjRU8O1O.js} +1 -1
- streamlit/static/static/js/{index.gsc49XzN.js → index.CwtpGPHA.js} +1 -1
- streamlit/static/static/js/{index.DMwRlpNi.js → index.CxWzt6oi.js} +1 -1
- streamlit/static/static/js/{index.CkSzTTpO.js → index.DBPWUJsj.js} +5 -5
- streamlit/static/static/js/{index.BlgpfTUq.js → index.DJfMW0Gy.js} +1 -1
- streamlit/static/static/js/{index.BYjec3-R.js → index.DLUSo6de.js} +1 -1
- streamlit/static/static/js/{index.-7yn3zqE.js → index.DL_yE83J.js} +1 -1
- streamlit/static/static/js/{index.CDZffl1q.js → index.DVRCyxMp.js} +1 -1
- streamlit/static/static/js/{index.B9XI6y3j.js → index.Dc5-tFdw.js} +1 -1
- streamlit/static/static/js/{index.Cb7V19H9.js → index.DcngUOyD.js} +1 -1
- streamlit/static/static/js/{index.BBVcEzWu.js → index.Dh3PJIlq.js} +1 -1
- streamlit/static/static/js/{index.BUOjbZl6.js → index.DlgcEr0f.js} +1 -1
- streamlit/static/static/js/{index.wKGUZfH4.js → index.DxGXuhh6.js} +1 -1
- streamlit/static/static/js/{index.6UQ__fP7.js → index.DxfYCrPp.js} +1 -1
- streamlit/static/static/js/{index.Ci3x7GcT.js → index.HmRK3HyC.js} +1 -1
- streamlit/static/static/js/{index.D1tkD8Lg.js → index.TjMWsKSH.js} +1 -1
- streamlit/static/static/js/{index.4QSKV4yi.js → index.VwDKazgt.js} +1 -1
- streamlit/static/static/js/{index.lMhsw-5K.js → index.aCorc3Yt.js} +26 -26
- streamlit/static/static/js/{index.CAzk7fUP.js → index.cfuZ69LI.js} +1 -1
- streamlit/static/static/js/{index.BlchQrZL.js → index.hlAfdSqC.js} +1 -1
- streamlit/static/static/js/{index.tjRGlTlQ.js → index.iUV9rb8C.js} +1 -1
- streamlit/static/static/js/{index.BUbgW8RJ.js → index.q0ceUXt6.js} +1 -1
- streamlit/static/static/js/{input.CIKqvWjB.js → input.CXGIJ7D6.js} +1 -1
- streamlit/static/static/js/{main.BkNqoTrd.js → main.CCVkbuxC.js} +1 -1
- streamlit/static/static/js/{memory.DNcbFok2.js → memory.CNbnYs2A.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DwjiYKav.js → number-overlay-editor.CvI6wkld.js} +1 -1
- streamlit/static/static/js/{pandasStylerUtils.BSc50we3.js → pandasStylerUtils.CFSReOTm.js} +1 -1
- streamlit/static/static/js/{sandbox.DJL9Gdcf.js → sandbox.Bld0L3us.js} +1 -1
- streamlit/static/static/js/{styled-components.D4jE1G9j.js → styled-components.BoUHK6TA.js} +1 -1
- streamlit/static/static/js/{throttle.dHeXiPIK.js → throttle.ByDFm7WV.js} +1 -1
- streamlit/static/static/js/{timepicker.CIpoSUyW.js → timepicker.CN6CUZEL.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.AOXQx2YY.js → toConsumableArray.DwMycSpg.js} +1 -1
- streamlit/static/static/js/uniqueId.DcCWa2cf.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.BwQxG7iA.js → useBasicWidgetState.Bg0ZMUt5.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.JXPZPWaJ.js → useIntlLocale.DgBUDcPA.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.CD_nhoE_.js → useTextInputAutoExpand.DDBezxks.js} +1 -1
- streamlit/static/static/js/{useUpdateUiValue.Cl1Y22Ao.js → useUpdateUiValue.Df1h6fXC.js} +1 -1
- streamlit/static/static/js/{useWaveformController.DJhScSDn.js → useWaveformController.DbWw5MEk.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.CrAfFzO9.js → withCalculatedWidth.YaK0HIIP.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.EdE3zOz5.js → withFullScreenWrapper.CcWCKoY8.js} +1 -1
- streamlit/web/bootstrap.py +5 -2
- streamlit/web/server/server_util.py +22 -0
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/RECORD +101 -101
- streamlit/static/static/js/uniqueId.DRPc21MO.js +0 -1
- {streamlit_nightly-1.53.2.dev20260127.data → streamlit_nightly-1.53.2.dev20260128.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.53.2.dev20260127.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{V as Q,e as Z,bu as me,bv as ge,z as he,r as d,l as ye,bw as k,aj as _,j as A,aM as pe,bx as H,by as Ee,a0 as be,a1 as Fe,o as Ce,$ as we,aL as Se,n as Ne,S as Oe}from"./index.lMhsw-5K.js";import{bz as nr}from"./index.lMhsw-5K.js";import{w as Ae}from"./withCalculatedWidth.CrAfFzO9.js";import{C as W,a as Y}from"./urls.BwSlolu9.js";import{D as Re,a as Ie}from"./IFrameUtil.DefezniK.js";const v="%[a-f0-9]{2}",G=new RegExp("("+v+")|([^%]+?)","gi"),B=new RegExp("("+v+")+","gi");function T(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;const t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],T(t),T(n))}function _e(e){try{return decodeURIComponent(e)}catch{let r=e.match(G)||[];for(let t=1;t<r.length;t++)e=T(r,t).join(""),r=e.match(G)||[];return e}}function Te(e){const r={"%FE%FF":"��","%FF%FE":"��"};let t=B.exec(e);for(;t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{const a=_e(t[0]);a!==t[0]&&(r[t[0]]=a)}t=B.exec(e)}r["%C2"]="�";const n=Object.keys(r);for(const a of n)e=e.replace(new RegExp(a,"g"),r[a]);return e}function xe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Te(e)}}function Ue(e,r){const t={};if(Array.isArray(r))for(const n of r){const a=Object.getOwnPropertyDescriptor(e,n);a?.enumerable&&Object.defineProperty(t,n,a)}else for(const n of Reflect.ownKeys(e)){const a=Object.getOwnPropertyDescriptor(e,n);if(a.enumerable){const s=e[n];r(n,s,e)&&Object.defineProperty(t,n,a)}}return t}function ee(e,r){if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||r==="")return[];const t=e.indexOf(r);return t===-1?[]:[e.slice(0,t),e.slice(t+r.length)]}const $e=e=>e==null,Me=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),x=Symbol("encodeFragmentIdentifier");function Le(e){switch(e.arrayFormat){case"index":return r=>(t,n)=>{const a=t.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[",a,"]"].join("")]:[...t,[c(r,e),"[",c(a,e),"]=",c(n,e)].join("")]};case"bracket":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[]"].join("")]:[...t,[c(r,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),":list="].join("")]:[...t,[c(r,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const r=e.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,a)=>a===void 0||e.skipNull&&a===null||e.skipEmptyString&&a===""?n:(a=a===null?"":a,n.length===0?[[c(t,e),r,c(a,e)].join("")]:[[n,c(a,e)].join(e.arrayFormatSeparator)])}default:return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,c(r,e)]:[...t,[c(r,e),"=",c(n,e)].join("")]}}function je(e){let r;switch(e.arrayFormat){case"index":return(t,n,a)=>{if(r=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!r){a[t]=n;return}a[t]===void 0&&(a[t]={}),a[t][r[1]]=n};case"bracket":return(t,n,a)=>{if(r=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"colon-list-separator":return(t,n,a)=>{if(r=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"comma":case"separator":return(t,n,a)=>{const o=typeof n=="string"&&n.includes(e.arrayFormatSeparator)?n.split(e.arrayFormatSeparator).map(i=>h(i,e)):n===null?n:h(n,e);a[t]=o};case"bracket-separator":return(t,n,a)=>{const s=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!s){a[t]=n&&h(n,e);return}const o=n===null?[]:h(n,e).split(e.arrayFormatSeparator);if(a[t]===void 0){a[t]=o;return}a[t]=[...a[t],...o]};default:return(t,n,a)=>{if(a[t]===void 0){a[t]=n;return}a[t]=[...[a[t]].flat(),n]}}}function re(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,r){return r.encode?r.strict?Me(e):encodeURIComponent(e):e}function h(e,r){return r.decode?xe(e):e}function te(e){return Array.isArray(e)?e.sort():typeof e=="object"?te(Object.keys(e)).sort((r,t)=>Number(r)-Number(t)).map(r=>e[r]):e}function ne(e){const r=e.indexOf("#");return r!==-1&&(e=e.slice(0,r)),e}function De(e){let r="";const t=e.indexOf("#");return t!==-1&&(r=e.slice(t)),r}function q(e,r,t){return t==="string"&&typeof e=="string"?e:typeof t=="function"&&typeof e=="string"?t(e):t==="boolean"&&e===null?!0:t==="boolean"&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":t==="boolean"&&e!==null&&(e.toLowerCase()==="1"||e.toLowerCase()==="0")?e.toLowerCase()==="1":t==="string[]"&&r.arrayFormat!=="none"&&typeof e=="string"?[e]:t==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?[Number(e)]:t==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):r.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function U(e){e=ne(e);const r=e.indexOf("?");return r===-1?"":e.slice(r+1)}function $(e,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},re(r.arrayFormatSeparator);const t=je(r),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const a of e.split("&")){if(a==="")continue;const s=r.decode?a.replaceAll("+"," "):a;let[o,i]=ee(s,"=");o===void 0&&(o=s),i=i===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?i:h(i,r),t(h(o,r),i,n)}for(const[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null&&r.types[a]!=="string")for(const[o,i]of Object.entries(s)){const l=r.types[a],f=typeof l=="function"?l:l?l.replace("[]",""):void 0;s[o]=q(i,r,f)}else typeof s=="object"&&s!==null&&r.types[a]==="string"?n[a]=Object.values(s).join(r.arrayFormatSeparator):n[a]=q(s,r,r.types[a]);return r.sort===!1?n:(r.sort===!0?Object.keys(n).sort():Object.keys(n).sort(r.sort)).reduce((a,s)=>{const o=n[s];return a[s]=o&&typeof o=="object"&&!Array.isArray(o)?te(o):o,a},Object.create(null))}function ae(e,r){if(!e)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},re(r.arrayFormatSeparator);const t=o=>r.skipNull&&$e(e[o])||r.skipEmptyString&&e[o]==="",n=Le(r),a={};for(const[o,i]of Object.entries(e))t(o)||(a[o]=i);const s=Object.keys(a);return r.sort!==!1&&s.sort(r.sort),s.map(o=>{let i=e[o];if(r.replacer&&(i=r.replacer(o,i),i===void 0)||i===void 0)return"";if(i===null)return c(o,r);if(Array.isArray(i)){if(i.length===0&&r.arrayFormat==="bracket-separator")return c(o,r)+"[]";let l=i;return r.replacer&&(l=i.map((f,u)=>r.replacer(`${o}[${u}]`,f)).filter(f=>f!==void 0)),l.reduce(n(o),[]).join("&")}return c(o,r)+"="+c(i,r)}).filter(o=>o.length>0).join("&")}function se(e,r){r={decode:!0,...r};let[t,n]=ee(e,"#");return t===void 0&&(t=e),{url:t?.split("?")?.[0]??"",query:$(U(e),r),...r&&r.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,r)}:{}}}function oe(e,r){r={encode:!0,strict:!0,[x]:!0,...r};const t=ne(e.url).split("?")[0]||"",n=U(e.url),a={...$(n,{sort:!1,...r}),...e.query};let s=ae(a,r);s&&=`?${s}`;let o=De(e.url);if(typeof e.fragmentIdentifier=="string"){const i=new URL(t);i.hash=e.fragmentIdentifier,o=r[x]?i.hash:`#${e.fragmentIdentifier}`}return`${t}${s}${o}`}function ie(e,r,t){t={parseFragmentIdentifier:!0,[x]:!1,...t};const{url:n,query:a,fragmentIdentifier:s}=se(e,t);return oe({url:n,query:Ue(a,r),fragmentIdentifier:s},t)}function Pe(e,r,t){const n=Array.isArray(r)?a=>!r.includes(a):(a,s)=>!r(a,s);return ie(e,n,t)}const Ve=Object.freeze(Object.defineProperty({__proto__:null,exclude:Pe,extract:U,parse:$,parseUrl:se,pick:ie,stringify:ae,stringifyUrl:oe},Symbol.toStringTag,{value:"Module"}));var S=(function(e){return e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight",e})({}),ke=(function(e){return e.RENDER="streamlit:render",e})({});const He=1,F=Q.getLogger("componentUtils");function We(e){return(r,t)=>{if(!e.current)return;const{isReady:n,element:a,widgetMgr:s,setComponentError:o,componentReadyCallback:i,frameHeightCallback:l,fragmentId:f}=e.current,u=n();switch(r){case S.COMPONENT_READY:{const{apiVersion:y}=t;y!==He?o(new Error(`Unrecognized component API version: '${y}'`)):i();break}case S.SET_COMPONENT_VALUE:u?Ge(K(t,"value"),t.dataType,{fromUi:!0},a,s,f):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;case S.SET_FRAME_HEIGHT:u?l(K(t,"height")):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;default:F.warn(`Unrecognized ComponentBackMsgType: ${r}`)}}}function Ye(e,r){const t=JSON.parse(e),n=[];for(const a of r){const{key:s}=a;switch(a.value?.toLowerCase()){case"arrowdataframe":n.push({key:s,value:ge.toObject(a.arrowDataframe)});break;case"bytes":t[s]=a.bytes;break;default:throw new Error(`Unrecognized SpecialArg type: ${a.value}`)}}return[t,n]}function z(e,r,t,n,a){if(!a){F.warn("Can't send ForwardMsg; missing our iframe!");return}if(Z(a.contentWindow)){F.warn("Can't send ForwardMsg; iframe has no contentWindow!");return}a.contentWindow.postMessage({type:ke.RENDER,args:e,dfs:r,disabled:t,theme:{...me(n),font:n.genericFonts.bodyFont}},"*")}function Ge(e,r,t,n,a,s){if(e===void 0){F.warn("handleSetComponentValue: missing 'value' prop");return}switch(r){case"dataframe":a.setArrowValue(n,e,t,s);break;case"bytes":a.setBytesValue(n,e,t,s);break;default:a.setJsonValue(n,e,t,s)}}function K(e,r,t=void 0){return Object.hasOwn(e,r)?e[r]:t}const Be=he("iframe",{target:"edxyb2x0"})(({theme:e,componentReady:r})=>({colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,display:r?"initial":"none"})),R=Q.getLogger("ComponentInstance"),J=6e4;function qe(e,r,t){let n;Ne(t)&&t!==""?n=t:n=r.getComponentURL(e,"index.html");const a=Oe.CUSTOM_COMPONENT_CLIENT_ID,s=new URL(window.location.href);return n=Ve.stringifyUrl({url:n,query:{streamlitUrl:s.origin+s.pathname,...a&&{__streamlit_parent_client_id:a}}}),n}function X(e,r){let t;return r&&r!==""?t=`Your app is having trouble loading the **${e}** component.
|
|
1
|
+
import{V as Q,e as Z,bu as me,bv as ge,z as he,r as d,l as ye,bw as k,aj as _,j as A,aM as pe,bx as H,by as Ee,a0 as be,a1 as Fe,o as Ce,$ as we,aL as Se,n as Ne,S as Oe}from"./index.aCorc3Yt.js";import{bz as nr}from"./index.aCorc3Yt.js";import{w as Ae}from"./withCalculatedWidth.YaK0HIIP.js";import{C as W,a as Y}from"./urls.BwSlolu9.js";import{D as Re,a as Ie}from"./IFrameUtil.DefezniK.js";const v="%[a-f0-9]{2}",G=new RegExp("("+v+")|([^%]+?)","gi"),B=new RegExp("("+v+")+","gi");function T(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;const t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],T(t),T(n))}function _e(e){try{return decodeURIComponent(e)}catch{let r=e.match(G)||[];for(let t=1;t<r.length;t++)e=T(r,t).join(""),r=e.match(G)||[];return e}}function Te(e){const r={"%FE%FF":"��","%FF%FE":"��"};let t=B.exec(e);for(;t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{const a=_e(t[0]);a!==t[0]&&(r[t[0]]=a)}t=B.exec(e)}r["%C2"]="�";const n=Object.keys(r);for(const a of n)e=e.replace(new RegExp(a,"g"),r[a]);return e}function xe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Te(e)}}function Ue(e,r){const t={};if(Array.isArray(r))for(const n of r){const a=Object.getOwnPropertyDescriptor(e,n);a?.enumerable&&Object.defineProperty(t,n,a)}else for(const n of Reflect.ownKeys(e)){const a=Object.getOwnPropertyDescriptor(e,n);if(a.enumerable){const s=e[n];r(n,s,e)&&Object.defineProperty(t,n,a)}}return t}function ee(e,r){if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||r==="")return[];const t=e.indexOf(r);return t===-1?[]:[e.slice(0,t),e.slice(t+r.length)]}const $e=e=>e==null,Me=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),x=Symbol("encodeFragmentIdentifier");function Le(e){switch(e.arrayFormat){case"index":return r=>(t,n)=>{const a=t.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[",a,"]"].join("")]:[...t,[c(r,e),"[",c(a,e),"]=",c(n,e)].join("")]};case"bracket":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[]"].join("")]:[...t,[c(r,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),":list="].join("")]:[...t,[c(r,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const r=e.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,a)=>a===void 0||e.skipNull&&a===null||e.skipEmptyString&&a===""?n:(a=a===null?"":a,n.length===0?[[c(t,e),r,c(a,e)].join("")]:[[n,c(a,e)].join(e.arrayFormatSeparator)])}default:return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,c(r,e)]:[...t,[c(r,e),"=",c(n,e)].join("")]}}function je(e){let r;switch(e.arrayFormat){case"index":return(t,n,a)=>{if(r=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!r){a[t]=n;return}a[t]===void 0&&(a[t]={}),a[t][r[1]]=n};case"bracket":return(t,n,a)=>{if(r=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"colon-list-separator":return(t,n,a)=>{if(r=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"comma":case"separator":return(t,n,a)=>{const o=typeof n=="string"&&n.includes(e.arrayFormatSeparator)?n.split(e.arrayFormatSeparator).map(i=>h(i,e)):n===null?n:h(n,e);a[t]=o};case"bracket-separator":return(t,n,a)=>{const s=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!s){a[t]=n&&h(n,e);return}const o=n===null?[]:h(n,e).split(e.arrayFormatSeparator);if(a[t]===void 0){a[t]=o;return}a[t]=[...a[t],...o]};default:return(t,n,a)=>{if(a[t]===void 0){a[t]=n;return}a[t]=[...[a[t]].flat(),n]}}}function re(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,r){return r.encode?r.strict?Me(e):encodeURIComponent(e):e}function h(e,r){return r.decode?xe(e):e}function te(e){return Array.isArray(e)?e.sort():typeof e=="object"?te(Object.keys(e)).sort((r,t)=>Number(r)-Number(t)).map(r=>e[r]):e}function ne(e){const r=e.indexOf("#");return r!==-1&&(e=e.slice(0,r)),e}function De(e){let r="";const t=e.indexOf("#");return t!==-1&&(r=e.slice(t)),r}function q(e,r,t){return t==="string"&&typeof e=="string"?e:typeof t=="function"&&typeof e=="string"?t(e):t==="boolean"&&e===null?!0:t==="boolean"&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":t==="boolean"&&e!==null&&(e.toLowerCase()==="1"||e.toLowerCase()==="0")?e.toLowerCase()==="1":t==="string[]"&&r.arrayFormat!=="none"&&typeof e=="string"?[e]:t==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?[Number(e)]:t==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):r.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function U(e){e=ne(e);const r=e.indexOf("?");return r===-1?"":e.slice(r+1)}function $(e,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},re(r.arrayFormatSeparator);const t=je(r),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const a of e.split("&")){if(a==="")continue;const s=r.decode?a.replaceAll("+"," "):a;let[o,i]=ee(s,"=");o===void 0&&(o=s),i=i===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?i:h(i,r),t(h(o,r),i,n)}for(const[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null&&r.types[a]!=="string")for(const[o,i]of Object.entries(s)){const l=r.types[a],f=typeof l=="function"?l:l?l.replace("[]",""):void 0;s[o]=q(i,r,f)}else typeof s=="object"&&s!==null&&r.types[a]==="string"?n[a]=Object.values(s).join(r.arrayFormatSeparator):n[a]=q(s,r,r.types[a]);return r.sort===!1?n:(r.sort===!0?Object.keys(n).sort():Object.keys(n).sort(r.sort)).reduce((a,s)=>{const o=n[s];return a[s]=o&&typeof o=="object"&&!Array.isArray(o)?te(o):o,a},Object.create(null))}function ae(e,r){if(!e)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},re(r.arrayFormatSeparator);const t=o=>r.skipNull&&$e(e[o])||r.skipEmptyString&&e[o]==="",n=Le(r),a={};for(const[o,i]of Object.entries(e))t(o)||(a[o]=i);const s=Object.keys(a);return r.sort!==!1&&s.sort(r.sort),s.map(o=>{let i=e[o];if(r.replacer&&(i=r.replacer(o,i),i===void 0)||i===void 0)return"";if(i===null)return c(o,r);if(Array.isArray(i)){if(i.length===0&&r.arrayFormat==="bracket-separator")return c(o,r)+"[]";let l=i;return r.replacer&&(l=i.map((f,u)=>r.replacer(`${o}[${u}]`,f)).filter(f=>f!==void 0)),l.reduce(n(o),[]).join("&")}return c(o,r)+"="+c(i,r)}).filter(o=>o.length>0).join("&")}function se(e,r){r={decode:!0,...r};let[t,n]=ee(e,"#");return t===void 0&&(t=e),{url:t?.split("?")?.[0]??"",query:$(U(e),r),...r&&r.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,r)}:{}}}function oe(e,r){r={encode:!0,strict:!0,[x]:!0,...r};const t=ne(e.url).split("?")[0]||"",n=U(e.url),a={...$(n,{sort:!1,...r}),...e.query};let s=ae(a,r);s&&=`?${s}`;let o=De(e.url);if(typeof e.fragmentIdentifier=="string"){const i=new URL(t);i.hash=e.fragmentIdentifier,o=r[x]?i.hash:`#${e.fragmentIdentifier}`}return`${t}${s}${o}`}function ie(e,r,t){t={parseFragmentIdentifier:!0,[x]:!1,...t};const{url:n,query:a,fragmentIdentifier:s}=se(e,t);return oe({url:n,query:Ue(a,r),fragmentIdentifier:s},t)}function Pe(e,r,t){const n=Array.isArray(r)?a=>!r.includes(a):(a,s)=>!r(a,s);return ie(e,n,t)}const Ve=Object.freeze(Object.defineProperty({__proto__:null,exclude:Pe,extract:U,parse:$,parseUrl:se,pick:ie,stringify:ae,stringifyUrl:oe},Symbol.toStringTag,{value:"Module"}));var S=(function(e){return e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight",e})({}),ke=(function(e){return e.RENDER="streamlit:render",e})({});const He=1,F=Q.getLogger("componentUtils");function We(e){return(r,t)=>{if(!e.current)return;const{isReady:n,element:a,widgetMgr:s,setComponentError:o,componentReadyCallback:i,frameHeightCallback:l,fragmentId:f}=e.current,u=n();switch(r){case S.COMPONENT_READY:{const{apiVersion:y}=t;y!==He?o(new Error(`Unrecognized component API version: '${y}'`)):i();break}case S.SET_COMPONENT_VALUE:u?Ge(K(t,"value"),t.dataType,{fromUi:!0},a,s,f):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;case S.SET_FRAME_HEIGHT:u?l(K(t,"height")):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;default:F.warn(`Unrecognized ComponentBackMsgType: ${r}`)}}}function Ye(e,r){const t=JSON.parse(e),n=[];for(const a of r){const{key:s}=a;switch(a.value?.toLowerCase()){case"arrowdataframe":n.push({key:s,value:ge.toObject(a.arrowDataframe)});break;case"bytes":t[s]=a.bytes;break;default:throw new Error(`Unrecognized SpecialArg type: ${a.value}`)}}return[t,n]}function z(e,r,t,n,a){if(!a){F.warn("Can't send ForwardMsg; missing our iframe!");return}if(Z(a.contentWindow)){F.warn("Can't send ForwardMsg; iframe has no contentWindow!");return}a.contentWindow.postMessage({type:ke.RENDER,args:e,dfs:r,disabled:t,theme:{...me(n),font:n.genericFonts.bodyFont}},"*")}function Ge(e,r,t,n,a,s){if(e===void 0){F.warn("handleSetComponentValue: missing 'value' prop");return}switch(r){case"dataframe":a.setArrowValue(n,e,t,s);break;case"bytes":a.setBytesValue(n,e,t,s);break;default:a.setJsonValue(n,e,t,s)}}function K(e,r,t=void 0){return Object.hasOwn(e,r)?e[r]:t}const Be=he("iframe",{target:"edxyb2x0"})(({theme:e,componentReady:r})=>({colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,display:r?"initial":"none"})),R=Q.getLogger("ComponentInstance"),J=6e4;function qe(e,r,t){let n;Ne(t)&&t!==""?n=t:n=r.getComponentURL(e,"index.html");const a=Oe.CUSTOM_COMPONENT_CLIENT_ID,s=new URL(window.location.href);return n=Ve.stringifyUrl({url:n,query:{streamlitUrl:s.origin+s.pathname,...a&&{__streamlit_parent_client_id:a}}}),n}function X(e,r){let t;return r&&r!==""?t=`Your app is having trouble loading the **${e}** component.
|
|
2
2
|
The app is attempting to load the component from **${r}**,
|
|
3
3
|
and hasn't received its \`Streamlit.setComponentReady()\` message.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,L,H as M,B as w,u as T,o as U,j as u,b as A,c as P,D as j,a as N,I as Y}from"./index.
|
|
1
|
+
import{r as o,L,H as M,B as w,u as T,o as U,j as u,b as A,c as P,D as j,a as N,I as Y}from"./index.aCorc3Yt.js";import{m as z}from"./iconPosition.2YynQUxu.js";import{c as R}from"./createDownloadLinkElement.DnBEQQbK.js";function F(S){const{disabled:i,element:r,widgetMgr:B,endpoints:t,fragmentId:g}=S,{help:v,label:x,icon:I,ignoreRerun:h,type:p,url:k,deferredFileId:n}=r,b=r.shortcut?r.shortcut:void 0,[C,f]=o.useState(!1),[l,s]=o.useState(null),{enforceDownloadInNewTab:d=!1}=o.useContext(L),{requestDeferredFile:D}=o.useContext(M);let m=w.SECONDARY;p==="primary"?m=w.PRIMARY:p==="tertiary"&&(m=w.TERTIARY);const c=o.useMemo(()=>t.buildDownloadUrl(k),[t,k]);o.useEffect(()=>{n?.length||t.checkSourceUrlResponse(c,"Download Button")},[c,t,n]);const E=o.useCallback(async()=>{if(!D||!n){s("Deferred download not properly configured");return}f(!0),s(null);try{const e=await D(n);if(e.errorMsg){s(e.errorMsg),f(!1);return}const a=t.buildDownloadUrl(e.url);t.checkSourceUrlResponse(a,"Download Button"),R({filename:"",url:a,enforceDownloadInNewTab:d}).click()}catch(e){const a=e instanceof Error?e.message:"Download failed";s(a)}finally{f(!1)}},[D,n,t,d]),y=o.useCallback(()=>{if(i)return;h||B.setTriggerValue(r,{fromUi:!0},g),!!n?.length?E():R({filename:"",url:c,enforceDownloadInNewTab:d}).click()},[i,h,B,r,g,n,E,c,d]);return T({shortcut:b,disabled:i,onActivate:y}),o.useEffect(()=>{if(l){const e=setTimeout(()=>s(null),5e3);return()=>clearTimeout(e)}},[l]),U("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:[u(N,{help:v,containerWidth:!0,children:u(A,{kind:m,size:P.SMALL,disabled:i||C,onClick:y,containerWidth:!0,children:u(j,{icon:C?"spinner":I,iconPosition:z(r.iconPosition),label:x,shortcut:b})})}),l&&u(Y,{"data-testid":"stDownloadButtonError",children:l})]})}const O=o.memo(F);export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{av as j,j as m,aw as U,ae as z,P as $,ax as _,q as X,ay as q,m as G,e as Z,r as s,l as J,az as K,L as Q,o as oo,p as to,ab as ro,ac as eo}from"./index.
|
|
1
|
+
import{av as j,j as m,aw as U,ae as z,P as $,ax as _,q as X,ay as q,m as G,e as Z,r as s,l as J,az as K,L as Q,o as oo,p as to,ab as ro,ac as eo}from"./index.aCorc3Yt.js";import{h as x}from"./moment.C7qA8nIE.js";import{u as no,D as ao,a as so}from"./useIntlLocale.DgBUDcPA.js";import{u as io}from"./useBasicWidgetState.Bg0ZMUt5.js";import{S as lo}from"./styled-components.BoUHK6TA.js";import{E as co}from"./ErrorOutline.esm.D71F8ziR.js";import"./timepicker.CN6CUZEL.js";import"./input.CXGIJ7D6.js";import"./base-input.Cs-E6S71.js";import"./FormClearHelper.DN8D_YXO.js";const po=({theme:o,isInSidebar:t,step:r,minTime:c,maxTime:u,disabled:p,clearable:g,error:e})=>({Popover:{props:{ignoreBoundary:t,placement:U.bottomLeft,overrides:{Body:{style:{marginTop:o.spacing.px}}}}},CalendarContainer:{style:{fontSize:o.fontSizes.sm,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.none,paddingTop:o.spacing.sm}},Week:{style:{fontSize:o.fontSizes.sm}},Day:{style:({$pseudoHighlighted:i,$pseudoSelected:a,$selected:T,$isHovered:y})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,"::before":{backgroundColor:T||a||i||y?`${o.colors.darkenedBgMix15} !important`:o.colors.transparent},"::after":{borderColor:o.colors.transparent},...G(o)&&y&&a&&!T?{color:o.colors.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:o.colors.transparent},":focus":{backgroundColor:o.colors.transparent,outline:0}})},NextButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:o.colors.transparent},":focus":{backgroundColor:o.colors.transparent,outline:0}})},Input:{props:{maskChar:null,endEnhancer:e&&m(q,{content:m(X,{source:e,allowHTML:!1}),placement:$.TOP_RIGHT,error:!0,children:m(_,{content:co,size:"lg"})}),overrides:{EndEnhancer:{style:{color:e?o.colors.redTextColor:o.colors.grayTextColor,backgroundColor:o.colors.transparent}},Root:{style:({$isFocused:i})=>{const a=z(o.colors,i);return{borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,paddingRight:o.spacing.twoXS,borderTopColor:a,borderRightColor:a,borderBottomColor:a,borderLeftColor:a,...e&&{backgroundColor:o.colors.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.grayTextColor,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{fontWeight:o.fontWeights.normal,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,lineHeight:o.lineHeights.inputWidget,"::placeholder":{color:o.colors.fadedText60},...e&&{color:o.colors.redTextColor}},props:{"data-testid":"stDateTimeInputField"}}}}},TimeSelectContainer:{style:{paddingTop:o.spacing.none,paddingBottom:o.spacing.none}},TimeSelectFormControl:{style:{marginBottom:o.spacing.none},props:{overrides:{Label:{component:()=>null}}}},TimeSelect:{props:{step:r,format:"24",disabled:p,nullable:g,minTime:c,maxTime:u,overrides:{Select:{props:{disabled:p,overrides:{ControlContainer:{style:({$isFocused:i})=>{const a=z(o.colors,i);return{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderTopColor:a,borderRightColor:a,borderBottomColor:a,borderLeftColor:a}}},IconsContainer:{style:()=>({paddingRight:o.spacing.sm})},ValueContainer:{style:()=>({lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm})},SingleValue:{style:{fontWeight:o.fontWeights.normal},props:{"data-testid":"stDateTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:o.spacing.none,paddingBottom:o.spacing.none,boxShadow:"none",maxHeight:o.sizes.maxDropdownHeight})},DropdownListItem:{component:lo},Popover:{props:{ignoreBoundary:t,overrides:{Body:{style:()=>({marginTop:o.spacing.px})}}}},Placeholder:{style:()=>({color:o.colors.fadedText60})},SelectArrow:{component:j,props:{overrides:{Svg:{style:()=>({width:o.iconSizes.xl,height:o.iconSizes.xl})}}}}}}}}}}}),h="YYYY/MM/DD, HH:mm",go=(o,t)=>{const r=o.getStringArrayValue(t);return r&&r.length>0?r[0]:null},uo=o=>o.default?.length?o.default[0]:null,fo=o=>o.value?.length?o.value[0]:null,k=o=>{let t;if(Array.isArray(o)?t=o.find(c=>c instanceof Date):t=o,!t||Number.isNaN(t.getTime()))return null;const r=new Date(t.getTime());return r.setSeconds(0,0),r},b=o=>{if(Z(o)||o==="")return null;const t=x(o,h,!0);return t.isValid()?k(t.toDate()):null},B=(o,t)=>o.getFullYear()===t.getFullYear()&&o.getMonth()===t.getMonth()&&o.getDate()===t.getDate(),I=(o,t)=>{const r=new Date(o.getTime());return r.setHours(t.getHours(),t.getMinutes(),0,0),r},mo=(o,t,r,c)=>{const u=b(o.min),p=b(o.max),g=e=>{t.setStringArrayValue(o,e?[e]:[],{fromUi:r.fromUi},c)};if(r.value){const e=b(r.value);if(e){u&&e<u||p&&e>p||g(r.value);return}}g(r.value)};function bo({disabled:o,element:t,widgetMgr:r,fragmentId:c}){const u=J(),p=s.useContext(K),g=s.useRef(null),[e,i]=io({getStateFromWidgetMgr:go,getDefaultStateFromProto:uo,getCurrStateFromProto:fo,updateWidgetMgrState:mo,element:t,widgetMgr:r,fragmentId:c}),{locale:a}=s.useContext(Q),T=no(a),y=t.step?Number(t.step):900,l=s.useMemo(()=>b(t.min),[t.min]),d=s.useMemo(()=>b(t.max),[t.max]),C=s.useMemo(()=>b(e),[e]),[n,v]=s.useState(C),[M,L]=s.useState(C);C!==M&&(v(C),L(C));const H=l??void 0,V=d??void 0,E=s.useMemo(()=>{if(!(!n||!l))return B(n,l)?I(n,l):void 0},[n,l]),P=s.useMemo(()=>{if(!(!n||!d))return B(n,d)?I(n,d):void 0},[n,d]),w=t.format.replaceAll(/[a-zA-Z]/g,"9"),D=`${t.format.replaceAll("Y","y").replaceAll("D","d")}, HH:mm`,A=`${w}, 99:99`,R=`${t.format}, HH:MM`,W=(t.default&&t.default.length>0?t.default[0]:"").length===0&&!o,F=s.useMemo(()=>{if(!n)return null;if(l&&n<l||d&&n>d){const f=x(l).format(D),S=x(d).format(D);return`**Error**: Date and time set outside allowed range. Please select a date and time between ${f} and ${S}.`}return null},[n,l,d,D]),O=s.useCallback(({date:f})=>{const S=k(f);v(S),g.current?.open?.()},[]),N=s.useCallback(()=>{const f=n?x(n).format(h):null;f!==e&&i({value:f,fromUi:!0})},[n,e,i]),Y=po({theme:u,isInSidebar:p,step:y,minTime:E,maxTime:P,disabled:o,clearable:W,error:F});return oo("div",{className:"stDateTimeInput","data-testid":"stDateTimeInput",children:[m(eo,{label:t.label,disabled:o,labelVisibility:to(t.labelVisibility?.value),children:t.help&&m(ro,{content:t.help,label:t.label})}),m(so,{ref:g,locale:T,density:ao.high,value:n,onChange:O,onClose:N,minDate:H,maxDate:V,disabled:o,timeSelectStart:!0,formatString:D,mask:A,placeholder:R,clearable:W,overrides:Y,"aria-label":t.label})]})}const ko=s.memo(bo);export{ko as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m,l as x,m as C,j as s,o as T,p as y,q as L,P as S,t as W,C as B,v as w}from"./index.
|
|
1
|
+
import{r as m,l as x,m as C,j as s,o as T,p as y,q as L,P as S,t as W,C as B,v as w}from"./index.aCorc3Yt.js";import{W as R}from"./WidgetLabelHelpIconInline.6xCU76OE.js";import{u as E}from"./useBasicWidgetState.Bg0ZMUt5.js";import{S as P,L as v,a as u}from"./checkbox.OTGupu18.js";import"./FormClearHelper.DN8D_YXO.js";function $({element:o,disabled:a,widgetMgr:n,fragmentId:d}){const[p,g]=E({getStateFromWidgetMgr:M,getDefaultStateFromProto:X,getCurrStateFromProto:H,updateWidgetMgrState:V,element:o,widgetMgr:n,fragmentId:d}),f=m.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=x(),{colors:r,spacing:h,sizes:e}=t,b=C(t),k=a?r.fadedText40:r.bodyText;return s(w,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:s(P,{checked:p,disabled:a,onChange:f,"aria-label":o.label,checkmarkType:o.type===B.StyleType.TOGGLE?u.toggle:u.default,labelPlacement:v.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?r.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=b?r.bgColor:r.bodyText;return a&&(c=b?r.gray70:r.gray90),{width:`calc(${e.checkbox} - ${t.spacing.twoXS})`,height:`calc(${e.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${e.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=r.borderColor;return c&&!a&&(l=r.darkenedBgMix15),i&&!a&&(l=r.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${e.checkbox})`,minWidth:`calc(2 * ${e.checkbox})`,height:e.checkbox,minHeight:e.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?r.primary:r.borderColor;return{outline:0,width:e.checkbox,height:e.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?t.shadows.focusRing:"",borderLeftWidth:e.borderWidth,borderRightWidth:e.borderWidth,borderTopWidth:e.borderWidth,borderBottomWidth:e.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:k}}},children:T(W,{visibility:y(o.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[s(L,{source:o.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),o.help&&s(R,{content:o.help,placement:S.TOP_RIGHT,label:o.label})]})})})}function M(o,a){return o.getBoolValue(a)}function X(o){return o.default??null}function H(o){return o.value??null}function V(o,a,n,d){a.setBoolValue(o,n.value,{fromUi:n.fromUi},d)}const _=m.memo($);export{_ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{J as P,r as u,V as ao,cs as L,ct as co,aL as io,l as lo,j as m,W as U,R as fo,cu as go,z as _,aM as V}from"./index.
|
|
1
|
+
import{J as P,r as u,V as ao,cs as L,ct as co,aL as io,l as lo,j as m,W as U,R as fo,cu as go,z as _,aM as V}from"./index.aCorc3Yt.js";function Co(o,e,r,n){for(var t=-1,s=o==null?0:o.length;++t<s;)r=e(r,o[t],t,o);return r}function xo(o){return function(e){return o?.[e]}}var po={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ho=xo(po),mo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bo="\\u0300-\\u036f",So="\\ufe20-\\ufe2f",Ro="\\u20d0-\\u20ff",yo=bo+So+Ro,Eo="["+yo+"]",Fo=RegExp(Eo,"g");function wo(o){return o=P(o),o&&o.replace(mo,ho).replace(Fo,"")}var vo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ko(o){return o.match(vo)||[]}var Bo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function To(o){return Bo.test(o)}var H="\\ud800-\\udfff",zo="\\u0300-\\u036f",Ao="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",Io=zo+Ao+Uo,J="\\u2700-\\u27bf",Z="a-z\\xdf-\\xf6\\xf8-\\xff",Wo="\\xac\\xb1\\xd7\\xf7",Lo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Oo="\\u2000-\\u206f",Mo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",G="A-Z\\xc0-\\xd6\\xd8-\\xde",jo="\\ufe0e\\ufe0f",Y=Wo+Lo+Oo+Mo,q="['’]",O="["+Y+"]",$o="["+Io+"]",K="\\d+",No="["+J+"]",X="["+Z+"]",Q="[^"+H+Y+K+J+Z+G+"]",Do="\\ud83c[\\udffb-\\udfff]",Po="(?:"+$o+"|"+Do+")",_o="[^"+H+"]",oo="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+G+"]",Vo="\\u200d",M="(?:"+X+"|"+Q+")",Ho="(?:"+w+"|"+Q+")",j="(?:"+q+"(?:d|ll|m|re|s|t|ve))?",$="(?:"+q+"(?:D|LL|M|RE|S|T|VE))?",ro=Po+"?",to="["+jo+"]?",Jo="(?:"+Vo+"(?:"+[_o,oo,eo].join("|")+")"+to+ro+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Go="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yo=to+ro+Jo,qo="(?:"+[No,oo,eo].join("|")+")"+Yo,Ko=RegExp([w+"?"+X+"+"+j+"(?="+[O,w,"$"].join("|")+")",Ho+"+"+$+"(?="+[O,w+M,"$"].join("|")+")",w+"?"+M+"+"+j,w+"+"+$,Go,Zo,K,qo].join("|"),"g");function Xo(o){return o.match(Ko)||[]}function Qo(o,e,r){return o=P(o),e=e,e===void 0?To(o)?Xo(o):ko(o):o.match(e)||[]}var oe="['’]",ee=RegExp(oe,"g");function re(o){return function(e){return Co(Qo(wo(e).replace(ee,"")),o,"")}}var te=re(function(o,e,r){return o+(r?"-":"")+e.toLowerCase()});const k=u.createContext(null);k.displayName="BidiComponentContext";const v=ao.getLogger("BidiComponent"),N="__",z="__streamlit_arrow_ref__",ne="$$STREAMLIT_INTERNAL_KEY",se=(o,e)=>{if(o&&typeof o=="object"&&!Array.isArray(o)){if(typeof o[z]=="string"){const n=o[z],t=e[n];if(t)try{return L(t)}catch{return null}return null}const r={};for(const[n,t]of Object.entries(o))if(t&&typeof t=="object"&&!Array.isArray(t)&&typeof t[z]=="string"){const s=t[z],a=e[s];if(a)try{r[n]=L(a)}catch{r[n]=null}else r[n]=null}else r[n]=t;return r}return o},ue=({arrowBlobs:o,arrowData:e,bytes:r,data:n,json:t,mixedJson:s})=>{switch(n){case"json":return t?JSON.parse(t):null;case"arrowData":return e??null;case"bytes":return r??null;case"mixed":{if(s&&o){const a=JSON.parse(s),i={};return Object.entries(o).forEach(([l,d])=>{d?.data&&(i[l]=d.data)}),se(a,i)}return null}case"any":case void 0:return null;default:co(n)}},ae=(o,e="--st")=>{const r={};return Object.entries(o).forEach(([n,t])=>{const s=te(n),a=`${e}-${s}`;if(typeof t=="boolean"){r[a]=t?"1":"0";return}if(t==null){r[a]="unset";return}if(Array.isArray(t)){r[a]=t.join(",");return}if(typeof t=="number"||typeof t=="string"){r[a]=String(t);return}r[a]="unset"}),r},ce=o=>{const e=[o.fontSizes.h1FontSize,o.fontSizes.h2FontSize,o.fontSizes.h3FontSize,o.fontSizes.h4FontSize,o.fontSizes.h5FontSize,o.fontSizes.h6FontSize],r=[o.fontWeights.h1FontWeight,o.fontWeights.h2FontWeight,o.fontWeights.h3FontWeight,o.fontWeights.h4FontWeight,o.fontWeights.h5FontWeight,o.fontWeights.h6FontWeight];return{primaryColor:o.colors.primary,backgroundColor:o.colors.bgColor,secondaryBackgroundColor:o.colors.secondaryBg,textColor:o.colors.bodyText,linkColor:o.colors.link,linkUnderline:o.linkUnderline,headingFont:o.genericFonts.headingFont,codeFont:o.genericFonts.codeFont,baseRadius:o.radii.default,buttonRadius:o.radii.button,baseFontSize:typeof o.fontSizes.baseFontSize=="number"?`${o.fontSizes.baseFontSize}px`:String(o.fontSizes.baseFontSize),baseFontWeight:o.fontWeights.normal,codeFontWeight:o.fontWeights.code,codeFontSize:o.fontSizes.codeFontSize,headingFontSizes:e,headingFontSize1:e[0],headingFontSize2:e[1],headingFontSize3:e[2],headingFontSize4:e[3],headingFontSize5:e[4],headingFontSize6:e[5],headingFontWeights:r,headingFontWeight1:r[0],headingFontWeight2:r[1],headingFontWeight3:r[2],headingFontWeight4:r[3],headingFontWeight5:r[4],headingFontWeight6:r[5],borderColor:o.colors.borderColor,dataframeBorderColor:o.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:o.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:o.colors.codeBackgroundColor,font:o.genericFonts.bodyFont,chartCategoricalColors:o.colors.chartCategoricalColors,chartSequentialColors:o.colors.chartSequentialColors,chartDivergingColors:o.colors.chartDivergingColors,headingColor:o.colors.headingColor,borderColorLight:o.colors.borderColorLight,codeTextColor:o.colors.codeTextColor,widgetBorderColor:o.colors.widgetBorderColor||"transparent",redColor:o.colors.redColor,orangeColor:o.colors.orangeColor,yellowColor:o.colors.yellowColor,blueColor:o.colors.blueColor,greenColor:o.colors.greenColor,violetColor:o.colors.violetColor,grayColor:o.colors.grayColor,redBackgroundColor:o.colors.redBackgroundColor,orangeBackgroundColor:o.colors.orangeBackgroundColor,yellowBackgroundColor:o.colors.yellowBackgroundColor,blueBackgroundColor:o.colors.blueBackgroundColor,greenBackgroundColor:o.colors.greenBackgroundColor,violetBackgroundColor:o.colors.violetBackgroundColor,grayBackgroundColor:o.colors.grayBackgroundColor,redTextColor:o.colors.redTextColor,orangeTextColor:o.colors.orangeTextColor,yellowTextColor:o.colors.yellowTextColor,blueTextColor:o.colors.blueTextColor,greenTextColor:o.colors.greenTextColor,violetTextColor:o.colors.violetTextColor,grayTextColor:o.colors.grayTextColor}},ie=u.memo(({element:o,children:e,widgetMgr:r,fragmentId:n,componentRegistry:t})=>{const{arrowData:s,bytes:a,componentName:i,cssContent:l,cssSourcePath:d,data:f,htmlContent:g,id:c,jsContent:b,json:p,jsSourcePath:h,mixed:C}=o,y=u.useMemo(()=>({id:o.id,formId:o.formId}),[o.id,o.formId]),B=u.useCallback(()=>{const F=r.getJsonValue(y);if(!F)return{};try{return JSON.parse(F)}catch(I){const R=io(I);return v.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:y.id,formId:y.formId,error:R.message}),{}}},[y,r]),T=u.useMemo(()=>ue({arrowBlobs:C?.arrowBlobs||void 0,arrowData:s?.data||void 0,bytes:a,data:f,json:p,mixedJson:C?.json||void 0}),[f,p,s?.data,a,C?.json,C?.arrowBlobs]),S=lo(),E=u.useMemo(()=>ce(S),[S]),x=u.useMemo(()=>({componentName:i,componentRegistry:t,cssContent:l?.trim(),cssSourcePath:d||void 0,data:T,fragmentId:n,getWidgetValue:B,htmlContent:g?.trim(),id:c,formId:o.formId||void 0,jsContent:b||void 0,jsSourcePath:h||void 0,theme:E,widgetMgr:r}),[i,t,l,d,n,B,g,c,o.formId,b,h,T,E,r]);return m(k.Provider,{value:x,children:e})}),no=(o,e)=>{if(o instanceof Error)return o;const r=e?`${e}: ${String(o)}`:String(o);return new Error(r)},A=(o,e,r)=>{const n=no(o,r);v.error(`BidiComponent Error: ${n.message}`,o),e(n)},de=(o,e)=>{try{const n=document.createRange().createContextualFragment(o);e.appendChild(n)}catch(r){v.warn("createContextualFragment failed, falling back to innerHTML",r),e.innerHTML=o}},so=({containerRef:o,setError:e,skip:r=!1})=>{const n=u.useRef(null),{htmlContent:t,cssContent:s,cssSourcePath:a,componentName:i,componentRegistry:{getBidiComponentURL:l}}=U(k),d=u.useMemo(()=>{if(a)return l(i,a)},[i,a,l]),f=fo(d);return u.useEffect(()=>{if(r)return;const g=o.current;if(g)try{if(n.current?.parentNode===g&&g.removeChild(n.current),n.current=document.createElement("div"),t){const c=document.createElement("div");de(t,c),n.current.appendChild(c)}if(s){const c=document.createElement("style");c.textContent=s,n.current.appendChild(c)}else if(d){const c=document.createElement("link");c.href=d,c.rel="stylesheet",f&&(c.crossOrigin=f),c.onerror=()=>{A(new Error(`Failed to load CSS from ${d}`),e)},n.current.appendChild(c)}g.appendChild(n.current)}catch(c){A(c,e,"Failed to process HTML/CSS content")}},[t,s,o,f,d,e,r]),n};class le{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let r=this.hashSeed;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r>>>0,this.hashPrime)>>>0;return(r>>>0).toString(16)}getOrCreateUrlForJs(e,r){const n=this.computeHash(e),t=this.cache.get(n);if(t)return{url:t,hash:n};const s=`${e}
|
|
2
2
|
//# sourceURL=${r}-${n}.js`,a=new Blob([s],{type:"text/javascript"}),i=URL.createObjectURL(a);return this.cache.set(n,i),{url:i,hash:n}}}const fe=new le,ge="events";function Ce(o){if(o.includes(N))throw new Error("Base component id must not contain the delimiter sequence");return`${ne}_${o}${N}${ge}`}const D=async({componentId:o,componentIdForWidgetMgr:e,componentName:r,data:n,formId:t,fragmentId:s,getWidgetValue:a,moduleUrl:i,parentElement:l,widgetMgr:d})=>{const f=await import(i);if(!f)throw new Error("JS module does not exist.");if(!f.default||typeof f.default!="function")throw new Error("JS module does not have a default export function.");const g=(b,p)=>{let h={};try{h={...a(),[b]:p}}catch(C){v.error(`Failed to get existing value for ${b}`,C),h={[b]:p}}d.setJsonValue({id:e,formId:t},h,{fromUi:!0},s)},c=(b,p)=>{if(t){v.warn("BidiComponent: setTriggerValue ignored inside st.form. Triggers are not allowed in forms; use setStateValue and form submit instead.");return}const h=Ce(e);d.setTriggerValue({id:h,formId:t},{fromUi:!0},s,{event:b,value:p})};return f.default({name:r,data:n,key:o,parentElement:l,setStateValue:g,setTriggerValue:c})},uo=({containerRef:o,setError:e,skip:r=!1})=>{const t=`st-bidi-component-${u.useMemo(()=>go(),[])}`,{componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,id:f,jsContent:g,jsSourcePath:c,theme:b,widgetMgr:p,componentRegistry:{getBidiComponentURL:h}}=U(k),C=u.useMemo(()=>{if(c)return h(s,c)},[s,c,h]),y=u.useRef(),B=u.useRef(),T=u.useRef(!1);u.useEffect(()=>{const{current:S}=o;if(r||!g&&!C||!S)return;(async()=>{try{if(g){const{url:x}=fe.getOrCreateUrlForJs(g,`st-bidi-${s}`);y.current=await D({componentId:t,componentIdForWidgetMgr:f,componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,moduleUrl:x,parentElement:S,widgetMgr:p})}else if(C){const x=C;try{await new Promise((F,I)=>{const R=document.createElement("script");R.type="module",R.src=x,R.async=!0,R.onload=()=>F(),R.onerror=()=>I(new Error(`Failed to load script from ${C}`)),document.head.appendChild(R),B.current=R}),y.current=await D({componentId:t,componentIdForWidgetMgr:f,componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,moduleUrl:x,parentElement:S,widgetMgr:p})}catch(F){throw no(F,`Failed to load or execute script from ${C}`)}}}catch(x){T.current||A(x,e)}})()},[t,s,o,a,i,l,d,f,g,C,e,r,p,b]),u.useEffect(()=>()=>{T.current=!0;const S=y.current;S&&Promise.resolve(S).then(x=>{x?.()}).catch(x=>{v.error("Failed to run custom component cleanup",x)});const E=B.current;E?.parentNode&&E.parentNode.removeChild(E)},[])},xe=_("div",{target:"epzkg1s0"})(({cssCustomProperties:o})=>({...o,display:"contents"})),W=_("div",{target:"epzkg1s1"})({width:"100%",height:"100%"}),pe=u.memo(()=>{const o=u.useRef(null),e=u.useRef(null),[r,n]=u.useState(!1),[t,s]=u.useState(null),{id:a}=U(k);u.useEffect(()=>{if(o.current)try{if(o.current.shadowRoot){e.current=o.current.shadowRoot,n(!0);return}e.current=o.current.attachShadow({mode:"open"}),n(!0)}catch(l){A(l,s,"Failed to create shadow DOM")}},[a]);const i=!r||!!t;return so({containerRef:e,setError:s,skip:i}),uo({containerRef:e,setError:s,skip:i}),t?m(V,{name:"BidiComponent Error",message:t.message,stack:t.stack}):m(W,{ref:o,"data-testid":"stBidiComponentIsolated"})}),he=u.memo(()=>{const o=u.useRef(null),[e,r]=u.useState(null),n=!!e;return so({containerRef:o,setError:r,skip:n}),uo({containerRef:o,setError:r,skip:n}),e?m(V,{name:"BidiComponent Error",message:e.message,stack:e.stack}):m(W,{ref:o,"data-testid":"stBidiComponentRegular"})}),me=({children:o})=>{const{theme:e}=U(k),r=u.useMemo(()=>ae(e),[e]);return m(xe,{cssCustomProperties:r,children:o})},be=({element:o,widgetMgr:e,fragmentId:r,componentRegistry:n})=>{const{isolateStyles:t}=o;return m(ie,{element:o,widgetMgr:e,fragmentId:r,componentRegistry:n,children:m(W,{className:"stBidiComponent",children:m(me,{children:t?m(pe,{}):m(he,{})})})})},Re=u.memo(be);export{k as BidiComponentContext,Re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,E as B,_ as $,l as X,e as L,Q,O as K,bd as z,be as j,bf as Y,bg as Z,n as k,bh as M,V as U,W as q,k as ee,b8 as te,bi as ne,j as x,o as se,b1 as re}from"./index.
|
|
1
|
+
import{r as a,E as B,_ as $,l as X,e as L,Q,O as K,bd as z,be as j,bf as Y,bg as Z,n as k,bh as M,V as U,W as q,k as ee,b8 as te,bi as ne,j as x,o as se,b1 as re}from"./index.aCorc3Yt.js";import{w as oe,E as ae}from"./withFullScreenWrapper.CcWCKoY8.js";import{a as _,S as H,T as ie}from"./Toolbar.CQsWYXer.js";import{R as ce}from"./index.DBPWUJsj.js";import{a as J,c as le,b as ue,e as fe,t as de,S as me,d as pe}from"./embed.o8HvK3mH.js";import{u as he}from"./FormClearHelper.DN8D_YXO.js";import{T as ge}from"./TableChart.esm.DHKzVs3a.js";import"./moment.C7qA8nIE.js";import"./pandasStylerUtils.CFSReOTm.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";import"./index.8HslT92O.js";import"./main.CCVkbuxC.js";import"./throttle.ByDFm7WV.js";import"./toConsumableArray.DwMycSpg.js";import"./formatNumber.BK7h0k2z.js";import"./sprintf.DpPCfzXw.js";import"./formatMoment.C6Hwn6X5.js";import"./checkbox.OTGupu18.js";import"./createDownloadLinkElement.DnBEQQbK.js";import"./FileDownload.esm.yTkppsJy.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";var W=a.forwardRef(function(n,t){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,$({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});W.displayName="InsertChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&L(t.select.encodings)&&(t.select.encodings=Object.keys(n.encoding)))})}const be=(n,t,r,s,f,l,u,m)=>{const e=JSON.parse(n);if(typeof e.height=="number"&&e.height<=0&&delete e.height,typeof e.width=="number"&&e.width<=0&&delete e.width,s==="streamlit"?e.config=J(e.config,l):e.usermeta?.embedOptions?.theme==="streamlit"?(e.config=J(e.config,l),e.usermeta.embedOptions.theme=void 0):e.config=le(e.config,l),e.title&&(typeof e.title=="string"&&(e.title={text:e.title}),e.title.limit=e.title.limit??Math.max(u-40,0)),r&&m&&m>0&&(e.height=m),t&&u&&u>0&&(e.width=u,"vconcat"in e&&e.vconcat.forEach(o=>{o===null||typeof o!="object"||"hconcat"in o||"vconcat"in o||"concat"in o||"layer"in o||(o.width=u)})),e.padding||(e.padding={}),L(e.padding.bottom)&&(e.padding.bottom=Se),e.datasets)throw new Error("Datasets should not be passed as part of the spec");return f.length>0&&ye(e),e},we=(n,t,r,s,f)=>{const l=X(),{id:u,formId:m,spec:e,data:o,datasets:i,vegaLiteTheme:d,selectionMode:c}=n,h=a.useMemo(()=>c,[JSON.stringify(c)]),S=a.useMemo(()=>be(e,s,f,d,h,l,t,r),[e,s,f,d,h,l,t,r]);return{id:u,formId:m,vegaLiteTheme:d,spec:S,selectionMode:h,data:o,datasets:i,useContainerWidth:s}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:F(n)}function Ne(n){const t=I(n);if(L(t))return null;const r={};for(const[s,f]of Object.entries(t))r[s]=F(f);return r}function I(n){if(n?.length===0)return null;const t={};return n.forEach(r=>{if(!r)return;const s=r.hasName?r.name:null;t[s]=r.data}),t}function F(n,t=0){if(n.dimensions.numDataRows===0)return[];const r=[],{numDataRows:s,numDataColumns:f,numIndexColumns:l}=n.dimensions,u=n.columnTypes[0]??void 0,m=u?.type===Q.INDEX&&(K(u)||z(u)||j(u));for(let e=t;e<s;e++){const o={};if(m){const{content:i}=n.getCell(e,0);o[Ce.DATAFRAME_INDEX]=typeof i=="bigint"?Number(i):i}for(let i=0;i<f;i++){const d=i+l,{content:c,contentType:h}=n.getCell(e,d);if((c instanceof Date||typeof c=="number"&&Number.isFinite(c))&&(z(h)||j(h))&&!Y(h)){const S=new Date(c).getTimezoneOffset()*60*1e3;o[n.columnNames[0][d]]=c.valueOf()+S}else o[n.columnNames[0][d]]=typeof c=="bigint"?Number(c):c}r.push(o)}return r}const Ve=150,De=U.getLogger("useVegaLiteSelections"),Oe=(n,t,r)=>{const{id:s,formId:f,selectionMode:l}=n,u=a.useCallback(e=>{l.forEach(i=>{e.addSignalListener(i,Z(Ve,(d,c)=>{const h=e.getState({data:(N,A)=>l.some(g=>`${g}_store`===N),recurse:!1});k(h)&&t.setElementState(s,"viewState",h);let S=c;"vlPoint"in c&&"or"in c.vlPoint&&(S=c.vlPoint.or);const D={id:s,formId:f},E=JSON.parse(t.getStringValue(D)||"{}"),V={selection:{...E?.selection||{},[d]:S||{}}};M(E,V)||t.setStringValue(D,JSON.stringify(V),{fromUi:!0},r)}))});const o=t.getElementState(s,"viewState");if(k(o))try{return e.setState(o)}catch(i){De.warn("Failed to restore view state",i)}return e},[s,l,t,f,r]),m=a.useCallback(()=>{const e={selection:{}};l.forEach(c=>{e.selection[c]={}});const o={id:s,formId:f},i=t.getStringValue(o),d=i?JSON.parse(i):e;M(d,e)||t.setStringValue(o,JSON.stringify(e),{fromUi:!0},r)},[s,f,r,l,t]);return{maybeConfigureSelections:u,onFormCleared:m}},P="source",Te=U.getLogger("useVegaEmbed");function ve(n,t,r){const s=a.useRef(null),f=a.useRef(null),l=a.useRef(P),u=a.useRef(null),m=a.useRef([]),e=a.useRef(null),o=a.useRef([]),[i,d]=a.useState(!1),{maybeConfigureSelections:c,onFormCleared:h}=Oe(n,t,r);he({widgetMgr:t,element:n,onFormCleared:h});const{data:S,datasets:D}=n;a.useEffect(()=>{e.current=S,o.current=D,s.current===null&&(u.current=S,m.current=D)},[S,D]);const E=a.useCallback(()=>{f.current&&f.current(),f.current=null,s.current=null},[]),V=a.useCallback(async(g,b)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{E();const w={ast:!0,expr:ue,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:R,finalize:T}=await fe(g.current,b,w);s.current=c(R),f.current=T;const p=Ne(o.current),C=p?Object.keys(p):[];if(C.length===1){const[v]=C;l.current=v}else C.length===0&&y.data&&(l.current=P);const O=Ee(e.current);if(O&&s.current.insert(l.current,O),p)for(const[v,G]of Object.entries(p))s.current.insert(v,G);return await s.current.runAsync(),await s.current.resize().runAsync(),u.current=e.current,m.current=o.current,s.current}finally{d(!1)}},[E,c]),N=a.useCallback((g,b,w,y)=>{if(!y||y.dimensions.numDataRows===0){try{g.remove(b,de)}catch{}return}if(!w||w.dimensions.numDataRows===0){g.insert(b,F(y));return}y.hash!==w.hash&&(g.data(b,F(y)),Te.info(`Had to clear the ${b} dataset before inserting data through Vega view.`))},[]),A=a.useCallback(async(g,b)=>{if(s.current===null||i)return null;const w=u.current,y=m.current;(w||g)&&N(s.current,l.current,w,g);const R=I(y)??{},T=I(b)??{};for(const[p,C]of Object.entries(T)){const O=p||l.current,v=R[O];N(s.current,O,v,C)}for(const p of Object.keys(R))!Object.hasOwn(T,p)&&p!==l.current&&N(s.current,p,null,null);return await s.current?.resize().runAsync(),u.current=g,m.current=b,s.current},[N,i]);return{createView:V,updateView:A,finalizeView:E}}function Ae(n){try{const t=typeof n=="string"?JSON.parse(n):n;return!!(t.facet||t.encoding?.row||t.encoding?.column||t.encoding?.facet)}catch{return!1}}function Re(n){try{const t=typeof n=="string"?JSON.parse(n):n;return!("vconcat"in t)||!Array.isArray(t.vconcat)?!1:t.vconcat.some(r=>r!==null&&typeof r=="object"&&("hconcat"in r||"vconcat"in r||"concat"in r||"layer"in r))}catch{return!1}}const xe=({disableFullscreenMode:n,element:t,fragmentId:r,widgetMgr:s,widthConfig:f,heightConfig:l})=>{const[u,m]=a.useState(!1),[e,o]=a.useState(!1),{expanded:i,height:d,width:c,expand:h,collapse:S}=q(ae),{width:D,height:E,elementRef:V}=ee([u]),N=te(f)||t.useContainerWidth,A=ne(l),g=Ae(t.spec),b=Re(t.spec),w=we(t,g?c??0:D,(i?d:E)??0,i&&!b?!0:N,i?!0:A),{createView:y,updateView:R,finalizeView:T}=ve(w,s,r),{data:p,datasets:C,spec:O}=w;if(a.useLayoutEffect(()=>(V.current!==null&&y(V,O),T),[y,T,O,c,d,u,V]),a.useEffect(()=>{R(p,C)},[p,C]),a.useEffect(()=>{p||C?.[0]?.data?o(!0):o(!1)},[p,C]),u){const v=d??(E>0?E:void 0);return x(ce,{data:p??C[0]?.data,height:v,width:f??void 0,customToolbarActions:[x(_,{label:"Show chart",icon:W,onClick:()=>{m(!1)}},"show-chart")]})}return se(H,{height:A?i?d:"100%":d,useContainerWidth:i?!0:N,children:[x(ie,{target:H,isFullScreen:i,onExpand:h,onCollapse:S,disableFullscreenMode:n,children:e&&x(_,{label:"Show data",icon:ge,onClick:()=>{m(!0)}})}),x(re,{styles:[me]}),x(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:N,useContainerHeight:A,ref:V})]})},Fe=oe(xe),rt=a.memo(Fe);export{me as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,rt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as p,M as o,r as C,N,o as g,j as s,O as u,q as T,Q as m}from"./index.
|
|
1
|
+
import{z as p,M as o,r as C,N,o as g,j as s,O as u,q as T,Q as m}from"./index.aCorc3Yt.js";import{g as A,a as L,f as w}from"./pandasStylerUtils.CFSReOTm.js";import"./moment.C7qA8nIE.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";const x=p("div",{target:"e10e2fxn0"})(({theme:e})=>({fontSize:e.fontSizes.md,fontFamily:e.genericFonts.bodyFont,lineHeight:e.lineHeights.small,captionSide:"bottom"})),M=p("div",{target:"e10e2fxn1"})(({theme:e})=>({fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm,paddingTop:e.spacing.sm,paddingBottom:0,color:e.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),h=p("div",{target:"e10e2fxn2"})(({theme:e,borderMode:t})=>({border:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none",borderRadius:e.radii.default,overflow:"auto"})),O=p("table",{target:"e10e2fxn3"})(({theme:e})=>({width:e.sizes.full,color:e.colors.bodyText,borderSpacing:0})),S=(e,t=o.BorderMode.ALL)=>({borderBottom:t!==o.BorderMode.NONE?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:t===o.BorderMode.ALL||t===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:t===o.BorderMode.ALL?"none":void 0,paddingRight:t===o.BorderMode.NONE?"0":e.spacing.xs},verticalAlign:"middle",padding:`${e.spacing.twoXS} ${e.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.xs},"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.xs},fontWeight:e.fontWeights.normal}),b=p("td",{target:"e10e2fxn4"})(({theme:e,borderMode:t})=>S(e,t)),B=p("th",{target:"e10e2fxn5"})(({theme:e,borderMode:t})=>({...S(e,t),textAlign:"inherit",color:e.colors.fadedText60,"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.sm},"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.sm}})),H=p(b,{target:"e10e2fxn6"})(({theme:e})=>({color:e.colors.gray70,fontStyle:"italic",fontSize:e.fontSizes.md,textAlign:"center"}));function R(e){const t=e.data,{cssId:l,cssStyles:r,caption:d}=t.styler??{},{numHeaderRows:f,numDataRows:c,numColumns:a}=t.dimensions,n=N(c),i=e.element.borderMode;return g(x,{className:"stTable","data-testid":"stTable",children:[r&&s("style",{children:r}),s(h,{borderMode:i,children:g(O,{id:l,"data-testid":"stTableStyledTable",children:[f>0&&E(t,i),s("tbody",{children:n.length===0?s("tr",{children:s(H,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):n.map(y=>z(t,y,a,i))})]})}),d&&s(M,{children:d})]})}function E(e,t){const l=t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL;return s("thead",{children:A(e).map((r,d)=>s("tr",{children:r.map((f,c)=>{let a="inherit";if(l&&e.dimensions.numDataRows>0){const{contentType:n}=e.getCell(0,c);a=u(n)?"right":"left"}return s(B,{className:f.cssClass,scope:"col",borderMode:t,style:{textAlign:a},children:s(T,{source:f.name||" ",allowHTML:!1})},c)})},d))})}function z(e,t,l,r){return s("tr",{children:N(l).map(d=>$(e,t,d,r))},t)}function $(e,t,l,r){const{type:d,content:f,contentType:c}=e.getCell(t,l),a=L(e,t,l);let n=a?.displayContent||w(f,c),i=!1;const y={textAlign:u(c)?"right":"left"};switch(n?.endsWith('<span class="pd-t"></span>')&&(n=n.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case m.INDEX:return g(B,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);case m.DATA:return g(b,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const j=C.memo(R);export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,E as L,_ as k,z as p,aa as Se,o as x,j as a,ax as I,b as V,c as Ue,B as M,h as ve,$ as be,k as Ce,aj as ee,bh as Ie,e as D,bW as Ee,p as Be,ab as De,ac as Le,bP as ke,bQ as Ve}from"./index.lMhsw-5K.js";import{u as Me}from"./FormClearHelper.BM3uDLnU.js";import{g as oe,F as R,a as Re,D as Pe,I as Ae,s as Ne,b as Te}from"./FileHelper.DmtDDGp0.js";import{S as We,P as He}from"./ProgressBar.DWErD3j3.js";import{U as j}from"./UploadFileInfo.Dr-zDST7.js";const $e=e=>{const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current};var ne=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});ne.displayName="ChevronLeft";var le=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});le.displayName="ChevronRight";var se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});se.displayName="Clear";var ae=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.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"}))});ae.displayName="CloudUpload";var ie=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.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"}))});ie.displayName="Error";const re=p("section",{target:"ewslnz90"})(({isDisabled:e,theme:t})=>({display:"flex",gap:t.spacing.lg,alignItems:"center",padding:t.spacing.lg,backgroundColor:t.colors.secondaryBg,borderRadius:t.radii.default,border:t.colors.widgetBorderColor?`${t.sizes.borderWidth} solid ${t.colors.widgetBorderColor}`:void 0,height:t.sizes.largestElementHeight,":focus":{outline:"none"},":focus-visible":{boxShadow:t.shadows.focusRingOutline},cursor:e?"not-allowed":"pointer"})),je=p("div",{target:"ewslnz91"})(({theme:e})=>({marginRight:"auto",alignItems:"center",display:"flex",gap:e.spacing.lg,minWidth:0,width:"100%"})),ce=p("span",{target:"ewslnz92"})(({theme:e})=>({color:e.colors.darkenedBgMix100})),de=p("span",{target:"ewslnz93"})(({theme:e,disabled:t})=>({color:t?e.colors.fadedText40:e.colors.bodyText})),Xe=p("span",{target:"ewslnz94"})(({theme:e,disabled:t})=>({fontSize:e.fontSizes.sm,color:t?e.colors.fadedText40:e.colors.fadedText60,display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",maxWidth:"100%"})),Oe=p("div",{target:"ewslnz95"})({display:"flex",flexDirection:"column",minWidth:0,maxWidth:"100%"}),qe=p("span",{target:"ewslnz96"})({whiteSpace:"nowrap"}),pe=p("div",{target:"ewslnz97"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),_e=p("ul",{target:"ewslnz98"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),ue=p("li",{target:"ewslnz99"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),ge=p("div",{target:"ewslnz910"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),fe=p("div",{target:"ewslnz911"})(({theme:e,disabled:t})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t?e.colors.fadedText40:e.colors.bodyText})),he=p("div",{target:"ewslnz912"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Ke=p("span",{target:"ewslnz913"})(({theme:e})=>({marginRight:e.spacing.twoXS})),Qe=p("div",{target:"ewslnz914"})(({theme:e,disabled:t})=>({display:"flex",padding:e.spacing.twoXS,color:t?e.colors.fadedText40:e.colors.darkenedBgMix100})),Fe=p("small",{target:"ewslnz915"})(({theme:e})=>({color:e.colors.redTextColor,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),me=p("span",{target:"ewslnz916"})({}),Ye=e=>({[re]:{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"auto",gap:e.spacing.sm},[ce]:{display:"none"},[de]:{marginBottom:e.spacing.twoXS},[pe]:{paddingRight:e.spacing.lg},[he]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[fe]:{width:e.sizes.full},[ge]:{flexDirection:"column"},[Fe]:{height:"auto",whiteSpace:"initial"},[me]:{display:"none"},[ue]:{margin:e.spacing.none,padding:e.spacing.none}}),Ge=p("div",{target:"ewslnz917"})(({theme:e,width:t})=>{if(t<Se("23rem"))return Ye(e)}),Je=({multiple:e,acceptedExtensions:t,maxSizeBytes:n,acceptDirectory:i=!1,disabled:d})=>{const y=()=>i?"directories":e?"files":"file",c=()=>t.length?` • ${t.map(w=>w.replace(/^\./,"").toUpperCase()).join(", ")}`:null,F=()=>`Limit ${oe(n,R.Byte,0)} per file`;return x(je,{"data-testid":"stFileUploaderDropzoneInstructions",children:[a(ce,{children:a(I,{content:ae,size:"threeXL"})}),x(Oe,{children:[x(de,{disabled:d,children:["Drag and drop ",y()," here"]}),x(Xe,{disabled:d,children:[F(),c()]})]})]})},Ze=o.memo(Je),et=({onDrop:e,multiple:t,acceptedExtensions:n,maxSizeBytes:i,disabled:d,label:y,acceptDirectory:c=!1})=>a(Pe,{onDrop:e,multiple:t,accept:Re(n),maxSize:i,disabled:d,useFsAccessApi:!1,children:({getRootProps:F,getInputProps:w})=>{const U=w({multiple:t||!!c});return x(re,{...F(),"data-testid":"stFileUploaderDropzone",isDisabled:d,"aria-label":y,"aria-disabled":d,children:[a("input",{"data-testid":"stFileUploaderDropzoneInput",...U,...c&&{webkitdirectory:""}}),a(Ze,{multiple:t,acceptedExtensions:n,maxSizeBytes:i,acceptDirectory:c,disabled:d}),a(qe,{children:a(V,{kind:M.SECONDARY,disabled:d,size:Ue.SMALL,children:c?"Browse directories":"Browse files"})})]})}}),tt=o.memo(et),we=p("small",{target:"e1xq3mgd0"})(({kind:e,disabled:t,theme:n})=>{const{redTextColor:i,fadedText60:d,fadedText40:y}=n.colors;let c=d;return t&&(c=y),e==="danger"&&(c=i),{color:c,fontSize:n.fontSizes.sm,lineHeight:n.lineHeights.tight}}),ot=({fileInfo:e,disabled:t})=>e.status.type==="uploading"?a(He,{value:e.status.progress,size:We.SMALL}):e.status.type==="error"?x(Fe,{children:[a(Ke,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),a(me,{children:a(I,{content:ie,size:"lg"})})]}):e.status.type==="uploaded"?a(we,{disabled:t,children:oe(e.size,R.Byte)}):null,nt=({fileInfo:e,onDelete:t,disabled:n})=>x(he,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[a(Qe,{disabled:n,children:a(I,{content:Ae,size:"twoXL"})}),x(ge,{className:"stFileUploaderFileData",children:[a(fe,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,disabled:n,children:e.name}),a(ot,{fileInfo:e,disabled:n})]}),a("div",{"data-testid":"stFileUploaderDeleteBtn",children:a(V,{onClick:()=>t(e.id),kind:M.MINIMAL,disabled:n,"aria-label":`Remove ${e.name}`,children:a(I,{content:se,size:"lg"})})})]}),lt=o.memo(nt),st=p("div",{target:"e1o0u1j0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),at=p("div",{target:"e1o0u1j1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),it=({currentPage:e,totalPages:t,onNext:n,onPrevious:i})=>x(st,{"data-testid":"stFileUploaderPagination",children:[a(we,{children:`Showing page ${e} of ${t}`}),x(at,{children:[a(V,{onClick:i,kind:M.MINIMAL,children:a(I,{content:ne,size:"xl"})}),a(V,{onClick:n,kind:M.MINIMAL,children:a(I,{content:le,size:"xl"})})]})]}),rt=o.memo(it),te=(e,t)=>Math.ceil(e.length/t),ct=e=>ve(({pageSize:n,items:i,resetOnAdd:d,...y})=>{const[c,F]=o.useState(0),[w,U]=o.useState(()=>te(i,n)),u=$e(i);o.useEffect(()=>{u&&u.length!==i.length&&U(te(i,n)),u&&u.length<i.length?d&&F(0):c+1>=w&&F(w-1)},[i,c,n,u,d,w]);const E=()=>{F(Math.min(c+1,w-1))},v=()=>{F(Math.max(0,c-1))},P=i.slice(c*n,c*n+n);return x(be,{children:[a(e,{items:P,...y}),i.length>n?a(rt,{pageSize:n,totalPages:w,currentPage:c+1,onNext:E,onPrevious:v}):null]})},e),dt=({items:e,onDelete:t,disabled:n})=>a(_e,{children:e.map(i=>a(ue,{children:a(lt,{fileInfo:i,onDelete:t,disabled:n})},i.id))}),pt=ct(dt),ut=e=>a(pe,{children:a(pt,{...e})}),gt=o.memo(ut),ft=(e,t)=>{const n=t.getFileUploaderStateValue(e);if(D(n))return{files:[],nextLocalId:1};const{uploadedFileInfo:i}=n;if(D(i)||i.length===0)return{files:[],nextLocalId:1};let d=1;return{files:i.map(c=>{const F=c.name,w=c.size,U=c.fileId,u=c.fileUrls,E=new j(F,w,d,{type:"uploaded",fileId:U,fileUrls:u});return d+=1,E}),nextLocalId:d}},$=e=>{const t=e.filter(n=>n.status.type==="uploaded").map(n=>{const{name:i,size:d,status:y}=n,{fileId:c,fileUrls:F}=y;return new ke({fileId:c,fileUrls:F,name:i,size:d})});return new Ve({uploadedFileInfo:t})},ht=({disabled:e,element:t,widgetMgr:n,uploadClient:i,fragmentId:d})=>{const{width:y,elementRef:c}=Ce(),{files:F,nextLocalId:w}=o.useMemo(()=>ft(t,n),[t,n]),U=o.useRef(w),[u,E]=o.useState(()=>F),v=o.useRef(u);o.useEffect(()=>{v.current=u},[u]);const[P,X]=o.useState(!1),B=o.useCallback(()=>{const l=U.current;return U.current+=1,l},[]),A=o.useMemo(()=>{const l=t.maxUploadSizeMb;return Ne(l,R.Megabyte,R.Byte)},[t.maxUploadSizeMb]),S=o.useCallback(l=>{ee.flushSync(()=>{E(s=>{const r=typeof l=="function"?l(s):l;return v.current=r,r})})},[]),N=o.useCallback(l=>{ee.flushSync(()=>{X(l)})},[X]),O=o.useCallback(l=>{S(s=>[...s,l])},[S]),T=o.useCallback(l=>{l.length!==0&&S(s=>[...s,...l])},[S]),q=o.useCallback(l=>{S(s=>s.filter(r=>r.id!==l))},[S]),b=o.useCallback((l,s)=>{S(r=>r.map(g=>g.id===l?s:g))},[S]),C=o.useCallback(l=>v.current.find(s=>s.id===l),[]),_=u.some(l=>l.status.type==="uploading")||P?"updating":"ready";o.useEffect(()=>{n.getFileUploaderStateValue(t)===void 0&&n.setFileUploaderStateValue(t,$(v.current),{fromUi:!1},d)},[n,t,d]),o.useEffect(()=>{if(_!=="ready")return;const l=$(u),s=n.getFileUploaderStateValue(t);Ie(l,s)||n.setFileUploaderStateValue(t,l,{fromUi:!0},d)},[_,u,n,t,d]);const ye=o.useCallback(()=>{S(()=>[]);const l=$([]);n.setFileUploaderStateValue(t,l,{fromUi:!0},d)},[t,d,S,n]);Me({element:t,widgetMgr:n,onFormCleared:ye});const K=o.useCallback(l=>{const s=t.type;if(!s||s.length===0)return!0;const r=l.name.toLowerCase();return s.some(g=>r.endsWith(g.toLowerCase()))},[t.type]),Q=o.useCallback(l=>{const s=[],r=[];return l.forEach(g=>{K(g)?s.push(g):r.push({file:g,errors:[{code:"file-invalid-type",message:`${g.type} files are not allowed.`}]})}),{accepted:s,rejected:r}},[K]),Y=o.useCallback((l,s)=>{const r=C(l);D(r)||r.status.type!=="uploading"||b(r.id,r.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},[C,b]),G=o.useCallback((l,s)=>{const r=C(s);if(D(r)||r.status.type!=="uploading")return;const g=Math.round(l.loaded*100/l.total);r.status.progress!==g&&b(s,r.setStatus({type:"uploading",abortController:r.status.abortController,progress:g}))},[C,b]),J=o.useCallback((l,s)=>{const r=new AbortController,g=s.webkitRelativePath||s.name,f=new j(g,s.size,B(),{type:"uploading",abortController:r,progress:1});O(f),i.uploadFile(t,l.uploadUrl,s,h=>G(h,f.id),r.signal).then(()=>Y(f.id,l)).catch(h=>{h instanceof DOMException&&h.name==="AbortError"||b(f.id,f.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},[O,t,B,Y,G,b,i]),W=o.useCallback(l=>{if(e)return;const s=C(l);D(s)||(s.status.type==="uploading"&&s.status.abortController.abort(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&i.deleteFile(s.status.fileUrls.deleteUrl),q(l))},[e,C,q,i]),xe=o.useCallback((l,s)=>{const{multipleFiles:r}=t,g=!!t.acceptDirectory;let f=[...l],h=[...s];if(g&&f.length>0){const{accepted:z,rejected:m}=Q(f);f=z,h=[...h,...m]}if(!r&&f.length===0&&h.length>1){const z=h.findIndex(m=>m.errors.length===1&&m.errors[0].code==="too-many-files");z>=0&&(f.push(h[z].file),h.splice(z,1))}if(i.fetchFileURLs(f).then(z=>{if(!r&&f.length>0){const m=v.current.find(H=>H.status.type!=="error");if(m){N(!0);try{W(m.id)}finally{N(!1)}}}Ee(z,f).forEach(([m,H])=>{J(m,H)})}).catch(z=>{T(f.map(m=>new j(m.name,m.size,B(),{type:"error",errorMessage:z})))}),h.length>0){const z=h.map(m=>Te(m,B(),A));T(z)}},[T,W,t,Q,A,B,i,J,N]),Z=o.useMemo(()=>u.slice().reverse(),[u]),ze=t.type;return x(Ge,{className:"stFileUploader","data-testid":"stFileUploader",width:y,ref:c,children:[a(Le,{label:t.label,disabled:e,labelVisibility:Be(t.labelVisibility?.value),children:t.help&&a(De,{content:t.help,label:t.label})}),a(tt,{onDrop:xe,multiple:t.multipleFiles,acceptedExtensions:ze,maxSizeBytes:A,label:t.label,disabled:e,acceptDirectory:!!t.acceptDirectory}),Z.length>0&&a(gt,{items:Z,pageSize:3,onDelete:W,resetOnAdd:!0,disabled:e})]})},zt=o.memo(ht);export{zt as default};
|
|
1
|
+
import{r as o,E as L,_ as k,z as p,aa as Se,o as x,j as a,ax as I,b as V,c as Ue,B as M,h as ve,$ as be,k as Ce,aj as ee,bh as Ie,e as D,bW as Ee,p as Be,ab as De,ac as Le,bP as ke,bQ as Ve}from"./index.aCorc3Yt.js";import{u as Me}from"./FormClearHelper.DN8D_YXO.js";import{g as oe,F as R,a as Re,D as Pe,I as Ae,s as Ne,b as Te}from"./FileHelper.hUOqtbwa.js";import{S as We,P as He}from"./ProgressBar.C5uBOtcx.js";import{U as j}from"./UploadFileInfo.Dr-zDST7.js";const $e=e=>{const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current};var ne=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});ne.displayName="ChevronLeft";var le=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});le.displayName="ChevronRight";var se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});se.displayName="Clear";var ae=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.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"}))});ae.displayName="CloudUpload";var ie=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.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"}))});ie.displayName="Error";const re=p("section",{target:"ewslnz90"})(({isDisabled:e,theme:t})=>({display:"flex",gap:t.spacing.lg,alignItems:"center",padding:t.spacing.lg,backgroundColor:t.colors.secondaryBg,borderRadius:t.radii.default,border:t.colors.widgetBorderColor?`${t.sizes.borderWidth} solid ${t.colors.widgetBorderColor}`:void 0,height:t.sizes.largestElementHeight,":focus":{outline:"none"},":focus-visible":{boxShadow:t.shadows.focusRingOutline},cursor:e?"not-allowed":"pointer"})),je=p("div",{target:"ewslnz91"})(({theme:e})=>({marginRight:"auto",alignItems:"center",display:"flex",gap:e.spacing.lg,minWidth:0,width:"100%"})),ce=p("span",{target:"ewslnz92"})(({theme:e})=>({color:e.colors.darkenedBgMix100})),de=p("span",{target:"ewslnz93"})(({theme:e,disabled:t})=>({color:t?e.colors.fadedText40:e.colors.bodyText})),Xe=p("span",{target:"ewslnz94"})(({theme:e,disabled:t})=>({fontSize:e.fontSizes.sm,color:t?e.colors.fadedText40:e.colors.fadedText60,display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",maxWidth:"100%"})),Oe=p("div",{target:"ewslnz95"})({display:"flex",flexDirection:"column",minWidth:0,maxWidth:"100%"}),qe=p("span",{target:"ewslnz96"})({whiteSpace:"nowrap"}),pe=p("div",{target:"ewslnz97"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),_e=p("ul",{target:"ewslnz98"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),ue=p("li",{target:"ewslnz99"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),ge=p("div",{target:"ewslnz910"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),fe=p("div",{target:"ewslnz911"})(({theme:e,disabled:t})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t?e.colors.fadedText40:e.colors.bodyText})),he=p("div",{target:"ewslnz912"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Ke=p("span",{target:"ewslnz913"})(({theme:e})=>({marginRight:e.spacing.twoXS})),Qe=p("div",{target:"ewslnz914"})(({theme:e,disabled:t})=>({display:"flex",padding:e.spacing.twoXS,color:t?e.colors.fadedText40:e.colors.darkenedBgMix100})),Fe=p("small",{target:"ewslnz915"})(({theme:e})=>({color:e.colors.redTextColor,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),me=p("span",{target:"ewslnz916"})({}),Ye=e=>({[re]:{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"auto",gap:e.spacing.sm},[ce]:{display:"none"},[de]:{marginBottom:e.spacing.twoXS},[pe]:{paddingRight:e.spacing.lg},[he]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[fe]:{width:e.sizes.full},[ge]:{flexDirection:"column"},[Fe]:{height:"auto",whiteSpace:"initial"},[me]:{display:"none"},[ue]:{margin:e.spacing.none,padding:e.spacing.none}}),Ge=p("div",{target:"ewslnz917"})(({theme:e,width:t})=>{if(t<Se("23rem"))return Ye(e)}),Je=({multiple:e,acceptedExtensions:t,maxSizeBytes:n,acceptDirectory:i=!1,disabled:d})=>{const y=()=>i?"directories":e?"files":"file",c=()=>t.length?` • ${t.map(w=>w.replace(/^\./,"").toUpperCase()).join(", ")}`:null,F=()=>`Limit ${oe(n,R.Byte,0)} per file`;return x(je,{"data-testid":"stFileUploaderDropzoneInstructions",children:[a(ce,{children:a(I,{content:ae,size:"threeXL"})}),x(Oe,{children:[x(de,{disabled:d,children:["Drag and drop ",y()," here"]}),x(Xe,{disabled:d,children:[F(),c()]})]})]})},Ze=o.memo(Je),et=({onDrop:e,multiple:t,acceptedExtensions:n,maxSizeBytes:i,disabled:d,label:y,acceptDirectory:c=!1})=>a(Pe,{onDrop:e,multiple:t,accept:Re(n),maxSize:i,disabled:d,useFsAccessApi:!1,children:({getRootProps:F,getInputProps:w})=>{const U=w({multiple:t||!!c});return x(re,{...F(),"data-testid":"stFileUploaderDropzone",isDisabled:d,"aria-label":y,"aria-disabled":d,children:[a("input",{"data-testid":"stFileUploaderDropzoneInput",...U,...c&&{webkitdirectory:""}}),a(Ze,{multiple:t,acceptedExtensions:n,maxSizeBytes:i,acceptDirectory:c,disabled:d}),a(qe,{children:a(V,{kind:M.SECONDARY,disabled:d,size:Ue.SMALL,children:c?"Browse directories":"Browse files"})})]})}}),tt=o.memo(et),we=p("small",{target:"e1xq3mgd0"})(({kind:e,disabled:t,theme:n})=>{const{redTextColor:i,fadedText60:d,fadedText40:y}=n.colors;let c=d;return t&&(c=y),e==="danger"&&(c=i),{color:c,fontSize:n.fontSizes.sm,lineHeight:n.lineHeights.tight}}),ot=({fileInfo:e,disabled:t})=>e.status.type==="uploading"?a(He,{value:e.status.progress,size:We.SMALL}):e.status.type==="error"?x(Fe,{children:[a(Ke,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),a(me,{children:a(I,{content:ie,size:"lg"})})]}):e.status.type==="uploaded"?a(we,{disabled:t,children:oe(e.size,R.Byte)}):null,nt=({fileInfo:e,onDelete:t,disabled:n})=>x(he,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[a(Qe,{disabled:n,children:a(I,{content:Ae,size:"twoXL"})}),x(ge,{className:"stFileUploaderFileData",children:[a(fe,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,disabled:n,children:e.name}),a(ot,{fileInfo:e,disabled:n})]}),a("div",{"data-testid":"stFileUploaderDeleteBtn",children:a(V,{onClick:()=>t(e.id),kind:M.MINIMAL,disabled:n,"aria-label":`Remove ${e.name}`,children:a(I,{content:se,size:"lg"})})})]}),lt=o.memo(nt),st=p("div",{target:"e1o0u1j0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),at=p("div",{target:"e1o0u1j1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),it=({currentPage:e,totalPages:t,onNext:n,onPrevious:i})=>x(st,{"data-testid":"stFileUploaderPagination",children:[a(we,{children:`Showing page ${e} of ${t}`}),x(at,{children:[a(V,{onClick:i,kind:M.MINIMAL,children:a(I,{content:ne,size:"xl"})}),a(V,{onClick:n,kind:M.MINIMAL,children:a(I,{content:le,size:"xl"})})]})]}),rt=o.memo(it),te=(e,t)=>Math.ceil(e.length/t),ct=e=>ve(({pageSize:n,items:i,resetOnAdd:d,...y})=>{const[c,F]=o.useState(0),[w,U]=o.useState(()=>te(i,n)),u=$e(i);o.useEffect(()=>{u&&u.length!==i.length&&U(te(i,n)),u&&u.length<i.length?d&&F(0):c+1>=w&&F(w-1)},[i,c,n,u,d,w]);const E=()=>{F(Math.min(c+1,w-1))},v=()=>{F(Math.max(0,c-1))},P=i.slice(c*n,c*n+n);return x(be,{children:[a(e,{items:P,...y}),i.length>n?a(rt,{pageSize:n,totalPages:w,currentPage:c+1,onNext:E,onPrevious:v}):null]})},e),dt=({items:e,onDelete:t,disabled:n})=>a(_e,{children:e.map(i=>a(ue,{children:a(lt,{fileInfo:i,onDelete:t,disabled:n})},i.id))}),pt=ct(dt),ut=e=>a(pe,{children:a(pt,{...e})}),gt=o.memo(ut),ft=(e,t)=>{const n=t.getFileUploaderStateValue(e);if(D(n))return{files:[],nextLocalId:1};const{uploadedFileInfo:i}=n;if(D(i)||i.length===0)return{files:[],nextLocalId:1};let d=1;return{files:i.map(c=>{const F=c.name,w=c.size,U=c.fileId,u=c.fileUrls,E=new j(F,w,d,{type:"uploaded",fileId:U,fileUrls:u});return d+=1,E}),nextLocalId:d}},$=e=>{const t=e.filter(n=>n.status.type==="uploaded").map(n=>{const{name:i,size:d,status:y}=n,{fileId:c,fileUrls:F}=y;return new ke({fileId:c,fileUrls:F,name:i,size:d})});return new Ve({uploadedFileInfo:t})},ht=({disabled:e,element:t,widgetMgr:n,uploadClient:i,fragmentId:d})=>{const{width:y,elementRef:c}=Ce(),{files:F,nextLocalId:w}=o.useMemo(()=>ft(t,n),[t,n]),U=o.useRef(w),[u,E]=o.useState(()=>F),v=o.useRef(u);o.useEffect(()=>{v.current=u},[u]);const[P,X]=o.useState(!1),B=o.useCallback(()=>{const l=U.current;return U.current+=1,l},[]),A=o.useMemo(()=>{const l=t.maxUploadSizeMb;return Ne(l,R.Megabyte,R.Byte)},[t.maxUploadSizeMb]),S=o.useCallback(l=>{ee.flushSync(()=>{E(s=>{const r=typeof l=="function"?l(s):l;return v.current=r,r})})},[]),N=o.useCallback(l=>{ee.flushSync(()=>{X(l)})},[X]),O=o.useCallback(l=>{S(s=>[...s,l])},[S]),T=o.useCallback(l=>{l.length!==0&&S(s=>[...s,...l])},[S]),q=o.useCallback(l=>{S(s=>s.filter(r=>r.id!==l))},[S]),b=o.useCallback((l,s)=>{S(r=>r.map(g=>g.id===l?s:g))},[S]),C=o.useCallback(l=>v.current.find(s=>s.id===l),[]),_=u.some(l=>l.status.type==="uploading")||P?"updating":"ready";o.useEffect(()=>{n.getFileUploaderStateValue(t)===void 0&&n.setFileUploaderStateValue(t,$(v.current),{fromUi:!1},d)},[n,t,d]),o.useEffect(()=>{if(_!=="ready")return;const l=$(u),s=n.getFileUploaderStateValue(t);Ie(l,s)||n.setFileUploaderStateValue(t,l,{fromUi:!0},d)},[_,u,n,t,d]);const ye=o.useCallback(()=>{S(()=>[]);const l=$([]);n.setFileUploaderStateValue(t,l,{fromUi:!0},d)},[t,d,S,n]);Me({element:t,widgetMgr:n,onFormCleared:ye});const K=o.useCallback(l=>{const s=t.type;if(!s||s.length===0)return!0;const r=l.name.toLowerCase();return s.some(g=>r.endsWith(g.toLowerCase()))},[t.type]),Q=o.useCallback(l=>{const s=[],r=[];return l.forEach(g=>{K(g)?s.push(g):r.push({file:g,errors:[{code:"file-invalid-type",message:`${g.type} files are not allowed.`}]})}),{accepted:s,rejected:r}},[K]),Y=o.useCallback((l,s)=>{const r=C(l);D(r)||r.status.type!=="uploading"||b(r.id,r.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},[C,b]),G=o.useCallback((l,s)=>{const r=C(s);if(D(r)||r.status.type!=="uploading")return;const g=Math.round(l.loaded*100/l.total);r.status.progress!==g&&b(s,r.setStatus({type:"uploading",abortController:r.status.abortController,progress:g}))},[C,b]),J=o.useCallback((l,s)=>{const r=new AbortController,g=s.webkitRelativePath||s.name,f=new j(g,s.size,B(),{type:"uploading",abortController:r,progress:1});O(f),i.uploadFile(t,l.uploadUrl,s,h=>G(h,f.id),r.signal).then(()=>Y(f.id,l)).catch(h=>{h instanceof DOMException&&h.name==="AbortError"||b(f.id,f.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},[O,t,B,Y,G,b,i]),W=o.useCallback(l=>{if(e)return;const s=C(l);D(s)||(s.status.type==="uploading"&&s.status.abortController.abort(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&i.deleteFile(s.status.fileUrls.deleteUrl),q(l))},[e,C,q,i]),xe=o.useCallback((l,s)=>{const{multipleFiles:r}=t,g=!!t.acceptDirectory;let f=[...l],h=[...s];if(g&&f.length>0){const{accepted:z,rejected:m}=Q(f);f=z,h=[...h,...m]}if(!r&&f.length===0&&h.length>1){const z=h.findIndex(m=>m.errors.length===1&&m.errors[0].code==="too-many-files");z>=0&&(f.push(h[z].file),h.splice(z,1))}if(i.fetchFileURLs(f).then(z=>{if(!r&&f.length>0){const m=v.current.find(H=>H.status.type!=="error");if(m){N(!0);try{W(m.id)}finally{N(!1)}}}Ee(z,f).forEach(([m,H])=>{J(m,H)})}).catch(z=>{T(f.map(m=>new j(m.name,m.size,B(),{type:"error",errorMessage:z})))}),h.length>0){const z=h.map(m=>Te(m,B(),A));T(z)}},[T,W,t,Q,A,B,i,J,N]),Z=o.useMemo(()=>u.slice().reverse(),[u]),ze=t.type;return x(Ge,{className:"stFileUploader","data-testid":"stFileUploader",width:y,ref:c,children:[a(Le,{label:t.label,disabled:e,labelVisibility:Be(t.labelVisibility?.value),children:t.help&&a(De,{content:t.help,label:t.label})}),a(tt,{onDrop:xe,multiple:t.multipleFiles,acceptedExtensions:ze,maxSizeBytes:A,label:t.label,disabled:e,acceptDirectory:!!t.acceptDirectory}),Z.length>0&&a(gt,{items:Z,pageSize:3,onDelete:W,resetOnAdd:!0,disabled:e})]})},zt=o.memo(ht);export{zt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,E as S,_ as A,a_ as o,m as D,a$ as j,z as c,b0 as H,aA as v,l as P,k as G,o as f,j as a,p as q,q as x,P as F,ax as U,b1 as X,aa as Y}from"./index.
|
|
1
|
+
import{r as l,E as S,_ as A,a_ as o,m as D,a$ as j,z as c,b0 as H,aA as v,l as P,k as G,o as f,j as a,p as q,q as x,P as F,ax as U,b1 as X,aa as Y}from"./index.aCorc3Yt.js";import{e as J,S as K,a as Q,b as Z}from"./embed.o8HvK3mH.js";import{W as ee}from"./WidgetLabelHelpIconInline.6xCU76OE.js";import{i as L,f as re}from"./formatNumber.BK7h0k2z.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";import"./numbro.B9_PXfzp.js";import"./sprintf.DpPCfzXw.js";var z=l.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(S,A({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}))});z.displayName="ArrowDownward";var b=l.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(S,A({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}))});b.displayName="ArrowUpward";function k(e,r){switch(r){case o.MetricColor.RED:return e.colors.redColor;case o.MetricColor.GREEN:return e.colors.greenColor;case o.MetricColor.ORANGE:return e.colors.orangeColor;case o.MetricColor.YELLOW:return e.colors.yellowColor;case o.MetricColor.BLUE:return e.colors.blueColor;case o.MetricColor.VIOLET:return e.colors.violetColor;case o.MetricColor.PRIMARY:return e.colors.primary;default:return e.colors.grayColor}}function V(e,r){const t=D(e);switch(r){case o.MetricColor.RED:return e.colors.redBackgroundColor;case o.MetricColor.GREEN:return e.colors.greenBackgroundColor;case o.MetricColor.ORANGE:return e.colors.orangeBackgroundColor;case o.MetricColor.YELLOW:return e.colors.yellowBackgroundColor;case o.MetricColor.BLUE:return e.colors.blueBackgroundColor;case o.MetricColor.VIOLET:return e.colors.violetBackgroundColor;case o.MetricColor.PRIMARY:return j(e.colors.primary,t?.9:.7);default:return e.colors.grayBackgroundColor}}function oe(e,r){switch(r){case o.MetricColor.RED:return e.colors.redTextColor;case o.MetricColor.GREEN:return e.colors.greenTextColor;case o.MetricColor.ORANGE:return e.colors.orangeTextColor;case o.MetricColor.YELLOW:return e.colors.yellowTextColor;case o.MetricColor.BLUE:return e.colors.blueTextColor;case o.MetricColor.VIOLET:return e.colors.violetTextColor;case o.MetricColor.PRIMARY:return e.colors.primary;default:return e.colors.grayTextColor}}const te=c("div",{target:"e132k71j0"})(({theme:e,showBorder:r})=>({height:"100%",...r&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,overflow:"hidden"}})),ie=c("div",{target:"e132k71j1"})(({theme:e,showBorder:r})=>({...r&&{padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`}})),ae=c("div",{target:"e132k71j2"})(({theme:e,showBorder:r})=>({marginTop:r?void 0:e.spacing.lg,marginBottom:r?e.spacing.twoXL:void 0})),h=c("div",{target:"e132k71j3"})(({theme:e})=>({overflowWrap:"normal",textOverflow:"ellipsis",width:"100%",overflow:"hidden",whiteSpace:"nowrap",fontFamily:e.genericFonts.bodyFont,lineHeight:"normal",verticalAlign:"middle","& > div":{overflow:"hidden","& > p":{textOverflow:"ellipsis",overflow:"hidden"}}})),le=c(H,{target:"e132k71j4"})(({visibility:e})=>({marginBottom:0,display:e===v.Collapsed?"none":"grid",gridTemplateColumns:e===v.Collapsed?"initial":"auto 1fr",visibility:e===v.Hidden?"hidden":"visible"})),ne=c("div",{target:"e132k71j5"})(({theme:e})=>({fontSize:e.fontSizes.threeXL,color:e.colors.bodyText,paddingBottom:e.spacing.twoXS})),se=c("div",{target:"e132k71j6"})(({theme:e,metricColor:r,showArrow:t})=>({color:oe(e,r),backgroundColor:V(e,r),fontSize:e.fontSizes.sm,display:"inline-flex",flexDirection:"row",alignItems:"center",fontWeight:e.fontWeights.normal,borderRadius:e.radii.full,maxWidth:"100%",padding:`${e.spacing.threeXS} ${e.spacing.xs} ${e.spacing.threeXS} ${e.spacing.xs}`,...t&&{paddingLeft:e.spacing.twoXS}})),ce=1e3;function R(e,r){try{return re(Number(e),r)}catch{return e}}function de(e,r,t,i,p){const n=`metric_chart_${Math.random().toString(36).slice(2,10)}`,C=e.length===1?[e[0],e[0]]:e,s={$schema:"https://vega.github.io/schema/vega-lite/v5.json",width:Math.round(t),height:Math.round(Y("3.5rem")),data:{values:C.map((M,g)=>({x:g,y:M}))},layer:[{name:`${n}_mark`,mark:{type:"line",...r===o.ChartType.LINE&&{type:"line",strokeCap:"round",strokeWidth:i.sizes.metricStrokeWidth},...r===o.ChartType.BAR&&{type:"bar",cornerRadius:parseFloat(i.radii.full)},...r===o.ChartType.AREA&&{type:"area",color:V(i,p),opacity:1,line:{color:k(i,p),opacity:1,strokeWidth:i.sizes.metricStrokeWidth,strokeCap:"round"}}},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}},{name:`${n}_points`,mark:{type:"point",opacity:0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}},params:[{name:`${n}_hover_selection`,select:{type:"point",encodings:["x"],nearest:!0,on:e.length>ce?"mousemove{16}":"mousemove",clear:"mouseleave"}}]},{name:`${n}_highlighted_points`,transform:[{filter:{param:`${n}_hover_selection`,empty:!1}}],mark:{type:"point",filled:!0,size:65,tooltip:!0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}}],config:{view:{stroke:null},padding:{left:-3,right:-3,top:2,bottom:2},...r===o.ChartType.BAR&&{padding:{left:0,right:0,top:2,bottom:2}},mark:{tooltip:{content:"encoding"},color:k(i,p)}}};return s.config=Q(s.config,i),s}function ue({element:e}){const r=P(),t=l.useRef(null),{width:i,elementRef:p}=G(),{MetricDirection:m}=o,{body:n,label:C,delta:s,direction:M,color:g,labelVisibility:B,help:E,showBorder:w,chartData:d,chartType:T,format:y}=e,N=y&&L(n)?R(n,y):n,$=y&&s&&L(s)?R(s,y):s;let u=null;switch(M){case m.DOWN:u=z;break;case m.UP:u=b;break;case m.NONE:break}const I="0 threeXS 0 0",W=s!=="";return l.useEffect(()=>{if(d&&d.length>0&&t.current&&i>0){const O=de(d,T,i,r,g);J(t.current,O,{actions:!1,renderer:"svg",ast:!0,expr:Z,tooltip:{theme:"custom",formatTooltip:_=>`${_.y}`}})}},[d,g,r,i,T,t]),f(te,{className:"stMetric","data-testid":"stMetric",showBorder:w,children:[f(ie,{showBorder:w,children:[f(le,{"data-testid":"stMetricLabel",visibility:q(B?.value),children:[a(h,{children:a(x,{source:C,allowHTML:!1,isLabel:!0})}),E&&a(ee,{content:E,placement:F.TOP_RIGHT,label:C})]}),a(ne,{"data-testid":"stMetricValue",children:a(h,{children:a(x,{source:N,allowHTML:!1,isLabel:!0,inheritFont:!0})})}),W&&f(se,{"data-testid":"stMetricDelta",metricColor:g,showArrow:u!==null,children:[u&&a(U,{testid:u===b?"stMetricDeltaIcon-Up":"stMetricDeltaIcon-Down",content:u,size:"md",margin:I}),a(h,{children:a(x,{source:$,allowHTML:!1,isLabel:!0,inheritFont:!0})})]})]}),d&&d.length>0&&f("div",{ref:p,children:[a(X,{styles:[K]}),a(ae,{ref:t,"data-testid":"stMetricChart",showBorder:w})]})]})}const xe=l.memo(ue);export{xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aR as L,aS as E,aT as O,aU as A,z as B,r as n,l as H,az as k,aV as N,j as h,aW as $,o as F,p as D,ab as P,ac as U,aX as Y,aY as j,av as K,aZ as X,ae as Z}from"./index.
|
|
1
|
+
import{aR as L,aS as E,aT as O,aU as A,z as B,r as n,l as H,az as k,aV as N,j as h,aW as $,o as F,p as D,ab as P,ac as U,aX as Y,aY as j,av as K,aZ as X,ae as Z}from"./index.aCorc3Yt.js";import{u as _}from"./useBasicWidgetState.Bg0ZMUt5.js";import{a as q}from"./_arrayIncludes.B19Iyn2B.js";import"./FormClearHelper.DN8D_YXO.js";import"./_baseIndexOf.BTknn6Gb.js";var G=200;function J(o,t,d,u){var e=-1,m=q,l=!0,p=o.length,s=[],f=t.length;if(!p)return s;t.length>=G&&(m=E,l=!1,t=new L(t));e:for(;++e<p;){var i=o[e],c=i;if(i=i!==0?i:0,l&&c===c){for(var g=f;g--;)if(t[g]===c)continue e;s.push(i)}else m(t,c,u)||s.push(i)}return s}var Q=O(function(o,t){return A(o)?J(o,t):[]});const ee=B("div",{target:"ekqzr6e0"})(({theme:o})=>({"span[aria-disabled='true']":{background:o.colors.fadedText05}})),te=(o,t)=>o.getStringArrayValue(t),oe=o=>o.default.map(t=>o.options[t])??null,re=o=>o.rawValues??null,se=(o,t,d,u)=>{t.setStringArrayValue(o,d.value,{fromUi:d.fromUi},u)},ne=o=>{const{element:t,widgetMgr:d,fragmentId:u}=o,e=H(),m=n.useContext(k),l=n.useRef(null),p=n.useRef(0),[s,f]=_({getStateFromWidgetMgr:te,getDefaultStateFromProto:oe,getCurrStateFromProto:re,updateWidgetMgrState:se,element:t,widgetMgr:d,fragmentId:u}),i=t.maxSelections>0&&s.length>=t.maxSelections,c=n.useMemo(()=>{if(t.maxSelections===0)return"No results";if(s.length===t.maxSelections){const r=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${r}. Remove an option first.`}return"No results"},[t.maxSelections,s.length]),g=n.useCallback(r=>{switch(r.type){case"remove":return Q(s,r.option?.value);case"clear":return[];case"select":return s.concat([r.option?.value]);default:throw new Error(`State transition is unknown: ${r.type}`)}},[s]),C=n.useCallback(r=>{t.maxSelections&&r.type==="select"&&s.length>=t.maxSelections||f({value:g(r),fromUi:!0})},[t.maxSelections,g,f,s.length]),{options:v}=t,{placeholder:R,disabled:z,selectOptions:w,inputReadOnly:T,valuesToUiMulti:b,createFilterOptions:y}=N({options:v,isMulti:!0,acceptNewOptions:t.acceptNewOptions??!1,placeholderInput:t.placeholder}),M=n.useCallback((r,a)=>i?[]:y(s)(r,a),[y,i,s]),S=o.disabled||z,W=n.useMemo(()=>b(s),[b,s]),V=n.useMemo(()=>{const r=e.fontSizes.baseFontSize*1.6+14;return`${Math.round(r*4.25)}px`},[e.fontSizes.baseFontSize]);n.useLayoutEffect(()=>{l.current&&(l.current.scrollTop=p.current)});const x=n.useCallback(r=>{p.current=r.currentTarget.scrollTop},[]),I=n.useMemo(()=>(function(a){return h($,{...a,ref:l,onScroll:x})}),[x]);return F("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[h(U,{label:t.label,disabled:S,labelVisibility:D(t.labelVisibility?.value),children:t.help&&h(P,{content:t.help,label:t.label})}),h(ee,{children:h(Y,{creatable:t.acceptNewOptions??!1,options:w,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:R,type:X.select,multi:!0,onChange:C,value:W,disabled:S,size:"compact",noResultsMsg:c,filterOptions:M,closeOnSelect:!1,ignoreCase:!1,overrides:{Popover:{props:{ignoreBoundary:m,overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:K,props:{style:{cursor:"pointer"},overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:({$isFocused:r})=>{const a=Z(e.colors,r);return{maxHeight:V,minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,borderTopColor:a,borderRightColor:a,borderBottomColor:a,borderLeftColor:a}}},Placeholder:{style:()=>({flex:"inherit",color:S?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{component:I,style:()=>({overflowY:"auto",paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.grayTextColor,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.grayTextColor}},Tag:{props:{overrides:{Root:{style:{fontWeight:e.fontWeights.normal,borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:T}},Dropdown:{component:j}}})})]})},ue=n.memo(ne);export{ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{get as O}from"./index.
|
|
1
|
+
import{get as O}from"./index.BIqcOZ_u.js";import{K as P}from"./index.aCorc3Yt.js";const s=[{description:"angry face",emoji:"😠",emoticons:[">:(",">:[",">:-(",">:-[",">=(",">=[",">=-(",">=-["],name:"angry",tags:["mad","annoyed"]},{description:"smiling face with smiling eyes",emoji:"😊",emoticons:[':")',':"]',':"D',':-")',':-"]',':-"D','=")','="]','="D','=-")','=-"]','=-"D'],name:"blush",tags:["proud"]},{description:"broken heart",emoji:"💔",emoticons:["<\\3","</3"],name:"broken_heart",tags:[]},{description:"confused face",emoji:"😕",emoticons:[":/",":\\",":-/",":-\\","=/","=\\","=-/","=-\\"],name:"confused",tags:[]},{description:"crying face",emoji:"😢",emoticons:[":,(",":,[",":,|",":,-(",":,-[",":,-|",":'(",":'[",":'|",":'-(",":'-[",":'-|","=,(","=,[","=,|","=,-(","=,-[","=,-|","='(","='[","='|","='-(","='-[","='-|","T-T"],name:"cry",tags:["sad","tear"]},{description:"frowning face with open mouth",emoji:"😦",emoticons:[":(",":[",":-(",":-[","=(","=[","=-(","=-["],name:"frowning",tags:[]},{description:"red heart",emoji:"❤️",emoticons:["<3"],name:"heart",tags:["love"]},{description:"angry face with horns",emoji:"👿",emoticons:["]:(","]:[","]:-(","]:-[","]=(","]=[","]=-(","]=-["],name:"imp",tags:["angry","devil","evil","horns"]},{description:"smiling face with halo",emoji:"😇",emoticons:["o:)","o:]","o:D","o:-)","o:-]","o:-D","o=)","o=]","o=D","o=-)","o=-]","o=-D","O:)","O:]","O:D","O:-)","O:-]","O:-D","O=)","O=]","O=D","O=-)","O=-]","O=-D","0:)","0:]","0:D","0:-)","0:-]","0:-D","0=)","0=]","0=D","0=-)","0=-]","0=-D"],name:"innocent",tags:["angel"]},{description:"face with tears of joy",emoji:"😂",emoticons:[":,)",":,]",":,D",":,-)",":,-]",":,-D",":')",":']",":'D",":'-)",":'-]",":'-D","=,)","=,]","=,D","=,-)","=,-]","=,-D","=')","=']","='D","='-)","='-]","='-D"],name:"joy",tags:["tears"]},{description:"kissing face",emoji:"😗",emoticons:[":*",":-*","=*","=-*"],name:"kissing",tags:[]},{description:"grinning squinting face",emoji:"😆",emoticons:["x)","x]","xD","x-)","x-]","x-D","X)","X]","X-)","X-]","X-D"],name:"laughing",tags:["happy","haha"]},{description:"man",emoji:"👨",emoticons:[":3",":-3","=3","=-3",";3",";-3","x3","x-3","X3","X-3"],name:"man",tags:["mustache","father","dad"]},{description:"neutral face",emoji:"😐",emoticons:[":|",":-|","=|","=-|"],name:"neutral_face",tags:["meh"]},{description:"face without mouth",emoji:"😶",emoticons:[":-"],name:"no_mouth",tags:["mute","silence"]},{description:"face with open mouth",emoji:"😮",emoticons:[":o",":O",":0",":-o",":-O",":-0","=o","=O","=0","=-o","=-O","=-0"],name:"open_mouth",tags:["surprise","impressed","wow"]},{description:"enraged face",emoji:"😡",emoticons:[":@",":-@","=@","=-@"],name:"rage",tags:["angry"]},{description:"grinning face with smiling eyes",emoji:"😄",emoticons:[":D",":-D","=D","=-D"],name:"smile",tags:["happy","joy","laugh","pleased"]},{description:"grinning face with big eyes",emoji:"😃",emoticons:[":)",":]",":-)",":-]","=)","=]","=-)","=-]"],name:"smiley",tags:["happy","joy","haha"]},{description:"smiling face with horns",emoji:"😈",emoticons:["]:)","]:]","]:D","]:-)","]:-]","]:-D","]=)","]=]","]=D","]=-)","]=-]","]=-D"],name:"smiling_imp",tags:["devil","evil","horns"]},{description:"loudly crying face",emoji:"😭",emoticons:[":,'(",":,'[",":,'-(",":,'-[",":',(",":',[",":',-(",":',-[","=,'(","=,'[","=,'-(","=,'-[","=',(","=',[","=',-(","=',-["],name:"sob",tags:["sad","cry","bawling"]},{description:"face with tongue",emoji:"😛",emoticons:[":p",":P",":d",":-p",":-P",":-d","=p","=P","=d","=-p","=-P","=-d"],name:"stuck_out_tongue",tags:[]},{description:"squinting face with tongue",emoji:"😝",emoticons:["xP","x-p","x-P","x-d","Xp","Xd","X-p","X-P","X-d"],name:"stuck_out_tongue_closed_eyes",tags:["prank"]},{description:"winking face with tongue",emoji:"😜",emoticons:[";p",";P",";d",";-p",";-P",";-d"],name:"stuck_out_tongue_winking_eye",tags:["prank","silly"]},{description:"smiling face with sunglasses",emoji:"😎",emoticons:["8)","8]","8D","8-)","8-]","8-D","B)","B]","B-)","B-]","B-D"],name:"sunglasses",tags:["cool"]},{description:"downcast face with sweat",emoji:"😓",emoticons:[",:(",",:[",",:-(",",:-[",",=(",",=[",",=-(",",=-[","':(","':[","':-(","':-[","'=(","'=[","'=-(","'=-["],name:"sweat",tags:[]},{description:"grinning face with sweat",emoji:"😅",emoticons:[",:)",",:]",",:D",",:-)",",:-]",",:-D",",=)",",=]",",=D",",=-)",",=-]",",=-D","':)","':]","':D","':-)","':-]","':-D","'=)","'=]","'=D","'=-)","'=-]","'=-D"],name:"sweat_smile",tags:["hot"]},{description:"unamused face",emoji:"😒",emoticons:[":$",":s",":z",":S",":Z",":-$",":-s",":-z",":-S",":-Z","=$","=s","=z","=S","=Z","=-$","=-s","=-z","=-S","=-Z"],name:"unamused",tags:["meh"]},{description:"winking face",emoji:"😉",emoticons:[";)",";]",";D",";-)",";-]",";-D"],name:"wink",tags:["flirt"]}],x=/:\+1:|:-1:|:[\w-]+:/g,b=/(^|\s)[@$|*'",;.=:\-)([\]\\/<>038BOopPsSdDxXzZ]{2,5}/g,k=/(?:_|-(?!1))/g,X={padSpaceAfter:!1,emoticon:!1,accessible:!1},T=f=>{const t=Object.assign({},X,f),r=!!t.padSpaceAfter,u=!!t.emoticon,g=!!t.accessible;function d(e,i){return{type:"text",value:e,data:{hName:"span",hProperties:{role:"img",ariaLabel:i},hChildren:[{type:"text",value:e}]}}}function D(e){const i=s.find(o=>o.emoticons.includes(e)),n=s.find(o=>o.emoticons.includes(e.slice(0,-1))),a=s.find(o=>o.emoticons.includes(e.slice(1))),c=s.find(o=>o.emoticons.includes(e.slice(1,-1))),m=i||n||a||c;if(!m)return!1;const w=!(i||a)&&(c||n)?e.slice(-1):"",y=!(i||n)&&(c||a)?e.slice(0,1):"",_=r?" ":"",l=y+m.emoji+_+w;return g?d(l,m.name+" emoticon"):l}function h(e){let i=O(e);if(typeof i>"u")return!1;if(r&&(i=i+" "),g){const n=e.slice(1,-1).replace(k," ")+" emoji";return d(i,n)}return i}const p=[[x,h]];u&&p.push([b,D]);function j(e){P(e,p)}return j};export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as u,r as L,W as C,o as x,j as i,R as E,q as b,V as v}from"./index.
|
|
1
|
+
import{z as u,r as L,W as C,o as x,j as i,R as E,q as b,V as v}from"./index.aCorc3Yt.js";import{w as y,E as W}from"./withFullScreenWrapper.CcWCKoY8.js";import{S as p,T}from"./Toolbar.CQsWYXer.js";const F=u("div",{target:"e1xt4yf90"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:t?"100%":"fit-content"})),R=u("div",{target:"e1xt4yf91"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:t?"100%":"auto",flexGrow:t?1:0,">img":{borderRadius:e.radii.default}})),j=u("div",{target:"e1xt4yf92"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),H=v.getLogger("ImageList");function M(e,t,r){if(e){if(e.useStretch)return r;if(e.useContent)return;if(e.pixelWidth)return e.pixelWidth}if(t!=null)switch(t){case-1:case-3:case-4:return;case-2:case-5:return r;default:return t>0?t:void 0}}const G=({itemKey:e,image:t,imgStyle:r,buildMediaURL:l,handleImageError:s,shouldStretch:d})=>{const o=E(t.url);return x(R,{"data-testid":"stImageContainer",shouldStretch:d,children:[i("img",{style:r,src:l(t.url),alt:e,onError:s,crossOrigin:o}),t.caption&&i(j,{"data-testid":"stImageCaption",style:r,children:i(b,{source:t.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]})};function O({element:e,endpoints:t,widthConfig:r,disableFullscreenMode:l}){const{expanded:s,width:d,height:o,expand:f,collapse:h}=C(W),g=d||0,I=M(r,e.width,g),m=r?.useStretch||e.width===-5,a={};o&&s?(a.maxHeight=o,a.objectFit="contain",a.width="100%"):(a.width=I??"100%",a.maxWidth="100%");const w=c=>{const n=c.currentTarget.src;H.error(`Client Error: Image source error - ${n}`),t.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",n)};return x(p,{width:g,height:o,useContainerWidth:s,topCentered:!0,children:[i(T,{target:p,isFullScreen:s,onExpand:f,onCollapse:h,disableFullscreenMode:l}),i(F,{className:"stImage","data-testid":"stImage",shouldStretch:m,children:e.imgs.map((c,n)=>i(G,{itemKey:n.toString(),image:c,imgStyle:a,buildMediaURL:S=>t.buildMediaURL(S),handleImageError:w,shouldStretch:m},n))})]})}const U=y(O),D=L.memo(U);export{D as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{z as f,r,l as b,aI as y,j as c,aJ as S,aw as x,o as h,m as T,Y as R,aK as v,aL as B,aM as E}from"./index.
|
|
1
|
+
import{z as f,r,l as b,aI as y,j as c,aJ as S,aw as x,o as h,m as T,Y as R,aK as v,aL as B,aM as E}from"./index.aCorc3Yt.js";import{l as J}from"./index.8HslT92O.js";import{R as k}from"./main.CCVkbuxC.js";const w=f("div",{target:"eem6pay0"})(({theme:o})=>({overflowY:"auto",position:"relative",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),L=f("div",{target:"eem6pay1"})(({theme:o})=>({display:"flex",alignItems:"center",gap:o.spacing.sm,padding:o.spacing.sm,paddingLeft:o.spacing.md,fontFamily:o.genericFonts.codeFont,fontSize:o.fontSizes.twoSm,color:o.colors.bodyText,maxWidth:"90vw",wordBreak:"break-all"})),$=f("button",{target:"eem6pay2"})(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing.threeXS,backgroundColor:"transparent",border:"none",borderRadius:o.radii.md,cursor:"pointer",color:o.colors.fadedText60,transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{backgroundColor:o.colors.darkenedBgMix15,color:o.colors.bodyText},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:o.shadows.focusRing}})),I=f("div",{target:"eem6pay3"})(({top:o,left:e})=>({position:"fixed",top:o,left:e}));function P({top:o,left:e,path:t,clearTooltip:d}){const[p,n]=r.useState(!0),s=b(),{colors:i,radii:a}=s,{isCopied:l,copyToClipboard:u,label:m}=y(),g=r.useCallback(()=>{n(!1),d()},[d]),C=r.useCallback(()=>{u(t)},[u,t]);return c(v,{content:h(L,{"data-testid":"stJsonPathTooltip",children:[c("code",{children:t}),c($,{onClick:C,title:m,"aria-label":m,autoFocus:!0,children:c(R,{size:"sm",iconValue:l?":material/check:":":material/content_copy:"})})]}),placement:x.top,accessibilityType:S.tooltip,showArrow:!1,popoverMargin:15,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:T(s)?i.bgColor:i.secondaryBg,color:i.bodyText,borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:p,children:c(I,{"data-testid":"stJsonPathTooltipTarget",top:o,left:e})})}const j=r.memo(P);function z(o){return o.length===0?"$":o.reduce((e,t,d)=>{if(t===null)return e;if(/^\d+$/.test(t))return`${e}[${t}]`;if(t===""||/[^a-zA-Z0-9_$]/.test(t)||/^\d/.test(t)){const s=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`${e}["${s}"]`}return d===0||e===""?t:`${e}.${t}`},"")}function F(){const[o,e]=r.useState(null),t=r.useRef({x:0,y:0});r.useEffect(()=>{const n=s=>{t.current={x:s.clientX,y:s.clientY}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]);const d=r.useCallback(n=>{const{x:s,y:i}=t.current,a=[...n.namespace,n.name],l=z(a);e({path:l,x:s,y:i})},[]),p=r.useCallback(()=>{e(null)},[]);return{tooltip:o,handleSelect:d,clearTooltip:p}}function A({element:o}){const e=b(),{tooltip:t,handleSelect:d,clearTooltip:p}=F(),{copyToClipboard:n}=y(),s=r.useCallback(l=>{n(JSON.stringify(l.src))},[n]);let i;try{i=JSON.parse(o.body)}catch(l){const u=B(l);try{i=J.parse(o.body)}catch{const g=parseInt(u.message.replace(/[^0-9]/g,""),10);return u.message+=`
|
|
2
2
|
${o.body.substring(0,g+1)} ← here`,c(E,{name:"Json Parse Error",message:u.message})}}const a=T(e)?"rjv-default":"monokai";return h(w,{className:"stJson","data-testid":"stJson",children:[c(k,{src:i,collapsed:o.maxExpandDepth??!o.expanded,displayDataTypes:!1,displayObjectSize:!1,name:!1,theme:a,enableClipboard:s,onSelect:d,style:{fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.codeFontSize,fontWeight:e.fontWeights.code,backgroundColor:e.colors.bgColor,whiteSpace:"pre-wrap"}}),t&&c(j,{top:t.y,left:t.x,path:t.path,clearTooltip:p})]})}const Y=r.memo(A);export{Y as default};
|