@lion/form-core
Advanced tools
Comparing version 0.7.2 to 0.7.3
# Change Log | ||
## 0.7.3 | ||
### Patch Changes | ||
- a7b27502: Sync name to parent form group conditionally and allow overriding. Also fix sync properly to prevent infinite loop. | ||
## 0.7.2 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@lion/form-core", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "Form-core contains all essential building blocks for creating form fields and fieldsets", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -122,4 +122,3 @@ /* eslint-disable class-methods-use-this */ | ||
) { | ||
// @ts-expect-error not all choice inputs have a name prop, because this mixin does not have a strict contract with form control mixin | ||
this.name = changedProperties.get('name'); | ||
this._syncNameToParentFormGroup(); | ||
} | ||
@@ -237,2 +236,16 @@ } | ||
/** | ||
* Override this in case of extending ChoiceInputMixin and requiring | ||
* to sync differently with parent form group name | ||
* Right now it checks tag name match where the parent form group tagname | ||
* should include the child field tagname ('checkbox' is included in 'checkbox-group') | ||
*/ | ||
_syncNameToParentFormGroup() { | ||
// @ts-expect-error not all choice inputs have a name prop, because this mixin does not have a strict contract with form control mixin | ||
if (this._parentFormGroup.tagName.includes(this.tagName)) { | ||
// @ts-expect-error | ||
this.name = this._parentFormGroup.name; | ||
} | ||
} | ||
/** | ||
* @param {boolean} checked | ||
@@ -239,0 +252,0 @@ */ |
@@ -46,2 +46,4 @@ import { Constructor } from '@open-wc/dedupe-mixin'; | ||
_syncNameToParentFormGroup(): void; | ||
_toggleChecked(ev: Event): void; | ||
@@ -48,0 +50,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
310901
7431