@firestitch/form 13.3.0 → 13.3.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/app/directives/validators/url.directive.d.ts +1 -1
- package/esm2020/app/components/confirm-unsaved/confirm-unsaved.component.mjs +1 -1
- package/esm2020/app/components/confirm-unsaved/index.mjs +1 -1
- package/esm2020/app/directives/form/form.directive.mjs +2 -2
- package/esm2020/app/directives/validators/url.directive.mjs +8 -10
- package/esm2020/app/validators/validators.mjs +7 -11
- package/fesm2015/firestitch-form.mjs +9 -15
- package/fesm2015/firestitch-form.mjs.map +1 -1
- package/fesm2020/firestitch-form.mjs +9 -15
- package/fesm2020/firestitch-form.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -722,9 +722,9 @@ class FsFormDirective {
|
|
|
722
722
|
this.ngForm.form.registerControl = (name, control) => {
|
|
723
723
|
const el = this._element.nativeElement.querySelector(`input[name='${name}']`);
|
|
724
724
|
if (el) {
|
|
725
|
-
el.setAttribute('name', `${name}_${guid()}`);
|
|
726
725
|
if (!el.getAttribute('autocomplete')) {
|
|
727
726
|
el.setAttribute('autocomplete', 'none');
|
|
727
|
+
el.setAttribute('name', `${name}_${guid()}`);
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
return this._registerControl(name, control);
|
|
@@ -1577,17 +1577,13 @@ class FsValidators {
|
|
|
1577
1577
|
if (isEmpty(control.value) || isNumeric(control.value)) {
|
|
1578
1578
|
return null;
|
|
1579
1579
|
}
|
|
1580
|
-
|
|
1581
|
-
return { numeric: true };
|
|
1582
|
-
}
|
|
1580
|
+
return { numeric: true };
|
|
1583
1581
|
}
|
|
1584
1582
|
static integer(control) {
|
|
1585
1583
|
if (!control.value || String(control.value) === '' || (control.value % 1 === 0)) {
|
|
1586
1584
|
return null;
|
|
1587
1585
|
}
|
|
1588
|
-
|
|
1589
|
-
return { integer: true };
|
|
1590
|
-
}
|
|
1586
|
+
return { integer: true };
|
|
1591
1587
|
}
|
|
1592
1588
|
static phone(control) {
|
|
1593
1589
|
if (!control.value || phone(control.value)) {
|
|
@@ -1630,8 +1626,8 @@ class FsValidators {
|
|
|
1630
1626
|
result = formFunction(control, data);
|
|
1631
1627
|
}
|
|
1632
1628
|
catch (err) {
|
|
1633
|
-
|
|
1634
|
-
stream$ = throwError(
|
|
1629
|
+
const error = err instanceof Error ? err.message : err;
|
|
1630
|
+
stream$ = throwError(error);
|
|
1635
1631
|
}
|
|
1636
1632
|
if (!stream$) {
|
|
1637
1633
|
if (result instanceof Promise) {
|
|
@@ -2303,7 +2299,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
2303
2299
|
class FsFormUrlDirective extends FsControlDirective {
|
|
2304
2300
|
constructor() {
|
|
2305
2301
|
super(...arguments);
|
|
2306
|
-
this.fsFormUrlProtocol =
|
|
2302
|
+
this.fsFormUrlProtocol = true;
|
|
2307
2303
|
}
|
|
2308
2304
|
set validationMessage(value) {
|
|
2309
2305
|
this._validateMessages.url = value;
|
|
@@ -2315,21 +2311,19 @@ class FsFormUrlDirective extends FsControlDirective {
|
|
|
2315
2311
|
if (isEnabled(this.fsFormUrl)) {
|
|
2316
2312
|
return FsValidators.url(this._control, this.fsFormUrlProtocol);
|
|
2317
2313
|
}
|
|
2318
|
-
|
|
2319
|
-
return null;
|
|
2320
|
-
}
|
|
2314
|
+
return null;
|
|
2321
2315
|
}
|
|
2322
2316
|
}
|
|
2323
2317
|
FsFormUrlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormUrlDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
2324
2318
|
FsFormUrlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsFormUrlDirective, selector: "[fsFormUrl]", inputs: { fsFormUrl: "fsFormUrl", fsFormUrlProtocol: "fsFormUrlProtocol", validationMessage: ["fsFormUrlMessage", "validationMessage"] }, providers: [
|
|
2325
|
-
VALIDATE_MESSAGE_PROVIDER
|
|
2319
|
+
VALIDATE_MESSAGE_PROVIDER,
|
|
2326
2320
|
], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
2327
2321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormUrlDirective, decorators: [{
|
|
2328
2322
|
type: Directive,
|
|
2329
2323
|
args: [{
|
|
2330
2324
|
selector: '[fsFormUrl]',
|
|
2331
2325
|
providers: [
|
|
2332
|
-
VALIDATE_MESSAGE_PROVIDER
|
|
2326
|
+
VALIDATE_MESSAGE_PROVIDER,
|
|
2333
2327
|
],
|
|
2334
2328
|
}]
|
|
2335
2329
|
}], propDecorators: { fsFormUrl: [{
|