@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.132 → 2.0.0-next.133

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.
@@ -118263,21 +118263,8 @@ let ObcUserMenu = class extends i$4 {
118263
118263
  this.recentUsers = [];
118264
118264
  this.signedInActions = [];
118265
118265
  }
118266
- get defaultSignedInActions() {
118267
- return [
118268
- { id: "calendar", label: msg("Calendar") },
118269
- { id: "log", label: msg("Log") },
118270
- { id: "preferences", label: msg("Preferences") },
118271
- { id: "user-account", label: msg("User account") }
118272
- ];
118273
- }
118274
- get defaultRecentUsers() {
118275
- const label = msg("Username");
118276
- return [
118277
- { initials: "AB", label },
118278
- { initials: "CD", label },
118279
- { initials: "EF", label }
118280
- ];
118266
+ get showRecentUsers() {
118267
+ return this.hasRecentlySignedIn && this.recentUsers.length > 0;
118281
118268
  }
118282
118269
  renderTextInput(placeholder, type = HTMLInputTypeAttribute.Text, value = "", onInput, errorText = "") {
118283
118270
  const isPassword = type === HTMLInputTypeAttribute.Password;
@@ -118298,7 +118285,7 @@ let ObcUserMenu = class extends i$4 {
118298
118285
  }
118299
118286
  renderUserButtons(count, isLarge) {
118300
118287
  const size = isLarge ? Size.large : Size.regular;
118301
- const users = (this.recentUsers.length ? this.recentUsers : this.defaultRecentUsers).slice(0, count);
118288
+ const users = this.recentUsers.slice(0, count);
118302
118289
  return b`
118303
118290
  <div
118304
118291
  class=${e$1({
@@ -118322,11 +118309,11 @@ let ObcUserMenu = class extends i$4 {
118322
118309
  </div>
118323
118310
  `;
118324
118311
  }
118325
- renderUserProfile(layout, size, initials, label) {
118312
+ renderUserProfile(layout, size) {
118313
+ if (!this.userInitials && !this.userLabel) {
118314
+ return A;
118315
+ }
118326
118316
  const userButtonSize = size === "large" ? Size.large : Size.regular;
118327
- const fallbackUser = this.recentUsers[0] ?? this.defaultRecentUsers[0];
118328
- const resolvedInitials = initials ?? this.userInitials ?? fallbackUser.initials;
118329
- const resolvedLabel = label ?? this.userLabel ?? fallbackUser.label;
118330
118317
  return b`
118331
118318
  <div
118332
118319
  class=${e$1({
@@ -118342,8 +118329,8 @@ let ObcUserMenu = class extends i$4 {
118342
118329
  .variant=${Variant.initials}
118343
118330
  .styleType=${StyleType.normal}
118344
118331
  .size=${userButtonSize}
118345
- .initials=${resolvedInitials}
118346
- .label=${resolvedLabel}
118332
+ .initials=${this.userInitials ?? ""}
118333
+ .label=${this.userLabel ?? ""}
118347
118334
  ></obc-user-button>
118348
118335
  </div>
118349
118336
  `;
@@ -118447,7 +118434,7 @@ let ObcUserMenu = class extends i$4 {
118447
118434
  ${msg("Sign in")}
118448
118435
  </obc-button>
118449
118436
  </div>
118450
- ${this.hasRecentlySignedIn ? b`
118437
+ ${this.showRecentUsers ? b`
118451
118438
  <div class="recent-container">
118452
118439
  <div class="title-container">
118453
118440
  <div class="subtitle">${msg("Recently signed in")}</div>
@@ -118487,8 +118474,8 @@ let ObcUserMenu = class extends i$4 {
118487
118474
  ${msg("Sign in")}
118488
118475
  </obc-button>
118489
118476
  </div>
118490
- <div class="divider" aria-hidden="true"></div>
118491
- ${this.hasRecentlySignedIn ? b`
118477
+ ${this.showRecentUsers ? b`
118478
+ <div class="divider" aria-hidden="true"></div>
118492
118479
  <div class="recent-container recent">
118493
118480
  <div class="title-container">
118494
118481
  <div class="subtitle">${msg("Recent")}</div>
@@ -118526,7 +118513,7 @@ let ObcUserMenu = class extends i$4 {
118526
118513
  </obc-button>
118527
118514
  </div>
118528
118515
  </div>
118529
- ${this.hasRecentlySignedIn ? b`
118516
+ ${this.showRecentUsers ? b`
118530
118517
  <div class="recent-container">
118531
118518
  <div class="title-container">
118532
118519
  <div class="subtitle">${msg("Recently signed in")}</div>
@@ -118562,8 +118549,8 @@ let ObcUserMenu = class extends i$4 {
118562
118549
  ${msg("Sign in")}
118563
118550
  </obc-button>
118564
118551
  </div>
118565
- <div class="divider" aria-hidden="true"></div>
118566
- ${this.hasRecentlySignedIn ? b`
118552
+ ${this.showRecentUsers ? b`
118553
+ <div class="divider" aria-hidden="true"></div>
118567
118554
  <div class="recent-container recent">
118568
118555
  <div class="title-container">
118569
118556
  <div class="subtitle">${msg("Recent")}</div>
@@ -118608,7 +118595,6 @@ let ObcUserMenu = class extends i$4 {
118608
118595
  `;
118609
118596
  }
118610
118597
  renderSignedIn() {
118611
- const actions = this.signedInActions.length ? this.signedInActions : this.defaultSignedInActions;
118612
118598
  return b`
118613
118599
  <div class="title-container">
118614
118600
  <h3 class="title">${msg("User")}</h3>
@@ -118617,24 +118603,26 @@ let ObcUserMenu = class extends i$4 {
118617
118603
  ${this.renderUserProfile("vertical", "large")}
118618
118604
  </div>
118619
118605
  <div class="divider" aria-hidden="true"></div>
118620
- <div class="nav-container">
118621
- ${actions.map((action) => {
118606
+ ${this.signedInActions.length ? b`
118607
+ <div class="nav-container">
118608
+ ${this.signedInActions.map((action) => {
118622
118609
  const normalizedId = this.normalizeActionId(action.id);
118623
118610
  return b`
118624
- <obc-navigation-item
118625
- .label=${action.label}
118626
- hasIcon
118627
- @click=${() => this.handleSignedInActionClick(action)}
118628
- >
118629
- <span slot="icon">
118630
- <slot name="signed-in-action-icon-${normalizedId}">
118631
- ${this.getSignedInActionIcon(normalizedId)}
118632
- </slot>
118633
- </span>
118634
- </obc-navigation-item>
118635
- `;
118611
+ <obc-navigation-item
118612
+ .label=${action.label}
118613
+ hasIcon
118614
+ @click=${() => this.handleSignedInActionClick(action)}
118615
+ >
118616
+ <span slot="icon">
118617
+ <slot name="signed-in-action-icon-${normalizedId}">
118618
+ ${this.getSignedInActionIcon(normalizedId)}
118619
+ </slot>
118620
+ </span>
118621
+ </obc-navigation-item>
118622
+ `;
118636
118623
  })}
118637
- </div>
118624
+ </div>
118625
+ ` : A}
118638
118626
  <div class="button-container">
118639
118627
  <obc-button
118640
118628
  variant=${ButtonVariant.normal}
@@ -118647,8 +118635,9 @@ let ObcUserMenu = class extends i$4 {
118647
118635
  `;
118648
118636
  }
118649
118637
  renderSignedInSmall() {
118650
- const actions = this.signedInActions.length ? this.signedInActions : this.defaultSignedInActions;
118651
- const primaryAction = actions[2];
118638
+ const primaryAction = this.signedInActions.find(
118639
+ (action) => action.id === this.primaryActionId
118640
+ );
118652
118641
  return b`
118653
118642
  <div class="title-container">
118654
118643
  <h3 class="title">${msg("User")}</h3>
@@ -118737,6 +118726,9 @@ __decorateClass$sA([
118737
118726
  __decorateClass$sA([
118738
118727
  n$3({ type: Array, attribute: false })
118739
118728
  ], ObcUserMenu.prototype, "signedInActions", 2);
118729
+ __decorateClass$sA([
118730
+ n$3({ type: String })
118731
+ ], ObcUserMenu.prototype, "primaryActionId", 2);
118740
118732
  ObcUserMenu = __decorateClass$sA([
118741
118733
  customElement("obc-user-menu"),
118742
118734
  localized()