streamlit-nightly 1.21.1.dev20230424__py2.py3-none-any.whl → 1.21.1.dev20230425__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. streamlit/__init__.py +0 -7
  2. streamlit/elements/data_editor.py +104 -96
  3. streamlit/elements/file_uploader.py +17 -0
  4. streamlit/elements/layouts.py +0 -5
  5. streamlit/elements/lib/column_config_utils.py +371 -0
  6. streamlit/static/asset-manifest.json +20 -20
  7. streamlit/static/index.html +1 -1
  8. streamlit/static/static/js/{14.a19a6cd8.chunk.js → 14.9399e424.chunk.js} +1 -1
  9. streamlit/static/static/js/{227.087adf66.chunk.js → 227.9ccac1d5.chunk.js} +1 -1
  10. streamlit/static/static/js/{242.0daf8b47.chunk.js → 242.1b3289e0.chunk.js} +1 -1
  11. streamlit/static/static/js/{279.fdac58fc.chunk.js → 279.35b01780.chunk.js} +1 -1
  12. streamlit/static/static/js/{289.481fd42d.chunk.js → 289.e6157e40.chunk.js} +1 -1
  13. streamlit/static/static/js/{467.242e14ff.chunk.js → 467.50ac84df.chunk.js} +1 -1
  14. streamlit/static/static/js/{491.d0b710e9.chunk.js → 491.5a33a8ce.chunk.js} +1 -1
  15. streamlit/static/static/js/503.15864587.chunk.js +1 -0
  16. streamlit/static/static/js/{511.9f04ae9e.chunk.js → 511.e6ca580f.chunk.js} +1 -1
  17. streamlit/static/static/js/{578.ceaadcd5.chunk.js → 578.a65fcea0.chunk.js} +1 -1
  18. streamlit/static/static/js/{619.365611c8.chunk.js → 619.0325af0e.chunk.js} +1 -1
  19. streamlit/static/static/js/{628.7f41e2de.chunk.js → 628.9c70196b.chunk.js} +1 -1
  20. streamlit/static/static/js/{681.a2ba76c7.chunk.js → 681.9e30a8cd.chunk.js} +1 -1
  21. streamlit/static/static/js/{745.e2bcf16d.chunk.js → 745.e75ba963.chunk.js} +1 -1
  22. streamlit/static/static/js/{807.6789990f.chunk.js → 807.122f8b05.chunk.js} +1 -1
  23. streamlit/static/static/js/{828.096c1ad3.chunk.js → 828.0fde3da8.chunk.js} +1 -1
  24. streamlit/static/static/js/{871.ba625aee.chunk.js → 871.90a7dbae.chunk.js} +1 -1
  25. streamlit/static/static/js/{main.e7d9d363.js → main.ff35bd72.js} +2 -2
  26. {streamlit_nightly-1.21.1.dev20230424.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/METADATA +1 -1
  27. {streamlit_nightly-1.21.1.dev20230424.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/RECORD +33 -33
  28. streamlit/elements/show.py +0 -105
  29. streamlit/static/static/js/728.79e35e5d.chunk.js +0 -1
  30. /streamlit/static/static/css/{728.23fa976d.chunk.css → 503.23fa976d.chunk.css} +0 -0
  31. /streamlit/static/static/js/{main.e7d9d363.js.LICENSE.txt → main.ff35bd72.js.LICENSE.txt} +0 -0
  32. {streamlit_nightly-1.21.1.dev20230424.data → streamlit_nightly-1.21.1.dev20230425.data}/scripts/streamlit.cmd +0 -0
  33. {streamlit_nightly-1.21.1.dev20230424.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/WHEEL +0 -0
  34. {streamlit_nightly-1.21.1.dev20230424.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/entry_points.txt +0 -0
  35. {streamlit_nightly-1.21.1.dev20230424.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[745],{6745:function(e,t,n){n.r(t),n.d(t,{default:function(){return N}});var a=n(29439),o=n(74165),r=n(15861),i=n(15671),s=n(43144),l=n(60136),d=n(29388),c=n(47313),u=n(83985),h=n(86538),g=n(61469),f=n(29334),m=n(72599),p=n(26419),v=n(81003),b=n(45429),w=n(1413),y=n(16031),x=n(16168);function S(e,t){var n={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},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:t.spacing.mdPx,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},concat:{columns:1},facet:{columns:1},mark:(0,w.Z)({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?(0,y.mergeWith)({},n,e,(function(e,t){return(0,y.isArray)(t)?t:void 0})):n}function F(e,t){var n=t.colors,a=t.fontSizes,o=t.genericFonts,r={labelFont:o.bodyFont,titleFont:o.bodyFont,labelFontSize:a.twoSmPx,titleFontSize:a.twoSmPx},i={background:n.bgColor,axis:(0,w.Z)({labelColor:n.bodyText,titleColor:n.bodyText,gridColor:(0,x.ny)(t)},r),legend:(0,w.Z)({labelColor:n.bodyText,titleColor:n.bodyText},r),title:(0,w.Z)({color:n.bodyText,subtitleColor:n.bodyText},r),header:{labelColor:n.bodyText},view:{continuousHeight:350,continuousWidth:400},mark:{tooltip:!0}};return e?(0,y.merge)({},i,e):i}var k=(0,n(47167).Z)("div",{target:"everg990"})((function(e){var t=e.theme;return{"&.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.md,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}}}}}),""),z=n(46417),C="(index)",V="source",P=new Set([b.GI.DatetimeIndex,b.GI.Float64Index,b.GI.Int64Index,b.GI.RangeIndex,b.GI.UInt64Index]),Z=function(e){(0,l.Z)(n,e);var t=(0,d.Z)(n);function n(){var e;(0,i.Z)(this,n);for(var a=arguments.length,o=new Array(a),r=0;r<a;r++)o[r]=arguments[r];return(e=t.call.apply(t,[this].concat(o))).vegaView=void 0,e.vegaFinalizer=void 0,e.defaultDataName=V,e.element=null,e.state={error:void 0},e.finalizeView=function(){e.vegaFinalizer&&e.vegaFinalizer(),e.vegaFinalizer=void 0,e.vegaView=void 0},e.generateSpec=function(){var t,n,a=e.props,o=a.element,r=a.theme,i=JSON.parse(o.spec),s=o.useContainerWidth;if("streamlit"===o.vegaLiteTheme?i.config=S(i.config,r):"streamlit"===(null===(t=i.usermeta)||void 0===t||null===(n=t.embedOptions)||void 0===n?void 0:n.theme)?(i.config=S(i.config,r),i.usermeta.embedOptions.theme=void 0):i.config=F(i.config,r),e.props.height?(i.width=e.props.width,i.height=e.props.height):s&&(i.width=e.props.width),i.padding||(i.padding={}),null==i.padding.bottom&&(i.padding.bottom=20),i.datasets)throw new Error("Datasets should not be passed as part of the spec");return i},e}return(0,s.Z)(n,[{key:"componentDidMount",value:function(){var e=(0,r.Z)((0,o.Z)().mark((function e(){var t;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.createView();case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),t=(0,v.b)(e.t0),this.setState({error:t});case 9:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(){return e.apply(this,arguments)}}()},{key:"componentWillUnmount",value:function(){this.finalizeView()}},{key:"componentDidUpdate",value:function(){var e=(0,r.Z)((0,o.Z)().mark((function e(t){var n,r,i,s,l,d,c,u,h,g,f,p,b,w,y,x,S,F,k,z,C,V;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.element,r=t.theme,i=this.props,s=i.element,l=i.theme,d=n.spec,c=s.spec,this.vegaView&&d===c&&r===l&&t.width===this.props.width&&t.height===this.props.height&&t.element.vegaLiteTheme===this.props.element.vegaLiteTheme){e.next=16;break}return(0,m.ji)("Vega spec changed."),e.prev=6,e.next=9,this.createView();case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(6),u=(0,v.b)(e.t0),this.setState({error:u});case 15:return e.abrupt("return");case 16:for(h=n.data,g=s.data,(h||g)&&this.updateData(this.defaultDataName,h,g),f=I(n)||{},p=I(s)||{},b=0,w=Object.entries(p);b<w.length;b++)y=(0,a.Z)(w[b],2),x=y[0],S=y[1],F=x||this.defaultDataName,k=f[F],this.updateData(F,k,S);for(z=0,C=Object.keys(f);z<C.length;z++)V=C[z],p.hasOwnProperty(V)||V===this.defaultDataName||this.updateData(V,null,null);this.vegaView.resize().runAsync();case 24:case"end":return e.stop()}}),e,this,[[6,11]])})));return function(t){return e.apply(this,arguments)}}()},{key:"updateData",value:function(e,t,n){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(n&&0!==n.data.numRows)if(t&&0!==t.data.numRows){var a=t.dimensions,o=a.dataRows,r=a.dataColumns,i=n.dimensions,s=i.dataRows;if(function(e,t,n,a,o,r){if(n!==r)return!1;if(t>=o)return!1;if(0===t)return!1;var i=r-1,s=t-1;if(e.getDataValue(0,i)!==a.getDataValue(0,i)||e.getDataValue(s,i)!==a.getDataValue(s,i))return!1;return!0}(t,o,r,n,s,i.dataColumns))o<s&&this.vegaView.insert(e,T(n,o));else{var l=g.changeset().remove(g.truthy).insert(T(n));this.vegaView.change(e,l),(0,m.ji)("Had to clear the ".concat(e," dataset before inserting data through Vega view."))}}else this.vegaView.insert(e,T(n));else this.vegaView._runtime.data.hasOwnProperty(e)&&this.vegaView.remove(e,g.truthy)}},{key:"createView",value:function(){var e=(0,r.Z)((0,o.Z)().mark((function e(){var t,n,r,i,s,l,d,c,u,g,p,v,b,w,y,x,S;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,m.ji)("Creating a new Vega view."),this.element){e.next=3;break}throw Error("Element missing.");case 3:return this.finalizeView(),t=this.props.element,n=this.generateSpec(),r={defaultStyle:!0,ast:!0,expr:f.N},e.next=9,(0,h.ZP)(this.element,n,r);case 9:if(i=e.sent,s=i.vgSpec,l=i.view,d=i.finalize,this.vegaView=l,this.vegaFinalizer=d,c=W(t),1===(u=c?Object.keys(c):[]).length?(g=(0,a.Z)(u,1),p=g[0],this.defaultDataName=p):0===u.length&&s.data&&(this.defaultDataName=V),(v=D(t))&&l.insert(this.defaultDataName,v),c)for(b=0,w=Object.entries(c);b<w.length;b++)y=(0,a.Z)(w[b],2),x=y[0],S=y[1],l.insert(x,S);return e.next=23,l.runAsync();case 23:this.vegaView.resize().runAsync();case 24:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;if(this.state.error)throw this.state.error;return(0,z.jsx)(k,{"data-testid":"stArrowVegaLiteChart",ref:function(t){e.element=t}})}}]),n}(c.PureComponent);function D(e){var t=e.data;return t&&0!==t.data.numRows?T(t):null}function W(e){var t=I(e);if(null==t)return null;for(var n={},o=0,r=Object.entries(t);o<r.length;o++){var i=(0,a.Z)(r[o],2),s=i[0],l=i[1];n[s]=T(l)}return n}function I(e){var t;if(0===(null===(t=e.datasets)||void 0===t?void 0:t.length))return null;var n={};return e.datasets.forEach((function(e){if(e){var t=e.hasName?e.name:null;n[t]=e.data}})),n}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.isEmpty())return[];for(var n=[],a=e.dimensions,o=a.dataRows,r=a.dataColumns,i=b.fu.getTypeName(e.types.index[0]),s=P.has(i),l=t;l<o;l++){var d={};if(s){var c=e.getIndexValue(l,0);d[C]="bigint"===typeof c?Number(c):c}for(var u=0;u<r;u++){var h=e.getDataValue(l,u);d[e.columns[0][u]]="bigint"===typeof h?Number(h):h}n.push(d)}return n}var N=(0,u.b)((0,p.Z)(Z))}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[745],{6745:function(e,t,n){n.r(t),n.d(t,{default:function(){return N}});var a=n(29439),o=n(74165),r=n(15861),i=n(15671),s=n(43144),l=n(60136),d=n(29388),c=n(47313),u=n(83985),h=n(86538),g=n(61469),f=n(29334),m=n(72599),p=n(26419),v=n(81003),b=n(45429),w=n(1413),y=n(16031),x=n(81512);function S(e,t){var n={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},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:t.spacing.mdPx,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},concat:{columns:1},facet:{columns:1},mark:(0,w.Z)({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?(0,y.mergeWith)({},n,e,(function(e,t){return(0,y.isArray)(t)?t:void 0})):n}function F(e,t){var n=t.colors,a=t.fontSizes,o=t.genericFonts,r={labelFont:o.bodyFont,titleFont:o.bodyFont,labelFontSize:a.twoSmPx,titleFontSize:a.twoSmPx},i={background:n.bgColor,axis:(0,w.Z)({labelColor:n.bodyText,titleColor:n.bodyText,gridColor:(0,x.ny)(t)},r),legend:(0,w.Z)({labelColor:n.bodyText,titleColor:n.bodyText},r),title:(0,w.Z)({color:n.bodyText,subtitleColor:n.bodyText},r),header:{labelColor:n.bodyText},view:{continuousHeight:350,continuousWidth:400},mark:{tooltip:!0}};return e?(0,y.merge)({},i,e):i}var k=(0,n(47167).Z)("div",{target:"everg990"})((function(e){var t=e.theme;return{"&.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.md,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}}}}}),""),z=n(46417),C="(index)",V="source",P=new Set([b.GI.DatetimeIndex,b.GI.Float64Index,b.GI.Int64Index,b.GI.RangeIndex,b.GI.UInt64Index]),Z=function(e){(0,l.Z)(n,e);var t=(0,d.Z)(n);function n(){var e;(0,i.Z)(this,n);for(var a=arguments.length,o=new Array(a),r=0;r<a;r++)o[r]=arguments[r];return(e=t.call.apply(t,[this].concat(o))).vegaView=void 0,e.vegaFinalizer=void 0,e.defaultDataName=V,e.element=null,e.state={error:void 0},e.finalizeView=function(){e.vegaFinalizer&&e.vegaFinalizer(),e.vegaFinalizer=void 0,e.vegaView=void 0},e.generateSpec=function(){var t,n,a=e.props,o=a.element,r=a.theme,i=JSON.parse(o.spec),s=o.useContainerWidth;if("streamlit"===o.vegaLiteTheme?i.config=S(i.config,r):"streamlit"===(null===(t=i.usermeta)||void 0===t||null===(n=t.embedOptions)||void 0===n?void 0:n.theme)?(i.config=S(i.config,r),i.usermeta.embedOptions.theme=void 0):i.config=F(i.config,r),e.props.height?(i.width=e.props.width,i.height=e.props.height):s&&(i.width=e.props.width),i.padding||(i.padding={}),null==i.padding.bottom&&(i.padding.bottom=20),i.datasets)throw new Error("Datasets should not be passed as part of the spec");return i},e}return(0,s.Z)(n,[{key:"componentDidMount",value:function(){var e=(0,r.Z)((0,o.Z)().mark((function e(){var t;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.createView();case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),t=(0,v.b)(e.t0),this.setState({error:t});case 9:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(){return e.apply(this,arguments)}}()},{key:"componentWillUnmount",value:function(){this.finalizeView()}},{key:"componentDidUpdate",value:function(){var e=(0,r.Z)((0,o.Z)().mark((function e(t){var n,r,i,s,l,d,c,u,h,g,f,p,b,w,y,x,S,F,k,z,C,V;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.element,r=t.theme,i=this.props,s=i.element,l=i.theme,d=n.spec,c=s.spec,this.vegaView&&d===c&&r===l&&t.width===this.props.width&&t.height===this.props.height&&t.element.vegaLiteTheme===this.props.element.vegaLiteTheme){e.next=16;break}return(0,m.ji)("Vega spec changed."),e.prev=6,e.next=9,this.createView();case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(6),u=(0,v.b)(e.t0),this.setState({error:u});case 15:return e.abrupt("return");case 16:for(h=n.data,g=s.data,(h||g)&&this.updateData(this.defaultDataName,h,g),f=I(n)||{},p=I(s)||{},b=0,w=Object.entries(p);b<w.length;b++)y=(0,a.Z)(w[b],2),x=y[0],S=y[1],F=x||this.defaultDataName,k=f[F],this.updateData(F,k,S);for(z=0,C=Object.keys(f);z<C.length;z++)V=C[z],p.hasOwnProperty(V)||V===this.defaultDataName||this.updateData(V,null,null);this.vegaView.resize().runAsync();case 24:case"end":return e.stop()}}),e,this,[[6,11]])})));return function(t){return e.apply(this,arguments)}}()},{key:"updateData",value:function(e,t,n){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(n&&0!==n.data.numRows)if(t&&0!==t.data.numRows){var a=t.dimensions,o=a.dataRows,r=a.dataColumns,i=n.dimensions,s=i.dataRows;if(function(e,t,n,a,o,r){if(n!==r)return!1;if(t>=o)return!1;if(0===t)return!1;var i=r-1,s=t-1;if(e.getDataValue(0,i)!==a.getDataValue(0,i)||e.getDataValue(s,i)!==a.getDataValue(s,i))return!1;return!0}(t,o,r,n,s,i.dataColumns))o<s&&this.vegaView.insert(e,T(n,o));else{var l=g.changeset().remove(g.truthy).insert(T(n));this.vegaView.change(e,l),(0,m.ji)("Had to clear the ".concat(e," dataset before inserting data through Vega view."))}}else this.vegaView.insert(e,T(n));else this.vegaView._runtime.data.hasOwnProperty(e)&&this.vegaView.remove(e,g.truthy)}},{key:"createView",value:function(){var e=(0,r.Z)((0,o.Z)().mark((function e(){var t,n,r,i,s,l,d,c,u,g,p,v,b,w,y,x,S;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,m.ji)("Creating a new Vega view."),this.element){e.next=3;break}throw Error("Element missing.");case 3:return this.finalizeView(),t=this.props.element,n=this.generateSpec(),r={defaultStyle:!0,ast:!0,expr:f.N},e.next=9,(0,h.ZP)(this.element,n,r);case 9:if(i=e.sent,s=i.vgSpec,l=i.view,d=i.finalize,this.vegaView=l,this.vegaFinalizer=d,c=W(t),1===(u=c?Object.keys(c):[]).length?(g=(0,a.Z)(u,1),p=g[0],this.defaultDataName=p):0===u.length&&s.data&&(this.defaultDataName=V),(v=D(t))&&l.insert(this.defaultDataName,v),c)for(b=0,w=Object.entries(c);b<w.length;b++)y=(0,a.Z)(w[b],2),x=y[0],S=y[1],l.insert(x,S);return e.next=23,l.runAsync();case 23:this.vegaView.resize().runAsync();case 24:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;if(this.state.error)throw this.state.error;return(0,z.jsx)(k,{"data-testid":"stArrowVegaLiteChart",ref:function(t){e.element=t}})}}]),n}(c.PureComponent);function D(e){var t=e.data;return t&&0!==t.data.numRows?T(t):null}function W(e){var t=I(e);if(null==t)return null;for(var n={},o=0,r=Object.entries(t);o<r.length;o++){var i=(0,a.Z)(r[o],2),s=i[0],l=i[1];n[s]=T(l)}return n}function I(e){var t;if(0===(null===(t=e.datasets)||void 0===t?void 0:t.length))return null;var n={};return e.datasets.forEach((function(e){if(e){var t=e.hasName?e.name:null;n[t]=e.data}})),n}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.isEmpty())return[];for(var n=[],a=e.dimensions,o=a.dataRows,r=a.dataColumns,i=b.fu.getTypeName(e.types.index[0]),s=P.has(i),l=t;l<o;l++){var d={};if(s){var c=e.getIndexValue(l,0);d[C]="bigint"===typeof c?Number(c):c}for(var u=0;u<r;u++){var h=e.getDataValue(l,u);d[e.columns[0][u]]="bigint"===typeof h?Number(h):h}n.push(d)}return n}var N=(0,u.b)((0,p.Z)(Z))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[807],{99807:function(n,r,o){o.r(r),o.d(r,{default:function(){return c}});o(47313);var t=o(4371),i=o(47167),e=o(16168),a=(0,i.Z)("div",{target:"edb2rvg0"})((function(n){var r=n.theme;return{paddingBottom:r.spacing.smPx,lineHeight:r.lineHeights.normal,color:(0,e.yq)(r)}}),""),s=o(50412),g=o(46417);var c=function(n){var r=n.element,o=n.width;return(0,g.jsxs)("div",{className:"stProgress",children:[(0,g.jsx)(a,{children:(0,g.jsx)(s.Z,{source:r.text,allowHTML:!1,isLabel:!0})}),(0,g.jsx)(t.Z,{value:r.value,width:o})]})}},4371:function(n,r,o){o.d(r,{$:function(){return t},Z:function(){return d}});var t,i=o(47313),e=o(83985),a=o(54922),s=o(16168),g=o(75314),c=o(74969),u=o(46417);!function(n){n.EXTRASMALL="xs",n.SMALL="sm",n.MEDIUM="md",n.LARGE="lg",n.EXTRALARGE="xl"}(t||(t={}));var d=function(n){var r=n.value,o=n.width,d=n.size,l=void 0===d?t.SMALL:d,p=n.overrides,m=(0,e.u)(),h={xs:m.spacing.twoXS,sm:m.spacing.sm,md:m.spacing.lg,lg:m.spacing.xl,xl:m.spacing.twoXL},f=i.useContext(a.I).activeTheme,v=!(0,s.MJ)(f),w={BarContainer:{style:{marginTop:m.spacing.none,marginBottom:m.spacing.none,marginRight:m.spacing.none,marginLeft:m.spacing.none}},Bar:{style:function(n){var r=n.$theme;return{width:o?o.toString():void 0,marginTop:m.spacing.none,marginBottom:m.spacing.none,marginRight:m.spacing.none,marginLeft:m.spacing.none,height:h[l],backgroundColor:r.colors.progressbarTrackFill,borderTopLeftRadius:m.spacing.twoXS,borderTopRightRadius:m.spacing.twoXS,borderBottomLeftRadius:m.spacing.twoXS,borderBottomRightRadius:m.spacing.twoXS}}},BarProgress:{style:function(){return{backgroundColor:v?m.colors.primary:m.colors.blue70,borderTopLeftRadius:m.spacing.twoXS,borderTopRightRadius:m.spacing.twoXS,borderBottomLeftRadius:m.spacing.twoXS,borderBottomRightRadius:m.spacing.twoXS}}}};return(0,u.jsx)(g.Z,{value:r,overrides:(0,c.aO)(w,p)})}}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[807],{99807:function(n,r,o){o.r(r),o.d(r,{default:function(){return c}});o(47313);var t=o(4371),i=o(47167),e=o(81512),a=(0,i.Z)("div",{target:"edb2rvg0"})((function(n){var r=n.theme;return{paddingBottom:r.spacing.smPx,lineHeight:r.lineHeights.normal,color:(0,e.yq)(r)}}),""),s=o(50412),g=o(46417);var c=function(n){var r=n.element,o=n.width;return(0,g.jsxs)("div",{className:"stProgress",children:[(0,g.jsx)(a,{children:(0,g.jsx)(s.Z,{source:r.text,allowHTML:!1,isLabel:!0})}),(0,g.jsx)(t.Z,{value:r.value,width:o})]})}},4371:function(n,r,o){o.d(r,{$:function(){return t},Z:function(){return d}});var t,i=o(47313),e=o(83985),a=o(54922),s=o(81512),g=o(75314),c=o(74969),u=o(46417);!function(n){n.EXTRASMALL="xs",n.SMALL="sm",n.MEDIUM="md",n.LARGE="lg",n.EXTRALARGE="xl"}(t||(t={}));var d=function(n){var r=n.value,o=n.width,d=n.size,l=void 0===d?t.SMALL:d,p=n.overrides,m=(0,e.u)(),h={xs:m.spacing.twoXS,sm:m.spacing.sm,md:m.spacing.lg,lg:m.spacing.xl,xl:m.spacing.twoXL},f=i.useContext(a.I).activeTheme,v=!(0,s.MJ)(f),w={BarContainer:{style:{marginTop:m.spacing.none,marginBottom:m.spacing.none,marginRight:m.spacing.none,marginLeft:m.spacing.none}},Bar:{style:function(n){var r=n.$theme;return{width:o?o.toString():void 0,marginTop:m.spacing.none,marginBottom:m.spacing.none,marginRight:m.spacing.none,marginLeft:m.spacing.none,height:h[l],backgroundColor:r.colors.progressbarTrackFill,borderTopLeftRadius:m.spacing.twoXS,borderTopRightRadius:m.spacing.twoXS,borderBottomLeftRadius:m.spacing.twoXS,borderBottomRightRadius:m.spacing.twoXS}}},BarProgress:{style:function(){return{backgroundColor:v?m.colors.primary:m.colors.blue70,borderTopLeftRadius:m.spacing.twoXS,borderTopRightRadius:m.spacing.twoXS,borderBottomLeftRadius:m.spacing.twoXS,borderBottomRightRadius:m.spacing.twoXS}}}};return(0,u.jsx)(g.Z,{value:r,overrides:(0,c.aO)(w,p)})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[828],{2828:function(e,t,n){n.r(t),n.d(t,{default:function(){return w}});var r=n(15671),a=n(43144),i=n(60136),o=n(29388),s=n(47313),l=n(70816),u=n.n(l),p=n(83985),d=n(78138),m=n(66097),c=n(18550),f=n(46332),h=n(65167),g=n(73290),y=n(80213),v=n(64243),b=n(46417),C="YYYY/MM/DD";function x(e){return e.map((function(e){return new Date(e)}))}function k(e){return e.map((function(e){return u()(e).format(C)}))}var V=function(e){(0,i.Z)(n,e);var t=(0,o.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).formClearHelper=new f.Kz,e.state={values:e.initialValue,isRange:e.props.element.isRange,isEmpty:!1},e.commitWidgetValue=function(t){e.props.widgetMgr.setStringArrayValue(e.props.element,k(e.state.values),t)},e.onFormCleared=function(){var t=x(e.props.element.default);e.setState({values:t},(function(){return e.commitWidgetValue({fromUi:!0})}))},e.handleChange=function(t){var n=t.date;if(null!==n&&void 0!==n){var r=[];Array.isArray(n)?n.forEach((function(e){e&&r.push(e)})):r.push(n),e.setState({values:r,isEmpty:!r},(function(){e.state.isEmpty||e.commitWidgetValue({fromUi:!0})}))}else e.setState({values:[],isEmpty:!0})},e.handleClose=function(){e.state.isEmpty&&e.setState((function(e,t){return{values:x(t.element.default),isEmpty:!x(t.element.default)}}),(function(){e.commitWidgetValue({fromUi:!0})}))},e.getMaxDate=function(){var t=e.props.element.max;return t&&t.length>0?u()(t,C).toDate():void 0},e}return(0,a.Z)(n,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getStringArrayValue(this.props.element);return x(void 0!==e?e:this.props.element.default)}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({values:t.map((function(e){return new Date(e)}))},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e,t=this.props,n=t.width,r=t.element,a=t.disabled,i=t.theme,o=t.widgetMgr,s=this.state,l=s.values,p=s.isRange,f=i.colors,x=i.fontSizes,k=i.lineHeights,V={width:n},w=u()(r.min,C).toDate(),D=this.getMaxDate();return this.formClearHelper.manageFormClearListener(o,r.formId,this.onFormCleared),(0,b.jsxs)("div",{className:"stDateInput",style:V,children:[(0,b.jsx)(h.ON,{label:r.label,disabled:a,labelVisibility:(0,v.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),children:r.help&&(0,b.jsx)(h.dT,{children:(0,b.jsx)(g.ZP,{content:r.help,placement:y.ug.TOP_RIGHT})})}),(0,b.jsx)(d.Z,{density:m.pw.high,formatString:"yyyy/MM/dd",disabled:a,onChange:this.handleChange,onClose:this.handleClose,overrides:{Popover:{props:{placement:c.r4.bottomLeft,overrides:{Body:{style:{border:"1px solid ".concat(f.fadedText10)}}}}},CalendarContainer:{style:{fontSize:x.sm,paddingRight:i.spacing.sm,paddingLeft:i.spacing.sm,paddingBottom:i.spacing.sm,paddingTop:i.spacing.sm}},Week:{style:{fontSize:x.sm}},Day:{style:{fontSize:x.sm,lineHeight:k.base,"::after":{borderColor:f.transparent}}},PrevButton:{style:function(){return{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:f.transparent},":focus":{backgroundColor:f.transparent,outline:0}}}},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:f.transparent},":focus":{backgroundColor:f.transparent,outline:0}}},Input:{props:{maskChar:null,overrides:{Root:{style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}},Input:{style:{paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}}}}}},value:l,minDate:w,maxDate:D,range:p})]})}}]),n}(s.PureComponent),w=(0,p.b)(V)}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[828],{2828:function(e,t,n){n.r(t),n.d(t,{default:function(){return w}});var r=n(15671),a=n(43144),i=n(60136),o=n(29388),s=n(47313),l=n(70816),u=n.n(l),p=n(83985),d=n(78138),m=n(66097),c=n(18550),f=n(46332),h=n(65167),g=n(73290),y=n(10612),v=n(64243),b=n(46417),C="YYYY/MM/DD";function x(e){return e.map((function(e){return new Date(e)}))}function k(e){return e.map((function(e){return u()(e).format(C)}))}var V=function(e){(0,i.Z)(n,e);var t=(0,o.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).formClearHelper=new f.Kz,e.state={values:e.initialValue,isRange:e.props.element.isRange,isEmpty:!1},e.commitWidgetValue=function(t){e.props.widgetMgr.setStringArrayValue(e.props.element,k(e.state.values),t)},e.onFormCleared=function(){var t=x(e.props.element.default);e.setState({values:t},(function(){return e.commitWidgetValue({fromUi:!0})}))},e.handleChange=function(t){var n=t.date;if(null!==n&&void 0!==n){var r=[];Array.isArray(n)?n.forEach((function(e){e&&r.push(e)})):r.push(n),e.setState({values:r,isEmpty:!r},(function(){e.state.isEmpty||e.commitWidgetValue({fromUi:!0})}))}else e.setState({values:[],isEmpty:!0})},e.handleClose=function(){e.state.isEmpty&&e.setState((function(e,t){return{values:x(t.element.default),isEmpty:!x(t.element.default)}}),(function(){e.commitWidgetValue({fromUi:!0})}))},e.getMaxDate=function(){var t=e.props.element.max;return t&&t.length>0?u()(t,C).toDate():void 0},e}return(0,a.Z)(n,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getStringArrayValue(this.props.element);return x(void 0!==e?e:this.props.element.default)}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({values:t.map((function(e){return new Date(e)}))},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e,t=this.props,n=t.width,r=t.element,a=t.disabled,i=t.theme,o=t.widgetMgr,s=this.state,l=s.values,p=s.isRange,f=i.colors,x=i.fontSizes,k=i.lineHeights,V={width:n},w=u()(r.min,C).toDate(),D=this.getMaxDate();return this.formClearHelper.manageFormClearListener(o,r.formId,this.onFormCleared),(0,b.jsxs)("div",{className:"stDateInput",style:V,children:[(0,b.jsx)(h.ON,{label:r.label,disabled:a,labelVisibility:(0,v.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),children:r.help&&(0,b.jsx)(h.dT,{children:(0,b.jsx)(g.ZP,{content:r.help,placement:y.ug.TOP_RIGHT})})}),(0,b.jsx)(d.Z,{density:m.pw.high,formatString:"yyyy/MM/dd",disabled:a,onChange:this.handleChange,onClose:this.handleClose,overrides:{Popover:{props:{placement:c.r4.bottomLeft,overrides:{Body:{style:{border:"1px solid ".concat(f.fadedText10)}}}}},CalendarContainer:{style:{fontSize:x.sm,paddingRight:i.spacing.sm,paddingLeft:i.spacing.sm,paddingBottom:i.spacing.sm,paddingTop:i.spacing.sm}},Week:{style:{fontSize:x.sm}},Day:{style:{fontSize:x.sm,lineHeight:k.base,"::after":{borderColor:f.transparent}}},PrevButton:{style:function(){return{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:f.transparent},":focus":{backgroundColor:f.transparent,outline:0}}}},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:f.transparent},":focus":{backgroundColor:f.transparent,outline:0}}},Input:{props:{maskChar:null,overrides:{Root:{style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}},Input:{style:{paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}}}}}},value:l,minDate:w,maxDate:D,range:p})]})}}]),n}(s.PureComponent),w=(0,p.b)(V)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[871],{75006:function(e,t,n){n.d(t,{Z:function(){return m}});n(47313);var r,o=n(64243),i=n(65167),a=n(1413),s=n(30168),l=n(47167),u=(0,n(30686).F4)(r||(r=(0,s.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),c=(0,l.Z)("span",{target:"e1m4n6jn0"})((function(e){var t=e.includeDot,n=e.shouldBlink,r=e.theme;return(0,a.Z)((0,a.Z)({},t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:r.colors.gray,margin:"0 5px"}}:{}),n?{color:r.colors.red,animationName:"".concat(u),animationDuration:"0.5s",animationIterationCount:5}:{})}),""),d=n(46417),m=function(e){var t=e.dirty,n=e.value,r=e.maxLength,a=e.className,s=e.type,l=[],u=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l.push((0,d.jsx)(c,{includeDot:l.length>0,shouldBlink:t,children:e},l.length))};return t&&("multiline"===(void 0===s?"single":s)?(0,o.Ge)()?u("Press \u2318+Enter to apply"):u("Press Ctrl+Enter to apply"):u("Press Enter to apply")),r&&u("".concat(n.length,"/").concat(r),t&&n.length>=r),(0,d.jsx)(i.X7,{className:a,children:l})}},92871:function(e,t,n){n.r(t),n.d(t,{default:function(){return j}});var r=n(15671),o=n(43144),i=n(60136),a=n(29388),s=n(47313),l=n(66946),u=n(99055),c=n(17076),d=n(46332),m=n(72599),p=n(7976),f=n(73290),h=n(80213),g=n(49089),b=n(3208),y=n(75006),v=n(65167),x=n(64243),w=n(47167);var V=(0,w.Z)("div",{target:"e1jwn65y3"})((function(e){var t=e.theme;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",borderWidth:"1px",borderStyle:"solid",borderColor:t.colors.widgetBorderColor||t.colors.widgetBackgroundColor||t.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.md,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}}}),""),k=(0,w.Z)("div",{target:"e1jwn65y2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),C=(0,w.Z)("button",{target:"e1jwn65y1"})((function(e){var t=e.theme;return{margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:"".concat(32,"px"),justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.widgetBackgroundColor||t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.md,borderBottomRightRadius:t.radii.md},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}}}),""),D=(0,w.Z)("div",{target:"e1jwn65y0"})((function(e){return{position:"absolute",marginRight:e.theme.spacing.twoXS,left:0,right:"".concat(64,"px")}}),""),R=n(46417);var j=function(e){(0,i.Z)(n,e);var t=(0,a.Z)(n);function n(e){var o;return(0,r.Z)(this,n),(o=t.call(this,e)).formClearHelper=new d.Kz,o.inputRef=s.createRef(),o.formatValue=function(e){var t=function(e){return null==e||""===e?void 0:e}(o.props.element.format);if(null==t)return e.toString();try{return(0,c.sprintf)(t,e)}catch(n){return(0,m.KE)("Error in sprintf(".concat(t,", ").concat(e,"): ").concat(n)),String(e)}},o.isIntData=function(){return o.props.element.dataType===p.Y2.DataType.INT},o.getMin=function(){return o.props.element.hasMin?o.props.element.min:-1/0},o.getMax=function(){return o.props.element.hasMax?o.props.element.max:1/0},o.getStep=function(){var e=o.props.element.step;return e||(o.isIntData()?1:.01)},o.commitWidgetValue=function(e){var t=o.state.value,n=o.props,r=n.element,i=n.widgetMgr,a=o.props.element,s=o.getMin(),l=o.getMax();if(s>t||t>l){var u=o.inputRef.current;u&&u.reportValidity()}else{var c=t||0===t?t:a.default;o.isIntData()?i.setIntValue(r,c,e):i.setDoubleValue(r,c,e),o.setState({dirty:!1,value:c,formattedValue:o.formatValue(c)})}},o.onFormCleared=function(){o.setState((function(e,t){return{value:t.element.default}}),(function(){return o.commitWidgetValue({fromUi:!0})}))},o.onBlur=function(){o.state.dirty&&o.commitWidgetValue({fromUi:!0}),o.setState({isFocused:!1})},o.onFocus=function(){o.setState({isFocused:!0})},o.onChange=function(e){var t,n=e.target.value;t=o.isIntData()?parseInt(n,10):parseFloat(n),o.setState({dirty:!0,value:t,formattedValue:n})},o.onKeyDown=function(e){switch(e.key){case"ArrowUp":e.preventDefault(),o.modifyValueUsingStep("increment")();break;case"ArrowDown":e.preventDefault(),o.modifyValueUsingStep("decrement")()}},o.onKeyPress=function(e){"Enter"===e.key&&o.state.dirty&&o.commitWidgetValue({fromUi:!0})},o.modifyValueUsingStep=function(e){return function(){var t=o.state.value,n=o.getStep();switch(e){case"increment":o.canIncrement&&o.setState({dirty:!0,value:t+n},(function(){o.commitWidgetValue({fromUi:!0})}));break;case"decrement":o.canDecrement&&o.setState({dirty:!0,value:t-n},(function(){o.commitWidgetValue({fromUi:!0})}))}}},o.state={dirty:!1,value:o.initialValue,formattedValue:o.formatValue(o.initialValue),isFocused:!1},o}return(0,o.Z)(n,[{key:"initialValue",get:function(){var e=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t,formattedValue:this.formatValue(t)},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"canDecrement",get:function(){return this.state.value-this.getStep()>=this.getMin()}},{key:"canIncrement",get:function(){return this.state.value+this.getStep()<=this.getMax()}},{key:"render",value:function(){var e,t=this.props,n=t.element,r=t.width,o=t.disabled,i=t.widgetMgr,a=this.state,s=a.formattedValue,c=a.dirty,d=a.isFocused,m={width:r},p=!this.canDecrement||o,w=!this.canIncrement||o;return this.formClearHelper.manageFormClearListener(i,n.formId,this.onFormCleared),(0,R.jsxs)("div",{className:"stNumberInput",style:m,children:[(0,R.jsx)(v.ON,{label:n.label,disabled:o,labelVisibility:(0,x.iF)(null===(e=n.labelVisibility)||void 0===e?void 0:e.value),children:n.help&&(0,R.jsx)(v.dT,{children:(0,R.jsx)(f.ZP,{content:n.help,placement:h.ug.TOP_RIGHT})})}),(0,R.jsxs)(V,{className:d?"focused":"",children:[(0,R.jsx)(b.Z,{type:"number",inputRef:this.inputRef,value:s,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,disabled:o,"aria-label":n.label,overrides:{Input:{props:{step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},InputContainer:{style:function(){return{borderTopRightRadius:0,borderBottomRightRadius:0}}},Root:{style:function(){return{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0}}}}}),(0,R.jsxs)(k,{children:[(0,R.jsx)(C,{className:"step-down",onClick:this.modifyValueUsingStep("decrement"),disabled:p,children:(0,R.jsx)(g.ZP,{content:l.W,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),(0,R.jsx)(C,{className:"step-up",onClick:this.modifyValueUsingStep("increment"),disabled:w,children:(0,R.jsx)(g.ZP,{content:u.v,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),(0,R.jsx)(D,{children:(0,R.jsx)(y.Z,{dirty:c,value:s,className:"input-instructions"})})]})}}]),n}(s.PureComponent)}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[871],{75006:function(e,t,n){n.d(t,{Z:function(){return m}});n(47313);var r,o=n(64243),i=n(65167),a=n(1413),s=n(30168),l=n(47167),u=(0,n(30686).F4)(r||(r=(0,s.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),c=(0,l.Z)("span",{target:"e1m4n6jn0"})((function(e){var t=e.includeDot,n=e.shouldBlink,r=e.theme;return(0,a.Z)((0,a.Z)({},t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:r.colors.gray,margin:"0 5px"}}:{}),n?{color:r.colors.red,animationName:"".concat(u),animationDuration:"0.5s",animationIterationCount:5}:{})}),""),d=n(46417),m=function(e){var t=e.dirty,n=e.value,r=e.maxLength,a=e.className,s=e.type,l=[],u=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l.push((0,d.jsx)(c,{includeDot:l.length>0,shouldBlink:t,children:e},l.length))};return t&&("multiline"===(void 0===s?"single":s)?(0,o.Ge)()?u("Press \u2318+Enter to apply"):u("Press Ctrl+Enter to apply"):u("Press Enter to apply")),r&&u("".concat(n.length,"/").concat(r),t&&n.length>=r),(0,d.jsx)(i.X7,{className:a,children:l})}},92871:function(e,t,n){n.r(t),n.d(t,{default:function(){return j}});var r=n(15671),o=n(43144),i=n(60136),a=n(29388),s=n(47313),l=n(66946),u=n(99055),c=n(17076),d=n(46332),m=n(72599),p=n(7976),f=n(73290),h=n(10612),g=n(49089),b=n(3208),y=n(75006),v=n(65167),x=n(64243),w=n(47167);var V=(0,w.Z)("div",{target:"e1jwn65y3"})((function(e){var t=e.theme;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",borderWidth:"1px",borderStyle:"solid",borderColor:t.colors.widgetBorderColor||t.colors.widgetBackgroundColor||t.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.md,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}}}),""),k=(0,w.Z)("div",{target:"e1jwn65y2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),C=(0,w.Z)("button",{target:"e1jwn65y1"})((function(e){var t=e.theme;return{margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:"".concat(32,"px"),justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.widgetBackgroundColor||t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.md,borderBottomRightRadius:t.radii.md},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}}}),""),D=(0,w.Z)("div",{target:"e1jwn65y0"})((function(e){return{position:"absolute",marginRight:e.theme.spacing.twoXS,left:0,right:"".concat(64,"px")}}),""),R=n(46417);var j=function(e){(0,i.Z)(n,e);var t=(0,a.Z)(n);function n(e){var o;return(0,r.Z)(this,n),(o=t.call(this,e)).formClearHelper=new d.Kz,o.inputRef=s.createRef(),o.formatValue=function(e){var t=function(e){return null==e||""===e?void 0:e}(o.props.element.format);if(null==t)return e.toString();try{return(0,c.sprintf)(t,e)}catch(n){return(0,m.KE)("Error in sprintf(".concat(t,", ").concat(e,"): ").concat(n)),String(e)}},o.isIntData=function(){return o.props.element.dataType===p.Y2.DataType.INT},o.getMin=function(){return o.props.element.hasMin?o.props.element.min:-1/0},o.getMax=function(){return o.props.element.hasMax?o.props.element.max:1/0},o.getStep=function(){var e=o.props.element.step;return e||(o.isIntData()?1:.01)},o.commitWidgetValue=function(e){var t=o.state.value,n=o.props,r=n.element,i=n.widgetMgr,a=o.props.element,s=o.getMin(),l=o.getMax();if(s>t||t>l){var u=o.inputRef.current;u&&u.reportValidity()}else{var c=t||0===t?t:a.default;o.isIntData()?i.setIntValue(r,c,e):i.setDoubleValue(r,c,e),o.setState({dirty:!1,value:c,formattedValue:o.formatValue(c)})}},o.onFormCleared=function(){o.setState((function(e,t){return{value:t.element.default}}),(function(){return o.commitWidgetValue({fromUi:!0})}))},o.onBlur=function(){o.state.dirty&&o.commitWidgetValue({fromUi:!0}),o.setState({isFocused:!1})},o.onFocus=function(){o.setState({isFocused:!0})},o.onChange=function(e){var t,n=e.target.value;t=o.isIntData()?parseInt(n,10):parseFloat(n),o.setState({dirty:!0,value:t,formattedValue:n})},o.onKeyDown=function(e){switch(e.key){case"ArrowUp":e.preventDefault(),o.modifyValueUsingStep("increment")();break;case"ArrowDown":e.preventDefault(),o.modifyValueUsingStep("decrement")()}},o.onKeyPress=function(e){"Enter"===e.key&&o.state.dirty&&o.commitWidgetValue({fromUi:!0})},o.modifyValueUsingStep=function(e){return function(){var t=o.state.value,n=o.getStep();switch(e){case"increment":o.canIncrement&&o.setState({dirty:!0,value:t+n},(function(){o.commitWidgetValue({fromUi:!0})}));break;case"decrement":o.canDecrement&&o.setState({dirty:!0,value:t-n},(function(){o.commitWidgetValue({fromUi:!0})}))}}},o.state={dirty:!1,value:o.initialValue,formattedValue:o.formatValue(o.initialValue),isFocused:!1},o}return(0,o.Z)(n,[{key:"initialValue",get:function(){var e=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t,formattedValue:this.formatValue(t)},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"canDecrement",get:function(){return this.state.value-this.getStep()>=this.getMin()}},{key:"canIncrement",get:function(){return this.state.value+this.getStep()<=this.getMax()}},{key:"render",value:function(){var e,t=this.props,n=t.element,r=t.width,o=t.disabled,i=t.widgetMgr,a=this.state,s=a.formattedValue,c=a.dirty,d=a.isFocused,m={width:r},p=!this.canDecrement||o,w=!this.canIncrement||o;return this.formClearHelper.manageFormClearListener(i,n.formId,this.onFormCleared),(0,R.jsxs)("div",{className:"stNumberInput",style:m,children:[(0,R.jsx)(v.ON,{label:n.label,disabled:o,labelVisibility:(0,x.iF)(null===(e=n.labelVisibility)||void 0===e?void 0:e.value),children:n.help&&(0,R.jsx)(v.dT,{children:(0,R.jsx)(f.ZP,{content:n.help,placement:h.ug.TOP_RIGHT})})}),(0,R.jsxs)(V,{className:d?"focused":"",children:[(0,R.jsx)(b.Z,{type:"number",inputRef:this.inputRef,value:s,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,disabled:o,"aria-label":n.label,overrides:{Input:{props:{step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},InputContainer:{style:function(){return{borderTopRightRadius:0,borderBottomRightRadius:0}}},Root:{style:function(){return{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0}}}}}),(0,R.jsxs)(k,{children:[(0,R.jsx)(C,{className:"step-down",onClick:this.modifyValueUsingStep("decrement"),disabled:p,children:(0,R.jsx)(g.ZP,{content:l.W,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),(0,R.jsx)(C,{className:"step-up",onClick:this.modifyValueUsingStep("increment"),disabled:w,children:(0,R.jsx)(g.ZP,{content:u.v,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),(0,R.jsx)(D,{children:(0,R.jsx)(y.Z,{dirty:c,value:s,className:"input-instructions"})})]})}}]),n}(s.PureComponent)}}]);