@sumaris-net/ngx-components 2.7.0-rc6 → 2.7.0-rc7
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/shared/material/datetime/material.date.mjs +36 -30
- package/esm2022/src/app/shared/material/datetime/material.dateshort.mjs +35 -29
- package/esm2022/src/app/shared/material/datetime/material.datetime.mjs +65 -55
- package/esm2022/src/app/shared/pipes/maskito.pipe.mjs +1 -1
- package/fesm2022/sumaris-net.ngx-components.mjs +130 -108
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/inputs.d.ts +1 -1
- package/src/app/shared/material/datetime/material.date.d.ts +1 -1
- package/src/app/shared/material/datetime/material.dateshort.d.ts +1 -1
- package/src/app/shared/material/datetime/material.datetime.d.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
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
3
|
import { shareReplay, tap, of, firstValueFrom, Subject, merge, isObservable, from, timer, Subscription, BehaviorSubject, fromEvent, noop as noop$9, Observable, forkJoin, defer, timeout, fromEventPattern, interval, combineLatest, mergeMap as mergeMap$1, EMPTY, delay, iif } from 'rxjs';
|
|
4
|
-
import { catchError, map, first, tap as tap$1, switchMap, takeUntil, filter, mergeMap, debounceTime, startWith, distinctUntilChanged,
|
|
4
|
+
import { catchError, map, first, tap as tap$1, switchMap, takeUntil, filter, mergeMap, debounceTime, startWith, distinctUntilChanged, 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';
|
|
7
7
|
import * as i2$3 from '@angular/common';
|
|
@@ -8337,10 +8337,13 @@ class MatDate {
|
|
|
8337
8337
|
() => this.formControl.errors);
|
|
8338
8338
|
// Get patterns to display date
|
|
8339
8339
|
this.updatePattern(this.translate.instant('COMMON.DATE_PATTERN'));
|
|
8340
|
-
this.
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8340
|
+
this.updateMaskOptions(this.translate.instant('COMMON.DATE_PLACEHOLDER'));
|
|
8341
|
+
this._subscription.add(this.translate.get(['COMMON.DATE_PATTERN', 'COMMON.DATE_PLACEHOLDER'])
|
|
8342
|
+
.pipe(skip(1))
|
|
8343
|
+
.subscribe((translate) => {
|
|
8344
|
+
this.updatePattern(translate['COMMON.DATE_PATTERN']);
|
|
8345
|
+
this.updateMaskOptions(translate['COMMON.DATE_PLACEHOLDER']);
|
|
8346
|
+
}));
|
|
8344
8347
|
this._subscription.add(this.textControl.valueChanges
|
|
8345
8348
|
.subscribe((value) => this.onFormChange(value)));
|
|
8346
8349
|
// Listen status changes (when done outside the component - e.g. when setErrors() is calling on the formControl)
|
|
@@ -8561,30 +8564,33 @@ class MatDate {
|
|
|
8561
8564
|
markForCheck() {
|
|
8562
8565
|
this.cd.markForCheck();
|
|
8563
8566
|
}
|
|
8564
|
-
|
|
8565
|
-
this.datePlaceholder
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8567
|
+
updateMaskOptions(datePlaceholder) {
|
|
8568
|
+
if (this.datePlaceholder != datePlaceholder) {
|
|
8569
|
+
this.datePlaceholder = datePlaceholder;
|
|
8570
|
+
const dateOptions = maskitoDateOptionsGenerator({
|
|
8571
|
+
mode: this.datePattern.toLowerCase(),
|
|
8572
|
+
separator: '/',
|
|
8573
|
+
});
|
|
8574
|
+
const { plugins, // plugins keeps caret inside actual value and remove placeholder on blur
|
|
8575
|
+
...placeholderOptions
|
|
8576
|
+
// pass 'true' as second argument to add plugin to hide placeholder when input is not focused
|
|
8577
|
+
} = maskitoWithPlaceholder(this.datePlaceholder, true);
|
|
8578
|
+
this.maskitoOptions = {
|
|
8579
|
+
...dateOptions,
|
|
8580
|
+
plugins: plugins.concat(dateOptions.plugins || []),
|
|
8581
|
+
preprocessors: [
|
|
8582
|
+
// Always put it BEFORE all other preprocessors
|
|
8583
|
+
...placeholderOptions.preprocessors,
|
|
8584
|
+
...dateOptions.preprocessors,
|
|
8585
|
+
],
|
|
8586
|
+
postprocessors: [
|
|
8587
|
+
...dateOptions.postprocessors,
|
|
8588
|
+
// Always put it AFTER all other postprocessors
|
|
8589
|
+
...placeholderOptions.postprocessors,
|
|
8590
|
+
],
|
|
8591
|
+
};
|
|
8592
|
+
this.markForCheck();
|
|
8593
|
+
}
|
|
8588
8594
|
}
|
|
8589
8595
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MatDate, deps: [{ token: i1.MomentDateAdapter }, { token: i1$1.TranslateService }, { token: i1$2.UntypedFormBuilder }, { token: i0.ChangeDetectorRef }, { token: i1$2.FormGroupDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
8590
8596
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: MatDate, selector: "mat-date-field", inputs: { mobile: "mobile", formControl: "formControl", formControlName: "formControlName", placeholder: "placeholder", floatLabel: "floatLabel", appearance: "appearance", required: "required", compact: "compact", autofocus: "autofocus", startDate: "startDate", clearable: "clearable", timezone: "timezone", datePickerFilter: "datePickerFilter", readonly: "readonly", tabindex: "tabindex" }, providers: [
|
|
@@ -8761,11 +8767,15 @@ class MatDateTime {
|
|
|
8761
8767
|
this.timeControl = this.formBuilder.control(null, this.mobile ? null : Validators.pattern(TIME_REGEXP));
|
|
8762
8768
|
// Get patterns to display date and date+time
|
|
8763
8769
|
this.updatePattern(this.translate.instant(['COMMON.DATE_PATTERN', 'COMMON.TIME_PATTERN', 'COMMON.DATE_TIME_PATTERN']));
|
|
8764
|
-
this.
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8770
|
+
this.updateDateMaskOptions(this.translate.instant('COMMON.DATE_PLACEHOLDER'));
|
|
8771
|
+
this.updateTimeMaskOptions(this.translate.instant('COMMON.TIME_PLACEHOLDER'));
|
|
8772
|
+
this._subscription.add(this.translate.get(['COMMON.DATE_PATTERN', 'COMMON.TIME_PATTERN', 'COMMON.DATE_TIME_PATTERN', 'COMMON.DATE_PLACEHOLDER', 'COMMON.TIME_PLACEHOLDER'])
|
|
8773
|
+
.pipe(skip(1))
|
|
8774
|
+
.subscribe((translate) => {
|
|
8775
|
+
this.updatePattern(translate);
|
|
8776
|
+
this.updateDateMaskOptions(translate['COMMON.DATE_PLACEHOLDER']);
|
|
8777
|
+
this.updateTimeMaskOptions(translate['COMMON.TIME_PLACEHOLDER']);
|
|
8778
|
+
}));
|
|
8769
8779
|
this._subscription.add(merge(this.dateControl.valueChanges, this.timeControl.valueChanges)
|
|
8770
8780
|
.subscribe((_) => this.onFormChange()));
|
|
8771
8781
|
this._writing = false;
|
|
@@ -9099,54 +9109,60 @@ class MatDateTime {
|
|
|
9099
9109
|
markForCheck() {
|
|
9100
9110
|
this.cd.markForCheck();
|
|
9101
9111
|
}
|
|
9102
|
-
|
|
9103
|
-
this.datePlaceholder
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9112
|
+
updateDateMaskOptions(datePlaceholder) {
|
|
9113
|
+
if (this.datePlaceholder !== datePlaceholder) {
|
|
9114
|
+
this.datePlaceholder = datePlaceholder;
|
|
9115
|
+
const dateOptions = maskitoDateOptionsGenerator({
|
|
9116
|
+
mode: this.datePattern.toLowerCase(),
|
|
9117
|
+
separator: '/',
|
|
9118
|
+
});
|
|
9119
|
+
const { plugins, // plugins keeps caret inside actual value and remove placeholder on blur
|
|
9120
|
+
...placeholderOptions
|
|
9121
|
+
// pass 'true' as second argument to add plugin to hide placeholder when input is not focused
|
|
9122
|
+
} = maskitoWithPlaceholder(this.datePlaceholder, true);
|
|
9123
|
+
this.maskitoDateOptions = {
|
|
9124
|
+
...dateOptions,
|
|
9125
|
+
plugins: plugins.concat(dateOptions.plugins || []),
|
|
9126
|
+
preprocessors: [
|
|
9127
|
+
// Always put it BEFORE all other preprocessors
|
|
9128
|
+
...placeholderOptions.preprocessors,
|
|
9129
|
+
...dateOptions.preprocessors,
|
|
9130
|
+
],
|
|
9131
|
+
postprocessors: [
|
|
9132
|
+
...dateOptions.postprocessors,
|
|
9133
|
+
// Always put it AFTER all other postprocessors
|
|
9134
|
+
...placeholderOptions.postprocessors,
|
|
9135
|
+
],
|
|
9136
|
+
};
|
|
9137
|
+
this.markForCheck();
|
|
9138
|
+
}
|
|
9126
9139
|
}
|
|
9127
|
-
|
|
9128
|
-
this.timePlaceholder
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9140
|
+
updateTimeMaskOptions(timePlaceholder) {
|
|
9141
|
+
if (this.timePlaceholder !== timePlaceholder) {
|
|
9142
|
+
this.timePlaceholder = timePlaceholder;
|
|
9143
|
+
const timeOptions = maskitoTimeOptionsGenerator({
|
|
9144
|
+
mode: this.timePattern.toUpperCase()
|
|
9145
|
+
});
|
|
9146
|
+
const { plugins, // plugins keeps caret inside actual value and remove placeholder on blur
|
|
9147
|
+
...placeholderOptions
|
|
9148
|
+
// pass 'true' as second argument to add plugin to hide placeholder when input is not focused
|
|
9149
|
+
} = maskitoWithPlaceholder(this.timePlaceholder, true);
|
|
9150
|
+
this.maskitoTimeOptions = {
|
|
9151
|
+
...timeOptions,
|
|
9152
|
+
plugins: plugins.concat(timeOptions.plugins || []),
|
|
9153
|
+
preprocessors: [
|
|
9154
|
+
// Always put it BEFORE all other preprocessors
|
|
9155
|
+
...placeholderOptions.preprocessors,
|
|
9156
|
+
...timeOptions.preprocessors,
|
|
9157
|
+
],
|
|
9158
|
+
postprocessors: [
|
|
9159
|
+
...timeOptions.postprocessors,
|
|
9160
|
+
// Always put it AFTER all other postprocessors
|
|
9161
|
+
...placeholderOptions.postprocessors,
|
|
9162
|
+
],
|
|
9163
|
+
};
|
|
9164
|
+
this.markForCheck();
|
|
9165
|
+
}
|
|
9150
9166
|
}
|
|
9151
9167
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MatDateTime, deps: [{ token: i1.MomentDateAdapter }, { token: i1$1.TranslateService }, { token: i1$2.UntypedFormBuilder }, { token: i0.ChangeDetectorRef }, { token: i1$2.FormGroupDirective, optional: true }, { token: MAT_FORM_FIELD_DEFAULT_OPTIONS }], target: i0.ɵɵFactoryTarget.Component });
|
|
9152
9168
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: MatDateTime, selector: "mat-date-time-field", inputs: { subscriptSizing: "subscriptSizing", formControl: "formControl", formControlName: "formControlName", required: "required", placeholder: "placeholder", floatLabel: "floatLabel", appearance: "appearance", mobile: "mobile", compact: "compact", autofocus: "autofocus", startDate: "startDate", clearable: "clearable", datePickerFilter: "datePickerFilter", readonly: "readonly", tabindex: "tabindex" }, providers: [
|
|
@@ -9296,10 +9312,13 @@ class MatDateShort {
|
|
|
9296
9312
|
() => this.formControl.errors);
|
|
9297
9313
|
// Get patterns to display date
|
|
9298
9314
|
this.updatePattern(this.translate.instant('COMMON.DATE_YEAR_PATTERN'));
|
|
9299
|
-
this.
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9315
|
+
this.updateMaskOptions(this.translate.instant('COMMON.DATE_YEAR_PLACEHOLDER'));
|
|
9316
|
+
this._subscription.add(this.translate.get(['COMMON.DATE_YEAR_PATTERN', 'COMMON.DATE_YEAR_PLACEHOLDER'])
|
|
9317
|
+
.pipe(skip(1))
|
|
9318
|
+
.subscribe((translate) => {
|
|
9319
|
+
this.updatePattern(translate['COMMON.DATE_YEAR_PATTERN']);
|
|
9320
|
+
this.updateMaskOptions(translate['COMMON.DATE_YEAR_PLACEHOLDER']);
|
|
9321
|
+
}));
|
|
9303
9322
|
this._subscription.add(this.textControl.valueChanges
|
|
9304
9323
|
.subscribe((value) => this.onFormChange(value)));
|
|
9305
9324
|
// Listen status changes (when done outside the component - e.g. when setErrors() is calling on the formControl)
|
|
@@ -9530,29 +9549,32 @@ class MatDateShort {
|
|
|
9530
9549
|
markForCheck() {
|
|
9531
9550
|
this.cd.markForCheck();
|
|
9532
9551
|
}
|
|
9533
|
-
|
|
9534
|
-
this.yearPlaceholder
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9552
|
+
updateMaskOptions(yearPlaceholder) {
|
|
9553
|
+
if (this.yearPlaceholder !== yearPlaceholder) {
|
|
9554
|
+
this.yearPlaceholder = yearPlaceholder;
|
|
9555
|
+
const dateOptions = maskitoDateOptionsGenerator({
|
|
9556
|
+
mode: this.datePattern.toLowerCase(),
|
|
9557
|
+
});
|
|
9558
|
+
const { plugins, // plugins keeps caret inside actual value and remove placeholder on blur
|
|
9559
|
+
...placeholderOptions
|
|
9560
|
+
// pass 'true' as second argument to add plugin to hide placeholder when input is not focused
|
|
9561
|
+
} = maskitoWithPlaceholder(this.yearPlaceholder, true);
|
|
9562
|
+
this.maskitoOptions = {
|
|
9563
|
+
...dateOptions,
|
|
9564
|
+
plugins: plugins.concat(dateOptions.plugins || []),
|
|
9565
|
+
preprocessors: [
|
|
9566
|
+
// Always put it BEFORE all other preprocessors
|
|
9567
|
+
...placeholderOptions.preprocessors,
|
|
9568
|
+
...dateOptions.preprocessors,
|
|
9569
|
+
],
|
|
9570
|
+
postprocessors: [
|
|
9571
|
+
...dateOptions.postprocessors,
|
|
9572
|
+
// Always put it AFTER all other postprocessors
|
|
9573
|
+
...placeholderOptions.postprocessors,
|
|
9574
|
+
],
|
|
9575
|
+
};
|
|
9576
|
+
this.markForCheck();
|
|
9577
|
+
}
|
|
9556
9578
|
}
|
|
9557
9579
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MatDateShort, deps: [{ token: i1.MomentDateAdapter }, { token: i1$1.TranslateService }, { token: i1$2.UntypedFormBuilder }, { token: i0.ChangeDetectorRef }, { token: i1$2.FormGroupDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
9558
9580
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: MatDateShort, selector: "mat-date-short-field", inputs: { mobile: "mobile", formControl: "formControl", formControlName: "formControlName", placeholder: "placeholder", floatLabel: "floatLabel", appearance: "appearance", required: "required", compact: "compact", autofocus: "autofocus", startDate: "startDate", clearable: "clearable", datePickerFilter: "datePickerFilter", readonly: "readonly", tabindex: "tabindex" }, providers: [
|