@flexilla/collapse
Advanced tools
Comparing version 2.0.2 to 2.0.3
var r = Object.defineProperty; | ||
var h = (i, t, e) => t in i ? r(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e; | ||
var s = (i, t, e) => (h(i, typeof t != "symbol" ? t + "" : t, e), e); | ||
const n = (i, t, e, l, o) => { | ||
if (!(i instanceof HTMLElement)) | ||
var p = (s, t, e) => t in s ? r(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e; | ||
var i = (s, t, e) => (p(s, typeof t != "symbol" ? t + "" : t, e), e); | ||
const n = (s, t, e, l, o) => { | ||
if (!(s instanceof HTMLElement)) | ||
throw new Error("accordion item not a valid HTMLELement"); | ||
switch (i.setAttribute("aria-hidden", e === "open" ? "false" : "true"), i.setAttribute("data-state", e), l) { | ||
switch (s.setAttribute("aria-hidden", e === "open" ? "false" : "true"), s.setAttribute("data-state", e), l) { | ||
case "horizontal": { | ||
i.style.width = e === "open" ? `${o}px` : "0px"; | ||
s.style.width = e === "open" ? `${o}px` : "0px"; | ||
break; | ||
} | ||
default: { | ||
i.style.height = e === "open" ? `${i.scrollHeight}px` : "0px"; | ||
s.style.height = e === "open" ? `${s.scrollHeight}px` : "0px"; | ||
break; | ||
@@ -18,3 +18,3 @@ } | ||
t instanceof HTMLElement && t.setAttribute("aria-expanded", e === "open" ? "true" : "false"); | ||
}, p = (i, t = document.body) => Array.from(t.querySelectorAll(i)), a = class a { | ||
}, h = (s, t = document.body) => Array.from(t.querySelectorAll(s)), a = class a { | ||
/** | ||
@@ -27,18 +27,18 @@ * Collapse Component | ||
constructor(t, e = {}, l) { | ||
s(this, "collapseElement"); | ||
s(this, "collapseOrientation"); | ||
s(this, "defaultState"); | ||
s(this, "collapseId"); | ||
s(this, "collapseTrigger"); | ||
s(this, "options"); | ||
s(this, "collapseElementWidth"); | ||
s(this, "show", () => { | ||
i(this, "collapseElement"); | ||
i(this, "collapseOrientation"); | ||
i(this, "defaultState"); | ||
i(this, "collapseId"); | ||
i(this, "collapseTrigger"); | ||
i(this, "options"); | ||
i(this, "collapseElementWidth"); | ||
i(this, "show", () => { | ||
var t, e; | ||
n(this.collapseElement, this.collapseTrigger, "open", this.collapseOrientation, this.collapseElementWidth), (e = (t = this.options).onToggle) == null || e.call(t, { isExpanded: !0 }); | ||
}); | ||
s(this, "hide", () => { | ||
i(this, "hide", () => { | ||
var t, e; | ||
n(this.collapseElement, this.collapseTrigger, "close", this.collapseOrientation), (e = (t = this.options).onToggle) == null || e.call(t, { isExpanded: !1 }); | ||
}); | ||
s(this, "toggle", () => { | ||
i(this, "toggle", () => { | ||
var e, l; | ||
@@ -61,4 +61,4 @@ const t = this.collapseElement.dataset.state === "close" ? "open" : "close"; | ||
*/ | ||
s(a, "autoInit", (t = "[data-fx-collapse]") => { | ||
const e = p(t); | ||
i(a, "autoInit", (t = "[data-fx-collapse]") => { | ||
const e = h(t); | ||
for (const l of e) | ||
@@ -68,4 +68,6 @@ new a(l); | ||
let c = a; | ||
const g = (s, t = {}, e) => new c(s, t, e); | ||
export { | ||
c as Collapse | ||
c as Collapse, | ||
g as fCollapse | ||
}; |
@@ -35,2 +35,4 @@ export declare class Collapse { | ||
export declare const fCollapse: (selector: string | HTMLElement, options?: CollapseOptions, triggerSelector?: string) => Collapse; | ||
export { } |
{ | ||
"name": "@flexilla/collapse", | ||
"private": false, | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"type": "module", | ||
@@ -65,3 +65,4 @@ "description": "A versatile and interactive collapse component for creating collapsible sections in web applications, conserving space and improving user experience.", | ||
"license": "MIT", | ||
"author": "johnkat-mj" | ||
"author": "johnkat-mj", | ||
"gitHead": "98932fa7279389be90368e974e58fab0fb1ba654" | ||
} |
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
11268
116