menu-wc.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 'use strict';
  2. customElements.define('compodoc-menu', class extends HTMLElement {
  3. constructor() {
  4. super();
  5. this.isNormalMode = this.getAttribute('mode') === 'normal';
  6. }
  7. connectedCallback() {
  8. this.render(this.isNormalMode);
  9. }
  10. render(isNormalMode) {
  11. let tp = lithtml.html(`
  12. <nav>
  13. <ul class="list">
  14. <li class="title">
  15. <a href="index.html" data-type="index-link">Application documentation</a>
  16. </li>
  17. <li class="divider"></li>
  18. ${ isNormalMode ? `<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div>` : '' }
  19. <li class="chapter">
  20. <a data-type="chapter-link" href="index.html"><span class="icon ion-ios-home"></span>Getting started</a>
  21. <ul class="links">
  22. <li class="link">
  23. <a href="index.html" data-type="chapter-link">
  24. <span class="icon ion-ios-keypad"></span>Overview
  25. </a>
  26. </li>
  27. </ul>
  28. </li>
  29. <li class="chapter">
  30. <a data-type="chapter-link" href="coverage.html"><span class="icon ion-ios-stats"></span>Documentation coverage</a>
  31. </li>
  32. <li class="divider"></li>
  33. <li class="copyright">
  34. Documentation generated using <a href="https://compodoc.app/" target="_blank" rel="noopener noreferrer">
  35. <img data-src="images/compodoc-vectorise.png" class="img-responsive" data-type="compodoc-logo">
  36. </a>
  37. </li>
  38. </ul>
  39. </nav>
  40. `);
  41. this.innerHTML = tp.strings;
  42. }
  43. });