Socket
Socket
Sign inDemoInstall

@lion/form-core

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.1 to 0.8.2

6

CHANGELOG.md
# Change Log
## 0.8.2
### Patch Changes
- d0b37e62: Do a deep equals check for choice group children that have complex modelValues, enabling modelValue setter to work on the group level.
## 0.8.1

@@ -4,0 +10,0 @@

10

package.json
{
"name": "@lion/form-core",
"version": "0.8.1",
"version": "0.8.2",
"description": "Form-core contains all essential building blocks for creating form fields and fieldsets",

@@ -27,3 +27,3 @@ "license": "MIT",

"scripts": {
"custom-elements-manifest": "custom-elements-manifest analyze --exclude 'docs/**/*'",
"custom-elements-manifest": "custom-elements-manifest analyze --litelement --exclude 'docs/**/*' 'test-helpers/**/*'",
"debug": "cd ../../ && npm run debug -- --group form-core",

@@ -51,2 +51,3 @@ "debug:firefox": "cd ../../ && npm run debug:firefox -- --group form-core",

},
"customElementsManifest": "custom-elements.json",
"exports": {

@@ -58,4 +59,3 @@ ".": "./index.js",

"./lion-validation-feedback": "./lion-validation-feedback.js"
},
"customElementsManifest": "custom-elements.json"
}
}
}

@@ -47,3 +47,8 @@ import { dedupeMixin } from '@lion/core';

*/
const checkCondition = (el, val) => el.choiceValue === val;
const checkCondition = (el, val) => {
if (typeof el.choiceValue === 'object') {
return JSON.stringify(el.choiceValue) === JSON.stringify(value);
}
return el.choiceValue === val;
};

@@ -285,3 +290,12 @@ if (this.__isInitialModelValue) {

if (this.multipleChoice) {
this.formElements[i].checked = value.includes(this.formElements[i].value);
let valueIsIncluded = value.includes(this.formElements[i].modelValue.value);
// For complex values, do a JSON Stringified includes check, because [{ v: 'foo'}].includes({ v: 'foo' }) => false
if (typeof this.formElements[i].modelValue.value === 'object') {
valueIsIncluded = /** @type {any[]} */ (value)
.map(/** @param {Object} v */ v => JSON.stringify(v))
.includes(JSON.stringify(this.formElements[i].modelValue.value));
}
this.formElements[i].checked = valueIsIncluded;
} else if (check(this.formElements[i], value)) {

@@ -288,0 +302,0 @@ // Allows checking against custom values e.g. formattedValue or serializedValue

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc