@triptease/tt-navbar 0.0.4 → 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.
package/dist/web/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.4
2
+ * @triptease/tt-navbar v0.0.5
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -591,30 +591,133 @@ function n4(t3) {
591
591
  }
592
592
 
593
593
  // src/styles.ts
594
- var styles = i``;
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
+ `;
595
613
 
596
614
  // src/TtNavbar.ts
597
615
  var TtNavbar = class extends i4 {
598
616
  constructor() {
599
617
  super(...arguments);
600
- this.onNavigate = () => {
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
+ }
601
628
  };
602
629
  }
603
630
  render() {
604
631
  return x`
605
632
  <nav id=${this.id}>
606
- <a href="/">Dashboard</a>
607
- <a href="/campaigns">Campaigns</a>
608
- <a href="/channels">Channels</a>
609
- <a href="/guest-insights/zxd47KQGAP">Guest insights</a>
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>
610
707
  </nav>
611
708
  `;
612
709
  }
613
710
  };
614
711
  TtNavbar.styles = styles;
615
712
  __decorateClass([
616
- n4()
617
- ], TtNavbar.prototype, "onNavigate", 2);
713
+ n4({ type: Function })
714
+ ], TtNavbar.prototype, "navigate", 2);
715
+ __decorateClass([
716
+ n4({ type: String })
717
+ ], TtNavbar.prototype, "baseUrl", 2);
718
+ __decorateClass([
719
+ n4({ type: String })
720
+ ], TtNavbar.prototype, "clientKey", 2);
618
721
  export {
619
722
  TtNavbar
620
723
  };