tuain-ng-forms-lib 12.0.84 → 12.0.87
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/bundles/tuain-ng-forms-lib.umd.js +21 -10
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/field.js +12 -2
- package/esm2015/lib/components/forms/basic-form.js +11 -10
- package/fesm2015/tuain-ng-forms-lib.js +21 -10
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/package.json +1 -1
|
@@ -697,11 +697,21 @@ class FieldDescriptor extends FormElement {
|
|
|
697
697
|
if (fieldCurrentValue === undefined || fieldCurrentValue === null) {
|
|
698
698
|
return true;
|
|
699
699
|
}
|
|
700
|
-
if (
|
|
700
|
+
if (this.fieldType === this._formConfig.fieldTypes.array
|
|
701
701
|
&& Array.isArray(fieldCurrentValue) && fieldCurrentValue.length === 0) {
|
|
702
702
|
return true;
|
|
703
703
|
}
|
|
704
704
|
;
|
|
705
|
+
if (this.fieldType === this._formConfig.fieldTypes.phone) {
|
|
706
|
+
if (!Array.isArray(fieldCurrentValue)) {
|
|
707
|
+
return true;
|
|
708
|
+
}
|
|
709
|
+
if (fieldCurrentValue.length !== 2 || !fieldCurrentValue[0] || !fieldCurrentValue[1]) {
|
|
710
|
+
return true;
|
|
711
|
+
}
|
|
712
|
+
return false;
|
|
713
|
+
}
|
|
714
|
+
;
|
|
705
715
|
return fieldCurrentValue === '';
|
|
706
716
|
}
|
|
707
717
|
getValue() {
|
|
@@ -2530,17 +2540,18 @@ class BasicFormComponent {
|
|
|
2530
2540
|
return (name) ? ((_b = (_a = this.extraData) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null) : null;
|
|
2531
2541
|
}
|
|
2532
2542
|
preocessInputParams(params) {
|
|
2533
|
-
var _a, _b, _c;
|
|
2543
|
+
var _a, _b, _c, _d;
|
|
2534
2544
|
this._controlToken = (_a = params === null || params === void 0 ? void 0 : params[TOKEN]) !== null && _a !== void 0 ? _a : null;
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2545
|
+
this.formSubject = (_b = params === null || params === void 0 ? void 0 : params[SUBJECT]) !== null && _b !== void 0 ? _b : null;
|
|
2546
|
+
const tokenInfo = (this._controlToken) ? this.formManagerService.getFormInfo(this._controlToken) : {};
|
|
2547
|
+
const { token, subject, state, fields, extra, originToken } = tokenInfo;
|
|
2548
|
+
if (token && this._controlToken === token) {
|
|
2549
|
+
this.formSubject = (_d = (_c = this.formSubject) !== null && _c !== void 0 ? _c : subject) !== null && _d !== void 0 ? _d : null;
|
|
2550
|
+
this.inputDataFields = fields;
|
|
2551
|
+
this.extraData = extra;
|
|
2552
|
+
this._originToken = originToken;
|
|
2553
|
+
return state;
|
|
2538
2554
|
}
|
|
2539
|
-
this.formSubject = (_c = (_b = params === null || params === void 0 ? void 0 : params[SUBJECT]) !== null && _b !== void 0 ? _b : subject) !== null && _c !== void 0 ? _c : null;
|
|
2540
|
-
this.inputDataFields = fields;
|
|
2541
|
-
this.extraData = extra;
|
|
2542
|
-
this._originToken = originToken;
|
|
2543
|
-
return state;
|
|
2544
2555
|
}
|
|
2545
2556
|
subscribeSectionActivation() {
|
|
2546
2557
|
const formSections = this._formStructure.sections;
|