avalynx-form 1.0.0 → 1.0.1
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/README.md +2 -1
- package/dist/js/avalynx-form.esm.js +5 -3
- package/dist/js/avalynx-form.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ Here's a simple example of how to use AvalynxForm in your project:
|
|
|
15
15
|
* [Overview](https://avalynx-form.jbs-newmedia.de/examples/index.html)
|
|
16
16
|
* [Form](https://avalynx-form.jbs-newmedia.de/examples/form.html)
|
|
17
17
|
* [Form with slow response](https://avalynx-form.jbs-newmedia.de/examples/form-slow-response.html)
|
|
18
|
+
* [Form with AvalynxSelect](https://avalynx-form.jbs-newmedia.de/examples/form-with-avalynx-select.html)
|
|
18
19
|
|
|
19
20
|
## Installation
|
|
20
21
|
|
|
@@ -41,7 +42,7 @@ Replace `path/to/avalynx-form.js` with the actual path to the file in your proje
|
|
|
41
42
|
AvalynxForm is also available via [jsDelivr](https://www.jsdelivr.com/). You can include it in your project like this:
|
|
42
43
|
|
|
43
44
|
```html
|
|
44
|
-
<script src="https://cdn.jsdelivr.net/npm/avalynx-form@1.0.
|
|
45
|
+
<script src="https://cdn.jsdelivr.net/npm/avalynx-form@1.0.1/dist/js/avalynx-form.js"></script>
|
|
45
46
|
```
|
|
46
47
|
|
|
47
48
|
Make sure to also include Bootstrap's JS/CSS in your project to ensure AvalynxForm displays correctly.
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
+
import * as bootstrap from 'bootstrap';
|
|
23
|
+
|
|
22
24
|
export class AvalynxForm {
|
|
23
25
|
constructor(id, options = {}) {
|
|
24
26
|
this.form = document.getElementById(id);
|
|
@@ -120,7 +122,7 @@ export class AvalynxForm {
|
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
showInvalidFeedback(key, value) {
|
|
123
|
-
const elements = document.querySelectorAll(`#${key}, [name="${key}"], [name="${key}[]"], [name^="${key}["]`);
|
|
125
|
+
const elements = document.querySelectorAll(`#${key}, [name="${key}"], [name="${key}[]"], [name^="${key}\\["]`);
|
|
124
126
|
elements.forEach(element => {
|
|
125
127
|
const parentElement = element.closest('.form-group') || element.parentElement;
|
|
126
128
|
if (parentElement !== null) {
|
|
@@ -135,7 +137,7 @@ export class AvalynxForm {
|
|
|
135
137
|
}
|
|
136
138
|
|
|
137
139
|
clearInvalidFeedback(key) {
|
|
138
|
-
const elements = document.querySelectorAll(`#${key}, [name="${key}"], [name="${key}[]"], [name^="${key}["]`);
|
|
140
|
+
const elements = document.querySelectorAll(`#${key}, [name="${key}"], [name="${key}[]"], [name^="${key}\\["]`);
|
|
139
141
|
elements.forEach(element => {
|
|
140
142
|
const parentElement = element.closest('.form-group') || element.parentElement;
|
|
141
143
|
if (parentElement !== null) {
|
|
@@ -174,4 +176,4 @@ export class AvalynxForm {
|
|
|
174
176
|
this.form.appendChild(overlay);
|
|
175
177
|
}
|
|
176
178
|
}
|
|
177
|
-
}
|
|
179
|
+
}
|
package/dist/js/avalynx-form.js
CHANGED
|
@@ -120,7 +120,7 @@ class AvalynxForm {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
showInvalidFeedback(key, value) {
|
|
123
|
-
const elements = document.querySelectorAll(`#${key}, [name="${key}"], [name="${key}[]"], [name^="${key}["]`);
|
|
123
|
+
const elements = document.querySelectorAll(`#${key}, [name="${key}"], [name="${key}[]"], [name^="${key}\\["]`);
|
|
124
124
|
elements.forEach(element => {
|
|
125
125
|
const parentElement = element.closest('.form-group') || element.parentElement;
|
|
126
126
|
if (parentElement !== null) {
|
|
@@ -135,7 +135,7 @@ class AvalynxForm {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
clearInvalidFeedback(key) {
|
|
138
|
-
const elements = document.querySelectorAll(`#${key}, [name="${key}"], [name="${key}[]"], [name^="${key}["]`);
|
|
138
|
+
const elements = document.querySelectorAll(`#${key}, [name="${key}"], [name="${key}[]"], [name^="${key}\\["]`);
|
|
139
139
|
elements.forEach(element => {
|
|
140
140
|
const parentElement = element.closest('.form-group') || element.parentElement;
|
|
141
141
|
if (parentElement !== null) {
|
|
@@ -175,3 +175,7 @@ class AvalynxForm {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
+
|
|
179
|
+
if (typeof module !== 'undefined' && module.exports) {
|
|
180
|
+
module.exports = AvalynxForm;
|
|
181
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "avalynx-form",
|
|
3
3
|
"title": "AvalynxForm",
|
|
4
4
|
"description": "AvalynxForm is a lightweight, customizable form handling library for web applications. Based on Bootstrap >=5.3 without any framework dependencies.",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/js/avalynx-form.js",
|
|
8
8
|
"module": "dist/js/avalynx-form.esm.js",
|