@triptease/tt-navbar 0.0.2 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.2
2
+ * @triptease/tt-navbar v0.0.5
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -590,36 +590,134 @@ function n4(t3) {
590
590
  })(t3, e5, o6);
591
591
  }
592
592
 
593
+ // src/styles.ts
594
+ var styles = i`
595
+ nav {
596
+ max-width: 260px;
597
+ display: flex;
598
+ flex-direction: column;
599
+ }
600
+
601
+ nav details div {
602
+ display: flex;
603
+ flex-direction: column;
604
+ }
605
+
606
+ hr {
607
+ background: black;
608
+ width: 100%;
609
+ height: 1px;
610
+ border: none;
611
+ }
612
+ `;
613
+
593
614
  // src/TtNavbar.ts
594
615
  var TtNavbar = class extends i4 {
595
616
  constructor() {
596
617
  super(...arguments);
597
- this.header = "Hey there";
598
- this.counter = 5;
599
- }
600
- __increment() {
601
- this.counter += 1;
618
+ this.buildUrl = (path) => {
619
+ if (!this.clientKey) throw new Error("clientKey is required");
620
+ const formattedPath = path.replace("$CLIENT_KEY", this.clientKey);
621
+ if (!this.baseUrl) return formattedPath;
622
+ return new URL(formattedPath, this.baseUrl).toString();
623
+ };
624
+ this.onAnchorClick = (e5) => {
625
+ if (this.navigate) {
626
+ this.navigate(e5);
627
+ }
628
+ };
602
629
  }
603
630
  render() {
604
631
  return x`
605
- <h2>${this.header} Nr. ${this.counter}!</h2>
606
- <button @click=${this.__increment}>increment</button>
632
+ <nav id=${this.id}>
633
+ <a href=${this.buildUrl("/")} @click=${this.onAnchorClick}>Dashboard</a>
634
+ <a href="https://app.campaign-manager.triptease.io">Campaigns</a>
635
+ <a href=${this.buildUrl("/channels")} @click=${this.onAnchorClick}
636
+ >Channels</a
637
+ >
638
+ <details>
639
+ <summary>Market Insights</summary>
640
+ <div>
641
+ <a
642
+ href=${this.buildUrl("/parity/$CLIENT_KEY")}
643
+ @click=${this.onAnchorClick}
644
+ >Parity</a
645
+ >
646
+ <a
647
+ href=${this.buildUrl("/guest-insights/$CLIENT_KEY")}
648
+ @click=${this.onAnchorClick}
649
+ >Guest insights</a
650
+ >
651
+ </div>
652
+ </details>
653
+ <details>
654
+ <summary>Settings</summary>
655
+ <div>
656
+ <a
657
+ href=${this.buildUrl("/$CLIENT_KEY/guest-behavioural-data")}
658
+ @click=${this.onAnchorClick}
659
+ >Email setup</a
660
+ >
661
+ <a
662
+ href=${this.buildUrl("/$CLIENT_KEY/crm-config")}
663
+ @click=${this.onAnchorClick}
664
+ >CRM connectivity</a
665
+ >
666
+ <a
667
+ href=${this.buildUrl("/settings/group")}
668
+ @click=${this.onAnchorClick}
669
+ >Group settings</a
670
+ >
671
+ <a
672
+ href=${this.buildUrl("/settings/$CLIENT_KEY/hotels/")}
673
+ @click=${this.onAnchorClick}
674
+ >Property settings</a
675
+ >
676
+ </div>
677
+ </details>
678
+ <hr />
679
+ <details>
680
+ <summary>Account</summary>
681
+ <div>
682
+ <a href=${this.buildUrl("/account")} @click=${this.onAnchorClick}
683
+ >User settings</a
684
+ >
685
+ <a
686
+ href=${this.buildUrl("/account/team/$CLIENT_KEY")}
687
+ @click=${this.onAnchorClick}
688
+ >Team and permissions</a
689
+ >
690
+ </div>
691
+ </details>
692
+ <details>
693
+ <summary>Billing</summary>
694
+ <div>
695
+ <a
696
+ href=${this.buildUrl("/account/billing-management/$CLIENT_KEY")}
697
+ @click=${this.onAnchorClick}
698
+ >Booking reconciliation</a
699
+ >
700
+ <a
701
+ href=${this.buildUrl("/subscriptions/$CLIENT_KEY")}
702
+ @click=${this.onAnchorClick}
703
+ >Subscriptions</a
704
+ >
705
+ </div>
706
+ </details>
707
+ </nav>
607
708
  `;
608
709
  }
609
710
  };
610
- TtNavbar.styles = i`
611
- :host {
612
- display: block;
613
- padding: 25px;
614
- color: var(--tt-navbar-text-color, #000);
615
- }
616
- `;
711
+ TtNavbar.styles = styles;
712
+ __decorateClass([
713
+ n4({ type: Function })
714
+ ], TtNavbar.prototype, "navigate", 2);
617
715
  __decorateClass([
618
716
  n4({ type: String })
619
- ], TtNavbar.prototype, "header", 2);
717
+ ], TtNavbar.prototype, "baseUrl", 2);
620
718
  __decorateClass([
621
- n4({ type: Number })
622
- ], TtNavbar.prototype, "counter", 2);
719
+ n4({ type: String })
720
+ ], TtNavbar.prototype, "clientKey", 2);
623
721
 
624
722
  // src/tt-navbar.ts
625
723
  window.customElements.define("tt-navbar", TtNavbar);