Comparing version 2.0.0 to 2.1.0
@@ -291,3 +291,3 @@ 'use strict'; | ||
// when the component is connected to the hierarchy | ||
_this.state = {}; | ||
_this.state = Object.assign({}, _this.getConfig('defaultState')); | ||
_this.appState = _this.getConfig('appState'); | ||
@@ -350,6 +350,12 @@ | ||
// share either appState or all of state | ||
Object.assign(this.$panelRoot.appState, this.appState); // flush any queued appState changes | ||
this.appState = this.$panelRoot.appState; | ||
// flush any queued appState changes | ||
this.appState = Object.assign(this.$panelRoot.appState, this.appState); | ||
// if child element state is shared, point | ||
// state to parent's state object and flush any | ||
// queued state changes to the parent state | ||
this.isStateShared = this.$panelRoot.isStateShared; | ||
this.state = this.isStateShared ? this.$panelRoot.state : {}; | ||
if (this.isStateShared) { | ||
this.state = Object.assign(this.$panelRoot.state, this.state); | ||
} | ||
} else { | ||
@@ -362,6 +368,4 @@ this.isPanelRoot = true; | ||
var newState = Object.assign({}, this.getConfig('defaultState'), this.state, this.getJSONAttribute('data-state'), this._stateFromAttributes()); | ||
Object.assign(this.state, this.getJSONAttribute('data-state'), this._stateFromAttributes()); | ||
Object.assign(this.state, newState); | ||
if (Object.keys(this.getConfig('routes')).length) { | ||
@@ -368,0 +372,0 @@ this.router = new _router2.default(this, { historyMethod: this.historyMethod }); |
@@ -220,3 +220,3 @@ import cuid from 'cuid'; | ||
// when the component is connected to the hierarchy | ||
this.state = {}; | ||
this.state = Object.assign({}, this.getConfig(`defaultState`)); | ||
this.appState = this.getConfig(`appState`); | ||
@@ -275,7 +275,12 @@ | ||
// share either appState or all of state | ||
Object.assign(this.$panelRoot.appState, this.appState); // flush any queued appState changes | ||
this.appState = this.$panelRoot.appState; | ||
// flush any queued appState changes | ||
this.appState = Object.assign(this.$panelRoot.appState, this.appState); | ||
// if child element state is shared, point | ||
// state to parent's state object and flush any | ||
// queued state changes to the parent state | ||
this.isStateShared = this.$panelRoot.isStateShared; | ||
this.state = this.isStateShared ? this.$panelRoot.state : {}; | ||
if (this.isStateShared) { | ||
this.state = Object.assign(this.$panelRoot.state, this.state); | ||
} | ||
} else { | ||
@@ -288,12 +293,7 @@ this.isPanelRoot = true; | ||
const newState = Object.assign( | ||
{}, | ||
this.getConfig(`defaultState`), | ||
this.state, | ||
Object.assign(this.state, | ||
this.getJSONAttribute(`data-state`), | ||
this._stateFromAttributes() | ||
this._stateFromAttributes(), | ||
); | ||
Object.assign(this.state, newState); | ||
if (Object.keys(this.getConfig(`routes`)).length) { | ||
@@ -300,0 +300,0 @@ this.router = new Router(this, {historyMethod: this.historyMethod}); |
{ | ||
"name": "panel", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Web Components with Virtual DOM: lightweight composable web apps", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
2819
0
127058
29