@live-change/vue3-components 0.2.11 → 0.2.12
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/form/DefinedForm.vue +14 -10
- package/package.json +2 -2
package/form/DefinedForm.vue
CHANGED
|
@@ -530,6 +530,17 @@
|
|
|
530
530
|
//console.log("Form after reset", JSON.stringify(this.formRoot.getValue(), null, ' '))
|
|
531
531
|
},
|
|
532
532
|
|
|
533
|
+
getValidationContext(srcContext) {
|
|
534
|
+
const context = {
|
|
535
|
+
...(srcContext || { parameters: this.parameters }),
|
|
536
|
+
...this.provided,
|
|
537
|
+
source: this.definition,
|
|
538
|
+
props: this.formRoot.getValue(),
|
|
539
|
+
form: this
|
|
540
|
+
}
|
|
541
|
+
return context
|
|
542
|
+
},
|
|
543
|
+
|
|
533
544
|
addValidator(name, validator) {
|
|
534
545
|
this.getNode(name).validators.push(validator)
|
|
535
546
|
},
|
|
@@ -539,18 +550,11 @@
|
|
|
539
550
|
if(id == -1) throw new Error("validator not found")
|
|
540
551
|
validators.splice(id)
|
|
541
552
|
},
|
|
542
|
-
validateField(name) {
|
|
543
|
-
return this.getNode(name).validate(this.
|
|
553
|
+
validateField(name, context) {
|
|
554
|
+
return this.getNode(name).validate(this.getValidationContext(context))
|
|
544
555
|
},
|
|
545
556
|
validate(context) {
|
|
546
|
-
context
|
|
547
|
-
...(context || { parameters: this.parameters }),
|
|
548
|
-
...this.provided,
|
|
549
|
-
source: this.definition,
|
|
550
|
-
props: this.formRoot.getValue(),
|
|
551
|
-
form: this
|
|
552
|
-
}
|
|
553
|
-
return this.formRoot.validate(context)
|
|
557
|
+
return this.formRoot.validate(this.getValidationContext(context))
|
|
554
558
|
},
|
|
555
559
|
clearFieldValidation(name) {
|
|
556
560
|
this.getNode(name).clearValidation()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/vue3-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Live Change Framework - vue components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"mitt": "3.0.0",
|
|
27
27
|
"vue": "^3.2.33"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "3120e4e5c5c96e017cf66bb8172a3f6f96baea84"
|
|
30
30
|
}
|