L i ddlmZddlmZmZddlmZddlmZddl m Z ddl m Z erddlmZGdd Z d d d Zy )) annotations) TYPE_CHECKINGcast) LayoutConfig)StreamlitAPIException)IFrame)gather_metrics)DeltaGeneratorceZdZed ddd d dZed ddd d dZed dZy) IframeMixin_iframeN) tab_indexct}t||||t||nd||nd}|jj d||S)adLoad a remote URL in an iframe. To use this function, import it from the ``streamlit.components.v1`` module. .. warning:: Using ``st.components.v1.iframe`` directly (instead of importing its module) is deprecated and will be disallowed in a later version. Parameters ---------- src : str The URL of the page to embed. width : int The width of the iframe in CSS pixels. By default, this is the app's default element width. height : int The height of the frame in CSS pixels. By default, this is ``150``. scrolling : bool Whether to allow scrolling in the iframe. If this ``False`` (default), Streamlit crops any content larger than the iframe and does not show a scrollbar. If this is ``True``, Streamlit shows a scrollbar when the content is larger than the iframe. tab_index : int or None Specifies how and if the iframe is sequentially focusable. Users typically use the ``Tab`` key for sequential focus navigation. This can be one of the following values: - ``None`` (default): Uses the browser's default behavior. - ``-1``: Removes the iframe from sequential navigation, but still allows it to be focused programmatically. - ``0``: Includes the iframe in sequential navigation in the order it appears in the document but after all elements with a positive ``tab_index``. - Positive integer: Includes the iframe in sequential navigation. Elements are navigated in ascending order of their positive ``tab_index``. For more information, see the `tabindex `_ documentation on MDN. Example ------- >>> import streamlit.components.v1 as components >>> >>> components.iframe("https://example.com", height=500) )src scrollingrstretchwidthheightiframe layout_config IFrameProtomarshallrdg_enqueue)selfrrrrr iframe_protors _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/elements/iframe.pyr zIframeMixin._iframes^D#}    % ,%)#/6S ww,mTT_htmlct}t||||t||nd||nd}|jj d||S)a% Display an HTML string in an iframe. To use this function, import it from the ``streamlit.components.v1`` module. If you want to insert HTML text into your app without an iframe, try ``st.html`` instead. .. warning:: Using ``st.components.v1.html`` directly (instead of importing its module) is deprecated and will be disallowed in a later version. Parameters ---------- html : str The HTML string to embed in the iframe. width : int The width of the iframe in CSS pixels. By default, this is the app's default element width. height : int The height of the frame in CSS pixels. By default, this is ``150``. scrolling : bool Whether to allow scrolling in the iframe. If this ``False`` (default), Streamlit crops any content larger than the iframe and does not show a scrollbar. If this is ``True``, Streamlit shows a scrollbar when the content is larger than the iframe. tab_index : int or None Specifies how and if the iframe is sequentially focusable. Users typically use the ``Tab`` key for sequential focus navigation. This can be one of the following values: - ``None`` (default): Uses the browser's default behavior. - ``-1``: Removes the iframe from sequential navigation, but still allows it to be focused programmatically. - ``0``: Includes the iframe in sequential navigation in the order it appears in the document but after all elements with a positive ``tab_index``. - Positive integer: Includes the iframe in sequential navigation. Elements are navigated in ascending order of their positive ``tab_index``. For more information, see the `tabindex `_ documentation on MDN. Example ------- >>> import streamlit.components.v1 as components >>> >>> components.html( >>> "

Oops!

" >>> ) )srcdocrrrrrrrr)rhtmlrrrrr rs r!r#zIframeMixin._htmlls^N#}    % ,%)#/6S ww,mTTr"ctd|S)zGet our DeltaGenerator.r )r)rs r!rzIframeMixin.dgs$d++r")NNF) rstrr int | Nonerr)rboolrr)returnr ) r&r(rr)rr)rr*rr)r+r )r+r )__name__ __module__ __qualname__r r r#propertyrr"r!r r s I!! LU!%LU LULU LU  LULU LULU\G!! QU!%QUQUQU QU  QUQU QUQUf,,r"r Nc|||_|||_||_|8t|trt|t s|dk\s t d||_yy)aMarshalls data into an IFrame proto. These parameters correspond directly to