@kumori/aurora-wui-components 0.0.230 → 0.0.232

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,15 +1,10 @@
1
1
  import { LitElement } from 'lit';
2
- /**
3
- * Purely presentational tab selector. Tab count is derived from the
4
- * slotted `tab-label-N`/`tab-panel-N` children - everything else (which
5
- * tab is active, whether it's disabled) is driven by properties/events,
6
- * the caller owns the actual selection state.
7
- */
8
2
  export declare class AxebowTabSelector extends LitElement {
9
3
  disabled: boolean;
10
4
  activeTab?: number;
11
5
  private _activeTab;
12
6
  private _tabCount;
7
+ private _tabDisabled;
13
8
  private _observer;
14
9
  static styles: import('lit').CSSResult[];
15
10
  connectedCallback(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"axebow-tab-selector.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-tab-selector/axebow-tab-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAkB,MAAM,KAAK,CAAC;AAEvD,OAAO,+BAA+B,CAAC;AAGvC;;;;;GAKG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IACA,QAAQ,UAAS;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEtC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,SAAS,CAAK;IAE/B,OAAO,CAAC,SAAS,CAAiC;IAElD,MAAM,CAAC,MAAM,4BA4BX;IAEF,iBAAiB;IAOjB,oBAAoB;IAKpB,SAAS,CAAC,YAAY;IAItB,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IASzD,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,UAAU;IAMlB,MAAM;CAyCP"}
1
+ {"version":3,"file":"axebow-tab-selector.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-tab-selector/axebow-tab-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAkB,MAAM,KAAK,CAAC;AAEvD,OAAO,+BAA+B,CAAC;AAGvC,qBACa,iBAAkB,SAAQ,UAAU;IACA,QAAQ,UAAS;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEtC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,YAAY,CAAiB;IAE9C,OAAO,CAAC,SAAS,CAAiC;IAElD,MAAM,CAAC,MAAM,4BA4BX;IAEF,iBAAiB;IAOjB,oBAAoB;IAKpB,SAAS,CAAC,YAAY;IAItB,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IASzD,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,UAAU;IAMlB,MAAM;CA6CP"}
package/dist/index.js CHANGED
@@ -6876,6 +6876,7 @@ var AxebowTabSelector = class AxebowTabSelector extends LitElement {
6876
6876
  this.disabled = false;
6877
6877
  this._activeTab = 0;
6878
6878
  this._tabCount = 0;
6879
+ this._tabDisabled = [];
6879
6880
  this._observer = null;
6880
6881
  }
6881
6882
  static {
@@ -6886,10 +6887,10 @@ var AxebowTabSelector = class AxebowTabSelector extends LitElement {
6886
6887
  button {
6887
6888
  font-family: inherit;
6888
6889
  }
6889
- button.tab-inactive {
6890
+ button.tab-inactive:not(:disabled) {
6890
6891
  position: relative;
6891
6892
  }
6892
- button.tab-inactive:hover::after {
6893
+ button.tab-inactive:not(:disabled):hover::after {
6893
6894
  content: '';
6894
6895
  position: absolute;
6895
6896
  bottom: 0;
@@ -6909,7 +6910,12 @@ var AxebowTabSelector = class AxebowTabSelector extends LitElement {
6909
6910
  connectedCallback() {
6910
6911
  super.connectedCallback();
6911
6912
  this._observer = new MutationObserver(() => this._updateTabCount());
6912
- this._observer.observe(this, { childList: true });
6913
+ this._observer.observe(this, {
6914
+ childList: true,
6915
+ attributes: true,
6916
+ attributeFilter: ["disabled"],
6917
+ subtree: true
6918
+ });
6913
6919
  this._updateTabCount();
6914
6920
  }
6915
6921
  disconnectedCallback() {
@@ -6929,9 +6935,12 @@ var AxebowTabSelector = class AxebowTabSelector extends LitElement {
6929
6935
  if (this._activeTab >= count) this._activeTab = 0;
6930
6936
  this._tabCount = count;
6931
6937
  }
6938
+ this._tabDisabled = Array.from({ length: this._tabCount }, (_, i) => {
6939
+ return this.querySelector(`[slot="tab-label-${i}"]`)?.hasAttribute("disabled") ?? false;
6940
+ });
6932
6941
  }
6933
6942
  _selectTab(index) {
6934
- if (this.disabled) return;
6943
+ if (this.disabled || this._tabDisabled[index]) return;
6935
6944
  this._activeTab = index;
6936
6945
  this.dispatchEvent(new CustomEvent("tab-change", {
6937
6946
  detail: { index },
@@ -6944,21 +6953,27 @@ var AxebowTabSelector = class AxebowTabSelector extends LitElement {
6944
6953
  return html`
6945
6954
  <div class="w-full max-w-194.25 rounded-xl box-border">
6946
6955
  <div class="w-full h-8 flex bg-(--axebow-base) gap-1 rounded-t-xl box-border">
6947
- ${tabs.map((i) => html`
6956
+ ${tabs.map((i) => {
6957
+ const active = this._activeTab === i;
6958
+ const isDisabled = this._tabDisabled[i];
6959
+ return html`
6948
6960
  <button
6949
- class="flex-1 h-8 flex items-center justify-center gap-2 border-none cursor-pointer transition-colors duration-200 font-medium
6961
+ class="flex-1 h-8 flex items-center justify-center gap-2 border-none transition-colors duration-200 font-medium
6950
6962
  focus-visible:outline-2 focus-visible:outline-(--axebow-tertiary)
6951
- ${this._activeTab === i ? "bg-white text-(--axebow-primary) rounded-t-lg tab-active" : "bg-transparent text-(--axebow-secondary) rounded-lg tab-inactive"}"
6963
+ ${isDisabled ? "opacity-60 cursor-not-allowed" : "cursor-pointer"}
6964
+ ${active ? "bg-white text-(--axebow-primary) rounded-t-lg tab-active" : "bg-transparent text-(--axebow-secondary) rounded-lg tab-inactive"}"
6965
+ ?disabled=${isDisabled}
6952
6966
  @click=${() => this._selectTab(i)}
6953
6967
  >
6954
6968
  <axebow-icon
6955
- iconName="${this._activeTab === i ? "radio_button_checked" : "radio_button_unchecked"}"
6969
+ iconName="${active ? "radio_button_checked" : "radio_button_unchecked"}"
6956
6970
  iconColor="var(--axebow-tertiary)"
6957
6971
  size="x-small"
6958
6972
  ></axebow-icon>
6959
6973
  <slot name="tab-label-${i}"></slot>
6960
6974
  </button>
6961
- `)}
6975
+ `;
6976
+ })}
6962
6977
  </div>
6963
6978
 
6964
6979
  <div
@@ -6981,6 +6996,7 @@ __decorate([property({
6981
6996
  __decorate([property({ type: Number })], AxebowTabSelector.prototype, "activeTab", void 0);
6982
6997
  __decorate([state()], AxebowTabSelector.prototype, "_activeTab", void 0);
6983
6998
  __decorate([state()], AxebowTabSelector.prototype, "_tabCount", void 0);
6999
+ __decorate([state()], AxebowTabSelector.prototype, "_tabDisabled", void 0);
6984
7000
  AxebowTabSelector = __decorate([customElement("axebow-tab-selector")], AxebowTabSelector);
6985
7001
  //#endregion
6986
7002
  //#region src/components/axebow-deploy-summary/axebow-deploy-summary.ts