@rxdi/forms 0.7.208 → 0.7.210
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/dist/form.decorator.js +8 -9
- package/dist/form.group.js +2 -0
- package/package.json +2 -2
package/dist/form.decorator.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.Form = Form;
|
|
|
4
4
|
const form_group_1 = require("./form.group");
|
|
5
5
|
const rx_fake_1 = require("./rx-fake");
|
|
6
6
|
function Form(options = {
|
|
7
|
-
strategy: 'none'
|
|
7
|
+
strategy: 'none',
|
|
8
8
|
}) {
|
|
9
9
|
return function (clazz, name) {
|
|
10
10
|
if (!options.name) {
|
|
@@ -17,18 +17,17 @@ function Form(options = {
|
|
|
17
17
|
if (!(this[name] instanceof form_group_1.FormGroup)) {
|
|
18
18
|
throw new Error('Value provided is not an instance of FormGroup!');
|
|
19
19
|
}
|
|
20
|
-
this[name]
|
|
21
|
-
.setParentElement(this)
|
|
22
|
-
.setOptions(options)
|
|
23
|
-
.prepareValues();
|
|
20
|
+
this[name].setParentElement(this).setOptions(options).prepareValues();
|
|
24
21
|
return Connect.call(this);
|
|
25
22
|
};
|
|
26
23
|
clazz.constructor.prototype.firstUpdated = function () {
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
/* Edge case for @rhtml/renderer */
|
|
25
|
+
const renderer = this.shadowRoot.querySelector('r-renderer');
|
|
26
|
+
if (renderer) {
|
|
27
|
+
renderer.addEventListener('loaded', () => this[name].init());
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
else {
|
|
30
|
+
this[name].init();
|
|
32
31
|
}
|
|
33
32
|
return UpdateFirst.call(this);
|
|
34
33
|
};
|
package/dist/form.group.js
CHANGED
|
@@ -213,6 +213,7 @@ class FormGroup {
|
|
|
213
213
|
return __awaiter(this, void 0, void 0, function* () {
|
|
214
214
|
let errors = [];
|
|
215
215
|
element.setCustomValidity('');
|
|
216
|
+
this.setFormValidity(true);
|
|
216
217
|
if (!element.checkValidity()) {
|
|
217
218
|
return {
|
|
218
219
|
errors: errors.concat(Object.keys(form_tokens_1.InputValidityState)
|
|
@@ -270,6 +271,7 @@ class FormGroup {
|
|
|
270
271
|
setFormValidity(validity = true) {
|
|
271
272
|
this.valid = validity;
|
|
272
273
|
this.invalid = !validity;
|
|
274
|
+
this.getParentElement().requestUpdate();
|
|
273
275
|
}
|
|
274
276
|
resetErrors() {
|
|
275
277
|
this.errors = Object.keys(this.errors).reduce((object, key) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdi/forms",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.210",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"author": "Kristiyan Tachev",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"build": "tsc"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@rxdi/lit-html": "^0.7.
|
|
15
|
+
"@rxdi/lit-html": "^0.7.209",
|
|
16
16
|
"@types/node": "^25.0.3",
|
|
17
17
|
"rxjs": "^7.8.2",
|
|
18
18
|
"typescript": "^5.9.3"
|