CodeMeltedDEV
    Preparing search index...

    Class CTextToSpeechButton

    <cm-share-button> Subcomponent Documentation

    A specialized instance of <cm-button> that completely locks down the text ("Print") and icon (🖨️) so they cannot be overwritten.

    USAGE

    Content passed between the tags is ignored to preserve structural intent:

    <cm-print-button></cm-print-button>
    <cm-print-button icon-only></cm-print-button>

    THEMING (SAME EXPOSED CSS VARIABLES)

    This component accepts the exact same styling variables as <cm-button>: --padding, --gap, --border-radius, --border, --font-size, --font-weight, --bg-color, --hover-bg-color, --color, --hover-color

    Example:

    cm-print-button {
    --border: none;
    }
    Note

    Even though this extends CButton, you need to manage styles on specific tag name as shown above.

    SELF-MANAGED AVAILABILITY

    Upon entering the DOM, this component automatically determines if print is available. If the internal verification fails, the button quietly applies "display: none" to itself internally logging a warning to the console.

    Hierarchy (View Summary)

    Index
    title: string
    • get observedAttributes(): string[]

      Returns string[]

    • Called each time the element is moved to a new document.

      Returns void

    • Called when attributes are changed, added, removed, or replaced.

      Parameters

      • name: string

        The name of a observedAttributes allowing access into the internals of the custom component.

      • old_value: string

        The original value held by the attribute.

      • new_value: string

        The new value to apply.

      Returns void

    • Called each time the element is added to the document. The specification recommends that, as far as possible, developers should implement custom element setup in this callback rather than the constructor.

      Returns void

    • When defined, this is called instead of connectedCallback() and disconnectedCallback() each time the element is moved to a different place in the DOM via Element.moveBefore(). Use this to avoid running initialization/cleanup code in the connectedCallback() and disconnectedCallback() callbacks when the element is not actually being added to or removed from the DOM. See Lifecycle callbacks and state-preserving moves for more details.

      Returns void

    • Called each time the element is removed from the document.

      Returns void

    • The get_attribute() method of the Element interface returns the string value of the specified attribute of the specified element. It returns null if the element doesn't have an attribute with the given name.

      Parameters

      • name: string

        A string specifying the name of the attribute. When called on an HTML element in a DOM flagged as an HTML document, the name is normalized to lowercase.

      Returns string | null

      A string containing the attribute's value, or null if the element doesn't have an attribute with the given name.

    • Parameters

      • name: string

      Returns boolean

    • Forces a refresh of the component.

      Returns void

    • The set_attribute() method of the Element interface sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value.

      Parameters

      • name: string

        A string containing the qualified name of the attribute whose value is to be set. The attribute name is automatically converted to all lower-case when set_attribute() is called on an HTML element in an HTML document.

      • value: string

        A trusted type or string containing the value to assign to the attribute.

      Returns void

    • Utility function to register a custom component if it has not already been defined.

      Parameters

      • name: string

        The name of the component.

      • element_def: any

        The constructor definition.

      Returns void