@oicl/openbridge-webcomponents 2.1.0 → 2.2.0-next.1

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.
@@ -7674,6 +7674,10 @@ var ObcIconButton = class ObcIconButton extends i$4 {
7674
7674
  this.focusable = true;
7675
7675
  this.ariaLabel = null;
7676
7676
  }
7677
+ /** Focus lands on the button inside, not on the host. */
7678
+ focus(options) {
7679
+ this.shadowRoot?.querySelector("button")?.focus(options);
7680
+ }
7677
7681
  get progressSpinner() {
7678
7682
  if (this.progress === void 0) return A;
7679
7683
  if (this.progress === 100) return b`<div class="progress-spinner">
@@ -107950,6 +107954,11 @@ var split_button_default = i$7`* {
107950
107954
  top: unset;
107951
107955
  }
107952
107956
 
107957
+ .wrapper.open-left .positioned-menu {
107958
+ right: anchor(right);
107959
+ left: unset;
107960
+ }
107961
+
107953
107962
  .dropdown-button::part(visible-wrapper) {
107954
107963
  box-sizing: border-box;
107955
107964
  }
@@ -107970,7 +107979,10 @@ var ObcSplitButton = class ObcSplitButton extends i$4 {
107970
107979
  this.dropdownLabel = "More options";
107971
107980
  this.fullWidth = false;
107972
107981
  this.disabled = false;
107982
+ this.primaryDisabled = false;
107983
+ this.dropdownDisabled = false;
107973
107984
  this.openTop = false;
107985
+ this.openLeft = false;
107974
107986
  this.columnGroups = [];
107975
107987
  this.isDropdownOpen = false;
107976
107988
  this.restoreFocusOnClose = false;
@@ -107989,7 +108001,7 @@ var ObcSplitButton = class ObcSplitButton extends i$4 {
107989
108001
  } else window.removeEventListener("pointerdown", this.closeOnOutside);
107990
108002
  };
107991
108003
  this.handleDropdownKeydown = (event) => {
107992
- if (this.disabled) return;
108004
+ if (this.isDropdownDisabled) return;
107993
108005
  switch (event.key) {
107994
108006
  case "ArrowDown":
107995
108007
  event.preventDefault();
@@ -108051,8 +108063,15 @@ var ObcSplitButton = class ObcSplitButton extends i$4 {
108051
108063
  });
108052
108064
  };
108053
108065
  }
108066
+ get isPrimaryDisabled() {
108067
+ return this.disabled || this.primaryDisabled;
108068
+ }
108069
+ get isDropdownDisabled() {
108070
+ return this.disabled || this.dropdownDisabled;
108071
+ }
108054
108072
  async focusMenuAfterOpen() {
108055
108073
  await this.updateComplete;
108074
+ await this.menu?.updateComplete;
108056
108075
  if (!this.isDropdownOpen) return;
108057
108076
  if (this.menuFocusStrategy === "last") this.menu?.focusLastItem();
108058
108077
  else if (this.menuFocusStrategy === "first") this.menu?.focusFirstItem();
@@ -108084,7 +108103,8 @@ var ObcSplitButton = class ObcSplitButton extends i$4 {
108084
108103
  wrapper: true,
108085
108104
  "full-width": this.fullWidth,
108086
108105
  "is-open": this.isDropdownOpen,
108087
- "open-top": this.openTop
108106
+ "open-top": this.openTop,
108107
+ "open-left": this.openLeft
108088
108108
  })}
108089
108109
  >
108090
108110
  <obc-button
@@ -108092,7 +108112,7 @@ var ObcSplitButton = class ObcSplitButton extends i$4 {
108092
108112
  .variant=${"normal"}
108093
108113
  .segmentPosition=${segmentPosition.start}
108094
108114
  .showLeadingIcon=${this.hasIcon}
108095
- .disabled=${this.disabled}
108115
+ .disabled=${this.isPrimaryDisabled}
108096
108116
  @click=${this.handlePrimaryClick}
108097
108117
  .fullWidth=${this.fullWidth}
108098
108118
  >
@@ -108104,7 +108124,7 @@ var ObcSplitButton = class ObcSplitButton extends i$4 {
108104
108124
  class="dropdown-button"
108105
108125
  .variant=${"normal"}
108106
108126
  .cornerRight=${true}
108107
- .disabled=${this.disabled}
108127
+ .disabled=${this.isDropdownDisabled}
108108
108128
  .activated=${this.isDropdownOpen}
108109
108129
  aria-label=${this.dropdownLabel}
108110
108130
  @click=${this.handleDropdownClick}
@@ -108112,7 +108132,11 @@ var ObcSplitButton = class ObcSplitButton extends i$4 {
108112
108132
  aria-expanded=${this.isDropdownOpen}
108113
108133
  aria-haspopup="menu"
108114
108134
  >
108115
- <obi-arrow-flyout-google></obi-arrow-flyout-google>
108135
+ <slot name="dropdown-icon">
108136
+ <obi-arrow-flyout-google
108137
+ aria-hidden="true"
108138
+ ></obi-arrow-flyout-google>
108139
+ </slot>
108116
108140
  </obc-icon-button>
108117
108141
 
108118
108142
  <!-- Context Menu -->
@@ -108153,7 +108177,10 @@ __decorate([n$4({ type: String })], ObcSplitButton.prototype, "menuTitle", void
108153
108177
  __decorate([n$4({ type: String })], ObcSplitButton.prototype, "dropdownLabel", void 0);
108154
108178
  __decorate([n$4({ type: Boolean })], ObcSplitButton.prototype, "fullWidth", void 0);
108155
108179
  __decorate([n$4({ type: Boolean })], ObcSplitButton.prototype, "disabled", void 0);
108180
+ __decorate([n$4({ type: Boolean })], ObcSplitButton.prototype, "primaryDisabled", void 0);
108181
+ __decorate([n$4({ type: Boolean })], ObcSplitButton.prototype, "dropdownDisabled", void 0);
108156
108182
  __decorate([n$4({ type: Boolean })], ObcSplitButton.prototype, "openTop", void 0);
108183
+ __decorate([n$4({ type: Boolean })], ObcSplitButton.prototype, "openLeft", void 0);
108157
108184
  __decorate([n$4({ type: Array })], ObcSplitButton.prototype, "columnGroups", void 0);
108158
108185
  __decorate([r$3()], ObcSplitButton.prototype, "isDropdownOpen", void 0);
108159
108186
  __decorate([e$4("obc-context-menu-input")], ObcSplitButton.prototype, "menu", void 0);