streamlit-nightly 1.38.1.dev20240828__py2.py3-none-any.whl → 1.38.1.dev20240830__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/widgets/button.py +23 -0
- streamlit/proto/LinkButton_pb2.py +3 -3
- streamlit/proto/LinkButton_pb2.pyi +4 -1
- streamlit/static/asset-manifest.json +5 -5
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/583.0933ee10.chunk.js +1 -0
- streamlit/static/static/js/6364.7ec8417d.chunk.js +1 -0
- streamlit/static/static/js/{7077.d0cf23b9.chunk.js → 7077.e21833ae.chunk.js} +2 -2
- streamlit/static/static/js/main.f42f34e1.js +28 -0
- {streamlit_nightly-1.38.1.dev20240828.dist-info → streamlit_nightly-1.38.1.dev20240830.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.38.1.dev20240828.dist-info → streamlit_nightly-1.38.1.dev20240830.dist-info}/RECORD +17 -17
- streamlit/static/static/js/583.738fb385.chunk.js +0 -1
- streamlit/static/static/js/6364.1b2defdb.chunk.js +0 -1
- streamlit/static/static/js/main.c3c37027.js +0 -28
- /streamlit/static/static/js/{7077.d0cf23b9.chunk.js.LICENSE.txt → 7077.e21833ae.chunk.js.LICENSE.txt} +0 -0
- /streamlit/static/static/js/{main.c3c37027.js.LICENSE.txt → main.f42f34e1.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.38.1.dev20240828.data → streamlit_nightly-1.38.1.dev20240830.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.38.1.dev20240828.dist-info → streamlit_nightly-1.38.1.dev20240830.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.38.1.dev20240828.dist-info → streamlit_nightly-1.38.1.dev20240830.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.38.1.dev20240828.dist-info → streamlit_nightly-1.38.1.dev20240830.dist-info}/top_level.txt +0 -0
@@ -421,6 +421,7 @@ class ButtonMixin:
|
|
421
421
|
*,
|
422
422
|
help: str | None = None,
|
423
423
|
type: Literal["primary", "secondary"] = "secondary",
|
424
|
+
icon: str | None = None,
|
424
425
|
disabled: bool = False,
|
425
426
|
use_container_width: bool = False,
|
426
427
|
) -> DeltaGenerator:
|
@@ -460,6 +461,23 @@ class ButtonMixin:
|
|
460
461
|
button with additional emphasis or "secondary" for a normal button. Defaults
|
461
462
|
to "secondary".
|
462
463
|
|
464
|
+
icon : str or None
|
465
|
+
An optional emoji or icon to display next to the button label. If ``icon``
|
466
|
+
is ``None`` (default), no icon is displayed. If ``icon`` is a
|
467
|
+
string, the following options are valid:
|
468
|
+
|
469
|
+
* A single-character emoji. For example, you can set ``icon="🚨"``
|
470
|
+
or ``icon="🔥"``. Emoji short codes are not supported.
|
471
|
+
|
472
|
+
* An icon from the Material Symbols library (rounded style) in the
|
473
|
+
format ``":material/icon_name:"`` where "icon_name" is the name
|
474
|
+
of the icon in snake case.
|
475
|
+
|
476
|
+
For example, ``icon=":material/thumb_up:"`` will display the
|
477
|
+
Thumb Up icon. Find additional icons in the `Material Symbols \
|
478
|
+
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
479
|
+
font library.
|
480
|
+
|
463
481
|
disabled : bool
|
464
482
|
An optional boolean, which disables the link button if set to
|
465
483
|
True. The default is False.
|
@@ -497,6 +515,7 @@ class ButtonMixin:
|
|
497
515
|
help=help,
|
498
516
|
disabled=disabled,
|
499
517
|
type=type,
|
518
|
+
icon=icon,
|
500
519
|
use_container_width=use_container_width,
|
501
520
|
)
|
502
521
|
|
@@ -703,6 +722,7 @@ class ButtonMixin:
|
|
703
722
|
help: str | None,
|
704
723
|
*, # keyword-only arguments:
|
705
724
|
type: Literal["primary", "secondary"] = "secondary",
|
725
|
+
icon: str | None = None,
|
706
726
|
disabled: bool = False,
|
707
727
|
use_container_width: bool = False,
|
708
728
|
) -> DeltaGenerator:
|
@@ -716,6 +736,9 @@ class ButtonMixin:
|
|
716
736
|
if help is not None:
|
717
737
|
link_button_proto.help = dedent(help)
|
718
738
|
|
739
|
+
if icon is not None:
|
740
|
+
link_button_proto.icon = validate_icon_or_emoji(icon)
|
741
|
+
|
719
742
|
return self.dg._enqueue("link_button", link_button_proto)
|
720
743
|
|
721
744
|
def _page_link(
|
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/LinkButton.proto\"
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/LinkButton.proto\"\x81\x01\n\nLinkButton\x12\r\n\x05label\x18\x02 \x01(\t\x12\x0c\n\x04help\x18\x04 \x01(\t\x12\x0b\n\x03url\x18\x06 \x01(\t\x12\x10\n\x08\x64isabled\x18\x07 \x01(\x08\x12\x1b\n\x13use_container_width\x18\x08 \x01(\x08\x12\x0c\n\x04type\x18\t \x01(\t\x12\x0c\n\x04icon\x18\n \x01(\tB/\n\x1c\x63om.snowflake.apps.streamlitB\x0fLinkButtonProtob\x06proto3')
|
18
18
|
|
19
19
|
_globals = globals()
|
20
20
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -22,6 +22,6 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.LinkButton_
|
|
22
22
|
if not _descriptor._USE_C_DESCRIPTORS:
|
23
23
|
_globals['DESCRIPTOR']._loaded_options = None
|
24
24
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\017LinkButtonProto'
|
25
|
-
_globals['_LINKBUTTON']._serialized_start=
|
26
|
-
_globals['_LINKBUTTON']._serialized_end=
|
25
|
+
_globals['_LINKBUTTON']._serialized_start=37
|
26
|
+
_globals['_LINKBUTTON']._serialized_end=166
|
27
27
|
# @@protoc_insertion_point(module_scope)
|
@@ -34,12 +34,14 @@ class LinkButton(google.protobuf.message.Message):
|
|
34
34
|
DISABLED_FIELD_NUMBER: builtins.int
|
35
35
|
USE_CONTAINER_WIDTH_FIELD_NUMBER: builtins.int
|
36
36
|
TYPE_FIELD_NUMBER: builtins.int
|
37
|
+
ICON_FIELD_NUMBER: builtins.int
|
37
38
|
label: builtins.str
|
38
39
|
help: builtins.str
|
39
40
|
url: builtins.str
|
40
41
|
disabled: builtins.bool
|
41
42
|
use_container_width: builtins.bool
|
42
43
|
type: builtins.str
|
44
|
+
icon: builtins.str
|
43
45
|
def __init__(
|
44
46
|
self,
|
45
47
|
*,
|
@@ -49,7 +51,8 @@ class LinkButton(google.protobuf.message.Message):
|
|
49
51
|
disabled: builtins.bool = ...,
|
50
52
|
use_container_width: builtins.bool = ...,
|
51
53
|
type: builtins.str = ...,
|
54
|
+
icon: builtins.str = ...,
|
52
55
|
) -> None: ...
|
53
|
-
def ClearField(self, field_name: typing.Literal["disabled", b"disabled", "help", b"help", "label", b"label", "type", b"type", "url", b"url", "use_container_width", b"use_container_width"]) -> None: ...
|
56
|
+
def ClearField(self, field_name: typing.Literal["disabled", b"disabled", "help", b"help", "icon", b"icon", "label", b"label", "type", b"type", "url", b"url", "use_container_width", b"use_container_width"]) -> None: ...
|
54
57
|
|
55
58
|
global___LinkButton = LinkButton
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"files": {
|
3
3
|
"main.css": "./static/css/main.5513bd04.css",
|
4
|
-
"main.js": "./static/js/main.
|
4
|
+
"main.js": "./static/js/main.f42f34e1.js",
|
5
5
|
"static/js/6679.265ca09c.chunk.js": "./static/js/6679.265ca09c.chunk.js",
|
6
6
|
"static/js/9464.7e9a3c0a.chunk.js": "./static/js/9464.7e9a3c0a.chunk.js",
|
7
7
|
"static/js/9077.8a0d79f6.chunk.js": "./static/js/9077.8a0d79f6.chunk.js",
|
@@ -12,11 +12,11 @@
|
|
12
12
|
"static/js/5711.28939a95.chunk.js": "./static/js/5711.28939a95.chunk.js",
|
13
13
|
"static/js/3861.0dedcd19.chunk.js": "./static/js/3861.0dedcd19.chunk.js",
|
14
14
|
"static/js/8642.dfef7dcb.chunk.js": "./static/js/8642.dfef7dcb.chunk.js",
|
15
|
-
"static/js/6364.
|
15
|
+
"static/js/6364.7ec8417d.chunk.js": "./static/js/6364.7ec8417d.chunk.js",
|
16
16
|
"static/js/8148.f51df66c.chunk.js": "./static/js/8148.f51df66c.chunk.js",
|
17
17
|
"static/js/84.414fa87b.chunk.js": "./static/js/84.414fa87b.chunk.js",
|
18
18
|
"static/js/9923.7061d124.chunk.js": "./static/js/9923.7061d124.chunk.js",
|
19
|
-
"static/js/583.
|
19
|
+
"static/js/583.0933ee10.chunk.js": "./static/js/583.0933ee10.chunk.js",
|
20
20
|
"static/js/4827.f9cb5fa3.chunk.js": "./static/js/4827.f9cb5fa3.chunk.js",
|
21
21
|
"static/js/8237.ed5d881b.chunk.js": "./static/js/8237.ed5d881b.chunk.js",
|
22
22
|
"static/js/5828.f8572ba4.chunk.js": "./static/js/5828.f8572ba4.chunk.js",
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"static/js/783.788bb3ab.chunk.js": "./static/js/783.788bb3ab.chunk.js",
|
53
53
|
"static/js/5544.2769497c.chunk.js": "./static/js/5544.2769497c.chunk.js",
|
54
54
|
"static/css/7077.81b3d18f.chunk.css": "./static/css/7077.81b3d18f.chunk.css",
|
55
|
-
"static/js/7077.
|
55
|
+
"static/js/7077.e21833ae.chunk.js": "./static/js/7077.e21833ae.chunk.js",
|
56
56
|
"static/js/2266.48d2ebd0.chunk.js": "./static/js/2266.48d2ebd0.chunk.js",
|
57
57
|
"static/js/3389.71902a75.chunk.js": "./static/js/3389.71902a75.chunk.js",
|
58
58
|
"static/js/4297.3afbdd03.chunk.js": "./static/js/4297.3afbdd03.chunk.js",
|
@@ -153,6 +153,6 @@
|
|
153
153
|
},
|
154
154
|
"entrypoints": [
|
155
155
|
"static/css/main.5513bd04.css",
|
156
|
-
"static/js/main.
|
156
|
+
"static/js/main.f42f34e1.js"
|
157
157
|
]
|
158
158
|
}
|
streamlit/static/index.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.f42f34e1.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[583],{10583:(o,r,e)=>{e.r(r),e.d(r,{default:()=>m});e(58878);var i=e(8151),t=e(84720),l=e(98350),s=e(34914),a=e(94426),d=e(89653),n=e(32735);function c(o,r){switch(o){case t.Pj.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case t.Pj.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case t.Pj.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const u=(0,d.A)("a",{target:"e16zdaao2"})((o=>{let{fluidWidth:r,size:e,theme:i}=o;const t="number"==typeof r?`${r}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.default,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:r?t:"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,n.No)(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...c(e,i)}}),""),b=(0,d.A)(u,{target:"e16zdaao1"})((o=>{let{theme:r}=o;return{backgroundColor:r.colors.primary,color:r.colors.white,border:`${r.sizes.borderWidth} solid ${r.colors.primary}`,"&:hover":{backgroundColor:(0,n.e$)(r.colors.primary,.05),color:r.colors.white},"&:active":{backgroundColor:"transparent",color:r.colors.primary},"&:visited:not(:active)":{color:r.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}}),""),p=(0,d.A)(u,{target:"e16zdaao0"})((o=>{let{theme:r}=o;return{backgroundColor:r.colors.lightenedBg05,color:r.colors.bodyText,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,"&:visited":{color:r.colors.bodyText},"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}}),"");var h=e(90782);const g=function(o){let{kind:r,size:e,disabled:i,fluidWidth:l,children:s,autoFocus:a,href:d,rel:n,target:c,onClick:u}=o,g=b;return r===t.KX.SECONDARY&&(g=p),(0,h.jsx)(g,{kind:r,size:e||t.Pj.MEDIUM,fluidWidth:l||!1,disabled:i||!1,autoFocus:a||!1,href:d,target:c,rel:n,onClick:u,tabIndex:i?-1:0,children:s})};const m=function(o){const{disabled:r,element:e,width:d}=o,{colors:n}=(0,i.u)(),c=e.icon.startsWith(":material"),u={width:d},b="primary"===e.type?t.KX.PRIMARY:t.KX.SECONDARY,p=!e.help||d;return(0,h.jsx)("div",{className:"stLinkButton","data-testid":"stLinkButton",style:u,children:(0,h.jsx)(l.F,{help:e.help,children:(0,h.jsxs)(g,{kind:b,size:t.Pj.SMALL,disabled:r,onClick:r=>{o.disabled&&r.preventDefault()},fluidWidth:!!e.useContainerWidth&&p,href:e.url,target:"_blank",rel:"noreferrer","aria-disabled":r,children:[e.icon&&(0,h.jsx)(a.$,{iconValue:e.icon,color:n.bodyText,size:c?"lg":"base",margin:c?"0 sm 0 0":"0 md 0 0"}),(0,h.jsx)(s.Ay,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})]})})})}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6364],{52781:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>_});var o=i(58878),s=i(6334),n=i(21640),r=i(71034),a=i.n(r),l=i(72192),h=i(8151),c=i(14251),d=i(86202),p=i(26592),m=i(64639),u=i(73417),g=i(27126),x=i(92502),w=i(19720),b=i(14249),y=i(59353),S=i(78025),v=i(43338),k=i(58144),f=i(22044),j=i(53124),T=i.n(j),C=i(32782),z=i(67253),E=i(29669),F=i(1780),A=i(84152),V=i(6240),D=i(90782);const M=e=>{let{error:t,width:i,deltaType:o}=e;return t instanceof O?(0,D.jsx)(V.A,{width:i,name:"No Mapbox token provided",message:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("p",{children:["To use ",(0,D.jsxs)("code",{children:["st.",o]})," or ",(0,D.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,D.jsxs)("p",{children:["To get a token, create an account at"," ",(0,D.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,D.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,D.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,D.jsxs)("p",{children:["See"," ",(0,D.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 P?(0,D.jsx)(V.A,{width:i,name:"Error fetching Streamlit Mapbox token",message:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("p",{children:"This app requires an internet connection."}),(0,D.jsx)("p",{children:"Please check your connection and try again."}),(0,D.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,D.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,D.jsx)(V.A,{width:i,name:"Error fetching Streamlit Mapbox token",message:t.message})};class O extends Error{}class P extends Error{}const I="https://data.streamlit.io/tokens.json",J="mapbox",W=e=>t=>{class i extends o.PureComponent{constructor(i){super(i),this.context=void 0,this.initMapboxToken=async()=>{try{const e=await C.A.get(I),{[J]:t}=e.data;if(!t)throw new Error(`Missing token ${J}`);this.setState({mapboxToken:t,isFetching:!1})}catch(e){const t=(0,z.$)(e);throw this.setState({mapboxTokenError:t,isFetching:!1}),new P(`${t.message} (${I})`)}},this.render=()=>{const{mapboxToken:i,mapboxTokenError:o,isFetching:s}=this.state,{width:n}=this.props;return o?(0,D.jsx)(M,{width:n,error:o,deltaType:e}):s?(0,D.jsx)(F.E,{element:E.EA.create({style:E.EA.SkeletonStyle.ELEMENT})}):(0,D.jsx)(t,{...this.props,mapboxToken:i,width:n})},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=A.n,T()(i,t)};var L=i(89653);const H=(0,L.A)("div",{target:"e1az0zs51"})((e=>{let{width:t,height:i,theme:o}=e;return{marginTop:o.spacing.sm,position:"relative",height:i,width:t}}),""),N=(0,L.A)("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,k.iq)(t)?"":"invert(100%)"}}}}),"");i(93298);const $={classes:{...u,...w,...x,...b,CartoLayer:c.A},functions:{colorBins:d.A,colorCategories:p.A,colorContinuous:m.A}};(0,v.mk)([y.y,S.B]);const q=new g.A({configuration:$});class B 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,k.iq)(this.props.theme)},this.componentDidMount=()=>{this.setState({initialized:!0})},this.createTooltip=e=>{const{element:t}=this.props;if(!e||!e.object||!t.tooltip)return null;const i=n.A.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=B.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=B.getDeckObject(this.props,this.state),{viewState:t}=this.state,{width:i}=this.props;return(0,D.jsx)(H,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",width:i,height:e.initialViewState.height,children:(0,D.jsxs)(s.A,{viewState:t,onViewStateChange:this.onViewStateChange,height:e.initialViewState.height,width:i,layers:this.state.initialized?e.layers:[],getTooltip:this.createTooltip,ContextProvider:l.wZ.Provider,controller:!0,children:[(0,D.jsx)(l.b,{height:e.initialViewState.height,width:i,mapStyle:e.mapStyle&&("string"===typeof e.mapStyle?e.mapStyle:e.mapStyle[0]),mapboxApiAccessToken:this.props.element.mapboxToken||this.props.mapboxToken}),(0,D.jsx)(N,{children:(0,D.jsx)(l.ov,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})})}}B.getDeckObject=(e,t)=>{var i,o;const{element:s,width:r,height:a,theme:l,isFullScreen:h}=e,c=null!==h&&void 0!==h&&h;var d,p,m;(s.id===t.id&&t.isFullScreen===c&&t.isLightTheme===(0,k.iq)(l)||(t.pydeckJson=n.A.parse(s.json),t.id=s.id),null!==(i=t.pydeckJson)&&void 0!==i&&i.mapStyle||(t.pydeckJson.mapStyle=`mapbox://styles/mapbox/${(0,k.iq)(l)?"light":"dark"}-v9`),h)?Object.assign(null===(d=t.pydeckJson)||void 0===d?void 0:d.initialViewState,{width:r,height:a}):(null!==(p=t.pydeckJson)&&void 0!==p&&null!==(m=p.initialViewState)&&void 0!==m&&m.height||(t.pydeckJson.initialViewState.height=500),s.useContainerWidth&&(t.pydeckJson.initialViewState.width=r));return t.isFullScreen=h,t.isLightTheme=(0,k.iq)(l),null===(o=t.pydeckJson)||void 0===o||delete o.views,q.convert(t.pydeckJson)};const _=(0,h.b)(W("st.pydeck_chart")((0,f.A)(B)))},22044:(e,t,i)=>{"use strict";i.d(t,{A:()=>w});var o=i(58878),s=i(53124),n=i.n(s),r=i(8151),a=i(41514),l=i(67214),h=i(64611),c=i(84152),d=i(89653);const p=(0,d.A)("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,d.A)("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:t.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var u=i(90782);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(this.props.theme.sizes.fullScreenHeaderHeight);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:s,height:n,disableFullscreenMode:r}=this.props;let c=a.u,d=this.zoomIn,g="View fullscreen";return e&&(c=l.Q,d=this.zoomOut,g="Exit fullscreen"),(0,u.jsxs)(m,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,u.jsx)(p,{"data-testid":"StyledFullScreenButton",onClick:d,title:g,isExpanded:e,children:(0,u.jsx)(h.A,{content:c})}),o(e?{width:t,height:i,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:s,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=c.n;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:s}=this.props;return(0,u.jsx)(x,{width:i,height:o,disableFullscreenMode:t||s,children:t=>{let{width:i,height:o,expanded:s,expand:n,collapse:r}=t;return(0,u.jsx)(e,{...this.props,width:i,height:o,isFullScreen:s,expand:n,collapse:r})}})}}}return i.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,n()(i,e)}},63872:()=>{},35111:()=>{}}]);
|