streamlit-nightly 1.45.1.dev20250502__py3-none-any.whl → 1.45.1.dev20250504__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/camera_input.py +20 -0
- streamlit/elements/widgets/file_uploader.py +23 -0
- streamlit/elements/widgets/number_input.py +23 -5
- streamlit/elements/widgets/selectbox.py +25 -0
- streamlit/elements/widgets/text_widgets.py +38 -0
- streamlit/proto/CameraInput_pb2.py +4 -3
- streamlit/proto/CameraInput_pb2.pyi +8 -2
- streamlit/proto/FileUploader_pb2.py +4 -3
- streamlit/proto/FileUploader_pb2.pyi +8 -2
- streamlit/proto/NumberInput_pb2.py +6 -5
- streamlit/proto/NumberInput_pb2.pyi +9 -2
- streamlit/proto/Selectbox_pb2.py +4 -3
- streamlit/proto/Selectbox_pb2.pyi +9 -2
- streamlit/proto/TextArea_pb2.py +4 -3
- streamlit/proto/TextArea_pb2.pyi +9 -2
- streamlit/proto/TextInput_pb2.py +6 -5
- streamlit/proto/TextInput_pb2.pyi +9 -2
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.Cyo2PQmw.js → ErrorOutline.esm.Bp4VdNOc.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.BzWzjfn-.js → FileDownload.esm.hVzDDDNS.js} +1 -1
- streamlit/static/static/js/{FileHelper.Bq0bHIQU.js → FileHelper.BGcyDQ_S.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.ChH2zw9r.js → FormClearHelper.a0IiSXcn.js} +1 -1
- streamlit/static/static/js/{Hooks.BX4S_9SH.js → Hooks.C2dZkryw.js} +1 -1
- streamlit/static/static/js/{InputInstructions.gIgCn0KU.js → InputInstructions.Cn0WICoN.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CfPAxQrK.js → ProgressBar.VRmRPHtW.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.2PFuDBNw.js → RenderInPortalIfExists.CZa97lrw.js} +1 -1
- streamlit/static/static/js/{Toolbar.Buf9GIBa.js → Toolbar.DJZBBDvl.js} +1 -1
- streamlit/static/static/js/{base-input.Bm9shgk4.js → base-input.CzerGAEH.js} +1 -1
- streamlit/static/static/js/{checkbox.a7k2DcAP.js → checkbox.C6Sj4eVw.js} +1 -1
- streamlit/static/static/js/{createSuper.DCriRkdS.js → createSuper.C7yhRETi.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DILbTvay.js → data-grid-overlay-editor.DAgcbVks.js} +1 -1
- streamlit/static/static/js/{downloader.HVIUsQvS.js → downloader.B8HL-u_1.js} +1 -1
- streamlit/static/static/js/{es6.20UTkPH7.js → es6.BxAW_jrO.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DysIhKUL.js → iframeResizer.contentWindow.CS8fz-W7.js} +1 -1
- streamlit/static/static/js/{index.D_JOW5L_.js → index.6jptdEp6.js} +1 -1
- streamlit/static/static/js/{index.hPo8pssx.js → index.A_t8lw--.js} +1 -1
- streamlit/static/static/js/{index.B3bE5uB1.js → index.B2tTSlE1.js} +1 -1
- streamlit/static/static/js/{index.DYEXGytC.js → index.B7UKH_JX.js} +1 -1
- streamlit/static/static/js/{index.CSU4ypQb.js → index.BBClg-gm.js} +1 -1
- streamlit/static/static/js/{index.C-XV9rWR.js → index.BDzCUpOG.js} +1 -1
- streamlit/static/static/js/{index.MS-4hkiz.js → index.BRtyx04t.js} +1 -1
- streamlit/static/static/js/{index.Cx1FqRGB.js → index.BwlA1Cf_.js} +1 -1
- streamlit/static/static/js/{index.B60sXnAm.js → index.BwnckS8e.js} +1 -1
- streamlit/static/static/js/{index.DZYKdc2u.js → index.C4KrRG3c.js} +1 -1
- streamlit/static/static/js/{index.D0zXTb0m.js → index.C7t1-CQQ.js} +1 -1
- streamlit/static/static/js/{index.CcMkhkWk.js → index.CG2pASlR.js} +1 -1
- streamlit/static/static/js/{index.Cbix_1J1.js → index.CGzwdjEF.js} +1 -1
- streamlit/static/static/js/{index.DyoIc8Zs.js → index.CHL4u91M.js} +1 -1
- streamlit/static/static/js/{index.aNlXA-L0.js → index.CLFopaXS.js} +1 -1
- streamlit/static/static/js/{index._MzojgSv.js → index.CSAdYIt3.js} +1 -1
- streamlit/static/static/js/{index.Co9rIAmf.js → index.CSPC2m_c.js} +1 -1
- streamlit/static/static/js/{index.wrZNg1iJ.js → index.CgzjjllY.js} +1 -1
- streamlit/static/static/js/{index.Cufx1YWe.js → index.ChOkUAuD.js} +1 -1
- streamlit/static/static/js/{index.CQxpOqNH.js → index.Cr1JUXmf.js} +1 -1
- streamlit/static/static/js/{index.Dh2hRWUh.js → index.Cxp7siQJ.js} +5 -5
- streamlit/static/static/js/{index.nfYF_n-U.js → index.D6KElXAI.js} +1 -1
- streamlit/static/static/js/{index.BcjACxDW.js → index.DDCep3pE.js} +1 -1
- streamlit/static/static/js/{index.BGeguImE.js → index.DG9Swsby.js} +1 -1
- streamlit/static/static/js/{index.FrboqWsl.js → index.DIZcktIN.js} +1 -1
- streamlit/static/static/js/{index.BoUSwThS.js → index.DR2lTx8N.js} +34 -34
- streamlit/static/static/js/{index.CWQZ6fj2.js → index.DWb5kgxt.js} +1 -1
- streamlit/static/static/js/{index.DuuM3erk.js → index.D_0HKLRm.js} +1 -1
- streamlit/static/static/js/{index.PpH65WhH.js → index.DgOrPDFa.js} +1 -1
- streamlit/static/static/js/{index.C8opbOI3.js → index.Dt0FtS-M.js} +1 -1
- streamlit/static/static/js/{index.DTDSrcrv.js → index.DtY8dAVN.js} +1 -1
- streamlit/static/static/js/{index.DtUymdq4.js → index.QdRaJV_a.js} +1 -1
- streamlit/static/static/js/{index.Casjy0w3.js → index.aBgCjIEX.js} +1 -1
- streamlit/static/static/js/{index.BFBmymos.js → index.o12m2E2P.js} +1 -1
- streamlit/static/static/js/{index.C9zP89H9.js → index.qMnAjj-G.js} +1 -1
- streamlit/static/static/js/{index.MnEfEagX.js → index.uOOdkOMl.js} +1 -1
- streamlit/static/static/js/{index.D4a4MQfL.js → index.vdE-PayY.js} +1 -1
- streamlit/static/static/js/{input.Cb_tvJ_5.js → input.qNZgmgfK.js} +1 -1
- streamlit/static/static/js/{memory.gWLPmyVz.js → memory.DifcSUze.js} +1 -1
- streamlit/static/static/js/{mergeWith.DyYsO7xJ.js → mergeWith.Bykfc0n-.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.atsI6tTt.js → number-overlay-editor.D_L9PQiU.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.k2Tjz93L.js → possibleConstructorReturn.Cyeph4pU.js} +1 -1
- streamlit/static/static/js/{sandbox.DZ5kjuSJ.js → sandbox.DT6zcSKI.js} +1 -1
- streamlit/static/static/js/{textarea.Bd_m3MJ1.js → textarea.C46FrViu.js} +1 -1
- streamlit/static/static/js/{timepicker.CrYAvpIP.js → timepicker.N6lFakQJ.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DTRRsITN.js → toConsumableArray.DwaNiLbv.js} +1 -1
- streamlit/static/static/js/{uniqueId.Cp20OGew.js → uniqueId.bNZuA9Mz.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.CkEGHpKC.js → useBasicWidgetState.qUuCVRZV.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.Dnb1JE6q.js → useOnInputChange.CylEhpc7.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.C60s7JiX.js → withFullScreenWrapper.BQay_j7X.js} +1 -1
- {streamlit_nightly-1.45.1.dev20250502.dist-info → streamlit_nightly-1.45.1.dev20250504.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.45.1.dev20250502.dist-info → streamlit_nightly-1.45.1.dev20250504.dist-info}/RECORD +90 -90
- {streamlit_nightly-1.45.1.dev20250502.dist-info → streamlit_nightly-1.45.1.dev20250504.dist-info}/WHEEL +1 -1
- {streamlit_nightly-1.45.1.dev20250502.data → streamlit_nightly-1.45.1.dev20250504.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.45.1.dev20250502.dist-info → streamlit_nightly-1.45.1.dev20250504.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.45.1.dev20250502.dist-info → streamlit_nightly-1.45.1.dev20250504.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{n as s,r as f,R as u,aE as b,ba as x,z as k,j as a,b7 as C,bb as L,C as v,D as T,aC as h}from"./index.
|
1
|
+
import{n as s,r as f,R as u,aE as b,ba as x,z as k,j as a,b7 as C,bb as L,C as v,D as T,aC as h}from"./index.DR2lTx8N.js";const w=s("div",{target:"e12r95n60"})(({containerWidth:r})=>({display:"flex",flexDirection:"column",width:r?"100%":"fit-content"})),S=s("a",{target:"e12r95n61"})(({disabled:r,isCurrentPage:o,containerWidth:l,theme:e})=>({textDecoration:"none",width:l?"100%":"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),y=s("span",{target:"e12r95n62"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function P(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function D(r){const{onPageChange:o,currentPageScriptHash:l}=u.useContext(b),e=u.useContext(x),{colors:c}=k(),{disabled:t,element:n}=r,i=P(n.useContainerWidth,e),d=l===n.pageScriptHash,p=g=>{n.external?t&&g.preventDefault():(g.preventDefault(),t||o(n.pageScriptHash))};return a("div",{className:"stPageLink","data-testid":"stPageLink",children:a(C,{help:n.help,placement:L.TOP_RIGHT,containerWidth:i,children:a(w,{containerWidth:i,children:v(S,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:d,containerWidth:i,href:n.page,target:n.external?"_blank":"",rel:"noreferrer",onClick:p,children:[n.icon&&a(T,{size:"lg",color:t?c.fadedText40:c.bodyText,iconValue:n.icon}),a(y,{disabled:t,children:a(h,{source:n.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}const H=f.memo(D);export{H as default};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{bw as Z,bx as J,r as f,by as Q,z as Y,bz as s,j as v,C as ee,bs as te,bA as re,bt as ne,bb as oe,bB as ie,bu as ae,bq as ue,b6 as C,b5 as W,b8 as le}from"./index.
|
1
|
+
import{bw as Z,bx as J,r as f,by as Q,z as Y,bz as s,j as v,C as ee,bs as te,bA as re,bt as ne,bb as oe,bB as ie,bu as ae,bq as ue,b6 as C,b5 as W,b8 as le}from"./index.DR2lTx8N.js";import{a as ce}from"./useBasicWidgetState.qUuCVRZV.js";import"./FormClearHelper.a0IiSXcn.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 me(e)||he(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 he(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 me(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 Se(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 ve(e,t,r){return t&&Se(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=A(e),o;if(t){var i=A(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 A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},A(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 ve(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,h=i.disabled,l=i.onClick,_=i.kind,m=i.shape,w=i.size,B=J(p.Root,z),O=de(B,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:m,$length:d.length},L),f.Children.map(d,function(b,R){if(!f.isValidElement(b))return null;var I=b.props.isSelected?b.props.isSelected:Le(y,R);return g&&(o.childRefs[R]=f.createRef()),f.cloneElement(b,{disabled:h||b.props.disabled,isSelected:I,ref:g?o.childRefs[R]:void 0,tabIndex:!g||I||g&&(!y||y===-1)&&R===0?0:-1,onKeyDown:function(u){if(g){var S=Number(y)?Number(y):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var T=S-1<0?V-1:S-1;l&&l(u,T),o.childRefs[T].current&&o.childRefs[T].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var D=S+1>V-1?0:S+1;l&&l(u,D),o.childRefs[D].current&&o.childRefs[D].current.focus()}}},kind:_,onClick:function(u){h||(b.props.onClick&&b.props.onClick(u),l&&l(u,R))},shape:m,size:w,overrides:pe({BaseButton:{style:function(u){var S=u.$theme;return d.length===1?{}:m!==G.default?{marginLeft:S.sizing.scale100,marginRight:S.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":I,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 Ae(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:v(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Be(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 Ie(e,t){return e&&(t=`${t}Active`),t}function Te(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=Be(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:h,kind:l,size:_}=Ae(p??"",c??void 0,i),m=Ie(!!(a&&!e.selectedContent&&!e.selectedContentIcon),l);return v(ue,{...d,size:_,kind:m,children:h})})}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,h=Y(),[l,_]=ce({getStateFromWidgetMgr:je,getDefaultStateFromProto:Me,getCurrStateFromProto:$e,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),m=(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 B=f.useMemo(()=>a.map((O,E)=>{const L=De(O,E,p,i,l,c);return v(L,{},`${O.content}-${E}`)}),[i,a,p,c,l]);return ee("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[v(ae,{label:P,disabled:t,labelVisibility:te((d==null?void 0:d.value)??ie.LabelVisibilityOptions.COLLAPSED),children:y&&v(re,{children:v(ne,{content:y,placement:oe.TOP})})}),v(F,{disabled:t,mode:w,onClick:m,selected:i===s.ClickMode.MULTI_SELECT?l:Pe(l),overrides:{Root:{style:f.useCallback(()=>Te(c,h.spacing),[c,h.spacing])}},children:B})]})}const Ue=f.memo(Ge);export{Ue as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as l,M as u,j as d,bs as x,c8 as V}from"./index.
|
1
|
+
import{r as l,M as u,j as d,bs as x,c8 as V}from"./index.DR2lTx8N.js";import{a as h}from"./useBasicWidgetState.qUuCVRZV.js";import"./FormClearHelper.a0IiSXcn.js";const U=(t,o)=>t.getStringValue(o),v=t=>t.options.length===0||u(t.default)?null:t.options[t.default],C=t=>t.rawValue??null,F=(t,o,e,a)=>{o.setStringValue(t,e.value,{fromUi:e.fromUi},a)},M=({disabled:t,element:o,widgetMgr:e,fragmentId:a})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:g,acceptNewOptions:p}=o,[f,s]=h({getStateFromWidgetMgr:U,getDefaultStateFromProto:v,getCurrStateFromProto:C,updateWidgetMgrState:F,element:o,widgetMgr:e,fragmentId:a}),m=l.useCallback(b=>{s({value:b,fromUi:!0})},[s]),S=u(o.default)&&!t;return d(V,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,onChange:m,value:f,help:c,placeholder:g,clearable:S,acceptNewOptions:p})},w=l.memo(M);export{w as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as f,z as T,B as C,j as n,C as y,bs as L,aC as S,bA as W,bt as B,bb as w,bK as R,J as $,bL as E,bM as P}from"./index.
|
1
|
+
import{r as f,z as T,B as C,j as n,C as y,bs as L,aC as S,bA as W,bt as B,bb as w,bK as R,J as $,bL as E,bM as P}from"./index.DR2lTx8N.js";import{a as v}from"./useBasicWidgetState.qUuCVRZV.js";import{a as M,L as X,S as p}from"./checkbox.C6Sj4eVw.js";import"./FormClearHelper.a0IiSXcn.js";function H({element:e,disabled:a,widgetMgr:s,fragmentId:d}){var m;const[x,g]=v({getStateFromWidgetMgr:V,getDefaultStateFromProto:I,getCurrStateFromProto:j,updateWidgetMgrState:z,element:e,widgetMgr:s,fragmentId:d}),k=f.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=T(),{colors:o,spacing:h,sizes:r}=t,b=C(t),u=a?o.fadedText40:o.bodyText;return n(P,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(M,{checked:x,disabled:a,onChange:k,"aria-label":e.label,checkmarkType:e.type===E.StyleType.TOGGLE?p.toggle:p.default,labelPlacement:X.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=b?o.bgColor:o.bodyText;return a&&(c=b?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${t.spacing.twoXS})`,height:`calc(${r.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=o.fadedText40;return c&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?`0 0 0 0.2rem ${$(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:u}}},children:y(R,{visibility:L((m=e.labelVisibility)==null?void 0:m.value),"data-testid":"stWidgetLabel",children:[n(S,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&n(W,{color:u,children:n(B,{content:e.help,placement:w.TOP_RIGHT})})]})})})}function V(e,a){return e.getBoolValue(a)}function I(e){return e.default??null}function j(e){return e.value??null}function z(e,a,s,d){a.setBoolValue(e,s.value,{fromUi:s.fromUi},d)}const _=f.memo(H);export{_ as default};
|