makeup-expander
Advanced tools
Comparing version 0.11.4 to 0.11.5
@@ -20,2 +20,3 @@ "use strict"; | ||
collapseOnClickOut: false, | ||
collapseOnHostFocus: false, | ||
contentSelector: ".expander__content", | ||
@@ -132,2 +133,3 @@ expandedClass: null, | ||
this.expandOnHover = this.options.expandOnHover; | ||
this.collapseOnHostFocus = this.options.collapseOnHostFocus; | ||
if (this.options.autoCollapse === false) { | ||
@@ -197,2 +199,9 @@ this.collapseOnClickOut = this.options.collapseOnClickOut; | ||
} | ||
set collapseOnHostFocus(bool) { | ||
if (bool === true) { | ||
this.contentEl.addEventListener("focusExit", this._focusExitListener); | ||
} else { | ||
this.contentEl.removeEventListener("focusExit", this._focusExitListener); | ||
} | ||
} | ||
set collapseOnMouseOut(bool) { | ||
@@ -199,0 +208,0 @@ if (bool === true) { |
@@ -11,2 +11,3 @@ import nextID from "makeup-next-id"; | ||
collapseOnClickOut: false, | ||
collapseOnHostFocus: false, | ||
contentSelector: ".expander__content", | ||
@@ -118,2 +119,3 @@ expandedClass: null, | ||
this.expandOnHover = this.options.expandOnHover; | ||
this.collapseOnHostFocus = this.options.collapseOnHostFocus; | ||
if (this.options.autoCollapse === false) { | ||
@@ -183,2 +185,9 @@ this.collapseOnClickOut = this.options.collapseOnClickOut; | ||
} | ||
set collapseOnHostFocus(bool) { | ||
if (bool === true) { | ||
this.contentEl.addEventListener("focusExit", this._focusExitListener); | ||
} else { | ||
this.contentEl.removeEventListener("focusExit", this._focusExitListener); | ||
} | ||
} | ||
set collapseOnMouseOut(bool) { | ||
@@ -185,0 +194,0 @@ if (bool === true) { |
{ | ||
"name": "makeup-expander", | ||
"description": "Creates the basic interactivity for an element that expands and collapses another element.", | ||
"version": "0.11.4", | ||
"version": "0.11.5", | ||
"main": "./dist/cjs/index.js", | ||
@@ -42,3 +42,3 @@ "module": "./dist/mjs/index.js", | ||
], | ||
"gitHead": "72b3adbcb4d841dbd4ad8e722637b3d7de3ab7f0" | ||
"gitHead": "db2e3ea8dbeddb9b729c1ea89abf82a488bd4ab5" | ||
} |
@@ -99,2 +99,3 @@ # makeup-expander | ||
- `options.collapseOnMouseOut`: whether the content should collapse when mouse leaves the content (default: false) | ||
- `options.collapseOnHostFocus`: whether the content should collapse when focus is on the host (default: false) | ||
- `options.contentSelector`: the query selector for the expandee element in relation to the widget (default: '.expander\_\_content') | ||
@@ -101,0 +102,0 @@ - `options.expandOnClick`: whether the host should be click activated (default: false) |
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
27732
528
137
1
1