form-father 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/FormFather.min.js +1 -1
- package/dist/FormFather.min.js.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -766,7 +766,16 @@ class Form {
|
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
768
|
toSafeIdPart(value) {
|
|
769
|
-
|
|
769
|
+
const normalized = value.trim().toLowerCase().replace(/[^a-z0-9_-]+/gi, "-");
|
|
770
|
+
let start = 0;
|
|
771
|
+
let end = normalized.length;
|
|
772
|
+
while (start < end && normalized[start] === "-") {
|
|
773
|
+
start += 1;
|
|
774
|
+
}
|
|
775
|
+
while (end > start && normalized[end - 1] === "-") {
|
|
776
|
+
end -= 1;
|
|
777
|
+
}
|
|
778
|
+
return normalized.slice(start, end) || "field";
|
|
770
779
|
}
|
|
771
780
|
createErrorId($input) {
|
|
772
781
|
const prefix = this.config.errorIdPrefix || "form-father-error";
|