@oicl/openbridge-webcomponents 2.0.0-next.139 → 2.0.0-next.140

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.
@@ -122193,6 +122193,10 @@ const componentStyle$l = i$7`* {
122193
122193
  calc(var(--app-components-user-menu-padding-horizontal) * 2);
122194
122194
  }
122195
122195
 
122196
+ .signin-only:is(.card .login-container) {
122197
+ padding-bottom: var(--app-components-user-menu-padding-vertical);
122198
+ }
122199
+
122196
122200
  .card.size-small.type-sign-in .login-container,.card.size-small.type-user-sign-in .login-container {
122197
122201
  padding-bottom: var(--app-components-user-menu-padding-vertical);
122198
122202
  }
@@ -122374,7 +122378,9 @@ let ObcUserMenu = class extends i$4 {
122374
122378
  this.type = "sign-in";
122375
122379
  this.size = "regular";
122376
122380
  this.hasRecentlySignedIn = false;
122381
+ this.showUsername = true;
122377
122382
  this.username = "";
122383
+ this.showPassword = true;
122378
122384
  this.password = "";
122379
122385
  this.usernameError = "";
122380
122386
  this.passwordError = "";
@@ -122500,12 +122506,13 @@ let ObcUserMenu = class extends i$4 {
122500
122506
  }
122501
122507
  validateSignIn() {
122502
122508
  let valid = true;
122503
- const needsUsername = this.type === "sign-in";
122509
+ const needsUsername = this.type === "sign-in" && this.showUsername;
122510
+ const needsPassword = this.showPassword;
122504
122511
  if (needsUsername && !this.username) {
122505
122512
  this.usernameError = msg("Username is required");
122506
122513
  valid = false;
122507
122514
  }
122508
- if (!this.password) {
122515
+ if (needsPassword && !this.password) {
122509
122516
  this.passwordError = msg("Password is required");
122510
122517
  valid = false;
122511
122518
  }
@@ -122517,7 +122524,10 @@ let ObcUserMenu = class extends i$4 {
122517
122524
  }
122518
122525
  this.dispatchEvent(
122519
122526
  new CustomEvent("sign-in-click", {
122520
- detail: { username: this.username, password: this.password }
122527
+ detail: {
122528
+ username: this.showUsername ? this.username : void 0,
122529
+ password: this.showPassword ? this.password : void 0
122530
+ }
122521
122531
  })
122522
122532
  );
122523
122533
  }
@@ -122529,21 +122539,26 @@ let ObcUserMenu = class extends i$4 {
122529
122539
  <div class="title-container">
122530
122540
  <h3 class="title">${msg("Sign in")}</h3>
122531
122541
  </div>
122532
- <div class="login-container">
122533
- ${this.renderTextInput(
122542
+ <div
122543
+ class=${e$1({
122544
+ "login-container": true,
122545
+ "signin-only": !this.showRecentUsers
122546
+ })}
122547
+ >
122548
+ ${this.showUsername ? this.renderTextInput(
122534
122549
  msg("Username"),
122535
122550
  HTMLInputTypeAttribute.Text,
122536
122551
  this.username,
122537
122552
  this.handleUsernameInput.bind(this),
122538
122553
  this.usernameError
122539
- )}
122540
- ${this.renderTextInput(
122554
+ ) : A}
122555
+ ${this.showPassword ? this.renderTextInput(
122541
122556
  msg("Password"),
122542
122557
  HTMLInputTypeAttribute.Password,
122543
122558
  this.password,
122544
122559
  this.handlePasswordInput.bind(this),
122545
122560
  this.passwordError
122546
- )}
122561
+ ) : A}
122547
122562
  <obc-button
122548
122563
  variant=${ButtonVariant.raised}
122549
122564
  fullWidth
@@ -122569,21 +122584,26 @@ let ObcUserMenu = class extends i$4 {
122569
122584
  <div class="title-container">
122570
122585
  <h3 class="title">${msg("Sign in")}</h3>
122571
122586
  </div>
122572
- <div class="login-container">
122573
- ${this.renderTextInput(
122587
+ <div
122588
+ class=${e$1({
122589
+ "login-container": true,
122590
+ "signin-only": !this.showRecentUsers
122591
+ })}
122592
+ >
122593
+ ${this.showUsername ? this.renderTextInput(
122574
122594
  msg("Username"),
122575
122595
  HTMLInputTypeAttribute.Text,
122576
122596
  this.username,
122577
122597
  this.handleUsernameInput.bind(this),
122578
122598
  this.usernameError
122579
- )}
122580
- ${this.renderTextInput(
122599
+ ) : A}
122600
+ ${this.showPassword ? this.renderTextInput(
122581
122601
  msg("Password"),
122582
122602
  HTMLInputTypeAttribute.Password,
122583
122603
  this.password,
122584
122604
  this.handlePasswordInput.bind(this),
122585
122605
  this.passwordError
122586
- )}
122606
+ ) : A}
122587
122607
  <obc-button
122588
122608
  variant=${ButtonVariant.raised}
122589
122609
  fullWidth
@@ -122610,18 +122630,23 @@ let ObcUserMenu = class extends i$4 {
122610
122630
  <div class="title-container">
122611
122631
  <h3 class="title">${msg("Sign in")}</h3>
122612
122632
  </div>
122613
- <div class="login-container">
122633
+ <div
122634
+ class=${e$1({
122635
+ "login-container": true,
122636
+ "signin-only": !this.showRecentUsers
122637
+ })}
122638
+ >
122614
122639
  <div class="user-primary">
122615
122640
  ${this.renderUserProfile("vertical", "large")}
122616
122641
  </div>
122617
122642
  <div class="fields">
122618
- ${this.renderTextInput(
122643
+ ${this.showPassword ? this.renderTextInput(
122619
122644
  msg("Password"),
122620
122645
  HTMLInputTypeAttribute.Password,
122621
122646
  this.password,
122622
122647
  this.handlePasswordInput.bind(this),
122623
122648
  this.passwordError
122624
- )}
122649
+ ) : A}
122625
122650
  <obc-button
122626
122651
  variant=${ButtonVariant.raised}
122627
122652
  fullWidth
@@ -122651,14 +122676,19 @@ let ObcUserMenu = class extends i$4 {
122651
122676
  <div class="user-container">
122652
122677
  ${this.renderUserProfile("horizontal", "regular")}
122653
122678
  </div>
122654
- <div class="login-container">
122655
- ${this.renderTextInput(
122679
+ <div
122680
+ class=${e$1({
122681
+ "login-container": true,
122682
+ "signin-only": !this.showRecentUsers
122683
+ })}
122684
+ >
122685
+ ${this.showPassword ? this.renderTextInput(
122656
122686
  msg("Password"),
122657
122687
  HTMLInputTypeAttribute.Password,
122658
122688
  this.password,
122659
122689
  this.handlePasswordInput.bind(this),
122660
122690
  this.passwordError
122661
- )}
122691
+ ) : A}
122662
122692
  <obc-button
122663
122693
  variant=${ButtonVariant.raised}
122664
122694
  fullWidth
@@ -122820,9 +122850,15 @@ __decorateClass$sK([
122820
122850
  __decorateClass$sK([
122821
122851
  n$3({ type: Boolean })
122822
122852
  ], ObcUserMenu.prototype, "hasRecentlySignedIn", 2);
122853
+ __decorateClass$sK([
122854
+ n$3({ type: Boolean, attribute: false })
122855
+ ], ObcUserMenu.prototype, "showUsername", 2);
122823
122856
  __decorateClass$sK([
122824
122857
  n$3({ type: String })
122825
122858
  ], ObcUserMenu.prototype, "username", 2);
122859
+ __decorateClass$sK([
122860
+ n$3({ type: Boolean, attribute: false })
122861
+ ], ObcUserMenu.prototype, "showPassword", 2);
122826
122862
  __decorateClass$sK([
122827
122863
  n$3({ type: String })
122828
122864
  ], ObcUserMenu.prototype, "password", 2);