@sumaris-net/ngx-components 1.20.8 → 1.20.11
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 +61 -37
- 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 +3 -0
- package/esm2015/public_api.js +2 -1
- package/esm2015/src/app/core/graphql/graphql.service.js +2 -2
- package/esm2015/src/app/core/services/errors.js +1 -1
- package/esm2015/src/app/core/services/model/referential.model.js +1 -1
- package/esm2015/src/app/shared/file/file.utils.js +25 -1
- package/esm2015/src/app/shared/form/field.model.js +1 -1
- package/esm2015/src/app/shared/help/help.modal.js +14 -7
- package/esm2015/src/app/shared/material/latlong/material.latlong.js +23 -27
- package/fesm2015/sumaris-net.ngx-components.js +60 -31
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/src/app/core/services/config/core.config.d.ts +25 -25
- package/src/app/core/services/errors.d.ts +1 -1
- package/src/app/core/services/model/referential.model.d.ts +1 -0
- package/src/app/shared/file/file.utils.d.ts +2 -0
- package/src/app/shared/form/field.model.d.ts +3 -3
- package/src/app/shared/help/help.modal.d.ts +4 -3
- package/src/app/shared/material/latlong/material.latlong.d.ts +3 -5
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -5366,16 +5366,15 @@
|
|
|
5366
5366
|
};
|
|
5367
5367
|
var ɵ0$2 = noop$1;
|
|
5368
5368
|
var MatLatLongField = /** @class */ (function () {
|
|
5369
|
-
function MatLatLongField(
|
|
5370
|
-
this.translate = translate;
|
|
5369
|
+
function MatLatLongField(formBuilder, cd, formGroupDir) {
|
|
5371
5370
|
this.formBuilder = formBuilder;
|
|
5372
5371
|
this.cd = cd;
|
|
5373
5372
|
this.formGroupDir = formGroupDir;
|
|
5374
5373
|
this._onChangeCallback = noop$1;
|
|
5375
5374
|
this._onTouchedCallback = noop$1;
|
|
5376
5375
|
this._subscription = new rxjs.Subscription();
|
|
5377
|
-
this.
|
|
5378
|
-
this.
|
|
5376
|
+
this._disabling = false;
|
|
5377
|
+
this._writing = false;
|
|
5379
5378
|
this._readonly = false;
|
|
5380
5379
|
this.required = false;
|
|
5381
5380
|
this.floatLabel = 'auto';
|
|
@@ -5457,7 +5456,7 @@
|
|
|
5457
5456
|
.subscribe(function (_) { return _this.onFormChange(_this.textFormControl.value); }));
|
|
5458
5457
|
// Listen status changes (when done outside the component - e.g. when setErrors() is calling on the formControl)
|
|
5459
5458
|
this._subscription.add(this.formControl.statusChanges
|
|
5460
|
-
.pipe(operators.filter(function (_) { return !_this.readonly && !_this.
|
|
5459
|
+
.pipe(operators.filter(function (_) { return !_this.readonly && !_this._writing && !_this._disabling; }) // Skip
|
|
5461
5460
|
)
|
|
5462
5461
|
.subscribe(function (_) { return _this.markForCheck(); }));
|
|
5463
5462
|
};
|
|
@@ -5465,12 +5464,12 @@
|
|
|
5465
5464
|
this._subscription.unsubscribe();
|
|
5466
5465
|
};
|
|
5467
5466
|
MatLatLongField.prototype.writeValue = function (obj) {
|
|
5468
|
-
if (this.
|
|
5467
|
+
if (this._writing)
|
|
5469
5468
|
return;
|
|
5470
|
-
|
|
5471
|
-
this.
|
|
5469
|
+
var value = (typeof obj === 'string') ? parseFloat(obj.replace(/,/g, '.')) : obj;
|
|
5470
|
+
this._writing = true;
|
|
5472
5471
|
var strValue = this._formatFn(this.value, Object.assign(Object.assign({}, this._formatOptions), { placeholderChar: this.placeholderChar }));
|
|
5473
|
-
var sign = isNotNil(this.value) ? (
|
|
5472
|
+
var sign = isNotNil(this.value) ? (value < 0 ? -1 : 1) :
|
|
5474
5473
|
// Use default sign, if any
|
|
5475
5474
|
(this.defaultSign ? (this.defaultSign === '-' ? -1 : 1) : null);
|
|
5476
5475
|
// DEBUG
|
|
@@ -5478,7 +5477,7 @@
|
|
|
5478
5477
|
// console.debug("sign: " + sign)
|
|
5479
5478
|
this.textFormControl.patchValue(strValue, { emitEvent: false });
|
|
5480
5479
|
this.signFormControl.patchValue(sign, { emitEvent: false });
|
|
5481
|
-
this.
|
|
5480
|
+
this._writing = false;
|
|
5482
5481
|
this.markForCheck();
|
|
5483
5482
|
};
|
|
5484
5483
|
MatLatLongField.prototype.registerOnChange = function (fn) {
|
|
@@ -5488,9 +5487,9 @@
|
|
|
5488
5487
|
this._onTouchedCallback = fn;
|
|
5489
5488
|
};
|
|
5490
5489
|
MatLatLongField.prototype.setDisabledState = function (isDisabled) {
|
|
5491
|
-
if (this.
|
|
5490
|
+
if (this._disabling)
|
|
5492
5491
|
return;
|
|
5493
|
-
this.
|
|
5492
|
+
this._disabling = true;
|
|
5494
5493
|
if (isDisabled) {
|
|
5495
5494
|
this.textFormControl.disable({ onlySelf: true, emitEvent: false });
|
|
5496
5495
|
this.signFormControl.disable({ onlySelf: true, emitEvent: false });
|
|
@@ -5499,7 +5498,7 @@
|
|
|
5499
5498
|
this.textFormControl.enable({ onlySelf: true, emitEvent: false });
|
|
5500
5499
|
this.signFormControl.enable({ onlySelf: true, emitEvent: false });
|
|
5501
5500
|
}
|
|
5502
|
-
this.
|
|
5501
|
+
this._disabling = false;
|
|
5503
5502
|
this.markForCheck();
|
|
5504
5503
|
};
|
|
5505
5504
|
/**
|
|
@@ -5621,13 +5620,13 @@
|
|
|
5621
5620
|
}
|
|
5622
5621
|
};
|
|
5623
5622
|
MatLatLongField.prototype.onFormChange = function (strValue) {
|
|
5624
|
-
if (this.
|
|
5623
|
+
if (this._writing)
|
|
5625
5624
|
return; // Skip if call by self
|
|
5626
|
-
this.
|
|
5625
|
+
this._writing = true;
|
|
5627
5626
|
if (this.textFormControl.invalid || this.signFormControl.invalid) {
|
|
5628
5627
|
this.formControl.markAsPending();
|
|
5629
5628
|
this.formControl.setErrors(Object.assign(Object.assign(Object.assign({}, this.formControl.errors), this.textFormControl.errors), this.signFormControl.errors));
|
|
5630
|
-
this.
|
|
5629
|
+
this._writing = false;
|
|
5631
5630
|
return;
|
|
5632
5631
|
}
|
|
5633
5632
|
var parsedValue = isNotNilOrBlank(strValue) ? parseLatitudeOrLongitude(strValue, this.pattern, 7 /*=precision of the converted double value */, this.placeholderChar) : null;
|
|
@@ -5636,15 +5635,15 @@
|
|
|
5636
5635
|
if (isNaN(parsedValue)) {
|
|
5637
5636
|
this.formControl.markAsPending();
|
|
5638
5637
|
this.formControl.setErrors(this.type === 'latitude' ? { latitude: true } : { longitude: true });
|
|
5639
|
-
this.
|
|
5638
|
+
this._writing = false;
|
|
5640
5639
|
return;
|
|
5641
5640
|
}
|
|
5642
5641
|
var sign = (this.pattern === 'DD') ? 1 /*ignore sign*/ : (this.signFormControl.value || 1);
|
|
5643
|
-
|
|
5642
|
+
var value = isNotNil(parsedValue) ? sign * parsedValue : null;
|
|
5644
5643
|
// Get the model value
|
|
5645
|
-
//console.debug("[mat-latlon] Setting value {" +
|
|
5646
|
-
this.formControl.patchValue(
|
|
5647
|
-
this.
|
|
5644
|
+
//console.debug("[mat-latlon] Setting value {" + value + "} parsed from {" + strValue + "}");
|
|
5645
|
+
this.formControl.patchValue(value, { emitEvent: false });
|
|
5646
|
+
this._writing = false;
|
|
5648
5647
|
this.markForCheck();
|
|
5649
5648
|
this._onChangeCallback(this.value);
|
|
5650
5649
|
};
|
|
@@ -5664,7 +5663,7 @@
|
|
|
5664
5663
|
MatLatLongField.decorators = [
|
|
5665
5664
|
{ type: i0.Component, args: [{
|
|
5666
5665
|
selector: 'mat-latlong-field',
|
|
5667
|
-
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>{{_format(value) }}</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 <ion-grid class=\"ion-no-padding\">\n <ion-row class=\"ion-no-padding no-wrap\">\n <ion-col class=\"text ion-no-padding\">\n <mat-form-field [floatLabel]=\"floatLabel\"\n [class.mat-form-field-disabled]=\"formControl.disabled\"\n [class.mat-form-field-invalid]=\"formControl.touched && formControl.invalid\">\n\n <mat-label *ngIf=\"placeholder\">{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput #inputElement\n type=\"text\"\n autocomplete=\"off\"\n [textMask]=\"textMaskConfig\"\n [formControl]=\"textFormControl\"\n [placeholder]=\"inputPlaceholder|translate\"\n (keypress)=\"onKeypress($event)\"\n (keydown.tab)=\"moveCaretToSeparator($event, true)\"\n (keydown.shift.tab)=\"moveCaretToSeparator($event, false)\"\n (focus)=\"_onFocus($event)\"\n (blur)=\"_onBlur($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\">\n\n <div matSuffix *ngIf=\"!showSignControl\">\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n\n <div class=\"mat-form-field-subscript mat-form-field-subscript-wrapper\">\n\n <!-- errors -->\n <ng-container *ngIf=\"formControl.touched && formControl.errors|mapKeys|arrayFirst; let errorKey\" [ngSwitch]=\"errorKey\">\n <mat-error *ngSwitchCase=\"'required'\" translate>ERROR.FIELD_REQUIRED</mat-error>\n <mat-error *ngSwitchCase=\"'latitude'\" translate>ERROR.FIELD_NOT_VALID_LATITUDE</mat-error>\n <mat-error *ngSwitchCase=\"'longitude'\" translate>ERROR.FIELD_NOT_VALID_LONGITUDE</mat-error>\n <mat-error *ngSwitchCase=\"'min'\">{{'ERROR.FIELD_MIN_COMPACT'|translate: {min: _format(formControl.errors.min.min) } }}</mat-error>\n <mat-error *ngSwitchCase=\"'max'\">{{'ERROR.FIELD_MAX_COMPACT'|translate: {max: _format(formControl.errors.max.max) } }}</mat-error>\n <mat-error *ngSwitchCase=\"'msg'\">{{(formControl.errors.msg?.key || formControl.errors.msg) | translate: formControl.errors.msg?.params}}</mat-error>\n </ng-container>\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 </div>\n </mat-form-field>\n </ion-col>\n\n <!-- sign -->\n <ion-col class=\"sign ion-no-padding\" [ngSwitch]=\"type\" *ngIf=\"showSignControl\">\n\n <!-- sign on latitude -->\n <mat-form-field *ngSwitchCase=\"'latitude'\"\n floatLabel=\"never\"\n [class.mat-form-field-invalid]=\"formControl.touched && signFormControl.invalid\">\n <mat-label *ngIf=\"placeholder && floatLabel != 'never'\" translate>COMMON.LAT_LONG.LAT_SIGN_PLACEHOLDER</mat-label>\n <mat-select [formControl]=\"signFormControl\"\n [tabindex]=\"tabindex+1\">\n <mat-option [value]=\"1\">{{'COMMON.LAT_LONG.LAT_SIGN_N'|translate}}</mat-option>\n <mat-option [value]=\"-1\" >{{'COMMON.LAT_LONG.LAT_SIGN_S'|translate}}</mat-option>\n </mat-select>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n </mat-form-field>\n\n <!-- sign on longitude -->\n <mat-form-field floatLabel=\"never\"\n *ngSwitchCase=\"'longitude'\"\n [class.mat-form-field-invalid]=\"formControl.touched && signFormControl.invalid\">\n <mat-label *ngIf=\"placeholder && floatLabel != 'never'\" translate>COMMON.LAT_LONG.LONG_SIGN_PLACEHOLDER</mat-label>\n <mat-select [formControl]=\"signFormControl\"\n [tabindex]=\"tabindex+2\">\n <mat-option [value]=\"1\" translate>{{'COMMON.LAT_LONG.LONG_SIGN_E'|translate}}</mat-option>\n <mat-option [value]=\"-1\" translate>{{'COMMON.LAT_LONG.LONG_SIGN_W'|translate}}</mat-option>\n </mat-select>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n </mat-form-field>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n</ng-template>\n\n<ng-template #matPrefixTemplate>\n <ng-content select=\"[matPrefix]\"></ng-content>\n</ng-template>\n\n\n<ng-template #matSuffixTemplate>\n <ng-content select=\"[matSuffix]\"></ng-content>\n</ng-template>\n",
|
|
5666
|
+
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>{{_format(formControl.value) }}</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 <ion-grid class=\"ion-no-padding\">\n <ion-row class=\"ion-no-padding no-wrap\">\n <ion-col class=\"text ion-no-padding\">\n <mat-form-field [floatLabel]=\"floatLabel\"\n [class.mat-form-field-disabled]=\"formControl.disabled\"\n [class.mat-form-field-invalid]=\"formControl.touched && formControl.invalid\">\n\n <mat-label *ngIf=\"placeholder\">{{placeholder}}</mat-label>\n\n <div matPrefix>\n <ng-container *ngTemplateOutlet=\"matPrefixTemplate\"></ng-container>\n </div>\n\n <input matInput #inputElement\n type=\"text\"\n autocomplete=\"off\"\n [textMask]=\"textMaskConfig\"\n [formControl]=\"textFormControl\"\n [placeholder]=\"inputPlaceholder|translate\"\n (keypress)=\"onKeypress($event)\"\n (keydown.tab)=\"moveCaretToSeparator($event, true)\"\n (keydown.shift.tab)=\"moveCaretToSeparator($event, false)\"\n (focus)=\"_onFocus($event)\"\n (blur)=\"_onBlur($event)\"\n [required]=\"required\"\n [tabindex]=\"tabindex\">\n\n <div matSuffix *ngIf=\"!showSignControl\">\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n\n <div class=\"mat-form-field-subscript mat-form-field-subscript-wrapper\">\n\n <!-- errors -->\n <ng-container *ngIf=\"formControl.touched && formControl.errors|mapKeys|arrayFirst; let errorKey\" [ngSwitch]=\"errorKey\">\n <mat-error *ngSwitchCase=\"'required'\" translate>ERROR.FIELD_REQUIRED</mat-error>\n <mat-error *ngSwitchCase=\"'latitude'\" translate>ERROR.FIELD_NOT_VALID_LATITUDE</mat-error>\n <mat-error *ngSwitchCase=\"'longitude'\" translate>ERROR.FIELD_NOT_VALID_LONGITUDE</mat-error>\n <mat-error *ngSwitchCase=\"'min'\">{{'ERROR.FIELD_MIN_COMPACT'|translate: {min: _format(formControl.errors.min.min) } }}</mat-error>\n <mat-error *ngSwitchCase=\"'max'\">{{'ERROR.FIELD_MAX_COMPACT'|translate: {max: _format(formControl.errors.max.max) } }}</mat-error>\n <mat-error *ngSwitchCase=\"'msg'\">{{(formControl.errors.msg?.key || formControl.errors.msg) | translate: formControl.errors.msg?.params}}</mat-error>\n </ng-container>\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 </div>\n </mat-form-field>\n </ion-col>\n\n <!-- sign -->\n <ion-col class=\"sign ion-no-padding\" [ngSwitch]=\"type\" *ngIf=\"showSignControl\">\n\n <!-- sign on latitude -->\n <mat-form-field *ngSwitchCase=\"'latitude'\"\n floatLabel=\"never\"\n [class.mat-form-field-invalid]=\"formControl.touched && signFormControl.invalid\">\n <mat-label *ngIf=\"placeholder && floatLabel != 'never'\" translate>COMMON.LAT_LONG.LAT_SIGN_PLACEHOLDER</mat-label>\n <mat-select [formControl]=\"signFormControl\"\n [tabindex]=\"tabindex+1\">\n <mat-option [value]=\"1\">{{'COMMON.LAT_LONG.LAT_SIGN_N'|translate}}</mat-option>\n <mat-option [value]=\"-1\" >{{'COMMON.LAT_LONG.LAT_SIGN_S'|translate}}</mat-option>\n </mat-select>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n </mat-form-field>\n\n <!-- sign on longitude -->\n <mat-form-field floatLabel=\"never\"\n *ngSwitchCase=\"'longitude'\"\n [class.mat-form-field-invalid]=\"formControl.touched && signFormControl.invalid\">\n <mat-label *ngIf=\"placeholder && floatLabel != 'never'\" translate>COMMON.LAT_LONG.LONG_SIGN_PLACEHOLDER</mat-label>\n <mat-select [formControl]=\"signFormControl\"\n [tabindex]=\"tabindex+2\">\n <mat-option [value]=\"1\" translate>{{'COMMON.LAT_LONG.LONG_SIGN_E'|translate}}</mat-option>\n <mat-option [value]=\"-1\" translate>{{'COMMON.LAT_LONG.LONG_SIGN_W'|translate}}</mat-option>\n </mat-select>\n\n <div matSuffix>\n <ng-container *ngTemplateOutlet=\"matSuffixTemplate\"></ng-container>\n </div>\n </mat-form-field>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n</ng-template>\n\n<ng-template #matPrefixTemplate>\n <ng-content select=\"[matPrefix]\"></ng-content>\n</ng-template>\n\n\n<ng-template #matSuffixTemplate>\n <ng-content select=\"[matSuffix]\"></ng-content>\n</ng-template>\n",
|
|
5668
5667
|
providers: [
|
|
5669
5668
|
{
|
|
5670
5669
|
provide: i1.NG_VALUE_ACCESSOR,
|
|
@@ -5672,12 +5671,10 @@
|
|
|
5672
5671
|
useExisting: i0.forwardRef(function () { return MatLatLongField; }),
|
|
5673
5672
|
}
|
|
5674
5673
|
],
|
|
5675
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
5676
|
-
styles: [":host{display:inline-block;width:100%;min-width:140px;position:relative;--ion-grid-column-padding:0}mat-form-field .datetime-md{padding:0!important}ion-row{flex-wrap:nowrap}ion-row ion-col.text{min-width:80px}ion-row ion-col.sign{min-width:40px;max-width:55px}mat-form-field{width:100%}mat-form-field .mat-form-field-subscript-wrapper{overflow:visible;white-space:nowrap;top:100%}mat-form-field .mat-form-field-subscript-wrapper .mat-form-field-hint-wrapper{display:flex}mat-form-field .mat-form-field-subscript-wrapper .mat-form-field-hint-wrapper .mat-form-field-hint-spacer{flex:1 0 1em}mat-error{text-align:right;width:100%}"]
|
|
5674
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
5677
5675
|
},] }
|
|
5678
5676
|
];
|
|
5679
5677
|
MatLatLongField.ctorParameters = function () { return [
|
|
5680
|
-
{ type: i1$2.TranslateService },
|
|
5681
5678
|
{ type: i1.FormBuilder },
|
|
5682
5679
|
{ type: i0.ChangeDetectorRef },
|
|
5683
5680
|
{ type: i1.FormGroupDirective, decorators: [{ type: i0.Optional }] }
|
|
@@ -15674,7 +15671,7 @@
|
|
|
15674
15671
|
if (!peer)
|
|
15675
15672
|
throw Error('[graphql] Missing peer. Unable to start graphql service');
|
|
15676
15673
|
uri = peer.url + '/graphql';
|
|
15677
|
-
wsUri =
|
|
15674
|
+
wsUri = uri.replace(/^http(s)?:/, 'ws$1:') + '/websocket';
|
|
15678
15675
|
console.info('[graphql] Base uri: ' + uri);
|
|
15679
15676
|
console.info('[graphql] Subscription uri: ' + wsUri);
|
|
15680
15677
|
this.httpParams = this.httpParams || {};
|
|
@@ -18382,6 +18379,30 @@
|
|
|
18382
18379
|
}
|
|
18383
18380
|
}
|
|
18384
18381
|
};
|
|
18382
|
+
FilesUtils.downloadUri = function (uri, filename) {
|
|
18383
|
+
if (navigator.msLaunchUri) { // IE 10+
|
|
18384
|
+
navigator.msLaunchUri(uri);
|
|
18385
|
+
}
|
|
18386
|
+
else {
|
|
18387
|
+
filename = filename || this.getFilenameFromUri(uri);
|
|
18388
|
+
var link = document.createElement('a');
|
|
18389
|
+
if (link.download !== undefined) {
|
|
18390
|
+
// Browsers that support HTML5 download attribute
|
|
18391
|
+
link.setAttribute('href', uri);
|
|
18392
|
+
link.setAttribute('download', filename);
|
|
18393
|
+
link.style.visibility = 'hidden';
|
|
18394
|
+
document.body.appendChild(link);
|
|
18395
|
+
link.click();
|
|
18396
|
+
document.body.removeChild(link);
|
|
18397
|
+
}
|
|
18398
|
+
}
|
|
18399
|
+
};
|
|
18400
|
+
FilesUtils.getFilenameFromUri = function (uri) {
|
|
18401
|
+
var lastSlashIndex = uri === null || uri === void 0 ? void 0 : uri.lastIndexOf('/');
|
|
18402
|
+
if (lastSlashIndex === -1 || lastSlashIndex === uri.length - 1)
|
|
18403
|
+
throw new Error('Invalid URI format. No slash found');
|
|
18404
|
+
return uri.substring(lastSlashIndex + 1);
|
|
18405
|
+
};
|
|
18385
18406
|
return FilesUtils;
|
|
18386
18407
|
}());
|
|
18387
18408
|
FilesUtils.UTF8_BOM_CHAR = new Uint8Array([0xEF, 0xBB, 0xBF]); // UTF-8 BOM
|
|
@@ -19011,33 +19032,34 @@
|
|
|
19011
19032
|
// TODO: for DEV only
|
|
19012
19033
|
//this.debug = !environment.production;
|
|
19013
19034
|
}
|
|
19035
|
+
AppHelpModal.prototype.ngOnInit = function () {
|
|
19036
|
+
// Fix docUrl
|
|
19037
|
+
if (this.docUrl && !this.docUrl.endsWith('.md')) {
|
|
19038
|
+
console.warn('[help-modal] Missing extension \'.md\' will be add to the url: ' + this.docUrl);
|
|
19039
|
+
this.docUrl += '.md';
|
|
19040
|
+
}
|
|
19041
|
+
};
|
|
19014
19042
|
AppHelpModal.prototype.close = function (event) {
|
|
19015
|
-
return
|
|
19016
|
-
return __generator(this, function (_a) {
|
|
19017
|
-
switch (_a.label) {
|
|
19018
|
-
case 0: return [4 /*yield*/, this.viewCtrl.dismiss()];
|
|
19019
|
-
case 1:
|
|
19020
|
-
_a.sent();
|
|
19021
|
-
return [2 /*return*/];
|
|
19022
|
-
}
|
|
19023
|
-
});
|
|
19024
|
-
});
|
|
19043
|
+
return this.viewCtrl.dismiss();
|
|
19025
19044
|
};
|
|
19026
19045
|
AppHelpModal.prototype.markAsLoaded = function () {
|
|
19027
19046
|
this.loading = false;
|
|
19028
19047
|
this.error = null;
|
|
19048
|
+
this.cd.markForCheck();
|
|
19029
19049
|
};
|
|
19030
19050
|
AppHelpModal.prototype.onLoadError = function (error) {
|
|
19031
19051
|
console.error(error);
|
|
19032
19052
|
this.error = error;
|
|
19033
19053
|
this.loading = false;
|
|
19054
|
+
this.cd.markForCheck();
|
|
19034
19055
|
};
|
|
19035
19056
|
return AppHelpModal;
|
|
19036
19057
|
}());
|
|
19037
19058
|
AppHelpModal.decorators = [
|
|
19038
19059
|
{ type: i0.Component, args: [{
|
|
19039
19060
|
selector: 'app-help-modal',
|
|
19040
|
-
template: "<app-modal-toolbar color=\"light\"\n [title]=\"title\"\n (cancel)=\"close($event)\"\n [showSpinner]=\"loading\">\n</app-modal-toolbar>\n\n<ion-content class=\"ion-padding\">\n\n <!-- error -->\n <ion-item *ngIf=\"error && showError\" 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]=\"error|translate\"></ion-label>\n </ion-item>\n\n <markdown *ngIf=\"markdownContent\"\n [data]=\"markdownContent\"\n (ready)=\"markAsLoaded()\"\n emoji>\n </markdown>\n\n <markdown *ngIf=\"docUrl\"\n
|
|
19061
|
+
template: "<app-modal-toolbar color=\"light\"\n [title]=\"title|translate\"\n (cancel)=\"close($event)\"\n [showSpinner]=\"loading\">\n</app-modal-toolbar>\n\n<ion-content class=\"ion-padding\">\n\n <!-- error -->\n <ion-item *ngIf=\"error && showError\" 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]=\"error|translate\"></ion-label>\n </ion-item>\n\n <markdown *ngIf=\"markdownContent; else useDocUrl\"\n [data]=\"markdownContent\"\n (ready)=\"markAsLoaded()\"\n emoji>\n </markdown>\n\n <ng-template #useDocUrl>\n <markdown *ngIf=\"docUrl\"\n [src]=\"docUrl + '.md'\"\n (load)=\"markAsLoaded()\"\n (error)=\"onLoadError($event)\"\n emoji></markdown>\n </ng-template>\n\n</ion-content>\n\n<ion-footer hidden-xs hidden-sm hidden-mobile>\n <ion-toolbar>\n <ion-row class=\"ion-no-padding\" nowrap>\n <ion-col></ion-col>\n <ion-col size=\"auto\">\n <ion-button fill=\"solid\" color=\"tertiary\" (click)=\"close()\">{{'COMMON.BTN_CLOSE'|translate}}</ion-button>\n </ion-col>\n </ion-row>\n </ion-toolbar>\n</ion-footer>\n\n\n",
|
|
19062
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
19041
19063
|
},] }
|
|
19042
19064
|
];
|
|
19043
19065
|
AppHelpModal.ctorParameters = function () { return [
|
|
@@ -32469,6 +32491,7 @@
|
|
|
32469
32491
|
exports.EntityStore = EntityStore;
|
|
32470
32492
|
exports.EntityUtils = EntityUtils;
|
|
32471
32493
|
exports.Environment = Environment;
|
|
32494
|
+
exports.ErrorCodes = ErrorCodes;
|
|
32472
32495
|
exports.EvenPipe = EvenPipe;
|
|
32473
32496
|
exports.FileResponse = FileResponse;
|
|
32474
32497
|
exports.FileService = FileService;
|
|
@@ -32575,6 +32598,7 @@
|
|
|
32575
32598
|
exports.SHARED_TESTING_PAGES = SHARED_TESTING_PAGES;
|
|
32576
32599
|
exports.SPACE_PLACEHOLDER_CHAR = SPACE_PLACEHOLDER_CHAR;
|
|
32577
32600
|
exports.SelectPeerModal = SelectPeerModal;
|
|
32601
|
+
exports.ServerErrorCodes = ServerErrorCodes;
|
|
32578
32602
|
exports.SettingsPage = SettingsPage;
|
|
32579
32603
|
exports.SharedAsyncValidators = SharedAsyncValidators;
|
|
32580
32604
|
exports.SharedDirectivesModule = SharedDirectivesModule;
|