Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dreamworld/dw-form

Package Overview
Dependencies
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dreamworld/dw-form - npm Package Compare versions

Comparing version 1.1.0-dw-composite-form.9 to 1.1.0-dw-composite-form.10

2

demo/dw-composite-form-element-demo.js

@@ -43,3 +43,3 @@ /**

return html`
<dw-composite-form-element @value-changed="${this._onValueChanged}" .inputValue="${this._inputs}">
<dw-composite-form-element @value-changed="${this._onValueChanged}" .value="${this._inputs}">
<section class="layout horizontal">

@@ -46,0 +46,0 @@ <dw-input

@@ -14,3 +14,3 @@ /**

// These are lodash element needed by this element.
import debounce from 'lodash-es/debounce';
import debounce from 'lodash-es/debounce';

@@ -36,9 +36,3 @@ // These are dw element needed by this element.

*/
value: { type: Object },
/**
* Input Property
* Used to set pre-filled value of the element
*/
inputValue: { type: Object }
value: { type: Object }
}

@@ -57,3 +51,2 @@ }

this.value = {};
this.inputValue = {};
this._dispatchValueChangeEvent = debounce(this._dispatchValueChangeEvent, 100);

@@ -64,2 +57,8 @@ this._onElementValueChange = this._onElementValueChange.bind(this);

this._onUnregisterDwFormElement = this._onUnregisterDwFormElement.bind(this);
/**
* Instance property
* Default value is false
* Becomes true when value is changed internally.
*/
this._changedInternally = false;
}

@@ -79,2 +78,3 @@

this._elements = [];
this._changedInternally = null;
}

@@ -85,12 +85,15 @@

*/
set inputValue(val) {
if (val === this._inputValue) {
set value(val) {
if (val === this._value || this._changedInternally) {
return;
}
let oldValue = this._inputValue;
this._inputValue = val;
this.value = { ...val };
this._changedInternally = false;
let oldValue = this._value;
this._value = val;
this._setChildElementValue();
this.requestUpdate('inputValue', oldValue);
this.requestUpdate('value', oldValue);
}

@@ -101,4 +104,4 @@

*/
get inputValue() {
return this._inputValue;
get value() {
return this._value;
}

@@ -155,5 +158,7 @@

_onElementValueChange(e) {
this._changedInternally = true;
let value = e.target.value;
let name = e.target.name;
this.value = { ...this.value };
this.value[name] = value;

@@ -168,5 +173,7 @@ this._dispatchValueChangeEvent();

_onElementCheckedChange(e) {
this._changedInternally = true;
let value = e.target.checked;
let name = e.target.name;
this.value = { ...this.value };
this.value[name] = value;

@@ -173,0 +180,0 @@ this._dispatchValueChangeEvent();

{
"name": "@dreamworld/dw-form",
"version": "1.1.0-dw-composite-form.9",
"version": "1.1.0-dw-composite-form.10",
"description": "",

@@ -5,0 +5,0 @@ "main": "dw-form.js",

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