Socket
Socket
Sign inDemoInstall

@github/tab-container-element

Package Overview
Dependencies
Maintainers
15
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@github/tab-container-element - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

5

dist/bundle.js

@@ -151,3 +151,3 @@ var __defProp = Object.defineProperty;

this.addEventListener("click", this);
this.selectTab(Math.max(__classPrivateFieldGet(this, _TabContainerElement_instances, "a", _TabContainerElement_tabs_get).findIndex((el) => el.matches("[aria-selected=true]")), 0));
this.selectTab(-1);
__classPrivateFieldSet(this, _TabContainerElement_setupComplete, true, "f");

@@ -209,2 +209,5 @@ }

__classPrivateFieldGet(this, _TabContainerElement_instances, "a", _TabContainerElement_afterPanelsSlot_get).assign(...afterSlotted);
const defaultTab = Number(this.getAttribute("default-tab") || -1);
const defaultIndex = defaultTab >= 0 ? defaultTab : __classPrivateFieldGet(this, _TabContainerElement_instances, "a", _TabContainerElement_tabs_get).findIndex((el) => el.matches("[aria-selected=true]"));
index = index >= 0 ? index : Math.max(0, defaultIndex);
}

@@ -211,0 +214,0 @@ const tabs = __classPrivateFieldGet(this, _TabContainerElement_instances, "a", _TabContainerElement_tabs_get);

@@ -125,3 +125,3 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {

this.addEventListener('click', this);
this.selectTab(Math.max(__classPrivateFieldGet(this, _TabContainerElement_instances, "a", _TabContainerElement_tabs_get).findIndex(el => el.matches('[aria-selected=true]')), 0));
this.selectTab(-1);
__classPrivateFieldSet(this, _TabContainerElement_setupComplete, true, "f");

@@ -186,2 +186,5 @@ }

__classPrivateFieldGet(this, _TabContainerElement_instances, "a", _TabContainerElement_afterPanelsSlot_get).assign(...afterSlotted);
const defaultTab = Number(this.getAttribute('default-tab') || -1);
const defaultIndex = defaultTab >= 0 ? defaultTab : __classPrivateFieldGet(this, _TabContainerElement_instances, "a", _TabContainerElement_tabs_get).findIndex(el => el.matches('[aria-selected=true]'));
index = index >= 0 ? index : Math.max(0, defaultIndex);
}

@@ -188,0 +191,0 @@ const tabs = __classPrivateFieldGet(this, _TabContainerElement_instances, "a", _TabContainerElement_tabs_get);

2

package.json
{
"name": "@github/tab-container-element",
"version": "4.0.0",
"version": "4.0.1",
"description": "Tab container element",

@@ -5,0 +5,0 @@ "type": "module",

@@ -34,2 +34,13 @@ # <tab-container> element

If none of the tabs have `aria-selected=true`, then the first tab will be selected automatically. You can also add the `default-tab=N` attribute to avoid having to set `aria-selected=true` on the desired tab, where `N` is the 0-based tab index:
```html
<!-- The _second_ tab will be selected -->
<tab-container default-tab="1">
<button type="button" id="tab-one" role="tab">Tab one</button>
<button type="button" id="tab-two" role="tab">Tab two</button>
<button type="button" id="tab-three" role="tab">Tab three</button>
<!-- ... -->
</tab-container>
### Events

@@ -36,0 +47,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc