@sumaris-net/ngx-components 1.19.2 → 1.19.3
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/sumaris-net.ngx-components.umd.js +70 -25
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +3 -0
- package/esm2015/src/app/core/auth/form/form-auth.js +26 -20
- package/esm2015/src/app/core/form/form.class.js +27 -7
- package/fesm2015/sumaris-net.ngx-components.js +50 -24
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/auth/form/form-auth.d.ts +1 -1
- package/src/app/core/form/form.class.d.ts +8 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -19663,12 +19663,41 @@
|
|
|
19663
19663
|
AppForm.prototype.cancel = function () {
|
|
19664
19664
|
this.onCancel.emit();
|
|
19665
19665
|
};
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19666
|
+
/**
|
|
19667
|
+
*
|
|
19668
|
+
* @param event
|
|
19669
|
+
* @param opts allow to skip validation check, using {checkValid: false}
|
|
19670
|
+
*/
|
|
19671
|
+
AppForm.prototype.doSubmit = function (event, opts) {
|
|
19672
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19673
|
+
return __generator(this, function (_b) {
|
|
19674
|
+
switch (_b.label) {
|
|
19675
|
+
case 0:
|
|
19676
|
+
if (!this._form) {
|
|
19677
|
+
this.markAllAsTouched({ emitEvent: true });
|
|
19678
|
+
return [2 /*return*/];
|
|
19679
|
+
}
|
|
19680
|
+
if (!((!opts || opts.checkValid !== false) && !this._form.valid)) return [3 /*break*/, 2];
|
|
19681
|
+
// Wait validation end
|
|
19682
|
+
return [4 /*yield*/, AppFormUtils.waitWhilePending(this._form)];
|
|
19683
|
+
case 1:
|
|
19684
|
+
// Wait validation end
|
|
19685
|
+
_b.sent();
|
|
19686
|
+
// Form is invalid: exit (+ log if debug)
|
|
19687
|
+
if (this._form.invalid) {
|
|
19688
|
+
this.markAllAsTouched({ emitEvent: true });
|
|
19689
|
+
if (this.debug)
|
|
19690
|
+
AppFormUtils.logFormErrors(this._form);
|
|
19691
|
+
return [2 /*return*/];
|
|
19692
|
+
}
|
|
19693
|
+
_b.label = 2;
|
|
19694
|
+
case 2:
|
|
19695
|
+
// Emit event
|
|
19696
|
+
this.onSubmit.emit(event);
|
|
19697
|
+
return [2 /*return*/];
|
|
19698
|
+
}
|
|
19699
|
+
});
|
|
19700
|
+
});
|
|
19672
19701
|
};
|
|
19673
19702
|
AppForm.prototype.setForm = function (form) {
|
|
19674
19703
|
var _this = this;
|
|
@@ -20953,25 +20982,41 @@
|
|
|
20953
20982
|
this.onCancel.emit();
|
|
20954
20983
|
};
|
|
20955
20984
|
AuthForm.prototype.doSubmit = function (event) {
|
|
20956
|
-
|
|
20957
|
-
|
|
20958
|
-
|
|
20959
|
-
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
20972
|
-
|
|
20973
|
-
|
|
20974
|
-
|
|
20985
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20986
|
+
var data;
|
|
20987
|
+
var _this = this;
|
|
20988
|
+
return __generator(this, function (_a) {
|
|
20989
|
+
switch (_a.label) {
|
|
20990
|
+
case 0:
|
|
20991
|
+
if (event) {
|
|
20992
|
+
event.preventDefault();
|
|
20993
|
+
event.stopPropagation();
|
|
20994
|
+
}
|
|
20995
|
+
if (this.loading)
|
|
20996
|
+
return [2 /*return*/];
|
|
20997
|
+
if (!!this.form.valid) return [3 /*break*/, 2];
|
|
20998
|
+
return [4 /*yield*/, AppFormUtils.waitWhilePending(this.form)];
|
|
20999
|
+
case 1:
|
|
21000
|
+
_a.sent();
|
|
21001
|
+
if (this.form.invalid) {
|
|
21002
|
+
AppFormUtils.logFormErrors(this.form);
|
|
21003
|
+
return [2 /*return*/]; // Skip if invalid
|
|
21004
|
+
}
|
|
21005
|
+
_a.label = 2;
|
|
21006
|
+
case 2:
|
|
21007
|
+
this.markAsLoading();
|
|
21008
|
+
data = this.form.value;
|
|
21009
|
+
this.showPwd = false; // Hide password
|
|
21010
|
+
this.error = null; // Reset error
|
|
21011
|
+
setTimeout(function () { return _this.onSubmit.emit({
|
|
21012
|
+
username: data.username,
|
|
21013
|
+
password: data.password,
|
|
21014
|
+
offline: data.offline
|
|
21015
|
+
}); });
|
|
21016
|
+
return [2 /*return*/];
|
|
21017
|
+
}
|
|
21018
|
+
});
|
|
21019
|
+
});
|
|
20975
21020
|
};
|
|
20976
21021
|
AuthForm.prototype.register = function () {
|
|
20977
21022
|
var _this = this;
|