@sumaris-net/ngx-components 1.2.14 → 1.2.18-rc1
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/doc/changelog.md +10 -1
- package/esm2020/src/app/shared/material/datetime/material.date.mjs +2 -14
- package/esm2020/src/app/shared/material/datetime/material.dateshort.mjs +48 -48
- package/esm2020/src/app/shared/material/latlong/material.latlong.mjs +6 -6
- package/esm2020/src/app/shared/pipes/form.pipes.mjs +4 -4
- package/esm2020/src/app/shared/shared.module.mjs +3 -2
- package/fesm2015/sumaris-net.ngx-components.mjs +58 -71
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +55 -66
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/material/datetime/material.date.d.ts +1 -1
- package/src/app/shared/material/datetime/material.dateshort.d.ts +2 -2
- package/src/app/shared/shared.module.d.ts +1 -1
- package/src/theme/_ngx-components.scss +11 -0
|
@@ -5100,7 +5100,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
5100
5100
|
}] });
|
|
5101
5101
|
class FormGetControlPipe {
|
|
5102
5102
|
transform(form, path) {
|
|
5103
|
-
return (form && isNotNil(path)
|
|
5103
|
+
return (form && isNotNil(path) ? form.get(path) : form);
|
|
5104
5104
|
}
|
|
5105
5105
|
}
|
|
5106
5106
|
FormGetControlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormGetControlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -5113,7 +5113,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
5113
5113
|
}] });
|
|
5114
5114
|
class FormGetArrayPipe {
|
|
5115
5115
|
transform(form, path) {
|
|
5116
|
-
return (form && path
|
|
5116
|
+
return (form && isNotNil(path) ? form.get(path) : form);
|
|
5117
5117
|
}
|
|
5118
5118
|
}
|
|
5119
5119
|
FormGetArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormGetArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -5126,7 +5126,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
5126
5126
|
}] });
|
|
5127
5127
|
class FormGetGroupPipe {
|
|
5128
5128
|
transform(form, path) {
|
|
5129
|
-
return (form && path
|
|
5129
|
+
return (form && isNotNil(path) ? form.get(path) : form);
|
|
5130
5130
|
}
|
|
5131
5131
|
}
|
|
5132
5132
|
FormGetGroupPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormGetGroupPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -5667,14 +5667,14 @@ function roundFloat(input, maxDecimals) {
|
|
|
5667
5667
|
|
|
5668
5668
|
const MASKS = {
|
|
5669
5669
|
latitude: {
|
|
5670
|
-
DDMMSS: [' ', /\d/, /\d/, '°', ' ',
|
|
5671
|
-
DDMM: [' ', /\d/, /\d/, '°', ' ',
|
|
5670
|
+
DDMMSS: [' ', /\d/, /\d/, '°', ' ', /\d/, /\d/, '\'', ' ', /\d/, /\d/, '.', /\d/, /\d/, '"'],
|
|
5671
|
+
DDMM: [' ', /\d/, /\d/, '°', ' ', /\d/, /\d/, '.', /\d/, /\d/, /\d/, '\''],
|
|
5672
5672
|
DD: [/[+-]/, ' ', /\d/, /\d/, '.', /\d/, /\d/, /\d/, /\d/, /\d/, /\d/, /\d/, '°']
|
|
5673
5673
|
},
|
|
5674
5674
|
longitude: {
|
|
5675
|
-
DDMMSS: [
|
|
5676
|
-
DDMM: [
|
|
5677
|
-
DD: [/[+-]/,
|
|
5675
|
+
DDMMSS: [/\d/, /\d/, /\d/, '°', ' ', /\d/, /\d/, '\'', ' ', /\d/, /\d/, '.', /\d/, /\d/, '"'],
|
|
5676
|
+
DDMM: [/\d/, /\d/, /\d/, '°', ' ', /\d/, /\d/, '.', /\d/, /\d/, /\d/, '\''],
|
|
5677
|
+
DD: [/[+-]/, /\d/, /\d/, /\d/, '.', /\d/, /\d/, /\d/, /\d/, /\d/, /\d/, /\d/, '°']
|
|
5678
5678
|
}
|
|
5679
5679
|
};
|
|
5680
5680
|
const noop$7 = () => {
|
|
@@ -6309,21 +6309,9 @@ class MatDate {
|
|
|
6309
6309
|
if (this._writing)
|
|
6310
6310
|
return; // Skip if call by self
|
|
6311
6311
|
this._writing = true;
|
|
6312
|
-
// DEBUG
|
|
6313
|
-
//console.debug(`[mat-date-time] onFormChange() from event: ${event} - controls values: `, [dayStr, time]);
|
|
6314
|
-
/*if (this.dayControl.invalid) {
|
|
6315
|
-
this.formControl.markAsPending({onlySelf: true});
|
|
6316
|
-
this.formControl.setErrors({
|
|
6317
|
-
...this.formControl.errors,
|
|
6318
|
-
...this.dayControl.errors
|
|
6319
|
-
});
|
|
6320
|
-
this.formControl.markAsDirty();
|
|
6321
|
-
this._writing = false;
|
|
6322
|
-
return;
|
|
6323
|
-
}*/
|
|
6324
6312
|
if (value) {
|
|
6325
6313
|
// Make to remove placeholder chars
|
|
6326
|
-
while (value
|
|
6314
|
+
while (value.indexOf(this.placeholderChar) !== -1) {
|
|
6327
6315
|
value = value.replace(this.placeholderChar, '');
|
|
6328
6316
|
}
|
|
6329
6317
|
// Force '0' for empty month (otherwise moment will use the current month)
|
|
@@ -6891,12 +6879,19 @@ class MatDateShort {
|
|
|
6891
6879
|
if (!this.formControl)
|
|
6892
6880
|
throw new Error('Missing mandatory attribute \'formControl\' or \'formControlName\' in <mat-date-short-field>.');
|
|
6893
6881
|
this.mobile = isNotNil(this.mobile) ? this.mobile : isMobile(window);
|
|
6894
|
-
// Redirect errors from main control, into day sub control
|
|
6895
|
-
const $error = new BehaviorSubject(null);
|
|
6896
6882
|
this.required = isNotNilBoolean(this.required) ? this.required : (this.formControl.validator === Validators.required || isBlankString(this.required));
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6883
|
+
// Add 'validDate' validator (when existing validator are null or required, to be sure to keep it)
|
|
6884
|
+
if (!this.formControl.validator || this.formControl.validator === Validators.required) {
|
|
6885
|
+
this.formControl.setValidators(this.required ? [Validators.required, SharedValidators.validDate] : SharedValidators.validDate);
|
|
6886
|
+
}
|
|
6887
|
+
else {
|
|
6888
|
+
this.formControl.setValidators(this.required ? [this.formControl.validator, Validators.required, SharedValidators.validDate] :
|
|
6889
|
+
[this.formControl.validator, SharedValidators.validDate]);
|
|
6890
|
+
}
|
|
6891
|
+
// Create the text control
|
|
6892
|
+
this.textControl = this.formBuilder.control(null,
|
|
6893
|
+
// Important: should copy errors from the model formControl
|
|
6894
|
+
() => this.formControl.errors);
|
|
6900
6895
|
// Get patterns to display date
|
|
6901
6896
|
this.updatePattern(this.translate.instant('COMMON.DATE_YEAR_PATTERN'));
|
|
6902
6897
|
this._subscription.add(this.translate.get('COMMON.DATE_YEAR_PATTERN')
|
|
@@ -6907,13 +6902,7 @@ class MatDateShort {
|
|
|
6907
6902
|
this._subscription.add(this.formControl.statusChanges
|
|
6908
6903
|
.pipe(filter((_) => !this.readonly && !this._writing && !this._disabling) // Skip
|
|
6909
6904
|
)
|
|
6910
|
-
.subscribe((
|
|
6911
|
-
if (status === 'INVALID') {
|
|
6912
|
-
$error.next(this.formControl.errors);
|
|
6913
|
-
}
|
|
6914
|
-
else if (status === 'VALID') {
|
|
6915
|
-
$error.next(null);
|
|
6916
|
-
}
|
|
6905
|
+
.subscribe(() => {
|
|
6917
6906
|
this.textControl.updateValueAndValidity({ emitEvent: false });
|
|
6918
6907
|
if (this.formControl.touched && !this.textControl.touched) {
|
|
6919
6908
|
this.textControl.markAsTouched();
|
|
@@ -6932,10 +6921,11 @@ class MatDateShort {
|
|
|
6932
6921
|
if (this._writing)
|
|
6933
6922
|
return; // Skip
|
|
6934
6923
|
this._writing = true;
|
|
6924
|
+
// DEBUG
|
|
6925
|
+
//console.debug("[mat-date] writeValue() with:", value);
|
|
6935
6926
|
// Convert into date
|
|
6936
6927
|
// Important: clone, because startOf will update the existing date
|
|
6937
|
-
const date = isMoment$1(value) ? value.clone()
|
|
6938
|
-
: (isNilOrBlank(value) ? undefined : this.dateAdapter.parse(value, DATE_ISO_PATTERN));
|
|
6928
|
+
const date = isMoment$1(value) ? value.clone() : fromDateISOString(value);
|
|
6939
6929
|
if (!date || !date.isValid()) {
|
|
6940
6930
|
this.textControl.patchValue(null, { emitEvent: false });
|
|
6941
6931
|
if (this.formControl.value) {
|
|
@@ -7027,6 +7017,18 @@ class MatDateShort {
|
|
|
7027
7017
|
});
|
|
7028
7018
|
}
|
|
7029
7019
|
}
|
|
7020
|
+
_openDatePickerIfMobile(event) {
|
|
7021
|
+
var _a;
|
|
7022
|
+
if (!this.mobile
|
|
7023
|
+
|| (event === null || event === void 0 ? void 0 : event.defaultPrevented)
|
|
7024
|
+
|| ((_a = this.datePicker) === null || _a === void 0 ? void 0 : _a.opened)
|
|
7025
|
+
|| this.disabled)
|
|
7026
|
+
return;
|
|
7027
|
+
//console.debug('[mat-date-short] Preparing to open date picker... ');
|
|
7028
|
+
this._preventEvent(event);
|
|
7029
|
+
// Open the picker
|
|
7030
|
+
this.openDatePicker();
|
|
7031
|
+
}
|
|
7030
7032
|
_checkIfTouched(opts) {
|
|
7031
7033
|
if (this.textControl.touched) {
|
|
7032
7034
|
this._onTouchedCallback();
|
|
@@ -7035,27 +7037,17 @@ class MatDateShort {
|
|
|
7035
7037
|
}
|
|
7036
7038
|
}
|
|
7037
7039
|
}
|
|
7038
|
-
_openDatePickerIfMobile(event) {
|
|
7039
|
-
var _a;
|
|
7040
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
7041
|
-
if (!this.mobile
|
|
7042
|
-
|| (event === null || event === void 0 ? void 0 : event.defaultPrevented)
|
|
7043
|
-
|| ((_a = this.datePicker) === null || _a === void 0 ? void 0 : _a.opened)
|
|
7044
|
-
|| this.disabled)
|
|
7045
|
-
return;
|
|
7046
|
-
//console.debug('[mat-date-short] Preparing to open date picker... ');
|
|
7047
|
-
this._preventEvent(event);
|
|
7048
|
-
// Make sure the keyboard is closed
|
|
7049
|
-
//await this.waitKeyboardHide(false);
|
|
7050
|
-
// Open the picker
|
|
7051
|
-
this.openDatePicker();
|
|
7052
|
-
});
|
|
7053
|
-
}
|
|
7054
7040
|
// select only year
|
|
7055
|
-
_closeDatePicker(
|
|
7041
|
+
_closeDatePicker(value) {
|
|
7056
7042
|
var _a;
|
|
7057
7043
|
(_a = this.datePicker) === null || _a === void 0 ? void 0 : _a.close();
|
|
7058
|
-
|
|
7044
|
+
// Reset time
|
|
7045
|
+
let date = isMoment$1(value) ? value.utc(true).hour(0).minute(0).seconds(0).millisecond(0) : null;
|
|
7046
|
+
// Get the model value
|
|
7047
|
+
const dateStr = date && date.isValid() ? date.format(DATE_ISO_PATTERN).replace('+00:00', 'Z') : date;
|
|
7048
|
+
if (this.formControl.value !== dateStr) {
|
|
7049
|
+
this.formControl.setValue(dateStr);
|
|
7050
|
+
}
|
|
7059
7051
|
}
|
|
7060
7052
|
_preventEvent(event) {
|
|
7061
7053
|
if (!event)
|
|
@@ -7074,32 +7066,26 @@ class MatDateShort {
|
|
|
7074
7066
|
this.markForCheck();
|
|
7075
7067
|
}
|
|
7076
7068
|
}
|
|
7077
|
-
onFormChange(
|
|
7069
|
+
onFormChange(value) {
|
|
7078
7070
|
if (this._writing)
|
|
7079
7071
|
return; // Skip if call by self
|
|
7080
7072
|
this._writing = true;
|
|
7081
|
-
if (
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
return;
|
|
7087
|
-
}
|
|
7088
|
-
// Make to remove placeholder chars
|
|
7089
|
-
while (dayValue && dayValue.indexOf(this.placeholderChar) !== -1) {
|
|
7090
|
-
dayValue = dayValue.replace(this.placeholderChar, '');
|
|
7073
|
+
if (value) {
|
|
7074
|
+
// Make to remove placeholder chars
|
|
7075
|
+
while (value.indexOf(this.placeholderChar) !== -1) {
|
|
7076
|
+
value = value.replace(this.placeholderChar, '');
|
|
7077
|
+
}
|
|
7091
7078
|
}
|
|
7092
|
-
let date;
|
|
7093
7079
|
// Parse day string
|
|
7094
|
-
date =
|
|
7080
|
+
let date = value && this.dateAdapter.parse(value, this.datePattern) || null;
|
|
7095
7081
|
// Reset time
|
|
7096
7082
|
date = date && date.utc(true).hour(0).minute(0).seconds(0).millisecond(0);
|
|
7097
7083
|
// Get the model value
|
|
7098
|
-
const dateStr = date && date.isValid()
|
|
7084
|
+
const dateStr = date && date.isValid() ? date.format(DATE_ISO_PATTERN).replace('+00:00', 'Z') : date;
|
|
7099
7085
|
// Set model value
|
|
7100
7086
|
if (this.formControl.value !== dateStr) {
|
|
7101
7087
|
// DEBUG
|
|
7102
|
-
|
|
7088
|
+
console.debug('[mat-date-time] Emit new value: ' + dateStr);
|
|
7103
7089
|
// Apply to form control. => Will call writeValue()
|
|
7104
7090
|
// NOT NEED, because a formControl should NOT be used by multiple fields
|
|
7105
7091
|
//this.formControl.setValue(dateStr, {emitEvent: false});
|
|
@@ -7148,12 +7134,12 @@ class MatDateShort {
|
|
|
7148
7134
|
MatDateShort.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatDateShort, deps: [{ token: i1$1.MomentDateAdapter }, { token: i1$2.TranslateService }, { token: i1$3.UntypedFormBuilder }, { token: i0.ChangeDetectorRef }, { token: i1$3.FormGroupDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
7149
7135
|
MatDateShort.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: MatDateShort, selector: "mat-date-short-field", inputs: { mobile: "mobile", formControl: "formControl", formControlName: "formControlName", placeholder: "placeholder", floatLabel: "floatLabel", appearance: "appearance", required: "required", compact: "compact", placeholderChar: "placeholderChar", autofocus: "autofocus", startDate: "startDate", clearable: "clearable", datePickerFilter: "datePickerFilter", readonly: "readonly", tabindex: "tabindex" }, providers: [
|
|
7150
7136
|
DEFAULT_VALUE_ACCESSOR$3,
|
|
7151
|
-
], viewQueries: [{ propertyName: "datePicker", first: true, predicate: ["datePicker"], descendants: true }, { propertyName: "_matInput", first: true, predicate: ["matInput"], descendants: true }], ngImport: i0, template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly; else writable\"\n [floatLabel]=\"floatLabel\"\n [appearance]=\"appearance\"\n class=\"mat-form-field-disabled\">\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput hidden type=\"text\"\n readonly\n [placeholder]=\"placeholder\"\n [formControl]=\"formControl\">\n <ion-text>{{formControl.value|dateFormat: {pattern: datePattern} }}</ion-text>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n</mat-form-field>\n\n<!-- writable -->\n<ng-template #writable>\n\n <mat-form-field [floatLabel]=\"floatLabel\"\n [appearance]=\"appearance\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <!-- Desktop -->\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n class=\"mat-input-element\"\n *ngIf=\"!mobile\"\n [formControl]=\"textControl\"\n [textMask]=\"{mask: mask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_YEAR_PLACEHOLDER'|translate\"\n (blur)=\"_checkIfTouched()\"\n (keyup.arrowDown)=\"openDatePicker()\"\n (keyup.escape)=\"_preventEvent($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n [appAutofocus]=\"autofocus\">\n <input type=\"text\" [formControl]=\"formControl\" hidden\n *ngIf=\"!mobile\"\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"_onDatePickerChange($event)\"\n readonly>\n\n <!-- Mobile -->\n <input #matInput autocomplete=\"off\" type=\"text\"\n class=\"mat-input-element\"\n *ngIf=\"mobile\"\n [formControl]=\"textControl\"\n (focus)=\"_openDatePickerIfMobile($event)\"\n (click)=\"_openDatePickerIfMobile($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n <input matInput type=\"text\" [formControl]=\"formControl\" hidden\n *ngIf=\"mobile\"\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"_onDatePickerChange($event)\"\n readonly>\n\n <button matSuffix type=\"button\" mat-icon-button tabindex=\"-1\"\n (click)=\"openDatePicker()\"\n [disabled]=\"disabled\">\n <mat-icon>{{mobile?'date_range':'keyboard_arrow_down'}}</mat-icon>\n </button>\n\n <mat-datepicker #datePicker\n startView=\"multi-year\"\n [touchUi]=\"mobile\"\n [disabled]=\"disabled\"\n (yearSelected)=\"_closeDatePicker($event)\"\n [startAt]=\"startDate\">\n <!-- Date picker buttons -->\n <mat-datepicker-actions *ngIf=\"mobile\">\n <ion-button fill=\"clear\" color=\"dark\" matDatepickerCancel>\n <ion-label translate>COMMON.BTN_CANCEL</ion-label>\n </ion-button>\n <ion-button fill=\"solid\" color=\"tertiary\" matDatepickerApply>\n <ion-label translate>COMMON.BTN_VALIDATE</ion-label>\n </ion-button>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"clear()\"\n [hidden]=\"disabled || !formControl.value\">\n <mat-icon>close</mat-icon>\n </button>\n\n <!-- errors -->\n <mat-error *ngIf=\"formControl.touched && formControl.errors|mapKeys|arrayFirst; let errorKey\" [ngSwitch]=\"errorKey\">\n <span *ngSwitchCase=\"'required'\" translate>ERROR.FIELD_REQUIRED</span>\n <span *ngSwitchCase=\"'validDate'\" translate>ERROR.FIELD_NOT_VALID_DATE</span>\n <span *ngSwitchCase=\"'dateIsAfter'\">{{'ERROR.FIELD_NOT_VALID_DATE_AFTER' | translate: formControl.errors.dateIsAfter }}</span>\n <span *ngSwitchCase=\"'dateIsBefore'\">{{'ERROR.FIELD_NOT_VALID_DATE_BEFORE' | translate: formControl.errors.dateIsBefore }}</span>\n <span *ngSwitchCase=\"'dateRange'\" translate>ERROR.FIELD_NOT_VALID_DATE_RANGE</span>\n <span *ngSwitchCase=\"'dateMaxDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MAX_DURATION</span>\n <span *ngSwitchCase=\"'dateMinDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MIN_DURATION</span>\n <span *ngSwitchCase=\"'msg'\">{{(formControl.errors.msg?.key || formControl.errors.msg) | translate: formControl.errors.msg?.params}}</span>\n </mat-error>\n <ng-content select=\"mat-error\"></ng-content>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n\n <!-- mat hint -->\n <div class=\"mat-form-field-hint-wrapper\" [class.cdk-visually-hidden]=\"formControl.invalid\">\n <div class=\"mat-form-field-hint-spacer\"></div>\n <ng-content select=\"mat-hint\"></ng-content>\n </div>\n </mat-form-field>\n\n</ng-template>\n\n<ng-template #matPrefixTemplate>\n <ng-content select=\"[matPrefix]\"></ng-content>\n</ng-template>\n\n<ng-template #matSuffixTemplate>\n <ng-content select=\"[matSuffix]\"></ng-content>\n</ng-template>\n", styles: [":host{display:inline-block;width:100%;position:relative}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}mat-form-field input[readonly]{-webkit-user-select:none!important;user-select:none!important}mat-form-field .datetime-md{padding:0!important}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i1.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: i1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i1.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "directive", type: i1$3.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$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i6$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i6$1.MatSuffix, selector: "[matSuffix]" }, { 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: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i9.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i10.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i10.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i10.MatDatepickerActions, selector: "mat-datepicker-actions, mat-date-range-picker-actions" }, { kind: "directive", type: i10.MatDatepickerCancel, selector: "[matDatepickerCancel], [matDateRangePickerCancel]" }, { kind: "directive", type: i10.MatDatepickerApply, selector: "[matDatepickerApply], [matDateRangePickerApply]" }, { kind: "directive", type: i11.MaskedInputDirective, selector: "[textMask]", inputs: ["textMask"], exportAs: ["textMask"] }, { kind: "directive", type: i1$2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "directive", type: AutofocusDirective, selector: "[autofocus], input[appAutofocus]", inputs: ["appAutofocus", "autofocusDelay"] }, { kind: "pipe", type: DateFormatPipe, name: "dateFormat" }, { kind: "pipe", type: ArrayFirstPipe, name: "arrayFirst" }, { kind: "pipe", type: MapKeysPipe, name: "mapKeys" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7137
|
+
], viewQueries: [{ propertyName: "datePicker", first: true, predicate: ["datePicker"], descendants: true }, { propertyName: "_matInput", first: true, predicate: ["matInput"], descendants: true }], ngImport: i0, template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly; else writable\"\n [floatLabel]=\"floatLabel\"\n [appearance]=\"appearance\"\n class=\"mat-form-field-disabled\">\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput hidden type=\"text\"\n readonly\n [placeholder]=\"placeholder\"\n [formControl]=\"formControl\">\n <ion-text>{{formControl.value|dateFormat: {pattern: datePattern} }}</ion-text>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n</mat-form-field>\n\n<!-- writable -->\n<ng-template #writable>\n\n <mat-form-field [floatLabel]=\"floatLabel\"\n [appearance]=\"appearance\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <!-- Desktop -->\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n class=\"mat-input-element\"\n *ngIf=\"!mobile\"\n [formControl]=\"textControl\"\n [textMask]=\"{mask: mask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_YEAR_PLACEHOLDER'|translate\"\n (blur)=\"_checkIfTouched()\"\n (keyup.arrowDown)=\"openDatePicker()\"\n (keyup.escape)=\"_preventEvent($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n [appAutofocus]=\"autofocus\">\n <input type=\"text\" [formControl]=\"formControl\" hidden\n *ngIf=\"!mobile\"\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"_onDatePickerChange($event)\"\n readonly>\n\n <!-- Mobile -->\n <input #matInput autocomplete=\"off\" type=\"text\"\n class=\"mat-input-element\"\n *ngIf=\"mobile\"\n [formControl]=\"textControl\"\n (focus)=\"_openDatePickerIfMobile($event)\"\n (click)=\"_openDatePickerIfMobile($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n <input matInput type=\"text\" [formControl]=\"formControl\" hidden\n *ngIf=\"mobile\"\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"_onDatePickerChange($event)\"\n readonly>\n\n <button matSuffix type=\"button\" mat-icon-button tabindex=\"-1\"\n (click)=\"openDatePicker()\"\n [disabled]=\"disabled\">\n <mat-icon>{{mobile?'date_range':'keyboard_arrow_down'}}</mat-icon>\n </button>\n\n <mat-datepicker #datePicker\n startView=\"multi-year\"\n [touchUi]=\"mobile\"\n [disabled]=\"disabled\"\n (yearSelected)=\"_closeDatePicker($event)\"\n panelClass=\"mat-date-short-panel\"\n [startAt]=\"startDate\">\n <!-- Date picker buttons -->\n <mat-datepicker-actions *ngIf=\"mobile\">\n <ion-button fill=\"clear\" color=\"dark\" matDatepickerCancel>\n <ion-label translate>COMMON.BTN_CANCEL</ion-label>\n </ion-button>\n <ion-button fill=\"solid\" color=\"tertiary\" matDatepickerApply>\n <ion-label translate>COMMON.BTN_VALIDATE</ion-label>\n </ion-button>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"clear()\"\n [hidden]=\"disabled || !formControl.value\">\n <mat-icon>close</mat-icon>\n </button>\n\n <!-- errors -->\n <mat-error *ngIf=\"formControl.touched && formControl.errors|mapKeys|arrayFirst; let errorKey\" [ngSwitch]=\"errorKey\">\n <span *ngSwitchCase=\"'required'\" translate>ERROR.FIELD_REQUIRED</span>\n <span *ngSwitchCase=\"'validDate'\" translate>ERROR.FIELD_NOT_VALID_DATE</span>\n <span *ngSwitchCase=\"'dateIsAfter'\">{{'ERROR.FIELD_NOT_VALID_DATE_AFTER' | translate: formControl.errors.dateIsAfter }}</span>\n <span *ngSwitchCase=\"'dateIsBefore'\">{{'ERROR.FIELD_NOT_VALID_DATE_BEFORE' | translate: formControl.errors.dateIsBefore }}</span>\n <span *ngSwitchCase=\"'dateRange'\" translate>ERROR.FIELD_NOT_VALID_DATE_RANGE</span>\n <span *ngSwitchCase=\"'dateMaxDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MAX_DURATION</span>\n <span *ngSwitchCase=\"'dateMinDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MIN_DURATION</span>\n <span *ngSwitchCase=\"'msg'\">{{(formControl.errors.msg?.key || formControl.errors.msg) | translate: formControl.errors.msg?.params}}</span>\n </mat-error>\n <ng-content select=\"mat-error\"></ng-content>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n\n <!-- mat hint -->\n <div class=\"mat-form-field-hint-wrapper\" [class.cdk-visually-hidden]=\"formControl.invalid\">\n <div class=\"mat-form-field-hint-spacer\"></div>\n <ng-content select=\"mat-hint\"></ng-content>\n </div>\n </mat-form-field>\n\n</ng-template>\n\n<ng-template #matPrefixTemplate>\n <ng-content select=\"[matPrefix]\"></ng-content>\n</ng-template>\n\n<ng-template #matSuffixTemplate>\n <ng-content select=\"[matSuffix]\"></ng-content>\n</ng-template>\n", styles: [":host{display:inline-block;width:100%;position:relative}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}mat-form-field input[readonly]{-webkit-user-select:none!important;user-select:none!important}mat-form-field .datetime-md{padding:0!important}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i1.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: i1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i1.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "directive", type: i1$3.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$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i6$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i6$1.MatSuffix, selector: "[matSuffix]" }, { 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: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i9.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i10.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i10.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i10.MatDatepickerActions, selector: "mat-datepicker-actions, mat-date-range-picker-actions" }, { kind: "directive", type: i10.MatDatepickerCancel, selector: "[matDatepickerCancel], [matDateRangePickerCancel]" }, { kind: "directive", type: i10.MatDatepickerApply, selector: "[matDatepickerApply], [matDateRangePickerApply]" }, { kind: "directive", type: i11.MaskedInputDirective, selector: "[textMask]", inputs: ["textMask"], exportAs: ["textMask"] }, { kind: "directive", type: i1$2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "directive", type: AutofocusDirective, selector: "[autofocus], input[appAutofocus]", inputs: ["appAutofocus", "autofocusDelay"] }, { kind: "pipe", type: DateFormatPipe, name: "dateFormat" }, { kind: "pipe", type: ArrayFirstPipe, name: "arrayFirst" }, { kind: "pipe", type: MapKeysPipe, name: "mapKeys" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7152
7138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatDateShort, decorators: [{
|
|
7153
7139
|
type: Component,
|
|
7154
7140
|
args: [{ selector: 'mat-date-short-field', providers: [
|
|
7155
7141
|
DEFAULT_VALUE_ACCESSOR$3,
|
|
7156
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly; else writable\"\n [floatLabel]=\"floatLabel\"\n [appearance]=\"appearance\"\n class=\"mat-form-field-disabled\">\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput hidden type=\"text\"\n readonly\n [placeholder]=\"placeholder\"\n [formControl]=\"formControl\">\n <ion-text>{{formControl.value|dateFormat: {pattern: datePattern} }}</ion-text>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n</mat-form-field>\n\n<!-- writable -->\n<ng-template #writable>\n\n <mat-form-field [floatLabel]=\"floatLabel\"\n [appearance]=\"appearance\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <!-- Desktop -->\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n class=\"mat-input-element\"\n *ngIf=\"!mobile\"\n [formControl]=\"textControl\"\n [textMask]=\"{mask: mask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_YEAR_PLACEHOLDER'|translate\"\n (blur)=\"_checkIfTouched()\"\n (keyup.arrowDown)=\"openDatePicker()\"\n (keyup.escape)=\"_preventEvent($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n [appAutofocus]=\"autofocus\">\n <input type=\"text\" [formControl]=\"formControl\" hidden\n *ngIf=\"!mobile\"\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"_onDatePickerChange($event)\"\n readonly>\n\n <!-- Mobile -->\n <input #matInput autocomplete=\"off\" type=\"text\"\n class=\"mat-input-element\"\n *ngIf=\"mobile\"\n [formControl]=\"textControl\"\n (focus)=\"_openDatePickerIfMobile($event)\"\n (click)=\"_openDatePickerIfMobile($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n <input matInput type=\"text\" [formControl]=\"formControl\" hidden\n *ngIf=\"mobile\"\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"_onDatePickerChange($event)\"\n readonly>\n\n <button matSuffix type=\"button\" mat-icon-button tabindex=\"-1\"\n (click)=\"openDatePicker()\"\n [disabled]=\"disabled\">\n <mat-icon>{{mobile?'date_range':'keyboard_arrow_down'}}</mat-icon>\n </button>\n\n <mat-datepicker #datePicker\n startView=\"multi-year\"\n [touchUi]=\"mobile\"\n [disabled]=\"disabled\"\n (yearSelected)=\"_closeDatePicker($event)\"\n [startAt]=\"startDate\">\n <!-- Date picker buttons -->\n <mat-datepicker-actions *ngIf=\"mobile\">\n <ion-button fill=\"clear\" color=\"dark\" matDatepickerCancel>\n <ion-label translate>COMMON.BTN_CANCEL</ion-label>\n </ion-button>\n <ion-button fill=\"solid\" color=\"tertiary\" matDatepickerApply>\n <ion-label translate>COMMON.BTN_VALIDATE</ion-label>\n </ion-button>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"clear()\"\n [hidden]=\"disabled || !formControl.value\">\n <mat-icon>close</mat-icon>\n </button>\n\n <!-- errors -->\n <mat-error *ngIf=\"formControl.touched && formControl.errors|mapKeys|arrayFirst; let errorKey\" [ngSwitch]=\"errorKey\">\n <span *ngSwitchCase=\"'required'\" translate>ERROR.FIELD_REQUIRED</span>\n <span *ngSwitchCase=\"'validDate'\" translate>ERROR.FIELD_NOT_VALID_DATE</span>\n <span *ngSwitchCase=\"'dateIsAfter'\">{{'ERROR.FIELD_NOT_VALID_DATE_AFTER' | translate: formControl.errors.dateIsAfter }}</span>\n <span *ngSwitchCase=\"'dateIsBefore'\">{{'ERROR.FIELD_NOT_VALID_DATE_BEFORE' | translate: formControl.errors.dateIsBefore }}</span>\n <span *ngSwitchCase=\"'dateRange'\" translate>ERROR.FIELD_NOT_VALID_DATE_RANGE</span>\n <span *ngSwitchCase=\"'dateMaxDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MAX_DURATION</span>\n <span *ngSwitchCase=\"'dateMinDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MIN_DURATION</span>\n <span *ngSwitchCase=\"'msg'\">{{(formControl.errors.msg?.key || formControl.errors.msg) | translate: formControl.errors.msg?.params}}</span>\n </mat-error>\n <ng-content select=\"mat-error\"></ng-content>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n\n <!-- mat hint -->\n <div class=\"mat-form-field-hint-wrapper\" [class.cdk-visually-hidden]=\"formControl.invalid\">\n <div class=\"mat-form-field-hint-spacer\"></div>\n <ng-content select=\"mat-hint\"></ng-content>\n </div>\n </mat-form-field>\n\n</ng-template>\n\n<ng-template #matPrefixTemplate>\n <ng-content select=\"[matPrefix]\"></ng-content>\n</ng-template>\n\n<ng-template #matSuffixTemplate>\n <ng-content select=\"[matSuffix]\"></ng-content>\n</ng-template>\n", styles: [":host{display:inline-block;width:100%;position:relative}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}mat-form-field input[readonly]{-webkit-user-select:none!important;user-select:none!important}mat-form-field .datetime-md{padding:0!important}\n"] }]
|
|
7142
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly; else writable\"\n [floatLabel]=\"floatLabel\"\n [appearance]=\"appearance\"\n class=\"mat-form-field-disabled\">\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput hidden type=\"text\"\n readonly\n [placeholder]=\"placeholder\"\n [formControl]=\"formControl\">\n <ion-text>{{formControl.value|dateFormat: {pattern: datePattern} }}</ion-text>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n</mat-form-field>\n\n<!-- writable -->\n<ng-template #writable>\n\n <mat-form-field [floatLabel]=\"floatLabel\"\n [appearance]=\"appearance\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <!-- Desktop -->\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n class=\"mat-input-element\"\n *ngIf=\"!mobile\"\n [formControl]=\"textControl\"\n [textMask]=\"{mask: mask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_YEAR_PLACEHOLDER'|translate\"\n (blur)=\"_checkIfTouched()\"\n (keyup.arrowDown)=\"openDatePicker()\"\n (keyup.escape)=\"_preventEvent($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n [appAutofocus]=\"autofocus\">\n <input type=\"text\" [formControl]=\"formControl\" hidden\n *ngIf=\"!mobile\"\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"_onDatePickerChange($event)\"\n readonly>\n\n <!-- Mobile -->\n <input #matInput autocomplete=\"off\" type=\"text\"\n class=\"mat-input-element\"\n *ngIf=\"mobile\"\n [formControl]=\"textControl\"\n (focus)=\"_openDatePickerIfMobile($event)\"\n (click)=\"_openDatePickerIfMobile($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n <input matInput type=\"text\" [formControl]=\"formControl\" hidden\n *ngIf=\"mobile\"\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"_onDatePickerChange($event)\"\n readonly>\n\n <button matSuffix type=\"button\" mat-icon-button tabindex=\"-1\"\n (click)=\"openDatePicker()\"\n [disabled]=\"disabled\">\n <mat-icon>{{mobile?'date_range':'keyboard_arrow_down'}}</mat-icon>\n </button>\n\n <mat-datepicker #datePicker\n startView=\"multi-year\"\n [touchUi]=\"mobile\"\n [disabled]=\"disabled\"\n (yearSelected)=\"_closeDatePicker($event)\"\n panelClass=\"mat-date-short-panel\"\n [startAt]=\"startDate\">\n <!-- Date picker buttons -->\n <mat-datepicker-actions *ngIf=\"mobile\">\n <ion-button fill=\"clear\" color=\"dark\" matDatepickerCancel>\n <ion-label translate>COMMON.BTN_CANCEL</ion-label>\n </ion-button>\n <ion-button fill=\"solid\" color=\"tertiary\" matDatepickerApply>\n <ion-label translate>COMMON.BTN_VALIDATE</ion-label>\n </ion-button>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"clear()\"\n [hidden]=\"disabled || !formControl.value\">\n <mat-icon>close</mat-icon>\n </button>\n\n <!-- errors -->\n <mat-error *ngIf=\"formControl.touched && formControl.errors|mapKeys|arrayFirst; let errorKey\" [ngSwitch]=\"errorKey\">\n <span *ngSwitchCase=\"'required'\" translate>ERROR.FIELD_REQUIRED</span>\n <span *ngSwitchCase=\"'validDate'\" translate>ERROR.FIELD_NOT_VALID_DATE</span>\n <span *ngSwitchCase=\"'dateIsAfter'\">{{'ERROR.FIELD_NOT_VALID_DATE_AFTER' | translate: formControl.errors.dateIsAfter }}</span>\n <span *ngSwitchCase=\"'dateIsBefore'\">{{'ERROR.FIELD_NOT_VALID_DATE_BEFORE' | translate: formControl.errors.dateIsBefore }}</span>\n <span *ngSwitchCase=\"'dateRange'\" translate>ERROR.FIELD_NOT_VALID_DATE_RANGE</span>\n <span *ngSwitchCase=\"'dateMaxDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MAX_DURATION</span>\n <span *ngSwitchCase=\"'dateMinDuration'\" translate>ERROR.FIELD_NOT_VALID_DATE_MIN_DURATION</span>\n <span *ngSwitchCase=\"'msg'\">{{(formControl.errors.msg?.key || formControl.errors.msg) | translate: formControl.errors.msg?.params}}</span>\n </mat-error>\n <ng-content select=\"mat-error\"></ng-content>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n\n <!-- mat hint -->\n <div class=\"mat-form-field-hint-wrapper\" [class.cdk-visually-hidden]=\"formControl.invalid\">\n <div class=\"mat-form-field-hint-spacer\"></div>\n <ng-content select=\"mat-hint\"></ng-content>\n </div>\n </mat-form-field>\n\n</ng-template>\n\n<ng-template #matPrefixTemplate>\n <ng-content select=\"[matPrefix]\"></ng-content>\n</ng-template>\n\n<ng-template #matSuffixTemplate>\n <ng-content select=\"[matSuffix]\"></ng-content>\n</ng-template>\n", styles: [":host{display:inline-block;width:100%;position:relative}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}mat-form-field input[readonly]{-webkit-user-select:none!important;user-select:none!important}mat-form-field .datetime-md{padding:0!important}\n"] }]
|
|
7157
7143
|
}], ctorParameters: function () {
|
|
7158
7144
|
return [{ type: i1$1.MomentDateAdapter }, { type: i1$2.TranslateService }, { type: i1$3.UntypedFormBuilder }, { type: i0.ChangeDetectorRef }, { type: i1$3.FormGroupDirective, decorators: [{
|
|
7159
7145
|
type: Optional
|
|
@@ -19519,7 +19505,8 @@ class SharedModule {
|
|
|
19519
19505
|
return {
|
|
19520
19506
|
ngModule: SharedModule,
|
|
19521
19507
|
providers: [
|
|
19522
|
-
|
|
19508
|
+
// Define environment token if provided. Can be defined elsewhere (see Quadrige)
|
|
19509
|
+
...(!!environment ? [{ provide: ENVIRONMENT, useValue: environment }] : []),
|
|
19523
19510
|
// { provide: StorageService, useClass: StorageService, deps: [ENVIRONMENT]},
|
|
19524
19511
|
{ provide: APP_STORAGE, useExisting: StorageService },
|
|
19525
19512
|
StorageService,
|