@wezz/ariatabmanager
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -47,5 +47,3 @@ var h = Object.defineProperty; | ||
const e = t.getAttribute("id") + ""; | ||
return e ? this.controlelements.filter( | ||
(a) => (a.getAttribute("aria-controls") + "").indexOf(e) !== -1 | ||
) : []; | ||
return e ? (console.log("this.controlelements", this.controlelements), this.controlelements.filter((a) => (a.getAttribute("aria-controls") + "").split(" ").indexOf(e) !== -1)) : []; | ||
} | ||
@@ -99,3 +97,4 @@ GetARIAControlTargets(t) { | ||
updateButtonState(t, e) { | ||
const a = (s, d) => s.hasAttribute(d) ? s.getAttribute(d) : null, i = e.detail.target, n = a(i, "aria-hidden"); | ||
console.log("updateButtonState(elm", t); | ||
const a = (s, l) => s.hasAttribute(l) ? s.getAttribute(l) : null, i = e.detail.target, n = a(i, "aria-hidden"); | ||
t.hasAttribute("aria-pressed") && t.setAttribute("aria-pressed", (n === "false") + ""), t.hasAttribute("aria-expanded") && t.setAttribute("aria-expanded", (n === "false") + ""); | ||
@@ -110,3 +109,3 @@ } | ||
}) | ||
), i.forEach((n) => { | ||
), console.log("relatedControls", e, i), i.forEach((n) => { | ||
n.dispatchEvent( | ||
@@ -163,6 +162,6 @@ this.customEvent("updateButtonState", { | ||
} | ||
class l { | ||
class d { | ||
} | ||
o(l, "AllowNone", "allownone"), o(l, "TabletAccordion", "tabletaccordion"), o(l, "Default", ""); | ||
class A { | ||
o(d, "AllowNone", "allownone"), o(d, "TabletAccordion", "tabletaccordion"), o(d, "Default", ""); | ||
class m { | ||
constructor(t) { | ||
@@ -221,12 +220,12 @@ o(this, "controlelements", []); | ||
const a = await this.ariaManager.GetARIAControlTargets(e), i = t.getAttribute(this.tabModeAttributeName), n = a[0].id; | ||
if (i === l.TabletAccordion) { | ||
const d = t.hasAttribute(this.tabMediaQueryAttributeName) ? t.getAttribute(this.tabMediaQueryAttributeName) + "" : "only screen and (min-width: 768px)"; | ||
if (typeof (window == null ? void 0 : window.matchMedia) < "u" && !window.matchMedia(d).matches) | ||
if (i === d.TabletAccordion) { | ||
const l = t.hasAttribute(this.tabMediaQueryAttributeName) ? t.getAttribute(this.tabMediaQueryAttributeName) + "" : "only screen and (min-width: 768px)"; | ||
if (typeof (window == null ? void 0 : window.matchMedia) < "u" && !window.matchMedia(l).matches) | ||
return; | ||
} | ||
this.getTargets(t).filter( | ||
(d) => d.id !== n | ||
).forEach((d) => { | ||
this.ariaManager.AriaHidden(d, !0), this.ariaManager.AriaExpand(d, !1); | ||
}), this.setPageHash(e), this.setContentHeight(t), i !== l.AllowNone && this.displayTarget(a[0], t); | ||
(l) => l.id !== n | ||
).forEach((l) => { | ||
this.ariaManager.AriaHidden(l, !0), this.ariaManager.AriaExpand(l, !1); | ||
}), this.setPageHash(e), this.setContentHeight(t), i !== d.AllowNone && this.displayTarget(a[0], t); | ||
} | ||
@@ -289,3 +288,3 @@ setPageHash(t) { | ||
export { | ||
A as default | ||
m as default | ||
}; |
{ | ||
"name": "@wezz/ariatabmanager", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"type": "module", | ||
@@ -46,4 +46,4 @@ "main": "./dist/ariatabmanager.umd.cjs", | ||
"dependencies": { | ||
"@wezz/ariamanager": "^1.0.4" | ||
"@wezz/ariamanager": "^1.0.5" | ||
} | ||
} |
# ARIA Tab Manager | ||
This is a Tab Management script that takes advantage of (ARIA Manager)[https://github.com/wezz/ARIAManager] | ||
This is a Tab Management script that takes advantage of [ARIA Manager](https://github.com/wezz/ARIAManager) | ||
By adding data attributes to markup it will take care of aria attributes which can e used to style the tabs. | ||
@@ -5,0 +5,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23036
Updated@wezz/ariamanager@^1.0.5