streamlit-nightly 1.45.1.dev20250509__py3-none-any.whl → 1.45.1.dev20250511__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/commands/execution_control.py +1 -1
- streamlit/commands/navigation.py +1 -1
- streamlit/commands/page_config.py +6 -26
- streamlit/delta_generator_singletons.py +1 -1
- streamlit/elements/arrow.py +2 -2
- streamlit/elements/code.py +1 -1
- streamlit/elements/lib/built_in_chart_utils.py +1 -1
- streamlit/elements/lib/column_types.py +2 -2
- streamlit/elements/lib/image_utils.py +1 -1
- streamlit/elements/lib/options_selector_utils.py +2 -2
- streamlit/elements/metric.py +1 -1
- streamlit/elements/vega_charts.py +1 -1
- streamlit/elements/widgets/audio_input.py +1 -1
- streamlit/elements/widgets/button.py +1 -1
- streamlit/elements/widgets/button_group.py +2 -2
- streamlit/elements/widgets/camera_input.py +1 -1
- streamlit/elements/widgets/checkbox.py +2 -2
- streamlit/elements/widgets/color_picker.py +1 -1
- streamlit/elements/widgets/data_editor.py +1 -1
- streamlit/elements/widgets/file_uploader.py +1 -1
- streamlit/elements/widgets/multiselect.py +1 -1
- streamlit/elements/widgets/number_input.py +2 -2
- streamlit/elements/widgets/radio.py +1 -1
- streamlit/elements/widgets/select_slider.py +1 -1
- streamlit/elements/widgets/selectbox.py +1 -1
- streamlit/elements/widgets/slider.py +3 -3
- streamlit/elements/widgets/text_widgets.py +2 -2
- streamlit/elements/widgets/time_widgets.py +2 -2
- streamlit/errors.py +0 -13
- streamlit/git_util.py +1 -1
- streamlit/proto/DataFrame_pb2.pyi +1 -1
- streamlit/proto/NamedDataSet_pb2.pyi +1 -1
- streamlit/proto/PageConfig_pb2.py +7 -7
- streamlit/proto/PageConfig_pb2.pyi +5 -1
- streamlit/runtime/connection_factory.py +3 -3
- streamlit/runtime/scriptrunner_utils/script_run_context.py +0 -15
- streamlit/runtime/state/query_params_proxy.py +1 -1
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.C-0hf1-k.js → ErrorOutline.esm.B5LmzpSn.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.B-fFGI-X.js → FileDownload.esm.BgWveG3s.js} +1 -1
- streamlit/static/static/js/{FileHelper.ACYo0OZo.js → FileHelper.DepIpP48.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.CVNTT-bJ.js → FormClearHelper.C_BjP_35.js} +1 -1
- streamlit/static/static/js/{Hooks.C3thlpd2.js → Hooks.BpH4YuRQ.js} +1 -1
- streamlit/static/static/js/{InputInstructions.CwAxousX.js → InputInstructions.CjdwGigq.js} +1 -1
- streamlit/static/static/js/{ProgressBar.xh599Rum.js → ProgressBar.D1hXcW3N.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.CQLIsNPE.js → RenderInPortalIfExists.A1T2s6z-.js} +1 -1
- streamlit/static/static/js/{Toolbar.LKdyvP0u.js → Toolbar.y7vr7z0G.js} +1 -1
- streamlit/static/static/js/{base-input.D8OdS4WW.js → base-input.BKhd-BLG.js} +1 -1
- streamlit/static/static/js/{checkbox.DSdYKlOI.js → checkbox.DC-GFdrh.js} +1 -1
- streamlit/static/static/js/{createSuper.B2pyCfWw.js → createSuper.D5WUtJEy.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DhO2r0ne.js → data-grid-overlay-editor.BPJ38mWp.js} +1 -1
- streamlit/static/static/js/{downloader.C24skoDM.js → downloader.C6a4LRBw.js} +1 -1
- streamlit/static/static/js/{es6.DHkvCKPh.js → es6.DgMlYq8q.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.2ckQaC2c.js → iframeResizer.contentWindow.BpQxex73.js} +1 -1
- streamlit/static/static/js/{index.BVgTQbOJ.js → index.20fI9wQF.js} +1 -1
- streamlit/static/static/js/{index.BHTbGZPQ.js → index.49Q6A5_9.js} +1 -1
- streamlit/static/static/js/{index.D0R7Xh4Z.js → index.4Gtr9egA.js} +1 -1
- streamlit/static/static/js/{index.CkTL9bAR.js → index.5k30-U6O.js} +1 -1
- streamlit/static/static/js/{index.CsbhsAPy.js → index.B3UoUwtN.js} +1 -1
- streamlit/static/static/js/{index.0dGwl8CJ.js → index.B8ca7fYO.js} +1 -1
- streamlit/static/static/js/{index.BNXtQAj4.js → index.BLpDfH1w.js} +1 -1
- streamlit/static/static/js/{index.D7SCC3z9.js → index.BRN41-Jy.js} +1 -1
- streamlit/static/static/js/{index.CwuKadAX.js → index.BbhQIRth.js} +1 -1
- streamlit/static/static/js/{index.BAafqHfB.js → index.BcbB70bz.js} +1 -1
- streamlit/static/static/js/{index.By-NmdnB.js → index.BgEbLy94.js} +5 -5
- streamlit/static/static/js/{index.CUsk52t2.js → index.BhGEwO_d.js} +1 -1
- streamlit/static/static/js/{index.BflIniLm.js → index.Bj81ZRkx.js} +1 -1
- streamlit/static/static/js/{index.CVO14oQG.js → index.Bo-z1JM2.js} +1 -1
- streamlit/static/static/js/{index.DZiilxEt.js → index.BydIp_VR.js} +1 -1
- streamlit/static/static/js/{index.yzoj_DuM.js → index.C2GjbQtf.js} +1 -1
- streamlit/static/static/js/{index.gFjPlsMT.js → index.CHnID3dI.js} +1 -1
- streamlit/static/static/js/{index.CRxaBCJ7.js → index.CY8tg9lY.js} +1 -1
- streamlit/static/static/js/{index.CU-pbYVN.js → index.CcvbHTJu.js} +1 -1
- streamlit/static/static/js/{index.jCJYMVED.js → index.Cfi3u2-T.js} +1 -1
- streamlit/static/static/js/{index.fz_c3Xh_.js → index.CiO2JPl_.js} +1 -1
- streamlit/static/static/js/{index.BSOiJVQd.js → index.CkBnHCIQ.js} +1 -1
- streamlit/static/static/js/{index.B5A28NpR.js → index.Cqla7uBZ.js} +1 -1
- streamlit/static/static/js/{index.JtIlC6Uq.js → index.D3tgBU6x.js} +1 -1
- streamlit/static/static/js/{index.D2D75EDw.js → index.D5PANKHd.js} +1 -1
- streamlit/static/static/js/{index.CIoOEhZ2.js → index.DAO4Lj-D.js} +1 -1
- streamlit/static/static/js/{index.CXFuA6J-.js → index.DB42JCH0.js} +1 -1
- streamlit/static/static/js/{index.Dvr1cEJS.js → index.DPiBGVm8.js} +1 -1
- streamlit/static/static/js/{index.C_dd5q7u.js → index.DSPS70gp.js} +1 -1
- streamlit/static/static/js/{index.B5EFweZ4.js → index.DT0CWGt3.js} +1 -1
- streamlit/static/static/js/{index.BjeNtZIz.js → index.Du1Pbz0y.js} +1 -1
- streamlit/static/static/js/{index.CjWUnKIN.js → index.VPO2zcSN.js} +1 -1
- streamlit/static/static/js/{index.D4eMiZ1F.js → index._oOkpIXS.js} +1 -1
- streamlit/static/static/js/{index.CRCdonis.js → index.br6zwNIk.js} +6 -6
- streamlit/static/static/js/{index.xldt56AE.js → index.ryD8hMpi.js} +1 -1
- streamlit/static/static/js/{index.BRhKaVdO.js → index.sKXwUANU.js} +1 -1
- streamlit/static/static/js/{index.CtCnBUtk.js → index.xIQLhQKv.js} +1 -1
- streamlit/static/static/js/{input.BP6LX_Bg.js → input.CNjMviuo.js} +1 -1
- streamlit/static/static/js/{memory.E9x2ZYJv.js → memory.f8X97LPt.js} +1 -1
- streamlit/static/static/js/{mergeWith.CZP2AaVS.js → mergeWith.DU9BO8BA.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.D-Kl79U_.js → number-overlay-editor.xJPBNdGQ.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.P2ILVC_6.js → possibleConstructorReturn.BjPX9m9m.js} +1 -1
- streamlit/static/static/js/{sandbox.DfzJIGMV.js → sandbox.B23JuuVd.js} +1 -1
- streamlit/static/static/js/{textarea.4PjzfDWF.js → textarea.DodnI6GX.js} +1 -1
- streamlit/static/static/js/{timepicker.DMQdaNzO.js → timepicker.ClHKNfP9.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.BEdkbHYx.js → toConsumableArray.CK6YGgcW.js} +1 -1
- streamlit/static/static/js/{uniqueId.CAs7ftHC.js → uniqueId.BAAVLIKj.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Cedp0V76.js → useBasicWidgetState.B1oropKY.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CvRKHHKx.js → useOnInputChange.CHQJz2sf.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.BbmjZAzW.js → withFullScreenWrapper.DZ1W8JUx.js} +1 -1
- streamlit/vendor/pympler/asizeof.py +1 -1
- {streamlit_nightly-1.45.1.dev20250509.dist-info → streamlit_nightly-1.45.1.dev20250511.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.45.1.dev20250509.dist-info → streamlit_nightly-1.45.1.dev20250511.dist-info}/RECORD +111 -111
- {streamlit_nightly-1.45.1.dev20250509.data → streamlit_nightly-1.45.1.dev20250511.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.45.1.dev20250509.dist-info → streamlit_nightly-1.45.1.dev20250511.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.45.1.dev20250509.dist-info → streamlit_nightly-1.45.1.dev20250511.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.45.1.dev20250509.dist-info → streamlit_nightly-1.45.1.dev20250511.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{n as p,r as s,z as T,C as x,j as i,D as w,aC as h,aQ as r,aR as v,aS as m,F as k,B as z}from"./index.
|
1
|
+
import{n as p,r as s,z as T,C as x,j as i,D as w,aC as h,aQ as r,aR as v,aS as m,F as k,B as z}from"./index.BgEbLy94.js";const R=p("button",{target:"e1rpgzpk0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),C=p("div",{target:"e1rpgzpk1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),L=p("div",{target:"e1rpgzpk3"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function B(o){const a=z(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:a?o.colors.gray10:o.colors.gray90,color:o.colors.bodyText,boxShadow:a?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function E(o){if(o.length>104){let t=o.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return o}function D({body:o,icon:a}){const t=T(),n=E(o),d=o!==n,[e,y]=s.useState(!d),[u,b]=s.useState(0),f=s.useCallback(()=>{y(!e)},[e]),c=s.useMemo(()=>B(t),[t]),l=s.useMemo(()=>x(C,{expanded:e,children:[a&&i(w,{iconValue:a,size:"xl",testid:"stToastDynamicIcon"}),x(L,{children:[i(h,{source:e?o:n,allowHTML:!1,isToast:!0}),d&&i(R,{"data-testid":"stToastViewButton",onClick:f,children:e?"view less":"view more"})]})]}),[d,e,o,a,n,f]);s.useEffect(()=>{if(t.inSidebar)return;const g=r.info(l,{overrides:{...c}});return b(g),()=>{r.update(g,{overrides:{Body:{style:{display:"none"}}}}),r.clear(g)}},[]),s.useEffect(()=>{r.update(u,{children:l,overrides:{...c}})},[u,l,c]);const S=i(m,{kind:v.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return i(k,{children:t.inSidebar&&S})}const I=s.memo(D);export{I as default};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{bs as Z,bt as J,r as f,bu as Q,z as Y,bv as s,j as S,C as ee,bo as te,bw as re,bp as ne,b5 as oe,bx as ie,bq as ae,bm as ue,b0 as C,a$ as W,b2 as le}from"./index.
|
1
|
+
import{bs as Z,bt as J,r as f,bu as Q,z as Y,bv as s,j as S,C as ee,bo as te,bw as re,bp as ne,b5 as oe,bx as ie,bq as ae,bm as ue,b0 as C,a$ as W,b2 as le}from"./index.BgEbLy94.js";import{a as ce}from"./useBasicWidgetState.B1oropKY.js";import"./FormClearHelper.C_BjP_35.js";var se={secondary:"secondary"},G={default:"default"},fe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=Z("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}function M(){return M=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},M.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t){return he(e)||me(e,t)||be(e,t)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function be(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function me(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,p;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,p=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw p}}return n}}function he(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(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 Se(e,t,r){return t&&ve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oe(e,t){if(typeof t!="function"&&t!==null)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&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(e,t)}function Ee(e){var t=we();return function(){var n=I(e),o;if(t){var i=I(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return _e(this,o)}}function _e(e,t){if(t&&(j(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K(e)}function K(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function we(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Le(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var F=function(e){Oe(r,e);var t=Ee(r);function r(){var n;ge(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),N(K(n),"childRefs",{}),n}return Se(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,p=a===void 0?{}:a,c=i.mode,P=c===void 0?k.checkbox:c,d=i.children,y=i.selected,m=i.disabled,l=i.onClick,_=i.kind,h=i.shape,w=i.size,T=J(p.Root,z),O=de(T,2),E=O[0],L=O[1],H=this.props["aria-label"]||this.props.ariaLabel,g=P===k.radio,V=f.Children.count(d);return f.createElement(Q.Consumer,null,function(q){return f.createElement(E,M({"aria-label":H||q.buttongroup.ariaLabel,"data-baseweb":"button-group",role:g?"radiogroup":"group",$shape:h,$length:d.length},L),f.Children.map(d,function(b,R){if(!f.isValidElement(b))return null;var A=b.props.isSelected?b.props.isSelected:Le(y,R);return g&&(o.childRefs[R]=f.createRef()),f.cloneElement(b,{disabled:m||b.props.disabled,isSelected:A,ref:g?o.childRefs[R]:void 0,tabIndex:!g||A||g&&(!y||y===-1)&&R===0?0:-1,onKeyDown:function(u){if(g){var v=Number(y)?Number(y):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var B=v-1<0?V-1:v-1;l&&l(u,B),o.childRefs[B].current&&o.childRefs[B].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var D=v+1>V-1?0:v+1;l&&l(u,D),o.childRefs[D].current&&o.childRefs[D].current.focus()}}},kind:_,onClick:function(u){m||(b.props.onClick&&b.props.onClick(u),l&&l(u,R))},shape:h,size:w,overrides:pe({BaseButton:{style:function(u){var v=u.$theme;return d.length===1?{}:h!==G.default?{marginLeft:v.sizing.scale100,marginRight:v.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":A,role:g?"radio":"checkbox"}}},b.props.overrides)})}))})}}]),r}(f.Component);N(F,"defaultProps",{disabled:!1,onClick:function(){},shape:G.default,size:fe.default,kind:se.secondary});function Re(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Ce(e,t,r){return e==s.ClickMode.MULTI_SELECT?Re(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function Pe(e){return e.length===0?-1:e[0]}function ke(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ie(e,t,r){const n=r===s.Style.PILLS?C.PILLS:r===s.Style.BORDERLESS?C.BORDERLESS_ICON:C.SEGMENTED_CONTROL,o=r===s.Style.BORDERLESS?W.XSMALL:W.MEDIUM,i=n===C.PILLS||n===C.SEGMENTED_CONTROL,a=r===s.Style.BORDERLESS?"lg":"base";return{element:S(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Te(e,t,r,n){return r.indexOf(n)>-1?!0:t!==s.ClickMode.SINGLE_SELECT||e!==s.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function Ae(e,t){return e&&(t=`${t}Active`),t}function Be(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case s.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case s.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case s.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}function De(e,t,r,n,o,i){const a=Te(r,n,o,t);let p=e.content,c=e.contentIcon;return a&&(p=e.selectedContent?e.selectedContent:p,c=e.selectedContentIcon?e.selectedContentIcon:c),f.forwardRef(function(d,y){const{element:m,kind:l,size:_}=Ie(p??"",c??void 0,i),h=Ae(!!(a&&!e.selectedContent&&!e.selectedContentIcon),l);return S(ue,{...d,size:_,kind:h,children:m})})}function je(e,t){return e.getIntArrayValue(t)}function Me(e){return e.default??null}function $e(e){return e.value??null}function Ge(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:i,options:a,selectionVisualization:p,style:c,label:P,labelVisibility:d,help:y}=r,m=Y(),[l,_]=ce({getStateFromWidgetMgr:je,getDefaultStateFromProto:Me,getCurrStateFromProto:$e,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),h=(O,E)=>{const L=Ce(i,E,l);_({value:L,fromUi:!0})};let w;i===s.ClickMode.SINGLE_SELECT?w=k.radio:i===s.ClickMode.MULTI_SELECT&&(w=k.checkbox);const T=f.useMemo(()=>a.map((O,E)=>{const L=De(O,E,p,i,l,c);return S(L,{},`${O.content}-${E}`)}),[i,a,p,c,l]);return ee("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[S(ae,{label:P,disabled:t,labelVisibility:te((d==null?void 0:d.value)??ie.LabelVisibilityOptions.COLLAPSED),children:y&&S(re,{children:S(ne,{content:y,placement:oe.TOP})})}),S(F,{disabled:t,mode:w,onClick:h,selected:i===s.ClickMode.MULTI_SELECT?l:Pe(l),overrides:{Root:{style:f.useCallback(()=>Be(c,m.spacing),[c,m.spacing])}},children:T})]})}const Ue=f.memo(Ge);export{Ue as default};
|