@sumaris-net/ngx-components 1.20.20 → 1.20.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/sumaris-net.ngx-components.umd.js +26 -18
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +9 -0
- package/esm2015/src/app/core/form/entity-editor-modal.class.js +9 -4
- package/esm2015/src/app/core/install/install-upgrade-card.component.js +1 -2
- package/esm2015/src/app/core/table/entities-table-datasource.class.js +7 -5
- package/esm2015/src/app/core/table/table.class.js +4 -4
- package/esm2015/src/app/shared/material/datetime/material.date.js +2 -2
- package/esm2015/src/app/shared/material/datetime/material.dateshort.js +2 -2
- package/esm2015/src/app/shared/material/latlong/material.latlong.js +9 -7
- package/fesm2015/sumaris-net.ngx-components.js +26 -18
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/table/table.class.d.ts +1 -1
- package/src/app/shared/material/latlong/material.latlong.d.ts +0 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -5476,8 +5476,8 @@
|
|
|
5476
5476
|
return;
|
|
5477
5477
|
var value = (typeof obj === 'string') ? parseFloat(obj.replace(/,/g, '.')) : obj;
|
|
5478
5478
|
this._writing = true;
|
|
5479
|
-
var strValue = this._formatFn(
|
|
5480
|
-
var sign = isNotNil(
|
|
5479
|
+
var strValue = this._formatFn(value, Object.assign(Object.assign({}, this._formatOptions), { placeholderChar: this.placeholderChar }));
|
|
5480
|
+
var sign = isNotNil(value) ? (value < 0 ? -1 : 1) :
|
|
5481
5481
|
// Use default sign, if any
|
|
5482
5482
|
(this.defaultSign ? (this.defaultSign === '-' ? -1 : 1) : null);
|
|
5483
5483
|
// DEBUG
|
|
@@ -5520,7 +5520,8 @@
|
|
|
5520
5520
|
MatLatLongField.prototype._onFocus = function (event) {
|
|
5521
5521
|
var _this = this;
|
|
5522
5522
|
// Apply the default sign, when pattern is DD and field is empty
|
|
5523
|
-
|
|
5523
|
+
var value = this.formControl.value;
|
|
5524
|
+
if (isNilOrNaN(value)) {
|
|
5524
5525
|
if (this.defaultSign) {
|
|
5525
5526
|
// Compute the text value, using the default sign
|
|
5526
5527
|
var defaultSign = this.defaultSign === '-' ? -1 : 1;
|
|
@@ -5550,8 +5551,9 @@
|
|
|
5550
5551
|
return true;
|
|
5551
5552
|
};
|
|
5552
5553
|
MatLatLongField.prototype._onBlur = function (event) {
|
|
5554
|
+
var _a;
|
|
5553
5555
|
var touched = this.checkIfTouched();
|
|
5554
|
-
if (touched && isNil(this.value)) {
|
|
5556
|
+
if (touched && isNil((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value)) {
|
|
5555
5557
|
this.inputElement.nativeElement.value = '';
|
|
5556
5558
|
}
|
|
5557
5559
|
this.onBlur.emit(event);
|
|
@@ -5653,7 +5655,7 @@
|
|
|
5653
5655
|
this.formControl.patchValue(value, { emitEvent: false });
|
|
5654
5656
|
this._writing = false;
|
|
5655
5657
|
this.markForCheck();
|
|
5656
|
-
this._onChangeCallback(
|
|
5658
|
+
this._onChangeCallback(value);
|
|
5657
5659
|
};
|
|
5658
5660
|
MatLatLongField.prototype.checkIfTouched = function () {
|
|
5659
5661
|
if (this.formControl.touched || this.textFormControl.touched) {
|
|
@@ -6091,7 +6093,7 @@
|
|
|
6091
6093
|
MatDate.decorators = [
|
|
6092
6094
|
{ type: i0.Component, args: [{
|
|
6093
6095
|
selector: 'mat-date-field',
|
|
6094
|
-
template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly; else writable\"\n [floatLabel]=\"floatLabel\"\n class=\"mat-form-field-disabled\">\n\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</mat-form-field>\n\n<!-- writable -->\n<ng-template #writable>\n <mat-form-field [floatLabel]=\"floatLabel\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"!mobile\"\n [formControl]=\"textControl\"\n [textMask]=\"{mask: mask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_PLACEHOLDER'|translate\"\n (blur)=\"checkIfTouched()\"\n (keyup.arrowdown)=\"openDatePicker($event, datePicker)\"\n (keyup.escape)=\"preventEvent($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n [appAutofocus]=\"autofocus\">\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"mobile\"\n [formControl]=\"textControl\"\n (click)=\"openDatePickerIfMobile($event, datePicker)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n\n <!-- Hide the final input -->\n <input matInput type=\"text\" [formControl]=\"formControl\"\n hidden\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"onDatePickerChange($event)\">\n\n <button type=\"button\" mat-icon-button tabindex=\"-1\" matSuffix\n (click)=\"openDatePicker($event, datePicker)\"\n [disabled]=\"formControl.disabled\">\n <div *ngIf=\"mobile; then iconDate; else iconDesktop\"></div>\n </button>\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"clear()\"\n [hidden]=\"formControl.disabled || !formControl.value\">\n <mat-icon>close</mat-icon>\n </button>\n\n <!-- errors -->\n <
|
|
6096
|
+
template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly; else writable\"\n [floatLabel]=\"floatLabel\"\n class=\"mat-form-field-disabled\">\n\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</mat-form-field>\n\n<!-- writable -->\n<ng-template #writable>\n <mat-form-field [floatLabel]=\"floatLabel\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"!mobile\"\n [formControl]=\"textControl\"\n [textMask]=\"{mask: mask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_PLACEHOLDER'|translate\"\n (blur)=\"checkIfTouched()\"\n (keyup.arrowdown)=\"openDatePicker($event, datePicker)\"\n (keyup.escape)=\"preventEvent($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n [appAutofocus]=\"autofocus\">\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"mobile\"\n [formControl]=\"textControl\"\n (click)=\"openDatePickerIfMobile($event, datePicker)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n\n <!-- Hide the final input -->\n <input matInput type=\"text\" [formControl]=\"formControl\"\n hidden\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"datePickerFilter\"\n (dateChange)=\"onDatePickerChange($event)\">\n\n <button type=\"button\" mat-icon-button tabindex=\"-1\" matSuffix\n (click)=\"openDatePicker($event, datePicker)\"\n [disabled]=\"formControl.disabled\">\n <div *ngIf=\"mobile; then iconDate; else iconDesktop\"></div>\n </button>\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"clear()\"\n [hidden]=\"formControl.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 <!-- 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 <mat-datepicker #datePicker\n [touchUi]=\"mobile\"\n [disabled]=\"formControl.disabled\"\n [startAt]=\"startDate\"\n ></mat-datepicker>\n\n\n\n</ng-template>\n\n<ng-template #iconDesktop>\n <mat-icon>keyboard_arrow_down</mat-icon>\n</ng-template>\n\n<ng-template #iconDate>\n <mat-icon>date_range</mat-icon>\n</ng-template>\n\n<ng-template #matPrefixTemplate>\n <ng-content select=\"[matPrefix]\"></ng-content>\n</ng-template>\n",
|
|
6095
6097
|
providers: [
|
|
6096
6098
|
DEFAULT_VALUE_ACCESSOR,
|
|
6097
6099
|
],
|
|
@@ -6840,7 +6842,7 @@
|
|
|
6840
6842
|
MatDateShort.decorators = [
|
|
6841
6843
|
{ type: i0.Component, args: [{
|
|
6842
6844
|
selector: 'mat-date-short-field',
|
|
6843
|
-
template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly else writable\">\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput hidden type=\"text\" readonly=\"true\" [formControl]=\"formControl\">\n <ion-text>{{formControl.value|dateFormat: {pattern: displayPattern} }}</ion-text>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n</mat-form-field>\n\n<ng-template #writable>\n <mat-form-field [floatLabel]=\"floatLabel\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix><ng-content select=\"[matPrefix]\"></ng-content></div>\n\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"!mobile\"\n [formControl]=\"dayControl\"\n [textMask]=\"{mask: dayMask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_YEAR_PLACEHOLDER'|translate\"\n (blur)=\"checkIfTouched()\"\n (keyup.arrowdown)=\"openDatePicker($event, datePicker1)\"\n (keyup.escape)=\"preventEvent($event)\"\n (click)=\"matInput.select()\"\n [required]=\"required\"\n [tabindex]=\"tabindex\">\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"mobile\"\n [formControl]=\"dayControl\"\n (click)=\"openDatePickerIfMobile($event, datePicker1)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n\n <!-- Hide the final control -->\n <input matInput type=\"text\"\n [formControl]=\"formControl\"\n hidden\n [matDatepicker]=\"datePicker1\"\n (dateChange)=\"onDatePickerChange($event)\">\n\n\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n (click)=\"openDatePicker($event, datePicker1)\"\n [disabled]=\"formControl.disabled\">\n <div *ngIf=\"mobile; then iconDate; else iconDesktop\"></div>\n </button>\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"writeValue(null)\"\n [hidden]=\"formControl.disabled || !formControl.value\">\n <mat-icon>close</mat-icon>\n </button>\n\n
|
|
6845
|
+
template: "<!-- readonly -->\n<mat-form-field *ngIf=\"readonly else writable\">\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput hidden type=\"text\" readonly=\"true\" [formControl]=\"formControl\">\n <ion-text>{{formControl.value|dateFormat: {pattern: displayPattern} }}</ion-text>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n</mat-form-field>\n\n<ng-template #writable>\n <mat-form-field [floatLabel]=\"floatLabel\">\n\n <mat-label>{{placeholder}}</mat-label>\n\n <div matPrefix><ng-content select=\"[matPrefix]\"></ng-content></div>\n\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"!mobile\"\n [formControl]=\"dayControl\"\n [textMask]=\"{mask: dayMask, keepCharPositions: true, placeholderChar: placeholderChar}\"\n [placeholder]=\"'COMMON.DATE_YEAR_PLACEHOLDER'|translate\"\n (blur)=\"checkIfTouched()\"\n (keyup.arrowdown)=\"openDatePicker($event, datePicker1)\"\n (keyup.escape)=\"preventEvent($event)\"\n (click)=\"matInput.select()\"\n [required]=\"required\"\n [tabindex]=\"tabindex\">\n <input matInput #matInput autocomplete=\"off\" type=\"text\"\n *ngIf=\"mobile\"\n [formControl]=\"dayControl\"\n (click)=\"openDatePickerIfMobile($event, datePicker1)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\"\n readonly>\n\n <!-- Hide the final control -->\n <input matInput type=\"text\"\n [formControl]=\"formControl\"\n hidden\n [matDatepicker]=\"datePicker1\"\n (dateChange)=\"onDatePickerChange($event)\">\n\n\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n (click)=\"openDatePicker($event, datePicker1)\"\n [disabled]=\"formControl.disabled\">\n <div *ngIf=\"mobile; then iconDate; else iconDesktop\"></div>\n </button>\n <button matSuffix mat-icon-button tabindex=\"-1\"\n type=\"button\"\n *ngIf=\"clearable\"\n (click)=\"writeValue(null)\"\n [hidden]=\"formControl.disabled || !formControl.value\">\n <mat-icon>close</mat-icon>\n </button>\n\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=\"'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 </mat-form-field>\n\n <mat-datepicker #datePicker1\n startView=\"multi-year\"\n [touchUi]=\"mobile\"\n [disabled]=\"formControl.disabled\"\n (yearSelected)=\"closeDatePicker($event, datePicker1)\"\n [startAt]=\"startDate\"></mat-datepicker>\n\n <ng-template #iconDesktop>\n <mat-icon>keyboard_arrow_down</mat-icon>\n </ng-template>\n\n <ng-template #iconDate>\n <mat-icon>date_range</mat-icon>\n </ng-template>\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",
|
|
6844
6846
|
providers: [
|
|
6845
6847
|
DEFAULT_VALUE_ACCESSOR$2,
|
|
6846
6848
|
],
|
|
@@ -23866,7 +23868,6 @@
|
|
|
23866
23868
|
};
|
|
23867
23869
|
AppInstallUpgradeCard.prototype.ngOnDestroy = function () {
|
|
23868
23870
|
this._subscription.unsubscribe();
|
|
23869
|
-
this._subscription = null;
|
|
23870
23871
|
this.installLinks = null;
|
|
23871
23872
|
this.upgradeLinks = null;
|
|
23872
23873
|
};
|
|
@@ -25645,9 +25646,7 @@
|
|
|
25645
25646
|
this._fetchMoreFn = null;
|
|
25646
25647
|
this.markAsLoading();
|
|
25647
25648
|
return this.dataService.watchAll(offset, size, sortBy, sortDirection, filter, this.serviceOptions)
|
|
25648
|
-
.pipe(
|
|
25649
|
-
// Stop this pipe next time we call watchAll()
|
|
25650
|
-
operators.takeUntil(this._stopWatching$), operators.catchError(function (err) { return _this.handleError(err, 'ERROR.LOAD_DATA_ERROR'); }), operators.map(function (res) {
|
|
25649
|
+
.pipe(operators.catchError(function (err) { return _this.handleError(err, 'ERROR.LOAD_DATA_ERROR'); }), operators.map(function (res) {
|
|
25651
25650
|
if (_this._saving) {
|
|
25652
25651
|
console.info("[table-datasource] Received " + _this._logTypeName + " data (from service), but still saving: skip");
|
|
25653
25652
|
}
|
|
@@ -25659,7 +25658,11 @@
|
|
|
25659
25658
|
_this._fetchMoreFn = res.fetchMore;
|
|
25660
25659
|
}
|
|
25661
25660
|
return res;
|
|
25662
|
-
})
|
|
25661
|
+
}),
|
|
25662
|
+
// Stop this pipe next time we call watchAll()
|
|
25663
|
+
operators.takeUntil(this._stopWatching$)
|
|
25664
|
+
// ⚠ Notice: Don't put any operator after takeUntil to avoid potential subscription leaks
|
|
25665
|
+
);
|
|
25663
25666
|
};
|
|
25664
25667
|
EntitiesTableDataSource.prototype.save = function () {
|
|
25665
25668
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -26183,9 +26186,9 @@
|
|
|
26183
26186
|
return !this._enabled;
|
|
26184
26187
|
},
|
|
26185
26188
|
// FIXME: need to hidden buttons (in HTML), etc. when disabled
|
|
26186
|
-
set: function (
|
|
26187
|
-
if (
|
|
26188
|
-
if (
|
|
26189
|
+
set: function (value) {
|
|
26190
|
+
if (value !== !this._enabled) {
|
|
26191
|
+
if (value)
|
|
26189
26192
|
this.disable({ emitEvent: false });
|
|
26190
26193
|
else
|
|
26191
26194
|
this.enable({ emitEvent: false });
|
|
@@ -29545,8 +29548,12 @@
|
|
|
29545
29548
|
// Disable
|
|
29546
29549
|
if (this.disabled)
|
|
29547
29550
|
this.disable();
|
|
29548
|
-
|
|
29549
|
-
|
|
29551
|
+
if (this.isNewData) {
|
|
29552
|
+
// Update the title.
|
|
29553
|
+
this.updateTitle();
|
|
29554
|
+
}
|
|
29555
|
+
else {
|
|
29556
|
+
// Update title each time value changes
|
|
29550
29557
|
this.registerSubscription(this.form.valueChanges
|
|
29551
29558
|
.pipe(operators.debounceTime(250))
|
|
29552
29559
|
.subscribe(function (json) { return _this.updateTitle(json); }));
|
|
@@ -29595,11 +29602,12 @@
|
|
|
29595
29602
|
return [3 /*break*/, 5];
|
|
29596
29603
|
case 3:
|
|
29597
29604
|
err_1 = _b.sent();
|
|
29605
|
+
if (err_1 === 'CANCELLED')
|
|
29606
|
+
return [2 /*return*/];
|
|
29598
29607
|
this.setError(err_1);
|
|
29599
29608
|
this.selectedTabIndex = 0;
|
|
29600
29609
|
return [3 /*break*/, 5];
|
|
29601
29610
|
case 4:
|
|
29602
|
-
this.markAsPristine();
|
|
29603
29611
|
this.markAsLoaded();
|
|
29604
29612
|
return [7 /*endfinally*/];
|
|
29605
29613
|
case 5: return [2 /*return*/];
|