@neonjungle/birdseed
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -17,3 +17,8 @@ import Choices from "choices.js"; | ||
*/ | ||
constructor(formElement, fieldContainerSelector, fieldSelector) { | ||
constructor( | ||
formElement, | ||
fieldContainerSelector, | ||
fieldSelector, | ||
errorClassPrefix | ||
) { | ||
if (!formElement) { | ||
@@ -30,2 +35,3 @@ console.error( | ||
"input:not([data-novalidate]), select:not([data-novalidate]), textarea:not([data-novalidate])"; | ||
this.errorClassPrefix = errorClassPrefix | "form-field"; | ||
this.valid = true; | ||
@@ -78,3 +84,3 @@ this.formFieldContainers = this.formElement.querySelectorAll( | ||
$fieldContainer.querySelectorAll(this.fieldSelector).forEach($field => { | ||
$field.addEventListener("blur", e => | ||
$field.addEventListener("blur", _ => | ||
this.runValidation.call(this, [$fieldContainer]) | ||
@@ -115,3 +121,3 @@ ); | ||
const $errorMessagesContainer = $fieldContainer.querySelector( | ||
`.${this.fieldContainerSelector}--error-messages` | ||
`.${this.errorClassPrefix}--error-messages` | ||
); | ||
@@ -127,3 +133,3 @@ | ||
`<p class="${ | ||
this.fieldContainerSelector | ||
this.errorClassPrefix | ||
}--error-messages-single">${error}</p>` | ||
@@ -130,0 +136,0 @@ ); |
{ | ||
"name": "@neonjungle/birdseed", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "Collection of handy utility methods for Neon Jungle", | ||
@@ -5,0 +5,0 @@ "main": "", |
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
19378
578