New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ndla/accordion

Package Overview
Dependencies
Maintainers
5
Versions
282
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndla/accordion - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

37

es/Accordion.js

@@ -47,3 +47,3 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

_this.state = {
panelsOpen: props.openIndexes
openIndexes: props.openIndexes
};

@@ -57,3 +57,3 @@ _this.togglePanel = _this.togglePanel.bind(_assertThisInitialized(_assertThisInitialized(_this)));

value: function togglePanel(index) {
var panelsOpen = this.state.panelsOpen;
var openIndexes = this.state.openIndexes;
var single = this.props.single;

@@ -63,13 +63,13 @@

this.setState({
panelsOpen: panelsOpen.includes(index) ? [] : [index]
openIndexes: openIndexes.includes(index) ? [] : [index]
});
} else if (panelsOpen.includes(index)) {
panelsOpen.splice(panelsOpen.indexOf(index), 1);
} else if (openIndexes.includes(index)) {
openIndexes.splice(openIndexes.indexOf(index), 1);
this.setState({
panelsOpen: panelsOpen
openIndexes: openIndexes
});
} else {
panelsOpen.push(index);
openIndexes.push(index);
this.setState({
panelsOpen: panelsOpen
openIndexes: openIndexes
});

@@ -81,5 +81,22 @@ }

value: function render() {
var _this2 = this;
return this.props.children({
openIndexes: this.state.panelsOpen,
handleItemClick: this.togglePanel
openIndexes: this.state.openIndexes,
handleItemClick: this.togglePanel,
getBarProps: function getBarProps(panelId) {
return {
panelId: panelId,
isOpen: _this2.state.openIndexes.includes(panelId),
onClick: function onClick() {
return _this2.togglePanel(panelId);
}
};
},
getPanelProps: function getPanelProps(panelId) {
return {
id: panelId,
isOpen: _this2.state.openIndexes.includes(panelId)
};
}
});

@@ -86,0 +103,0 @@ }

@@ -60,3 +60,3 @@ "use strict";

_this.state = {
panelsOpen: props.openIndexes
openIndexes: props.openIndexes
};

@@ -70,3 +70,3 @@ _this.togglePanel = _this.togglePanel.bind(_assertThisInitialized(_assertThisInitialized(_this)));

value: function togglePanel(index) {
var panelsOpen = this.state.panelsOpen;
var openIndexes = this.state.openIndexes;
var single = this.props.single;

@@ -76,13 +76,13 @@

this.setState({
panelsOpen: panelsOpen.includes(index) ? [] : [index]
openIndexes: openIndexes.includes(index) ? [] : [index]
});
} else if (panelsOpen.includes(index)) {
panelsOpen.splice(panelsOpen.indexOf(index), 1);
} else if (openIndexes.includes(index)) {
openIndexes.splice(openIndexes.indexOf(index), 1);
this.setState({
panelsOpen: panelsOpen
openIndexes: openIndexes
});
} else {
panelsOpen.push(index);
openIndexes.push(index);
this.setState({
panelsOpen: panelsOpen
openIndexes: openIndexes
});

@@ -94,5 +94,22 @@ }

value: function render() {
var _this2 = this;
return this.props.children({
openIndexes: this.state.panelsOpen,
handleItemClick: this.togglePanel
openIndexes: this.state.openIndexes,
handleItemClick: this.togglePanel,
getBarProps: function getBarProps(panelId) {
return {
panelId: panelId,
isOpen: _this2.state.openIndexes.includes(panelId),
onClick: function onClick() {
return _this2.togglePanel(panelId);
}
};
},
getPanelProps: function getPanelProps(panelId) {
return {
id: panelId,
isOpen: _this2.state.openIndexes.includes(panelId)
};
}
});

@@ -99,0 +116,0 @@ }

{
"name": "@ndla/accordion",
"version": "0.3.3",
"version": "0.3.4",
"description": "A simple accordion from NDLA",

@@ -22,3 +22,3 @@ "license": "GPL-3.0",

"dependencies": {
"@ndla/core": "^0.4.3"
"@ndla/core": "^0.4.4"
},

@@ -34,3 +34,3 @@ "peerDependencies": {

},
"gitHead": "f51bccb73b427f3fa96fb6df8f2d450a13fab3f9"
"gitHead": "e222847817aa2f92e26a22462614e5cd964a490e"
}
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