streamlit-nightly 1.34.1.dev20240506__py2.py3-none-any.whl → 1.34.1.dev20240508__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/elements/vega_charts.py +117 -9
- streamlit/elements/widgets/button.py +18 -7
- streamlit/runtime/state/query_params.py +4 -2
- streamlit/runtime/state/query_params_proxy.py +11 -5
- streamlit/runtime/state/session_state_proxy.py +11 -3
- streamlit/static/asset-manifest.json +24 -24
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/1168.7452e363.chunk.js +1 -0
- streamlit/static/static/js/1307.0f0cca93.chunk.js +1 -0
- streamlit/static/static/js/1792.8bd6ce2a.chunk.js +1 -0
- streamlit/static/static/js/1955.426e67ca.chunk.js +2 -0
- streamlit/static/static/js/2178.90362aae.chunk.js +1 -0
- streamlit/static/static/js/{2469.3e9c3ce9.chunk.js → 2469.09ea79bb.chunk.js} +1 -1
- streamlit/static/static/js/{7217.d970c074.chunk.js → 2736.4336e2b9.chunk.js} +1 -1
- streamlit/static/static/js/3092.21bb8f7b.chunk.js +1 -0
- streamlit/static/static/js/329.464ed8ec.chunk.js +2 -0
- streamlit/static/static/js/3513.ebc278c4.chunk.js +1 -0
- streamlit/static/static/js/4113.99983645.chunk.js +1 -0
- streamlit/static/static/js/{4477.e10e4373.chunk.js → 4477.1bd49702.chunk.js} +1 -1
- streamlit/static/static/js/5249.f2f4070d.chunk.js +1 -0
- streamlit/static/static/js/5441.5bacdeda.chunk.js +1 -0
- streamlit/static/static/js/6013.4ba2d616.chunk.js +1 -0
- streamlit/static/static/js/6853.93dd1c4c.chunk.js +1 -0
- streamlit/static/static/js/{7323.2808d029.chunk.js → 7323.b74cc85b.chunk.js} +2 -2
- streamlit/static/static/js/7805.acc6316a.chunk.js +1 -0
- streamlit/static/static/js/8427.bd0a7cf3.chunk.js +1 -0
- streamlit/static/static/js/8477.de889fe5.chunk.js +1 -0
- streamlit/static/static/js/{8492.3e609489.chunk.js → 8492.0d93bd08.chunk.js} +1 -1
- streamlit/static/static/js/8536.f8de3d9a.chunk.js +1 -0
- streamlit/static/static/js/main.5a6e0ded.js +2 -0
- streamlit/type_util.py +50 -3
- {streamlit_nightly-1.34.1.dev20240506.dist-info → streamlit_nightly-1.34.1.dev20240508.dist-info}/METADATA +2 -2
- {streamlit_nightly-1.34.1.dev20240506.dist-info → streamlit_nightly-1.34.1.dev20240508.dist-info}/RECORD +41 -41
- streamlit/static/static/js/1168.fc5c673b.chunk.js +0 -1
- streamlit/static/static/js/1307.8ea033f1.chunk.js +0 -1
- streamlit/static/static/js/1792.b8efa879.chunk.js +0 -1
- streamlit/static/static/js/2736.914069e5.chunk.js +0 -2
- streamlit/static/static/js/3061.67758376.chunk.js +0 -1
- streamlit/static/static/js/3092.bc07c48b.chunk.js +0 -1
- streamlit/static/static/js/3513.e3e7300a.chunk.js +0 -1
- streamlit/static/static/js/4113.1e7eff4d.chunk.js +0 -1
- streamlit/static/static/js/4253.749d5244.chunk.js +0 -2
- streamlit/static/static/js/5441.71804c26.chunk.js +0 -1
- streamlit/static/static/js/6013.64cd6d28.chunk.js +0 -1
- streamlit/static/static/js/6150.427a30f5.chunk.js +0 -1
- streamlit/static/static/js/6853.3cbd385e.chunk.js +0 -1
- streamlit/static/static/js/7805.51638fbc.chunk.js +0 -1
- streamlit/static/static/js/8427.65ddaf36.chunk.js +0 -1
- streamlit/static/static/js/8477.7419a0aa.chunk.js +0 -1
- streamlit/static/static/js/8536.f13dff49.chunk.js +0 -1
- streamlit/static/static/js/main.24a14fec.js +0 -2
- /streamlit/static/static/js/{4253.749d5244.chunk.js.LICENSE.txt → 1955.426e67ca.chunk.js.LICENSE.txt} +0 -0
- /streamlit/static/static/js/{2736.914069e5.chunk.js.LICENSE.txt → 329.464ed8ec.chunk.js.LICENSE.txt} +0 -0
- /streamlit/static/static/js/{7323.2808d029.chunk.js.LICENSE.txt → 7323.b74cc85b.chunk.js.LICENSE.txt} +0 -0
- /streamlit/static/static/js/{main.24a14fec.js.LICENSE.txt → main.5a6e0ded.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.34.1.dev20240506.data → streamlit_nightly-1.34.1.dev20240508.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.34.1.dev20240506.dist-info → streamlit_nightly-1.34.1.dev20240508.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.34.1.dev20240506.dist-info → streamlit_nightly-1.34.1.dev20240508.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.34.1.dev20240506.dist-info → streamlit_nightly-1.34.1.dev20240508.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5441],{5441:(e,t,o)=>{o.r(t),o.d(t,{default:()=>W});var n=o(66845),i=o(25621),s=o(72965),a=o(94206),r=o(60784),l=o(23849),d=o(23593),c=o(63765),h=o(91191);const u={DATAFRAME_INDEX:"(index)"},m=new Set([h.GI.DatetimeIndex,h.GI.Float64Index,h.GI.Int64Index,h.GI.RangeIndex,h.GI.UInt64Index]);function g(e){var t;if(0===(null===(t=e.datasets)||void 0===t?void 0:t.length))return null;const o={};return e.datasets.forEach((e=>{if(!e)return;const t=e.hasName?e.name:null;o[t]=e.data})),o}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.isEmpty())return[];const o=[],{dataRows:n,dataColumns:i}=e.dimensions,s=h.fu.getTypeName(e.types.index[0]),a=m.has(s);for(let r=t;r<n;r++){const t={};if(a){const o=e.getIndexValue(r,0);t[u.DATAFRAME_INDEX]="bigint"===typeof o?Number(o):o}for(let o=0;o<i;o++){const n=e.getDataValue(r,o),i=e.types.data[o],s=h.fu.getTypeName(i);if("datetimetz"!==s&&(n instanceof Date||Number.isFinite(n))&&(s.startsWith("datetime")||"date"===s)){const i=60*new Date(n).getTimezoneOffset()*1e3;t[e.columns[0][o]]=n.valueOf()+i}else t[e.columns[0][o]]="bigint"===typeof n?Number(n):n}o.push(t)}return o}var f=o(96825),b=o.n(f),w=o(99394),y=o.n(w),x=o(27466);function v(e,t){const o={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:t.fontSizes.smPx+2,orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.mdPx,titleColor:(0,x.Xy)(t),titleFontStyle:"normal",labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,x.Xy)(t),labelFontStyle:"normal"},axis:{labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,x.Xy)(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.smPx,titleColor:(0,x.Xy)(t),titleFontStyle:"normal",ticks:!1,gridColor:(0,x.ny)(t),domain:!1,domainWidth:1,domainColor:(0,x.ny)(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:t.spacing.lgPx,labelPadding:t.spacing.lgPx,labelSeparation:t.spacing.twoXSPx,labelOverlap:!0},legend:{labelFontSize:t.fontSizes.smPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,x.Xy)(t),titleFontSize:t.fontSizes.smPx,titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:(0,x.Xy)(t),titlePadding:5,labelPadding:t.spacing.lgPx,columnPadding:t.spacing.smPx,rowPadding:t.spacing.twoXSPx,padding:7,symbolStrokeWidth:4},range:{category:(0,x.iY)(t),diverging:(0,x.ru)(t),ramp:(0,x.Gy)(t),heatmap:(0,x.Gy)(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400,discreteHeight:350,discreteWidth:{step:20}},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,...(0,x.Iy)(t)?{color:"#0068C9"}:{color:"#83C9FF"}},bar:{binSpacing:t.spacing.twoXSPx,discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?y()({},o,e,((e,t)=>Array.isArray(t)?t:void 0)):o}const S=(0,o(1515).Z)("div",{target:"egd2k5h0"})((e=>{let{theme:t,useContainerWidth:o,isFullScreen:n}=e;return{width:o||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&.has-actions":{paddingRight:0},".vega-actions":{zIndex:t.zIndices.popupMenu,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:"1px solid ".concat(t.colors.fadedText10),a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.twoXL),color:t.colors.bodyText},"a:hover":{backgroundColor:t.colors.secondaryBg,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},summary:{opacity:0,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.lg,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms","&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix25}}}}}),"");var F=o(40864);const z="source";class C extends n.PureComponent{constructor(){super(...arguments),this.vegaView=void 0,this.vegaFinalizer=void 0,this.defaultDataName=z,this.element=null,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var e,t;const{element:o,theme:n,isFullScreen:i,width:s,height:a}=this.props,r=JSON.parse(o.spec),{useContainerWidth:l}=o;if("streamlit"===o.vegaLiteTheme?r.config=v(r.config,n):"streamlit"===(null===(e=r.usermeta)||void 0===e||null===(t=e.embedOptions)||void 0===t?void 0:t.theme)?(r.config=v(r.config,n),r.usermeta.embedOptions.theme=void 0):r.config=function(e,t){const{colors:o,fontSizes:n,genericFonts:i}=t,s={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:n.twoSmPx,titleFontSize:n.twoSmPx},a={background:o.bgColor,axis:{labelColor:o.bodyText,titleColor:o.bodyText,gridColor:(0,x.ny)(t),...s},legend:{labelColor:o.bodyText,titleColor:o.bodyText,...s},title:{color:o.bodyText,subtitleColor:o.bodyText,...s},header:{labelColor:o.bodyText,titleColor:o.bodyText,...s},view:{stroke:(0,x.ny)(t),continuousHeight:350,continuousWidth:400,discreteHeight:350,discreteWidth:{step:20}},mark:{tooltip:!0}};return e?b()({},a,e):a}(r.config,n),i?(r.width=s,r.height=a,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))):l&&(r.width=s,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))),r.padding||(r.padding={}),null==r.padding.bottom&&(r.padding.bottom=20),r.datasets)throw new Error("Datasets should not be passed as part of the spec");return r}}async componentDidMount(){try{await this.createView()}catch(e){const t=(0,c.b)(e);this.setState({error:t})}}componentWillUnmount(){this.finalizeView()}async componentDidUpdate(e){const{element:t,theme:o}=e,{element:n,theme:i}=this.props,s=t.spec,{spec:a}=n;if(!this.vegaView||s!==a||o!==i||e.width!==this.props.width||e.height!==this.props.height||e.element.vegaLiteTheme!==this.props.element.vegaLiteTheme){(0,l.ji)("Vega spec changed.");try{await this.createView()}catch(m){const e=(0,c.b)(m);this.setState({error:e})}return}const r=t.data,{data:d}=n;(r||d)&&this.updateData(this.defaultDataName,r,d);const h=g(t)||{},u=g(n)||{};for(const[l,c]of Object.entries(u)){const e=l||this.defaultDataName,t=h[e];this.updateData(e,t,c)}for(const l of Object.keys(h))u.hasOwnProperty(l)||l===this.defaultDataName||this.updateData(l,null,null);this.vegaView.resize().runAsync()}updateData(e,t,o){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(!o||0===o.data.numRows){return void(this.vegaView._runtime.data.hasOwnProperty(e)&&this.vegaView.remove(e,a.truthy))}if(!t||0===t.data.numRows)return void this.vegaView.insert(e,p(o));const{dataRows:n,dataColumns:i}=t.dimensions,{dataRows:s,dataColumns:r}=o.dimensions;if(function(e,t,o,n,i,s){if(o!==s)return!1;if(t>=i)return!1;if(0===t)return!1;const a=s-1,r=t-1;return e.getDataValue(0,a)===n.getDataValue(0,a)&&e.getDataValue(r,a)===n.getDataValue(r,a)}(t,n,i,o,s,r))n<s&&this.vegaView.insert(e,p(o,n));else{const t=a.changeset().remove(a.truthy).insert(p(o));this.vegaView.change(e,t),(0,l.ji)("Had to clear the ".concat(e," dataset before inserting data through Vega view."))}}async createView(){if((0,l.ji)("Creating a new Vega view."),!this.element)throw Error("Element missing.");this.finalizeView();const e=this.props.element,t=this.generateSpec(),o={ast:!0,expr:r.N,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:n,view:i,finalize:a}=await(0,s.ZP)(this.element,t,o);this.vegaView=i,this.vegaFinalizer=a;const d=function(e){const t=g(e);if(null==t)return null;const o={};for(const[n,i]of Object.entries(t))o[n]=p(i);return o}(e),c=d?Object.keys(d):[];if(1===c.length){const[e]=c;this.defaultDataName=e}else 0===c.length&&n.data&&(this.defaultDataName=z);const h=function(e){const t=e.data;return t&&0!==t.data.numRows?p(t):null}(e);if(h&&i.insert(this.defaultDataName,h),d)for(const[s,r]of Object.entries(d))i.insert(s,r);await i.runAsync(),this.vegaView.resize().runAsync()}render(){if(this.state.error)throw this.state.error;return(0,F.jsx)(S,{"data-testid":"stArrowVegaLiteChart",useContainerWidth:this.props.element.useContainerWidth,isFullScreen:this.props.isFullScreen,ref:e=>{this.element=e}})}}const W=(0,i.b)((0,d.Z)(C))},23593:(e,t,o)=>{o.d(t,{Z:()=>b});var n=o(66845),i=o(13005),s=o.n(i),a=o(25621),r=o(82218),l=o(97781),d=o(46927),c=o(66694),h=o(1515);const u=(0,h.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:o}=e;const n=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:o.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:o.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:o.colors.fadedText60,borderRadius:"50%",...n,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:o.colors.bodyText,transition:"none"}}}),""),m=(0,h.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:o}=e;return{"&:hover":{[u]:{opacity:1,transform:"scale(1)",transition:"none"}},...o?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var g=o(40864);class p extends n.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:t}=this.state;27===e.keyCode&&t&&this.zoomOut()},this.zoomIn=()=>{document.body.style.overflow="hidden",this.context.setFullScreen(!0),this.setState({expanded:!0})},this.zoomOut=()=>{document.body.style.overflow="unset",this.context.setFullScreen(!1),this.setState({expanded:!1})},this.convertScssRemValueToPixels=e=>parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),this.getWindowDimensions=()=>{const e=this.convertScssRemValueToPixels(this.props.theme.spacing.md),t=this.convertScssRemValueToPixels("2.875rem");return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+t)}},this.updateWindowDimensions=()=>{this.setState(this.getWindowDimensions())},this.state={expanded:!1,...this.getWindowDimensions()}}componentDidMount(){window.addEventListener("resize",this.updateWindowDimensions),document.addEventListener("keydown",this.controlKeys,!1)}componentWillUnmount(){window.removeEventListener("resize",this.updateWindowDimensions),document.removeEventListener("keydown",this.controlKeys,!1)}render(){const{expanded:e,fullWidth:t,fullHeight:o}=this.state,{children:n,width:i,height:s,disableFullscreenMode:a}=this.props;let c=r.d,h=this.zoomIn,p="View fullscreen";return e&&(c=l.m,h=this.zoomOut,p="Exit fullscreen"),(0,g.jsxs)(m,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!a&&(0,g.jsx)(u,{"data-testid":"StyledFullScreenButton",onClick:h,title:p,isExpanded:e,children:(0,g.jsx)(d.Z,{content:c})}),n(e?{width:t,height:o,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:i,height:s,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}p.contextType=c.E;const f=(0,a.b)(p);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class o extends n.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:o,height:n,disableFullscreenMode:i}=this.props;return(0,g.jsx)(f,{width:o,height:n,disableFullscreenMode:t||i,children:t=>{let{width:o,height:n,expanded:i,expand:s,collapse:a}=t;return(0,g.jsx)(e,{...this.props,width:o,height:n,isFullScreen:i,expand:s,collapse:a})}})}}}return o.displayName="withFullScreenWrapper(".concat(e.displayName||e.name,")"),s()(o,e)}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6013],{79986:(e,t,r)=>{r.d(t,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),a=r(50669),s=r(1515);const c=(0,r(7865).F4)(n||(n=(0,a.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),l=(0,s.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(c),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var u=r(40864);const d=e=>{let{dirty:t,value:r,maxLength:n,className:a,type:s="single",inForm:c}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,u.jsx)(l,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=c?"submit form":"apply";if("multiline"===s){const t=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(t,"+Enter to ").concat(e))}else"single"===s&&p("Press Enter to ".concat(e))}return n&&("chat"!==s||t)&&p("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,u.jsx)(i.X7,{"data-testid":"InputInstructions",className:a,children:d})}},46013:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var n=r(66845),o=r(25621),i=r(25773),a=r(69),s=n.forwardRef((function(e,t){return n.createElement(a.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var c=r(118),l=r(46927),u=r(79986),d=r(27466),p=r(48266),f=r(1515);const h=(0,f.Z)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.lg,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:"".concat(n,"px")}}),""),y=(0,f.Z)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.lg,display:"flex",alignItems:"center"}}),""),g=(0,f.Z)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.Iy)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?t.radii.none:t.radii.lg,borderTopLeftRadius:n?t.radii.lg:t.radii.none,borderBottomRightRadius:t.radii.lg,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,margin:0,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),b=(0,f.Z)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),m=(0,f.Z)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var v=r(40864);const x=function(e){let{width:t,element:r,widgetMgr:i,fragmentId:a}=e;const f=(0,o.u)(),[x,w]=(0,n.useState)(!1),[O,j]=(0,n.useState)(r.default),[C,S]=(0,n.useState)(0),P=(0,n.useRef)(null),R=(0,n.useRef)({minHeight:0,maxHeight:0}),k=()=>{P.current&&P.current.focus(),O&&(i.setStringTriggerValue(r,O,{fromUi:!0},a),w(!1),j(""),S(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";j(e),w(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(P.current){const{offsetHeight:e}=P.current;R.current.minHeight=e,R.current.maxHeight=6.5*e}}),[P]);const{disabled:I,placeholder:E,maxChars:B}=r,T=(0,d.Iy)(f),{minHeight:F,maxHeight:Z}=R.current,z=T?f.colors.gray70:f.colors.gray80,A=!!(C>0&&P.current)&&Math.abs(C-F)>1;return(0,v.jsx)(h,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,v.jsxs)(y,{children:[(0,v.jsx)(c.Z,{inputRef:P,value:O,placeholder:E,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(w(""!==t),j(t),S((()=>{let e=0;const{current:t}=P;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),k())},"aria-label":E,disabled:I,rows:1,overrides:{Root:{style:{outline:"none",backgroundColor:f.colors.transparent,borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",width:"".concat(t,"px")}},InputContainer:{style:{backgroundColor:f.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:"1.4",backgroundColor:f.colors.transparent,"::placeholder":{color:z},height:A?"".concat(C+1,"px"):"auto",maxHeight:Z?"".concat(Z,"px"):"none",paddingRight:"3rem",paddingLeft:f.spacing.sm,paddingBottom:f.spacing.sm,paddingTop:f.spacing.sm}}}}),t>p.A.hideWidgetDetails&&(0,v.jsx)(m,{children:(0,v.jsx)(u.Z,{dirty:x,value:O,maxLength:B,type:"chat",inForm:!1})}),(0,v.jsx)(b,{children:(0,v.jsx)(g,{onClick:k,disabled:!x||I,extended:A,"data-testid":"stChatInputSubmitButton",children:(0,v.jsx)(l.Z,{content:s,size:"xl",color:"inherit"})})})]})})}},118:(e,t,r)=>{r.d(t,{Z:()=>P});var n=r(66845),o=r(80318),i=r(9656),a=r(38254),s=r(80745),c=r(98479);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,s.zo)("div",(function(e){return u(u({},(0,c.d5)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.zo)("div",(function(e){return(0,c.hB)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.zo)("textarea",(function(e){return u(u({},(0,c.Hx)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(c){s=!0,o=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(l,e);var t,r,s,c=w(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=c.call.apply(c,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=l,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),s=r[0],c=r[1],l=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},c),n.createElement(i.Z,g({},this.props,{type:a.iB.textarea,overrides:l,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),l}(n.Component);C(S,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:a.NO.default});const P=S}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6853],{76853:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var n=r(66845),o=r(23175),s=r.n(o),a=r(27466),i=r(63730),l=r(66694),c=r(1515),d=r(63637),h=r(60484);const p=(0,c.Z)(d.Q,{shouldForwardProp:h.Z,target:"e1se5lgy2"})((e=>{let{theme:t,usingCustomTheme:r}=e;return{fontSize:t.fontSizes.sm,width:"1.375rem",height:"1.375rem",borderWidth:"3px",radius:"4px",justifyContents:"center",padding:t.spacing.none,margin:t.spacing.none,borderColor:t.colors.fadedText10,borderTopColor:r?t.colors.primary:t.colors.blue70,flexGrow:0,flexShrink:0}}),""),m=(0,c.Z)("div",{target:"e1se5lgy1"})((e=>{let{theme:t,width:r,cache:n}=e;return{width:r,...n?{paddingBottom:"1rem",background:"linear-gradient(to bottom, ".concat(t.colors.bgColor," 0%, ").concat(t.colors.bgColor," 80%, transparent 100%)")}:null}}),""),u=(0,c.Z)("div",{target:"e1se5lgy0"})((e=>{let{theme:t}=e;return{display:"flex",gap:t.spacing.sm,alignItems:"center",width:"100%"}}),"");var g=r(40864);const x=function(e){let{width:t,element:r}=e;const{activeTheme:o}=n.useContext(l.E),c=!(0,a.MJ)(o),{cache:d}=r;return(0,g.jsx)(m,{className:s()({stSpinner:!0,cacheSpinner:d}),"data-testid":"stSpinner",width:t,cache:d,children:(0,g.jsxs)(u,{children:[(0,g.jsx)(p,{usingCustomTheme:c}),(0,g.jsx)(i.ZP,{source:r.text,allowHTML:!1})]})})}}}]);
|