@stlite/desktop 0.63.1 → 0.64.0

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 (27) hide show
  1. package/README.md +1 -1
  2. package/bin/dump_artifacts.js +1 -1
  3. package/build/asset-manifest.json +15 -14
  4. package/build/index.html +1 -1
  5. package/build/static/css/{main.fc8432ac.css → main.43acb583.css} +1 -1
  6. package/build/static/js/1122.0c68dfae.chunk.js +1 -0
  7. package/build/static/js/{144.e524055a.chunk.js → 144.40c147b9.chunk.js} +1 -1
  8. package/build/static/js/{1740.0e2e5bba.chunk.js → 1740.b3a702b0.chunk.js} +1 -1
  9. package/build/static/js/4482.ee44d0ee.chunk.js +17 -0
  10. package/build/static/js/{4785.3cf5ba35.chunk.js → 4785.604ebc5f.chunk.js} +1 -1
  11. package/build/static/js/4831.27f049a3.chunk.js +5 -0
  12. package/build/static/js/5299.999e0128.chunk.js +9 -0
  13. package/build/static/js/{6134.8ad13d14.chunk.js → 6134.a44cfca0.chunk.js} +1 -1
  14. package/build/static/js/6944.6d6c54f3.chunk.js +1 -0
  15. package/build/static/js/main.352f76e7.js +28 -0
  16. package/build/static/media/MaterialSymbols-Rounded.ec07649f7a20048d5730.woff2 +0 -0
  17. package/package.json +5 -5
  18. package/wheels/stlite_lib-0.1.0-py3-none-any.whl +0 -0
  19. package/wheels/streamlit-1.37.1-cp312-none-any.whl +0 -0
  20. package/build/static/js/1122.6e3ebec6.chunk.js +0 -1
  21. package/build/static/js/4482.98a18a0a.chunk.js +0 -17
  22. package/build/static/js/4831.1e1e6a8e.chunk.js +0 -5
  23. package/build/static/js/5299.37cca9f0.chunk.js +0 -9
  24. package/build/static/js/main.71e75b37.js +0 -28
  25. package/build/static/media/MaterialSymbols-Outlined.909d2dce4aba724ad02f.woff2 +0 -0
  26. package/wheels/streamlit-1.36.0-cp312-none-any.whl +0 -0
  27. /package/build/static/js/{main.71e75b37.js.LICENSE.txt → main.352f76e7.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stlite/desktop",
3
- "version": "0.63.1",
3
+ "version": "0.64.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -70,10 +70,10 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@craco/craco": "^7.0.0",
73
- "@stlite/common": "^0.63.1",
74
- "@stlite/common-react": "^0.63.1",
75
- "@stlite/kernel": "^0.63.1",
76
- "@streamlit/app": "1.36.0",
73
+ "@stlite/common": "^0.64.0",
74
+ "@stlite/common-react": "^0.64.0",
75
+ "@stlite/kernel": "^0.64.0",
76
+ "@streamlit/app": "1.37.1",
77
77
  "@testing-library/react": "^14.1.2",
78
78
  "@testing-library/user-event": "^14.0.0",
79
79
  "@types/jest": "^27.4.3",
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[1122],{21122:(e,t,i)=>{i.r(t),i.d(t,{default:()=>H});var o=i(5057),n=i(59663),s=i(41656),r=i(50482),a=i.n(r),l=i(87333),d=i(47206),h=i(17966),c=i(12136),p=i(34971),m=i(57440),u=i(5156),g=i(72212),x=i(80552),w=i(69301),b=i(65815),y=i(50256),S=i(98899),v=i(31324),k=i(719),f=i(10266),j=i(64327),T=i(56129),C=i.n(T),z=i(87672),V=i(96266);const E=e=>{let{error:t,width:i,deltaType:o}=e;return t instanceof D?(0,V.jsx)(z.Z,{width:i,name:"No Mapbox token provided",message:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("p",{children:["To use ",(0,V.jsxs)("code",{children:["st.",o]})," or ",(0,V.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,V.jsxs)("p",{children:["To get a token, create an account at"," ",(0,V.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,V.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,V.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,V.jsxs)("p",{children:["See"," ",(0,V.jsx)("a",{href:"https://docs.streamlit.io/develop/api-reference/configuration/config.toml",children:"our documentation"})," ","for more info on how to set config options."]})]})}):t instanceof M?(0,V.jsx)(z.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("p",{children:"This app requires an internet connection."}),(0,V.jsx)("p",{children:"Please check your connection and try again."}),(0,V.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,V.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,V.jsx)(z.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:t.message})};var F=i(51673),Z=i(60913),I=i(24589),O=i(31808);class D extends Error{}class M extends Error{}const P="https://data.streamlit.io/tokens.json",W="mapbox",J=e=>t=>{class i extends o.PureComponent{constructor(i){super(i),this.context=void 0,this.initMapboxToken=async()=>{try{const e=await F.Z.get(P),{[W]:t}=e.data;if(!t)throw new Error(`Missing token ${W}`);this.setState({mapboxToken:t,isFetching:!1})}catch(e){const t=(0,j.b)(e);throw this.setState({mapboxTokenError:t,isFetching:!1}),new M(`${t.message} (${P})`)}},this.render=()=>{const{mapboxToken:i,mapboxTokenError:o,isFetching:n}=this.state,{width:s}=this.props;return o?(0,V.jsx)(E,{width:s,error:o,deltaType:e}):n?(0,V.jsx)(I.O,{element:Z.Od.create({style:Z.Od.SkeletonStyle.ELEMENT})}):(0,V.jsx)(t,{...this.props,mapboxToken:i,width:s})},this.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0}}componentDidMount(){const e=this.props.element.mapboxToken||this.context.libConfig.mapboxToken;e?this.setState({mapboxToken:e,isFetching:!1}):this.initMapboxToken()}}return i.displayName=`withMapboxToken(${t.displayName||t.name})`,i.contextType=O.E,C()(i,t)};var L=i(82160);const N=(0,L.Z)("div",{target:"e1az0zs51"})((e=>{let{width:t,height:i,theme:o}=e;return{marginTop:o.spacing.sm,position:"relative",height:i,width:t}}),""),$=(0,L.Z)("div",{target:"e1az0zs50"})((e=>{let{theme:t}=e;return{position:"absolute",right:"2.625rem",top:t.spacing.md,zIndex:1,"button:not(:disabled)":{background:t.colors.bgColor,"& + button":{borderTopColor:t.colors.secondaryBg},"& span":{filter:(0,h.Iy)(t)?"":"invert(100%)"}}}}),"");i(20512);const B={classes:{...g,...b,...w,...y,CartoLayer:c.Z},functions:{colorBins:p.Z,colorCategories:m.Z,colorContinuous:u.Z}};(0,k.fh)([S.w,v.E]);const _=new x.Z({configuration:B});class R extends o.PureComponent{constructor(){super(...arguments),this.state={viewState:{bearing:0,pitch:0,zoom:11},initialized:!1,initialViewState:{},id:void 0,pydeckJson:void 0,isFullScreen:!1,isLightTheme:(0,h.Iy)(this.props.theme)},this.componentDidMount=()=>{this.setState({initialized:!0})},this.createTooltip=e=>{const{element:t}=this.props;if(!e||!e.object||!t.tooltip)return!1;const i=s.Z.parse(t.tooltip);return i.html?i.html=this.interpolate(e,i.html):i.text=this.interpolate(e,i.text),i},this.interpolate=(e,t)=>{const i=t.match(/{(.*?)}/g);return i&&i.forEach((i=>{const o=i.substring(1,i.length-1);e.object.hasOwnProperty(o)?t=t.replace(i,e.object[o]):e.object.hasOwnProperty("properties")&&e.object.properties.hasOwnProperty(o)&&(t=t.replace(i,e.object.properties[o]))})),t},this.onViewStateChange=e=>{let{viewState:t}=e;this.setState({viewState:t})}}static getDerivedStateFromProps(e,t){const i=R.getDeckObject(e,t);if(!a()(i.initialViewState,t.initialViewState)){const e=Object.keys(i.initialViewState).reduce(((e,o)=>i.initialViewState[o]===t.initialViewState[o]?e:{...e,[o]:i.initialViewState[o]}),{});return{viewState:{...t.viewState,...e},initialViewState:i.initialViewState}}return null}render(){const e=R.getDeckObject(this.props,this.state),{viewState:t}=this.state;return(0,V.jsx)(N,{className:"stDeckGlJsonChart",width:e.initialViewState.width,height:e.initialViewState.height,"data-testid":"stDeckGlJsonChart",children:(0,V.jsxs)(n.Z,{viewState:t,onViewStateChange:this.onViewStateChange,height:e.initialViewState.height,width:e.initialViewState.width,layers:this.state.initialized?e.layers:[],getTooltip:this.createTooltip,ContextProvider:l.X$.Provider,controller:!0,children:[(0,V.jsx)(l.Z3,{height:e.initialViewState.height,width:e.initialViewState.width,mapStyle:e.mapStyle&&("string"===typeof e.mapStyle?e.mapStyle:e.mapStyle[0]),mapboxApiAccessToken:this.props.element.mapboxToken||this.props.mapboxToken}),(0,V.jsx)($,{children:(0,V.jsx)(l.Pv,{className:"zoomButton",showCompass:!1})})]})})}}R.getDeckObject=(e,t)=>{var i,o;const{element:n,width:r,height:a,theme:l,isFullScreen:d}=e,c=null!==d&&void 0!==d&&d;var p,m,u;(n.id===t.id&&t.isFullScreen===c&&t.isLightTheme===(0,h.Iy)(l)||(t.pydeckJson=s.Z.parse(n.json),t.id=n.id),null!==(i=t.pydeckJson)&&void 0!==i&&i.mapStyle||(t.pydeckJson.mapStyle=`mapbox://styles/mapbox/${(0,h.Iy)(l)?"light":"dark"}-v9`),d)?Object.assign(null===(p=t.pydeckJson)||void 0===p?void 0:p.initialViewState,{width:r,height:a}):(null!==(m=t.pydeckJson)&&void 0!==m&&null!==(u=m.initialViewState)&&void 0!==u&&u.height||(t.pydeckJson.initialViewState.height=500),n.useContainerWidth&&(t.pydeckJson.initialViewState.width=r));return t.isFullScreen=d,t.isLightTheme=(0,h.Iy)(l),null===(o=t.pydeckJson)||void 0===o||delete o.views,_.convert(t.pydeckJson)};const H=(0,d.b)(J("st.pydeck_chart")((0,f.Z)(R)))},10266:(e,t,i)=>{i.d(t,{Z:()=>w});var o=i(5057),n=i(56129),s=i.n(n),r=i(47206),a=i(53136),l=i(88916),d=i(73401),h=i(31808),c=i(82160);const p=(0,c.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:i}=e;const o=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:i.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:i.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:i.colors.fadedText60,borderRadius:"50%",...o,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:i.colors.bodyText,transition:"none"}}}),""),m=(0,c.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:i}=e;return{"&:hover":{[p]:{opacity:1,transform:"scale(1)",transition:"none"}},...i?{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 u=i(96266);class g extends o.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:i}=this.state,{children:o,width:n,height:s,disableFullscreenMode:r}=this.props;let h=a.d,c=this.zoomIn,g="View fullscreen";return e&&(h=l.m,c=this.zoomOut,g="Exit fullscreen"),(0,u.jsxs)(m,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,u.jsx)(p,{"data-testid":"StyledFullScreenButton",onClick:c,title:g,isExpanded:e,children:(0,u.jsx)(d.Z,{content:h})}),o(e?{width:t,height:i,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:n,height:s,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=h.E;const x=(0,r.b)(g);const w=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class i extends o.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:i,height:o,disableFullscreenMode:n}=this.props;return(0,u.jsx)(x,{width:i,height:o,disableFullscreenMode:t||n,children:t=>{let{width:i,height:o,expanded:n,expand:s,collapse:r}=t;return(0,u.jsx)(e,{...this.props,width:i,height:o,isFullScreen:n,expand:s,collapse:r})}})}}}return i.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,s()(i,e)}}}]);
@@ -1,17 +0,0 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4482],{25094:(t,e,a)=>{a.d(e,{Z:()=>l});var n=a(5057),i=a(66904),r=a.n(i),o=a(7742),s=a.n(o),c=a(96266);const d=t=>{let{className:e,scriptRunId:a,numParticles:n,numParticleTypes:i,ParticleComponent:o}=t;return(0,c.jsx)("div",{className:s()(e,"stHidden"),"data-testid":`${e}`,children:r()(n).map((t=>{const e=Math.floor(Math.random()*i);return(0,c.jsx)(o,{particleType:e},a+t)}))})},l=(0,n.memo)(d)},48833:(t,e,a)=>{a.r(e),a.d(e,{NUM_FLAKES:()=>u,default:()=>k});var n=a(5057);const i=a.p+"static/media/flake-0.beded754e8024c73d9d2.png",r=a.p+"static/media/flake-1.8077dc154e0bf900aa73.png",o=a.p+"static/media/flake-2.e3f07d06933dd0e84c24.png";var s=a(25094),c=a(82160),d=a(21371);const l=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.random()*(t-e)+e},m=(0,c.Z)("img",{target:"ekdfb790"})((t=>{let{theme:e}=t;return{position:"fixed",top:"-150px",marginLeft:"-75px",zIndex:e.zIndices.balloons,left:`${l(90,10)}vw`,animationDelay:`${l(4e3)}ms`,height:"150px",width:"150px",pointerEvents:"none",animationDuration:"3000ms",animationName:d.F4`
2
- from {
3
- transform:
4
- translateY(0)
5
- rotateX(${l(360)}deg)
6
- rotateY(${l(360)}deg)
7
- rotateZ(${l(360)}deg);
8
- }
9
-
10
- to {
11
- transform:
12
- translateY(calc(100vh + ${150}px))
13
- rotateX(0)
14
- rotateY(0)
15
- rotateZ(0);
16
- }
17
- `,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1}}),"");var p=a(96266);const u=100,f=[i,r,o],h=f.length,g=t=>{let{particleType:e}=t;return(0,p.jsx)(m,{src:f[e]})},x=function(t){let{scriptRunId:e}=t;return(0,p.jsx)(s.Z,{className:"snow",scriptRunId:e,numParticleTypes:h,numParticles:u,ParticleComponent:g})},k=(0,n.memo)(x)}}]);
@@ -1,5 +0,0 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[4831],{94778:(t,e,i)=>{i.d(e,{Z:()=>d});i(5057);var s=i(50120),r=i(93905),o=i(82160);const n=i(21371).F4`
2
- 50% {
3
- color: rgba(0, 0, 0, 0);
4
- }
5
- `,a=(0,o.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:i,theme:s}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:s.colors.gray,margin:"0 5px"}}:{},...i?{color:s.colors.red,animationName:`${n}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=i(96266);const d=t=>{let{dirty:e,value:i,maxLength:o,className:n,type:d="single",inForm:h}=t;const u=[],c=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u.push((0,l.jsx)(a,{includeDot:u.length>0,shouldBlink:e,children:t},u.length))};if(e){const t=h?"submit form":"apply";if("multiline"===d){c(`Press ${(0,s.Ge)()?"\u2318":"Ctrl"}+Enter to ${t}`)}else"single"===d&&c(`Press Enter to ${t}`)}return o&&("chat"!==d||e)&&c(`${i.length}/${o}`,e&&i.length>=o),(0,l.jsx)(r.X7,{"data-testid":"InputInstructions",className:n,children:u})}},52955:(t,e,i)=>{i.d(e,{K:()=>r});var s=i(50120);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,i){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,s.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,i),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},44831:(t,e,i)=>{i.r(e),i.d(e,{default:()=>M});var s=i(5057),r=i(52707),o=i(84332),n=i(47206),a=i(59500),l=i(52955),d=i(70714),h=i(60913),u=i(96216),c=i(21034),m=i(98790),p=i(73401),g=i(30124),f=i(94778),b=i(38944),v=i(93905),y=i(50120),x=i(82160);const I=(0,x.Z)("div",{target:"e116k4er3"})((t=>{let{theme:e}=t;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor||e.colors.widgetBackgroundColor||e.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}}),""),C=(0,x.Z)("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),V=(0,x.Z)("button",{target:"e116k4er1"})((t=>{let{theme:e}=t;return{margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:"32px",justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.widgetBackgroundColor||e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.default,borderBottomRightRadius:e.radii.default},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}}),""),w=(0,x.Z)("div",{target:"e116k4er0"})((t=>{let{theme:e,clearable:i}=t;return{position:"absolute",marginRight:e.spacing.twoXS,left:0,right:64+(i?12:0)+"px"}}),"");var F=i(72581),k=i.n(F),D=i(96266);class S extends s.PureComponent{constructor(t){super(t),this.formClearHelper=new l.K,this.id=void 0,this.inputRef=s.createRef(),this.formatValue=t=>{if((0,y.le)(t))return null;const e=function(t){return null==t||""===t?void 0:t}(this.props.element.format);if(null==e)return t.toString();try{return(0,a.sprintf)(e,t)}catch(i){return(0,d.KE)(`Error in sprintf(${e}, ${t}): ${i}`),String(t)}},this.isIntData=()=>this.props.element.dataType===h.Y2.DataType.INT,this.getMin=()=>this.props.element.hasMin?this.props.element.min:-1/0,this.getMax=()=>this.props.element.hasMax?this.props.element.max:1/0,this.getStep=()=>{const{step:t}=this.props.element;return t||(this.isIntData()?1:.01)},this.commitWidgetValue=t=>{const{value:e}=this.state,{element:i,widgetMgr:s,fragmentId:r}=this.props,o=this.props.element,n=this.getMin(),a=this.getMax();if((0,y.bb)(e)&&(n>e||e>a)){const t=this.inputRef.current;t&&t.reportValidity()}else{var l;const n=null!==(l=null!==e&&void 0!==e?e:o.default)&&void 0!==l?l:null;this.isIntData()?s.setIntValue(i,n,t,r):s.setDoubleValue(i,n,t,r),this.setState({dirty:!1,value:n,formattedValue:this.formatValue(n)})}},this.onFormCleared=()=>{this.setState(((t,e)=>{var i;return{value:null!==(i=e.element.default)&&void 0!==i?i:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0}),this.setState({isFocused:!1})},this.onFocus=()=>{this.setState({isFocused:!0})},this.onChange=t=>{const{value:e}=t.target;if(""===e)this.setState({dirty:!0,value:null,formattedValue:null});else{let t;t=this.isIntData()?parseInt(e,10):parseFloat(e),this.setState({dirty:!0,value:t,formattedValue:e})}},this.onKeyDown=t=>{const{key:e}=t;switch(e){case"ArrowUp":t.preventDefault(),this.modifyValueUsingStep("increment")();break;case"ArrowDown":t.preventDefault(),this.modifyValueUsingStep("decrement")()}},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,y.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId))},this.modifyValueUsingStep=t=>()=>{const{value:e}=this.state,i=this.getStep();switch(t){case"increment":this.canIncrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMin())+i},(()=>{this.commitWidgetValue({fromUi:!0})}));break;case"decrement":this.canDecrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMax())-i},(()=>{this.commitWidgetValue({fromUi:!0})}))}},this.state={dirty:!1,value:this.initialValue,formattedValue:this.formatValue(this.initialValue),isFocused:!1},this.id=k()("number_input_")}get initialValue(){var t;const e=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null,formattedValue:this.formatValue(null!==t&&void 0!==t?t:null)},(()=>{this.commitWidgetValue({fromUi:!1})}))}get canDecrement(){return!(0,y.le)(this.state.value)&&this.state.value-this.getStep()>=this.getMin()}get canIncrement(){return!(0,y.le)(this.state.value)&&this.state.value+this.getStep()<=this.getMax()}render(){var t;const{element:e,width:i,disabled:s,widgetMgr:n,theme:a}=this.props,{formattedValue:l,dirty:d,isFocused:h}=this.state,x={width:i},F=!this.canDecrement||s,k=!this.canIncrement||s,S=(0,y.le)(e.default)&&!s;return this.formClearHelper.manageFormClearListener(n,e.formId,this.onFormCleared),(0,D.jsxs)("div",{className:"stNumberInput","data-testid":"stNumberInput",style:x,children:[(0,D.jsx)(b.O,{label:e.label,disabled:s,labelVisibility:(0,y.iF)(null===(t=e.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:e.help&&(0,D.jsx)(v.dT,{children:(0,D.jsx)(c.Z,{content:e.help,placement:m.u.TOP_RIGHT})})}),(0,D.jsxs)(I,{className:h?"focused":"","data-testid":"stNumberInputContainer",children:[(0,D.jsx)(g.Z,{type:"number",inputRef:this.inputRef,value:null!==l&&void 0!==l?l:"",placeholder:e.placeholder,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,clearable:S,clearOnEscape:S,disabled:s,"aria-label":e.label,id:this.id,overrides:{ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,transform:"scale(1.4)",width:a.spacing.twoXL,marginRight:"-1.25em",":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInput-Input",step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),i>u.A.hideNumberInputControls&&(0,D.jsxs)(C,{children:[(0,D.jsx)(V,{className:"step-down","data-testid":"stNumberInput-StepDown",onClick:this.modifyValueUsingStep("decrement"),disabled:F,tabIndex:-1,children:(0,D.jsx)(p.Z,{content:r.W,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),(0,D.jsx)(V,{className:"step-up","data-testid":"stNumberInput-StepUp",onClick:this.modifyValueUsingStep("increment"),disabled:k,tabIndex:-1,children:(0,D.jsx)(p.Z,{content:o.v,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),i>u.A.hideWidgetDetails&&(0,D.jsx)(w,{clearable:S,children:(0,D.jsx)(f.Z,{dirty:d,value:null!==l&&void 0!==l?l:"",inForm:(0,y.$b)({formId:e.formId})})})]})}}const M=(0,n.b)(S)}}]);
@@ -1,9 +0,0 @@
1
- "use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[5299],{62817:(t,a,e)=>{e.r(a),e.d(a,{NUM_BALLOONS:()=>h,default:()=>k});var n=e(5057);const i=e.p+"static/media/balloon-0.0e6e96ece0ea0719d6b6.png",o=e.p+"static/media/balloon-1.a503c271109e9a0fdd2d.png",s=e.p+"static/media/balloon-2.872250f3bf3a8965d655.png",r=e.p+"static/media/balloon-3.e772fafd3bfc55fb439b.png",l=e.p+"static/media/balloon-4.1a74162473d81c9cb9ee.png",c=e.p+"static/media/balloon-5.edb75c74c54165b29856.png";var m=e(25094),p=e(82160),d=e(21371);const u=d.F4`
2
- from {
3
- transform: translateY(calc(100vh + ${300}px));
4
- }
5
-
6
- to {
7
- transform: translateY(0);
8
- }
9
- `,b=(0,p.Z)("img",{target:"earwcwy0"})((t=>{let{theme:a}=t;return{position:"fixed",top:"-300px",marginLeft:"-60.5px",zIndex:a.zIndices.balloons,left:60*Math.random()+20+"vw",animationDelay:1e3*Math.random()+"ms",height:"300px",width:"121px",pointerEvents:"none",animationDuration:"750ms",animationName:u,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1}}),"");var f=e(96266);const h=30,g=[i,o,s,r,l,c],x=g.length,v=t=>{let{particleType:a}=t;return(0,f.jsx)(b,{src:g[a]})},y=t=>{let{scriptRunId:a}=t;return(0,f.jsx)(m.Z,{className:"balloons",scriptRunId:a,numParticleTypes:x,numParticles:h,ParticleComponent:v})},k=(0,n.memo)(y)},25094:(t,a,e)=>{e.d(a,{Z:()=>m});var n=e(5057),i=e(66904),o=e.n(i),s=e(7742),r=e.n(s),l=e(96266);const c=t=>{let{className:a,scriptRunId:e,numParticles:n,numParticleTypes:i,ParticleComponent:s}=t;return(0,l.jsx)("div",{className:r()(a,"stHidden"),"data-testid":`${a}`,children:o()(n).map((t=>{const a=Math.floor(Math.random()*i);return(0,l.jsx)(s,{particleType:a},e+t)}))})},m=(0,n.memo)(c)}}]);