render() {
    if (!this.template) {
      return this;
    }

    const templateHTML = this.template();
    if (!templateHTML) {
      return this;
    }

    // Make template and shadow objects
    const template = document.createElement('template');
    if (this.shadowRoot?.innerHTML) {
      for (const el of this.shadowRoot.children) {
        if (el.nodeName !== 'STYLE') {
          el.remove();
        }
      }
    }

    if (!this.shadowRoot) {
      this.attachShadow({ mode: 'open' });
    }

    this.appendStyles();
    template.innerHTML = templateHTML;
    this.shadowRoot?.appendChild(template.content.cloneNode(true));

    this.container = this.shadowRoot?.querySelector(`.${this.name}`);
    if (this.shadowRoot?.firstElementChild.nodeName === 'STYLE' && !this.container) {
      this.container = this.shadowRoot?.firstElementChild.nextElementSibling;
    }

    if (this.shadowRoot?.firstElementChild.nodeName !== 'STYLE' && !this.container) {
      this.container = this.shadowRoot?.firstElementChild;
    }

    // Runs on next next paint to be sure rendered() fully
    if (this.rendered) {
      renderLoop.register(new IdsRenderLoopItem({
        duration: 1,
        timeoutCallback: () => {
          this.rendered();
        }
      }));
    }

    // Add automation Ids
    if (this.appendIds) {
      this.addInternalIds();
    }
    return this;
  }
/**
   * Render the component using the defined template.
   * @returns {object} The object for chaining.
   */
Render the component using the defined template.
@returns {object} The object for chaining.
Render the component using the defined template . @returns { object } The object for chaining .
render() {
    if (!this.template) {
      return this;
    }
    const templateHTML = this.template();
    if (!templateHTML) {
      return this;
    }
    const template = document.createElement('template');
    if (this.shadowRoot?.innerHTML) {
      for (const el of this.shadowRoot.children) {
        if (el.nodeName !== 'STYLE') {
          el.remove();
        }
      }
    }
    if (!this.shadowRoot) {
      this.attachShadow({ mode: 'open' });
    }
    this.appendStyles();
    template.innerHTML = templateHTML;
    this.shadowRoot?.appendChild(template.content.cloneNode(true));
    this.container = this.shadowRoot?.querySelector(`.${this.name}`);
    if (this.shadowRoot?.firstElementChild.nodeName === 'STYLE' && !this.container) {
      this.container = this.shadowRoot?.firstElementChild.nextElementSibling;
    }
    if (this.shadowRoot?.firstElementChild.nodeName !== 'STYLE' && !this.container) {
      this.container = this.shadowRoot?.firstElementChild;
    }
    if (this.rendered) {
      renderLoop.register(new IdsRenderLoopItem({
        duration: 1,
        timeoutCallback: () => {
          this.rendered();
        }
      }));
    }
    if (this.appendIds) {
      this.addInternalIds();
    }
    return this;
  }
render ( ) { if ( ! this . template ) { return this ; } const templateHTML = this . template ( ) ; if ( ! templateHTML ) { return this ; } const template = document . createElement ( 'template' ) ; if ( this . shadowRoot ?. innerHTML ) { for ( const el of this . shadowRoot . children ) { if ( el . nodeName !== 'STYLE' ) { el . remove ( ) ; } } } if ( ! this . shadowRoot ) { this . attachShadow ( { mode : 'open' } ) ; } this . appendStyles ( ) ; template . innerHTML = templateHTML ; this . shadowRoot ?. appendChild ( template . content . cloneNode ( true ) ) ; this . container = this . shadowRoot ?. querySelector ( ` ${ this . name } ` ) ; if ( this . shadowRoot ?. firstElementChild . nodeName === 'STYLE' && ! this . container ) { this . container = this . shadowRoot ?. firstElementChild . nextElementSibling ; } if ( this . shadowRoot ?. firstElementChild . nodeName !== 'STYLE' && ! this . container ) { this . container = this . shadowRoot ?. firstElementChild ; } if ( this . rendered ) { renderLoop . register ( new IdsRenderLoopItem ( { duration : 1 , timeoutCallback : ( ) => { this . rendered ( ) ; } } ) ) ; } if ( this . appendIds ) { this . addInternalIds ( ) ; } return this ; }
Render the component using the defined template.
Render the component using the defined template .
// Make template and shadow objects // Runs on next next paint to be sure rendered() fully // Add automation Ids