streamlit-nightly 1.37.2.dev20240818__py2.py3-none-any.whl → 1.37.2.dev20240820__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/dataframe_util.py +70 -71
- streamlit/elements/image.py +15 -25
- streamlit/elements/lib/built_in_chart_utils.py +1 -1
- streamlit/elements/lib/options_selector_utils.py +3 -3
- streamlit/elements/lib/policies.py +10 -9
- streamlit/elements/widgets/radio.py +2 -2
- streamlit/elements/widgets/select_slider.py +2 -2
- streamlit/elements/widgets/selectbox.py +2 -2
- streamlit/runtime/caching/__init__.py +1 -11
- streamlit/runtime/caching/cache_data_api.py +11 -83
- streamlit/runtime/caching/cache_errors.py +13 -9
- streamlit/runtime/caching/cache_resource_api.py +9 -58
- streamlit/runtime/caching/cache_utils.py +7 -12
- streamlit/runtime/caching/cached_message_replay.py +29 -185
- streamlit/runtime/caching/legacy_cache_api.py +15 -11
- streamlit/runtime/scriptrunner_utils/script_run_context.py +9 -4
- streamlit/runtime/state/widgets.py +0 -5
- streamlit/static/asset-manifest.json +7 -7
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/1307.74bce9ab.chunk.js +1 -0
- streamlit/static/static/js/3599.eaeac234.chunk.js +5 -0
- streamlit/static/static/js/6013.fb4531df.chunk.js +5 -0
- streamlit/static/static/js/7175.70728640.chunk.js +5 -0
- streamlit/static/static/js/8691.93a29403.chunk.js +5 -0
- streamlit/static/static/js/main.ff81c7a3.js +28 -0
- {streamlit_nightly-1.37.2.dev20240818.dist-info → streamlit_nightly-1.37.2.dev20240820.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.37.2.dev20240818.dist-info → streamlit_nightly-1.37.2.dev20240820.dist-info}/RECORD +32 -32
- {streamlit_nightly-1.37.2.dev20240818.dist-info → streamlit_nightly-1.37.2.dev20240820.dist-info}/WHEEL +1 -1
- streamlit/static/static/js/1307.5225662c.chunk.js +0 -1
- streamlit/static/static/js/3599.17480cdf.chunk.js +0 -5
- streamlit/static/static/js/6013.fc3867be.chunk.js +0 -5
- streamlit/static/static/js/7175.ed4a2f0d.chunk.js +0 -5
- streamlit/static/static/js/8691.885f6268.chunk.js +0 -5
- streamlit/static/static/js/main.90c4efd0.js +0 -28
- /streamlit/static/static/js/{main.90c4efd0.js.LICENSE.txt → main.ff81c7a3.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.37.2.dev20240818.data → streamlit_nightly-1.37.2.dev20240820.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.37.2.dev20240818.dist-info → streamlit_nightly-1.37.2.dev20240820.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.37.2.dev20240818.dist-info → streamlit_nightly-1.37.2.dev20240820.dist-info}/top_level.txt +0 -0
@@ -67,11 +67,11 @@ def cache(
|
|
67
67
|
This is not used.
|
68
68
|
|
69
69
|
hash_funcs : dict or None
|
70
|
-
Mapping of types or fully qualified names to hash functions. This is used to
|
71
|
-
the behavior of the hasher inside Streamlit's caching mechanism: when
|
72
|
-
encounters an object, it will first check to see if its type matches
|
73
|
-
dict and, if so, will use the provided function to generate a hash
|
74
|
-
for an example of how this can be used.
|
70
|
+
Mapping of types or fully qualified names to hash functions. This is used to
|
71
|
+
override the behavior of the hasher inside Streamlit's caching mechanism: when
|
72
|
+
the hasher encounters an object, it will first check to see if its type matches
|
73
|
+
a key in this dict and, if so, will use the provided function to generate a hash
|
74
|
+
for it. See below for an example of how this can be used.
|
75
75
|
|
76
76
|
max_entries : int or None
|
77
77
|
The maximum number of entries to keep in the cache, or ``None``
|
@@ -109,7 +109,8 @@ def cache(
|
|
109
109
|
... # Fetch data from URL here, and then clean it up.
|
110
110
|
... return data
|
111
111
|
|
112
|
-
To disable hashing return values, set the ``allow_output_mutation`` parameter to
|
112
|
+
To disable hashing return values, set the ``allow_output_mutation`` parameter to
|
113
|
+
``True``:
|
113
114
|
|
114
115
|
>>> @st.cache(allow_output_mutation=True)
|
115
116
|
... def fetch_and_clean_data(url):
|
@@ -118,7 +119,8 @@ def cache(
|
|
118
119
|
|
119
120
|
|
120
121
|
To override the default hashing behavior, pass a custom hash function.
|
121
|
-
You can do that by mapping a type (e.g. ``MongoClient``) to a hash function (``id``)
|
122
|
+
You can do that by mapping a type (e.g. ``MongoClient``) to a hash function (``id``)
|
123
|
+
like this:
|
122
124
|
|
123
125
|
>>> @st.cache(hash_funcs={MongoClient: id})
|
124
126
|
... def connect_to_database(url):
|
@@ -136,11 +138,13 @@ def cache(
|
|
136
138
|
|
137
139
|
deprecation_util.show_deprecation_warning(
|
138
140
|
f"""
|
139
|
-
`st.cache` is deprecated and will be removed soon. Please use one of Streamlit's new
|
140
|
-
|
141
|
+
`st.cache` is deprecated and will be removed soon. Please use one of Streamlit's new
|
142
|
+
caching commands, `st.cache_data` or `st.cache_resource`. More information
|
143
|
+
[in our docs]({CACHE_DOCS_URL}).
|
141
144
|
|
142
|
-
**Note**: The behavior of `st.cache` was updated in Streamlit 1.36 to the new caching
|
143
|
-
This might lead to some problems
|
145
|
+
**Note**: The behavior of `st.cache` was updated in Streamlit 1.36 to the new caching
|
146
|
+
logic used by `st.cache_data` and `st.cache_resource`. This might lead to some problems
|
147
|
+
or unexpected behavior in certain edge cases.
|
144
148
|
"""
|
145
149
|
)
|
146
150
|
|
@@ -15,6 +15,7 @@
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
17
|
import collections
|
18
|
+
import contextvars
|
18
19
|
import threading
|
19
20
|
from dataclasses import dataclass, field
|
20
21
|
from typing import TYPE_CHECKING, Callable, Counter, Dict, Final, Union
|
@@ -39,6 +40,13 @@ _LOGGER: Final = get_logger(__name__)
|
|
39
40
|
UserInfo: TypeAlias = Dict[str, Union[str, None]]
|
40
41
|
|
41
42
|
|
43
|
+
# If true, it indicates that we are in a cached function that disallows the usage of
|
44
|
+
# widgets. Using contextvars to be thread-safe.
|
45
|
+
in_cached_function: contextvars.ContextVar[bool] = contextvars.ContextVar(
|
46
|
+
"in_cached_function", default=False
|
47
|
+
)
|
48
|
+
|
49
|
+
|
42
50
|
@dataclass
|
43
51
|
class ScriptRunContext:
|
44
52
|
"""A context object that contains data for a "script run" - that is,
|
@@ -80,9 +88,6 @@ class ScriptRunContext:
|
|
80
88
|
new_fragment_ids: set[str] = field(default_factory=set)
|
81
89
|
# we allow only one dialog to be open at the same time
|
82
90
|
has_dialog_opened: bool = False
|
83
|
-
# If true, it indicates that we are in a cached function that disallows
|
84
|
-
# the usage of widgets.
|
85
|
-
disallow_cached_widget_usage: bool = False
|
86
91
|
|
87
92
|
# TODO(willhuang1997): Remove this variable when experimental query params are removed
|
88
93
|
_experimental_query_params_used = False
|
@@ -119,7 +124,7 @@ class ScriptRunContext:
|
|
119
124
|
self.fragment_ids_this_run = fragment_ids_this_run
|
120
125
|
self.new_fragment_ids = set()
|
121
126
|
self.has_dialog_opened = False
|
122
|
-
|
127
|
+
in_cached_function.set(False)
|
123
128
|
|
124
129
|
parsed_query_params = parse.parse_qs(query_string, keep_blank_values=True)
|
125
130
|
with self.session_state.query_params() as qp:
|
@@ -181,9 +181,6 @@ def register_widget_from_metadata(
|
|
181
181
|
|
182
182
|
See `register_widget` for details on what this returns.
|
183
183
|
"""
|
184
|
-
# Local import to avoid import cycle
|
185
|
-
import streamlit.runtime.caching as caching
|
186
|
-
|
187
184
|
if ctx is None:
|
188
185
|
# Early-out if we don't have a script run context (which probably means
|
189
186
|
# we're running as a "bare" Python script, and not via `streamlit run`).
|
@@ -215,8 +212,6 @@ def register_widget_from_metadata(
|
|
215
212
|
user_key,
|
216
213
|
)
|
217
214
|
)
|
218
|
-
# Save the widget metadata for cached result replay
|
219
|
-
caching.save_widget_metadata(metadata)
|
220
215
|
return ctx.session_state.register_widget(metadata, user_key)
|
221
216
|
|
222
217
|
|
@@ -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.ff81c7a3.js",
|
5
5
|
"static/js/9336.3e046ad7.chunk.js": "./static/js/9336.3e046ad7.chunk.js",
|
6
6
|
"static/js/9330.32e8a53a.chunk.js": "./static/js/9330.32e8a53a.chunk.js",
|
7
7
|
"static/js/2736.3d50ec7f.chunk.js": "./static/js/2736.3d50ec7f.chunk.js",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
"static/js/8536.b7b2ef90.chunk.js": "./static/js/8536.b7b2ef90.chunk.js",
|
16
16
|
"static/js/7805.ba32ae70.chunk.js": "./static/js/7805.ba32ae70.chunk.js",
|
17
17
|
"static/js/4500.d884c792.chunk.js": "./static/js/4500.d884c792.chunk.js",
|
18
|
-
"static/js/1307.
|
18
|
+
"static/js/1307.74bce9ab.chunk.js": "./static/js/1307.74bce9ab.chunk.js",
|
19
19
|
"static/js/2469.6217c5c3.chunk.js": "./static/js/2469.6217c5c3.chunk.js",
|
20
20
|
"static/js/4113.786b0142.chunk.js": "./static/js/4113.786b0142.chunk.js",
|
21
21
|
"static/js/1168.2a9806f0.chunk.js": "./static/js/1168.2a9806f0.chunk.js",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"static/js/1116.22f8322c.chunk.js": "./static/js/1116.22f8322c.chunk.js",
|
25
25
|
"static/js/3513.577f3dc5.chunk.js": "./static/js/3513.577f3dc5.chunk.js",
|
26
26
|
"static/js/7602.33571c14.chunk.js": "./static/js/7602.33571c14.chunk.js",
|
27
|
-
"static/js/6013.
|
27
|
+
"static/js/6013.fb4531df.chunk.js": "./static/js/6013.fb4531df.chunk.js",
|
28
28
|
"static/js/4335.bc097c4d.chunk.js": "./static/js/4335.bc097c4d.chunk.js",
|
29
29
|
"static/js/4177.e5631c43.chunk.js": "./static/js/4177.e5631c43.chunk.js",
|
30
30
|
"static/js/1451.d93e956f.chunk.js": "./static/js/1451.d93e956f.chunk.js",
|
@@ -36,10 +36,10 @@
|
|
36
36
|
"static/js/4319.00adb829.chunk.js": "./static/js/4319.00adb829.chunk.js",
|
37
37
|
"static/js/5106.4c60cfa4.chunk.js": "./static/js/5106.4c60cfa4.chunk.js",
|
38
38
|
"static/js/4666.0e91bb87.chunk.js": "./static/js/4666.0e91bb87.chunk.js",
|
39
|
-
"static/js/3599.
|
40
|
-
"static/js/8691.
|
39
|
+
"static/js/3599.eaeac234.chunk.js": "./static/js/3599.eaeac234.chunk.js",
|
40
|
+
"static/js/8691.93a29403.chunk.js": "./static/js/8691.93a29403.chunk.js",
|
41
41
|
"static/js/6718.6fb2aa21.chunk.js": "./static/js/6718.6fb2aa21.chunk.js",
|
42
|
-
"static/js/7175.
|
42
|
+
"static/js/7175.70728640.chunk.js": "./static/js/7175.70728640.chunk.js",
|
43
43
|
"static/js/5345.816da891.chunk.js": "./static/js/5345.816da891.chunk.js",
|
44
44
|
"static/js/9865.8216f445.chunk.js": "./static/js/9865.8216f445.chunk.js",
|
45
45
|
"static/js/6405.67a0df81.chunk.js": "./static/js/6405.67a0df81.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.ff81c7a3.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.ff81c7a3.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([[1307],{51307:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});n(66845);var i=n(23593),o=n(1515);const s=(0,o.Z)("div",{target:"e115fcil2"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg}}),""),r=(0,o.Z)("div",{target:"e115fcil1"})((()=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0})),""),l=(0,o.Z)("div",{target:"e115fcil0"})((e=>{let{theme:t}=e;return{fontFamily:t.genericFonts.bodyFont,fontSize:t.fontSizes.sm,color:t.colors.fadedText60,textAlign:"center",marginTop:t.spacing.xs,wordWrap:"break-word",padding:t.spacing.threeXS}}),"");var d,a=n(40864);!function(e){e[e.OriginalWidth=-1]="OriginalWidth",e[e.ColumnWidth=-2]="ColumnWidth",e[e.AutoWidth=-3]="AutoWidth"}(d||(d={}));const c=(0,i.Z)((function(e){let t,{width:n,isFullScreen:i,element:o,height:c,endpoints:h}=e;const m=o.width;if(m===d.OriginalWidth||m===d.AutoWidth)t=void 0;else if(m===d.ColumnWidth)t=n;else{if(!(m>0))throw Error(`Invalid image width: ${m}`);t=m}const u={};return c&&i?(u.maxHeight=c,u.objectFit="contain"):(u.width=t,m===d.AutoWidth&&(u.maxWidth="100%")),(0,a.jsx)(s,{className:"stImage","data-testid":"stImage",style:{width:n},children:o.imgs.map(((e,t)=>{const n=e;return(0,a.jsxs)(r,{"data-testid":"stImageContainer",children:[(0,a.jsx)("img",{style:u,src:h.buildMediaURL(n.url),alt:t.toString()}),n.caption&&(0,a.jsx)(l,{"data-testid":"stImageCaption",style:u,children:` ${n.caption} `})]},t)}))})}))},23593:(e,t,n)=>{n.d(t,{Z:()=>x});var i=n(66845),o=n(13005),s=n.n(o),r=n(25621),l=n(82218),d=n(97781),a=n(46927),c=n(66694),h=n(1515);const m=(0,h.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:n}=e;const i=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:n.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:n.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:n.colors.fadedText60,borderRadius:"50%",...i,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:n.colors.bodyText,transition:"none"}}}),""),u=(0,h.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:n}=e;return{"&:hover":{[m]:{opacity:1,transform:"scale(1)",transition:"none"}},...n?{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 p=n(40864);class g extends i.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:n}=this.state,{children:i,width:o,height:s,disableFullscreenMode:r}=this.props;let c=l.d,h=this.zoomIn,g="View fullscreen";return e&&(c=d.m,h=this.zoomOut,g="Exit fullscreen"),(0,p.jsxs)(u,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,p.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:h,title:g,isExpanded:e,children:(0,p.jsx)(a.Z,{content:c})}),i(e?{width:t,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:o,height:s,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=c.E;const w=(0,r.b)(g);const x=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class n extends i.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:n,height:i,disableFullscreenMode:o}=this.props;return(0,p.jsx)(w,{width:n,height:i,disableFullscreenMode:t||o,children:t=>{let{width:n,height:i,expanded:o,expand:s,collapse:r}=t;return(0,p.jsx)(e,{...this.props,width:n,height:i,isFullScreen:o,expand:s,collapse:r})}})}}}return n.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,s()(n,e)}},82218:(e,t,n)=>{n.d(t,{d:()=>r});var i=n(25773),o=n(66845),s=n(69),r=o.forwardRef((function(e,t){return o.createElement(s.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),o.createElement("path",{d:"M0 0v4l1.5-1.5L3 4l1-1-1.5-1.5L4 0H0zm5 4L4 5l1.5 1.5L4 8h4V4L6.5 5.5 5 4z"}))}));r.displayName="FullscreenEnter"},97781:(e,t,n)=>{n.d(t,{m:()=>r});var i=n(25773),o=n(66845),s=n(69),r=o.forwardRef((function(e,t){return o.createElement(s.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),o.createElement("path",{d:"M1 0L0 1l1.5 1.5L0 4h4V0L2.5 1.5 1 0zm3 4v4l1.5-1.5L7 8l1-1-1.5-1.5L8 4H4z"}))}));r.displayName="FullscreenExit"}}]);
|
@@ -0,0 +1,5 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[3599],{79986:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});r(66845);var n=r(50641),o=r(86659),i=r(1515);const s=r(7865).F4`
|
2
|
+
50% {
|
3
|
+
color: rgba(0, 0, 0, 0);
|
4
|
+
}
|
5
|
+
`,a=(0,i.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:`${s}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(40864);const u=e=>{let{dirty:t,value:r,maxLength:i,className:s,type:u="single",inForm:c}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,l.jsx)(a,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=c?"submit form":"apply";if("multiline"===u){p(`Press ${(0,n.Ge)()?"\u2318":"Ctrl"}+Enter to ${e}`)}else"single"===u&&p(`Press Enter to ${e}`)}return i&&("chat"!==u||t)&&p(`${r.length}/${i}`,t&&r.length>=i),(0,l.jsx)(o.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(e,t,r)=>{"use strict";r.d(t,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,n.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},83599:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>b});var n=r(66845),o=r(118),i=r(25621),s=r(70479),a=r.n(s),l=r(87814),u=r(79986),c=r(98478),d=r(86659),p=r(8879),h=r(68411),f=r(50641),m=r(40864);class y extends n.PureComponent{get initialValue(){var e;const t=this.props.widgetMgr.getStringValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}constructor(e){super(e),this.formClearHelper=new l.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:r,fragmentId:n}=this.props;t.setStringValue(r,this.state.value,e,n),this.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((e,t)=>{var r;return{value:null!==(r=t.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=e=>{const{value:t}=e.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&t.length>n||this.setState({dirty:!0,value:t})},this.isEnterKeyPressed=e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))},this.onKeyDown=e=>{const{metaKey:t,ctrlKey:r}=e,{dirty:n}=this.state;if(this.isEnterKeyPressed(e)&&(r||t)&&n){e.preventDefault(),this.commitWidgetValue({fromUi:!0});const{formId:t}=this.props.element;(0,f.$b)({formId:t})&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId)}},this.id=a()("text_area_")}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{element:t,disabled:r,width:n,widgetMgr:i,theme:s}=this.props,{value:a,dirty:l}=this.state,y={width:n},{height:b,placeholder:g}=t;return this.formClearHelper.manageFormClearListener(i,t.formId,this.onFormCleared),(0,m.jsxs)("div",{className:"stTextArea","data-testid":"stTextArea",style:y,children:[(0,m.jsx)(c.O,{label:t.label,disabled:r,labelVisibility:(0,f.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),htmlFor:this.id,children:t.help&&(0,m.jsx)(d.dT,{children:(0,m.jsx)(p.Z,{content:t.help,placement:h.u.TOP_RIGHT})})}),(0,m.jsx)(o.Z,{value:null!==a&&void 0!==a?a:"",placeholder:g,onBlur:this.onBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,"aria-label":t.label,disabled:r,id:this.id,overrides:{Input:{style:{lineHeight:s.lineHeights.inputWidget,height:b?`${b}px`:"",minHeight:"95px",resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:s.spacing.lg,paddingLeft:s.spacing.lg,paddingBottom:s.spacing.lg,paddingTop:s.spacing.lg}},Root:{props:{"data-testid":"stTextInput-RootElement"},style:{borderLeftWidth:s.sizes.borderWidth,borderRightWidth:s.sizes.borderWidth,borderTopWidth:s.sizes.borderWidth,borderBottomWidth:s.sizes.borderWidth}}}}),n>s.breakpoints.hideWidgetDetails&&(0,m.jsx)(u.Z,{dirty:l,value:null!==a&&void 0!==a?a:"",maxLength:t.maxChars,type:"multiline",inForm:(0,f.$b)({formId:t.formId})})]})}}const b=(0,i.b)(y)},118:(e,t,r)=>{"use strict";r.d(t,{Z:()=>F});var n=r(66845),o=r(80318),i=r(9656),s=r(38254),a=r(80745),l=r(98479);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,a.zo)("div",(function(e){return c(c({},(0,l.d5)(c(c({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var h=(0,a.zo)("div",(function(e){return(0,l.hB)(c({$positive:!1},e))}));h.displayName="StyledTextareaContainer",h.displayName="StyledTextareaContainer";var f=(0,a.zo)("textarea",(function(e){return c(c({},(0,l.Hx)(e)),{},{resize:e.$resize||"none"})}));function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=x(e);if(t){var o=x(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===m(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return j(e)}(this,r)}}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},x(e)}function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}f.displayName="StyledTextarea",f.displayName="StyledTextarea";var C=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}(u,e);var t,r,a,l=w(u);function u(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return P(j(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),P(j(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),P(j(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=u,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),a=r[0],l=r[1],u=(0,o.aO)({Input:{component:f},InputContainer:{component:h}},t);return n.createElement(a,y({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.Z,y({},this.props,{type:s.iB.textarea,overrides:u,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),a&&v(t,a),Object.defineProperty(t,"prototype",{writable:!1}),u}(n.Component);P(C,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:s.NO.default});const F=C},70479:(e,t,r)=>{var n=r(38145),o=0;e.exports=function(e){var t=++o;return n(e)+t}}}]);
|
@@ -0,0 +1,5 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6013],{79986:(e,t,r)=>{r.d(t,{Z:()=>c});r(66845);var n=r(50641),o=r(86659),i=r(1515);const a=r(7865).F4`
|
2
|
+
50% {
|
3
|
+
color: rgba(0, 0, 0, 0);
|
4
|
+
}
|
5
|
+
`,s=(0,i.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:`${a}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(40864);const c=e=>{let{dirty:t,value:r,maxLength:i,className:a,type:c="single",inForm:u}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,l.jsx)(s,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=u?"submit form":"apply";if("multiline"===c){p(`Press ${(0,n.Ge)()?"\u2318":"Ctrl"}+Enter to ${e}`)}else"single"===c&&p(`Press Enter to ${e}`)}return i&&("chat"!==c||t)&&p(`${r.length}/${i}`,t&&r.length>=i),(0,l.jsx)(o.X7,{"data-testid":"InputInstructions",className:a,children:d})}},46013:(e,t,r)=>{r.r(t),r.d(t,{default:()=>v});var n=r(66845),o=r(25621),i=r(25773),a=r(69),s=n.forwardRef((function(e,t){return n.createElement(a.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var l=r(118),c=r(46927),u=r(79986),d=r(27466),p=r(1515);const f=(0,p.Z)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.default,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:`${n}px`}}),""),h=(0,p.Z)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.default,display:"flex",alignItems:"center"}}),""),y=(0,p.Z)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.Iy)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?t.radii.none:t.radii.default,borderTopLeftRadius:n?t.radii.default:t.radii.none,borderBottomRightRadius:t.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:0,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),g=(0,p.Z)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),b=(0,p.Z)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var m=r(40864);const v=function(e){let{width:t,element:r,widgetMgr:i,fragmentId:a}=e;const p=(0,o.u)(),[v,x]=(0,n.useState)(!1),[w,O]=(0,n.useState)(r.default),[j,C]=(0,n.useState)(0),S=(0,n.useRef)(null),k=(0,n.useRef)({minHeight:0,maxHeight:0}),P=()=>{S.current&&S.current.focus(),w&&(i.setStringTriggerValue(r,w,{fromUi:!0},a),x(!1),O(""),C(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";O(e),x(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(S.current){const{offsetHeight:e}=S.current;k.current.minHeight=e,k.current.maxHeight=6.5*e}}),[S]);const{disabled:R,placeholder:$,maxChars:E}=r,I=(0,d.Iy)(p),{minHeight:z,maxHeight:B}=k.current,T=I?p.colors.gray70:p.colors.gray80,H=!!(j>0&&S.current)&&Math.abs(j-z)>1;return(0,m.jsx)(f,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,m.jsxs)(h,{children:[(0,m.jsx)(l.Z,{inputRef:S,value:w,placeholder:$,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(x(""!==t),O(t),C((()=>{let e=0;const{current:t}=S;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),P())},"aria-label":$,disabled:R,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",backgroundColor:p.colors.transparent,borderLeftWidth:p.sizes.borderWidth,borderRightWidth:p.sizes.borderWidth,borderTopWidth:p.sizes.borderWidth,borderBottomWidth:p.sizes.borderWidth,width:`${t}px`}},InputContainer:{style:{backgroundColor:p.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,backgroundColor:p.colors.transparent,"::placeholder":{color:T},height:H?`${j+1}px`:"auto",maxHeight:B?`${B}px`:"none",paddingRight:"3rem",paddingLeft:p.spacing.sm,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm}}}}),t>p.breakpoints.hideWidgetDetails&&(0,m.jsx)(b,{children:(0,m.jsx)(u.Z,{dirty:v,value:w,maxLength:E,type:"chat",inForm:!1})}),(0,m.jsx)(g,{children:(0,m.jsx)(y,{onClick:P,disabled:!v||R,extended:H,"data-testid":"stChatInputSubmitButton",children:(0,m.jsx)(c.Z,{content:s,size:"xl",color:"inherit"})})})]})})}},118:(e,t,r)=>{r.d(t,{Z:()=>k});var n=r(66845),o=r(80318),i=r(9656),a=r(38254),s=r(80745),l=r(98479);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,s.zo)("div",(function(e){return u(u({},(0,l.d5)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.zo)("div",(function(e){return(0,l.hB)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.zo)("textarea",(function(e){return u(u({},(0,l.Hx)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(c,e);var t,r,s,l=w(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),s=r[0],l=r[1],c=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.Z,g({},this.props,{type:a.iB.textarea,overrides:c,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(n.Component);C(S,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:a.NO.default});const k=S}}]);
|
@@ -0,0 +1,5 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7175],{79986:(e,t,r)=>{r.d(t,{Z:()=>d});r(66845);var o=r(50641),l=r(86659),i=r(1515);const n=r(7865).F4`
|
2
|
+
50% {
|
3
|
+
color: rgba(0, 0, 0, 0);
|
4
|
+
}
|
5
|
+
`,a=(0,i.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:o}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:o.colors.gray,margin:"0 5px"}}:{},...r?{color:o.colors.red,animationName:`${n}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var s=r(40864);const d=e=>{let{dirty:t,value:r,maxLength:i,className:n,type:d="single",inForm:u}=e;const c=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c.push((0,s.jsx)(a,{includeDot:c.length>0,shouldBlink:t,children:e},c.length))};if(t){const e=u?"submit form":"apply";if("multiline"===d){p(`Press ${(0,o.Ge)()?"\u2318":"Ctrl"}+Enter to ${e}`)}else"single"===d&&p(`Press Enter to ${e}`)}return i&&("chat"!==d||t)&&p(`${r.length}/${i}`,t&&r.length>=i),(0,s.jsx)(l.X7,{"data-testid":"InputInstructions",className:n,children:c})}},87814:(e,t,r)=>{r.d(t,{K:()=>l});var o=r(50641);class l{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,o.bb)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},67175:(e,t,r)=>{r.r(t),r.d(t,{default:()=>N});var o=r(66845),l=r(20607),i=r(89997),n=r(25621),a=r(52347),s=r(82534),d=r(70479),u=r.n(d),c=r(50641),p=r(87814),m=r(23849),b=r(16295),g=r(8879),h=r(68411),f=r(46927),v=r(79986),y=r(98478),I=r(86659),x=r(1515);const k=(0,x.Z)("div",{target:"e116k4er3"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,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.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}}}),""),w=(0,x.Z)("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),C=(0,x.Z)("button",{target:"e116k4er1"})((e=>{let{theme:t}=e;return{margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:"32px",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.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}}}),""),T=(0,x.Z)("div",{target:"e116k4er0"})((e=>{let{theme:t,clearable:r}=e;return{position:"absolute",marginRight:t.spacing.twoXS,left:0,right:64+(r?12:0)+"px"}}),"");var R=r(40864);const D=e=>{let{step:t,dataType:r}=e;return t||(r===b.Y2.DataType.INT?1:.01)},F=e=>{let{value:t,format:r,step:o,dataType:l}=e;if((0,c.le)(t))return null;let i=function(e){return(0,c.le)(e)||""===e?void 0:e}(r);if((0,c.le)(i)&&(0,c.bb)(o)){const e=o.toString();if(l===b.Y2.DataType.FLOAT&&0!==o&&e.includes(".")){i=`%0.${e.split(".")[1].length}f`}}if((0,c.le)(i))return t.toString();try{return(0,a.sprintf)(i,t)}catch(n){return(0,m.KE)(`Error in sprintf(${i}, ${t}): ${n}`),String(t)}},N=(0,n.b)((e=>{var t;let{disabled:r,element:n,widgetMgr:a,width:d,theme:m,fragmentId:x}=e;const{dataType:N,id:j,formId:W,default:L,format:S}=n,B=n.hasMin?n.min:-1/0,M=n.hasMax?n.max:1/0,[$,Z]=o.useState(D(n)),E=(e=>{var t;const r=e.element.dataType===b.Y2.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element);return null!==(t=null!==r&&void 0!==r?r:e.element.default)&&void 0!==t?t:null})({element:n,widgetMgr:a}),[V,U]=o.useState(!1),[z,_]=o.useState(E),[A,Y]=o.useState(F({value:E,...n,step:$})),[K,O]=o.useState(!1),P=o.useRef(null),H=o.useRef(new p.K),G=o.useRef(u()("number_input_")),X=((e,t,r)=>!(0,c.le)(e)&&e-t>=r)(z,$,B),q=((e,t,r)=>!(0,c.le)(e)&&e+t<=r)(z,$,M);o.useEffect((()=>{Z(D({step:n.step,dataType:n.dataType}))}),[n.dataType,n.step]);const J=o.useCallback((e=>{let{value:t,source:r}=e;if((0,c.bb)(t)&&(B>t||t>M)){var o;null===(o=P.current)||void 0===o||o.reportValidity()}else{var l;const e=null!==(l=null!==t&&void 0!==t?t:L)&&void 0!==l?l:null;switch(N){case b.Y2.DataType.INT:a.setIntValue({id:j,formId:W},e,r,x);break;case b.Y2.DataType.FLOAT:a.setDoubleValue({id:j,formId:W},e,r,x);break;default:throw new Error("Invalid data type")}U(!1),_(e),Y(F({value:e,dataType:N,format:S,step:$}))}}),[B,M,P,a,x,$,N,j,W,L,S]),Q=()=>{const{value:e}=n;n.setValue=!1,_(null!==e&&void 0!==e?e:null),Y(F({value:null!==e&&void 0!==e?e:null,...n,step:$})),J({value:null!==e&&void 0!==e?e:null,source:{fromUi:!1}})};o.useEffect((()=>{const e=H.current;return n.setValue?Q():J({value:z,source:{fromUi:!1}}),()=>{e.disconnect()}}),[]),n.setValue&&Q();const ee=(0,c.le)(n.default)&&!r;H.current.manageFormClearListener(a,n.formId,(()=>{var e;_(null!==(e=n.default)&&void 0!==e?e:null),J({value:z,source:{fromUi:!0}})}));const te=o.useCallback((()=>{q&&(U(!0),J({value:(null!==z&&void 0!==z?z:B)+$,source:{fromUi:!0}}))}),[z,B,$,q]),re=o.useCallback((()=>{X&&(U(!0),J({value:(null!==z&&void 0!==z?z:M)-$,source:{fromUi:!0}}))}),[z,M,$,X]),oe=o.useCallback((e=>{const{key:t}=e;switch(t){case"ArrowUp":e.preventDefault(),te();break;case"ArrowDown":e.preventDefault(),re()}}),[te,re]),le=o.useCallback((e=>{"Enter"===e.key&&(V&&J({value:z,source:{fromUi:!0}}),(0,c.$b)({formId:W})&&a.submitForm(W,x))}),[V,z,J,a,W,x]);return(0,R.jsxs)("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:d},children:[(0,R.jsx)(y.O,{label:n.label,disabled:r,labelVisibility:(0,c.iF)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:G.current,children:n.help&&(0,R.jsx)(I.dT,{children:(0,R.jsx)(g.Z,{content:n.help,placement:h.u.TOP_RIGHT})})}),(0,R.jsxs)(k,{className:K?"focused":"","data-testid":"stNumberInputContainer",children:[(0,R.jsx)(s.Z,{type:"number",inputRef:P,value:null!==A&&void 0!==A?A:"",placeholder:n.placeholder,onBlur:()=>(V&&J({value:z,source:{fromUi:!0}}),void O(!1)),onFocus:()=>{O(!0)},onChange:e=>(e=>{const{value:t}=e.target;if(""===t)U(!0),_(null),Y(null);else{let e;e=n.dataType===b.Y2.DataType.INT?parseInt(t,10):parseFloat(t),U(!0),_(e),Y(t)}})(e),onKeyPress:e=>le(e),onKeyDown:e=>oe(e),clearable:ee,clearOnEscape:ee,disabled:r,"aria-label":n.label,id:G.current,overrides:{ClearIcon:{props:{overrides:{Svg:{style:{color:m.colors.darkGray,transform:"scale(1.4)",width:m.spacing.twoXL,marginRight:"-1.25em",":hover":{fill:m.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInput-Input",step:$,min:B,max:M},style:{lineHeight:m.lineHeights.inputWidget,paddingRight:m.spacing.sm,paddingLeft:m.spacing.sm,paddingBottom:m.spacing.sm,paddingTop:m.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),d>m.breakpoints.hideNumberInputControls&&(0,R.jsxs)(w,{children:[(0,R.jsx)(C,{className:"step-down","data-testid":"stNumberInput-StepDown",onClick:re,disabled:!X||r,tabIndex:-1,children:(0,R.jsx)(f.Z,{content:l.W,size:"xs",color:X?"inherit":"disabled"})}),(0,R.jsx)(C,{className:"step-up","data-testid":"stNumberInput-StepUp",onClick:te,disabled:!q||r,tabIndex:-1,children:(0,R.jsx)(f.Z,{content:i.v,size:"xs",color:q?"inherit":"disabled"})})]})]}),d>m.breakpoints.hideWidgetDetails&&(0,R.jsx)(T,{clearable:ee,children:(0,R.jsx)(v.Z,{dirty:V,value:null!==A&&void 0!==A?A:"",inForm:(0,c.$b)({formId:n.formId})})})]})}))}}]);
|
@@ -0,0 +1,5 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8691],{79986:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});r(66845);var n=r(50641),o=r(86659),i=r(1515);const s=r(7865).F4`
|
2
|
+
50% {
|
3
|
+
color: rgba(0, 0, 0, 0);
|
4
|
+
}
|
5
|
+
`,a=(0,i.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:r,theme:n}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:`${s}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(40864);const u=t=>{let{dirty:e,value:r,maxLength:i,className:s,type:u="single",inForm:c}=t;const d=[],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,l.jsx)(a,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};if(e){const t=c?"submit form":"apply";if("multiline"===u){p(`Press ${(0,n.Ge)()?"\u2318":"Ctrl"}+Enter to ${t}`)}else"single"===u&&p(`Press Enter to ${t}`)}return i&&("chat"!==u||e)&&p(`${r.length}/${i}`,e&&r.length>=i),(0,l.jsx)(o.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(t,e,r)=>{"use strict";r.d(e,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){(0,n.bb)(this.formClearListener)&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,n.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,r),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}}},58691:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(66845),o=r(70479),i=r.n(o),s=r(82534),a=r(25621),l=r(16295),u=r(87814),c=r(79986),d=r(98478),p=r(86659),h=r(8879),f=r(68411),m=r(50641);const y=(0,r(1515).Z)("div",{target:"e11y4ecf0"})((t=>{let{width:e}=t;return{position:"relative",width:e}}),"");var b=r(40864);class g extends n.PureComponent{constructor(t){var e;super(t),e=this,this.formClearHelper=new u.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=function(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{widgetMgr:n,element:o,fragmentId:i}=e.props;n.setStringValue(o,e.state.value,t,i),r&&e.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((t,e)=>{var r;return{value:null!==(r=e.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=t=>{const{value:e}=t.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&e.length>n||((0,m.$b)(this.props.element)?this.setState({dirty:!0,value:e},(()=>{this.commitWidgetValue({fromUi:!0},!1)})):this.setState({dirty:!0,value:e}))},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,m.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId))},this.id=i()("text_input_")}get initialValue(){var t;const e=this.props.widgetMgr.getStringValue(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},(()=>{this.commitWidgetValue({fromUi:!1})}))}getTypeString(){return this.props.element.type===l.oi.Type.PASSWORD?"password":"text"}render(){var t;const{dirty:e,value:r}=this.state,{element:n,width:o,disabled:i,widgetMgr:a,theme:l}=this.props,{placeholder:u}=n;return this.formClearHelper.manageFormClearListener(a,n.formId,this.onFormCleared),(0,b.jsxs)(y,{className:"row-widget stTextInput","data-testid":"stTextInput",width:o,children:[(0,b.jsx)(d.O,{label:n.label,disabled:i,labelVisibility:(0,m.iF)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:n.help&&(0,b.jsx)(p.dT,{children:(0,b.jsx)(h.Z,{content:n.help,placement:f.u.TOP_RIGHT})})}),(0,b.jsx)(s.Z,{value:null!==r&&void 0!==r?r:"",placeholder:u,onBlur:this.onBlur,onChange:this.onChange,onKeyPress:this.onKeyPress,"aria-label":n.label,disabled:i,id:this.id,type:this.getTypeString(),autoComplete:n.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:l.lineHeights.inputWidget,paddingRight:l.spacing.sm,paddingLeft:l.spacing.sm,paddingBottom:l.spacing.sm,paddingTop:l.spacing.sm}},Root:{props:{"data-testid":"stTextInput-RootElement"},style:{height:l.sizes.minElementHeight,borderLeftWidth:l.sizes.borderWidth,borderRightWidth:l.sizes.borderWidth,borderTopWidth:l.sizes.borderWidth,borderBottomWidth:l.sizes.borderWidth}}}}),o>l.breakpoints.hideWidgetDetails&&(0,b.jsx)(c.Z,{dirty:e,value:null!==r&&void 0!==r?r:"",maxLength:n.maxChars,inForm:(0,m.$b)({formId:n.formId})})]})}}const v=(0,a.b)(g)},82534:(t,e,r)=>{"use strict";r.d(e,{Z:()=>S});var n=r(66845),o=r(80318),i=r(32510),s=r(9656),a=r(98479),l=r(38254);function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=["Root","StartEnhancer","EndEnhancer"],d=["startEnhancer","endEnhancer","overrides"];function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=w(t);if(e){var o=w(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===u(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}(this,r)}}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function j(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var O=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}(w,t);var e,r,u,f=g(w);function w(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,w);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return j(v(t=f.call.apply(f,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),j(v(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),j(v(t),"onBlur",(function(e){t.setState({isFocused:!1}),t.props.onBlur(e)})),t}return e=w,(r=[{key:"render",value:function(){var t=this.props,e=t.startEnhancer,r=t.endEnhancer,u=t.overrides,f=u.Root,y=u.StartEnhancer,b=u.EndEnhancer,g=m(u,c),v=m(t,d),w=h((0,o.jb)(f,a.fC),2),j=w[0],O=w[1],S=h((0,o.jb)(y,a.Fp),2),E=S[0],P=S[1],x=h((0,o.jb)(b,a.Fp),2),W=x[0],I=x[1],T=(0,i.t)(this.props,this.state);return n.createElement(j,p({"data-baseweb":"input"},T,O,{$adjoined:F(e,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),C(e)&&n.createElement(E,p({},T,P,{$position:l.Xf.start}),"function"===typeof e?e(T):e),n.createElement(s.Z,p({},v,{overrides:g,adjoined:F(e,r),onFocus:this.onFocus,onBlur:this.onBlur})),C(r)&&n.createElement(W,p({},T,I,{$position:l.Xf.end}),"function"===typeof r?r(T):r))}}])&&y(e.prototype,r),u&&y(e,u),Object.defineProperty(e,"prototype",{writable:!1}),w}(n.Component);function F(t,e){return C(t)&&C(e)?l.y4.both:C(t)?l.y4.left:C(e)?l.y4.right:l.y4.none}function C(t){return Boolean(t||0===t)}j(O,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:l.NO.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});const S=O},70479:(t,e,r)=>{var n=r(38145),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);
|