build(element) {
    element = element || this.element;
    this.empty(element);
    this.setContent(element, this.render());
    return this.attach(element);
  }
Performs a complete build of a component, which empties, renders, sets the content in the DOM, and then finally attaches events.
@param {HTMLElement} element - The element to attach this component to.
@returns {Promise<void>} - A promise that resolves when the component has been built.