@sumaris-net/ngx-components 2.7.1-rc1 → 2.7.1-rc2
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/esm2022/src/app/core/form/text-popover/text-popover.component.mjs +4 -4
- package/esm2022/src/app/shared/material/text/testing/text-form.testing.mjs +27 -18
- package/esm2022/src/app/shared/material/text/text-form.component.mjs +73 -15
- package/fesm2022/sumaris-net.ngx-components.mjs +122 -56
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/material/text/testing/text-form.testing.d.ts +10 -4
- package/src/app/shared/material/text/text-form.component.d.ts +20 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, Directive, Injectable, Pipe, EventEmitter, Output, Optional, Inject, NgModule, forwardRef, Component, ChangeDetectionStrategy, Input, ViewChildren, HostBinding, HostListener, ElementRef, ViewChild, ANIMATION_MODULE_TYPE, inject, ChangeDetectorRef, ContentChild, CUSTOM_ELEMENTS_SCHEMA, ViewEncapsulation, APP_INITIALIZER } from '@angular/core';
|
|
3
|
-
import { firstValueFrom, shareReplay, tap, of, Subject, merge, timer, isObservable, from, Subscription, BehaviorSubject, fromEvent, noop as noop$
|
|
3
|
+
import { firstValueFrom, shareReplay, tap, of, Subject, merge, timer, isObservable, from, Subscription, BehaviorSubject, fromEvent, noop as noop$a, Observable, forkJoin, defer, timeout, fromEventPattern, interval, combineLatest, mergeMap as mergeMap$1, EMPTY, iif, delay } from 'rxjs';
|
|
4
4
|
import { catchError, map, first, tap as tap$1, switchMap, takeUntil, filter, debounceTime, startWith, distinctUntilChanged, mergeMap, skip, throttleTime, bufferWhen, mapTo, distinctUntilKeyChanged, take } from 'rxjs/operators';
|
|
5
5
|
import * as i2 from '@angular/common/http';
|
|
6
6
|
import { HttpEventType, HttpClient, HttpHeaders, HttpResponse, HttpClientModule } from '@angular/common/http';
|
|
@@ -5478,7 +5478,7 @@ const DEFAULT_VALUE_ACCESSOR$5 = {
|
|
|
5478
5478
|
};
|
|
5479
5479
|
const HOUR_TIME_PATTERN = /[0-9]\d\d:[0-5]\d/;
|
|
5480
5480
|
const DURATION_MASK = [/\d/, /\d/, /\d/, ':', /[0-5]/, /\d/];
|
|
5481
|
-
const noop$
|
|
5481
|
+
const noop$9 = () => {
|
|
5482
5482
|
};
|
|
5483
5483
|
class MatDuration {
|
|
5484
5484
|
dateAdapter;
|
|
@@ -5487,8 +5487,8 @@ class MatDuration {
|
|
|
5487
5487
|
cd;
|
|
5488
5488
|
formGroupDir;
|
|
5489
5489
|
_subscription = new Subscription();
|
|
5490
|
-
_onChangeCallback = noop$
|
|
5491
|
-
_onTouchedCallback = noop$
|
|
5490
|
+
_onChangeCallback = noop$9;
|
|
5491
|
+
_onTouchedCallback = noop$9;
|
|
5492
5492
|
writing = true;
|
|
5493
5493
|
disabling = false;
|
|
5494
5494
|
_tabindex;
|
|
@@ -6106,7 +6106,7 @@ const DEFAULT_VALUE_ACCESSOR$4 = {
|
|
|
6106
6106
|
useExisting: forwardRef(() => MatBooleanField),
|
|
6107
6107
|
multi: true,
|
|
6108
6108
|
};
|
|
6109
|
-
const noop$
|
|
6109
|
+
const noop$8 = () => { };
|
|
6110
6110
|
class MatBooleanField {
|
|
6111
6111
|
cd;
|
|
6112
6112
|
formGroupDir;
|
|
@@ -6139,8 +6139,8 @@ class MatBooleanField {
|
|
|
6139
6139
|
showRadio = false;
|
|
6140
6140
|
_value;
|
|
6141
6141
|
_tabindex;
|
|
6142
|
-
_onChangeCallback = noop$
|
|
6143
|
-
_onTouchedCallback = noop$
|
|
6142
|
+
_onChangeCallback = noop$8;
|
|
6143
|
+
_onTouchedCallback = noop$8;
|
|
6144
6144
|
_writing = false;
|
|
6145
6145
|
constructor(cd, formGroupDir) {
|
|
6146
6146
|
this.cd = cd;
|
|
@@ -6770,15 +6770,15 @@ class MatAutocompleteFieldUtils {
|
|
|
6770
6770
|
}
|
|
6771
6771
|
}
|
|
6772
6772
|
|
|
6773
|
-
const noop$
|
|
6773
|
+
const noop$7 = (_) => { };
|
|
6774
6774
|
class MatAutocompleteField {
|
|
6775
6775
|
cd;
|
|
6776
6776
|
modalController;
|
|
6777
6777
|
renderer;
|
|
6778
6778
|
viewRef;
|
|
6779
6779
|
formGroupDir;
|
|
6780
|
-
_onChangeCallback = noop$
|
|
6781
|
-
_onTouchedCallback = noop$
|
|
6780
|
+
_onChangeCallback = noop$7;
|
|
6781
|
+
_onTouchedCallback = noop$7;
|
|
6782
6782
|
_onFetchMoreCallback;
|
|
6783
6783
|
_implicitValue;
|
|
6784
6784
|
_subscription = new Subscription();
|
|
@@ -7800,15 +7800,15 @@ const MASKS = {
|
|
|
7800
7800
|
DD: [/[+-]/, D, D, D, '.', D, D, D, D, D, D, D, '°']
|
|
7801
7801
|
}
|
|
7802
7802
|
};
|
|
7803
|
-
const noop$
|
|
7803
|
+
const noop$6 = () => {
|
|
7804
7804
|
};
|
|
7805
7805
|
class MatLatLongField {
|
|
7806
7806
|
formBuilder;
|
|
7807
7807
|
cd;
|
|
7808
7808
|
formGroupDir;
|
|
7809
7809
|
_defaults;
|
|
7810
|
-
_onChangeCallback = noop$
|
|
7811
|
-
_onTouchedCallback = noop$
|
|
7810
|
+
_onChangeCallback = noop$6;
|
|
7811
|
+
_onTouchedCallback = noop$6;
|
|
7812
7812
|
_subscription = new Subscription();
|
|
7813
7813
|
_formatOptions;
|
|
7814
7814
|
_disabling = false;
|
|
@@ -8258,15 +8258,15 @@ const DEFAULT_VALUE_ACCESSOR$3 = {
|
|
|
8258
8258
|
useExisting: forwardRef(() => MatDate),
|
|
8259
8259
|
multi: true
|
|
8260
8260
|
};
|
|
8261
|
-
const noop$
|
|
8261
|
+
const noop$5 = () => { };
|
|
8262
8262
|
class MatDate {
|
|
8263
8263
|
dateAdapter;
|
|
8264
8264
|
translate;
|
|
8265
8265
|
formBuilder;
|
|
8266
8266
|
cd;
|
|
8267
8267
|
formGroupDir;
|
|
8268
|
-
_onChangeCallback = noop$
|
|
8269
|
-
_onTouchedCallback = noop$
|
|
8268
|
+
_onChangeCallback = noop$5;
|
|
8269
|
+
_onTouchedCallback = noop$5;
|
|
8270
8270
|
_subscription = new Subscription();
|
|
8271
8271
|
_writing = true;
|
|
8272
8272
|
_disabling = false;
|
|
@@ -8655,7 +8655,7 @@ const DEFAULT_VALUE_ACCESSOR$2 = {
|
|
|
8655
8655
|
multi: true
|
|
8656
8656
|
};
|
|
8657
8657
|
const TIME_REGEXP = /^[012][0-9][:][012345][0-9]$/;
|
|
8658
|
-
const noop$
|
|
8658
|
+
const noop$4 = () => { };
|
|
8659
8659
|
class MatDateTime {
|
|
8660
8660
|
dateAdapter;
|
|
8661
8661
|
translate;
|
|
@@ -8663,8 +8663,8 @@ class MatDateTime {
|
|
|
8663
8663
|
cd;
|
|
8664
8664
|
formGroupDir;
|
|
8665
8665
|
_defaults;
|
|
8666
|
-
_onChangeCallback = noop$
|
|
8667
|
-
_onTouchedCallback = noop$
|
|
8666
|
+
_onChangeCallback = noop$4;
|
|
8667
|
+
_onTouchedCallback = noop$4;
|
|
8668
8668
|
_subscription = new Subscription();
|
|
8669
8669
|
_controlSubscription;
|
|
8670
8670
|
_writing = true;
|
|
@@ -9234,15 +9234,15 @@ const DEFAULT_VALUE_ACCESSOR$1 = {
|
|
|
9234
9234
|
useExisting: forwardRef(() => MatDateShort),
|
|
9235
9235
|
multi: true
|
|
9236
9236
|
};
|
|
9237
|
-
const noop$
|
|
9237
|
+
const noop$3 = () => { };
|
|
9238
9238
|
class MatDateShort {
|
|
9239
9239
|
dateAdapter;
|
|
9240
9240
|
translate;
|
|
9241
9241
|
formBuilder;
|
|
9242
9242
|
cd;
|
|
9243
9243
|
formGroupDir;
|
|
9244
|
-
_onChangeCallback = noop$
|
|
9245
|
-
_onTouchedCallback = noop$
|
|
9244
|
+
_onChangeCallback = noop$3;
|
|
9245
|
+
_onTouchedCallback = noop$3;
|
|
9246
9246
|
_subscription = new Subscription();
|
|
9247
9247
|
_writing = true;
|
|
9248
9248
|
_disabling = false;
|
|
@@ -10357,8 +10357,8 @@ const DEFAULT_VALUE_ACCESSOR = {
|
|
|
10357
10357
|
class MatSwipeField {
|
|
10358
10358
|
cd;
|
|
10359
10359
|
formGroupDir;
|
|
10360
|
-
_onChangeCallback = noop$
|
|
10361
|
-
_onTouchedCallback = noop$
|
|
10360
|
+
_onChangeCallback = noop$a;
|
|
10361
|
+
_onTouchedCallback = noop$a;
|
|
10362
10362
|
_value;
|
|
10363
10363
|
_subscription = new Subscription();
|
|
10364
10364
|
_itemsSubscription;
|
|
@@ -10742,12 +10742,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
|
|
|
10742
10742
|
}]
|
|
10743
10743
|
}] });
|
|
10744
10744
|
|
|
10745
|
-
const noop$
|
|
10745
|
+
const noop$2 = () => { };
|
|
10746
10746
|
class MatChipsField {
|
|
10747
10747
|
cd;
|
|
10748
10748
|
formGroupDir;
|
|
10749
|
-
_onChangeCallback = noop$
|
|
10750
|
-
_onTouchedCallback = noop$
|
|
10749
|
+
_onChangeCallback = noop$2;
|
|
10750
|
+
_onTouchedCallback = noop$2;
|
|
10751
10751
|
equals;
|
|
10752
10752
|
logPrefix = '[mat-chips] ';
|
|
10753
10753
|
formControl;
|
|
@@ -12520,10 +12520,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
|
|
|
12520
12520
|
type: Output
|
|
12521
12521
|
}] } });
|
|
12522
12522
|
|
|
12523
|
+
const noop$1 = () => { };
|
|
12523
12524
|
class TextForm extends AppForm {
|
|
12524
12525
|
injector;
|
|
12525
12526
|
cd;
|
|
12526
12527
|
formBuilder;
|
|
12528
|
+
formGroupDir;
|
|
12527
12529
|
showError = true;
|
|
12528
12530
|
placeholder;
|
|
12529
12531
|
multiline = true;
|
|
@@ -12531,18 +12533,29 @@ class TextForm extends AppForm {
|
|
|
12531
12533
|
maxLength = 2000;
|
|
12532
12534
|
autofocus = false;
|
|
12533
12535
|
validator = null;
|
|
12536
|
+
standalone = false;
|
|
12537
|
+
formControl;
|
|
12538
|
+
formControlName;
|
|
12534
12539
|
textAreaChanges = new EventEmitter();
|
|
12535
12540
|
textArea;
|
|
12536
12541
|
textInput;
|
|
12537
12542
|
autosizeDirective;
|
|
12538
|
-
|
|
12539
|
-
|
|
12543
|
+
textControl;
|
|
12544
|
+
_onChangeCallback = noop$1;
|
|
12545
|
+
_onTouchedCallback = noop$1;
|
|
12546
|
+
constructor(injector, cd, formBuilder, formGroupDir) {
|
|
12540
12547
|
super(injector);
|
|
12541
12548
|
this.injector = injector;
|
|
12542
12549
|
this.cd = cd;
|
|
12543
12550
|
this.formBuilder = formBuilder;
|
|
12551
|
+
this.formGroupDir = formGroupDir;
|
|
12544
12552
|
}
|
|
12545
12553
|
ngOnInit() {
|
|
12554
|
+
if (!this.standalone) {
|
|
12555
|
+
this.formControl = this.formControl || this.formControlName && this.formGroupDir && this.formGroupDir.form.get(this.formControlName);
|
|
12556
|
+
if (!this.formControl)
|
|
12557
|
+
throw new Error('Missing mandatory attribute \'formControl\' or \'formControlName\' in <mat-date-field>.');
|
|
12558
|
+
}
|
|
12546
12559
|
// Compute validators
|
|
12547
12560
|
const validators = isNotNil(this.maxLength) && this.maxLength > 0 ? [Validators.maxLength(this.maxLength)] : [];
|
|
12548
12561
|
if (this.validator)
|
|
@@ -12551,13 +12564,18 @@ class TextForm extends AppForm {
|
|
|
12551
12564
|
const form = this.formBuilder.group({
|
|
12552
12565
|
text: [null, validators.length ? Validators.compose(validators) : null]
|
|
12553
12566
|
});
|
|
12554
|
-
this.control = form.get('text');
|
|
12555
12567
|
this.setForm(form);
|
|
12568
|
+
this.textControl = form.get('text');
|
|
12569
|
+
this.registerSubscription(this.textControl.valueChanges.subscribe(value => {
|
|
12570
|
+
if (this.standalone) {
|
|
12571
|
+
this.textAreaChanges.emit(value);
|
|
12572
|
+
}
|
|
12573
|
+
else {
|
|
12574
|
+
this.textFormValueChanged(value);
|
|
12575
|
+
}
|
|
12576
|
+
}));
|
|
12556
12577
|
super.ngOnInit();
|
|
12557
12578
|
}
|
|
12558
|
-
textAreaChanged(event) {
|
|
12559
|
-
this.textAreaChanges.emit(this.control.value);
|
|
12560
|
-
}
|
|
12561
12579
|
containerResize() {
|
|
12562
12580
|
this.autosizeDirective?.resizeToFitContent(true);
|
|
12563
12581
|
}
|
|
@@ -12567,17 +12585,49 @@ class TextForm extends AppForm {
|
|
|
12567
12585
|
if (this.textInput)
|
|
12568
12586
|
focusInput(this.textInput);
|
|
12569
12587
|
}
|
|
12588
|
+
registerOnChange(fn) {
|
|
12589
|
+
this._onChangeCallback = fn;
|
|
12590
|
+
}
|
|
12591
|
+
registerOnTouched(fn) {
|
|
12592
|
+
this._onTouchedCallback = fn;
|
|
12593
|
+
}
|
|
12594
|
+
setDisabledState(isDisabled) {
|
|
12595
|
+
if (isDisabled) {
|
|
12596
|
+
this.textControl.disable({ emitEvent: false });
|
|
12597
|
+
}
|
|
12598
|
+
else {
|
|
12599
|
+
this.textControl.enable({ emitEvent: false });
|
|
12600
|
+
}
|
|
12601
|
+
this.markForCheck();
|
|
12602
|
+
}
|
|
12603
|
+
writeValue(value) {
|
|
12604
|
+
this.textControl.patchValue(value);
|
|
12605
|
+
}
|
|
12570
12606
|
markForCheck() {
|
|
12571
12607
|
this.cd.markForCheck();
|
|
12572
12608
|
}
|
|
12573
|
-
|
|
12574
|
-
|
|
12609
|
+
checkIfTouched(opts) {
|
|
12610
|
+
if (this.textControl.touched) {
|
|
12611
|
+
this._onTouchedCallback();
|
|
12612
|
+
if (!opts || opts.emitEvent !== false) {
|
|
12613
|
+
this.markForCheck();
|
|
12614
|
+
}
|
|
12615
|
+
}
|
|
12616
|
+
}
|
|
12617
|
+
textFormValueChanged(value) {
|
|
12618
|
+
if (this.formControl.value !== value) {
|
|
12619
|
+
this._onChangeCallback(value);
|
|
12620
|
+
this.checkIfTouched();
|
|
12621
|
+
}
|
|
12622
|
+
}
|
|
12623
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: TextForm, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }, { token: i1$2.UntypedFormBuilder }, { token: i1$2.FormGroupDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
12624
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: TextForm, selector: "app-text-form", inputs: { showError: "showError", placeholder: "placeholder", multiline: "multiline", autoHeight: "autoHeight", maxLength: "maxLength", autofocus: "autofocus", validator: "validator", standalone: "standalone", formControl: "formControl", formControlName: "formControlName" }, outputs: { textAreaChanges: "textAreaChanges" }, providers: [
|
|
12575
12625
|
{
|
|
12576
12626
|
provide: NG_VALUE_ACCESSOR,
|
|
12577
12627
|
useExisting: forwardRef(() => TextForm),
|
|
12578
|
-
multi: true
|
|
12628
|
+
multi: true
|
|
12579
12629
|
}
|
|
12580
|
-
], viewQueries: [{ propertyName: "textArea", first: true, predicate: ["textArea"], descendants: true }, { propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true }, { propertyName: "autosizeDirective", first: true, predicate: CdkTextareaAutosize, descendants: true }], usesInheritance: true, ngImport: i0, template: "<form class=\"form-container\" [formGroup]=\"form\" (ngSubmit)=\"onSubmit.emit($event)\">\n <mat-form-field *ngIf=\"multiline; else monoline\">\n <mat-label *ngIf=\"placeholder\">{{placeholder}}</mat-label>\n <textarea\n #textArea\n matInput\n [formControl]=\"
|
|
12630
|
+
], viewQueries: [{ propertyName: "textArea", first: true, predicate: ["textArea"], descendants: true }, { propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true }, { propertyName: "autosizeDirective", first: true, predicate: CdkTextareaAutosize, descendants: true }], usesInheritance: true, ngImport: i0, template: "<form class=\"form-container\" [formGroup]=\"form\" (ngSubmit)=\"onSubmit.emit($event)\">\n <mat-form-field *ngIf=\"multiline; else monoline\">\n <mat-label *ngIf=\"placeholder\">{{placeholder}}</mat-label>\n <textarea\n #textArea\n matInput\n [formControl]=\"textControl\"\n [readonly]=\"textControl.disabled\"\n [class.fixed-height]=\"!autoHeight\"\n [cdkTextareaAutosize]=\"autoHeight\"\n (keydown.control.enter)=\"onSubmit.emit($event)\"\n [autofocus]=\"autofocus\"\n ></textarea>\n <mat-error *ngIf=\"textControl.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH' | translate: textControl.errors['maxlength'] }}\n </mat-error>\n <mat-hint *ngIf=\"maxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: textArea.value?.length || 0, max: maxLength } }}\n </mat-hint>\n </mat-form-field>\n <ng-template #monoline>\n <mat-form-field>\n <mat-label *ngIf=\"placeholder\">{{placeholder}}</mat-label>\n <input\n #textInput\n matInput\n [formControl]=\"textControl\"\n [readonly]=\"textControl.disabled\"\n [appAutofocus]=\"autofocus\"\n (keydown.control.enter)=\"onSubmit.emit($event)\"\n />\n <mat-error *ngIf=\"textControl.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH' | translate: textControl.errors['maxlength'] }}\n </mat-error>\n <mat-error *ngIf=\"textControl.hasError('pattern')\">\n {{ 'ERROR.FIELD_INVALID' | translate }}\n </mat-error>\n <mat-error [class.cdk-visually-hidden]=\"!errorSpan.innerHTML.trim()\">\n <span #errorSpan>\n <ng-content select=\"[matError]\"></ng-content>\n </span>\n </mat-error>\n <mat-hint *ngIf=\"maxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: textInput.value?.length || 0, max: maxLength } }}\n </mat-hint>\n </mat-form-field>\n </ng-template>\n</form>\n", styles: ["textarea{--textarea-height: 11.5em;max-height:var(--textarea-height)}textarea.fixed-height{height:var(--textarea-height)}\n"], dependencies: [{ kind: "directive", type: i2$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i6.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: AutofocusDirective, selector: "[autofocus], input[appAutofocus]", inputs: ["appAutofocus", "autofocusDelay"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12581
12631
|
}
|
|
12582
12632
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: TextForm, decorators: [{
|
|
12583
12633
|
type: Component,
|
|
@@ -12585,10 +12635,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
|
|
|
12585
12635
|
{
|
|
12586
12636
|
provide: NG_VALUE_ACCESSOR,
|
|
12587
12637
|
useExisting: forwardRef(() => TextForm),
|
|
12588
|
-
multi: true
|
|
12638
|
+
multi: true
|
|
12589
12639
|
}
|
|
12590
|
-
], template: "<form class=\"form-container\" [formGroup]=\"form\" (ngSubmit)=\"onSubmit.emit($event)\">\n <mat-form-field *ngIf=\"multiline; else monoline\">\n <mat-label *ngIf=\"placeholder\">{{placeholder}}</mat-label>\n <textarea\n #textArea\n matInput\n [formControl]=\"
|
|
12591
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: i1$2.UntypedFormBuilder }
|
|
12640
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form class=\"form-container\" [formGroup]=\"form\" (ngSubmit)=\"onSubmit.emit($event)\">\n <mat-form-field *ngIf=\"multiline; else monoline\">\n <mat-label *ngIf=\"placeholder\">{{placeholder}}</mat-label>\n <textarea\n #textArea\n matInput\n [formControl]=\"textControl\"\n [readonly]=\"textControl.disabled\"\n [class.fixed-height]=\"!autoHeight\"\n [cdkTextareaAutosize]=\"autoHeight\"\n (keydown.control.enter)=\"onSubmit.emit($event)\"\n [autofocus]=\"autofocus\"\n ></textarea>\n <mat-error *ngIf=\"textControl.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH' | translate: textControl.errors['maxlength'] }}\n </mat-error>\n <mat-hint *ngIf=\"maxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: textArea.value?.length || 0, max: maxLength } }}\n </mat-hint>\n </mat-form-field>\n <ng-template #monoline>\n <mat-form-field>\n <mat-label *ngIf=\"placeholder\">{{placeholder}}</mat-label>\n <input\n #textInput\n matInput\n [formControl]=\"textControl\"\n [readonly]=\"textControl.disabled\"\n [appAutofocus]=\"autofocus\"\n (keydown.control.enter)=\"onSubmit.emit($event)\"\n />\n <mat-error *ngIf=\"textControl.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH' | translate: textControl.errors['maxlength'] }}\n </mat-error>\n <mat-error *ngIf=\"textControl.hasError('pattern')\">\n {{ 'ERROR.FIELD_INVALID' | translate }}\n </mat-error>\n <mat-error [class.cdk-visually-hidden]=\"!errorSpan.innerHTML.trim()\">\n <span #errorSpan>\n <ng-content select=\"[matError]\"></ng-content>\n </span>\n </mat-error>\n <mat-hint *ngIf=\"maxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: textInput.value?.length || 0, max: maxLength } }}\n </mat-hint>\n </mat-form-field>\n </ng-template>\n</form>\n", styles: ["textarea{--textarea-height: 11.5em;max-height:var(--textarea-height)}textarea.fixed-height{height:var(--textarea-height)}\n"] }]
|
|
12641
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: i1$2.UntypedFormBuilder }, { type: i1$2.FormGroupDirective, decorators: [{
|
|
12642
|
+
type: Optional
|
|
12643
|
+
}] }], propDecorators: { showError: [{
|
|
12592
12644
|
type: Input
|
|
12593
12645
|
}], placeholder: [{
|
|
12594
12646
|
type: Input
|
|
@@ -12602,6 +12654,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
|
|
|
12602
12654
|
type: Input
|
|
12603
12655
|
}], validator: [{
|
|
12604
12656
|
type: Input
|
|
12657
|
+
}], standalone: [{
|
|
12658
|
+
type: Input
|
|
12659
|
+
}], formControl: [{
|
|
12660
|
+
type: Input
|
|
12661
|
+
}], formControlName: [{
|
|
12662
|
+
type: Input
|
|
12605
12663
|
}], textAreaChanges: [{
|
|
12606
12664
|
type: Output
|
|
12607
12665
|
}], textArea: [{
|
|
@@ -16238,7 +16296,7 @@ class TextPopover {
|
|
|
16238
16296
|
async onValidate(event) {
|
|
16239
16297
|
await waitWhilePending(this.form);
|
|
16240
16298
|
if (!this.valid) {
|
|
16241
|
-
logFormErrors(this.form.
|
|
16299
|
+
logFormErrors(this.form.textControl);
|
|
16242
16300
|
return;
|
|
16243
16301
|
}
|
|
16244
16302
|
try {
|
|
@@ -16284,11 +16342,11 @@ class TextPopover {
|
|
|
16284
16342
|
return button?.side !== 'start';
|
|
16285
16343
|
}
|
|
16286
16344
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: TextPopover, deps: [{ token: i2$2.PopoverController }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
16287
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: TextPopover, selector: "app-text-popover", inputs: { showHeader: "showHeader", headerColor: "headerColor", showFooter: "showFooter", title: "title", text: "text", placeholder: "placeholder", editing: "editing", multiline: "multiline", autoHeight: "autoHeight", maxLength: "maxLength", autofocus: "autofocus", validator: "validator", headerButtons: "headerButtons", mobile: "mobile" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true, static: true }], ngImport: i0, template: "<ion-header *ngIf=\"showHeader\">\n <ion-toolbar [color]=\"headerColor\">\n <ion-buttons slot=\"start\">\n <ion-button *ngIf=\"mobile && editing\"\n (click)=\"cancel()\"\n [title]=\"'COMMON.BTN_CANCEL'|translate\">\n <ion-icon slot=\"icon-only\" name=\"arrow-back\"></ion-icon>\n </ion-button>\n <ion-button *ngFor=\"let button of headerButtons|arrayFilter: isStartSide\"\n [fill]=\"button.fill\"\n [color]=\"button.color\"\n (click)=\"clickButton(button)\">\n <ion-icon *ngIf=\"button.icon\" [slot]=\"button.text ? 'start' : 'icon-only'\" [name]=\"button.icon\"></ion-icon>\n <ion-text *ngIf=\"button.text\">{{button.text|translate}}</ion-text>\n </ion-button>\n </ion-buttons>\n\n <ion-title *ngIf=\"title\">{{title|translate}}</ion-title>\n\n <ion-buttons slot=\"end\">\n <ion-button *ngFor=\"let button of headerButtons|arrayFilter: isEndSide\"\n [fill]=\"button.fill\"\n [color]=\"button.color\"\n (click)=\"clickButton(button)\">\n <ion-icon *ngIf=\"button.icon\" [slot]=\"button.text ? 'start' : 'icon-only'\" [name]=\"button.icon\"></ion-icon>\n <ion-text *ngIf=\"button.text\">{{button.text|translate}}</ion-text>\n </ion-button>\n\n <ng-container *ngIf=\"mobile\">\n <ion-button *ngIf=\"editing\" (click)=\"onValidate($event)\"\n [disabled]=\"disabled\"\n [title]=\"'COMMON.BTN_VALIDATE_WITH_SHORTCUT_HELP'|translate\">\n <ion-icon slot=\"icon-only\" name=\"checkmark\"></ion-icon>\n </ion-button>\n <ion-button *ngIf=\"!editing\"\n (click)=\"cancel()\"\n [title]=\"'COMMON.BTN_CLOSE'|translate\">\n <ion-icon slot=\"icon-only\" name=\"close\"></ion-icon>\n </ion-button>\n </ng-container>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\"\n [class.has-header]=\"showHeader\"\n cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n <ion-item *ngIf=\"form.error\" visible-xs visible-sm visible-mobile lines=\"none\">\n <ion-icon color=\"danger\" slot=\"start\" name=\"alert-circle\"></ion-icon>\n <ion-label color=\"danger\" class=\"error\" [innerHTML]=\"form.error|translate\"></ion-label>\n </ion-item>\n\n <app-text-form #form
|
|
16345
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: TextPopover, selector: "app-text-popover", inputs: { showHeader: "showHeader", headerColor: "headerColor", showFooter: "showFooter", title: "title", text: "text", placeholder: "placeholder", editing: "editing", multiline: "multiline", autoHeight: "autoHeight", maxLength: "maxLength", autofocus: "autofocus", validator: "validator", headerButtons: "headerButtons", mobile: "mobile" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true, static: true }], ngImport: i0, template: "<ion-header *ngIf=\"showHeader\">\n <ion-toolbar [color]=\"headerColor\">\n <ion-buttons slot=\"start\">\n <ion-button *ngIf=\"mobile && editing\"\n (click)=\"cancel()\"\n [title]=\"'COMMON.BTN_CANCEL'|translate\">\n <ion-icon slot=\"icon-only\" name=\"arrow-back\"></ion-icon>\n </ion-button>\n <ion-button *ngFor=\"let button of headerButtons|arrayFilter: isStartSide\"\n [fill]=\"button.fill\"\n [color]=\"button.color\"\n (click)=\"clickButton(button)\">\n <ion-icon *ngIf=\"button.icon\" [slot]=\"button.text ? 'start' : 'icon-only'\" [name]=\"button.icon\"></ion-icon>\n <ion-text *ngIf=\"button.text\">{{button.text|translate}}</ion-text>\n </ion-button>\n </ion-buttons>\n\n <ion-title *ngIf=\"title\">{{title|translate}}</ion-title>\n\n <ion-buttons slot=\"end\">\n <ion-button *ngFor=\"let button of headerButtons|arrayFilter: isEndSide\"\n [fill]=\"button.fill\"\n [color]=\"button.color\"\n (click)=\"clickButton(button)\">\n <ion-icon *ngIf=\"button.icon\" [slot]=\"button.text ? 'start' : 'icon-only'\" [name]=\"button.icon\"></ion-icon>\n <ion-text *ngIf=\"button.text\">{{button.text|translate}}</ion-text>\n </ion-button>\n\n <ng-container *ngIf=\"mobile\">\n <ion-button *ngIf=\"editing\" (click)=\"onValidate($event)\"\n [disabled]=\"disabled\"\n [title]=\"'COMMON.BTN_VALIDATE_WITH_SHORTCUT_HELP'|translate\">\n <ion-icon slot=\"icon-only\" name=\"checkmark\"></ion-icon>\n </ion-button>\n <ion-button *ngIf=\"!editing\"\n (click)=\"cancel()\"\n [title]=\"'COMMON.BTN_CLOSE'|translate\">\n <ion-icon slot=\"icon-only\" name=\"close\"></ion-icon>\n </ion-button>\n </ng-container>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\"\n [class.has-header]=\"showHeader\"\n cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n <ion-item *ngIf=\"form.error\" visible-xs visible-sm visible-mobile lines=\"none\">\n <ion-icon color=\"danger\" slot=\"start\" name=\"alert-circle\"></ion-icon>\n <ion-label color=\"danger\" class=\"error\" [innerHTML]=\"form.error|translate\"></ion-label>\n </ion-item>\n\n <app-text-form #form\n [standalone]=\"true\"\n [placeholder]=\"placeholder\"\n [multiline]=\"multiline\"\n [maxLength]=\"maxLength\"\n [autoHeight]=\"autoHeight\"\n [autofocus]=\"editing && autofocus\"\n [validator]=\"validator\"\n (onSubmit)=\"onValidate($event)\"\n ></app-text-form>\n</ion-content>\n\n<ion-footer *ngIf=\"showFooter\">\n <ion-toolbar>\n <ion-row class=\"ion-no-padding\" nowrap>\n <ion-col>\n\n </ion-col>\n\n <ion-col size=\"auto\">\n <ion-button fill=\"clear\" color=\"dark\" (click)=\"cancel()\">\n <ion-label translate>COMMON.BTN_CANCEL</ion-label>\n </ion-button>\n <ion-button\n [fill]=\"disabled ? 'clear' : 'solid'\"\n (click)=\"onValidate($event)\"\n (keyup.enter)=\"onValidate($event)\"\n color=\"tertiary\"\n [disabled]=\"disabled\"\n [title]=\"'COMMON.BTN_VALIDATE_WITH_SHORTCUT_HELP'|translate\">\n <ion-label translate>COMMON.BTN_VALIDATE</ion-label>\n </ion-button>\n </ion-col>\n </ion-row>\n </ion-toolbar>\n</ion-footer>\n", styles: ["ion-content{--textarea-height: 11.5em}ion-content.has-header{--textarea-height: calc(11.5em - var(--ion-toolbar-height, 0em))}\n"], dependencies: [{ kind: "directive", type: i2$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2$2.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i2$2.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { kind: "component", type: i2$2.IonContent, selector: "ion-content", inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i2$2.IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i2$2.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i2$2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i2$2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2$2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i2$2.IonRow, selector: "ion-row" }, { kind: "component", type: i2$2.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: i2$2.IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: i2$2.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "directive", type: i1$3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: TextForm, selector: "app-text-form", inputs: ["showError", "placeholder", "multiline", "autoHeight", "maxLength", "autofocus", "validator", "standalone", "formControl", "formControlName"], outputs: ["textAreaChanges"] }, { kind: "directive", type: AutofocusDirective, selector: "[autofocus], input[appAutofocus]", inputs: ["appAutofocus", "autofocusDelay"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: ArrayFilterPipe, name: "arrayFilter" }] });
|
|
16288
16346
|
}
|
|
16289
16347
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: TextPopover, decorators: [{
|
|
16290
16348
|
type: Component,
|
|
16291
|
-
args: [{ selector: 'app-text-popover', template: "<ion-header *ngIf=\"showHeader\">\n <ion-toolbar [color]=\"headerColor\">\n <ion-buttons slot=\"start\">\n <ion-button *ngIf=\"mobile && editing\"\n (click)=\"cancel()\"\n [title]=\"'COMMON.BTN_CANCEL'|translate\">\n <ion-icon slot=\"icon-only\" name=\"arrow-back\"></ion-icon>\n </ion-button>\n <ion-button *ngFor=\"let button of headerButtons|arrayFilter: isStartSide\"\n [fill]=\"button.fill\"\n [color]=\"button.color\"\n (click)=\"clickButton(button)\">\n <ion-icon *ngIf=\"button.icon\" [slot]=\"button.text ? 'start' : 'icon-only'\" [name]=\"button.icon\"></ion-icon>\n <ion-text *ngIf=\"button.text\">{{button.text|translate}}</ion-text>\n </ion-button>\n </ion-buttons>\n\n <ion-title *ngIf=\"title\">{{title|translate}}</ion-title>\n\n <ion-buttons slot=\"end\">\n <ion-button *ngFor=\"let button of headerButtons|arrayFilter: isEndSide\"\n [fill]=\"button.fill\"\n [color]=\"button.color\"\n (click)=\"clickButton(button)\">\n <ion-icon *ngIf=\"button.icon\" [slot]=\"button.text ? 'start' : 'icon-only'\" [name]=\"button.icon\"></ion-icon>\n <ion-text *ngIf=\"button.text\">{{button.text|translate}}</ion-text>\n </ion-button>\n\n <ng-container *ngIf=\"mobile\">\n <ion-button *ngIf=\"editing\" (click)=\"onValidate($event)\"\n [disabled]=\"disabled\"\n [title]=\"'COMMON.BTN_VALIDATE_WITH_SHORTCUT_HELP'|translate\">\n <ion-icon slot=\"icon-only\" name=\"checkmark\"></ion-icon>\n </ion-button>\n <ion-button *ngIf=\"!editing\"\n (click)=\"cancel()\"\n [title]=\"'COMMON.BTN_CLOSE'|translate\">\n <ion-icon slot=\"icon-only\" name=\"close\"></ion-icon>\n </ion-button>\n </ng-container>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\"\n [class.has-header]=\"showHeader\"\n cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n <ion-item *ngIf=\"form.error\" visible-xs visible-sm visible-mobile lines=\"none\">\n <ion-icon color=\"danger\" slot=\"start\" name=\"alert-circle\"></ion-icon>\n <ion-label color=\"danger\" class=\"error\" [innerHTML]=\"form.error|translate\"></ion-label>\n </ion-item>\n\n <app-text-form #form
|
|
16349
|
+
args: [{ selector: 'app-text-popover', template: "<ion-header *ngIf=\"showHeader\">\n <ion-toolbar [color]=\"headerColor\">\n <ion-buttons slot=\"start\">\n <ion-button *ngIf=\"mobile && editing\"\n (click)=\"cancel()\"\n [title]=\"'COMMON.BTN_CANCEL'|translate\">\n <ion-icon slot=\"icon-only\" name=\"arrow-back\"></ion-icon>\n </ion-button>\n <ion-button *ngFor=\"let button of headerButtons|arrayFilter: isStartSide\"\n [fill]=\"button.fill\"\n [color]=\"button.color\"\n (click)=\"clickButton(button)\">\n <ion-icon *ngIf=\"button.icon\" [slot]=\"button.text ? 'start' : 'icon-only'\" [name]=\"button.icon\"></ion-icon>\n <ion-text *ngIf=\"button.text\">{{button.text|translate}}</ion-text>\n </ion-button>\n </ion-buttons>\n\n <ion-title *ngIf=\"title\">{{title|translate}}</ion-title>\n\n <ion-buttons slot=\"end\">\n <ion-button *ngFor=\"let button of headerButtons|arrayFilter: isEndSide\"\n [fill]=\"button.fill\"\n [color]=\"button.color\"\n (click)=\"clickButton(button)\">\n <ion-icon *ngIf=\"button.icon\" [slot]=\"button.text ? 'start' : 'icon-only'\" [name]=\"button.icon\"></ion-icon>\n <ion-text *ngIf=\"button.text\">{{button.text|translate}}</ion-text>\n </ion-button>\n\n <ng-container *ngIf=\"mobile\">\n <ion-button *ngIf=\"editing\" (click)=\"onValidate($event)\"\n [disabled]=\"disabled\"\n [title]=\"'COMMON.BTN_VALIDATE_WITH_SHORTCUT_HELP'|translate\">\n <ion-icon slot=\"icon-only\" name=\"checkmark\"></ion-icon>\n </ion-button>\n <ion-button *ngIf=\"!editing\"\n (click)=\"cancel()\"\n [title]=\"'COMMON.BTN_CLOSE'|translate\">\n <ion-icon slot=\"icon-only\" name=\"close\"></ion-icon>\n </ion-button>\n </ng-container>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\"\n [class.has-header]=\"showHeader\"\n cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n <ion-item *ngIf=\"form.error\" visible-xs visible-sm visible-mobile lines=\"none\">\n <ion-icon color=\"danger\" slot=\"start\" name=\"alert-circle\"></ion-icon>\n <ion-label color=\"danger\" class=\"error\" [innerHTML]=\"form.error|translate\"></ion-label>\n </ion-item>\n\n <app-text-form #form\n [standalone]=\"true\"\n [placeholder]=\"placeholder\"\n [multiline]=\"multiline\"\n [maxLength]=\"maxLength\"\n [autoHeight]=\"autoHeight\"\n [autofocus]=\"editing && autofocus\"\n [validator]=\"validator\"\n (onSubmit)=\"onValidate($event)\"\n ></app-text-form>\n</ion-content>\n\n<ion-footer *ngIf=\"showFooter\">\n <ion-toolbar>\n <ion-row class=\"ion-no-padding\" nowrap>\n <ion-col>\n\n </ion-col>\n\n <ion-col size=\"auto\">\n <ion-button fill=\"clear\" color=\"dark\" (click)=\"cancel()\">\n <ion-label translate>COMMON.BTN_CANCEL</ion-label>\n </ion-button>\n <ion-button\n [fill]=\"disabled ? 'clear' : 'solid'\"\n (click)=\"onValidate($event)\"\n (keyup.enter)=\"onValidate($event)\"\n color=\"tertiary\"\n [disabled]=\"disabled\"\n [title]=\"'COMMON.BTN_VALIDATE_WITH_SHORTCUT_HELP'|translate\">\n <ion-label translate>COMMON.BTN_VALIDATE</ion-label>\n </ion-button>\n </ion-col>\n </ion-row>\n </ion-toolbar>\n</ion-footer>\n", styles: ["ion-content{--textarea-height: 11.5em}ion-content.has-header{--textarea-height: calc(11.5em - var(--ion-toolbar-height, 0em))}\n"] }]
|
|
16292
16350
|
}], ctorParameters: () => [{ type: i2$2.PopoverController }, { type: i1$1.TranslateService }], propDecorators: { form: [{
|
|
16293
16351
|
type: ViewChild,
|
|
16294
16352
|
args: ['form', { static: true }]
|
|
@@ -39932,27 +39990,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
|
|
|
39932
39990
|
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1$2.UntypedFormBuilder }, { type: i0.ChangeDetectorRef }] });
|
|
39933
39991
|
|
|
39934
39992
|
class TextFormTestingPage {
|
|
39935
|
-
|
|
39936
|
-
|
|
39937
|
-
|
|
39938
|
-
|
|
39993
|
+
formBuilder;
|
|
39994
|
+
standaloneTextForm1;
|
|
39995
|
+
standaloneTextForm2;
|
|
39996
|
+
form;
|
|
39939
39997
|
Validators = Validators;
|
|
39998
|
+
stringify = JSON.stringify;
|
|
39999
|
+
constructor(formBuilder) {
|
|
40000
|
+
this.formBuilder = formBuilder;
|
|
40001
|
+
this.form = formBuilder.group({
|
|
40002
|
+
empty: [null],
|
|
40003
|
+
required: [null, Validators.required]
|
|
40004
|
+
});
|
|
40005
|
+
}
|
|
39940
40006
|
ngAfterViewInit() {
|
|
39941
|
-
this.
|
|
39942
|
-
this.
|
|
40007
|
+
this.standaloneTextForm1.enable();
|
|
40008
|
+
this.standaloneTextForm2.enable();
|
|
39943
40009
|
}
|
|
39944
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: TextFormTestingPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
39945
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: TextFormTestingPage, selector: "text-form-testing", viewQueries: [{ propertyName: "
|
|
40010
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: TextFormTestingPage, deps: [{ token: i1$2.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
40011
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: TextFormTestingPage, selector: "text-form-testing", viewQueries: [{ propertyName: "standaloneTextForm1", first: true, predicate: ["standaloneTextForm1"], descendants: true }, { propertyName: "standaloneTextForm2", first: true, predicate: ["standaloneTextForm2"], descendants: true }], ngImport: i0, template: "<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Text from examples</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <ion-grid>\n <ion-row>\n <ion-col>\n <ion-text><h4>Standalone mode (no form)</h4></ion-text>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Default validator\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <app-text-form #standaloneTextForm1 [standalone]=\"true\" [multiline]=\"false\" [maxLength]=\"10\"></app-text-form>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Required\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <app-text-form #standaloneTextForm2 [standalone]=\"true\" [multiline]=\"false\" [maxLength]=\"10\" [validator]=\"Validators.required\">\n <mat-error matError *ngIf=\"standaloneTextForm2.textControl.hasError('required')\">REQUIRED</mat-error>\n </app-text-form>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n <form class=\"form-container\" [formGroup]=\"form\">\n <ion-grid>\n <ion-row>\n <ion-col>\n <ion-text><h4>FormGroup mode</h4></ion-text>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>{{stringify(form.controls.empty.value)}}</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <app-text-form formControlName=\"empty\" [multiline]=\"false\" [maxLength]=\"10\"></app-text-form>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Required\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>{{stringify(form.controls.required.value)}}</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <app-text-form formControlName=\"required\" [multiline]=\"false\" [maxLength]=\"10\" [validator]=\"Validators.required\">\n <mat-error matError *ngIf=\"form.controls.required.hasError('required')\">REQUIRED</mat-error>\n </app-text-form>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n </form>\n\n</ion-content>\n", dependencies: [{ kind: "directive", type: i2$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i2$2.IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: i2$2.IonCardContent, selector: "ion-card-content", inputs: ["mode"] }, { kind: "component", type: i2$2.IonCardHeader, selector: "ion-card-header", inputs: ["color", "mode", "translucent"] }, { kind: "component", type: i2$2.IonCardSubtitle, selector: "ion-card-subtitle", inputs: ["color", "mode"] }, { kind: "component", type: i2$2.IonCardTitle, selector: "ion-card-title", inputs: ["color", "mode"] }, { kind: "component", type: i2$2.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { kind: "component", type: i2$2.IonContent, selector: "ion-content", inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i2$2.IonGrid, selector: "ion-grid", inputs: ["fixed"] }, { kind: "component", type: i2$2.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i2$2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i2$2.IonRow, selector: "ion-row" }, { kind: "component", type: i2$2.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: i2$2.IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: i2$2.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: i2$2.IonBackButton, selector: "ion-back-button" }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i6.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: TextForm, selector: "app-text-form", inputs: ["showError", "placeholder", "multiline", "autoHeight", "maxLength", "autofocus", "validator", "standalone", "formControl", "formControlName"], outputs: ["textAreaChanges"] }] });
|
|
39946
40012
|
}
|
|
39947
40013
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: TextFormTestingPage, decorators: [{
|
|
39948
40014
|
type: Component,
|
|
39949
|
-
args: [{ selector: 'text-form-testing', template: "<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Text from examples</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <
|
|
39950
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
40015
|
+
args: [{ selector: 'text-form-testing', template: "<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Text from examples</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <ion-grid>\n <ion-row>\n <ion-col>\n <ion-text><h4>Standalone mode (no form)</h4></ion-text>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Default validator\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <app-text-form #standaloneTextForm1 [standalone]=\"true\" [multiline]=\"false\" [maxLength]=\"10\"></app-text-form>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Required\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <app-text-form #standaloneTextForm2 [standalone]=\"true\" [multiline]=\"false\" [maxLength]=\"10\" [validator]=\"Validators.required\">\n <mat-error matError *ngIf=\"standaloneTextForm2.textControl.hasError('required')\">REQUIRED</mat-error>\n </app-text-form>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n <form class=\"form-container\" [formGroup]=\"form\">\n <ion-grid>\n <ion-row>\n <ion-col>\n <ion-text><h4>FormGroup mode</h4></ion-text>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Empty\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>{{stringify(form.controls.empty.value)}}</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <app-text-form formControlName=\"empty\" [multiline]=\"false\" [maxLength]=\"10\"></app-text-form>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Required\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>{{stringify(form.controls.required.value)}}</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <app-text-form formControlName=\"required\" [multiline]=\"false\" [maxLength]=\"10\" [validator]=\"Validators.required\">\n <mat-error matError *ngIf=\"form.controls.required.hasError('required')\">REQUIRED</mat-error>\n </app-text-form>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n </form>\n\n</ion-content>\n" }]
|
|
40016
|
+
}], ctorParameters: () => [{ type: i1$2.UntypedFormBuilder }], propDecorators: { standaloneTextForm1: [{
|
|
39951
40017
|
type: ViewChild,
|
|
39952
|
-
args: ['
|
|
39953
|
-
}],
|
|
40018
|
+
args: ['standaloneTextForm1']
|
|
40019
|
+
}], standaloneTextForm2: [{
|
|
39954
40020
|
type: ViewChild,
|
|
39955
|
-
args: ['
|
|
40021
|
+
args: ['standaloneTextForm2']
|
|
39956
40022
|
}] } });
|
|
39957
40023
|
|
|
39958
40024
|
const SHARED_MATERIAL_TESTING_PAGES = [
|